OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet / deprecated / build-artifacts / bundle / hyper-wallet.bundle.js

2 lines · javascript ref:
module.exports = "284116\n{\"version\":0,\"id\":\"e4b1b46c19fda6de4770fd21b2699a00b1d7c3ec02c6be6ebb90f1882d3f7746\",\"main\":\"/cli.js\",\"imports\":{},\"resolutions\":{\"/cli.js\":{\"#package\":\"/package.json\",\"./cmd/balance.js\":\"/cmd/balance.js\",\"./cmd/init.js\":\"/cmd/init.js\",\"./cmd/whoami.js\":\"/cmd/whoami.js\",\"./lib/wallet-context.js\":\"/lib/wallet-context.js\",\"./protocols/index.js\":\"/protocols/index.js\"},\"/cmd/balance.js\":{\"#package\":\"/package.json\"},\"/cmd/init.js\":{\"#package\":\"/package.json\",\"../protocols/index.js\":\"/protocols/index.js\",\"bip39\":\"/node_modules/bip39/src/index.js\"},\"/cmd/whoami.js\":{\"#package\":\"/package.json\"},\"/lib/identity.js\":{\"#package\":\"/package.json\",\"keet-identity-key\":\"/node_modules/keet-identity-key/index.js\"},\"/lib/wallet-context.js\":{\"#os\":\"/node_modules/bare-os/index.js\",\"#package\":\"/package.json\",\"#path\":\"/node_modules/bare-path/index.js\",\"./identity.js\":\"/lib/identity.js\",\"autobase\":\"/node_modules/autobase/index.js\",\"corestore\":\"/node_modules/corestore/index.js\",\"hyperbee\":\"/node_modules/hyperbee/index.js\"},\"/node_modules/@adraffy/ens-normalize/dist/index.mjs\":{\"#package\":\"/node_modules/@adraffy/ens-normalize/package.json\"},\"/node_modules/@adraffy/ens-normalize/package.json\":{},\"/node_modules/@bitcoinerlab/coinselect/dist/algos/addUntilReach.js\":{\"#package\":\"/node_modules/@bitcoinerlab/coinselect/package.json\",\"../dust\":\"/node_modules/@bitcoinerlab/coinselect/dist/dust.js\",\"../index\":\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\",\"../validation\":\"/node_modules/@bitcoinerlab/coinselect/dist/validation.js\",\"../vsize\":\"/node_modules/@bitcoinerlab/coinselect/dist/vsize.js\"},\"/node_modules/@bitcoinerlab/coinselect/dist/algos/avoidChange.js\":{\"#package\":\"/node_modules/@bitcoinerlab/coinselect/package.json\",\"../dust\":\"/node_modules/@bitcoinerlab/coinselect/dist/dust.js\",\"../index\":\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\",\"../validation\":\"/node_modules/@bitcoinerlab/coinselect/dist/validation.js\",\"../vsize\":\"/node_modules/@bitcoinerlab/coinselect/dist/vsize.js\"},\"/node_modules/@bitcoinerlab/coinselect/dist/algos/maxFunds.js\":{\"#package\":\"/node_modules/@bitcoinerlab/coinselect/package.json\",\"../dust\":\"/node_modules/@bitcoinerlab/coinselect/dist/dust.js\",\"../index\":\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\",\"../validation\":\"/node_modules/@bitcoinerlab/coinselect/dist/validation.js\",\"../vsize\":\"/node_modules/@bitcoinerlab/coinselect/dist/vsize.js\"},\"/node_modules/@bitcoinerlab/coinselect/dist/coinselect.js\":{\"#package\":\"/node_modules/@bitcoinerlab/coinselect/package.json\",\"./algos/addUntilReach\":\"/node_modules/@bitcoinerlab/coinselect/dist/algos/addUntilReach.js\",\"./algos/avoidChange\":\"/node_modules/@bitcoinerlab/coinselect/dist/algos/avoidChange.js\",\"./index\":\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\",\"./validation\":\"/node_modules/@bitcoinerlab/coinselect/dist/validation.js\",\"./vsize\":\"/node_modules/@bitcoinerlab/coinselect/dist/vsize.js\"},\"/node_modules/@bitcoinerlab/coinselect/dist/dust.js\":{\"#package\":\"/node_modules/@bitcoinerlab/coinselect/package.json\",\"./index\":\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\"},\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\":{\"#package\":\"/node_modules/@bitcoinerlab/coinselect/package.json\",\"./algos/addUntilReach\":\"/node_modules/@bitcoinerlab/coinselect/dist/algos/addUntilReach.js\",\"./algos/avoidChange\":\"/node_modules/@bitcoinerlab/coinselect/dist/algos/avoidChange.js\",\"./algos/maxFunds\":\"/node_modules/@bitcoinerlab/coinselect/dist/algos/maxFunds.js\",\"./coinselect\":\"/node_modules/@bitcoinerlab/coinselect/dist/coinselect.js\",\"./dust\":\"/node_modules/@bitcoinerlab/coinselect/dist/dust.js\",\"./vsize\":\"/node_modules/@bitcoinerlab/coinselect/dist/vsize.js\"},\"/node_modules/@bitcoinerlab/coinselect/dist/validation.js\":{\"#package\":\"/node_modules/@bitcoinerlab/coinselect/package.json\",\"./dust\":\"/node_modules/@bitcoinerlab/coinselect/dist/dust.js\",\"./index\":\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\",\"./vsize\":\"/node_modules/@bitcoinerlab/coinselect/dist/vsize.js\"},\"/node_modules/@bitcoinerlab/coinselect/dist/vsize.js\":{\"#package\":\"/node_modules/@bitcoinerlab/coinselect/package.json\",\"varuint-bitcoin\":\"/node_modules/varuint-bitcoin/index.js\"},\"/node_modules/@bitcoinerlab/coinselect/package.json\":{},\"/node_modules/@bitcoinerlab/descriptors/dist/applyPR2137.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"bip174/src/lib/utils\":\"/node_modules/bip174/src/lib/utils.js\",\"bitcoinjs-lib/src/crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"bitcoinjs-lib/src/payments/bip341\":\"/node_modules/bitcoinjs-lib/src/payments/bip341.js\",\"bitcoinjs-lib/src/psbt/bip371\":\"/node_modules/bitcoinjs-lib/src/psbt/bip371.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/checksum.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\"},\"/node_modules/@bitcoinerlab/descriptors/dist/descriptors.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"./checksum\":\"/node_modules/@bitcoinerlab/descriptors/dist/checksum.js\",\"./keyExpressions\":\"/node_modules/@bitcoinerlab/descriptors/dist/keyExpressions.js\",\"./miniscript\":\"/node_modules/@bitcoinerlab/descriptors/dist/miniscript.js\",\"./psbt\":\"/node_modules/@bitcoinerlab/descriptors/dist/psbt.js\",\"./re\":\"/node_modules/@bitcoinerlab/descriptors/dist/re.js\",\"bip32\":\"/node_modules/bip32/src/index.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\",\"ecpair\":\"/node_modules/ecpair/src/index.js\",\"lodash.memoize\":\"/node_modules/lodash.memoize/index.js\",\"varuint-bitcoin\":\"/node_modules/varuint-bitcoin/index.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/index.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"./checksum\":\"/node_modules/@bitcoinerlab/descriptors/dist/checksum.js\",\"./descriptors\":\"/node_modules/@bitcoinerlab/descriptors/dist/descriptors.js\",\"./keyExpressions\":\"/node_modules/@bitcoinerlab/descriptors/dist/keyExpressions.js\",\"./ledger\":\"/node_modules/@bitcoinerlab/descriptors/dist/ledger.js\",\"./scriptExpressions\":\"/node_modules/@bitcoinerlab/descriptors/dist/scriptExpressions.js\",\"./signers\":\"/node_modules/@bitcoinerlab/descriptors/dist/signers.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/keyExpressions.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"./ledger\":\"/node_modules/@bitcoinerlab/descriptors/dist/ledger.js\",\"./re\":\"/node_modules/@bitcoinerlab/descriptors/dist/re.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/ledger.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"./descriptors\":\"/node_modules/@bitcoinerlab/descriptors/dist/descriptors.js\",\"./re\":\"/node_modules/@bitcoinerlab/descriptors/dist/re.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\",\"ledger-bitcoin\":\"/node_modules/ledger-bitcoin/build/main/index.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/miniscript.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"./keyExpressions\":\"/node_modules/@bitcoinerlab/descriptors/dist/keyExpressions.js\",\"./re\":\"/node_modules/@bitcoinerlab/descriptors/dist/re.js\",\"@bitcoinerlab/miniscript\":\"/node_modules/@bitcoinerlab/miniscript/dist/index.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/psbt.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\",\"varuint-bitcoin\":\"/node_modules/varuint-bitcoin/index.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/re.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"./checksum\":\"/node_modules/@bitcoinerlab/descriptors/dist/checksum.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/scriptExpressions.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"./keyExpressions\":\"/node_modules/@bitcoinerlab/descriptors/dist/keyExpressions.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\"},\"/node_modules/@bitcoinerlab/descriptors/dist/signers.js\":{\"#package\":\"/node_modules/@bitcoinerlab/descriptors/package.json\",\"./applyPR2137\":\"/node_modules/@bitcoinerlab/descriptors/dist/applyPR2137.js\",\"./ledger\":\"/node_modules/@bitcoinerlab/descriptors/dist/ledger.js\",\"bitcoinjs-lib/src/payments/bip341\":\"/node_modules/bitcoinjs-lib/src/payments/bip341.js\",\"bitcoinjs-lib/src/psbt/bip371\":\"/node_modules/bitcoinjs-lib/src/psbt/bip371.js\"},\"/node_modules/@bitcoinerlab/descriptors/package.json\":{},\"/node_modules/@bitcoinerlab/miniscript/dist/index.js\":{\"#package\":\"/node_modules/@bitcoinerlab/miniscript/package.json\",\"bip68\":\"/node_modules/bip68/index.js\"},\"/node_modules/@bitcoinerlab/miniscript/package.json\":{},\"/node_modules/@bitcoinerlab/secp256k1/dist/index.js\":{\"#package\":\"/node_modules/@bitcoinerlab/secp256k1/package.json\",\"@noble/curves/abstract/modular\":\"/node_modules/@noble/curves/abstract/modular.js\",\"@noble/curves/abstract/utils\":\"/node_modules/@noble/curves/abstract/utils.js\",\"@noble/curves/secp256k1\":\"/node_modules/@noble/curves/secp256k1.js\"},\"/node_modules/@bitcoinerlab/secp256k1/package.json\":{},\"/node_modules/@hyperswarm/secret-stream/index.js\":{\"#package\":\"/node_modules/@hyperswarm/secret-stream/package.json\",\"./lib/bridge\":\"/node_modules/@hyperswarm/secret-stream/lib/bridge.js\",\"./lib/handshake\":\"/node_modules/@hyperswarm/secret-stream/lib/handshake.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"sodium-secretstream\":\"/node_modules/sodium-secretstream/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\",\"streamx\":\"/node_modules/streamx/index.js\",\"timeout-refresh\":\"/node_modules/timeout-refresh/index.js\",\"unslab\":\"/node_modules/unslab/index.js\"},\"/node_modules/@hyperswarm/secret-stream/lib/bridge.js\":{\"#package\":\"/node_modules/@hyperswarm/secret-stream/package.json\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/@hyperswarm/secret-stream/lib/handshake.js\":{\"#package\":\"/node_modules/@hyperswarm/secret-stream/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"noise-curve-ed\":\"/node_modules/noise-curve-ed/index.js\",\"noise-handshake\":\"/node_modules/noise-handshake/noise.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/@hyperswarm/secret-stream/package.json\":{},\"/node_modules/@mempool/electrum-client/index.js\":{\"#package\":\"/node_modules/@mempool/electrum-client/package.json\",\"./lib/client\":\"/node_modules/@mempool/electrum-client/lib/client.js\"},\"/node_modules/@mempool/electrum-client/lib/TlsSocketWrapper.js\":{\"#package\":\"/node_modules/@mempool/electrum-client/package.json\"},\"/node_modules/@mempool/electrum-client/lib/client.js\":{\"#package\":\"/node_modules/@mempool/electrum-client/package.json\",\"./TlsSocketWrapper.js\":\"/node_modules/@mempool/electrum-client/lib/TlsSocketWrapper.js\",\"./util\":\"/node_modules/@mempool/electrum-client/lib/util.js\",\"events\":\"/node_modules/bare-events/index.js\",\"net\":\"/node_modules/bare-net/index.js\",\"tls\":\"/node_modules/bare-tls/index.js\"},\"/node_modules/@mempool/electrum-client/lib/util.js\":{\"#package\":\"/node_modules/@mempool/electrum-client/package.json\"},\"/node_modules/@mempool/electrum-client/package.json\":{},\"/node_modules/@noble/curves/_shortw_utils.js\":{\"#package\":\"/node_modules/@noble/curves/package.json\",\"./abstract/weierstrass.js\":\"/node_modules/@noble/curves/abstract/weierstrass.js\"},\"/node_modules/@noble/curves/abstract/curve.js\":{\"#package\":\"/node_modules/@noble/curves/package.json\",\"../utils.js\":\"/node_modules/@noble/curves/utils.js\",\"./modular.js\":\"/node_modules/@noble/curves/abstract/modular.js\"},\"/node_modules/@noble/curves/abstract/hash-to-curve.js\":{\"#package\":\"/node_modules/@noble/curves/package.json\",\"../utils.js\":\"/node_modules/@noble/curves/utils.js\",\"./modular.js\":\"/node_modules/@noble/curves/abstract/modular.js\"},\"/node_modules/@noble/curves/abstract/modular.js\":{\"#package\":\"/node_modules/@noble/curves/package.json\",\"../utils.js\":\"/node_modules/@noble/curves/utils.js\"},\"/node_modules/@noble/curves/abstract/utils.js\":{\"#package\":\"/node_modules/@noble/curves/package.json\",\"../utils.js\":\"/node_modules/@noble/curves/utils.js\"},\"/node_modules/@noble/curves/abstract/weierstrass.js\":{\"#package\":\"/node_modules/@noble/curves/package.json\",\"../utils.js\":\"/node_modules/@noble/curves/utils.js\",\"./curve.js\":\"/node_modules/@noble/curves/abstract/curve.js\",\"./modular.js\":\"/node_modules/@noble/curves/abstract/modular.js\",\"@noble/hashes/hmac.js\":\"/node_modules/@noble/hashes/hmac.js\",\"@noble/hashes/utils\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/@noble/curves/package.json\":{},\"/node_modules/@noble/curves/secp256k1.js\":{\"#package\":\"/node_modules/@noble/curves/package.json\",\"./_shortw_utils.js\":\"/node_modules/@noble/curves/_shortw_utils.js\",\"./abstract/hash-to-curve.js\":\"/node_modules/@noble/curves/abstract/hash-to-curve.js\",\"./abstract/modular.js\":\"/node_modules/@noble/curves/abstract/modular.js\",\"./abstract/weierstrass.js\":\"/node_modules/@noble/curves/abstract/weierstrass.js\",\"./utils.js\":\"/node_modules/@noble/curves/utils.js\",\"@noble/hashes/sha2.js\":\"/node_modules/@noble/hashes/sha2.js\",\"@noble/hashes/utils.js\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/@noble/curves/utils.js\":{\"#package\":\"/node_modules/@noble/curves/package.json\",\"@noble/hashes/utils.js\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/@noble/hashes/_md.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./utils.js\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/@noble/hashes/_u64.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\"},\"/node_modules/@noble/hashes/cryptoNode.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"node:crypto\":\"/node_modules/bare-crypto/index.js\"},\"/node_modules/@noble/hashes/esm/_md.js\":{\"#package\":\"/node_modules/@noble/hashes/esm/package.json\",\"./utils.js\":\"/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/@noble/hashes/esm/_u64.js\":{\"#package\":\"/node_modules/@noble/hashes/esm/package.json\"},\"/node_modules/@noble/hashes/esm/cryptoNode.js\":{\"#package\":\"/node_modules/@noble/hashes/esm/package.json\",\"node:crypto\":\"/node_modules/bare-crypto/index.js\"},\"/node_modules/@noble/hashes/esm/hmac.js\":{\"#package\":\"/node_modules/@noble/hashes/esm/package.json\",\"./utils.js\":\"/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/@noble/hashes/esm/package.json\":{},\"/node_modules/@noble/hashes/esm/sha2.js\":{\"#package\":\"/node_modules/@noble/hashes/esm/package.json\",\"./_md.js\":\"/node_modules/@noble/hashes/esm/_md.js\",\"./_u64.js\":\"/node_modules/@noble/hashes/esm/_u64.js\",\"./utils.js\":\"/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/@noble/hashes/esm/sha256.js\":{\"#package\":\"/node_modules/@noble/hashes/esm/package.json\",\"./sha2.js\":\"/node_modules/@noble/hashes/esm/sha2.js\"},\"/node_modules/@noble/hashes/esm/sha512.js\":{\"#package\":\"/node_modules/@noble/hashes/esm/package.json\",\"./sha2.js\":\"/node_modules/@noble/hashes/esm/sha2.js\"},\"/node_modules/@noble/hashes/esm/utils.js\":{\"#package\":\"/node_modules/@noble/hashes/esm/package.json\",\"@noble/hashes/crypto\":\"/node_modules/@noble/hashes/esm/cryptoNode.js\"},\"/node_modules/@noble/hashes/hmac.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./utils.js\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/@noble/hashes/legacy.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./_md.js\":\"/node_modules/@noble/hashes/_md.js\",\"./utils.js\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/@noble/hashes/package.json\":{},\"/node_modules/@noble/hashes/pbkdf2.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./hmac.js\":\"/node_modules/@noble/hashes/hmac.js\",\"./utils.js\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/@noble/hashes/ripemd160.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./legacy.js\":\"/node_modules/@noble/hashes/legacy.js\"},\"/node_modules/@noble/hashes/sha1.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./legacy.js\":\"/node_modules/@noble/hashes/legacy.js\"},\"/node_modules/@noble/hashes/sha2.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./_md.js\":\"/node_modules/@noble/hashes/_md.js\",\"./_u64.js\":\"/node_modules/@noble/hashes/_u64.js\",\"./utils.js\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/@noble/hashes/sha256.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./sha2.js\":\"/node_modules/@noble/hashes/sha2.js\"},\"/node_modules/@noble/hashes/sha512.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"./sha2.js\":\"/node_modules/@noble/hashes/sha2.js\"},\"/node_modules/@noble/hashes/utils.js\":{\"#package\":\"/node_modules/@noble/hashes/package.json\",\"@noble/hashes/crypto\":\"/node_modules/@noble/hashes/cryptoNode.js\"},\"/node_modules/@noble/secp256k1/index.js\":{\"#package\":\"/node_modules/@noble/secp256k1/package.json\"},\"/node_modules/@noble/secp256k1/package.json\":{},\"/node_modules/@scure/base/lib/index.js\":{\"#package\":\"/node_modules/@scure/base/package.json\"},\"/node_modules/@scure/base/package.json\":{},\"/node_modules/@tetherto/wdk-wallet-btc/index.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-btc/package.json\",\"./src/wallet-account-btc.js\":\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-account-btc.js\",\"./src/wallet-account-read-only-btc.js\":\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-account-read-only-btc.js\",\"./src/wallet-manager-btc.js\":\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-manager-btc.js\"},\"/node_modules/@tetherto/wdk-wallet-btc/package.json\":{},\"/node_modules/@tetherto/wdk-wallet-btc/src/electrum-client.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-btc/package.json\",\"@mempool/electrum-client\":\"/node_modules/@mempool/electrum-client/index.js\"},\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-account-btc.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-btc/package.json\",\"./wallet-account-read-only-btc.js\":\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-account-read-only-btc.js\",\"@bitcoinerlab/secp256k1\":\"/node_modules/@bitcoinerlab/secp256k1/dist/index.js\",\"@noble/hashes/hmac\":\"/node_modules/@noble/hashes/esm/hmac.js\",\"@noble/hashes/sha512\":\"/node_modules/@noble/hashes/esm/sha512.js\",\"bip32\":\"/node_modules/bip32/src/index.js\",\"bip39\":\"/node_modules/bip39/src/index.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\",\"bitcoinjs-message\":\"/node_modules/bitcoinjs-message/index.js\",\"lru-cache\":\"/node_modules/lru-cache/dist/esm/index.js\",\"p-limit\":\"/node_modules/p-limit/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-account-read-only-btc.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-btc/package.json\",\"./electrum-client.js\":\"/node_modules/@tetherto/wdk-wallet-btc/src/electrum-client.js\",\"@bitcoinerlab/coinselect\":\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\",\"@bitcoinerlab/descriptors\":\"/node_modules/@bitcoinerlab/descriptors/dist/index.js\",\"@bitcoinerlab/secp256k1\":\"/node_modules/@bitcoinerlab/secp256k1/dist/index.js\",\"@tetherto/wdk-wallet\":\"/node_modules/@tetherto/wdk-wallet/bare.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\"},\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-manager-btc.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-btc/package.json\",\"./wallet-account-btc.js\":\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-account-btc.js\",\"@tetherto/wdk-wallet\":\"/node_modules/@tetherto/wdk-wallet/bare.js\"},\"/node_modules/@tetherto/wdk-wallet-evm/index.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-evm/package.json\",\"./src/wallet-account-evm.js\":\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-account-evm.js\",\"./src/wallet-account-read-only-evm.js\":\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-account-read-only-evm.js\",\"./src/wallet-manager-evm.js\":\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-manager-evm.js\"},\"/node_modules/@tetherto/wdk-wallet-evm/package.json\":{},\"/node_modules/@tetherto/wdk-wallet-evm/src/memory-safe/hd-node-wallet.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-evm/package.json\",\"./signing-key.js\":\"/node_modules/@tetherto/wdk-wallet-evm/src/memory-safe/signing-key.js\",\"@noble/secp256k1\":\"/node_modules/@noble/secp256k1/index.js\",\"ethers\":\"/node_modules/ethers/lib.esm/index.js\"},\"/node_modules/@tetherto/wdk-wallet-evm/src/memory-safe/signing-key.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-evm/package.json\",\"@noble/hashes/hmac\":\"/node_modules/@noble/hashes/esm/hmac.js\",\"@noble/hashes/sha256\":\"/node_modules/@noble/hashes/esm/sha256.js\",\"@noble/secp256k1\":\"/node_modules/@noble/secp256k1/index.js\",\"ethers\":\"/node_modules/ethers/lib.esm/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-account-evm.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-evm/package.json\",\"./memory-safe/hd-node-wallet.js\":\"/node_modules/@tetherto/wdk-wallet-evm/src/memory-safe/hd-node-wallet.js\",\"./wallet-account-read-only-evm.js\":\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-account-read-only-evm.js\",\"bip39\":\"/node_modules/bip39/src/index.js\",\"ethers\":\"/node_modules/ethers/lib.esm/index.js\"},\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-account-read-only-evm.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-evm/package.json\",\"@tetherto/wdk-wallet\":\"/node_modules/@tetherto/wdk-wallet/bare.js\",\"ethers\":\"/node_modules/ethers/lib.esm/index.js\"},\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-manager-evm.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet-evm/package.json\",\"./wallet-account-evm.js\":\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-account-evm.js\",\"@tetherto/wdk-wallet\":\"/node_modules/@tetherto/wdk-wallet/bare.js\",\"ethers\":\"/node_modules/ethers/lib.esm/index.js\"},\"/node_modules/@tetherto/wdk-wallet/bare.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"./index.js\":\"/node_modules/@tetherto/wdk-wallet/index.js\",\"bare-node-runtime/global\":\"/node_modules/bare-node-runtime/global.js\"},\"/node_modules/@tetherto/wdk-wallet/index.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"./src/errors.js\":\"/node_modules/@tetherto/wdk-wallet/src/errors.js\",\"./src/wallet-account-read-only.js\":\"/node_modules/@tetherto/wdk-wallet/src/wallet-account-read-only.js\",\"./src/wallet-account.js\":\"/node_modules/@tetherto/wdk-wallet/src/wallet-account.js\",\"./src/wallet-manager.js\":\"/node_modules/@tetherto/wdk-wallet/src/wallet-manager.js\"},\"/node_modules/@tetherto/wdk-wallet/package.json\":{},\"/node_modules/@tetherto/wdk-wallet/src/errors.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\"},\"/node_modules/@tetherto/wdk-wallet/src/protocols/bridge-protocol.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"../errors.js\":\"/node_modules/@tetherto/wdk-wallet/src/errors.js\"},\"/node_modules/@tetherto/wdk-wallet/src/protocols/fiat-protocol.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"../errors.js\":\"/node_modules/@tetherto/wdk-wallet/src/errors.js\"},\"/node_modules/@tetherto/wdk-wallet/src/protocols/index.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"./bridge-protocol.js\":\"/node_modules/@tetherto/wdk-wallet/src/protocols/bridge-protocol.js\",\"./fiat-protocol.js\":\"/node_modules/@tetherto/wdk-wallet/src/protocols/fiat-protocol.js\",\"./lending-protocol.js\":\"/node_modules/@tetherto/wdk-wallet/src/protocols/lending-protocol.js\",\"./swap-protocol.js\":\"/node_modules/@tetherto/wdk-wallet/src/protocols/swap-protocol.js\"},\"/node_modules/@tetherto/wdk-wallet/src/protocols/lending-protocol.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"../errors.js\":\"/node_modules/@tetherto/wdk-wallet/src/errors.js\"},\"/node_modules/@tetherto/wdk-wallet/src/protocols/swap-protocol.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"../errors.js\":\"/node_modules/@tetherto/wdk-wallet/src/errors.js\"},\"/node_modules/@tetherto/wdk-wallet/src/wallet-account-read-only.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"./errors.js\":\"/node_modules/@tetherto/wdk-wallet/src/errors.js\"},\"/node_modules/@tetherto/wdk-wallet/src/wallet-account.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"./errors.js\":\"/node_modules/@tetherto/wdk-wallet/src/errors.js\",\"./wallet-account-read-only.js\":\"/node_modules/@tetherto/wdk-wallet/src/wallet-account-read-only.js\"},\"/node_modules/@tetherto/wdk-wallet/src/wallet-manager.js\":{\"#package\":\"/node_modules/@tetherto/wdk-wallet/package.json\",\"./errors.js\":\"/node_modules/@tetherto/wdk-wallet/src/errors.js\",\"bip39\":\"/node_modules/bip39/src/index.js\"},\"/node_modules/@tetherto/wdk/index.js\":{\"#package\":\"/node_modules/@tetherto/wdk/package.json\",\"./src/wdk-manager.js\":\"/node_modules/@tetherto/wdk/src/wdk-manager.js\"},\"/node_modules/@tetherto/wdk/package.json\":{},\"/node_modules/@tetherto/wdk/src/wdk-manager.js\":{\"#package\":\"/node_modules/@tetherto/wdk/package.json\",\"@tetherto/wdk-wallet\":\"/node_modules/@tetherto/wdk-wallet/bare.js\",\"@tetherto/wdk-wallet/protocols\":\"/node_modules/@tetherto/wdk-wallet/src/protocols/index.js\"},\"/node_modules/aes-js/lib.esm/aes.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\"},\"/node_modules/aes-js/lib.esm/index.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\",\"./aes.js\":\"/node_modules/aes-js/lib.esm/aes.js\",\"./mode-cbc.js\":\"/node_modules/aes-js/lib.esm/mode-cbc.js\",\"./mode-cfb.js\":\"/node_modules/aes-js/lib.esm/mode-cfb.js\",\"./mode-ctr.js\":\"/node_modules/aes-js/lib.esm/mode-ctr.js\",\"./mode-ecb.js\":\"/node_modules/aes-js/lib.esm/mode-ecb.js\",\"./mode-ofb.js\":\"/node_modules/aes-js/lib.esm/mode-ofb.js\",\"./mode.js\":\"/node_modules/aes-js/lib.esm/mode.js\",\"./padding.js\":\"/node_modules/aes-js/lib.esm/padding.js\"},\"/node_modules/aes-js/lib.esm/mode-cbc.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\",\"./mode.js\":\"/node_modules/aes-js/lib.esm/mode.js\"},\"/node_modules/aes-js/lib.esm/mode-cfb.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\",\"./mode.js\":\"/node_modules/aes-js/lib.esm/mode.js\"},\"/node_modules/aes-js/lib.esm/mode-ctr.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\",\"./mode.js\":\"/node_modules/aes-js/lib.esm/mode.js\"},\"/node_modules/aes-js/lib.esm/mode-ecb.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\",\"./mode.js\":\"/node_modules/aes-js/lib.esm/mode.js\"},\"/node_modules/aes-js/lib.esm/mode-ofb.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\",\"./mode.js\":\"/node_modules/aes-js/lib.esm/mode.js\"},\"/node_modules/aes-js/lib.esm/mode.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\",\"./aes.js\":\"/node_modules/aes-js/lib.esm/aes.js\"},\"/node_modules/aes-js/lib.esm/package.json\":{},\"/node_modules/aes-js/lib.esm/padding.js\":{\"#package\":\"/node_modules/aes-js/lib.esm/package.json\"},\"/node_modules/autobase/encoding/legacy.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"index-encoder\":\"/node_modules/index-encoder/index.js\"},\"/node_modules/autobase/encoding/spec/autobase/index.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"../../legacy.js\":\"/node_modules/autobase/encoding/legacy.js\",\"hyperschema/runtime\":\"/node_modules/hyperschema/runtime.cjs\"},\"/node_modules/autobase/index.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./lib/active-writers.js\":\"/node_modules/autobase/lib/active-writers.js\",\"./lib/append-batch.js\":\"/node_modules/autobase/lib/append-batch.js\",\"./lib/apply-calls.js\":\"/node_modules/autobase/lib/apply-calls.js\",\"./lib/apply-state.js\":\"/node_modules/autobase/lib/apply-state.js\",\"./lib/boot.js\":\"/node_modules/autobase/lib/boot.js\",\"./lib/caps.js\":\"/node_modules/autobase/lib/caps.js\",\"./lib/encryption.js\":\"/node_modules/autobase/lib/encryption.js\",\"./lib/fast-forward.js\":\"/node_modules/autobase/lib/fast-forward.js\",\"./lib/linearizer.js\":\"/node_modules/autobase/lib/linearizer.js\",\"./lib/local-state.js\":\"/node_modules/autobase/lib/local-state.js\",\"./lib/messages.js\":\"/node_modules/autobase/lib/messages.js\",\"./lib/store.js\":\"/node_modules/autobase/lib/store.js\",\"./lib/system.js\":\"/node_modules/autobase/lib/system.js\",\"./lib/timer.js\":\"/node_modules/autobase/lib/timer.js\",\"./lib/updates.js\":\"/node_modules/autobase/lib/updates.js\",\"./lib/values.js\":\"/node_modules/autobase/lib/values.js\",\"./lib/wakeup.js\":\"/node_modules/autobase/lib/wakeup.js\",\"./lib/writer.js\":\"/node_modules/autobase/lib/writer.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"core-coupler\":\"/node_modules/core-coupler/index.js\",\"debounceify\":\"/node_modules/debounceify/index.js\",\"encryption-encoding\":\"/node_modules/encryption-encoding/index.js\",\"hypercore\":\"/node_modules/hypercore/index.js\",\"hypercore-id-encoding\":\"/node_modules/hypercore-id-encoding/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"protomux-wakeup\":\"/node_modules/protomux-wakeup/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"resolve-reject-promise\":\"/node_modules/resolve-reject-promise/index.js\",\"safety-catch\":\"/node_modules/safety-catch/index.js\",\"scope-lock\":\"/node_modules/scope-lock/index.js\",\"signal-promise\":\"/node_modules/signal-promise/index.js\"},\"/node_modules/autobase/lib/active-writers.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/autobase/lib/append-batch.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"signal-promise\":\"/node_modules/signal-promise/index.js\"},\"/node_modules/autobase/lib/apply-calls.js\":{\"#package\":\"/node_modules/autobase/package.json\"},\"/node_modules/autobase/lib/apply-state.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./apply-calls.js\":\"/node_modules/autobase/lib/apply-calls.js\",\"./caps.js\":\"/node_modules/autobase/lib/caps.js\",\"./encryption.js\":\"/node_modules/autobase/lib/encryption.js\",\"./fork.js\":\"/node_modules/autobase/lib/fork.js\",\"./local-state.js\":\"/node_modules/autobase/lib/local-state.js\",\"./messages.js\":\"/node_modules/autobase/lib/messages.js\",\"./system.js\":\"/node_modules/autobase/lib/system.js\",\"./updates.js\":\"/node_modules/autobase/lib/updates.js\",\"./values.js\":\"/node_modules/autobase/lib/values.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"hypercore/lib/multisig.js\":\"/node_modules/hypercore/lib/multisig.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"safety-catch\":\"/node_modules/safety-catch/index.js\"},\"/node_modules/autobase/lib/boot.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./messages.js\":\"/node_modules/autobase/lib/messages.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"encryption-encoding\":\"/node_modules/encryption-encoding/index.js\"},\"/node_modules/autobase/lib/caps.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\"},\"/node_modules/autobase/lib/clock.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"tiny-buffer-map\":\"/node_modules/tiny-buffer-map/index.js\"},\"/node_modules/autobase/lib/consensus.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./clock.js\":\"/node_modules/autobase/lib/clock.js\",\"tiny-buffer-map\":\"/node_modules/tiny-buffer-map/index.js\"},\"/node_modules/autobase/lib/encryption.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./caps.js\":\"/node_modules/autobase/lib/caps.js\",\"./messages.js\":\"/node_modules/autobase/lib/messages.js\",\"./system.js\":\"/node_modules/autobase/lib/system.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"hypercore/lib/default-encryption.js\":\"/node_modules/hypercore/lib/default-encryption.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"resolve-reject-promise\":\"/node_modules/resolve-reject-promise/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/autobase/lib/fast-forward.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./encryption.js\":\"/node_modules/autobase/lib/encryption.js\",\"./system.js\":\"/node_modules/autobase/lib/system.js\",\"resolve-reject-promise\":\"/node_modules/resolve-reject-promise/index.js\",\"safety-catch\":\"/node_modules/safety-catch/index.js\"},\"/node_modules/autobase/lib/fork.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./encryption.js\":\"/node_modules/autobase/lib/encryption.js\",\"./messages.js\":\"/node_modules/autobase/lib/messages.js\",\"./system.js\":\"/node_modules/autobase/lib/system.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\"},\"/node_modules/autobase/lib/linearizer.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./clock.js\":\"/node_modules/autobase/lib/clock.js\",\"./consensus.js\":\"/node_modules/autobase/lib/consensus.js\",\"./topolist.js\":\"/node_modules/autobase/lib/topolist.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\"},\"/node_modules/autobase/lib/local-state.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./messages.js\":\"/node_modules/autobase/lib/messages.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\"},\"/node_modules/autobase/lib/messages.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"../encoding/spec/autobase\":\"/node_modules/autobase/encoding/spec/autobase/index.js\"},\"/node_modules/autobase/lib/node-buffer.js\":{\"#package\":\"/node_modules/autobase/package.json\"},\"/node_modules/autobase/lib/store.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./messages.js\":\"/node_modules/autobase/lib/messages.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"hypercore\":\"/node_modules/hypercore/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\"},\"/node_modules/autobase/lib/system.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./caps.js\":\"/node_modules/autobase/lib/caps.js\",\"./messages.js\":\"/node_modules/autobase/lib/messages.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"hyperbee\":\"/node_modules/hyperbee/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"sub-encoder\":\"/node_modules/sub-encoder/index.js\"},\"/node_modules/autobase/lib/timer.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"safety-catch\":\"/node_modules/safety-catch/index.js\"},\"/node_modules/autobase/lib/topolist.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\"},\"/node_modules/autobase/lib/updates.js\":{\"#package\":\"/node_modules/autobase/package.json\"},\"/node_modules/autobase/lib/values.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./caps.js\":\"/node_modules/autobase/lib/caps.js\",\"./encryption.js\":\"/node_modules/autobase/lib/encryption.js\",\"./messages.js\":\"/node_modules/autobase/lib/messages.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\"},\"/node_modules/autobase/lib/wakeup.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"safety-catch\":\"/node_modules/safety-catch/index.js\"},\"/node_modules/autobase/lib/writer.js\":{\"#package\":\"/node_modules/autobase/package.json\",\"./linearizer.js\":\"/node_modules/autobase/lib/linearizer.js\",\"./node-buffer.js\":\"/node_modules/autobase/lib/node-buffer.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"signal-promise\":\"/node_modules/signal-promise/index.js\"},\"/node_modules/autobase/package.json\":{},\"/node_modules/b4a/index.js\":{\"#package\":\"/node_modules/b4a/package.json\"},\"/node_modules/b4a/package.json\":{},\"/node_modules/bare-abort-controller/global.js\":{\"#package\":\"/node_modules/bare-abort-controller/package.json\",\".\":\"/node_modules/bare-abort-controller/index.js\"},\"/node_modules/bare-abort-controller/index.js\":{\"#package\":\"/node_modules/bare-abort-controller/package.json\",\"bare-events/web\":\"/node_modules/bare-events/web.js\"},\"/node_modules/bare-abort-controller/package.json\":{},\"/node_modules/bare-ansi-escapes/index.js\":{\"#package\":\"/node_modules/bare-ansi-escapes/package.json\"},\"/node_modules/bare-ansi-escapes/package.json\":{},\"/node_modules/bare-buffer/binding.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\".\":\"linked:libbare-buffer.3.4.2.so\"},\"/node_modules/bare-buffer/index.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\"./binding\":\"/node_modules/bare-buffer/binding.js\",\"./lib/ascii\":\"/node_modules/bare-buffer/lib/ascii.js\",\"./lib/base64\":\"/node_modules/bare-buffer/lib/base64.js\",\"./lib/base64url\":\"/node_modules/bare-buffer/lib/base64url.js\",\"./lib/constants\":\"/node_modules/bare-buffer/lib/constants.js\",\"./lib/hex\":\"/node_modules/bare-buffer/lib/hex.js\",\"./lib/latin1\":\"/node_modules/bare-buffer/lib/latin1.js\",\"./lib/utf16le\":\"/node_modules/bare-buffer/lib/utf16le.js\",\"./lib/utf8\":\"/node_modules/bare-buffer/lib/utf8.js\"},\"/node_modules/bare-buffer/lib/ascii.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\"},\"/node_modules/bare-buffer/lib/base64.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\"../binding\":\"/node_modules/bare-buffer/binding.js\"},\"/node_modules/bare-buffer/lib/base64url.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\"../binding\":\"/node_modules/bare-buffer/binding.js\"},\"/node_modules/bare-buffer/lib/constants.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\"../binding\":\"/node_modules/bare-buffer/binding.js\"},\"/node_modules/bare-buffer/lib/hex.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\"../binding\":\"/node_modules/bare-buffer/binding.js\"},\"/node_modules/bare-buffer/lib/latin1.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\"../binding\":\"/node_modules/bare-buffer/binding.js\"},\"/node_modules/bare-buffer/lib/utf16le.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\"../binding\":\"/node_modules/bare-buffer/binding.js\"},\"/node_modules/bare-buffer/lib/utf8.js\":{\"#package\":\"/node_modules/bare-buffer/package.json\",\"../binding\":\"/node_modules/bare-buffer/binding.js\"},\"/node_modules/bare-buffer/package.json\":{},\"/node_modules/bare-crypto/binding.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\".\":\"linked:libbare-crypto.1.13.0.so\"},\"/node_modules/bare-crypto/global.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"./web\":\"/node_modules/bare-crypto/web.js\"},\"/node_modules/bare-crypto/index.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"./lib/cipher\":\"/node_modules/bare-crypto/lib/cipher.js\",\"./lib/constants\":\"/node_modules/bare-crypto/lib/constants.js\",\"./lib/hash\":\"/node_modules/bare-crypto/lib/hash.js\",\"./lib/hmac\":\"/node_modules/bare-crypto/lib/hmac.js\",\"./lib/key\":\"/node_modules/bare-crypto/lib/key.js\",\"./lib/pbkdf2\":\"/node_modules/bare-crypto/lib/pbkdf2.js\",\"./lib/random\":\"/node_modules/bare-crypto/lib/random.js\",\"./lib/signature\":\"/node_modules/bare-crypto/lib/signature.js\",\"./web\":\"/node_modules/bare-crypto/web.js\"},\"/node_modules/bare-crypto/lib/cipher.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../binding\":\"/node_modules/bare-crypto/binding.js\",\"./constants\":\"/node_modules/bare-crypto/lib/constants.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-crypto/lib/constants.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../binding\":\"/node_modules/bare-crypto/binding.js\",\"./errors\":\"/node_modules/bare-crypto/lib/errors.js\"},\"/node_modules/bare-crypto/lib/errors.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\"},\"/node_modules/bare-crypto/lib/hash.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../binding\":\"/node_modules/bare-crypto/binding.js\",\"./constants\":\"/node_modules/bare-crypto/lib/constants.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-crypto/lib/hmac.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../binding\":\"/node_modules/bare-crypto/binding.js\",\"./constants\":\"/node_modules/bare-crypto/lib/constants.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-crypto/lib/key.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../binding\":\"/node_modules/bare-crypto/binding.js\",\"./constants\":\"/node_modules/bare-crypto/lib/constants.js\"},\"/node_modules/bare-crypto/lib/pbkdf2.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../binding\":\"/node_modules/bare-crypto/binding.js\",\"./constants\":\"/node_modules/bare-crypto/lib/constants.js\"},\"/node_modules/bare-crypto/lib/random.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../binding\":\"/node_modules/bare-crypto/binding.js\"},\"/node_modules/bare-crypto/lib/signature.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../binding\":\"/node_modules/bare-crypto/binding.js\",\"./constants\":\"/node_modules/bare-crypto/lib/constants.js\"},\"/node_modules/bare-crypto/lib/web/algorithm/ed25519.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../../..\":\"/node_modules/bare-crypto/index.js\",\"../../../binding\":\"/node_modules/bare-crypto/binding.js\",\"../../errors\":\"/node_modules/bare-crypto/lib/errors.js\",\"../../key\":\"/node_modules/bare-crypto/lib/key.js\",\"../crypto-key\":\"/node_modules/bare-crypto/lib/web/crypto-key.js\"},\"/node_modules/bare-crypto/lib/web/algorithm/hmac.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../../..\":\"/node_modules/bare-crypto/index.js\",\"../../errors\":\"/node_modules/bare-crypto/lib/errors.js\",\"../crypto-key\":\"/node_modules/bare-crypto/lib/web/crypto-key.js\"},\"/node_modules/bare-crypto/lib/web/algorithm/pbkdf2.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../../..\":\"/node_modules/bare-crypto/index.js\",\"../../errors\":\"/node_modules/bare-crypto/lib/errors.js\",\"../crypto-key\":\"/node_modules/bare-crypto/lib/web/crypto-key.js\"},\"/node_modules/bare-crypto/lib/web/algorithm/sha.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\"../../..\":\"/node_modules/bare-crypto/index.js\"},\"/node_modules/bare-crypto/lib/web/crypto-key.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\"},\"/node_modules/bare-crypto/package.json\":{},\"/node_modules/bare-crypto/web.js\":{\"#package\":\"/node_modules/bare-crypto/package.json\",\".\":\"/node_modules/bare-crypto/index.js\",\"./lib/errors\":\"/node_modules/bare-crypto/lib/errors.js\",\"./lib/web/algorithm/ed25519\":\"/node_modules/bare-crypto/lib/web/algorithm/ed25519.js\",\"./lib/web/algorithm/hmac\":\"/node_modules/bare-crypto/lib/web/algorithm/hmac.js\",\"./lib/web/algorithm/pbkdf2\":\"/node_modules/bare-crypto/lib/web/algorithm/pbkdf2.js\",\"./lib/web/algorithm/sha\":\"/node_modules/bare-crypto/lib/web/algorithm/sha.js\",\"./lib/web/crypto-key\":\"/node_modules/bare-crypto/lib/web/crypto-key.js\"},\"/node_modules/bare-debug-log/index.js\":{\"#package\":\"/node_modules/bare-debug-log/package.json\",\"bare-os\":\"/node_modules/bare-os/index.js\"},\"/node_modules/bare-debug-log/package.json\":{},\"/node_modules/bare-dns/binding.js\":{\"#package\":\"/node_modules/bare-dns/package.json\",\".\":\"linked:libbare-dns.2.1.4.so\"},\"/node_modules/bare-dns/index.js\":{\"#package\":\"/node_modules/bare-dns/package.json\",\"./binding\":\"/node_modules/bare-dns/binding.js\"},\"/node_modules/bare-dns/package.json\":{},\"/node_modules/bare-encoding/global.js\":{\"#package\":\"/node_modules/bare-encoding/package.json\",\".\":\"/node_modules/bare-encoding/index.js\"},\"/node_modules/bare-encoding/index.js\":{\"#package\":\"/node_modules/bare-encoding/package.json\",\"./lib/errors\":\"/node_modules/bare-encoding/lib/errors.js\",\"./lib/pass-through-decoder\":\"/node_modules/bare-encoding/lib/pass-through-decoder.js\",\"./lib/utf8-decoder\":\"/node_modules/bare-encoding/lib/utf8-decoder.js\"},\"/node_modules/bare-encoding/lib/errors.js\":{\"#package\":\"/node_modules/bare-encoding/package.json\"},\"/node_modules/bare-encoding/lib/pass-through-decoder.js\":{\"#package\":\"/node_modules/bare-encoding/package.json\"},\"/node_modules/bare-encoding/lib/utf8-decoder.js\":{\"#package\":\"/node_modules/bare-encoding/package.json\"},\"/node_modules/bare-encoding/package.json\":{},\"/node_modules/bare-env/index.js\":{\"#package\":\"/node_modules/bare-env/package.json\",\"bare-os\":\"/node_modules/bare-os/index.js\"},\"/node_modules/bare-env/package.json\":{},\"/node_modules/bare-events/global.js\":{\"#package\":\"/node_modules/bare-events/package.json\",\"./web\":\"/node_modules/bare-events/web.js\"},\"/node_modules/bare-events/index.js\":{\"#package\":\"/node_modules/bare-events/package.json\",\"./lib/errors\":\"/node_modules/bare-events/lib/errors.js\"},\"/node_modules/bare-events/lib/errors.js\":{\"#package\":\"/node_modules/bare-events/package.json\"},\"/node_modules/bare-events/package.json\":{},\"/node_modules/bare-events/web.js\":{\"#package\":\"/node_modules/bare-events/package.json\"},\"/node_modules/bare-fetch/global.js\":{\"#package\":\"/node_modules/bare-fetch/package.json\",\".\":\"/node_modules/bare-fetch/index.js\"},\"/node_modules/bare-fetch/index.js\":{\"#package\":\"/node_modules/bare-fetch/package.json\",\"./lib/errors\":\"/node_modules/bare-fetch/lib/errors.js\",\"./lib/headers\":\"/node_modules/bare-fetch/lib/headers.js\",\"./lib/request\":\"/node_modules/bare-fetch/lib/request.js\",\"./lib/response\":\"/node_modules/bare-fetch/lib/response.js\",\"./lib/response-stream\":\"/node_modules/bare-fetch/lib/response-stream.js\",\"bare-http1\":\"/node_modules/bare-http1/index.js\",\"bare-https\":\"/node_modules/bare-https/index.js\",\"bare-stream/web\":\"/node_modules/bare-stream/web.js\"},\"/node_modules/bare-fetch/lib/body.js\":{\"#package\":\"/node_modules/bare-fetch/package.json\",\"./errors\":\"/node_modules/bare-fetch/lib/errors.js\",\"bare-form-data\":\"/node_modules/bare-form-data/index.js\",\"bare-stream/web\":\"/node_modules/bare-stream/web.js\"},\"/node_modules/bare-fetch/lib/errors.js\":{\"#package\":\"/node_modules/bare-fetch/package.json\"},\"/node_modules/bare-fetch/lib/headers.js\":{\"#package\":\"/node_modules/bare-fetch/package.json\"},\"/node_modules/bare-fetch/lib/request.js\":{\"#package\":\"/node_modules/bare-fetch/package.json\",\"./body\":\"/node_modules/bare-fetch/lib/body.js\",\"./errors\":\"/node_modules/bare-fetch/lib/errors.js\",\"./headers\":\"/node_modules/bare-fetch/lib/headers.js\"},\"/node_modules/bare-fetch/lib/response-stream.js\":{\"#package\":\"/node_modules/bare-fetch/package.json\",\"bare-stream\":\"/node_modules/bare-stream/index.js\",\"bare-zlib\":\"/node_modules/bare-zlib/index.js\"},\"/node_modules/bare-fetch/lib/response.js\":{\"#package\":\"/node_modules/bare-fetch/package.json\",\"./body\":\"/node_modules/bare-fetch/lib/body.js\",\"./headers\":\"/node_modules/bare-fetch/lib/headers.js\"},\"/node_modules/bare-fetch/package.json\":{},\"/node_modules/bare-form-data/index.js\":{\"#package\":\"/node_modules/bare-form-data/package.json\",\"./lib/errors\":\"/node_modules/bare-form-data/lib/errors.js\",\"bare-stream/web\":\"/node_modules/bare-stream/web.js\"},\"/node_modules/bare-form-data/lib/errors.js\":{\"#package\":\"/node_modules/bare-form-data/package.json\"},\"/node_modules/bare-form-data/package.json\":{},\"/node_modules/bare-format/index.js\":{\"#package\":\"/node_modules/bare-format/package.json\",\"bare-inspect\":\"/node_modules/bare-inspect/index.js\"},\"/node_modules/bare-format/package.json\":{},\"/node_modules/bare-fs/binding.js\":{\"#package\":\"/node_modules/bare-fs/package.json\",\".\":\"linked:libbare-fs.4.5.2.so\"},\"/node_modules/bare-fs/index.js\":{\"#package\":\"/node_modules/bare-fs/package.json\",\"./binding\":\"/node_modules/bare-fs/binding.js\",\"./lib/constants\":\"/node_modules/bare-fs/lib/constants.js\",\"./lib/errors\":\"/node_modules/bare-fs/lib/errors.js\",\"./promises\":\"/node_modules/bare-fs/promises.js\",\"bare-events\":\"/node_modules/bare-events/index.js\",\"bare-path\":\"/node_modules/bare-path/index.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\",\"bare-url\":\"/node_modules/bare-url/index.js\",\"fast-fifo\":\"/node_modules/fast-fifo/index.js\"},\"/node_modules/bare-fs/lib/constants.js\":{\"#package\":\"/node_modules/bare-fs/package.json\",\"../binding\":\"/node_modules/bare-fs/binding.js\"},\"/node_modules/bare-fs/lib/errors.js\":{\"#package\":\"/node_modules/bare-fs/package.json\",\"bare-os\":\"/node_modules/bare-os/index.js\"},\"/node_modules/bare-fs/package.json\":{},\"/node_modules/bare-fs/promises.js\":{\"#package\":\"/node_modules/bare-fs/package.json\",\".\":\"/node_modules/bare-fs/index.js\",\"bare-events\":\"/node_modules/bare-events/index.js\"},\"/node_modules/bare-hrtime/binding.js\":{\"#package\":\"/node_modules/bare-hrtime/package.json\",\".\":\"linked:libbare-hrtime.2.1.1.so\"},\"/node_modules/bare-hrtime/index.js\":{\"#package\":\"/node_modules/bare-hrtime/package.json\",\"./binding\":\"/node_modules/bare-hrtime/binding.js\"},\"/node_modules/bare-hrtime/package.json\":{},\"/node_modules/bare-http-parser/index.js\":{\"#package\":\"/node_modules/bare-http-parser/package.json\",\"./lib/errors\":\"/node_modules/bare-http-parser/lib/errors.js\"},\"/node_modules/bare-http-parser/lib/errors.js\":{\"#package\":\"/node_modules/bare-http-parser/package.json\"},\"/node_modules/bare-http-parser/package.json\":{},\"/node_modules/bare-http1/index.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"./lib/agent\":\"/node_modules/bare-http1/lib/agent.js\",\"./lib/client-connection\":\"/node_modules/bare-http1/lib/client-connection.js\",\"./lib/client-request\":\"/node_modules/bare-http1/lib/client-request.js\",\"./lib/constants\":\"/node_modules/bare-http1/lib/constants.js\",\"./lib/errors\":\"/node_modules/bare-http1/lib/errors.js\",\"./lib/incoming-message\":\"/node_modules/bare-http1/lib/incoming-message.js\",\"./lib/outgoing-message\":\"/node_modules/bare-http1/lib/outgoing-message.js\",\"./lib/server\":\"/node_modules/bare-http1/lib/server.js\",\"./lib/server-connection\":\"/node_modules/bare-http1/lib/server-connection.js\",\"./lib/server-response\":\"/node_modules/bare-http1/lib/server-response.js\"},\"/node_modules/bare-http1/lib/agent.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"./client-connection\":\"/node_modules/bare-http1/lib/client-connection.js\",\"bare-events\":\"/node_modules/bare-events/index.js\",\"bare-tcp\":\"/node_modules/bare-tcp/index.js\"},\"/node_modules/bare-http1/lib/client-connection.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"./errors\":\"/node_modules/bare-http1/lib/errors.js\",\"./incoming-message\":\"/node_modules/bare-http1/lib/incoming-message.js\",\"bare-http-parser\":\"/node_modules/bare-http-parser/index.js\"},\"/node_modules/bare-http1/lib/client-request.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"./agent\":\"/node_modules/bare-http1/lib/agent.js\",\"./outgoing-message\":\"/node_modules/bare-http1/lib/outgoing-message.js\"},\"/node_modules/bare-http1/lib/constants.js\":{\"#package\":\"/node_modules/bare-http1/package.json\"},\"/node_modules/bare-http1/lib/errors.js\":{\"#package\":\"/node_modules/bare-http1/package.json\"},\"/node_modules/bare-http1/lib/incoming-message.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-http1/lib/outgoing-message.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"./errors\":\"/node_modules/bare-http1/lib/errors.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-http1/lib/server-connection.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"./incoming-message\":\"/node_modules/bare-http1/lib/incoming-message.js\",\"./server-response\":\"/node_modules/bare-http1/lib/server-response.js\",\"bare-http-parser\":\"/node_modules/bare-http-parser/index.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-http1/lib/server-response.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"./constants\":\"/node_modules/bare-http1/lib/constants.js\",\"./outgoing-message\":\"/node_modules/bare-http1/lib/outgoing-message.js\"},\"/node_modules/bare-http1/lib/server.js\":{\"#package\":\"/node_modules/bare-http1/package.json\",\"./server-connection\":\"/node_modules/bare-http1/lib/server-connection.js\",\"bare-tcp\":\"/node_modules/bare-tcp/index.js\"},\"/node_modules/bare-http1/package.json\":{},\"/node_modules/bare-https/index.js\":{\"#package\":\"/node_modules/bare-https/package.json\",\"./lib/agent\":\"/node_modules/bare-https/lib/agent.js\",\"./lib/client-request\":\"/node_modules/bare-https/lib/client-request.js\",\"./lib/server\":\"/node_modules/bare-https/lib/server.js\"},\"/node_modules/bare-https/lib/agent.js\":{\"#package\":\"/node_modules/bare-https/package.json\",\"./socket\":\"/node_modules/bare-https/lib/socket.js\",\"bare-http1\":\"/node_modules/bare-http1/index.js\"},\"/node_modules/bare-https/lib/client-request.js\":{\"#package\":\"/node_modules/bare-https/package.json\",\"./agent\":\"/node_modules/bare-https/lib/agent.js\",\"bare-http1\":\"/node_modules/bare-http1/index.js\"},\"/node_modules/bare-https/lib/server.js\":{\"#package\":\"/node_modules/bare-https/package.json\",\"./socket\":\"/node_modules/bare-https/lib/socket.js\",\"bare-http1\":\"/node_modules/bare-http1/index.js\",\"bare-tcp\":\"/node_modules/bare-tcp/index.js\"},\"/node_modules/bare-https/lib/socket.js\":{\"#package\":\"/node_modules/bare-https/package.json\",\"bare-tls\":\"/node_modules/bare-tls/index.js\"},\"/node_modules/bare-https/package.json\":{},\"/node_modules/bare-inspect/binding.js\":{\"#package\":\"/node_modules/bare-inspect/package.json\",\".\":\"linked:libbare-inspect.3.1.4.so\"},\"/node_modules/bare-inspect/index.js\":{\"#package\":\"/node_modules/bare-inspect/package.json\",\"./binding\":\"/node_modules/bare-inspect/binding.js\",\"bare-ansi-escapes\":\"/node_modules/bare-ansi-escapes/index.js\",\"bare-type\":\"/node_modules/bare-type/index.js\"},\"/node_modules/bare-inspect/package.json\":{},\"/node_modules/bare-net/index.js\":{\"#package\":\"/node_modules/bare-net/package.json\",\"./lib/constants\":\"/node_modules/bare-net/lib/constants.js\",\"bare-events\":\"/node_modules/bare-events/index.js\",\"bare-pipe\":\"/node_modules/bare-pipe/index.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\",\"bare-tcp\":\"/node_modules/bare-tcp/index.js\"},\"/node_modules/bare-net/lib/constants.js\":{\"#package\":\"/node_modules/bare-net/package.json\"},\"/node_modules/bare-net/package.json\":{},\"/node_modules/bare-node-runtime/global.js\":{\"#package\":\"/node_modules/bare-node-runtime/package.json\",\"bare-abort-controller/global\":\"/node_modules/bare-abort-controller/global.js\",\"bare-crypto/global\":\"/node_modules/bare-crypto/global.js\",\"bare-encoding/global\":\"/node_modules/bare-encoding/global.js\",\"bare-events/global\":\"/node_modules/bare-events/global.js\",\"bare-fetch/global\":\"/node_modules/bare-fetch/global.js\",\"bare-performance/global\":\"/node_modules/bare-performance/global.js\",\"bare-process/global\":\"/node_modules/bare-process/global.js\",\"bare-stream/global\":\"/node_modules/bare-stream/global.js\"},\"/node_modules/bare-node-runtime/package.json\":{},\"/node_modules/bare-os/binding.js\":{\"#package\":\"/node_modules/bare-os/package.json\",\".\":\"linked:libbare-os.3.6.2.so\"},\"/node_modules/bare-os/index.js\":{\"#package\":\"/node_modules/bare-os/package.json\",\"./binding\":\"/node_modules/bare-os/binding.js\",\"./lib/constants\":\"/node_modules/bare-os/lib/constants.js\",\"./lib/errors\":\"/node_modules/bare-os/lib/errors.js\"},\"/node_modules/bare-os/lib/constants.js\":{\"#package\":\"/node_modules/bare-os/package.json\",\"../binding\":\"/node_modules/bare-os/binding.js\"},\"/node_modules/bare-os/lib/errors.js\":{\"#package\":\"/node_modules/bare-os/package.json\"},\"/node_modules/bare-os/package.json\":{},\"/node_modules/bare-path/index.js\":{\"#package\":\"/node_modules/bare-path/package.json\",\"./lib/posix\":\"/node_modules/bare-path/lib/posix.js\",\"./lib/win32\":\"/node_modules/bare-path/lib/win32.js\"},\"/node_modules/bare-path/lib/constants.js\":{\"#package\":\"/node_modules/bare-path/package.json\"},\"/node_modules/bare-path/lib/posix.js\":{\"#package\":\"/node_modules/bare-path/package.json\",\"./constants\":\"/node_modules/bare-path/lib/constants.js\",\"./shared\":\"/node_modules/bare-path/lib/shared.js\",\"./win32\":\"/node_modules/bare-path/lib/win32.js\",\"bare-os\":\"/node_modules/bare-os/index.js\"},\"/node_modules/bare-path/lib/shared.js\":{\"#package\":\"/node_modules/bare-path/package.json\",\"./constants\":\"/node_modules/bare-path/lib/constants.js\"},\"/node_modules/bare-path/lib/win32.js\":{\"#package\":\"/node_modules/bare-path/package.json\",\"./constants\":\"/node_modules/bare-path/lib/constants.js\",\"./posix\":\"/node_modules/bare-path/lib/posix.js\",\"./shared\":\"/node_modules/bare-path/lib/shared.js\",\"bare-os\":\"/node_modules/bare-os/index.js\"},\"/node_modules/bare-path/package.json\":{},\"/node_modules/bare-performance/binding.js\":{\"#package\":\"/node_modules/bare-performance/package.json\",\".\":\"linked:libbare-performance.1.3.0.so\"},\"/node_modules/bare-performance/global.js\":{\"#package\":\"/node_modules/bare-performance/package.json\",\".\":\"/node_modules/bare-performance/index.js\"},\"/node_modules/bare-performance/index.js\":{\"#package\":\"/node_modules/bare-performance/package.json\",\"./binding\":\"/node_modules/bare-performance/binding.js\",\"./lib/constants\":\"/node_modules/bare-performance/lib/constants.js\",\"./lib/errors\":\"/node_modules/bare-performance/lib/errors.js\"},\"/node_modules/bare-performance/lib/constants.js\":{\"#package\":\"/node_modules/bare-performance/package.json\"},\"/node_modules/bare-performance/lib/errors.js\":{\"#package\":\"/node_modules/bare-performance/package.json\"},\"/node_modules/bare-performance/package.json\":{},\"/node_modules/bare-pipe/binding.js\":{\"#package\":\"/node_modules/bare-pipe/package.json\",\".\":\"linked:libbare-pipe.4.1.2.so\"},\"/node_modules/bare-pipe/index.js\":{\"#package\":\"/node_modules/bare-pipe/package.json\",\"./binding\":\"/node_modules/bare-pipe/binding.js\",\"./lib/constants\":\"/node_modules/bare-pipe/lib/constants.js\",\"./lib/errors\":\"/node_modules/bare-pipe/lib/errors.js\",\"bare-events\":\"/node_modules/bare-events/index.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-pipe/lib/constants.js\":{\"#package\":\"/node_modules/bare-pipe/package.json\"},\"/node_modules/bare-pipe/lib/errors.js\":{\"#package\":\"/node_modules/bare-pipe/package.json\"},\"/node_modules/bare-pipe/package.json\":{},\"/node_modules/bare-process/global.js\":{\"#package\":\"/node_modules/bare-process/package.json\",\".\":\"/node_modules/bare-process/index.js\"},\"/node_modules/bare-process/index.js\":{\"#package\":\"/node_modules/bare-process/package.json\",\"bare-env\":\"/node_modules/bare-env/index.js\",\"bare-events\":\"/node_modules/bare-events/index.js\",\"bare-hrtime\":\"/node_modules/bare-hrtime/index.js\",\"bare-os\":\"/node_modules/bare-os/index.js\",\"bare-pipe\":\"/node_modules/bare-pipe/index.js\",\"bare-signals\":\"/node_modules/bare-signals/index.js\",\"bare-tty\":\"/node_modules/bare-tty/index.js\"},\"/node_modules/bare-process/package.json\":{},\"/node_modules/bare-signals/binding.js\":{\"#package\":\"/node_modules/bare-signals/package.json\",\".\":\"linked:libbare-signals.4.2.0.so\"},\"/node_modules/bare-signals/index.js\":{\"#package\":\"/node_modules/bare-signals/package.json\",\"./binding\":\"/node_modules/bare-signals/binding.js\",\"./lib/emitter\":\"/node_modules/bare-signals/lib/emitter.js\",\"./lib/errors\":\"/node_modules/bare-signals/lib/errors.js\",\"bare-events\":\"/node_modules/bare-events/index.js\",\"bare-os\":\"/node_modules/bare-os/index.js\"},\"/node_modules/bare-signals/lib/emitter.js\":{\"#package\":\"/node_modules/bare-signals/package.json\",\"..\":\"/node_modules/bare-signals/index.js\",\"bare-events\":\"/node_modules/bare-events/index.js\"},\"/node_modules/bare-signals/lib/errors.js\":{\"#package\":\"/node_modules/bare-signals/package.json\"},\"/node_modules/bare-signals/package.json\":{},\"/node_modules/bare-stream/global.js\":{\"#package\":\"/node_modules/bare-stream/package.json\",\"./web\":\"/node_modules/bare-stream/web.js\"},\"/node_modules/bare-stream/index.js\":{\"#package\":\"/node_modules/bare-stream/package.json\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/bare-stream/package.json\":{},\"/node_modules/bare-stream/web.js\":{\"#package\":\"/node_modules/bare-stream/package.json\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/bare-tcp/binding.js\":{\"#package\":\"/node_modules/bare-tcp/package.json\",\".\":\"linked:libbare-tcp.2.2.2.so\"},\"/node_modules/bare-tcp/index.js\":{\"#package\":\"/node_modules/bare-tcp/package.json\",\"./binding\":\"/node_modules/bare-tcp/binding.js\",\"./lib/constants\":\"/node_modules/bare-tcp/lib/constants.js\",\"./lib/errors\":\"/node_modules/bare-tcp/lib/errors.js\",\"./lib/ip\":\"/node_modules/bare-tcp/lib/ip.js\",\"bare-dns\":\"/node_modules/bare-dns/index.js\",\"bare-events\":\"/node_modules/bare-events/index.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-tcp/lib/constants.js\":{\"#package\":\"/node_modules/bare-tcp/package.json\"},\"/node_modules/bare-tcp/lib/errors.js\":{\"#package\":\"/node_modules/bare-tcp/package.json\"},\"/node_modules/bare-tcp/lib/ip.js\":{\"#package\":\"/node_modules/bare-tcp/package.json\"},\"/node_modules/bare-tcp/package.json\":{},\"/node_modules/bare-tls/binding.js\":{\"#package\":\"/node_modules/bare-tls/package.json\",\".\":\"linked:libbare-tls.2.1.7.so\"},\"/node_modules/bare-tls/index.js\":{\"#package\":\"/node_modules/bare-tls/package.json\",\"./binding\":\"/node_modules/bare-tls/binding.js\",\"./lib/constants\":\"/node_modules/bare-tls/lib/constants.js\",\"./lib/errors\":\"/node_modules/bare-tls/lib/errors.js\",\"./net\":\"/node_modules/bare-tls/net.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-tls/lib/constants.js\":{\"#package\":\"/node_modules/bare-tls/package.json\"},\"/node_modules/bare-tls/lib/errors.js\":{\"#package\":\"/node_modules/bare-tls/package.json\"},\"/node_modules/bare-tls/net.js\":{\"#package\":\"/node_modules/bare-tls/package.json\",\"bare-events\":\"/node_modules/bare-events/index.js\",\"bare-net\":\"/node_modules/bare-net/index.js\",\"bare-tls\":\"/node_modules/bare-tls/index.js\"},\"/node_modules/bare-tls/package.json\":{},\"/node_modules/bare-tty/binding.js\":{\"#package\":\"/node_modules/bare-tty/package.json\",\".\":\"linked:libbare-tty.5.0.3.so\"},\"/node_modules/bare-tty/index.js\":{\"#package\":\"/node_modules/bare-tty/package.json\",\"./binding\":\"/node_modules/bare-tty/binding.js\",\"./lib/constants\":\"/node_modules/bare-tty/lib/constants.js\",\"bare-signals\":\"/node_modules/bare-signals/index.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-tty/lib/constants.js\":{\"#package\":\"/node_modules/bare-tty/package.json\",\"../binding\":\"/node_modules/bare-tty/binding.js\"},\"/node_modules/bare-tty/package.json\":{},\"/node_modules/bare-type/binding.js\":{\"#package\":\"/node_modules/bare-type/package.json\",\".\":\"linked:libbare-type.1.1.0.so\"},\"/node_modules/bare-type/index.js\":{\"#package\":\"/node_modules/bare-type/package.json\",\"./binding\":\"/node_modules/bare-type/binding.js\"},\"/node_modules/bare-type/package.json\":{},\"/node_modules/bare-url/binding.js\":{\"#package\":\"/node_modules/bare-url/package.json\",\".\":\"linked:libbare-url.2.3.2.so\"},\"/node_modules/bare-url/index.js\":{\"#package\":\"/node_modules/bare-url/package.json\",\"./binding\":\"/node_modules/bare-url/binding.js\",\"./lib/errors\":\"/node_modules/bare-url/lib/errors.js\",\"./lib/url-search-params\":\"/node_modules/bare-url/lib/url-search-params.js\",\"bare-path\":\"/node_modules/bare-path/index.js\"},\"/node_modules/bare-url/lib/errors.js\":{\"#package\":\"/node_modules/bare-url/package.json\"},\"/node_modules/bare-url/lib/url-search-params.js\":{\"#package\":\"/node_modules/bare-url/package.json\"},\"/node_modules/bare-url/package.json\":{},\"/node_modules/bare-utils/index.js\":{\"#package\":\"/node_modules/bare-utils/package.json\",\"./lib/deprecate\":\"/node_modules/bare-utils/lib/deprecate.js\",\"./lib/inherits\":\"/node_modules/bare-utils/lib/inherits.js\",\"./lib/promisify\":\"/node_modules/bare-utils/lib/promisify.js\",\"./lib/types\":\"/node_modules/bare-utils/lib/types.js\",\"bare-debug-log\":\"/node_modules/bare-debug-log/index.js\",\"bare-encoding\":\"/node_modules/bare-encoding/index.js\",\"bare-format\":\"/node_modules/bare-format/index.js\",\"bare-inspect\":\"/node_modules/bare-inspect/index.js\"},\"/node_modules/bare-utils/lib/deprecate.js\":{\"#package\":\"/node_modules/bare-utils/package.json\"},\"/node_modules/bare-utils/lib/inherits.js\":{\"#package\":\"/node_modules/bare-utils/package.json\"},\"/node_modules/bare-utils/lib/promisify.js\":{\"#package\":\"/node_modules/bare-utils/package.json\"},\"/node_modules/bare-utils/lib/types.js\":{\"#package\":\"/node_modules/bare-utils/package.json\",\"bare-type\":\"/node_modules/bare-type/index.js\"},\"/node_modules/bare-utils/package.json\":{},\"/node_modules/bare-zlib/binding.js\":{\"#package\":\"/node_modules/bare-zlib/package.json\",\".\":\"linked:libbare-zlib.1.3.1.so\"},\"/node_modules/bare-zlib/index.js\":{\"#package\":\"/node_modules/bare-zlib/package.json\",\"./binding\":\"/node_modules/bare-zlib/binding.js\",\"./lib/constants\":\"/node_modules/bare-zlib/lib/constants.js\",\"./lib/errors\":\"/node_modules/bare-zlib/lib/errors.js\",\"bare-stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/bare-zlib/lib/constants.js\":{\"#package\":\"/node_modules/bare-zlib/package.json\",\"../binding\":\"/node_modules/bare-zlib/binding.js\"},\"/node_modules/bare-zlib/lib/errors.js\":{\"#package\":\"/node_modules/bare-zlib/package.json\"},\"/node_modules/bare-zlib/package.json\":{},\"/node_modules/base-x/package.json\":{},\"/node_modules/base-x/src/index.js\":{\"#package\":\"/node_modules/base-x/package.json\"},\"/node_modules/bech32/dist/index.js\":{\"#package\":\"/node_modules/bech32/package.json\"},\"/node_modules/bech32/package.json\":{},\"/node_modules/big-sparse-array/index.js\":{\"#package\":\"/node_modules/big-sparse-array/package.json\"},\"/node_modules/big-sparse-array/package.json\":{},\"/node_modules/bindings/bindings.js\":{\"#package\":\"/node_modules/bindings/package.json\",\"file-uri-to-path\":\"/node_modules/file-uri-to-path/index.js\",\"fs\":\"/node_modules/bare-fs/index.js\",\"path\":\"/node_modules/bare-path/index.js\"},\"/node_modules/bindings/package.json\":{},\"/node_modules/bip174/package.json\":{},\"/node_modules/bip174/src/lib/combiner/index.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../parser\":\"/node_modules/bip174/src/lib/parser/index.js\"},\"/node_modules/bip174/src/lib/converter/global/globalXpub.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/global/unsignedTx.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/index.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\",\"./global/globalXpub\":\"/node_modules/bip174/src/lib/converter/global/globalXpub.js\",\"./global/unsignedTx\":\"/node_modules/bip174/src/lib/converter/global/unsignedTx.js\",\"./input/finalScriptSig\":\"/node_modules/bip174/src/lib/converter/input/finalScriptSig.js\",\"./input/finalScriptWitness\":\"/node_modules/bip174/src/lib/converter/input/finalScriptWitness.js\",\"./input/nonWitnessUtxo\":\"/node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.js\",\"./input/partialSig\":\"/node_modules/bip174/src/lib/converter/input/partialSig.js\",\"./input/porCommitment\":\"/node_modules/bip174/src/lib/converter/input/porCommitment.js\",\"./input/sighashType\":\"/node_modules/bip174/src/lib/converter/input/sighashType.js\",\"./input/tapKeySig\":\"/node_modules/bip174/src/lib/converter/input/tapKeySig.js\",\"./input/tapLeafScript\":\"/node_modules/bip174/src/lib/converter/input/tapLeafScript.js\",\"./input/tapMerkleRoot\":\"/node_modules/bip174/src/lib/converter/input/tapMerkleRoot.js\",\"./input/tapScriptSig\":\"/node_modules/bip174/src/lib/converter/input/tapScriptSig.js\",\"./input/witnessUtxo\":\"/node_modules/bip174/src/lib/converter/input/witnessUtxo.js\",\"./output/tapTree\":\"/node_modules/bip174/src/lib/converter/output/tapTree.js\",\"./shared/bip32Derivation\":\"/node_modules/bip174/src/lib/converter/shared/bip32Derivation.js\",\"./shared/checkPubkey\":\"/node_modules/bip174/src/lib/converter/shared/checkPubkey.js\",\"./shared/redeemScript\":\"/node_modules/bip174/src/lib/converter/shared/redeemScript.js\",\"./shared/tapBip32Derivation\":\"/node_modules/bip174/src/lib/converter/shared/tapBip32Derivation.js\",\"./shared/tapInternalKey\":\"/node_modules/bip174/src/lib/converter/shared/tapInternalKey.js\",\"./shared/witnessScript\":\"/node_modules/bip174/src/lib/converter/shared/witnessScript.js\"},\"/node_modules/bip174/src/lib/converter/input/finalScriptSig.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/finalScriptWitness.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/partialSig.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/porCommitment.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/sighashType.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/tapKeySig.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/tapLeafScript.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/tapMerkleRoot.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/tapScriptSig.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/converter/input/witnessUtxo.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\",\"../tools\":\"/node_modules/bip174/src/lib/converter/tools.js\",\"../varint\":\"/node_modules/bip174/src/lib/converter/varint.js\"},\"/node_modules/bip174/src/lib/converter/output/tapTree.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\",\"../varint\":\"/node_modules/bip174/src/lib/converter/varint.js\"},\"/node_modules/bip174/src/lib/converter/shared/bip32Derivation.js\":{\"#package\":\"/node_modules/bip174/package.json\"},\"/node_modules/bip174/src/lib/converter/shared/checkPubkey.js\":{\"#package\":\"/node_modules/bip174/package.json\"},\"/node_modules/bip174/src/lib/converter/shared/redeemScript.js\":{\"#package\":\"/node_modules/bip174/package.json\"},\"/node_modules/bip174/src/lib/converter/shared/tapBip32Derivation.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../varint\":\"/node_modules/bip174/src/lib/converter/varint.js\",\"./bip32Derivation\":\"/node_modules/bip174/src/lib/converter/shared/bip32Derivation.js\"},\"/node_modules/bip174/src/lib/converter/shared/tapInternalKey.js\":{\"#package\":\"/node_modules/bip174/package.json\"},\"/node_modules/bip174/src/lib/converter/shared/witnessScript.js\":{\"#package\":\"/node_modules/bip174/package.json\"},\"/node_modules/bip174/src/lib/converter/tools.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"./varint\":\"/node_modules/bip174/src/lib/converter/varint.js\"},\"/node_modules/bip174/src/lib/converter/varint.js\":{\"#package\":\"/node_modules/bip174/package.json\"},\"/node_modules/bip174/src/lib/parser/fromBuffer.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../converter\":\"/node_modules/bip174/src/lib/converter/index.js\",\"../converter/tools\":\"/node_modules/bip174/src/lib/converter/tools.js\",\"../converter/varint\":\"/node_modules/bip174/src/lib/converter/varint.js\",\"../typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\"},\"/node_modules/bip174/src/lib/parser/index.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"./fromBuffer\":\"/node_modules/bip174/src/lib/parser/fromBuffer.js\",\"./toBuffer\":\"/node_modules/bip174/src/lib/parser/toBuffer.js\"},\"/node_modules/bip174/src/lib/parser/toBuffer.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"../converter\":\"/node_modules/bip174/src/lib/converter/index.js\",\"../converter/tools\":\"/node_modules/bip174/src/lib/converter/tools.js\"},\"/node_modules/bip174/src/lib/psbt.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"./combiner\":\"/node_modules/bip174/src/lib/combiner/index.js\",\"./parser\":\"/node_modules/bip174/src/lib/parser/index.js\",\"./typeFields\":\"/node_modules/bip174/src/lib/typeFields.js\",\"./utils\":\"/node_modules/bip174/src/lib/utils.js\"},\"/node_modules/bip174/src/lib/typeFields.js\":{\"#package\":\"/node_modules/bip174/package.json\"},\"/node_modules/bip174/src/lib/utils.js\":{\"#package\":\"/node_modules/bip174/package.json\",\"./converter\":\"/node_modules/bip174/src/lib/converter/index.js\"},\"/node_modules/bip32-path/index.js\":{\"#package\":\"/node_modules/bip32-path/package.json\"},\"/node_modules/bip32-path/package.json\":{},\"/node_modules/bip32/package.json\":{},\"/node_modules/bip32/src/bip32.js\":{\"#package\":\"/node_modules/bip32/package.json\",\"./crypto\":\"/node_modules/bip32/src/crypto.js\",\"./testecc\":\"/node_modules/bip32/src/testecc.js\",\"@noble/hashes/sha256\":\"/node_modules/@noble/hashes/sha256.js\",\"@scure/base\":\"/node_modules/@scure/base/lib/index.js\",\"typeforce\":\"/node_modules/typeforce/index.js\",\"wif\":\"/node_modules/wif/index.js\"},\"/node_modules/bip32/src/crypto.js\":{\"#package\":\"/node_modules/bip32/package.json\",\"@noble/hashes/hmac\":\"/node_modules/@noble/hashes/hmac.js\",\"@noble/hashes/ripemd160\":\"/node_modules/@noble/hashes/ripemd160.js\",\"@noble/hashes/sha256\":\"/node_modules/@noble/hashes/sha256.js\",\"@noble/hashes/sha512\":\"/node_modules/@noble/hashes/sha512.js\"},\"/node_modules/bip32/src/index.js\":{\"#package\":\"/node_modules/bip32/package.json\",\"./bip32\":\"/node_modules/bip32/src/bip32.js\"},\"/node_modules/bip32/src/testecc.js\":{\"#package\":\"/node_modules/bip32/package.json\"},\"/node_modules/bip39-mnemonic/index.js\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\",\"./wordlist\":\"/node_modules/bip39-mnemonic/wordlist/index.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/bip39-mnemonic/package.json\":{},\"/node_modules/bip39-mnemonic/wordlist/chinese_simplified.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/chinese_traditional.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/czech.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/english.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/french.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/index.js\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\",\"./chinese_simplified.json\":\"/node_modules/bip39-mnemonic/wordlist/chinese_simplified.json\",\"./chinese_traditional.json\":\"/node_modules/bip39-mnemonic/wordlist/chinese_traditional.json\",\"./czech.json\":\"/node_modules/bip39-mnemonic/wordlist/czech.json\",\"./english.json\":\"/node_modules/bip39-mnemonic/wordlist/english.json\",\"./french.json\":\"/node_modules/bip39-mnemonic/wordlist/french.json\",\"./italian.json\":\"/node_modules/bip39-mnemonic/wordlist/italian.json\",\"./japanese.json\":\"/node_modules/bip39-mnemonic/wordlist/japanese.json\",\"./korean.json\":\"/node_modules/bip39-mnemonic/wordlist/korean.json\",\"./lookup.json\":\"/node_modules/bip39-mnemonic/wordlist/lookup.json\",\"./portuguese.json\":\"/node_modules/bip39-mnemonic/wordlist/portuguese.json\",\"./russian.json\":\"/node_modules/bip39-mnemonic/wordlist/russian.json\",\"./spanish.json\":\"/node_modules/bip39-mnemonic/wordlist/spanish.json\",\"./turkish.json\":\"/node_modules/bip39-mnemonic/wordlist/turkish.json\"},\"/node_modules/bip39-mnemonic/wordlist/italian.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/japanese.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/korean.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/lookup.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/portuguese.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/russian.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/spanish.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39-mnemonic/wordlist/turkish.json\":{\"#package\":\"/node_modules/bip39-mnemonic/package.json\"},\"/node_modules/bip39/package.json\":{},\"/node_modules/bip39/src/_wordlists.js\":{\"#package\":\"/node_modules/bip39/package.json\",\"./wordlists/chinese_simplified.json\":\"/node_modules/bip39/src/wordlists/chinese_simplified.json\",\"./wordlists/chinese_traditional.json\":\"/node_modules/bip39/src/wordlists/chinese_traditional.json\",\"./wordlists/czech.json\":\"/node_modules/bip39/src/wordlists/czech.json\",\"./wordlists/english.json\":\"/node_modules/bip39/src/wordlists/english.json\",\"./wordlists/french.json\":\"/node_modules/bip39/src/wordlists/french.json\",\"./wordlists/italian.json\":\"/node_modules/bip39/src/wordlists/italian.json\",\"./wordlists/japanese.json\":\"/node_modules/bip39/src/wordlists/japanese.json\",\"./wordlists/korean.json\":\"/node_modules/bip39/src/wordlists/korean.json\",\"./wordlists/portuguese.json\":\"/node_modules/bip39/src/wordlists/portuguese.json\",\"./wordlists/spanish.json\":\"/node_modules/bip39/src/wordlists/spanish.json\"},\"/node_modules/bip39/src/index.js\":{\"#package\":\"/node_modules/bip39/package.json\",\"./_wordlists\":\"/node_modules/bip39/src/_wordlists.js\",\"@noble/hashes/pbkdf2\":\"/node_modules/@noble/hashes/pbkdf2.js\",\"@noble/hashes/sha256\":\"/node_modules/@noble/hashes/sha256.js\",\"@noble/hashes/sha512\":\"/node_modules/@noble/hashes/sha512.js\",\"@noble/hashes/utils\":\"/node_modules/@noble/hashes/utils.js\"},\"/node_modules/bip39/src/wordlists/chinese_simplified.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/chinese_traditional.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/czech.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/english.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/french.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/italian.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/japanese.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/korean.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/portuguese.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip39/src/wordlists/spanish.json\":{\"#package\":\"/node_modules/bip39/package.json\"},\"/node_modules/bip66/index.js\":{\"#package\":\"/node_modules/bip66/package.json\",\"safe-buffer\":\"/node_modules/safe-buffer/index.js\"},\"/node_modules/bip66/package.json\":{},\"/node_modules/bip68/index.js\":{\"#package\":\"/node_modules/bip68/package.json\"},\"/node_modules/bip68/package.json\":{},\"/node_modules/bitcoinjs-lib/package.json\":{},\"/node_modules/bitcoinjs-lib/src/address.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"./payments\":\"/node_modules/bitcoinjs-lib/src/payments/index.js\",\"./script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"./types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"bech32\":\"/node_modules/bech32/dist/index.js\",\"bs58check\":\"/node_modules/bs58check/index.js\"},\"/node_modules/bitcoinjs-lib/src/bip66.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\"},\"/node_modules/bitcoinjs-lib/src/block.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./bufferutils\":\"/node_modules/bitcoinjs-lib/src/bufferutils.js\",\"./crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"./merkle\":\"/node_modules/bitcoinjs-lib/src/merkle.js\",\"./transaction\":\"/node_modules/bitcoinjs-lib/src/transaction.js\",\"./types\":\"/node_modules/bitcoinjs-lib/src/types.js\"},\"/node_modules/bitcoinjs-lib/src/bufferutils.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"varuint-bitcoin\":\"/node_modules/varuint-bitcoin/index.js\"},\"/node_modules/bitcoinjs-lib/src/crypto.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"@noble/hashes/ripemd160\":\"/node_modules/@noble/hashes/ripemd160.js\",\"@noble/hashes/sha1\":\"/node_modules/@noble/hashes/sha1.js\",\"@noble/hashes/sha256\":\"/node_modules/@noble/hashes/sha256.js\"},\"/node_modules/bitcoinjs-lib/src/ecc_lib.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\"},\"/node_modules/bitcoinjs-lib/src/index.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./address\":\"/node_modules/bitcoinjs-lib/src/address.js\",\"./block\":\"/node_modules/bitcoinjs-lib/src/block.js\",\"./crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"./ecc_lib\":\"/node_modules/bitcoinjs-lib/src/ecc_lib.js\",\"./networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"./ops\":\"/node_modules/bitcoinjs-lib/src/ops.js\",\"./payments\":\"/node_modules/bitcoinjs-lib/src/payments/index.js\",\"./psbt\":\"/node_modules/bitcoinjs-lib/src/psbt.js\",\"./script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"./transaction\":\"/node_modules/bitcoinjs-lib/src/transaction.js\"},\"/node_modules/bitcoinjs-lib/src/merkle.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\"},\"/node_modules/bitcoinjs-lib/src/networks.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\"},\"/node_modules/bitcoinjs-lib/src/ops.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\"},\"/node_modules/bitcoinjs-lib/src/payments/bip341.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../bufferutils\":\"/node_modules/bitcoinjs-lib/src/bufferutils.js\",\"../crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"../ecc_lib\":\"/node_modules/bitcoinjs-lib/src/ecc_lib.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"buffer\":\"/node_modules/bare-buffer/index.js\"},\"/node_modules/bitcoinjs-lib/src/payments/embed.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./lazy\":\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\"},\"/node_modules/bitcoinjs-lib/src/payments/index.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./embed\":\"/node_modules/bitcoinjs-lib/src/payments/embed.js\",\"./p2ms\":\"/node_modules/bitcoinjs-lib/src/payments/p2ms.js\",\"./p2pk\":\"/node_modules/bitcoinjs-lib/src/payments/p2pk.js\",\"./p2pkh\":\"/node_modules/bitcoinjs-lib/src/payments/p2pkh.js\",\"./p2sh\":\"/node_modules/bitcoinjs-lib/src/payments/p2sh.js\",\"./p2tr\":\"/node_modules/bitcoinjs-lib/src/payments/p2tr.js\",\"./p2wpkh\":\"/node_modules/bitcoinjs-lib/src/payments/p2wpkh.js\",\"./p2wsh\":\"/node_modules/bitcoinjs-lib/src/payments/p2wsh.js\"},\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\"},\"/node_modules/bitcoinjs-lib/src/payments/p2ms.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./lazy\":\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\"},\"/node_modules/bitcoinjs-lib/src/payments/p2pk.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./lazy\":\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\"},\"/node_modules/bitcoinjs-lib/src/payments/p2pkh.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"../networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./lazy\":\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\",\"bs58check\":\"/node_modules/bs58check/index.js\"},\"/node_modules/bitcoinjs-lib/src/payments/p2sh.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"../networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./lazy\":\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\",\"bs58check\":\"/node_modules/bs58check/index.js\"},\"/node_modules/bitcoinjs-lib/src/payments/p2tr.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../address\":\"/node_modules/bitcoinjs-lib/src/address.js\",\"../ecc_lib\":\"/node_modules/bitcoinjs-lib/src/ecc_lib.js\",\"../networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./bip341\":\"/node_modules/bitcoinjs-lib/src/payments/bip341.js\",\"./lazy\":\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\",\"bech32\":\"/node_modules/bech32/dist/index.js\",\"buffer\":\"/node_modules/bare-buffer/index.js\"},\"/node_modules/bitcoinjs-lib/src/payments/p2wpkh.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"../networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./lazy\":\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\",\"bech32\":\"/node_modules/bech32/dist/index.js\"},\"/node_modules/bitcoinjs-lib/src/payments/p2wsh.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"../networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./lazy\":\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\",\"bech32\":\"/node_modules/bech32/dist/index.js\"},\"/node_modules/bitcoinjs-lib/src/psbt.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./address\":\"/node_modules/bitcoinjs-lib/src/address.js\",\"./bufferutils\":\"/node_modules/bitcoinjs-lib/src/bufferutils.js\",\"./networks\":\"/node_modules/bitcoinjs-lib/src/networks.js\",\"./payments\":\"/node_modules/bitcoinjs-lib/src/payments/index.js\",\"./payments/bip341\":\"/node_modules/bitcoinjs-lib/src/payments/bip341.js\",\"./psbt/bip371\":\"/node_modules/bitcoinjs-lib/src/psbt/bip371.js\",\"./psbt/psbtutils\":\"/node_modules/bitcoinjs-lib/src/psbt/psbtutils.js\",\"./script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"./transaction\":\"/node_modules/bitcoinjs-lib/src/transaction.js\",\"bip174\":\"/node_modules/bip174/src/lib/psbt.js\",\"bip174/src/lib/converter/varint\":\"/node_modules/bip174/src/lib/converter/varint.js\",\"bip174/src/lib/utils\":\"/node_modules/bip174/src/lib/utils.js\"},\"/node_modules/bitcoinjs-lib/src/psbt/bip371.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../payments\":\"/node_modules/bitcoinjs-lib/src/payments/index.js\",\"../payments/bip341\":\"/node_modules/bitcoinjs-lib/src/payments/bip341.js\",\"../transaction\":\"/node_modules/bitcoinjs-lib/src/transaction.js\",\"../types\":\"/node_modules/bitcoinjs-lib/src/types.js\",\"./psbtutils\":\"/node_modules/bitcoinjs-lib/src/psbt/psbtutils.js\"},\"/node_modules/bitcoinjs-lib/src/psbt/psbtutils.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"../crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"../payments\":\"/node_modules/bitcoinjs-lib/src/payments/index.js\",\"../script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"../transaction\":\"/node_modules/bitcoinjs-lib/src/transaction.js\",\"bip174/src/lib/converter/varint\":\"/node_modules/bip174/src/lib/converter/varint.js\"},\"/node_modules/bitcoinjs-lib/src/push_data.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./ops\":\"/node_modules/bitcoinjs-lib/src/ops.js\"},\"/node_modules/bitcoinjs-lib/src/script.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./bip66\":\"/node_modules/bitcoinjs-lib/src/bip66.js\",\"./ops\":\"/node_modules/bitcoinjs-lib/src/ops.js\",\"./push_data\":\"/node_modules/bitcoinjs-lib/src/push_data.js\",\"./script_number\":\"/node_modules/bitcoinjs-lib/src/script_number.js\",\"./script_signature\":\"/node_modules/bitcoinjs-lib/src/script_signature.js\",\"./types\":\"/node_modules/bitcoinjs-lib/src/types.js\"},\"/node_modules/bitcoinjs-lib/src/script_number.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\"},\"/node_modules/bitcoinjs-lib/src/script_signature.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./bip66\":\"/node_modules/bitcoinjs-lib/src/bip66.js\",\"./script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"./types\":\"/node_modules/bitcoinjs-lib/src/types.js\"},\"/node_modules/bitcoinjs-lib/src/transaction.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"./bufferutils\":\"/node_modules/bitcoinjs-lib/src/bufferutils.js\",\"./crypto\":\"/node_modules/bitcoinjs-lib/src/crypto.js\",\"./script\":\"/node_modules/bitcoinjs-lib/src/script.js\",\"./types\":\"/node_modules/bitcoinjs-lib/src/types.js\"},\"/node_modules/bitcoinjs-lib/src/types.js\":{\"#package\":\"/node_modules/bitcoinjs-lib/package.json\",\"buffer\":\"/node_modules/bare-buffer/index.js\",\"typeforce\":\"/node_modules/typeforce/index.js\"},\"/node_modules/bitcoinjs-message/index.js\":{\"#package\":\"/node_modules/bitcoinjs-message/package.json\",\"bech32\":\"/node_modules/bitcoinjs-message/node_modules/bech32/index.js\",\"bs58check\":\"/node_modules/bitcoinjs-message/node_modules/bs58check/index.js\",\"buffer-equals\":\"/node_modules/buffer-equals/index.js\",\"create-hash\":\"/node_modules/create-hash/index.js\",\"secp256k1\":\"/node_modules/secp256k1/index.js\",\"varuint-bitcoin\":\"/node_modules/varuint-bitcoin/index.js\"},\"/node_modules/bitcoinjs-message/node_modules/base-x/package.json\":{},\"/node_modules/bitcoinjs-message/node_modules/base-x/src/index.js\":{\"#package\":\"/node_modules/bitcoinjs-message/node_modules/base-x/package.json\",\"safe-buffer\":\"/node_modules/safe-buffer/index.js\"},\"/node_modules/bitcoinjs-message/node_modules/bech32/index.js\":{\"#package\":\"/node_modules/bitcoinjs-message/node_modules/bech32/package.json\"},\"/node_modules/bitcoinjs-message/node_modules/bech32/package.json\":{},\"/node_modules/bitcoinjs-message/node_modules/bs58/index.js\":{\"#package\":\"/node_modules/bitcoinjs-message/node_modules/bs58/package.json\",\"base-x\":\"/node_modules/bitcoinjs-message/node_modules/base-x/src/index.js\"},\"/node_modules/bitcoinjs-message/node_modules/bs58/package.json\":{},\"/node_modules/bitcoinjs-message/node_modules/bs58check/base.js\":{\"#package\":\"/node_modules/bitcoinjs-message/node_modules/bs58check/package.json\",\"bs58\":\"/node_modules/bitcoinjs-message/node_modules/bs58/index.js\",\"safe-buffer\":\"/node_modules/safe-buffer/index.js\"},\"/node_modules/bitcoinjs-message/node_modules/bs58check/index.js\":{\"#package\":\"/node_modules/bitcoinjs-message/node_modules/bs58check/package.json\",\"./base\":\"/node_modules/bitcoinjs-message/node_modules/bs58check/base.js\",\"create-hash\":\"/node_modules/create-hash/index.js\"},\"/node_modules/bitcoinjs-message/node_modules/bs58check/package.json\":{},\"/node_modules/bitcoinjs-message/package.json\":{},\"/node_modules/bn.js/lib/bn.js\":{\"#package\":\"/node_modules/bn.js/package.json\",\"buffer\":\"/node_modules/bare-buffer/index.js\"},\"/node_modules/bn.js/package.json\":{},\"/node_modules/brorand/index.js\":{\"#package\":\"/node_modules/brorand/package.json\",\"crypto\":\"/node_modules/bare-crypto/index.js\"},\"/node_modules/brorand/package.json\":{},\"/node_modules/bs58/index.js\":{\"#package\":\"/node_modules/bs58/package.json\",\"base-x\":\"/node_modules/base-x/src/index.js\"},\"/node_modules/bs58/package.json\":{},\"/node_modules/bs58check/base.js\":{\"#package\":\"/node_modules/bs58check/package.json\",\"bs58\":\"/node_modules/bs58/index.js\"},\"/node_modules/bs58check/index.js\":{\"#package\":\"/node_modules/bs58check/package.json\",\"./base\":\"/node_modules/bs58check/base.js\",\"@noble/hashes/sha256\":\"/node_modules/@noble/hashes/sha256.js\"},\"/node_modules/bs58check/package.json\":{},\"/node_modules/buffer-equals/index.js\":{\"#package\":\"/node_modules/buffer-equals/package.json\"},\"/node_modules/buffer-equals/package.json\":{},\"/node_modules/bufferutil/fallback.js\":{\"#package\":\"/node_modules/bufferutil/package.json\"},\"/node_modules/bufferutil/index.js\":{\"#package\":\"/node_modules/bufferutil/package.json\",\"./fallback\":\"/node_modules/bufferutil/fallback.js\",\"node-gyp-build\":\"/node_modules/node-gyp-build/index.js\"},\"/node_modules/bufferutil/package.json\":{},\"/node_modules/codecs/index.js\":{\"#package\":\"/node_modules/codecs/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/codecs/package.json\":{},\"/node_modules/compact-encoding/endian.js\":{\"#package\":\"/node_modules/compact-encoding/package.json\"},\"/node_modules/compact-encoding/index.js\":{\"#package\":\"/node_modules/compact-encoding/package.json\",\"./endian\":\"/node_modules/compact-encoding/endian.js\",\"./lexint\":\"/node_modules/compact-encoding/lexint.js\",\"./raw\":\"/node_modules/compact-encoding/raw.js\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/compact-encoding/lexint.js\":{\"#package\":\"/node_modules/compact-encoding/package.json\"},\"/node_modules/compact-encoding/package.json\":{},\"/node_modules/compact-encoding/raw.js\":{\"#package\":\"/node_modules/compact-encoding/package.json\",\"./endian\":\"/node_modules/compact-encoding/endian.js\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/core-coupler/index.js\":{\"#package\":\"/node_modules/core-coupler/package.json\",\"safety-catch\":\"/node_modules/safety-catch/index.js\"},\"/node_modules/core-coupler/package.json\":{},\"/node_modules/corestore/index.js\":{\"#package\":\"/node_modules/corestore/package.json\",\"./lib/audit.js\":\"/node_modules/corestore/lib/audit.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"hypercore\":\"/node_modules/hypercore/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"hypercore-id-encoding\":\"/node_modules/hypercore-id-encoding/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\",\"which-runtime\":\"/node_modules/which-runtime/index.js\"},\"/node_modules/corestore/lib/audit.js\":{\"#package\":\"/node_modules/corestore/package.json\"},\"/node_modules/corestore/package.json\":{},\"/node_modules/create-hash/index.js\":{\"#package\":\"/node_modules/create-hash/package.json\",\"crypto\":\"/node_modules/bare-crypto/index.js\"},\"/node_modules/create-hash/package.json\":{},\"/node_modules/debounceify/index.js\":{\"#package\":\"/node_modules/debounceify/package.json\"},\"/node_modules/debounceify/package.json\":{},\"/node_modules/device-file/index.js\":{\"#package\":\"/node_modules/device-file/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"fd-lock\":\"/node_modules/fd-lock/index.js\",\"fs\":\"/node_modules/bare-fs/index.js\",\"fs-native-extensions\":\"/node_modules/fs-native-extensions/index.js\",\"path\":\"/node_modules/bare-path/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\"},\"/node_modules/device-file/package.json\":{},\"/node_modules/ecpair/package.json\":{},\"/node_modules/ecpair/src/ecpair.js\":{\"#package\":\"/node_modules/ecpair/package.json\",\"./networks\":\"/node_modules/ecpair/src/networks.js\",\"./testecc\":\"/node_modules/ecpair/src/testecc.js\",\"./types\":\"/node_modules/ecpair/src/types.js\",\"randombytes\":\"/node_modules/randombytes/index.js\",\"wif\":\"/node_modules/wif/index.js\"},\"/node_modules/ecpair/src/index.js\":{\"#package\":\"/node_modules/ecpair/package.json\",\"./ecpair\":\"/node_modules/ecpair/src/ecpair.js\"},\"/node_modules/ecpair/src/networks.js\":{\"#package\":\"/node_modules/ecpair/package.json\"},\"/node_modules/ecpair/src/testecc.js\":{\"#package\":\"/node_modules/ecpair/package.json\"},\"/node_modules/ecpair/src/types.js\":{\"#package\":\"/node_modules/ecpair/package.json\",\"typeforce\":\"/node_modules/typeforce/index.js\"},\"/node_modules/elliptic/lib/elliptic.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../package.json\":\"/node_modules/elliptic/package.json\",\"./elliptic/curve\":\"/node_modules/elliptic/lib/elliptic/curve/index.js\",\"./elliptic/curves\":\"/node_modules/elliptic/lib/elliptic/curves.js\",\"./elliptic/ec\":\"/node_modules/elliptic/lib/elliptic/ec/index.js\",\"./elliptic/eddsa\":\"/node_modules/elliptic/lib/elliptic/eddsa/index.js\",\"./elliptic/utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"brorand\":\"/node_modules/brorand/index.js\"},\"/node_modules/elliptic/lib/elliptic/curve/base.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\"},\"/node_modules/elliptic/lib/elliptic/curve/edwards.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"./base\":\"/node_modules/elliptic/lib/elliptic/curve/base.js\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\",\"inherits\":\"/node_modules/inherits/inherits.js\"},\"/node_modules/elliptic/lib/elliptic/curve/index.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"./base\":\"/node_modules/elliptic/lib/elliptic/curve/base.js\",\"./edwards\":\"/node_modules/elliptic/lib/elliptic/curve/edwards.js\",\"./mont\":\"/node_modules/elliptic/lib/elliptic/curve/mont.js\",\"./short\":\"/node_modules/elliptic/lib/elliptic/curve/short.js\"},\"/node_modules/elliptic/lib/elliptic/curve/mont.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"./base\":\"/node_modules/elliptic/lib/elliptic/curve/base.js\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\",\"inherits\":\"/node_modules/inherits/inherits.js\"},\"/node_modules/elliptic/lib/elliptic/curve/short.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"./base\":\"/node_modules/elliptic/lib/elliptic/curve/base.js\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\",\"inherits\":\"/node_modules/inherits/inherits.js\"},\"/node_modules/elliptic/lib/elliptic/curves.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"./curve\":\"/node_modules/elliptic/lib/elliptic/curve/index.js\",\"./precomputed/secp256k1\":\"/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\",\"./utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"hash.js\":\"/node_modules/hash.js/lib/hash.js\"},\"/node_modules/elliptic/lib/elliptic/ec/index.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../curves\":\"/node_modules/elliptic/lib/elliptic/curves.js\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"./key\":\"/node_modules/elliptic/lib/elliptic/ec/key.js\",\"./signature\":\"/node_modules/elliptic/lib/elliptic/ec/signature.js\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\",\"brorand\":\"/node_modules/brorand/index.js\",\"hmac-drbg\":\"/node_modules/hmac-drbg/lib/hmac-drbg.js\"},\"/node_modules/elliptic/lib/elliptic/ec/key.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\"},\"/node_modules/elliptic/lib/elliptic/ec/signature.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\"},\"/node_modules/elliptic/lib/elliptic/eddsa/index.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../curves\":\"/node_modules/elliptic/lib/elliptic/curves.js\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"./key\":\"/node_modules/elliptic/lib/elliptic/eddsa/key.js\",\"./signature\":\"/node_modules/elliptic/lib/elliptic/eddsa/signature.js\",\"hash.js\":\"/node_modules/hash.js/lib/hash.js\"},\"/node_modules/elliptic/lib/elliptic/eddsa/key.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\"},\"/node_modules/elliptic/lib/elliptic/eddsa/signature.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"../utils\":\"/node_modules/elliptic/lib/elliptic/utils.js\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\"},\"/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\":{\"#package\":\"/node_modules/elliptic/package.json\"},\"/node_modules/elliptic/lib/elliptic/utils.js\":{\"#package\":\"/node_modules/elliptic/package.json\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\",\"minimalistic-assert\":\"/node_modules/minimalistic-assert/index.js\",\"minimalistic-crypto-utils\":\"/node_modules/minimalistic-crypto-utils/lib/utils.js\"},\"/node_modules/elliptic/package.json\":{},\"/node_modules/encryption-encoding/index.js\":{\"#package\":\"/node_modules/encryption-encoding/package.json\",\"./spec/hyperschema\":\"/node_modules/encryption-encoding/spec/hyperschema/index.js\"},\"/node_modules/encryption-encoding/package.json\":{},\"/node_modules/encryption-encoding/spec/hyperschema/index.js\":{\"#package\":\"/node_modules/encryption-encoding/package.json\",\"hyperschema/runtime\":\"/node_modules/hyperschema/runtime.cjs\"},\"/node_modules/ethers/lib.esm/_version.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\"},\"/node_modules/ethers/lib.esm/abi/abi-coder.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./coders/abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\",\"./coders/address.js\":\"/node_modules/ethers/lib.esm/abi/coders/address.js\",\"./coders/array.js\":\"/node_modules/ethers/lib.esm/abi/coders/array.js\",\"./coders/boolean.js\":\"/node_modules/ethers/lib.esm/abi/coders/boolean.js\",\"./coders/bytes.js\":\"/node_modules/ethers/lib.esm/abi/coders/bytes.js\",\"./coders/fixed-bytes.js\":\"/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js\",\"./coders/null.js\":\"/node_modules/ethers/lib.esm/abi/coders/null.js\",\"./coders/number.js\":\"/node_modules/ethers/lib.esm/abi/coders/number.js\",\"./coders/string.js\":\"/node_modules/ethers/lib.esm/abi/coders/string.js\",\"./coders/tuple.js\":\"/node_modules/ethers/lib.esm/abi/coders/tuple.js\",\"./fragments.js\":\"/node_modules/ethers/lib.esm/abi/fragments.js\"},\"/node_modules/ethers/lib.esm/abi/bytes32.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/abi/coders/address.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../../utils/maths.js\":\"/node_modules/ethers/lib.esm/utils/maths.js\",\"../typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\"},\"/node_modules/ethers/lib.esm/abi/coders/anonymous.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\"},\"/node_modules/ethers/lib.esm/abi/coders/array.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"../typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\",\"./anonymous.js\":\"/node_modules/ethers/lib.esm/abi/coders/anonymous.js\"},\"/node_modules/ethers/lib.esm/abi/coders/boolean.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\"},\"/node_modules/ethers/lib.esm/abi/coders/bytes.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\"},\"/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"../typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\"},\"/node_modules/ethers/lib.esm/abi/coders/null.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\"},\"/node_modules/ethers/lib.esm/abi/coders/number.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"../typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\"},\"/node_modules/ethers/lib.esm/abi/coders/string.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../../utils/utf8.js\":\"/node_modules/ethers/lib.esm/utils/utf8.js\",\"../typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\",\"./bytes.js\":\"/node_modules/ethers/lib.esm/abi/coders/bytes.js\"},\"/node_modules/ethers/lib.esm/abi/coders/tuple.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../../utils/properties.js\":\"/node_modules/ethers/lib.esm/utils/properties.js\",\"../typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\",\"./abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\",\"./array.js\":\"/node_modules/ethers/lib.esm/abi/coders/array.js\"},\"/node_modules/ethers/lib.esm/abi/fragments.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/abi/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./abi-coder.js\":\"/node_modules/ethers/lib.esm/abi/abi-coder.js\",\"./bytes32.js\":\"/node_modules/ethers/lib.esm/abi/bytes32.js\",\"./fragments.js\":\"/node_modules/ethers/lib.esm/abi/fragments.js\",\"./interface.js\":\"/node_modules/ethers/lib.esm/abi/interface.js\",\"./typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\"},\"/node_modules/ethers/lib.esm/abi/interface.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./abi-coder.js\":\"/node_modules/ethers/lib.esm/abi/abi-coder.js\",\"./coders/abstract-coder.js\":\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\",\"./fragments.js\":\"/node_modules/ethers/lib.esm/abi/fragments.js\",\"./typed.js\":\"/node_modules/ethers/lib.esm/abi/typed.js\"},\"/node_modules/ethers/lib.esm/abi/typed.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/address/address.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/address/checks.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./address.js\":\"/node_modules/ethers/lib.esm/address/address.js\"},\"/node_modules/ethers/lib.esm/address/contract-address.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./address.js\":\"/node_modules/ethers/lib.esm/address/address.js\"},\"/node_modules/ethers/lib.esm/address/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./address.js\":\"/node_modules/ethers/lib.esm/address/address.js\",\"./checks.js\":\"/node_modules/ethers/lib.esm/address/checks.js\",\"./contract-address.js\":\"/node_modules/ethers/lib.esm/address/contract-address.js\"},\"/node_modules/ethers/lib.esm/constants/addresses.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\"},\"/node_modules/ethers/lib.esm/constants/hashes.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\"},\"/node_modules/ethers/lib.esm/constants/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./addresses.js\":\"/node_modules/ethers/lib.esm/constants/addresses.js\",\"./hashes.js\":\"/node_modules/ethers/lib.esm/constants/hashes.js\",\"./numbers.js\":\"/node_modules/ethers/lib.esm/constants/numbers.js\",\"./strings.js\":\"/node_modules/ethers/lib.esm/constants/strings.js\"},\"/node_modules/ethers/lib.esm/constants/numbers.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\"},\"/node_modules/ethers/lib.esm/constants/strings.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\"},\"/node_modules/ethers/lib.esm/contract/contract.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../abi/index.js\":\"/node_modules/ethers/lib.esm/abi/index.js\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../providers/provider.js\":\"/node_modules/ethers/lib.esm/providers/provider.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./wrappers.js\":\"/node_modules/ethers/lib.esm/contract/wrappers.js\"},\"/node_modules/ethers/lib.esm/contract/factory.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../abi/index.js\":\"/node_modules/ethers/lib.esm/abi/index.js\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./contract.js\":\"/node_modules/ethers/lib.esm/contract/contract.js\"},\"/node_modules/ethers/lib.esm/contract/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./contract.js\":\"/node_modules/ethers/lib.esm/contract/contract.js\",\"./factory.js\":\"/node_modules/ethers/lib.esm/contract/factory.js\",\"./wrappers.js\":\"/node_modules/ethers/lib.esm/contract/wrappers.js\"},\"/node_modules/ethers/lib.esm/contract/wrappers.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../providers/provider.js\":\"/node_modules/ethers/lib.esm/providers/provider.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/crypto/crypto.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"crypto\":\"/node_modules/bare-crypto/index.js\"},\"/node_modules/ethers/lib.esm/crypto/hmac.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./crypto.js\":\"/node_modules/ethers/lib.esm/crypto/crypto.js\"},\"/node_modules/ethers/lib.esm/crypto/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./hmac.js\":\"/node_modules/ethers/lib.esm/crypto/hmac.js\",\"./keccak.js\":\"/node_modules/ethers/lib.esm/crypto/keccak.js\",\"./pbkdf2.js\":\"/node_modules/ethers/lib.esm/crypto/pbkdf2.js\",\"./random.js\":\"/node_modules/ethers/lib.esm/crypto/random.js\",\"./ripemd160.js\":\"/node_modules/ethers/lib.esm/crypto/ripemd160.js\",\"./scrypt.js\":\"/node_modules/ethers/lib.esm/crypto/scrypt.js\",\"./sha2.js\":\"/node_modules/ethers/lib.esm/crypto/sha2.js\",\"./signature.js\":\"/node_modules/ethers/lib.esm/crypto/signature.js\",\"./signing-key.js\":\"/node_modules/ethers/lib.esm/crypto/signing-key.js\"},\"/node_modules/ethers/lib.esm/crypto/keccak.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"@noble/hashes/sha3\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js\"},\"/node_modules/ethers/lib.esm/crypto/pbkdf2.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./crypto.js\":\"/node_modules/ethers/lib.esm/crypto/crypto.js\"},\"/node_modules/ethers/lib.esm/crypto/random.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./crypto.js\":\"/node_modules/ethers/lib.esm/crypto/crypto.js\"},\"/node_modules/ethers/lib.esm/crypto/ripemd160.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"@noble/hashes/ripemd160\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js\"},\"/node_modules/ethers/lib.esm/crypto/scrypt.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"@noble/hashes/scrypt\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js\"},\"/node_modules/ethers/lib.esm/crypto/sha2.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./crypto.js\":\"/node_modules/ethers/lib.esm/crypto/crypto.js\"},\"/node_modules/ethers/lib.esm/crypto/signature.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../constants/index.js\":\"/node_modules/ethers/lib.esm/constants/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/crypto/signing-key.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./signature.js\":\"/node_modules/ethers/lib.esm/crypto/signature.js\",\"@noble/curves/secp256k1\":\"/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js\"},\"/node_modules/ethers/lib.esm/ethers.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./_version.js\":\"/node_modules/ethers/lib.esm/_version.js\",\"./abi/index.js\":\"/node_modules/ethers/lib.esm/abi/index.js\",\"./address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"./constants/index.js\":\"/node_modules/ethers/lib.esm/constants/index.js\",\"./contract/index.js\":\"/node_modules/ethers/lib.esm/contract/index.js\",\"./crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"./hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"./providers/index.js\":\"/node_modules/ethers/lib.esm/providers/index.js\",\"./transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"./utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./wallet/index.js\":\"/node_modules/ethers/lib.esm/wallet/index.js\",\"./wordlists/index.js\":\"/node_modules/ethers/lib.esm/wordlists/index.js\"},\"/node_modules/ethers/lib.esm/hash/authorization.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/hash/id.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/hash/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./authorization.js\":\"/node_modules/ethers/lib.esm/hash/authorization.js\",\"./id.js\":\"/node_modules/ethers/lib.esm/hash/id.js\",\"./message.js\":\"/node_modules/ethers/lib.esm/hash/message.js\",\"./namehash.js\":\"/node_modules/ethers/lib.esm/hash/namehash.js\",\"./solidity.js\":\"/node_modules/ethers/lib.esm/hash/solidity.js\",\"./typed-data.js\":\"/node_modules/ethers/lib.esm/hash/typed-data.js\"},\"/node_modules/ethers/lib.esm/hash/message.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../constants/index.js\":\"/node_modules/ethers/lib.esm/constants/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/hash/namehash.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"@adraffy/ens-normalize\":\"/node_modules/@adraffy/ens-normalize/dist/index.mjs\"},\"/node_modules/ethers/lib.esm/hash/solidity.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/hash/typed-data.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./id.js\":\"/node_modules/ethers/lib.esm/hash/id.js\"},\"/node_modules/ethers/lib.esm/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./ethers.js\":\"/node_modules/ethers/lib.esm/ethers.js\"},\"/node_modules/ethers/lib.esm/package.json\":{},\"/node_modules/ethers/lib.esm/providers/abstract-provider.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../constants/index.js\":\"/node_modules/ethers/lib.esm/constants/index.js\",\"../contract/index.js\":\"/node_modules/ethers/lib.esm/contract/index.js\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./ens-resolver.js\":\"/node_modules/ethers/lib.esm/providers/ens-resolver.js\",\"./format.js\":\"/node_modules/ethers/lib.esm/providers/format.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider.js\":\"/node_modules/ethers/lib.esm/providers/provider.js\",\"./subscriber-polling.js\":\"/node_modules/ethers/lib.esm/providers/subscriber-polling.js\"},\"/node_modules/ethers/lib.esm/providers/abstract-signer.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./provider.js\":\"/node_modules/ethers/lib.esm/providers/provider.js\"},\"/node_modules/ethers/lib.esm/providers/community.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\"},\"/node_modules/ethers/lib.esm/providers/default-provider.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-alchemy.js\":\"/node_modules/ethers/lib.esm/providers/provider-alchemy.js\",\"./provider-ankr.js\":\"/node_modules/ethers/lib.esm/providers/provider-ankr.js\",\"./provider-chainstack.js\":\"/node_modules/ethers/lib.esm/providers/provider-chainstack.js\",\"./provider-cloudflare.js\":\"/node_modules/ethers/lib.esm/providers/provider-cloudflare.js\",\"./provider-etherscan.js\":\"/node_modules/ethers/lib.esm/providers/provider-etherscan.js\",\"./provider-fallback.js\":\"/node_modules/ethers/lib.esm/providers/provider-fallback.js\",\"./provider-infura.js\":\"/node_modules/ethers/lib.esm/providers/provider-infura.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\",\"./provider-quicknode.js\":\"/node_modules/ethers/lib.esm/providers/provider-quicknode.js\",\"./provider-websocket.js\":\"/node_modules/ethers/lib.esm/providers/provider-websocket.js\"},\"/node_modules/ethers/lib.esm/providers/ens-resolver.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../constants/index.js\":\"/node_modules/ethers/lib.esm/constants/index.js\",\"../contract/index.js\":\"/node_modules/ethers/lib.esm/contract/index.js\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/providers/format.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/providers/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./abstract-provider.js\":\"/node_modules/ethers/lib.esm/providers/abstract-provider.js\",\"./abstract-signer.js\":\"/node_modules/ethers/lib.esm/providers/abstract-signer.js\",\"./community.js\":\"/node_modules/ethers/lib.esm/providers/community.js\",\"./default-provider.js\":\"/node_modules/ethers/lib.esm/providers/default-provider.js\",\"./ens-resolver.js\":\"/node_modules/ethers/lib.esm/providers/ens-resolver.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./plugins-network.js\":\"/node_modules/ethers/lib.esm/providers/plugins-network.js\",\"./provider-alchemy.js\":\"/node_modules/ethers/lib.esm/providers/provider-alchemy.js\",\"./provider-ankr.js\":\"/node_modules/ethers/lib.esm/providers/provider-ankr.js\",\"./provider-blockscout.js\":\"/node_modules/ethers/lib.esm/providers/provider-blockscout.js\",\"./provider-browser.js\":\"/node_modules/ethers/lib.esm/providers/provider-browser.js\",\"./provider-chainstack.js\":\"/node_modules/ethers/lib.esm/providers/provider-chainstack.js\",\"./provider-cloudflare.js\":\"/node_modules/ethers/lib.esm/providers/provider-cloudflare.js\",\"./provider-etherscan.js\":\"/node_modules/ethers/lib.esm/providers/provider-etherscan.js\",\"./provider-fallback.js\":\"/node_modules/ethers/lib.esm/providers/provider-fallback.js\",\"./provider-infura.js\":\"/node_modules/ethers/lib.esm/providers/provider-infura.js\",\"./provider-ipcsocket.js\":\"/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\",\"./provider-pocket.js\":\"/node_modules/ethers/lib.esm/providers/provider-pocket.js\",\"./provider-quicknode.js\":\"/node_modules/ethers/lib.esm/providers/provider-quicknode.js\",\"./provider-socket.js\":\"/node_modules/ethers/lib.esm/providers/provider-socket.js\",\"./provider-websocket.js\":\"/node_modules/ethers/lib.esm/providers/provider-websocket.js\",\"./provider.js\":\"/node_modules/ethers/lib.esm/providers/provider.js\",\"./signer-noncemanager.js\":\"/node_modules/ethers/lib.esm/providers/signer-noncemanager.js\"},\"/node_modules/ethers/lib.esm/providers/network.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./plugins-network.js\":\"/node_modules/ethers/lib.esm/providers/plugins-network.js\"},\"/node_modules/ethers/lib.esm/providers/plugins-network.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"../utils/properties.js\":\"/node_modules/ethers/lib.esm/utils/properties.js\"},\"/node_modules/ethers/lib.esm/providers/provider-alchemy.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./community.js\":\"/node_modules/ethers/lib.esm/providers/community.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-ankr.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./community.js\":\"/node_modules/ethers/lib.esm/providers/community.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-blockscout.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-browser.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-chainstack.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./community.js\":\"/node_modules/ethers/lib.esm/providers/community.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-cloudflare.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-etherscan.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../abi/index.js\":\"/node_modules/ethers/lib.esm/abi/index.js\",\"../contract/index.js\":\"/node_modules/ethers/lib.esm/contract/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./abstract-provider.js\":\"/node_modules/ethers/lib.esm/providers/abstract-provider.js\",\"./community.js\":\"/node_modules/ethers/lib.esm/providers/community.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./plugins-network.js\":\"/node_modules/ethers/lib.esm/providers/plugins-network.js\"},\"/node_modules/ethers/lib.esm/providers/provider-fallback.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./abstract-provider.js\":\"/node_modules/ethers/lib.esm/providers/abstract-provider.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\"},\"/node_modules/ethers/lib.esm/providers/provider-infura.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./community.js\":\"/node_modules/ethers/lib.esm/providers/community.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\",\"./provider-websocket.js\":\"/node_modules/ethers/lib.esm/providers/provider-websocket.js\"},\"/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./provider-socket.js\":\"/node_modules/ethers/lib.esm/providers/provider-socket.js\",\"net\":\"/node_modules/bare-net/index.js\"},\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../abi/index.js\":\"/node_modules/ethers/lib.esm/abi/index.js\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./abstract-provider.js\":\"/node_modules/ethers/lib.esm/providers/abstract-provider.js\",\"./abstract-signer.js\":\"/node_modules/ethers/lib.esm/providers/abstract-signer.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./subscriber-filterid.js\":\"/node_modules/ethers/lib.esm/providers/subscriber-filterid.js\",\"./subscriber-polling.js\":\"/node_modules/ethers/lib.esm/providers/subscriber-polling.js\"},\"/node_modules/ethers/lib.esm/providers/provider-pocket.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./community.js\":\"/node_modules/ethers/lib.esm/providers/community.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-quicknode.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./community.js\":\"/node_modules/ethers/lib.esm/providers/community.js\",\"./network.js\":\"/node_modules/ethers/lib.esm/providers/network.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-socket.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./abstract-provider.js\":\"/node_modules/ethers/lib.esm/providers/abstract-provider.js\",\"./provider-jsonrpc.js\":\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\"},\"/node_modules/ethers/lib.esm/providers/provider-websocket.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./provider-socket.js\":\"/node_modules/ethers/lib.esm/providers/provider-socket.js\",\"./ws.js\":\"/node_modules/ethers/lib.esm/providers/ws.js\"},\"/node_modules/ethers/lib.esm/providers/provider.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/providers/signer-noncemanager.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./abstract-signer.js\":\"/node_modules/ethers/lib.esm/providers/abstract-signer.js\"},\"/node_modules/ethers/lib.esm/providers/subscriber-filterid.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./subscriber-polling.js\":\"/node_modules/ethers/lib.esm/providers/subscriber-polling.js\"},\"/node_modules/ethers/lib.esm/providers/subscriber-polling.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/providers/ws.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"ws\":\"/node_modules/ws/wrapper.mjs\"},\"/node_modules/ethers/lib.esm/transaction/accesslist.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/transaction/address.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\"},\"/node_modules/ethers/lib.esm/transaction/authorization.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/transaction/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./accesslist.js\":\"/node_modules/ethers/lib.esm/transaction/accesslist.js\",\"./address.js\":\"/node_modules/ethers/lib.esm/transaction/address.js\",\"./authorization.js\":\"/node_modules/ethers/lib.esm/transaction/authorization.js\",\"./transaction.js\":\"/node_modules/ethers/lib.esm/transaction/transaction.js\"},\"/node_modules/ethers/lib.esm/transaction/transaction.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../constants/addresses.js\":\"/node_modules/ethers/lib.esm/constants/addresses.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./accesslist.js\":\"/node_modules/ethers/lib.esm/transaction/accesslist.js\",\"./address.js\":\"/node_modules/ethers/lib.esm/transaction/address.js\",\"./authorization.js\":\"/node_modules/ethers/lib.esm/transaction/authorization.js\"},\"/node_modules/ethers/lib.esm/utils/base58.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\",\"./maths.js\":\"/node_modules/ethers/lib.esm/utils/maths.js\"},\"/node_modules/ethers/lib.esm/utils/base64.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\"},\"/node_modules/ethers/lib.esm/utils/data.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\"},\"/node_modules/ethers/lib.esm/utils/errors.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../_version.js\":\"/node_modules/ethers/lib.esm/_version.js\",\"./properties.js\":\"/node_modules/ethers/lib.esm/utils/properties.js\"},\"/node_modules/ethers/lib.esm/utils/events.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./properties.js\":\"/node_modules/ethers/lib.esm/utils/properties.js\"},\"/node_modules/ethers/lib.esm/utils/fetch.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./base64.js\":\"/node_modules/ethers/lib.esm/utils/base64.js\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\",\"./geturl.js\":\"/node_modules/ethers/lib.esm/utils/geturl.js\",\"./properties.js\":\"/node_modules/ethers/lib.esm/utils/properties.js\",\"./utf8.js\":\"/node_modules/ethers/lib.esm/utils/utf8.js\"},\"/node_modules/ethers/lib.esm/utils/fixednumber.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\",\"./maths.js\":\"/node_modules/ethers/lib.esm/utils/maths.js\",\"./properties.js\":\"/node_modules/ethers/lib.esm/utils/properties.js\"},\"/node_modules/ethers/lib.esm/utils/geturl.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\",\"http\":\"/node_modules/bare-http1/index.js\",\"https\":\"/node_modules/bare-https/index.js\",\"zlib\":\"/node_modules/bare-zlib/index.js\"},\"/node_modules/ethers/lib.esm/utils/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./base58.js\":\"/node_modules/ethers/lib.esm/utils/base58.js\",\"./base64.js\":\"/node_modules/ethers/lib.esm/utils/base64.js\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\",\"./events.js\":\"/node_modules/ethers/lib.esm/utils/events.js\",\"./fetch.js\":\"/node_modules/ethers/lib.esm/utils/fetch.js\",\"./fixednumber.js\":\"/node_modules/ethers/lib.esm/utils/fixednumber.js\",\"./maths.js\":\"/node_modules/ethers/lib.esm/utils/maths.js\",\"./properties.js\":\"/node_modules/ethers/lib.esm/utils/properties.js\",\"./rlp-decode.js\":\"/node_modules/ethers/lib.esm/utils/rlp-decode.js\",\"./rlp-encode.js\":\"/node_modules/ethers/lib.esm/utils/rlp-encode.js\",\"./units.js\":\"/node_modules/ethers/lib.esm/utils/units.js\",\"./utf8.js\":\"/node_modules/ethers/lib.esm/utils/utf8.js\",\"./uuid.js\":\"/node_modules/ethers/lib.esm/utils/uuid.js\"},\"/node_modules/ethers/lib.esm/utils/maths.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\"},\"/node_modules/ethers/lib.esm/utils/properties.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\"},\"/node_modules/ethers/lib.esm/utils/rlp-decode.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\"},\"/node_modules/ethers/lib.esm/utils/rlp-encode.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\"},\"/node_modules/ethers/lib.esm/utils/units.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\",\"./fixednumber.js\":\"/node_modules/ethers/lib.esm/utils/fixednumber.js\",\"./maths.js\":\"/node_modules/ethers/lib.esm/utils/maths.js\"},\"/node_modules/ethers/lib.esm/utils/utf8.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\",\"./errors.js\":\"/node_modules/ethers/lib.esm/utils/errors.js\"},\"/node_modules/ethers/lib.esm/utils/uuid.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./data.js\":\"/node_modules/ethers/lib.esm/utils/data.js\"},\"/node_modules/ethers/lib.esm/wallet/base-wallet.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../providers/index.js\":\"/node_modules/ethers/lib.esm/providers/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/wallet/hdwallet.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../providers/index.js\":\"/node_modules/ethers/lib.esm/providers/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"../wordlists/lang-en.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-en.js\",\"./base-wallet.js\":\"/node_modules/ethers/lib.esm/wallet/base-wallet.js\",\"./json-keystore.js\":\"/node_modules/ethers/lib.esm/wallet/json-keystore.js\",\"./mnemonic.js\":\"/node_modules/ethers/lib.esm/wallet/mnemonic.js\"},\"/node_modules/ethers/lib.esm/wallet/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./base-wallet.js\":\"/node_modules/ethers/lib.esm/wallet/base-wallet.js\",\"./hdwallet.js\":\"/node_modules/ethers/lib.esm/wallet/hdwallet.js\",\"./json-crowdsale.js\":\"/node_modules/ethers/lib.esm/wallet/json-crowdsale.js\",\"./json-keystore.js\":\"/node_modules/ethers/lib.esm/wallet/json-keystore.js\",\"./mnemonic.js\":\"/node_modules/ethers/lib.esm/wallet/mnemonic.js\",\"./wallet.js\":\"/node_modules/ethers/lib.esm/wallet/wallet.js\"},\"/node_modules/ethers/lib.esm/wallet/json-crowdsale.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./utils.js\":\"/node_modules/ethers/lib.esm/wallet/utils.js\",\"aes-js\":\"/node_modules/aes-js/lib.esm/index.js\"},\"/node_modules/ethers/lib.esm/wallet/json-keystore.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../_version.js\":\"/node_modules/ethers/lib.esm/_version.js\",\"../address/index.js\":\"/node_modules/ethers/lib.esm/address/index.js\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../transaction/index.js\":\"/node_modules/ethers/lib.esm/transaction/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./utils.js\":\"/node_modules/ethers/lib.esm/wallet/utils.js\",\"aes-js\":\"/node_modules/aes-js/lib.esm/index.js\"},\"/node_modules/ethers/lib.esm/wallet/mnemonic.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"../wordlists/lang-en.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-en.js\"},\"/node_modules/ethers/lib.esm/wallet/utils.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/wallet/wallet.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../crypto/index.js\":\"/node_modules/ethers/lib.esm/crypto/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./base-wallet.js\":\"/node_modules/ethers/lib.esm/wallet/base-wallet.js\",\"./hdwallet.js\":\"/node_modules/ethers/lib.esm/wallet/hdwallet.js\",\"./json-crowdsale.js\":\"/node_modules/ethers/lib.esm/wallet/json-crowdsale.js\",\"./json-keystore.js\":\"/node_modules/ethers/lib.esm/wallet/json-keystore.js\",\"./mnemonic.js\":\"/node_modules/ethers/lib.esm/wallet/mnemonic.js\"},\"/node_modules/ethers/lib.esm/wordlists/bit-reader.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\"},\"/node_modules/ethers/lib.esm/wordlists/decode-owl.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/wordlists/decode-owla.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./bit-reader.js\":\"/node_modules/ethers/lib.esm/wordlists/bit-reader.js\",\"./decode-owl.js\":\"/node_modules/ethers/lib.esm/wordlists/decode-owl.js\"},\"/node_modules/ethers/lib.esm/wordlists/index.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./lang-en.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-en.js\",\"./wordlist-owl.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js\",\"./wordlist-owla.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js\",\"./wordlist.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist.js\",\"./wordlists.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlists.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-cz.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./wordlist-owl.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-en.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./wordlist-owl.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-es.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./wordlist-owla.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-fr.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./wordlist-owla.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-it.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./wordlist-owl.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-ja.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./wordlist.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-ko.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./wordlist.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-pt.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./wordlist-owl.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js\"},\"/node_modules/ethers/lib.esm/wordlists/lang-zh.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./wordlist.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist.js\"},\"/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../hash/index.js\":\"/node_modules/ethers/lib.esm/hash/index.js\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\",\"./decode-owl.js\":\"/node_modules/ethers/lib.esm/wordlists/decode-owl.js\",\"./wordlist.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist.js\"},\"/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./decode-owla.js\":\"/node_modules/ethers/lib.esm/wordlists/decode-owla.js\",\"./wordlist-owl.js\":\"/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js\"},\"/node_modules/ethers/lib.esm/wordlists/wordlist.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"../utils/index.js\":\"/node_modules/ethers/lib.esm/utils/index.js\"},\"/node_modules/ethers/lib.esm/wordlists/wordlists.js\":{\"#package\":\"/node_modules/ethers/lib.esm/package.json\",\"./lang-cz.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-cz.js\",\"./lang-en.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-en.js\",\"./lang-es.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-es.js\",\"./lang-fr.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-fr.js\",\"./lang-it.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-it.js\",\"./lang-ja.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-ja.js\",\"./lang-ko.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-ko.js\",\"./lang-pt.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-pt.js\",\"./lang-zh.js\":\"/node_modules/ethers/lib.esm/wordlists/lang-zh.js\"},\"/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\",\"./abstract/weierstrass.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js\",\"@noble/hashes/hmac\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js\",\"@noble/hashes/utils\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\",\"./modular.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js\"},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\",\"./modular.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js\"},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js\"},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\"},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\",\"./curve.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js\",\"./modular.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js\"},\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\":{},\"/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\",\"./_shortw_utils.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js\",\"./abstract/hash-to-curve.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js\",\"./abstract/modular.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js\",\"./abstract/utils.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js\",\"./abstract/weierstrass.js\":\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js\",\"@noble/hashes/sha256\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js\",\"@noble/hashes/utils\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"./_assert.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"node:crypto\":\"/node_modules/bare-crypto/index.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"./_assert.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\":{},\"/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"./_assert.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js\",\"./hmac.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"./_sha2.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"./_assert.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js\",\"./pbkdf2.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js\",\"./sha256.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"./_sha2.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"./_assert.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js\",\"./_u64.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js\",\"./utils.js\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\"},\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\":{\"#package\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\",\"@noble/hashes/crypto\":\"/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js\"},\"/node_modules/events-universal/bare.js\":{\"#package\":\"/node_modules/events-universal/package.json\",\"bare-events\":\"/node_modules/bare-events/index.js\"},\"/node_modules/events-universal/package.json\":{},\"/node_modules/fast-fifo/fixed-size.js\":{\"#package\":\"/node_modules/fast-fifo/package.json\"},\"/node_modules/fast-fifo/index.js\":{\"#package\":\"/node_modules/fast-fifo/package.json\",\"./fixed-size\":\"/node_modules/fast-fifo/fixed-size.js\"},\"/node_modules/fast-fifo/package.json\":{},\"/node_modules/fd-lock/index.js\":{\"#package\":\"/node_modules/fd-lock/package.json\",\"fs\":\"/node_modules/bare-fs/index.js\",\"fs-native-extensions\":\"/node_modules/fs-native-extensions/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"resource-on-exit\":\"/node_modules/resource-on-exit/index.js\"},\"/node_modules/fd-lock/package.json\":{},\"/node_modules/file-uri-to-path/index.js\":{\"#package\":\"/node_modules/file-uri-to-path/package.json\",\"path\":\"/node_modules/bare-path/index.js\"},\"/node_modules/file-uri-to-path/package.json\":{},\"/node_modules/flat-tree/index.js\":{\"#package\":\"/node_modules/flat-tree/package.json\"},\"/node_modules/flat-tree/package.json\":{},\"/node_modules/fs-native-extensions/binding.js\":{\"#package\":\"/node_modules/fs-native-extensions/package.json\",\".\":\"linked:libfs-native-extensions.1.4.5.so\",\"require-addon\":\"/node_modules/require-addon/lib/bare.js\"},\"/node_modules/fs-native-extensions/index.js\":{\"#package\":\"/node_modules/fs-native-extensions/package.json\",\"./binding\":\"/node_modules/fs-native-extensions/binding.js\",\"which-runtime\":\"/node_modules/which-runtime/index.js\"},\"/node_modules/fs-native-extensions/package.json\":{},\"/node_modules/hash.js/lib/hash.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"./hash/common\":\"/node_modules/hash.js/lib/hash/common.js\",\"./hash/hmac\":\"/node_modules/hash.js/lib/hash/hmac.js\",\"./hash/ripemd\":\"/node_modules/hash.js/lib/hash/ripemd.js\",\"./hash/sha\":\"/node_modules/hash.js/lib/hash/sha.js\",\"./hash/utils\":\"/node_modules/hash.js/lib/hash/utils.js\"},\"/node_modules/hash.js/lib/hash/common.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"./utils\":\"/node_modules/hash.js/lib/hash/utils.js\",\"minimalistic-assert\":\"/node_modules/minimalistic-assert/index.js\"},\"/node_modules/hash.js/lib/hash/hmac.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"./utils\":\"/node_modules/hash.js/lib/hash/utils.js\",\"minimalistic-assert\":\"/node_modules/minimalistic-assert/index.js\"},\"/node_modules/hash.js/lib/hash/ripemd.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"./common\":\"/node_modules/hash.js/lib/hash/common.js\",\"./utils\":\"/node_modules/hash.js/lib/hash/utils.js\"},\"/node_modules/hash.js/lib/hash/sha.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"./sha/1\":\"/node_modules/hash.js/lib/hash/sha/1.js\",\"./sha/224\":\"/node_modules/hash.js/lib/hash/sha/224.js\",\"./sha/256\":\"/node_modules/hash.js/lib/hash/sha/256.js\",\"./sha/384\":\"/node_modules/hash.js/lib/hash/sha/384.js\",\"./sha/512\":\"/node_modules/hash.js/lib/hash/sha/512.js\"},\"/node_modules/hash.js/lib/hash/sha/1.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"../common\":\"/node_modules/hash.js/lib/hash/common.js\",\"../utils\":\"/node_modules/hash.js/lib/hash/utils.js\",\"./common\":\"/node_modules/hash.js/lib/hash/sha/common.js\"},\"/node_modules/hash.js/lib/hash/sha/224.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"../utils\":\"/node_modules/hash.js/lib/hash/utils.js\",\"./256\":\"/node_modules/hash.js/lib/hash/sha/256.js\"},\"/node_modules/hash.js/lib/hash/sha/256.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"../common\":\"/node_modules/hash.js/lib/hash/common.js\",\"../utils\":\"/node_modules/hash.js/lib/hash/utils.js\",\"./common\":\"/node_modules/hash.js/lib/hash/sha/common.js\",\"minimalistic-assert\":\"/node_modules/minimalistic-assert/index.js\"},\"/node_modules/hash.js/lib/hash/sha/384.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"../utils\":\"/node_modules/hash.js/lib/hash/utils.js\",\"./512\":\"/node_modules/hash.js/lib/hash/sha/512.js\"},\"/node_modules/hash.js/lib/hash/sha/512.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"../common\":\"/node_modules/hash.js/lib/hash/common.js\",\"../utils\":\"/node_modules/hash.js/lib/hash/utils.js\",\"minimalistic-assert\":\"/node_modules/minimalistic-assert/index.js\"},\"/node_modules/hash.js/lib/hash/sha/common.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"../utils\":\"/node_modules/hash.js/lib/hash/utils.js\"},\"/node_modules/hash.js/lib/hash/utils.js\":{\"#package\":\"/node_modules/hash.js/package.json\",\"inherits\":\"/node_modules/inherits/inherits.js\",\"minimalistic-assert\":\"/node_modules/minimalistic-assert/index.js\"},\"/node_modules/hash.js/package.json\":{},\"/node_modules/hmac-drbg/lib/hmac-drbg.js\":{\"#package\":\"/node_modules/hmac-drbg/package.json\",\"hash.js\":\"/node_modules/hash.js/lib/hash.js\",\"minimalistic-assert\":\"/node_modules/minimalistic-assert/index.js\",\"minimalistic-crypto-utils\":\"/node_modules/minimalistic-crypto-utils/lib/utils.js\"},\"/node_modules/hmac-drbg/package.json\":{},\"/node_modules/hyperbee/index.js\":{\"#package\":\"/node_modules/hyperbee/package.json\",\"./iterators/diff\":\"/node_modules/hyperbee/iterators/diff.js\",\"./iterators/history\":\"/node_modules/hyperbee/iterators/history.js\",\"./iterators/local\":\"/node_modules/hyperbee/iterators/local.js\",\"./iterators/range\":\"/node_modules/hyperbee/iterators/range.js\",\"./lib/extension\":\"/node_modules/hyperbee/lib/extension.js\",\"./lib/messages\":\"/node_modules/hyperbee/lib/messages.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"codecs\":\"/node_modules/codecs/index.js\",\"debounceify\":\"/node_modules/debounceify/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"mutexify/promise\":\"/node_modules/mutexify/promise.js\",\"rache\":\"/node_modules/rache/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"resolve-reject-promise\":\"/node_modules/resolve-reject-promise/index.js\",\"safety-catch\":\"/node_modules/safety-catch/index.js\",\"streamx\":\"/node_modules/streamx/index.js\",\"unslab\":\"/node_modules/unslab/index.js\"},\"/node_modules/hyperbee/iterators/diff.js\":{\"#package\":\"/node_modules/hyperbee/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/hyperbee/iterators/history.js\":{\"#package\":\"/node_modules/hyperbee/package.json\"},\"/node_modules/hyperbee/iterators/local.js\":{\"#package\":\"/node_modules/hyperbee/package.json\"},\"/node_modules/hyperbee/iterators/range.js\":{\"#package\":\"/node_modules/hyperbee/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/hyperbee/lib/extension.js\":{\"#package\":\"/node_modules/hyperbee/package.json\",\"./messages\":\"/node_modules/hyperbee/lib/messages.js\"},\"/node_modules/hyperbee/lib/messages.js\":{\"#package\":\"/node_modules/hyperbee/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"protocol-buffers-encodings\":\"/node_modules/protocol-buffers-encodings/index.js\"},\"/node_modules/hyperbee/package.json\":{},\"/node_modules/hypercore-crypto/index.js\":{\"#package\":\"/node_modules/hypercore-crypto/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/hypercore-crypto/package.json\":{},\"/node_modules/hypercore-errors/index.js\":{\"#package\":\"/node_modules/hypercore-errors/package.json\",\"hypercore-id-encoding\":\"/node_modules/hypercore-id-encoding/index.js\"},\"/node_modules/hypercore-errors/package.json\":{},\"/node_modules/hypercore-id-encoding/index.js\":{\"#package\":\"/node_modules/hypercore-id-encoding/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"z32\":\"/node_modules/z32/index.js\"},\"/node_modules/hypercore-id-encoding/package.json\":{},\"/node_modules/hypercore-storage/index.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"./lib/keys.js\":\"/node_modules/hypercore-storage/lib/keys.js\",\"./lib/streams.js\":\"/node_modules/hypercore-storage/lib/streams.js\",\"./lib/tx.js\":\"/node_modules/hypercore-storage/lib/tx.js\",\"./lib/view.js\":\"/node_modules/hypercore-storage/lib/view.js\",\"./migrations/0\":\"/node_modules/hypercore-storage/migrations/0/index.js\",\"device-file\":\"/node_modules/device-file/index.js\",\"fs\":\"/node_modules/bare-fs/index.js\",\"path\":\"/node_modules/bare-path/index.js\",\"resolve-reject-promise\":\"/node_modules/resolve-reject-promise/index.js\",\"rocksdb-native\":\"/node_modules/rocksdb-native/index.js\",\"scope-lock\":\"/node_modules/scope-lock/index.js\"},\"/node_modules/hypercore-storage/lib/block-dependency-stream.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"./keys\":\"/node_modules/hypercore-storage/lib/keys.js\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/hypercore-storage/lib/close-error-stream.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/hypercore-storage/lib/keys.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"index-encoder\":\"/node_modules/index-encoder/index.js\"},\"/node_modules/hypercore-storage/lib/streams.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"../spec/hyperschema\":\"/node_modules/hypercore-storage/spec/hyperschema/index.js\",\"./block-dependency-stream.js\":\"/node_modules/hypercore-storage/lib/block-dependency-stream.js\",\"./keys.js\":\"/node_modules/hypercore-storage/lib/keys.js\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/hypercore-storage/lib/tx.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"../spec/hyperschema\":\"/node_modules/hypercore-storage/spec/hyperschema/index.js\",\"./keys.js\":\"/node_modules/hypercore-storage/lib/keys.js\",\"./view.js\":\"/node_modules/hypercore-storage/lib/view.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\"},\"/node_modules/hypercore-storage/lib/view.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"./close-error-stream.js\":\"/node_modules/hypercore-storage/lib/close-error-stream.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/hypercore-storage/migrations/0/index.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"../../lib/tx.js\":\"/node_modules/hypercore-storage/lib/tx.js\",\"../../lib/view.js\":\"/node_modules/hypercore-storage/lib/view.js\",\"./messages.js\":\"/node_modules/hypercore-storage/migrations/0/messages.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\",\"fs\":\"/node_modules/bare-fs/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"path\":\"/node_modules/bare-path/index.js\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/hypercore-storage/migrations/0/messages.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\"},\"/node_modules/hypercore-storage/package.json\":{},\"/node_modules/hypercore-storage/spec/hyperschema/index.js\":{\"#package\":\"/node_modules/hypercore-storage/package.json\",\"hyperschema/runtime\":\"/node_modules/hyperschema/runtime.cjs\"},\"/node_modules/hypercore/index.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./lib/caps\":\"/node_modules/hypercore/lib/caps.js\",\"./lib/core\":\"/node_modules/hypercore/lib/core.js\",\"./lib/default-encryption\":\"/node_modules/hypercore/lib/default-encryption.js\",\"./lib/download\":\"/node_modules/hypercore/lib/download.js\",\"./lib/info\":\"/node_modules/hypercore/lib/info.js\",\"./lib/inspect\":\"/node_modules/hypercore/lib/inspect.js\",\"./lib/merkle-tree\":\"/node_modules/hypercore/lib/merkle-tree.js\",\"./lib/replicator\":\"/node_modules/hypercore/lib/replicator.js\",\"./lib/streams\":\"/node_modules/hypercore/lib/streams.js\",\"./lib/verifier\":\"/node_modules/hypercore/lib/verifier.js\",\"@hyperswarm/secret-stream\":\"/node_modules/@hyperswarm/secret-stream/index.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"events\":\"/node_modules/bare-events/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"hypercore-id-encoding\":\"/node_modules/hypercore-id-encoding/index.js\",\"hypercore-storage\":\"/node_modules/hypercore-storage/index.js\",\"is-options\":\"/node_modules/is-options/index.js\",\"protomux\":\"/node_modules/protomux/index.js\",\"safety-catch\":\"/node_modules/safety-catch/index.js\",\"unslab\":\"/node_modules/unslab/index.js\"},\"/node_modules/hypercore/lib/audit.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./merkle-tree\":\"/node_modules/hypercore/lib/merkle-tree.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\"},\"/node_modules/hypercore/lib/bit-interlude.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./compat\":\"/node_modules/hypercore/lib/compat.js\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/hypercore/lib/bitfield.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./compat\":\"/node_modules/hypercore/lib/compat.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"big-sparse-array\":\"/node_modules/big-sparse-array/index.js\"},\"/node_modules/hypercore/lib/caps.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/hypercore/lib/compat.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"quickbit-universal\":\"/node_modules/quickbit-universal/index.js\",\"quickbit-universal/fallback\":\"/node_modules/quickbit-universal/fallback.js\"},\"/node_modules/hypercore/lib/copy-prologue.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./bitfield\":\"/node_modules/hypercore/lib/bitfield.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"quickbit-universal\":\"/node_modules/quickbit-universal/index.js\"},\"/node_modules/hypercore/lib/core.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./audit\":\"/node_modules/hypercore/lib/audit.js\",\"./bit-interlude\":\"/node_modules/hypercore/lib/bit-interlude.js\",\"./bitfield\":\"/node_modules/hypercore/lib/bitfield.js\",\"./copy-prologue\":\"/node_modules/hypercore/lib/copy-prologue.js\",\"./merkle-tree\":\"/node_modules/hypercore/lib/merkle-tree.js\",\"./mutex\":\"/node_modules/hypercore/lib/mutex.js\",\"./remote-bitfield\":\"/node_modules/hypercore/lib/remote-bitfield.js\",\"./replicator\":\"/node_modules/hypercore/lib/replicator.js\",\"./session-state\":\"/node_modules/hypercore/lib/session-state.js\",\"./verifier\":\"/node_modules/hypercore/lib/verifier.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"unslab\":\"/node_modules/unslab/index.js\",\"z32\":\"/node_modules/z32/index.js\"},\"/node_modules/hypercore/lib/default-encryption.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./caps\":\"/node_modules/hypercore/lib/caps.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/hypercore/lib/download.js\":{\"#package\":\"/node_modules/hypercore/package.json\"},\"/node_modules/hypercore/lib/hotswap-queue.js\":{\"#package\":\"/node_modules/hypercore/package.json\"},\"/node_modules/hypercore/lib/info.js\":{\"#package\":\"/node_modules/hypercore/package.json\"},\"/node_modules/hypercore/lib/inspect.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/hypercore/lib/merkle-tree.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./caps\":\"/node_modules/hypercore/lib/caps.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"unslab\":\"/node_modules/unslab/index.js\"},\"/node_modules/hypercore/lib/messages.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./caps\":\"/node_modules/hypercore/lib/caps.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"unslab\":\"/node_modules/unslab/index.js\"},\"/node_modules/hypercore/lib/multisig.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./merkle-tree\":\"/node_modules/hypercore/lib/merkle-tree.js\",\"./messages\":\"/node_modules/hypercore/lib/messages.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\"},\"/node_modules/hypercore/lib/mutex.js\":{\"#package\":\"/node_modules/hypercore/package.json\"},\"/node_modules/hypercore/lib/receiver-queue.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"fast-fifo\":\"/node_modules/fast-fifo/index.js\"},\"/node_modules/hypercore/lib/remote-bitfield.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./compat\":\"/node_modules/hypercore/lib/compat.js\",\"big-sparse-array\":\"/node_modules/big-sparse-array/index.js\"},\"/node_modules/hypercore/lib/replicator.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./caps\":\"/node_modules/hypercore/lib/caps.js\",\"./hotswap-queue\":\"/node_modules/hypercore/lib/hotswap-queue.js\",\"./merkle-tree\":\"/node_modules/hypercore/lib/merkle-tree.js\",\"./messages\":\"/node_modules/hypercore/lib/messages.js\",\"./mutex\":\"/node_modules/hypercore/lib/mutex.js\",\"./receiver-queue\":\"/node_modules/hypercore/lib/receiver-queue.js\",\"./remote-bitfield\":\"/node_modules/hypercore/lib/remote-bitfield.js\",\"./wants\":\"/node_modules/hypercore/lib/wants.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"random-array-iterator\":\"/node_modules/random-array-iterator/index.js\",\"safety-catch\":\"/node_modules/safety-catch/index.js\"},\"/node_modules/hypercore/lib/session-state.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./bitfield\":\"/node_modules/hypercore/lib/bitfield.js\",\"./merkle-tree\":\"/node_modules/hypercore/lib/merkle-tree.js\",\"./mutex\":\"/node_modules/hypercore/lib/mutex.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"quickbit-universal\":\"/node_modules/quickbit-universal/index.js\"},\"/node_modules/hypercore/lib/streams.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/hypercore/lib/verifier.js\":{\"#package\":\"/node_modules/hypercore/package.json\",\"./caps\":\"/node_modules/hypercore/lib/caps.js\",\"./messages\":\"/node_modules/hypercore/lib/messages.js\",\"./multisig\":\"/node_modules/hypercore/lib/multisig.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"flat-tree\":\"/node_modules/flat-tree/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"hypercore-errors\":\"/node_modules/hypercore-errors/index.js\",\"unslab\":\"/node_modules/unslab/index.js\"},\"/node_modules/hypercore/lib/wants.js\":{\"#package\":\"/node_modules/hypercore/package.json\"},\"/node_modules/hypercore/package.json\":{},\"/node_modules/hyperschema/package.json\":{},\"/node_modules/hyperschema/runtime.cjs\":{\"#package\":\"/node_modules/hyperschema/package.json\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\"},\"/node_modules/index-encoder/index.js\":{\"#package\":\"/node_modules/index-encoder/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/index-encoder/package.json\":{},\"/node_modules/inherits/inherits.js\":{\"#package\":\"/node_modules/inherits/package.json\",\"./inherits_browser.js\":\"/node_modules/inherits/inherits_browser.js\",\"util\":\"/node_modules/bare-utils/index.js\"},\"/node_modules/inherits/inherits_browser.js\":{\"#package\":\"/node_modules/inherits/package.json\"},\"/node_modules/inherits/package.json\":{},\"/node_modules/is-options/index.js\":{\"#package\":\"/node_modules/is-options/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/is-options/package.json\":{},\"/node_modules/keet-identity-key/index.js\":{\"#package\":\"/node_modules/keet-identity-key/package.json\",\"./lib/crypto\":\"/node_modules/keet-identity-key/lib/crypto.js\",\"./lib/encoding\":\"/node_modules/keet-identity-key/lib/encoding.js\",\"./lib/keychain\":\"/node_modules/keet-identity-key/lib/keychain.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\"},\"/node_modules/keet-identity-key/lib/crypto.js\":{\"#package\":\"/node_modules/keet-identity-key/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/keet-identity-key/lib/encoding.js\":{\"#package\":\"/node_modules/keet-identity-key/package.json\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\"},\"/node_modules/keet-identity-key/lib/keychain.js\":{\"#package\":\"/node_modules/keet-identity-key/package.json\",\"./crypto\":\"/node_modules/keet-identity-key/lib/crypto.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"bip39-mnemonic\":\"/node_modules/bip39-mnemonic/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"sodium-hmac\":\"/node_modules/sodium-hmac/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/keet-identity-key/package.json\":{},\"/node_modules/ledger-bitcoin/build/main/index.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"./lib/appClient\":\"/node_modules/ledger-bitcoin/build/main/lib/appClient.js\",\"./lib/policy\":\"/node_modules/ledger-bitcoin/build/main/lib/policy.js\",\"./lib/psbtv2\":\"/node_modules/ledger-bitcoin/build/main/lib/psbtv2.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/appClient.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"./bip32\":\"/node_modules/ledger-bitcoin/build/main/lib/bip32.js\",\"./clientCommands\":\"/node_modules/ledger-bitcoin/build/main/lib/clientCommands.js\",\"./merkelizedPsbt\":\"/node_modules/ledger-bitcoin/build/main/lib/merkelizedPsbt.js\",\"./merkle\":\"/node_modules/ledger-bitcoin/build/main/lib/merkle.js\",\"./psbtv2\":\"/node_modules/ledger-bitcoin/build/main/lib/psbtv2.js\",\"./varint\":\"/node_modules/ledger-bitcoin/build/main/lib/varint.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/bip32.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"bip32-path\":\"/node_modules/bip32-path/index.js\",\"bs58check\":\"/node_modules/bs58check/index.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/buffertools.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"./varint\":\"/node_modules/ledger-bitcoin/build/main/lib/varint.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/clientCommands.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"./buffertools\":\"/node_modules/ledger-bitcoin/build/main/lib/buffertools.js\",\"./merkle\":\"/node_modules/ledger-bitcoin/build/main/lib/merkle.js\",\"./varint\":\"/node_modules/ledger-bitcoin/build/main/lib/varint.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/merkelizedPsbt.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"./merkleMap\":\"/node_modules/ledger-bitcoin/build/main/lib/merkleMap.js\",\"./psbtv2\":\"/node_modules/ledger-bitcoin/build/main/lib/psbtv2.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/merkle.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/merkleMap.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"./merkle\":\"/node_modules/ledger-bitcoin/build/main/lib/merkle.js\",\"./varint\":\"/node_modules/ledger-bitcoin/build/main/lib/varint.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/policy.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"./buffertools\":\"/node_modules/ledger-bitcoin/build/main/lib/buffertools.js\",\"./merkle\":\"/node_modules/ledger-bitcoin/build/main/lib/merkle.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/psbtv2.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\",\"./buffertools\":\"/node_modules/ledger-bitcoin/build/main/lib/buffertools.js\",\"./varint\":\"/node_modules/ledger-bitcoin/build/main/lib/varint.js\",\"bitcoinjs-lib\":\"/node_modules/bitcoinjs-lib/src/index.js\"},\"/node_modules/ledger-bitcoin/build/main/lib/varint.js\":{\"#package\":\"/node_modules/ledger-bitcoin/package.json\"},\"/node_modules/ledger-bitcoin/package.json\":{},\"/node_modules/lodash.memoize/index.js\":{\"#package\":\"/node_modules/lodash.memoize/package.json\"},\"/node_modules/lodash.memoize/package.json\":{},\"/node_modules/lru-cache/dist/esm/index.js\":{\"#package\":\"/node_modules/lru-cache/dist/esm/package.json\"},\"/node_modules/lru-cache/dist/esm/package.json\":{},\"/node_modules/minimalistic-assert/index.js\":{\"#package\":\"/node_modules/minimalistic-assert/package.json\"},\"/node_modules/minimalistic-assert/package.json\":{},\"/node_modules/minimalistic-crypto-utils/lib/utils.js\":{\"#package\":\"/node_modules/minimalistic-crypto-utils/package.json\"},\"/node_modules/minimalistic-crypto-utils/package.json\":{},\"/node_modules/mutexify/index.js\":{\"#package\":\"/node_modules/mutexify/package.json\",\"queue-tick\":\"/node_modules/queue-tick/process-next-tick.js\"},\"/node_modules/mutexify/package.json\":{},\"/node_modules/mutexify/promise.js\":{\"#package\":\"/node_modules/mutexify/package.json\",\".\":\"/node_modules/mutexify/index.js\"},\"/node_modules/nanoassert/index.js\":{\"#package\":\"/node_modules/nanoassert/package.json\"},\"/node_modules/nanoassert/package.json\":{},\"/node_modules/node-gyp-build/index.js\":{\"#package\":\"/node_modules/node-gyp-build/package.json\",\"./node-gyp-build.js\":\"/node_modules/node-gyp-build/node-gyp-build.js\"},\"/node_modules/node-gyp-build/node-gyp-build.js\":{\"#package\":\"/node_modules/node-gyp-build/package.json\",\"fs\":\"builtin:fs\",\"os\":\"builtin:os\",\"path\":\"builtin:path\"},\"/node_modules/node-gyp-build/package.json\":{},\"/node_modules/noise-curve-ed/index.js\":{\"#package\":\"/node_modules/noise-curve-ed/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/noise-curve-ed/package.json\":{},\"/node_modules/noise-handshake/cipher.js\":{\"#package\":\"/node_modules/noise-handshake/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/noise-handshake/dh.js\":{\"#package\":\"/node_modules/noise-handshake/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/noise-handshake/hkdf.js\":{\"#package\":\"/node_modules/noise-handshake/package.json\",\"./hmac\":\"/node_modules/noise-handshake/hmac.js\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/noise-handshake/hmac.js\":{\"#package\":\"/node_modules/noise-handshake/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/noise-handshake/noise.js\":{\"#package\":\"/node_modules/noise-handshake/package.json\",\"./hkdf\":\"/node_modules/noise-handshake/hkdf.js\",\"./symmetric-state\":\"/node_modules/noise-handshake/symmetric-state.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\"},\"/node_modules/noise-handshake/package.json\":{},\"/node_modules/noise-handshake/symmetric-state.js\":{\"#package\":\"/node_modules/noise-handshake/package.json\",\"./cipher\":\"/node_modules/noise-handshake/cipher.js\",\"./dh\":\"/node_modules/noise-handshake/dh.js\",\"./hkdf\":\"/node_modules/noise-handshake/hkdf.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"nanoassert\":\"/node_modules/nanoassert/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/p-limit/index.js\":{\"#package\":\"/node_modules/p-limit/package.json\",\"yocto-queue\":\"/node_modules/yocto-queue/index.js\"},\"/node_modules/p-limit/package.json\":{},\"/node_modules/protocol-buffers-encodings/index.js\":{\"#package\":\"/node_modules/protocol-buffers-encodings/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"signed-varint\":\"/node_modules/signed-varint/index.js\",\"varint\":\"/node_modules/varint/index.js\"},\"/node_modules/protocol-buffers-encodings/package.json\":{},\"/node_modules/protomux-wakeup/index.js\":{\"#package\":\"/node_modules/protomux-wakeup/package.json\",\"./spec/hyperschema\":\"/node_modules/protomux-wakeup/spec/hyperschema/index.js\",\"b4a\":\"/node_modules/b4a/index.js\",\"hypercore-crypto\":\"/node_modules/hypercore-crypto/index.js\",\"protomux\":\"/node_modules/protomux/index.js\"},\"/node_modules/protomux-wakeup/package.json\":{},\"/node_modules/protomux-wakeup/spec/hyperschema/index.js\":{\"#package\":\"/node_modules/protomux-wakeup/package.json\",\"hyperschema/runtime\":\"/node_modules/hyperschema/runtime.cjs\"},\"/node_modules/protomux/index.js\":{\"#package\":\"/node_modules/protomux/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"queue-tick\":\"/node_modules/queue-tick/process-next-tick.js\",\"safety-catch\":\"/node_modules/safety-catch/index.js\",\"unslab\":\"/node_modules/unslab/index.js\"},\"/node_modules/protomux/package.json\":{},\"/node_modules/queue-tick/package.json\":{},\"/node_modules/queue-tick/process-next-tick.js\":{\"#package\":\"/node_modules/queue-tick/package.json\",\"./queue-microtask\":\"/node_modules/queue-tick/queue-microtask.js\"},\"/node_modules/queue-tick/queue-microtask.js\":{\"#package\":\"/node_modules/queue-tick/package.json\"},\"/node_modules/quickbit-native/binding.js\":{\"#package\":\"/node_modules/quickbit-native/package.json\",\".\":\"linked:libquickbit-native.2.4.8.so\",\"require-addon\":\"/node_modules/require-addon/lib/bare.js\"},\"/node_modules/quickbit-native/index.js\":{\"#package\":\"/node_modules/quickbit-native/package.json\",\"./binding\":\"/node_modules/quickbit-native/binding.js\"},\"/node_modules/quickbit-native/package.json\":{},\"/node_modules/quickbit-universal/fallback.js\":{\"#package\":\"/node_modules/quickbit-universal/package.json\",\"simdle-universal\":\"/node_modules/simdle-universal/index.js\"},\"/node_modules/quickbit-universal/index.js\":{\"#package\":\"/node_modules/quickbit-universal/package.json\",\"./fallback\":\"/node_modules/quickbit-universal/fallback.js\",\"quickbit-native\":\"/node_modules/quickbit-native/index.js\"},\"/node_modules/quickbit-universal/package.json\":{},\"/node_modules/rache/index.js\":{\"#package\":\"/node_modules/rache/package.json\"},\"/node_modules/rache/package.json\":{},\"/node_modules/random-array-iterator/index.js\":{\"#package\":\"/node_modules/random-array-iterator/package.json\"},\"/node_modules/random-array-iterator/package.json\":{},\"/node_modules/randombytes/index.js\":{\"#package\":\"/node_modules/randombytes/package.json\",\"crypto\":\"/node_modules/bare-crypto/index.js\"},\"/node_modules/randombytes/package.json\":{},\"/node_modules/ready-resource/index.js\":{\"#package\":\"/node_modules/ready-resource/package.json\",\"events\":\"/node_modules/bare-events/index.js\"},\"/node_modules/ready-resource/package.json\":{},\"/node_modules/refcounter/index.js\":{\"#package\":\"/node_modules/refcounter/package.json\"},\"/node_modules/refcounter/package.json\":{},\"/node_modules/require-addon/lib/bare.js\":{\"#package\":\"/node_modules/require-addon/package.json\"},\"/node_modules/require-addon/package.json\":{},\"/node_modules/resolve-reject-promise/index.js\":{\"#package\":\"/node_modules/resolve-reject-promise/package.json\"},\"/node_modules/resolve-reject-promise/package.json\":{},\"/node_modules/resource-on-exit/index.js\":{\"#package\":\"/node_modules/resource-on-exit/package.json\"},\"/node_modules/resource-on-exit/package.json\":{},\"/node_modules/rocksdb-native/binding.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\",\".\":\"linked:librocksdb-native.3.12.0.so\",\"require-addon\":\"/node_modules/require-addon/lib/bare.js\"},\"/node_modules/rocksdb-native/index.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\",\"./lib/column-family\":\"/node_modules/rocksdb-native/lib/column-family.js\",\"./lib/constants\":\"/node_modules/rocksdb-native/lib/constants.js\",\"./lib/filter-policy\":\"/node_modules/rocksdb-native/lib/filter-policy.js\",\"./lib/iterator\":\"/node_modules/rocksdb-native/lib/iterator.js\",\"./lib/snapshot\":\"/node_modules/rocksdb-native/lib/snapshot.js\",\"./lib/state\":\"/node_modules/rocksdb-native/lib/state.js\"},\"/node_modules/rocksdb-native/lib/batch.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\",\"../binding\":\"/node_modules/rocksdb-native/binding.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\"},\"/node_modules/rocksdb-native/lib/column-family.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\",\"../binding\":\"/node_modules/rocksdb-native/binding.js\",\"./constants\":\"/node_modules/rocksdb-native/lib/constants.js\",\"./filter-policy\":\"/node_modules/rocksdb-native/lib/filter-policy.js\"},\"/node_modules/rocksdb-native/lib/constants.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\"},\"/node_modules/rocksdb-native/lib/filter-policy.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\"},\"/node_modules/rocksdb-native/lib/iterator.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\",\"../binding\":\"/node_modules/rocksdb-native/binding.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"streamx\":\"/node_modules/streamx/index.js\"},\"/node_modules/rocksdb-native/lib/snapshot.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\",\"../binding\":\"/node_modules/rocksdb-native/binding.js\"},\"/node_modules/rocksdb-native/lib/state.js\":{\"#package\":\"/node_modules/rocksdb-native/package.json\",\"../binding\":\"/node_modules/rocksdb-native/binding.js\",\"./batch\":\"/node_modules/rocksdb-native/lib/batch.js\",\"./column-family\":\"/node_modules/rocksdb-native/lib/column-family.js\",\"./constants\":\"/node_modules/rocksdb-native/lib/constants.js\",\"compact-encoding\":\"/node_modules/compact-encoding/index.js\",\"ready-resource\":\"/node_modules/ready-resource/index.js\",\"refcounter\":\"/node_modules/refcounter/index.js\",\"resolve-reject-promise\":\"/node_modules/resolve-reject-promise/index.js\",\"signal-promise\":\"/node_modules/signal-promise/index.js\"},\"/node_modules/rocksdb-native/package.json\":{},\"/node_modules/safe-buffer/index.js\":{\"#package\":\"/node_modules/safe-buffer/package.json\",\"buffer\":\"/node_modules/bare-buffer/index.js\"},\"/node_modules/safe-buffer/package.json\":{},\"/node_modules/safety-catch/index.js\":{\"#package\":\"/node_modules/safety-catch/package.json\"},\"/node_modules/safety-catch/package.json\":{},\"/node_modules/scope-lock/index.js\":{\"#package\":\"/node_modules/scope-lock/package.json\"},\"/node_modules/scope-lock/package.json\":{},\"/node_modules/secp256k1/bindings.js\":{\"#package\":\"/node_modules/secp256k1/package.json\",\"bindings\":\"/node_modules/bindings/bindings.js\"},\"/node_modules/secp256k1/elliptic.js\":{\"#package\":\"/node_modules/secp256k1/package.json\",\"./lib\":\"/node_modules/secp256k1/lib/index.js\",\"./lib/elliptic\":\"/node_modules/secp256k1/lib/elliptic/index.js\"},\"/node_modules/secp256k1/index.js\":{\"#package\":\"/node_modules/secp256k1/package.json\",\"./bindings\":\"/node_modules/secp256k1/bindings.js\",\"./elliptic\":\"/node_modules/secp256k1/elliptic.js\"},\"/node_modules/secp256k1/lib/assert.js\":{\"#package\":\"/node_modules/secp256k1/package.json\"},\"/node_modules/secp256k1/lib/der.js\":{\"#package\":\"/node_modules/secp256k1/package.json\",\"bip66\":\"/node_modules/bip66/index.js\",\"safe-buffer\":\"/node_modules/safe-buffer/index.js\"},\"/node_modules/secp256k1/lib/elliptic/index.js\":{\"#package\":\"/node_modules/secp256k1/package.json\",\"../messages.json\":\"/node_modules/secp256k1/lib/messages.json\",\"bn.js\":\"/node_modules/bn.js/lib/bn.js\",\"create-hash\":\"/node_modules/create-hash/index.js\",\"elliptic\":\"/node_modules/elliptic/lib/elliptic.js\",\"safe-buffer\":\"/node_modules/safe-buffer/index.js\"},\"/node_modules/secp256k1/lib/index.js\":{\"#package\":\"/node_modules/secp256k1/package.json\",\"./assert\":\"/node_modules/secp256k1/lib/assert.js\",\"./der\":\"/node_modules/secp256k1/lib/der.js\",\"./messages.json\":\"/node_modules/secp256k1/lib/messages.json\"},\"/node_modules/secp256k1/lib/messages.json\":{\"#package\":\"/node_modules/secp256k1/package.json\"},\"/node_modules/secp256k1/package.json\":{},\"/node_modules/signal-promise/index.js\":{\"#package\":\"/node_modules/signal-promise/package.json\"},\"/node_modules/signal-promise/package.json\":{},\"/node_modules/signed-varint/index.js\":{\"#package\":\"/node_modules/signed-varint/package.json\",\"varint\":\"/node_modules/varint/index.js\"},\"/node_modules/signed-varint/package.json\":{},\"/node_modules/simdle-native/binding.js\":{\"#package\":\"/node_modules/simdle-native/package.json\",\".\":\"linked:libsimdle-native.1.3.9.so\",\"require-addon\":\"/node_modules/require-addon/lib/bare.js\"},\"/node_modules/simdle-native/index.js\":{\"#package\":\"/node_modules/simdle-native/package.json\",\"./binding\":\"/node_modules/simdle-native/binding.js\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/simdle-native/package.json\":{},\"/node_modules/simdle-universal/fallback.js\":{\"#package\":\"/node_modules/simdle-universal/package.json\",\"./scalar\":\"/node_modules/simdle-universal/scalar.js\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/simdle-universal/index.js\":{\"#package\":\"/node_modules/simdle-universal/package.json\",\"./fallback\":\"/node_modules/simdle-universal/fallback.js\",\"simdle-native\":\"/node_modules/simdle-native/index.js\"},\"/node_modules/simdle-universal/package.json\":{},\"/node_modules/simdle-universal/scalar.js\":{\"#package\":\"/node_modules/simdle-universal/package.json\"},\"/node_modules/sodium-hmac/hash/sha256.js\":{\"#package\":\"/node_modules/sodium-hmac/package.json\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/sodium-hmac/hash/sha512.js\":{\"#package\":\"/node_modules/sodium-hmac/package.json\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/sodium-hmac/index.js\":{\"#package\":\"/node_modules/sodium-hmac/package.json\",\"./hash/sha256\":\"/node_modules/sodium-hmac/hash/sha256.js\",\"./hash/sha512\":\"/node_modules/sodium-hmac/hash/sha512.js\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/sodium-hmac/package.json\":{},\"/node_modules/sodium-native/binding.js\":{\"#package\":\"/node_modules/sodium-native/package.json\",\".\":\"linked:libsodium-native.5.0.10.so\",\"require-addon\":\"/node_modules/require-addon/lib/bare.js\"},\"/node_modules/sodium-native/index.js\":{\"#package\":\"/node_modules/sodium-native/package.json\",\"./binding\":\"/node_modules/sodium-native/binding.js\",\"which-runtime\":\"/node_modules/which-runtime/index.js\"},\"/node_modules/sodium-native/package.json\":{},\"/node_modules/sodium-secretstream/index.js\":{\"#package\":\"/node_modules/sodium-secretstream/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"sodium-universal\":\"/node_modules/sodium-universal/index.js\"},\"/node_modules/sodium-secretstream/package.json\":{},\"/node_modules/sodium-universal/index.js\":{\"#package\":\"/node_modules/sodium-universal/package.json\",\"sodium-native\":\"/node_modules/sodium-native/index.js\"},\"/node_modules/sodium-universal/package.json\":{},\"/node_modules/streamx/index.js\":{\"#package\":\"/node_modules/streamx/package.json\",\"events-universal\":\"/node_modules/events-universal/bare.js\",\"fast-fifo\":\"/node_modules/fast-fifo/index.js\",\"text-decoder\":\"/node_modules/text-decoder/index.js\"},\"/node_modules/streamx/package.json\":{},\"/node_modules/sub-encoder/index.js\":{\"#package\":\"/node_modules/sub-encoder/package.json\",\"b4a\":\"/node_modules/b4a/index.js\",\"codecs\":\"/node_modules/codecs/index.js\"},\"/node_modules/sub-encoder/package.json\":{},\"/node_modules/text-decoder/index.js\":{\"#package\":\"/node_modules/text-decoder/package.json\",\"./lib/pass-through-decoder\":\"/node_modules/text-decoder/lib/pass-through-decoder.js\",\"./lib/utf8-decoder\":\"/node_modules/text-decoder/lib/utf8-decoder.js\"},\"/node_modules/text-decoder/lib/pass-through-decoder.js\":{\"#package\":\"/node_modules/text-decoder/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/text-decoder/lib/utf8-decoder.js\":{\"#package\":\"/node_modules/text-decoder/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/text-decoder/package.json\":{},\"/node_modules/timeout-refresh/browser.js\":{\"#package\":\"/node_modules/timeout-refresh/package.json\"},\"/node_modules/timeout-refresh/index.js\":{\"#package\":\"/node_modules/timeout-refresh/package.json\",\"./browser\":\"/node_modules/timeout-refresh/browser.js\",\"./node\":\"/node_modules/timeout-refresh/node.js\"},\"/node_modules/timeout-refresh/node.js\":{\"#package\":\"/node_modules/timeout-refresh/package.json\"},\"/node_modules/timeout-refresh/package.json\":{},\"/node_modules/tiny-buffer-map/index.js\":{\"#package\":\"/node_modules/tiny-buffer-map/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/tiny-buffer-map/package.json\":{},\"/node_modules/typeforce/errors.js\":{\"#package\":\"/node_modules/typeforce/package.json\",\"./native\":\"/node_modules/typeforce/native.js\"},\"/node_modules/typeforce/extra.js\":{\"#package\":\"/node_modules/typeforce/package.json\",\"./errors\":\"/node_modules/typeforce/errors.js\",\"./native\":\"/node_modules/typeforce/native.js\"},\"/node_modules/typeforce/index.js\":{\"#package\":\"/node_modules/typeforce/package.json\",\"./errors\":\"/node_modules/typeforce/errors.js\",\"./extra\":\"/node_modules/typeforce/extra.js\",\"./native\":\"/node_modules/typeforce/native.js\"},\"/node_modules/typeforce/native.js\":{\"#package\":\"/node_modules/typeforce/package.json\"},\"/node_modules/typeforce/package.json\":{},\"/node_modules/unslab/index.js\":{\"#package\":\"/node_modules/unslab/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/unslab/package.json\":{},\"/node_modules/utf-8-validate/fallback.js\":{\"#package\":\"/node_modules/utf-8-validate/package.json\"},\"/node_modules/utf-8-validate/index.js\":{\"#package\":\"/node_modules/utf-8-validate/package.json\",\"./fallback\":\"/node_modules/utf-8-validate/fallback.js\",\"node-gyp-build\":\"/node_modules/node-gyp-build/index.js\"},\"/node_modules/utf-8-validate/package.json\":{},\"/node_modules/varint/decode.js\":{\"#package\":\"/node_modules/varint/package.json\"},\"/node_modules/varint/encode.js\":{\"#package\":\"/node_modules/varint/package.json\"},\"/node_modules/varint/index.js\":{\"#package\":\"/node_modules/varint/package.json\",\"./decode.js\":\"/node_modules/varint/decode.js\",\"./encode.js\":\"/node_modules/varint/encode.js\",\"./length.js\":\"/node_modules/varint/length.js\"},\"/node_modules/varint/length.js\":{\"#package\":\"/node_modules/varint/package.json\"},\"/node_modules/varint/package.json\":{},\"/node_modules/varuint-bitcoin/index.js\":{\"#package\":\"/node_modules/varuint-bitcoin/package.json\",\"safe-buffer\":\"/node_modules/safe-buffer/index.js\"},\"/node_modules/varuint-bitcoin/package.json\":{},\"/node_modules/which-runtime/index.js\":{\"#package\":\"/node_modules/which-runtime/package.json\"},\"/node_modules/which-runtime/package.json\":{},\"/node_modules/wif/index.js\":{\"#package\":\"/node_modules/wif/package.json\",\"bs58check\":\"/node_modules/wif/node_modules/bs58check/index.js\"},\"/node_modules/wif/node_modules/base-x/package.json\":{},\"/node_modules/wif/node_modules/base-x/src/index.js\":{\"#package\":\"/node_modules/wif/node_modules/base-x/package.json\",\"safe-buffer\":\"/node_modules/safe-buffer/index.js\"},\"/node_modules/wif/node_modules/bs58/index.js\":{\"#package\":\"/node_modules/wif/node_modules/bs58/package.json\",\"base-x\":\"/node_modules/wif/node_modules/base-x/src/index.js\"},\"/node_modules/wif/node_modules/bs58/package.json\":{},\"/node_modules/wif/node_modules/bs58check/base.js\":{\"#package\":\"/node_modules/wif/node_modules/bs58check/package.json\",\"bs58\":\"/node_modules/wif/node_modules/bs58/index.js\",\"safe-buffer\":\"/node_modules/safe-buffer/index.js\"},\"/node_modules/wif/node_modules/bs58check/index.js\":{\"#package\":\"/node_modules/wif/node_modules/bs58check/package.json\",\"./base\":\"/node_modules/wif/node_modules/bs58check/base.js\",\"create-hash\":\"/node_modules/create-hash/index.js\"},\"/node_modules/wif/node_modules/bs58check/package.json\":{},\"/node_modules/wif/package.json\":{},\"/node_modules/ws/lib/buffer-util.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./constants\":\"/node_modules/ws/lib/constants.js\",\"bufferutil\":\"/node_modules/bufferutil/index.js\"},\"/node_modules/ws/lib/constants.js\":{\"#package\":\"/node_modules/ws/package.json\"},\"/node_modules/ws/lib/event-target.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./constants\":\"/node_modules/ws/lib/constants.js\"},\"/node_modules/ws/lib/extension.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./validation\":\"/node_modules/ws/lib/validation.js\"},\"/node_modules/ws/lib/limiter.js\":{\"#package\":\"/node_modules/ws/package.json\"},\"/node_modules/ws/lib/permessage-deflate.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./buffer-util\":\"/node_modules/ws/lib/buffer-util.js\",\"./constants\":\"/node_modules/ws/lib/constants.js\",\"./limiter\":\"/node_modules/ws/lib/limiter.js\",\"zlib\":\"/node_modules/bare-zlib/index.js\"},\"/node_modules/ws/lib/receiver.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./buffer-util\":\"/node_modules/ws/lib/buffer-util.js\",\"./constants\":\"/node_modules/ws/lib/constants.js\",\"./permessage-deflate\":\"/node_modules/ws/lib/permessage-deflate.js\",\"./validation\":\"/node_modules/ws/lib/validation.js\",\"stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/ws/lib/sender.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./buffer-util\":\"/node_modules/ws/lib/buffer-util.js\",\"./constants\":\"/node_modules/ws/lib/constants.js\",\"./permessage-deflate\":\"/node_modules/ws/lib/permessage-deflate.js\",\"./validation\":\"/node_modules/ws/lib/validation.js\",\"crypto\":\"/node_modules/bare-crypto/index.js\",\"stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/ws/lib/stream.js\":{\"#package\":\"/node_modules/ws/package.json\",\"stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/ws/lib/subprotocol.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./validation\":\"/node_modules/ws/lib/validation.js\"},\"/node_modules/ws/lib/validation.js\":{\"#package\":\"/node_modules/ws/package.json\",\"buffer\":\"/node_modules/bare-buffer/index.js\",\"utf-8-validate\":\"/node_modules/utf-8-validate/index.js\"},\"/node_modules/ws/lib/websocket-server.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./constants\":\"/node_modules/ws/lib/constants.js\",\"./extension\":\"/node_modules/ws/lib/extension.js\",\"./permessage-deflate\":\"/node_modules/ws/lib/permessage-deflate.js\",\"./subprotocol\":\"/node_modules/ws/lib/subprotocol.js\",\"./websocket\":\"/node_modules/ws/lib/websocket.js\",\"crypto\":\"/node_modules/bare-crypto/index.js\",\"events\":\"/node_modules/bare-events/index.js\",\"http\":\"/node_modules/bare-http1/index.js\",\"stream\":\"/node_modules/bare-stream/index.js\"},\"/node_modules/ws/lib/websocket.js\":{\"#package\":\"/node_modules/ws/package.json\",\"./buffer-util\":\"/node_modules/ws/lib/buffer-util.js\",\"./constants\":\"/node_modules/ws/lib/constants.js\",\"./event-target\":\"/node_modules/ws/lib/event-target.js\",\"./extension\":\"/node_modules/ws/lib/extension.js\",\"./permessage-deflate\":\"/node_modules/ws/lib/permessage-deflate.js\",\"./receiver\":\"/node_modules/ws/lib/receiver.js\",\"./sender\":\"/node_modules/ws/lib/sender.js\",\"crypto\":\"/node_modules/bare-crypto/index.js\",\"events\":\"/node_modules/bare-events/index.js\",\"http\":\"/node_modules/bare-http1/index.js\",\"https\":\"/node_modules/bare-https/index.js\",\"net\":\"/node_modules/bare-net/index.js\",\"stream\":\"/node_modules/bare-stream/index.js\",\"tls\":\"/node_modules/bare-tls/index.js\",\"url\":\"/node_modules/bare-url/index.js\"},\"/node_modules/ws/package.json\":{},\"/node_modules/ws/wrapper.mjs\":{\"#package\":\"/node_modules/ws/package.json\",\"./lib/receiver.js\":\"/node_modules/ws/lib/receiver.js\",\"./lib/sender.js\":\"/node_modules/ws/lib/sender.js\",\"./lib/stream.js\":\"/node_modules/ws/lib/stream.js\",\"./lib/websocket-server.js\":\"/node_modules/ws/lib/websocket-server.js\",\"./lib/websocket.js\":\"/node_modules/ws/lib/websocket.js\"},\"/node_modules/yocto-queue/index.js\":{\"#package\":\"/node_modules/yocto-queue/package.json\"},\"/node_modules/yocto-queue/package.json\":{},\"/node_modules/z32/index.js\":{\"#package\":\"/node_modules/z32/package.json\",\"b4a\":\"/node_modules/b4a/index.js\"},\"/node_modules/z32/package.json\":{},\"/package.json\":{},\"/protocols/index.js\":{\"#package\":\"/package.json\",\"./wdk.js\":\"/protocols/wdk.js\"},\"/protocols/wdk.js\":{\"#package\":\"/package.json\",\"../shims/wdk-bare.js\":\"/shims/wdk-bare.js\",\"../shims/wdk-wallet-btc.js\":\"/shims/wdk-wallet-btc.js\",\"../shims/wdk-wallet-evm.js\":\"/shims/wdk-wallet-evm.js\"},\"/shims/wdk-bare.js\":{\"#package\":\"/package.json\",\"../node_modules/@tetherto/wdk/index.js\":\"/node_modules/@tetherto/wdk/index.js\",\"bare-node-runtime/global\":\"/node_modules/bare-node-runtime/global.js\"},\"/shims/wdk-wallet-btc.js\":{\"#package\":\"/package.json\",\"../node_modules/@tetherto/wdk-wallet-btc/index.js\":\"/node_modules/@tetherto/wdk-wallet-btc/index.js\",\"bare-node-runtime/global\":\"/node_modules/bare-node-runtime/global.js\"},\"/shims/wdk-wallet-evm.js\":{\"#package\":\"/package.json\",\"../node_modules/@tetherto/wdk-wallet-evm/index.js\":\"/node_modules/@tetherto/wdk-wallet-evm/index.js\",\"bare-node-runtime/global\":\"/node_modules/bare-node-runtime/global.js\"}},\"addons\":[\"linked:libbare-buffer.3.4.2.so\",\"linked:libbare-crypto.1.13.0.so\",\"linked:libbare-dns.2.1.4.so\",\"linked:libbare-fs.4.5.2.so\",\"linked:libbare-hrtime.2.1.1.so\",\"linked:libbare-inspect.3.1.4.so\",\"linked:libbare-os.3.6.2.so\",\"linked:libbare-performance.1.3.0.so\",\"linked:libbare-pipe.4.1.2.so\",\"linked:libbare-signals.4.2.0.so\",\"linked:libbare-tcp.2.2.2.so\",\"linked:libbare-tls.2.1.7.so\",\"linked:libbare-tty.5.0.3.so\",\"linked:libbare-type.1.1.0.so\",\"linked:libbare-url.2.3.2.so\",\"linked:libbare-zlib.1.3.1.so\",\"linked:libfs-native-extensions.1.4.5.so\",\"linked:libquickbit-native.2.4.8.so\",\"linked:librocksdb-native.3.12.0.so\",\"linked:libsimdle-native.1.3.9.so\",\"linked:libsodium-native.5.0.10.so\"],\"assets\":[],\"files\":{\"/cli.js\":{\"offset\":0,\"length\":3519,\"mode\":420},\"/cmd/balance.js\":{\"offset\":3519,\"length\":1962,\"mode\":420},\"/cmd/init.js\":{\"offset\":5481,\"length\":1872,\"mode\":420},\"/cmd/whoami.js\":{\"offset\":7353,\"length\":1547,\"mode\":420},\"/lib/identity.js\":{\"offset\":8900,\"length\":1323,\"mode\":420},\"/lib/wallet-context.js\":{\"offset\":10223,\"length\":4698,\"mode\":420},\"/node_modules/@adraffy/ens-normalize/dist/index.mjs\":{\"offset\":14921,\"length\":64839,\"mode\":420},\"/node_modules/@adraffy/ens-normalize/package.json\":{\"offset\":79760,\"length\":1810,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/dist/algos/addUntilReach.js\":{\"offset\":81570,\"length\":3731,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/dist/algos/avoidChange.js\":{\"offset\":85301,\"length\":3685,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/dist/algos/maxFunds.js\":{\"offset\":88986,\"length\":2939,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/dist/coinselect.js\":{\"offset\":91925,\"length\":4235,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/dist/dust.js\":{\"offset\":96160,\"length\":3966,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/dist/index.js\":{\"offset\":100126,\"length\":1489,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/dist/validation.js\":{\"offset\":101615,\"length\":2255,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/dist/vsize.js\":{\"offset\":103870,\"length\":2826,\"mode\":420},\"/node_modules/@bitcoinerlab/coinselect/package.json\":{\"offset\":106696,\"length\":2236,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/applyPR2137.js\":{\"offset\":108932,\"length\":4697,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/checksum.js\":{\"offset\":113629,\"length\":1994,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/descriptors.js\":{\"offset\":115623,\"length\":62296,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/index.js\":{\"offset\":177919,\"length\":3134,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/keyExpressions.js\":{\"offset\":181053,\"length\":11034,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/ledger.js\":{\"offset\":192087,\"length\":26556,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/miniscript.js\":{\"offset\":218643,\"length\":11381,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/psbt.js\":{\"offset\":230024,\"length\":8552,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/re.js\":{\"offset\":238576,\"length\":6226,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/scriptExpressions.js\":{\"offset\":244802,\"length\":3878,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/dist/signers.js\":{\"offset\":248680,\"length\":11299,\"mode\":420},\"/node_modules/@bitcoinerlab/descriptors/package.json\":{\"offset\":259979,\"length\":3348,\"mode\":420},\"/node_modules/@bitcoinerlab/miniscript/dist/index.js\":{\"offset\":263327,\"length\":819325,\"mode\":420},\"/node_modules/@bitcoinerlab/miniscript/package.json\":{\"offset\":1082652,\"length\":1977,\"mode\":420},\"/node_modules/@bitcoinerlab/secp256k1/dist/index.js\":{\"offset\":1084629,\"length\":12395,\"mode\":420},\"/node_modules/@bitcoinerlab/secp256k1/package.json\":{\"offset\":1097024,\"length\":1518,\"mode\":420},\"/node_modules/@hyperswarm/secret-stream/index.js\":{\"offset\":1098542,\"length\":16722,\"mode\":420},\"/node_modules/@hyperswarm/secret-stream/lib/bridge.js\":{\"offset\":1115264,\"length\":1273,\"mode\":420},\"/node_modules/@hyperswarm/secret-stream/lib/handshake.js\":{\"offset\":1116537,\"length\":1950,\"mode\":420},\"/node_modules/@hyperswarm/secret-stream/package.json\":{\"offset\":1118487,\"length\":1132,\"mode\":420},\"/node_modules/@mempool/electrum-client/index.js\":{\"offset\":1119619,\"length\":7740,\"mode\":420},\"/node_modules/@mempool/electrum-client/lib/TlsSocketWrapper.js\":{\"offset\":1127359,\"length\":3219,\"mode\":420},\"/node_modules/@mempool/electrum-client/lib/client.js\":{\"offset\":1130578,\"length\":4580,\"mode\":420},\"/node_modules/@mempool/electrum-client/lib/util.js\":{\"offset\":1135158,\"length\":1645,\"mode\":420},\"/node_modules/@mempool/electrum-client/package.json\":{\"offset\":1136803,\"length\":699,\"mode\":420},\"/node_modules/@noble/curves/_shortw_utils.js\":{\"offset\":1137502,\"length\":742,\"mode\":420},\"/node_modules/@noble/curves/abstract/curve.js\":{\"offset\":1138244,\"length\":18994,\"mode\":420},\"/node_modules/@noble/curves/abstract/hash-to-curve.js\":{\"offset\":1157238,\"length\":8604,\"mode\":420},\"/node_modules/@noble/curves/abstract/modular.js\":{\"offset\":1165842,\"length\":22405,\"mode\":420},\"/node_modules/@noble/curves/abstract/utils.js\":{\"offset\":1188247,\"length\":3781,\"mode\":420},\"/node_modules/@noble/curves/abstract/weierstrass.js\":{\"offset\":1192028,\"length\":60245,\"mode\":420},\"/node_modules/@noble/curves/package.json\":{\"offset\":1252273,\"length\":7683,\"mode\":420},\"/node_modules/@noble/curves/secp256k1.js\":{\"offset\":1259956,\"length\":13247,\"mode\":420},\"/node_modules/@noble/curves/utils.js\":{\"offset\":1273203,\"length\":14111,\"mode\":420},\"/node_modules/@noble/hashes/_md.js\":{\"offset\":1287314,\"length\":6470,\"mode\":420},\"/node_modules/@noble/hashes/_u64.js\":{\"offset\":1293784,\"length\":3819,\"mode\":420},\"/node_modules/@noble/hashes/cryptoNode.js\":{\"offset\":1297603,\"length\":579,\"mode\":420},\"/node_modules/@noble/hashes/esm/_md.js\":{\"offset\":1298182,\"length\":6192,\"mode\":420},\"/node_modules/@noble/hashes/esm/_u64.js\":{\"offset\":1304374,\"length\":3081,\"mode\":420},\"/node_modules/@noble/hashes/esm/cryptoNode.js\":{\"offset\":1307455,\"length\":482,\"mode\":420},\"/node_modules/@noble/hashes/esm/hmac.js\":{\"offset\":1307937,\"length\":2962,\"mode\":420},\"/node_modules/@noble/hashes/esm/package.json\":{\"offset\":1310899,\"length\":147,\"mode\":420},\"/node_modules/@noble/hashes/esm/sha2.js\":{\"offset\":1311046,\"length\":16832,\"mode\":420},\"/node_modules/@noble/hashes/esm/sha256.js\":{\"offset\":1327878,\"length\":871,\"mode\":420},\"/node_modules/@noble/hashes/esm/sha512.js\":{\"offset\":1328749,\"length\":1315,\"mode\":420},\"/node_modules/@noble/hashes/esm/utils.js\":{\"offset\":1330064,\"length\":10538,\"mode\":420},\"/node_modules/@noble/hashes/hmac.js\":{\"offset\":1340602,\"length\":3187,\"mode\":420},\"/node_modules/@noble/hashes/legacy.js\":{\"offset\":1343789,\"length\":10376,\"mode\":420},\"/node_modules/@noble/hashes/package.json\":{\"offset\":1354165,\"length\":6734,\"mode\":420},\"/node_modules/@noble/hashes/pbkdf2.js\":{\"offset\":1360899,\"length\":4115,\"mode\":420},\"/node_modules/@noble/hashes/ripemd160.js\":{\"offset\":1365014,\"length\":627,\"mode\":420},\"/node_modules/@noble/hashes/sha1.js\":{\"offset\":1365641,\"length\":460,\"mode\":420},\"/node_modules/@noble/hashes/sha2.js\":{\"offset\":1366101,\"length\":17868,\"mode\":420},\"/node_modules/@noble/hashes/sha256.js\":{\"offset\":1383969,\"length\":975,\"mode\":420},\"/node_modules/@noble/hashes/sha512.js\":{\"offset\":1384944,\"length\":1411,\"mode\":420},\"/node_modules/@noble/hashes/utils.js\":{\"offset\":1386355,\"length\":11528,\"mode\":420},\"/node_modules/@noble/secp256k1/index.js\":{\"offset\":1397883,\"length\":27173,\"mode\":420},\"/node_modules/@noble/secp256k1/package.json\":{\"offset\":1425056,\"length\":1709,\"mode\":420},\"/node_modules/@scure/base/lib/index.js\":{\"offset\":1426765,\"length\":25417,\"mode\":420},\"/node_modules/@scure/base/package.json\":{\"offset\":1452182,\"length\":1779,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-btc/index.js\":{\"offset\":1453961,\"length\":1488,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-btc/package.json\":{\"offset\":1455449,\"length\":1688,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-btc/src/electrum-client.js\":{\"offset\":1457137,\"length\":4540,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-account-btc.js\":{\"offset\":1461677,\"length\":16172,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-account-read-only-btc.js\":{\"offset\":1477849,\"length\":13524,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-btc/src/wallet-manager-btc.js\":{\"offset\":1491373,\"length\":3039,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-evm/index.js\":{\"offset\":1494412,\"length\":1574,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-evm/package.json\":{\"offset\":1495986,\"length\":1830,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-evm/src/memory-safe/hd-node-wallet.js\":{\"offset\":1497816,\"length\":6005,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-evm/src/memory-safe/signing-key.js\":{\"offset\":1503821,\"length\":2185,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-account-evm.js\":{\"offset\":1506006,\"length\":7343,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-account-read-only-evm.js\":{\"offset\":1513349,\"length\":7400,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet-evm/src/wallet-manager-evm.js\":{\"offset\":1520749,\"length\":3768,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/bare.js\":{\"offset\":1524517,\"length\":766,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/index.js\":{\"offset\":1525283,\"length\":1478,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/package.json\":{\"offset\":1526761,\"length\":1343,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/errors.js\":{\"offset\":1528104,\"length\":907,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/protocols/bridge-protocol.js\":{\"offset\":1529011,\"length\":3805,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/protocols/fiat-protocol.js\":{\"offset\":1532816,\"length\":11521,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/protocols/index.js\":{\"offset\":1544337,\"length\":3386,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/protocols/lending-protocol.js\":{\"offset\":1547723,\"length\":8266,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/protocols/swap-protocol.js\":{\"offset\":1555989,\"length\":4222,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/wallet-account-read-only.js\":{\"offset\":1560211,\"length\":5423,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/wallet-account.js\":{\"offset\":1565634,\"length\":3355,\"mode\":420},\"/node_modules/@tetherto/wdk-wallet/src/wallet-manager.js\":{\"offset\":1568989,\"length\":4137,\"mode\":420},\"/node_modules/@tetherto/wdk/index.js\":{\"offset\":1573126,\"length\":1022,\"mode\":420},\"/node_modules/@tetherto/wdk/package.json\":{\"offset\":1574148,\"length\":1304,\"mode\":420},\"/node_modules/@tetherto/wdk/src/wdk-manager.js\":{\"offset\":1575452,\"length\":10188,\"mode\":420},\"/node_modules/aes-js/lib.esm/aes.js\":{\"offset\":1585640,\"length\":48607,\"mode\":420},\"/node_modules/aes-js/lib.esm/index.js\":{\"offset\":1634247,\"length\":348,\"mode\":420},\"/node_modules/aes-js/lib.esm/mode-cbc.js\":{\"offset\":1634595,\"length\":3271,\"mode\":420},\"/node_modules/aes-js/lib.esm/mode-cfb.js\":{\"offset\":1637866,\"length\":4220,\"mode\":420},\"/node_modules/aes-js/lib.esm/mode-ctr.js\":{\"offset\":1642086,\"length\":4178,\"mode\":420},\"/node_modules/aes-js/lib.esm/mode-ecb.js\":{\"offset\":1646264,\"length\":1012,\"mode\":420},\"/node_modules/aes-js/lib.esm/mode-ofb.js\":{\"offset\":1647276,\"length\":3234,\"mode\":420},\"/node_modules/aes-js/lib.esm/mode.js\":{\"offset\":1650510,\"length\":428,\"mode\":420},\"/node_modules/aes-js/lib.esm/package.json\":{\"offset\":1650938,\"length\":23,\"mode\":420},\"/node_modules/aes-js/lib.esm/padding.js\":{\"offset\":1650961,\"length\":819,\"mode\":420},\"/node_modules/autobase/encoding/legacy.js\":{\"offset\":1651780,\"length\":8848,\"mode\":420},\"/node_modules/autobase/encoding/spec/autobase/index.js\":{\"offset\":1660628,\"length\":18918,\"mode\":420},\"/node_modules/autobase/index.js\":{\"offset\":1679546,\"length\":58595,\"mode\":420},\"/node_modules/autobase/lib/active-writers.js\":{\"offset\":1738141,\"length\":736,\"mode\":420},\"/node_modules/autobase/lib/append-batch.js\":{\"offset\":1738877,\"length\":1426,\"mode\":420},\"/node_modules/autobase/lib/apply-calls.js\":{\"offset\":1740303,\"length\":2275,\"mode\":420},\"/node_modules/autobase/lib/apply-state.js\":{\"offset\":1742578,\"length\":45236,\"mode\":420},\"/node_modules/autobase/lib/boot.js\":{\"offset\":1787814,\"length\":4599,\"mode\":420},\"/node_modules/autobase/lib/caps.js\":{\"offset\":1792413,\"length\":505,\"mode\":420},\"/node_modules/autobase/lib/clock.js\":{\"offset\":1792918,\"length\":749,\"mode\":420},\"/node_modules/autobase/lib/consensus.js\":{\"offset\":1793667,\"length\":11754,\"mode\":420},\"/node_modules/autobase/lib/encryption.js\":{\"offset\":1805421,\"length\":9444,\"mode\":420},\"/node_modules/autobase/lib/fast-forward.js\":{\"offset\":1814865,\"length\":5714,\"mode\":420},\"/node_modules/autobase/lib/fork.js\":{\"offset\":1820579,\"length\":4230,\"mode\":420},\"/node_modules/autobase/lib/linearizer.js\":{\"offset\":1824809,\"length\":9696,\"mode\":420},\"/node_modules/autobase/lib/local-state.js\":{\"offset\":1834505,\"length\":2013,\"mode\":420},\"/node_modules/autobase/lib/messages.js\":{\"offset\":1836518,\"length\":827,\"mode\":420},\"/node_modules/autobase/lib/node-buffer.js\":{\"offset\":1837345,\"length\":1563,\"mode\":420},\"/node_modules/autobase/lib/store.js\":{\"offset\":1838908,\"length\":14107,\"mode\":420},\"/node_modules/autobase/lib/system.js\":{\"offset\":1853015,\"length\":20176,\"mode\":420},\"/node_modules/autobase/lib/timer.js\":{\"offset\":1873191,\"length\":2937,\"mode\":420},\"/node_modules/autobase/lib/topolist.js\":{\"offset\":1876128,\"length\":5108,\"mode\":420},\"/node_modules/autobase/lib/updates.js\":{\"offset\":1881236,\"length\":1148,\"mode\":420},\"/node_modules/autobase/lib/values.js\":{\"offset\":1882384,\"length\":1539,\"mode\":420},\"/node_modules/autobase/lib/wakeup.js\":{\"offset\":1883923,\"length\":4034,\"mode\":420},\"/node_modules/autobase/lib/writer.js\":{\"offset\":1887957,\"length\":8901,\"mode\":420},\"/node_modules/autobase/package.json\":{\"offset\":1896858,\"length\":2327,\"mode\":420},\"/node_modules/b4a/index.js\":{\"offset\":1899185,\"length\":4054,\"mode\":420},\"/node_modules/b4a/package.json\":{\"offset\":1903239,\"length\":1140,\"mode\":420},\"/node_modules/bare-abort-controller/global.js\":{\"offset\":1904379,\"length\":129,\"mode\":420},\"/node_modules/bare-abort-controller/index.js\":{\"offset\":1904508,\"length\":2370,\"mode\":420},\"/node_modules/bare-abort-controller/package.json\":{\"offset\":1906878,\"length\":1119,\"mode\":420},\"/node_modules/bare-ansi-escapes/index.js\":{\"offset\":1907997,\"length\":2255,\"mode\":420},\"/node_modules/bare-ansi-escapes/package.json\":{\"offset\":1910252,\"length\":1178,\"mode\":420},\"/node_modules/bare-buffer/binding.js\":{\"offset\":1911430,\"length\":33,\"mode\":420},\"/node_modules/bare-buffer/index.js\":{\"offset\":1911463,\"length\":27188,\"mode\":420},\"/node_modules/bare-buffer/lib/ascii.js\":{\"offset\":1938651,\"length\":452,\"mode\":420},\"/node_modules/bare-buffer/lib/base64.js\":{\"offset\":1939103,\"length\":531,\"mode\":420},\"/node_modules/bare-buffer/lib/base64url.js\":{\"offset\":1939634,\"length\":534,\"mode\":420},\"/node_modules/bare-buffer/lib/constants.js\":{\"offset\":1940168,\"length\":74,\"mode\":420},\"/node_modules/bare-buffer/lib/hex.js\":{\"offset\":1940242,\"length\":392,\"mode\":420},\"/node_modules/bare-buffer/lib/latin1.js\":{\"offset\":1940634,\"length\":392,\"mode\":420},\"/node_modules/bare-buffer/lib/utf16le.js\":{\"offset\":1941026,\"length\":398,\"mode\":420},\"/node_modules/bare-buffer/lib/utf8.js\":{\"offset\":1941424,\"length\":405,\"mode\":420},\"/node_modules/bare-buffer/package.json\":{\"offset\":1941829,\"length\":1210,\"mode\":420},\"/node_modules/bare-crypto/binding.js\":{\"offset\":1943039,\"length\":33,\"mode\":420},\"/node_modules/bare-crypto/global.js\":{\"offset\":1943072,\"length\":164,\"mode\":420},\"/node_modules/bare-crypto/index.js\":{\"offset\":1943236,\"length\":1611,\"mode\":420},\"/node_modules/bare-crypto/lib/cipher.js\":{\"offset\":1944847,\"length\":7366,\"mode\":420},\"/node_modules/bare-crypto/lib/constants.js\":{\"offset\":1952213,\"length\":2375,\"mode\":420},\"/node_modules/bare-crypto/lib/errors.js\":{\"offset\":1954588,\"length\":957,\"mode\":420},\"/node_modules/bare-crypto/lib/hash.js\":{\"offset\":1955545,\"length\":1549,\"mode\":420},\"/node_modules/bare-crypto/lib/hmac.js\":{\"offset\":1957094,\"length\":1015,\"mode\":420},\"/node_modules/bare-crypto/lib/key.js\":{\"offset\":1958109,\"length\":1067,\"mode\":420},\"/node_modules/bare-crypto/lib/pbkdf2.js\":{\"offset\":1959176,\"length\":713,\"mode\":420},\"/node_modules/bare-crypto/lib/random.js\":{\"offset\":1959889,\"length\":1707,\"mode\":420},\"/node_modules/bare-crypto/lib/signature.js\":{\"offset\":1961596,\"length\":1010,\"mode\":420},\"/node_modules/bare-crypto/lib/web/algorithm/ed25519.js\":{\"offset\":1962606,\"length\":6918,\"mode\":420},\"/node_modules/bare-crypto/lib/web/algorithm/hmac.js\":{\"offset\":1969524,\"length\":4925,\"mode\":420},\"/node_modules/bare-crypto/lib/web/algorithm/pbkdf2.js\":{\"offset\":1974449,\"length\":1467,\"mode\":420},\"/node_modules/bare-crypto/lib/web/algorithm/sha.js\":{\"offset\":1975916,\"length\":299,\"mode\":420},\"/node_modules/bare-crypto/lib/web/crypto-key.js\":{\"offset\":1976215,\"length\":970,\"mode\":420},\"/node_modules/bare-crypto/package.json\":{\"offset\":1977185,\"length\":1475,\"mode\":420},\"/node_modules/bare-crypto/web.js\":{\"offset\":1978660,\"length\":7537,\"mode\":420},\"/node_modules/bare-debug-log/index.js\":{\"offset\":1986197,\"length\":509,\"mode\":420},\"/node_modules/bare-debug-log/package.json\":{\"offset\":1986706,\"length\":675,\"mode\":420},\"/node_modules/bare-dns/binding.js\":{\"offset\":1987381,\"length\":33,\"mode\":420},\"/node_modules/bare-dns/index.js\":{\"offset\":1987414,\"length\":1345,\"mode\":420},\"/node_modules/bare-dns/package.json\":{\"offset\":1988759,\"length\":968,\"mode\":420},\"/node_modules/bare-encoding/global.js\":{\"offset\":1989727,\"length\":115,\"mode\":420},\"/node_modules/bare-encoding/index.js\":{\"offset\":1989842,\"length\":1875,\"mode\":420},\"/node_modules/bare-encoding/lib/errors.js\":{\"offset\":1991717,\"length\":400,\"mode\":420},\"/node_modules/bare-encoding/lib/pass-through-decoder.js\":{\"offset\":1992117,\"length\":395,\"mode\":420},\"/node_modules/bare-encoding/lib/utf8-decoder.js\":{\"offset\":1992512,\"length\":2602,\"mode\":420},\"/node_modules/bare-encoding/package.json\":{\"offset\":1995114,\"length\":1169,\"mode\":420},\"/node_modules/bare-env/index.js\":{\"offset\":1996283,\"length\":1023,\"mode\":420},\"/node_modules/bare-env/package.json\":{\"offset\":1997306,\"length\":649,\"mode\":420},\"/node_modules/bare-events/global.js\":{\"offset\":1997955,\"length\":141,\"mode\":420},\"/node_modules/bare-events/index.js\":{\"offset\":1998096,\"length\":8033,\"mode\":420},\"/node_modules/bare-events/lib/errors.js\":{\"offset\":2006129,\"length\":671,\"mode\":420},\"/node_modules/bare-events/package.json\":{\"offset\":2006800,\"length\":1399,\"mode\":420},\"/node_modules/bare-events/web.js\":{\"offset\":2008199,\"length\":7424,\"mode\":420},\"/node_modules/bare-fetch/global.js\":{\"offset\":2015623,\"length\":144,\"mode\":420},\"/node_modules/bare-fetch/index.js\":{\"offset\":2015767,\"length\":3172,\"mode\":420},\"/node_modules/bare-fetch/lib/body.js\":{\"offset\":2018939,\"length\":2316,\"mode\":420},\"/node_modules/bare-fetch/lib/errors.js\":{\"offset\":2021255,\"length\":897,\"mode\":420},\"/node_modules/bare-fetch/lib/headers.js\":{\"offset\":2022152,\"length\":1480,\"mode\":420},\"/node_modules/bare-fetch/lib/request.js\":{\"offset\":2023632,\"length\":1139,\"mode\":420},\"/node_modules/bare-fetch/lib/response-stream.js\":{\"offset\":2024771,\"length\":1055,\"mode\":420},\"/node_modules/bare-fetch/lib/response.js\":{\"offset\":2025826,\"length\":1178,\"mode\":420},\"/node_modules/bare-fetch/package.json\":{\"offset\":2027004,\"length\":1834,\"mode\":420},\"/node_modules/bare-form-data/index.js\":{\"offset\":2028838,\"length\":5628,\"mode\":420},\"/node_modules/bare-form-data/lib/errors.js\":{\"offset\":2034466,\"length\":436,\"mode\":420},\"/node_modules/bare-form-data/package.json\":{\"offset\":2034902,\"length\":812,\"mode\":420},\"/node_modules/bare-format/index.js\":{\"offset\":2035714,\"length\":3511,\"mode\":420},\"/node_modules/bare-format/package.json\":{\"offset\":2039225,\"length\":835,\"mode\":420},\"/node_modules/bare-fs/binding.js\":{\"offset\":2040060,\"length\":33,\"mode\":420},\"/node_modules/bare-fs/index.js\":{\"offset\":2040093,\"length\":48267,\"mode\":420},\"/node_modules/bare-fs/lib/constants.js\":{\"offset\":2088360,\"length\":1494,\"mode\":420},\"/node_modules/bare-fs/lib/errors.js\":{\"offset\":2089854,\"length\":1163,\"mode\":420},\"/node_modules/bare-fs/package.json\":{\"offset\":2091017,\"length\":1546,\"mode\":420},\"/node_modules/bare-fs/promises.js\":{\"offset\":2092563,\"length\":1866,\"mode\":420},\"/node_modules/bare-hrtime/binding.js\":{\"offset\":2094429,\"length\":33,\"mode\":420},\"/node_modules/bare-hrtime/index.js\":{\"offset\":2094462,\"length\":319,\"mode\":420},\"/node_modules/bare-hrtime/package.json\":{\"offset\":2094781,\"length\":905,\"mode\":420},\"/node_modules/bare-http-parser/index.js\":{\"offset\":2095686,\"length\":4995,\"mode\":420},\"/node_modules/bare-http-parser/lib/errors.js\":{\"offset\":2100681,\"length\":845,\"mode\":420},\"/node_modules/bare-http-parser/package.json\":{\"offset\":2101526,\"length\":793,\"mode\":420},\"/node_modules/bare-http1/index.js\":{\"offset\":2102319,\"length\":2188,\"mode\":420},\"/node_modules/bare-http1/lib/agent.js\":{\"offset\":2104507,\"length\":3056,\"mode\":420},\"/node_modules/bare-http1/lib/client-connection.js\":{\"offset\":2107563,\"length\":3284,\"mode\":420},\"/node_modules/bare-http1/lib/client-request.js\":{\"offset\":2110847,\"length\":2796,\"mode\":420},\"/node_modules/bare-http1/lib/constants.js\":{\"offset\":2113643,\"length\":2016,\"mode\":420},\"/node_modules/bare-http1/lib/errors.js\":{\"offset\":2115659,\"length\":517,\"mode\":420},\"/node_modules/bare-http1/lib/incoming-message.js\":{\"offset\":2116176,\"length\":937,\"mode\":420},\"/node_modules/bare-http1/lib/outgoing-message.js\":{\"offset\":2117113,\"length\":1023,\"mode\":420},\"/node_modules/bare-http1/lib/server-connection.js\":{\"offset\":2118136,\"length\":3760,\"mode\":420},\"/node_modules/bare-http1/lib/server-response.js\":{\"offset\":2121896,\"length\":2922,\"mode\":420},\"/node_modules/bare-http1/lib/server.js\":{\"offset\":2124818,\"length\":977,\"mode\":420},\"/node_modules/bare-http1/package.json\":{\"offset\":2125795,\"length\":1395,\"mode\":420},\"/node_modules/bare-https/index.js\":{\"offset\":2127190,\"length\":1498,\"mode\":420},\"/node_modules/bare-https/lib/agent.js\":{\"offset\":2128688,\"length\":301,\"mode\":420},\"/node_modules/bare-https/lib/client-request.js\":{\"offset\":2128989,\"length\":654,\"mode\":420},\"/node_modules/bare-https/lib/server.js\":{\"offset\":2129643,\"length\":1072,\"mode\":420},\"/node_modules/bare-https/lib/socket.js\":{\"offset\":2130715,\"length\":464,\"mode\":420},\"/node_modules/bare-https/package.json\":{\"offset\":2131179,\"length\":914,\"mode\":420},\"/node_modules/bare-inspect/binding.js\":{\"offset\":2132093,\"length\":33,\"mode\":420},\"/node_modules/bare-inspect/index.js\":{\"offset\":2132126,\"length\":23856,\"mode\":420},\"/node_modules/bare-inspect/package.json\":{\"offset\":2155982,\"length\":1041,\"mode\":420},\"/node_modules/bare-net/index.js\":{\"offset\":2157023,\"length\":7690,\"mode\":420},\"/node_modules/bare-net/lib/constants.js\":{\"offset\":2164713,\"length\":91,\"mode\":420},\"/node_modules/bare-net/package.json\":{\"offset\":2164804,\"length\":1034,\"mode\":420},\"/node_modules/bare-node-runtime/global.js\":{\"offset\":2165838,\"length\":257,\"mode\":420},\"/node_modules/bare-node-runtime/package.json\":{\"offset\":2166095,\"length\":1908,\"mode\":420},\"/node_modules/bare-os/binding.js\":{\"offset\":2168003,\"length\":33,\"mode\":420},\"/node_modules/bare-os/index.js\":{\"offset\":2168036,\"length\":2433,\"mode\":420},\"/node_modules/bare-os/lib/constants.js\":{\"offset\":2170469,\"length\":113,\"mode\":420},\"/node_modules/bare-os/lib/errors.js\":{\"offset\":2170582,\"length\":479,\"mode\":420},\"/node_modules/bare-os/package.json\":{\"offset\":2171061,\"length\":1023,\"mode\":420},\"/node_modules/bare-path/index.js\":{\"offset\":2172084,\"length\":306,\"mode\":420},\"/node_modules/bare-path/lib/constants.js\":{\"offset\":2172390,\"length\":247,\"mode\":420},\"/node_modules/bare-path/lib/posix.js\":{\"offset\":2172637,\"length\":5991,\"mode\":420},\"/node_modules/bare-path/lib/shared.js\":{\"offset\":2178628,\"length\":1888,\"mode\":420},\"/node_modules/bare-path/lib/win32.js\":{\"offset\":2180516,\"length\":13427,\"mode\":420},\"/node_modules/bare-path/package.json\":{\"offset\":2193943,\"length\":796,\"mode\":420},\"/node_modules/bare-performance/binding.js\":{\"offset\":2194739,\"length\":33,\"mode\":420},\"/node_modules/bare-performance/global.js\":{\"offset\":2194772,\"length\":374,\"mode\":420},\"/node_modules/bare-performance/index.js\":{\"offset\":2195146,\"length\":10832,\"mode\":420},\"/node_modules/bare-performance/lib/constants.js\":{\"offset\":2205978,\"length\":92,\"mode\":420},\"/node_modules/bare-performance/lib/errors.js\":{\"offset\":2206070,\"length\":167,\"mode\":420},\"/node_modules/bare-performance/package.json\":{\"offset\":2206237,\"length\":935,\"mode\":420},\"/node_modules/bare-pipe/binding.js\":{\"offset\":2207172,\"length\":33,\"mode\":420},\"/node_modules/bare-pipe/index.js\":{\"offset\":2207205,\"length\":10720,\"mode\":420},\"/node_modules/bare-pipe/lib/constants.js\":{\"offset\":2217925,\"length\":188,\"mode\":420},\"/node_modules/bare-pipe/lib/errors.js\":{\"offset\":2218113,\"length\":599,\"mode\":420},\"/node_modules/bare-pipe/package.json\":{\"offset\":2218712,\"length\":1256,\"mode\":420},\"/node_modules/bare-process/global.js\":{\"offset\":2219968,\"length\":30,\"mode\":420},\"/node_modules/bare-process/index.js\":{\"offset\":2219998,\"length\":3050,\"mode\":420},\"/node_modules/bare-process/package.json\":{\"offset\":2223048,\"length\":1136,\"mode\":420},\"/node_modules/bare-signals/binding.js\":{\"offset\":2224184,\"length\":33,\"mode\":420},\"/node_modules/bare-signals/index.js\":{\"offset\":2224217,\"length\":1517,\"mode\":420},\"/node_modules/bare-signals/lib/emitter.js\":{\"offset\":2225734,\"length\":1278,\"mode\":420},\"/node_modules/bare-signals/lib/errors.js\":{\"offset\":2227012,\"length\":479,\"mode\":420},\"/node_modules/bare-signals/package.json\":{\"offset\":2227491,\"length\":1112,\"mode\":420},\"/node_modules/bare-stream/global.js\":{\"offset\":2228603,\"length\":358,\"mode\":420},\"/node_modules/bare-stream/index.js\":{\"offset\":2228961,\"length\":7658,\"mode\":420},\"/node_modules/bare-stream/package.json\":{\"offset\":2236619,\"length\":1307,\"mode\":420},\"/node_modules/bare-stream/web.js\":{\"offset\":2237926,\"length\":5000,\"mode\":420},\"/node_modules/bare-tcp/binding.js\":{\"offset\":2242926,\"length\":33,\"mode\":420},\"/node_modules/bare-tcp/index.js\":{\"offset\":2242959,\"length\":13836,\"mode\":420},\"/node_modules/bare-tcp/lib/constants.js\":{\"offset\":2256795,\"length\":167,\"mode\":420},\"/node_modules/bare-tcp/lib/errors.js\":{\"offset\":2256962,\"length\":711,\"mode\":420},\"/node_modules/bare-tcp/lib/ip.js\":{\"offset\":2257673,\"length\":2204,\"mode\":420},\"/node_modules/bare-tcp/package.json\":{\"offset\":2259877,\"length\":1128,\"mode\":420},\"/node_modules/bare-tls/binding.js\":{\"offset\":2261005,\"length\":33,\"mode\":420},\"/node_modules/bare-tls/index.js\":{\"offset\":2261038,\"length\":4669,\"mode\":420},\"/node_modules/bare-tls/lib/constants.js\":{\"offset\":2265707,\"length\":55,\"mode\":420},\"/node_modules/bare-tls/lib/errors.js\":{\"offset\":2265762,\"length\":358,\"mode\":420},\"/node_modules/bare-tls/net.js\":{\"offset\":2266120,\"length\":2389,\"mode\":420},\"/node_modules/bare-tls/package.json\":{\"offset\":2268509,\"length\":1339,\"mode\":420},\"/node_modules/bare-tty/binding.js\":{\"offset\":2269848,\"length\":33,\"mode\":420},\"/node_modules/bare-tty/index.js\":{\"offset\":2269881,\"length\":4451,\"mode\":420},\"/node_modules/bare-tty/lib/constants.js\":{\"offset\":2274332,\"length\":442,\"mode\":420},\"/node_modules/bare-tty/package.json\":{\"offset\":2274774,\"length\":1096,\"mode\":420},\"/node_modules/bare-type/binding.js\":{\"offset\":2275870,\"length\":33,\"mode\":420},\"/node_modules/bare-type/index.js\":{\"offset\":2275903,\"length\":4566,\"mode\":420},\"/node_modules/bare-type/package.json\":{\"offset\":2280469,\"length\":938,\"mode\":420},\"/node_modules/bare-url/binding.js\":{\"offset\":2281407,\"length\":33,\"mode\":420},\"/node_modules/bare-url/index.js\":{\"offset\":2281440,\"length\":9261,\"mode\":420},\"/node_modules/bare-url/lib/errors.js\":{\"offset\":2290701,\"length\":778,\"mode\":420},\"/node_modules/bare-url/lib/url-search-params.js\":{\"offset\":2291479,\"length\":3867,\"mode\":420},\"/node_modules/bare-url/package.json\":{\"offset\":2295346,\"length\":1105,\"mode\":420},\"/node_modules/bare-utils/index.js\":{\"offset\":2296451,\"length\":499,\"mode\":420},\"/node_modules/bare-utils/lib/deprecate.js\":{\"offset\":2296950,\"length\":419,\"mode\":420},\"/node_modules/bare-utils/lib/inherits.js\":{\"offset\":2297369,\"length\":132,\"mode\":420},\"/node_modules/bare-utils/lib/promisify.js\":{\"offset\":2297501,\"length\":276,\"mode\":420},\"/node_modules/bare-utils/lib/types.js\":{\"offset\":2297777,\"length\":2869,\"mode\":420},\"/node_modules/bare-utils/package.json\":{\"offset\":2300646,\"length\":949,\"mode\":420},\"/node_modules/bare-zlib/binding.js\":{\"offset\":2301595,\"length\":33,\"mode\":420},\"/node_modules/bare-zlib/index.js\":{\"offset\":2301628,\"length\":7275,\"mode\":420},\"/node_modules/bare-zlib/lib/constants.js\":{\"offset\":2308903,\"length\":74,\"mode\":420},\"/node_modules/bare-zlib/lib/errors.js\":{\"offset\":2308977,\"length\":986,\"mode\":420},\"/node_modules/bare-zlib/package.json\":{\"offset\":2309963,\"length\":1006,\"mode\":420},\"/node_modules/base-x/package.json\":{\"offset\":2310969,\"length\":1056,\"mode\":420},\"/node_modules/base-x/src/index.js\":{\"offset\":2312025,\"length\":4301,\"mode\":420},\"/node_modules/bech32/dist/index.js\":{\"offset\":2316326,\"length\":5231,\"mode\":420},\"/node_modules/bech32/package.json\":{\"offset\":2321557,\"length\":1290,\"mode\":420},\"/node_modules/big-sparse-array/index.js\":{\"offset\":2322847,\"length\":2471,\"mode\":420},\"/node_modules/big-sparse-array/package.json\":{\"offset\":2325318,\"length\":636,\"mode\":420},\"/node_modules/bindings/bindings.js\":{\"offset\":2325954,\"length\":5986,\"mode\":420},\"/node_modules/bindings/package.json\":{\"offset\":2331940,\"length\":660,\"mode\":420},\"/node_modules/bip174/package.json\":{\"offset\":2332600,\"length\":1729,\"mode\":420},\"/node_modules/bip174/src/lib/combiner/index.js\":{\"offset\":2334329,\"length\":2592,\"mode\":420},\"/node_modules/bip174/src/lib/converter/global/globalXpub.js\":{\"offset\":2336921,\"length\":2602,\"mode\":420},\"/node_modules/bip174/src/lib/converter/global/unsignedTx.js\":{\"offset\":2339523,\"length\":284,\"mode\":420},\"/node_modules/bip174/src/lib/converter/index.js\":{\"offset\":2339807,\"length\":2931,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/finalScriptSig.js\":{\"offset\":2342738,\"length\":826,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/finalScriptWitness.js\":{\"offset\":2343564,\"length\":852,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/nonWitnessUtxo.js\":{\"offset\":2344416,\"length\":814,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/partialSig.js\":{\"offset\":2345230,\"length\":2017,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/porCommitment.js\":{\"offset\":2347247,\"length\":863,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/sighashType.js\":{\"offset\":2348110,\"length\":898,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/tapKeySig.js\":{\"offset\":2349008,\"length\":1012,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/tapLeafScript.js\":{\"offset\":2350020,\"length\":1888,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/tapMerkleRoot.js\":{\"offset\":2351908,\"length\":974,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/tapScriptSig.js\":{\"offset\":2352882,\"length\":1886,\"mode\":420},\"/node_modules/bip174/src/lib/converter/input/witnessUtxo.js\":{\"offset\":2354768,\"length\":1595,\"mode\":420},\"/node_modules/bip174/src/lib/converter/output/tapTree.js\":{\"offset\":2356363,\"length\":1820,\"mode\":420},\"/node_modules/bip174/src/lib/converter/shared/bip32Derivation.js\":{\"offset\":2358183,\"length\":2645,\"mode\":420},\"/node_modules/bip174/src/lib/converter/shared/checkPubkey.js\":{\"offset\":2360828,\"length\":577,\"mode\":420},\"/node_modules/bip174/src/lib/converter/shared/redeemScript.js\":{\"offset\":2361405,\"length\":812,\"mode\":420},\"/node_modules/bip174/src/lib/converter/shared/tapBip32Derivation.js\":{\"offset\":2362217,\"length\":1748,\"mode\":420},\"/node_modules/bip174/src/lib/converter/shared/tapInternalKey.js\":{\"offset\":2363965,\"length\":1001,\"mode\":420},\"/node_modules/bip174/src/lib/converter/shared/witnessScript.js\":{\"offset\":2364966,\"length\":828,\"mode\":420},\"/node_modules/bip174/src/lib/converter/tools.js\":{\"offset\":2365794,\"length\":2184,\"mode\":420},\"/node_modules/bip174/src/lib/converter/varint.js\":{\"offset\":2367978,\"length\":2310,\"mode\":420},\"/node_modules/bip174/src/lib/parser/fromBuffer.js\":{\"offset\":2370288,\"length\":13241,\"mode\":420},\"/node_modules/bip174/src/lib/parser/index.js\":{\"offset\":2383529,\"length\":240,\"mode\":420},\"/node_modules/bip174/src/lib/parser/toBuffer.js\":{\"offset\":2383769,\"length\":2412,\"mode\":420},\"/node_modules/bip174/src/lib/psbt.js\":{\"offset\":2386181,\"length\":4438,\"mode\":420},\"/node_modules/bip174/src/lib/typeFields.js\":{\"offset\":2390619,\"length\":2653,\"mode\":420},\"/node_modules/bip174/src/lib/utils.js\":{\"offset\":2393272,\"length\":4691,\"mode\":420},\"/node_modules/bip32-path/index.js\":{\"offset\":2397963,\"length\":2106,\"mode\":420},\"/node_modules/bip32-path/package.json\":{\"offset\":2400069,\"length\":554,\"mode\":420},\"/node_modules/bip32/package.json\":{\"offset\":2400623,\"length\":1697,\"mode\":420},\"/node_modules/bip32/src/bip32.js\":{\"offset\":2402320,\"length\":15192,\"mode\":420},\"/node_modules/bip32/src/crypto.js\":{\"offset\":2417512,\"length\":654,\"mode\":420},\"/node_modules/bip32/src/index.js\":{\"offset\":2418166,\"length\":397,\"mode\":420},\"/node_modules/bip32/src/testecc.js\":{\"offset\":2418563,\"length\":4550,\"mode\":420},\"/node_modules/bip39-mnemonic/index.js\":{\"offset\":2423113,\"length\":4554,\"mode\":420},\"/node_modules/bip39-mnemonic/package.json\":{\"offset\":2427667,\"length\":789,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/chinese_simplified.json\":{\"offset\":2428456,\"length\":12289,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/chinese_traditional.json\":{\"offset\":2440745,\"length\":12289,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/czech.json\":{\"offset\":2453034,\"length\":19042,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/english.json\":{\"offset\":2472076,\"length\":17213,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/french.json\":{\"offset\":2489289,\"length\":20874,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/index.js\":{\"offset\":2510163,\"length\":1406,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/italian.json\":{\"offset\":2511569,\"length\":20130,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/japanese.json\":{\"offset\":2531699,\"length\":30520,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/korean.json\":{\"offset\":2562219,\"length\":41929,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/lookup.json\":{\"offset\":2604148,\"length\":592224,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/portuguese.json\":{\"offset\":3196372,\"length\":19768,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/russian.json\":{\"offset\":3216140,\"length\":30635,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/spanish.json\":{\"offset\":3246775,\"length\":18093,\"mode\":420},\"/node_modules/bip39-mnemonic/wordlist/turkish.json\":{\"offset\":3264868,\"length\":19421,\"mode\":420},\"/node_modules/bip39/package.json\":{\"offset\":3284289,\"length\":1441,\"mode\":420},\"/node_modules/bip39/src/_wordlists.js\":{\"offset\":3285730,\"length\":1799,\"mode\":420},\"/node_modules/bip39/src/index.js\":{\"offset\":3287529,\"length\":6062,\"mode\":420},\"/node_modules/bip39/src/wordlists/chinese_simplified.json\":{\"offset\":3293591,\"length\":22531,\"mode\":420},\"/node_modules/bip39/src/wordlists/chinese_traditional.json\":{\"offset\":3316122,\"length\":22531,\"mode\":420},\"/node_modules/bip39/src/wordlists/czech.json\":{\"offset\":3338653,\"length\":29284,\"mode\":420},\"/node_modules/bip39/src/wordlists/english.json\":{\"offset\":3367937,\"length\":27455,\"mode\":420},\"/node_modules/bip39/src/wordlists/french.json\":{\"offset\":3395392,\"length\":31116,\"mode\":420},\"/node_modules/bip39/src/wordlists/italian.json\":{\"offset\":3426508,\"length\":30372,\"mode\":420},\"/node_modules/bip39/src/wordlists/japanese.json\":{\"offset\":3456880,\"length\":40762,\"mode\":420},\"/node_modules/bip39/src/wordlists/korean.json\":{\"offset\":3497642,\"length\":52171,\"mode\":420},\"/node_modules/bip39/src/wordlists/portuguese.json\":{\"offset\":3549813,\"length\":30010,\"mode\":420},\"/node_modules/bip39/src/wordlists/spanish.json\":{\"offset\":3579823,\"length\":28335,\"mode\":420},\"/node_modules/bip66/index.js\":{\"offset\":3608158,\"length\":3868,\"mode\":420},\"/node_modules/bip66/package.json\":{\"offset\":3612026,\"length\":828,\"mode\":420},\"/node_modules/bip68/index.js\":{\"offset\":3612854,\"length\":1680,\"mode\":420},\"/node_modules/bip68/package.json\":{\"offset\":3614534,\"length\":822,\"mode\":420},\"/node_modules/bitcoinjs-lib/package.json\":{\"offset\":3615356,\"length\":3271,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/address.js\":{\"offset\":3618627,\"length\":6230,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/bip66.js\":{\"offset\":3624857,\"length\":4019,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/block.js\":{\"offset\":3628876,\"length\":7605,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/bufferutils.js\":{\"offset\":3636481,\"length\":5136,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/crypto.js\":{\"offset\":3641617,\"length\":4857,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/ecc_lib.js\":{\"offset\":3646474,\"length\":3618,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/index.js\":{\"offset\":3650092,\"length\":1424,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/merkle.js\":{\"offset\":3651516,\"length\":1116,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/networks.js\":{\"offset\":3652632,\"length\":1615,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/ops.js\":{\"offset\":3654247,\"length\":2381,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/bip341.js\":{\"offset\":3656628,\"length\":4056,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/embed.js\":{\"offset\":3660684,\"length\":1798,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/index.js\":{\"offset\":3662482,\"length\":1476,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/lazy.js\":{\"offset\":3663958,\"length\":707,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/p2ms.js\":{\"offset\":3664665,\"length\":4991,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/p2pk.js\":{\"offset\":3669656,\"length\":2667,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/p2pkh.js\":{\"offset\":3672323,\"length\":4824,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/p2sh.js\":{\"offset\":3677147,\"length\":7154,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/p2tr.js\":{\"offset\":3684301,\"length\":10855,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/p2wpkh.js\":{\"offset\":3695156,\"length\":4965,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/payments/p2wsh.js\":{\"offset\":3700121,\"length\":7559,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/psbt.js\":{\"offset\":3707680,\"length\":55203,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/psbt/bip371.js\":{\"offset\":3762883,\"length\":14653,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/psbt/psbtutils.js\":{\"offset\":3777536,\"length\":6608,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/push_data.js\":{\"offset\":3784144,\"length\":2640,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/script.js\":{\"offset\":3786784,\"length\":6720,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/script_number.js\":{\"offset\":3793504,\"length\":2304,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/script_signature.js\":{\"offset\":3795808,\"length\":2535,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/transaction.js\":{\"offset\":3798343,\"length\":18753,\"mode\":420},\"/node_modules/bitcoinjs-lib/src/types.js\":{\"offset\":3817096,\"length\":3333,\"mode\":420},\"/node_modules/bitcoinjs-message/index.js\":{\"offset\":3820429,\"length\":6112,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/base-x/package.json\":{\"offset\":3826541,\"length\":1110,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/base-x/src/index.js\":{\"offset\":3827651,\"length\":4236,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/bech32/index.js\":{\"offset\":3831887,\"length\":4301,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/bech32/package.json\":{\"offset\":3836188,\"length\":768,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/bs58/index.js\":{\"offset\":3836956,\"length\":140,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/bs58/package.json\":{\"offset\":3837096,\"length\":667,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/bs58check/base.js\":{\"offset\":3837763,\"length\":1199,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/bs58check/index.js\":{\"offset\":3838962,\"length\":300,\"mode\":420},\"/node_modules/bitcoinjs-message/node_modules/bs58check/package.json\":{\"offset\":3839262,\"length\":1167,\"mode\":420},\"/node_modules/bitcoinjs-message/package.json\":{\"offset\":3840429,\"length\":1114,\"mode\":420},\"/node_modules/bn.js/lib/bn.js\":{\"offset\":3841543,\"length\":87778,\"mode\":420},\"/node_modules/bn.js/package.json\":{\"offset\":3929321,\"length\":789,\"mode\":420},\"/node_modules/brorand/index.js\":{\"offset\":3930110,\"length\":1510,\"mode\":420},\"/node_modules/brorand/package.json\":{\"offset\":3931620,\"length\":654,\"mode\":420},\"/node_modules/bs58/index.js\":{\"offset\":3932274,\"length\":144,\"mode\":420},\"/node_modules/bs58/package.json\":{\"offset\":3932418,\"length\":712,\"mode\":420},\"/node_modules/bs58check/base.js\":{\"offset\":3933130,\"length\":1301,\"mode\":420},\"/node_modules/bs58check/index.js\":{\"offset\":3934431,\"length\":233,\"mode\":420},\"/node_modules/bs58check/package.json\":{\"offset\":3934664,\"length\":1213,\"mode\":420},\"/node_modules/buffer-equals/index.js\":{\"offset\":3935877,\"length\":409,\"mode\":420},\"/node_modules/buffer-equals/package.json\":{\"offset\":3936286,\"length\":651,\"mode\":420},\"/node_modules/bufferutil/fallback.js\":{\"offset\":3936937,\"length\":899,\"mode\":420},\"/node_modules/bufferutil/index.js\":{\"offset\":3937836,\"length\":136,\"mode\":420},\"/node_modules/bufferutil/package.json\":{\"offset\":3937972,\"length\":815,\"mode\":420},\"/node_modules/codecs/index.js\":{\"offset\":3938787,\"length\":2416,\"mode\":420},\"/node_modules/codecs/package.json\":{\"offset\":3941203,\"length\":655,\"mode\":420},\"/node_modules/compact-encoding/endian.js\":{\"offset\":3941858,\"length\":105,\"mode\":420},\"/node_modules/compact-encoding/index.js\":{\"offset\":3941963,\"length\":23634,\"mode\":420},\"/node_modules/compact-encoding/lexint.js\":{\"offset\":3965597,\"length\":2851,\"mode\":420},\"/node_modules/compact-encoding/package.json\":{\"offset\":3968448,\"length\":801,\"mode\":420},\"/node_modules/compact-encoding/raw.js\":{\"offset\":3969249,\"length\":4093,\"mode\":420},\"/node_modules/core-coupler/index.js\":{\"offset\":3973342,\"length\":2243,\"mode\":420},\"/node_modules/core-coupler/package.json\":{\"offset\":3975585,\"length\":599,\"mode\":420},\"/node_modules/corestore/index.js\":{\"offset\":3976184,\"length\":17862,\"mode\":420},\"/node_modules/corestore/lib/audit.js\":{\"offset\":3994046,\"length\":475,\"mode\":420},\"/node_modules/corestore/package.json\":{\"offset\":3994521,\"length\":1085,\"mode\":420},\"/node_modules/create-hash/index.js\":{\"offset\":3995606,\"length\":46,\"mode\":420},\"/node_modules/create-hash/package.json\":{\"offset\":3995652,\"length\":936,\"mode\":420},\"/node_modules/debounceify/index.js\":{\"offset\":3996588,\"length\":585,\"mode\":420},\"/node_modules/debounceify/package.json\":{\"offset\":3997173,\"length\":567,\"mode\":420},\"/node_modules/device-file/index.js\":{\"offset\":3997740,\"length\":6088,\"mode\":420},\"/node_modules/device-file/package.json\":{\"offset\":4003828,\"length\":1190,\"mode\":420},\"/node_modules/ecpair/package.json\":{\"offset\":4005018,\"length\":2924,\"mode\":420},\"/node_modules/ecpair/src/ecpair.js\":{\"offset\":4007942,\"length\":5939,\"mode\":420},\"/node_modules/ecpair/src/index.js\":{\"offset\":4013881,\"length\":571,\"mode\":420},\"/node_modules/ecpair/src/networks.js\":{\"offset\":4014452,\"length\":535,\"mode\":420},\"/node_modules/ecpair/src/testecc.js\":{\"offset\":4014987,\"length\":7015,\"mode\":420},\"/node_modules/ecpair/src/types.js\":{\"offset\":4022002,\"length\":855,\"mode\":420},\"/node_modules/elliptic/lib/elliptic.js\":{\"offset\":4022857,\"length\":371,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/curve/base.js\":{\"offset\":4023228,\"length\":9202,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/curve/edwards.js\":{\"offset\":4032430,\"length\":10908,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/curve/index.js\":{\"offset\":4043338,\"length\":173,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/curve/mont.js\":{\"offset\":4043511,\"length\":4581,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/curve/short.js\":{\"offset\":4048092,\"length\":22969,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/curves.js\":{\"offset\":4071061,\"length\":6453,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/ec/index.js\":{\"offset\":4077514,\"length\":7500,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/ec/key.js\":{\"offset\":4085014,\"length\":3146,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/ec/signature.js\":{\"offset\":4088160,\"length\":3432,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/eddsa/index.js\":{\"offset\":4091592,\"length\":3578,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/eddsa/key.js\":{\"offset\":4095170,\"length\":2496,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/eddsa/signature.js\":{\"offset\":4097666,\"length\":1786,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\":{\"offset\":4099452,\"length\":32535,\"mode\":420},\"/node_modules/elliptic/lib/elliptic/utils.js\":{\"offset\":4131987,\"length\":2411,\"mode\":420},\"/node_modules/elliptic/package.json\":{\"offset\":4134398,\"length\":1396,\"mode\":420},\"/node_modules/encryption-encoding/index.js\":{\"offset\":4135794,\"length\":378,\"mode\":420},\"/node_modules/encryption-encoding/package.json\":{\"offset\":4136172,\"length\":1234,\"mode\":420},\"/node_modules/encryption-encoding/spec/hyperschema/index.js\":{\"offset\":4137406,\"length\":1749,\"mode\":420},\"/node_modules/ethers/lib.esm/_version.js\":{\"offset\":4139155,\"length\":180,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/abi-coder.js\":{\"offset\":4139335,\"length\":8081,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/bytes32.js\":{\"offset\":4147416,\"length\":1195,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/abstract-coder.js\":{\"offset\":4148611,\"length\":16028,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/address.js\":{\"offset\":4164639,\"length\":838,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/anonymous.js\":{\"offset\":4165477,\"length\":577,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/array.js\":{\"offset\":4166054,\"length\":5949,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/boolean.js\":{\"offset\":4172003,\"length\":520,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/bytes.js\":{\"offset\":4172523,\"length\":839,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/fixed-bytes.js\":{\"offset\":4173362,\"length\":956,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/null.js\":{\"offset\":4174318,\"length\":541,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/number.js\":{\"offset\":4174859,\"length\":1639,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/string.js\":{\"offset\":4176498,\"length\":577,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/coders/tuple.js\":{\"offset\":4177075,\"length\":1946,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/fragments.js\":{\"offset\":4179021,\"length\":46421,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/index.js\":{\"offset\":4225442,\"length\":836,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/interface.js\":{\"offset\":4226278,\"length\":41082,\"mode\":420},\"/node_modules/ethers/lib.esm/abi/typed.js\":{\"offset\":4267360,\"length\":16449,\"mode\":420},\"/node_modules/ethers/lib.esm/address/address.js\":{\"offset\":4283809,\"length\":5856,\"mode\":420},\"/node_modules/ethers/lib.esm/address/checks.js\":{\"offset\":4289665,\"length\":3665,\"mode\":420},\"/node_modules/ethers/lib.esm/address/contract-address.js\":{\"offset\":4293330,\"length\":2575,\"mode\":420},\"/node_modules/ethers/lib.esm/address/index.js\":{\"offset\":4295905,\"length\":793,\"mode\":420},\"/node_modules/ethers/lib.esm/constants/addresses.js\":{\"offset\":4296698,\"length\":222,\"mode\":420},\"/node_modules/ethers/lib.esm/constants/hashes.js\":{\"offset\":4296920,\"length\":261,\"mode\":420},\"/node_modules/ethers/lib.esm/constants/index.js\":{\"offset\":4297181,\"length\":376,\"mode\":420},\"/node_modules/ethers/lib.esm/constants/numbers.js\":{\"offset\":4297557,\"length\":1233,\"mode\":420},\"/node_modules/ethers/lib.esm/constants/strings.js\":{\"offset\":4298790,\"length\":432,\"mode\":420},\"/node_modules/ethers/lib.esm/contract/contract.js\":{\"offset\":4299222,\"length\":35241,\"mode\":420},\"/node_modules/ethers/lib.esm/contract/factory.js\":{\"offset\":4334463,\"length\":4176,\"mode\":420},\"/node_modules/ethers/lib.esm/contract/index.js\":{\"offset\":4338639,\"length\":671,\"mode\":420},\"/node_modules/ethers/lib.esm/contract/wrappers.js\":{\"offset\":4339310,\"length\":5000,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/crypto.js\":{\"offset\":4344310,\"length\":108,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/hmac.js\":{\"offset\":4344418,\"length\":1366,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/index.js\":{\"offset\":4345784,\"length\":1146,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/keccak.js\":{\"offset\":4346930,\"length\":1287,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/pbkdf2.js\":{\"offset\":4348217,\"length\":1681,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/random.js\":{\"offset\":4349898,\"length\":1024,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/ripemd160.js\":{\"offset\":4350922,\"length\":959,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/scrypt.js\":{\"offset\":4351881,\"length\":3882,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/sha2.js\":{\"offset\":4355763,\"length\":1670,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/signature.js\":{\"offset\":4357433,\"length\":9880,\"mode\":420},\"/node_modules/ethers/lib.esm/crypto/signing-key.js\":{\"offset\":4367313,\"length\":6243,\"mode\":420},\"/node_modules/ethers/lib.esm/ethers.js\":{\"offset\":4373556,\"length\":3429,\"mode\":420},\"/node_modules/ethers/lib.esm/hash/authorization.js\":{\"offset\":4376985,\"length\":995,\"mode\":420},\"/node_modules/ethers/lib.esm/hash/id.js\":{\"offset\":4377980,\"length\":460,\"mode\":420},\"/node_modules/ethers/lib.esm/hash/index.js\":{\"offset\":4378440,\"length\":626,\"mode\":420},\"/node_modules/ethers/lib.esm/hash/message.js\":{\"offset\":4379066,\"length\":1592,\"mode\":420},\"/node_modules/ethers/lib.esm/hash/namehash.js\":{\"offset\":4380658,\"length\":2757,\"mode\":420},\"/node_modules/ethers/lib.esm/hash/solidity.js\":{\"offset\":4383415,\"length\":3897,\"mode\":420},\"/node_modules/ethers/lib.esm/hash/typed-data.js\":{\"offset\":4387312,\"length\":19734,\"mode\":420},\"/node_modules/ethers/lib.esm/index.js\":{\"offset\":4407046,\"length\":350,\"mode\":420},\"/node_modules/ethers/lib.esm/package.json\":{\"offset\":4407396,\"length\":438,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/abstract-provider.js\":{\"offset\":4407834,\"length\":51658,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/abstract-signer.js\":{\"offset\":4459492,\"length\":9985,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/community.js\":{\"offset\":4469477,\"length\":1545,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/default-provider.js\":{\"offset\":4471022,\"length\":7249,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/ens-resolver.js\":{\"offset\":4478271,\"length\":19662,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/format.js\":{\"offset\":4497933,\"length\":9496,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/index.js\":{\"offset\":4507429,\"length\":2337,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/network.js\":{\"offset\":4509766,\"length\":12855,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/plugins-network.js\":{\"offset\":4522621,\"length\":6664,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-alchemy.js\":{\"offset\":4529285,\"length\":5280,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-ankr.js\":{\"offset\":4534565,\"length\":4562,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-blockscout.js\":{\"offset\":4539127,\"length\":5245,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-browser.js\":{\"offset\":4544372,\"length\":7910,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-chainstack.js\":{\"offset\":4552282,\"length\":3372,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-cloudflare.js\":{\"offset\":4555654,\"length\":736,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-etherscan.js\":{\"offset\":4556390,\"length\":23765,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-fallback.js\":{\"offset\":4580155,\"length\":23359,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-infura.js\":{\"offset\":4603514,\"length\":7063,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-ipcsocket.js\":{\"offset\":4610577,\"length\":2128,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js\":{\"offset\":4612705,\"length\":39192,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-pocket.js\":{\"offset\":4651897,\"length\":3622,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-quicknode.js\":{\"offset\":4655519,\"length\":5657,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-socket.js\":{\"offset\":4661176,\"length\":10181,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider-websocket.js\":{\"offset\":4671357,\"length\":2628,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/provider.js\":{\"offset\":4673985,\"length\":43415,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/signer-noncemanager.js\":{\"offset\":4717400,\"length\":2294,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/subscriber-filterid.js\":{\"offset\":4719694,\"length\":5450,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/subscriber-polling.js\":{\"offset\":4725144,\"length\":8552,\"mode\":420},\"/node_modules/ethers/lib.esm/providers/ws.js\":{\"offset\":4733696,\"length\":62,\"mode\":420},\"/node_modules/ethers/lib.esm/transaction/accesslist.js\":{\"offset\":4733758,\"length\":1548,\"mode\":420},\"/node_modules/ethers/lib.esm/transaction/address.js\":{\"offset\":4735306,\"length\":808,\"mode\":420},\"/node_modules/ethers/lib.esm/transaction/authorization.js\":{\"offset\":4736114,\"length\":478,\"mode\":420},\"/node_modules/ethers/lib.esm/transaction/index.js\":{\"offset\":4736592,\"length\":400,\"mode\":420},\"/node_modules/ethers/lib.esm/transaction/transaction.js\":{\"offset\":4736992,\"length\":40305,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/base58.js\":{\"offset\":4777297,\"length\":1932,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/base64.js\":{\"offset\":4779229,\"length\":1466,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/data.js\":{\"offset\":4780695,\"length\":5028,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/errors.js\":{\"offset\":4785723,\"length\":7595,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/events.js\":{\"offset\":4793318,\"length\":1129,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/fetch.js\":{\"offset\":4794447,\"length\":28729,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/fixednumber.js\":{\"offset\":4823176,\"length\":19466,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/geturl.js\":{\"offset\":4842642,\"length\":4700,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/index.js\":{\"offset\":4847342,\"length\":1361,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/maths.js\":{\"offset\":4848703,\"length\":7083,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/properties.js\":{\"offset\":4855786,\"length\":1603,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/rlp-decode.js\":{\"offset\":4857389,\"length\":3142,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/rlp-encode.js\":{\"offset\":4860531,\"length\":1431,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/units.js\":{\"offset\":4861962,\"length\":2858,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/utf8.js\":{\"offset\":4864820,\"length\":7765,\"mode\":420},\"/node_modules/ethers/lib.esm/utils/uuid.js\":{\"offset\":4872585,\"length\":894,\"mode\":420},\"/node_modules/ethers/lib.esm/wallet/base-wallet.js\":{\"offset\":4873479,\"length\":4805,\"mode\":420},\"/node_modules/ethers/lib.esm/wallet/hdwallet.js\":{\"offset\":4878284,\"length\":18581,\"mode\":420},\"/node_modules/ethers/lib.esm/wallet/index.js\":{\"offset\":4896865,\"length\":1203,\"mode\":420},\"/node_modules/ethers/lib.esm/wallet/json-crowdsale.js\":{\"offset\":4898068,\"length\":2108,\"mode\":420},\"/node_modules/ethers/lib.esm/wallet/json-keystore.js\":{\"offset\":4900176,\"length\":12774,\"mode\":420},\"/node_modules/ethers/lib.esm/wallet/mnemonic.js\":{\"offset\":4912950,\"length\":6254,\"mode\":420},\"/node_modules/ethers/lib.esm/wallet/utils.js\":{\"offset\":4919204,\"length\":4117,\"mode\":420},\"/node_modules/ethers/lib.esm/wallet/wallet.js\":{\"offset\":4923321,\"length\":5592,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/bit-reader.js\":{\"offset\":4928913,\"length\":1013,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/decode-owl.js\":{\"offset\":4929926,\"length\":1657,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/decode-owla.js\":{\"offset\":4931583,\"length\":1055,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/index.js\":{\"offset\":4932638,\"length\":1041,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-cz.js\":{\"offset\":4933679,\"length\":8014,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-en.js\":{\"offset\":4941693,\"length\":6893,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-es.js\":{\"offset\":4948586,\"length\":7157,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-fr.js\":{\"offset\":4955743,\"length\":8908,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-it.js\":{\"offset\":4964651,\"length\":8544,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-ja.js\":{\"offset\":4973195,\"length\":12817,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-ko.js\":{\"offset\":4986012,\"length\":14355,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-pt.js\":{\"offset\":5000367,\"length\":8383,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/lang-zh.js\":{\"offset\":5008750,\"length\":10828,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/wordlist-owl.js\":{\"offset\":5019578,\"length\":2150,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/wordlist-owla.js\":{\"offset\":5021728,\"length\":1124,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/wordlist.js\":{\"offset\":5022852,\"length\":1427,\"mode\":420},\"/node_modules/ethers/lib.esm/wordlists/wordlists.js\":{\"offset\":5024279,\"length\":1216,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/curves/esm/_shortw_utils.js\":{\"offset\":5025495,\"length\":663,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/curve.js\":{\"offset\":5026158,\"length\":6945,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/hash-to-curve.js\":{\"offset\":5033103,\"length\":6824,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/modular.js\":{\"offset\":5039927,\"length\":16981,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/utils.js\":{\"offset\":5056908,\"length\":9660,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/curves/esm/abstract/weierstrass.js\":{\"offset\":5066568,\"length\":45624,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/curves/esm/package.json\":{\"offset\":5112192,\"length\":47,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/curves/esm/secp256k1.js\":{\"offset\":5112239,\"length\":11486,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/_assert.js\":{\"offset\":5123725,\"length\":1367,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/_sha2.js\":{\"offset\":5125092,\"length\":4360,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/_u64.js\":{\"offset\":5129452,\"length\":2967,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/cryptoNode.js\":{\"offset\":5132419,\"length\":351,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/hmac.js\":{\"offset\":5132770,\"length\":2795,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/package.json\":{\"offset\":5135565,\"length\":147,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/pbkdf2.js\":{\"offset\":5135712,\"length\":3547,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/ripemd160.js\":{\"offset\":5139259,\"length\":4342,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/scrypt.js\":{\"offset\":5143601,\"length\":9805,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/sha256.js\":{\"offset\":5153406,\"length\":5003,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/sha3.js\":{\"offset\":5158409,\"length\":7781,\"mode\":420},\"/node_modules/ethers/node_modules/@noble/hashes/esm/utils.js\":{\"offset\":5166190,\"length\":6012,\"mode\":420},\"/node_modules/events-universal/bare.js\":{\"offset\":5172202,\"length\":40,\"mode\":420},\"/node_modules/events-universal/package.json\":{\"offset\":5172242,\"length\":908,\"mode\":420},\"/node_modules/fast-fifo/fixed-size.js\":{\"offset\":5173150,\"length\":875,\"mode\":420},\"/node_modules/fast-fifo/index.js\":{\"offset\":5174025,\"length\":972,\"mode\":420},\"/node_modules/fast-fifo/package.json\":{\"offset\":5174997,\"length\":682,\"mode\":420},\"/node_modules/fd-lock/index.js\":{\"offset\":5175679,\"length\":1661,\"mode\":420},\"/node_modules/fd-lock/package.json\":{\"offset\":5177340,\"length\":1099,\"mode\":420},\"/node_modules/file-uri-to-path/index.js\":{\"offset\":5178439,\"length\":1723,\"mode\":420},\"/node_modules/file-uri-to-path/package.json\":{\"offset\":5180162,\"length\":717,\"mode\":420},\"/node_modules/flat-tree/index.js\":{\"offset\":5180879,\"length\":8164,\"mode\":420},\"/node_modules/flat-tree/package.json\":{\"offset\":5189043,\"length\":631,\"mode\":420},\"/node_modules/fs-native-extensions/binding.js\":{\"offset\":5189674,\"length\":90,\"mode\":420},\"/node_modules/fs-native-extensions/index.js\":{\"offset\":5189764,\"length\":5718,\"mode\":420},\"/node_modules/fs-native-extensions/package.json\":{\"offset\":5195482,\"length\":1699,\"mode\":420},\"/node_modules/hash.js/lib/hash.js\":{\"offset\":5197181,\"length\":444,\"mode\":420},\"/node_modules/hash.js/lib/hash/common.js\":{\"offset\":5197625,\"length\":2312,\"mode\":420},\"/node_modules/hash.js/lib/hash/hmac.js\":{\"offset\":5199937,\"length\":1139,\"mode\":420},\"/node_modules/hash.js/lib/hash/ripemd.js\":{\"offset\":5201076,\"length\":3551,\"mode\":420},\"/node_modules/hash.js/lib/hash/sha.js\":{\"offset\":5204627,\"length\":206,\"mode\":420},\"/node_modules/hash.js/lib/hash/sha/1.js\":{\"offset\":5204833,\"length\":1567,\"mode\":420},\"/node_modules/hash.js/lib/hash/sha/224.js\":{\"offset\":5206400,\"length\":670,\"mode\":420},\"/node_modules/hash.js/lib/hash/sha/256.js\":{\"offset\":5207070,\"length\":2878,\"mode\":420},\"/node_modules/hash.js/lib/hash/sha/384.js\":{\"offset\":5209948,\"length\":768,\"mode\":420},\"/node_modules/hash.js/lib/hash/sha/512.js\":{\"offset\":5210716,\"length\":8342,\"mode\":420},\"/node_modules/hash.js/lib/hash/sha/common.js\":{\"offset\":5219058,\"length\":907,\"mode\":420},\"/node_modules/hash.js/lib/hash/utils.js\":{\"offset\":5219965,\"length\":6527,\"mode\":420},\"/node_modules/hash.js/package.json\":{\"offset\":5226492,\"length\":855,\"mode\":420},\"/node_modules/hmac-drbg/lib/hmac-drbg.js\":{\"offset\":5227347,\"length\":2988,\"mode\":420},\"/node_modules/hmac-drbg/package.json\":{\"offset\":5230335,\"length\":752,\"mode\":420},\"/node_modules/hyperbee/index.js\":{\"offset\":5231087,\"length\":46120,\"mode\":420},\"/node_modules/hyperbee/iterators/diff.js\":{\"offset\":5277207,\"length\":5368,\"mode\":420},\"/node_modules/hyperbee/iterators/history.js\":{\"offset\":5282575,\"length\":1642,\"mode\":420},\"/node_modules/hyperbee/iterators/local.js\":{\"offset\":5284217,\"length\":1180,\"mode\":420},\"/node_modules/hyperbee/iterators/range.js\":{\"offset\":5285397,\"length\":4734,\"mode\":420},\"/node_modules/hyperbee/lib/extension.js\":{\"offset\":5290131,\"length\":3445,\"mode\":420},\"/node_modules/hyperbee/lib/messages.js\":{\"offset\":5293576,\"length\":28162,\"mode\":420},\"/node_modules/hyperbee/package.json\":{\"offset\":5321738,\"length\":1216,\"mode\":420},\"/node_modules/hypercore-crypto/index.js\":{\"offset\":5322954,\"length\":5040,\"mode\":420},\"/node_modules/hypercore-crypto/package.json\":{\"offset\":5327994,\"length\":771,\"mode\":420},\"/node_modules/hypercore-errors/index.js\":{\"offset\":5328765,\"length\":4896,\"mode\":420},\"/node_modules/hypercore-errors/package.json\":{\"offset\":5333661,\"length\":688,\"mode\":420},\"/node_modules/hypercore-id-encoding/index.js\":{\"offset\":5334349,\"length\":923,\"mode\":420},\"/node_modules/hypercore-id-encoding/package.json\":{\"offset\":5335272,\"length\":799,\"mode\":420},\"/node_modules/hypercore-storage/index.js\":{\"offset\":5336071,\"length\":27551,\"mode\":420},\"/node_modules/hypercore-storage/lib/block-dependency-stream.js\":{\"offset\":5363622,\"length\":2557,\"mode\":420},\"/node_modules/hypercore-storage/lib/close-error-stream.js\":{\"offset\":5366179,\"length\":276,\"mode\":420},\"/node_modules/hypercore-storage/lib/keys.js\":{\"offset\":5366455,\"length\":7454,\"mode\":420},\"/node_modules/hypercore-storage/lib/streams.js\":{\"offset\":5373909,\"length\":4820,\"mode\":420},\"/node_modules/hypercore-storage/lib/tx.js\":{\"offset\":5378729,\"length\":8416,\"mode\":420},\"/node_modules/hypercore-storage/lib/view.js\":{\"offset\":5387145,\"length\":8378,\"mode\":420},\"/node_modules/hypercore-storage/migrations/0/index.js\":{\"offset\":5395523,\"length\":20125,\"mode\":420},\"/node_modules/hypercore-storage/migrations/0/messages.js\":{\"offset\":5415648,\"length\":26210,\"mode\":420},\"/node_modules/hypercore-storage/package.json\":{\"offset\":5441858,\"length\":1248,\"mode\":420},\"/node_modules/hypercore-storage/spec/hyperschema/index.js\":{\"offset\":5443106,\"length\":13108,\"mode\":420},\"/node_modules/hypercore/index.js\":{\"offset\":5456214,\"length\":33855,\"mode\":420},\"/node_modules/hypercore/lib/audit.js\":{\"offset\":5490069,\"length\":3834,\"mode\":420},\"/node_modules/hypercore/lib/bit-interlude.js\":{\"offset\":5493903,\"length\":4257,\"mode\":420},\"/node_modules/hypercore/lib/bitfield.js\":{\"offset\":5498160,\"length\":12115,\"mode\":420},\"/node_modules/hypercore/lib/caps.js\":{\"offset\":5510275,\"length\":1537,\"mode\":420},\"/node_modules/hypercore/lib/compat.js\":{\"offset\":5511812,\"length\":477,\"mode\":420},\"/node_modules/hypercore/lib/copy-prologue.js\":{\"offset\":5512289,\"length\":5999,\"mode\":420},\"/node_modules/hypercore/lib/core.js\":{\"offset\":5518288,\"length\":24419,\"mode\":420},\"/node_modules/hypercore/lib/default-encryption.js\":{\"offset\":5542707,\"length\":3453,\"mode\":420},\"/node_modules/hypercore/lib/download.js\":{\"offset\":5546160,\"length\":1278,\"mode\":420},\"/node_modules/hypercore/lib/hotswap-queue.js\":{\"offset\":5547438,\"length\":1498,\"mode\":420},\"/node_modules/hypercore/lib/info.js\":{\"offset\":5548936,\"length\":1517,\"mode\":420},\"/node_modules/hypercore/lib/inspect.js\":{\"offset\":5550453,\"length\":1983,\"mode\":420},\"/node_modules/hypercore/lib/merkle-tree.js\":{\"offset\":5552436,\"length\":33977,\"mode\":420},\"/node_modules/hypercore/lib/messages.js\":{\"offset\":5586413,\"length\":28353,\"mode\":420},\"/node_modules/hypercore/lib/multisig.js\":{\"offset\":5614766,\"length\":2851,\"mode\":420},\"/node_modules/hypercore/lib/mutex.js\":{\"offset\":5617617,\"length\":1028,\"mode\":420},\"/node_modules/hypercore/lib/receiver-queue.js\":{\"offset\":5618645,\"length\":1413,\"mode\":420},\"/node_modules/hypercore/lib/remote-bitfield.js\":{\"offset\":5620058,\"length\":8124,\"mode\":420},\"/node_modules/hypercore/lib/replicator.js\":{\"offset\":5628182,\"length\":85489,\"mode\":420},\"/node_modules/hypercore/lib/session-state.js\":{\"offset\":5713671,\"length\":32225,\"mode\":420},\"/node_modules/hypercore/lib/streams.js\":{\"offset\":5745896,\"length\":3034,\"mode\":420},\"/node_modules/hypercore/lib/verifier.js\":{\"offset\":5748930,\"length\":9678,\"mode\":420},\"/node_modules/hypercore/lib/wants.js\":{\"offset\":5758608,\"length\":7031,\"mode\":420},\"/node_modules/hypercore/package.json\":{\"offset\":5765639,\"length\":2197,\"mode\":420},\"/node_modules/hyperschema/package.json\":{\"offset\":5767836,\"length\":1556,\"mode\":420},\"/node_modules/hyperschema/runtime.cjs\":{\"offset\":5769392,\"length\":54,\"mode\":420},\"/node_modules/index-encoder/index.js\":{\"offset\":5769446,\"length\":6762,\"mode\":420},\"/node_modules/index-encoder/package.json\":{\"offset\":5776208,\"length\":729,\"mode\":420},\"/node_modules/inherits/inherits.js\":{\"offset\":5776937,\"length\":250,\"mode\":420},\"/node_modules/inherits/inherits_browser.js\":{\"offset\":5777187,\"length\":753,\"mode\":420},\"/node_modules/inherits/package.json\":{\"offset\":5777940,\"length\":581,\"mode\":420},\"/node_modules/is-options/index.js\":{\"offset\":5778521,\"length\":140,\"mode\":420},\"/node_modules/is-options/package.json\":{\"offset\":5778661,\"length\":605,\"mode\":420},\"/node_modules/keet-identity-key/index.js\":{\"offset\":5779266,\"length\":6320,\"mode\":420},\"/node_modules/keet-identity-key/lib/crypto.js\":{\"offset\":5785586,\"length\":552,\"mode\":420},\"/node_modules/keet-identity-key/lib/encoding.js\":{\"offset\":5786138,\"length\":3695,\"mode\":420},\"/node_modules/keet-identity-key/lib/keychain.js\":{\"offset\":5789833,\"length\":3080,\"mode\":420},\"/node_modules/keet-identity-key/package.json\":{\"offset\":5792913,\"length\":888,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/index.js\":{\"offset\":5793801,\"length\":1309,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/appClient.js\":{\"offset\":5795110,\"length\":26885,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/bip32.js\":{\"offset\":5821995,\"length\":4823,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/buffertools.js\":{\"offset\":5826818,\"length\":8968,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/clientCommands.js\":{\"offset\":5835786,\"length\":23065,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/merkelizedPsbt.js\":{\"offset\":5858851,\"length\":4691,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/merkle.js\":{\"offset\":5863542,\"length\":8222,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/merkleMap.js\":{\"offset\":5871764,\"length\":3412,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/policy.js\":{\"offset\":5875176,\"length\":4806,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/psbtv2.js\":{\"offset\":5879982,\"length\":55414,\"mode\":420},\"/node_modules/ledger-bitcoin/build/main/lib/varint.js\":{\"offset\":5935396,\"length\":7743,\"mode\":420},\"/node_modules/ledger-bitcoin/package.json\":{\"offset\":5943139,\"length\":2159,\"mode\":420},\"/node_modules/lodash.memoize/index.js\":{\"offset\":5945298,\"length\":16969,\"mode\":420},\"/node_modules/lodash.memoize/package.json\":{\"offset\":5962267,\"length\":746,\"mode\":420},\"/node_modules/lru-cache/dist/esm/index.js\":{\"offset\":5963013,\"length\":56062,\"mode\":420},\"/node_modules/lru-cache/dist/esm/package.json\":{\"offset\":6019075,\"length\":23,\"mode\":420},\"/node_modules/minimalistic-assert/index.js\":{\"offset\":6019098,\"length\":252,\"mode\":420},\"/node_modules/minimalistic-assert/package.json\":{\"offset\":6019350,\"length\":510,\"mode\":420},\"/node_modules/minimalistic-crypto-utils/lib/utils.js\":{\"offset\":6019860,\"length\":1140,\"mode\":420},\"/node_modules/minimalistic-crypto-utils/package.json\":{\"offset\":6021000,\"length\":693,\"mode\":420},\"/node_modules/mutexify/index.js\":{\"offset\":6021693,\"length\":536,\"mode\":420},\"/node_modules/mutexify/package.json\":{\"offset\":6022229,\"length\":679,\"mode\":420},\"/node_modules/mutexify/promise.js\":{\"offset\":6022908,\"length\":324,\"mode\":420},\"/node_modules/nanoassert/index.js\":{\"offset\":6023232,\"length\":438,\"mode\":420},\"/node_modules/nanoassert/package.json\":{\"offset\":6023670,\"length\":647,\"mode\":420},\"/node_modules/node-gyp-build/index.js\":{\"offset\":6024317,\"length\":390,\"mode\":420},\"/node_modules/node-gyp-build/node-gyp-build.js\":{\"offset\":6024707,\"length\":6078,\"mode\":420},\"/node_modules/node-gyp-build/package.json\":{\"offset\":6030785,\"length\":1004,\"mode\":420},\"/node_modules/noise-curve-ed/index.js\":{\"offset\":6031789,\"length\":1642,\"mode\":420},\"/node_modules/noise-curve-ed/package.json\":{\"offset\":6033431,\"length\":808,\"mode\":420},\"/node_modules/noise-handshake/cipher.js\":{\"offset\":6034239,\"length\":2817,\"mode\":420},\"/node_modules/noise-handshake/dh.js\":{\"offset\":6037056,\"length\":1439,\"mode\":420},\"/node_modules/noise-handshake/hkdf.js\":{\"offset\":6038495,\"length\":1092,\"mode\":420},\"/node_modules/noise-handshake/hmac.js\":{\"offset\":6039587,\"length\":1273,\"mode\":420},\"/node_modules/noise-handshake/noise.js\":{\"offset\":6040860,\"length\":6437,\"mode\":420},\"/node_modules/noise-handshake/package.json\":{\"offset\":6047297,\"length\":638,\"mode\":420},\"/node_modules/noise-handshake/symmetric-state.js\":{\"offset\":6047935,\"length\":2206,\"mode\":420},\"/node_modules/p-limit/index.js\":{\"offset\":6050141,\"length\":2823,\"mode\":420},\"/node_modules/p-limit/package.json\":{\"offset\":6052964,\"length\":1076,\"mode\":420},\"/node_modules/protocol-buffers-encodings/index.js\":{\"offset\":6054040,\"length\":6489,\"mode\":420},\"/node_modules/protocol-buffers-encodings/package.json\":{\"offset\":6060529,\"length\":719,\"mode\":420},\"/node_modules/protomux-wakeup/index.js\":{\"offset\":6061248,\"length\":16824,\"mode\":420},\"/node_modules/protomux-wakeup/package.json\":{\"offset\":6078072,\"length\":972,\"mode\":420},\"/node_modules/protomux-wakeup/spec/hyperschema/index.js\":{\"offset\":6079044,\"length\":3335,\"mode\":420},\"/node_modules/protomux/index.js\":{\"offset\":6082379,\"length\":18996,\"mode\":420},\"/node_modules/protomux/package.json\":{\"offset\":6101375,\"length\":816,\"mode\":420},\"/node_modules/queue-tick/package.json\":{\"offset\":6102191,\"length\":669,\"mode\":420},\"/node_modules/queue-tick/process-next-tick.js\":{\"offset\":6102860,\"length\":160,\"mode\":420},\"/node_modules/queue-tick/queue-microtask.js\":{\"offset\":6103020,\"length\":108,\"mode\":420},\"/node_modules/quickbit-native/binding.js\":{\"offset\":6103128,\"length\":90,\"mode\":420},\"/node_modules/quickbit-native/index.js\":{\"offset\":6103218,\"length\":4683,\"mode\":420},\"/node_modules/quickbit-native/package.json\":{\"offset\":6107901,\"length\":1104,\"mode\":420},\"/node_modules/quickbit-universal/fallback.js\":{\"offset\":6109005,\"length\":10204,\"mode\":420},\"/node_modules/quickbit-universal/index.js\":{\"offset\":6119209,\"length\":442,\"mode\":420},\"/node_modules/quickbit-universal/package.json\":{\"offset\":6119651,\"length\":908,\"mode\":420},\"/node_modules/rache/index.js\":{\"offset\":6120559,\"length\":2463,\"mode\":420},\"/node_modules/rache/package.json\":{\"offset\":6123022,\"length\":602,\"mode\":420},\"/node_modules/random-array-iterator/index.js\":{\"offset\":6123624,\"length\":1001,\"mode\":420},\"/node_modules/random-array-iterator/package.json\":{\"offset\":6124625,\"length\":700,\"mode\":420},\"/node_modules/randombytes/index.js\":{\"offset\":6125325,\"length\":47,\"mode\":420},\"/node_modules/randombytes/package.json\":{\"offset\":6125372,\"length\":869,\"mode\":420},\"/node_modules/ready-resource/index.js\":{\"offset\":6126241,\"length\":1091,\"mode\":420},\"/node_modules/ready-resource/package.json\":{\"offset\":6127332,\"length\":812,\"mode\":420},\"/node_modules/refcounter/index.js\":{\"offset\":6128144,\"length\":611,\"mode\":420},\"/node_modules/refcounter/package.json\":{\"offset\":6128755,\"length\":451,\"mode\":420},\"/node_modules/require-addon/lib/bare.js\":{\"offset\":6129206,\"length\":45,\"mode\":420},\"/node_modules/require-addon/package.json\":{\"offset\":6129251,\"length\":1449,\"mode\":420},\"/node_modules/resolve-reject-promise/index.js\":{\"offset\":6130700,\"length\":443,\"mode\":420},\"/node_modules/resolve-reject-promise/package.json\":{\"offset\":6131143,\"length\":581,\"mode\":420},\"/node_modules/resource-on-exit/index.js\":{\"offset\":6131724,\"length\":361,\"mode\":420},\"/node_modules/resource-on-exit/package.json\":{\"offset\":6132085,\"length\":496,\"mode\":420},\"/node_modules/rocksdb-native/binding.js\":{\"offset\":6132581,\"length\":90,\"mode\":420},\"/node_modules/rocksdb-native/index.js\":{\"offset\":6132671,\"length\":4708,\"mode\":420},\"/node_modules/rocksdb-native/lib/batch.js\":{\"offset\":6137379,\"length\":8812,\"mode\":420},\"/node_modules/rocksdb-native/lib/column-family.js\":{\"offset\":6146191,\"length\":2849,\"mode\":420},\"/node_modules/rocksdb-native/lib/constants.js\":{\"offset\":6149040,\"length\":248,\"mode\":420},\"/node_modules/rocksdb-native/lib/filter-policy.js\":{\"offset\":6149288,\"length\":437,\"mode\":420},\"/node_modules/rocksdb-native/lib/iterator.js\":{\"offset\":6149725,\"length\":4311,\"mode\":420},\"/node_modules/rocksdb-native/lib/snapshot.js\":{\"offset\":6154036,\"length\":503,\"mode\":420},\"/node_modules/rocksdb-native/lib/state.js\":{\"offset\":6154539,\"length\":10125,\"mode\":420},\"/node_modules/rocksdb-native/package.json\":{\"offset\":6164664,\"length\":1827,\"mode\":420},\"/node_modules/safe-buffer/index.js\":{\"offset\":6166491,\"length\":1670,\"mode\":420},\"/node_modules/safe-buffer/package.json\":{\"offset\":6168161,\"length\":1057,\"mode\":420},\"/node_modules/safety-catch/index.js\":{\"offset\":6169218,\"length\":506,\"mode\":420},\"/node_modules/safety-catch/package.json\":{\"offset\":6169724,\"length\":547,\"mode\":420},\"/node_modules/scope-lock/index.js\":{\"offset\":6170271,\"length\":1821,\"mode\":420},\"/node_modules/scope-lock/package.json\":{\"offset\":6172092,\"length\":611,\"mode\":420},\"/node_modules/secp256k1/bindings.js\":{\"offset\":6172703,\"length\":63,\"mode\":420},\"/node_modules/secp256k1/elliptic.js\":{\"offset\":6172766,\"length\":74,\"mode\":420},\"/node_modules/secp256k1/index.js\":{\"offset\":6172840,\"length\":246,\"mode\":420},\"/node_modules/secp256k1/lib/assert.js\":{\"offset\":6173086,\"length\":1318,\"mode\":420},\"/node_modules/secp256k1/lib/der.js\":{\"offset\":6174404,\"length\":7474,\"mode\":420},\"/node_modules/secp256k1/lib/elliptic/index.js\":{\"offset\":6181878,\"length\":8660,\"mode\":420},\"/node_modules/secp256k1/lib/index.js\":{\"offset\":6190538,\"length\":9522,\"mode\":420},\"/node_modules/secp256k1/lib/messages.json\":{\"offset\":6200060,\"length\":2384,\"mode\":420},\"/node_modules/secp256k1/package.json\":{\"offset\":6202444,\"length\":2276,\"mode\":420},\"/node_modules/signal-promise/index.js\":{\"offset\":6204720,\"length\":1252,\"mode\":420},\"/node_modules/signal-promise/package.json\":{\"offset\":6205972,\"length\":503,\"mode\":420},\"/node_modules/signed-varint/index.js\":{\"offset\":6206475,\"length\":435,\"mode\":420},\"/node_modules/signed-varint/package.json\":{\"offset\":6206910,\"length\":523,\"mode\":420},\"/node_modules/simdle-native/binding.js\":{\"offset\":6207433,\"length\":90,\"mode\":420},\"/node_modules/simdle-native/index.js\":{\"offset\":6207523,\"length\":3474,\"mode\":420},\"/node_modules/simdle-native/package.json\":{\"offset\":6210997,\"length\":1115,\"mode\":420},\"/node_modules/simdle-universal/fallback.js\":{\"offset\":6212112,\"length\":5137,\"mode\":420},\"/node_modules/simdle-universal/index.js\":{\"offset\":6217249,\"length\":103,\"mode\":420},\"/node_modules/simdle-universal/package.json\":{\"offset\":6217352,\"length\":879,\"mode\":420},\"/node_modules/simdle-universal/scalar.js\":{\"offset\":6218231,\"length\":469,\"mode\":420},\"/node_modules/sodium-hmac/hash/sha256.js\":{\"offset\":6218700,\"length\":284,\"mode\":420},\"/node_modules/sodium-hmac/hash/sha512.js\":{\"offset\":6218984,\"length\":284,\"mode\":420},\"/node_modules/sodium-hmac/index.js\":{\"offset\":6219268,\"length\":2063,\"mode\":420},\"/node_modules/sodium-hmac/package.json\":{\"offset\":6221331,\"length\":670,\"mode\":420},\"/node_modules/sodium-native/binding.js\":{\"offset\":6222001,\"length\":89,\"mode\":420},\"/node_modules/sodium-native/index.js\":{\"offset\":6222090,\"length\":66328,\"mode\":420},\"/node_modules/sodium-native/package.json\":{\"offset\":6288418,\"length\":1356,\"mode\":420},\"/node_modules/sodium-secretstream/index.js\":{\"offset\":6289774,\"length\":2257,\"mode\":420},\"/node_modules/sodium-secretstream/package.json\":{\"offset\":6292031,\"length\":657,\"mode\":420},\"/node_modules/sodium-universal/index.js\":{\"offset\":6292688,\"length\":42,\"mode\":420},\"/node_modules/sodium-universal/package.json\":{\"offset\":6292730,\"length\":1217,\"mode\":420},\"/node_modules/streamx/index.js\":{\"offset\":6293947,\"length\":33350,\"mode\":420},\"/node_modules/streamx/package.json\":{\"offset\":6327297,\"length\":836,\"mode\":420},\"/node_modules/sub-encoder/index.js\":{\"offset\":6328133,\"length\":1968,\"mode\":420},\"/node_modules/sub-encoder/package.json\":{\"offset\":6330101,\"length\":908,\"mode\":420},\"/node_modules/text-decoder/index.js\":{\"offset\":6331009,\"length\":1378,\"mode\":420},\"/node_modules/text-decoder/lib/pass-through-decoder.js\":{\"offset\":6332387,\"length\":273,\"mode\":420},\"/node_modules/text-decoder/lib/utf8-decoder.js\":{\"offset\":6332660,\"length\":2529,\"mode\":420},\"/node_modules/text-decoder/package.json\":{\"offset\":6335189,\"length\":987,\"mode\":420},\"/node_modules/timeout-refresh/browser.js\":{\"offset\":6336176,\"length\":1098,\"mode\":420},\"/node_modules/timeout-refresh/index.js\":{\"offset\":6337274,\"length\":184,\"mode\":420},\"/node_modules/timeout-refresh/node.js\":{\"offset\":6337458,\"length\":928,\"mode\":420},\"/node_modules/timeout-refresh/package.json\":{\"offset\":6338386,\"length\":619,\"mode\":420},\"/node_modules/tiny-buffer-map/index.js\":{\"offset\":6339005,\"length\":936,\"mode\":420},\"/node_modules/tiny-buffer-map/package.json\":{\"offset\":6339941,\"length\":650,\"mode\":420},\"/node_modules/typeforce/errors.js\":{\"offset\":6340591,\"length\":3053,\"mode\":420},\"/node_modules/typeforce/extra.js\":{\"offset\":6343644,\"length\":2211,\"mode\":420},\"/node_modules/typeforce/index.js\":{\"offset\":6345855,\"length\":6660,\"mode\":420},\"/node_modules/typeforce/native.js\":{\"offset\":6352515,\"length\":742,\"mode\":420},\"/node_modules/typeforce/package.json\":{\"offset\":6353257,\"length\":976,\"mode\":420},\"/node_modules/unslab/index.js\":{\"offset\":6354233,\"length\":913,\"mode\":420},\"/node_modules/unslab/package.json\":{\"offset\":6355146,\"length\":613,\"mode\":420},\"/node_modules/utf-8-validate/fallback.js\":{\"offset\":6355759,\"length\":1629,\"mode\":420},\"/node_modules/utf-8-validate/index.js\":{\"offset\":6357388,\"length\":136,\"mode\":420},\"/node_modules/utf-8-validate/package.json\":{\"offset\":6357524,\"length\":1199,\"mode\":420},\"/node_modules/varint/decode.js\":{\"offset\":6358723,\"length\":508,\"mode\":420},\"/node_modules/varint/encode.js\":{\"offset\":6359231,\"length\":452,\"mode\":420},\"/node_modules/varint/index.js\":{\"offset\":6359683,\"length\":134,\"mode\":420},\"/node_modules/varint/length.js\":{\"offset\":6359817,\"length\":471,\"mode\":420},\"/node_modules/varint/package.json\":{\"offset\":6360288,\"length\":511,\"mode\":420},\"/node_modules/varuint-bitcoin/index.js\":{\"offset\":6360799,\"length\":2074,\"mode\":420},\"/node_modules/varuint-bitcoin/package.json\":{\"offset\":6362873,\"length\":923,\"mode\":420},\"/node_modules/which-runtime/index.js\":{\"offset\":6363796,\"length\":1231,\"mode\":420},\"/node_modules/which-runtime/package.json\":{\"offset\":6365027,\"length\":602,\"mode\":420},\"/node_modules/wif/index.js\":{\"offset\":6365629,\"length\":1374,\"mode\":420},\"/node_modules/wif/node_modules/base-x/package.json\":{\"offset\":6367003,\"length\":1110,\"mode\":420},\"/node_modules/wif/node_modules/base-x/src/index.js\":{\"offset\":6368113,\"length\":4236,\"mode\":420},\"/node_modules/wif/node_modules/bs58/index.js\":{\"offset\":6372349,\"length\":140,\"mode\":420},\"/node_modules/wif/node_modules/bs58/package.json\":{\"offset\":6372489,\"length\":667,\"mode\":420},\"/node_modules/wif/node_modules/bs58check/base.js\":{\"offset\":6373156,\"length\":1199,\"mode\":420},\"/node_modules/wif/node_modules/bs58check/index.js\":{\"offset\":6374355,\"length\":300,\"mode\":420},\"/node_modules/wif/node_modules/bs58check/package.json\":{\"offset\":6374655,\"length\":1167,\"mode\":420},\"/node_modules/wif/package.json\":{\"offset\":6375822,\"length\":977,\"mode\":420},\"/node_modules/ws/lib/buffer-util.js\":{\"offset\":6376799,\"length\":3056,\"mode\":420},\"/node_modules/ws/lib/constants.js\":{\"offset\":6379855,\"length\":360,\"mode\":420},\"/node_modules/ws/lib/event-target.js\":{\"offset\":6380215,\"length\":7321,\"mode\":420},\"/node_modules/ws/lib/extension.js\":{\"offset\":6387536,\"length\":6183,\"mode\":420},\"/node_modules/ws/lib/limiter.js\":{\"offset\":6393719,\"length\":1034,\"mode\":420},\"/node_modules/ws/lib/permessage-deflate.js\":{\"offset\":6394753,\"length\":14110,\"mode\":420},\"/node_modules/ws/lib/receiver.js\":{\"offset\":6408863,\"length\":16376,\"mode\":420},\"/node_modules/ws/lib/sender.js\":{\"offset\":6425239,\"length\":13357,\"mode\":420},\"/node_modules/ws/lib/stream.js\":{\"offset\":6438596,\"length\":4083,\"mode\":420},\"/node_modules/ws/lib/subprotocol.js\":{\"offset\":6442679,\"length\":1498,\"mode\":420},\"/node_modules/ws/lib/validation.js\":{\"offset\":6444177,\"length\":3366,\"mode\":420},\"/node_modules/ws/lib/websocket-server.js\":{\"offset\":6447543,\"length\":16254,\"mode\":420},\"/node_modules/ws/lib/websocket.js\":{\"offset\":6463797,\"length\":35256,\"mode\":420},\"/node_modules/ws/package.json\":{\"offset\":6499053,\"length\":1722,\"mode\":420},\"/node_modules/ws/wrapper.mjs\":{\"offset\":6500775,\"length\":341,\"mode\":420},\"/node_modules/yocto-queue/index.js\":{\"offset\":6501116,\"length\":1587,\"mode\":420},\"/node_modules/yocto-queue/package.json\":{\"offset\":6502703,\"length\":849,\"mode\":420},\"/node_modules/z32/index.js\":{\"offset\":6503552,\"length\":2654,\"mode\":420},\"/node_modules/z32/package.json\":{\"offset\":6506206,\"length\":701,\"mode\":420},\"/package.json\":{\"offset\":6506907,\"length\":3541,\"mode\":420},\"/protocols/index.js\":{\"offset\":6510448,\"length\":787,\"mode\":420},\"/protocols/wdk.js\":{\"offset\":6511235,\"length\":7247,\"mode\":420},\"/shims/wdk-bare.js\":{\"offset\":6518482,\"length\":1116,\"mode\":420},\"/shims/wdk-wallet-btc.js\":{\"offset\":6519598,\"length\":410,\"mode\":420},\"/shims/wdk-wallet-evm.js\":{\"offset\":6520008,\"length\":410,\"mode\":420}}}\n#!/usr/bin/env pear\n\n// cli.js - Hyper Wallet CLI Entry Point\n//\n// Self-custodial P2P cryptocurrency wallet\n// Built on Holepunchto + Tether WDK\n\nimport WalletContext from './lib/wallet-context.js'\n\n// Hard-coded config for now (TODO: load from file)\nconst defaultConfig = {\n  storagePath: '~/.hyper-wallet/storage',\n  network: 'testnet',\n  protocols: ['wdk'],\n  wdk: {\n    chains: ['ethereum', 'bitcoin'],\n    networks: {\n      ethereum: {\n        name: 'sepolia',\n        provider: 'https://ethereum-sepolia-rpc.publicnode.com',\n        chainId: 11155111\n      },\n      bitcoin: {\n        network: 'testnet',\n        host: 'electrum.blockstream.info',\n        port: 60001\n      }\n    }\n  }\n}\n\n// Command handlers\nimport cmdInit from './cmd/init.js'\nimport cmdWhoami from './cmd/whoami.js'\nimport cmdBalance from './cmd/balance.js'\nimport { getEnabledProtocols } from './protocols/index.js'\n\nasync function main() {\n  const args = process.argv.slice(2)\n  const command = args[0]\n\n  // Load config (merge default + user config if exists)\n  const config = defaultConfig\n\n  // Create wallet context\n  const context = new WalletContext(config)\n\n  try {\n    switch (command) {\n      case 'init': {\n        const importMnemonic = args.includes('--import') ?\n          args[args.indexOf('--import') + 1] : null\n\n        const handler = cmdInit(context)[0]\n        await handler({ import: importMnemonic })\n        break\n      }\n\n      case 'whoami': {\n        // Load existing wallet\n        await context.init(await loadMnemonic())\n\n        const enabled = getEnabledProtocols(config)\n        await context.loadProtocols(enabled)\n\n        const handler = cmdWhoami(context)[0]\n        await handler({})\n        break\n      }\n\n      case 'balance': {\n        // Load existing wallet\n        await context.init(await loadMnemonic())\n\n        const enabled = getEnabledProtocols(config)\n        await context.loadProtocols(enabled)\n\n        const protocol = args[1]\n        const handler = cmdBalance(context, enabled)[0]\n        await handler({ protocol })\n        break\n      }\n\n      case 'help':\n      case '--help':\n      case '-h':\n      default:\n        showHelp()\n        break\n    }\n  } catch (err) {\n    console.error('❌ Error:', err.message)\n    if (process.env.DEBUG) {\n      console.error(err.stack)\n    }\n    process.exit(1)\n  } finally {\n    await context.close()\n  }\n}\n\n/**\n * Load mnemonic from storage\n * For now, we store it in the metadata (INSECURE - TODO: proper key management)\n */\nasync function loadMnemonic() {\n  // Mock mnemonic for testing\n  // TODO: Load from secure storage\n  return 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'\n}\n\n/**\n * Show help message\n */\nfunction showHelp() {\n  console.log(`\nhyper-wallet - Self-custodial P2P cryptocurrency wallet\n\nUSAGE:\n  hyper-wallet <command> [options]\n\nCOMMANDS:\n  init              Initialize new wallet\n  init --import     Import existing wallet from mnemonic\n  whoami            Show wallet identity and addresses\n  balance           Show balances across all protocols\n  balance <proto>   Show balance for specific protocol\n  help              Show this help message\n\nEXAMPLES:\n  hyper-wallet init\n  hyper-wallet whoami\n  hyper-wallet balance\n  hyper-wallet balance wdk\n\nSupported protocols: wdk (Tether WDK - Lightning, USDT, Bitcoin, ETH+)\n\nDocumentation: See ARCHITECTURE.md and MULTI_DEVICE.md\n`)\n}\n\n// Run CLI\nmain().catch(err => {\n  console.error('Fatal error:', err)\n  process.exit(1)\n})\n// cmd/balance.js - Show Wallet Balances\n\n/**\n * Balance command handler\n * @param {WalletContext} context - Wallet context\n * @param {Object} enabledProtocols - Enabled protocol instances\n * @returns {Array} - Command definition\n */\nexport default function (context, enabledProtocols) {\n  return [\n    async function handler(args) {\n      console.log('💰 Wallet Balances')\n      console.log('')\n\n      // Filter protocols if specific one requested\n      const protocols = args.protocol\n        ? { [args.protocol]: context.protocols[args.protocol] }\n        : context.protocols\n\n      if (args.protocol && !protocols[args.protocol]) {\n        console.error(`❌ Protocol \"${args.protocol}\" not enabled`)\n        process.exit(1)\n      }\n\n      // Get balances from each protocol\n      for (const [name, instance] of Object.entries(protocols)) {\n        const balances = await instance.getBalance()\n\n        console.log(`${name.toUpperCase()}:`)\n\n        if (Array.isArray(balances)) {\n          // Multi-asset protocol (like WDK)\n          for (const balance of balances) {\n            if (balance.error) {\n              console.log(`  ${balance.currency || balance.chain}: Error - ${balance.error}`)\n              continue\n            }\n\n            const currency = balance.currency || 'UNKNOWN'\n            const chain = balance.chain\n\n            // Format balance based on chain using protocol's formatter\n            if (instance.formatBalance) {\n              const formatted = instance.formatBalance(balance.wei || BigInt(balance.amount), chain)\n              console.log(`  ${currency} (${chain}): ${formatted}`)\n            } else {\n              const amount = balance.amount || '0'\n              console.log(`  ${currency} (${chain}): ${amount}`)\n            }\n          }\n        } else {\n          // Single asset protocol\n          console.log(`  ${balances.currency}: ${balances.amount}`)\n        }\n\n        console.log('')\n      }\n    }\n  ]\n}\n// cmd/init.js - Initialize Wallet Command\n\nimport bip39 from 'bip39'\nimport { getEnabledProtocols } from '../protocols/index.js'\n\n/**\n * Init command handler\n * @param {WalletContext} context - Wallet context\n * @returns {Array} - Command definition for paparam\n */\nexport default function (context) {\n  return [\n    async function handler(args) {\n      console.log('🔐 Initializing Hyper Wallet...')\n      console.log('')\n\n      // Generate or import mnemonic\n      let mnemonic\n\n      if (args.import) {\n        mnemonic = args.import\n        if (!bip39.validateMnemonic(mnemonic)) {\n          console.error('❌ Error: Invalid mnemonic')\n          process.exit(1)\n        }\n        console.log('✅ Imported existing mnemonic')\n      } else {\n        mnemonic = bip39.generateMnemonic()\n        console.log('🔑 Generated new mnemonic (WRITE THIS DOWN):')\n        console.log('')\n        console.log(`   ${mnemonic}`)\n        console.log('')\n        console.log('⚠️  Store this safely! You will need it to recover your wallet.')\n      }\n\n      console.log('')\n\n      // Initialize wallet context\n      await context.init(mnemonic)\n\n      // Load enabled protocols\n      const enabled = getEnabledProtocols(context.config)\n      await context.loadProtocols(enabled)\n\n      // Save metadata\n      await context.db.put('meta/initialized', {\n        timestamp: Date.now(),\n        protocols: Object.keys(enabled),\n        version: '0.1.0'\n      })\n\n      console.log('')\n      console.log('✅ Wallet initialized!')\n      console.log(`   Protocols: ${Object.keys(enabled).join(', ')}`)\n      console.log('')\n      console.log('Next steps:')\n      console.log('   hyper-wallet whoami     - Show wallet identity')\n      console.log('   hyper-wallet balance    - Check balances')\n\n      // Close corestore to release lock\n      await context.store.close()\n    }\n  ]\n}\n// cmd/whoami.js - Show Wallet Identity\n\n/**\n * Whoami command handler\n * @param {WalletContext} context - Wallet context\n * @returns {Array} - Command definition\n */\nexport default function (context) {\n  return [\n    async function handler(args) {\n      console.log('🔐 Wallet Identity')\n      console.log('')\n\n      // Check if initialized\n      const meta = await context.db.get('meta/initialized')\n      if (!meta) {\n        console.error('❌ Wallet not initialized')\n        console.log('   Run: hyper-wallet init')\n        process.exit(1)\n      }\n\n      // Show identity info\n      const identityKey = context.identity.identityPublicKey.toString('hex')\n      console.log(`Identity Key: ${identityKey}`)\n      console.log(`Initialized:  ${new Date(meta.value.timestamp).toLocaleString()}`)\n      console.log(`Protocols:    ${meta.value.protocols.join(', ')}`)\n      console.log('')\n\n      // Show wallet addresses for each protocol\n      console.log('💳 Wallet Addresses:')\n      console.log('')\n\n      for (const [protocol, instance] of Object.entries(context.protocols)) {\n        console.log(`${protocol.toUpperCase()}:`)\n\n        if (instance.accounts) {\n          for (const [chain, account] of Object.entries(instance.accounts)) {\n            try {\n              const address = await account.getAddress()\n              console.log(`  ${chain}: ${address}`)\n            } catch (err) {\n              console.log(`  ${chain}: Error - ${err.message}`)\n            }\n          }\n        }\n\n        console.log('')\n      }\n    }\n  ]\n}\n// lib/identity.js - Identity Management Wrapper\n//\n// Wraps keet-identity-key for consistent API\n\nimport KeetIdentityKey from 'keet-identity-key'\n\n/**\n * Identity wrapper\n * Provides consistent API for identity management and exposes mnemonic for WDK\n */\nclass IdentityKey {\n  /**\n   * Create identity from mnemonic\n   * @param {Object} options - { mnemonic }\n   * @returns {IdentityKey} - Identity instance with mnemonic exposed\n   */\n  static async from({ mnemonic }) {\n    const identity = await KeetIdentityKey.from({ mnemonic })\n\n    // Expose mnemonic for WDK (WDK needs the mnemonic to derive keys)\n    identity.mnemonic = mnemonic\n\n    return identity\n  }\n\n  /**\n   * Verify device attestation proof\n   * @param {Buffer} proof - Attestation proof\n   * @returns {Boolean} - True if valid\n   */\n  static verify(proof) {\n    return KeetIdentityKey.verify(proof)\n  }\n\n  /**\n   * Attest new device\n   * @param {Buffer} devicePublicKey - Device public key\n   * @param {Object} signingDevice - Device with signing authority\n   * @param {Buffer} previousProof - Previous attestation proof\n   * @returns {Buffer} - New attestation proof\n   */\n  static attest(devicePublicKey, signingDevice, previousProof) {\n    return KeetIdentityKey.attest(devicePublicKey, signingDevice, previousProof)\n  }\n}\n\nexport default IdentityKey\n// lib/wallet-context.js - Shared Wallet State\n//\n// Manages shared state across all protocols:\n// - Identity (keet-identity-key)\n// - Storage (Corestore)\n// - Database (Hyperbee)\n// - Transaction history (Autobase)\n\nimport IdentityKey from './identity.js'\nimport Corestore from 'corestore'\nimport Hyperbee from 'hyperbee'\nimport Autobase from 'autobase'\nimport path from '#path'\nimport os from '#os'\n\nclass WalletContext {\n  /**\n   * Create wallet context\n   * @param {Object} config - Configuration object\n   */\n  constructor(config) {\n    this.config = config\n    this.protocols = {} // Initialized protocol instances\n    this.identity = null\n    this.store = null\n    this.db = null\n    this.txHistory = null\n  }\n\n  /**\n   * Initialize wallet with mnemonic\n   * @param {String} mnemonic - BIP39 mnemonic phrase\n   * @returns {WalletContext} - This instance\n   */\n  async init(mnemonic) {\n    // 1. Initialize identity (keet-identity-key)\n    this.identity = await IdentityKey.from({ mnemonic })\n\n    // 2. Initialize storage (Corestore)\n    const storagePath = this.resolveStoragePath(this.config.storagePath)\n    // Note: Using identity seed as primaryKey for deterministic key derivation\n    this.store = new Corestore(storagePath, {\n      primaryKey: this.identity.seed,\n      unsafe: true // Acknowledge we're intentionally using a custom key\n    })\n    await this.store.ready()\n\n    // 3. Initialize database (Hyperbee)\n    const dbCore = this.store.get({ name: 'wallet-db' })\n    this.db = new Hyperbee(dbCore, {\n      keyEncoding: 'utf-8',\n      valueEncoding: 'json'\n    })\n    await this.db.ready()\n\n    // 4. Initialize transaction history (Autobase)\n    this.txHistory = new Autobase(this.store, null, {\n      apply: this.applyTransaction.bind(this),\n      open: (store) => store.get({ name: 'tx-log' })\n    })\n    await this.txHistory.ready()\n\n    console.log('✅ Wallet context initialized')\n    console.log(`   Storage: ${storagePath}`)\n    console.log(`   Identity: ${this.identity.identityPublicKey.toString('hex').slice(0, 16)}...`)\n\n    return this\n  }\n\n  /**\n   * Apply transaction to Autobase view\n   * This is called automatically by Autobase when syncing across devices\n   */\n  async applyTransaction(nodes, view, base) {\n    for (const node of nodes) {\n      try {\n        const tx = JSON.parse(node.value.toString())\n        await view.append(JSON.stringify(tx))\n      } catch (err) {\n        console.error('Failed to apply transaction:', err)\n      }\n    }\n  }\n\n  /**\n   * Load enabled protocols\n   * @param {Object} enabled - Enabled protocol objects\n   */\n  async loadProtocols(enabled) {\n    console.log('🔌 Loading protocols...')\n\n    for (const [name, protocol] of Object.entries(enabled)) {\n      try {\n        this.protocols[name] = await protocol.init(this)\n        console.log(`   ✅ ${name}`)\n      } catch (err) {\n        console.error(`   ❌ ${name}: ${err.message}`)\n      }\n    }\n\n    console.log('✅ Protocols loaded')\n  }\n\n  /**\n   * Get balances from all protocols\n   * @returns {Object} - { protocolName: balance }\n   */\n  async getBalances() {\n    const balances = {}\n\n    for (const [name, protocol] of Object.entries(this.protocols)) {\n      try {\n        balances[name] = await protocol.getBalance()\n      } catch (err) {\n        balances[name] = { error: err.message }\n      }\n    }\n\n    return balances\n  }\n\n  /**\n   * Check if device is authorized\n   * @param {Buffer} devicePublicKey - Device public key\n   * @returns {Boolean} - True if authorized\n   */\n  async isDeviceAuthorized(devicePublicKey) {\n    // Get device proof\n    const deviceId = devicePublicKey.toString('hex').slice(0, 8)\n    const device = await this.db.get(`devices/${deviceId}`)\n\n    if (!device) return false\n\n    // Verify proof is valid\n    const verified = IdentityKey.verify(device.value.proof)\n    if (!verified) return false\n\n    // Check revocation list\n    const revoked = await this.db.get('devices/revoked')\n    if (revoked && revoked.value) {\n      const isRevoked = revoked.value.some(r =>\n        r.publicKey.equals(devicePublicKey)\n      )\n      if (isRevoked) return false\n    }\n\n    return true\n  }\n\n  /**\n   * Resolve storage path (expand ~)\n   * @param {String} storagePath - Path from config\n   * @returns {String} - Absolute path\n   */\n  resolveStoragePath(storagePath) {\n    if (storagePath.startsWith('~')) {\n      return path.join(os.homedir(), storagePath.slice(1))\n    }\n    return storagePath\n  }\n\n  /**\n   * Close wallet (cleanup resources)\n   */\n  async close() {\n    if (this.txHistory) await this.txHistory.close()\n    if (this.db) await this.db.close()\n    if (this.store) await this.store.close()\n  }\n}\n\nexport default WalletContext\n// created 2023-09-25T01:01:55.148Z\n// compressed base64-encoded blob for include-ens data\n// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js\n// see: https://github.com/adraffy/ens-normalize.js#security\n// SHA-256: 0565ed049b9cf1614bb9e11ba7d8ac6a6fb96c893253d890f7e2b2884b9ded32\nvar COMPRESSED$1 = 'AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI';\nconst FENCED = new Map([[8217,\"apostrophe\"],[8260,\"fraction slash\"],[12539,\"middle dot\"]]);\nconst NSM_MAX = 4;\n\nfunction decode_arithmetic(bytes) {\r\n\tlet pos = 0;\r\n\tfunction u16() { return (bytes[pos++] << 8) | bytes[pos++]; }\r\n\t\r\n\t// decode the frequency table\r\n\tlet symbol_count = u16();\r\n\tlet total = 1;\r\n\tlet acc = [0, 1]; // first symbol has frequency 1\r\n\tfor (let i = 1; i < symbol_count; i++) {\r\n\t\tacc.push(total += u16());\r\n\t}\r\n\r\n\t// skip the sized-payload that the last 3 symbols index into\r\n\tlet skip = u16();\r\n\tlet pos_payload = pos;\r\n\tpos += skip;\r\n\r\n\tlet read_width = 0;\r\n\tlet read_buffer = 0; \r\n\tfunction read_bit() {\r\n\t\tif (read_width == 0) {\r\n\t\t\t// this will read beyond end of buffer\r\n\t\t\t// but (undefined|0) => zero pad\r\n\t\t\tread_buffer = (read_buffer << 8) | bytes[pos++];\r\n\t\t\tread_width = 8;\r\n\t\t}\r\n\t\treturn (read_buffer >> --read_width) & 1;\r\n\t}\r\n\r\n\tconst N = 31;\r\n\tconst FULL = 2**N;\r\n\tconst HALF = FULL >>> 1;\r\n\tconst QRTR = HALF >> 1;\r\n\tconst MASK = FULL - 1;\r\n\r\n\t// fill register\r\n\tlet register = 0;\r\n\tfor (let i = 0; i < N; i++) register = (register << 1) | read_bit();\r\n\r\n\tlet symbols = [];\r\n\tlet low = 0;\r\n\tlet range = FULL; // treat like a float\r\n\twhile (true) {\r\n\t\tlet value = Math.floor((((register - low + 1) * total) - 1) / range);\r\n\t\tlet start = 0;\r\n\t\tlet end = symbol_count;\r\n\t\twhile (end - start > 1) { // binary search\r\n\t\t\tlet mid = (start + end) >>> 1;\r\n\t\t\tif (value < acc[mid]) {\r\n\t\t\t\tend = mid;\r\n\t\t\t} else {\r\n\t\t\t\tstart = mid;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (start == 0) break; // first symbol is end mark\r\n\t\tsymbols.push(start);\r\n\t\tlet a = low + Math.floor(range * acc[start]   / total);\r\n\t\tlet b = low + Math.floor(range * acc[start+1] / total) - 1;\r\n\t\twhile (((a ^ b) & HALF) == 0) {\r\n\t\t\tregister = (register << 1) & MASK | read_bit();\r\n\t\t\ta = (a << 1) & MASK;\r\n\t\t\tb = (b << 1) & MASK | 1;\r\n\t\t}\r\n\t\twhile (a & ~b & QRTR) {\r\n\t\t\tregister = (register & HALF) | ((register << 1) & (MASK >>> 1)) | read_bit();\r\n\t\t\ta = (a << 1) ^ HALF;\r\n\t\t\tb = ((b ^ HALF) << 1) | HALF | 1;\r\n\t\t}\r\n\t\tlow = a;\r\n\t\trange = 1 + b - a;\r\n\t}\r\n\tlet offset = symbol_count - 4;\r\n\treturn symbols.map(x => { // index into payload\r\n\t\tswitch (x - offset) {\r\n\t\t\tcase 3: return offset + 0x10100 + ((bytes[pos_payload++] << 16) | (bytes[pos_payload++] << 8) | bytes[pos_payload++]);\r\n\t\t\tcase 2: return offset + 0x100 + ((bytes[pos_payload++] << 8) | bytes[pos_payload++]);\r\n\t\t\tcase 1: return offset + bytes[pos_payload++];\r\n\t\t\tdefault: return x - 1;\r\n\t\t}\r\n\t});\r\n}\t\r\n\r\n// returns an iterator which returns the next symbol\r\nfunction read_payload(v) {\r\n\tlet pos = 0;\r\n\treturn () => v[pos++];\r\n}\r\nfunction read_compressed_payload(s) {\r\n\treturn read_payload(decode_arithmetic(unsafe_atob(s)));\r\n}\r\n\r\n// unsafe in the sense:\r\n// expected well-formed Base64 w/o padding \r\n// 20220922: added for https://github.com/adraffy/ens-normalize.js/issues/4\r\nfunction unsafe_atob(s) {\r\n\tlet lookup = [];\r\n\t[...'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'].forEach((c, i) => lookup[c.charCodeAt(0)] = i);\r\n\tlet n = s.length;\r\n\tlet ret = new Uint8Array((6 * n) >> 3);\r\n\tfor (let i = 0, pos = 0, width = 0, carry = 0; i < n; i++) {\r\n\t\tcarry = (carry << 6) | lookup[s.charCodeAt(i)];\r\n\t\twidth += 6;\r\n\t\tif (width >= 8) {\r\n\t\t\tret[pos++] = (carry >> (width -= 8));\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n// eg. [0,1,2,3...] => [0,-1,1,-2,...]\r\nfunction signed(i) { \r\n\treturn (i & 1) ? (~i >> 1) : (i >> 1);\r\n}\r\n\r\nfunction read_deltas(n, next) {\r\n\tlet v = Array(n);\r\n\tfor (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next());\r\n\treturn v;\r\n}\r\n\r\n// [123][5] => [0 3] [1 1] [0 0]\r\nfunction read_sorted(next, prev = 0) {\r\n\tlet ret = [];\r\n\twhile (true) {\r\n\t\tlet x = next();\r\n\t\tlet n = next();\r\n\t\tif (!n) break;\r\n\t\tprev += x;\r\n\t\tfor (let i = 0; i < n; i++) {\r\n\t\t\tret.push(prev + i);\r\n\t\t}\r\n\t\tprev += n + 1;\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction read_sorted_arrays(next) {\r\n\treturn read_array_while(() => { \r\n\t\tlet v = read_sorted(next);\r\n\t\tif (v.length) return v;\r\n\t});\r\n}\r\n\r\n// returns map of x => ys\r\nfunction read_mapped(next) {\r\n\tlet ret = [];\r\n\twhile (true) {\r\n\t\tlet w = next();\r\n\t\tif (w == 0) break;\r\n\t\tret.push(read_linear_table(w, next));\r\n\t}\r\n\twhile (true) {\r\n\t\tlet w = next() - 1;\r\n\t\tif (w < 0) break;\r\n\t\tret.push(read_replacement_table(w, next));\r\n\t}\r\n\treturn ret.flat();\r\n}\r\n\r\n// read until next is falsy\r\n// return array of read values\r\nfunction read_array_while(next) {\r\n\tlet v = [];\r\n\twhile (true) {\r\n\t\tlet x = next(v.length);\r\n\t\tif (!x) break;\r\n\t\tv.push(x);\r\n\t}\r\n\treturn v;\r\n}\r\n\r\n// read w columns of length n\r\n// return as n rows of length w\r\nfunction read_transposed(n, w, next) {\r\n\tlet m = Array(n).fill().map(() => []);\r\n\tfor (let i = 0; i < w; i++) {\r\n\t\tread_deltas(n, next).forEach((x, j) => m[j].push(x));\r\n\t}\r\n\treturn m;\r\n}\r\n \r\n// returns [[x, ys], [x+dx, ys+dy], [x+2*dx, ys+2*dy], ...]\r\n// where dx/dy = steps, n = run size, w = length of y\r\nfunction read_linear_table(w, next) {\r\n\tlet dx = 1 + next();\r\n\tlet dy = next();\r\n\tlet vN = read_array_while(next);\r\n\tlet m = read_transposed(vN.length, 1+w, next);\r\n\treturn m.flatMap((v, i) => {\r\n\t\tlet [x, ...ys] = v;\r\n\t\treturn Array(vN[i]).fill().map((_, j) => {\r\n\t\t\tlet j_dy = j * dy;\r\n\t\t\treturn [x + j * dx, ys.map(y => y + j_dy)];\r\n\t\t});\r\n\t});\r\n}\r\n\r\n// return [[x, ys...], ...]\r\n// where w = length of y\r\nfunction read_replacement_table(w, next) { \r\n\tlet n = 1 + next();\r\n\tlet m = read_transposed(n, 1+w, next);\r\n\treturn m.map(v => [v[0], v.slice(1)]);\r\n}\r\n\r\n\r\nfunction read_trie(next) {\r\n\tlet ret = [];\r\n\tlet sorted = read_sorted(next); \r\n\texpand(decode([]), []);\r\n\treturn ret; // not sorted\r\n\tfunction decode(Q) { // characters that lead into this node\r\n\t\tlet S = next(); // state: valid, save, check\r\n\t\tlet B = read_array_while(() => { // buckets leading to new nodes\r\n\t\t\tlet cps = read_sorted(next).map(i => sorted[i]);\r\n\t\t\tif (cps.length) return decode(cps);\r\n\t\t});\r\n\t\treturn {S, B, Q};\r\n\t}\r\n\tfunction expand({S, B}, cps, saved) {\r\n\t\tif (S & 4 && saved === cps[cps.length-1]) return;\r\n\t\tif (S & 2) saved = cps[cps.length-1];\r\n\t\tif (S & 1) ret.push(cps); \r\n\t\tfor (let br of B) {\r\n\t\t\tfor (let cp of br.Q) {\r\n\t\t\t\texpand(br, [...cps, cp], saved);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\n\nfunction hex_cp(cp) {\r\n\treturn cp.toString(16).toUpperCase().padStart(2, '0');\r\n}\r\n\r\nfunction quote_cp(cp) {\r\n\treturn `{${hex_cp(cp)}}`; // raffy convention: like \"\\u{X}\" w/o the \"\\u\"\r\n}\r\n\r\n/*\r\nexport function explode_cp(s) {\r\n\treturn [...s].map(c => c.codePointAt(0));\r\n}\r\n*/\r\nfunction explode_cp(s) { // this is about 2x faster\r\n\tlet cps = [];\r\n\tfor (let pos = 0, len = s.length; pos < len; ) {\r\n\t\tlet cp = s.codePointAt(pos);\r\n\t\tpos += cp < 0x10000 ? 1 : 2;\r\n\t\tcps.push(cp);\r\n\t}\r\n\treturn cps;\r\n}\r\n\r\nfunction str_from_cps(cps) {\r\n\tconst chunk = 4096;\r\n\tlet len = cps.length;\r\n\tif (len < chunk) return String.fromCodePoint(...cps);\r\n\tlet buf = [];\r\n\tfor (let i = 0; i < len; ) {\r\n\t\tbuf.push(String.fromCodePoint(...cps.slice(i, i += chunk)));\r\n\t}\r\n\treturn buf.join('');\r\n}\r\n\r\nfunction compare_arrays(a, b) {\r\n\tlet n = a.length;\r\n\tlet c = n - b.length;\r\n\tfor (let i = 0; c == 0 && i < n; i++) c = a[i] - b[i];\r\n\treturn c;\r\n}\n\n// created 2023-09-25T01:01:55.148Z\n// compressed base64-encoded blob for include-nf data\n// source: https://github.com/adraffy/ens-normalize.js/blob/main/src/make.js\n// see: https://github.com/adraffy/ens-normalize.js#security\n// SHA-256: a974b6f8541fc29d919bc85118af0a44015851fab5343f8679cb31be2bdb209e\nvar COMPRESSED = 'AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g';\n\n// https://unicode.org/reports/tr15/\r\n// for reference implementation\r\n// see: /derive/nf.js\r\n\r\n\r\n// algorithmic hangul\r\n// https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf (page 144)\r\nconst S0 = 0xAC00;\r\nconst L0 = 0x1100;\r\nconst V0 = 0x1161;\r\nconst T0 = 0x11A7;\r\nconst L_COUNT = 19;\r\nconst V_COUNT = 21;\r\nconst T_COUNT = 28;\r\nconst N_COUNT = V_COUNT * T_COUNT;\r\nconst S_COUNT = L_COUNT * N_COUNT;\r\nconst S1 = S0 + S_COUNT;\r\nconst L1 = L0 + L_COUNT;\r\nconst V1 = V0 + V_COUNT;\r\nconst T1 = T0 + T_COUNT;\r\n\r\nfunction unpack_cc(packed) {\r\n\treturn (packed >> 24) & 0xFF;\r\n}\r\nfunction unpack_cp(packed) {\r\n\treturn packed & 0xFFFFFF;\r\n}\r\n\r\nlet SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP;\r\n\r\nfunction init$1() {\r\n\t//console.time('nf');\r\n\tlet r = read_compressed_payload(COMPRESSED);\r\n\tSHIFTED_RANK = new Map(read_sorted_arrays(r).flatMap((v, i) => v.map(x => [x, (i+1) << 24]))); // pre-shifted\r\n\tEXCLUSIONS = new Set(read_sorted(r));\r\n\tDECOMP = new Map();\r\n\tRECOMP = new Map();\r\n\tfor (let [cp, cps] of read_mapped(r)) {\r\n\t\tif (!EXCLUSIONS.has(cp) && cps.length == 2) {\r\n\t\t\tlet [a, b] = cps;\r\n\t\t\tlet bucket = RECOMP.get(a);\r\n\t\t\tif (!bucket) {\r\n\t\t\t\tbucket = new Map();\r\n\t\t\t\tRECOMP.set(a, bucket);\r\n\t\t\t}\r\n\t\t\tbucket.set(b, cp);\r\n\t\t}\r\n\t\tDECOMP.set(cp, cps.reverse()); // stored reversed\r\n\t}\r\n\t//console.timeEnd('nf');\r\n\t// 20230905: 11ms\r\n}\r\n\r\nfunction is_hangul(cp) {\r\n\treturn cp >= S0 && cp < S1;\r\n}\r\n\r\nfunction compose_pair(a, b) {\r\n\tif (a >= L0 && a < L1 && b >= V0 && b < V1) {\r\n\t\treturn S0 + (a - L0) * N_COUNT + (b - V0) * T_COUNT;\r\n\t} else if (is_hangul(a) && b > T0 && b < T1 && (a - S0) % T_COUNT == 0) {\r\n\t\treturn a + (b - T0);\r\n\t} else {\r\n\t\tlet recomp = RECOMP.get(a);\r\n\t\tif (recomp) {\r\n\t\t\trecomp = recomp.get(b);\r\n\t\t\tif (recomp) {\r\n\t\t\t\treturn recomp;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}\r\n}\r\n\r\nfunction decomposed(cps) {\r\n\tif (!SHIFTED_RANK) init$1();\r\n\tlet ret = [];\r\n\tlet buf = [];\r\n\tlet check_order = false;\r\n\tfunction add(cp) {\r\n\t\tlet cc = SHIFTED_RANK.get(cp);\r\n\t\tif (cc) {\r\n\t\t\tcheck_order = true;\r\n\t\t\tcp |= cc;\r\n\t\t}\r\n\t\tret.push(cp);\r\n\t}\r\n\tfor (let cp of cps) {\r\n\t\twhile (true) {\r\n\t\t\tif (cp < 0x80) {\r\n\t\t\t\tret.push(cp);\r\n\t\t\t} else if (is_hangul(cp)) {\r\n\t\t\t\tlet s_index = cp - S0;\r\n\t\t\t\tlet l_index = s_index / N_COUNT | 0;\r\n\t\t\t\tlet v_index = (s_index % N_COUNT) / T_COUNT | 0;\r\n\t\t\t\tlet t_index = s_index % T_COUNT;\r\n\t\t\t\tadd(L0 + l_index);\r\n\t\t\t\tadd(V0 + v_index);\r\n\t\t\t\tif (t_index > 0) add(T0 + t_index);\r\n\t\t\t} else {\r\n\t\t\t\tlet mapped = DECOMP.get(cp);\r\n\t\t\t\tif (mapped) {\r\n\t\t\t\t\tbuf.push(...mapped);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tadd(cp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!buf.length) break;\r\n\t\t\tcp = buf.pop();\r\n\t\t}\r\n\t}\r\n\tif (check_order && ret.length > 1) {\r\n\t\tlet prev_cc = unpack_cc(ret[0]);\r\n\t\tfor (let i = 1; i < ret.length; i++) {\r\n\t\t\tlet cc = unpack_cc(ret[i]);\r\n\t\t\tif (cc == 0 || prev_cc <= cc) {\r\n\t\t\t\tprev_cc = cc;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tlet j = i-1;\r\n\t\t\twhile (true) {\r\n\t\t\t\tlet tmp = ret[j+1];\r\n\t\t\t\tret[j+1] = ret[j];\r\n\t\t\t\tret[j] = tmp;\r\n\t\t\t\tif (!j) break;\r\n\t\t\t\tprev_cc = unpack_cc(ret[--j]);\r\n\t\t\t\tif (prev_cc <= cc) break;\r\n\t\t\t}\r\n\t\t\tprev_cc = unpack_cc(ret[i]);\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction composed_from_decomposed(v) {\r\n\tlet ret = [];\r\n\tlet stack = [];\r\n\tlet prev_cp = -1;\r\n\tlet prev_cc = 0;\r\n\tfor (let packed of v) {\r\n\t\tlet cc = unpack_cc(packed);\r\n\t\tlet cp = unpack_cp(packed);\r\n\t\tif (prev_cp == -1) {\r\n\t\t\tif (cc == 0) {\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tret.push(cp);\r\n\t\t\t}\r\n\t\t} else if (prev_cc > 0 && prev_cc >= cc) {\r\n\t\t\tif (cc == 0) {\r\n\t\t\t\tret.push(prev_cp, ...stack);\r\n\t\t\t\tstack.length = 0;\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tstack.push(cp);\r\n\t\t\t}\r\n\t\t\tprev_cc = cc;\r\n\t\t} else {\r\n\t\t\tlet composed = compose_pair(prev_cp, cp);\r\n\t\t\tif (composed >= 0) {\r\n\t\t\t\tprev_cp = composed;\r\n\t\t\t} else if (prev_cc == 0 && cc == 0) {\r\n\t\t\t\tret.push(prev_cp);\r\n\t\t\t\tprev_cp = cp;\r\n\t\t\t} else {\r\n\t\t\t\tstack.push(cp);\r\n\t\t\t\tprev_cc = cc;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (prev_cp >= 0) {\r\n\t\tret.push(prev_cp, ...stack);\t\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\n// note: cps can be iterable\r\nfunction nfd(cps) {\r\n\treturn decomposed(cps).map(unpack_cp);\r\n}\r\nfunction nfc(cps) {\r\n\treturn composed_from_decomposed(decomposed(cps));\r\n}\n\nconst HYPHEN = 0x2D;\r\nconst STOP = 0x2E;\r\nconst STOP_CH = '.';\r\nconst FE0F = 0xFE0F;\r\nconst UNIQUE_PH = 1;\r\n\r\n// 20230913: replace [...v] with Array_from(v) to avoid large spreads\r\nconst Array_from = x => Array.from(x); // Array.from.bind(Array);\r\n\r\nfunction group_has_cp(g, cp) {\r\n\t// 20230913: keep primary and secondary distinct instead of creating valid union\r\n\treturn g.P.has(cp) || g.Q.has(cp);\r\n}\r\n\r\nclass Emoji extends Array {\r\n\tget is_emoji() { return true; } // free tagging system\r\n}\r\n\r\nlet MAPPED, IGNORED, CM, NSM, ESCAPE, NFC_CHECK, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT;\r\n\r\nfunction init() {\r\n\tif (MAPPED) return;\r\n\t\r\n\tlet r = read_compressed_payload(COMPRESSED$1);\r\n\tconst read_sorted_array = () => read_sorted(r);\r\n\tconst read_sorted_set = () => new Set(read_sorted_array());\r\n\tconst set_add_many = (set, v) => v.forEach(x => set.add(x));\r\n\r\n\tMAPPED = new Map(read_mapped(r)); \r\n\tIGNORED = read_sorted_set(); // ignored characters are not valid, so just read raw codepoints\r\n\r\n\t/*\r\n\t// direct include from payload is smaller than the decompression code\r\n\tconst FENCED = new Map(read_array_while(() => {\r\n\t\tlet cp = r();\r\n\t\tif (cp) return [cp, read_str(r())];\r\n\t}));\r\n\t*/\r\n\t// 20230217: we still need all CM for proper error formatting\r\n\t// but norm only needs NSM subset that are potentially-valid\r\n\tCM = read_sorted_array();\r\n\tNSM = new Set(read_sorted_array().map(i => CM[i]));\r\n\tCM = new Set(CM);\r\n\t\r\n\tESCAPE = read_sorted_set(); // characters that should not be printed\r\n\tNFC_CHECK = read_sorted_set(); // only needed to illustrate ens_tokenize() transformations\r\n\r\n\tlet chunks = read_sorted_arrays(r);\r\n\tlet unrestricted = r();\r\n\t//const read_chunked = () => new Set(read_sorted_array().flatMap(i => chunks[i]).concat(read_sorted_array()));\r\n\tconst read_chunked = () => {\r\n\t\t// 20230921: build set in parts, 2x faster\r\n\t\tlet set = new Set();\r\n\t\tread_sorted_array().forEach(i => set_add_many(set, chunks[i]));\r\n\t\tset_add_many(set, read_sorted_array());\r\n\t\treturn set; \r\n\t};\r\n\tGROUPS = read_array_while(i => {\r\n\t\t// minifier property mangling seems unsafe\r\n\t\t// so these are manually renamed to single chars\r\n\t\tlet N = read_array_while(r).map(x => x+0x60);\r\n\t\tif (N.length) {\r\n\t\t\tlet R = i >= unrestricted; // unrestricted then restricted\r\n\t\t\tN[0] -= 32; // capitalize\r\n\t\t\tN = str_from_cps(N);\r\n\t\t\tif (R) N=`Restricted[${N}]`;\r\n\t\t\tlet P = read_chunked(); // primary\r\n\t\t\tlet Q = read_chunked(); // secondary\r\n\t\t\tlet M = !r(); // not-whitelisted, check for NSM\r\n\t\t\t// *** this code currently isn't needed ***\r\n\t\t\t/*\r\n\t\t\tlet V = [...P, ...Q].sort((a, b) => a-b); // derive: sorted valid\r\n\t\t\tlet M = r()-1; // number of combining mark\r\n\t\t\tif (M < 0) { // whitelisted\r\n\t\t\t\tM = new Map(read_array_while(() => {\r\n\t\t\t\t\tlet i = r();\r\n\t\t\t\t\tif (i) return [V[i-1], read_array_while(() => {\r\n\t\t\t\t\t\tlet v = read_array_while(r);\r\n\t\t\t\t\t\tif (v.length) return v.map(x => x-1);\r\n\t\t\t\t\t})];\r\n\t\t\t\t}));\r\n\t\t\t}*/\r\n\t\t\treturn {N, P, Q, M, R};\r\n\t\t}\r\n\t});\r\n\r\n\t// decode compressed wholes\r\n\tWHOLE_VALID = read_sorted_set();\r\n\tWHOLE_MAP = new Map();\r\n\tlet wholes = read_sorted_array().concat(Array_from(WHOLE_VALID)).sort((a, b) => a-b); // must be sorted\r\n\twholes.forEach((cp, i) => {\r\n\t\tlet d = r(); \r\n\t\tlet w = wholes[i] = d ? wholes[i-d] : {V: [], M: new Map()};\r\n\t\tw.V.push(cp); // add to member set\r\n\t\tif (!WHOLE_VALID.has(cp)) {\r\n\t\t\tWHOLE_MAP.set(cp, w);  // register with whole map\r\n\t\t}\r\n\t});\r\n\r\n\t// compute confusable-extent complements\r\n\t// usage: WHOLE_MAP.get(cp).M.get(cp) = complement set\r\n\tfor (let {V, M} of new Set(WHOLE_MAP.values())) {\r\n\t\t// connect all groups that have each whole character\r\n\t\tlet recs = [];\r\n\t\tfor (let cp of V) {\r\n\t\t\tlet gs = GROUPS.filter(g => group_has_cp(g, cp));\r\n\t\t\tlet rec = recs.find(({G}) => gs.some(g => G.has(g)));\r\n\t\t\tif (!rec) {\r\n\t\t\t\trec = {G: new Set(), V: []};\r\n\t\t\t\trecs.push(rec);\r\n\t\t\t}\r\n\t\t\trec.V.push(cp);\r\n\t\t\tset_add_many(rec.G, gs);\r\n\t\t}\r\n\t\t// per character cache groups which are not a member of the extent\r\n\t\tlet union = recs.flatMap(x => Array_from(x.G)); // all of the groups used by this whole\r\n\t\tfor (let {G, V} of recs) {\r\n\t\t\tlet complement = new Set(union.filter(g => !G.has(g))); // groups not covered by the extent\r\n\t\t\tfor (let cp of V) {\r\n\t\t\t\tM.set(cp, complement); // this is the same reference\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// compute valid set\r\n\t// 20230924: VALID was union but can be re-used\r\n\tVALID = new Set(); // exists in 1+ groups\r\n\tlet multi = new Set(); // exists in 2+ groups\r\n\tconst add_to_union = cp => VALID.has(cp) ? multi.add(cp) : VALID.add(cp);\r\n\tfor (let g of GROUPS) {\r\n\t\tfor (let cp of g.P) add_to_union(cp);\r\n\t\tfor (let cp of g.Q) add_to_union(cp);\r\n\t}\r\n\t// dual purpose WHOLE_MAP: return placeholder if unique non-confusable\r\n\tfor (let cp of VALID) {\r\n\t\tif (!WHOLE_MAP.has(cp) && !multi.has(cp)) {\r\n\t\t\tWHOLE_MAP.set(cp, UNIQUE_PH);\r\n\t\t}\r\n\t}\r\n\t// add all decomposed parts\r\n\t// see derive: \"Valid is Closed (via Brute-force)\"\r\n\tset_add_many(VALID, nfd(VALID));\r\n\t\r\n\t// decode emoji\r\n\t// 20230719: emoji are now fully-expanded to avoid quirk logic \r\n\tEMOJI_LIST = read_trie(r).map(v => Emoji.from(v)).sort(compare_arrays);\r\n\tEMOJI_ROOT = new Map(); // this has approx 7K nodes (2+ per emoji)\r\n\tfor (let cps of EMOJI_LIST) {\r\n\t\t// 20230719: change to *slightly* stricter algorithm which disallows \r\n\t\t// insertion of misplaced FE0F in emoji sequences (matching ENSIP-15)\r\n\t\t// example: beautified [A B] (eg. flag emoji) \r\n\t\t//  before: allow: [A FE0F B], error: [A FE0F FE0F B] \r\n\t\t//   after: error: both\r\n\t\t// note: this code now matches ENSNormalize.{cs,java} logic\r\n\t\tlet prev = [EMOJI_ROOT];\r\n\t\tfor (let cp of cps) {\r\n\t\t\tlet next = prev.map(node => {\r\n\t\t\t\tlet child = node.get(cp);\r\n\t\t\t\tif (!child) {\r\n\t\t\t\t\t// should this be object? \r\n\t\t\t\t\t// (most have 1-2 items, few have many)\r\n\t\t\t\t\t// 20230719: no, v8 default map is 4?\r\n\t\t\t\t\tchild = new Map();\r\n\t\t\t\t\tnode.set(cp, child);\r\n\t\t\t\t}\r\n\t\t\t\treturn child;\r\n\t\t\t});\r\n\t\t\tif (cp === FE0F) {\r\n\t\t\t\tprev.push(...next); // less than 20 elements\r\n\t\t\t} else {\r\n\t\t\t\tprev = next;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (let x of prev) {\r\n\t\t\tx.V = cps;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// if escaped: {HEX}\r\n//       else: \"x\" {HEX}\r\nfunction quoted_cp(cp) {\r\n\treturn (should_escape(cp) ? '' : `${bidi_qq(safe_str_from_cps([cp]))} `) + quote_cp(cp);\r\n}\r\n\r\n// 20230211: some messages can be mixed-directional and result in spillover\r\n// use 200E after a quoted string to force the remainder of a string from \r\n// acquring the direction of the quote\r\n// https://www.w3.org/International/questions/qa-bidi-unicode-controls#exceptions\r\nfunction bidi_qq(s) {\r\n\treturn `\"${s}\"\\u200E`; // strong LTR\r\n}\r\n\r\nfunction check_label_extension(cps) {\r\n\tif (cps.length >= 4 && cps[2] == HYPHEN && cps[3] == HYPHEN) {\r\n\t\tthrow new Error(`invalid label extension: \"${str_from_cps(cps.slice(0, 4))}\"`); // this can only be ascii so cant be bidi\r\n\t}\r\n}\r\nfunction check_leading_underscore(cps) {\r\n\tconst UNDERSCORE = 0x5F;\r\n\tfor (let i = cps.lastIndexOf(UNDERSCORE); i > 0; ) {\r\n\t\tif (cps[--i] !== UNDERSCORE) {\r\n\t\t\tthrow new Error('underscore allowed only at start');\r\n\t\t}\r\n\t}\r\n}\r\n// check that a fenced cp is not leading, trailing, or touching another fenced cp\r\nfunction check_fenced(cps) {\r\n\tlet cp = cps[0];\r\n\tlet prev = FENCED.get(cp);\r\n\tif (prev) throw error_placement(`leading ${prev}`);\r\n\tlet n = cps.length;\r\n\tlet last = -1; // prevents trailing from throwing\r\n\tfor (let i = 1; i < n; i++) {\r\n\t\tcp = cps[i];\r\n\t\tlet match = FENCED.get(cp);\r\n\t\tif (match) {\r\n\t\t\t// since cps[0] isn't fenced, cps[1] cannot throw\r\n\t\t\tif (last == i) throw error_placement(`${prev} + ${match}`);\r\n\t\t\tlast = i + 1;\r\n\t\t\tprev = match;\r\n\t\t}\r\n\t}\r\n\tif (last == n) throw error_placement(`trailing ${prev}`);\r\n}\r\n\r\n// create a safe to print string \r\n// invisibles are escaped\r\n// leading cm uses placeholder\r\n// if cps exceed max, middle truncate with ellipsis\r\n// quoter(cp) => string, eg. 3000 => \"{3000}\"\r\n// note: in html, you'd call this function then replace [<>&] with entities\r\nfunction safe_str_from_cps(cps, max = Infinity, quoter = quote_cp) {\r\n\t//if (Number.isInteger(cps)) cps = [cps];\r\n\t//if (!Array.isArray(cps)) throw new TypeError(`expected codepoints`);\r\n\tlet buf = [];\r\n\tif (is_combining_mark(cps[0])) buf.push('◌');\r\n\tif (cps.length > max) {\r\n\t\tmax >>= 1;\r\n\t\tcps = [...cps.slice(0, max), 0x2026, ...cps.slice(-max)];\r\n\t}\r\n\tlet prev = 0;\r\n\tlet n = cps.length;\r\n\tfor (let i = 0; i < n; i++) {\r\n\t\tlet cp = cps[i];\r\n\t\tif (should_escape(cp)) {\r\n\t\t\tbuf.push(str_from_cps(cps.slice(prev, i)));\r\n\t\t\tbuf.push(quoter(cp));\r\n\t\t\tprev = i + 1;\r\n\t\t}\r\n\t}\r\n\tbuf.push(str_from_cps(cps.slice(prev, n)));\r\n\treturn buf.join('');\r\n}\r\n\r\n// note: set(s) cannot be exposed because they can be modified\r\n// note: Object.freeze() doesn't work\r\nfunction is_combining_mark(cp) {\r\n\tinit();\r\n\treturn CM.has(cp);\r\n}\r\nfunction should_escape(cp) {\r\n\tinit();\r\n\treturn ESCAPE.has(cp);\r\n}\r\n\r\n// return all supported emoji as fully-qualified emoji \r\n// ordered by length then lexicographic \r\nfunction ens_emoji() {\r\n\tinit();\r\n\treturn EMOJI_LIST.map(x => x.slice()); // emoji are exposed so copy\r\n}\r\n\r\nfunction ens_normalize_fragment(frag, decompose) {\r\n\tinit();\r\n\tlet nf = decompose ? nfd : nfc;\r\n\treturn frag.split(STOP_CH).map(label => str_from_cps(tokens_from_str(explode_cp(label), nf, filter_fe0f).flat())).join(STOP_CH);\r\n}\r\n\r\nfunction ens_normalize(name) {\r\n\treturn flatten(split(name, nfc, filter_fe0f));\r\n}\r\n\r\nfunction ens_beautify(name) {\r\n\tlet labels = split(name, nfc, x => x); // emoji not exposed\r\n\tfor (let {type, output, error} of labels) {\r\n\t\tif (error) break; // flatten will throw\r\n\r\n\t\t// replace leading/trailing hyphen\r\n\t\t// 20230121: consider beautifing all or leading/trailing hyphen to unicode variant\r\n\t\t// not exactly the same in every font, but very similar: \"-\" vs \"‐\"\r\n\t\t/*\r\n\t\tconst UNICODE_HYPHEN = 0x2010;\r\n\t\t// maybe this should replace all for visual consistancy?\r\n\t\t// `node tools/reg-count.js regex ^-\\{2,\\}` => 592\r\n\t\t//for (let i = 0; i < output.length; i++) if (output[i] == 0x2D) output[i] = 0x2010;\r\n\t\tif (output[0] == HYPHEN) output[0] = UNICODE_HYPHEN;\r\n\t\tlet end = output.length-1;\r\n\t\tif (output[end] == HYPHEN) output[end] = UNICODE_HYPHEN;\r\n\t\t*/\r\n\t\t// 20230123: WHATWG URL uses \"CheckHyphens\" false\r\n\t\t// https://url.spec.whatwg.org/#idna\r\n\r\n\t\t// update ethereum symbol\r\n\t\t// ξ => Ξ if not greek\r\n\t\tif (type !== 'Greek') array_replace(output, 0x3BE, 0x39E);\r\n\r\n\t\t// 20221213: fixes bidi subdomain issue, but breaks invariant (200E is disallowed)\r\n\t\t// could be fixed with special case for: 2D (.) + 200E (LTR)\r\n\t\t// https://discuss.ens.domains/t/bidi-label-ordering-spoof/15824\r\n\t\t//output.splice(0, 0, 0x200E);\r\n\t}\r\n\treturn flatten(labels);\r\n}\r\n\r\nfunction array_replace(v, a, b) {\r\n\tlet prev = 0;\r\n\twhile (true) {\r\n\t\tlet next = v.indexOf(a, prev);\r\n\t\tif (next < 0) break;\r\n\t\tv[next] = b; \r\n\t\tprev = next + 1;\r\n\t}\r\n}\r\n\r\nfunction ens_split(name, preserve_emoji) {\r\n\treturn split(name, nfc, preserve_emoji ? x => x.slice() : filter_fe0f); // emoji are exposed so copy\r\n}\r\n\r\nfunction split(name, nf, ef) {\r\n\tif (!name) return []; // 20230719: empty name allowance\r\n\tinit();\r\n\tlet offset = 0;\r\n\t// https://unicode.org/reports/tr46/#Validity_Criteria\r\n\t// 4.) \"The label must not contain a U+002E ( . ) FULL STOP.\"\r\n\treturn name.split(STOP_CH).map(label => {\r\n\t\tlet input = explode_cp(label);\r\n\t\tlet info = {\r\n\t\t\tinput,\r\n\t\t\toffset, // codepoint, not substring!\r\n\t\t};\r\n\t\toffset += input.length + 1; // + stop\r\n\t\ttry {\r\n\t\t\t// 1.) \"The label must be in Unicode Normalization Form NFC\"\r\n\t\t\tlet tokens = info.tokens = tokens_from_str(input, nf, ef);\r\n\t\t\tlet token_count = tokens.length;\r\n\t\t\tlet type;\r\n\t\t\tif (!token_count) { // the label was effectively empty (could of had ignored characters)\r\n\t\t\t\t//norm = [];\r\n\t\t\t\t//type = 'None'; // use this instead of next match, \"ASCII\"\r\n\t\t\t\t// 20230120: change to strict\r\n\t\t\t\t// https://discuss.ens.domains/t/ens-name-normalization-2nd/14564/59\r\n\t\t\t\tthrow new Error(`empty label`);\r\n\t\t\t} \r\n\t\t\tlet norm = info.output = tokens.flat();\r\n\t\t\tcheck_leading_underscore(norm);\r\n\t\t\tlet emoji = info.emoji = token_count > 1 || tokens[0].is_emoji; // same as: tokens.some(x => x.is_emoji);\r\n\t\t\tif (!emoji && norm.every(cp => cp < 0x80)) { // special case for ascii\r\n\t\t\t\t// 20230123: matches matches WHATWG, see note 3.3\r\n\t\t\t\tcheck_label_extension(norm); // only needed for ascii\r\n\t\t\t\t// cant have fenced\r\n\t\t\t\t// cant have cm\r\n\t\t\t\t// cant have wholes\r\n\t\t\t\t// see derive: \"Fastpath ASCII\"\r\n\t\t\t\ttype = 'ASCII';\r\n\t\t\t} else {\r\n\t\t\t\tlet chars = tokens.flatMap(x => x.is_emoji ? [] : x); // all of the nfc tokens concat together\r\n\t\t\t\tif (!chars.length) { // theres no text, just emoji\r\n\t\t\t\t\ttype = 'Emoji';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// 5.) \"The label must not begin with a combining mark, that is: General_Category=Mark.\"\r\n\t\t\t\t\tif (CM.has(norm[0])) throw error_placement('leading combining mark');\r\n\t\t\t\t\tfor (let i = 1; i < token_count; i++) { // we've already checked the first token\r\n\t\t\t\t\t\tlet cps = tokens[i];\r\n\t\t\t\t\t\tif (!cps.is_emoji && CM.has(cps[0])) { // every text token has emoji neighbors, eg. EtEEEtEt...\r\n\t\t\t\t\t\t\t// bidi_qq() not needed since emoji is LTR and cps is a CM\r\n\t\t\t\t\t\t\tthrow error_placement(`emoji + combining mark: \"${str_from_cps(tokens[i-1])} + ${safe_str_from_cps([cps[0]])}\"`); \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheck_fenced(norm);\r\n\t\t\t\t\tlet unique = Array_from(new Set(chars));\r\n\t\t\t\t\tlet [g] = determine_group(unique); // take the first match\r\n\t\t\t\t\t// see derive: \"Matching Groups have Same CM Style\"\r\n\t\t\t\t\t// alternative: could form a hybrid type: Latin/Japanese/...\t\r\n\t\t\t\t\tcheck_group(g, chars); // need text in order\r\n\t\t\t\t\tcheck_whole(g, unique); // only need unique text (order would be required for multiple-char confusables)\r\n\t\t\t\t\ttype = g.N;\r\n\t\t\t\t\t// 20230121: consider exposing restricted flag\r\n\t\t\t\t\t// it's simpler to just check for 'Restricted'\r\n\t\t\t\t\t// or even better: type.endsWith(']')\r\n\t\t\t\t\t//if (g.R) info.restricted = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tinfo.type = type;\r\n\t\t} catch (err) {\r\n\t\t\tinfo.error = err; // use full error object\r\n\t\t}\r\n\t\treturn info;\r\n\t});\r\n}\r\n\r\nfunction check_whole(group, unique) {\r\n\tlet maker;\r\n\tlet shared = [];\r\n\tfor (let cp of unique) {\r\n\t\tlet whole = WHOLE_MAP.get(cp);\r\n\t\tif (whole === UNIQUE_PH) return; // unique, non-confusable\r\n\t\tif (whole) {\r\n\t\t\tlet set = whole.M.get(cp); // groups which have a character that look-like this character\r\n\t\t\tmaker = maker ? maker.filter(g => set.has(g)) : Array_from(set);\r\n\t\t\tif (!maker.length) return; // confusable intersection is empty\r\n\t\t} else {\r\n\t\t\tshared.push(cp); \r\n\t\t}\r\n\t}\r\n\tif (maker) {\r\n\t\t// we have 1+ confusable\r\n\t\t// check if any of the remaining groups\r\n\t\t// contain the shared characters too\r\n\t\tfor (let g of maker) {\r\n\t\t\tif (shared.every(cp => group_has_cp(g, cp))) {\r\n\t\t\t\tthrow new Error(`whole-script confusable: ${group.N}/${g.N}`);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// assumption: unique.size > 0\r\n// returns list of matching groups\r\nfunction determine_group(unique) {\r\n\tlet groups = GROUPS;\r\n\tfor (let cp of unique) {\r\n\t\t// note: we need to dodge CM that are whitelisted\r\n\t\t// but that code isn't currently necessary\r\n\t\tlet gs = groups.filter(g => group_has_cp(g, cp));\r\n\t\tif (!gs.length) {\r\n\t\t\tif (!GROUPS.some(g => group_has_cp(g, cp))) { \r\n\t\t\t\t// the character was composed of valid parts\r\n\t\t\t\t// but it's NFC form is invalid\r\n\t\t\t\t// 20230716: change to more exact statement, see: ENSNormalize.{cs,java}\r\n\t\t\t\t// note: this doesn't have to be a composition\r\n\t\t\t\t// 20230720: change to full check\r\n\t\t\t\tthrow error_disallowed(cp); // this should be rare\r\n\t\t\t} else {\r\n\t\t\t\t// there is no group that contains all these characters\r\n\t\t\t\t// throw using the highest priority group that matched\r\n\t\t\t\t// https://www.unicode.org/reports/tr39/#mixed_script_confusables\r\n\t\t\t\tthrow error_group_member(groups[0], cp);\r\n\t\t\t}\r\n\t\t}\r\n\t\tgroups = gs;\r\n\t\tif (gs.length == 1) break; // there is only one group left\r\n\t}\r\n\t// there are at least 1 group(s) with all of these characters\r\n\treturn groups;\r\n}\r\n\r\n// throw on first error\r\nfunction flatten(split) {\r\n\treturn split.map(({input, error, output}) => {\r\n\t\tif (error) {\r\n\t\t\t// don't print label again if just a single label\r\n\t\t\tlet msg = error.message;\r\n\t\t\t// bidi_qq() only necessary if msg is digits\r\n\t\t\tthrow new Error(split.length == 1 ? msg : `Invalid label ${bidi_qq(safe_str_from_cps(input, 63))}: ${msg}`); \r\n\t\t}\r\n\t\treturn str_from_cps(output);\r\n\t}).join(STOP_CH);\r\n}\r\n\r\nfunction error_disallowed(cp) {\r\n\t// TODO: add cp to error?\r\n\treturn new Error(`disallowed character: ${quoted_cp(cp)}`); \r\n}\r\nfunction error_group_member(g, cp) {\r\n\tlet quoted = quoted_cp(cp);\r\n\tlet gg = GROUPS.find(g => g.P.has(cp)); // only check primary\r\n\tif (gg) {\r\n\t\tquoted = `${gg.N} ${quoted}`;\r\n\t}\r\n\treturn new Error(`illegal mixture: ${g.N} + ${quoted}`);\r\n}\r\nfunction error_placement(where) {\r\n\treturn new Error(`illegal placement: ${where}`);\r\n}\r\n\r\n// assumption: cps.length > 0\r\n// assumption: cps[0] isn't a CM\r\n// assumption: the previous character isn't an emoji\r\nfunction check_group(g, cps) {\r\n\tfor (let cp of cps) {\r\n\t\tif (!group_has_cp(g, cp)) {\r\n\t\t\t// for whitelisted scripts, this will throw illegal mixture on invalid cm, eg. \"e{300}{300}\"\r\n\t\t\t// at the moment, it's unnecessary to introduce an extra error type\r\n\t\t\t// until there exists a whitelisted multi-character\r\n\t\t\t//   eg. if (M < 0 && is_combining_mark(cp)) { ... }\r\n\t\t\t// there are 3 cases:\r\n\t\t\t//   1. illegal cm for wrong group => mixture error\r\n\t\t\t//   2. illegal cm for same group => cm error\r\n\t\t\t//       requires set of whitelist cm per group: \r\n\t\t\t//        eg. new Set([...g.P, ...g.Q].flatMap(nfc).filter(cp => CM.has(cp)))\r\n\t\t\t//   3. wrong group => mixture error\r\n\t\t\tthrow error_group_member(g, cp);\r\n\t\t}\r\n\t}\r\n\t//if (M >= 0) { // we have a known fixed cm count\r\n\tif (g.M) { // we need to check for NSM\r\n\t\tlet decomposed = nfd(cps);\r\n\t\tfor (let i = 1, e = decomposed.length; i < e; i++) { // see: assumption\r\n\t\t\t// 20230210: bugfix: using cps instead of decomposed h/t Carbon225\r\n\t\t\t/*\r\n\t\t\tif (CM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\twhile (j < e && CM.has(decomposed[j])) j++;\r\n\t\t\t\tif (j - i > M) {\r\n\t\t\t\t\tthrow new Error(`too many combining marks: ${g.N} ${bidi_qq(str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${M})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t\t// 20230217: switch to NSM counting\r\n\t\t\t// https://www.unicode.org/reports/tr39/#Optional_Detection\r\n\t\t\tif (NSM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\tfor (let cp; j < e && NSM.has(cp = decomposed[j]); j++) {\r\n\t\t\t\t\t// a. Forbid sequences of the same nonspacing mark.\r\n\t\t\t\t\tfor (let k = i; k < j; k++) { // O(n^2) but n < 100\r\n\t\t\t\t\t\tif (decomposed[k] == cp) {\r\n\t\t\t\t\t\t\tthrow new Error(`duplicate non-spacing marks: ${quoted_cp(cp)}`);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// parse to end so we have full nsm count\r\n\t\t\t\t// b. Forbid sequences of more than 4 nonspacing marks (gc=Mn or gc=Me).\r\n\t\t\t\tif (j - i > NSM_MAX) {\r\n\t\t\t\t\t// note: this slice starts with a base char or spacing-mark cm\r\n\t\t\t\t\tthrow new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(decomposed.slice(i-1, j)))} (${j-i}/${NSM_MAX})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// *** this code currently isn't needed ***\r\n\t/*\r\n\tlet cm_whitelist = M instanceof Map;\r\n\tfor (let i = 0, e = cps.length; i < e; ) {\r\n\t\tlet cp = cps[i++];\r\n\t\tlet seqs = cm_whitelist && M.get(cp);\r\n\t\tif (seqs) { \r\n\t\t\t// list of codepoints that can follow\r\n\t\t\t// if this exists, this will always be 1+\r\n\t\t\tlet j = i;\r\n\t\t\twhile (j < e && CM.has(cps[j])) j++;\r\n\t\t\tlet cms = cps.slice(i, j);\r\n\t\t\tlet match = seqs.find(seq => !compare_arrays(seq, cms));\r\n\t\t\tif (!match) throw new Error(`disallowed combining mark sequence: \"${safe_str_from_cps([cp, ...cms])}\"`);\r\n\t\t\ti = j;\r\n\t\t} else if (!V.has(cp)) {\r\n\t\t\t// https://www.unicode.org/reports/tr39/#mixed_script_confusables\r\n\t\t\tlet quoted = quoted_cp(cp);\r\n\t\t\tfor (let cp of cps) {\r\n\t\t\t\tlet u = UNIQUE.get(cp);\r\n\t\t\t\tif (u && u !== g) {\r\n\t\t\t\t\t// if both scripts are restricted this error is confusing\r\n\t\t\t\t\t// because we don't differentiate RestrictedA from RestrictedB \r\n\t\t\t\t\tif (!u.R) quoted = `${quoted} is ${u.N}`;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthrow new Error(`disallowed ${g.N} character: ${quoted}`);\r\n\t\t\t//throw new Error(`disallowed character: ${quoted} (expected ${g.N})`);\r\n\t\t\t//throw new Error(`${g.N} does not allow: ${quoted}`);\r\n\t\t}\r\n\t}\r\n\tif (!cm_whitelist) {\r\n\t\tlet decomposed = nfd(cps);\r\n\t\tfor (let i = 1, e = decomposed.length; i < e; i++) { // we know it can't be cm leading\r\n\t\t\tif (CM.has(decomposed[i])) {\r\n\t\t\t\tlet j = i + 1;\r\n\t\t\t\twhile (j < e && CM.has(decomposed[j])) j++;\r\n\t\t\t\tif (j - i > M) {\r\n\t\t\t\t\tthrow new Error(`too many combining marks: \"${str_from_cps(decomposed.slice(i-1, j))}\" (${j-i}/${M})`);\r\n\t\t\t\t}\r\n\t\t\t\ti = j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t*/\r\n}\r\n\r\n// given a list of codepoints\r\n// returns a list of lists, where emoji are a fully-qualified (as Array subclass)\r\n// eg. explode_cp(\"abc💩d\") => [[61, 62, 63], Emoji[1F4A9, FE0F], [64]]\r\n// 20230818: rename for 'process' name collision h/t Javarome\r\n// https://github.com/adraffy/ens-normalize.js/issues/23\r\nfunction tokens_from_str(input, nf, ef) {\r\n\tlet ret = [];\r\n\tlet chars = [];\r\n\tinput = input.slice().reverse(); // flip so we can pop\r\n\twhile (input.length) {\r\n\t\tlet emoji = consume_emoji_reversed(input);\r\n\t\tif (emoji) {\r\n\t\t\tif (chars.length) {\r\n\t\t\t\tret.push(nf(chars));\r\n\t\t\t\tchars = [];\r\n\t\t\t}\r\n\t\t\tret.push(ef(emoji));\r\n\t\t} else {\r\n\t\t\tlet cp = input.pop();\r\n\t\t\tif (VALID.has(cp)) {\r\n\t\t\t\tchars.push(cp);\r\n\t\t\t} else {\r\n\t\t\t\tlet cps = MAPPED.get(cp);\r\n\t\t\t\tif (cps) {\r\n\t\t\t\t\tchars.push(...cps); // less than 10 elements\r\n\t\t\t\t} else if (!IGNORED.has(cp)) {\r\n\t\t\t\t\t// 20230912: unicode 15.1 changed the order of processing such that\r\n\t\t\t\t\t// disallowed parts are only rejected after NFC\r\n\t\t\t\t\t// https://unicode.org/reports/tr46/#Validity_Criteria\r\n\t\t\t\t\t// this doesn't impact normalization as of today\r\n\t\t\t\t\t// technically, this error can be removed as the group logic will apply similar logic\r\n\t\t\t\t\t// however the error type might be less clear\r\n\t\t\t\t\tthrow error_disallowed(cp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (chars.length) {\r\n\t\tret.push(nf(chars));\r\n\t}\r\n\treturn ret;\r\n}\r\n\r\nfunction filter_fe0f(cps) {\r\n\treturn cps.filter(cp => cp != FE0F);\r\n}\r\n\r\n// given array of codepoints\r\n// returns the longest valid emoji sequence (or undefined if no match)\r\n// *MUTATES* the supplied array\r\n// disallows interleaved ignored characters\r\n// fills (optional) eaten array with matched codepoints\r\nfunction consume_emoji_reversed(cps, eaten) {\r\n\tlet node = EMOJI_ROOT;\r\n\tlet emoji;\r\n\tlet pos = cps.length;\r\n\twhile (pos) {\r\n\t\tnode = node.get(cps[--pos]);\r\n\t\tif (!node) break;\r\n\t\tlet {V} = node;\r\n\t\tif (V) { // this is a valid emoji (so far)\r\n\t\t\temoji = V;\r\n\t\t\tif (eaten) eaten.push(...cps.slice(pos).reverse()); // (optional) copy input, used for ens_tokenize()\r\n\t\t\tcps.length = pos; // truncate\r\n\t\t}\r\n\t}\r\n\treturn emoji;\r\n}\r\n\r\n// ************************************************************\r\n// tokenizer \r\n\r\nconst TY_VALID = 'valid';\r\nconst TY_MAPPED = 'mapped';\r\nconst TY_IGNORED = 'ignored';\r\nconst TY_DISALLOWED = 'disallowed';\r\nconst TY_EMOJI = 'emoji';\r\nconst TY_NFC = 'nfc';\r\nconst TY_STOP = 'stop';\r\n\r\nfunction ens_tokenize(name, {\r\n\tnf = true, // collapse unnormalized runs into a single token\r\n} = {}) {\r\n\tinit();\r\n\tlet input = explode_cp(name).reverse();\r\n\tlet eaten = [];\r\n\tlet tokens = [];\r\n\twhile (input.length) {\r\n\t\tlet emoji = consume_emoji_reversed(input, eaten);\r\n\t\tif (emoji) {\r\n\t\t\ttokens.push({\r\n\t\t\t\ttype: TY_EMOJI,\r\n\t\t\t\temoji: emoji.slice(), // copy emoji\r\n\t\t\t\tinput: eaten,\r\n\t\t\t\tcps: filter_fe0f(emoji)\r\n\t\t\t});\r\n\t\t\teaten = []; // reset buffer\r\n\t\t} else {\r\n\t\t\tlet cp = input.pop();\r\n\t\t\tif (cp == STOP) {\r\n\t\t\t\ttokens.push({type: TY_STOP, cp});\r\n\t\t\t} else if (VALID.has(cp)) {\r\n\t\t\t\ttokens.push({type: TY_VALID, cps: [cp]});\r\n\t\t\t} else if (IGNORED.has(cp)) {\r\n\t\t\t\ttokens.push({type: TY_IGNORED, cp});\r\n\t\t\t} else {\r\n\t\t\t\tlet cps = MAPPED.get(cp);\r\n\t\t\t\tif (cps) {\r\n\t\t\t\t\ttokens.push({type: TY_MAPPED, cp, cps: cps.slice()});\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttokens.push({type: TY_DISALLOWED, cp});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (nf) {\r\n\t\tfor (let i = 0, start = -1; i < tokens.length; i++) {\r\n\t\t\tlet token = tokens[i];\r\n\t\t\tif (is_valid_or_mapped(token.type)) {\r\n\t\t\t\tif (requires_check(token.cps)) { // normalization might be needed\r\n\t\t\t\t\tlet end = i + 1;\r\n\t\t\t\t\tfor (let pos = end; pos < tokens.length; pos++) { // find adjacent text\r\n\t\t\t\t\t\tlet {type, cps} = tokens[pos];\r\n\t\t\t\t\t\tif (is_valid_or_mapped(type)) {\r\n\t\t\t\t\t\t\tif (!requires_check(cps)) break;\r\n\t\t\t\t\t\t\tend = pos + 1;\r\n\t\t\t\t\t\t} else if (type !== TY_IGNORED) { // || type !== TY_DISALLOWED) { \r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (start < 0) start = i;\r\n\t\t\t\t\tlet slice = tokens.slice(start, end);\r\n\t\t\t\t\tlet cps0 = slice.flatMap(x => is_valid_or_mapped(x.type) ? x.cps : []); // strip junk tokens\r\n\t\t\t\t\tlet cps = nfc(cps0);\r\n\t\t\t\t\tif (compare_arrays(cps, cps0)) { // bundle into an nfc token\r\n\t\t\t\t\t\ttokens.splice(start, end - start, {\r\n\t\t\t\t\t\t\ttype: TY_NFC, \r\n\t\t\t\t\t\t\tinput: cps0, // there are 3 states: tokens0 ==(process)=> input ==(nfc)=> tokens/cps\r\n\t\t\t\t\t\t\tcps, \r\n\t\t\t\t\t\t\ttokens0: collapse_valid_tokens(slice),\r\n\t\t\t\t\t\t\ttokens: ens_tokenize(str_from_cps(cps), {nf: false})\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\ti = start;\r\n\t\t\t\t\t} else { \r\n\t\t\t\t\t\ti = end - 1; // skip to end of slice\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart = -1; // reset\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstart = i; // remember last\r\n\t\t\t\t}\r\n\t\t\t} else if (token.type !== TY_IGNORED) { // 20221024: is this correct?\r\n\t\t\t\tstart = -1; // reset\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn collapse_valid_tokens(tokens);\r\n}\r\n\r\nfunction is_valid_or_mapped(type) {\r\n\treturn type == TY_VALID || type == TY_MAPPED;\r\n}\r\n\r\nfunction requires_check(cps) {\r\n\treturn cps.some(cp => NFC_CHECK.has(cp));\r\n}\r\n\r\nfunction collapse_valid_tokens(tokens) {\r\n\tfor (let i = 0; i < tokens.length; i++) {\r\n\t\tif (tokens[i].type == TY_VALID) {\r\n\t\t\tlet j = i + 1;\r\n\t\t\twhile (j < tokens.length && tokens[j].type == TY_VALID) j++;\r\n\t\t\ttokens.splice(i, j - i, {type: TY_VALID, cps: tokens.slice(i, j).flatMap(x => x.cps)});\r\n\t\t}\r\n\t}\r\n\treturn tokens;\r\n}\n\nexport { ens_beautify, ens_emoji, ens_normalize, ens_normalize_fragment, ens_split, ens_tokenize, is_combining_mark, nfc, nfd, safe_str_from_cps, should_escape };\n{\n\t\"name\": \"@adraffy/ens-normalize\",\n\t\"version\": \"1.10.1\",\n\t\"description\": \"Ethereum Name Service (ENS) Name Normalizer\",\n\t\"keywords\": [\n\t\t\"ENS\",\n\t\t\"ENSIP-1\",\n\t\t\"ENSIP-15\",\n\t\t\"Ethereum\",\n\t\t\"UTS-46\",\n\t\t\"UTS-51\",\n\t\t\"IDNA\",\n\t\t\"Name\",\n\t\t\"Normalize\",\n\t\t\"Normalization\",\n\t\t\"NFC\",\n\t\t\"NFD\"\n\t],\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.ts\",\n\t\t\t\"import\": \"./dist/index.mjs\",\n\t\t\t\"default\": \"./dist/index.cjs\"\n\t\t},\n\t\t\"./xnf\": {\n\t\t\t\"types\": \"./dist/index.d.ts\",\n\t\t\t\"import\": \"./dist/index-xnf.mjs\",\n\t\t\t\"default\": \"./dist/index-xnf.cjs\"\n\t\t}\n\t},\n\t\"types\": \"./dist/index.d.ts\",\n\t\"typesVersions\": {\n\t\t\"*\": {\n\t\t\t\"*\": [\n\t\t\t\t\"./dist/index.d.ts\"\n\t\t\t]\n\t\t}\n\t},\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.mjs\",\n\t\"files\": [\n\t\t\"./dist\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git+https://github.com/adraffy/ens-normalize.js.git\"\n\t},\n\t\"license\": \"MIT\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/adraffy/ens-normalize.js/issues\"\n\t},\n\t\"homepage\": \"https://github.com/adraffy/ens-normalize.js#readme\",\n\t\"author\": {\n\t\t\"name\": \"raffy.eth\",\n\t\t\"email\": \"raffy@me.com\",\n\t\t\"url\": \"http://raffy.antistupid.com\"\n\t},\n\t\"scripts\": {\n\t\t\"unicode\": \"node derive/download.js\",\n\t\t\"labels\": \"node validate/download-labels.js\",\n\t\t\"derive\": \"node derive/make.js\",\n\t\t\"make\": \"node src/make.js\",\n\t\t\"validate\": \"node validate/make.js\",\n\t\t\"test\": \"node test/coder.js && node test/nf.js && node test/validate.js && node test/init.js\",\n\t\t\"build\": \"rollup -c\",\n\t\t\"rebuild\": \"npm run derive && npm run make && npm run validate && npm run test && npm run build\",\n\t\t\"order\": \"node validate/dump-group-order.js save && npm run rebuild\",\n\t\t\"pack\": \"node ./src/prepost.js pack\",\n\t\t\"pub\": \"node ./src/prepost.js publish\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@rollup/plugin-alias\": \"^5.0.0\",\n\t\t\"@rollup/plugin-terser\": \"^0.4.0\",\n\t\t\"rollup\": \"^3.24.1\"\n\t}\n}\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addUntilReach = void 0;\nconst index_1 = require(\"../index\");\nconst validation_1 = require(\"../validation\");\nconst vsize_1 = require(\"../vsize\");\nconst dust_1 = require(\"../dust\");\n/**\n * The `addUntilReach` algorithm is similar to the default {@link coinselect coinselect}.\n * It continuously adds UTXOs until the combined value surpasses the sum of the targets and fees.\n * This function does not reorder UTXOs before selection. It evaluates whether creating change\n * is feasible, with consideration of whether the change exceeds the dust threshold.\n *\n * Notes:\n *\n * - This function does not reorder UTXOs prior to selection.\n * - UTXOs that do not provide enough value to cover their respective fee contributions are automatically excluded.\n *\n * Refer to {@link coinselect coinselect} for additional details on input parameters and expected returned values.\n */\nfunction addUntilReach({ utxos, targets, remainder, feeRate, dustRelayFeeRate = index_1.DUST_RELAY_FEE_RATE }) {\n    (0, validation_1.validateOutputWithValues)(utxos);\n    (0, validation_1.validateOutputWithValues)(targets);\n    (0, validation_1.validateDust)(targets);\n    (0, validation_1.validateFeeRate)(feeRate);\n    (0, validation_1.validateFeeRate)(dustRelayFeeRate);\n    const targetsValue = targets.reduce((a, target) => a + target.value, 0);\n    const utxosSoFar = [];\n    for (const candidate of utxos) {\n        const txSizeSoFar = (0, vsize_1.vsize)(utxosSoFar.map(utxo => utxo.output), targets.map(target => target.output));\n        const utxosSoFarValue = utxosSoFar.reduce((a, utxo) => a + utxo.value, 0);\n        const txFeeSoFar = Math.ceil(txSizeSoFar * feeRate);\n        const txSizeWithCandidate = (0, vsize_1.vsize)([candidate.output, ...utxosSoFar.map(utxo => utxo.output)], targets.map(target => target.output));\n        const txFeeWithCandidate = Math.ceil(txSizeWithCandidate * feeRate);\n        const candidateFeeContribution = txFeeWithCandidate - txFeeSoFar;\n        if (candidateFeeContribution < 0)\n            throw new Error(`candidateFeeContribution < 0`);\n        // Only consider inputs with more value than the fee they require\n        if (candidate.value > candidateFeeContribution) {\n            if (utxosSoFarValue + candidate.value >=\n                targetsValue + txFeeWithCandidate) {\n                // Evaluate if adding remainder is beneficial\n                const txSizeWithCandidateAndChange = (0, vsize_1.vsize)([candidate.output, ...utxosSoFar.map(utxo => utxo.output)], [remainder, ...targets.map(target => target.output)]);\n                const txFeeWithCandidateAndChange = Math.ceil(txSizeWithCandidateAndChange * feeRate);\n                const remainderValue = utxosSoFarValue +\n                    candidate.value -\n                    (targetsValue + txFeeWithCandidateAndChange);\n                //return the same reference if nothing changed to interact nicely with\n                //reactive components\n                const utxosResult = [candidate, ...utxosSoFar];\n                const targetsResult = (0, dust_1.isDust)(remainder, remainderValue, dustRelayFeeRate)\n                    ? targets\n                    : [...targets, { output: remainder, value: remainderValue }];\n                return {\n                    utxos: utxosResult.length === utxos.length ? utxos : utxosResult,\n                    targets: targetsResult,\n                    ...(0, validation_1.validatedFeeAndVsize)(utxosResult, targetsResult, feeRate)\n                };\n            }\n            else {\n                utxosSoFar.push(candidate);\n            }\n        }\n    }\n    return;\n}\nexports.addUntilReach = addUntilReach;\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.avoidChange = void 0;\nconst index_1 = require(\"../index\");\nconst validation_1 = require(\"../validation\");\nconst vsize_1 = require(\"../vsize\");\nconst dust_1 = require(\"../dust\");\n/**\n * Seeks a selection of UTXOs that does not necessitate the creation of change.\n * Although the function signature matches that of the standard {@link coinselect coinselect},\n * requiring a `remainder`, change is never generated. The `remainder` is used\n * to assess if hypothetical change would NOT be considered dust, thereby rendering\n * the solution unviable.\n *\n * Notes:\n *\n * - This function does not reorder UTXOs prior to selection.\n * - UTXOs that do not provide enough value to cover their respective fee contributions are automatically excluded.\n *\n * Refer to {@link coinselect coinselect} for additional details on input parameters and expected returned values.\n */\nfunction avoidChange({ utxos, targets, remainder, feeRate, dustRelayFeeRate = index_1.DUST_RELAY_FEE_RATE }) {\n    (0, validation_1.validateOutputWithValues)(utxos);\n    (0, validation_1.validateOutputWithValues)(targets);\n    (0, validation_1.validateDust)(targets);\n    (0, validation_1.validateFeeRate)(feeRate);\n    (0, validation_1.validateFeeRate)(dustRelayFeeRate);\n    const targetsValue = targets.reduce((a, target) => a + target.value, 0);\n    const utxosSoFar = [];\n    for (const candidate of utxos) {\n        const utxosSoFarValue = utxosSoFar.reduce((a, utxo) => a + utxo.value, 0);\n        const txSizeWithCandidateAndChange = (0, vsize_1.vsize)([candidate.output, ...utxosSoFar.map(utxo => utxo.output)], [remainder, ...targets.map(target => target.output)]);\n        const txFeeWithCandidateAndChange = Math.ceil(txSizeWithCandidateAndChange * feeRate);\n        const remainderValue = utxosSoFarValue +\n            candidate.value -\n            (targetsValue + txFeeWithCandidateAndChange);\n        const txSizeWithCandidate = (0, vsize_1.vsize)([candidate.output, ...utxosSoFar.map(utxo => utxo.output)], targets.map(target => target.output));\n        const txFeeWithCandidate = Math.ceil(txSizeWithCandidate * feeRate);\n        const txSizeSoFar = (0, vsize_1.vsize)(utxosSoFar.map(utxo => utxo.output), targets.map(target => target.output));\n        const txFeeSoFar = Math.ceil(txSizeSoFar * feeRate);\n        const candidateFeeContribution = txFeeWithCandidate - txFeeSoFar;\n        if (candidateFeeContribution < 0)\n            throw new Error(`candidateFeeContribution < 0`);\n        // Only consider inputs with more value than the fee they require\n        if (candidate.value > candidateFeeContribution) {\n            //Check that adding the candidate utxo would NOT imply that change was needed:\n            if ((0, dust_1.isDust)(remainder, remainderValue, dustRelayFeeRate)) {\n                //Enough utxo value already so that it covers targets and fee?\n                if (utxosSoFarValue + candidate.value >=\n                    targetsValue + txFeeWithCandidate) {\n                    //return the same reference if nothing changed to interact nicely with\n                    //reactive components\n                    const utxosResult = [candidate, ...utxosSoFar];\n                    return {\n                        utxos: utxosResult.length === utxos.length ? utxos : utxosResult,\n                        targets,\n                        ...(0, validation_1.validatedFeeAndVsize)(utxosResult, targets, feeRate)\n                    };\n                }\n                else\n                    utxosSoFar.push(candidate);\n            }\n        }\n    }\n    return;\n}\nexports.avoidChange = avoidChange;\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.maxFunds = void 0;\nconst index_1 = require(\"../index\");\nconst validation_1 = require(\"../validation\");\nconst vsize_1 = require(\"../vsize\");\nconst dust_1 = require(\"../dust\");\n/**\n * The `maxFunds` algorithm is tailored for scenarios where the goal is to transfer all funds from specified UTXOs to a single recipient output.\n * To utilize this function, specify the recipient output in the `remainder` argument.\n * In this context, the `remainder` serves as the recipient of the funds.\n *\n * Notes:\n *\n * - This function does not reorder UTXOs prior to selection.\n * - UTXOs that do not provide enough value to cover their respective fee contributions are automatically excluded.\n * - Recipient of all funds is set to last position of the returned `targets` array.\n *\n * Refer to {@link coinselect coinselect} for additional details on input parameters and expected returned values.\n */\nfunction maxFunds({ utxos, targets, remainder, feeRate, dustRelayFeeRate = index_1.DUST_RELAY_FEE_RATE }) {\n    (0, validation_1.validateOutputWithValues)(utxos);\n    if (targets.length)\n        (0, validation_1.validateOutputWithValues)(targets);\n    (0, validation_1.validateDust)(targets);\n    (0, validation_1.validateFeeRate)(feeRate);\n    (0, validation_1.validateFeeRate)(dustRelayFeeRate);\n    const outputs = [...targets.map(target => target.output), remainder];\n    const targetsValue = targets.reduce((a, target) => a + target.value, 0);\n    const allUtxosFee = Math.ceil(feeRate *\n        (0, vsize_1.vsize)(utxos.map(utxo => utxo.output), outputs));\n    // Only consider inputs with more value than the fee they require\n    const validUtxos = utxos.filter(validUtxo => {\n        const txSizeWithoutUtxo = (0, vsize_1.vsize)(utxos.filter(utxo => utxo !== validUtxo).map(utxo => utxo.output), outputs);\n        const feeContribution = allUtxosFee - Math.ceil(feeRate * txSizeWithoutUtxo);\n        if (feeContribution < 0)\n            throw new Error(`feeContribution < 0`);\n        return validUtxo.value > feeContribution;\n    });\n    const validFee = Math.ceil(feeRate *\n        (0, vsize_1.vsize)(validUtxos.map(utxo => utxo.output), outputs));\n    const validUtxosValue = validUtxos.reduce((a, utxo) => a + utxo.value, 0);\n    const remainderValue = validUtxosValue - targetsValue - validFee;\n    if (!(0, dust_1.isDust)(remainder, remainderValue, dustRelayFeeRate)) {\n        //return the same reference if nothing changed to interact nicely with\n        //reactive components\n        //mutate targets:\n        targets = [...targets, { output: remainder, value: remainderValue }];\n        return {\n            utxos: utxos.length === validUtxos.length ? utxos : validUtxos,\n            targets,\n            ...(0, validation_1.validatedFeeAndVsize)(validUtxos, targets, feeRate)\n        };\n    }\n    else\n        return;\n}\nexports.maxFunds = maxFunds;\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.coinselect = void 0;\nconst index_1 = require(\"./index\");\nconst validation_1 = require(\"./validation\");\nconst addUntilReach_1 = require(\"./algos/addUntilReach\");\nconst avoidChange_1 = require(\"./algos/avoidChange\");\nconst vsize_1 = require(\"./vsize\");\n// order by descending value, minus the inputs approximate fee\nfunction utxoTransferredValue(outputAndValue, feeRate, isSegwitTx) {\n    return (outputAndValue.value -\n        (feeRate *\n            outputAndValue.output.inputWeight(isSegwitTx, 'DANGEROUSLY_USE_FAKE_SIGNATURES')) /\n            4);\n}\n/**\n * Selects UTXOs for a Bitcoin transaction.\n *\n * Sorts UTXOs by their descending net value\n * (each UTXO's value minus the fees needed to spend it).\n *\n * It initially attempts to find a solution using the\n * {@link avoidChange avoidChange} algorithm,\n * which aims to select UTXOs such that no change is required. If this is not\n * possible, it then applies the {@link addUntilReach addUntilReach} algorithm,\n * which adds UTXOs\n * until the total value exceeds the target value plus fees.\n * Change is added only if it's above the {@link dustThreshold dustThreshold}).\n *\n * UTXOs that do not provide enough value to cover their respective fee\n * contributions are automatically excluded.\n *\n * *NOTE:* When the descriptor in an input is `addr(address)`, it is assumed\n * that any `addr(SH_TYPE_ADDRESS)` is in fact a Segwit `SH_WPKH`\n * (Script Hash-Witness Public Key Hash).\n * For inputs using arbitrary scripts (not standard addresses),\n * use a descriptor in the format `sh(MINISCRIPT)`.\n *\n * @returns Object with selected UTXOs, targets, fee, and estimated vsize, or\n *          undefined if no solution is found.\n *\n * @example\n * ```\n * const { utxos, targets, fee, vsize } = coinselect({\n *   utxos: [\n *     { output: new Output({ descriptor: 'addr(...)' }), value: 2000 },\n *     { output: new Output({ descriptor: 'addr(...)' }), value: 4000 }\n *   ],\n *   targets: [\n *     { output: new Output({ descriptor: 'addr(...)' }), value: 3000 }\n *   ],\n *   remainder: new Output({ descriptor: 'addr(...)' }),\n *   feeRate: 1.34\n * });\n * ```\n *\n * @see {@link https://bitcoinerlab.com/modules/descriptors} for descriptor info.\n */\nfunction coinselect({ utxos, targets, remainder, feeRate, dustRelayFeeRate = index_1.DUST_RELAY_FEE_RATE }) {\n    (0, validation_1.validateOutputWithValues)(utxos);\n    if (targets) {\n        (0, validation_1.validateOutputWithValues)(targets);\n        (0, validation_1.validateDust)(targets);\n    }\n    (0, validation_1.validateFeeRate)(feeRate);\n    (0, validation_1.validateFeeRate)(dustRelayFeeRate);\n    //We will assume that the tx is segwit if there is at least one segwit\n    //utxo for computing the utxo ordering. This is an approximation.\n    //Note that having one segwit utxo does not mean the final tx will be segwit\n    //(because the coinselect algo may end up choosing only non-segwit utxos).\n    const isPossiblySegwitTx = (0, vsize_1.isSegwitTx)(utxos.map(utxo => utxo.output));\n    //Sort in descending utxoTransferredValue\n    //Using [...utxos] because sort mutates the input\n    const sortedUtxos = [...utxos].sort((a, b) => utxoTransferredValue(b, feeRate, isPossiblySegwitTx) -\n        utxoTransferredValue(a, feeRate, isPossiblySegwitTx));\n    const coinselected = (0, avoidChange_1.avoidChange)({\n        utxos: sortedUtxos,\n        targets,\n        remainder,\n        feeRate,\n        dustRelayFeeRate\n    }) ||\n        (0, addUntilReach_1.addUntilReach)({\n            utxos: sortedUtxos,\n            targets,\n            remainder,\n            feeRate,\n            dustRelayFeeRate\n        });\n    if (coinselected) {\n        //return the same reference if nothing changed to interact nicely with\n        //reactive components\n        utxos =\n            coinselected.utxos.length === utxos.length ? utxos : coinselected.utxos;\n        targets =\n            coinselected.targets.length === targets?.length\n                ? targets\n                : coinselected.targets;\n        return { utxos, targets, fee: coinselected.fee, vsize: coinselected.vsize };\n    }\n    else\n        return;\n}\nexports.coinselect = coinselect;\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isDust = exports.dustThreshold = void 0;\nconst index_1 = require(\"./index\");\n/**\n * Coin selection algorithms in this library throw errors for targets below the\n * dustThreshold to prevent creation of transactions that Bitcoin nodes may not\n * relay. Ensure your targets are equal or above dust with this function.\n *\n * The default `DUST_RELAY_FEE_RATE` matches Bitcoin Core's. Changing it isn't\n * recommended.\n *\n * \"Dust\" is defined in terms of `dustRelayFee`, measured in satoshis-per-byte\n * (it differs from Bitcoin Core's measurement in satoshis-per-kilobyte).\n * If you'd pay more in fees than the value of the output to spend something,\n * then we consider it dust.\n *\n * Examples: A typical spendable non-segwit output is 34 bytes big, and will\n * need an input of at least 148 bytes to spend:\n * `TX_INPUT_BASE + TX_INPUT_PUBKEYHASH = (32 + 4 + 1 + 4) + 107 = 148`\n * so dust is a spendable output less than\n * `(34 + 148) * dustRelayFeeRate = 182 * dustRelayFee` (in satoshis).\n * 546 satoshis at the default `DUST_RELAY_FEE_RATE` of 3 sat/vB.\n *\n * A typical spendable segwit P2WPKH output is 31 bytes big, and will\n * need an input of at least 67.75 bytes to spend, 68, rounded up:\n * so dust is a spendable output less than\n * `98 * dustRelayFee` (in satoshis).\n * 297 satoshis at the default `DUST_RELAY_FEE_RATE` of 3 sat/vB.\n *\n * Note: Bitcoin Core contains a rounding error (rounds down instead of up) that\n * generates an incorrect dust threshold for Segwit (294). See:\n * https://github.com/lightningnetwork/lnd/issues/3946#issuecomment-890222512.\n *\n * We rather return the correct value (rounding up) which, in fact, is safer\n * should Bitcoin Core fix the problem in the future.\n *\n * See Bitcoin Core implementation here:\n * https://github.com/bitcoin/bitcoin/blob/d752349029ec7a76f1fd440db2ec2e458d0f3c99/src/policy/policy.cpp#L26\n */\nfunction dustThreshold(\n/**\n * The `Output` instance  for which the dust threshold is computed\n */\noutput, \n/**\n * Fee rate (in sats/byte) used to define dust, the value of an output such\n * that it will cost more than its value in fees at this fee rate to\n * spend it.\n * @defaultValue `DUST_RELAY_FEE_RATE `= `3`\n */\ndustRelayFeeRate = index_1.DUST_RELAY_FEE_RATE) {\n    const isSegwitOutput = output.isSegwit();\n    if (isSegwitOutput === undefined)\n        throw new Error(`Unknown output type`);\n    // When sending to scripts (such as TR, SH, or WSH) using an addr() descriptor,\n    // the actual input weight may be unknown because the unlocking script isn’t provided.\n    // In such cases, we fall back to a conservative estimate based on a typical P2WPKH input.\n    // Bitcoin Core Wallet does similar stuff...\n    //\n    // The fallback is derived as follows:\n    // - Non-witness part:\n    //   • txid: 32 bytes\n    //   • vout: 4 bytes\n    //   • sequence: 4 bytes\n    //   • script length: 1 byte\n    //   Total non-witness bytes = 41 bytes → 41 * 4 = 164 weight units.\n    // - Witness part (for P2WPKH):\n    //   • push count: 1 byte\n    //   • signature: 73 bytes\n    //   • public key: 34 bytes\n    //   Total witness bytes = 108 weight units.\n    // Combined total input weight = 164 + 108 = 272 weight units.\n    let inputWeight;\n    try {\n        //this may throw. F.ex. if the output is a wsh and the miniscript was\n        //not provided.\n        inputWeight = output.inputWeight(isSegwitOutput, 'DANGEROUSLY_USE_FAKE_SIGNATURES');\n    }\n    catch (err) {\n        inputWeight = 272;\n    }\n    return Math.ceil(dustRelayFeeRate * Math.ceil((output.outputWeight() + inputWeight) / 4));\n}\nexports.dustThreshold = dustThreshold;\nfunction isDust(output, value, dustRelayFeeRate = index_1.DUST_RELAY_FEE_RATE) {\n    if (!Number.isInteger(value))\n        throw new Error(`Invalid value ${value}`);\n    return value < dustThreshold(output, dustRelayFeeRate);\n}\nexports.isDust = isDust;\n\"use strict\";\n// Copyright (c) 2023 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.avoidChange = exports.addUntilReach = exports.maxFunds = exports.dustThreshold = exports.vsize = exports.coinselect = exports.MAX_FEE_RATE = exports.DUST_RELAY_FEE_RATE = void 0;\n// Same as in Bitcoin Core\nexports.DUST_RELAY_FEE_RATE = 3;\n//10 times larger than 2017 peak\nexports.MAX_FEE_RATE = 10000;\nvar coinselect_1 = require(\"./coinselect\");\nObject.defineProperty(exports, \"coinselect\", { enumerable: true, get: function () { return coinselect_1.coinselect; } });\nvar vsize_1 = require(\"./vsize\");\nObject.defineProperty(exports, \"vsize\", { enumerable: true, get: function () { return vsize_1.vsize; } });\nvar dust_1 = require(\"./dust\");\nObject.defineProperty(exports, \"dustThreshold\", { enumerable: true, get: function () { return dust_1.dustThreshold; } });\nvar maxFunds_1 = require(\"./algos/maxFunds\");\nObject.defineProperty(exports, \"maxFunds\", { enumerable: true, get: function () { return maxFunds_1.maxFunds; } });\nvar addUntilReach_1 = require(\"./algos/addUntilReach\");\nObject.defineProperty(exports, \"addUntilReach\", { enumerable: true, get: function () { return addUntilReach_1.addUntilReach; } });\nvar avoidChange_1 = require(\"./algos/avoidChange\");\nObject.defineProperty(exports, \"avoidChange\", { enumerable: true, get: function () { return avoidChange_1.avoidChange; } });\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validatedFeeAndVsize = exports.validateDust = exports.validateFeeRate = exports.validateOutputWithValues = void 0;\nconst index_1 = require(\"./index\");\nconst vsize_1 = require(\"./vsize\");\nconst dust_1 = require(\"./dust\");\nfunction validateOutputWithValues(outputAndValues) {\n    if (outputAndValues.length === 0)\n        throw new Error('Empty group');\n    for (const outputAndValue of outputAndValues) {\n        const value = outputAndValue.value;\n        //note an utxo with value === 0 is possible, see https://blockstream.info/testnet/tx/a063dbdc23cf969df020536f75c431167a2bbf29d6215a2067495ac46991c954\n        if (!Number.isInteger(value) || value < 0 || value > 1e14 /*1 M Btc*/) {\n            throw new Error(`Input value ${value} not supported`);\n        }\n    }\n}\nexports.validateOutputWithValues = validateOutputWithValues;\nfunction validateFeeRate(feeRate) {\n    if (!Number.isFinite(feeRate) || feeRate < 1 || feeRate > index_1.MAX_FEE_RATE) {\n        throw new Error(`Fee rate ${feeRate} not supported`);\n    }\n}\nexports.validateFeeRate = validateFeeRate;\nfunction validateDust(targets, dustRelayFeeRate = index_1.DUST_RELAY_FEE_RATE) {\n    for (const [index, target] of Object.entries(targets))\n        if ((0, dust_1.isDust)(target.output, target.value, dustRelayFeeRate))\n            throw new Error(`Target #${index} is dusty`);\n}\nexports.validateDust = validateDust;\nfunction validatedFeeAndVsize(utxos, targets, feeRate) {\n    const fee = utxos.reduce((a, u) => a + u.value, 0) -\n        targets.reduce((a, t) => a + t.value, 0);\n    const vsizeResult = (0, vsize_1.vsize)(utxos.map(u => u.output), targets.map(t => t.output));\n    const finalFeeRate = fee / vsizeResult;\n    // Don't compare fee rates because values are picked based on comparing fees (multiplications)\n    // Don't mix * / operators:\n    // F.ex.: 100/27 !== 100*(1/27)\n    // Instead, compare final fee\n    if (fee < Math.ceil(vsizeResult * feeRate))\n        throw new Error(`Final fee ${fee} lower than required ${Math.ceil(vsizeResult * feeRate)}`);\n    validateFeeRate(finalFeeRate);\n    return { fee, vsize: vsizeResult };\n}\nexports.validatedFeeAndVsize = validatedFeeAndVsize;\n\"use strict\";\n// Copyright (c) 2023 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.vsize = exports.isSegwitTx = void 0;\nconst varuint_bitcoin_1 = require(\"varuint-bitcoin\");\nconst isSegwitTx = (inputs) => inputs.some(input => input.isSegwit());\nexports.isSegwitTx = isSegwitTx;\n/**\n * Computes the virtual size (vsize) of a Bitcoin transaction based on specified\n * inputs and outputs.\n *\n * @returns The computed virtual size (vsize) of the transaction, rounded up to\n * the nearest integer.\n *\n * *NOTE:* When the descriptor in an input is `addr(address)`, it is assumed\n * that any `addr(SH_TYPE_ADDRESS)` is in fact a Segwit `SH_WPKH`\n * (Script Hash-Witness Public Key Hash).\n * For inputs using arbitrary scripts (not standard addresses),\n * use a descriptor in the format `sh(MINISCRIPT)`.\n * Similarly, add(TR_TYPE_ADDRESS) is assumed to be a single-key tr address.\n *\n * @example\n * ```\n * const vsizeValue = vsize(\n *   [new Output({ descriptor: 'addr(...)' })], // inputs\n *   [new Output({ descriptor: 'addr(...)' })]  // outputs\n * );\n * ```\n *\n * @see {@link https://bitcoinerlab.com/modules/descriptors} for details on\n * OutputInstance and descriptors.\n */\nfunction vsize(\n/**\n * Array of `OutputInstance` representing the inputs of the transaction.\n */\ninputs, \n/**\n * Array of `OutputInstance` representing the outputs of the transaction.\n */\noutputs, \n/**\n * Optional array of arrays containing signatures.\n * The outer array corresponds to each input in the transaction. The inner array contains\n * signatures for each public key associated with the respective input.\n *\n * If provided, enables calculation of exact signature sizes.\n * Defaults to assuming 72 bytes per signature.\n * Mainly used for testing and accurate fee estimation.\n */\nsignaturesPerInput) {\n    const isSegwitTxValue = (0, exports.isSegwitTx)(inputs);\n    let totalWeight = 0;\n    inputs.forEach(function (input, index) {\n        if (signaturesPerInput) {\n            const signatures = signaturesPerInput[index];\n            if (!signatures)\n                throw new Error(`signaturesPerInput not defined for ${index}`);\n            totalWeight += input.inputWeight(isSegwitTxValue, signatures);\n        }\n        else\n            totalWeight += input.inputWeight(isSegwitTxValue, 'DANGEROUSLY_USE_FAKE_SIGNATURES');\n    });\n    outputs.forEach(function (output) {\n        totalWeight += output.outputWeight();\n    });\n    if (isSegwitTxValue)\n        totalWeight += 2;\n    totalWeight += 8 * 4;\n    totalWeight += (0, varuint_bitcoin_1.encodingLength)(inputs.length) * 4;\n    totalWeight += (0, varuint_bitcoin_1.encodingLength)(outputs.length) * 4;\n    return Math.ceil(totalWeight / 4);\n}\nexports.vsize = vsize;\n{\n  \"name\": \"@bitcoinerlab/coinselect\",\n  \"version\": \"1.3.1\",\n  \"author\": \"Jose-Luis Landabaso\",\n  \"license\": \"MIT\",\n  \"description\": \"A TypeScript library for Bitcoin transaction management, based on Bitcoin Descriptors for defining inputs and outputs. It facilitates optimal UTXO selection and transaction size calculation.\",\n  \"homepage\": \"https://bitcoinerlab.com/modules/coinselect\",\n  \"main\": \"dist/index.js\",\n  \"types\": \"dist/index.d.ts\",\n  \"prettier\": \"@bitcoinerlab/configs/prettierConfig.json\",\n  \"eslintConfig\": {\n    \"extends\": \"./node_modules/@bitcoinerlab/configs/eslintConfig\"\n  },\n  \"jest\": {\n    \"preset\": \"@bitcoinerlab/configs\"\n  },\n  \"scripts\": {\n    \"webdocs\": \"typedoc --options ./node_modules/@bitcoinerlab/configs/webtypedoc.json\",\n    \"docs\": \"typedoc --options ./node_modules/@bitcoinerlab/configs/typedoc.json\",\n    \"build:src\": \"tsc --project ./node_modules/@bitcoinerlab/configs/tsconfig.src.json\",\n    \"fixturesCoinselect\": \"npx ts-node --project ./node_modules/@bitcoinerlab/configs/tsconfig.test.json test/tools/coinselect/fixturesFromBjs.ts\",\n    \"fixturesVsize\": \"npm run tester && npx ts-node --transpile-only --project ./node_modules/@bitcoinerlab/configs/tsconfig.test.json test/tools/vsize/fixturesFromRegtest.ts\",\n    \"build:test\": \"tsc --project ./node_modules/@bitcoinerlab/configs/tsconfig.test.json --resolveJsonModule\",\n    \"build\": \"npm run build:src && npm run build:test\",\n    \"lint\": \"eslint --ignore-path .gitignore --ext .ts src/ test/\",\n    \"tester\": \"./node_modules/@bitcoinerlab/configs/scripts/tester.sh\",\n    \"test\": \"npm run lint && npm run build && jest\",\n    \"prepublishOnly\": \"npm test\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/bitcoinerlab/coinselect.git\"\n  },\n  \"keywords\": [\n    \"coinselect\",\n    \"bitcoin\",\n    \"descriptors\",\n    \"utxos\"\n  ],\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinerlab/coinselect/issues\"\n  },\n  \"files\": [\n    \"dist\"\n  ],\n  \"devDependencies\": {\n    \"@bitcoinerlab/configs\": \"github:bitcoinerlab/configs\",\n    \"bip39\": \"^3.1.0\",\n    \"bip68\": \"^1.0.4\",\n    \"fs\": \"^0.0.1-security\",\n    \"path\": \"^0.12.7\",\n    \"regtest-client\": \"^0.2.1\"\n  },\n  \"dependencies\": {\n    \"@bitcoinerlab/descriptors\": \"^2.3.0\"\n  }\n}\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.applyPR2137 = void 0;\nconst utils_1 = require(\"bip174/src/lib/utils\");\nconst bip341_1 = require(\"bitcoinjs-lib/src/payments/bip341\");\nconst bip371_1 = require(\"bitcoinjs-lib/src/psbt/bip371\");\nconst crypto_1 = require(\"bitcoinjs-lib/src/crypto\");\nconst toXOnly = (pubKey) => pubKey.length === 32 ? pubKey : pubKey.slice(1, 33);\nfunction range(n) {\n    return [...Array(n).keys()];\n}\nfunction tapBranchHash(a, b) {\n    return (0, crypto_1.taggedHash)('TapBranch', Buffer.concat([a, b]));\n}\nfunction calculateScriptTreeMerkleRoot(leafHashes) {\n    if (!leafHashes || leafHashes.length === 0) {\n        return undefined;\n    }\n    // sort the leaf nodes\n    leafHashes.sort(Buffer.compare);\n    // create the initial hash node\n    let currentLevel = leafHashes;\n    // build Merkle Tree\n    while (currentLevel.length > 1) {\n        const nextLevel = [];\n        for (let i = 0; i < currentLevel.length; i += 2) {\n            const left = currentLevel[i];\n            const right = i + 1 < currentLevel.length ? currentLevel[i + 1] : left;\n            nextLevel.push(i + 1 < currentLevel.length ? tapBranchHash(left, right) : left);\n        }\n        currentLevel = nextLevel;\n    }\n    return currentLevel[0];\n}\nfunction getTweakSignersFromHD(inputIndex, inputs, hdKeyPair) {\n    const input = (0, utils_1.checkForInput)(inputs, inputIndex);\n    if (!input.tapBip32Derivation || input.tapBip32Derivation.length === 0) {\n        throw new Error('Need tapBip32Derivation to sign with HD');\n    }\n    const myDerivations = input.tapBip32Derivation\n        .map(bipDv => {\n        if (bipDv.masterFingerprint.equals(hdKeyPair.fingerprint)) {\n            return bipDv;\n        }\n        else {\n            return;\n        }\n    })\n        .filter(v => !!v);\n    if (myDerivations.length === 0) {\n        throw new Error('Need one tapBip32Derivation masterFingerprint to match the HDSigner fingerprint');\n    }\n    const signers = myDerivations.map(bipDv => {\n        const node = hdKeyPair.derivePath(bipDv.path);\n        if (!bipDv.pubkey.equals(toXOnly(node.publicKey))) {\n            throw new Error('pubkey did not match tapBip32Derivation');\n        }\n        const h = calculateScriptTreeMerkleRoot(bipDv.leafHashes);\n        const tweakValue = (0, bip341_1.tapTweakHash)(toXOnly(node.publicKey), h);\n        return node.tweak(tweakValue);\n    });\n    return signers;\n}\nfunction getSignersFromHD(inputIndex, inputs, hdKeyPair) {\n    const input = (0, utils_1.checkForInput)(inputs, inputIndex);\n    if ((0, bip371_1.isTaprootInput)(input)) {\n        return getTweakSignersFromHD(inputIndex, inputs, hdKeyPair);\n    }\n    if (!input.bip32Derivation || input.bip32Derivation.length === 0) {\n        throw new Error('Need bip32Derivation to sign with HD');\n    }\n    const myDerivations = input.bip32Derivation\n        .map(bipDv => {\n        if (bipDv.masterFingerprint.equals(hdKeyPair.fingerprint)) {\n            return bipDv;\n        }\n        else {\n            return;\n        }\n    })\n        .filter(v => !!v);\n    if (myDerivations.length === 0) {\n        throw new Error('Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint');\n    }\n    const signers = myDerivations.map(bipDv => {\n        const node = hdKeyPair.derivePath(bipDv.path);\n        if (!bipDv.pubkey.equals(node.publicKey)) {\n            throw new Error('pubkey did not match bip32Derivation');\n        }\n        return node;\n    });\n    return signers;\n}\nconst applyPR2137 = (psbt) => {\n    psbt.signInputHD = function signInputHD(inputIndex, hdKeyPair, sighashTypes) {\n        if (!hdKeyPair || !hdKeyPair.publicKey || !hdKeyPair.fingerprint) {\n            throw new Error('Need HDSigner to sign input');\n        }\n        const signers = getSignersFromHD(inputIndex, this.data.inputs, hdKeyPair);\n        signers.forEach(signer => this.signInput(inputIndex, signer, sighashTypes));\n        return this;\n    };\n    psbt.signAllInputsHD = function signAllInputsHD(hdKeyPair, sighashTypes) {\n        if (!hdKeyPair || !hdKeyPair.publicKey || !hdKeyPair.fingerprint) {\n            throw new Error('Need HDSigner to sign input');\n        }\n        const results = [];\n        for (const i of range(psbt.data.inputs.length)) {\n            try {\n                psbt.signInputHD(i, hdKeyPair, sighashTypes);\n                results.push(true);\n            }\n            catch (err) {\n                results.push(false);\n            }\n        }\n        if (results.every(v => v === false)) {\n            throw new Error('No inputs were signed');\n        }\n        return psbt;\n    };\n};\nexports.applyPR2137 = applyPR2137;\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DescriptorChecksum = exports.CHECKSUM_CHARSET = void 0;\n// Converted to Javascript by Jose-Luis Landabaso, 2023 - https://bitcoinerlab.com\n// Source: https://github.com/bitcoin/bitcoin/blob/master/src/script/descriptor.cpp\n// Distributed under the MIT software license\nconst PolyMod = (c, val) => {\n    const c0 = c >> 35n;\n    c = ((c & 0x7ffffffffn) << 5n) ^ val;\n    if (c0 & 1n)\n        c ^= 0xf5dee51989n;\n    if (c0 & 2n)\n        c ^= 0xa9fdca3312n;\n    if (c0 & 4n)\n        c ^= 0x1bab10e32dn;\n    if (c0 & 8n)\n        c ^= 0x3706b1677an;\n    if (c0 & 16n)\n        c ^= 0x644d626ffdn;\n    return c;\n};\nexports.CHECKSUM_CHARSET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';\n/**\n * Implements the Bitcoin descriptor's checksum algorithm described in\n * {@link https://github.com/bitcoin/bitcoin/blob/master/src/script/descriptor.cpp}\n */\nconst DescriptorChecksum = (span) => {\n    const INPUT_CHARSET = '0123456789()[],\\'/*abcdefgh@:$%{}IJKLMNOPQRSTUVWXYZ&+-.;<=>?!^_|~ijklmnopqrstuvwxyzABCDEFGH`#\"\\\\ ';\n    let c = 1n;\n    let cls = 0n;\n    let clscount = 0n;\n    for (const ch of span) {\n        const pos = BigInt(INPUT_CHARSET.indexOf(ch));\n        if (pos === -1n)\n            return '';\n        c = PolyMod(c, pos & 31n);\n        cls = cls * 3n + (pos >> 5n);\n        if (++clscount === 3n) {\n            c = PolyMod(c, cls);\n            cls = 0n;\n            clscount = 0n;\n        }\n    }\n    if (clscount > 0n)\n        c = PolyMod(c, cls);\n    for (let j = 0; j < 8; ++j)\n        c = PolyMod(c, 0n);\n    c ^= 1n;\n    let ret = '';\n    for (let j = 0; j < 8; ++j) {\n        const index = (c >> (5n * (7n - BigInt(j)))) & 31n;\n        if (index < 0 || index > Number.MAX_SAFE_INTEGER)\n            throw new Error(`Error: could not compute checksum, invalid index ${index}`);\n        ret += exports.CHECKSUM_CHARSET[Number(index)];\n    }\n    return ret;\n};\nexports.DescriptorChecksum = DescriptorChecksum;\n\"use strict\";\n// Copyright (c) 2025 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DescriptorsFactory = void 0;\nconst lodash_memoize_1 = __importDefault(require(\"lodash.memoize\"));\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\nconst varuint_bitcoin_1 = require(\"varuint-bitcoin\");\nconst { p2sh, p2wpkh, p2pkh, p2pk, p2wsh, p2tr } = bitcoinjs_lib_1.payments;\nconst bip32_1 = require(\"bip32\");\nconst ecpair_1 = require(\"ecpair\");\nconst psbt_1 = require(\"./psbt\");\nconst checksum_1 = require(\"./checksum\");\nconst keyExpressions_1 = require(\"./keyExpressions\");\nconst RE = __importStar(require(\"./re\"));\nconst miniscript_1 = require(\"./miniscript\");\n//See \"Resource limitations\" https://bitcoin.sipa.be/miniscript/\n//https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-September/017306.html\nconst MAX_SCRIPT_ELEMENT_SIZE = 520;\nconst MAX_STANDARD_P2WSH_SCRIPT_SIZE = 3600;\nconst MAX_OPS_PER_SCRIPT = 201;\nfunction countNonPushOnlyOPs(script) {\n    const decompile = bitcoinjs_lib_1.script.decompile(script);\n    if (!decompile)\n        throw new Error(`Error: cound not decompile ${script}`);\n    return decompile.filter(op => typeof op === 'number' && op > bitcoinjs_lib_1.script.OPS['OP_16']).length;\n}\nfunction vectorSize(someVector) {\n    const length = someVector.length;\n    return ((0, varuint_bitcoin_1.encodingLength)(length) +\n        someVector.reduce((sum, witness) => {\n            return sum + varSliceSize(witness);\n        }, 0));\n}\nfunction varSliceSize(someScript) {\n    const length = someScript.length;\n    return (0, varuint_bitcoin_1.encodingLength)(length) + length;\n}\n/**\n * This function will typically return 73; since it assumes a signature size of\n * 72 bytes (this is the max size of a DER encoded signature) and it adds 1\n * extra byte for encoding its length\n */\nfunction signatureSize(signature) {\n    const length = signature === 'DANGEROUSLY_USE_FAKE_SIGNATURES'\n        ? 72\n        : signature.signature.length;\n    return (0, varuint_bitcoin_1.encodingLength)(length) + length;\n}\n/*\n * Returns a bare descriptor without checksum and particularized for a certain\n * index (if desc was a range descriptor)\n * @hidden\n */\nfunction evaluate({ descriptor, checksumRequired, index }) {\n    if (!descriptor)\n        throw new Error('You must provide a descriptor.');\n    const mChecksum = descriptor.match(String.raw `(${RE.reChecksum})$`);\n    if (mChecksum === null && checksumRequired === true)\n        throw new Error(`Error: descriptor ${descriptor} has not checksum`);\n    //evaluatedDescriptor: a bare desc without checksum and particularized for a certain\n    //index (if desc was a range descriptor)\n    let evaluatedDescriptor = descriptor;\n    if (mChecksum !== null) {\n        const checksum = mChecksum[0].substring(1); //remove the leading #\n        evaluatedDescriptor = descriptor.substring(0, descriptor.length - mChecksum[0].length);\n        if (checksum !== (0, checksum_1.DescriptorChecksum)(evaluatedDescriptor)) {\n            throw new Error(`Error: invalid descriptor checksum for ${descriptor}`);\n        }\n    }\n    if (index !== undefined) {\n        const mWildcard = evaluatedDescriptor.match(/\\*/g);\n        if (mWildcard && mWildcard.length > 0) {\n            //From  https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md\n            //To prevent a combinatorial explosion of the search space, if more than\n            //one of the multi() key arguments is a BIP32 wildcard path ending in /* or\n            //*', the multi() descriptor only matches multisig scripts with the ith\n            //child key from each wildcard path in lockstep, rather than scripts with\n            //any combination of child keys from each wildcard path.\n            //We extend this reasoning for musig for all cases\n            evaluatedDescriptor = evaluatedDescriptor.replaceAll('*', index.toString());\n        }\n        else\n            throw new Error(`Error: index passed for non-ranged descriptor: ${descriptor}`);\n    }\n    return evaluatedDescriptor;\n}\n/**\n * Constructs the necessary functions and classes for working with descriptors\n * using an external elliptic curve (ecc) library.\n *\n * Notably, it returns the {@link _Internal_.Output | `Output`} class, which\n * provides methods to create, sign, and finalize PSBTs based on descriptor\n * expressions.\n *\n * While this Factory function includes the `Descriptor` class, note that\n * this class was deprecated in v2.0 in favor of `Output`. For backward\n * compatibility, the `Descriptor` class remains, but using `Output` is advised.\n *\n * The Factory also returns utility methods like `expand` (detailed below)\n * and `parseKeyExpression` (see {@link ParseKeyExpression}).\n *\n * Additionally, for convenience, the function returns `BIP32` and `ECPair`.\n * These are {@link https://github.com/bitcoinjs bitcoinjs-lib} classes designed\n * for managing {@link https://github.com/bitcoinjs/bip32 | `BIP32`} keys and\n * public/private key pairs:\n * {@link https://github.com/bitcoinjs/ecpair | `ECPair`}, respectively.\n *\n * @param {Object} ecc - An object with elliptic curve operations, such as\n * [tiny-secp256k1](https://github.com/bitcoinjs/tiny-secp256k1) or\n * [@bitcoinerlab/secp256k1](https://github.com/bitcoinerlab/secp256k1).\n */\nfunction DescriptorsFactory(ecc) {\n    var _Output_instances, _Output_payment, _Output_preimages, _Output_signersPubKeys, _Output_miniscript, _Output_witnessScript, _Output_redeemScript, _Output_isSegwit, _Output_isTaproot, _Output_expandedExpression, _Output_expandedMiniscript, _Output_expansionMap, _Output_network, _Output_getTimeConstraints, _Output_assertPsbtInput;\n    (0, bitcoinjs_lib_1.initEccLib)(ecc); //Taproot requires initEccLib\n    const BIP32 = (0, bip32_1.BIP32Factory)(ecc);\n    const ECPair = (0, ecpair_1.ECPairFactory)(ecc);\n    const signatureValidator = (pubkey, msghash, signature) => {\n        if (pubkey.length === 32) {\n            //x-only\n            if (!ecc.verifySchnorr) {\n                throw new Error('TinySecp256k1Interface is not initialized properly: verifySchnorr is missing.');\n            }\n            return ecc.verifySchnorr(msghash, pubkey, signature);\n        }\n        else {\n            return ECPair.fromPublicKey(pubkey).verify(msghash, signature);\n        }\n    };\n    /**\n     * Takes a string key expression (xpub, xprv, pubkey or wif) and parses it\n     */\n    const parseKeyExpression = ({ keyExpression, isSegwit, isTaproot, network = bitcoinjs_lib_1.networks.bitcoin }) => {\n        return (0, keyExpressions_1.parseKeyExpression)({\n            keyExpression,\n            network,\n            ...(typeof isSegwit === 'boolean' ? { isSegwit } : {}),\n            ...(typeof isTaproot === 'boolean' ? { isTaproot } : {}),\n            ECPair,\n            BIP32\n        });\n    };\n    /**\n     * @hidden\n     * To be removed in v3.0 and replaced by the version with the signature that\n     * does not accept descriptors\n     */\n    function expand({ descriptor, expression, index, checksumRequired = false, network = bitcoinjs_lib_1.networks.bitcoin, allowMiniscriptInP2SH = false }) {\n        if (descriptor && expression)\n            throw new Error(`expression param has been deprecated`);\n        descriptor = descriptor || expression;\n        if (!descriptor)\n            throw new Error(`descriptor not provided`);\n        let expandedExpression;\n        let miniscript;\n        let expansionMap;\n        let isSegwit;\n        let isTaproot;\n        let expandedMiniscript;\n        let payment;\n        let witnessScript;\n        let redeemScript;\n        const isRanged = descriptor.indexOf('*') !== -1;\n        if (index !== undefined)\n            if (!Number.isInteger(index) || index < 0)\n                throw new Error(`Error: invalid index ${index}`);\n        //Verify and remove checksum (if exists) and\n        //particularize range descriptor for index (if desc is range descriptor)\n        const canonicalExpression = evaluate({\n            descriptor,\n            ...(index !== undefined ? { index } : {}),\n            checksumRequired\n        });\n        const isCanonicalRanged = canonicalExpression.indexOf('*') !== -1;\n        //addr(ADDR)\n        if (canonicalExpression.match(RE.reAddrAnchored)) {\n            if (isRanged)\n                throw new Error(`Error: addr() cannot be ranged`);\n            const matchedAddress = canonicalExpression.match(RE.reAddrAnchored)?.[1]; //[1]-> whatever is found addr(->HERE<-)\n            if (!matchedAddress)\n                throw new Error(`Error: could not get an address in ${descriptor}`);\n            let output;\n            try {\n                output = bitcoinjs_lib_1.address.toOutputScript(matchedAddress, network);\n            }\n            catch (e) {\n                throw new Error(`Error: invalid address ${matchedAddress}`);\n            }\n            try {\n                payment = p2pkh({ output, network });\n                isSegwit = false;\n                isTaproot = false;\n            }\n            catch (e) { }\n            try {\n                payment = p2sh({ output, network });\n                // It assumes that an addr(SH_ADDRESS) is always a add(SH_WPKH) address\n                isSegwit = true;\n                isTaproot = false;\n            }\n            catch (e) { }\n            try {\n                payment = p2wpkh({ output, network });\n                isSegwit = true;\n                isTaproot = false;\n            }\n            catch (e) { }\n            try {\n                payment = p2wsh({ output, network });\n                isSegwit = true;\n                isTaproot = false;\n            }\n            catch (e) { }\n            try {\n                payment = p2tr({ output, network });\n                isSegwit = true;\n                isTaproot = true;\n            }\n            catch (e) { }\n            if (!payment) {\n                throw new Error(`Error: invalid address ${matchedAddress}`);\n            }\n        }\n        //pk(KEY)\n        else if (canonicalExpression.match(RE.rePkAnchored)) {\n            isSegwit = false;\n            isTaproot = false;\n            const keyExpression = canonicalExpression.match(RE.reNonSegwitKeyExp)?.[0];\n            if (!keyExpression)\n                throw new Error(`Error: keyExpression could not me extracted`);\n            if (canonicalExpression !== `pk(${keyExpression})`)\n                throw new Error(`Error: invalid expression ${descriptor}`);\n            expandedExpression = 'pk(@0)';\n            const pKE = parseKeyExpression({ keyExpression, network, isSegwit });\n            expansionMap = { '@0': pKE };\n            if (!isCanonicalRanged) {\n                const pubkey = pKE.pubkey;\n                //Note there exists no address for p2pk, but we can still use the script\n                if (!pubkey)\n                    throw new Error(`Error: could not extract a pubkey from ${descriptor}`);\n                payment = p2pk({ pubkey, network });\n            }\n        }\n        //pkh(KEY) - legacy\n        else if (canonicalExpression.match(RE.rePkhAnchored)) {\n            isSegwit = false;\n            isTaproot = false;\n            const keyExpression = canonicalExpression.match(RE.reNonSegwitKeyExp)?.[0];\n            if (!keyExpression)\n                throw new Error(`Error: keyExpression could not me extracted`);\n            if (canonicalExpression !== `pkh(${keyExpression})`)\n                throw new Error(`Error: invalid expression ${descriptor}`);\n            expandedExpression = 'pkh(@0)';\n            const pKE = parseKeyExpression({ keyExpression, network, isSegwit });\n            expansionMap = { '@0': pKE };\n            if (!isCanonicalRanged) {\n                const pubkey = pKE.pubkey;\n                if (!pubkey)\n                    throw new Error(`Error: could not extract a pubkey from ${descriptor}`);\n                payment = p2pkh({ pubkey, network });\n            }\n        }\n        //sh(wpkh(KEY)) - nested segwit\n        else if (canonicalExpression.match(RE.reShWpkhAnchored)) {\n            isSegwit = true;\n            isTaproot = false;\n            const keyExpression = canonicalExpression.match(RE.reSegwitKeyExp)?.[0];\n            if (!keyExpression)\n                throw new Error(`Error: keyExpression could not me extracted`);\n            if (canonicalExpression !== `sh(wpkh(${keyExpression}))`)\n                throw new Error(`Error: invalid expression ${descriptor}`);\n            expandedExpression = 'sh(wpkh(@0))';\n            const pKE = parseKeyExpression({ keyExpression, network, isSegwit });\n            expansionMap = { '@0': pKE };\n            if (!isCanonicalRanged) {\n                const pubkey = pKE.pubkey;\n                if (!pubkey)\n                    throw new Error(`Error: could not extract a pubkey from ${descriptor}`);\n                payment = p2sh({ redeem: p2wpkh({ pubkey, network }), network });\n                redeemScript = payment.redeem?.output;\n                if (!redeemScript)\n                    throw new Error(`Error: could not calculate redeemScript for ${descriptor}`);\n            }\n        }\n        //wpkh(KEY) - native segwit\n        else if (canonicalExpression.match(RE.reWpkhAnchored)) {\n            isSegwit = true;\n            isTaproot = false;\n            const keyExpression = canonicalExpression.match(RE.reSegwitKeyExp)?.[0];\n            if (!keyExpression)\n                throw new Error(`Error: keyExpression could not me extracted`);\n            if (canonicalExpression !== `wpkh(${keyExpression})`)\n                throw new Error(`Error: invalid expression ${descriptor}`);\n            expandedExpression = 'wpkh(@0)';\n            const pKE = parseKeyExpression({ keyExpression, network, isSegwit });\n            expansionMap = { '@0': pKE };\n            if (!isCanonicalRanged) {\n                const pubkey = pKE.pubkey;\n                if (!pubkey)\n                    throw new Error(`Error: could not extract a pubkey from ${descriptor}`);\n                payment = p2wpkh({ pubkey, network });\n            }\n        }\n        //sh(wsh(miniscript))\n        else if (canonicalExpression.match(RE.reShWshMiniscriptAnchored)) {\n            isSegwit = true;\n            isTaproot = false;\n            miniscript = canonicalExpression.match(RE.reShWshMiniscriptAnchored)?.[1]; //[1]-> whatever is found sh(wsh(->HERE<-))\n            if (!miniscript)\n                throw new Error(`Error: could not get miniscript in ${descriptor}`);\n            ({ expandedMiniscript, expansionMap } = expandMiniscript({\n                miniscript,\n                isSegwit,\n                network\n            }));\n            expandedExpression = `sh(wsh(${expandedMiniscript}))`;\n            if (!isCanonicalRanged) {\n                const script = (0, miniscript_1.miniscript2Script)({ expandedMiniscript, expansionMap });\n                witnessScript = script;\n                if (script.byteLength > MAX_STANDARD_P2WSH_SCRIPT_SIZE) {\n                    throw new Error(`Error: script is too large, ${script.byteLength} bytes is larger than ${MAX_STANDARD_P2WSH_SCRIPT_SIZE} bytes`);\n                }\n                const nonPushOnlyOps = countNonPushOnlyOPs(script);\n                if (nonPushOnlyOps > MAX_OPS_PER_SCRIPT) {\n                    throw new Error(`Error: too many non-push ops, ${nonPushOnlyOps} non-push ops is larger than ${MAX_OPS_PER_SCRIPT}`);\n                }\n                payment = p2sh({\n                    redeem: p2wsh({ redeem: { output: script, network }, network }),\n                    network\n                });\n                redeemScript = payment.redeem?.output;\n                if (!redeemScript)\n                    throw new Error(`Error: could not calculate redeemScript for ${descriptor}`);\n            }\n        }\n        //sh(miniscript)\n        else if (canonicalExpression.match(RE.reShMiniscriptAnchored)) {\n            //isSegwit false because we know it's a P2SH of a miniscript and not a\n            //P2SH that embeds a witness payment.\n            isSegwit = false;\n            isTaproot = false;\n            miniscript = canonicalExpression.match(RE.reShMiniscriptAnchored)?.[1]; //[1]-> whatever is found sh(->HERE<-)\n            if (!miniscript)\n                throw new Error(`Error: could not get miniscript in ${descriptor}`);\n            if (allowMiniscriptInP2SH === false &&\n                //These top-level expressions within sh are allowed within sh.\n                //They can be parsed with miniscript2Script, but first we must make sure\n                //that other expressions are not accepted (unless forced with allowMiniscriptInP2SH).\n                miniscript.search(/^(pk\\(|pkh\\(|wpkh\\(|combo\\(|multi\\(|sortedmulti\\(|multi_a\\(|sortedmulti_a\\()/) !== 0) {\n                throw new Error(`Error: Miniscript expressions can only be used in wsh`);\n            }\n            ({ expandedMiniscript, expansionMap } = expandMiniscript({\n                miniscript,\n                isSegwit,\n                network\n            }));\n            expandedExpression = `sh(${expandedMiniscript})`;\n            if (!isCanonicalRanged) {\n                const script = (0, miniscript_1.miniscript2Script)({ expandedMiniscript, expansionMap });\n                redeemScript = script;\n                if (script.byteLength > MAX_SCRIPT_ELEMENT_SIZE) {\n                    throw new Error(`Error: P2SH script is too large, ${script.byteLength} bytes is larger than ${MAX_SCRIPT_ELEMENT_SIZE} bytes`);\n                }\n                const nonPushOnlyOps = countNonPushOnlyOPs(script);\n                if (nonPushOnlyOps > MAX_OPS_PER_SCRIPT) {\n                    throw new Error(`Error: too many non-push ops, ${nonPushOnlyOps} non-push ops is larger than ${MAX_OPS_PER_SCRIPT}`);\n                }\n                payment = p2sh({ redeem: { output: script, network }, network });\n            }\n        }\n        //wsh(miniscript)\n        else if (canonicalExpression.match(RE.reWshMiniscriptAnchored)) {\n            isSegwit = true;\n            isTaproot = false;\n            miniscript = canonicalExpression.match(RE.reWshMiniscriptAnchored)?.[1]; //[1]-> whatever is found wsh(->HERE<-)\n            if (!miniscript)\n                throw new Error(`Error: could not get miniscript in ${descriptor}`);\n            ({ expandedMiniscript, expansionMap } = expandMiniscript({\n                miniscript,\n                isSegwit,\n                network\n            }));\n            expandedExpression = `wsh(${expandedMiniscript})`;\n            if (!isCanonicalRanged) {\n                const script = (0, miniscript_1.miniscript2Script)({ expandedMiniscript, expansionMap });\n                witnessScript = script;\n                if (script.byteLength > MAX_STANDARD_P2WSH_SCRIPT_SIZE) {\n                    throw new Error(`Error: script is too large, ${script.byteLength} bytes is larger than ${MAX_STANDARD_P2WSH_SCRIPT_SIZE} bytes`);\n                }\n                const nonPushOnlyOps = countNonPushOnlyOPs(script);\n                if (nonPushOnlyOps > MAX_OPS_PER_SCRIPT) {\n                    throw new Error(`Error: too many non-push ops, ${nonPushOnlyOps} non-push ops is larger than ${MAX_OPS_PER_SCRIPT}`);\n                }\n                payment = p2wsh({ redeem: { output: script, network }, network });\n            }\n        }\n        //tr(KEY) - taproot - TODO: tr(KEY,TREE) not yet supported\n        else if (canonicalExpression.match(RE.reTrSingleKeyAnchored)) {\n            isSegwit = true;\n            isTaproot = true;\n            const keyExpression = canonicalExpression.match(RE.reTaprootKeyExp)?.[0];\n            if (!keyExpression)\n                throw new Error(`Error: keyExpression could not me extracted`);\n            if (canonicalExpression !== `tr(${keyExpression})`)\n                throw new Error(`Error: invalid expression ${expression}`);\n            expandedExpression = 'tr(@0)';\n            const pKE = parseKeyExpression({\n                keyExpression,\n                network,\n                isSegwit,\n                isTaproot\n            });\n            expansionMap = { '@0': pKE };\n            if (!isCanonicalRanged) {\n                const pubkey = pKE.pubkey;\n                if (!pubkey)\n                    throw new Error(`Error: could not extract a pubkey from ${expression}`);\n                payment = p2tr({ internalPubkey: pubkey, network });\n                //console.log('TRACE', {\n                //  pKE,\n                //  pubkey: pubkey?.toString('hex'),\n                //  payment,\n                //  paymentPubKey: payment.pubkey\n                //});\n            }\n        }\n        else {\n            throw new Error(`Error: Could not parse descriptor ${descriptor}`);\n        }\n        return {\n            ...(payment !== undefined ? { payment } : {}),\n            ...(expandedExpression !== undefined ? { expandedExpression } : {}),\n            ...(miniscript !== undefined ? { miniscript } : {}),\n            ...(expansionMap !== undefined ? { expansionMap } : {}),\n            ...(isSegwit !== undefined ? { isSegwit } : {}),\n            ...(isTaproot !== undefined ? { isTaproot } : {}),\n            ...(expandedMiniscript !== undefined ? { expandedMiniscript } : {}),\n            ...(redeemScript !== undefined ? { redeemScript } : {}),\n            ...(witnessScript !== undefined ? { witnessScript } : {}),\n            isRanged,\n            canonicalExpression\n        };\n    }\n    /**\n     * Expand a miniscript to a generalized form using variables instead of key\n     * expressions. Variables will be of this form: @0, @1, ...\n     * This is done so that it can be compiled with compileMiniscript and\n     * satisfied with satisfier.\n     * Also compute pubkeys from descriptors to use them later.\n     */\n    function expandMiniscript({ miniscript, isSegwit, network = bitcoinjs_lib_1.networks.bitcoin }) {\n        return (0, miniscript_1.expandMiniscript)({\n            miniscript,\n            isSegwit,\n            isTaproot: false,\n            network,\n            BIP32,\n            ECPair\n        });\n    }\n    /**\n     * The `Output` class is the central component for managing descriptors.\n     * It facilitates the creation of outputs to receive funds and enables the\n     * signing and finalization of PSBTs (Partially Signed Bitcoin Transactions)\n     * for spending UTXOs (Unspent Transaction Outputs).\n     */\n    class Output {\n        /**\n         * @param options\n         * @throws {Error} - when descriptor is invalid\n         */\n        constructor({ descriptor, index, checksumRequired = false, allowMiniscriptInP2SH = false, network = bitcoinjs_lib_1.networks.bitcoin, preimages = [], signersPubKeys }) {\n            _Output_instances.add(this);\n            _Output_payment.set(this, void 0);\n            _Output_preimages.set(this, []);\n            _Output_signersPubKeys.set(this, void 0);\n            _Output_miniscript.set(this, void 0);\n            _Output_witnessScript.set(this, void 0);\n            _Output_redeemScript.set(this, void 0);\n            //isSegwit true if witnesses are needed to the spend coins sent to this descriptor.\n            //may be unset because we may get addr(P2SH) which we don't know if they have segwit.\n            _Output_isSegwit.set(this, void 0);\n            _Output_isTaproot.set(this, void 0);\n            _Output_expandedExpression.set(this, void 0);\n            _Output_expandedMiniscript.set(this, void 0);\n            _Output_expansionMap.set(this, void 0);\n            _Output_network.set(this, void 0);\n            __classPrivateFieldSet(this, _Output_network, network, \"f\");\n            __classPrivateFieldSet(this, _Output_preimages, preimages, \"f\");\n            if (typeof descriptor !== 'string')\n                throw new Error(`Error: invalid descriptor type`);\n            const expandedResult = expand({\n                descriptor,\n                ...(index !== undefined ? { index } : {}),\n                checksumRequired,\n                network,\n                allowMiniscriptInP2SH\n            });\n            if (expandedResult.isRanged && index === undefined)\n                throw new Error(`Error: index was not provided for ranged descriptor`);\n            if (!expandedResult.payment)\n                throw new Error(`Error: could not extract a payment from ${descriptor}`);\n            __classPrivateFieldSet(this, _Output_payment, expandedResult.payment, \"f\");\n            if (expandedResult.expandedExpression !== undefined)\n                __classPrivateFieldSet(this, _Output_expandedExpression, expandedResult.expandedExpression, \"f\");\n            if (expandedResult.miniscript !== undefined)\n                __classPrivateFieldSet(this, _Output_miniscript, expandedResult.miniscript, \"f\");\n            if (expandedResult.expansionMap !== undefined)\n                __classPrivateFieldSet(this, _Output_expansionMap, expandedResult.expansionMap, \"f\");\n            if (expandedResult.isSegwit !== undefined)\n                __classPrivateFieldSet(this, _Output_isSegwit, expandedResult.isSegwit, \"f\");\n            if (expandedResult.isTaproot !== undefined)\n                __classPrivateFieldSet(this, _Output_isTaproot, expandedResult.isTaproot, \"f\");\n            if (expandedResult.expandedMiniscript !== undefined)\n                __classPrivateFieldSet(this, _Output_expandedMiniscript, expandedResult.expandedMiniscript, \"f\");\n            if (expandedResult.redeemScript !== undefined)\n                __classPrivateFieldSet(this, _Output_redeemScript, expandedResult.redeemScript, \"f\");\n            if (expandedResult.witnessScript !== undefined)\n                __classPrivateFieldSet(this, _Output_witnessScript, expandedResult.witnessScript, \"f\");\n            if (signersPubKeys) {\n                __classPrivateFieldSet(this, _Output_signersPubKeys, signersPubKeys, \"f\");\n            }\n            else {\n                if (__classPrivateFieldGet(this, _Output_expansionMap, \"f\")) {\n                    __classPrivateFieldSet(this, _Output_signersPubKeys, Object.values(__classPrivateFieldGet(this, _Output_expansionMap, \"f\")).map(keyInfo => {\n                        const pubkey = keyInfo.pubkey;\n                        if (!pubkey)\n                            throw new Error(`Error: could not extract a pubkey from ${descriptor}`);\n                        return pubkey;\n                    }), \"f\");\n                }\n                else {\n                    //We should only miss expansionMap in addr() expressions:\n                    if (!expandedResult.canonicalExpression.match(RE.reAddrAnchored)) {\n                        throw new Error(`Error: expansionMap not available for expression ${descriptor} that is not an address`);\n                    }\n                    __classPrivateFieldSet(this, _Output_signersPubKeys, [this.getScriptPubKey()], \"f\");\n                }\n            }\n            this.getSequence = (0, lodash_memoize_1.default)(this.getSequence);\n            this.getLockTime = (0, lodash_memoize_1.default)(this.getLockTime);\n            const getSignaturesKey = (signatures) => signatures === 'DANGEROUSLY_USE_FAKE_SIGNATURES'\n                ? signatures\n                : signatures\n                    .map(s => `${s.pubkey.toString('hex')}-${s.signature.toString('hex')}`)\n                    .join('|');\n            this.getScriptSatisfaction = (0, lodash_memoize_1.default)(this.getScriptSatisfaction, \n            // resolver function:\n            getSignaturesKey);\n            this.guessOutput = (0, lodash_memoize_1.default)(this.guessOutput);\n            this.inputWeight = (0, lodash_memoize_1.default)(this.inputWeight, \n            // resolver function:\n            (isSegwitTx, signatures) => {\n                const segwitKey = isSegwitTx ? 'segwit' : 'non-segwit';\n                const signaturesKey = getSignaturesKey(signatures);\n                return `${segwitKey}-${signaturesKey}`;\n            });\n            this.outputWeight = (0, lodash_memoize_1.default)(this.outputWeight);\n        }\n        /**\n         * Creates and returns an instance of bitcoinjs-lib\n         * [`Payment`](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/ts_src/payments/index.ts)'s interface with the `scriptPubKey` of this `Output`.\n         */\n        getPayment() {\n            return __classPrivateFieldGet(this, _Output_payment, \"f\");\n        }\n        /**\n         * Returns the Bitcoin Address of this `Output`.\n         */\n        getAddress() {\n            if (!__classPrivateFieldGet(this, _Output_payment, \"f\").address)\n                throw new Error(`Error: could extract an address from the payment`);\n            return __classPrivateFieldGet(this, _Output_payment, \"f\").address;\n        }\n        /**\n         * Returns this `Output`'s scriptPubKey.\n         */\n        getScriptPubKey() {\n            if (!__classPrivateFieldGet(this, _Output_payment, \"f\").output)\n                throw new Error(`Error: could extract output.script from the payment`);\n            return __classPrivateFieldGet(this, _Output_payment, \"f\").output;\n        }\n        /**\n         * Returns the compiled Script Satisfaction if this `Output` was created\n         * using a miniscript-based descriptor.\n         *\n         * The Satisfaction is the unlocking script that fulfills\n         * (satisfies) this `Output` and it is derived using the Safisfier algorithm\n         * [described here](https://bitcoin.sipa.be/miniscript/).\n         *\n         * Important: As mentioned above, note that this function only applies to\n         * miniscript descriptors.\n         */\n        getScriptSatisfaction(\n        /**\n         * An array with all the signatures needed to\n         * build the Satisfaction of this miniscript-based `Output`.\n         *\n         * `signatures` must be passed using this format (pairs of `pubKey/signature`):\n         * `interface PartialSig { pubkey: Buffer; signature: Buffer; }`\n         *\n         *  * Alternatively, if you do not have the signatures, you can use the option\n         * `'DANGEROUSLY_USE_FAKE_SIGNATURES'`. This will generate script satisfactions\n         * using 72-byte zero-padded signatures. While this can be useful in\n         * modules like coinselector that require estimating transaction size before\n         * signing, it is critical to understand the risks:\n         * - Using this option generales invalid unlocking scripts.\n         * - It should NEVER be used with real transactions.\n         * - Its primary use is for testing and size estimation purposes only.\n         *\n         * ⚠️ Warning: Misuse of 'DANGEROUSLY_USE_FAKE_SIGNATURES' can lead to security\n         * vulnerabilities, including but not limited to invalid transaction generation.\n         * Ensure you fully understand the implications before use.\n         *\n         */\n        signatures) {\n            if (signatures === 'DANGEROUSLY_USE_FAKE_SIGNATURES')\n                signatures = __classPrivateFieldGet(this, _Output_signersPubKeys, \"f\").map(pubkey => ({\n                    pubkey,\n                    // https://transactionfee.info/charts/bitcoin-script-ecdsa-length/\n                    signature: Buffer.alloc(72, 0)\n                }));\n            const miniscript = __classPrivateFieldGet(this, _Output_miniscript, \"f\");\n            const expandedMiniscript = __classPrivateFieldGet(this, _Output_expandedMiniscript, \"f\");\n            const expansionMap = __classPrivateFieldGet(this, _Output_expansionMap, \"f\");\n            if (miniscript === undefined ||\n                expandedMiniscript === undefined ||\n                expansionMap === undefined)\n                throw new Error(`Error: cannot get satisfaction from not expanded miniscript ${miniscript}`);\n            //Note that we pass the nLockTime and nSequence that is deduced\n            //using preimages and signersPubKeys.\n            //satisfyMiniscript will make sure\n            //that the actual solution given, using real signatures, still meets the\n            //same nLockTime and nSequence constraints\n            const scriptSatisfaction = (0, miniscript_1.satisfyMiniscript)({\n                expandedMiniscript,\n                expansionMap,\n                signatures,\n                preimages: __classPrivateFieldGet(this, _Output_preimages, \"f\"),\n                //Here we pass the TimeConstraints obtained using signersPubKeys to\n                //verify that the solutions found using the final signatures have not\n                //changed\n                timeConstraints: {\n                    nLockTime: this.getLockTime(),\n                    nSequence: this.getSequence()\n                }\n            }).scriptSatisfaction;\n            if (!scriptSatisfaction)\n                throw new Error(`Error: could not produce a valid satisfaction`);\n            return scriptSatisfaction;\n        }\n        /**\n         * Gets the nSequence required to fulfill this `Output`.\n         */\n        getSequence() {\n            return __classPrivateFieldGet(this, _Output_instances, \"m\", _Output_getTimeConstraints).call(this)?.nSequence;\n        }\n        /**\n         * Gets the nLockTime required to fulfill this `Output`.\n         */\n        getLockTime() {\n            return __classPrivateFieldGet(this, _Output_instances, \"m\", _Output_getTimeConstraints).call(this)?.nLockTime;\n        }\n        /**\n         * Gets the witnessScript required to fulfill this `Output`. Only applies to\n         * Segwit outputs.\n         */\n        getWitnessScript() {\n            return __classPrivateFieldGet(this, _Output_witnessScript, \"f\");\n        }\n        /**\n         * Gets the redeemScript required to fullfill this `Output`. Only applies to\n         * SH outputs: sh(wpkh), sh(wsh), sh(lockingScript).\n         */\n        getRedeemScript() {\n            return __classPrivateFieldGet(this, _Output_redeemScript, \"f\");\n        }\n        /**\n         * Gets the bitcoinjs-lib [`network`](https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/ts_src/networks.ts) used to create this `Output`.\n         */\n        getNetwork() {\n            return __classPrivateFieldGet(this, _Output_network, \"f\");\n        }\n        /**\n         * Whether this `Output` is Segwit.\n         *\n         * *NOTE:* When the descriptor in an input is `addr(address)`, it is assumed\n         * that any `addr(SH_TYPE_ADDRESS)` is in fact a Segwit `SH_WPKH`\n         * (Script Hash-Witness Public Key Hash).\n         * For inputs using arbitrary scripts (not standard addresses),\n         * use a descriptor in the format `sh(MINISCRIPT)`.\n         *\n         */\n        isSegwit() {\n            return __classPrivateFieldGet(this, _Output_isSegwit, \"f\");\n        }\n        /**\n         * Whether this `Output` is Taproot.\n         */\n        isTaproot() {\n            return __classPrivateFieldGet(this, _Output_isTaproot, \"f\");\n        }\n        /**\n         * Attempts to determine the type of output script by testing it against\n         * various payment types.\n         *\n         * This method tries to identify if the output is one of the following types:\n         * - P2SH (Pay to Script Hash)\n         * - P2WSH (Pay to Witness Script Hash)\n         * - P2WPKH (Pay to Witness Public Key Hash)\n         * - P2PKH (Pay to Public Key Hash)\n         * - P2TR (Pay to Taproot)\n         *\n         * @returns An object { isPKH: boolean; isWPKH: boolean; isSH: boolean; isWSH: boolean; isTR: boolean;}\n         * with boolean properties indicating the detected output type\n         */\n        guessOutput() {\n            function guessSH(output) {\n                try {\n                    bitcoinjs_lib_1.payments.p2sh({ output });\n                    return true;\n                }\n                catch (err) {\n                    return false;\n                }\n            }\n            function guessWSH(output) {\n                try {\n                    bitcoinjs_lib_1.payments.p2wsh({ output });\n                    return true;\n                }\n                catch (err) {\n                    return false;\n                }\n            }\n            function guessWPKH(output) {\n                try {\n                    bitcoinjs_lib_1.payments.p2wpkh({ output });\n                    return true;\n                }\n                catch (err) {\n                    return false;\n                }\n            }\n            function guessPKH(output) {\n                try {\n                    bitcoinjs_lib_1.payments.p2pkh({ output });\n                    return true;\n                }\n                catch (err) {\n                    return false;\n                }\n            }\n            function guessTR(output) {\n                try {\n                    bitcoinjs_lib_1.payments.p2tr({ output });\n                    return true;\n                }\n                catch (err) {\n                    return false;\n                }\n            }\n            const isPKH = guessPKH(this.getScriptPubKey());\n            const isWPKH = guessWPKH(this.getScriptPubKey());\n            const isSH = guessSH(this.getScriptPubKey());\n            const isWSH = guessWSH(this.getScriptPubKey());\n            const isTR = guessTR(this.getScriptPubKey());\n            if ([isPKH, isWPKH, isSH, isWSH, isTR].filter(Boolean).length > 1)\n                throw new Error('Cannot have multiple output types.');\n            return { isPKH, isWPKH, isSH, isWSH, isTR };\n        }\n        // References for inputWeight & outputWeight:\n        // https://gist.github.com/junderw/b43af3253ea5865ed52cb51c200ac19c\n        // https://bitcoinops.org/en/tools/calc-size/\n        // Look for byteLength: https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/ts_src/transaction.ts\n        // https://github.com/bitcoinjs/coinselect/blob/master/utils.js\n        // https://bitcoin.stackexchange.com/questions/111395/what-is-the-weight-of-a-p2tr-input\n        /**\n         * Computes the Weight Unit contributions of this Output as if it were the\n         * input in a tx.\n         *\n         * *NOTE:* When the descriptor in an input is `addr(address)`, it is assumed\n         * that any `addr(SH_TYPE_ADDRESS)` is in fact a Segwit `SH_WPKH`\n         * (Script Hash-Witness Public Key Hash).\n         *, Also any `addr(SINGLE_KEY_ADDRESS)` * is assumed to be a single key Taproot\n         * address (like those defined in BIP86).\n         * For inputs using arbitrary scripts (not standard addresses),\n         * use a descriptor in the format `sh(MINISCRIPT)` or `tr(MINISCRIPT)`.\n         * Note however that tr(MINISCRIPT) is not yet supported for non-single-key\n         * expressions.\n         */\n        inputWeight(\n        /**\n         * Indicates if the transaction is a Segwit transaction.\n         * If a transaction isSegwitTx, a single byte is then also required for\n         * non-witness inputs to encode the length of the empty witness stack:\n         * encodeLength(0) + 0 = 1\n         * Read more:\n         * https://gist.github.com/junderw/b43af3253ea5865ed52cb51c200ac19c?permalink_comment_id=4760512#gistcomment-4760512\n         */\n        isSegwitTx, \n        /*\n         *  Array of `PartialSig`. Each `PartialSig` includes\n         *  a public key and its corresponding signature. This parameter\n         *  enables the accurate calculation of signature sizes for ECDSA.\n         *  Pass 'DANGEROUSLY_USE_FAKE_SIGNATURES' to assume 72 bytes in length\n         *  for ECDSA.\n         *  Schnorr signatures are always 64 bytes.\n         *  Mainly used for testing.\n         */\n        signatures) {\n            if (this.isSegwit() && !isSegwitTx)\n                throw new Error(`a tx is segwit if at least one input is segwit`);\n            //expand any miniscript-based descriptor. If not miniscript-based, then it's\n            //an addr() descriptor. For those, we can only guess their type.\n            const expansion = this.expand().expandedExpression;\n            const { isPKH, isWPKH, isSH, isTR } = this.guessOutput();\n            const errorMsg = `Input type not implemented. Currently supported: pkh(KEY), wpkh(KEY), tr(KEY), \\\nsh(wpkh(KEY)), sh(wsh(MINISCRIPT)), sh(MINISCRIPT), wsh(MINISCRIPT), \\\naddr(PKH_ADDRESS), addr(WPKH_ADDRESS), addr(SH_WPKH_ADDRESS), addr(SINGLE_KEY_ADDRESS). \\\nexpansion=${expansion}, isPKH=${isPKH}, isWPKH=${isWPKH}, isSH=${isSH}, isTR=${isTR}.`;\n            if (!expansion && !isPKH && !isWPKH && !isSH && !isTR)\n                throw new Error(errorMsg);\n            const firstSignature = signatures && typeof signatures[0] === 'object'\n                ? signatures[0]\n                : 'DANGEROUSLY_USE_FAKE_SIGNATURES';\n            if (expansion ? expansion.startsWith('pkh(') : isPKH) {\n                return (\n                // Non-segwit: (txid:32) + (vout:4) + (sequence:4) + (script_len:1) + (sig:73) + (pubkey:34)\n                (32 + 4 + 4 + 1 + signatureSize(firstSignature) + 34) * 4 +\n                    //Segwit:\n                    (isSegwitTx ? 1 : 0));\n            }\n            else if (expansion ? expansion.startsWith('wpkh(') : isWPKH) {\n                if (!isSegwitTx)\n                    throw new Error('Should be SegwitTx');\n                return (\n                // Non-segwit: (txid:32) + (vout:4) + (sequence:4) + (script_len:1)\n                41 * 4 +\n                    // Segwit: (push_count:1) + (sig:73) + (pubkey:34)\n                    (1 + signatureSize(firstSignature) + 34));\n            }\n            else if (expansion ? expansion.startsWith('sh(wpkh(') : isSH) {\n                if (!isSegwitTx)\n                    throw new Error('Should be SegwitTx');\n                return (\n                // Non-segwit: (txid:32) + (vout:4) + (sequence:4) + (script_len:1) + (p2wpkh:23)\n                //  -> p2wpkh_script: OP_0 OP_PUSH20 <public_key_hash>\n                //  -> p2wpkh: (script_len:1) + (script:22)\n                64 * 4 +\n                    // Segwit: (push_count:1) + (sig:73) + (pubkey:34)\n                    (1 + signatureSize(firstSignature) + 34));\n            }\n            else if (expansion?.startsWith('sh(wsh(')) {\n                if (!isSegwitTx)\n                    throw new Error('Should be SegwitTx');\n                const witnessScript = this.getWitnessScript();\n                if (!witnessScript)\n                    throw new Error('sh(wsh) must provide witnessScript');\n                const payment = bitcoinjs_lib_1.payments.p2sh({\n                    redeem: bitcoinjs_lib_1.payments.p2wsh({\n                        redeem: {\n                            input: this.getScriptSatisfaction(signatures || 'DANGEROUSLY_USE_FAKE_SIGNATURES'),\n                            output: witnessScript\n                        }\n                    })\n                });\n                if (!payment || !payment.input || !payment.witness)\n                    throw new Error('Could not create payment');\n                return (\n                //Non-segwit\n                4 * (40 + varSliceSize(payment.input)) +\n                    //Segwit\n                    vectorSize(payment.witness));\n            }\n            else if (expansion?.startsWith('sh(')) {\n                const redeemScript = this.getRedeemScript();\n                if (!redeemScript)\n                    throw new Error('sh() must provide redeemScript');\n                const payment = bitcoinjs_lib_1.payments.p2sh({\n                    redeem: {\n                        input: this.getScriptSatisfaction(signatures || 'DANGEROUSLY_USE_FAKE_SIGNATURES'),\n                        output: redeemScript\n                    }\n                });\n                if (!payment || !payment.input)\n                    throw new Error('Could not create payment');\n                if (payment.witness?.length)\n                    throw new Error('A legacy p2sh payment should not cointain a witness');\n                return (\n                //Non-segwit\n                4 * (40 + varSliceSize(payment.input)) +\n                    //Segwit:\n                    (isSegwitTx ? 1 : 0));\n            }\n            else if (expansion?.startsWith('wsh(')) {\n                const witnessScript = this.getWitnessScript();\n                if (!witnessScript)\n                    throw new Error('wsh must provide witnessScript');\n                const payment = bitcoinjs_lib_1.payments.p2wsh({\n                    redeem: {\n                        input: this.getScriptSatisfaction(signatures || 'DANGEROUSLY_USE_FAKE_SIGNATURES'),\n                        output: witnessScript\n                    }\n                });\n                if (!payment || !payment.input || !payment.witness)\n                    throw new Error('Could not create payment');\n                return (\n                //Non-segwit\n                4 * (40 + varSliceSize(payment.input)) +\n                    //Segwit\n                    vectorSize(payment.witness));\n                //when addr(SINGLE_KEY_ADDRESS) or tr(KEY) (single key):\n                //TODO: only single-key taproot outputs currently supported\n            }\n            else if (isTR && (!expansion || expansion === 'tr(@0)')) {\n                if (!isSegwitTx)\n                    throw new Error('Should be SegwitTx');\n                return (\n                // Non-segwit: (txid:32) + (vout:4) + (sequence:4) + (script_len:1)\n                41 * 4 +\n                    // Segwit: (push_count:1) + (sig_length(1) + schnorr_sig(64): 65)\n                    (1 + 65));\n            }\n            else {\n                throw new Error(errorMsg);\n            }\n        }\n        /**\n         * Computes the Weight Unit contributions of this Output as if it were the\n         * output in a tx.\n         */\n        outputWeight() {\n            //expand any miniscript-based descriptor. If not miniscript-based, then it's\n            //an addr() descriptor. For those, we can only guess their type.\n            const { isPKH, isWPKH, isSH, isWSH, isTR } = this.guessOutput();\n            const errorMsg = `Output type not implemented. Currently supported: pkh=${isPKH}, wpkh=${isWPKH}, tr=${isTR}, sh=${isSH} and wsh=${isWSH}.`;\n            if (isPKH) {\n                // (p2pkh:26) + (amount:8)\n                return 34 * 4;\n            }\n            else if (isWPKH) {\n                // (p2wpkh:23) + (amount:8)\n                return 31 * 4;\n            }\n            else if (isSH) {\n                // (p2sh:24) + (amount:8)\n                return 32 * 4;\n            }\n            else if (isWSH) {\n                // (p2wsh:35) + (amount:8)\n                return 43 * 4;\n            }\n            else if (isTR) {\n                // (script_pubKey_length:1) + (p2t2(OP_1 OP_PUSH32 <schnorr_public_key>):34) + (amount:8)\n                return 43 * 4;\n            }\n            else {\n                throw new Error(errorMsg);\n            }\n        }\n        /** @deprecated - Use updatePsbtAsInput instead\n         * @hidden\n         */\n        updatePsbt(params) {\n            this.updatePsbtAsInput(params);\n            return params.psbt.data.inputs.length - 1;\n        }\n        /**\n         * Sets this output as an input of the provided `psbt` and updates the\n         * `psbt` locktime if required by the descriptor.\n         *\n         * `psbt` and `vout` are mandatory. Include `txHex` as well. The pair\n         * `vout` and `txHex` define the transaction and output number this instance\n         * pertains to.\n         *\n         * Though not advised, for Segwit inputs you can pass `txId` and `value`\n         * in lieu of `txHex`. If doing so, ensure `value` accuracy to avoid\n         * potential fee attacks -\n         * [See this issue](https://github.com/bitcoinjs/bitcoinjs-lib/issues/1625).\n         *\n         * Note: Hardware wallets need the [full `txHex` for Segwit](https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd).\n         *\n         * When unsure, always use `txHex`, and skip `txId` and `value` for safety.\n         *\n         * Use `rbf` to mark whether this tx can be replaced with another with\n         * higher fee while being in the mempool. Note that a tx will automatically\n         * be marked as replacable if a single input requests it.\n         * Note that any transaction using a relative timelock (nSequence < 0x80000000)\n         * also falls within the RBF range (nSequence < 0xFFFFFFFE), making it\n         * inherently replaceable. So don't set `rbf` to false if this is tx uses\n         * relative time locks.\n         *\n         * @returns A finalizer function to be used after signing the `psbt`.\n         * This function ensures that this input is properly finalized.\n         * The finalizer has this signature:\n         *\n         * `( { psbt, validate = true } : { psbt: Psbt; validate: boolean | undefined } ) => void`\n         *\n         */\n        updatePsbtAsInput({ psbt, txHex, txId, value, vout, //vector output index\n        rbf = true }) {\n            if (txHex === undefined) {\n                console.warn(`Warning: missing txHex may allow fee attacks`);\n            }\n            const isSegwit = this.isSegwit();\n            if (isSegwit === undefined) {\n                //This should only happen when using addr() expressions\n                throw new Error(`Error: could not determine whether this is a segwit descriptor`);\n            }\n            const isTaproot = this.isTaproot();\n            if (isTaproot === undefined) {\n                //This should only happen when using addr() expressions\n                throw new Error(`Error: could not determine whether this is a taproot descriptor`);\n            }\n            const index = (0, psbt_1.updatePsbt)({\n                psbt,\n                vout,\n                ...(txHex !== undefined ? { txHex } : {}),\n                ...(txId !== undefined ? { txId } : {}),\n                ...(value !== undefined ? { value } : {}),\n                ...(isTaproot\n                    ? { tapInternalKey: this.getPayment().internalPubkey }\n                    : {}),\n                sequence: this.getSequence(),\n                locktime: this.getLockTime(),\n                keysInfo: __classPrivateFieldGet(this, _Output_expansionMap, \"f\") ? Object.values(__classPrivateFieldGet(this, _Output_expansionMap, \"f\")) : [],\n                scriptPubKey: this.getScriptPubKey(),\n                isSegwit,\n                witnessScript: this.getWitnessScript(),\n                redeemScript: this.getRedeemScript(),\n                rbf\n            });\n            const finalizer = ({ psbt, validate = true }) => this.finalizePsbtInput({ index, psbt, validate });\n            return finalizer;\n        }\n        /**\n         * Adds this output as an output of the provided `psbt` with the given\n         * value.\n         *\n         * @param psbt - The Partially Signed Bitcoin Transaction.\n         * @param value - The value for the output in satoshis.\n         */\n        updatePsbtAsOutput({ psbt, value }) {\n            psbt.addOutput({ script: this.getScriptPubKey(), value });\n        }\n        /**\n         * Finalizes a PSBT input by adding the necessary unlocking script that satisfies this `Output`'s\n         * spending conditions.\n         *\n         * 🔴 IMPORTANT 🔴\n         * It is STRONGLY RECOMMENDED to use the finalizer function returned by\n         * {@link _Internal_.Output.updatePsbtAsInput | `updatePsbtAsInput`} instead\n         * of calling this method directly.\n         * This approach eliminates the need to manage the `Output` instance and the\n         * input's index, simplifying the process.\n         *\n         * The `finalizePsbtInput` method completes a PSBT input by adding the\n         * unlocking script (`scriptWitness` or `scriptSig`) that satisfies\n         * this `Output`'s spending conditions. Bear in mind that both\n         * `scriptSig` and `scriptWitness` incorporate signatures. As such, you\n         * should complete all necessary signing operations before calling this\n         * method.\n         *\n         * For each unspent output from a previous transaction that you're\n         * referencing in a `psbt` as an input to be spent, apply this method as\n         * follows: `output.finalizePsbtInput({ index, psbt })`.\n         *\n         * It's essential to specify the exact position (or `index`) of the input in\n         * the `psbt` that references this unspent `Output`. This `index` should\n         * align with the value returned by the `updatePsbtAsInput` method.\n         * Note:\n         * The `index` corresponds to the position of the input in the `psbt`.\n         * To get this index, right after calling `updatePsbtAsInput()`, use:\n         * `index = psbt.data.inputs.length - 1`.\n         */\n        finalizePsbtInput({ index, psbt, validate = true }) {\n            if (validate &&\n                !psbt.validateSignaturesOfInput(index, signatureValidator)) {\n                throw new Error(`Error: invalid signatures on input ${index}`);\n            }\n            //An index must be passed since finding the index in the psbt cannot be\n            //done:\n            //Imagine the case where you received money twice to\n            //the same miniscript-based address. You would have the same scriptPubKey,\n            //same sequences, ... The descriptor does not store the hash of the previous\n            //transaction since it is a general Descriptor object. Indices must be kept\n            //out of the scope of this class and then passed.\n            __classPrivateFieldGet(this, _Output_instances, \"m\", _Output_assertPsbtInput).call(this, { index, psbt });\n            if (!__classPrivateFieldGet(this, _Output_miniscript, \"f\")) {\n                //Use standard finalizers\n                psbt.finalizeInput(index);\n            }\n            else {\n                const signatures = psbt.data.inputs[index]?.partialSig;\n                if (!signatures)\n                    throw new Error(`Error: cannot finalize without signatures`);\n                const scriptSatisfaction = this.getScriptSatisfaction(signatures);\n                psbt.finalizeInput(index, (0, psbt_1.finalScriptsFuncFactory)(scriptSatisfaction, __classPrivateFieldGet(this, _Output_network, \"f\")));\n            }\n        }\n        /**\n         * Decomposes the descriptor used to form this `Output` into its elemental\n         * parts. See {@link ExpansionMap ExpansionMap} for a detailed explanation.\n         */\n        expand() {\n            return {\n                ...(__classPrivateFieldGet(this, _Output_expandedExpression, \"f\") !== undefined\n                    ? { expandedExpression: __classPrivateFieldGet(this, _Output_expandedExpression, \"f\") }\n                    : {}),\n                ...(__classPrivateFieldGet(this, _Output_miniscript, \"f\") !== undefined\n                    ? { miniscript: __classPrivateFieldGet(this, _Output_miniscript, \"f\") }\n                    : {}),\n                ...(__classPrivateFieldGet(this, _Output_expandedMiniscript, \"f\") !== undefined\n                    ? { expandedMiniscript: __classPrivateFieldGet(this, _Output_expandedMiniscript, \"f\") }\n                    : {}),\n                ...(__classPrivateFieldGet(this, _Output_expansionMap, \"f\") !== undefined\n                    ? { expansionMap: __classPrivateFieldGet(this, _Output_expansionMap, \"f\") }\n                    : {})\n            };\n        }\n    }\n    _Output_payment = new WeakMap(), _Output_preimages = new WeakMap(), _Output_signersPubKeys = new WeakMap(), _Output_miniscript = new WeakMap(), _Output_witnessScript = new WeakMap(), _Output_redeemScript = new WeakMap(), _Output_isSegwit = new WeakMap(), _Output_isTaproot = new WeakMap(), _Output_expandedExpression = new WeakMap(), _Output_expandedMiniscript = new WeakMap(), _Output_expansionMap = new WeakMap(), _Output_network = new WeakMap(), _Output_instances = new WeakSet(), _Output_getTimeConstraints = function _Output_getTimeConstraints() {\n        const miniscript = __classPrivateFieldGet(this, _Output_miniscript, \"f\");\n        const preimages = __classPrivateFieldGet(this, _Output_preimages, \"f\");\n        const expandedMiniscript = __classPrivateFieldGet(this, _Output_expandedMiniscript, \"f\");\n        const expansionMap = __classPrivateFieldGet(this, _Output_expansionMap, \"f\");\n        const signersPubKeys = __classPrivateFieldGet(this, _Output_signersPubKeys, \"f\");\n        //Create a method. solvePreimages to solve them.\n        if (miniscript) {\n            if (expandedMiniscript === undefined || expansionMap === undefined)\n                throw new Error(`Error: cannot get time constraints from not expanded miniscript ${miniscript}`);\n            //We create some fakeSignatures since we may not have them yet.\n            //We only want to retrieve the nLockTime and nSequence of the satisfaction and\n            //signatures don't matter\n            const fakeSignatures = signersPubKeys.map(pubkey => ({\n                pubkey,\n                // https://transactionfee.info/charts/bitcoin-script-ecdsa-length/\n                signature: Buffer.alloc(72, 0)\n            }));\n            const { nLockTime, nSequence } = (0, miniscript_1.satisfyMiniscript)({\n                expandedMiniscript,\n                expansionMap,\n                signatures: fakeSignatures,\n                preimages\n            });\n            return { nLockTime, nSequence };\n        }\n        else\n            return undefined;\n    }, _Output_assertPsbtInput = function _Output_assertPsbtInput({ psbt, index }) {\n        const input = psbt.data.inputs[index];\n        const txInput = psbt.txInputs[index];\n        if (!input || !txInput)\n            throw new Error(`Error: invalid input or txInput`);\n        const { sequence: inputSequence, index: vout } = txInput;\n        let scriptPubKey;\n        if (input.witnessUtxo)\n            scriptPubKey = input.witnessUtxo.script;\n        else {\n            if (!input.nonWitnessUtxo)\n                throw new Error(`Error: input should have either witnessUtxo or nonWitnessUtxo`);\n            const tx = bitcoinjs_lib_1.Transaction.fromBuffer(input.nonWitnessUtxo);\n            const out = tx.outs[vout];\n            if (!out)\n                throw new Error(`Error: utxo should exist`);\n            scriptPubKey = out.script;\n        }\n        const locktime = this.getLockTime() || 0;\n        const sequence = this.getSequence();\n        //We don't know whether the user opted for RBF or not. So check that\n        //at least one of the 2 sequences matches.\n        const sequenceNoRBF = sequence !== undefined\n            ? sequence\n            : locktime === 0\n                ? 0xffffffff\n                : 0xfffffffe;\n        const sequenceRBF = sequence !== undefined ? sequence : 0xfffffffd;\n        const eqBuffers = (buf1, buf2) => buf1 instanceof Buffer && buf2 instanceof Buffer\n            ? Buffer.compare(buf1, buf2) === 0\n            : buf1 === buf2;\n        if (Buffer.compare(scriptPubKey, this.getScriptPubKey()) !== 0 ||\n            (sequenceRBF !== inputSequence && sequenceNoRBF !== inputSequence) ||\n            locktime !== psbt.locktime ||\n            !eqBuffers(this.getWitnessScript(), input.witnessScript) ||\n            !eqBuffers(this.getRedeemScript(), input.redeemScript)) {\n            throw new Error(`Error: cannot finalize psbt index ${index} since it does not correspond to this descriptor`);\n        }\n    };\n    /**\n     * @hidden\n     * @deprecated Use `Output` instead\n     */\n    class Descriptor extends Output {\n        constructor({ expression, ...rest }) {\n            super({ descriptor: expression, ...rest });\n        }\n    }\n    return {\n        // deprecated TAG must also be below so it is exported to descriptors.d.ts\n        /** @deprecated */ Descriptor,\n        Output,\n        parseKeyExpression,\n        expand,\n        ECPair,\n        BIP32\n    };\n}\nexports.DescriptorsFactory = DescriptorsFactory;\n\"use strict\";\n// Copyright (c) 2023 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ledger = exports.scriptExpressions = exports.keyExpressionLedger = exports.keyExpressionBIP32 = exports.finalizePsbt = exports.signers = exports.checksum = exports.DescriptorsFactory = void 0;\nvar descriptors_1 = require(\"./descriptors\");\nObject.defineProperty(exports, \"DescriptorsFactory\", { enumerable: true, get: function () { return descriptors_1.DescriptorsFactory; } });\nvar checksum_1 = require(\"./checksum\");\nObject.defineProperty(exports, \"checksum\", { enumerable: true, get: function () { return checksum_1.DescriptorChecksum; } });\nconst signers = __importStar(require(\"./signers\"));\nexports.signers = signers;\n/**\n * @hidden\n * To be removed in v3.0 and replaced by the version with the signature that\n * does not accept descriptors\n */\nfunction finalizePsbt({ psbt, outputs, descriptors, validate = true }) {\n    if (descriptors && outputs)\n        throw new Error(`descriptors param has been deprecated`);\n    outputs = descriptors || outputs;\n    if (!outputs)\n        throw new Error(`outputs not provided`);\n    outputs.forEach((output, inputIndex) => output.finalizePsbtInput({ index: inputIndex, psbt, validate }));\n}\nexports.finalizePsbt = finalizePsbt;\nvar keyExpressions_1 = require(\"./keyExpressions\");\nObject.defineProperty(exports, \"keyExpressionBIP32\", { enumerable: true, get: function () { return keyExpressions_1.keyExpressionBIP32; } });\nObject.defineProperty(exports, \"keyExpressionLedger\", { enumerable: true, get: function () { return keyExpressions_1.keyExpressionLedger; } });\nconst scriptExpressions = __importStar(require(\"./scriptExpressions\"));\nexports.scriptExpressions = scriptExpressions;\nconst ledger_1 = require(\"./ledger\");\nexports.ledger = {\n    getLedgerMasterFingerPrint: ledger_1.getLedgerMasterFingerPrint,\n    getLedgerXpub: ledger_1.getLedgerXpub,\n    registerLedgerWallet: ledger_1.registerLedgerWallet,\n    assertLedgerApp: ledger_1.assertLedgerApp\n};\n\"use strict\";\n// Copyright (c) 2023 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.keyExpressionBIP32 = exports.keyExpressionLedger = exports.parseKeyExpression = void 0;\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\nconst ledger_1 = require(\"./ledger\");\nconst RE = __importStar(require(\"./re\"));\nconst derivePath = (node, path) => {\n    if (typeof path !== 'string') {\n        throw new Error(`Error: invalid derivation path ${path}`);\n    }\n    const parsedPath = path.replaceAll('H', \"'\").replaceAll('h', \"'\").slice(1);\n    const splitPath = parsedPath.split('/');\n    for (const element of splitPath) {\n        const unhardened = element.endsWith(\"'\") ? element.slice(0, -1) : element;\n        if (!Number.isInteger(Number(unhardened)) ||\n            Number(unhardened) >= 0x80000000)\n            throw new Error(`Error: BIP 32 path element overflow`);\n    }\n    return node.derivePath(parsedPath);\n};\n/**\n * Parses a key expression (xpub, xprv, pubkey or wif) into {@link KeyInfo | `KeyInfo`}.\n *\n * For example, given this `keyExpression`: `\"[d34db33f/49'/0'/0']tpubDCdxmvzJ5QBjTN8oCjjyT2V58AyZvA1fkmCeZRC75QMoaHcVP2m45Bv3hmnR7ttAwkb2UNYyoXdHVt4gwBqRrJqLUU2JrM43HippxiWpHra/1/2/3/4/*\"`, this is its parsed result:\n *\n * ```javascript\n *  {\n *    keyExpression:\n *      \"[d34db33f/49'/0'/0']tpubDCdxmvzJ5QBjTN8oCjjyT2V58AyZvA1fkmCeZRC75QMoaHcVP2m45Bv3hmnR7ttAwkb2UNYyoXdHVt4gwBqRrJqLUU2JrM43HippxiWpHra/1/2/3/4/*\",\n *    keyPath: '/1/2/3/4/*',\n *    originPath: \"/49'/0'/0'\",\n *    path: \"m/49'/0'/0'/1/2/3/4/*\",\n *    // Other relevant properties of the type `KeyInfo`: `pubkey`, `ecpair` & `bip32` interfaces, `masterFingerprint`, etc.\n *  }\n * ```\n */\nfunction parseKeyExpression({ keyExpression, isSegwit, isTaproot, ECPair, BIP32, network = bitcoinjs_lib_1.networks.bitcoin }) {\n    let pubkey; //won't be computed for ranged keyExpressions\n    let ecpair;\n    let bip32;\n    let masterFingerprint;\n    let originPath;\n    let keyPath;\n    let path;\n    const isRanged = keyExpression.indexOf('*') !== -1;\n    const reKeyExp = isTaproot\n        ? RE.reTaprootKeyExp\n        : isSegwit\n            ? RE.reSegwitKeyExp\n            : RE.reNonSegwitKeyExp;\n    const rePubKey = isTaproot\n        ? RE.reTaprootPubKey\n        : isSegwit\n            ? RE.reSegwitPubKey\n            : RE.reNonSegwitPubKey;\n    //Validate the keyExpression:\n    const keyExpressions = keyExpression.match(reKeyExp);\n    if (keyExpressions === null || keyExpressions[0] !== keyExpression) {\n        throw new Error(`Error: expected a keyExpression but got ${keyExpression}`);\n    }\n    const reOriginAnchoredStart = RegExp(String.raw `^(${RE.reOrigin})?`); //starts with ^origin\n    const mOrigin = keyExpression.match(reOriginAnchoredStart);\n    if (mOrigin) {\n        const bareOrigin = mOrigin[0].replace(/[[\\]]/g, ''); //strip the \"[\" and \"]\" in [origin]\n        const reMasterFingerprintAnchoredStart = String.raw `^(${RE.reMasterFingerprint})`;\n        const mMasterFingerprint = bareOrigin.match(reMasterFingerprintAnchoredStart);\n        const masterFingerprintHex = mMasterFingerprint\n            ? mMasterFingerprint[0]\n            : '';\n        originPath = bareOrigin.replace(masterFingerprintHex, '');\n        if (masterFingerprintHex.length > 0) {\n            if (masterFingerprintHex.length !== 8)\n                throw new Error(`Error: masterFingerprint ${masterFingerprintHex} invalid for keyExpression: ${keyExpression}`);\n            masterFingerprint = Buffer.from(masterFingerprintHex, 'hex');\n        }\n    }\n    //Remove the origin (if it exists) and store result in actualKey\n    const actualKey = keyExpression.replace(reOriginAnchoredStart, '');\n    let mPubKey, mWIF, mXpubKey, mXprvKey;\n    //match pubkey:\n    if ((mPubKey = actualKey.match(RE.anchorStartAndEnd(rePubKey))) !== null) {\n        pubkey = Buffer.from(mPubKey[0], 'hex');\n        if (isTaproot && pubkey.length === 32)\n            //convert the xonly point to a compressed point assuming even parity\n            pubkey = Buffer.concat([Buffer.from([0x02]), pubkey]);\n        ecpair = ECPair.fromPublicKey(pubkey, { network });\n        //Validate the pubkey (compressed or uncompressed)\n        if (!ECPair.isPoint(pubkey) ||\n            !(pubkey.length === 33 || pubkey.length === 65)) {\n            throw new Error(`Error: invalid pubkey`);\n        }\n        //Do an extra check in case we know this pubkey refers to a segwit input\n        if (typeof isSegwit === 'boolean' &&\n            isSegwit &&\n            pubkey.length !== 33 //Inside wpkh and wsh, only compressed public keys are permitted.\n        ) {\n            throw new Error(`Error: invalid pubkey`);\n        }\n        //match WIF:\n    }\n    else if ((mWIF = actualKey.match(RE.anchorStartAndEnd(RE.reWIF))) !== null) {\n        ecpair = ECPair.fromWIF(mWIF[0], network);\n        //fromWIF will throw if the wif is not valid\n        pubkey = ecpair.publicKey;\n        //match xpub:\n    }\n    else if ((mXpubKey = actualKey.match(RE.anchorStartAndEnd(RE.reXpubKey))) !== null) {\n        const xPubKey = mXpubKey[0];\n        const xPub = xPubKey.match(RE.reXpub)?.[0];\n        if (!xPub)\n            throw new Error(`Error: xpub could not be matched`);\n        bip32 = BIP32.fromBase58(xPub, network);\n        const mPath = xPubKey.match(RE.rePath);\n        if (mPath !== null) {\n            keyPath = xPubKey.match(RE.rePath)?.[0];\n            if (!keyPath)\n                throw new Error(`Error: could not extract a path`);\n            //fromBase58 and derivePath will throw if xPub or path are not valid\n            if (!isRanged)\n                pubkey = derivePath(bip32, keyPath).publicKey;\n        }\n        else {\n            pubkey = bip32.publicKey;\n        }\n        //match xprv:\n    }\n    else if ((mXprvKey = actualKey.match(RE.anchorStartAndEnd(RE.reXprvKey))) !== null) {\n        const xPrvKey = mXprvKey[0];\n        const xPrv = xPrvKey.match(RE.reXprv)?.[0];\n        if (!xPrv)\n            throw new Error(`Error: xprv could not be matched`);\n        bip32 = BIP32.fromBase58(xPrv, network);\n        const mPath = xPrvKey.match(RE.rePath);\n        if (mPath !== null) {\n            keyPath = xPrvKey.match(RE.rePath)?.[0];\n            if (!keyPath)\n                throw new Error(`Error: could not extract a path`);\n            //fromBase58 and derivePath will throw if xPrv or path are not valid\n            if (!isRanged)\n                pubkey = derivePath(bip32, keyPath).publicKey;\n        }\n        else {\n            pubkey = bip32.publicKey;\n        }\n    }\n    else {\n        throw new Error(`Error: could not get pubkey for keyExpression ${keyExpression}`);\n    }\n    if (originPath || keyPath) {\n        path = `m${originPath ?? ''}${keyPath ?? ''}`;\n    }\n    if (pubkey !== undefined && isTaproot && pubkey.length === 33)\n        // If we get a 33-byte compressed key, drop the first byte.\n        pubkey = pubkey.slice(1, 33);\n    return {\n        keyExpression,\n        ...(pubkey !== undefined ? { pubkey } : {}),\n        ...(ecpair !== undefined ? { ecpair } : {}),\n        ...(bip32 !== undefined ? { bip32 } : {}),\n        ...(masterFingerprint !== undefined ? { masterFingerprint } : {}),\n        ...(originPath !== undefined && originPath !== '' ? { originPath } : {}),\n        ...(keyPath !== undefined && keyPath !== '' ? { keyPath } : {}),\n        ...(path !== undefined ? { path } : {})\n    };\n}\nexports.parseKeyExpression = parseKeyExpression;\nfunction assertChangeIndexKeyPath({ change, index, keyPath }) {\n    if (!((change === undefined && index === undefined) ||\n        (change !== undefined && index !== undefined)))\n        throw new Error(`Error: Pass change and index or neither`);\n    if ((change !== undefined) === (keyPath !== undefined))\n        throw new Error(`Error: Pass either change and index or a keyPath`);\n}\n/** @hidden */\nasync function keyExpressionLedger({ ledgerClient, ledgerState, ledgerManager, originPath, keyPath, change, index }) {\n    if (ledgerManager && (ledgerClient || ledgerState))\n        throw new Error(`ledgerClient and ledgerState have been deprecated`);\n    if (ledgerManager)\n        ({ ledgerClient, ledgerState } = ledgerManager);\n    if (!ledgerClient || !ledgerState)\n        throw new Error(`Could not retrieve ledgerClient or ledgerState`);\n    assertChangeIndexKeyPath({ change, index, keyPath });\n    const masterFingerprint = await (0, ledger_1.getLedgerMasterFingerPrint)({\n        ledgerClient,\n        ledgerState\n    });\n    const origin = `[${masterFingerprint.toString('hex')}${originPath}]`;\n    const xpub = await (0, ledger_1.getLedgerXpub)({ originPath, ledgerClient, ledgerState });\n    const keyRoot = `${origin}${xpub}`;\n    if (keyPath !== undefined)\n        return `${keyRoot}${keyPath}`;\n    else\n        return `${keyRoot}/${change}/${index}`;\n}\nexports.keyExpressionLedger = keyExpressionLedger;\n/**\n * Constructs a key expression string from its constituent components.\n *\n * This function essentially performs the reverse operation of\n * {@link _Internal_.ParseKeyExpression | ParseKeyExpression}. For detailed\n * explanations and examples of the terms used here, refer to\n * {@link _Internal_.ParseKeyExpression | ParseKeyExpression}.\n */\nfunction keyExpressionBIP32({ masterNode, originPath, keyPath, change, index, isPublic = true }) {\n    assertChangeIndexKeyPath({ change, index, keyPath });\n    const masterFingerprint = masterNode.fingerprint;\n    const origin = `[${masterFingerprint.toString('hex')}${originPath}]`;\n    const xpub = isPublic\n        ? masterNode.derivePath(`m${originPath}`).neutered().toBase58().toString()\n        : masterNode.derivePath(`m${originPath}`).toBase58().toString();\n    const keyRoot = `${origin}${xpub}`;\n    if (keyPath !== undefined)\n        return `${keyRoot}${keyPath}`;\n    else\n        return `${keyRoot}/${change}/${index}`;\n}\nexports.keyExpressionBIP32 = keyExpressionBIP32;\n\"use strict\";\n// Copyright (c) 2023 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ledgerPolicyFromState = exports.comparePolicies = exports.ledgerPolicyFromStandard = exports.registerLedgerWallet = exports.ledgerPolicyFromOutput = exports.ledgerPolicyFromPsbtInput = exports.getLedgerXpub = exports.getLedgerMasterFingerPrint = exports.assertLedgerApp = exports.importAndValidateLedgerBitcoin = void 0;\n/*\n * Notes on Ledger implementation:\n *\n * Ledger assumes as external all keyRoots that do not have origin information.\n *\n * Some known Ledger Limitations (based on my tests as of Febr 2023):\n *\n * 1) All keyExpressions must be expanded into @i. In other words,\n * this template is not valid:\n * wsh(and_v(v:pk(03ed0b41d808b012b3a77dd7f6a30c4180dfbcab604133d90ce7593ec7f3e4037b),and_v(v:sha256(6c60f404f8167a38fc70eaf8aa17ac351023bef86bcb9d1086a19afe95bd5333),and_v(and_v(v:pk(@0/**),v:pk(@1/**)),older(5)))))\n * (note the fixed 03ed0b41d808b012b3a77dd7f6a30c4180dfbcab604133d90ce7593ec7f3e4037b pubkey)\n *\n * 2) All elements in the keyRoot vector must be xpub-type (no xprv-type, no pubkey-type, ...)\n *\n * 3) All originPaths of the expressions in the keyRoot vector must be the same.\n * On the other hand, an empty originPath is permitted for external keys.\n *\n * 4) Since all originPaths must be the same and originPaths for the Ledger are\n * necessary, a Ledger device can only sign at most 1 key per policy and input.\n *\n * All the conditions above are checked in function ledgerPolicyFromOutput.\n */\nconst descriptors_1 = require(\"./descriptors\");\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\nconst re_1 = require(\"./re\");\n/**\n * Dynamically imports the 'ledger-bitcoin' module and, if provided, checks if `ledgerClient` is an instance of `AppClient`.\n *\n * @async\n * @param {unknown} ledgerClient - An optional parameter that, if provided, is checked to see if it's an instance of `AppClient`.\n * @throws {Error} Throws an error if `ledgerClient` is provided but is not an instance of `AppClient`.\n * @throws {Error} Throws an error if the 'ledger-bitcoin' module cannot be imported. This typically indicates that the 'ledger-bitcoin' peer dependency is not installed.\n * @returns {Promise<unknown>} Returns a promise that resolves with the entire 'ledger-bitcoin' module if it can be successfully imported. We force it to return an unknown type so that the declaration of this function won't break projects that don't use ledger-bitcoin as dependency\n *\n * @example\n *\n * importAndValidateLedgerBitcoin(ledgerClient)\n *   .then((module) => {\n *     const { AppClient, PsbtV2, DefaultWalletPolicy, WalletPolicy, DefaultDescriptorTemplate, PartialSignature } = module;\n *     // Use the imported objects...\n *   })\n *   .catch((error) => console.error(error));\n */\nasync function importAndValidateLedgerBitcoin(ledgerClient) {\n    let ledgerBitcoinModule;\n    try {\n        // Originally, the code used dynamic imports:\n        // ledgerBitcoinModule = await import('ledger-bitcoin');\n        // However, in React Native with the Metro bundler, there's an issue with\n        // recognizing dynamic imports inside try-catch blocks. For details, refer to:\n        // https://github.com/react-native-community/discussions-and-proposals/issues/120\n        // The dynamic import gets transpiled to:\n        // ledgerBitcoinModule = Promise.resolve().then(() => __importStar(require('ledger-bitcoin')));\n        // Metro bundler fails to recognize the above as conditional. Hence, it tries\n        // to require 'ledger-bitcoin' unconditionally, leading to potential errors if\n        // 'ledger-bitcoin' is not installed (given it's an optional peerDependency).\n        // To bypass this, we directly use require:\n        ledgerBitcoinModule = require('ledger-bitcoin');\n    }\n    catch (error) {\n        throw new Error('Could not import \"ledger-bitcoin\". This is a peer dependency and needs to be installed explicitly. Please run \"npm install ledger-bitcoin\" to use Ledger Hardware Wallet functionality.');\n    }\n    const { AppClient } = ledgerBitcoinModule;\n    if (ledgerClient !== undefined && !(ledgerClient instanceof AppClient)) {\n        throw new Error('Error: invalid AppClient instance');\n    }\n    return ledgerBitcoinModule;\n}\nexports.importAndValidateLedgerBitcoin = importAndValidateLedgerBitcoin;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nasync function ledgerAppInfo(transport) {\n    const r = await transport.send(0xb0, 0x01, 0x00, 0x00);\n    let i = 0;\n    const format = r[i++];\n    const nameLength = r[i++];\n    const name = r.slice(i, (i += nameLength)).toString('ascii');\n    const versionLength = r[i++];\n    const version = r.slice(i, (i += versionLength)).toString('ascii');\n    const flagLength = r[i++];\n    const flags = r.slice(i, (i += flagLength));\n    return { name, version, flags, format };\n}\n/**\n * Verifies if the Ledger device is connected, if the required Bitcoin App is opened,\n * and if the version of the app meets the minimum requirements.\n *\n * @throws Will throw an error if the Ledger device is not connected, the required\n * Bitcoin App is not opened, or if the version is below the required number.\n *\n * @returns Promise<void> - A promise that resolves if all assertions pass, or throws otherwise.\n */\nasync function assertLedgerApp({ transport, name, minVersion }) {\n    const { name: openName, version } = await ledgerAppInfo(transport);\n    if (openName !== name) {\n        throw new Error(`Open the ${name} app and try again`);\n    }\n    else {\n        const [mVmajor, mVminor, mVpatch] = minVersion.split('.').map(Number);\n        const [major, minor, patch] = version.split('.').map(Number);\n        if (mVmajor === undefined ||\n            mVminor === undefined ||\n            mVpatch === undefined) {\n            throw new Error(`Pass a minVersion using semver notation: major.minor.patch`);\n        }\n        if (major < mVmajor ||\n            (major === mVmajor && minor < mVminor) ||\n            (major === mVmajor && minor === mVminor && patch < mVpatch))\n            throw new Error(`Error: please upgrade ${name} to version ${minVersion}`);\n    }\n}\nexports.assertLedgerApp = assertLedgerApp;\nfunction isLedgerStandard({ ledgerTemplate, keyRoots, network = bitcoinjs_lib_1.networks.bitcoin }) {\n    if (keyRoots.length !== 1)\n        return false;\n    const originPath = keyRoots[0]?.match(re_1.reOriginPath)?.[1];\n    if (!originPath)\n        return false;\n    //Network is the 6th character: /44'/0'\n    if (originPath[5] !== (network === bitcoinjs_lib_1.networks.bitcoin ? '0' : '1'))\n        return false;\n    if ((ledgerTemplate === 'pkh(@0/**)' &&\n        originPath.match(/^\\/44'\\/[01]'\\/(\\d+)'$/)) ||\n        (ledgerTemplate === 'wpkh(@0/**)' &&\n            originPath.match(/^\\/84'\\/[01]'\\/(\\d+)'$/)) ||\n        (ledgerTemplate === 'sh(wpkh(@0/**))' &&\n            originPath.match(/^\\/49'\\/[01]'\\/(\\d+)'$/)) ||\n        (ledgerTemplate === 'tr(@0/**)' &&\n            originPath.match(/^\\/86'\\/[01]'\\/(\\d+)'$/)))\n        return true;\n    return false;\n}\n/** @hidden */\nasync function getLedgerMasterFingerPrint({ ledgerClient, ledgerState, ledgerManager }) {\n    if (ledgerManager && (ledgerClient || ledgerState))\n        throw new Error(`ledgerClient and ledgerState have been deprecated`);\n    if (ledgerManager)\n        ({ ledgerClient, ledgerState } = ledgerManager);\n    if (!ledgerClient || !ledgerState)\n        throw new Error(`Could not retrieve ledgerClient or ledgerState`);\n    const { AppClient } = (await importAndValidateLedgerBitcoin(ledgerClient));\n    if (!(ledgerClient instanceof AppClient))\n        throw new Error(`Error: pass a valid ledgerClient`);\n    let masterFingerprint = ledgerState.masterFingerprint;\n    if (!masterFingerprint) {\n        masterFingerprint = Buffer.from(await ledgerClient.getMasterFingerprint(), 'hex');\n        ledgerState.masterFingerprint = masterFingerprint;\n    }\n    return masterFingerprint;\n}\nexports.getLedgerMasterFingerPrint = getLedgerMasterFingerPrint;\n/** @hidden */\nasync function getLedgerXpub({ originPath, ledgerClient, ledgerState, ledgerManager }) {\n    if (ledgerManager && (ledgerClient || ledgerState))\n        throw new Error(`ledgerClient and ledgerState have been deprecated`);\n    if (ledgerManager)\n        ({ ledgerClient, ledgerState } = ledgerManager);\n    if (!ledgerClient || !ledgerState)\n        throw new Error(`Could not retrieve ledgerClient or ledgerState`);\n    const { AppClient } = (await importAndValidateLedgerBitcoin(ledgerClient));\n    if (!(ledgerClient instanceof AppClient))\n        throw new Error(`Error: pass a valid ledgerClient`);\n    if (!ledgerState.xpubs)\n        ledgerState.xpubs = {};\n    let xpub = ledgerState.xpubs[originPath];\n    if (!xpub) {\n        try {\n            //Try getting the xpub without user confirmation\n            xpub = await ledgerClient.getExtendedPubkey(`m${originPath}`, false);\n        }\n        catch (err) {\n            xpub = await ledgerClient.getExtendedPubkey(`m${originPath}`, true);\n        }\n        if (typeof xpub !== 'string')\n            throw new Error(`Error: ledgerClient did not return a valid xpub`);\n        ledgerState.xpubs[originPath] = xpub;\n    }\n    return xpub;\n}\nexports.getLedgerXpub = getLedgerXpub;\n/**\n * Checks whether there is a policy in ledgerState that the ledger\n * could use to sign this psbt input.\n *\n * It found return the policy, otherwise, return undefined\n *\n * All considerations in the header of this file are applied\n */\nasync function ledgerPolicyFromPsbtInput({ ledgerManager, psbt, index }) {\n    const { ledgerState, ledgerClient, ecc, network } = ledgerManager;\n    const { Output } = (0, descriptors_1.DescriptorsFactory)(ecc);\n    const input = psbt.data.inputs[index];\n    if (!input)\n        throw new Error(`Input numer ${index} not set.`);\n    let scriptPubKey;\n    if (input.nonWitnessUtxo) {\n        const vout = psbt.txInputs[index]?.index;\n        if (vout === undefined)\n            throw new Error(`Could not extract vout from nonWitnessUtxo for input ${index}.`);\n        scriptPubKey = bitcoinjs_lib_1.Transaction.fromBuffer(input.nonWitnessUtxo).outs[vout]\n            ?.script;\n    }\n    else if (input.witnessUtxo) {\n        scriptPubKey = input.witnessUtxo.script;\n    }\n    if (!scriptPubKey)\n        throw new Error(`Could not retrieve scriptPubKey for input ${index}.`);\n    const bip32Derivations = input.bip32Derivation;\n    if (!bip32Derivations || !bip32Derivations.length)\n        throw new Error(`Input ${index} does not contain bip32 derivations.`);\n    const ledgerMasterFingerprint = await getLedgerMasterFingerPrint({\n        ledgerManager\n    });\n    for (const bip32Derivation of bip32Derivations) {\n        //get the keyRoot and keyPath. If it matches one of our policies then\n        //we are still not sure this is the policy that must be used yet\n        //So we must use the template and the keyRoot of each policy and compute the\n        //scriptPubKey:\n        if (Buffer.compare(bip32Derivation.masterFingerprint, ledgerMasterFingerprint) === 0) {\n            // Match /m followed by n consecutive hardened levels and then 2 consecutive unhardened levels:\n            const match = bip32Derivation.path.match(/m((\\/\\d+['hH])*)(\\/\\d+\\/\\d+)?/);\n            const originPath = match ? match[1] : undefined; //n consecutive hardened levels\n            const keyPath = match ? match[3] : undefined; //2 unhardened levels or undefined\n            if (originPath && keyPath) {\n                const [, strChange, strIndex] = keyPath.split('/');\n                if (!strChange || !strIndex)\n                    throw new Error(`keyPath ${keyPath} incorrectly extracted`);\n                const change = parseInt(strChange, 10);\n                const index = parseInt(strIndex, 10);\n                const coinType = network === bitcoinjs_lib_1.networks.bitcoin ? 0 : 1;\n                //standard policy candidate. This policy will be added to the pool\n                //of policies below and check if it produces the correct scriptPubKey\n                let standardPolicy;\n                if (change === 0 || change === 1) {\n                    const standardTemplate = originPath.match(new RegExp(`^/44'/${coinType}'/(\\\\d+)'$`))\n                        ? 'pkh(@0/**)'\n                        : originPath.match(new RegExp(`^/84'/${coinType}'/(\\\\d+)'$`))\n                            ? 'wpkh(@0/**)'\n                            : originPath.match(new RegExp(`^/49'/${coinType}'/(\\\\d+)'$`))\n                                ? 'sh(wpkh(@0/**))'\n                                : originPath.match(new RegExp(`^/86'/${coinType}'/(\\\\d+)'$`))\n                                    ? 'tr(@0/**)'\n                                    : undefined;\n                    if (standardTemplate) {\n                        const xpub = await getLedgerXpub({\n                            originPath,\n                            ledgerClient,\n                            ledgerState\n                        });\n                        standardPolicy = {\n                            ledgerTemplate: standardTemplate,\n                            keyRoots: [\n                                `[${ledgerMasterFingerprint.toString('hex')}${originPath}]${xpub}`\n                            ]\n                        };\n                    }\n                }\n                const policies = [...(ledgerState.policies || [])];\n                if (standardPolicy)\n                    policies.push(standardPolicy);\n                for (const policy of policies) {\n                    //Build the descriptor from the ledgerTemplate + keyRoots\n                    //then get the scriptPubKey\n                    let descriptor = policy.ledgerTemplate;\n                    // Replace change (making sure the value in the change level for the\n                    // template of the policy meets the change in bip32Derivation):\n                    descriptor = descriptor.replace(/\\/\\*\\*/g, `/<0;1>/*`);\n                    const regExpMN = new RegExp(`/<(\\\\d+);(\\\\d+)>`, 'g');\n                    let matchMN;\n                    while (descriptor && (matchMN = regExpMN.exec(descriptor)) !== null) {\n                        const [M, N] = [\n                            parseInt(matchMN[1], 10),\n                            parseInt(matchMN[2], 10)\n                        ];\n                        if (M === change || N === change)\n                            descriptor = descriptor.replace(`/<${M};${N}>`, `/${change}`);\n                        else\n                            descriptor = undefined;\n                    }\n                    if (descriptor) {\n                        // Replace index:\n                        descriptor = descriptor.replace(/\\/\\*/g, `/${index}`);\n                        // Replace origin in reverse order to prevent\n                        // misreplacements, e.g., @10 being mistaken for @1 and leaving a 0.\n                        for (let i = policy.keyRoots.length - 1; i >= 0; i--) {\n                            const keyRoot = policy.keyRoots[i];\n                            if (!keyRoot)\n                                throw new Error(`keyRoot ${keyRoot} invalidly extracted.`);\n                            const match = keyRoot.match(/\\[([^]+)\\]/);\n                            const keyRootOrigin = match && match[1];\n                            if (keyRootOrigin) {\n                                const [, ...arrKeyRootOriginPath] = keyRootOrigin.split('/');\n                                const keyRootOriginPath = '/' + arrKeyRootOriginPath.join('/');\n                                //We check all origins to be the same even if they do not\n                                //belong to the ledger (read the header in this file)\n                                if (descriptor && keyRootOriginPath === originPath)\n                                    descriptor = descriptor.replace(new RegExp(`@${i}`, 'g'), keyRoot);\n                                else\n                                    descriptor = undefined;\n                            }\n                            else\n                                descriptor = undefined;\n                        }\n                        //verify the scriptPubKey from the input vs. the one obtained from\n                        //the policy after having filled in the keyPath in the template\n                        if (descriptor) {\n                            const policyScriptPubKey = new Output({\n                                descriptor,\n                                network\n                            }).getScriptPubKey();\n                            if (Buffer.compare(policyScriptPubKey, scriptPubKey) === 0) {\n                                return policy;\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n    return;\n}\nexports.ledgerPolicyFromPsbtInput = ledgerPolicyFromPsbtInput;\n/**\n * Given an output, it extracts its descriptor and converts it to a Ledger\n * Wallet Policy, that is, its keyRoots and template.\n *\n * keyRoots and template follow Ledger's specifications:\n * https://github.com/LedgerHQ/app-bitcoin-new/blob/develop/doc/wallet.md\n *\n * keyRoots and template are a generalization of a descriptor and serve to\n * describe internal and external addresses and any index.\n *\n * So, this function starts from a descriptor and obtains generalized Ledger\n * wallet policy.\n *\n * keyRoots is an array of strings, encoding xpub-type key expressions up to the origin.\n * F.ex.: [76223a6e/48'/1'/0'/2']tpubDE7NQymr4AFtewpAsWtnreyq9ghkzQBXpCZjWLFVRAvnbf7vya2eMTvT2fPapNqL8SuVvLQdbUbMfWLVDCZKnsEBqp6UK93QEzL8Ck23AwF\n *\n * Template encodes the descriptor script expression, where its key\n * expressions are represented using variables for each keyRoot and finished with \"/**\"\n * (for change 1 or 0 and any index). F.ex.:\n * wsh(sortedmulti(2,@0/**,@1/**)), where @0 corresponds the first element in the keyRoots array.\n *\n * If this descriptor does not contain any key that can be signed with the ledger\n * (non-matching masterFingerprint), then this function returns null.\n *\n * This function takes into account all the considerations regarding Ledger\n * policy implementation details expressed in the header of this file.\n */\nasync function ledgerPolicyFromOutput({ output, ledgerClient, ledgerState }) {\n    const expandedExpression = output.expand().expandedExpression;\n    const expansionMap = output.expand().expansionMap;\n    if (!expandedExpression || !expansionMap)\n        throw new Error(`Error: invalid output`);\n    const ledgerMasterFingerprint = await getLedgerMasterFingerPrint({\n        ledgerClient,\n        ledgerState\n    });\n    //It's important to have keys sorted in ascii order. keys\n    //are of this type: @0, @1, @2, ....  and they also appear in the expandedExpression\n    //in ascending ascii order. Note that Object.keys(expansionMap ) does not ensure\n    //that the order is respected and so we force it.\n    const allKeys = Object.keys(expansionMap).sort();\n    const ledgerKeys = allKeys.filter(key => {\n        const masterFingerprint = expansionMap[key]?.masterFingerprint;\n        return (masterFingerprint &&\n            Buffer.compare(masterFingerprint, ledgerMasterFingerprint) === 0);\n    });\n    if (ledgerKeys.length === 0)\n        return null;\n    if (ledgerKeys.length > 1)\n        throw new Error(`Error: descriptor ${expandedExpression} does not contain exactly 1 ledger key`);\n    const ledgerKey = ledgerKeys[0];\n    const masterFingerprint = expansionMap[ledgerKey].masterFingerprint;\n    const originPath = expansionMap[ledgerKey].originPath;\n    const keyPath = expansionMap[ledgerKey].keyPath;\n    const bip32 = expansionMap[ledgerKey].bip32;\n    if (!masterFingerprint || !originPath || !keyPath || !bip32) {\n        throw new Error(`Error: Ledger key expression must have a valid masterFingerprint: ${masterFingerprint}, originPath: ${originPath}, keyPath: ${keyPath} and a valid bip32 node`);\n    }\n    if (!/^\\/[01]\\/\\d+$/.test(keyPath))\n        throw new Error(`Error: key paths must be /<1;0>/index, where change is 1 or 0 and index >= 0`);\n    const keyRoots = [];\n    let ledgerTemplate = expandedExpression;\n    allKeys.forEach(key => {\n        if (key !== ledgerKey) {\n            //This block here only does data integrity assertions:\n            const otherKeyInfo = expansionMap[key];\n            if (!otherKeyInfo.bip32) {\n                throw new Error(`Error: ledger only allows xpub-type key expressions`);\n            }\n            if (otherKeyInfo.originPath) {\n                if (otherKeyInfo.originPath !== originPath) {\n                    throw new Error(`Error: all originPaths must be the same for Ledger being able to sign. On the other hand, you can leave the origin info empty for external keys: ${otherKeyInfo.originPath} !== ${originPath}`);\n                }\n            }\n            if (otherKeyInfo.keyPath !== keyPath) {\n                throw new Error(`Error: all keyPaths must be the same for Ledger being able to sign: ${otherKeyInfo.keyPath} !== ${keyPath}`);\n            }\n        }\n        ledgerTemplate = ledgerTemplate.replaceAll(key, `@${keyRoots.length}/**`);\n        const keyInfo = expansionMap[key];\n        if (keyInfo.masterFingerprint && keyInfo.originPath)\n            keyRoots.push(`[${keyInfo.masterFingerprint?.toString('hex')}${keyInfo.originPath}]${keyInfo?.bip32?.neutered().toBase58()}`);\n        else\n            keyRoots.push(`${keyInfo?.bip32?.neutered().toBase58()}`);\n    });\n    return { ledgerTemplate, keyRoots };\n}\nexports.ledgerPolicyFromOutput = ledgerPolicyFromOutput;\n/**\n * To be removed in v3.0 and replaced by a version that does not accept\n * descriptors\n * @hidden\n **/\nasync function registerLedgerWallet({ descriptor, ledgerClient, ledgerState, ledgerManager, policyName }) {\n    if (typeof descriptor !== 'string' && ledgerManager)\n        throw new Error(`Invalid usage: descriptor must be a string`);\n    if (ledgerManager && (ledgerClient || ledgerState))\n        throw new Error(`Invalid usage: either ledgerManager or ledgerClient + ledgerState`);\n    if (ledgerManager)\n        ({ ledgerClient, ledgerState } = ledgerManager);\n    if (!ledgerClient)\n        throw new Error(`ledgerManager not provided`);\n    if (!ledgerState)\n        throw new Error(`ledgerManager not provided`);\n    const { WalletPolicy, AppClient } = (await importAndValidateLedgerBitcoin(ledgerClient));\n    if (!(ledgerClient instanceof AppClient))\n        throw new Error(`Error: pass a valid ledgerClient`);\n    let output;\n    if (typeof descriptor === 'string') {\n        if (!ledgerManager)\n            throw new Error(`ledgerManager not provided`);\n        const { Output } = (0, descriptors_1.DescriptorsFactory)(ledgerManager.ecc);\n        output = new Output({\n            descriptor,\n            ...(descriptor.includes('*') ? { index: 0 } : {}),\n            network: ledgerManager.network\n        });\n    }\n    else\n        output = descriptor;\n    if (await ledgerPolicyFromStandard({ output, ledgerClient, ledgerState }))\n        return;\n    const result = await ledgerPolicyFromOutput({\n        output,\n        ledgerClient,\n        ledgerState\n    });\n    if (await ledgerPolicyFromStandard({ output, ledgerClient, ledgerState }))\n        return;\n    if (!result)\n        throw new Error(`Error: output does not have a ledger input`);\n    const { ledgerTemplate, keyRoots } = result;\n    if (!ledgerState.policies)\n        ledgerState.policies = [];\n    let walletPolicy, policyHmac;\n    //Search in ledgerState first\n    const policy = await ledgerPolicyFromState({\n        output,\n        ledgerClient,\n        ledgerState\n    });\n    if (policy) {\n        if (policy.policyName !== policyName)\n            throw new Error(`Error: policy was already registered with a different name: ${policy.policyName}`);\n        //It already existed. No need to register it again.\n    }\n    else {\n        walletPolicy = new WalletPolicy(policyName, ledgerTemplate, keyRoots);\n        let policyId;\n        [policyId, policyHmac] = await ledgerClient.registerWallet(walletPolicy);\n        const policy = {\n            policyName,\n            ledgerTemplate,\n            keyRoots,\n            policyId,\n            policyHmac\n        };\n        ledgerState.policies.push(policy);\n    }\n}\nexports.registerLedgerWallet = registerLedgerWallet;\n/**\n * Retrieve a standard ledger policy or null if it does correspond.\n **/\nasync function ledgerPolicyFromStandard({ output, ledgerClient, ledgerState }) {\n    const result = await ledgerPolicyFromOutput({\n        output,\n        ledgerClient,\n        ledgerState\n    });\n    if (!result)\n        throw new Error(`Error: descriptor does not have a ledger input`);\n    const { ledgerTemplate, keyRoots } = result;\n    if (isLedgerStandard({\n        ledgerTemplate,\n        keyRoots,\n        network: output.getNetwork()\n    }))\n        return { ledgerTemplate, keyRoots };\n    return null;\n}\nexports.ledgerPolicyFromStandard = ledgerPolicyFromStandard;\nfunction compareKeyRoots(arr1, arr2) {\n    if (arr1.length !== arr2.length) {\n        return false;\n    }\n    for (let i = 0; i < arr1.length; i++) {\n        if (arr1[i] !== arr2[i]) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction comparePolicies(policyA, policyB) {\n    return (compareKeyRoots(policyA.keyRoots, policyB.keyRoots) &&\n        policyA.ledgerTemplate === policyB.ledgerTemplate);\n}\nexports.comparePolicies = comparePolicies;\n/**\n * Retrieve a ledger policy from ledgerState or null if it does not exist yet.\n **/\nasync function ledgerPolicyFromState({ output, ledgerClient, ledgerState }) {\n    const result = await ledgerPolicyFromOutput({\n        output,\n        ledgerClient,\n        ledgerState\n    });\n    if (!result)\n        throw new Error(`Error: output does not have a ledger input`);\n    const { ledgerTemplate, keyRoots } = result;\n    if (!ledgerState.policies)\n        ledgerState.policies = [];\n    //Search in ledgerState:\n    const policies = ledgerState.policies.filter(policy => comparePolicies(policy, { ledgerTemplate, keyRoots }));\n    if (policies.length > 1)\n        throw new Error(`Error: duplicated policy`);\n    if (policies.length === 1) {\n        return policies[0];\n    }\n    else {\n        return null;\n    }\n}\nexports.ledgerPolicyFromState = ledgerPolicyFromState;\n\"use strict\";\n// Copyright (c) 2023 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.numberEncodeAsm = exports.satisfyMiniscript = exports.miniscript2Script = exports.expandMiniscript = void 0;\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\nconst keyExpressions_1 = require(\"./keyExpressions\");\nconst RE = __importStar(require(\"./re\"));\nconst miniscript_1 = require(\"@bitcoinerlab/miniscript\");\n/**\n * Expand a miniscript to a generalized form using variables instead of key\n * expressions. Variables will be of this form: @0, @1, ...\n * This is done so that it can be compiled with compileMiniscript and\n * satisfied with satisfier.\n * Also compute pubkeys from descriptors to use them later.\n */\nfunction expandMiniscript({ miniscript, isSegwit, isTaproot, network = bitcoinjs_lib_1.networks.bitcoin, ECPair, BIP32 }) {\n    if (isTaproot)\n        throw new Error('Taproot miniscript not yet supported.');\n    const reKeyExp = isTaproot\n        ? RE.reTaprootKeyExp\n        : isSegwit\n            ? RE.reSegwitKeyExp\n            : RE.reNonSegwitKeyExp;\n    const expansionMap = {};\n    const expandedMiniscript = miniscript.replace(RegExp(reKeyExp, 'g'), (keyExpression) => {\n        const key = '@' + Object.keys(expansionMap).length;\n        expansionMap[key] = (0, keyExpressions_1.parseKeyExpression)({\n            keyExpression,\n            isSegwit,\n            network,\n            ECPair,\n            BIP32\n        });\n        return key;\n    });\n    //Do some assertions. Miniscript must not have duplicate keys, also all\n    //keyExpressions must produce a valid pubkey (unless it's ranged and we want\n    //to expand a generalized form, then we don't check)\n    const pubkeysHex = Object.values(expansionMap)\n        .filter(keyInfo => keyInfo.keyExpression.indexOf('*') === -1)\n        .map(keyInfo => {\n        if (!keyInfo.pubkey)\n            throw new Error(`Error: keyExpression ${keyInfo.keyExpression} does not have a pubkey`);\n        return keyInfo.pubkey.toString('hex');\n    });\n    if (new Set(pubkeysHex).size !== pubkeysHex.length) {\n        throw new Error(`Error: miniscript ${miniscript} is not sane: contains duplicate public keys.`);\n    }\n    return { expandedMiniscript, expansionMap };\n}\nexports.expandMiniscript = expandMiniscript;\n/**\n * Particularize an expanded ASM expression using the variables in\n * expansionMap.\n * This is the kind of the opposite to what expandMiniscript does.\n * Signatures and preimages are already subsituted by the satisfier calling\n * this function.\n */\nfunction substituteAsm({ expandedAsm, expansionMap }) {\n    //Replace back variables into the pubkeys previously computed.\n    let asm = Object.keys(expansionMap).reduce((accAsm, key) => {\n        const pubkey = expansionMap[key]?.pubkey;\n        if (!pubkey) {\n            throw new Error(`Error: invalid expansionMap for ${key}`);\n        }\n        return accAsm\n            .replaceAll(`<${key}>`, `<${pubkey.toString('hex')}>`)\n            .replaceAll(`<HASH160(${key})>`, `<${bitcoinjs_lib_1.crypto.hash160(pubkey).toString('hex')}>`);\n    }, expandedAsm);\n    //Now clean it and prepare it so that fromASM can be called:\n    asm = asm\n        .trim()\n        //Replace one or more consecutive whitespace characters (spaces, tabs,\n        //or line breaks) with a single space.\n        .replace(/\\s+/g, ' ')\n        //Now encode numbers to little endian hex. Note that numbers are not\n        //enclosed in <>, since <> represents hex code already encoded.\n        //The regex below will match one or more digits within a string,\n        //except if the sequence is surrounded by \"<\" and \">\"\n        .replace(/(<\\d+>)|\\b\\d+\\b/g, match => match.startsWith('<') ? match : numberEncodeAsm(Number(match)))\n        //we don't have numbers anymore, now it's safe to remove < and > since we\n        //know that every remaining is either an op_code or a hex encoded number\n        .replace(/[<>]/g, '');\n    return asm;\n}\nfunction miniscript2Script({ expandedMiniscript, expansionMap }) {\n    const compiled = (0, miniscript_1.compileMiniscript)(expandedMiniscript);\n    if (compiled.issane !== true) {\n        throw new Error(`Error: Miniscript ${expandedMiniscript} is not sane`);\n    }\n    return bitcoinjs_lib_1.script.fromASM(substituteAsm({ expandedAsm: compiled.asm, expansionMap }));\n}\nexports.miniscript2Script = miniscript2Script;\n/**\n * Assumptions:\n * The attacker does not have access to any of the private keys of public keys\n * that participate in the Script.\n *\n * The attacker only has access to hash preimages that honest users have access\n * to as well.\n *\n * Pass timeConstraints to search for the first solution with this nLockTime and\n * nSequence. Throw if no solution is possible using these constraints.\n *\n * Don't pass timeConstraints (this is the default) if you want to get the\n * smallest size solution altogether.\n *\n * If a solution is not found this function throws.\n */\nfunction satisfyMiniscript({ expandedMiniscript, expansionMap, signatures = [], preimages = [], timeConstraints }) {\n    //convert 'sha256(6c...33)' to: { ['<sha256_preimage(6c...33)>']: '10...5f'}\n    const preimageMap = {};\n    preimages.forEach(preimage => {\n        preimageMap['<' + preimage.digest.replace('(', '_preimage(') + '>'] =\n            '<' + preimage.preimage + '>';\n    });\n    //convert the pubkeys in signatures into [{['<sig(@0)>']: '30450221'}, ...]\n    //get the keyExpressions: @0, @1 from the keys in expansionMap\n    const expandedSignatureMap = {};\n    signatures.forEach(signature => {\n        const pubkeyHex = signature.pubkey.toString('hex');\n        const keyExpression = Object.keys(expansionMap).find(k => expansionMap[k]?.pubkey?.toString('hex') === pubkeyHex);\n        expandedSignatureMap['<sig(' + keyExpression + ')>'] =\n            '<' + signature.signature.toString('hex') + '>';\n    });\n    const expandedKnownsMap = { ...preimageMap, ...expandedSignatureMap };\n    const knowns = Object.keys(expandedKnownsMap);\n    //satisfier verifies again internally whether expandedKnownsMap with given knowns is sane\n    const { nonMalleableSats } = (0, miniscript_1.satisfier)(expandedMiniscript, { knowns });\n    if (!Array.isArray(nonMalleableSats) || !nonMalleableSats[0])\n        throw new Error(`Error: unresolvable miniscript ${expandedMiniscript}`);\n    let sat;\n    if (!timeConstraints) {\n        sat = nonMalleableSats[0];\n    }\n    else {\n        sat = nonMalleableSats.find(nonMalleableSat => nonMalleableSat.nSequence === timeConstraints.nSequence &&\n            nonMalleableSat.nLockTime === timeConstraints.nLockTime);\n        if (sat === undefined) {\n            throw new Error(`Error: unresolvable miniscript ${expandedMiniscript}. Could not find solutions for sequence ${timeConstraints.nSequence} & locktime=${timeConstraints.nLockTime}. Signatures are applied to a hash that depends on sequence and locktime. Did you provide all the signatures wrt the signers keys declared and include all preimages?`);\n        }\n    }\n    //substitute signatures and preimages:\n    let expandedAsm = sat.asm;\n    //replace in expandedAsm all the <sig(@0)> and <sha256_preimage(6c...33)>\n    //to <304...01> and <107...5f> ...\n    for (const search in expandedKnownsMap) {\n        const replace = expandedKnownsMap[search];\n        if (!replace || replace === '<>')\n            throw new Error(`Error: invalid expandedKnownsMap`);\n        expandedAsm = expandedAsm.replaceAll(search, replace);\n    }\n    const scriptSatisfaction = bitcoinjs_lib_1.script.fromASM(substituteAsm({ expandedAsm, expansionMap }));\n    return {\n        scriptSatisfaction,\n        nLockTime: sat.nLockTime,\n        nSequence: sat.nSequence\n    };\n}\nexports.satisfyMiniscript = satisfyMiniscript;\n/**\n *\n * Use this function instead of bitcoinjs-lib's equivalent `script.number.encode`\n * when encoding numbers to be compiled with `fromASM` to avoid problems.\n *\n * Motivation:\n *\n * Numbers in Bitcoin assembly code are represented in hex and in Little Endian.\n * Decimal: 32766 - Big endian: 0x7FFE - Little Endian: 0xFE7F.\n *\n * This function takes an integer and encodes it so that bitcoinjs-lib `fromASM`\n * can compile it. This is basically what bitcoinjs-lib's `script.number.encode`\n * does.\n *\n * Note that `fromASM` already converts integers from 1 to 16 to\n * OP_1 ... OP_16 {@link https://github.com/bitcoinjs/bitcoinjs-lib/blob/59b21162a2c4645c64271ca004c7a3755a3d72fb/src/script.js#L33 here}.\n * This is done in Bitcoin to save some bits.\n *\n * Neither this function nor `script.number.encode` convert numbers to\n * their op code equivalent since this is done later in `fromASM`.\n *\n * Both functions simply convert numbers to Little Endian.\n *\n * However, the `0` number is an edge case that we specially handle with this\n * function.\n *\n * bitcoinjs-lib's `bscript.number.encode(0)` produces an empty Buffer.\n * This is what the Bitcoin interpreter does and it is what `script.number.encode` was\n * implemented to do.\n *\n * The problem is `bscript.number.encode(0).toString('hex')` produces an\n * empty string and thus it should not be used to serialize number zero before `fromASM`.\n *\n * A zero should produce the OP_0 ASM symbolic code (corresponding to a `0` when\n * compiled).\n *\n * So, this function will produce a string in hex format in Little Endian\n * encoding for integers not equal to `0` and it will return `OP_0` for `0`.\n *\n * Read more about the this {@link https://github.com/bitcoinjs/bitcoinjs-lib/issues/1799#issuecomment-1122591738 here}.\n *\n * Use it in combination with `fromASM` like this:\n *\n * ```javascript\n * //To produce \"0 1 OP_ADD\":\n * fromASM(\n * `${numberEncodeAsm(0)} ${numberEncodeAsm(1)} OP_ADD`\n *   .trim().replace(/\\s+/g, ' ')\n * )\n * ```\n *\n * @param {number} number An integer.\n * @returns {string} Returns `\"OP_0\"` for `number === 0` and a hex string representing other numbers in Little Endian encoding.\n */\nfunction numberEncodeAsm(number) {\n    if (Number.isSafeInteger(number) === false) {\n        throw new Error(`Error: invalid number ${number}`);\n    }\n    if (number === 0) {\n        return 'OP_0';\n    }\n    else\n        return bitcoinjs_lib_1.script.number.encode(number).toString('hex');\n}\nexports.numberEncodeAsm = numberEncodeAsm;\n\"use strict\";\n// Copyright (c) 2025 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updatePsbt = exports.finalScriptsFuncFactory = void 0;\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\nconst varuint_bitcoin_1 = require(\"varuint-bitcoin\");\nfunction reverseBuffer(buffer) {\n    if (buffer.length < 1)\n        return buffer;\n    let j = buffer.length - 1;\n    let tmp = 0;\n    for (let i = 0; i < buffer.length / 2; i++) {\n        tmp = buffer[i];\n        buffer[i] = buffer[j];\n        buffer[j] = tmp;\n        j--;\n    }\n    return buffer;\n}\nfunction witnessStackToScriptWitness(witness) {\n    let buffer = Buffer.allocUnsafe(0);\n    function writeSlice(slice) {\n        buffer = Buffer.concat([buffer, Buffer.from(slice)]);\n    }\n    function writeVarInt(i) {\n        const currentLen = buffer.length;\n        const varintLen = (0, varuint_bitcoin_1.encodingLength)(i);\n        buffer = Buffer.concat([buffer, Buffer.allocUnsafe(varintLen)]);\n        (0, varuint_bitcoin_1.encode)(i, buffer, currentLen);\n    }\n    function writeVarSlice(slice) {\n        writeVarInt(slice.length);\n        writeSlice(slice);\n    }\n    function writeVector(vector) {\n        writeVarInt(vector.length);\n        vector.forEach(writeVarSlice);\n    }\n    writeVector(witness);\n    return buffer;\n}\nfunction finalScriptsFuncFactory(scriptSatisfaction, network) {\n    const finalScriptsFunc = (_index, _input, lockingScript /*witnessScript or redeemScript*/, isSegwit, isP2SH, _isP2WSH) => {\n        let finalScriptWitness;\n        let finalScriptSig;\n        //p2wsh\n        if (isSegwit && !isP2SH) {\n            const payment = bitcoinjs_lib_1.payments.p2wsh({\n                redeem: { input: scriptSatisfaction, output: lockingScript },\n                network\n            });\n            if (!payment.witness)\n                throw new Error(`Error: p2wsh failed producing a witness`);\n            finalScriptWitness = witnessStackToScriptWitness(payment.witness);\n        }\n        //p2sh-p2wsh\n        else if (isSegwit && isP2SH) {\n            const payment = bitcoinjs_lib_1.payments.p2sh({\n                redeem: bitcoinjs_lib_1.payments.p2wsh({\n                    redeem: { input: scriptSatisfaction, output: lockingScript },\n                    network\n                }),\n                network\n            });\n            if (!payment.witness)\n                throw new Error(`Error: p2sh-p2wsh failed producing a witness`);\n            finalScriptWitness = witnessStackToScriptWitness(payment.witness);\n            finalScriptSig = payment.input;\n        }\n        //p2sh\n        else {\n            finalScriptSig = bitcoinjs_lib_1.payments.p2sh({\n                redeem: { input: scriptSatisfaction, output: lockingScript },\n                network\n            }).input;\n        }\n        return {\n            finalScriptWitness,\n            finalScriptSig\n        };\n    };\n    return finalScriptsFunc;\n}\nexports.finalScriptsFuncFactory = finalScriptsFuncFactory;\n/**\n * Important: Read comments on descriptor.updatePsbt regarding not passing txHex\n */\nfunction updatePsbt({ psbt, vout, txHex, txId, value, sequence, locktime, keysInfo, scriptPubKey, isSegwit, tapInternalKey, witnessScript, redeemScript, rbf }) {\n    //Some data-sanity checks:\n    if (sequence !== undefined && rbf && sequence > 0xfffffffd)\n        throw new Error(`Error: incompatible sequence and rbf settings`);\n    if (!isSegwit && txHex === undefined)\n        throw new Error(`Error: txHex is mandatory for Non-Segwit inputs`);\n    if (isSegwit &&\n        txHex === undefined &&\n        (txId === undefined || value === undefined))\n        throw new Error(`Error: pass txHex or txId+value for Segwit inputs`);\n    if (txHex !== undefined) {\n        const tx = bitcoinjs_lib_1.Transaction.fromHex(txHex);\n        const out = tx?.outs?.[vout];\n        if (!out)\n            throw new Error(`Error: tx ${txHex} does not have vout ${vout}`);\n        const outputScript = out.script;\n        if (!outputScript)\n            throw new Error(`Error: could not extract outputScript for txHex ${txHex} and vout ${vout}`);\n        if (Buffer.compare(outputScript, scriptPubKey) !== 0)\n            throw new Error(`Error: txHex ${txHex} for vout ${vout} does not correspond to scriptPubKey ${scriptPubKey}`);\n        if (txId !== undefined) {\n            if (tx.getId() !== txId)\n                throw new Error(`Error: txId for ${txHex} and vout ${vout} does not correspond to ${txId}`);\n        }\n        else {\n            txId = tx.getId();\n        }\n        if (value !== undefined) {\n            if (out.value !== value)\n                throw new Error(`Error: value for ${txHex} and vout ${vout} does not correspond to ${value}`);\n        }\n        else {\n            value = out.value;\n        }\n    }\n    if (txId === undefined || !value)\n        throw new Error(`Error: txHex+vout required. Alternatively, but ONLY for Segwit inputs, txId+value can also be passed.`);\n    if (locktime) {\n        if (psbt.locktime && psbt.locktime !== locktime)\n            throw new Error(`Error: transaction locktime was already set with a different value: ${locktime} != ${psbt.locktime}`);\n        // nLockTime only works if at least one of the transaction inputs has an\n        // nSequence value that is below 0xffffffff. Let's make sure that at least\n        // this input's sequence < 0xffffffff\n        if (sequence === undefined) {\n            //NOTE: if sequence is undefined, bitcoinjs-lib uses 0xffffffff as default\n            sequence = rbf ? 0xfffffffd : 0xfffffffe;\n        }\n        else if (sequence > 0xfffffffe) {\n            throw new Error(`Error: incompatible sequence: ${sequence} and locktime: ${locktime}`);\n        }\n        if (sequence === undefined && rbf)\n            sequence = 0xfffffffd;\n        psbt.setLocktime(locktime);\n    }\n    else {\n        if (sequence === undefined) {\n            if (rbf)\n                sequence = 0xfffffffd;\n            else\n                sequence = 0xffffffff;\n        }\n    }\n    const input = {\n        hash: reverseBuffer(Buffer.from(txId, 'hex')),\n        index: vout\n    };\n    if (txHex !== undefined) {\n        input.nonWitnessUtxo = bitcoinjs_lib_1.Transaction.fromHex(txHex).toBuffer();\n    }\n    if (tapInternalKey) {\n        //Taproot\n        const tapBip32Derivation = keysInfo\n            .filter((keyInfo) => keyInfo.pubkey && keyInfo.masterFingerprint && keyInfo.path)\n            .map((keyInfo) => {\n            const pubkey = keyInfo.pubkey;\n            if (!pubkey)\n                throw new Error(`key ${keyInfo.keyExpression} missing pubkey`);\n            return {\n                masterFingerprint: keyInfo.masterFingerprint,\n                pubkey,\n                path: keyInfo.path,\n                leafHashes: [] // TODO: Empty array for tr(KEY) taproot key spend - this is the only type currently supported\n            };\n        });\n        if (tapBip32Derivation.length)\n            input.tapBip32Derivation = tapBip32Derivation;\n        input.tapInternalKey = tapInternalKey;\n        //TODO: currently only single-key taproot supported.\n        //https://github.com/bitcoinjs/bitcoinjs-lib/blob/6ba8bb3ce20ba533eeaba6939cfc2891576d9969/test/integration/taproot.spec.ts#L243\n        if (tapBip32Derivation.length > 1)\n            throw new Error('Only single key taproot inputs are currently supported');\n    }\n    else {\n        const bip32Derivation = keysInfo\n            .filter((keyInfo) => keyInfo.pubkey && keyInfo.masterFingerprint && keyInfo.path)\n            .map((keyInfo) => {\n            const pubkey = keyInfo.pubkey;\n            if (!pubkey)\n                throw new Error(`key ${keyInfo.keyExpression} missing pubkey`);\n            return {\n                masterFingerprint: keyInfo.masterFingerprint,\n                pubkey,\n                path: keyInfo.path\n            };\n        });\n        if (bip32Derivation.length)\n            input.bip32Derivation = bip32Derivation;\n    }\n    if (isSegwit && txHex !== undefined) {\n        //There's no need to put both witnessUtxo and nonWitnessUtxo\n        input.witnessUtxo = { script: scriptPubKey, value };\n    }\n    if (sequence !== undefined)\n        input.sequence = sequence;\n    if (witnessScript)\n        input.witnessScript = witnessScript;\n    if (redeemScript)\n        input.redeemScript = redeemScript;\n    psbt.addInput(input);\n    return psbt.data.inputs.length - 1;\n}\nexports.updatePsbt = updatePsbt;\n\"use strict\";\n// Copyright (c) 2025 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reWshMiniscriptAnchored = exports.reShWshMiniscriptAnchored = exports.reShMiniscriptAnchored = exports.reTrSingleKeyAnchored = exports.reShWpkhAnchored = exports.reWpkhAnchored = exports.rePkhAnchored = exports.reAddrAnchored = exports.rePkAnchored = exports.anchorStartAndEnd = exports.reTaprootKeyExp = exports.reSegwitKeyExp = exports.reNonSegwitKeyExp = exports.reXprvKey = exports.reXpubKey = exports.rePath = exports.reXprv = exports.reXpub = exports.reWIF = exports.reTaprootPubKey = exports.reSegwitPubKey = exports.reNonSegwitPubKey = exports.reChecksum = exports.reOrigin = exports.reMasterFingerprint = exports.reOriginPath = void 0;\nconst checksum_1 = require(\"./checksum\");\n//Regular expressions cheat sheet:\n//https://www.keycdn.com/support/regex-cheat-sheet\n//hardened characters\nconst reHardened = String.raw `(['hH])`;\n//a level is a series of integers followed (optional) by a hardener char\nconst reLevel = String.raw `(\\d+${reHardened}?)`;\n//a path component is a level followed by a slash \"/\" char\nconst rePathComponent = String.raw `(${reLevel}\\/)`;\n//A path formed by a series of path components that can be hardened: /2'/23H/23\nexports.reOriginPath = String.raw `(\\/${rePathComponent}*${reLevel})`; //The \"*\" means: \"match 0 or more of the previous\"\n//an origin is something like this: [d34db33f/44'/0'/0'] where the path is optional. The fingerPrint is 8 chars hex\nexports.reMasterFingerprint = String.raw `[0-9a-fA-F]{8}`;\nexports.reOrigin = String.raw `(\\[${exports.reMasterFingerprint}(${exports.reOriginPath})?\\])`;\nexports.reChecksum = String.raw `(#[${checksum_1.CHECKSUM_CHARSET}]{8})`;\n//Something like this: 0252972572d465d016d4c501887b8df303eee3ed602c056b1eb09260dfa0da0ab2\n//as explained here: github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#reference\nconst reCompressedPubKey = String.raw `((02|03)[0-9a-fA-F]{64})`;\nconst reUncompressedPubKey = String.raw `(04[0-9a-fA-F]{128})`;\nconst reXOnlyPubKey = String.raw `([0-9a-fA-F]{64})`;\nexports.reNonSegwitPubKey = String.raw `(${reCompressedPubKey}|${reUncompressedPubKey})`;\nexports.reSegwitPubKey = String.raw `(${reCompressedPubKey})`;\nexports.reTaprootPubKey = String.raw `(${reCompressedPubKey}|${reXOnlyPubKey})`;\n//https://learnmeabitcoin.com/technical/wif\n//5, K, L for mainnet, 5: uncompressed, {K, L}: compressed\n//c, 9, testnet, c: compressed, 9: uncompressed\nexports.reWIF = String.raw `([5KLc9][1-9A-HJ-NP-Za-km-z]{50,51})`;\n//x for mainnet, t for testnet\nexports.reXpub = String.raw `([xXtT]pub[1-9A-HJ-NP-Za-km-z]{79,108})`;\nexports.reXprv = String.raw `([xXtT]prv[1-9A-HJ-NP-Za-km-z]{79,108})`;\n//reRangeLevel is like reLevel but using a wildcard \"*\"\nconst reRangeLevel = String.raw `(\\*(${reHardened})?)`;\n//A path can be finished with stuff like this: /23 or /23h or /* or /*'\nexports.rePath = String.raw `(\\/(${rePathComponent})*(${reRangeLevel}|${reLevel}))`;\n//rePath is optional (note the \"zero\"): Followed by zero or more /NUM or /NUM' path elements to indicate unhardened or hardened derivation steps between the fingerprint and the key or xpub/xprv root that follows\nexports.reXpubKey = String.raw `(${exports.reXpub})(${exports.rePath})?`;\nexports.reXprvKey = String.raw `(${exports.reXprv})(${exports.rePath})?`;\n//actualKey is the keyExpression without optional origin\nconst reNonSegwitActualKey = String.raw `(${exports.reXpubKey}|${exports.reXprvKey}|${exports.reNonSegwitPubKey}|${exports.reWIF})`;\nconst reSegwitActualKey = String.raw `(${exports.reXpubKey}|${exports.reXprvKey}|${exports.reSegwitPubKey}|${exports.reWIF})`;\nconst reTaprootActualKey = String.raw `(${exports.reXpubKey}|${exports.reXprvKey}|${exports.reTaprootPubKey}|${exports.reWIF})`;\n//reOrigin is optional: Optionally, key origin information, consisting of:\n//Matches a key expression: wif, xpub, xprv or pubkey:\nexports.reNonSegwitKeyExp = String.raw `(${exports.reOrigin})?(${reNonSegwitActualKey})`;\nexports.reSegwitKeyExp = String.raw `(${exports.reOrigin})?(${reSegwitActualKey})`;\nexports.reTaprootKeyExp = String.raw `(${exports.reOrigin})?(${reTaprootActualKey})`;\nconst rePk = String.raw `pk\\((.*?)\\)`; //Matches anything. We assert later in the code that the pubkey is valid.\nconst reAddr = String.raw `addr\\((.*?)\\)`; //Matches anything. We assert later in the code that the address is valid.\nconst rePkh = String.raw `pkh\\(${exports.reNonSegwitKeyExp}\\)`;\nconst reWpkh = String.raw `wpkh\\(${exports.reSegwitKeyExp}\\)`;\nconst reShWpkh = String.raw `sh\\(wpkh\\(${exports.reSegwitKeyExp}\\)\\)`;\nconst reTrSingleKey = String.raw `tr\\(${exports.reTaprootKeyExp}\\)`; // TODO: tr(KEY,TREE) not yet supported. TrSingleKey used for tr(KEY)\nconst reMiniscript = String.raw `(.*?)`; //Matches anything. We assert later in the code that miniscripts are valid and sane.\n//RegExp makers:\nconst makeReSh = (re) => String.raw `sh\\(${re}\\)`;\nconst makeReWsh = (re) => String.raw `wsh\\(${re}\\)`;\nconst makeReShWsh = (re) => makeReSh(makeReWsh(re));\nconst anchorStartAndEnd = (re) => String.raw `^${re}$`; //starts and finishes like re (not composable)\nexports.anchorStartAndEnd = anchorStartAndEnd;\nconst composeChecksum = (re) => String.raw `${re}(${exports.reChecksum})?`; //it's optional (note the \"?\")\nexports.rePkAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(rePk));\nexports.reAddrAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(reAddr));\nexports.rePkhAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(rePkh));\nexports.reWpkhAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(reWpkh));\nexports.reShWpkhAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(reShWpkh));\nexports.reTrSingleKeyAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(reTrSingleKey));\nexports.reShMiniscriptAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(makeReSh(reMiniscript)));\nexports.reShWshMiniscriptAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(makeReShWsh(reMiniscript)));\nexports.reWshMiniscriptAnchored = (0, exports.anchorStartAndEnd)(composeChecksum(makeReWsh(reMiniscript)));\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.trLedger = exports.wpkhLedger = exports.shWpkhLedger = exports.pkhLedger = exports.trBIP32 = exports.wpkhBIP32 = exports.shWpkhBIP32 = exports.pkhBIP32 = void 0;\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\nconst keyExpressions_1 = require(\"./keyExpressions\");\nfunction assertStandardKeyPath(keyPath) {\n    // Regular expression to match \"/change/index\" or \"/change/*\" format\n    const regex = /^\\/[01]\\/(\\d+|\\*)$/;\n    if (!regex.test(keyPath)) {\n        throw new Error(\"Error: Key path must be in the format '/change/index', where change is either 0 or 1 and index is a non-negative integer.\");\n    }\n}\nfunction standardExpressionsBIP32Maker(purpose, scriptTemplate) {\n    /**\n     * Computes the standard descriptor based on given parameters.\n     *\n     * You can define the output location either by:\n     * - Providing the full `keyPath` (e.g., \"/0/2\").\n     * OR\n     * - Specifying the `change` and `index` values separately (e.g., `{change:0, index:2}`).\n     *\n     * For ranged indexing, the `index` can be set as a wildcard '*'. For example:\n     * - `keyPath=\"/0/*\"`\n     * OR\n     * - `{change:0, index:'*'}`.\n     */\n    function standardScriptExpressionBIP32({ masterNode, network = bitcoinjs_lib_1.networks.bitcoin, keyPath, account, change, index, isPublic = true }) {\n        const originPath = `/${purpose}'/${network === bitcoinjs_lib_1.networks.bitcoin ? 0 : 1}'/${account}'`;\n        if (keyPath !== undefined)\n            assertStandardKeyPath(keyPath);\n        const keyExpression = (0, keyExpressions_1.keyExpressionBIP32)({\n            masterNode,\n            originPath,\n            keyPath,\n            change,\n            index,\n            isPublic\n        });\n        return scriptTemplate.replace('KEYEXPRESSION', keyExpression);\n    }\n    return standardScriptExpressionBIP32;\n}\nexports.pkhBIP32 = standardExpressionsBIP32Maker(44, 'pkh(KEYEXPRESSION)');\nexports.shWpkhBIP32 = standardExpressionsBIP32Maker(49, 'sh(wpkh(KEYEXPRESSION))');\nexports.wpkhBIP32 = standardExpressionsBIP32Maker(84, 'wpkh(KEYEXPRESSION)');\nexports.trBIP32 = standardExpressionsBIP32Maker(86, 'tr(KEYEXPRESSION)');\nfunction standardExpressionsLedgerMaker(purpose, scriptTemplate) {\n    /** @hidden */\n    async function standardScriptExpressionLedger({ ledgerClient, ledgerState, ledgerManager, network, account, keyPath, change, index }) {\n        if (ledgerManager && (ledgerClient || ledgerState))\n            throw new Error(`ledgerClient and ledgerState have been deprecated`);\n        if (ledgerManager && network)\n            throw new Error(`ledgerManager already includes the network object`);\n        if (!ledgerManager && !network)\n            network = bitcoinjs_lib_1.networks.bitcoin;\n        if (ledgerManager)\n            ({ ledgerClient, ledgerState, network } = ledgerManager);\n        if (!ledgerClient || !ledgerState)\n            throw new Error(`Could not retrieve ledgerClient or ledgerState`);\n        const originPath = `/${purpose}'/${network === bitcoinjs_lib_1.networks.bitcoin ? 0 : 1}'/${account}'`;\n        if (keyPath !== undefined)\n            assertStandardKeyPath(keyPath);\n        const keyExpression = await (0, keyExpressions_1.keyExpressionLedger)({\n            ledgerClient,\n            ledgerState,\n            originPath,\n            keyPath,\n            change,\n            index\n        });\n        return scriptTemplate.replace('KEYEXPRESSION', keyExpression);\n    }\n    return standardScriptExpressionLedger;\n}\nexports.pkhLedger = standardExpressionsLedgerMaker(44, 'pkh(KEYEXPRESSION)');\nexports.shWpkhLedger = standardExpressionsLedgerMaker(49, 'sh(wpkh(KEYEXPRESSION))');\nexports.wpkhLedger = standardExpressionsLedgerMaker(84, 'wpkh(KEYEXPRESSION)');\nexports.trLedger = standardExpressionsLedgerMaker(86, 'tr(KEYEXPRESSION)');\n\"use strict\";\n// Copyright (c) 2025 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.signLedger = exports.signInputLedger = exports.signBIP32 = exports.signInputBIP32 = exports.signECPair = exports.signInputECPair = void 0;\nconst bip371_1 = require(\"bitcoinjs-lib/src/psbt/bip371\");\nconst bip341_1 = require(\"bitcoinjs-lib/src/payments/bip341\");\nconst ledger_1 = require(\"./ledger\");\nconst applyPR2137_1 = require(\"./applyPR2137\");\nfunction range(n) {\n    return [...Array(n).keys()];\n}\n/**\n * Signs a specific input of a PSBT with an ECPair.\n *\n * Unlike bitcoinjs-lib's native `psbt.signInput()`, this function automatically detects\n * if the input is a Taproot input and internally tweaks the key if needed.\n *\n * This behavior matches how `signInputBIP32` works, where the BIP32 node is automatically\n * tweaked for Taproot inputs. In contrast, bitcoinjs-lib's native implementation requires\n * manual pre-tweaking of ECPair signers for Taproot inputs.\n *\n * @see https://github.com/bitcoinjs/bitcoinjs-lib/pull/2137#issuecomment-2713264848\n *\n * @param {Object} params - The parameters object\n * @param {Psbt} params.psbt - The PSBT to sign\n * @param {number} params.index - The input index to sign\n * @param {ECPairInterface} params.ecpair - The ECPair to sign with\n */\nfunction signInputECPair({ psbt, index, ecpair }) {\n    //psbt.signInput(index, ecpair); <- Replaced for the code below\n    //that can handle taroot inputs automatically.\n    //See https://github.com/bitcoinjs/bitcoinjs-lib/pull/2137#issuecomment-2713264848\n    const input = psbt.data.inputs[index];\n    if (!input)\n        throw new Error('Invalid index');\n    if ((0, bip371_1.isTaprootInput)(input)) {\n        const hash = (0, bip341_1.tapTweakHash)(Buffer.from(ecpair.publicKey.slice(1, 33)), undefined);\n        const tweakedEcpair = ecpair.tweak(hash);\n        psbt.signInput(index, tweakedEcpair);\n    }\n    else\n        psbt.signInput(index, ecpair);\n}\nexports.signInputECPair = signInputECPair;\n/**\n * Signs all inputs of a PSBT with an ECPair.\n *\n * This function improves upon bitcoinjs-lib's native `psbt.signAllInputs()` by automatically\n * handling Taproot inputs. For each input, it detects if it's a Taproot input and internally\n * tweaks the key if needed.\n *\n * This creates consistency with the BIP32 signing methods (`signBIP32`/`signInputBIP32`),\n * which also automatically handle key tweaking for Taproot inputs. In contrast, bitcoinjs-lib's\n * native implementation requires users to manually pre-tweak ECPair signers for Taproot inputs.\n *\n * With this implementation, you can use a single ECPair to sign both Taproot and non-Taproot\n * inputs in the same PSBT, similar to how `signBIP32` allows using a common node for both types.\n *\n * @see https://github.com/bitcoinjs/bitcoinjs-lib/pull/2137#issuecomment-2713264848\n *\n * @param {Object} params - The parameters object\n * @param {Psbt} params.psbt - The PSBT to sign\n * @param {ECPairInterface} params.ecpair - The ECPair to sign with\n */\nfunction signECPair({ psbt, ecpair }) {\n    //psbt.signAllInputs(ecpair); <- replaced for the code below that handles\n    //taptoot automatically.\n    //See https://github.com/bitcoinjs/bitcoinjs-lib/pull/2137#issuecomment-2713264848\n    const results = [];\n    for (const index of range(psbt.data.inputs.length)) {\n        try {\n            signInputECPair({ psbt, index, ecpair });\n            results.push(true);\n        }\n        catch (err) {\n            results.push(false);\n        }\n    }\n    if (results.every(v => v === false)) {\n        throw new Error('No inputs were signed');\n    }\n}\nexports.signECPair = signECPair;\nfunction signInputBIP32({ psbt, index, node }) {\n    (0, applyPR2137_1.applyPR2137)(psbt);\n    psbt.signInputHD(index, node);\n}\nexports.signInputBIP32 = signInputBIP32;\nfunction signBIP32({ psbt, masterNode }) {\n    (0, applyPR2137_1.applyPR2137)(psbt);\n    psbt.signAllInputsHD(masterNode);\n}\nexports.signBIP32 = signBIP32;\nconst ledgerSignaturesForInputIndex = (index, ledgerSignatures) => ledgerSignatures\n    .filter(([i]) => i === index)\n    .map(([_i, partialSignature]) => ({\n    pubkey: partialSignature.pubkey,\n    signature: partialSignature.signature\n}));\n/**\n * To be removed in v3.0 and replaced by a version that does not accept\n * descriptor\n * @hidden\n */\nasync function signInputLedger({ psbt, index, descriptor, ledgerClient, ledgerState, ledgerManager }) {\n    if (!descriptor && !ledgerManager)\n        throw new Error(`ledgerManager not provided`);\n    if (descriptor && ledgerManager)\n        throw new Error(`Invalid usage: don't pass descriptor`);\n    if (ledgerManager && (ledgerClient || ledgerState))\n        throw new Error(`Invalid usage: either ledgerManager or ledgerClient + ledgerState`);\n    const output = descriptor;\n    if (ledgerManager)\n        ({ ledgerClient, ledgerState } = ledgerManager);\n    if (!ledgerClient)\n        throw new Error(`ledgerManager not provided`);\n    if (!ledgerState)\n        throw new Error(`ledgerManager not provided`);\n    const { PsbtV2, DefaultWalletPolicy, WalletPolicy, AppClient } = (await (0, ledger_1.importAndValidateLedgerBitcoin)(ledgerClient));\n    if (!(ledgerClient instanceof AppClient))\n        throw new Error(`Error: pass a valid ledgerClient`);\n    let ledgerSignatures;\n    if (ledgerManager) {\n        if (psbt.data.inputs[index]?.tapInternalKey)\n            throw new Error('Taproot inputs not yet supported for the Ledger device');\n        const policy = await (0, ledger_1.ledgerPolicyFromPsbtInput)({\n            psbt,\n            index,\n            ledgerManager\n        });\n        if (!policy)\n            throw new Error(`Error: the ledger cannot sign this pstb input`);\n        if (policy.policyName && policy.policyHmac && policy.policyId) {\n            //non-standard policy\n            const walletPolicy = new WalletPolicy(policy.policyName, policy.ledgerTemplate, policy.keyRoots);\n            ledgerSignatures = await ledgerClient.signPsbt(new PsbtV2().fromBitcoinJS(psbt), walletPolicy, policy.policyHmac);\n        }\n        else {\n            //standard policy\n            ledgerSignatures = await ledgerClient.signPsbt(new PsbtV2().fromBitcoinJS(psbt), new DefaultWalletPolicy(policy.ledgerTemplate, policy.keyRoots[0]), null);\n        }\n    }\n    else {\n        if (!output)\n            throw new Error(`outputs not provided`);\n        const result = await (0, ledger_1.ledgerPolicyFromOutput)({\n            output,\n            ledgerClient,\n            ledgerState\n        });\n        if (!result)\n            throw new Error(`Error: output does not have a ledger input`);\n        const { ledgerTemplate, keyRoots } = result;\n        const standardPolicy = await (0, ledger_1.ledgerPolicyFromStandard)({\n            output,\n            ledgerClient,\n            ledgerState\n        });\n        if (standardPolicy) {\n            ledgerSignatures = await ledgerClient.signPsbt(new PsbtV2().fromBitcoinJS(psbt), new DefaultWalletPolicy(ledgerTemplate, keyRoots[0]), null);\n        }\n        else {\n            const policy = await (0, ledger_1.ledgerPolicyFromState)({\n                output,\n                ledgerClient,\n                ledgerState\n            });\n            if (!policy || !policy.policyName || !policy.policyHmac)\n                throw new Error(`Error: the descriptor's policy is not registered`);\n            const walletPolicy = new WalletPolicy(policy.policyName, ledgerTemplate, keyRoots);\n            ledgerSignatures = await ledgerClient.signPsbt(new PsbtV2().fromBitcoinJS(psbt), walletPolicy, policy.policyHmac);\n        }\n    }\n    //Add the signatures to the Psbt object using PartialSig format:\n    psbt.updateInput(index, {\n        partialSig: ledgerSignaturesForInputIndex(index, ledgerSignatures)\n    });\n}\nexports.signInputLedger = signInputLedger;\n/**\n * To be removed in v3.0 and replaced by a version that does not accept\n * descriptors\n * @hidden\n */\nasync function signLedger({ psbt, descriptors, ledgerClient, ledgerState, ledgerManager }) {\n    if (!descriptors && !ledgerManager)\n        throw new Error(`ledgerManager not provided`);\n    if (descriptors && ledgerManager)\n        throw new Error(`Invalid usage: don't pass descriptors`);\n    if (ledgerManager && (ledgerClient || ledgerState))\n        throw new Error(`Invalid usage: either ledgerManager or ledgerClient + ledgerState`);\n    const outputs = descriptors;\n    if (ledgerManager)\n        ({ ledgerClient, ledgerState } = ledgerManager);\n    if (!ledgerClient)\n        throw new Error(`ledgerManager not provided`);\n    if (!ledgerState)\n        throw new Error(`ledgerManager not provided`);\n    const { PsbtV2, DefaultWalletPolicy, WalletPolicy, AppClient } = (await (0, ledger_1.importAndValidateLedgerBitcoin)(ledgerClient));\n    if (!(ledgerClient instanceof AppClient))\n        throw new Error(`Error: pass a valid ledgerClient`);\n    const ledgerPolicies = [];\n    if (ledgerManager)\n        for (let index = 0; index < psbt.data.inputs.length; index++) {\n            if (psbt.data.inputs[index]?.tapInternalKey)\n                throw new Error('Taproot inputs not yet supported for the Ledger device');\n            const policy = await (0, ledger_1.ledgerPolicyFromPsbtInput)({\n                psbt,\n                index,\n                ledgerManager\n            });\n            if (policy)\n                ledgerPolicies.push(policy);\n        }\n    else {\n        if (!outputs)\n            throw new Error(`outputs not provided`);\n        for (const output of outputs) {\n            const policy = (await (0, ledger_1.ledgerPolicyFromState)({ output, ledgerClient, ledgerState })) ||\n                (await (0, ledger_1.ledgerPolicyFromStandard)({ output, ledgerClient, ledgerState }));\n            if (policy)\n                ledgerPolicies.push(policy);\n        }\n        if (ledgerPolicies.length === 0)\n            throw new Error(`Error: there are no inputs which could be signed`);\n    }\n    //cluster unique LedgerPolicies\n    const uniquePolicies = [];\n    for (const policy of ledgerPolicies) {\n        if (!uniquePolicies.find((uniquePolicy) => (0, ledger_1.comparePolicies)(uniquePolicy, policy)))\n            uniquePolicies.push(policy);\n    }\n    for (const uniquePolicy of uniquePolicies) {\n        let ledgerSignatures;\n        if (uniquePolicy.policyName &&\n            uniquePolicy.policyHmac &&\n            uniquePolicy.policyId) {\n            //non-standard policy\n            const walletPolicy = new WalletPolicy(uniquePolicy.policyName, uniquePolicy.ledgerTemplate, uniquePolicy.keyRoots);\n            ledgerSignatures = await ledgerClient.signPsbt(new PsbtV2().fromBitcoinJS(psbt), walletPolicy, uniquePolicy.policyHmac);\n        }\n        else {\n            //standard policy\n            ledgerSignatures = await ledgerClient.signPsbt(new PsbtV2().fromBitcoinJS(psbt), new DefaultWalletPolicy(uniquePolicy.ledgerTemplate, uniquePolicy.keyRoots[0]), null);\n        }\n        for (const [index, ,] of ledgerSignatures) {\n            psbt.updateInput(index, {\n                partialSig: ledgerSignaturesForInputIndex(index, ledgerSignatures)\n            });\n        }\n    }\n}\nexports.signLedger = signLedger;\n{\n  \"name\": \"@bitcoinerlab/descriptors\",\n  \"description\": \"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets.\",\n  \"homepage\": \"https://github.com/bitcoinerlab/descriptors\",\n  \"version\": \"2.3.1\",\n  \"author\": \"Jose-Luis Landabaso\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/bitcoinerlab/descriptors.git\"\n  },\n  \"keywords\": [\n    \"bitcoin\",\n    \"descriptors\",\n    \"bitcoinjs\",\n    \"miniscript\"\n  ],\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinerlab/descriptors/issues\"\n  },\n  \"main\": \"dist/index.js\",\n  \"types\": \"dist/index.d.ts\",\n  \"prettier\": \"@bitcoinerlab/configs/prettierConfig.json\",\n  \"eslintConfig\": {\n    \"extends\": \"./node_modules/@bitcoinerlab/configs/eslintConfig\"\n  },\n  \"jest\": {\n    \"preset\": \"@bitcoinerlab/configs\"\n  },\n  \"scripts\": {\n    \"webdocs\": \"typedoc --options ./node_modules/@bitcoinerlab/configs/webtypedoc.json\",\n    \"docs\": \"typedoc --options ./node_modules/@bitcoinerlab/configs/typedoc.json\",\n    \"build:src\": \"tsc --project ./node_modules/@bitcoinerlab/configs/tsconfig.src.json\",\n    \"build:fixtures\": \"node test/tools/generateBitcoinCoreFixtures.js -i test/fixtures/descriptor_tests.cpp | npx prettier --parser typescript > test/fixtures/bitcoinCore.ts\",\n    \"build:test\": \"npm run build:fixtures && tsc --project ./node_modules/@bitcoinerlab/configs/tsconfig.test.json --resolveJsonModule\",\n    \"build\": \"npm run build:src && npm run build:test\",\n    \"lint\": \"eslint --ignore-path .gitignore --ext .ts src/ test/\",\n    \"ensureTester\": \"./node_modules/@bitcoinerlab/configs/scripts/ensureTester.sh\",\n    \"test:integration:soft\": \"npm run ensureTester && node test/integration/standardOutputs.js && echo \\\"\\\\n\\\\n\\\" && node test/integration/miniscript.js\",\n    \"test:integration:ledger\": \"npm run ensureTester && node test/integration/ledger.js\",\n    \"test:integration:deprecated\": \"npm run ensureTester && node test/integration/standardOutputs-deprecated.js && echo \\\"\\\\n\\\\n\\\" && node test/integration/miniscript-deprecated.js && echo \\\"\\\\n\\\\n\\\" && node test/integration/ledger-deprecated.js\",\n    \"test:unit\": \"jest\",\n    \"test\": \"npm run lint && npm run build && npm run test:unit && npm run test:integration:soft\",\n    \"testledger\": \"npm run lint && npm run build && npm run test:integration:ledger\",\n    \"prepublishOnly\": \"npm run test && echo \\\"\\\\n\\\\n\\\" && npm run test:integration:deprecated && npm run test:integration:ledger\"\n  },\n  \"files\": [\n    \"dist\"\n  ],\n  \"peerDependencies\": {\n    \"ledger-bitcoin\": \"^0.2.2\"\n  },\n  \"peerDependenciesMeta\": {\n    \"ledger-bitcoin\": {\n      \"optional\": true\n    }\n  },\n  \"devDependencies\": {\n    \"@bitcoinerlab/configs\": \"github:bitcoinerlab/configs\",\n    \"@ledgerhq/hw-transport-node-hid\": \"^6.27.12\",\n    \"@types/lodash.memoize\": \"^4.1.9\",\n    \"bip39\": \"^3.0.4\",\n    \"bip65\": \"^1.0.3\",\n    \"bip68\": \"^1.0.4\",\n    \"ledger-bitcoin\": \"^0.2.2\",\n    \"regtest-client\": \"^0.2.0\",\n    \"yargs\": \"^17.7.2\"\n  },\n  \"dependencies\": {\n    \"@bitcoinerlab/miniscript\": \"^1.4.0\",\n    \"@bitcoinerlab/secp256k1\": \"^1.2.0\",\n    \"bip32\": \"^4.0.0\",\n    \"bitcoinjs-lib\": \"^6.1.3\",\n    \"ecpair\": \"^2.1.0\",\n    \"lodash.memoize\": \"^4.1.2\",\n    \"varuint-bitcoin\": \"^1.1.2\"\n  }\n}\n'use strict';\n\nvar bip68 = require('bip68');\n\n// Copyright (c) 2022 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\n\n\nconst ABSOLUTE = 'ABSOLUTE';\nconst RELATIVE = 'RELATIVE';\n\n/**\n * Calculates the maximum lock time value between two lock time values (a and b)\n * using the specified lock type (ABSOLUTE or RELATIVE).\n * It asserts that there are no timeLock mixings.\n * It asserts that a or b are correctly encoded in bip68 format if they are\n * RELATIVE.\n * Either both a and b are block based or time based.\n * https://medium.com/blockstream/dont-mix-your-timelocks-d9939b665094\n *\n * If only a or b is undefined it asserts the value and returns it.\n * If none are defined it returns undefined.\n * @param {string|number} [a] - The first lock time value to compare.\n * @param {string|number} [b] - The second lock time value to compare.\n * @param {string} lockType - The type of lock time to use. Can be either \"ABSOLUTE\" or \"RELATIVE\".\n * @return {number} - The maximum lock time value between a and b.\n */\n\nfunction maxLock(a, b, lockType) {\n  if (typeof a === 'undefined' && typeof b === 'undefined') {\n    return undefined;\n  }\n  if (typeof lockType === 'undefined')\n    throw new Error('lockType must be specified');\n  // Check that lockType is either \"ABSOLUTE\" or \"RELATIVE\"\n  if (lockType !== ABSOLUTE && lockType !== RELATIVE)\n    throw new Error('lockType must be either \"ABSOLUTE\" or \"RELATIVE\"');\n\n  function isInteger(number) {\n    const isNumeric = !isNaN(number) && !isNaN(parseFloat(number));\n    if (isNumeric && Number.isInteger(Number(number))) return true;\n    else return false;\n  }\n  if (typeof a !== 'undefined') {\n    if (isInteger(a) === false)\n      throw new Error('nSequence/nLockTime must be an integer: ' + a);\n    a = Number(a);\n    if (\n      lockType === RELATIVE &&\n      !bip68.decode(a).hasOwnProperty('seconds') &&\n      !bip68.decode(a).hasOwnProperty('blocks')\n    )\n      throw new Error('Invalid bip68 encoded a value: ' + a);\n  }\n  if (typeof b !== 'undefined') {\n    if (isInteger(b) === false)\n      throw new Error('nSequence/nLockTime must be an integer: ' + b);\n    b = Number(b);\n    if (\n      lockType === RELATIVE &&\n      !bip68.decode(b).hasOwnProperty('seconds') &&\n      !bip68.decode(b).hasOwnProperty('blocks')\n    )\n      throw new Error('Invalid bip68 encoded b value: ' + b);\n  }\n\n  if (typeof a !== 'undefined' && typeof b !== 'undefined') {\n    if (lockType === ABSOLUTE) {\n      // Both a and b must be either below 500000000 or both above or equal 500000000\n      if (\n        (a < 500000000 && b >= 500000000) ||\n        (a >= 500000000 && b < 500000000)\n      ) {\n        throw new Error(\n          'nLockTime values must be either below 500000000 or both above or equal 500000000'\n        );\n      }\n    } else {\n      const decodedA = bip68.decode(a);\n      const decodedB = bip68.decode(b);\n\n      if (\n        decodedA.hasOwnProperty('seconds') !==\n        decodedB.hasOwnProperty('seconds')\n      ) {\n        throw new Error(\n          'a and b must both be either represent seconds or block height'\n        );\n      }\n    }\n    return Math.max(a, b);\n  }\n\n  if (typeof a !== 'undefined') return a;\n  if (typeof b !== 'undefined') return b;\n  return undefined;\n}\n\n// Copyright (c) 2022 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\n\n\n/**\n * Given a `solutionTemplate`, such as \"0 dsat(X) sat(Y) 1 sat(Z)\", and given the\n * sat/dissatisfactions for X, Y, Z,... (comprised in `satisfactionsMap`) it\n * computes all the possible combination of solutions returned in an array\n * of {@link Solution}.\n *\n * Terminology:\n *\n * A solution of type {@link Solution} is an object\n * that contains an unlocking witness for a\n * miniscript fragment.\n *\n * When matching an unlocking witness with a locking\n * script, they can produce True or False. These solutions are called sats and\n * dsats, respectively.\n *\n * For example, take this solution: `sol = {asm:\"sig key\"}`.\n *\n * When matched with `DUP HASH160 <HASH160(key)> EQUALVERIFY CHECKSIG` it\n * produces `True`, that is, a valid sat solution: `<sig> <key> DUP HASH160 <HASH160(key)> EQUALVERIFY CHECKSIG`.\n *\n * A solution object can also contain other associated pieces of information: `solution: {asm, nLockTime, nSequence}`:\n *   -  nLockTime, nSequence: (number/str) interlock attached to this transaction\n *\n * A `solutionTemplate` describes a solution using sats and dsats of subexpressions.\n *\n * F.ex., this is a `solutionTemplate = \"0 dsat(X) sat(Y) 1 sat(Z)\"`.\n *\n * satisfactions is an object of type {@link Satisfactions}\n * that comprises both sat and dsat solutions for a\n * miniscript fragment:\n *\n *   `satisfactions = {sats: [sol_s1, sol_s2, ...], dsats: [sol_d1, ...]}`\n *\n * satisfactionsMap is a group of satisfactions:\n * ```javascript\n *   satisfactionsMap = { X: satisfactions_X, Y: satisfactions_Y, ...} =\n *   satisfactionsMap = {\n *                     X: {\n *                         sats: [sol_s1, sol_s2, ...],\n *                         dsats:[...]\n *                     },\n *                     Y: {sats: [...], dsats: [...]},\n *                     ...}\n * ```\n *\n * @param {string} solutionTemplate - a string containing sat or dsat expressions such as: \"0 dsat(X) sat(Y) 1 sat(Z)\"\n * @param {Object} satisfactionsMap - an object mapping the arguments for the sat and dsat expressions\n * in `solutionTemplate` (f.ex: `X, Y, Z`) to their {@link Satisfactions}.\n * @param {Satisfactions} [satisfactionsMap.X] - The satisfactions for `X`\n * @param {Satisfactions} [satisfactionsMap.Y] - The satisfactions for `Y`\n * @param {Satisfactions} [satisfactionsMap.Z] - The satisfactions for `Z`\n * @param {Satisfactions} [satisfactionsMap....] - The satisfactions for `...`\n *\n * @returns {Solution[]} an array of solutions, containing the resulting witness, nSequence and nLockTime values, and whether the solution has a HASSIG marker or should be marked as \"DONTUSE\".\n */\n\nfunction combine(solutionTemplate, satisfactionsMap) {\n  //First, break solutionTemplate into 3 parts:\n  //  pre + curr + post,\n  //where curr is the first sat(...)/dsat(...) in solutionTemplate.\n  //\n  //For example, in \"0 dsat(X) sat(Y) 1 sat(Z)\":\n  //  pre= \"0 \"; curr = \"dsat(X)\"; post: \" sat(Y) sat(Z)\"\n  //\n  //Recursively call combine(post) until there are no further\n  //sat()/dsat() in *post*\n\n  //regExp that matches the first dsat(...) or sat(...):\n  const reCurr = /d?sat\\(([^\\(]*)\\)/;\n  const currMatch = solutionTemplate.match(reCurr);\n\n  if (currMatch && currMatch.length) {\n    //The array of solutions to be computed and returned.\n    const solutions = [];\n\n    //curr is the first d?sat() matched in solutionTemplate:\n    const curr = currMatch[0];\n    //pre is whatever was before the first d?sat():\n    const pre = solutionTemplate.split(curr)[0];\n    //post is whatever was after the first d?sat():\n    const post = solutionTemplate.slice(curr.length + pre.length);\n\n    //the argument for curr: d?sat( -> argument <- ):\n    //This will match the string \"X\" in the example above:\n    //currArg = \"X\" for solutionTemplate \"0 dsat(X) sat(Y) 1 sat(Z)\"\n    const currArg = currMatch[1];\n    //currKey = \"sats\" or \"dsats\". \"dsats\" for the example above.\n    const currKey = curr[0] === 'd' ? 'dsats' : 'sats';\n\n    if (typeof satisfactionsMap[currArg] !== 'object')\n      throw new Error(\n        `satisfactionsMap does not provide sats/dsats solutions for argument ${currArg}, evaluating: ${solutionTemplate}`\n      );\n    const currSolutions = satisfactionsMap[currArg][currKey] || [];\n    for (const currSolution of currSolutions) {\n      //Does *post* contain further sat() or dsat() expressions?\n      if (post.match(reCurr)) {\n        //There are more sat/dsat, do a recursive call:\n        const postSolutions = combine(post, satisfactionsMap);\n        for (const postSolution of postSolutions) {\n          //if ((currSolution.nLockTime && postSolution.nLockTime)) return [];\n          solutions.push({\n            nSequence: maxLock(\n              currSolution.nSequence,\n              postSolution.nSequence,\n              RELATIVE\n            ),\n            nLockTime: maxLock(\n              currSolution.nLockTime,\n              postSolution.nLockTime,\n              ABSOLUTE\n            ),\n            asm: `${pre}${currSolution.asm}${postSolution.asm}`\n          });\n        }\n      } else {\n        //This was the last instance of combine where there are no *post*\n        //sat/dsats\n        solutions.push({\n          ...currSolution,\n          asm: `${pre}${currSolution.asm}${post}`\n        });\n      }\n    }\n    //markDontUseSolutions(solutions);\n\n    return solutions;\n  }\n  throw new Error('Invalid solutionTemplate: ' + solutionTemplate);\n}\n\n/**\n * An object containing functions for generating Basic satisfaction and dissatisfaction sets for miniscripts.\n *\n * @see {@link https://bitcoin.sipa.be/miniscript/}\n * @typedef {Object} SatisfactionsMaker\n *\n */\nconst satisfactionsMaker = {\n  0: () => ({\n    dsats: [{ asm: `` }]\n  }),\n  1: () => ({\n    sats: [{ asm: `` }]\n  }),\n  pk_k: key => ({\n    dsats: [{ asm: `0` }],\n    sats: [{ asm: `<sig(${key})>` }]\n  }),\n  pk_h: key => ({\n    dsats: [{ asm: `0 <${key}>` }],\n    sats: [{ asm: `<sig(${key})> <${key}>` }]\n  }),\n  older: n => ({\n    sats: [{ asm: ``, nSequence: n }]\n  }),\n  after: n => ({\n    sats: [{ asm: ``, nLockTime: n }]\n  }),\n  sha256: h => ({\n    sats: [{ asm: `<sha256_preimage(${h})>` }],\n    dsats: [{ asm: `<random_preimage()>` }]\n  }),\n  ripemd160: h => ({\n    sats: [{ asm: `<ripemd160_preimage(${h})>` }],\n    dsats: [{ asm: `<random_preimage()>` }]\n  }),\n  hash256: h => ({\n    sats: [{ asm: `<hash256_preimage(${h})>` }],\n    dsats: [{ asm: `<random_preimage()>` }]\n  }),\n  hash160: h => ({\n    sats: [{ asm: `<hash160_preimage(${h})>` }],\n    dsats: [{ asm: `<random_preimage()>` }]\n  }),\n  andor: (X, Y, Z) => ({\n    dsats: [\n      ...combine(`dsat(Z) dsat(X)`, { X, Y, Z }),\n      ...combine(`dsat(Y) sat(X)`, { X, Y, Z })\n    ],\n    sats: [\n      ...combine('sat(Y) sat(X)', { X, Y, Z }),\n      ...combine('sat(Z) dsat(X)', { X, Y, Z })\n    ]\n  }),\n  and_v: (X, Y) => ({\n    dsats: [...combine(`dsat(Y) sat(X)`, { X, Y })],\n    sats: [...combine(`sat(Y) sat(X)`, { X, Y })]\n  }),\n  and_b: (X, Y) => ({\n    dsats: [\n      ...combine(`dsat(Y) dsat(X)`, { X, Y }),\n      //https://bitcoin.sipa.be/miniscript/\n      //The non-canonical options for and_b, or_b, and thresh are always\n      //overcomplete (reason 3), so instead use DONTUSE there\n      ...combine(`sat(Y) dsat(X)`, { X, Y }),\n      ...combine(`dsat(Y) sat(X)`, { X, Y })\n    ],\n    sats: [...combine(`sat(Y) sat(X)`, { Y, X })]\n  }),\n  or_b: (X, Z) => ({\n    dsats: [...combine(`dsat(Z) dsat(X)`, { X, Z })],\n    sats: [\n      ...combine(`dsat(Z) sat(X)`, { X, Z }),\n      ...combine(`sat(Z) dsat(X)`, { X, Z }),\n      //https://bitcoin.sipa.be/miniscript/\n      //The non-canonical options for and_b, or_b, and thresh are always\n      //overcomplete (reason 3), so instead use DONTUSE there\n      ...combine(`sat(Z) sat(X)`, { X, Z })\n    ]\n  }),\n  or_c: (X, Z) => ({\n    sats: [\n      ...combine(`sat(X)`, { X, Z }),\n      ...combine(`sat(Z) dsat(X)`, { X, Z })\n    ]\n  }),\n  or_d: (X, Z) => ({\n    dsats: [...combine(`dsat(Z) dsat(X)`, { X, Z })],\n    sats: [\n      ...combine(`sat(X)`, { X, Z }),\n      ...combine(`sat(Z) dsat(X)`, { X, Z })\n    ]\n  }),\n  or_i: (X, Z) => ({\n    dsats: [\n      ...combine(`dsat(X) 1`, { X, Z }),\n      ...combine(`dsat(Z) 0`, { X, Z })\n    ],\n    sats: [...combine(`sat(X) 1`, { X, Z }), ...combine(`sat(Z) 0`, { X, Z })]\n  }),\n  /*\n   * This is not entirely trivial from the docs\n   * (https://bitcoin.sipa.be/miniscript/),\n   *  but solution templates for thresh must be written in reverse order.\n   *  For example the first dsat, which is \"All dsats\", corresponds to:\n   *  \"<DSAT_N> <DSAT_N-1> ... <DSAT_1>\" (note the reverse order in N)\n   *  While this is not entirely trivial by reading the document\n   *  it can be deduced by analyzing the script:\n   *  thresh(k,X1,...,Xn)\t[X1] [X2] ADD ... [Xn] ADD ... <k> EQUAL\n   */\n  thresh: (k, ...satisfactionsArray) => {\n    if (Number.isInteger(Number(k)) && Number(k) > 0) k = Number(k);\n    else throw new Error(`k must be positive number: ${k}`);\n\n    //First, convert input satisfactions (which are dynamic for thresh\n    //and multi) into an object.\n    //For example, if input was, thresh(k, X, Y, Z), then\n    //create an object like this: satisfactionsMap = {X, Y, Z};\n    const satisfactionsMap = {};\n    const N = satisfactionsArray.length;\n    satisfactionsArray.map((satisfactions, index) => {\n      satisfactionsMap[index] = satisfactions;\n    });\n\n    const dsats = [];\n    const sats = [];\n    //Push the canonical dsat (All dsats):\n    //\"<DSAT_N> <DSAT_N-1> ... <DSAT_1>\" (note the reverse order)\n    dsats.push(\n      ...combine(\n        Object.keys(satisfactionsMap)\n          .map(mapKeyName => `dsat(${mapKeyName})`)\n          .reverse()\n          .join(' '),\n        satisfactionsMap\n      )\n    );\n\n    const dsatsNonCanSolutionTemplates = []; //Sats/dsats with 1 ≤ #(sats) ≠ k\n    const satsSolutionTemplates = []; //Sats/dsats with #(sats) = k\n    for (let i = 1; i < 1 << N; i++) { // i expressed in binary will be: 0 0 ...N... 0 1,  0  0  ... N ... 1 0,  0  0  ... N ... 1 1,  ... , 1 1 1 1 ...N.... 1\n      const c = [];\n      let totalSatisfactions = 0;\n      for (let j = 0; j < N; j++) {\n        if (i & (1 << j)) totalSatisfactions++; //binary mask of i (see above) and jth element to count how many \"1\"s\n        c.push(i & (1 << j) ? `sat(${j})` : `dsat(${j})`);\n      }\n      if (totalSatisfactions !== k)\n        dsatsNonCanSolutionTemplates.push(c.reverse().join(' '));\n      else satsSolutionTemplates.push(c.reverse().join(' '));\n    }\n\n    //Push the non canonical dsats:\n    for (const solutionTemplate of dsatsNonCanSolutionTemplates) {\n      //https://bitcoin.sipa.be/miniscript/\n      //The non-canonical options for and_b, or_b, and thresh are always\n      //overcomplete (reason 3), so instead use DONTUSE there\n      dsats.push(...combine(solutionTemplate, satisfactionsMap));\n    }\n\n    //Push the sats (which all are canonical):\n    for (const solutionTemplate of satsSolutionTemplates) {\n      sats.push(...combine(solutionTemplate, satisfactionsMap));\n    }\n\n    return { dsats, sats };\n  },\n  multi: (k, ...keys) => {\n    if (Number.isInteger(Number(k)) && Number(k) > 0) k = Number(k);\n    else throw new Error(`k must be positive number: ${k}`);\n\n    //Example of a multi-sig locking script:\n    //OP_3 <pubKey1> <pubKey2> <pubKey3> <pubKey4> OP_4 OP_CHECKMULTISIG\n    //unlockingScript: OP_0 <sig1> <sig2> <sig4>\n    //OP_0 is a dummy OP, needed because of a bug in Bitcoin\n    if (typeof k !== 'number') throw new Error('k must be a number:' + k);\n    if (k === 0) throw new Error('k cannot be 0');\n    const dsats = [{ asm: '0 '.repeat(k + 1).trim() }];\n\n    // Create all combinations of k signatures\n    function keyCombinations(keys, k) {\n      if (k === 0) {\n        return [[]];\n      }\n\n      const combinations = [];\n\n      for (let i = 0; i < keys.length; i++) {\n        const remainingKeys = keys.slice(i + 1);\n        const subCombinations = keyCombinations(remainingKeys, k - 1);\n        subCombinations.forEach(combination => {\n          combinations.push([keys[i], ...combination]);\n        });\n      }\n\n      return combinations;\n    }\n\n    const asms = [];\n    // Create asms from keyCombination\n    keyCombinations(keys, k).forEach(combination => {\n      let asm = '0';\n      combination.forEach(key => {\n        asm += ` <sig(${key})>`;\n      });\n      asms.push(asm);\n    });\n\n    let asm = '0';\n    for (let i = 0; i < k; i++) {\n      asm += ` <sig(${keys[i]})>`;\n    }\n    const sats = asms.map(asm => ({ asm }));\n\n    return { sats, dsats };\n  },\n  a: X => ({\n    dsats: [...combine(`dsat(X)`, { X })],\n    sats: [...combine(`sat(X)`, { X })]\n  }),\n  s: X => ({\n    dsats: [...combine(`dsat(X)`, { X })],\n    sats: [...combine(`sat(X)`, { X })]\n  }),\n  c: X => ({\n    dsats: [...combine(`dsat(X)`, { X })],\n    sats: [...combine(`sat(X)`, { X })]\n  }),\n  d: X => ({\n    dsats: [{ asm: `0` }],\n    sats: [...combine(`sat(X) 1`, { X })]\n  }),\n  v: X => ({\n    sats: [...combine(`sat(X)`, { X })]\n  }),\n\n  /**\n   * j:X corresponds to SIZE 0NOTEQUAL IF [X] ENDIF\n   *\n   * By definition, this: \"dsat(X) X\" produces a zero.\n   *\n   *\n   * A dsat needs to make this \"dsat(X) X\" return zero.\n\n   * The easiest dsat for j:X is using 0:\n   * 0 SIZE 0NOTEQUAL IF [X] ENDIF\n   * 0 0 0NOTEQUAL IF [X] ENDIF\n   * 0 0 IF [X] ENDIF\n   * 0\n\n   * Now let's do the case where dsat(X) finishes with a 0: \"... 0\"\n   * ... 0 SIZE 0NOTEQUAL IF [X] ENDIF\n   * ... 0 0 0NOTEQUAL IF [X] ENDIF\n   * ... 0 0 IF [X] ENDIF \n   * ... 0\n   * DSAT(X)\n   * The final expression is \"DSAT(X)\".\n   * It should have either been \"0\" or \"DSAT(X) X\"\n   * Thus, this is not a valid dsat.\n\n   * Now let's do the case where dsat(X) is this: \"... <nonzero>\"\n   * ... <nonzero> SIZE 0NOTEQUAL IF [X] ENDIF\n   * ... <nonzero> <length_is_nonzero> 0NOTEQUAL IF [X] ENDIF\n   * ... <nonzero> 1 IF [X] ENDIF\n   * ... <nonzero> [X]\n   * DSAT(X) [X]\n\n   * DSAT(X) X is a good dsat\n   */\n  j: X => {\n    const dsats = [];\n\n    dsats.push({ asm: `0` });\n\n    //Filter the dsats of X with Non Zero Top Stack (nztp).\n    const dsats_nzts = X.dsats.filter(\n      //The top stack corresponds to the last element pushed to the stack,\n      //that is, the last element in the produced witness\n      solution => solution.asm.trim().split(' ').pop() !== '0'\n    );\n    dsats.push(...dsats_nzts);\n\n    return { dsats, sats: [...combine(`sat(X)`, { X })] };\n  },\n  n: X => ({\n    dsats: [...combine(`dsat(X)`, { X })],\n    sats: [...combine(`sat(X)`, { X })]\n  })\n};\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar bindings$1 = {exports: {}};\n\nvar hasRequiredBindings;\n\nfunction requireBindings () {\n\tif (hasRequiredBindings) return bindings$1.exports;\n\thasRequiredBindings = 1;\n\t(function (module, exports) {\n\t\tvar Module = (() => {\n\t\t  var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n\t\t  \n\t\t  return (\n\t\tfunction(moduleArg = {}) {\n\n\t\tvar Module=moduleArg;var readyPromiseResolve,readyPromiseReject;Module[\"ready\"]=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject;});var moduleOverrides=Object.assign({},Module);var thisProgram=\"./this.program\";var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}{if(typeof document!=\"undefined\"&&document.currentScript){scriptDirectory=document.currentScript.src;}if(_scriptDir){scriptDirectory=_scriptDir;}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1);}else {scriptDirectory=\"\";}}Module[\"print\"]||console.log.bind(console);var err=Module[\"printErr\"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module[\"arguments\"])Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"quit\"])Module[\"quit\"];var wasmBinary;if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];Module[\"noExitRuntime\"]||true;var WebAssembly={Memory:function(opts){this.buffer=new ArrayBuffer(opts[\"initial\"]*65536);},Module:function(binary){},Instance:function(module,info){this.exports=(\n\t\t// EMSCRIPTEN_START_ASM\n\t\tfunction instantiate(_a){function c(d){d.set=function(a,b){this[a]=b;};d.get=function(a){return this[a]};return d}var e;var f=new Uint8Array(123);for(var a=25;a>=0;--a){f[48+a]=52+a;f[65+a]=a;f[97+a]=26+a;}f[43]=62;f[47]=63;function l(m,n,o){var g,h,a=0,i=n,j=o.length,k=n+(j*3>>2)-(o[j-2]==\"=\")-(o[j-1]==\"=\");for(;a<j;a+=4){g=f[o.charCodeAt(a+1)];h=f[o.charCodeAt(a+2)];m[i++]=f[o.charCodeAt(a)]<<2|g>>4;if(i<k)m[i++]=g<<4|h>>2;if(i<k)m[i++]=h<<6|f[o.charCodeAt(a+3)];}}function p(q){l(e,1024,\"ZG16AFZ6AGluZmluaXR5AGNoYW5nZV9jYXBhY2l0eQBGZWJydWFyeQBKYW51YXJ5AEp1bHkAVGh1cnNkYXkAVHVlc2RheQBXZWRuZXNkYXkAU2F0dXJkYXkAU3VuZGF5AE1vbmRheQBGcmlkYXkATWF5ACVtLyVkLyV5AGR1eABCL3pvbm1zeABWL3Vuem9mbXN4AEsvdW56b2Ztc3gAQi91bnpvZm1zeABCby91ZGZlbXN4AGZ4AG5keAAtKyAgIDBYMHgALTBYKzBYIDBYLTB4KzB4IDB4AF9fbmV4dF9wcmltZSBvdmVyZmxvdwBOb3YAYW5kX3YAVGh1AFdlbWR1AEJlbWR1AFdkdQBCZHUAQXVndXN0AHN0ZDo6YmFkX2Nhc3QAQ29tcHV0aW5nIENvc3RQYWlyIG9mIHVua25vd24gZnJhZ21lbnQAbmV3X2luZGlyZWN0AF91bmlvbi5pbmRpcmVjdABPY3QAU2F0AHpzAGsgPj0gMSAmJiBrIDw9IG5fa2V5cwB1cwBDYWxjT3BzAG91bXMAVi9uem9tcwBCZHVlL3pvbXMAV2RlL3pvbXMAQmRlL3pvbXMAVi96b21zAFYvbnNvbXMAem9ubXMAVi96Zm1zAFYvem91Zm1zAEsvem91Zm1zAEIvem91Zm1zAEJuL291Zm1zAFYvenVkZmVtcwBLL3p1ZGZlbXMAQi96dWRmZW1zAFYvem91ZGZlbXMASy96b3VkZmVtcwBCL3pvdWRmZW1zAEIvdWRmZW1zAEJ6b25kZmVtcwBXL3pvbmRmZW1zAEIvem9uZGZlbXMAQm1zAFZCS3VmcwB6ZXMAayA+PSAxICYmIGsgPD0gbl9zdWJzAEdldFBRcwBBcHIAdmVjdG9yAHVuc3BlY2lmaWVkIGlvc3RyZWFtX2NhdGVnb3J5IGVycm9yAG1vbmV5X2dldCBlcnJvcgBDYWxjQ29zdFBhaXIAR2V0VHlwZUZpbHRlcgBhZnRlcgBvbGRlcgBPY3RvYmVyAE5vdmVtYmVyAFNlcHRlbWJlcgBEZWNlbWJlcgBpb3NfYmFzZTo6Y2xlYXIATWFyAGl0LT5zZWNvbmQucSA9PSBxAG1pbmlzY3JpcHQvYml0Y29pbi9zY3JpcHQvbWluaXNjcmlwdC5jcHAAbWluaXNjcmlwdC9jb21waWxlci5jcHAAU2VwACVJOiVNOiVTICVwAGl0LT5zZWNvbmQucCA9PSBwAEJvAFN1bgBKdW4Ac3RkOjpleGNlcHRpb24AR2V0Q29tcGlsYXRpb24ATW9uAENvbXB1dGVTY3JpcHRMZW4AbmFuAEphbgBCbgBkem0Ab25kZmVtAGlvc3RyZWFtAEp1bABsbABBcHJpbABVbmtub3duIGNoYXJhY3RlciBpbiBfbXN0IGxpdGVyYWwAQnp1ZGVtc3hrAEtvbnVkZW1zeGsAS251ZGVtc3hrAEJ6Zm14awBCenVmbXhrAEJudWRlbXNrAEJvbnVkbWsAZ2hpamsAZ2hpagBGcmkAYmFkX2FycmF5X25ld19sZW5ndGgAdGhyZXNoAE1hcmNoAG1pbmlzY3JpcHQvYml0Y29pbi9zY3JpcHQvbWluaXNjcmlwdC5oAG1pbmlzY3JpcHQvYml0Y29pbi9wcmV2ZWN0b3IuaABBdWcAYmFzaWNfc3RyaW5nAHNmAGluZgAlLjBMZgAlTGYAJWYAQ2FsY1N0YWNrU2l6ZQB0cnVlAFR1ZQB6c2UAUGFyc2UAZmFsc2UAU2FuaXRpemVUeXBlAENvbXB1dGVUeXBlAEp1bmUAQ29tcGlsZQBDU2NyaXB0OjpvcGVyYXRvcjw8KCk6IGludmFsaWQgb3Bjb2RlAEsvb25kZQBUcmVlRXZhbE1heWJlAGl0Mi5zZWNvbmQAYW5kAHVmZABsb2NhbGUgbm90IHN1cHBvcnRlZABXZWQAQWRkAFdkAEJkAFVua25vd24gZXJyb3IgJWQAc3RkOjpiYWRfYWxsb2MARGVjAEZlYgBhbmRfYgBhAC4tXwBbYW5hbHlzaXMgZXJyb3JdAFtjb21waWxlIGVycm9yXQBhbmRvciBbb3JdAFtpbnZhbGlkXQBPUF9WRVJJRlkAT1BfRVFVQUxWRVJJRlkAT1BfTlVNRVFVQUxWRVJJRlkAT1BfQ0hFQ0tTSUdWRVJJRlkAT1BfQ0hFQ0tNVUxUSVNJR1ZFUklGWQBPUF9DSEVDS0xPQ0tUSU1FVkVSSUZZAE9QX0NIRUNLU0VRVUVOQ0VWRVJJRlkAJWEgJWIgJWQgJUg6JU06JVMgJVkAUE9TSVgAT1BfTUFYAFcAQktWAE9QX0RJVgBPUF8yRElWAE9QX0lOVkVSVABPUF9ST1QAT1BfMlJPVABPUF9OT1QAT1BfUklHSFQAT1BfUlNISUZUAE9QX0xTSElGVABPUF9MRUZUAE9QX0NBVABPUF9BQlMAJUg6JU06JVMAT1BfU1VCU1RSAE9QX09SAE9QX1hPUgBPUF9DT0RFU0VQQVJBVE9SAE9QX0JPT0xPUgBPUF9WRVIAT1BfT1ZFUgBPUF8yT1ZFUgBPUF9EVVAAT1BfSUZEVVAAT1BfM0RVUABPUF8yRFVQAE9QX0RST1AAT1BfMkRST1AAT1BfTk9QAE9QX05JUABPUF9TV0FQAE9QXzJTV0FQAE9QX1VOS05PV04AT1BfUkVUVVJOAE9QX01JTgBPUF9XSVRISU4ATkFOAE9QX0xFU1NUSEFOAE9QX0dSRUFURVJUSEFOAFBNAEFNAE9QX01VTABPUF8yTVVMAGsgPj0gMSAmJiBrIDwgMHg4MDAwMDAwMFVMAE9QX1JPTEwATENfQUxMAE9QX0VRVUFMAE9QX05VTU5PVEVRVUFMAE9QXzBOT1RFUVVBTABPUF9MRVNTVEhBTk9SRVFVQUwAT1BfR1JFQVRFUlRIQU5PUkVRVUFMAE9QX05VTUVRVUFMAE9QX1RVQ0sAT1BfUElDSwBPUF9UT0FMVFNUQUNLAE9QX0ZST01BTFRTVEFDSwBPUF9ERVBUSABMQU5HAE9QX0NIRUNLU0lHAE9QX0NIRUNLTVVMVElTSUcASU5GAE9QX0lGAE9QX05PVElGAE9QX1ZFUk5PVElGAE9QX1ZFUklGAE9QX0VORElGAE9QX1NJWkUAT1BfTkVHQVRFAE9QX0VMU0UAc3RyYXQtPm5vZGVfdHlwZSA9PSBTdHJhdDo6VHlwZTo6Q0FDSEUAT1BfSU5WQUxJRE9QQ09ERQBPUF9NT0QAT1BfQU5EAE9QX0JPT0xBTkQAT1BfUkVTRVJWRUQAT1BfQUREAE9QXzFBREQAQwBLVkIAT1BfU1VCAE9QXzFTVUIAPC9zcGFuPgAgV1U8L2xpPjwvdWw+ACBieXRlcyBzY3JpcHQ8dWw+PGxpPgA8L2xpPjwvdWw+PC9saT48bGk+ADx1bCBzdHlsZT0ibGlzdC1zdHlsZS10eXBlOiBkaXNjOyI+PGxpPmFuZG9yIFthbmRdPHVsIHN0eWxlPSJsaXN0LXN0eWxlLXR5cGU6IGRpc2M7Ij48bGk+ADwvbGk+ADxIPgApPgA8dWwgc3R5bGU9Imxpc3Qtc3R5bGUtdHlwZTogZGlzYzsiPgA8ADoAT1BfTk9QOQBhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ekFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaMDEyMzQ1Njc4OQBPUF9OT1A4AEMuVVRGLTgAT1BfTk9QNwBPUF9OT1A2AGhhc2gyNTYAc2hhMjU2AE9QX0hBU0gyNTYAT1BfU0hBMjU2ADE2AE9QX05PUDUAMTUAT1BfTk9QNABPUF9QVVNIREFUQTQAMTQAMTMAbl9zdWJzID09IDMAT1BfUkVTRVJWRUQyAE9QX1BVU0hEQVRBMgBkYXRhX3NpemUgPT0gMzIAMTIAbl9zdWJzID09IDIAT1BfTk9QMQBPUF9SRVNFUlZFRDEAT1BfUFVTSERBVEExAE9QX1NIQTEAMTEALTEAbl9rZXlzID09IDEAbnVtX3R5cGVzID09IDEAbl9zdWJzID09IDEAcmVzdWx0cy5zaXplKCkgPT0gMQBjb25zdHJ1Y3RlZC5zaXplKCkgPT0gMQByZXNfVy5zaXplKCkgPT0gMQByZXNfQi5zaXplKCkgPT0gMQBoYXNoMTYwAHJpcGVtZDE2MABPUF9IQVNIMTYwAE9QX1JJUEVNRDE2MABkYXRhX3NpemUgPT0gMjAAbl9rZXlzID49IDEgJiYgbl9rZXlzIDw9IDIwAE9QX05PUDEwAHN0cmF0LT5zdWIuc2l6ZSgpID4gMABuX2tleXMgPT0gMABuX3N1YnMgPT0gMABsID09IDAAayA9PSAwAGRhdGFfc2l6ZSA9PSAwAC4ALAAhKGUgPDwgIm4iX21zdCkgfHwgIShlIDw8ICJ6Il9tc3QpACEoZSA8PCAiViJfbXN0KSB8fCAhKGUgPDwgInUiX21zdCkAIShlIDw8ICJLIl9tc3QpIHx8IChlIDw8ICJ1Il9tc3QpACEoZSA8PCAiSyJfbXN0KSB8fCAoZSA8PCAicyJfbXN0KQAhKGUgPDwgInoiX21zdCkgfHwgIShlIDw8ICJvIl9tc3QpACEoZSA8PCAieiJfbXN0KSB8fCAoZSA8PCAibSJfbXN0KQAhKGUgPDwgImUiX21zdCkgfHwgIShlIDw8ICJmIl9tc3QpACEoZSA8PCAiZCJfbXN0KSB8fCAhKGUgPDwgImYiX21zdCkAIShlIDw8ICJWIl9tc3QpIHx8IChlIDw8ICJmIl9tc3QpACEoZSA8PCAiViJfbXN0KSB8fCAhKGUgPDwgImUiX21zdCkAIShlIDw8ICJWIl9tc3QpIHx8ICEoZSA8PCAiZCJfbXN0KQAhKGUgPDwgImUiX21zdCkgfHwgKGUgPDwgImQiX21zdCkAIShlIDw8ICJuIl9tc3QpIHx8ICEoZSA8PCAiVyJfbXN0KQAobnVsbCkAaGFzaDI1NihIKQBzaGEyNTYoSCkAaGFzaDE2MChIKQByaXBlbWQxNjAoSCkAaGFzaDE2MCg5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5KQByaXBlbWQxNjAoOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OSkAaGFzaDI1Nig4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4KQBzaGEyNTYoODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OCkAb3BlcmF0b3IoKQBrIDw9IHNhdHMuc2l6ZSgpAHJlc3VsdHMuc2l6ZSgpID49IG5vZGUuc3Vicy5zaXplKCkAcy5zaXplKCkgPT0gZmlsdGVyW2pdLnNpemUoKQAgLiw7LV8vOj9AKCkAaGFzaDI1NigpAGhhc2gxNjAoKQByaXBlbWQxNjAoKQBhbmRfdigAYW5kb3IoAGFmdGVyKABvbGRlcigAYW5kX24oAHBrKABwa19rKABtdWx0aSgAb3JfaSgAdGhyZXNoKABwa2goAHBrX2goAG9yX2QoAG9yX2MoAG9yX2IoAGFuZF9iKABoYXNoMjU2KABzaGEyNTYoAGhhc2gxNjAoAHJpcGVtZDE2MCgAPEhBU0gxNjAoACEqJygpOzpAJj0rJCwvPyNbXS1fLn4lACBvZiAAIFdVPC9saT48bGk+SW5wdXQ6IAA8dWw+PGxpPlNjcmlwdDogACYjMTM7bWF4IG9wczogAFtleGNlcHRpb246IAAmIzEzO3NjcmlwdGxlbjogACBXVTwvbGk+PGxpPlRvdGFsOiAAJiMxMzttYXggc3RhY2sgc2l6ZTogAFNpemU6IAA8c3BhbiB0aXRsZT0idHlwZTogACAg\");l(e,5584,\"////////////////////////////////////////////////////////////////AAECAwQFBgcICf////////8KCwwNDg///////////////////////////////////woLDA0OD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////4QAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADEDwAAgw8AAFcPAADcDwAAtw0AAFQQAACtDwAAdA8AAGUPAABNDwAAQg8AABMPAAALDwAA+w4AALIQAADZDwAAoA8AAGcPAABkDwAATA8AAEEPAADFCwAAfAsAAB8NAAAlDQAAOg0AAC4NAABeDQAAQw0AADUKAADvCwAA0gwAAOAMAAC8CwAArAsAAKQLAACLCwAA/woAANsLAACbCwAA8AwAALQLAACUCwAAzAsAAIMLAADKDAAAWQwAAPgKAADTCwAAwgwAADMLAABKCwAAKwsAAA4LAABMDQAA7goAAKUNAABUCwAAWgsAAGgMAAA/CgAAtw8AAHYPAADKDQAA3w0AADYMAADmCgAAVA0AADoLAAAHCwAAgAwAAMMNAADYDQAALwwAAN8KAACeDQAAIQsAABcLAACsDQAAcgsAALYMAABOCgAAcQwAAA4MAAAaDAAAjQwAAKAMAAD5CwAA0goAAAAMAABzEAAA0Q8AADcPAABoEAAALA8AAGELAAD+DAAAYAoAAAoNAAByCgAArw8AAIkKAACgCgAATw8AAEQPAAAVDwAADQ8AAP0OAAC2DgAArBAAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAOQLAADkCwAA5AsAAI0NAAAEXwAABF8AAARfAAAEXwAABF8AAARfAAAEXwAABF8AAARfAAAEXwAAFF8AACRfAAA0XwAARF8AAFRfAABkXwAAdF8AAIRfAACUXwAApF8AAMRfAAC0XwAA1F8AAORfAAAEXwAABF8=\");l(e,6976,\"MDEyMzQ1Njc4OWFiY2RlZgAAAAAAAAAAJAEAACUBAAAmAQAAJwEAACgBAAAAAAAAGQAKABkZGQAAAAAFAAAAAAAACQAAAAALAAAAAAAAAAAZABEKGRkZAwoHAAEACQsYAAAJBgsAAAsABhkAAAAZGRk=\");l(e,7105,\"DgAAAAAAAAAAGQAKDRkZGQANAAACAAkOAAAACQAOAAAO\");l(e,7163,\"DA==\");l(e,7175,\"EwAAAAATAAAAAAkMAAAAAAAMAAAM\");l(e,7221,\"EA==\");l(e,7233,\"DwAAAAQPAAAAAAkQAAAAAAAQAAAQ\");l(e,7279,\"Eg==\");l(e,7291,\"EQAAAAARAAAAAAkSAAAAAAASAAASAAAaAAAAGhoa\");l(e,7346,\"GgAAABoaGgAAAAAAAAk=\");l(e,7395,\"FA==\");l(e,7407,\"FwAAAAAXAAAAAAkUAAAAAAAUAAAU\");l(e,7453,\"Fg==\");l(e,7465,\"FQAAAAAVAAAAAAkWAAAAAAAWAAAWAAAwMTIzNDU2Nzg5QUJDREVGAAAAAAIAAAADAAAABQAAAAcAAAALAAAADQAAABEAAAATAAAAFwAAAB0AAAAfAAAAJQAAACkAAAArAAAALwAAADUAAAA7AAAAPQAAAEMAAABHAAAASQAAAE8AAABTAAAAWQAAAGEAAABlAAAAZwAAAGsAAABtAAAAcQAAAH8AAACDAAAAiQAAAIsAAACVAAAAlwAAAJ0AAACjAAAApwAAAK0AAACzAAAAtQAAAL8AAADBAAAAxQAAAMcAAADTAAAAAQAAAAsAAAANAAAAEQAAABMAAAAXAAAAHQAAAB8AAAAlAAAAKQAAACsAAAAvAAAANQAAADsAAAA9AAAAQwAAAEcAAABJAAAATwAAAFMAAABZAAAAYQAAAGUAAABnAAAAawAAAG0AAABxAAAAeQAAAH8AAACDAAAAiQAAAIsAAACPAAAAlQAAAJcAAACdAAAAowAAAKcAAACpAAAArQAAALMAAAC1AAAAuwAAAL8AAADBAAAAxQAAAMcAAADRAAAAAAAAALwfAAApAQAAKgEAACsBAAAsAQAALQEAAC4BAAAvAQAAMAEAADEBAAAyAQAAMwEAADQBAAA1AQAANgEAAAAAAABQIAAANwEAADgBAAArAQAALAEAADkBAAA6AQAALwEAADABAAAxAQAAOwEAADMBAAA8AQAANQEAAD0BAABOU3QzX18yOWJhc2ljX2lvc0ljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRQAAACRZAABQHwAAXCEAAE5TdDNfXzIxNWJhc2ljX3N0cmVhbWJ1ZkljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRQAAAADkWAAAiB8AAE5TdDNfXzIxM2Jhc2ljX29zdHJlYW1JY05TXzExY2hhcl90cmFpdHNJY0VFRUUAAABXAADEHwAAAAAAAAEAAAB8HwAAA/T//05TdDNfXzIxNWJhc2ljX3N0cmluZ2J1ZkljTlNfMTFjaGFyX3RyYWl0c0ljRUVOU185YWxsb2NhdG9ySWNFRUVFAAAAJFkAAAwgAAC8HwAAOAAAAAAAAAD0IAAAPgEAAD8BAADI////yP////QgAABAAQAAQQEAADgAAAAAAAAA9B8AAEIBAABDAQAAyP///8j////0HwAARAEAAEUBAABOU3QzX18yMTliYXNpY19vc3RyaW5nc3RyZWFtSWNOU18xMWNoYXJfdHJhaXRzSWNFRU5TXzlhbGxvY2F0b3JJY0VFRUUAAAAkWQAArCAAAPQfAAAAAAAArCEAAEYBAABHAQAASAEAAEkBAABKAQAASwEAAEwBAAAAAAAAgCEAALEAAABNAQAATgEAAAAAAABcIQAATwEAAFABAABOU3QzX18yOGlvc19iYXNlRQAAAORYAABIIQAATlN0M19fMjhpb3NfYmFzZTdmYWlsdXJlRQAAACRZAABkIQAAlFUAAE5TdDNfXzIxOV9faW9zdHJlYW1fY2F0ZWdvcnlFAAAAJFkAAIwhAADkVQ==\");l(e,8640,\"/////////////////////////////////////////////////////////////////wABAgMEBQYHCAn/////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP///////8KCwwNDg8QERITFBUWFxgZGhscHR4fICEiI/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAQIEBwMGBQAAAAAAAADRdJ4AV529KoBwUg///z4nCgAAAGQAAADoAwAAECcAAKCGAQBAQg8AgJaYAADh9QUYAAAANQAAAHEAAABr////zvv//5K///8AAAAAAAAAAN4SBJUAAAAA////////////////\");l(e,9024,\"TENfQ1RZUEUAAAAATENfTlVNRVJJQwAATENfVElNRQAAAAAATENfQ09MTEFURQAATENfTU9ORVRBUlkATENfTUVTU0FHRVMAICMAABQAAABDLlVURi04\");l(e,9652,\"AQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACAAAAAhAAAAIgAAACMAAAAkAAAAJQAAACYAAAAnAAAAKAAAACkAAAAqAAAAKwAAACwAAAAtAAAALgAAAC8AAAAwAAAAMQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAOgAAADsAAAA8AAAAPQAAAD4AAAA/AAAAQAAAAGEAAABiAAAAYwAAAGQAAABlAAAAZgAAAGcAAABoAAAAaQAAAGoAAABrAAAAbAAAAG0AAABuAAAAbwAAAHAAAABxAAAAcgAAAHMAAAB0AAAAdQAAAHYAAAB3AAAAeAAAAHkAAAB6AAAAWwAAAFwAAABdAAAAXgAAAF8AAABgAAAAYQAAAGIAAABjAAAAZAAAAGUAAABmAAAAZwAAAGgAAABpAAAAagAAAGsAAABsAAAAbQAAAG4AAABvAAAAcAAAAHEAAAByAAAAcwAAAHQAAAB1AAAAdgAAAHcAAAB4AAAAeQAAAHoAAAB7AAAAfAAAAH0AAAB+AAAAfw==\");l(e,11188,\"AQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACAAAAAhAAAAIgAAACMAAAAkAAAAJQAAACYAAAAnAAAAKAAAACkAAAAqAAAAKwAAACwAAAAtAAAALgAAAC8AAAAwAAAAMQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAAAA5AAAAOgAAADsAAAA8AAAAPQAAAD4AAAA/AAAAQAAAAEEAAABCAAAAQwAAAEQAAABFAAAARgAAAEcAAABIAAAASQAAAEoAAABLAAAATAAAAE0AAABOAAAATwAAAFAAAABRAAAAUgAAAFMAAABUAAAAVQAAAFYAAABXAAAAWAAAAFkAAABaAAAAWwAAAFwAAABdAAAAXgAAAF8AAABgAAAAQQAAAEIAAABDAAAARAAAAEUAAABGAAAARwAAAEgAAABJAAAASgAAAEsAAABMAAAATQAAAE4AAABPAAAAUAAAAFEAAABSAAAAUwAAAFQAAABVAAAAVgAAAFcAAABYAAAAWQAAAFoAAAB7AAAAfAAAAH0AAAB+AAAAfw==\");l(e,12208,\"AgAAwAMAAMAEAADABQAAwAYAAMAHAADACAAAwAkAAMAKAADACwAAwAwAAMANAADADgAAwA8AAMAQAADAEQAAwBIAAMATAADAFAAAwBUAAMAWAADAFwAAwBgAAMAZAADAGgAAwBsAAMAcAADAHQAAwB4AAMAfAADAAAAAswEAAMMCAADDAwAAwwQAAMMFAADDBgAAwwcAAMMIAADDCQAAwwoAAMMLAADDDAAAww0AANMOAADDDwAAwwAADLsBAAzDAgAMwwMADMMEAAzbAAAAADAxMjM0NTY3ODlhYmNkZWZBQkNERUZ4WCstcFBpSW5OACVJOiVNOiVTICVwJUg6JU0=\");l(e,12480,\"JQAAAG0AAAAvAAAAJQAAAGQAAAAvAAAAJQAAAHkAAAAlAAAAWQAAAC0AAAAlAAAAbQAAAC0AAAAlAAAAZAAAACUAAABJAAAAOgAAACUAAABNAAAAOgAAACUAAABTAAAAIAAAACUAAABwAAAAAAAAACUAAABIAAAAOgAAACUAAABN\");l(e,12624,\"JQAAAEgAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAAAAAAxDoAAFEBAABSAQAAUwEAAAAAAAAkOwAAVAEAAFUBAABTAQAAVgEAAFcBAABYAQAAWQEAAFoBAABbAQAAXAEAAF0B\");l(e,12736,\"BAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABQIAAAUAAAAFAAAABQAAAAUAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAADAgAAggAAAIIAAACCAAAAggAAAIIAAACCAAAAggAAAIIAAACCAAAAggAAAIIAAACCAAAAggAAAIIAAACCAAAAQgEAAEIBAABCAQAAQgEAAEIBAABCAQAAQgEAAEIBAABCAQAAQgEAAIIAAACCAAAAggAAAIIAAACCAAAAggAAAIIAAAAqAQAAKgEAACoBAAAqAQAAKgEAACoBAAAqAAAAKgAAACoAAAAqAAAAKgAAACoAAAAqAAAAKgAAACoAAAAqAAAAKgAAACoAAAAqAAAAKgAAACoAAAAqAAAAKgAAACoAAAAqAAAAKgAAAIIAAACCAAAAggAAAIIAAACCAAAAggAAADIBAAAyAQAAMgEAADIBAAAyAQAAMgEAADIAAAAyAAAAMgAAADIAAAAyAAAAMgAAADIAAAAyAAAAMgAAADIAAAAyAAAAMgAAADIAAAAyAAAAMgAAADIAAAAyAAAAMgAAADIAAAAyAAAAggAAAIIAAACCAAAAggAAAAQ=\");l(e,13764,\"jDoAAF4BAABfAQAAUwEAAGABAABhAQAAYgEAAGMBAABkAQAAZQEAAGYBAAAAAAAAXDsAAGcBAABoAQAAUwEAAGkBAABqAQAAawEAAGwBAABtAQAAAAAAAIA7AABuAQAAbwEAAFMBAABwAQAAcQEAAHIBAABzAQAAdAEAAHQAAAByAAAAdQAAAGUAAAAAAAAAZgAAAGEAAABsAAAAcwAAAGUAAAAAAAAAJQAAAG0AAAAvAAAAJQAAAGQAAAAvAAAAJQAAAHkAAAAAAAAAJQAAAEgAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAAAAAAJQAAAGEAAAAgAAAAJQAAAGIAAAAgAAAAJQAAAGQAAAAgAAAAJQAAAEgAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAgAAAAJQAAAFkAAAAAAAAAJQAAAEkAAAA6AAAAJQAAAE0AAAA6AAAAJQAAAFMAAAAgAAAAJQAAAHA=\");l(e,14140,\"ZDcAAHUBAAB2AQAAUwEAAE5TdDNfXzI2bG9jYWxlNWZhY2V0RQAAACRZAABMNwAA3FUAAAAAAADkNwAAdQEAAHcBAABTAQAAeAEAAHkBAAB6AQAAewEAAHwBAAB9AQAAfgEAAH8BAACAAQAAgQEAAIIBAACDAQAATlN0M19fMjVjdHlwZUl3RUUATlN0M19fMjEwY3R5cGVfYmFzZUUAAORYAADGNwAAAFcAALQ3AAAAAAAAAgAAAGQ3AAACAAAA3DcAAAIAAAAAAAAAeDgAAHUBAACEAQAAUwEAAIUBAACGAQAAhwEAAIgBAACJAQAAigEAAIsBAABOU3QzX18yN2NvZGVjdnRJY2MxMV9fbWJzdGF0ZV90RUUATlN0M19fMjEyY29kZWN2dF9iYXNlRQAAAADkWAAAVjgAAABXAAA0OAAAAAAAAAIAAABkNwAAAgAAAHA4AAACAAAAAAAAAOw4AAB1AQAAjAEAAFMBAACNAQAAjgEAAI8BAACQAQAAkQEAAJIBAACTAQAATlN0M19fMjdjb2RlY3Z0SURzYzExX19tYnN0YXRlX3RFRQAAAFcAAMg4AAAAAAAAAgAAAGQ3AAACAAAAcDgAAAIAAAAAAAAAYDkAAHUBAACUAQAAUwEAAJUBAACWAQAAlwEAAJgBAACZAQAAmgEAAJsBAABOU3QzX18yN2NvZGVjdnRJRHNEdTExX19tYnN0YXRlX3RFRQAAVwAAPDkAAAAAAAACAAAAZDcAAAIAAABwOAAAAgAAAAAAAADUOQAAdQEAAJwBAABTAQAAnQEAAJ4BAACfAQAAoAEAAKEBAACiAQAAowEAAE5TdDNfXzI3Y29kZWN2dElEaWMxMV9fbWJzdGF0ZV90RUUAAABXAACwOQAAAAAAAAIAAABkNwAAAgAAAHA4AAACAAAAAAAAAEg6AAB1AQAApAEAAFMBAAClAQAApgEAAKcBAACoAQAAqQEAAKoBAACrAQAATlN0M19fMjdjb2RlY3Z0SURpRHUxMV9fbWJzdGF0ZV90RUUAAFcAACQ6AAAAAAAAAgAAAGQ3AAACAAAAcDgAAAIAAABOU3QzX18yN2NvZGVjdnRJd2MxMV9fbWJzdGF0ZV90RUUAAAAAVwAAaDoAAAAAAAACAAAAZDcAAAIAAABwOAAAAgAAAE5TdDNfXzI2bG9jYWxlNV9faW1wRQAAACRZAACsOgAAZDcAAE5TdDNfXzI3Y29sbGF0ZUljRUUAJFkAANA6AABkNwAATlN0M19fMjdjb2xsYXRlSXdFRQAkWQAA8DoAAGQ3AABOU3QzX18yNWN0eXBlSWNFRQAAAABXAAAQOwAAAAAAAAIAAABkNwAAAgAAANw3AAACAAAATlN0M19fMjhudW1wdW5jdEljRUUAAAAAJFkAAEQ7AABkNwAATlN0M19fMjhudW1wdW5jdEl3RUUAAAAAJFkAAGg7AABkNwAAAAAAAOQ6AACsAQAArQEAAFMBAACuAQAArwEAALABAAAAAAAABDsAALEBAACyAQAAUwEAALMBAAC0AQAAtQEAAAAAAACgPAAAdQEAALYBAABTAQAAtwEAALgBAAC5AQAAugEAALsBAAC8AQAAvQEAAL4BAAC/AQAAwAEAAMEBAABOU3QzX18yN251bV9nZXRJY05TXzE5aXN0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzI5X19udW1fZ2V0SWNFRQBOU3QzX18yMTRfX251bV9nZXRfYmFzZUUAAORYAABmPAAAAFcAAFA8AAAAAAAAAQAAAIA8AAAAAAAAAFcAAAw8AAAAAAAAAgAAAGQ3AAACAAAAiDw=\");l(e,15556,\"dD0AAHUBAADCAQAAUwEAAMMBAADEAQAAxQEAAMYBAADHAQAAyAEAAMkBAADKAQAAywEAAMwBAADNAQAATlN0M19fMjdudW1fZ2V0SXdOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yOV9fbnVtX2dldEl3RUUAAAAAVwAARD0AAAAAAAABAAAAgDwAAAAAAAAAVwAAAD0AAAAAAAACAAAAZDcAAAIAAABcPQ==\");l(e,15768,\"XD4AAHUBAADOAQAAUwEAAM8BAADQAQAA0QEAANIBAADTAQAA1AEAANUBAADWAQAATlN0M19fMjdudW1fcHV0SWNOU18xOW9zdHJlYW1idWZfaXRlcmF0b3JJY05TXzExY2hhcl90cmFpdHNJY0VFRUVFRQBOU3QzX18yOV9fbnVtX3B1dEljRUUATlN0M19fMjE0X19udW1fcHV0X2Jhc2VFAADkWAAAIj4AAABXAAAMPgAAAAAAAAEAAAA8PgAAAAAAAABXAADIPQAAAAAAAAIAAABkNwAAAgAAAEQ+\");l(e,16e3,\"JD8AAHUBAADXAQAAUwEAANgBAADZAQAA2gEAANsBAADcAQAA3QEAAN4BAADfAQAATlN0M19fMjdudW1fcHV0SXdOU18xOW9zdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yOV9fbnVtX3B1dEl3RUUAAAAAVwAA9D4AAAAAAAABAAAAPD4AAAAAAAAAVwAAsD4AAAAAAAACAAAAZDcAAAIAAAAMPw==\");l(e,16200,\"JEAAAOABAADhAQAAUwEAAOIBAADjAQAA5AEAAOUBAADmAQAA5wEAAOgBAAD4////JEAAAOkBAADqAQAA6wEAAOwBAADtAQAA7gEAAO8BAABOU3QzX18yOHRpbWVfZ2V0SWNOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJY05TXzExY2hhcl90cmFpdHNJY0VFRUVFRQBOU3QzX18yOXRpbWVfYmFzZUUA5FgAAN0/AABOU3QzX18yMjBfX3RpbWVfZ2V0X2Nfc3RvcmFnZUljRUUAAADkWAAA+D8AAABXAACYPwAAAAAAAAMAAABkNwAAAgAAAPA/AAACAAAAHEAAAAAIAAAAAAAAEEEAAPABAADxAQAAUwEAAPIBAADzAQAA9AEAAPUBAAD2AQAA9wEAAPgBAAD4////EEEAAPkBAAD6AQAA+wEAAPwBAAD9AQAA/gEAAP8BAABOU3QzX18yOHRpbWVfZ2V0SXdOU18xOWlzdHJlYW1idWZfaXRlcmF0b3JJd05TXzExY2hhcl90cmFpdHNJd0VFRUVFRQBOU3QzX18yMjBfX3RpbWVfZ2V0X2Nfc3RvcmFnZUl3RUUAAORYAADlQAAAAFcAAKBAAAAAAAAAAwAAAGQ3AAACAAAA8D8AAAIAAAAIQQAAAAgAAAAAAAC0QQAAAAIAAAECAABTAQAAAgIAAE5TdDNfXzI4dGltZV9wdXRJY05TXzE5b3N0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzIxMF9fdGltZV9wdXRFAAAA5FgAAJVBAAAAVwAAUEEAAAAAAAACAAAAZDcAAAIAAACsQQAAAAgAAAAAAAA0QgAAAwIAAAQCAABTAQAABQIAAE5TdDNfXzI4dGltZV9wdXRJd05TXzE5b3N0cmVhbWJ1Zl9pdGVyYXRvckl3TlNfMTFjaGFyX3RyYWl0c0l3RUVFRUVFAAAAAABXAADsQQAAAAAAAAIAAABkNwAAAgAAAKxBAAAACAAAAAAAAMhCAAB1AQAABgIAAFMBAAAHAgAACAIAAAkCAAAKAgAACwIAAAwCAAANAgAADgIAAA8CAABOU3QzX18yMTBtb25leXB1bmN0SWNMYjBFRUUATlN0M19fMjEwbW9uZXlfYmFzZUUAAAAA5FgAAKhCAAAAVwAAjEIAAAAAAAACAAAAZDcAAAIAAADAQgAAAgAAAAAAAAA8QwAAdQEAABACAABTAQAAEQIAABICAAATAgAAFAIAABUCAAAWAgAAFwIAABgCAAAZAgAATlN0M19fMjEwbW9uZXlwdW5jdEljTGIxRUVFAABXAAAgQwAAAAAAAAIAAABkNwAAAgAAAMBCAAACAAAAAAAAALBDAAB1AQAAGgIAAFMBAAAbAgAAHAIAAB0CAAAeAgAAHwIAACACAAAhAgAAIgIAACMCAABOU3QzX18yMTBtb25leXB1bmN0SXdMYjBFRUUAAFcAAJRDAAAAAAAAAgAAAGQ3AAACAAAAwEIAAAIAAAAAAAAAJEQAAHUBAAAkAgAAUwEAACUCAAAmAgAAJwIAACgCAAApAgAAKgIAACsCAAAsAgAALQIAAE5TdDNfXzIxMG1vbmV5cHVuY3RJd0xiMUVFRQAAVwAACEQAAAAAAAACAAAAZDcAAAIAAADAQgAAAgAAAAAAAADIRAAAdQEAAC4CAABTAQAALwIAADACAABOU3QzX18yOW1vbmV5X2dldEljTlNfMTlpc3RyZWFtYnVmX2l0ZXJhdG9ySWNOU18xMWNoYXJfdHJhaXRzSWNFRUVFRUUATlN0M19fMjExX19tb25leV9nZXRJY0VFAADkWAAApkQAAABXAABgRAAAAAAAAAIAAABkNwAAAgAAAMBE\");l(e,17644,\"bEUAAHUBAAAxAgAAUwEAADICAAAzAgAATlN0M19fMjltb25leV9nZXRJd05TXzE5aXN0cmVhbWJ1Zl9pdGVyYXRvckl3TlNfMTFjaGFyX3RyYWl0c0l3RUVFRUVFAE5TdDNfXzIxMV9fbW9uZXlfZ2V0SXdFRQAA5FgAAEpFAAAAVwAABEUAAAAAAAACAAAAZDcAAAIAAABkRQ==\");l(e,17808,\"EEYAAHUBAAA0AgAAUwEAADUCAAA2AgAATlN0M19fMjltb25leV9wdXRJY05TXzE5b3N0cmVhbWJ1Zl9pdGVyYXRvckljTlNfMTFjaGFyX3RyYWl0c0ljRUVFRUVFAE5TdDNfXzIxMV9fbW9uZXlfcHV0SWNFRQAA5FgAAO5FAAAAVwAAqEUAAAAAAAACAAAAZDcAAAIAAAAIRg==\");l(e,17972,\"tEYAAHUBAAA3AgAAUwEAADgCAAA5AgAATlN0M19fMjltb25leV9wdXRJd05TXzE5b3N0cmVhbWJ1Zl9pdGVyYXRvckl3TlNfMTFjaGFyX3RyYWl0c0l3RUVFRUVFAE5TdDNfXzIxMV9fbW9uZXlfcHV0SXdFRQAA5FgAAJJGAAAAVwAATEYAAAAAAAACAAAAZDcAAAIAAACsRg==\");l(e,18136,\"LEcAAHUBAAA6AgAAUwEAADsCAAA8AgAAPQIAAE5TdDNfXzI4bWVzc2FnZXNJY0VFAE5TdDNfXzIxM21lc3NhZ2VzX2Jhc2VFAAAAAORYAAAJRwAAAFcAAPRGAAAAAAAAAgAAAGQ3AAACAAAAJEcAAAIAAAAAAAAAhEcAAHUBAAA+AgAAUwEAAD8CAABAAgAAQQIAAE5TdDNfXzI4bWVzc2FnZXNJd0VFAAAAAABXAABsRwAAAAAAAAIAAABkNwAAAgAAACRHAAACAAAAUwAAAHUAAABuAAAAZAAAAGEAAAB5AAAAAAAAAE0AAABvAAAAbgAAAGQAAABhAAAAeQAAAAAAAABUAAAAdQAAAGUAAABzAAAAZAAAAGEAAAB5AAAAAAAAAFcAAABlAAAAZAAAAG4AAABlAAAAcwAAAGQAAABhAAAAeQAAAAAAAABUAAAAaAAAAHUAAAByAAAAcwAAAGQAAABhAAAAeQAAAAAAAABGAAAAcgAAAGkAAABkAAAAYQAAAHkAAAAAAAAAUwAAAGEAAAB0AAAAdQAAAHIAAABkAAAAYQAAAHkAAAAAAAAAUwAAAHUAAABuAAAAAAAAAE0AAABvAAAAbgAAAAAAAABUAAAAdQAAAGUAAAAAAAAAVwAAAGUAAABkAAAAAAAAAFQAAABoAAAAdQAAAAAAAABGAAAAcgAAAGkAAAAAAAAAUwAAAGEAAAB0AAAAAAAAAEoAAABhAAAAbgAAAHUAAABhAAAAcgAAAHkAAAAAAAAARgAAAGUAAABiAAAAcgAAAHUAAABhAAAAcgAAAHkAAAAAAAAATQAAAGEAAAByAAAAYwAAAGgAAAAAAAAAQQAAAHAAAAByAAAAaQAAAGwAAAAAAAAATQAAAGEAAAB5AAAAAAAAAEoAAAB1AAAAbgAAAGUAAAAAAAAASgAAAHUAAABsAAAAeQAAAAAAAABBAAAAdQAAAGcAAAB1AAAAcwAAAHQAAAAAAAAAUwAAAGUAAABwAAAAdAAAAGUAAABtAAAAYgAAAGUAAAByAAAAAAAAAE8AAABjAAAAdAAAAG8AAABiAAAAZQAAAHIAAAAAAAAATgAAAG8AAAB2AAAAZQAAAG0AAABiAAAAZQAAAHIAAAAAAAAARAAAAGUAAABjAAAAZQAAAG0AAABiAAAAZQAAAHIAAAAAAAAASgAAAGEAAABuAAAAAAAAAEYAAABlAAAAYgAAAAAAAABNAAAAYQAAAHIAAAAAAAAAQQAAAHAAAAByAAAAAAAAAEoAAAB1AAAAbgAAAAAAAABKAAAAdQAAAGwAAAAAAAAAQQAAAHUAAABnAAAAAAAAAFMAAABlAAAAcAAAAAAAAABPAAAAYwAAAHQAAAAAAAAATgAAAG8AAAB2AAAAAAAAAEQAAABlAAAAYwAAAAAAAABBAAAATQAAAAAAAABQAAAATQ==\");l(e,19228,\"HEAAAOkBAADqAQAA6wEAAOwBAADtAQAA7gEAAO8BAAAAAAAACEEAAPkBAAD6AQAA+wEAAPwBAAD9AQAA/gEAAP8BAABOU3QzX18yMTRfX3NoYXJlZF9jb3VudEU=\");l(e,19348,\"iCM=\");l(e,19372,\"Tm8gZXJyb3IgaW5mb3JtYXRpb24ASWxsZWdhbCBieXRlIHNlcXVlbmNlAERvbWFpbiBlcnJvcgBSZXN1bHQgbm90IHJlcHJlc2VudGFibGUATm90IGEgdHR5AFBlcm1pc3Npb24gZGVuaWVkAE9wZXJhdGlvbiBub3QgcGVybWl0dGVkAE5vIHN1Y2ggZmlsZSBvciBkaXJlY3RvcnkATm8gc3VjaCBwcm9jZXNzAEZpbGUgZXhpc3RzAFZhbHVlIHRvbyBsYXJnZSBmb3IgZGF0YSB0eXBlAE5vIHNwYWNlIGxlZnQgb24gZGV2aWNlAE91dCBvZiBtZW1vcnkAUmVzb3VyY2UgYnVzeQBJbnRlcnJ1cHRlZCBzeXN0ZW0gY2FsbABSZXNvdXJjZSB0ZW1wb3JhcmlseSB1bmF2YWlsYWJsZQBJbnZhbGlkIHNlZWsAQ3Jvc3MtZGV2aWNlIGxpbmsAUmVhZC1vbmx5IGZpbGUgc3lzdGVtAERpcmVjdG9yeSBub3QgZW1wdHkAQ29ubmVjdGlvbiByZXNldCBieSBwZWVyAE9wZXJhdGlvbiB0aW1lZCBvdXQAQ29ubmVjdGlvbiByZWZ1c2VkAEhvc3QgaXMgZG93bgBIb3N0IGlzIHVucmVhY2hhYmxlAEFkZHJlc3MgaW4gdXNlAEJyb2tlbiBwaXBlAEkvTyBlcnJvcgBObyBzdWNoIGRldmljZSBvciBhZGRyZXNzAEJsb2NrIGRldmljZSByZXF1aXJlZABObyBzdWNoIGRldmljZQBOb3QgYSBkaXJlY3RvcnkASXMgYSBkaXJlY3RvcnkAVGV4dCBmaWxlIGJ1c3kARXhlYyBmb3JtYXQgZXJyb3IASW52YWxpZCBhcmd1bWVudABBcmd1bWVudCBsaXN0IHRvbyBsb25nAFN5bWJvbGljIGxpbmsgbG9vcABGaWxlbmFtZSB0b28gbG9uZwBUb28gbWFueSBvcGVuIGZpbGVzIGluIHN5c3RlbQBObyBmaWxlIGRlc2NyaXB0b3JzIGF2YWlsYWJsZQBCYWQgZmlsZSBkZXNjcmlwdG9yAE5vIGNoaWxkIHByb2Nlc3MAQmFkIGFkZHJlc3MARmlsZSB0b28gbGFyZ2UAVG9vIG1hbnkgbGlua3MATm8gbG9ja3MgYXZhaWxhYmxlAFJlc291cmNlIGRlYWRsb2NrIHdvdWxkIG9jY3VyAFN0YXRlIG5vdCByZWNvdmVyYWJsZQBQcmV2aW91cyBvd25lciBkaWVkAE9wZXJhdGlvbiBjYW5jZWxlZABGdW5jdGlvbiBub3QgaW1wbGVtZW50ZWQATm8gbWVzc2FnZSBvZiBkZXNpcmVkIHR5cGUASWRlbnRpZmllciByZW1vdmVkAERldmljZSBub3QgYSBzdHJlYW0ATm8gZGF0YSBhdmFpbGFibGUARGV2aWNlIHRpbWVvdXQAT3V0IG9mIHN0cmVhbXMgcmVzb3VyY2VzAExpbmsgaGFzIGJlZW4gc2V2ZXJlZABQcm90b2NvbCBlcnJvcgBCYWQgbWVzc2FnZQBGaWxlIGRlc2NyaXB0b3IgaW4gYmFkIHN0YXRlAE5vdCBhIHNvY2tldABEZXN0aW5hdGlvbiBhZGRyZXNzIHJlcXVpcmVkAE1lc3NhZ2UgdG9vIGxhcmdlAFByb3RvY29sIHdyb25nIHR5cGUgZm9yIHNvY2tldABQcm90b2NvbCBub3QgYXZhaWxhYmxlAFByb3RvY29sIG5vdCBzdXBwb3J0ZWQAU29ja2V0IHR5cGUgbm90IHN1cHBvcnRlZABOb3Qgc3VwcG9ydGVkAFByb3RvY29sIGZhbWlseSBub3Qgc3VwcG9ydGVkAEFkZHJlc3MgZmFtaWx5IG5vdCBzdXBwb3J0ZWQgYnkgcHJvdG9jb2wAQWRkcmVzcyBub3QgYXZhaWxhYmxlAE5ldHdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATXVsdGlob3AgYXR0ZW1wdGVkAFJlcXVpcmVkIGtleSBub3QgYXZhaWxhYmxlAEtleSBoYXMgZXhwaXJlZABLZXkgaGFzIGJlZW4gcmV2b2tlZABLZXkgd2FzIHJlamVjdGVkIGJ5IHNlcnZpY2U=\");l(e,21298,\"pQJbAPABtQWMBSUBgwYdA5QE/wDHAzEDCwa8AY8BfwPKBCsA2gavAEIDTgPcAQ4EFQChBg0BlAILAjgGZAK8Av8CXQPnBAsHzwLLBe8F2wXhAh4GRQKFAIICbANvBPEA8wMYBdkA2gNMBlQCewGdA70EAABRABUCuwCzA20A/wGFBC8F+QQ4AGUBRgGfALcGqAFzAlMB\");l(e,21496,\"IQQAAAAAAAAAAC8C\");l(e,21528,\"NQRHBFYE\");l(e,21550,\"oAQ=\");l(e,21570,\"RgVgBW4FYQYAAM8BAAAAAAAAAADJBukG+QYeBzkHSQdeBw==\");l(e,21620,\"CgAAAGQAAADoAwAAECcAAKCGAQBAQg8AgJaYAADh9QUAypo7AAAAAAAAAAAwMDAxMDIwMzA0MDUwNjA3MDgwOTEwMTExMjEzMTQxNTE2MTcxODE5MjAyMTIyMjMyNDI1MjYyNzI4MjkzMDMxMzIzMzM0MzUzNjM3MzgzOTQwNDE0MjQzNDQ0NTQ2NDc0ODQ5NTA1MTUyNTM1NDU1NTY1NzU4NTk2MDYxNjI2MzY0NjU2NjY3Njg2OTcwNzE3MjczNzQ3NTc2Nzc3ODc5ODA4MTgyODM4NDg1ODY4Nzg4ODk5MDkxOTI5Mzk0OTU5Njk3OTg5OQAAAACUVQAAQgIAAEMCAABOAQAATlN0M19fMjEyc3lzdGVtX2Vycm9yRQAAJFkAAHxVAACIWAAATlN0M19fMjE0ZXJyb3JfY2F0ZWdvcnlFAAAAAORYAACgVQAATlN0M19fMjEyX19kb19tZXNzYWdlRQAA5FgAAGBLAAAkWQAAxFUAALxVAAAAAAAA3FUAAEQCAABFAgAARgIAAE4xMF9fY3h4YWJpdjExNl9fc2hpbV90eXBlX2luZm9FAAAAACRZAAAEVgAAFFkAAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAACRZAAA0VgAAKFYAAE4xMF9fY3h4YWJpdjExN19fcGJhc2VfdHlwZV9pbmZvRQAAACRZAABkVgAAKFYAAE4xMF9fY3h4YWJpdjExOV9fcG9pbnRlcl90eXBlX2luZm9FACRZAACUVgAAiFYAAE4xMF9fY3h4YWJpdjEyMF9fc2lfY2xhc3NfdHlwZV9pbmZvRQAAAAAkWQAAxFYAAFhWAAAAAAAASFcAAEgCAABJAgAASgIAAEsCAABMAgAATQIAAE4CAABPAgAATjEwX19jeHhhYml2MTIxX192bWlfY2xhc3NfdHlwZV9pbmZvRQAAACRZAAAgVwAAWFYAAAAAAACwVwAABQAAAFACAABRAgAAAAAAALxXAAAFAAAAUgIAAFMCAABTdDlleGNlcHRpb24AU3QyMGJhZF9hcnJheV9uZXdfbGVuZ3RoAFN0OWJhZF9hbGxvYwAAJFkAAKJXAABQWQAAJFkAAIlXAACwVwAAAAAAAABYAAAHAAAAVAIAAFUCAAAAAAAAiFgAAFwAAABWAgAATgEAAFN0MTFsb2dpY19lcnJvcgAkWQAA8FcAAFBZAAAAAAAANFgAAAcAAABXAgAAVQIAAFN0MTJsZW5ndGhfZXJyb3IAAAAAJFkAACBYAAAAWAAAAAAAAGhYAAAHAAAAWAIAAFUCAABTdDEyb3V0X29mX3JhbmdlAAAAACRZAABUWAAAAFgAAFN0MTNydW50aW1lX2Vycm9yAAAAJFkAAHRYAABQWQAAAAAAALxYAABcAAAAWQIAAE4BAABTdDE0b3ZlcmZsb3dfZXJyb3IAACRZAACoWAAAiFgAAAAAAABYWQAArQAAAFoCAABbAgAAAAAAAFhWAABIAgAAXAIAAEoCAABLAgAATAIAAF0CAABeAgAAXwIAAFN0OXR5cGVfaW5mbwAAAADkWAAABFkAAAAAAADsVgAASAIAAGACAABKAgAASwIAAEwCAABhAgAAYgIAAGMCAABTdDhiYWRfY2FzdADkWAAAfFcAACRZAABEWQAAUFkAAAAAAABQWQAABQAAAGQCAABlAg==\");l(e,22904,\"0GoBAAghAABHAg==\");}var r=new ArrayBuffer(16);var s=new Int32Array(r);var t=new Float32Array(r);var u=new Float64Array(r);function v(w){return s[w]}function x(w,y){s[w]=y;}function z(){return u[0]}function A(y){u[0]=y;}function B(){throw new Error(\"abort\")}function C(){return t[2]}function D(y){t[2]=y;}function Za(q){var E=q.a;var F=E.a;var G=F.buffer;var H=new Int8Array(G);var I=new Int16Array(G);var J=new Int32Array(G);var K=new Uint8Array(G);var L=new Uint16Array(G);var M=new Uint32Array(G);var N=new Float32Array(G);var O=new Float64Array(G);var P=Math.imul;var Q=Math.fround;var R=Math.abs;var S=Math.clz32;var W=Math.ceil;var Z=E.b;var _=E.c;var $=E.d;var aa=E.e;var ba=E.f;var ca=E.g;var da=E.h;var ea=E.i;var fa=E.j;var ga=E.k;var ha=E.l;var ia=E.m;var ja=E.n;var ka=E.o;var la=E.p;var ma=E.q;var na=E.r;var oa=E.s;var pa=E.t;var qa=E.u;var ra=E.v;var sa=E.w;var ta=E.x;var ua=E.y;var va=E.z;var wa=E.A;var xa=E.B;var ya=E.C;var za=E.D;var Aa=E.E;var Ba=E.F;var Ca=E.G;var Da=E.H;var Ea=E.I;var Fa=E.J;var Ga=E.K;var Ha=E.L;var Ia=E.M;var Ja=E.N;var Ka=E.O;var La=E.P;var Ma=E.Q;var Na=E.R;var Oa=E.S;var Pa=E.T;var Qa=E.U;var Ra=E.V;var Sa=E.W;var Ta=E.X;var Ua=92880;var Va=0;var Wa=0;\n\t\t// EMSCRIPTEN_START_FUNCS\n\t\tfunction Vm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=Ua-352|0;Ua=e;J[e+328>>2]=0;J[e+320>>2]=0;J[e+324>>2]=0;J[5996]=0;J[e+316>>2]=0;J[e+308>>2]=0;J[e+312>>2]=0;f=$(3,24)|0;d=J[5996];J[5996]=0;a:{b:{c:{if((d|0)!=1){J[f+8>>2]=-1;J[f+12>>2]=-1;J[f>>2]=0;J[f+16>>2]=-1;J[f+20>>2]=-1;c=f+24|0;J[e+328>>2]=c;J[e+320>>2]=f;m=e+296|0;d:{e:{f:{g:{h:{i:{j:{k:{l:{while(1){d=c-24|0;g=J[d+20>>2];J[m>>2]=J[d+16>>2];J[m+4>>2]=g;g=J[d+12>>2];J[e+288>>2]=J[d+8>>2];J[e+292>>2]=g;h=J[d+4>>2];g=J[d>>2];J[e+280>>2]=g;J[e+284>>2]=h;J[e+324>>2]=d;l=18;m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{x:{y:{z:{switch(g|0){case 0:c=J[b+4>>2];A:{if((c|0)<2){f=-1;break A}g=J[b>>2];f=1;while(1){h=K[f+g|0];if((h|0)==58){l=0;B:{C:{D:{E:{while(1){F:{G:{switch(K[J[b>>2]+l|0]-97|0){case 0:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=3;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}H:{I:{J:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;K:{if(c>>>0>=178956971){J[5996]=0;ca(142);a=J[5996];J[5996]=0;if((a|0)==1){break K}break a}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break I}if(h>>>0<178956971){break J}J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break H}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=3;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 18:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=2;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}L:{M:{N:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;O:{if(c>>>0>=178956971){J[5996]=0;ca(142);break O}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break M}if(h>>>0<178956971){break N}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break L}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=2;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 2:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=4;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}P:{Q:{R:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;S:{if(c>>>0>=178956971){J[5996]=0;ca(142);break S}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break Q}if(h>>>0<178956971){break R}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break P}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=4;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 3:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=5;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}T:{U:{V:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;W:{if(c>>>0>=178956971){J[5996]=0;ca(142);break W}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break U}if(h>>>0<178956971){break V}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break T}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=5;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 9:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=7;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}X:{Y:{Z:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;_:{if(c>>>0>=178956971){J[5996]=0;ca(142);break _}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break Y}if(h>>>0<178956971){break Z}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break X}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=7;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 13:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=8;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}$:{aa:{ba:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;ca:{if(c>>>0>=178956971){J[5996]=0;ca(142);break ca}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break aa}if(h>>>0<178956971){break ba}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break $}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=8;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 21:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=6;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}da:{ea:{fa:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;ga:{if(c>>>0>=178956971){J[5996]=0;ca(142);break ga}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break ea}if(h>>>0<178956971){break fa}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break da}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=6;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 20:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=9;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}ha:{ia:{ja:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;ka:{if(c>>>0>=178956971){J[5996]=0;ca(142);break ka}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break ia}if(h>>>0<178956971){break ja}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break ha}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=9;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 19:d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=10;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}la:{ma:{na:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;oa:{if(c>>>0>=178956971){J[5996]=0;ca(142);break oa}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break ma}if(h>>>0<178956971){break na}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break la}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=10;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);break F}b=Z()|0;break b;case 11:break G;default:break B}}J[5996]=0;d=$(3,104)|0;c=J[5996];J[5996]=0;if((c|0)==1){break E}J[d>>2]=7e3;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;g=ba(143,d+12|0,0,0)|0;c=J[5996];J[5996]=0;if((c|0)==1){b=Z()|0;$a(d);break b}J[e+244>>2]=d;J[e+240>>2]=g;c=J[e+312>>2];pa:{if(c>>>0<M[e+316>>2]){J[c+4>>2]=d;J[c>>2]=g;J[e+312>>2]=c+8;break pa}J[5996]=0;aa(144,e+308|0,e+240|0);d=J[5996];J[5996]=0;if((d|0)==1){break D}d=J[e+244>>2];if(!d){break pa}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break pa}Xa[J[J[d>>2]+8>>2]](d);bb(d);}d=J[e+324>>2];h=J[e+328>>2];if(d>>>0<h>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=18;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break F}qa:{ra:{g=J[e+320>>2];j=(d-g|0)/24|0;c=j+1|0;sa:{if(c>>>0>=178956971){J[5996]=0;ca(142);break sa}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break qa}if(h>>>0<178956971){break ra}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break C}}c=P(j,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=18;J[c+16>>2]=-1;J[c+20>>2]=-1;j=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;k=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=k;k=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=k;k=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=k;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=j;J[e+320>>2]=c;if(!d){break F}$a(d);}l=l+1|0;if((l|0)!=(f|0)){continue}break}d=J[e+324>>2];break A}b=Z()|0;break b}b=Z()|0;mb(e+240|0);break b}b=Z()|0;break b}J[a>>2]=0;J[a+4>>2]=0;break l}if((h-97&255)>>>0>25){f=-1;break A}f=f+1|0;if((c|0)>(f|0)){continue}break}f=-1;}ta:{h=J[e+328>>2];ua:{if(h>>>0>d>>>0){J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=1;J[d+16>>2]=-1;J[d+20>>2]=-1;J[e+324>>2]=d+24;break ua}va:{wa:{g=J[e+320>>2];l=(d-g|0)/24|0;c=l+1|0;xa:{if(c>>>0>=178956971){J[5996]=0;ca(142);break xa}h=(h-g|0)/24|0;i=h<<1;h=h>>>0>=89478485?178956970:c>>>0<i>>>0?i:c;if(!h){i=0;break va}if(h>>>0<178956971){break wa}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(h,24)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break ta}}c=P(l,24)+i|0;J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=1;J[c+16>>2]=-1;J[c+20>>2]=-1;l=c+24|0;if((d|0)!=(g|0)){while(1){d=d-24|0;j=J[d+4>>2];c=c-24|0;J[c>>2]=J[d>>2];J[c+4>>2]=j;j=J[d+20>>2];J[c+16>>2]=J[d+16>>2];J[c+20>>2]=j;j=J[d+12>>2];J[c+8>>2]=J[d+8>>2];J[c+12>>2]=j;if((d|0)!=(g|0)){continue}break}d=g;}J[e+328>>2]=P(h,24)+i;J[e+324>>2]=l;J[e+320>>2]=c;if(!d){break ua}$a(d);}d=f+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];break m}b=Z()|0;break b;case 21:ya:{d=J[b+4>>2];if(d){c=J[b>>2];if(K[c|0]==41){break ya}}J[a>>2]=0;J[a+4>>2]=0;break l}J[b+4>>2]=d-1;J[b>>2]=c+1;break m;case 20:za:{d=J[b+4>>2];if(d){c=J[b>>2];if(K[c|0]==44){break za}}J[a>>2]=0;J[a+4>>2]=0;break l}J[b+4>>2]=d-1;J[b>>2]=c+1;break m;case 19:g=J[b+4>>2];if(!g){J[a>>2]=0;J[a+4>>2]=0;break l}Aa:{Ba:{Ca:{Da:{Ea:{Fa:{h=J[b>>2];switch(K[h|0]-41|0){case 0:break Ea;case 3:break Fa;default:break Da}}J[b+4>>2]=g-1;J[b>>2]=h+1;g=J[e+292>>2];h=J[e+288>>2]+1|0;g=h?g:g+1|0;Ga:{Ha:{i=J[e+328>>2];Ia:{if(i>>>0>d>>>0){J[d>>2]=19;J[d+8>>2]=h;J[d+12>>2]=g;f=J[e+300>>2];J[d+16>>2]=J[e+296>>2];J[d+20>>2]=f;J[e+324>>2]=c;break Ia}Ja:{Ka:{l=(d-f|0)/24|0;c=l+1|0;La:{if(c>>>0>=178956971){J[5996]=0;ca(142);break La}i=(i-f|0)/24|0;j=i<<1;c=i>>>0>=89478485?178956970:c>>>0<j>>>0?j:c;if(!c){i=0;break Ja}if(c>>>0<178956971){break Ka}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(c,24)|0)|0;j=J[5996];J[5996]=0;if((j|0)==1){break Ha}}l=P(l,24)+i|0;J[l+8>>2]=h;J[l+12>>2]=g;J[l>>2]=19;g=J[e+300>>2];J[l+16>>2]=J[e+296>>2];J[l+20>>2]=g;i=P(c,24)+i|0;c=l+24|0;Ma:{if((d|0)==(f|0)){J[e+328>>2]=i;J[e+324>>2]=c;J[e+320>>2]=l;break Ma}while(1){d=d-24|0;h=J[d+4>>2];l=l-24|0;g=l;J[g>>2]=J[d>>2];J[g+4>>2]=h;g=J[d+20>>2];J[l+16>>2]=J[d+16>>2];J[l+20>>2]=g;g=J[d+12>>2];J[l+8>>2]=J[d+8>>2];J[l+12>>2]=g;if((d|0)!=(f|0)){continue}break}J[e+328>>2]=i;J[e+324>>2]=c;J[e+320>>2]=l;if(!f){break Ia}}$a(f);i=J[e+328>>2];c=J[e+324>>2];}if(c>>>0<i>>>0){J[c+8>>2]=-1;J[c+12>>2]=-1;J[c>>2]=0;J[c+16>>2]=-1;J[c+20>>2]=-1;J[e+324>>2]=c+24;break m}Na:{Oa:{f=J[e+320>>2];h=(c-f|0)/24|0;d=h+1|0;Pa:{if(d>>>0>=178956971){J[5996]=0;ca(142);break Pa}g=(i-f|0)/24|0;i=g<<1;g=g>>>0>=89478485?178956970:d>>>0<i>>>0?i:d;if(!g){i=0;break Na}if(g>>>0<178956971){break Oa}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[5996]=0;i=$(3,P(g,24)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Ga}}d=P(h,24)+i|0;J[d+8>>2]=-1;J[d+12>>2]=-1;J[d>>2]=0;J[d+16>>2]=-1;J[d+20>>2]=-1;h=d+24|0;if((c|0)!=(f|0)){while(1){c=c-24|0;l=J[c+4>>2];d=d-24|0;J[d>>2]=J[c>>2];J[d+4>>2]=l;l=J[c+20>>2];J[d+16>>2]=J[c+16>>2];J[d+20>>2]=l;l=J[c+12>>2];J[d+8>>2]=J[c+8>>2];J[d+12>>2]=l;if((c|0)!=(f|0)){continue}break}c=f;}J[e+328>>2]=P(g,24)+i;J[e+324>>2]=h;J[e+320>>2]=d;if(!c){break m}$a(c);break m}b=Z()|0;break b}b=Z()|0;break b}d=J[e+288>>2];c=J[e+292>>2];f=J[e+300>>2];if(d>>>0<M[e+296>>2]&(c|0)<=(f|0)|(c|0)<(f|0)){J[a>>2]=0;J[a+4>>2]=0;break l}J[b+4>>2]=g-1;J[b>>2]=h+1;J[e+340>>2]=0;J[e+332>>2]=0;J[e+336>>2]=0;if(!d&(c|0)<=0|(c|0)<0){break Ba}f=0;c=0;d=J[e+312>>2];while(1){Qa:{g=d-8|0;h=J[e+336>>2];Ra:{if(h>>>0<M[e+340>>2]){J[h>>2]=J[g>>2];i=d-4|0;J[h+4>>2]=J[i>>2];J[g>>2]=0;J[i>>2]=0;J[e+336>>2]=h+8;break Ra}J[5996]=0;aa(144,e+332|0,g|0);d=J[5996];J[5996]=0;if((d|0)==1){break Qa}d=J[e+312>>2];g=J[d-4>>2];if(!g){break Ra}h=J[g+4>>2];J[g+4>>2]=h-1;if(h){break Ra}Xa[J[J[g>>2]+8>>2]](g);bb(g);}d=d-8|0;J[e+312>>2]=d;f=f+1|0;c=f?c:c+1|0;g=J[e+292>>2];if(M[e+288>>2]>f>>>0&(g|0)>=(c|0)|(c|0)<(g|0)){continue}break Ca}break}b=Z()|0;break Aa}J[a>>2]=0;J[a+4>>2]=0;break l}d=J[e+332>>2];f=J[e+336>>2];if((d|0)==(f|0)){break Ba}c=f-8|0;if(c>>>0<=d>>>0){break Ba}while(1){g=J[d>>2];J[d>>2]=J[c>>2];J[c>>2]=g;g=J[d+4>>2];f=f-4|0;J[d+4>>2]=J[f>>2];J[f>>2]=g;f=c;d=d+8|0;c=c-8|0;if(d>>>0<c>>>0){continue}break}}J[5996]=0;f=$(3,104)|0;d=J[5996];J[5996]=0;Sa:{Ta:{if((d|0)!=1){J[f>>2]=7e3;J[f+4>>2]=0;J[f+8>>2]=0;J[5996]=0;J[e+240>>2]=J[e+332>>2];d=J[e+336>>2];c=J[e+340>>2];J[e+340>>2]=0;J[e+244>>2]=d;J[e+248>>2]=c;J[e+332>>2]=0;J[e+336>>2]=0;h=ia(64,f+12|0,24,e+240|0,J[e+296>>2])|0;d=J[5996];J[5996]=0;if((d|0)==1){break Sa}c=J[e+240>>2];if(c){d=J[e+244>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;g=J[d+4>>2];Ua:{if(!g){break Ua}i=J[g+4>>2];J[g+4>>2]=i-1;if(i){break Ua}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((c|0)!=(d|0)){continue}break}c=J[e+240>>2];}$a(c);}J[e+348>>2]=f;J[e+344>>2]=h;d=J[e+312>>2];Va:{if(d>>>0<M[e+316>>2]){J[d+4>>2]=f;J[d>>2]=h;J[e+312>>2]=d+8;break Va}J[5996]=0;aa(144,e+308|0,e+344|0);d=J[5996];J[5996]=0;if((d|0)==1){break Ta}d=J[e+348>>2];if(!d){break Va}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break Va}Xa[J[J[d>>2]+8>>2]](d);bb(d);}c=J[e+332>>2];if(!c){break m}d=J[e+336>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];Wa:{if(!f){break Wa}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break Wa}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+332>>2];}$a(c);break m}b=Z()|0;break Aa}b=Z()|0;mb(e+344|0);break Aa}b=Z()|0;lb(e+240|0);$a(f);}lb(e+332|0);break b;case 14:c=J[e+312>>2];d=c-8|0;J[e+332>>2]=J[d>>2];J[e+336>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;d=c-16|0;J[e+344>>2]=J[d>>2];J[e+348>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[e+312>>2]=d;J[5996]=0;f=e+240|0;ga(145,f|0,c-24|0,e+344|0,e+332|0);d=J[5996];J[5996]=0;Xa:{Ya:{Za:{if((d|0)!=1){J[5996]=0;d=$(3,104)|0;c=J[5996];J[5996]=0;if((c|0)==1){break Za}J[5996]=0;c=ba(146,d|0,23,f|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){b=Z()|0;$a(d);break Ya}f=J[e+312>>2]-8|0;J[f>>2]=c+12;d=J[f+4>>2];J[f+4>>2]=c;_a:{if(!d){break _a}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break _a}Xa[J[J[d>>2]+8>>2]](d);bb(d);}f=J[e+240>>2];if(f){d=J[e+244>>2];c=f;if((d|0)!=(c|0)){while(1){d=d-8|0;c=J[d+4>>2];$a:{if(!c){break $a}g=J[c+4>>2];J[c+4>>2]=g-1;if(g){break $a}Xa[J[J[c>>2]+8>>2]](c);bb(c);}if((d|0)!=(f|0)){continue}break}c=J[e+240>>2];}J[e+244>>2]=f;$a(c);}d=J[e+348>>2];ab:{if(!d){break ab}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break ab}Xa[J[J[d>>2]+8>>2]](d);bb(d);}d=J[e+336>>2];if(!d){break m}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break m}Xa[J[J[d>>2]+8>>2]](d);bb(d);break m}b=Z()|0;break Xa}b=Z()|0;}lb(e+240|0);}mb(e+344|0);mb(e+332|0);break b;case 18:l=22;break y;case 17:l=21;break y;case 16:l=20;break y;case 15:l=19;break y;case 1:break n;case 3:break o;case 2:break p;case 4:break q;case 5:break r;case 7:break s;case 8:break t;case 6:break u;case 9:break v;case 10:break w;case 11:break x;case 13:break y;case 12:break z;default:break m}}l=17;}f=J[e+312>>2];c=f-8|0;J[e+344>>2]=J[c>>2];J[e+348>>2]=J[c+4>>2];J[c>>2]=0;J[c+4>>2]=0;J[e+312>>2]=c;J[5996]=0;J[e+340>>2]=0;J[e+332>>2]=0;J[e+336>>2]=0;d=$(3,16)|0;g=J[5996];J[5996]=0;bb:{if((g|0)==1){b=Z()|0;break bb}J[e+332>>2]=d;g=d+16|0;J[e+340>>2]=g;f=f-16|0;J[d>>2]=J[f>>2];J[d+4>>2]=J[f+4>>2];J[f>>2]=0;J[f+4>>2]=0;J[d+8>>2]=J[e+344>>2];J[d+12>>2]=J[e+348>>2];J[e+336>>2]=g;J[e+344>>2]=0;J[e+348>>2]=0;J[5996]=0;f=$(3,104)|0;h=J[5996];J[5996]=0;if((h|0)!=1){J[f>>2]=7e3;J[f+4>>2]=0;J[f+8>>2]=0;J[e+244>>2]=g;J[e+240>>2]=d;J[e+332>>2]=0;J[e+336>>2]=0;J[5996]=0;d=J[e+340>>2];J[e+340>>2]=0;J[e+248>>2]=d;g=ia(64,f+12|0,l|0,e+240|0,0)|0;d=J[5996];J[5996]=0;if((d|0)!=1){l=J[e+240>>2];if(l){d=J[e+244>>2];if((l|0)!=(d|0)){while(1){d=d-8|0;c=J[d+4>>2];cb:{if(!c){break cb}h=J[c+4>>2];J[c+4>>2]=h-1;if(h){break cb}Xa[J[J[c>>2]+8>>2]](c);bb(c);}if((d|0)!=(l|0)){continue}break}l=J[e+240>>2];c=J[e+312>>2];}$a(l);}c=c-8|0;J[c>>2]=g;d=J[c+4>>2];J[c+4>>2]=f;db:{if(!d){break db}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break db}Xa[J[J[d>>2]+8>>2]](d);bb(d);}c=J[e+332>>2];if(c){d=J[e+336>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];eb:{if(!f){break eb}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break eb}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+332>>2];}$a(c);}d=J[e+348>>2];if(!d){break m}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break m}Xa[J[J[d>>2]+8>>2]](d);bb(d);break m}b=Z()|0;lb(e+240|0);$a(f);break bb}b=Z()|0;}lb(e+332|0);mb(e+344|0);break b}c=J[e+312>>2];d=c-8|0;J[e+332>>2]=J[d>>2];J[e+336>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[e+312>>2]=d;J[5996]=0;d=$(3,104)|0;f=J[5996];J[5996]=0;fb:{gb:{hb:{ib:{jb:{if((f|0)!=1){J[d>>2]=7e3;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=ba(143,d+12|0,0,0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(d);break fb}J[e+348>>2]=d;J[e+344>>2]=f;J[5996]=0;f=e+240|0;ga(145,f|0,c-16|0,e+332|0,e+344|0);d=J[5996];J[5996]=0;if((d|0)==1){break jb}J[5996]=0;d=$(3,104)|0;c=J[5996];J[5996]=0;if((c|0)==1){break ib}J[5996]=0;c=ba(146,d|0,23,f|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){b=Z()|0;$a(d);break hb}f=J[e+312>>2]-8|0;J[f>>2]=c+12;d=J[f+4>>2];J[f+4>>2]=c;kb:{if(!d){break kb}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break kb}Xa[J[J[d>>2]+8>>2]](d);bb(d);}f=J[e+240>>2];if(f){d=J[e+244>>2];c=f;if((d|0)!=(c|0)){while(1){d=d-8|0;c=J[d+4>>2];lb:{if(!c){break lb}g=J[c+4>>2];J[c+4>>2]=g-1;if(g){break lb}Xa[J[J[c>>2]+8>>2]](c);bb(c);}if((d|0)!=(f|0)){continue}break}c=J[e+240>>2];}J[e+244>>2]=f;$a(c);}d=J[e+348>>2];mb:{if(!d){break mb}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break mb}Xa[J[J[d>>2]+8>>2]](d);bb(d);}d=J[e+336>>2];if(!d){break m}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break m}Xa[J[J[d>>2]+8>>2]](d);bb(d);break m}b=Z()|0;break fb}b=Z()|0;break gb}b=Z()|0;}lb(e+240|0);}mb(e+344|0);}mb(e+332|0);break b}J[5996]=0;c=J[e+312>>2];d=$(3,104)|0;f=J[5996];J[5996]=0;nb:{ob:{if((f|0)!=1){J[d>>2]=7e3;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=ba(143,d+12|0,1,0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(d);break b}J[e+336>>2]=d;J[e+332>>2]=f;J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=$(3,16)|0;f=J[5996];J[5996]=0;if((f|0)==1){b=Z()|0;break nb}J[e+240>>2]=d;g=d+16|0;J[e+248>>2]=g;f=c-8|0;J[d>>2]=J[f>>2];c=c-4|0;J[d+4>>2]=J[c>>2];J[f>>2]=0;J[c>>2]=0;J[d+8>>2]=J[e+332>>2];J[d+12>>2]=J[e+336>>2];J[e+244>>2]=g;J[e+332>>2]=0;J[e+336>>2]=0;J[5996]=0;d=$(3,104)|0;g=J[5996];J[5996]=0;if((g|0)==1){break ob}J[5996]=0;g=ba(146,d|0,17,e+240|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){b=Z()|0;$a(d);break nb}J[f>>2]=g+12;d=J[c>>2];J[c>>2]=g;pb:{if(!d){break pb}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break pb}Xa[J[J[d>>2]+8>>2]](d);bb(d);}f=J[e+240>>2];if(f){d=J[e+244>>2];c=f;if((d|0)!=(c|0)){while(1){d=d-8|0;c=J[d+4>>2];qb:{if(!c){break qb}g=J[c+4>>2];J[c+4>>2]=g-1;if(g){break qb}Xa[J[J[c>>2]+8>>2]](c);bb(c);}if((d|0)!=(f|0)){continue}break}c=J[e+240>>2];}J[e+244>>2]=f;$a(c);}d=J[e+336>>2];if(!d){break m}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break m}Xa[J[J[d>>2]+8>>2]](d);bb(d);break m}b=Z()|0;break b}b=Z()|0;}lb(e+240|0);mb(e+332|0);break b}J[5996]=0;c=J[e+312>>2];d=$(3,104)|0;f=J[5996];J[5996]=0;rb:{sb:{if((f|0)!=1){J[d>>2]=7e3;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=ba(143,d+12|0,0,0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(d);break b}J[e+336>>2]=d;J[e+332>>2]=f;J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=$(3,16)|0;f=J[5996];J[5996]=0;if((f|0)==1){b=Z()|0;break rb}J[e+240>>2]=d;g=d+16|0;J[e+248>>2]=g;f=c-8|0;J[d>>2]=J[f>>2];c=c-4|0;J[d+4>>2]=J[c>>2];J[f>>2]=0;J[c>>2]=0;J[d+8>>2]=J[e+332>>2];J[d+12>>2]=J[e+336>>2];J[e+244>>2]=g;J[e+332>>2]=0;J[e+336>>2]=0;J[5996]=0;d=$(3,104)|0;g=J[5996];J[5996]=0;if((g|0)==1){break sb}J[5996]=0;g=ba(146,d|0,22,e+240|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){b=Z()|0;$a(d);break rb}J[f>>2]=g+12;d=J[c>>2];J[c>>2]=g;tb:{if(!d){break tb}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break tb}Xa[J[J[d>>2]+8>>2]](d);bb(d);}f=J[e+240>>2];if(f){d=J[e+244>>2];c=f;if((d|0)!=(c|0)){while(1){d=d-8|0;c=J[d+4>>2];ub:{if(!c){break ub}g=J[c+4>>2];J[c+4>>2]=g-1;if(g){break ub}Xa[J[J[c>>2]+8>>2]](c);bb(c);}if((d|0)!=(f|0)){continue}break}c=J[e+240>>2];}J[e+244>>2]=f;$a(c);}d=J[e+336>>2];if(!d){break m}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break m}Xa[J[J[d>>2]+8>>2]](d);bb(d);break m}b=Z()|0;break b}b=Z()|0;}lb(e+240|0);mb(e+332|0);break b}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=J[e+312>>2];c=$(3,8)|0;f=J[5996];J[5996]=0;vb:{if((f|0)!=1){J[e+240>>2]=c;f=c+8|0;J[e+248>>2]=f;d=d-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[5996]=0;J[e+244>>2]=f;c=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)!=1){J[5996]=0;f=ba(146,c|0,14,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break vb}J[d>>2]=f+12;c=J[d+4>>2];J[d+4>>2]=f;wb:{if(!c){break wb}d=J[c+4>>2];J[c+4>>2]=d-1;if(d){break wb}Xa[J[J[c>>2]+8>>2]](c);bb(c);}c=J[e+240>>2];if(!c){break m}d=J[e+244>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];xb:{if(!f){break xb}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break xb}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+240>>2];}$a(c);break m}b=Z()|0;break vb}b=Z()|0;}lb(e+240|0);break b}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=J[e+312>>2];c=$(3,8)|0;f=J[5996];J[5996]=0;yb:{if((f|0)!=1){J[e+240>>2]=c;f=c+8|0;J[e+248>>2]=f;d=d-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[5996]=0;J[e+244>>2]=f;c=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)!=1){J[5996]=0;f=ba(146,c|0,16,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break yb}J[d>>2]=f+12;c=J[d+4>>2];J[d+4>>2]=f;zb:{if(!c){break zb}d=J[c+4>>2];J[c+4>>2]=d-1;if(d){break zb}Xa[J[J[c>>2]+8>>2]](c);bb(c);}c=J[e+240>>2];if(!c){break m}d=J[e+244>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];Ab:{if(!f){break Ab}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break Ab}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+240>>2];}$a(c);break m}b=Z()|0;break yb}b=Z()|0;}lb(e+240|0);break b}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=J[e+312>>2];c=$(3,8)|0;f=J[5996];J[5996]=0;Bb:{if((f|0)!=1){J[e+240>>2]=c;f=c+8|0;J[e+248>>2]=f;d=d-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[5996]=0;J[e+244>>2]=f;c=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)!=1){J[5996]=0;f=ba(146,c|0,15,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break Bb}J[d>>2]=f+12;c=J[d+4>>2];J[d+4>>2]=f;Cb:{if(!c){break Cb}d=J[c+4>>2];J[c+4>>2]=d-1;if(d){break Cb}Xa[J[J[c>>2]+8>>2]](c);bb(c);}c=J[e+240>>2];if(!c){break m}d=J[e+244>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];Db:{if(!f){break Db}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break Db}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+240>>2];}$a(c);break m}b=Z()|0;break Bb}b=Z()|0;}lb(e+240|0);break b}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=J[e+312>>2];c=$(3,8)|0;f=J[5996];J[5996]=0;Eb:{if((f|0)!=1){J[e+240>>2]=c;f=c+8|0;J[e+248>>2]=f;d=d-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[5996]=0;J[e+244>>2]=f;c=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)!=1){J[5996]=0;f=ba(146,c|0,13,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break Eb}J[d>>2]=f+12;c=J[d+4>>2];J[d+4>>2]=f;Fb:{if(!c){break Fb}d=J[c+4>>2];J[c+4>>2]=d-1;if(d){break Fb}Xa[J[J[c>>2]+8>>2]](c);bb(c);}c=J[e+240>>2];if(!c){break m}d=J[e+244>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];Gb:{if(!f){break Gb}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break Gb}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+240>>2];}$a(c);break m}b=Z()|0;break Eb}b=Z()|0;}lb(e+240|0);break b}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=J[e+312>>2];c=$(3,8)|0;f=J[5996];J[5996]=0;Hb:{if((f|0)!=1){J[e+240>>2]=c;f=c+8|0;J[e+248>>2]=f;d=d-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[5996]=0;J[e+244>>2]=f;c=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)!=1){J[5996]=0;f=ba(146,c|0,12,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break Hb}J[d>>2]=f+12;c=J[d+4>>2];J[d+4>>2]=f;Ib:{if(!c){break Ib}d=J[c+4>>2];J[c+4>>2]=d-1;if(d){break Ib}Xa[J[J[c>>2]+8>>2]](c);bb(c);}c=J[e+240>>2];if(!c){break m}d=J[e+244>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];Jb:{if(!f){break Jb}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break Jb}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+240>>2];}$a(c);break m}b=Z()|0;break Hb}b=Z()|0;}lb(e+240|0);break b}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=J[e+312>>2];c=$(3,8)|0;f=J[5996];J[5996]=0;Kb:{if((f|0)!=1){J[e+240>>2]=c;f=c+8|0;J[e+248>>2]=f;d=d-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[5996]=0;J[e+244>>2]=f;c=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)!=1){J[5996]=0;f=ba(146,c|0,11,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break Kb}J[d>>2]=f+12;c=J[d+4>>2];J[d+4>>2]=f;Lb:{if(!c){break Lb}d=J[c+4>>2];J[c+4>>2]=d-1;if(d){break Lb}Xa[J[J[c>>2]+8>>2]](c);bb(c);}c=J[e+240>>2];if(!c){break m}d=J[e+244>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];Mb:{if(!f){break Mb}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break Mb}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+240>>2];}$a(c);break m}b=Z()|0;break Kb}b=Z()|0;}lb(e+240|0);break b}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;d=J[e+312>>2];c=$(3,8)|0;f=J[5996];J[5996]=0;Nb:{if((f|0)!=1){J[e+240>>2]=c;f=c+8|0;J[e+248>>2]=f;d=d-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[5996]=0;J[e+244>>2]=f;c=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)!=1){J[5996]=0;f=ba(146,c|0,10,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break Nb}J[d>>2]=f+12;c=J[d+4>>2];J[d+4>>2]=f;Ob:{if(!c){break Ob}d=J[c+4>>2];J[c+4>>2]=d-1;if(d){break Ob}Xa[J[J[c>>2]+8>>2]](c);bb(c);}c=J[e+240>>2];if(!c){break m}d=J[e+244>>2];if((c|0)!=(d|0)){while(1){d=d-8|0;f=J[d+4>>2];Pb:{if(!f){break Pb}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break Pb}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(d|0)){continue}break}c=J[e+240>>2];}$a(c);break m}b=Z()|0;break Nb}b=Z()|0;}lb(e+240|0);break b}I[e+240>>1]=48;H[e+251|0]=1;Qb:{Rb:{Sb:{Tb:{d=J[b+4>>2];if(!d){H[e+251|0]=3;H[e+243|0]=0;I[e+240>>1]=K[5279]|K[5280]<<8;H[e+242|0]=K[5281];break Tb}c=J[b>>2];if(K[e+240|0]==K[c|0]){J[b+4>>2]=d-1;J[b>>2]=c+1;J[5996]=0;d=$(3,104)|0;c=J[5996];J[5996]=0;Ub:{if((c|0)!=1){J[d>>2]=7e3;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=ba(143,d+12|0,0,0)|0;c=J[5996];J[5996]=0;if((c|0)==1){b=Z()|0;$a(d);break b}J[e+244>>2]=d;J[e+240>>2]=f;c=J[e+312>>2];if(c>>>0<M[e+316>>2]){J[c+4>>2]=d;J[c>>2]=f;J[e+312>>2]=c+8;break m}J[5996]=0;aa(144,e+308|0,e+240|0);d=J[5996];J[5996]=0;if((d|0)==1){break Ub}d=J[e+244>>2];if(!d){break m}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break m}Xa[J[J[d>>2]+8>>2]](d);bb(d);break m}b=Z()|0;break b}b=Z()|0;mb(e+240|0);break b}H[e+251|0]=1;I[e+240>>1]=49;c=J[b>>2];if(K[c|0]==49){J[b+4>>2]=d-1;J[b>>2]=c+1;J[5996]=0;d=$(3,104)|0;c=J[5996];J[5996]=0;Vb:{if((c|0)!=1){J[d>>2]=7e3;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=ba(143,d+12|0,1,0)|0;c=J[5996];J[5996]=0;if((c|0)==1){b=Z()|0;$a(d);break b}J[e+244>>2]=d;J[e+240>>2]=f;c=J[e+312>>2];if(c>>>0<M[e+316>>2]){J[c+4>>2]=d;J[c>>2]=f;J[e+312>>2]=c+8;break m}J[5996]=0;aa(144,e+308|0,e+240|0);d=J[5996];J[5996]=0;if((d|0)==1){break Vb}d=J[e+244>>2];if(!d){break m}c=J[d+4>>2];J[d+4>>2]=c-1;if(c){break m}Xa[J[J[d>>2]+8>>2]](d);bb(d);break m}b=Z()|0;break b}b=Z()|0;mb(e+240|0);break b}H[e+243|0]=0;I[e+240>>1]=K[5279]|K[5280]<<8;H[e+242|0]=K[5281];H[e+251|0]=3;if(d>>>0<3){break Tb}Wb:{Xb:{Yb:{Zb:{_b:{$b:{ac:{bc:{cc:{dc:{ec:{fc:{gc:{c=J[b>>2];if(!(K[e+240|0]!=K[c|0]|K[e+241|0]!=K[c+1|0]|K[e+242|0]!=K[c+2|0])){g=d-3|0;J[b+4>>2]=g;J[b>>2]=c+3;if((g|0)<=0){break Wb}f=J[b>>2];c=J[b>>2];d=0;while(1){if(K[c+d|0]!=41){d=d+1|0;if((g|0)!=(d|0)){continue}break Wb}break}if(d-18>>>0<4294967279){break Wb}hc:{if(d>>>0<=10){H[e+251|0]=d;c=e+240|0;break hc}J[5996]=0;g=(d|15)+1|0;c=$(3,g|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break gc}J[e+240>>2]=c;J[e+244>>2]=d;J[e+248>>2]=g|-2147483648;}H[fb(c,f,d)+d|0]=0;J[e+272>>2]=J[e+244>>2];c=K[e+247|0]|K[e+248|0]<<8|(K[e+249|0]<<16|K[e+250|0]<<24);H[e+275|0]=c;H[e+276|0]=c>>>8;H[e+277|0]=c>>>16;H[e+278|0]=c>>>24;J[5996]=0;f=J[e+240>>2];g=H[e+251|0];J[e+340>>2]=0;J[e+332>>2]=0;J[e+336>>2]=0;c=$(3,12)|0;h=J[5996];J[5996]=0;if((h|0)!=1){J[e+332>>2]=c;h=c+12|0;J[e+340>>2]=h;J[c>>2]=f;J[c+4>>2]=J[e+272>>2];f=K[e+275|0]|K[e+276|0]<<8|(K[e+277|0]<<16|K[e+278|0]<<24);H[c+7|0]=f;H[c+8|0]=f>>>8;H[c+9|0]=f>>>16;H[c+10|0]=f>>>24;H[c+11|0]=g;H[e+275|0]=0;H[e+276|0]=0;H[e+277|0]=0;H[e+278|0]=0;J[e+272>>2]=0;J[e+336>>2]=h;J[5996]=0;c=$(3,104)|0;f=J[5996];J[5996]=0;ic:{jc:{if((f|0)!=1){J[5996]=0;f=ba(147,c|0,2,e+332|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break Xb}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;J[e+268>>2]=f;g=f+12|0;J[e+264>>2]=g;c=$(3,8)|0;h=J[5996];J[5996]=0;if((h|0)==1){break fc}J[e+240>>2]=c;h=c+8|0;J[e+248>>2]=h;J[c+4>>2]=f;J[c>>2]=g;J[e+244>>2]=h;J[e+264>>2]=0;J[e+268>>2]=0;J[5996]=0;f=$(3,104)|0;c=J[5996];J[5996]=0;if((c|0)==1){break jc}J[5996]=0;c=ba(146,f|0,12,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(f);break Yb}J[e+348>>2]=c;g=c+12|0;J[e+344>>2]=g;f=J[e+312>>2];kc:{if(f>>>0<M[e+316>>2]){J[f+4>>2]=c;J[f>>2]=g;J[e+312>>2]=f+8;J[e+344>>2]=0;J[e+348>>2]=0;break kc}J[5996]=0;aa(144,e+308|0,e+344|0);c=J[5996];J[5996]=0;if((c|0)==1){break ic}c=J[e+348>>2];if(!c){break kc}f=J[c+4>>2];J[c+4>>2]=f-1;if(f){break kc}Xa[J[J[c>>2]+8>>2]](c);bb(c);}g=J[e+240>>2];if(g){c=J[e+244>>2];f=g;if((c|0)!=(f|0)){while(1){c=c-8|0;f=J[c+4>>2];lc:{if(!f){break lc}h=J[f+4>>2];J[f+4>>2]=h-1;if(h){break lc}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(g|0)){continue}break}f=J[e+240>>2];}J[e+244>>2]=g;$a(f);}c=J[e+268>>2];mc:{if(!c){break mc}f=J[c+4>>2];J[c+4>>2]=f-1;if(f){break mc}Xa[J[J[c>>2]+8>>2]](c);bb(c);}g=J[e+332>>2];if(g){f=J[e+336>>2];if((g|0)!=(f|0)){while(1){c=f-12|0;if(H[f-1|0]<0){$a(J[c>>2]);}f=c;if((c|0)!=(g|0)){continue}break}}J[e+336>>2]=g;$a(g);}d=d+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];break m}b=Z()|0;break Xb}b=Z()|0;break Yb}b=Z()|0;mb(e+344|0);break Yb}b=Z()|0;rb(e+332|0);if((g|0)>=0){break b}$a(f);break b}H[e+244|0]=0;J[e+240>>2]=677931888;H[e+251|0]=4;if(d>>>0<4){break Sb}c=J[b>>2];if(!(K[e+240|0]!=K[c|0]|K[e+241|0]!=K[c+1|0]|(K[e+242|0]!=K[c+2|0]|K[e+243|0]!=K[c+3|0]))){g=d-4|0;J[b+4>>2]=g;J[b>>2]=c+4;if((g|0)<=0){break Zb}f=J[b>>2];c=J[b>>2];d=0;while(1){if(K[c+d|0]!=41){d=d+1|0;if((g|0)!=(d|0)){continue}break Zb}break}if(d-18>>>0<4294967279){break Zb}nc:{if(d>>>0<=10){H[e+251|0]=d;c=e+240|0;break nc}J[5996]=0;g=(d|15)+1|0;c=$(3,g|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break ec}J[e+240>>2]=c;J[e+244>>2]=d;J[e+248>>2]=g|-2147483648;}H[fb(c,f,d)+d|0]=0;J[e+272>>2]=J[e+244>>2];c=K[e+247|0]|K[e+248|0]<<8|(K[e+249|0]<<16|K[e+250|0]<<24);H[e+275|0]=c;H[e+276|0]=c>>>8;H[e+277|0]=c>>>16;H[e+278|0]=c>>>24;J[5996]=0;f=J[e+240>>2];g=H[e+251|0];J[e+340>>2]=0;J[e+332>>2]=0;J[e+336>>2]=0;c=$(3,12)|0;h=J[5996];J[5996]=0;if((h|0)!=1){J[e+332>>2]=c;h=c+12|0;J[e+340>>2]=h;J[c>>2]=f;J[c+4>>2]=J[e+272>>2];f=K[e+275|0]|K[e+276|0]<<8|(K[e+277|0]<<16|K[e+278|0]<<24);H[c+7|0]=f;H[c+8|0]=f>>>8;H[c+9|0]=f>>>16;H[c+10|0]=f>>>24;H[c+11|0]=g;H[e+275|0]=0;H[e+276|0]=0;H[e+277|0]=0;H[e+278|0]=0;J[e+272>>2]=0;J[e+336>>2]=h;J[5996]=0;c=$(3,104)|0;f=J[5996];J[5996]=0;oc:{pc:{if((f|0)!=1){J[5996]=0;f=ba(147,c|0,3,e+332|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(c);break _b}J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[5996]=0;J[e+268>>2]=f;g=f+12|0;J[e+264>>2]=g;c=$(3,8)|0;h=J[5996];J[5996]=0;if((h|0)==1){break dc}J[e+240>>2]=c;h=c+8|0;J[e+248>>2]=h;J[c+4>>2]=f;J[c>>2]=g;J[e+244>>2]=h;J[e+264>>2]=0;J[e+268>>2]=0;J[5996]=0;f=$(3,104)|0;c=J[5996];J[5996]=0;if((c|0)==1){break pc}J[5996]=0;c=ba(146,f|0,12,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(f);break $b}J[e+348>>2]=c;g=c+12|0;J[e+344>>2]=g;f=J[e+312>>2];qc:{if(f>>>0<M[e+316>>2]){J[f+4>>2]=c;J[f>>2]=g;J[e+312>>2]=f+8;J[e+344>>2]=0;J[e+348>>2]=0;break qc}J[5996]=0;aa(144,e+308|0,e+344|0);c=J[5996];J[5996]=0;if((c|0)==1){break oc}c=J[e+348>>2];if(!c){break qc}f=J[c+4>>2];J[c+4>>2]=f-1;if(f){break qc}Xa[J[J[c>>2]+8>>2]](c);bb(c);}g=J[e+240>>2];if(g){c=J[e+244>>2];f=g;if((c|0)!=(f|0)){while(1){c=c-8|0;f=J[c+4>>2];rc:{if(!f){break rc}h=J[f+4>>2];J[f+4>>2]=h-1;if(h){break rc}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((c|0)!=(g|0)){continue}break}f=J[e+240>>2];}J[e+244>>2]=g;$a(f);}c=J[e+268>>2];sc:{if(!c){break sc}f=J[c+4>>2];J[c+4>>2]=f-1;if(f){break sc}Xa[J[J[c>>2]+8>>2]](c);bb(c);}g=J[e+332>>2];if(g){f=J[e+336>>2];if((g|0)!=(f|0)){while(1){c=f-12|0;if(H[f-1|0]<0){$a(J[c>>2]);}f=c;if((c|0)!=(g|0)){continue}break}}J[e+336>>2]=g;$a(g);}d=d+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];break m}b=Z()|0;break _b}b=Z()|0;break $b}b=Z()|0;mb(e+344|0);break $b}b=Z()|0;rb(e+332|0);if((g|0)>=0){break b}$a(f);break b}H[e+245|0]=0;H[e+244|0]=K[5287];J[e+240>>2]=K[5283]|K[5284]<<8|(K[5285]<<16|K[5286]<<24);H[e+251|0]=5;if(d>>>0<5){break Rb}tc:{c=J[b>>2];if(K[e+240|0]!=K[c|0]|K[e+241|0]!=K[c+1|0]|(K[e+242|0]!=K[c+2|0]|K[e+243|0]!=K[c+3|0])){break tc}if(K[e+244|0]!=K[c+4|0]){break tc}g=d-5|0;J[b+4>>2]=g;J[b>>2]=c+5;if((g|0)<=0){break ac}f=J[b>>2];c=J[b>>2];d=0;while(1){if(K[c+d|0]!=41){d=d+1|0;if((g|0)!=(d|0)){continue}break ac}break}if(d-18>>>0<4294967279){break ac}uc:{if(d>>>0<=10){H[e+251|0]=d;c=e+240|0;break uc}J[5996]=0;g=(d|15)+1|0;c=$(3,g|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break cc}J[e+240>>2]=c;J[e+244>>2]=d;J[e+248>>2]=g|-2147483648;}H[fb(c,f,d)+d|0]=0;J[e+344>>2]=J[e+244>>2];c=K[e+247|0]|K[e+248|0]<<8|(K[e+249|0]<<16|K[e+250|0]<<24);H[e+347|0]=c;H[e+348|0]=c>>>8;H[e+349|0]=c>>>16;H[e+350|0]=c>>>24;J[5996]=0;f=J[e+240>>2];g=H[e+251|0];J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;c=$(3,12)|0;h=J[5996];J[5996]=0;if((h|0)!=1){J[e+240>>2]=c;h=c+12|0;J[e+248>>2]=h;J[c>>2]=f;J[c+4>>2]=J[e+344>>2];f=K[e+347|0]|K[e+348|0]<<8|(K[e+349|0]<<16|K[e+350|0]<<24);H[c+7|0]=f;H[c+8|0]=f>>>8;H[c+9|0]=f>>>16;H[c+10|0]=f>>>24;H[c+11|0]=g;H[e+347|0]=0;H[e+348|0]=0;H[e+349|0]=0;H[e+350|0]=0;J[e+344>>2]=0;J[e+244>>2]=h;J[5996]=0;f=$(3,104)|0;c=J[5996];J[5996]=0;vc:{wc:{if((c|0)!=1){J[5996]=0;c=ba(147,f|0,2,e+240|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){b=Z()|0;$a(f);break vc}J[e+336>>2]=c;g=c+12|0;J[e+332>>2]=g;f=J[e+312>>2];xc:{if(f>>>0<M[e+316>>2]){J[f+4>>2]=c;J[f>>2]=g;J[e+312>>2]=f+8;J[e+332>>2]=0;J[e+336>>2]=0;break xc}J[5996]=0;aa(144,e+308|0,e+332|0);c=J[5996];J[5996]=0;if((c|0)==1){break wc}c=J[e+336>>2];if(!c){break xc}f=J[c+4>>2];J[c+4>>2]=f-1;if(f){break xc}Xa[J[J[c>>2]+8>>2]](c);bb(c);}g=J[e+240>>2];if(g){f=J[e+244>>2];if((g|0)!=(f|0)){while(1){c=f-12|0;if(H[f-1|0]<0){$a(J[c>>2]);}f=c;if((c|0)!=(g|0)){continue}break}}J[e+244>>2]=g;$a(g);}d=d+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];break m}b=Z()|0;break vc}b=Z()|0;mb(e+332|0);}rb(e+240|0);break b}b=Z()|0;rb(e+240|0);if((g|0)>=0){break b}$a(f);break b}H[e+245|0]=0;H[e+244|0]=K[5319];H[e+251|0]=5;f=K[5315]|K[5316]<<8|(K[5317]<<16|K[5318]<<24);J[e+240>>2]=f;c=J[b>>2];if(K[c|0]!=(f&255)|K[e+241|0]!=K[c+1|0]|(K[e+242|0]!=K[c+2|0]|K[e+243|0]!=K[c+3|0])){break Qb}if(K[e+244|0]!=K[c+4|0]){break Qb}J[b+4>>2]=d-5;J[b>>2]=c+5;d=J[b>>2];c=J[b+4>>2];J[5996]=0;f=e+240|0;Na(148,f|0,d|0,c|0);d=J[5996];J[5996]=0;if((d|0)==1){break bc}yc:{zc:{Ac:{Bc:{Cc:{if(K[e+256|0]){J[5996]=0;d=e+332|0;aa(149,d|0,f|0);c=J[5996];J[5996]=0;if((c|0)==1){break Cc}J[5996]=0;c=e+344|0;ea(150,c|0,3,d|0);f=J[5996];J[5996]=0;if((f|0)==1){break Bc}J[5996]=0;aa(151,e+308|0,c|0);f=J[5996];J[5996]=0;if((f|0)==1){break Ac}mb(c);rb(d);d=J[e+252>>2]+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];if(!K[e+256|0]|H[e+251|0]>=0){break m}$a(J[e+240>>2]);break m}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break yc}b=Z()|0;break zc}b=Z()|0;mb(e+344|0);}rb(e+332|0);}if(!K[e+256|0]|H[e+251|0]>=0){break b}$a(J[e+240>>2]);break b}b=Z()|0;break b}b=Z()|0;break Yb}b=Z()|0;break b}b=Z()|0;break $b}b=Z()|0;break b}b=Z()|0;break b}J[a>>2]=0;J[a+4>>2]=0;break l}lb(e+240|0);mb(e+264|0);}rb(e+332|0);break b}J[a>>2]=0;J[a+4>>2]=0;break l}lb(e+240|0);mb(e+264|0);}rb(e+332|0);break b}J[a>>2]=0;J[a+4>>2]=0;break l}H[e+244|0]=0;J[e+240>>2]=677931888;H[e+251|0]=4;}H[e+245|0]=0;H[e+244|0]=K[5287];H[e+251|0]=5;J[e+240>>2]=K[5283]|K[5284]<<8|(K[5285]<<16|K[5286]<<24);}H[e+245|0]=0;H[e+244|0]=K[5319];H[e+251|0]=5;J[e+240>>2]=K[5315]|K[5316]<<8|(K[5317]<<16|K[5318]<<24);}J[5996]=0;d=_(30,e+228|0,5355)|0;c=J[5996];J[5996]=0;Dc:{Ec:{Fc:{if((c|0)!=1){c=vb(d,b);if(H[e+239|0]<0){$a(J[d>>2]);}if(!c){break Dc}d=J[b>>2];c=J[b+4>>2];J[5996]=0;bd(e+240|0,d,c,32);d=J[5996];J[5996]=0;if((d|0)==1){break Fc}if(K[e+256|0]){break Ec}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}b=Z()|0;break b}J[5996]=0;d=e+332|0;ea(153,d|0,6,e+240|0);c=J[5996];J[5996]=0;Gc:{Hc:{if((c|0)!=1){J[5996]=0;aa(151,e+308|0,d|0);c=J[5996];J[5996]=0;if((c|0)==1){break Hc}mb(d);d=J[e+252>>2]+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];if(!K[e+256|0]){break m}d=J[e+240>>2];if(!d){break m}$a(d);break m}b=Z()|0;break Gc}b=Z()|0;mb(e+332|0);}if(!K[e+256|0]){break b}a=J[e+240>>2];if(!a){break b}$a(a);break b}J[5996]=0;d=_(30,e+216|0,5372)|0;c=J[5996];J[5996]=0;Ic:{Jc:{Kc:{if((c|0)!=1){c=vb(d,b);if(H[e+227|0]<0){$a(J[d>>2]);}if(!c){break Ic}d=J[b>>2];c=J[b+4>>2];J[5996]=0;bd(e+240|0,d,c,20);d=J[5996];J[5996]=0;if((d|0)==1){break Kc}if(K[e+256|0]){break Jc}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}b=Z()|0;break b}J[5996]=0;d=e+332|0;ea(153,d|0,8,e+240|0);c=J[5996];J[5996]=0;Lc:{Mc:{if((c|0)!=1){J[5996]=0;aa(151,e+308|0,d|0);c=J[5996];J[5996]=0;if((c|0)==1){break Mc}mb(d);d=J[e+252>>2]+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];if(!K[e+256|0]){break m}d=J[e+240>>2];if(!d){break m}$a(d);break m}b=Z()|0;break Lc}b=Z()|0;mb(e+332|0);}if(!K[e+256|0]){break b}a=J[e+240>>2];if(!a){break b}$a(a);break b}J[5996]=0;d=_(30,e+204|0,5346)|0;c=J[5996];J[5996]=0;Nc:{Oc:{Pc:{if((c|0)!=1){c=vb(d,b);if(H[e+215|0]<0){$a(J[d>>2]);}if(!c){break Nc}d=J[b>>2];c=J[b+4>>2];J[5996]=0;bd(e+240|0,d,c,32);d=J[5996];J[5996]=0;if((d|0)==1){break Pc}if(K[e+256|0]){break Oc}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}b=Z()|0;break b}J[5996]=0;d=e+332|0;ea(153,d|0,7,e+240|0);c=J[5996];J[5996]=0;Qc:{Rc:{if((c|0)!=1){J[5996]=0;aa(151,e+308|0,d|0);c=J[5996];J[5996]=0;if((c|0)==1){break Rc}mb(d);d=J[e+252>>2]+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];if(!K[e+256|0]){break m}d=J[e+240>>2];if(!d){break m}$a(d);break m}b=Z()|0;break Qc}b=Z()|0;mb(e+332|0);}if(!K[e+256|0]){break b}a=J[e+240>>2];if(!a){break b}$a(a);break b}J[5996]=0;d=_(30,e+192|0,5363)|0;c=J[5996];J[5996]=0;Sc:{Tc:{Uc:{if((c|0)!=1){c=vb(d,b);if(H[e+203|0]<0){$a(J[d>>2]);}if(!c){break Sc}d=J[b>>2];c=J[b+4>>2];J[5996]=0;bd(e+240|0,d,c,20);d=J[5996];J[5996]=0;if((d|0)==1){break Uc}if(K[e+256|0]){break Tc}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}b=Z()|0;break b}J[5996]=0;d=e+332|0;ea(153,d|0,9,e+240|0);c=J[5996];J[5996]=0;Vc:{Wc:{if((c|0)!=1){J[5996]=0;aa(151,e+308|0,d|0);c=J[5996];J[5996]=0;if((c|0)==1){break Wc}mb(d);d=J[e+252>>2]+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];if(!K[e+256|0]){break m}d=J[e+240>>2];if(!d){break m}$a(d);break m}b=Z()|0;break Vc}b=Z()|0;mb(e+332|0);}if(!K[e+256|0]){break b}a=J[e+240>>2];if(!a){break b}$a(a);break b}J[5996]=0;d=_(30,e+180|0,5258)|0;c=J[5996];J[5996]=0;Xc:{Yc:{Zc:{_c:{$c:{if((c|0)!=1){c=vb(d,b);if(H[e+191|0]<0){$a(J[d>>2]);}if(!c){break _c}f=J[b+4>>2];ad:{if((f|0)<=0){break ad}c=J[b>>2];d=0;while(1){g=c+d|0;if(K[g|0]!=41){d=d+1|0;if((f|0)!=(d|0)){continue}break ad}break}if(d){break $c}}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}J[5996]=0;c=ba(154,e+168|0,c|0,g|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Yc}f=hd(c,e+240|0);if(H[e+179|0]<0){$a(J[c>>2]);}if(!f){break Zc}f=J[e+244>>2];g=f;c=J[e+240>>2];h=c- -2147483648|0;f=f-(c>>>0<2147483648)|0;if((f|0)==-1&h>>>0<2147483649|(f|0)!=-1){break Zc}J[5996]=0;f=e+332|0;Ae(f,5,c,g);c=J[5996];J[5996]=0;bd:{if((c|0)!=1){J[5996]=0;aa(151,e+308|0,f|0);c=J[5996];J[5996]=0;if((c|0)==1){break bd}mb(f);d=d+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];break m}b=Z()|0;break b}b=Z()|0;mb(e+332|0);break b}J[5996]=0;d=_(30,e+156|0,5265)|0;c=J[5996];J[5996]=0;cd:{dd:{ed:{fd:{if((c|0)!=1){c=vb(d,b);if(H[e+167|0]<0){$a(J[d>>2]);}if(!c){break ed}f=J[b+4>>2];gd:{if((f|0)<=0){break gd}c=J[b>>2];d=0;while(1){g=c+d|0;if(K[g|0]!=41){d=d+1|0;if((f|0)!=(d|0)){continue}break gd}break}if(d){break fd}}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}J[5996]=0;c=ba(154,e+144|0,c|0,g|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break cd}f=hd(c,e+240|0);if(H[e+155|0]<0){$a(J[c>>2]);}if(!f){break dd}f=J[e+244>>2];g=f;c=J[e+240>>2];h=c- -2147483648|0;f=f-(c>>>0<2147483648)|0;if((f|0)==-1&h>>>0<2147483649|(f|0)!=-1){break dd}J[5996]=0;f=e+332|0;Ae(f,4,c,g);c=J[5996];J[5996]=0;hd:{if((c|0)!=1){J[5996]=0;aa(151,e+308|0,f|0);c=J[5996];J[5996]=0;if((c|0)==1){break hd}mb(f);d=d+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];break m}b=Z()|0;break b}b=Z()|0;mb(e+332|0);break b}J[5996]=0;d=_(30,e+132|0,5289)|0;c=J[5996];J[5996]=0;id:{if((c|0)!=1){c=vb(d,b);if(H[e+143|0]<0){$a(J[d>>2]);}if(!c){break Xc}f=J[b+4>>2];jd:{if((f|0)<=0){break jd}c=J[b>>2];d=0;while(1){g=c+d|0;h=K[g|0];if((h|0)!=44){if((h|0)==41){break jd}d=d+1|0;if((f|0)>(d|0)){continue}break jd}break}if(d){break id}}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}J[5996]=0;c=ba(154,e+120|0,c|0,g|0)|0;f=J[5996];J[5996]=0;kd:{if((f|0)!=1){f=hd(c,m);if(H[e+131|0]<0){$a(J[c>>2]);}if(f){break kd}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}d=d+1|0;l=J[b+4>>2]-d|0;J[b+4>>2]=l;f=d+J[b>>2]|0;J[b>>2]=f;J[e+340>>2]=0;J[e+332>>2]=0;J[e+336>>2]=0;ld:{md:{nd:{od:{pd:{qd:{while(1){d=0;g=(l|0)<=0;if(g){break od}rd:{while(1){c=K[d+f|0];if((c|0)==44){c=d;break rd}if((c|0)!=41){d=d+1|0;if((l|0)>(d|0)){continue}}break}c=0;if(g){break od}while(1){if(K[c+f|0]==41){d=-1;break rd}c=c+1|0;if((l|0)!=(c|0)){continue}break}break od}if((c|0)<=0){break od}J[5996]=0;ea(156,e+240|0,f|0,c+f|0);f=J[5996];J[5996]=0;if((f|0)==1){break ld}if(!K[e+252|0]){break od}f=J[e+336>>2];sd:{if(f>>>0<M[e+340>>2]){g=J[e+244>>2];J[f>>2]=J[e+240>>2];J[f+4>>2]=g;J[f+8>>2]=J[e+248>>2];J[e+248>>2]=0;J[e+240>>2]=0;J[e+244>>2]=0;J[e+336>>2]=f+12;l=1;g=0;break sd}J[5996]=0;aa(157,e+332|0,e+240|0);f=J[5996];J[5996]=0;if((f|0)==1){break qd}l=K[e+252|0];g=K[e+251|0];}c=c+1|0;J[b+4>>2]=J[b+4>>2]-c;f=c+J[b>>2]|0;J[b>>2]=f;if(!(!(l&255)|g<<24>>24>=0)){$a(J[e+240>>2]);f=J[b>>2];}if((d|0)!=-1){l=J[b+4>>2];continue}break}d=J[e+336>>2];c=J[e+332>>2];f=(d-c|0)/12|0;if((c|0)!=(d|0)&f>>>0<21){break pd}break od}b=Z()|0;if(!K[e+252|0]|H[e+251|0]>=0){break c}$a(J[e+240>>2]);break c}d=J[e+296>>2];c=J[e+300>>2];if(!((!!d&(c|0)>=0|(c|0)>0)&(!c&d>>>0<=f>>>0))){break od}J[5996]=0;f=e+240|0;g=e+332|0;Ka(158,f|0,25,g|0,d|0,c|0);d=J[5996];J[5996]=0;if((d|0)==1){break nd}J[5996]=0;aa(151,e+308|0,f|0);d=J[5996];J[5996]=0;if((d|0)==1){break md}mb(f);rb(g);break m}J[a>>2]=0;J[a+4>>2]=0;rb(e+332|0);break l}b=Z()|0;break c}b=Z()|0;mb(e+240|0);break c}b=Z()|0;break c}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}J[5996]=0;d=_(30,e+108|0,5302)|0;c=J[5996];J[5996]=0;td:{ud:{if((c|0)!=1){c=vb(d,b);if(H[e+119|0]<0){$a(J[d>>2]);}if(!c){break td}f=J[b+4>>2];vd:{if((f|0)<=0){break vd}c=J[b>>2];d=0;while(1){g=c+d|0;h=K[g|0];if((h|0)!=44){if((h|0)==41){break vd}d=d+1|0;if((f|0)>(d|0)){continue}break vd}break}if(d){break ud}}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}J[5996]=0;c=ba(154,e+96|0,c|0,g|0)|0;f=J[5996];J[5996]=0;wd:{if((f|0)!=1){f=hd(c,m);if(H[e+107|0]<0){$a(J[c>>2]);}if(f){break wd}J[a>>2]=0;J[a+4>>2]=0;break l}b=Z()|0;break b}c=J[e+300>>2];if(!J[e+296>>2]&(c|0)<=0|(c|0)<0){J[a>>2]=0;J[a+4>>2]=0;break l}d=d+1|0;J[b+4>>2]=J[b+4>>2]-d;J[b>>2]=d+J[b>>2];J[5996]=0;d=e+320|0;ga(159,d|0,19,1,m|0);c=J[5996];J[5996]=0;if((c|0)==1){break k}J[5996]=0;ga(160,d|0,0,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break m}b=Z()|0;break b}J[5996]=0;d=_(30,e+84|0,5251)|0;c=J[5996];J[5996]=0;xd:{yd:{zd:{Ad:{Bd:{Cd:{Dd:{if((c|0)!=1){c=vb(d,b);if(H[e+95|0]<0){$a(J[d>>2]);}if(!c){break xd}J[5996]=0;d=e+320|0;ga(160,d|0,14,-1,-1);c=J[5996];J[5996]=0;if((c|0)==1){break Dd}J[5996]=0;ga(160,d|0,21,-1,-1);c=J[5996];J[5996]=0;if((c|0)==1){break Cd}J[5996]=0;ga(160,d|0,0,-1,-1);c=J[5996];J[5996]=0;if((c|0)==1){break Bd}J[5996]=0;ga(160,d|0,20,-1,-1);c=J[5996];J[5996]=0;if((c|0)==1){break Ad}J[5996]=0;ga(160,d|0,0,-1,-1);c=J[5996];J[5996]=0;if((c|0)==1){break zd}J[5996]=0;ga(160,d|0,20,-1,-1);c=J[5996];J[5996]=0;if((c|0)==1){break yd}J[5996]=0;ga(160,d|0,0,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break m}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}J[5996]=0;d=_(30,e+72|0,5272)|0;c=J[5996];J[5996]=0;if((c|0)==1){break j}c=vb(d,b);if(H[e+83|0]<0){$a(J[d>>2]);}Ed:{if(c){J[5996]=0;ga(160,e+320|0,11,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break Ed}b=Z()|0;break b}J[5996]=0;d=_(30,e+60|0,5339)|0;c=J[5996];J[5996]=0;if((c|0)==1){break i}c=vb(d,b);if(H[e+71|0]<0){$a(J[d>>2]);}if(c){J[5996]=0;ga(160,e+320|0,13,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break Ed}b=Z()|0;break b}J[5996]=0;d=_(30,e+48|0,5244)|0;c=J[5996];J[5996]=0;if((c|0)==1){break h}c=vb(d,b);if(H[e+59|0]<0){$a(J[d>>2]);}if(c){J[5996]=0;ga(160,e+320|0,12,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break Ed}b=Z()|0;break b}J[5996]=0;d=_(30,e+36|0,5333)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}c=vb(d,b);if(H[e+47|0]<0){$a(J[d>>2]);}if(c){J[5996]=0;ga(160,e+320|0,15,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break Ed}b=Z()|0;break b}J[5996]=0;d=_(30,e+24|0,5327)|0;c=J[5996];J[5996]=0;if((c|0)==1){break f}c=vb(d,b);if(H[e+35|0]<0){$a(J[d>>2]);}if(c){J[5996]=0;ga(160,e+320|0,16,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break Ed}b=Z()|0;break b}J[5996]=0;d=_(30,e+12|0,5321)|0;c=J[5996];J[5996]=0;if((c|0)==1){break e}c=vb(d,b);if(H[e+23|0]<0){$a(J[d>>2]);}if(c){J[5996]=0;ga(160,e+320|0,17,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break Ed}b=Z()|0;break b}J[5996]=0;d=_(30,e|0,5296)|0;c=J[5996];J[5996]=0;if((c|0)==1){break d}c=vb(d,b);if(H[e+11|0]<0){$a(J[d>>2]);}if(c){J[5996]=0;ga(160,e+320|0,18,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break Ed}b=Z()|0;break b}J[a>>2]=0;J[a+4>>2]=0;break l}J[5996]=0;d=e+320|0;ga(160,d|0,21,-1,-1);c=J[5996];J[5996]=0;Fd:{Gd:{if((c|0)!=1){J[5996]=0;ga(160,d|0,0,-1,-1);c=J[5996];J[5996]=0;if((c|0)==1){break Gd}J[5996]=0;ga(160,d|0,20,-1,-1);c=J[5996];J[5996]=0;if((c|0)==1){break Fd}J[5996]=0;ga(160,d|0,0,-1,-1);d=J[5996];J[5996]=0;if((d|0)!=1){break m}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}c=J[e+324>>2];f=J[e+320>>2];if((c|0)!=(f|0)){continue}break}d=J[e+308>>2];if((J[e+312>>2]-d|0)!=8){J[5996]=0;ga(44,4122,2210,1561,2344);a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}if(J[b+4>>2]){J[a>>2]=0;J[a+4>>2]=0;break l}J[a>>2]=J[d>>2];J[a+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;}a=J[e+308>>2];if(a){d=J[e+312>>2];if((a|0)!=(d|0)){while(1){d=d-8|0;b=J[d+4>>2];Hd:{if(!b){break Hd}c=J[b+4>>2];J[b+4>>2]=c-1;if(c){break Hd}Xa[J[J[b>>2]+8>>2]](b);bb(b);}if((a|0)!=(d|0)){continue}break}a=J[e+308>>2];}$a(a);}a=J[e+320>>2];if(a){J[e+324>>2]=a;$a(a);}Ua=e+352|0;return}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}b=Z()|0;break b}rb(e+332|0);}lb(e+308|0);a=J[e+320>>2];if(a){J[e+324>>2]=a;$a(a);}da(b|0);B();}B();}function hn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=Ua-128|0;Ua=f;H[f+127|0]=b;g=f+116|0;fb(g,b?3764:5575,b);H[b|g]=0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{x:{y:{z:{A:{B:{C:{D:{switch(J[c>>2]){case 10:J[5996]=0;b=ba(99,d|0,0,2553)|0;c=J[5996];J[5996]=0;if((c|0)==1){break u}d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b;case 11:J[5996]=0;b=ba(99,d|0,0,1681)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 12:E:{F:{G:{b=J[J[c+32>>2]>>2];switch(J[b>>2]-2|0){case 1:break F;case 0:break G;default:break E}}b=J[b+8>>2];if(H[b+11|0]>=0){J[f+104>>2]=J[b+8>>2];c=J[b+4>>2];J[f+96>>2]=J[b>>2];J[f+100>>2]=c;break c}c=J[b+4>>2];b=J[b>>2];J[5996]=0;ea(40,f+96|0,b|0,c|0);b=J[5996];J[5996]=0;if((b|0)!=1){break c}a=Z()|0;break a}b=J[b+8>>2];if(H[b+11|0]>=0){J[f+104>>2]=J[b+8>>2];c=J[b+4>>2];J[f+96>>2]=J[b>>2];J[f+100>>2]=c;break d}c=J[b+4>>2];b=J[b>>2];J[5996]=0;ea(40,f+96|0,b|0,c|0);b=J[5996];J[5996]=0;if((b|0)!=1){break d}a=Z()|0;break a}J[5996]=0;b=ba(99,d|0,0,2541)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 13:J[5996]=0;b=ba(99,d|0,0,2522)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 14:J[5996]=0;b=ba(99,d|0,0,1271)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 15:J[5996]=0;b=ba(99,d|0,0,2170)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 16:J[5996]=0;b=ba(99,d|0,0,2029)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 17:if(J[J[J[c+32>>2]+8>>2]>>2]!=1){break C}J[5996]=0;b=ba(99,d|0,0,1392)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 22:b=J[c+32>>2];if(!J[J[b>>2]>>2]){J[5996]=0;b=ba(99,d+12|0,0,2096)|0;c=J[5996];J[5996]=0;if((c|0)!=1){e=J[b>>2];c=K[d+19|0]|K[d+20|0]<<8|(K[d+21|0]<<16|K[d+22|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[f+96>>2]=J[d+16>>2];c=K[d+23|0];J[b+8>>2]=0;J[b>>2]=0;J[b+4>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a}if(J[J[b+8>>2]>>2]){break x}J[5996]=0;b=ba(99,d|0,0,1295)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 2:b=J[c+8>>2];if(H[b+11|0]>=0){J[f+104>>2]=J[b+8>>2];c=J[b+4>>2];J[f+96>>2]=J[b>>2];J[f+100>>2]=c;break e}c=J[b+4>>2];b=J[b>>2];J[5996]=0;ea(40,f+96|0,b|0,c|0);b=J[5996];J[5996]=0;if((b|0)!=1){break e}a=Z()|0;break a;case 3:b=J[c+8>>2];if(H[b+11|0]>=0){J[f+104>>2]=J[b+8>>2];c=J[b+4>>2];J[f+96>>2]=J[b>>2];J[f+100>>2]=c;break f}c=J[b+4>>2];b=J[b>>2];J[5996]=0;ea(40,f+96|0,b|0,c|0);b=J[5996];J[5996]=0;if((b|0)!=1){break f}a=Z()|0;break a;case 5:J[5996]=0;b=_(97,f+116|0,5258)|0;d=J[5996];J[5996]=0;H:{I:{J:{K:{L:{if((d|0)!=1){J[f+88>>2]=J[b+8>>2];d=J[b+4>>2];J[f+80>>2]=J[b>>2];J[f+84>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;b=f- -64|0;aa(119,b|0,c+4|0);c=J[5996];J[5996]=0;if((c|0)==1){break L}J[5996]=0;d=b;b=K[f+75|0];c=b<<24>>24<0;c=ba(100,f+80|0,(c?J[f+64>>2]:d)|0,(c?J[f+68>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break K}J[f+104>>2]=J[c+8>>2];b=J[c+4>>2];J[f+96>>2]=J[c>>2];J[f+100>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break J}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break H}a=Z()|0;break I}a=Z()|0;if(H[f+107|0]>=0){break I}$a(J[f+96>>2]);}if(H[f+75|0]>=0){break H}$a(J[f+64>>2]);}if(H[f+91|0]>=0){break a}$a(J[f+80>>2]);break a;case 4:J[5996]=0;b=_(97,f+116|0,5265)|0;d=J[5996];J[5996]=0;M:{N:{O:{P:{Q:{if((d|0)!=1){J[f+88>>2]=J[b+8>>2];d=J[b+4>>2];J[f+80>>2]=J[b>>2];J[f+84>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;b=f- -64|0;aa(119,b|0,c+4|0);c=J[5996];J[5996]=0;if((c|0)==1){break Q}J[5996]=0;d=b;b=K[f+75|0];c=b<<24>>24<0;c=ba(100,f+80|0,(c?J[f+64>>2]:d)|0,(c?J[f+68>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break P}J[f+104>>2]=J[c+8>>2];b=J[c+4>>2];J[f+96>>2]=J[c>>2];J[f+100>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break O}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break M}a=Z()|0;break N}a=Z()|0;if(H[f+107|0]>=0){break N}$a(J[f+96>>2]);}if(H[f+75|0]>=0){break M}$a(J[f+64>>2]);}if(H[f+91|0]>=0){break a}$a(J[f+80>>2]);break a;case 7:J[5996]=0;b=_(97,f+116|0,5346)|0;d=J[5996];J[5996]=0;R:{S:{T:{if((d|0)!=1){J[f+88>>2]=J[b+8>>2];d=J[b+4>>2];J[f+80>>2]=J[b>>2];J[f+84>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;d=J[c+24>>2];b=J[c+20>>2];J[f+72>>2]=0;J[f+64>>2]=0;J[f+68>>2]=0;J[5996]=0;c=d-b|0;aa(101,f- -64|0,c<<1);e=J[5996];J[5996]=0;if((e|0)==1){break h}U:{if(b>>>0<d>>>0){d=b+c|0;while(1){c=K[b|0];J[5996]=0;e=f- -64|0;aa(98,e|0,H[(c>>>4|0)+6976|0]);g=J[5996];J[5996]=0;if((g|0)==1){break U}J[5996]=0;aa(98,e|0,H[(c&15)+6976|0]);c=J[5996];J[5996]=0;if((c|0)==1){break U}b=b+1|0;if((d|0)!=(b|0)){continue}break}}J[5996]=0;b=K[f+75|0];c=b<<24>>24<0;c=ba(100,f+80|0,(c?J[f+64>>2]:f- -64|0)|0,(c?J[f+68>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break T}J[f+104>>2]=J[c+8>>2];b=J[c+4>>2];J[f+96>>2]=J[c>>2];J[f+100>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break S}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}break h}a=Z()|0;break a}a=Z()|0;break R}a=Z()|0;if(H[f+107|0]>=0){break R}$a(J[f+96>>2]);}break g;case 9:J[5996]=0;b=_(97,f+116|0,5363)|0;d=J[5996];J[5996]=0;V:{W:{X:{if((d|0)!=1){J[f+88>>2]=J[b+8>>2];d=J[b+4>>2];J[f+80>>2]=J[b>>2];J[f+84>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;d=J[c+24>>2];b=J[c+20>>2];J[f+72>>2]=0;J[f+64>>2]=0;J[f+68>>2]=0;J[5996]=0;c=d-b|0;aa(101,f- -64|0,c<<1);e=J[5996];J[5996]=0;if((e|0)==1){break j}Y:{if(b>>>0<d>>>0){d=b+c|0;while(1){c=K[b|0];J[5996]=0;e=f- -64|0;aa(98,e|0,H[(c>>>4|0)+6976|0]);g=J[5996];J[5996]=0;if((g|0)==1){break Y}J[5996]=0;aa(98,e|0,H[(c&15)+6976|0]);c=J[5996];J[5996]=0;if((c|0)==1){break Y}b=b+1|0;if((d|0)!=(b|0)){continue}break}}J[5996]=0;b=K[f+75|0];c=b<<24>>24<0;c=ba(100,f+80|0,(c?J[f+64>>2]:f- -64|0)|0,(c?J[f+68>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break X}J[f+104>>2]=J[c+8>>2];b=J[c+4>>2];J[f+96>>2]=J[c>>2];J[f+100>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break W}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}break j}a=Z()|0;break a}a=Z()|0;break V}a=Z()|0;if(H[f+107|0]>=0){break V}$a(J[f+96>>2]);}break i;case 6:J[5996]=0;b=_(97,f+116|0,5355)|0;d=J[5996];J[5996]=0;Z:{_:{$:{if((d|0)!=1){J[f+88>>2]=J[b+8>>2];d=J[b+4>>2];J[f+80>>2]=J[b>>2];J[f+84>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;d=J[c+24>>2];b=J[c+20>>2];J[f+72>>2]=0;J[f+64>>2]=0;J[f+68>>2]=0;J[5996]=0;c=d-b|0;aa(101,f- -64|0,c<<1);e=J[5996];J[5996]=0;if((e|0)==1){break l}aa:{if(b>>>0<d>>>0){d=b+c|0;while(1){c=K[b|0];J[5996]=0;e=f- -64|0;aa(98,e|0,H[(c>>>4|0)+6976|0]);g=J[5996];J[5996]=0;if((g|0)==1){break aa}J[5996]=0;aa(98,e|0,H[(c&15)+6976|0]);c=J[5996];J[5996]=0;if((c|0)==1){break aa}b=b+1|0;if((d|0)!=(b|0)){continue}break}}J[5996]=0;b=K[f+75|0];c=b<<24>>24<0;c=ba(100,f+80|0,(c?J[f+64>>2]:f- -64|0)|0,(c?J[f+68>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break $}J[f+104>>2]=J[c+8>>2];b=J[c+4>>2];J[f+96>>2]=J[c>>2];J[f+100>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break _}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}break l}a=Z()|0;break a}a=Z()|0;break Z}a=Z()|0;if(H[f+107|0]>=0){break Z}$a(J[f+96>>2]);}break k;case 8:J[5996]=0;b=_(97,f+116|0,5372)|0;d=J[5996];J[5996]=0;ba:{ca:{da:{if((d|0)!=1){J[f+88>>2]=J[b+8>>2];d=J[b+4>>2];J[f+80>>2]=J[b>>2];J[f+84>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;d=J[c+24>>2];b=J[c+20>>2];J[f+72>>2]=0;J[f+64>>2]=0;J[f+68>>2]=0;J[5996]=0;c=d-b|0;aa(101,f- -64|0,c<<1);e=J[5996];J[5996]=0;if((e|0)==1){break n}ea:{if(b>>>0<d>>>0){d=b+c|0;while(1){c=K[b|0];J[5996]=0;e=f- -64|0;aa(98,e|0,H[(c>>>4|0)+6976|0]);g=J[5996];J[5996]=0;if((g|0)==1){break ea}J[5996]=0;aa(98,e|0,H[(c&15)+6976|0]);c=J[5996];J[5996]=0;if((c|0)==1){break ea}b=b+1|0;if((d|0)!=(b|0)){continue}break}}J[5996]=0;b=K[f+75|0];c=b<<24>>24<0;c=ba(100,f+80|0,(c?J[f+64>>2]:f- -64|0)|0,(c?J[f+68>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break da}J[f+104>>2]=J[c+8>>2];b=J[c+4>>2];J[f+96>>2]=J[c>>2];J[f+100>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break ca}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}break n}a=Z()|0;break a}a=Z()|0;break ba}a=Z()|0;if(H[f+107|0]>=0){break ba}$a(J[f+96>>2]);}break m;case 1:J[5996]=0;b=_(97,f+116|0,4180)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;c=K[f+127|0];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a;case 24:break s;case 25:break v;case 23:break w;case 20:break y;case 21:break z;case 19:break A;case 18:break B;case 0:break D;default:break t}}J[5996]=0;b=_(97,f+116|0,4350)|0;c=J[5996];J[5996]=0;if((c|0)!=1){d=J[b>>2];J[f+96>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+99|0]=c;H[f+100|0]=c>>>8;H[f+101|0]=c>>>16;H[f+102|0]=c>>>24;c=K[f+127|0];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+96>>2];b=K[f+99|0]|K[f+100|0]<<8|(K[f+101|0]<<16|K[f+102|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a}J[5996]=0;b=_(97,f+116|0,5244)|0;c=J[5996];J[5996]=0;fa:{ga:{ha:{ia:{ja:{ka:{la:{if((c|0)!=1){J[f+56>>2]=J[b+8>>2];c=J[b+4>>2];J[f+48>>2]=J[b>>2];J[f+52>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;c=J[d>>2];e=J[d+4>>2];b=K[d+11|0];J[5996]=0;h=c;c=b<<24>>24<0;c=ba(100,f+48|0,(c?h:d)|0,(c?e:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break la}J[f+72>>2]=J[c+8>>2];b=J[c+4>>2];J[f+64>>2]=J[c>>2];J[f+68>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=_(97,f- -64|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ka}J[f+88>>2]=J[e+8>>2];b=J[e+4>>2];J[f+80>>2]=J[e>>2];J[f+84>>2]=b;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;g=J[d+16>>2];h=J[d+12>>2];b=K[d+23|0];J[5996]=0;i=d+12|0;d=b<<24>>24<0;d=ba(100,f+80|0,(d?h:i)|0,(d?g:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ja}J[f+104>>2]=J[d+8>>2];b=J[d+4>>2];J[f+96>>2]=J[d>>2];J[f+100>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;g=J[5996];J[5996]=0;if((g|0)==1){break ia}h=J[b>>2];J[f+24>>2]=J[b+4>>2];g=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+27|0]=g;H[f+28|0]=g>>>8;H[f+29|0]=g>>>16;H[f+30|0]=g>>>24;J[b>>2]=0;J[b+4>>2]=0;g=K[b+11|0];J[b+8>>2]=0;J[a>>2]=h;J[a+4>>2]=J[f+24>>2];b=K[f+27|0]|K[f+28|0]<<8|(K[f+29|0]<<16|K[f+30|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=g;if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break fa}a=Z()|0;break ga}a=Z()|0;break ha}a=Z()|0;if(H[f+107|0]>=0){break ha}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break ga}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break fa}$a(J[f+64>>2]);}if(H[f+59|0]>=0){break a}$a(J[f+48>>2]);break a}J[5996]=0;b=_(97,f+116|0,5339)|0;c=J[5996];J[5996]=0;ma:{na:{oa:{pa:{qa:{ra:{sa:{if((c|0)!=1){J[f+56>>2]=J[b+8>>2];c=J[b+4>>2];J[f+48>>2]=J[b>>2];J[f+52>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;c=J[d>>2];e=J[d+4>>2];b=K[d+11|0];J[5996]=0;h=c;c=b<<24>>24<0;c=ba(100,f+48|0,(c?h:d)|0,(c?e:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break sa}J[f+72>>2]=J[c+8>>2];b=J[c+4>>2];J[f+64>>2]=J[c>>2];J[f+68>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=_(97,f- -64|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ra}J[f+88>>2]=J[e+8>>2];b=J[e+4>>2];J[f+80>>2]=J[e>>2];J[f+84>>2]=b;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;g=J[d+16>>2];h=J[d+12>>2];b=K[d+23|0];J[5996]=0;i=d+12|0;d=b<<24>>24<0;d=ba(100,f+80|0,(d?h:i)|0,(d?g:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break qa}J[f+104>>2]=J[d+8>>2];b=J[d+4>>2];J[f+96>>2]=J[d>>2];J[f+100>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;g=J[5996];J[5996]=0;if((g|0)==1){break pa}h=J[b>>2];J[f+24>>2]=J[b+4>>2];g=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+27|0]=g;H[f+28|0]=g>>>8;H[f+29|0]=g>>>16;H[f+30|0]=g>>>24;J[b>>2]=0;J[b+4>>2]=0;g=K[b+11|0];J[b+8>>2]=0;J[a>>2]=h;J[a+4>>2]=J[f+24>>2];b=K[f+27|0]|K[f+28|0]<<8|(K[f+29|0]<<16|K[f+30|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=g;if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break ma}a=Z()|0;break na}a=Z()|0;break oa}a=Z()|0;if(H[f+107|0]>=0){break oa}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break na}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break ma}$a(J[f+64>>2]);}if(H[f+59|0]>=0){break a}$a(J[f+48>>2]);break a}J[5996]=0;b=_(97,f+116|0,5333)|0;c=J[5996];J[5996]=0;ta:{ua:{va:{wa:{xa:{ya:{za:{if((c|0)!=1){J[f+56>>2]=J[b+8>>2];c=J[b+4>>2];J[f+48>>2]=J[b>>2];J[f+52>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;c=J[d>>2];e=J[d+4>>2];b=K[d+11|0];J[5996]=0;h=c;c=b<<24>>24<0;c=ba(100,f+48|0,(c?h:d)|0,(c?e:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break za}J[f+72>>2]=J[c+8>>2];b=J[c+4>>2];J[f+64>>2]=J[c>>2];J[f+68>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=_(97,f- -64|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ya}J[f+88>>2]=J[e+8>>2];b=J[e+4>>2];J[f+80>>2]=J[e>>2];J[f+84>>2]=b;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;g=J[d+16>>2];h=J[d+12>>2];b=K[d+23|0];J[5996]=0;i=d+12|0;d=b<<24>>24<0;d=ba(100,f+80|0,(d?h:i)|0,(d?g:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break xa}J[f+104>>2]=J[d+8>>2];b=J[d+4>>2];J[f+96>>2]=J[d>>2];J[f+100>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;g=J[5996];J[5996]=0;if((g|0)==1){break wa}h=J[b>>2];J[f+24>>2]=J[b+4>>2];g=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+27|0]=g;H[f+28|0]=g>>>8;H[f+29|0]=g>>>16;H[f+30|0]=g>>>24;J[b>>2]=0;J[b+4>>2]=0;g=K[b+11|0];J[b+8>>2]=0;J[a>>2]=h;J[a+4>>2]=J[f+24>>2];b=K[f+27|0]|K[f+28|0]<<8|(K[f+29|0]<<16|K[f+30|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=g;if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break ta}a=Z()|0;break ua}a=Z()|0;break va}a=Z()|0;if(H[f+107|0]>=0){break va}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break ua}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break ta}$a(J[f+64>>2]);}if(H[f+59|0]>=0){break a}$a(J[f+48>>2]);break a}J[5996]=0;b=_(97,f+116|0,5321)|0;c=J[5996];J[5996]=0;Aa:{Ba:{Ca:{Da:{Ea:{Fa:{Ga:{if((c|0)!=1){J[f+56>>2]=J[b+8>>2];c=J[b+4>>2];J[f+48>>2]=J[b>>2];J[f+52>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;c=J[d>>2];e=J[d+4>>2];b=K[d+11|0];J[5996]=0;h=c;c=b<<24>>24<0;c=ba(100,f+48|0,(c?h:d)|0,(c?e:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Ga}J[f+72>>2]=J[c+8>>2];b=J[c+4>>2];J[f+64>>2]=J[c>>2];J[f+68>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=_(97,f- -64|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Fa}J[f+88>>2]=J[e+8>>2];b=J[e+4>>2];J[f+80>>2]=J[e>>2];J[f+84>>2]=b;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;g=J[d+16>>2];h=J[d+12>>2];b=K[d+23|0];J[5996]=0;i=d+12|0;d=b<<24>>24<0;d=ba(100,f+80|0,(d?h:i)|0,(d?g:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Ea}J[f+104>>2]=J[d+8>>2];b=J[d+4>>2];J[f+96>>2]=J[d>>2];J[f+100>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Da}h=J[b>>2];J[f+24>>2]=J[b+4>>2];g=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+27|0]=g;H[f+28|0]=g>>>8;H[f+29|0]=g>>>16;H[f+30|0]=g>>>24;J[b>>2]=0;J[b+4>>2]=0;g=K[b+11|0];J[b+8>>2]=0;J[a>>2]=h;J[a+4>>2]=J[f+24>>2];b=K[f+27|0]|K[f+28|0]<<8|(K[f+29|0]<<16|K[f+30|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=g;if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break Aa}a=Z()|0;break Ba}a=Z()|0;break Ca}a=Z()|0;if(H[f+107|0]>=0){break Ca}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break Ba}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break Aa}$a(J[f+64>>2]);}if(H[f+59|0]>=0){break a}$a(J[f+48>>2]);break a}J[5996]=0;b=_(97,f+116|0,5327)|0;c=J[5996];J[5996]=0;Ha:{Ia:{Ja:{Ka:{La:{Ma:{Na:{if((c|0)!=1){J[f+56>>2]=J[b+8>>2];c=J[b+4>>2];J[f+48>>2]=J[b>>2];J[f+52>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;c=J[d>>2];e=J[d+4>>2];b=K[d+11|0];J[5996]=0;h=c;c=b<<24>>24<0;c=ba(100,f+48|0,(c?h:d)|0,(c?e:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Na}J[f+72>>2]=J[c+8>>2];b=J[c+4>>2];J[f+64>>2]=J[c>>2];J[f+68>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=_(97,f- -64|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Ma}J[f+88>>2]=J[e+8>>2];b=J[e+4>>2];J[f+80>>2]=J[e>>2];J[f+84>>2]=b;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;g=J[d+16>>2];h=J[d+12>>2];b=K[d+23|0];J[5996]=0;i=d+12|0;d=b<<24>>24<0;d=ba(100,f+80|0,(d?h:i)|0,(d?g:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break La}J[f+104>>2]=J[d+8>>2];b=J[d+4>>2];J[f+96>>2]=J[d>>2];J[f+100>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Ka}h=J[b>>2];J[f+24>>2]=J[b+4>>2];g=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+27|0]=g;H[f+28|0]=g>>>8;H[f+29|0]=g>>>16;H[f+30|0]=g>>>24;J[b>>2]=0;J[b+4>>2]=0;g=K[b+11|0];J[b+8>>2]=0;J[a>>2]=h;J[a+4>>2]=J[f+24>>2];b=K[f+27|0]|K[f+28|0]<<8|(K[f+29|0]<<16|K[f+30|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=g;if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break Ha}a=Z()|0;break Ia}a=Z()|0;break Ja}a=Z()|0;if(H[f+107|0]>=0){break Ja}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break Ia}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break Ha}$a(J[f+64>>2]);}if(H[f+59|0]>=0){break a}$a(J[f+48>>2]);break a}J[5996]=0;b=_(97,f+116|0,5296)|0;c=J[5996];J[5996]=0;Oa:{Pa:{Qa:{Ra:{Sa:{Ta:{Ua:{if((c|0)!=1){J[f+56>>2]=J[b+8>>2];c=J[b+4>>2];J[f+48>>2]=J[b>>2];J[f+52>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;c=J[d>>2];e=J[d+4>>2];b=K[d+11|0];J[5996]=0;h=c;c=b<<24>>24<0;c=ba(100,f+48|0,(c?h:d)|0,(c?e:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Ua}J[f+72>>2]=J[c+8>>2];b=J[c+4>>2];J[f+64>>2]=J[c>>2];J[f+68>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=_(97,f- -64|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Ta}J[f+88>>2]=J[e+8>>2];b=J[e+4>>2];J[f+80>>2]=J[e>>2];J[f+84>>2]=b;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;g=J[d+16>>2];h=J[d+12>>2];b=K[d+23|0];J[5996]=0;i=d+12|0;d=b<<24>>24<0;d=ba(100,f+80|0,(d?h:i)|0,(d?g:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Sa}J[f+104>>2]=J[d+8>>2];b=J[d+4>>2];J[f+96>>2]=J[d>>2];J[f+100>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Ra}h=J[b>>2];J[f+24>>2]=J[b+4>>2];g=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+27|0]=g;H[f+28|0]=g>>>8;H[f+29|0]=g>>>16;H[f+30|0]=g>>>24;J[b>>2]=0;J[b+4>>2]=0;g=K[b+11|0];J[b+8>>2]=0;J[a>>2]=h;J[a+4>>2]=J[f+24>>2];b=K[f+27|0]|K[f+28|0]<<8|(K[f+29|0]<<16|K[f+30|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=g;if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break Oa}a=Z()|0;break Pa}a=Z()|0;break Qa}a=Z()|0;if(H[f+107|0]>=0){break Qa}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break Pa}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break Oa}$a(J[f+64>>2]);}if(H[f+59|0]>=0){break a}$a(J[f+48>>2]);break a}if(!J[J[J[c+32>>2]+16>>2]>>2]){J[5996]=0;b=_(97,f+116|0,5272)|0;c=J[5996];J[5996]=0;Va:{Wa:{Xa:{Ya:{Za:{_a:{$a:{if((c|0)!=1){J[f+56>>2]=J[b+8>>2];c=J[b+4>>2];J[f+48>>2]=J[b>>2];J[f+52>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;c=J[d>>2];e=J[d+4>>2];b=K[d+11|0];J[5996]=0;h=c;c=b<<24>>24<0;c=ba(100,f+48|0,(c?h:d)|0,(c?e:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break $a}J[f+72>>2]=J[c+8>>2];b=J[c+4>>2];J[f+64>>2]=J[c>>2];J[f+68>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=_(97,f- -64|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break _a}J[f+88>>2]=J[e+8>>2];b=J[e+4>>2];J[f+80>>2]=J[e>>2];J[f+84>>2]=b;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;g=J[d+16>>2];h=J[d+12>>2];b=K[d+23|0];J[5996]=0;i=d+12|0;d=b<<24>>24<0;d=ba(100,f+80|0,(d?h:i)|0,(d?g:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Za}J[f+104>>2]=J[d+8>>2];b=J[d+4>>2];J[f+96>>2]=J[d>>2];J[f+100>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Ya}h=J[b>>2];J[f+24>>2]=J[b+4>>2];g=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+27|0]=g;H[f+28|0]=g>>>8;H[f+29|0]=g>>>16;H[f+30|0]=g>>>24;J[b>>2]=0;J[b+4>>2]=0;g=K[b+11|0];J[b+8>>2]=0;J[a>>2]=h;J[a+4>>2]=J[f+24>>2];b=K[f+27|0]|K[f+28|0]<<8|(K[f+29|0]<<16|K[f+30|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=g;if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break Va}a=Z()|0;break Wa}a=Z()|0;break Xa}a=Z()|0;if(H[f+107|0]>=0){break Xa}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break Wa}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break Va}$a(J[f+64>>2]);}if(H[f+59|0]>=0){break a}$a(J[f+48>>2]);break a}J[5996]=0;b=_(97,f+116|0,5251)|0;c=J[5996];J[5996]=0;ab:{bb:{cb:{db:{eb:{fb:{gb:{hb:{ib:{jb:{kb:{if((c|0)!=1){J[f+16>>2]=J[b+8>>2];c=J[b+4>>2];J[f+8>>2]=J[b>>2];J[f+12>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;c=J[d>>2];e=J[d+4>>2];b=K[d+11|0];J[5996]=0;h=c;c=b<<24>>24<0;c=ba(100,f+8|0,(c?h:d)|0,(c?e:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break kb}J[f+32>>2]=J[c+8>>2];b=J[c+4>>2];J[f+24>>2]=J[c>>2];J[f+28>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=_(97,f+24|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break jb}J[f+56>>2]=J[e+8>>2];b=J[e+4>>2];J[f+48>>2]=J[e>>2];J[f+52>>2]=b;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;g=J[d+16>>2];h=J[d+12>>2];b=K[d+23|0];J[5996]=0;i=h;h=b<<24>>24<0;g=ba(100,f+48|0,(h?i:d+12|0)|0,(h?g:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ib}J[f+72>>2]=J[g+8>>2];b=J[g+4>>2];J[f+64>>2]=J[g>>2];J[f+68>>2]=b;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;h=_(97,f- -64|0,4354)|0;b=J[5996];J[5996]=0;if((b|0)==1){break hb}J[f+88>>2]=J[h+8>>2];b=J[h+4>>2];J[f+80>>2]=J[h>>2];J[f+84>>2]=b;J[h>>2]=0;J[h+4>>2]=0;J[h+8>>2]=0;i=J[d+28>>2];j=J[d+24>>2];b=K[d+35|0];J[5996]=0;k=d+24|0;d=b<<24>>24<0;d=ba(100,f+80|0,(d?j:k)|0,(d?i:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break gb}J[f+104>>2]=J[d+8>>2];b=J[d+4>>2];J[f+96>>2]=J[d>>2];J[f+100>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=_(97,f+96|0,5242)|0;i=J[5996];J[5996]=0;if((i|0)==1){break fb}j=J[b>>2];J[f+40>>2]=J[b+4>>2];i=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+43|0]=i;H[f+44|0]=i>>>8;H[f+45|0]=i>>>16;H[f+46|0]=i>>>24;J[b>>2]=0;J[b+4>>2]=0;i=K[b+11|0];J[b+8>>2]=0;J[a>>2]=j;J[a+4>>2]=J[f+40>>2];b=K[f+43|0]|K[f+44|0]<<8|(K[f+45|0]<<16|K[f+46|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=i;if(H[d+11|0]<0){$a(J[d>>2]);}if(H[h+11|0]<0){$a(J[h>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+11|0]>=0){break b}$a(J[c>>2]);break b}a=Z()|0;break a}a=Z()|0;break ab}a=Z()|0;break bb}a=Z()|0;break cb}a=Z()|0;break db}a=Z()|0;break eb}a=Z()|0;if(H[f+107|0]>=0){break eb}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break db}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break cb}$a(J[f+64>>2]);}if(H[f+59|0]>=0){break bb}$a(J[f+48>>2]);}if(H[f+35|0]>=0){break ab}$a(J[f+24>>2]);}if(H[f+19|0]>=0){break a}$a(J[f+8>>2]);break a}J[5996]=0;b=_(97,f+116|0,5289)|0;d=J[5996];J[5996]=0;if((d|0)==1){break o}J[f+72>>2]=J[b+8>>2];d=J[b+4>>2];J[f+64>>2]=J[b>>2];J[f+68>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;b=f+96|0;aa(119,b|0,c+4|0);d=J[5996];J[5996]=0;if((d|0)==1){break q}J[5996]=0;e=b;b=K[f+107|0];d=b<<24>>24<0;b=ba(100,f- -64|0,(d?J[f+96>>2]:e)|0,(d?J[f+100>>2]:b)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break r}J[f+88>>2]=J[b+8>>2];d=J[b+4>>2];J[f+80>>2]=J[b>>2];J[f+84>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;lb:{if(H[f+107|0]>=0){break lb}$a(J[f+96>>2]);if(H[b+11|0]>=0){break lb}$a(J[b>>2]);}mb:{nb:{ob:{pb:{qb:{b=J[c+8>>2];d=J[c+12>>2];if((b|0)!=(d|0)){while(1){rb:{if(H[b+11|0]>=0){J[f+104>>2]=J[b+8>>2];c=J[b+4>>2];J[f+96>>2]=J[b>>2];J[f+100>>2]=c;break rb}c=J[b+4>>2];e=J[b>>2];J[5996]=0;ea(40,f+96|0,e|0,c|0);c=J[5996];J[5996]=0;if((c|0)!=1){break rb}a=Z()|0;break nb}J[5996]=0;H[f+108|0]=1;c=ba(99,f+96|0,0,4354)|0;e=J[5996];J[5996]=0;if((e|0)==1){break qb}J[f+56>>2]=J[c+8>>2];e=J[c+4>>2];J[f+48>>2]=J[c>>2];J[f+52>>2]=e;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;e=K[f+59|0];g=e<<24>>24<0;ba(100,f+80|0,(g?J[f+48>>2]:f+48|0)|0,(g?J[f+52>>2]:e)|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break pb}if(H[f+59|0]<0){$a(J[f+48>>2]);}if(!(!K[f+108|0]|H[f+107|0]>=0)){$a(J[c>>2]);}b=b+12|0;if((d|0)!=(b|0)){continue}break}}J[5996]=0;b=_(97,f+80|0,5242)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break mb}a=Z()|0;break nb}a=Z()|0;break ob}a=Z()|0;if(H[f+59|0]>=0){break ob}$a(J[f+48>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break nb}$a(J[f+96>>2]);}if(H[f+91|0]>=0){break a}$a(J[f+80>>2]);break a}d=J[b>>2];J[f+48>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=c;H[f+52|0]=c>>>8;H[f+53|0]=c>>>16;H[f+54|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a}J[5996]=0;ga(44,2350,2210,725,5107);a=J[5996];J[5996]=0;if((a|0)==1){a=Z()|0;break a}B();}J[5996]=0;b=_(97,f+116|0,5302)|0;g=J[5996];J[5996]=0;sb:{tb:{ub:{vb:{wb:{xb:{yb:{if((g|0)!=1){J[f+88>>2]=J[b+8>>2];g=J[b+4>>2];J[f+80>>2]=J[b>>2];J[f+84>>2]=g;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;b=f- -64|0;aa(119,b|0,c+4|0);c=J[5996];J[5996]=0;if((c|0)==1){break yb}J[5996]=0;h=b;b=K[f+75|0];c=b<<24>>24<0;b=ba(100,f+80|0,(c?J[f+64>>2]:h)|0,(c?J[f+68>>2]:b)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break xb}J[f+104>>2]=J[b+8>>2];c=J[b+4>>2];J[f+96>>2]=J[b>>2];J[f+100>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;zb:{if(H[f+75|0]>=0){break zb}$a(J[f+64>>2]);if(H[b+11|0]>=0){break zb}$a(J[b>>2]);}if(e){c=P(e,12)+d|0;while(1){J[5996]=0;b=ba(99,d|0,0,4354)|0;d=J[5996];J[5996]=0;if((d|0)==1){break vb}J[f+72>>2]=J[b+8>>2];d=J[b+4>>2];J[f+64>>2]=J[b>>2];J[f+68>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;d=K[f+75|0];e=d<<24>>24<0;ba(100,f+96|0,(e?J[f+64>>2]:f- -64|0)|0,(e?J[f+68>>2]:d)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break ub}if(H[f+75|0]<0){$a(J[f+64>>2]);}d=b+12|0;if((c|0)!=(d|0)){continue}break}}J[5996]=0;b=_(97,f+96|0,5242)|0;c=J[5996];J[5996]=0;if((c|0)==1){break tb}d=J[b>>2];J[f+64>>2]=J[b+4>>2];c=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+67|0]=c;H[f+68|0]=c>>>8;H[f+69|0]=c>>>16;H[f+70|0]=c>>>24;J[b>>2]=0;J[b+4>>2]=0;c=K[b+11|0];J[b+8>>2]=0;J[a>>2]=d;J[a+4>>2]=J[f+64>>2];b=K[f+67|0]|K[f+68|0]<<8|(K[f+69|0]<<16|K[f+70|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=c;break b}a=Z()|0;break a}a=Z()|0;break wb}a=Z()|0;if(H[f+75|0]>=0){break wb}$a(J[f+64>>2]);}if(H[f+91|0]>=0){break a}$a(J[f+80>>2]);break a}a=Z()|0;break sb}a=Z()|0;if(H[f+75|0]>=0){break sb}$a(J[f+64>>2]);break sb}a=Z()|0;}if(H[f+107|0]>=0){break a}$a(J[f+96>>2]);break a}a=Z()|0;if(H[f+107|0]>=0){break p}$a(J[f+96>>2]);break p}a=Z()|0;}if(H[f+75|0]>=0){break a}$a(J[f+64>>2]);break a}a=Z()|0;break a}a=Z()|0;}if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[f+91|0]>=0){break a}$a(J[f+80>>2]);break a}a=Z()|0;}if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[f+91|0]>=0){break a}$a(J[f+80>>2]);break a}a=Z()|0;}if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[f+91|0]>=0){break a}$a(J[f+80>>2]);break a}a=Z()|0;}if(H[f+75|0]<0){$a(J[f+64>>2]);}if(H[f+91|0]>=0){break a}$a(J[f+80>>2]);break a}J[5996]=0;H[f+108|0]=1;b=_(97,f+116|0,5315)|0;c=J[5996];J[5996]=0;Ab:{Bb:{Cb:{Db:{if((c|0)!=1){J[f+72>>2]=J[b+8>>2];c=J[b+4>>2];J[f+64>>2]=J[b>>2];J[f+68>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;b=K[f+107|0];c=b<<24>>24<0;c=ba(100,f- -64|0,(c?J[f+96>>2]:f+96|0)|0,(c?J[f+100>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Db}J[f+88>>2]=J[c+8>>2];b=J[c+4>>2];J[f+80>>2]=J[c>>2];J[f+84>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+80|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Cb}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[c+11|0]<0){$a(J[c>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break b}$a(J[f+96>>2]);break b}a=Z()|0;break Ab}a=Z()|0;break Bb}a=Z()|0;if(H[f+91|0]>=0){break Bb}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break Ab}$a(J[f+64>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break a}$a(J[f+96>>2]);break a}J[5996]=0;H[f+108|0]=1;b=_(97,f+116|0,5283)|0;c=J[5996];J[5996]=0;Eb:{Fb:{Gb:{Hb:{if((c|0)!=1){J[f+72>>2]=J[b+8>>2];c=J[b+4>>2];J[f+64>>2]=J[b>>2];J[f+68>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;b=K[f+107|0];c=b<<24>>24<0;c=ba(100,f- -64|0,(c?J[f+96>>2]:f+96|0)|0,(c?J[f+100>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Hb}J[f+88>>2]=J[c+8>>2];b=J[c+4>>2];J[f+80>>2]=J[c>>2];J[f+84>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+80|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Gb}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[c+11|0]<0){$a(J[c>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break b}$a(J[f+96>>2]);break b}a=Z()|0;break Eb}a=Z()|0;break Fb}a=Z()|0;if(H[f+91|0]>=0){break Fb}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break Eb}$a(J[f+64>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break a}$a(J[f+96>>2]);break a}J[5996]=0;H[f+108|0]=1;b=_(97,f+116|0,5310)|0;c=J[5996];J[5996]=0;Ib:{Jb:{Kb:{Lb:{if((c|0)!=1){J[f+72>>2]=J[b+8>>2];c=J[b+4>>2];J[f+64>>2]=J[b>>2];J[f+68>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;b=K[f+107|0];c=b<<24>>24<0;c=ba(100,f- -64|0,(c?J[f+96>>2]:f+96|0)|0,(c?J[f+100>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Lb}J[f+88>>2]=J[c+8>>2];b=J[c+4>>2];J[f+80>>2]=J[c>>2];J[f+84>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+80|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Kb}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[c+11|0]<0){$a(J[c>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break b}$a(J[f+96>>2]);break b}a=Z()|0;break Ib}a=Z()|0;break Jb}a=Z()|0;if(H[f+91|0]>=0){break Jb}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break Ib}$a(J[f+64>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break a}$a(J[f+96>>2]);break a}J[5996]=0;H[f+108|0]=1;b=_(97,f+116|0,5279)|0;c=J[5996];J[5996]=0;Mb:{Nb:{Ob:{Pb:{if((c|0)!=1){J[f+72>>2]=J[b+8>>2];c=J[b+4>>2];J[f+64>>2]=J[b>>2];J[f+68>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;b=K[f+107|0];c=b<<24>>24<0;c=ba(100,f- -64|0,(c?J[f+96>>2]:f+96|0)|0,(c?J[f+100>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Pb}J[f+88>>2]=J[c+8>>2];b=J[c+4>>2];J[f+80>>2]=J[c>>2];J[f+84>>2]=b;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[5996]=0;b=_(97,f+80|0,5242)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Ob}e=J[b>>2];J[f+48>>2]=J[b+4>>2];d=K[b+7|0]|K[b+8|0]<<8|(K[b+9|0]<<16|K[b+10|0]<<24);H[f+51|0]=d;H[f+52|0]=d>>>8;H[f+53|0]=d>>>16;H[f+54|0]=d>>>24;J[b>>2]=0;J[b+4>>2]=0;d=K[b+11|0];J[b+8>>2]=0;J[a>>2]=e;J[a+4>>2]=J[f+48>>2];b=K[f+51|0]|K[f+52|0]<<8|(K[f+53|0]<<16|K[f+54|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+12|0]=1;H[a+11|0]=d;if(H[c+11|0]<0){$a(J[c>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break b}$a(J[f+96>>2]);break b}a=Z()|0;break Mb}a=Z()|0;break Nb}a=Z()|0;if(H[f+91|0]>=0){break Nb}$a(J[f+80>>2]);}if(H[f+75|0]>=0){break Mb}$a(J[f+64>>2]);}if(!K[f+108|0]|H[f+107|0]>=0){break a}$a(J[f+96>>2]);break a}if(H[f+127|0]<0){$a(J[f+116>>2]);}Ua=f+128|0;return}if(H[f+127|0]<0){$a(J[f+116>>2]);}da(a|0);B();}function dn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;h=Ua-112|0;Ua=h;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{switch(J[c>>2]){case 2:f=J[c+8>>2];c=cb(4);J[h+48>>2]=c;b=c+4|0;J[h+56>>2]=b;H[c|0]=2;H[c+1|0]=80;H[c+2|0]=75;H[c+3|0]=98;J[h+52>>2]=b;J[5996]=0;H[h+16|0]=0;d=h+48|0;ea(126,d|0,29,h+16|0);b=J[5996];J[5996]=0;if((b|0)==1){break c}e=J[h+48>>2];c=K[f+11|0];b=c<<24>>24<0;eb(e+4|0,b?J[f>>2]:f,b?J[f+4>>2]:c);H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;J[5996]=0;_(19,a|0,d|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){g=Z()|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0>=29){$a(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24));H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;}if(!e){break a}$a(e);break a}if(!e){break d}$a(e);break d;case 3:d=J[c+8>>2];c=cb(3);J[h+48>>2]=c;b=c+3|0;J[h+56>>2]=b;H[c+2|0]=104;H[c|0]=80;H[c+1|0]=75;J[h+52>>2]=b;J[5996]=0;H[h+16|0]=0;ea(126,h+48|0,17,h+16|0);b=J[5996];J[5996]=0;if((b|0)==1){g=Z()|0;a=J[h+48>>2];if(!a){break a}$a(a);break a}f=J[h+48>>2];c=K[d+11|0];b=c<<24>>24<0;eb(f+3|0,b?J[d>>2]:d,b?J[d+4>>2]:c);H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a|0]=2;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=118;H[a+5|0]=169;J[5996]=0;i=_(19,a|0,h+48|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){k:{g=K[i|0]|K[i+1|0]<<8|(K[i+2|0]<<16|K[i+3|0]<<24);e=g-29|0;c=g>>>0<29?g:e;b=c+1|0;d=a+4|0;if(b>>>0>(g>>>0<=28?28:K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24))>>>0){J[5996]=0;aa(124,i|0,b+(b>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break k}g=K[i|0]|K[i+1|0]<<8|(K[i+2|0]<<16|K[i+3|0]<<24);e=g-29|0;}b=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);a=g>>>0<29;b=c+(a?d:b)|0;eb(b+1|0,b,(a?g:e)-c|0);a=(K[i|0]|K[i+1|0]<<8|(K[i+2|0]<<16|K[i+3|0]<<24))+1|0;H[i|0]=a;H[i+1|0]=a>>>8;H[i+2|0]=a>>>16;H[i+3|0]=a>>>24;H[b|0]=136;if(!f){break d}$a(f);break d}}g=Z()|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0>=29){$a(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24));H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;}if(!f){break a}$a(f);break a;case 4:H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;b=J[c+4>>2];J[5996]=0;e=nc(a,b,0);b=J[5996];J[5996]=0;if((b|0)!=1){l:{f=K[e|0]|K[e+1|0]<<8|(K[e+2|0]<<16|K[e+3|0]<<24);b=f-29|0;d=f>>>0<29?f:b;c=d+1|0;if(c>>>0>(f>>>0<=28?28:K[e+4|0]|K[e+5|0]<<8|(K[e+6|0]<<16|K[e+7|0]<<24))>>>0){J[5996]=0;aa(124,e|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break l}f=K[e|0]|K[e+1|0]<<8|(K[e+2|0]<<16|K[e+3|0]<<24);b=f-29|0;}a=f>>>0<29;c=d+(a?e+4|0:K[e+8|0]|K[e+9|0]<<8|(K[e+10|0]<<16|K[e+11|0]<<24))|0;eb(c+1|0,c,(a?f:b)-d|0);a=(K[e|0]|K[e+1|0]<<8|(K[e+2|0]<<16|K[e+3|0]<<24))+1|0;H[e|0]=a;H[e+1|0]=a>>>8;H[e+2|0]=a>>>16;H[e+3|0]=a>>>24;H[c|0]=178;break d}}break b;case 5:H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;b=J[c+4>>2];J[5996]=0;e=nc(a,b,0);b=J[5996];J[5996]=0;if((b|0)!=1){m:{f=K[e|0]|K[e+1|0]<<8|(K[e+2|0]<<16|K[e+3|0]<<24);b=f-29|0;d=f>>>0<29?f:b;c=d+1|0;if(c>>>0>(f>>>0<=28?28:K[e+4|0]|K[e+5|0]<<8|(K[e+6|0]<<16|K[e+7|0]<<24))>>>0){J[5996]=0;aa(124,e|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break m}f=K[e|0]|K[e+1|0]<<8|(K[e+2|0]<<16|K[e+3|0]<<24);b=f-29|0;}a=f>>>0<29;c=d+(a?e+4|0:K[e+8|0]|K[e+9|0]<<8|(K[e+10|0]<<16|K[e+11|0]<<24))|0;eb(c+1|0,c,(a?f:b)-d|0);a=(K[e|0]|K[e+1|0]<<8|(K[e+2|0]<<16|K[e+3|0]<<24))+1|0;H[e|0]=a;H[e+1|0]=a>>>8;H[e+2|0]=a>>>16;H[e+3|0]=a>>>24;H[c|0]=177;break d}}break b;case 8:J[h+48>>2]=32;J[h+16>>2]=136;J[h+80>>2]=166;J[h+4>>2]=b?136:135;vd(a,h+48|0,h+16|0,h+80|0,c+20|0,h+4|0);break d;case 7:J[h+48>>2]=32;J[h+16>>2]=136;J[h+80>>2]=170;J[h+4>>2]=b?136:135;vd(a,h+48|0,h+16|0,h+80|0,c+20|0,h+4|0);break d;case 9:J[h+48>>2]=32;J[h+16>>2]=136;J[h+80>>2]=169;J[h+4>>2]=b?136:135;vd(a,h+48|0,h+16|0,h+80|0,c+20|0,h+4|0);break d;case 10:H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+4|0]=107;H[a|0]=1;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;c=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);e=-28;f=1;b=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);l=b>>>0<29;n:{j=l?b:b-29|0;b=j+1|0;if(b>>>0>=29){J[5996]=0;aa(124,a|0,b+(b>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break n}n=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=f-29|0;}i=a+4|0;b=f>>>0<29;g=(b?i:n)+1|0;eb(j+g|0,g,(b?f:e)-1|0);b=j+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;o:{if(!j){break o}b=l?d+4|0:c;c=j&7;p:{if(!c){f=b;break p}d=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((c|0)!=(d|0)){continue}break}}if(j>>>0<8){break o}b=b+j|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}g=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=g-29|0;d=g>>>0<29?g:n;b=d+1|0;if(b>>>0>(g>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){J[5996]=0;aa(124,a|0,b+(b>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break n}g=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=g-29|0;}b=g>>>0<29;c=d+(b?i:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(c+1|0,c,(b?g:n)-d|0);b=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;H[c|0]=108;break d}break b;case 11:H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+4|0]=124;H[a|0]=1;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;c=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);e=-28;f=1;b=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);i=b>>>0<29;q:{l=i?b:b-29|0;b=l+1|0;if(b>>>0>=29){J[5996]=0;aa(124,a|0,b+(b>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break q}n=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=f-29|0;}b=f>>>0<29;g=(b?a+4|0:n)+1|0;eb(l+g|0,g,(b?f:e)-1|0);b=l+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;if(!l){break d}a=i?d+4|0:c;b=l&7;r:{if(!b){f=a;break r}d=0;f=a;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((b|0)!=(d|0)){continue}break}}if(l>>>0<8){break d}a=a+l|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((a|0)!=(f|0)){continue}break}break d}break b;case 12:J[h+48>>2]=b?173:172;te(a,d,h+48|0);break d;case 13:H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a|0]=2;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=118;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+5|0]=99;c=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);e=-27;f=2;b=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);l=b>>>0<29;s:{j=l?b:b-29|0;b=j+2|0;if(b>>>0>=29){J[5996]=0;aa(124,a|0,b+(b>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break s}n=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=f-29|0;}i=a+4|0;b=f>>>0<29;g=(b?i:n)+2|0;eb(j+g|0,g,(b?f:e)-2|0);b=j+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;t:{if(!j){break t}b=l?d+4|0:c;c=j&7;u:{if(!c){f=b;break u}d=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((c|0)!=(d|0)){continue}break}}if(j>>>0<8){break t}b=b+j|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}g=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=g-29|0;d=g>>>0<29?g:n;b=d+1|0;if(b>>>0>(g>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){J[5996]=0;aa(124,a|0,b+(b>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break s}g=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=g-29|0;}b=g>>>0<29;c=d+(b?i:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(c+1|0,c,(b?g:n)-d|0);b=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;H[c|0]=104;break d}break b;case 14:b=J[J[J[c+32>>2]>>2]+80>>2];if(!(Wb(1239,1)&(b^-1))){J[h+48>>2]=105;te(a,d,h+48|0);break d}H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;J[h+72>>2]=K[a+28|0]|K[a+29|0]<<8|(K[a+30|0]<<16|K[a+31|0]<<24);b=K[a+24|0]|K[a+25|0]<<8|(K[a+26|0]<<16|K[a+27|0]<<24);c=h- -64|0;J[c>>2]=K[a+20|0]|K[a+21|0]<<8|(K[a+22|0]<<16|K[a+23|0]<<24);J[c+4>>2]=b;b=K[a+16|0]|K[a+17|0]<<8|(K[a+18|0]<<16|K[a+19|0]<<24);J[h+56>>2]=K[a+12|0]|K[a+13|0]<<8|(K[a+14|0]<<16|K[a+15|0]<<24);J[h+60>>2]=b;b=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);J[h+48>>2]=K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24);J[h+52>>2]=b;b=K[d+28|0]|K[d+29|0]<<8|(K[d+30|0]<<16|K[d+31|0]<<24);H[a+28|0]=b;H[a+29|0]=b>>>8;H[a+30|0]=b>>>16;H[a+31|0]=b>>>24;e=K[d+24|0]|K[d+25|0]<<8|(K[d+26|0]<<16|K[d+27|0]<<24);b=K[d+20|0]|K[d+21|0]<<8|(K[d+22|0]<<16|K[d+23|0]<<24);H[a+20|0]=b;H[a+21|0]=b>>>8;H[a+22|0]=b>>>16;H[a+23|0]=b>>>24;H[a+24|0]=e;H[a+25|0]=e>>>8;H[a+26|0]=e>>>16;H[a+27|0]=e>>>24;e=K[d+16|0]|K[d+17|0]<<8|(K[d+18|0]<<16|K[d+19|0]<<24);b=K[d+12|0]|K[d+13|0]<<8|(K[d+14|0]<<16|K[d+15|0]<<24);H[a+12|0]=b;H[a+13|0]=b>>>8;H[a+14|0]=b>>>16;H[a+15|0]=b>>>24;H[a+16|0]=e;H[a+17|0]=e>>>8;H[a+18|0]=e>>>16;H[a+19|0]=e>>>24;e=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);b=K[d+4|0]|K[d+5|0]<<8|(K[d+6|0]<<16|K[d+7|0]<<24);H[a+4|0]=b;H[a+5|0]=b>>>8;H[a+6|0]=b>>>16;H[a+7|0]=b>>>24;H[a+8|0]=e;H[a+9|0]=e>>>8;H[a+10|0]=e>>>16;H[a+11|0]=e>>>24;b=J[h+72>>2];H[d+28|0]=b;H[d+29|0]=b>>>8;H[d+30|0]=b>>>16;H[d+31|0]=b>>>24;e=J[c+4>>2];b=J[c>>2];H[d+20|0]=b;H[d+21|0]=b>>>8;H[d+22|0]=b>>>16;H[d+23|0]=b>>>24;H[d+24|0]=e;H[d+25|0]=e>>>8;H[d+26|0]=e>>>16;H[d+27|0]=e>>>24;c=J[h+60>>2];b=J[h+56>>2];H[d+12|0]=b;H[d+13|0]=b>>>8;H[d+14|0]=b>>>16;H[d+15|0]=b>>>24;H[d+16|0]=c;H[d+17|0]=c>>>8;H[d+18|0]=c>>>16;H[d+19|0]=c>>>24;c=J[h+52>>2];b=J[h+48>>2];H[d+4|0]=b;H[d+5|0]=b>>>8;H[d+6|0]=b>>>16;H[d+7|0]=b>>>24;H[d+8|0]=c;H[d+9|0]=c>>>8;H[d+10|0]=c>>>16;H[d+11|0]=c>>>24;J[a>>2]=J[d>>2];J[d>>2]=0;break d;case 15:H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;J[5996]=0;c=_(127,a|0,130)|0;b=J[5996];J[5996]=0;if((b|0)!=1){v:{J[5996]=0;c=_(127,c|0,146)|0;b=J[5996];J[5996]=0;if((b|0)==1){break v}J[5996]=0;k=_(127,c|0,99)|0;b=J[5996];J[5996]=0;if((b|0)==1){break v}e=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);c=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);l=c>>>0<29;f=K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24);b=f-29|0;j=l?c:c-29|0;i=f>>>0<29?f:b;c=j+i|0;if(c>>>0>(f>>>0<=28?28:K[k+4|0]|K[k+5|0]<<8|(K[k+6|0]<<16|K[k+7|0]<<24))>>>0){J[5996]=0;aa(124,k|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break v}f=K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24);b=f-29|0;}c=f>>>0<29;g=i+(c?k+4|0:K[k+8|0]|K[k+9|0]<<8|(K[k+10|0]<<16|K[k+11|0]<<24))|0;eb(j+g|0,g,(c?f:b)-i|0);b=j+(K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24))|0;H[k|0]=b;H[k+1|0]=b>>>8;H[k+2|0]=b>>>16;H[k+3|0]=b>>>24;w:{if(!j){break w}b=l?d+4|0:e;c=j&7;x:{if(!c){f=b;break x}d=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((c|0)!=(d|0)){continue}break}}if(j>>>0<8){break w}b=b+j|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;_(127,k|0,104)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break d}}}break b;case 16:J[h+48>>2]=146;te(a,d,h+48|0);break d;case 1:H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+4|0]=81;H[a|0]=1;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;break d;case 0:H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+4|0]=0;H[a|0]=1;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;break d;case 17:H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;c=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);n=-29;b=0;i=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);e=i>>>0<29;y:{l=e?i:i-29|0;if(l>>>0>=29){J[5996]=0;aa(124,a|0,l+(l>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break y}f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=f-29|0;b=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);}i=a+4|0;k=b;b=f>>>0<29;g=b?i:k;eb(l+g|0,g,b?f:n);b=l+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;z:{if(!l){break z}b=e?d+4|0:c;c=l&7;A:{if(!c){f=b;break A}n=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;n=n+1|0;if((c|0)!=(n|0)){continue}break}}if(l>>>0<8){break z}b=b+l|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}c=K[d+40|0]|K[d+41|0]<<8|(K[d+42|0]<<16|K[d+43|0]<<24);b=K[d+32|0]|K[d+33|0]<<8|(K[d+34|0]<<16|K[d+35|0]<<24);j=b>>>0<29;f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=f-29|0;k=j?b:b-29|0;l=f>>>0<29?f:e;b=k+l|0;if(b>>>0>(f>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){J[5996]=0;aa(124,a|0,b+(b>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break y}f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=f-29|0;}b=f>>>0<29;g=l+(b?i:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(k+g|0,g,(b?f:e)-l|0);b=k+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;if(!k){break d}a=j?d+36|0:c;b=k&7;B:{if(!b){f=a;break B}d=0;f=a;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((b|0)!=(d|0)){continue}break}}if(k>>>0<8){break d}a=a+k|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((a|0)!=(f|0)){continue}break}break d}break b;case 18:J[h+48>>2]=154;se(a,d,d+32|0,h+48|0);break d;case 19:J[h+48>>2]=155;se(a,d,d+32|0,h+48|0);break d;case 21:H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;c=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);n=-29;b=0;i=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);e=i>>>0<29;i=e?i:i-29|0;C:{if(i>>>0>=29){J[5996]=0;aa(124,a|0,i+(i>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break C}f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=f-29|0;b=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);}j=a+4|0;k=b;b=f>>>0<29;g=b?j:k;eb(i+g|0,g,b?f:n);b=i+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;D:{if(!i){break D}b=e?d+4|0:c;c=i&7;E:{if(!c){f=b;break E}n=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;n=n+1|0;if((c|0)!=(n|0)){continue}break}}if(i>>>0<8){break D}b=b+i|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;c=_(127,a|0,115)|0;b=J[5996];J[5996]=0;if((b|0)==1){break C}J[5996]=0;m=_(127,c|0,100)|0;b=J[5996];J[5996]=0;if((b|0)==1){break C}e=K[d+40|0]|K[d+41|0]<<8|(K[d+42|0]<<16|K[d+43|0]<<24);c=K[d+32|0]|K[d+33|0]<<8|(K[d+34|0]<<16|K[d+35|0]<<24);l=c>>>0<29;f=K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24);b=f-29|0;k=l?c:c-29|0;i=f>>>0<29?f:b;c=k+i|0;if(c>>>0>(f>>>0<=28?28:K[j|0]|K[j+1|0]<<8|(K[j+2|0]<<16|K[j+3|0]<<24))>>>0){J[5996]=0;aa(124,m|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break C}f=K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24);b=f-29|0;}c=f>>>0<29;g=i+(c?j:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(k+g|0,g,(c?f:b)-i|0);b=k+(K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24))|0;H[m|0]=b;H[m+1|0]=b>>>8;H[m+2|0]=b>>>16;H[m+3|0]=b>>>24;F:{if(!k){break F}b=l?d+36|0:e;c=k&7;G:{if(!c){f=b;break G}d=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((c|0)!=(d|0)){continue}break}}if(k>>>0<8){break F}b=b+k|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;_(127,m|0,104)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break d}}break b;case 20:H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;c=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);n=-29;b=0;i=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);e=i>>>0<29;i=e?i:i-29|0;H:{if(i>>>0>=29){J[5996]=0;aa(124,a|0,i+(i>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break H}f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=f-29|0;b=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);}j=a+4|0;k=b;b=f>>>0<29;g=b?j:k;eb(i+g|0,g,b?f:n);b=i+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;I:{if(!i){break I}b=e?d+4|0:c;c=i&7;J:{if(!c){f=b;break J}n=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;n=n+1|0;if((c|0)!=(n|0)){continue}break}}if(i>>>0<8){break I}b=b+i|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;m=_(127,a|0,100)|0;b=J[5996];J[5996]=0;if((b|0)==1){break H}e=K[d+40|0]|K[d+41|0]<<8|(K[d+42|0]<<16|K[d+43|0]<<24);c=K[d+32|0]|K[d+33|0]<<8|(K[d+34|0]<<16|K[d+35|0]<<24);l=c>>>0<29;f=K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24);b=f-29|0;k=l?c:c-29|0;i=f>>>0<29?f:b;c=k+i|0;if(c>>>0>(f>>>0<=28?28:K[j|0]|K[j+1|0]<<8|(K[j+2|0]<<16|K[j+3|0]<<24))>>>0){J[5996]=0;aa(124,m|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break H}f=K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24);b=f-29|0;}c=f>>>0<29;g=i+(c?j:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(k+g|0,g,(c?f:b)-i|0);b=k+(K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24))|0;H[m|0]=b;H[m+1|0]=b>>>8;H[m+2|0]=b>>>16;H[m+3|0]=b>>>24;K:{if(!k){break K}b=l?d+36|0:e;c=k&7;L:{if(!c){f=b;break L}d=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((c|0)!=(d|0)){continue}break}}if(k>>>0<8){break K}b=b+k|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;_(127,m|0,104)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break d}}break b;case 22:H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;J[5996]=0;k=_(127,a|0,99)|0;b=J[5996];J[5996]=0;if((b|0)!=1){M:{e=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);c=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);l=c>>>0<29;f=K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24);b=f-29|0;j=l?c:c-29|0;i=f>>>0<29?f:b;c=j+i|0;if(c>>>0>(f>>>0<=28?28:K[k+4|0]|K[k+5|0]<<8|(K[k+6|0]<<16|K[k+7|0]<<24))>>>0){J[5996]=0;aa(124,k|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break M}f=K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24);b=f-29|0;}c=f>>>0<29;g=i+(c?k+4|0:K[k+8|0]|K[k+9|0]<<8|(K[k+10|0]<<16|K[k+11|0]<<24))|0;eb(j+g|0,g,(c?f:b)-i|0);b=j+(K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24))|0;H[k|0]=b;H[k+1|0]=b>>>8;H[k+2|0]=b>>>16;H[k+3|0]=b>>>24;N:{if(!j){break N}b=l?d+4|0:e;c=j&7;O:{if(!c){f=b;break O}f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;n=n+1|0;if((c|0)!=(n|0)){continue}break}}if(j>>>0<8){break N}b=b+j|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;k=_(127,k|0,103)|0;b=J[5996];J[5996]=0;if((b|0)==1){break M}e=K[d+40|0]|K[d+41|0]<<8|(K[d+42|0]<<16|K[d+43|0]<<24);c=K[d+32|0]|K[d+33|0]<<8|(K[d+34|0]<<16|K[d+35|0]<<24);l=c>>>0<29;f=K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24);b=f-29|0;j=l?c:c-29|0;i=f>>>0<29?f:b;c=j+i|0;if(c>>>0>(f>>>0<=28?28:K[k+4|0]|K[k+5|0]<<8|(K[k+6|0]<<16|K[k+7|0]<<24))>>>0){J[5996]=0;aa(124,k|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break M}f=K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24);b=f-29|0;}c=f>>>0<29;g=i+(c?k+4|0:K[k+8|0]|K[k+9|0]<<8|(K[k+10|0]<<16|K[k+11|0]<<24))|0;eb(j+g|0,g,(c?f:b)-i|0);b=j+(K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24))|0;H[k|0]=b;H[k+1|0]=b>>>8;H[k+2|0]=b>>>16;H[k+3|0]=b>>>24;P:{if(!j){break P}b=l?d+36|0:e;c=j&7;Q:{if(!c){f=b;break Q}d=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((c|0)!=(d|0)){continue}break}}if(j>>>0<8){break P}b=b+j|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;_(127,k|0,104)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break d}}}break b;case 23:H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;c=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);n=-29;b=0;i=K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24);e=i>>>0<29;i=e?i:i-29|0;R:{if(i>>>0>=29){J[5996]=0;aa(124,a|0,i+(i>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break R}f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=f-29|0;b=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);}k=a+4|0;m=b;b=f>>>0<29;g=b?k:m;eb(i+g|0,g,b?f:n);b=i+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;S:{if(!i){break S}b=e?d+4|0:c;c=i&7;T:{if(!c){f=b;break T}n=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;n=n+1|0;if((c|0)!=(n|0)){continue}break}}if(i>>>0<8){break S}b=b+i|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;m=_(127,a|0,100)|0;b=J[5996];J[5996]=0;if((b|0)==1){break R}e=K[d+72|0]|K[d+73|0]<<8|(K[d+74|0]<<16|K[d+75|0]<<24);c=K[d+64|0]|K[d+65|0]<<8|(K[d+66|0]<<16|K[d+67|0]<<24);l=c>>>0<29;f=K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24);b=f-29|0;j=l?c:c-29|0;i=f>>>0<29?f:b;c=j+i|0;if(c>>>0>(f>>>0<=28?28:K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24))>>>0){J[5996]=0;aa(124,m|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break R}f=K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24);b=f-29|0;}c=f>>>0<29;g=i+(c?k:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(j+g|0,g,(c?f:b)-i|0);b=j+(K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24))|0;H[m|0]=b;H[m+1|0]=b>>>8;H[m+2|0]=b>>>16;H[m+3|0]=b>>>24;U:{if(!j){break U}b=l?d+68|0:e;c=j&7;V:{if(!c){f=b;break V}n=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;n=n+1|0;if((c|0)!=(n|0)){continue}break}}if(j>>>0<8){break U}b=b+j|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;m=_(127,m|0,103)|0;b=J[5996];J[5996]=0;if((b|0)==1){break R}e=K[d+40|0]|K[d+41|0]<<8|(K[d+42|0]<<16|K[d+43|0]<<24);c=K[d+32|0]|K[d+33|0]<<8|(K[d+34|0]<<16|K[d+35|0]<<24);l=c>>>0<29;f=K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24);b=f-29|0;j=l?c:c-29|0;i=f>>>0<29?f:b;c=j+i|0;if(c>>>0>(f>>>0<=28?28:K[k|0]|K[k+1|0]<<8|(K[k+2|0]<<16|K[k+3|0]<<24))>>>0){J[5996]=0;aa(124,m|0,c+(c>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break R}f=K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24);b=f-29|0;}c=f>>>0<29;g=i+(c?k:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(j+g|0,g,(c?f:b)-i|0);b=j+(K[m|0]|K[m+1|0]<<8|(K[m+2|0]<<16|K[m+3|0]<<24))|0;H[m|0]=b;H[m+1|0]=b>>>8;H[m+2|0]=b>>>16;H[m+3|0]=b>>>24;W:{if(!j){break W}b=l?d+36|0:e;c=j&7;X:{if(!c){f=b;break X}d=0;f=b;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((c|0)!=(d|0)){continue}break}}if(j>>>0<8){break W}b=b+j|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((b|0)!=(f|0)){continue}break}}J[5996]=0;_(127,m|0,104)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break d}}break b;case 25:J[h+72>>2]=0;J[h+76>>2]=0;d=h- -64|0;J[d>>2]=0;J[d+4>>2]=0;J[h+56>>2]=0;J[h+60>>2]=0;J[h+48>>2]=0;J[h+52>>2]=0;d=J[c+4>>2];J[5996]=0;o=nc(h+48|0,d,0);d=J[5996];J[5996]=0;if((d|0)==1){g=Z()|0;if(M[h+48>>2]<29){break a}$a(J[h+56>>2]);break a}e=J[c+8>>2];m=J[c+12>>2];if((e|0)==(m|0)){c=e;break g}l=o+4|0;i=h+20|0;while(1){Y:{J[5996]=0;f=$(3,4)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Y}J[h+4>>2]=f;d=f+4|0;J[h+12>>2]=d;H[f|0]=2;H[f+1|0]=80;H[f+2|0]=75;H[f+3|0]=98;J[h+8>>2]=d;J[5996]=0;H[h+80|0]=0;ea(126,h+4|0,29,h+80|0);d=J[5996];J[5996]=0;if((d|0)==1){g=Z()|0;a=J[h+4>>2];if(!a){break f}$a(a);break f}d=0;j=K[e+11|0];f=j<<24>>24<0;eb(J[h+4>>2]+4|0,f?J[e>>2]:e,f?J[e+4>>2]:j);J[h+40>>2]=0;J[h+44>>2]=0;J[h+32>>2]=0;J[h+36>>2]=0;J[h+24>>2]=0;J[h+28>>2]=0;J[h+16>>2]=0;J[h+20>>2]=0;n=-29;j=J[o+8>>2];f=0;p=J[o>>2];k=p>>>0<29;p=k?p:p-29|0;if(p>>>0>=29){J[5996]=0;aa(124,h+16|0,p+(p>>>1|0)|0);d=J[5996];J[5996]=0;if((d|0)==1){break i}f=J[h+16>>2];n=f-29|0;g=J[h+24>>2];}else {g=d;}d=f>>>0<29;g=d?i:g;eb(g+p|0,g,d?f:n);J[h+16>>2]=p+J[h+16>>2];Z:{if(!p){break Z}d=0;k=k?l:j;f=k;j=p&7;if(j){while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((j|0)!=(d|0)){continue}break}}if(p>>>0<8){break Z}d=k+p|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((d|0)!=(f|0)){continue}break}}J[5996]=0;f=_(19,h+16|0,h+4|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break i}J[h+104>>2]=K[l+24|0]|K[l+25|0]<<8|(K[l+26|0]<<16|K[l+27|0]<<24);d=K[l+20|0]|K[l+21|0]<<8|(K[l+22|0]<<16|K[l+23|0]<<24);J[h+96>>2]=K[l+16|0]|K[l+17|0]<<8|(K[l+18|0]<<16|K[l+19|0]<<24);J[h+100>>2]=d;d=K[l+12|0]|K[l+13|0]<<8|(K[l+14|0]<<16|K[l+15|0]<<24);J[h+88>>2]=K[l+8|0]|K[l+9|0]<<8|(K[l+10|0]<<16|K[l+11|0]<<24);J[h+92>>2]=d;d=K[l+4|0]|K[l+5|0]<<8|(K[l+6|0]<<16|K[l+7|0]<<24);J[h+80>>2]=K[l|0]|K[l+1|0]<<8|(K[l+2|0]<<16|K[l+3|0]<<24);J[h+84>>2]=d;J[l+24>>2]=J[i+24>>2];d=J[i+20>>2];J[l+16>>2]=J[i+16>>2];J[l+20>>2]=d;d=J[i+12>>2];J[l+8>>2]=J[i+8>>2];J[l+12>>2]=d;d=J[i+4>>2];J[l>>2]=J[i>>2];J[l+4>>2]=d;d=J[h+104>>2];H[i+24|0]=d;H[i+25|0]=d>>>8;H[i+26|0]=d>>>16;H[i+27|0]=d>>>24;j=J[h+100>>2];d=J[h+96>>2];H[i+16|0]=d;H[i+17|0]=d>>>8;H[i+18|0]=d>>>16;H[i+19|0]=d>>>24;H[i+20|0]=j;H[i+21|0]=j>>>8;H[i+22|0]=j>>>16;H[i+23|0]=j>>>24;j=J[h+92>>2];d=J[h+88>>2];H[i+8|0]=d;H[i+9|0]=d>>>8;H[i+10|0]=d>>>16;H[i+11|0]=d>>>24;H[i+12|0]=j;H[i+13|0]=j>>>8;H[i+14|0]=j>>>16;H[i+15|0]=j>>>24;j=J[h+84>>2];d=J[h+80>>2];H[i|0]=d;H[i+1|0]=d>>>8;H[i+2|0]=d>>>16;H[i+3|0]=d>>>24;H[i+4|0]=j;H[i+5|0]=j>>>8;H[i+6|0]=j>>>16;H[i+7|0]=j>>>24;d=J[o>>2];J[o>>2]=J[f>>2];J[f>>2]=d;if(d>>>0>=29){$a(J[h+24>>2]);J[h+24>>2]=0;}d=J[h+4>>2];if(d){$a(d);}e=e+12|0;if((m|0)!=(e|0)){continue}break h}break}g=Z()|0;break f;case 24:J[h+72>>2]=0;J[h+76>>2]=0;f=h- -64|0;J[f>>2]=0;J[f+4>>2]=0;J[h+56>>2]=0;J[h+60>>2]=0;J[h+48>>2]=0;J[h+52>>2]=0;n=J[h+76>>2];J[h+40>>2]=n;k=J[h+72>>2];f=J[h+68>>2];m=f;J[h+32>>2]=f;J[h+36>>2]=k;j=J[h+64>>2];i=J[h+60>>2];J[h+24>>2]=i;J[h+28>>2]=j;l=J[h+56>>2];f=J[h+52>>2];J[h+16>>2]=f;J[h+20>>2]=l;J[h+76>>2]=K[d+28|0]|K[d+29|0]<<8|(K[d+30|0]<<16|K[d+31|0]<<24);o=K[d+24|0]|K[d+25|0]<<8|(K[d+26|0]<<16|K[d+27|0]<<24);J[h+68>>2]=K[d+20|0]|K[d+21|0]<<8|(K[d+22|0]<<16|K[d+23|0]<<24);J[h+72>>2]=o;o=K[d+16|0]|K[d+17|0]<<8|(K[d+18|0]<<16|K[d+19|0]<<24);J[h+60>>2]=K[d+12|0]|K[d+13|0]<<8|(K[d+14|0]<<16|K[d+15|0]<<24);J[h+64>>2]=o;o=K[d+8|0]|K[d+9|0]<<8|(K[d+10|0]<<16|K[d+11|0]<<24);J[h+52>>2]=K[d+4|0]|K[d+5|0]<<8|(K[d+6|0]<<16|K[d+7|0]<<24);J[h+56>>2]=o;H[d+28|0]=n;H[d+29|0]=n>>>8;H[d+30|0]=n>>>16;H[d+31|0]=n>>>24;H[d+20|0]=m;H[d+21|0]=m>>>8;H[d+22|0]=m>>>16;H[d+23|0]=m>>>24;H[d+24|0]=k;H[d+25|0]=k>>>8;H[d+26|0]=k>>>16;H[d+27|0]=k>>>24;H[d+12|0]=i;H[d+13|0]=i>>>8;H[d+14|0]=i>>>16;H[d+15|0]=i>>>24;H[d+16|0]=j;H[d+17|0]=j>>>8;H[d+18|0]=j>>>16;H[d+19|0]=j>>>24;H[d+4|0]=f;H[d+5|0]=f>>>8;H[d+6|0]=f>>>16;H[d+7|0]=f>>>24;H[d+8|0]=l;H[d+9|0]=l>>>8;H[d+10|0]=l>>>16;H[d+11|0]=l>>>24;g=J[d>>2];J[h+48>>2]=g;J[d>>2]=0;j=h+48|4;_:{$:{if(e>>>0>=2){n=1;while(1){J[5996]=0;J[h+4>>2]=147;ga(128,h+16|0,h+48|0,(n<<5)+d|0,h+4|0);f=J[5996];J[5996]=0;if((f|0)==1){break $}J[h+104>>2]=K[j+24|0]|K[j+25|0]<<8|(K[j+26|0]<<16|K[j+27|0]<<24);f=K[j+20|0]|K[j+21|0]<<8|(K[j+22|0]<<16|K[j+23|0]<<24);J[h+96>>2]=K[j+16|0]|K[j+17|0]<<8|(K[j+18|0]<<16|K[j+19|0]<<24);J[h+100>>2]=f;f=K[j+12|0]|K[j+13|0]<<8|(K[j+14|0]<<16|K[j+15|0]<<24);J[h+88>>2]=K[j+8|0]|K[j+9|0]<<8|(K[j+10|0]<<16|K[j+11|0]<<24);J[h+92>>2]=f;f=K[j+4|0]|K[j+5|0]<<8|(K[j+6|0]<<16|K[j+7|0]<<24);J[h+80>>2]=K[j|0]|K[j+1|0]<<8|(K[j+2|0]<<16|K[j+3|0]<<24);J[h+84>>2]=f;J[j+24>>2]=J[h+44>>2];f=J[h+40>>2];J[j+16>>2]=J[h+36>>2];J[j+20>>2]=f;f=J[h+32>>2];J[j+8>>2]=J[h+28>>2];J[j+12>>2]=f;f=J[h+24>>2];J[j>>2]=J[h+20>>2];J[j+4>>2]=f;f=J[h+104>>2];H[h+44|0]=f;H[h+45|0]=f>>>8;H[h+46|0]=f>>>16;H[h+47|0]=f>>>24;i=J[h+100>>2];f=J[h+96>>2];H[h+36|0]=f;H[h+37|0]=f>>>8;H[h+38|0]=f>>>16;H[h+39|0]=f>>>24;H[h+40|0]=i;H[h+41|0]=i>>>8;H[h+42|0]=i>>>16;H[h+43|0]=i>>>24;i=J[h+92>>2];f=J[h+88>>2];H[h+28|0]=f;H[h+29|0]=f>>>8;H[h+30|0]=f>>>16;H[h+31|0]=f>>>24;H[h+32|0]=i;H[h+33|0]=i>>>8;H[h+34|0]=i>>>16;H[h+35|0]=i>>>24;i=J[h+84>>2];f=J[h+80>>2];H[h+20|0]=f;H[h+21|0]=f>>>8;H[h+22|0]=f>>>16;H[h+23|0]=f>>>24;H[h+24|0]=i;H[h+25|0]=i>>>8;H[h+26|0]=i>>>16;H[h+27|0]=i>>>24;f=J[h+48>>2];J[h+48>>2]=J[h+16>>2];J[h+16>>2]=f;if(f>>>0>=29){$a(J[h+24>>2]);}n=n+1|0;if((n|0)!=(e|0)){continue}break}g=J[h+48>>2];}H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;n=-29;i=J[h+56>>2];d=0;aa:{k=a+4|0;f=g>>>0<29;l=f?g:g-29|0;ba:{if(l>>>0>=29){J[5996]=0;aa(124,a|0,l+(l>>>1|0)|0);d=J[5996];J[5996]=0;if((d|0)==1){break ba}d=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);n=d-29|0;p=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);}e=d>>>0<29;g=e?k:p;eb(g+l|0,g,e?d:n);d=l+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=d;H[a+1|0]=d>>>8;H[a+2|0]=d>>>16;H[a+3|0]=d>>>24;ca:{if(!l){break ca}e=f?j:i;i=l&7;da:{if(!i){f=e;break da}d=0;f=e;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((i|0)!=(d|0)){continue}break}}if(l>>>0<8){break ca}d=e+l|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((d|0)!=(f|0)){continue}break}}c=J[c+4>>2];J[5996]=0;d=nc(a,c,0);c=J[5996];J[5996]=0;if((c|0)==1){break ba}J[5996]=0;_(127,d|0,(b?136:135)|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break aa}}g=Z()|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0<29){break _}$a(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24));H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;break _}if(M[h+48>>2]<29){break d}$a(J[h+56>>2]);break d}g=Z()|0;}if(M[h+48>>2]<29){break a}$a(J[h+56>>2]);break a;default:la(2350,2210,624,5107);B();case 6:break j}}J[h+48>>2]=32;J[h+16>>2]=136;J[h+80>>2]=168;J[h+4>>2]=b?136:135;vd(a,h+48|0,h+16|0,h+80|0,c+20|0,h+4|0);break d}g=Z()|0;if(M[h+16>>2]>=29){$a(J[h+24>>2]);J[h+24>>2]=0;}a=J[h+4>>2];if(!a){break f}$a(a);break f}e=J[c+8>>2];c=J[c+12>>2];}H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;l=J[o+8>>2];d=-29;i=(c-e|0)/12|0;n=0;f=0;c=J[o>>2];e=c>>>0<29;j=e?c:c-29|0;ea:{if(j>>>0>=29){J[5996]=0;aa(124,a|0,j+(j>>>1|0)|0);c=J[5996];J[5996]=0;if((c|0)==1){break ea}n=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);f=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=f-29|0;}c=f>>>0<29;g=c?a+4|0:n;eb(j+g|0,g,c?f:d);c=j+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;fa:{if(!j){break fa}c=e?o+4|0:l;e=j&7;ga:{if(!e){f=c;break ga}d=0;f=c;while(1){H[g|0]=K[f|0];f=f+1|0;g=g+1|0;d=d+1|0;if((e|0)!=(d|0)){continue}break}}if(j>>>0<8){break fa}c=c+j|0;while(1){H[g|0]=K[f|0];H[g+1|0]=K[f+1|0];H[g+2|0]=K[f+2|0];H[g+3|0]=K[f+3|0];H[g+4|0]=K[f+4|0];H[g+5|0]=K[f+5|0];H[g+6|0]=K[f+6|0];H[g+7|0]=K[f+7|0];g=g+8|0;f=f+8|0;if((c|0)!=(f|0)){continue}break}}J[5996]=0;d=nc(a,i,0);c=J[5996];J[5996]=0;if((c|0)==1){break ea}J[5996]=0;_(127,d|0,(b?175:174)|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break e}}g=Z()|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0<29){break f}$a(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24));H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;}if(M[o>>2]<29){break a}$a(J[o+8>>2]);break a}if(M[o>>2]<29){break d}$a(J[o+8>>2]);}Ua=h+112|0;return}g=Z()|0;a=J[h+48>>2];if(!a){break a}$a(a);break a}g=Z()|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0<29){break a}$a(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24));H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;}da(g|0);B();}function Um(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;c=Ua-496|0;Ua=c;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{x:{y:{z:{A:{B:{C:{D:{E:{F:{G:{H:{I:{J:{K:{L:{M:{N:{O:{P:{Q:{R:{S:{T:{U:{V:{W:{X:{Y:{e=J[b>>2];switch(J[e>>2]-1|0){case 23:break z;case 22:break A;case 21:break B;case 20:break C;case 19:break D;case 18:break E;case 17:break F;case 16:break G;case 14:break H;case 15:break I;case 13:break J;case 12:break K;case 11:break L;case 10:break M;case 9:break N;case 0:break O;case 8:break Q;case 6:break R;case 7:break S;case 5:break T;case 3:break U;case 4:break V;case 24:break W;case 2:break X;case 1:break Y;default:break P}}e=J[e+8>>2];Z:{if(H[e+11|0]>=0){J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;break Z}Zc(c+448|0,J[e>>2],J[e+4>>2]);}J[5996]=0;H[c+460|0]=1;e=ba(99,c+448|0,0,5283)|0;d=J[5996];J[5996]=0;_:{$:{aa:{ba:{if((d|0)!=1){J[c+472>>2]=J[e+8>>2];d=J[e+4>>2];J[c+464>>2]=J[e>>2];J[c+468>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;d=_(97,c+464|0,5242)|0;f=J[5996];J[5996]=0;if((f|0)==1){break ba}J[c+488>>2]=J[d+8>>2];f=J[d+4>>2];J[c+480>>2]=J[d>>2];J[c+484>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;ea(161,a|0,b|0,c+480|0);a=J[5996];J[5996]=0;if((a|0)==1){break aa}if(H[c+491|0]<0){$a(J[c+480>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(!K[c+460|0]|H[e+11|0]>=0){break y}$a(J[e>>2]);break y}b=Z()|0;break _}b=Z()|0;break $}b=Z()|0;if(H[c+491|0]>=0){break $}$a(J[c+480>>2]);}if(H[c+475|0]>=0){break _}$a(J[c+464>>2]);}break c}e=J[e+8>>2];ca:{if(H[e+11|0]>=0){J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;break ca}Zc(c+448|0,J[e>>2],J[e+4>>2]);}J[5996]=0;H[c+460|0]=1;e=ba(99,c+448|0,0,5315)|0;d=J[5996];J[5996]=0;da:{ea:{fa:{ga:{if((d|0)!=1){J[c+472>>2]=J[e+8>>2];d=J[e+4>>2];J[c+464>>2]=J[e>>2];J[c+468>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;d=_(97,c+464|0,5242)|0;f=J[5996];J[5996]=0;if((f|0)==1){break ga}J[c+440>>2]=J[d+8>>2];f=J[d+4>>2];J[c+432>>2]=J[d>>2];J[c+436>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;ea(161,a|0,b|0,c+432|0);a=J[5996];J[5996]=0;if((a|0)==1){break fa}if(H[c+443|0]<0){$a(J[c+432>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(!K[c+460|0]|H[e+11|0]>=0){break y}$a(J[e>>2]);break y}b=Z()|0;break da}b=Z()|0;break ea}b=Z()|0;if(H[c+443|0]>=0){break ea}$a(J[c+432>>2]);}if(H[c+475|0]>=0){break da}$a(J[c+464>>2]);}break c}d=c+384|0;Kc(d,J[e+4>>2]);J[5996]=0;e=ba(99,d|0,0,5289)|0;d=J[5996];J[5996]=0;ha:{ia:{ja:{ka:{la:{ma:{na:{oa:{pa:{qa:{if((d|0)!=1){J[c+408>>2]=J[e+8>>2];d=J[e+4>>2];J[c+400>>2]=J[e>>2];J[c+404>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;d=_(97,c+400|0,5417)|0;f=J[5996];J[5996]=0;if((f|0)==1){break qa}J[c+472>>2]=J[d+8>>2];f=J[d+4>>2];J[c+464>>2]=J[d>>2];J[c+468>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;f=J[b>>2];g=J[f+12>>2];f=J[f+8>>2];J[5996]=0;h=c+368|0;aa(115,h|0,(g-f|0)/12|0);f=J[5996];J[5996]=0;if((f|0)==1){break pa}J[5996]=0;f=K[c+379|0];g=f<<24>>24<0;f=ba(100,c+464|0,(g?J[c+368>>2]:h)|0,(g?J[c+372>>2]:f)|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break oa}J[c+456>>2]=J[f+8>>2];g=J[f+4>>2];J[c+448>>2]=J[f>>2];J[c+452>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;J[5996]=0;g=_(97,c+448|0,5242)|0;h=J[5996];J[5996]=0;if((h|0)==1){break na}J[c+424>>2]=J[g+8>>2];h=J[g+4>>2];J[c+416>>2]=J[g>>2];J[c+420>>2]=h;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;ea(161,a|0,b|0,c+416|0);a=J[5996];J[5996]=0;if((a|0)==1){break ma}if(H[c+427|0]<0){$a(J[c+416>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[c+379|0]<0){$a(J[c+368>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]>=0){break y}$a(J[e>>2]);break y}b=Z()|0;break ha}b=Z()|0;break ia}b=Z()|0;break ja}b=Z()|0;break ka}b=Z()|0;break la}b=Z()|0;if(H[c+427|0]>=0){break la}$a(J[c+416>>2]);}if(H[c+459|0]>=0){break ka}$a(J[c+448>>2]);}if(H[c+379|0]>=0){break ja}$a(J[c+368>>2]);}if(H[c+475|0]>=0){break ia}$a(J[c+464>>2]);}if(H[c+411|0]>=0){break ha}$a(J[c+400>>2]);}if(H[c+395|0]>=0){break a}$a(J[c+384>>2]);break a}d=c+464|0;Kc(d,J[e+4>>2]);J[5996]=0;e=ba(99,d|0,0,5258)|0;d=J[5996];J[5996]=0;ra:{sa:{ta:{ua:{if((d|0)!=1){J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;d=_(97,c+448|0,5242)|0;f=J[5996];J[5996]=0;if((f|0)==1){break ua}J[c+360>>2]=J[d+8>>2];f=J[d+4>>2];J[c+352>>2]=J[d>>2];J[c+356>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;ea(161,a|0,b|0,c+352|0);a=J[5996];J[5996]=0;if((a|0)==1){break ta}if(H[c+363|0]<0){$a(J[c+352>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]>=0){break y}$a(J[e>>2]);break y}b=Z()|0;break ra}b=Z()|0;break sa}b=Z()|0;if(H[c+363|0]>=0){break sa}$a(J[c+352>>2]);}if(H[c+459|0]>=0){break ra}$a(J[c+448>>2]);}break b}d=c+464|0;Kc(d,J[e+4>>2]);J[5996]=0;e=ba(99,d|0,0,5265)|0;d=J[5996];J[5996]=0;va:{wa:{xa:{ya:{if((d|0)!=1){J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;d=_(97,c+448|0,5242)|0;f=J[5996];J[5996]=0;if((f|0)==1){break ya}J[c+344>>2]=J[d+8>>2];f=J[d+4>>2];J[c+336>>2]=J[d>>2];J[c+340>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;ea(161,a|0,b|0,c+336|0);a=J[5996];J[5996]=0;if((a|0)==1){break xa}if(H[c+347|0]<0){$a(J[c+336>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]>=0){break y}$a(J[e>>2]);break y}b=Z()|0;break va}b=Z()|0;break wa}b=Z()|0;if(H[c+347|0]>=0){break wa}$a(J[c+336>>2]);}if(H[c+459|0]>=0){break va}$a(J[c+448>>2]);}break b}H[c+328|0]=0;J[c+320>>2]=845244531;J[c+324>>2]=690501173;H[c+331|0]=8;J[5996]=0;ea(161,a|0,b|0,c+320|0);a=J[5996];J[5996]=0;if((a|0)!=1){if(H[c+331|0]>=0){break y}$a(J[c+320>>2]);break y}b=Z()|0;if(H[c+331|0]>=0){break a}$a(J[c+320>>2]);break a}e=cb(16);J[c+308>>2]=e;J[c+312>>2]=11;J[c+316>>2]=-2147483632;d=K[5239]|K[5240]<<8|(K[5241]<<16|K[5242]<<24);H[e+7|0]=d;H[e+8|0]=d>>>8;H[e+9|0]=d>>>16;H[e+10|0]=d>>>24;d=K[5236]|K[5237]<<8|(K[5238]<<16|K[5239]<<24);f=K[5232]|K[5233]<<8|(K[5234]<<16|K[5235]<<24);H[e|0]=f;H[e+1|0]=f>>>8;H[e+2|0]=f>>>16;H[e+3|0]=f>>>24;H[e+4|0]=d;H[e+5|0]=d>>>8;H[e+6|0]=d>>>16;H[e+7|0]=d>>>24;H[e+11|0]=0;J[5996]=0;ea(161,a|0,b|0,c+308|0);a=J[5996];J[5996]=0;if((a|0)!=1){if(H[c+319|0]>=0){break y}$a(J[c+308>>2]);break y}b=Z()|0;if(H[c+319|0]>=0){break a}$a(J[c+308>>2]);break a}H[c+304|0]=K[5220];H[c+307|0]=9;H[c+305|0]=0;J[5996]=0;e=K[5216]|K[5217]<<8|(K[5218]<<16|K[5219]<<24);J[c+296>>2]=K[5212]|K[5213]<<8|(K[5214]<<16|K[5215]<<24);J[c+300>>2]=e;ea(161,a|0,b|0,c+296|0);a=J[5996];J[5996]=0;if((a|0)!=1){if(H[c+307|0]>=0){break y}$a(J[c+296>>2]);break y}b=Z()|0;if(H[c+307|0]>=0){break a}$a(J[c+296>>2]);break a}H[c+288|0]=K[5230];H[c+291|0]=9;H[c+289|0]=0;J[5996]=0;e=K[5226]|K[5227]<<8|(K[5228]<<16|K[5229]<<24);J[c+280>>2]=K[5222]|K[5223]<<8|(K[5224]<<16|K[5225]<<24);J[c+284>>2]=e;ea(161,a|0,b|0,c+280|0);a=J[5996];J[5996]=0;if((a|0)!=1){if(H[c+291|0]>=0){break y}$a(J[c+280>>2]);break y}b=Z()|0;if(H[c+291|0]>=0){break a}$a(J[c+280>>2]);break a}H[c+272|0]=K[2354];H[c+279|0]=5;H[c+273|0]=0;J[5996]=0;J[c+268>>2]=K[2350]|K[2351]<<8|(K[2352]<<16|K[2353]<<24);ea(161,a|0,b|0,c+268|0);a=J[5996];J[5996]=0;if((a|0)!=1){if(H[c+279|0]>=0){break y}$a(J[c+268>>2]);break y}b=Z()|0;if(H[c+279|0]>=0){break a}$a(J[c+268>>2]);break a}H[c+260|0]=0;J[c+256>>2]=1702195828;H[c+267|0]=4;J[5996]=0;ea(161,a|0,b|0,c+256|0);a=J[5996];J[5996]=0;if((a|0)!=1){if(H[c+267|0]>=0){break y}$a(J[c+256>>2]);break y}b=Z()|0;if(H[c+267|0]>=0){break a}$a(J[c+256>>2]);break a}H[c+255|0]=2;H[c+246|0]=0;I[c+244>>1]=14945;J[5996]=0;e=c+464|0;ea(161,e|0,b|0,c+244|0);d=J[5996];J[5996]=0;za:{Aa:{Ba:{Ca:{Da:{Ea:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,5574)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Ea}J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;d=c+400|0;aa(141,d|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break Da}J[5996]=0;f=d;b=K[c+411|0];d=b<<24>>24<0;b=ba(100,c+448|0,(d?J[c+400>>2]:f)|0,(d?J[c+404>>2]:b)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Ca}d=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=d;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;Fa:{if(H[c+411|0]>=0){break Fa}$a(J[c+400>>2]);if(H[b+11|0]>=0){break Fa}$a(J[b>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+255|0]>=0){break y}$a(J[c+244>>2]);break y}b=Z()|0;break za}b=Z()|0;break Aa}b=Z()|0;break Ba}b=Z()|0;if(H[c+411|0]>=0){break Ba}$a(J[c+400>>2]);}if(H[c+459|0]>=0){break Aa}$a(J[c+448>>2]);}if(H[c+475|0]>=0){break za}$a(J[c+464>>2]);}if(H[c+255|0]>=0){break a}$a(J[c+244>>2]);break a}H[c+243|0]=2;H[c+234|0]=0;I[c+232>>1]=14963;J[5996]=0;e=c+464|0;ea(161,e|0,b|0,c+232|0);d=J[5996];J[5996]=0;Ga:{Ha:{Ia:{Ja:{Ka:{La:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,5574)|0;d=J[5996];J[5996]=0;if((d|0)==1){break La}J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;d=c+400|0;aa(141,d|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ka}J[5996]=0;f=d;b=K[c+411|0];d=b<<24>>24<0;b=ba(100,c+448|0,(d?J[c+400>>2]:f)|0,(d?J[c+404>>2]:b)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Ja}d=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=d;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;Ma:{if(H[c+411|0]>=0){break Ma}$a(J[c+400>>2]);if(H[b+11|0]>=0){break Ma}$a(J[b>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+243|0]>=0){break y}$a(J[c+232>>2]);break y}b=Z()|0;break Ga}b=Z()|0;break Ha}b=Z()|0;break Ia}b=Z()|0;if(H[c+411|0]>=0){break Ia}$a(J[c+400>>2]);}if(H[c+459|0]>=0){break Ha}$a(J[c+448>>2]);}if(H[c+475|0]>=0){break Ga}$a(J[c+464>>2]);}if(H[c+243|0]>=0){break a}$a(J[c+232>>2]);break a}H[c+231|0]=2;H[c+222|0]=0;I[c+220>>1]=14947;J[5996]=0;e=c+464|0;ea(161,e|0,b|0,c+220|0);d=J[5996];J[5996]=0;Na:{Oa:{Pa:{Qa:{Ra:{Sa:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,5574)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Sa}J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;d=c+400|0;aa(141,d|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ra}J[5996]=0;f=d;b=K[c+411|0];d=b<<24>>24<0;b=ba(100,c+448|0,(d?J[c+400>>2]:f)|0,(d?J[c+404>>2]:b)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Qa}d=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=d;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;Ta:{if(H[c+411|0]>=0){break Ta}$a(J[c+400>>2]);if(H[b+11|0]>=0){break Ta}$a(J[b>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+231|0]>=0){break y}$a(J[c+220>>2]);break y}b=Z()|0;break Na}b=Z()|0;break Oa}b=Z()|0;break Pa}b=Z()|0;if(H[c+411|0]>=0){break Pa}$a(J[c+400>>2]);}if(H[c+459|0]>=0){break Oa}$a(J[c+448>>2]);}if(H[c+475|0]>=0){break Na}$a(J[c+464>>2]);}if(H[c+231|0]>=0){break a}$a(J[c+220>>2]);break a}H[c+219|0]=2;H[c+210|0]=0;I[c+208>>1]=14948;J[5996]=0;e=c+464|0;ea(161,e|0,b|0,c+208|0);d=J[5996];J[5996]=0;Ua:{Va:{Wa:{Xa:{Ya:{Za:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,5574)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Za}J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;d=c+400|0;aa(141,d|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ya}J[5996]=0;f=d;b=K[c+411|0];d=b<<24>>24<0;b=ba(100,c+448|0,(d?J[c+400>>2]:f)|0,(d?J[c+404>>2]:b)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Xa}d=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=d;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;_a:{if(H[c+411|0]>=0){break _a}$a(J[c+400>>2]);if(H[b+11|0]>=0){break _a}$a(J[b>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+219|0]>=0){break y}$a(J[c+208>>2]);break y}b=Z()|0;break Ua}b=Z()|0;break Va}b=Z()|0;break Wa}b=Z()|0;if(H[c+411|0]>=0){break Wa}$a(J[c+400>>2]);}if(H[c+459|0]>=0){break Va}$a(J[c+448>>2]);}if(H[c+475|0]>=0){break Ua}$a(J[c+464>>2]);}if(H[c+219|0]>=0){break a}$a(J[c+208>>2]);break a}H[c+207|0]=2;H[c+198|0]=0;I[c+196>>1]=14966;J[5996]=0;e=c+464|0;ea(161,e|0,b|0,c+196|0);d=J[5996];J[5996]=0;$a:{ab:{bb:{cb:{db:{eb:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,5574)|0;d=J[5996];J[5996]=0;if((d|0)==1){break eb}J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;d=c+400|0;aa(141,d|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break db}J[5996]=0;f=d;b=K[c+411|0];d=b<<24>>24<0;b=ba(100,c+448|0,(d?J[c+400>>2]:f)|0,(d?J[c+404>>2]:b)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break cb}d=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=d;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;fb:{if(H[c+411|0]>=0){break fb}$a(J[c+400>>2]);if(H[b+11|0]>=0){break fb}$a(J[b>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+207|0]>=0){break y}$a(J[c+196>>2]);break y}b=Z()|0;break $a}b=Z()|0;break ab}b=Z()|0;break bb}b=Z()|0;if(H[c+411|0]>=0){break bb}$a(J[c+400>>2]);}if(H[c+459|0]>=0){break ab}$a(J[c+448>>2]);}if(H[c+475|0]>=0){break $a}$a(J[c+464>>2]);}if(H[c+207|0]>=0){break a}$a(J[c+196>>2]);break a}H[c+195|0]=2;H[c+186|0]=0;I[c+184>>1]=14958;J[5996]=0;e=c+464|0;ea(161,e|0,b|0,c+184|0);d=J[5996];J[5996]=0;gb:{hb:{ib:{jb:{kb:{lb:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,5574)|0;d=J[5996];J[5996]=0;if((d|0)==1){break lb}J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;d=c+400|0;aa(141,d|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break kb}J[5996]=0;f=d;b=K[c+411|0];d=b<<24>>24<0;b=ba(100,c+448|0,(d?J[c+400>>2]:f)|0,(d?J[c+404>>2]:b)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break jb}d=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=d;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;mb:{if(H[c+411|0]>=0){break mb}$a(J[c+400>>2]);if(H[b+11|0]>=0){break mb}$a(J[b>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+195|0]>=0){break y}$a(J[c+184>>2]);break y}b=Z()|0;break gb}b=Z()|0;break hb}b=Z()|0;break ib}b=Z()|0;if(H[c+411|0]>=0){break ib}$a(J[c+400>>2]);}if(H[c+459|0]>=0){break hb}$a(J[c+448>>2]);}if(H[c+475|0]>=0){break gb}$a(J[c+464>>2]);}if(H[c+195|0]>=0){break a}$a(J[c+184>>2]);break a}H[c+183|0]=2;H[c+174|0]=0;I[c+172>>1]=14954;J[5996]=0;e=c+464|0;ea(161,e|0,b|0,c+172|0);d=J[5996];J[5996]=0;nb:{ob:{pb:{qb:{rb:{sb:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,5574)|0;d=J[5996];J[5996]=0;if((d|0)==1){break sb}J[c+456>>2]=J[e+8>>2];d=J[e+4>>2];J[c+448>>2]=J[e>>2];J[c+452>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;d=c+400|0;aa(141,d|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break rb}J[5996]=0;f=d;b=K[c+411|0];d=b<<24>>24<0;b=ba(100,c+448|0,(d?J[c+400>>2]:f)|0,(d?J[c+404>>2]:b)|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break qb}d=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=d;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;tb:{if(H[c+411|0]>=0){break tb}$a(J[c+400>>2]);if(H[b+11|0]>=0){break tb}$a(J[b>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+183|0]>=0){break y}$a(J[c+172>>2]);break y}b=Z()|0;break nb}b=Z()|0;break ob}b=Z()|0;break pb}b=Z()|0;if(H[c+411|0]>=0){break pb}$a(J[c+400>>2]);}if(H[c+459|0]>=0){break ob}$a(J[c+448>>2]);}if(H[c+475|0]>=0){break nb}$a(J[c+464>>2]);}if(H[c+183|0]>=0){break a}$a(J[c+172>>2]);break a}H[c+164|0]=K[1271];H[c+171|0]=5;H[c+165|0]=0;J[5996]=0;J[c+160>>2]=K[1267]|K[1268]<<8|(K[1269]<<16|K[1270]<<24);e=c+368|0;ea(161,e|0,b|0,c+160|0);d=J[5996];J[5996]=0;ub:{vb:{wb:{xb:{yb:{zb:{Ab:{Bb:{Cb:{Db:{Eb:{Fb:{Gb:{Hb:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,3673)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Hb}J[c+392>>2]=J[e+8>>2];d=J[e+4>>2];J[c+384>>2]=J[e>>2];J[c+388>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;d=J[J[b>>2]+32>>2];J[5996]=0;f=c+144|0;aa(141,f|0,d|0);d=J[5996];J[5996]=0;if((d|0)==1){break Gb}J[5996]=0;g=f;d=K[c+155|0];f=d<<24>>24<0;d=ba(100,c+384|0,(f?J[c+144>>2]:g)|0,(f?J[c+148>>2]:d)|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Fb}J[c+408>>2]=J[d+8>>2];f=J[d+4>>2];J[c+400>>2]=J[d>>2];J[c+404>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=_(97,c+400|0,3613)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Eb}J[c+472>>2]=J[f+8>>2];g=J[f+4>>2];J[c+464>>2]=J[f>>2];J[c+468>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;g=c+128|0;aa(141,g|0,b+8|0);b=J[5996];J[5996]=0;if((b|0)==1){break Db}J[5996]=0;h=g;b=K[c+139|0];g=b<<24>>24<0;g=ba(100,c+464|0,(g?J[c+128>>2]:h)|0,(g?J[c+132>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Cb}J[c+456>>2]=J[g+8>>2];b=J[g+4>>2];J[c+448>>2]=J[g>>2];J[c+452>>2]=b;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;b=_(97,c+448|0,3570)|0;h=J[5996];J[5996]=0;if((h|0)==1){break Bb}h=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=h;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;if(H[c+139|0]<0){$a(J[c+128>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[c+155|0]<0){$a(J[c+144>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+171|0]>=0){break y}$a(J[c+160>>2]);break y}b=Z()|0;break ub}b=Z()|0;break vb}b=Z()|0;break wb}b=Z()|0;break xb}b=Z()|0;break yb}b=Z()|0;break zb}b=Z()|0;break Ab}b=Z()|0;if(H[c+459|0]>=0){break Ab}$a(J[c+448>>2]);}if(H[c+139|0]>=0){break zb}$a(J[c+128>>2]);}if(H[c+475|0]>=0){break yb}$a(J[c+464>>2]);}if(H[c+411|0]>=0){break xb}$a(J[c+400>>2]);}if(H[c+155|0]>=0){break wb}$a(J[c+144>>2]);}if(H[c+395|0]>=0){break vb}$a(J[c+384>>2]);}if(H[c+379|0]>=0){break ub}$a(J[c+368>>2]);}if(H[c+171|0]>=0){break a}$a(J[c+160>>2]);break a}H[c+120|0]=K[2551];H[c+127|0]=5;H[c+121|0]=0;J[5996]=0;J[c+116>>2]=K[2547]|K[2548]<<8|(K[2549]<<16|K[2550]<<24);e=c+368|0;ea(161,e|0,b|0,c+116|0);d=J[5996];J[5996]=0;Ib:{Jb:{Kb:{Lb:{Mb:{Nb:{Ob:{Pb:{Qb:{Rb:{Sb:{Tb:{Ub:{Vb:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,3673)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Vb}J[c+392>>2]=J[e+8>>2];d=J[e+4>>2];J[c+384>>2]=J[e>>2];J[c+388>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;d=J[J[b>>2]+32>>2];J[5996]=0;f=c+144|0;aa(141,f|0,d|0);d=J[5996];J[5996]=0;if((d|0)==1){break Ub}J[5996]=0;g=f;d=K[c+155|0];f=d<<24>>24<0;d=ba(100,c+384|0,(f?J[c+144>>2]:g)|0,(f?J[c+148>>2]:d)|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Tb}J[c+408>>2]=J[d+8>>2];f=J[d+4>>2];J[c+400>>2]=J[d>>2];J[c+404>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=_(97,c+400|0,3613)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Sb}J[c+472>>2]=J[f+8>>2];g=J[f+4>>2];J[c+464>>2]=J[f>>2];J[c+468>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;g=c+128|0;aa(141,g|0,b+8|0);b=J[5996];J[5996]=0;if((b|0)==1){break Rb}J[5996]=0;h=g;b=K[c+139|0];g=b<<24>>24<0;g=ba(100,c+464|0,(g?J[c+128>>2]:h)|0,(g?J[c+132>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Qb}J[c+456>>2]=J[g+8>>2];b=J[g+4>>2];J[c+448>>2]=J[g>>2];J[c+452>>2]=b;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;b=_(97,c+448|0,3570)|0;h=J[5996];J[5996]=0;if((h|0)==1){break Pb}h=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=h;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;if(H[c+139|0]<0){$a(J[c+128>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[c+155|0]<0){$a(J[c+144>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+127|0]>=0){break y}$a(J[c+116>>2]);break y}b=Z()|0;break Ib}b=Z()|0;break Jb}b=Z()|0;break Kb}b=Z()|0;break Lb}b=Z()|0;break Mb}b=Z()|0;break Nb}b=Z()|0;break Ob}b=Z()|0;if(H[c+459|0]>=0){break Ob}$a(J[c+448>>2]);}if(H[c+139|0]>=0){break Nb}$a(J[c+128>>2]);}if(H[c+475|0]>=0){break Mb}$a(J[c+464>>2]);}if(H[c+411|0]>=0){break Lb}$a(J[c+400>>2]);}if(H[c+155|0]>=0){break Kb}$a(J[c+144>>2]);}if(H[c+395|0]>=0){break Jb}$a(J[c+384>>2]);}if(H[c+379|0]>=0){break Ib}$a(J[c+368>>2]);}if(H[c+127|0]>=0){break a}$a(J[c+116>>2]);break a}H[c+115|0]=4;H[c+108|0]=0;J[c+104>>2]=1650422383;J[5996]=0;e=c+368|0;ea(161,e|0,b|0,c+104|0);d=J[5996];J[5996]=0;Wb:{Xb:{Yb:{Zb:{_b:{$b:{ac:{bc:{cc:{dc:{ec:{fc:{gc:{hc:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,3673)|0;d=J[5996];J[5996]=0;if((d|0)==1){break hc}J[c+392>>2]=J[e+8>>2];d=J[e+4>>2];J[c+384>>2]=J[e>>2];J[c+388>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;d=J[J[b>>2]+32>>2];J[5996]=0;f=c+144|0;aa(141,f|0,d|0);d=J[5996];J[5996]=0;if((d|0)==1){break gc}J[5996]=0;g=f;d=K[c+155|0];f=d<<24>>24<0;d=ba(100,c+384|0,(f?J[c+144>>2]:g)|0,(f?J[c+148>>2]:d)|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break fc}J[c+408>>2]=J[d+8>>2];f=J[d+4>>2];J[c+400>>2]=J[d>>2];J[c+404>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=_(97,c+400|0,3613)|0;g=J[5996];J[5996]=0;if((g|0)==1){break ec}J[c+472>>2]=J[f+8>>2];g=J[f+4>>2];J[c+464>>2]=J[f>>2];J[c+468>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;g=c+128|0;aa(141,g|0,b+8|0);b=J[5996];J[5996]=0;if((b|0)==1){break dc}J[5996]=0;h=g;b=K[c+139|0];g=b<<24>>24<0;g=ba(100,c+464|0,(g?J[c+128>>2]:h)|0,(g?J[c+132>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break cc}J[c+456>>2]=J[g+8>>2];b=J[g+4>>2];J[c+448>>2]=J[g>>2];J[c+452>>2]=b;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;b=_(97,c+448|0,3570)|0;h=J[5996];J[5996]=0;if((h|0)==1){break bc}h=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=h;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;if(H[c+139|0]<0){$a(J[c+128>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[c+155|0]<0){$a(J[c+144>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+115|0]>=0){break y}$a(J[c+104>>2]);break y}b=Z()|0;break Wb}b=Z()|0;break Xb}b=Z()|0;break Yb}b=Z()|0;break Zb}b=Z()|0;break _b}b=Z()|0;break $b}b=Z()|0;break ac}b=Z()|0;if(H[c+459|0]>=0){break ac}$a(J[c+448>>2]);}if(H[c+139|0]>=0){break $b}$a(J[c+128>>2]);}if(H[c+475|0]>=0){break _b}$a(J[c+464>>2]);}if(H[c+411|0]>=0){break Zb}$a(J[c+400>>2]);}if(H[c+155|0]>=0){break Yb}$a(J[c+144>>2]);}if(H[c+395|0]>=0){break Xb}$a(J[c+384>>2]);}if(H[c+379|0]>=0){break Wb}$a(J[c+368>>2]);}if(H[c+115|0]>=0){break a}$a(J[c+104>>2]);break a}H[c+103|0]=4;H[c+96|0]=0;J[c+92>>2]=1667199599;J[5996]=0;e=c+368|0;ea(161,e|0,b|0,c+92|0);d=J[5996];J[5996]=0;ic:{jc:{kc:{lc:{mc:{nc:{oc:{pc:{qc:{rc:{sc:{tc:{uc:{vc:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,3673)|0;d=J[5996];J[5996]=0;if((d|0)==1){break vc}J[c+392>>2]=J[e+8>>2];d=J[e+4>>2];J[c+384>>2]=J[e>>2];J[c+388>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;d=J[J[b>>2]+32>>2];J[5996]=0;f=c+144|0;aa(141,f|0,d|0);d=J[5996];J[5996]=0;if((d|0)==1){break uc}J[5996]=0;g=f;d=K[c+155|0];f=d<<24>>24<0;d=ba(100,c+384|0,(f?J[c+144>>2]:g)|0,(f?J[c+148>>2]:d)|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break tc}J[c+408>>2]=J[d+8>>2];f=J[d+4>>2];J[c+400>>2]=J[d>>2];J[c+404>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=_(97,c+400|0,3613)|0;g=J[5996];J[5996]=0;if((g|0)==1){break sc}J[c+472>>2]=J[f+8>>2];g=J[f+4>>2];J[c+464>>2]=J[f>>2];J[c+468>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;g=c+128|0;aa(141,g|0,b+8|0);b=J[5996];J[5996]=0;if((b|0)==1){break rc}J[5996]=0;h=g;b=K[c+139|0];g=b<<24>>24<0;g=ba(100,c+464|0,(g?J[c+128>>2]:h)|0,(g?J[c+132>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break qc}J[c+456>>2]=J[g+8>>2];b=J[g+4>>2];J[c+448>>2]=J[g>>2];J[c+452>>2]=b;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;b=_(97,c+448|0,3570)|0;h=J[5996];J[5996]=0;if((h|0)==1){break pc}h=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=h;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;if(H[c+139|0]<0){$a(J[c+128>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[c+155|0]<0){$a(J[c+144>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+103|0]>=0){break y}$a(J[c+92>>2]);break y}b=Z()|0;break ic}b=Z()|0;break jc}b=Z()|0;break kc}b=Z()|0;break lc}b=Z()|0;break mc}b=Z()|0;break nc}b=Z()|0;break oc}b=Z()|0;if(H[c+459|0]>=0){break oc}$a(J[c+448>>2]);}if(H[c+139|0]>=0){break nc}$a(J[c+128>>2]);}if(H[c+475|0]>=0){break mc}$a(J[c+464>>2]);}if(H[c+411|0]>=0){break lc}$a(J[c+400>>2]);}if(H[c+155|0]>=0){break kc}$a(J[c+144>>2]);}if(H[c+395|0]>=0){break jc}$a(J[c+384>>2]);}if(H[c+379|0]>=0){break ic}$a(J[c+368>>2]);}if(H[c+103|0]>=0){break a}$a(J[c+92>>2]);break a}H[c+91|0]=4;H[c+84|0]=0;J[c+80>>2]=1683976815;J[5996]=0;e=c+368|0;ea(161,e|0,b|0,c+80|0);d=J[5996];J[5996]=0;wc:{xc:{yc:{zc:{Ac:{Bc:{Cc:{Dc:{Ec:{Fc:{Gc:{Hc:{Ic:{Jc:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,3673)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Jc}J[c+392>>2]=J[e+8>>2];d=J[e+4>>2];J[c+384>>2]=J[e>>2];J[c+388>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;d=J[J[b>>2]+32>>2];J[5996]=0;f=c+144|0;aa(141,f|0,d|0);d=J[5996];J[5996]=0;if((d|0)==1){break Ic}J[5996]=0;g=f;d=K[c+155|0];f=d<<24>>24<0;d=ba(100,c+384|0,(f?J[c+144>>2]:g)|0,(f?J[c+148>>2]:d)|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Hc}J[c+408>>2]=J[d+8>>2];f=J[d+4>>2];J[c+400>>2]=J[d>>2];J[c+404>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=_(97,c+400|0,3613)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Gc}J[c+472>>2]=J[f+8>>2];g=J[f+4>>2];J[c+464>>2]=J[f>>2];J[c+468>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;g=c+128|0;aa(141,g|0,b+8|0);b=J[5996];J[5996]=0;if((b|0)==1){break Fc}J[5996]=0;h=g;b=K[c+139|0];g=b<<24>>24<0;g=ba(100,c+464|0,(g?J[c+128>>2]:h)|0,(g?J[c+132>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Ec}J[c+456>>2]=J[g+8>>2];b=J[g+4>>2];J[c+448>>2]=J[g>>2];J[c+452>>2]=b;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;b=_(97,c+448|0,3570)|0;h=J[5996];J[5996]=0;if((h|0)==1){break Dc}h=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=h;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;if(H[c+139|0]<0){$a(J[c+128>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[c+155|0]<0){$a(J[c+144>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+91|0]>=0){break y}$a(J[c+80>>2]);break y}b=Z()|0;break wc}b=Z()|0;break xc}b=Z()|0;break yc}b=Z()|0;break zc}b=Z()|0;break Ac}b=Z()|0;break Bc}b=Z()|0;break Cc}b=Z()|0;if(H[c+459|0]>=0){break Cc}$a(J[c+448>>2]);}if(H[c+139|0]>=0){break Bc}$a(J[c+128>>2]);}if(H[c+475|0]>=0){break Ac}$a(J[c+464>>2]);}if(H[c+411|0]>=0){break zc}$a(J[c+400>>2]);}if(H[c+155|0]>=0){break yc}$a(J[c+144>>2]);}if(H[c+395|0]>=0){break xc}$a(J[c+384>>2]);}if(H[c+379|0]>=0){break wc}$a(J[c+368>>2]);}if(H[c+91|0]>=0){break a}$a(J[c+80>>2]);break a}H[c+79|0]=4;H[c+72|0]=0;J[c+68>>2]=1767862895;J[5996]=0;e=c+368|0;ea(161,e|0,b|0,c+68|0);d=J[5996];J[5996]=0;Kc:{Lc:{Mc:{Nc:{Oc:{Pc:{Qc:{Rc:{Sc:{Tc:{Uc:{Vc:{Wc:{Xc:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,3673)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Xc}J[c+392>>2]=J[e+8>>2];d=J[e+4>>2];J[c+384>>2]=J[e>>2];J[c+388>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;d=J[J[b>>2]+32>>2];J[5996]=0;f=c+144|0;aa(141,f|0,d|0);d=J[5996];J[5996]=0;if((d|0)==1){break Wc}J[5996]=0;g=f;d=K[c+155|0];f=d<<24>>24<0;d=ba(100,c+384|0,(f?J[c+144>>2]:g)|0,(f?J[c+148>>2]:d)|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Vc}J[c+408>>2]=J[d+8>>2];f=J[d+4>>2];J[c+400>>2]=J[d>>2];J[c+404>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=_(97,c+400|0,3613)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Uc}J[c+472>>2]=J[f+8>>2];g=J[f+4>>2];J[c+464>>2]=J[f>>2];J[c+468>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;g=c+128|0;aa(141,g|0,b+8|0);b=J[5996];J[5996]=0;if((b|0)==1){break Tc}J[5996]=0;h=g;b=K[c+139|0];g=b<<24>>24<0;g=ba(100,c+464|0,(g?J[c+128>>2]:h)|0,(g?J[c+132>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break Sc}J[c+456>>2]=J[g+8>>2];b=J[g+4>>2];J[c+448>>2]=J[g>>2];J[c+452>>2]=b;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;b=_(97,c+448|0,3570)|0;h=J[5996];J[5996]=0;if((h|0)==1){break Rc}h=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=h;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;if(H[c+139|0]<0){$a(J[c+128>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[c+155|0]<0){$a(J[c+144>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+79|0]>=0){break y}$a(J[c+68>>2]);break y}b=Z()|0;break Kc}b=Z()|0;break Lc}b=Z()|0;break Mc}b=Z()|0;break Nc}b=Z()|0;break Oc}b=Z()|0;break Pc}b=Z()|0;break Qc}b=Z()|0;if(H[c+459|0]>=0){break Qc}$a(J[c+448>>2]);}if(H[c+139|0]>=0){break Pc}$a(J[c+128>>2]);}if(H[c+475|0]>=0){break Oc}$a(J[c+464>>2]);}if(H[c+411|0]>=0){break Nc}$a(J[c+400>>2]);}if(H[c+155|0]>=0){break Mc}$a(J[c+144>>2]);}if(H[c+395|0]>=0){break Lc}$a(J[c+384>>2]);}if(H[c+379|0]>=0){break Kc}$a(J[c+368>>2]);}if(H[c+79|0]>=0){break a}$a(J[c+68>>2]);break a}I[c- -64>>1]=K[2600]|K[2601]<<8;I[c+66>>1]=2560;J[5996]=0;e=K[2596]|K[2597]<<8|(K[2598]<<16|K[2599]<<24);J[c+56>>2]=K[2592]|K[2593]<<8|(K[2594]<<16|K[2595]<<24);J[c+60>>2]=e;e=c+128|0;ea(161,e|0,b|0,c+56|0);d=J[5996];J[5996]=0;Yc:{Zc:{_c:{$c:{ad:{bd:{cd:{dd:{ed:{fd:{gd:{hd:{id:{jd:{kd:{ld:{md:{nd:{od:{pd:{if((d|0)!=1){J[5996]=0;e=_(97,e|0,3623)|0;d=J[5996];J[5996]=0;if((d|0)==1){break pd}J[c+152>>2]=J[e+8>>2];d=J[e+4>>2];J[c+144>>2]=J[e>>2];J[c+148>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;d=J[J[b>>2]+32>>2];J[5996]=0;f=c+40|0;aa(141,f|0,d|0);d=J[5996];J[5996]=0;if((d|0)==1){break od}J[5996]=0;g=f;d=K[c+51|0];f=d<<24>>24<0;d=ba(100,c+144|0,(f?J[c+40>>2]:g)|0,(f?J[c+44>>2]:d)|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break nd}J[c+376>>2]=J[d+8>>2];f=J[d+4>>2];J[c+368>>2]=J[d>>2];J[c+372>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=_(97,c+368|0,3613)|0;g=J[5996];J[5996]=0;if((g|0)==1){break md}J[c+392>>2]=J[f+8>>2];g=J[f+4>>2];J[c+384>>2]=J[f>>2];J[c+388>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;g=J[J[b>>2]+32>>2];J[5996]=0;h=c+28|0;aa(141,h|0,g+8|0);g=J[5996];J[5996]=0;if((g|0)==1){break ld}J[5996]=0;i=h;g=K[c+39|0];h=g<<24>>24<0;g=ba(100,c+384|0,(h?J[c+28>>2]:i)|0,(h?J[c+32>>2]:g)|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break kd}J[c+408>>2]=J[g+8>>2];h=J[g+4>>2];J[c+400>>2]=J[g>>2];J[c+404>>2]=h;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;h=_(97,c+400|0,3603)|0;i=J[5996];J[5996]=0;if((i|0)==1){break jd}J[c+472>>2]=J[h+8>>2];i=J[h+4>>2];J[c+464>>2]=J[h>>2];J[c+468>>2]=i;J[h>>2]=0;J[h+4>>2]=0;J[h+8>>2]=0;b=J[J[b>>2]+32>>2];J[5996]=0;i=c+16|0;aa(141,i|0,b+16|0);b=J[5996];J[5996]=0;if((b|0)==1){break id}J[5996]=0;j=i;b=K[c+27|0];i=b<<24>>24<0;i=ba(100,c+464|0,(i?J[c+16>>2]:j)|0,(i?J[c+20>>2]:b)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break hd}J[c+456>>2]=J[i+8>>2];b=J[i+4>>2];J[c+448>>2]=J[i>>2];J[c+452>>2]=b;J[i>>2]=0;J[i+4>>2]=0;J[i+8>>2]=0;J[5996]=0;b=_(97,c+448|0,3570)|0;j=J[5996];J[5996]=0;if((j|0)==1){break gd}j=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=j;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;if(H[c+27|0]<0){$a(J[c+16>>2]);}if(H[i+11|0]<0){$a(J[i>>2]);}if(H[h+11|0]<0){$a(J[h>>2]);}if(H[c+39|0]<0){$a(J[c+28>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[c+51|0]<0){$a(J[c+40>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}if(H[c+67|0]>=0){break y}$a(J[c+56>>2]);break y}b=Z()|0;break Yc}b=Z()|0;break Zc}b=Z()|0;break _c}b=Z()|0;break $c}b=Z()|0;break ad}b=Z()|0;break bd}b=Z()|0;break cd}b=Z()|0;break dd}b=Z()|0;break ed}b=Z()|0;break fd}b=Z()|0;if(H[c+459|0]>=0){break fd}$a(J[c+448>>2]);}if(H[c+27|0]>=0){break ed}$a(J[c+16>>2]);}if(H[c+475|0]>=0){break dd}$a(J[c+464>>2]);}if(H[c+411|0]>=0){break cd}$a(J[c+400>>2]);}if(H[c+39|0]>=0){break bd}$a(J[c+28>>2]);}if(H[c+395|0]>=0){break ad}$a(J[c+384>>2]);}if(H[c+379|0]>=0){break $c}$a(J[c+368>>2]);}if(H[c+51|0]>=0){break _c}$a(J[c+40>>2]);}if(H[c+155|0]>=0){break Zc}$a(J[c+144>>2]);}if(H[c+139|0]>=0){break Yc}$a(J[c+128>>2]);}if(H[c+67|0]>=0){break a}$a(J[c+56>>2]);break a}d=c+144|0;Kc(d,J[e+4>>2]);J[5996]=0;e=ba(99,d|0,0,5302)|0;d=J[5996];J[5996]=0;if((d|0)==1){break x}J[c+376>>2]=J[e+8>>2];d=J[e+4>>2];J[c+368>>2]=J[e>>2];J[c+372>>2]=d;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;d=_(97,c+368|0,5417)|0;f=J[5996];J[5996]=0;if((f|0)==1){break w}J[c+392>>2]=J[d+8>>2];f=J[d+4>>2];J[c+384>>2]=J[d>>2];J[c+388>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;f=J[b>>2];g=J[f+36>>2];f=J[f+32>>2];J[5996]=0;h=c+128|0;aa(115,h|0,g-f>>3);f=J[5996];J[5996]=0;if((f|0)==1){break v}J[5996]=0;f=K[c+139|0];g=f<<24>>24<0;f=ba(100,c+384|0,(g?J[c+128>>2]:h)|0,(g?J[c+132>>2]:f)|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break u}J[c+408>>2]=J[f+8>>2];g=J[f+4>>2];J[c+400>>2]=J[f>>2];J[c+404>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;J[5996]=0;g=_(97,c+400|0,5242)|0;h=J[5996];J[5996]=0;if((h|0)==1){break t}J[c+8>>2]=J[g+8>>2];h=J[g+4>>2];J[c>>2]=J[g>>2];J[c+4>>2]=h;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;h=c+464|0;ea(161,h|0,b|0,c|0);i=J[5996];J[5996]=0;if((i|0)==1){break s}J[5996]=0;h=_(97,h|0,3726)|0;i=J[5996];J[5996]=0;if((i|0)==1){break r}J[c+456>>2]=J[h+8>>2];i=J[h+4>>2];J[c+448>>2]=J[h>>2];J[c+452>>2]=i;J[h>>2]=0;J[h+4>>2]=0;J[h+8>>2]=0;if(H[c+11|0]<0){$a(J[c>>2]);}if(H[g+11|0]<0){$a(J[g>>2]);}if(H[c+139|0]<0){$a(J[c+128>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}if(H[e+11|0]<0){$a(J[e>>2]);}b=J[b>>2];d=J[b+32>>2];f=J[b+36>>2];if((d|0)!=(f|0)){while(1){J[5996]=0;b=c+28|0;aa(141,b|0,d|0);e=J[5996];J[5996]=0;if((e|0)==1){break k}J[5996]=0;b=ba(99,b|0,0,3708)|0;e=J[5996];J[5996]=0;if((e|0)==1){break j}J[c+48>>2]=J[b+8>>2];e=J[b+4>>2];J[c+40>>2]=J[b>>2];J[c+44>>2]=e;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;e=_(97,c+40|0,3713)|0;g=J[5996];J[5996]=0;if((g|0)==1){break i}J[c+136>>2]=J[e+8>>2];g=J[e+4>>2];J[c+128>>2]=J[e>>2];J[c+132>>2]=g;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;g=K[c+139|0];h=g<<24>>24<0;ba(100,c+448|0,(h?J[c+128>>2]:c+128|0)|0,(h?J[c+132>>2]:g)|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break h}if(H[c+139|0]<0){$a(J[c+128>>2]);}if(H[c+51|0]<0){$a(J[e>>2]);}if(H[c+39|0]<0){$a(J[b>>2]);}d=d+8|0;if((f|0)!=(d|0)){continue}break}}J[5996]=0;b=_(97,c+448|0,3575)|0;e=J[5996];J[5996]=0;if((e|0)==1){break e}e=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=e;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;}Ua=c+496|0;return}b=Z()|0;break l}b=Z()|0;break m}b=Z()|0;break n}b=Z()|0;break o}b=Z()|0;break p}b=Z()|0;break q}b=Z()|0;if(H[c+475|0]>=0){break q}$a(J[c+464>>2]);}if(H[c+11|0]>=0){break p}$a(J[c>>2]);}if(H[c+411|0]>=0){break o}$a(J[c+400>>2]);}if(H[c+139|0]>=0){break n}$a(J[c+128>>2]);}if(H[c+395|0]>=0){break m}$a(J[c+384>>2]);}if(H[c+379|0]>=0){break l}$a(J[c+368>>2]);}if(H[c+155|0]>=0){break a}$a(J[c+144>>2]);break a}b=Z()|0;break d}b=Z()|0;break f}b=Z()|0;break g}b=Z()|0;if(H[c+139|0]>=0){break g}$a(J[c+128>>2]);}if(H[c+51|0]>=0){break f}$a(J[c+40>>2]);}if(H[c+39|0]>=0){break d}$a(J[c+28>>2]);break d}b=Z()|0;}if(H[c+459|0]>=0){break a}$a(J[c+448>>2]);break a}if(!K[c+460|0]|H[c+459|0]>=0){break a}$a(J[c+448>>2]);break a}if(H[c+475|0]>=0){break a}$a(J[c+464>>2]);}da(b|0);B();}function ze(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=Ua-48|0;Ua=h;J[h+24>>2]=0;J[h+16>>2]=0;J[h+20>>2]=0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{switch(J[a>>2]){case 1:J[5996]=0;b=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break d}J[5996]=0;a=_(32,h+28|0,a+28|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break u}J[b+4>>2]=0;J[b+8>>2]=0;J[b>>2]=2;J[b+12>>2]=0;J[b+16>>2]=J[a>>2];J[b+20>>2]=J[a+4>>2];J[b+24>>2]=J[a+8>>2];J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;J[b+44>>2]=0;J[b+36>>2]=0;J[b+40>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[5996]=0;aa(33,c|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break d}d=J[h+20>>2];f=J[h+24>>2];if(d>>>0<f>>>0){J[d>>2]=b;J[h+20>>2]=d+4;break o}a=J[h+16>>2];e=d-a>>2;g=e+1|0;if(g>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)==1){break d}break a}f=f-a|0;i=f>>1;g=f>>>0>=2147483644?1073741823:g>>>0<i>>>0?i:g;if(g){if(g>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break d}J[5996]=0;j=$(3,g<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break d}}e=(e<<2)+j|0;J[e>>2]=b;f=e+4|0;if((a|0)!=(d|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((a|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(g<<2)+j;J[h+20>>2]=f;J[h+16>>2]=e;if(!d){break n}$a(d);break o;case 2:a=J[a+52>>2];J[5996]=0;b=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break e}J[b+4>>2]=0;J[b+8>>2]=0;J[b>>2]=4;J[b+40>>2]=a;J[b+44>>2]=0;J[b+12>>2]=0;J[b+16>>2]=0;J[b+20>>2]=0;J[b+24>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[b+36>>2]=0;J[5996]=0;aa(33,c|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break e}d=J[h+20>>2];f=J[h+24>>2];if(d>>>0<f>>>0){J[d>>2]=b;J[h+20>>2]=d+4;break o}a=J[h+16>>2];e=d-a>>2;g=e+1|0;if(g>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break e}f=f-a|0;i=f>>1;g=f>>>0>=2147483644?1073741823:g>>>0<i>>>0?i:g;if(g){if(g>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break e}J[5996]=0;j=$(3,g<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break e}}e=(e<<2)+j|0;J[e>>2]=b;f=e+4|0;if((a|0)!=(d|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((a|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(g<<2)+j;J[h+20>>2]=f;J[h+16>>2]=e;if(!d){break n}$a(d);break o;case 3:a=J[a+52>>2];J[5996]=0;b=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break f}J[b+4>>2]=0;J[b+8>>2]=0;J[b>>2]=5;J[b+40>>2]=a;J[b+44>>2]=0;J[b+12>>2]=0;J[b+16>>2]=0;J[b+20>>2]=0;J[b+24>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[b+36>>2]=0;J[5996]=0;aa(33,c|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break f}d=J[h+20>>2];f=J[h+24>>2];if(d>>>0<f>>>0){J[d>>2]=b;J[h+20>>2]=d+4;break o}a=J[h+16>>2];e=d-a>>2;g=e+1|0;if(g>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break f}f=f-a|0;i=f>>1;g=f>>>0>=2147483644?1073741823:g>>>0<i>>>0?i:g;if(g){if(g>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break f}J[5996]=0;j=$(3,g<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break f}}e=(e<<2)+j|0;J[e>>2]=b;f=e+4|0;if((a|0)!=(d|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((a|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(g<<2)+j;J[h+20>>2]=f;J[h+16>>2]=e;if(!d){break n}$a(d);break o;case 5:b=J[a+20>>2];a=J[a+16>>2];J[5996]=0;g=ia(36,c|0,7,a|0,b|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}d=J[h+20>>2];f=J[h+24>>2];if(d>>>0<f>>>0){J[d>>2]=g;J[h+20>>2]=d+4;break o}a=J[h+16>>2];e=d-a>>2;b=e+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break g}f=f-a|0;i=f>>1;b=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;if(b){if(b>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break g}J[5996]=0;j=$(3,b<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}}e=(e<<2)+j|0;J[e>>2]=g;f=e+4|0;if((a|0)!=(d|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((a|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(b<<2)+j;J[h+20>>2]=f;J[h+16>>2]=e;if(!d){break n}$a(d);break o;case 4:b=J[a+20>>2];a=J[a+16>>2];J[5996]=0;g=ia(36,c|0,6,a|0,b|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break h}d=J[h+20>>2];f=J[h+24>>2];if(d>>>0<f>>>0){J[d>>2]=g;J[h+20>>2]=d+4;break o}a=J[h+16>>2];e=d-a>>2;b=e+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break h}f=f-a|0;i=f>>1;b=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;if(b){if(b>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break h}J[5996]=0;j=$(3,b<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break h}}e=(e<<2)+j|0;J[e>>2]=g;f=e+4|0;if((a|0)!=(d|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((a|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(b<<2)+j;J[h+20>>2]=f;J[h+16>>2]=e;if(!d){break n}$a(d);break o;case 7:b=J[a+20>>2];a=J[a+16>>2];J[5996]=0;g=ia(36,c|0,8,a|0,b|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break i}d=J[h+20>>2];f=J[h+24>>2];if(d>>>0<f>>>0){J[d>>2]=g;J[h+20>>2]=d+4;break o}a=J[h+16>>2];e=d-a>>2;b=e+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break i}f=f-a|0;i=f>>1;b=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;if(b){if(b>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break i}J[5996]=0;j=$(3,b<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break i}}e=(e<<2)+j|0;J[e>>2]=g;f=e+4|0;if((a|0)!=(d|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((a|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(b<<2)+j;J[h+20>>2]=f;J[h+16>>2]=e;if(!d){break n}$a(d);break o;case 6:b=J[a+20>>2];a=J[a+16>>2];J[5996]=0;g=ia(36,c|0,9,a|0,b|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break j}d=J[h+20>>2];f=J[h+24>>2];if(d>>>0<f>>>0){J[d>>2]=g;J[h+20>>2]=d+4;break o}a=J[h+16>>2];e=d-a>>2;b=e+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break j}f=f-a|0;i=f>>1;b=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;if(b){if(b>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break j}J[5996]=0;j=$(3,b<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break j}}e=(e<<2)+j|0;J[e>>2]=g;f=e+4|0;if((a|0)!=(d|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((a|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(b<<2)+j;J[h+20>>2]=f;J[h+16>>2]=e;if(!d){break n}$a(d);break o;case 8:d=J[a+4>>2];if((J[a+8>>2]-d|0)!=112){break m}J[5996]=0;g=ba(37,d|0,b|0,c|0)|0;d=J[5996];J[5996]=0;w:{x:{y:{z:{A:{B:{C:{if((d|0)!=1){a=J[a+4>>2];J[5996]=0;f=ba(37,a+56|0,b|0,c|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break C}if(!g|!f){break m}J[5996]=0;a=$(3,8)|0;b=J[5996];J[5996]=0;if((b|0)==1){break z}J[a+4>>2]=f;J[a>>2]=g;J[5996]=0;b=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break y}J[b+16>>2]=0;J[b+20>>2]=0;J[b+4>>2]=a;J[b>>2]=10;a=a+8|0;J[b+12>>2]=a;J[b+8>>2]=a;J[b+24>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[b+36>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;J[5996]=0;aa(33,c|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break k}e=J[h+20>>2];d=J[h+24>>2];if(e>>>0>=d>>>0){break B}J[e>>2]=b;J[h+20>>2]=e+4;break A}c=Z()|0;break c}c=Z()|0;break c}i=J[h+16>>2];k=e-i>>2;a=k+1|0;if(a>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break k}d=d-i|0;j=d>>1;j=d>>>0>=2147483644?1073741823:a>>>0<j>>>0?j:a;D:{if(!j){a=0;break D}if(j>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break k}J[5996]=0;a=$(3,j<<2)|0;d=J[5996];J[5996]=0;if((d|0)==1){break k}}d=(k<<2)+a|0;J[d>>2]=b;b=d+4|0;if((e|0)!=(i|0)){while(1){d=d-4|0;e=e-4|0;J[d>>2]=J[e>>2];if((e|0)!=(i|0)){continue}break}e=J[h+16>>2];}J[h+24>>2]=(j<<2)+a;J[h+20>>2]=b;J[h+16>>2]=d;if(!e){break A}$a(e);}J[5996]=0;b=$(3,12)|0;a=J[5996];J[5996]=0;if((a|0)==1){break x}J[b+4>>2]=f;J[b>>2]=g;J[b+8>>2]=J[6079];J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break w}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=12;J[a+48>>2]=0;J[a+52>>2]=1072693248;b=b+12|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break l}d=J[h+20>>2];f=J[h+24>>2];if(d>>>0<f>>>0){J[d>>2]=a;J[h+20>>2]=d+4;break o}b=J[h+16>>2];e=d-b>>2;g=e+1|0;if(g>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break l}f=f-b|0;i=f>>1;g=f>>>0>=2147483644?1073741823:g>>>0<i>>>0?i:g;E:{if(!g){j=0;break E}if(g>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break l}J[5996]=0;j=$(3,g<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break l}}e=(e<<2)+j|0;J[e>>2]=a;f=e+4|0;if((b|0)!=(d|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((b|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(g<<2)+j;J[h+20>>2]=f;J[h+16>>2]=e;if(!d){break n}$a(d);break o}c=Z()|0;break c}c=Z()|0;$a(a);break c}c=Z()|0;break c}c=Z()|0;$a(b);break c;case 9:d=J[a+4>>2];if((J[a+8>>2]-d|0)!=112){break m}g=J[a+40>>2];f=J[g+4>>2];i=J[g>>2];j=i+f|0;if(f>>>0>j>>>0){break m}J[5996]=0;g=ba(37,d|0,b|0,c|0)|0;d=J[5996];J[5996]=0;F:{G:{if((d|0)!=1){d=J[a+4>>2];J[5996]=0;f=ba(37,d+56|0,b|0,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break G}if(!g|!f){break m}o=+(i>>>0)/+(j>>>0);e=J[a+4>>2];if(J[e>>2]!=8){break p}d=J[e+4>>2];if((J[e+8>>2]-d|0)==112){break F}break p}c=Z()|0;break c}c=Z()|0;break c}J[5996]=0;i=ba(37,d|0,b|0,c|0)|0;d=J[5996];J[5996]=0;H:{I:{J:{if((d|0)!=1){d=J[J[a+4>>2]+4>>2];J[5996]=0;j=ba(37,d+56|0,b|0,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break J}e=0;if(!i|!j){break m}J[5996]=0;d=$(3,12)|0;e=J[5996];J[5996]=0;if((e|0)==1){break I}J[h+28>>2]=d;e=d+12|0;J[h+36>>2]=e;J[d+8>>2]=f;J[d+4>>2]=j;J[d>>2]=i;J[5996]=0;J[h+32>>2]=e;d=ya(38,c|0,12,h+28|0,+o)|0;e=J[5996];J[5996]=0;if((e|0)==1){break H}J[5996]=0;aa(39,h+16|0,d|0);d=J[5996];J[5996]=0;if((d|0)==1){break H}d=J[h+28>>2];if(d){$a(d);}e=J[a+4>>2];break p}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;a=J[h+28>>2];if(!a){break c}$a(a);break c;case 0:break m;case 10:break v;default:break o}}g=J[a+4>>2];l=J[a+8>>2];if((g|0)==(l|0)){break s}while(1){K:{J[5996]=0;d=ba(37,g|0,b|0,c|0)|0;i=J[5996];J[5996]=0;if((i|0)==1){break K}L:{if(e>>>0<j>>>0){J[e>>2]=d;e=e+4|0;break L}n=e-f>>2;i=n+1|0;if(i>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break r}j=j-f|0;k=j>>1;k=j>>>0>=2147483644?1073741823:i>>>0<k>>>0?k:i;M:{if(!k){j=0;break M}if(k>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break r}J[5996]=0;j=$(3,k<<2)|0;i=J[5996];J[5996]=0;if((i|0)==1){break K}}i=(n<<2)+j|0;J[i>>2]=d;d=i;if((e|0)!=(f|0)){while(1){d=d-4|0;e=e-4|0;J[d>>2]=J[e>>2];if((e|0)!=(f|0)){continue}break}}j=(k<<2)+j|0;e=i+4|0;if(f){$a(f);}f=d;}g=g+56|0;if((l|0)!=(g|0)){continue}break t}break}c=Z()|0;break q}c=Z()|0;$a(b);break c}if((e|0)==(f|0)){f=e;break s}d=f;while(1){if(J[d>>2]){d=d+4|0;if((e|0)!=(d|0)){continue}break s}break}e=0;if(!f){break m}$a(f);break m}N:{O:{n=J[a+8>>2];i=J[a+4>>2];P:{if((n-i|0)/56>>>0>20){break P}Q:{R:{if((i|0)!=(n|0)){d=i;while(1){if(J[d>>2]!=1){break P}d=d+56|0;if((n|0)!=(d|0)){continue}break}break R}J[h+12>>2]=0;J[h+4>>2]=0;J[h+8>>2]=0;break Q}J[h+12>>2]=0;J[h+4>>2]=0;J[h+8>>2]=0;q=h+12|0;while(1){b=J[i+28>>2];S:{T:{d=J[h+8>>2];if((d|0)!=J[h+12>>2]){if(H[b+11|0]>=0){g=J[b+4>>2];J[d>>2]=J[b>>2];J[d+4>>2]=g;J[d+8>>2]=J[b+8>>2];break T}g=J[b+4>>2];b=J[b>>2];J[5996]=0;ea(40,d|0,b|0,g|0);b=J[5996];J[5996]=0;if((b|0)!=1){break T}c=Z()|0;J[h+8>>2]=d;break N}U:{V:{W:{X:{g=J[h+4>>2];k=(d-g|0)/12|0;l=k+1|0;Y:{if(l>>>0>=357913942){J[5996]=0;ca(41);break Y}J[h+44>>2]=q;m=k<<1;m=k>>>0>=178956970?357913941:l>>>0<m>>>0?m:l;if(!m){l=0;break W}if(m>>>0<357913942){break X}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}c=Z()|0;break N}J[5996]=0;l=$(3,P(m,12)|0)|0;p=J[5996];J[5996]=0;if((p|0)==1){break V}}J[h+28>>2]=l;k=P(k,12)+l|0;J[h+36>>2]=k;l=P(m,12)+l|0;J[h+40>>2]=l;J[h+32>>2]=k;Z:{if(H[b+11|0]>=0){m=J[b+4>>2];J[k>>2]=J[b>>2];J[k+4>>2]=m;J[k+8>>2]=J[b+8>>2];break Z}d=J[b+4>>2];b=J[b>>2];J[5996]=0;ea(40,k|0,b|0,d|0);b=J[5996];J[5996]=0;if((b|0)==1){break U}g=J[h+4>>2];d=J[h+8>>2];}m=k+12|0;if((d|0)==(g|0)){b=g;}else {while(1){d=d-12|0;p=J[d+4>>2];k=k-12|0;b=k;J[b>>2]=J[d>>2];J[b+4>>2]=p;J[b+8>>2]=J[d+8>>2];J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;if((d|0)!=(g|0)){continue}break}g=J[h+8>>2];b=J[h+4>>2];}J[h+32>>2]=b;J[h+4>>2]=k;J[h+8>>2]=m;d=J[h+12>>2];J[h+12>>2]=l;J[h+40>>2]=d;J[h+28>>2]=b;if((b|0)!=(g|0)){while(1){d=g-12|0;J[h+36>>2]=d;if(H[g-1|0]<0){$a(J[d>>2]);}g=d;if((d|0)!=(b|0)){continue}break}g=b;}if(!g){break S}$a(g);break S}c=Z()|0;break N}c=Z()|0;a=J[h+36>>2];d=J[h+32>>2];if((a|0)!=(d|0)){while(1){b=a-12|0;J[h+36>>2]=b;if(H[a-1|0]>=0){a=b;}else {$a(J[b>>2]);a=J[h+36>>2];}if((d|0)!=(a|0)){continue}break}}a=J[h+28>>2];if(a){$a(a);}break N}J[h+8>>2]=d+12;}i=i+56|0;if((n|0)!=(i|0)){continue}break}}b=J[a+52>>2];J[5996]=0;i=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break O}d=J[h+12>>2];J[h+12>>2]=0;g=J[h+4>>2];k=J[h+8>>2];J[h+4>>2]=0;J[h+8>>2]=0;J[i+4>>2]=0;J[i+8>>2]=0;J[i>>2]=3;J[i+12>>2]=0;J[i+40>>2]=b;J[i+44>>2]=0;J[i+36>>2]=0;J[i+28>>2]=0;J[i+32>>2]=0;J[i+24>>2]=d;J[i+16>>2]=g;J[i+20>>2]=k;J[5996]=0;aa(33,c|0,i|0);b=J[5996];J[5996]=0;if((b|0)==1){break O}d=J[h+20>>2];k=J[h+24>>2];_:{if(d>>>0<k>>>0){J[d>>2]=i;J[h+20>>2]=d+4;break _}b=J[h+16>>2];n=d-b>>2;g=n+1|0;if(g>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break O}k=k-b|0;l=k>>1;k=k>>>0>=2147483644?1073741823:g>>>0<l>>>0?l:g;$:{if(!k){l=0;break $}if(k>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break O}J[5996]=0;l=$(3,k<<2)|0;g=J[5996];J[5996]=0;if((g|0)==1){break O}}g=(n<<2)+l|0;J[g>>2]=i;i=g+4|0;if((b|0)!=(d|0)){while(1){g=g-4|0;d=d-4|0;J[g>>2]=J[d>>2];if((b|0)!=(d|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(k<<2)+l;J[h+20>>2]=i;J[h+16>>2]=g;if(!d){break _}$a(d);}b=J[h+4>>2];if(!b){break P}d=b;g=J[h+8>>2];if((d|0)!=(g|0)){while(1){d=g-12|0;if(H[g-1|0]<0){$a(J[d>>2]);}g=d;if((d|0)!=(b|0)){continue}break}d=J[h+4>>2];}J[h+8>>2]=b;$a(d);}b=J[a+52>>2];aa:{if((b|0)!=1&(b|0)!=((J[a+8>>2]-J[a+4>>2]|0)/56|0)){break aa}ba:{ca:{da:{ea:{fa:{ga:{b=e-f|0;if(b>>>0>=5){while(1){k=J[a+52>>2];J[5996]=0;i=$(3,8)|0;d=J[5996];J[5996]=0;if((d|0)==1){break ga}d=e-8|0;J[i>>2]=J[d>>2];e=e-4|0;J[i+4>>2]=J[e>>2];J[5996]=0;g=$(3,56)|0;l=J[5996];J[5996]=0;if((l|0)==1){break fa}J[g+16>>2]=0;J[g+20>>2]=0;J[g+4>>2]=i;J[g>>2]=(k|0)==1?11:10;i=i+8|0;J[g+12>>2]=i;J[g+8>>2]=i;J[g+24>>2]=0;J[g+28>>2]=0;J[g+32>>2]=0;J[g+36>>2]=0;J[g+40>>2]=0;J[g+44>>2]=0;O[g+48>>3]=1/+(b>>2>>>0);J[5996]=0;aa(33,c|0,g|0);b=J[5996];J[5996]=0;if((b|0)==1){c=Z()|0;break q}J[5996]=0;i=$(3,4)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ea}J[i>>2]=g;J[5996]=0;b=$(3,56)|0;g=J[5996];J[5996]=0;if((g|0)==1){break ca}J[b+16>>2]=0;J[b+20>>2]=0;J[b+4>>2]=i;J[b>>2]=21;g=i+4|0;J[b+12>>2]=g;J[b+8>>2]=g;J[b+24>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[b+36>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;J[5996]=0;aa(33,c|0,b|0);g=J[5996];J[5996]=0;if((g|0)==1){break da}ha:{if(d>>>0<j>>>0){J[d>>2]=b;break ha}ia:{ja:{i=d-f>>2;g=i+1|0;ka:{if(g>>>0>=1073741824){J[5996]=0;ca(34);break ka}e=j-f|0;j=e>>1;e=e>>>0>=2147483644?1073741823:g>>>0<j>>>0?j:g;if(!e){j=0;break ia}if(e>>>0<1073741824){break ja}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}c=Z()|0;break q}J[5996]=0;j=$(3,e<<2)|0;g=J[5996];J[5996]=0;if((g|0)==1){break da}}g=(i<<2)+j|0;J[g>>2]=b;j=(e<<2)+j|0;e=g+4|0;la:{if((d|0)!=(f|0)){while(1){g=g-4|0;d=d-4|0;J[g>>2]=J[d>>2];if((d|0)!=(f|0)){continue}break}if(!f){break la}}$a(f);}f=g;}b=e-f|0;if(b>>>0>4){continue}break}}j=J[f>>2];d=J[h+20>>2];if((d|0)==J[h+24>>2]){break ba}J[d>>2]=j;J[h+20>>2]=d+4;break aa}c=Z()|0;break q}c=Z()|0;$a(i);break q}c=Z()|0;break q}c=Z()|0;break q}c=Z()|0;$a(i);break q}k=J[h+16>>2];b=d-k|0;l=b>>2;g=l+1|0;if(g>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break r}i=b>>1;b=b>>>0>=2147483644?1073741823:g>>>0<i>>>0?i:g;ma:{if(!b){i=0;break ma}if(b>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break r}J[5996]=0;i=$(3,b<<2)|0;g=J[5996];J[5996]=0;if((g|0)==1){break r}}g=(l<<2)+i|0;J[g>>2]=j;j=g+4|0;if((d|0)!=(k|0)){while(1){g=g-4|0;d=d-4|0;J[g>>2]=J[d>>2];if((d|0)!=(k|0)){continue}break}d=J[h+16>>2];}J[h+24>>2]=(b<<2)+i;J[h+20>>2]=j;J[h+16>>2]=g;if(!d){break aa}$a(d);}j=J[a+52>>2];b=0;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;na:{oa:{if((d|0)==1){break oa}g=e-f|0;k=g>>2;i=0;d=0;if((e|0)!=(f|0)){if((g|0)<0){J[5996]=0;ca(34);b=J[5996];J[5996]=0;if((b|0)!=1){break a}break na}J[5996]=0;d=$(3,g|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break na}g=(g-4&-4)+4|0;e=fb(d,f,g);b=e+(k<<2)|0;i=e+g|0;}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=d;J[a>>2]=13;O[a+48>>3]=+(j>>>0)/+(k>>>0);J[a+12>>2]=b;J[a+8>>2]=i;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=j;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break oa}e=J[h+20>>2];d=J[h+24>>2];pa:{if(e>>>0<d>>>0){J[e>>2]=a;J[h+20>>2]=e+4;break pa}g=J[h+16>>2];j=e-g>>2;b=j+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break oa}d=d-g|0;i=d>>1;i=d>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;qa:{if(!i){b=0;break qa}if(i>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break oa}J[5996]=0;b=$(3,i<<2)|0;d=J[5996];J[5996]=0;if((d|0)==1){break oa}}d=(j<<2)+b|0;J[d>>2]=a;a=d+4|0;if((e|0)!=(g|0)){while(1){d=d-4|0;e=e-4|0;J[d>>2]=J[e>>2];if((e|0)!=(g|0)){continue}break}e=J[h+16>>2];}J[h+24>>2]=(i<<2)+b;J[h+20>>2]=a;J[h+16>>2]=d;if(!e){break pa}$a(e);}if(!f){break o}$a(f);break o}c=Z()|0;break q}c=Z()|0;$a(a);break q}c=Z()|0;}rb(h+4|0);break q}c=Z()|0;}if(!f){break c}$a(f);break c}ra:{sa:{ta:{ua:{va:{wa:{xa:{ya:{za:{if(J[e+56>>2]!=8){break za}d=J[e+60>>2];if((J[e- -64>>2]-d|0)!=112){break za}J[5996]=0;d=ba(37,d|0,b|0,c|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break ya}a=J[J[a+4>>2]+60>>2];J[5996]=0;b=ba(37,a+56|0,b|0,c|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break xa}e=0;if(!d|!b){break m}J[5996]=0;a=$(3,12)|0;e=J[5996];J[5996]=0;if((e|0)==1){break wa}J[h+28>>2]=a;e=a+12|0;J[h+36>>2]=e;J[a+8>>2]=g;J[a+4>>2]=b;J[a>>2]=d;J[5996]=0;J[h+32>>2]=e;a=Sa(42,c|0,h+28|0,+(1-o))|0;b=J[5996];J[5996]=0;if((b|0)==1){break va}J[5996]=0;aa(39,h+16|0,a|0);a=J[5996];J[5996]=0;if((a|0)==1){break va}a=J[h+28>>2];if(!a){break za}$a(a);}J[5996]=0;a=$(3,12)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ua}J[h+28>>2]=a;b=a+12|0;J[h+36>>2]=b;J[a>>2]=g;d=J[6080];J[a+8>>2]=f;J[a+4>>2]=d;J[5996]=0;J[h+32>>2]=b;a=ya(38,c|0,12,h+28|0,+o)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ta}J[5996]=0;aa(39,h+16|0,a|0);a=J[5996];J[5996]=0;if((a|0)==1){break ta}a=J[h+28>>2];if(a){$a(a);}J[5996]=0;a=$(3,8)|0;b=J[5996];J[5996]=0;if((b|0)==1){break sa}J[h+28>>2]=a;b=a+8|0;J[h+36>>2]=b;J[a+4>>2]=f;J[a>>2]=g;J[5996]=0;J[h+32>>2]=b;a=ya(38,c|0,11,h+28|0,+o)|0;b=J[5996];J[5996]=0;if((b|0)==1){break ra}J[5996]=0;aa(39,h+16|0,a|0);a=J[5996];J[5996]=0;if((a|0)==1){break ra}a=J[h+28>>2];if(!a){break o}$a(a);break o}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;a=J[h+28>>2];if(!a){break c}$a(a);break c}c=Z()|0;break c}c=Z()|0;a=J[h+28>>2];if(!a){break c}$a(a);break c}c=Z()|0;break c}c=Z()|0;a=J[h+28>>2];if(!a){break c}$a(a);break c}f=J[h+20>>2];e=J[h+16>>2];}Aa:{Ba:{Ca:{Da:{if((f-e|0)==4){break Da}b=J[h+24>>2];J[h+24>>2]=0;J[h+16>>2]=0;J[h+20>>2]=0;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Ca}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=e;J[a>>2]=20;J[a+12>>2]=b;J[a+8>>2]=f;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break Aa}e=J[h+20>>2];g=J[h+24>>2];if(e>>>0<g>>>0){J[e>>2]=a;J[h+20>>2]=e+4;break Da}b=J[h+16>>2];f=e-b>>2;d=f+1|0;if(d>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Aa}g=g-b|0;i=g>>1;g=g>>>0>=2147483644?1073741823:d>>>0<i>>>0?i:d;Ea:{if(!g){j=0;break Ea}if(g>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Aa}J[5996]=0;j=$(3,g<<2)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Aa}}d=(f<<2)+j|0;J[d>>2]=a;a=d+4|0;if((b|0)!=(e|0)){while(1){d=d-4|0;e=e-4|0;J[d>>2]=J[e>>2];if((b|0)!=(e|0)){continue}break}e=J[h+16>>2];}J[h+24>>2]=(g<<2)+j;J[h+20>>2]=a;J[h+16>>2]=d;if(!e){break Da}$a(e);}J[5996]=0;e=$(3,56)|0;a=J[5996];J[5996]=0;if((a|0)!=1){a=J[h+24>>2];J[h+24>>2]=0;b=J[h+16>>2];d=J[h+20>>2];J[h+16>>2]=0;J[h+20>>2]=0;J[e+16>>2]=0;J[e+20>>2]=0;J[e+12>>2]=a;J[e+4>>2]=b;J[e+8>>2]=d;J[e>>2]=21;J[e+24>>2]=0;J[e+28>>2]=0;J[e+32>>2]=0;J[e+36>>2]=0;J[e+40>>2]=0;J[e+44>>2]=0;J[5996]=0;aa(33,c|0,e|0);a=J[5996];J[5996]=0;if((a|0)!=1){break Ba}}c=Z()|0;break c}c=Z()|0;if(!e){break b}$a(e);break c}J[5996]=0;b=$(3,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){c=Z()|0;break c}J[b>>2]=e;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;Fa:{Ga:{Ha:{Ia:{Ja:{Ka:{La:{Ma:{Na:{Oa:{Pa:{Qa:{Ra:{Sa:{Ta:{if((d|0)!=1){J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=15;b=b+4|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break Fa}d=J[e+8>>2];f=J[e+12>>2];Ua:{if(d>>>0<f>>>0){J[d>>2]=a;J[e+8>>2]=d+4;break Ua}g=J[e+4>>2];j=d-g>>2;b=j+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Fa}f=f-g|0;i=f>>1;i=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;Va:{if(!i){b=0;break Va}if(i>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Fa}J[5996]=0;b=$(3,i<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Fa}}f=(j<<2)+b|0;J[f>>2]=a;a=f+4|0;if((d|0)!=(g|0)){while(1){f=f-4|0;d=d-4|0;J[f>>2]=J[d>>2];if((d|0)!=(g|0)){continue}break}d=J[e+4>>2];}J[e+12>>2]=(i<<2)+b;J[e+8>>2]=a;J[e+4>>2]=f;if(!d){break Ua}$a(d);}J[5996]=0;b=$(3,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){c=Z()|0;break c}J[b>>2]=e;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Ta}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=17;b=b+4|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ga}d=J[e+8>>2];f=J[e+12>>2];Wa:{if(d>>>0<f>>>0){J[d>>2]=a;J[e+8>>2]=d+4;break Wa}g=J[e+4>>2];j=d-g>>2;b=j+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ga}f=f-g|0;i=f>>1;i=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;Xa:{if(!i){b=0;break Xa}if(i>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ga}J[5996]=0;b=$(3,i<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Ga}}f=(j<<2)+b|0;J[f>>2]=a;a=f+4|0;if((d|0)!=(g|0)){while(1){f=f-4|0;d=d-4|0;J[f>>2]=J[d>>2];if((d|0)!=(g|0)){continue}break}d=J[e+4>>2];}J[e+12>>2]=(i<<2)+b;J[e+8>>2]=a;J[e+4>>2]=f;if(!d){break Wa}$a(d);}J[5996]=0;a=J[6080];b=$(3,8)|0;d=J[5996];J[5996]=0;if((d|0)==1){c=Z()|0;break c}J[b+4>>2]=a;J[b>>2]=e;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Sa}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=10;b=b+8|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ha}d=J[e+8>>2];f=J[e+12>>2];Ya:{if(d>>>0<f>>>0){J[d>>2]=a;J[e+8>>2]=d+4;break Ya}g=J[e+4>>2];j=d-g>>2;b=j+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ha}f=f-g|0;i=f>>1;i=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;Za:{if(!i){b=0;break Za}if(i>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ha}J[5996]=0;b=$(3,i<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Ha}}f=(j<<2)+b|0;J[f>>2]=a;a=f+4|0;if((d|0)!=(g|0)){while(1){f=f-4|0;d=d-4|0;J[f>>2]=J[d>>2];if((d|0)!=(g|0)){continue}break}d=J[e+4>>2];}J[e+12>>2]=(i<<2)+b;J[e+8>>2]=a;J[e+4>>2]=f;if(!d){break Ya}$a(d);}J[5996]=0;b=$(3,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){c=Z()|0;break c}J[b>>2]=e;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Ra}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=19;b=b+4|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ia}d=J[e+8>>2];f=J[e+12>>2];_a:{if(d>>>0<f>>>0){J[d>>2]=a;J[e+8>>2]=d+4;break _a}g=J[e+4>>2];j=d-g>>2;b=j+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ia}f=f-g|0;i=f>>1;i=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;$a:{if(!i){b=0;break $a}if(i>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ia}J[5996]=0;b=$(3,i<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Ia}}f=(j<<2)+b|0;J[f>>2]=a;a=f+4|0;if((d|0)!=(g|0)){while(1){f=f-4|0;d=d-4|0;J[f>>2]=J[d>>2];if((d|0)!=(g|0)){continue}break}d=J[e+4>>2];}J[e+12>>2]=(i<<2)+b;J[e+8>>2]=a;J[e+4>>2]=f;if(!d){break _a}$a(d);}J[5996]=0;b=$(3,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){c=Z()|0;break c}J[b>>2]=e;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Qa}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=16;b=b+4|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ja}d=J[e+8>>2];f=J[e+12>>2];ab:{if(d>>>0<f>>>0){J[d>>2]=a;J[e+8>>2]=d+4;break ab}g=J[e+4>>2];j=d-g>>2;b=j+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ja}f=f-g|0;i=f>>1;i=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;bb:{if(!i){b=0;break bb}if(i>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ja}J[5996]=0;b=$(3,i<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Ja}}f=(j<<2)+b|0;J[f>>2]=a;a=f+4|0;if((d|0)!=(g|0)){while(1){f=f-4|0;d=d-4|0;J[f>>2]=J[d>>2];if((d|0)!=(g|0)){continue}break}d=J[e+4>>2];}J[e+12>>2]=(i<<2)+b;J[e+8>>2]=a;J[e+4>>2]=f;if(!d){break ab}$a(d);}J[5996]=0;b=$(3,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){c=Z()|0;break c}J[b>>2]=e;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Pa}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=18;b=b+4|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ka}d=J[e+8>>2];f=J[e+12>>2];cb:{if(d>>>0<f>>>0){J[d>>2]=a;J[e+8>>2]=d+4;break cb}g=J[e+4>>2];j=d-g>>2;b=j+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ka}f=f-g|0;i=f>>1;i=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;db:{if(!i){b=0;break db}if(i>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ka}J[5996]=0;b=$(3,i<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break Ka}}f=(j<<2)+b|0;J[f>>2]=a;a=f+4|0;if((d|0)!=(g|0)){while(1){f=f-4|0;d=d-4|0;J[f>>2]=J[d>>2];if((d|0)!=(g|0)){continue}break}d=J[e+4>>2];}J[e+12>>2]=(i<<2)+b;J[e+8>>2]=a;J[e+4>>2]=f;if(!d){break cb}$a(d);}J[5996]=0;a=J[6079];b=$(3,8)|0;d=J[5996];J[5996]=0;if((d|0)==1){c=Z()|0;break c}J[b+4>>2]=a;J[b>>2]=e;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Oa}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=11;J[a+48>>2]=0;J[a+52>>2]=1072693248;b=b+8|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break La}d=J[e+8>>2];f=J[e+12>>2];eb:{if(d>>>0<f>>>0){J[d>>2]=a;J[e+8>>2]=d+4;break eb}g=J[e+4>>2];j=d-g>>2;b=j+1|0;if(b>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break La}f=f-g|0;i=f>>1;i=f>>>0>=2147483644?1073741823:b>>>0<i>>>0?i:b;fb:{if(!i){b=0;break fb}if(i>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break La}J[5996]=0;b=$(3,i<<2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break La}}f=(j<<2)+b|0;J[f>>2]=a;a=f+4|0;if((d|0)!=(g|0)){while(1){f=f-4|0;d=d-4|0;J[f>>2]=J[d>>2];if((d|0)!=(g|0)){continue}break}d=J[e+4>>2];}J[e+12>>2]=(i<<2)+b;J[e+8>>2]=a;J[e+4>>2]=f;if(!d){break eb}$a(d);}J[5996]=0;b=$(3,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){c=Z()|0;break c}J[b>>2]=e;J[5996]=0;a=$(3,56)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Na}J[a+16>>2]=0;J[a+20>>2]=0;J[a+4>>2]=b;J[a>>2]=14;b=b+4|0;J[a+12>>2]=b;J[a+8>>2]=b;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[5996]=0;aa(33,c|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break Ma}d=J[e+8>>2];g=J[e+12>>2];if(d>>>0<g>>>0){J[d>>2]=a;J[e+8>>2]=d+4;break m}b=J[e+4>>2];f=d-b>>2;c=f+1|0;if(c>>>0>=1073741824){J[5996]=0;ca(34);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ma}g=g-b|0;i=g>>1;c=g>>>0>=2147483644?1073741823:c>>>0<i>>>0?i:c;gb:{if(!c){j=0;break gb}if(c>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break Ma}J[5996]=0;j=$(3,c<<2)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Ma}}f=(f<<2)+j|0;J[f>>2]=a;a=f+4|0;if((b|0)!=(d|0)){while(1){f=f-4|0;d=d-4|0;J[f>>2]=J[d>>2];if((b|0)!=(d|0)){continue}break}d=J[e+4>>2];}J[e+12>>2]=(c<<2)+j;J[e+8>>2]=a;J[e+4>>2]=f;if(!d){break m}$a(d);break m}c=Z()|0;$a(b);break c}c=Z()|0;$a(b);break c}c=Z()|0;$a(b);break c}c=Z()|0;$a(b);break c}c=Z()|0;$a(b);break c}c=Z()|0;$a(b);break c}c=Z()|0;$a(b);break c}c=Z()|0;$a(b);break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}a=J[h+16>>2];if(a){J[h+20>>2]=a;$a(a);}Ua=h+48|0;return e|0}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;break c}c=Z()|0;}a=J[h+16>>2];if(!a){break b}J[h+20>>2]=a;$a(a);}da(c|0);B();}B();}function yn(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;a:{b:{c:{if(J[a>>2]!=24){break c}c=J[a+32>>2];g=J[a+36>>2];if((c|0)==(g|0)){break c}while(1){j=J[J[c>>2]+80>>2];d:{if(f>>>0>i>>>0){J[i>>2]=j;i=i+4|0;break d}h=i-b>>2;d=h+1|0;if(d>>>0>=1073741824){J[5996]=0;ca(94);a=J[5996];J[5996]=0;if((a|0)==1){break b}break a}e=f-b|0;f=e>>1;f=e>>>0>=2147483644?1073741823:d>>>0<f>>>0?f:d;e:{if(!f){e=0;break e}if(f>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break b}J[5996]=0;e=$(3,f<<2)|0;d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=(h<<2)+e|0;J[d>>2]=j;v=d;if((b|0)!=(i|0)){while(1){v=v-4|0;i=i-4|0;J[v>>2]=J[i>>2];if((b|0)!=(i|0)){continue}break}}f=(f<<2)+e|0;i=d+4|0;if(b){$a(b);}b=v;}c=c+8|0;if((g|0)!=(c|0)){continue}break}}j=J[a+36>>2];f=J[a+32>>2];c=j-f|0;f:{if((f|0)==(j|0)){d=0;h=0;break f}h=J[J[f>>2]+80>>2];if(c>>>0<9){d=0;break f}d=J[J[f+8>>2]+80>>2];if(c>>>0<17){break f}m=J[J[f+16>>2]+80>>2];}s=c>>3;k=J[a+24>>2];o=J[a+20>>2];e=k-o|0;u=J[a+12>>2];w=J[a+8>>2];x=u-w|0;g=(x|0)/12|0;n=J[a+4>>2];g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{b=J[a>>2];a=b&-2;switch(a-6|0){case 2:break t;case 0:break u;default:break s}}if((e|0)==32){break r}e=2369;a=39;g=3984;break h}if((e|0)==20){break r}e=2369;a=41;g=4224;break h}e=2369;if((k|0)!=(o|0)){a=43;g=4337;break h}if((a|0)!=4){break r}if((n|0)>0){break q}a=47;g=3134;break h}v:{switch(b-24|0){case 1:if(g>>>0>n-1>>>0){break p}e=2369;a=49;g=1397;break h;case 0:if(s>>>0>n-1>>>0){break n}e=2369;a=51;g=1654;break h;default:break v}}e=2369;if(n){a=53;g=4330;break h}if(b-17>>>0>5){break q}if((c|0)==16){break o}a=58;g=4003;break h}if(b-10>>>0>=7){if((b|0)!=23){break p}if((c|0)==24){break n}a=60;g=3946;break h}if((c|0)==8){break n}a=64;g=4090;break h}if((b|0)==24|(f|0)==(j|0)){break o}e=2369;a=66;g=4311;break h}if((a|0)==2){if((x|0)==12){break m}e=2369;a=70;g=4063;break h}if((b|0)!=25){break n}if(g-1>>>0<20){break l}e=2369;a=72;g=4240;break h}if((u|0)==(w|0)){break m}e=2369;a=74;g=4299;break h}c=10;f=2108;e=2369;a=247;g=2350;w:{switch(b|0){case 3:c=9;f=2119;break k;case 4:J[5996]=0;a=_(54,2295,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,2278,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}J[5996]=0;c=_(54,2129,6)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}b=c|(n&4194304?a:b);break i;case 5:J[5996]=0;a=_(54,2174,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,2170,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}J[5996]=0;c=_(54,2129,6)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}b=c|((n>>>0<5e8?b:0)|(n>>>0>499999999?a:0));break i;case 6:case 7:case 8:case 9:c=7;f=2153;break k;case 1:c=7;f=2136;break k;case 0:c=9;f=2098;break k;case 10:J[5996]=0;a=_(54,2777,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,3557,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}J[5996]=0;c=_(54,2161,5)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}J[5996]=0;d=_(54,1600,6)|0;e=J[5996];J[5996]=0;if((e|0)==1){break g}J[5996]=0;e=_(54,1239,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}b=(c|d)&h|(e|(b&(h^-1)?0:a));break i;case 11:J[5996]=0;a=_(54,2777,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,1958,2)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}J[5996]=0;c=_(54,2161,5)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}J[5996]=0;d=_(54,1197,7)|0;e=J[5996];J[5996]=0;if((e|0)==1){break g}b=(c|d)&h|(b&(h^-1)?0:a);break i;case 12:J[5996]=0;a=_(54,3557,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,3310,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}J[5996]=0;c=_(54,2161,5)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}J[5996]=0;d=_(54,2035,6)|0;e=J[5996];J[5996]=0;if((e|0)==1){break g}J[5996]=0;e=_(54,1419,2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}b=(c|d)&h|(e|(b&(h^-1)?0:a));break i;case 13:J[5996]=0;b=_(54,3557,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;c=_(54,1028,2)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,1959,1)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}J[5996]=0;d=_(54,1029,1)|0;e=J[5996];J[5996]=0;if((e|0)==1){break g}J[5996]=0;e=_(54,2451,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}J[5996]=0;f=_(54,2315,1)|0;j=J[5996];J[5996]=0;if((j|0)==1){break g}J[5996]=0;j=_(54,2161,5)|0;g=J[5996];J[5996]=0;if((g|0)==1){break g}J[5996]=0;g=_(54,1640,2)|0;i=J[5996];J[5996]=0;if((i|0)==1){break g}J[5996]=0;i=_(54,1208,3)|0;n=J[5996];J[5996]=0;if((n|0)==1){break g}k=a;a=h^-1;b=(g|j)&h|(i|((a&d?0:k)|(a&c?0:b)|(a&f?0:e)));break i;case 14:J[5996]=0;a=_(54,2796,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,3557,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}J[5996]=0;c=_(54,2161,5)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}J[5996]=0;d=_(54,1486,5)|0;e=J[5996];J[5996]=0;if((e|0)==1){break g}J[5996]=0;e=_(54,1205,2)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}b=(c|d)&h|(e|(b&(h^-1)?0:a));break i;case 15:J[5996]=0;a=_(54,3557,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,2028,2)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}J[5996]=0;c=_(54,2451,1)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}J[5996]=0;d=_(54,2315,1)|0;e=J[5996];J[5996]=0;if((e|0)==1){break g}J[5996]=0;e=_(54,2161,5)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}J[5996]=0;f=_(54,1430,4)|0;j=J[5996];J[5996]=0;if((j|0)==1){break g}J[5996]=0;j=_(54,1208,3)|0;g=J[5996];J[5996]=0;if((g|0)==1){break g}g=c;c=h^-1;b=(e|f)&h|(j|((c&d?0:g)|(b&c?0:a)));break i;case 16:J[5996]=0;a=_(54,2161,5)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,1607,9)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}J[5996]=0;c=_(54,1149,2)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}b=c|(a|b)&h;break i;case 17:J[5996]=0;j=_(54,3540,3)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;g=_(54,2796,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;i=_(54,2029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;n=_(54,2029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;m=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;s=_(54,1959,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;k=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;o=_(54,1024,3)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;u=_(54,1681,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2315,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,2315,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}e=h^-1;f=d^-1;x:{if(f&b){c=0;J[5996]=0;b=_(54,1681,1)|0;w=J[5996];J[5996]=0;if((w|0)==1){break g}if(b&e){break x}}c=a;}J[5996]=0;w=_(54,1149,2)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;x=_(54,2167,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2165,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;q=_(54,2165,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}b=0;p=d&h;y:{if(q&(p^-1)){break y}J[5996]=0;b=_(54,2295,1)|0;q=J[5996];J[5996]=0;if((q|0)==1){break g}if(!(b&e)){b=0;J[5996]=0;q=_(54,2278,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break g}if(!(f&q)){break y}}J[5996]=0;b=_(54,2278,1)|0;q=J[5996];J[5996]=0;if((q|0)==1){break g}if(!(b&e)){b=0;J[5996]=0;q=_(54,2295,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break g}if(!(f&q)){break y}}J[5996]=0;b=_(54,2174,1)|0;q=J[5996];J[5996]=0;if((q|0)==1){break g}if(!(b&e)){b=0;J[5996]=0;q=_(54,2170,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break g}if(!(f&q)){break y}}J[5996]=0;b=_(54,2170,1)|0;q=J[5996];J[5996]=0;if((q|0)==1){break g}if(!(b&e)){b=0;J[5996]=0;q=_(54,2174,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break g}if(!(f&q)){break y}}b=a;}a=d|h;b=d&w|(o&p|(h&i|(e&g?0:d&j)|(e&m?0:d&n))|(k&(a^-1)?0:a&s)|a&u|c)|a&x|b;break i;case 18:J[5996]=0;i=_(54,3557,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;n=_(54,2777,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;m=_(54,1959,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;s=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;k=_(54,2029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;o=_(54,2029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;u=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;w=_(54,2451,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;x=_(54,1681,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;q=_(54,2031,3)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2315,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;e=_(54,2315,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}b=d^-1;c=h^-1;f=d&h;g=f^-1;z:{A:{if(!(g&e)){break A}J[5996]=0;e=_(54,2297,2)|0;j=J[5996];J[5996]=0;if((j|0)==1){break g}if(!(c&e)){break A}j=0;J[5996]=0;e=_(54,2297,2)|0;p=J[5996];J[5996]=0;if((p|0)==1){break g}if(b&e){break z}}j=a;}J[5996]=0;p=_(54,1681,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;r=_(54,1149,2)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;y=_(54,2167,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2165,1)|0;e=J[5996];J[5996]=0;if((e|0)==1){break g}e=0;J[5996]=0;l=_(54,2165,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}B:{if(g&l){break B}J[5996]=0;e=_(54,2295,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break g}if(!(c&e)){e=0;J[5996]=0;l=_(54,2278,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}if(!(b&l)){break B}}J[5996]=0;e=_(54,2278,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break g}if(!(c&e)){e=0;J[5996]=0;l=_(54,2295,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}if(!(b&l)){break B}}J[5996]=0;e=_(54,2174,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break g}if(!(c&e)){e=0;J[5996]=0;l=_(54,2170,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}if(!(b&l)){break B}}J[5996]=0;e=_(54,2170,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break g}if(!(c&e)){e=0;J[5996]=0;l=_(54,2174,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}if(!(b&l)){break B}}e=a;}a=d|h;b=r|(f&q|(h&k|(b&n?0:h&i)|(s&(a^-1)?0:a&m)|(c&u?0:d&o))|(g&x?0:f&w)|j|a&p)|a&y|e;break i;case 19:J[5996]=0;a=_(54,3557,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,2504,2)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}c=0;if(!((h^-1)&b)){J[5996]=0;b=_(54,2501,2)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}c=b&(d^-1)?0:a;}J[5996]=0;e=_(54,1959,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;j=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;g=_(54,2049,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}f=0;J[5996]=0;b=_(54,1681,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}a=d&h;k=b;b=d|h;d=b^-1;if(!(k&d)){J[5996]=0;f=_(54,2451,1)|0;h=J[5996];J[5996]=0;if((h|0)==1){break g}f=f&(a^-1)?0:a&g;}J[5996]=0;g=_(54,2340,3)|0;h=J[5996];J[5996]=0;if((h|0)==1){break g}J[5996]=0;h=_(54,1148,3)|0;i=J[5996];J[5996]=0;if((i|0)==1){break g}J[5996]=0;i=_(54,2167,4)|0;n=J[5996];J[5996]=0;if((n|0)==1){break g}J[5996]=0;n=_(54,2165,1)|0;m=J[5996];J[5996]=0;if((m|0)==1){break g}b=a&n|(b&i|(h|(a&g|((d&j?0:b&e)|c|f))));break i;case 21:J[5996]=0;e=_(54,3557,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;f=_(54,1293,3)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;j=_(54,1959,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;g=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2049,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;c=_(54,2451,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}b=d&h;i=h^-1;C:{if(i&c){a=d|h;c=0;break C}J[5996]=0;c=_(54,1681,1)|0;n=J[5996];J[5996]=0;if((n|0)==1){break g}k=a&b;a=d|h;c=c&(a^-1)?0:k;}J[5996]=0;n=_(54,1650,3)|0;m=J[5996];J[5996]=0;if((m|0)==1){break g}J[5996]=0;m=_(54,2468,3)|0;s=J[5996];J[5996]=0;if((s|0)==1){break g}J[5996]=0;s=_(54,1239,1)|0;k=J[5996];J[5996]=0;if((k|0)==1){break g}J[5996]=0;k=_(54,2167,4)|0;o=J[5996];J[5996]=0;if((o|0)==1){break g}J[5996]=0;o=_(54,2165,1)|0;u=J[5996];J[5996]=0;if((u|0)==1){break g}b=b&o|(a&k|(s|(d&m|(b&n|(c|((g&(d^-1)?0:h&j)|(f&i?0:d&e)))))));break i;case 20:J[5996]=0;e=_(54,2796,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;f=_(54,1293,3)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;j=_(54,1959,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;g=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2049,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;c=_(54,2451,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}b=d&h;i=h^-1;D:{if(i&c){a=d|h;c=0;break D}J[5996]=0;c=_(54,1681,1)|0;n=J[5996];J[5996]=0;if((n|0)==1){break g}k=a&b;a=d|h;c=c&(a^-1)?0:k;}J[5996]=0;n=_(54,1394,2)|0;m=J[5996];J[5996]=0;if((m|0)==1){break g}J[5996]=0;m=_(54,1205,2)|0;s=J[5996];J[5996]=0;if((s|0)==1){break g}J[5996]=0;s=_(54,2167,4)|0;k=J[5996];J[5996]=0;if((k|0)==1){break g}J[5996]=0;k=_(54,2165,1)|0;o=J[5996];J[5996]=0;if((o|0)==1){break g}b=b&k|(a&s|(m|(b&n|(c|((g&(d^-1)?0:h&j)|(f&i?0:d&e))))));break i;case 22:J[5996]=0;e=_(54,1643,6)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;b=_(54,1959,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;f=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;j=_(54,2451,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;g=_(54,2315,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;i=_(54,2049,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;n=_(54,1681,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;m=_(54,2522,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;s=_(54,1239,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;k=_(54,2167,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;o=_(54,2165,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}a=d|h;c=a^-1;l=b;b=d&h;b=a&k|(s|(a&m|((f&(b^-1)?0:l)|b&e|(c&g?0:a&j)))|(c&n?0:b&i))|b&o;break i;case 24:break j;case 2:break k;case 25:break l;case 23:break w;default:break h}}J[5996]=0;s=_(54,2779,3)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;k=_(54,1293,3)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;o=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;u=_(54,1959,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;w=_(54,1029,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;x=_(54,1295,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2315,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,1681,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}c=h^-1;E:{if(c&b){e=0;J[5996]=0;b=_(54,2315,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}if((d^-1)&b){break E}}e=a&m;}J[5996]=0;q=_(54,2522,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2451,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,1681,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}F:{if(b&c){j=0;J[5996]=0;b=_(54,2315,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}if((d^-1)&b){break F}}j=a&h&m;}J[5996]=0;a=_(54,2049,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,2451,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}n=d&h&m;G:{if(b&c){g=d|h;i=m|g;a=0;break G}J[5996]=0;b=_(54,1681,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}g=d|h;i=m|g;a=b&(i^-1)?0:a&n;}J[5996]=0;p=_(54,1681,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;r=_(54,1239,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;y=_(54,2167,4)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;b=_(54,2165,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break g}f=0;J[5996]=0;l=_(54,2165,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}H:{if(l&(n^-1)){break H}J[5996]=0;f=_(54,2295,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break g}if(!(c&f)){f=0;J[5996]=0;l=_(54,2278,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}if(!((d^-1)&l)){break H}}J[5996]=0;f=_(54,2278,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break g}if(!(c&f)){f=0;J[5996]=0;l=_(54,2295,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}if(!((d^-1)&l)){break H}}J[5996]=0;f=_(54,2174,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break g}if(!(c&f)){f=0;J[5996]=0;l=_(54,2170,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}if(!((d^-1)&l)){break H}}J[5996]=0;f=_(54,2170,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break g}if(!(c&f)){f=0;J[5996]=0;l=_(54,2174,1)|0;t=J[5996];J[5996]=0;if((t|0)==1){break g}if(!((d^-1)&l)){break H}}f=b;}b=d&m;d=b|h;b=i&y|(g&p&m|(r|(a|(m&q|(b&x|(n&o|(c&k?0:b&s))|(w&(d^-1)?0:d&u)|e)|j))))|f;break i}c=8;f=2144;}J[5996]=0;b=_(54,f|0,c|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){break i}break g}f=0;J[5996]=0;j=1;c=_(54,2165,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}I:{if((i|0)==(v|0)){a=1;h=0;break I}e=J[v>>2];b=0;J[5996]=0;a=_(54,1293,3)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}d=e^-1;if(d&a){break i}J[5996]=0;g=_(54,2451,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;h=_(54,2049,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;m=_(54,1681,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,1029,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}if(a&d){J[5996]=0;a=_(54,1959,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}f=a&d?2:1;}J[5996]=0;k=_(54,2167,4)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;a=_(54,2165,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}J[5996]=0;j=_(54,2165,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}b=0;J:{if(j&(c&e^-1)){break J}K:{if(n>>>0<2){break K}J[5996]=0;b=_(54,2295,1)|0;j=J[5996];J[5996]=0;if((j|0)==1){break g}j=c^-1;if(!(j&b)){b=0;J[5996]=0;o=_(54,2278,1)|0;u=J[5996];J[5996]=0;if((u|0)==1){break g}if(!(d&o)){break J}}J[5996]=0;b=_(54,2278,1)|0;o=J[5996];J[5996]=0;if((o|0)==1){break g}if(!(b&j)){b=0;J[5996]=0;o=_(54,2295,1)|0;u=J[5996];J[5996]=0;if((u|0)==1){break g}if(!(d&o)){break J}}J[5996]=0;b=_(54,2174,1)|0;o=J[5996];J[5996]=0;if((o|0)==1){break g}if(!(b&j)){b=0;J[5996]=0;o=_(54,2170,1)|0;u=J[5996];J[5996]=0;if((u|0)==1){break g}if(!(d&o)){break J}}J[5996]=0;b=_(54,2170,1)|0;o=J[5996];J[5996]=0;if((o|0)==1){break g}if(b&j){break K}b=0;J[5996]=0;j=_(54,2174,1)|0;o=J[5996];J[5996]=0;if((o|0)==1){break g}if(!(d&j)){break J}}b=a;}a=!(d&g);j=!(d&h);h=!(d&m);c=k&(c|e)|b;b=i-v|0;if(b>>>0<5){break I}b=b>>2;o=b>>>0<=2?2:b;e=1;while(1){m=J[(e<<2)+v>>2];J[5996]=0;b=_(54,1289,3)|0;d=J[5996];J[5996]=0;if((d|0)==1){break b}i=m^-1;if(i&b){b=0;break i}J[5996]=0;u=_(54,2451,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break b}J[5996]=0;w=_(54,2049,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break b}J[5996]=0;x=_(54,1681,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break b}J[5996]=0;b=_(54,1029,1)|0;d=J[5996];J[5996]=0;if((d|0)==1){break b}if(b&i){J[5996]=0;b=_(54,1959,1)|0;d=J[5996];J[5996]=0;if((d|0)==1){break b}b=b&i?2:1;}else {b=0;}J[5996]=0;q=_(54,2167,4)|0;d=J[5996];J[5996]=0;if((d|0)==1){break b}J[5996]=0;g=_(54,2165,1)|0;d=J[5996];J[5996]=0;if((d|0)==1){break b}J[5996]=0;k=_(54,2165,1)|0;d=J[5996];J[5996]=0;if((d|0)==1){break b}d=0;L:{if(k&(c&m^-1)){break L}M:{if(n>>>0<2){break M}J[5996]=0;k=_(54,2295,1)|0;p=J[5996];J[5996]=0;if((p|0)==1){break b}l=k;k=c^-1;if(!(l&k)){J[5996]=0;p=_(54,2278,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break b}if(!(i&p)){break L}}J[5996]=0;p=_(54,2278,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break b}if(!(k&p)){J[5996]=0;p=_(54,2295,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break b}if(!(i&p)){break L}}J[5996]=0;p=_(54,2174,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break b}if(!(k&p)){J[5996]=0;p=_(54,2170,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break b}if(!(i&p)){break L}}J[5996]=0;p=_(54,2170,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break b}if(k&p){break M}J[5996]=0;k=_(54,2174,1)|0;p=J[5996];J[5996]=0;if((p|0)==1){break b}if(!(i&k)){break L}}d=g;}a=!(i&u)&a;j=!(i&w)&j;h=!(i&x)+h|0;f=b+f|0;c=q&(c|m)|d;e=e+1|0;if((o|0)!=(e|0)){continue}break}}J[5996]=0;b=_(54,1293,3)|0;d=J[5996];J[5996]=0;if((d|0)==1){break g}J[5996]=0;d=_(54,1029,1)|0;e=J[5996];J[5996]=0;if((e|0)==1){break g}J[5996]=0;e=_(54,1959,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break g}J[5996]=0;g=_(54,2451,1)|0;i=J[5996];J[5996]=0;if((i|0)==1){break g}J[5996]=0;i=_(54,2049,1)|0;m=J[5996];J[5996]=0;if((m|0)==1){break g}J[5996]=0;m=_(54,1681,1)|0;k=J[5996];J[5996]=0;if((k|0)==1){break g}b=b|c|(f?0:d)|((f|0)==1?e:0)|(a?(h|0)==(s|0)?g:0:0);c=a&j?i:0;a=s-n|0;b=b|(a>>>0<=h>>>0?c:0)|(a+1>>>0<=h>>>0?m:0);}J[5996]=0;c=_(54,3310,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;d=_(54,2796,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;f=_(54,3557,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}J[5996]=0;j=_(54,2777,1)|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}e=2356;a=19;g=4075;N:{O:{k=d;d=b^-1;c=((!(k&d)+!(c&d)|0)+!(d&f)|0)+!(d&j)|0;switch(c|0){case 0:break N;case 1:break O;default:break h}}J[5996]=0;a=_(54,1029,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}P:{if(a&d){break P}J[5996]=0;a=_(54,1959,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){break P}a=20;g=4494;break h}J[5996]=0;a=_(54,2029,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}Q:{if(a&d){break Q}J[5996]=0;a=_(54,1029,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){break Q}a=21;g=4356;break h}J[5996]=0;a=_(54,2029,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}R:{if(a&d){break R}J[5996]=0;a=_(54,2777,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){break R}a=22;g=4771;break h}J[5996]=0;a=_(54,2796,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}S:{if(a&d){break S}J[5996]=0;a=_(54,2522,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){break S}a=23;g=4702;break h}J[5996]=0;a=_(54,3310,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}T:{if(a&d){break T}J[5996]=0;a=_(54,1295,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(!(a&d)){break T}a=24;g=4426;break h}J[5996]=0;a=_(54,2796,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}U:{if(a&d){break U}J[5996]=0;a=_(54,1295,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){break U}a=25;g=4391;break h}J[5996]=0;a=_(54,2451,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}V:{if(a&d){break V}J[5996]=0;a=_(54,2315,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){break V}a=26;g=4563;break h}J[5996]=0;a=_(54,2451,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}W:{if(a&d){break W}J[5996]=0;a=_(54,2522,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(!(a&d)){break W}a=27;g=4737;break h}J[5996]=0;a=_(54,2796,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}X:{if(a&d){break X}J[5996]=0;a=_(54,2451,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){break X}a=28;g=4667;break h}J[5996]=0;a=_(54,2522,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}Y:{if(a&d){break Y}J[5996]=0;a=_(54,2315,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){break Y}a=29;g=4598;break h}J[5996]=0;a=_(54,2796,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}Z:{if(a&d){break Z}J[5996]=0;a=_(54,2315,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(!(a&d)){break Z}a=30;g=4633;break h}J[5996]=0;a=_(54,3310,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}_:{if(a&d){break _}J[5996]=0;a=_(54,1681,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(!(a&d)){break _}a=31;g=4460;break h}J[5996]=0;a=_(54,1029,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}if(a&d){c=b;break N}J[5996]=0;a=_(54,2049,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break g}c=b;if(!(a&d)){break N}a=32;g=4529;break h}if(v){$a(v);}return c|0}J[5996]=0;ga(44,g|0,1859,a|0,e|0);a=J[5996];J[5996]=0;if((a|0)!=1){break a}}}a=Z()|0;if(v){$a(v);}da(a|0);B();}B();}function jn(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;l=Ua-304|0;Ua=l;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{m=Gb(a);if(m>>>0>=2147483632){J[5996]=0;ca(2);a=J[5996];J[5996]=0;if((a|0)==1){break s}break a}t:{if(m>>>0<=10){H[l+155|0]=m;n=l+144|0;break t}J[5996]=0;o=(m|15)+1|0;n=$(3,o|0)|0;p=J[5996];J[5996]=0;if((p|0)==1){break s}J[l+144>>2]=n;J[l+148>>2]=m;J[l+152>>2]=o|-2147483648;}H[fb(n,a,m)+m|0]=0;q=J[l+144>>2];a=K[l+155|0];r=a<<24>>24;m=(r|0)<0;p=m?q:l+144|0;s=m?J[l+148>>2]:a;m=p+s|0;n=-1;u:{while(1){if((m|0)==(p|0)){break u}m=m-1|0;o=K[m|0];v=o>>>0<=63;a=o&31;if((o&63)>>>0>=32){o=1<<a;t=0;}else {t=1<<a;o=t-1&1>>>32-a;}a=t&9728;if(v&(o&1|(a|0)!=0)){continue}break}n=m-p|0;}a=n+1|0;if(a>>>0>s>>>0){J[5996]=0;ca(108);a=J[5996];J[5996]=0;if((a|0)!=1){break a}m=fa(22864)|0;a=Va;break m}v:{if((r|0)<0){J[l+148>>2]=a;break v}H[l+155|0]=a;q=l+144|0;}H[a+q|0]=0;J[l+12>>2]=0;J[l+16>>2]=0;w:{if(H[l+155|0]>=0){J[l+120>>2]=J[l+152>>2];a=J[l+148>>2];J[l+112>>2]=J[l+144>>2];J[l+116>>2]=a;break w}J[5996]=0;ea(40,l+112|0,J[l+144>>2],J[l+148>>2]);a=J[5996];J[5996]=0;if((a|0)==1){break r}}J[5996]=0;m=l+128|0;aa(109,m|0,l+112|0);a=J[5996];J[5996]=0;if((a|0)==1){break q}n=H[l+139|0];a=(n|0)<0;J[l+180>>2]=a?J[l+132>>2]:n&255;J[l+176>>2]=a?J[l+128>>2]:m;J[5996]=0;aa(29,l+248|0,l+176|0);a=J[5996];J[5996]=0;x:{y:{z:{A:{if((a|0)!=1){if(!J[l+180>>2]){break A}J[l+240>>2]=0;J[l+244>>2]=0;J[l+232>>2]=0;J[l+236>>2]=0;J[l+224>>2]=0;J[l+228>>2]=0;J[l+216>>2]=0;J[l+220>>2]=0;J[l+208>>2]=0;J[l+212>>2]=0;J[l+200>>2]=0;J[l+204>>2]=0;J[l+192>>2]=0;J[l+196>>2]=0;break z}m=Ra(22528,22864)|0;a=Va;if((a|0)!=(wa(22528)|0)){break x}pa(m|0)|0;J[l+240>>2]=0;J[l+244>>2]=0;J[l+232>>2]=0;J[l+236>>2]=0;J[l+224>>2]=0;J[l+228>>2]=0;J[l+216>>2]=0;J[l+220>>2]=0;J[l+208>>2]=0;J[l+212>>2]=0;J[l+200>>2]=0;J[l+204>>2]=0;J[l+192>>2]=0;J[l+196>>2]=0;J[5996]=0;ca(110);a=J[5996];J[5996]=0;if((a|0)!=1){break y}m=fa(22864)|0;a=Va;break x}a=J[l+260>>2];m=J[l+264>>2];J[l+260>>2]=0;J[l+264>>2]=0;J[l+204>>2]=a;J[l+208>>2]=m;a=J[l+268>>2];m=J[l+272>>2];J[l+268>>2]=0;J[l+272>>2]=0;J[l+212>>2]=a;J[l+216>>2]=m;J[l+228>>2]=J[l+284>>2];a=J[l+288>>2];J[l+284>>2]=0;J[l+288>>2]=0;J[l+192>>2]=J[l+248>>2];m=J[l+252>>2];n=J[l+256>>2];J[l+252>>2]=0;J[l+256>>2]=0;J[l+196>>2]=m;J[l+200>>2]=n;m=J[l+280>>2];J[l+220>>2]=J[l+276>>2];J[l+224>>2]=m;J[l+276>>2]=0;J[l+280>>2]=0;J[l+232>>2]=a;J[l+236>>2]=J[l+292>>2];J[l+292>>2]=0;a=J[l+296>>2];J[l+296>>2]=0;J[l+240>>2]=a;J[l+244>>2]=J[l+300>>2];}Fb(l+248|0);}if(!J[l+192>>2]){n=0;break o}J[l+184>>2]=0;J[l+176>>2]=0;J[l+180>>2]=0;J[l+256>>2]=0;J[l+260>>2]=0;J[5996]=0;J[l+248>>2]=0;J[l+252>>2]=0;J[l+264>>2]=1065353216;o=ba(111,l+192|0,l+248|0,l+176|0)|0;a=J[5996];J[5996]=0;B:{if((a|0)!=1){m=J[l+256>>2];if(m){while(1){a=J[m>>2];$a(m);m=a;if(a){continue}break}}a=J[l+248>>2];n=0;J[l+248>>2]=0;if(a){$a(a);}C:{D:{if(o){J[l+252>>2]=0;J[l+256>>2]=0;J[5996]=0;J[l+248>>2]=l+252;a=qa(50,o|0,1,0,l+248|0)|0;m=J[5996];J[5996]=0;if((m|0)==1){break D}J[5996]=0;m=_(54,1639,3)|0;n=J[5996];J[5996]=0;E:{F:{G:{H:{if((n|0)==1){break H}n=J[a>>2];a=J[a+4>>2];J[5996]=0;oa(51,l+160|0,n|0,a|0,m|0,0);a=J[5996];J[5996]=0;if((a|0)==1){break H}m=J[l+164>>2];n=J[l+160>>2];o=m-n|0;if((o|0)!=32){break G}m=J[n>>2];p=J[n+4>>2];J[n>>2]=0;J[n+4>>2]=0;a=J[l+16>>2];J[l+12>>2]=m;J[l+16>>2]=p;I:{if(!a){break I}m=J[a+4>>2];J[a+4>>2]=m-1;if(m){break I}Xa[J[J[a>>2]+8>>2]](a);bb(a);}n=J[l+160>>2];u=O[n+8>>3];m=J[l+164>>2];break F}m=fa(22864)|0;break C}if(!n){break E}}if((m|0)!=(n|0)){while(1){m=m-32|0;a=J[m+4>>2];J:{if(!a){break J}p=J[a+4>>2];J[a+4>>2]=p-1;if(p){break J}Xa[J[J[a>>2]+8>>2]](a);bb(a);}if((m|0)!=(n|0)){continue}break}m=J[l+160>>2];}J[l+164>>2]=n;$a(m);}xd(J[l+252>>2]);n=(o|0)==32;}a=J[l+176>>2];if(!a){break o}m=J[l+180>>2];if((a|0)!=(m|0)){while(1){m=m-4|0;ad(m);if((a|0)!=(m|0)){continue}break}a=J[l+176>>2];}$a(a);break o}m=fa(22864)|0;}a=Va;xd(J[l+252>>2]);break B}m=fa(22864)|0;a=Va;h=J[l+256>>2];if(h){while(1){i=J[h>>2];$a(h);h=i;if(h){continue}break}}h=J[l+248>>2];J[l+248>>2]=0;if(h){$a(h);}}h=J[l+176>>2];if(h){j=J[l+180>>2];i=h;if((j|0)!=(h|0)){while(1){j=j-4|0;ad(j);if((h|0)!=(j|0)){continue}break}i=J[l+176>>2];}J[l+180>>2]=h;$a(i);}Fb(l+192|0);}if(H[l+139|0]>=0){break p}$a(J[l+128>>2]);break p}m=fa(22864)|0;a=Va;break l}m=fa(22864)|0;a=Va;break n}m=fa(22864)|0;a=Va;}if(H[l+123|0]>=0){break n}$a(J[l+112>>2]);break n}Fb(l+192|0);if(H[l+139|0]<0){$a(J[l+128>>2]);}if(H[l+123|0]<0){$a(J[l+112>>2]);}K:{L:{M:{N:{O:{P:{Q:{R:{if(!n){J[5996]=0;a=$(3,16)|0;h=J[5996];J[5996]=0;S:{T:{if((h|0)!=1){H[a+15|0]=0;h=K[2587]|K[2588]<<8|(K[2589]<<16|K[2590]<<24);i=K[2583]|K[2584]<<8|(K[2585]<<16|K[2586]<<24);H[a+7|0]=i;H[a+8|0]=i>>>8;H[a+9|0]=i>>>16;H[a+10|0]=i>>>24;H[a+11|0]=h;H[a+12|0]=h>>>8;H[a+13|0]=h>>>16;H[a+14|0]=h>>>24;h=K[2580]|K[2581]<<8|(K[2582]<<16|K[2583]<<24);i=K[2576]|K[2577]<<8|(K[2578]<<16|K[2579]<<24);H[a|0]=i;H[a+1|0]=i>>>8;H[a+2|0]=i>>>16;H[a+3|0]=i>>>24;H[a+4|0]=h;H[a+5|0]=h>>>8;H[a+6|0]=h>>>16;H[a+7|0]=h>>>24;h=((c|0)>=16?16:c)-1|0;H[fb(b,a,h)+h|0]=0;$a(a);J[5996]=0;k=$(3,16)|0;a=J[5996];J[5996]=0;if((a|0)==1){break T}H[k+15|0]=0;h=K[2587]|K[2588]<<8|(K[2589]<<16|K[2590]<<24);i=h;a=K[2583]|K[2584]<<8|(K[2585]<<16|K[2586]<<24);H[k+7|0]=a;n=a>>>8|0;H[k+8|0]=n;o=a>>>16|0;H[k+9|0]=o;p=a>>>24|0;H[k+10|0]=p;H[k+11|0]=h;H[k+12|0]=h>>>8;H[k+13|0]=h>>>16;H[k+14|0]=h>>>24;j=K[2580]|K[2581]<<8|(K[2582]<<16|K[2583]<<24);h=K[2576]|K[2577]<<8|(K[2578]<<16|K[2579]<<24);H[k|0]=h;H[k+1|0]=h>>>8;H[k+2|0]=h>>>16;H[k+3|0]=h>>>24;H[k+4|0]=j;H[k+5|0]=j>>>8;H[k+6|0]=j>>>16;H[k+7|0]=j>>>24;m=((e|0)>=16?16:e)-1|0;H[fb(d,k,m)+m|0]=0;$a(k);J[5996]=0;k=$(3,16)|0;m=J[5996];J[5996]=0;if((m|0)==1){break S}H[k+15|0]=0;H[k+7|0]=a;H[k+8|0]=n;H[k+9|0]=o;H[k+10|0]=p;a=i;H[k+11|0]=a;H[k+12|0]=a>>>8;H[k+13|0]=a>>>16;H[k+14|0]=a>>>24;H[k|0]=h;H[k+1|0]=h>>>8;H[k+2|0]=h>>>16;H[k+3|0]=h>>>24;a=j;H[k+4|0]=a;H[k+5|0]=a>>>8;H[k+6|0]=a>>>16;H[k+7|0]=a>>>24;a=((g|0)>=16?16:g)-1|0;H[fb(f,k,a)+a|0]=0;$a(k);break R}m=fa(22864)|0;a=Va;break n}m=fa(22864)|0;a=Va;break n}m=fa(22864)|0;a=Va;break n}J[5996]=0;a=J[l+12>>2];J[l+200>>2]=0;J[l+192>>2]=0;J[l+196>>2]=0;p=$(3,12)|0;m=J[5996];J[5996]=0;if((m|0)==1){break K}H[p+8|0]=0;J[p+4>>2]=0;J[p>>2]=a;m=p+12|0;t=m;U:{V:{W:{while(1){X:{r=m-12|0;o=J[r+4>>2];a=J[r>>2];n=J[a+32>>2];s=J[a+36>>2]-n>>3;Y:{if(s>>>0>o>>>0){s=1;J[r+4>>2]=o+1;a=J[a>>2];Z:{if(a-10>>>0<7){break Z}_:{switch(a-17|0){case 0:s=J[J[n+8>>2]>>2]==1;break Z;case 5:if(!J[J[n>>2]>>2]){break Z}s=!J[J[n+8>>2]>>2];break Z;default:break _}}s=0;}a=J[n+(o<<3)>>2];if(m>>>0<t>>>0){H[m+8|0]=s;J[m+4>>2]=0;J[m>>2]=a;m=m+12|0;break Y}$:{r=(m-p|0)/12|0;n=r+1|0;aa:{if(n>>>0>=357913942){J[5996]=0;ca(112);break aa}o=(t-p|0)/12|0;q=o<<1;n=o>>>0>=178956970?357913941:n>>>0<q>>>0?q:n;if(n>>>0<357913942){break $}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}m=fa(22864)|0;break M}J[5996]=0;q=P(n,12);o=$(3,q|0)|0;n=J[5996];J[5996]=0;if((n|0)==1){break N}n=o+P(r,12)|0;H[n+8|0]=s;J[n+4>>2]=0;J[n>>2]=a;a=n;if((m|0)!=(p|0)){while(1){m=m-12|0;r=J[m+4>>2];a=a-12|0;J[a>>2]=J[m>>2];J[a+4>>2]=r;J[a+8>>2]=J[m+8>>2];if((m|0)!=(p|0)){continue}break}}t=o+q|0;m=n+12|0;if(p){$a(p);}p=a;break Y}q=J[l+192>>2];n=(J[l+196>>2]-q|0)/12|0;if(n>>>0<s>>>0){J[5996]=0;ga(44,5135,2210,439,2439);a=J[5996];J[5996]=0;if((a|0)!=1){break a}m=fa(22864)|0;break M}m=K[m-4|0];J[5996]=0;oa(113,l+248|0,m|0,a|0,(P(n,12)+q|0)+P(s,-12)|0,s|0);m=J[5996];J[5996]=0;ba:{if((m|0)!=1){if(K[l+260|0]){break ba}s=0;break U}m=fa(22864)|0;break M}n=J[l+196>>2];m=J[a+36>>2]-J[a+32>>2]>>3;a=J[l+192>>2];o=((n+P(m,-12)|0)-a|0)/12|0;ca:{if(!P(m,-12)){m=n;break ca}o=a+P(o,12)|0;a=o;m=a+P((P(m,12)|0)/12|0,12)|0;if((n|0)!=(m|0)){while(1){if(H[a+11|0]<0){$a(J[a>>2]);}q=J[m+4>>2];J[a>>2]=J[m>>2];J[a+4>>2]=q;J[a+8>>2]=J[m+8>>2];H[m+11|0]=0;H[m|0]=0;a=a+12|0;m=m+12|0;if((n|0)!=(m|0)){continue}break}n=J[l+196>>2];}m=o+P((a-o|0)/12|0,12)|0;if((n|0)!=(m|0)){while(1){a=n-12|0;if(H[n-1|0]<0){$a(J[a>>2]);}n=a;if((a|0)!=(m|0)){continue}break}}J[l+196>>2]=m;}o=J[l+200>>2];da:{if(o>>>0>m>>>0){a=J[l+252>>2];J[m>>2]=J[l+248>>2];J[m+4>>2]=a;J[m+8>>2]=J[l+256>>2];J[l+256>>2]=0;J[l+248>>2]=0;J[l+252>>2]=0;J[l+196>>2]=m+12;break da}ea:{fa:{n=J[l+192>>2];s=(m-n|0)/12|0;a=s+1|0;ga:{if(a>>>0>=357913942){J[5996]=0;ca(41);break ga}o=(o-n|0)/12|0;q=o<<1;q=o>>>0>=178956970?357913941:a>>>0<q>>>0?q:a;if(!q){o=0;break ea}if(q>>>0<357913942){break fa}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}m=fa(22864)|0;break W}J[5996]=0;o=$(3,P(q,12)|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break X}}a=P(s,12)+o|0;s=J[l+252>>2];J[a>>2]=J[l+248>>2];J[a+4>>2]=s;J[a+8>>2]=J[l+256>>2];J[l+256>>2]=0;J[l+248>>2]=0;J[l+252>>2]=0;o=P(q,12)+o|0;q=a+12|0;ha:{if((m|0)==(n|0)){J[l+200>>2]=o;J[l+196>>2]=q;J[l+192>>2]=a;break ha}while(1){m=m-12|0;s=J[m+4>>2];a=a-12|0;J[a>>2]=J[m>>2];J[a+4>>2]=s;J[a+8>>2]=J[m+8>>2];J[m>>2]=0;J[m+4>>2]=0;J[m+8>>2]=0;if((m|0)!=(n|0)){continue}break}J[l+200>>2]=o;n=J[l+196>>2];J[l+196>>2]=q;m=J[l+192>>2];J[l+192>>2]=a;if((m|0)==(n|0)){break ha}while(1){a=n-12|0;if(H[n-1|0]<0){$a(J[a>>2]);}n=a;if((a|0)!=(m|0)){continue}break}}if(!m){break da}$a(m);}if(!(!K[l+260|0]|H[l+259|0]>=0)){$a(J[l+248>>2]);}m=r;}if((m|0)!=(p|0)){continue}break V}break}m=fa(22864)|0;}a=Va;if(!K[l+260|0]|H[l+259|0]>=0){break L}$a(J[l+248>>2]);break L}a=J[l+192>>2];if((J[l+196>>2]-a|0)!=12){J[5996]=0;ga(44,4102,2210,450,2439);a=J[5996];J[5996]=0;if((a|0)!=1){break a}m=fa(22864)|0;break M}s=J[a>>2];J[l+160>>2]=J[a+4>>2];m=K[a+7|0]|K[a+8|0]<<8|(K[a+9|0]<<16|K[a+10|0]<<24);H[l+163|0]=m;H[l+164|0]=m>>>8;H[l+165|0]=m>>>16;H[l+166|0]=m>>>24;J[a>>2]=0;J[a+4>>2]=0;q=K[a+11|0];J[a+8>>2]=0;}n=J[l+192>>2];if(n){a=J[l+196>>2];m=n;if((a|0)!=(m|0)){while(1){m=a-12|0;if(H[a-1|0]<0){$a(J[m>>2]);}a=m;if((n|0)!=(a|0)){continue}break}m=J[l+192>>2];}J[l+196>>2]=n;$a(m);}if(p){$a(p);}a=K[l+163|0]|K[l+164|0]<<8|(K[l+165|0]<<16|K[l+166|0]<<24);H[l+103|0]=a;H[l+104|0]=a>>>8;H[l+105|0]=a>>>16;H[l+106|0]=a>>>24;J[l+100>>2]=J[l+160>>2];J[l+96>>2]=s;J[l+160>>2]=0;H[l+163|0]=0;H[l+164|0]=0;H[l+165|0]=0;H[l+166|0]=0;H[l+107|0]=q;ia:{ja:{ka:{la:{ma:{na:{oa:{pa:{qa:{ra:{sa:{ta:{ua:{va:{wa:{xa:{ya:{za:{Aa:{Ba:{Ca:{Da:{p=J[l+100>>2];a=q<<24>>24<0;m=a?p:q&255;Ea:{if((m|0)<72){break Ea}o=a?s:l+96|0;n=o+m|0;while(1){a=o;while(1){a=Zb(a,115,m-71|0);if(!a){break Ea}if(Eb(a,5034,72)){a=a+1|0;m=n-a|0;if((m|0)>=72){continue}break Ea}break}if((a|0)==(n|0)){break Ea}a=a-o|0;if((a|0)==-1){break Ea}J[5996]=0;m=l+96|0;ga(114,m|0,a|0,72,4824);a=J[5996];J[5996]=0;if((a|0)==1){break Da}s=J[l+96>>2];n=m;a=K[l+107|0];q=a<<24>>24;m=(q|0)<0;o=m?s:n;p=J[l+100>>2];m=m?p:a;n=o+m|0;if((m|0)>71){continue}break}}Fa:{a=q<<24>>24;m=(a|0)<0?p:q&255;Ga:{if((m|0)<73){break Ga}o=(a|0)<0?s:l+96|0;n=o+m|0;while(1){a=o;while(1){a=Zb(a,104,m-72|0);if(!a){break Ga}if(Eb(a,4960,73)){a=a+1|0;m=n-a|0;if((m|0)>=73){continue}break Ga}break}if((a|0)==(n|0)){break Ga}a=a-o|0;if((a|0)==-1){break Ga}J[5996]=0;m=l+96|0;ga(114,m|0,a|0,73,4813);a=J[5996];J[5996]=0;if((a|0)==1){break Fa}s=J[l+96>>2];n=m;a=K[l+107|0];q=a<<24>>24;m=(q|0)<0;o=m?s:n;p=J[l+100>>2];m=m?p:a;n=o+m|0;if((m|0)>72){continue}break}}Ha:{a=q<<24>>24<0;m=a?p:q&255;Ia:{if((m|0)<51){break Ia}o=a?s:l+96|0;n=o+m|0;while(1){a=o;while(1){a=Zb(a,114,m-50|0);if(!a){break Ia}if(Eb(a,4908,51)){a=a+1|0;m=n-a|0;if((m|0)>=51){continue}break Ia}break}if((a|0)==(n|0)){break Ia}a=a-o|0;if((a|0)==-1){break Ia}J[5996]=0;m=l+96|0;ga(114,m|0,a|0,51,4845);a=J[5996];J[5996]=0;if((a|0)==1){break Ha}s=J[l+96>>2];n=m;a=K[l+107|0];q=a<<24>>24;m=(q|0)<0;o=m?s:n;p=J[l+100>>2];m=m?p:a;n=o+m|0;if((m|0)>50){continue}break}}Ja:{a=q<<24>>24;m=(a|0)<0?p:q&255;Ka:{if((m|0)<49){break Ka}p=(a|0)<0?s:l+96|0;n=p+m|0;while(1){a=p;while(1){a=Zb(a,104,m-48|0);if(!a){break Ka}if(Eb(a,4858,49)){a=a+1|0;m=n-a|0;if((m|0)>=49){continue}break Ka}break}if((a|0)==(n|0)){break Ka}a=a-p|0;if((a|0)==-1){break Ka}J[5996]=0;m=l+96|0;ga(114,m|0,a|0,49,4834);a=J[5996];J[5996]=0;if((a|0)==1){break Ja}n=m;a=K[l+107|0];m=a<<24>>24<0;p=m?J[l+96>>2]:n;m=m?J[l+100>>2]:a;n=p+m|0;if((m|0)>48){continue}break}}J[l+184>>2]=J[l+104>>2];J[l+104>>2]=0;m=J[l+100>>2];a=J[l+96>>2];J[l+176>>2]=a;J[l+180>>2]=m;J[l+96>>2]=0;J[l+100>>2]=0;m=K[l+187|0];n=m<<24>>24;o=(n|0)<0;p=o?a:l+176|0;m=o?J[l+180>>2]:m;o=c-1|0;m=(m|0)<(o|0)?m:o;H[fb(b,p,m)+m|0]=0;La:{if((n|0)>=0){break La}$a(a);if(H[l+107|0]>=0){break La}$a(J[l+96>>2]);}a=J[J[l+12>>2]+84>>2];J[5996]=0;m=l+36|0;aa(115,m|0,a|0);a=J[5996];J[5996]=0;if((a|0)==1){break Ba}J[5996]=0;a=ba(99,m|0,0,5442)|0;m=J[5996];J[5996]=0;if((m|0)==1){break Aa}J[l+56>>2]=J[a+8>>2];m=J[a+4>>2];J[l+48>>2]=J[a>>2];J[l+52>>2]=m;J[a>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;J[5996]=0;m=_(97,l+48|0,5422)|0;n=J[5996];J[5996]=0;if((n|0)==1){break za}J[l+72>>2]=J[m+8>>2];n=J[m+4>>2];J[l+64>>2]=J[m>>2];J[l+68>>2]=n;J[m>>2]=0;J[m+4>>2]=0;J[m+8>>2]=0;J[5996]=0;n=l+248|0;Da(116,n|0,+u);o=J[5996];J[5996]=0;if((o|0)==1){break ya}J[5996]=0;p=n;n=K[l+259|0];o=n<<24>>24<0;n=ba(100,l- -64|0,(o?J[l+248>>2]:p)|0,(o?J[l+252>>2]:n)|0)|0;o=J[5996];J[5996]=0;if((o|0)==1){break xa}J[l+88>>2]=J[n+8>>2];o=J[n+4>>2];J[l+80>>2]=J[n>>2];J[l+84>>2]=o;J[n>>2]=0;J[n+4>>2]=0;J[n+8>>2]=0;J[5996]=0;o=_(97,l+80|0,5504)|0;p=J[5996];J[5996]=0;if((p|0)==1){break wa}J[l+136>>2]=J[o+8>>2];p=J[o+4>>2];J[l+128>>2]=J[o>>2];J[l+132>>2]=p;J[o>>2]=0;J[o+4>>2]=0;J[o+8>>2]=0;p=J[J[l+12>>2]+84>>2];J[5996]=0;r=l+192|0;Da(116,r|0,+(u+ +(p>>>0)));p=J[5996];J[5996]=0;if((p|0)==1){break va}J[5996]=0;t=r;p=K[l+203|0];r=p<<24>>24<0;p=ba(100,l+128|0,(r?J[l+192>>2]:t)|0,(r?J[l+196>>2]:p)|0)|0;r=J[5996];J[5996]=0;if((r|0)==1){break ua}J[l+168>>2]=J[p+8>>2];r=J[p+4>>2];J[l+160>>2]=J[p>>2];J[l+164>>2]=r;J[p>>2]=0;J[p+4>>2]=0;J[p+8>>2]=0;J[5996]=0;r=_(97,l+160|0,3567)|0;q=J[5996];J[5996]=0;if((q|0)==1){break ta}J[l+184>>2]=J[r+8>>2];q=J[r+4>>2];J[l+176>>2]=J[r>>2];J[l+180>>2]=q;J[r>>2]=0;J[r+4>>2]=0;J[r+8>>2]=0;if(H[l+203|0]<0){$a(J[l+192>>2]);}if(H[p+11|0]<0){$a(J[p>>2]);}if(H[o+11|0]<0){$a(J[o>>2]);}if(H[l+259|0]<0){$a(J[l+248>>2]);}if(H[n+11|0]<0){$a(J[n>>2]);}if(H[m+11|0]<0){$a(J[m>>2]);}if(H[a+11|0]<0){$a(J[a>>2]);}n=J[l+176>>2];a=K[l+187|0];o=a<<24>>24;m=(o|0)<0;p=m?n:l+176|0;a=m?J[l+180>>2]:a;m=e-1|0;a=(a|0)<(m|0)?a:m;H[fb(d,p,a)+a|0]=0;J[5996]=0;m=l+248|0;aa(117,m|0,J[l+12>>2]);a=J[5996];J[5996]=0;if((a|0)==1){break la}J[l+220>>2]=J[l+276>>2];a=J[l+272>>2];J[l+212>>2]=J[l+268>>2];J[l+216>>2]=a;a=J[l+264>>2];J[l+204>>2]=J[l+260>>2];J[l+208>>2]=a;a=J[l+256>>2];J[l+196>>2]=J[l+252>>2];J[l+200>>2]=a;a=J[l+248>>2];J[l+192>>2]=a;J[5996]=0;p=a>>>0<29;r=p?l+196|0:J[l+200>>2];J[l+248>>2]=r;q=l+24|0;ga(102,q|0,m|0,r+(p?a:a-29|0)|0,0);a=J[5996];J[5996]=0;if((a|0)==1){break ka}a=J[l+24>>2];m=K[l+35|0];p=m<<24>>24;r=(p|0)<0;t=r?a:q;m=r?J[l+28>>2]:m;r=g-1|0;m=(m|0)<(r|0)?m:r;H[fb(f,t,m)+m|0]=0;if((p|0)<0){$a(a);}if(M[l+192>>2]>=29){$a(J[l+200>>2]);}a=J[l+12>>2];m=J[a+80>>2];if(!m|M[a+84>>2]>3600|(J[a+52>>2]+J[a+44>>2]>>>0>201|M[a+68>>2]>100)){break ja}J[5996]=0;p=_(54,2049,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break Q}if((m^-1)&p){break ja}m=J[a+80>>2];J[5996]=0;p=_(54,2165,1)|0;r=J[5996];J[5996]=0;if((r|0)==1){break Q}if(K[a+88|0]|(m^-1)&p){break ja}H[l+252|0]=0;J[l+248>>2]=1702195828;H[l+259|0]=4;a=((k|0)>=5?5:k)-1|0;H[fb(j,l+248|0,a)+a|0]=0;break ia}m=fa(22864)|0;break Ca}m=fa(22864)|0;break Ca}m=fa(22864)|0;break Ca}m=fa(22864)|0;}a=Va;if(H[l+107|0]>=0){break n}$a(J[l+96>>2]);break n}m=fa(22864)|0;a=Va;break n}m=fa(22864)|0;a=Va;break ma}m=fa(22864)|0;a=Va;break na}m=fa(22864)|0;a=Va;break oa}m=fa(22864)|0;a=Va;break pa}m=fa(22864)|0;a=Va;break qa}m=fa(22864)|0;a=Va;break ra}m=fa(22864)|0;a=Va;break sa}m=fa(22864)|0;a=Va;if(H[l+171|0]>=0){break sa}$a(J[l+160>>2]);}if(H[l+203|0]>=0){break ra}$a(J[l+192>>2]);}if(H[l+139|0]>=0){break qa}$a(J[l+128>>2]);}if(H[l+91|0]>=0){break pa}$a(J[l+80>>2]);}if(H[l+259|0]>=0){break oa}$a(J[l+248>>2]);}if(H[l+75|0]>=0){break na}$a(J[l+64>>2]);}if(H[l+59|0]>=0){break ma}$a(J[l+48>>2]);}if(H[l+47|0]>=0){break n}$a(J[l+36>>2]);break n}m=fa(22864)|0;break P}m=fa(22864)|0;a=Va;if(M[l+192>>2]<29){break O}$a(J[l+200>>2]);break O}H[l+252|0]=K[2354];H[l+259|0]=5;H[l+253|0]=0;J[l+248>>2]=K[2350]|K[2351]<<8|(K[2352]<<16|K[2353]<<24);a=((k|0)>=6?6:k)-1|0;H[fb(j,l+248|0,a)+a|0]=0;}J[5996]=0;a=$(118,J[l+12>>2])|0;j=J[5996];J[5996]=0;if((j|0)==1){break Q}Ma:{if(a){H[l+252|0]=0;J[l+248>>2]=1702195828;H[l+259|0]=4;a=((i|0)>=5?5:i)-1|0;H[fb(h,l+248|0,a)+a|0]=0;break Ma}H[l+252|0]=K[2354];H[l+259|0]=5;H[l+253|0]=0;J[l+248>>2]=K[2350]|K[2351]<<8|(K[2352]<<16|K[2353]<<24);a=((i|0)>=6?6:i)-1|0;H[fb(h,l+248|0,a)+a|0]=0;}if((o|0)>=0){break R}$a(n);}a=J[l+16>>2];Na:{if(!a){break Na}b=J[a+4>>2];J[a+4>>2]=b-1;if(b){break Na}Xa[J[J[a>>2]+8>>2]](a);bb(a);}if(H[l+155|0]>=0){break k}$a(J[l+144>>2]);break k}m=fa(22864)|0;}a=Va;}if((o|0)>=0){break n}$a(n);break n}m=fa(22864)|0;}a=Va;}rb(l+192|0);if(!p){break n}$a(p);break n}m=fa(22864)|0;a=Va;rb(l+192|0);}mb(l+12|0);}if(H[l+155|0]>=0){break l}$a(J[l+144>>2]);}if((wa(22864)|0)!=(a|0)){break c}a=pa(m|0)|0;a=Xa[J[J[a>>2]+8>>2]](a)|0;J[5996]=0;i=_(30,l+24|0,a|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break j}J[5996]=0;a=ba(99,i|0,0,5474)|0;h=J[5996];J[5996]=0;if((h|0)==1){break i}J[l+152>>2]=J[a+8>>2];h=J[a+4>>2];J[l+144>>2]=J[a>>2];J[l+148>>2]=h;J[a>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;J[5996]=0;h=_(97,l+144|0,2611)|0;j=J[5996];J[5996]=0;if((j|0)==1){break h}J[l+184>>2]=J[h+8>>2];i=J[h+4>>2];J[l+176>>2]=J[h>>2];J[l+180>>2]=i;J[h>>2]=0;J[h+4>>2]=0;J[h+8>>2]=0;m=b;b=J[l+176>>2];i=K[l+187|0];j=i<<24>>24;k=(j|0)<0;i=k?J[l+180>>2]:i;c=c-1|0;c=(c|0)>(i|0)?i:c;H[fb(m,k?b:l+176|0,c)+c|0]=0;Oa:{if((j|0)>=0){break Oa}$a(b);if(H[h+11|0]>=0){break Oa}$a(J[h>>2]);}if(H[a+11|0]<0){$a(J[a>>2]);}J[5996]=0;a=_(30,l+176|0,5575)|0;b=J[5996];J[5996]=0;if((b|0)==1){break f}i=d;b=J[a>>2];c=K[a+11|0];d=c<<24>>24;h=(d|0)<0;j=h?b:a;a=h?J[a+4>>2]:c;c=e-1|0;a=(a|0)<(c|0)?a:c;H[fb(i,j,a)+a|0]=0;if((d|0)<0){$a(b);}J[5996]=0;a=_(30,l+12|0,5575)|0;b=J[5996];J[5996]=0;if((b|0)==1){break e}b=J[a>>2];c=K[a+11|0];d=c<<24>>24;e=(d|0)<0;h=e?b:a;a=e?J[a+4>>2]:c;c=g-1|0;a=(a|0)<(c|0)?a:c;H[fb(f,h,a)+a|0]=0;if((d|0)<0){$a(b);}ra();}Ua=l+304|0;return}m=Z()|0;break d}m=Z()|0;break g}m=Z()|0;if(H[l+155|0]>=0){break g}$a(J[l+144>>2]);}if(H[i+11|0]>=0){break d}$a(J[i>>2]);break d}m=Z()|0;break d}m=Z()|0;}J[5996]=0;ca(110);a=J[5996];J[5996]=0;if((a|0)==1){break b}}da(m|0);B();}fa(0)|0;Vb();B();}B();}function _g(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=Ua-144|0;Ua=f;l=O[b+24>>3];m=O[b+16>>3];a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{x:{y:{z:{A:{B:{e=J[a>>2];switch(e|0){case 9:break j;case 8:break k;case 2:break l;case 3:break m;case 14:break n;case 15:break o;case 16:break p;case 19:break q;case 18:break r;case 17:break s;case 10:break t;case 11:break u;case 12:break v;case 13:break w;case 0:break x;case 4:case 5:break y;case 1:break z;case 21:break A;case 20:break B;case 6:break h;case 7:break i;default:break g}}d=J[a+4>>2];a=J[a+8>>2];if((d|0)==(a|0)){break g}while(1){_g(J[d>>2],b,c);d=d+4|0;if((a|0)!=(d|0)){continue}break}break g}a=$g(a,m,l,c);d=J[a>>2];c=J[a+4>>2];if((d|0)==(c|0)){break g}while(1){J[f+56>>2]=J[d>>2];a=J[d+4>>2];J[f+60>>2]=a;if(a){J[a+4>>2]=J[a+4>>2]+1;}a=J[f+60>>2];J[f>>2]=J[f+56>>2];J[f+4>>2]=a;Zg(b,d+8|0,f);d=d+32|0;if((c|0)!=(d|0)){continue}break}break g}hc(b,c,1,a+4|0,0,0);break g}n=(e|0)==4?4:5;Yc(f+56|0,n,m,l,0,0);J[5996]=0;d=$(46,n|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break f}J[f+88>>2]=0;J[f+80>>2]=0;J[f+84>>2]=0;H[f+136|0]=0;J[f+132>>2]=f+80;e=J[d+4>>2];h=J[d>>2];k=e-h|0;g=(k|0)/12|0;if((e|0)!=(h|0)){C:{D:{E:{if(g>>>0>=357913942){J[5996]=0;ca(47);a=J[5996];J[5996]=0;if((a|0)==1){break E}break d}J[5996]=0;e=$(3,k|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break E}J[f+84>>2]=e;J[f+80>>2]=e;J[f+88>>2]=e+P(g,12);g=J[d+4>>2];d=J[d>>2];J[5996]=0;d=ia(48,f+88|0,d|0,g|0,e|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){break C}d=Z()|0;J[f+84>>2]=e;break D}d=Z()|0;}Nc(f+132|0);break c}J[f+84>>2]=d;}J[f+140>>2]=0;J[f+132>>2]=0;J[f+136>>2]=0;e=J[a+8>>2];d=J[a+4>>2];J[5996]=0;aa(49,f+132|0,e-d>>2);e=J[5996];J[5996]=0;if((e|0)!=1){d=J[f+84>>2];e=J[f+80>>2];if((d|0)!=(e|0)){u=a+40|0;d=e;while(1){J[f+128>>2]=0;J[f+120>>2]=0;J[f+124>>2]=0;F:{G:{H:{I:{g=J[a+8>>2];e=J[a+4>>2];q=P(s,12);d=q+d|0;if(g-e>>2==J[d+4>>2]-J[d>>2]>>3){h=0;o=1;j=0;if((e|0)!=(g|0)){break I}break H}J[5996]=0;ga(44,5170,1900,642,2497);a=J[5996];J[5996]=0;if((a|0)!=1){break d}d=Z()|0;break G}J:{K:{while(1){L:{d=j<<3;l=O[d+J[f+68>>2]>>3];m=O[d+J[f+56>>2]>>3];e=J[(j<<2)+e>>2];J[5996]=0;e=qa(50,e|0,+m,+l,c|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break L}d=d+J[q+J[f+80>>2]>>2]|0;g=J[d>>2];d=J[d+4>>2];k=J[e+4>>2];e=J[e>>2];J[5996]=0;oa(51,f+100|0,e|0,k|0,g|0,d|0);e=J[5996];J[5996]=0;if((e|0)==1){break K}g=J[f+128>>2];M:{if(g>>>0>h>>>0){J[h+8>>2]=0;J[h>>2]=0;J[h+4>>2]=0;J[h>>2]=J[f+100>>2];J[h+4>>2]=J[f+104>>2];J[h+8>>2]=J[f+108>>2];J[f+124>>2]=h+12;break M}N:{e=J[f+120>>2];k=(h-e|0)/12|0;d=k+1|0;O:{if(d>>>0>=357913942){J[5996]=0;ca(52);break O}g=(g-e|0)/12|0;i=g<<1;d=g>>>0>=178956970?357913941:d>>>0<i>>>0?i:d;if(d>>>0<357913942){break N}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break d}break J}J[5996]=0;i=P(d,12);g=$(3,i|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break J}d=g+P(k,12)|0;J[d>>2]=J[f+100>>2];J[d+4>>2]=J[f+104>>2];J[d+8>>2]=J[f+108>>2];J[f+108>>2]=0;J[f+100>>2]=0;J[f+104>>2]=0;g=g+i|0;k=d+12|0;P:{if((e|0)==(h|0)){J[f+128>>2]=g;J[f+124>>2]=k;J[f+120>>2]=d;break P}while(1){d=d-12|0;h=h-12|0;J[d>>2]=J[h>>2];J[d+4>>2]=J[h+4>>2];J[d+8>>2]=J[h+8>>2];J[h+8>>2]=0;J[h>>2]=0;J[h+4>>2]=0;if((e|0)!=(h|0)){continue}break}J[f+128>>2]=g;e=J[f+124>>2];J[f+124>>2]=k;h=J[f+120>>2];J[f+120>>2]=d;if((e|0)==(h|0)){break P}while(1){i=e-12|0;k=J[i>>2];if(k){r=e-8|0;d=J[r>>2];g=k;if((d|0)!=(g|0)){while(1){d=d-32|0;e=J[d+4>>2];Q:{if(!e){break Q}g=J[e+4>>2];J[e+4>>2]=g-1;if(g){break Q}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(k|0)){continue}break}g=J[i>>2];}J[r>>2]=k;$a(g);}e=i;if((h|0)!=(e|0)){continue}break}}if(h){$a(h);}g=J[f+100>>2];if(!g){break M}e=g;d=J[f+104>>2];if((e|0)!=(d|0)){while(1){d=d-32|0;e=J[d+4>>2];R:{if(!e){break R}h=J[e+4>>2];J[e+4>>2]=h-1;if(h){break R}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(g|0)){continue}break}e=J[f+100>>2];}J[f+104>>2]=g;$a(e);}h=J[f+124>>2];e=h-12|0;o=P(J[e+4>>2]-J[e>>2]>>5,o);j=j+1|0;e=J[a+4>>2];if(j>>>0<J[a+8>>2]-e>>2>>>0){continue}break H}break}d=Z()|0;break G}d=Z()|0;break G}d=Z()|0;_b(f+100|0);break G}h=0;k=J[f+132>>2];while(1){if((h|0)==(o|0)){break F}if(J[a+8>>2]!=J[a+4>>2]){d=0;g=J[f+120>>2];e=h;while(1){i=P(d,12);j=i+g|0;g=J[j>>2];J[k+(d<<2)>>2]=g+((e>>>0)%(J[j+4>>2]-g>>5>>>0)<<5);j=e;g=J[f+120>>2];e=i+g|0;e=(j>>>0)/(J[e+4>>2]-J[e>>2]>>5>>>0)|0;d=d+1|0;if(d>>>0<J[a+8>>2]-J[a+4>>2]>>2>>>0){continue}break}}J[5996]=0;Ea(53,b|0,n|0,f+132|0,0,u|0);e=J[5996];J[5996]=0;h=h+1|0;if((e|0)!=1){continue}break}d=Z()|0;}Xc(f+120|0);break e}g=J[f+120>>2];if(g){d=J[f+124>>2];if((g|0)!=(d|0)){while(1){k=d-12|0;h=J[k>>2];if(h){e=h;i=d-8|0;d=J[i>>2];if((e|0)!=(d|0)){while(1){d=d-32|0;e=J[d+4>>2];S:{if(!e){break S}j=J[e+4>>2];J[e+4>>2]=j-1;if(j){break S}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(h|0)){continue}break}e=J[k>>2];}J[i>>2]=h;$a(e);}d=k;if((g|0)!=(d|0)){continue}break}g=J[f+120>>2];}$a(g);}s=s+1|0;d=J[f+80>>2];if(s>>>0<(J[f+84>>2]-d|0)/12>>>0){continue}break}}a=J[f+132>>2];if(a){$a(a);d=J[f+80>>2];}if(d){e=d;g=J[f+84>>2];if((e|0)!=(g|0)){while(1){a=g-12|0;b=J[a>>2];if(b){J[g-8>>2]=b;$a(b);}g=a;if((a|0)!=(d|0)){continue}break}e=J[f+80>>2];}J[f+84>>2]=d;$a(e);}a=J[f+68>>2];if(a){J[f+72>>2]=a;$a(a);}a=J[f+56>>2];if(!a){break g}J[f+60>>2]=a;$a(a);break g}d=Z()|0;break e}hc(b,c,0,a+4|0,0,0);break g}Yc(f+56|0,24,m,l,O[a+48>>3],J[a+8>>2]-J[a+4>>2]>>2);J[f+88>>2]=0;J[f+80>>2]=0;J[f+84>>2]=0;J[f+140>>2]=0;J[f+132>>2]=0;J[f+136>>2]=0;T:{U:{V:{W:{X:{Y:{Z:{_:{$:{g=J[a+4>>2];aa:{if((g|0)==J[a+8>>2]){k=-1;e=g;d=0;break aa}l=-1;e=g;k=-1;ba:{while(1){d=h<<3;m=O[d+J[f+68>>2]>>3];p=O[d+J[f+56>>2]>>3];e=J[(h<<2)+e>>2];J[5996]=0;e=qa(50,e|0,+p,+m,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break $}J[5996]=0;d=_(54,1283,5)|0;g=J[5996];J[5996]=0;ca:{da:{ea:{fa:{ga:{if((g|0)==1){break ga}g=J[e>>2];i=J[e+4>>2];J[5996]=0;oa(51,f+120|0,g|0,i|0,d|0,0);d=J[5996];J[5996]=0;if((d|0)==1){break ga}i=1;g=J[f+120>>2];switch(J[f+124>>2]-g>>5){case 0:break da;case 1:break ea;default:break fa}}d=Z()|0;break T}J[5996]=0;ga(44,4164,1900,807,2386);a=J[5996];J[5996]=0;if((a|0)!=1){break d}d=Z()|0;break U}J[5996]=0;aa(55,f+80|0,g|0);d=J[5996];J[5996]=0;if((d|0)==1){break _}J[5996]=0;d=_(54,1277,5)|0;g=J[5996];J[5996]=0;if((g|0)==1){break ca}g=J[e>>2];e=J[e+4>>2];J[5996]=0;oa(51,f+100|0,g|0,e|0,d|0,0);e=J[5996];J[5996]=0;if((e|0)==1){break ca}ha:{ia:{ja:{e=J[f+100>>2];switch(J[f+104>>2]-e>>5){case 0:break ha;case 1:break ia;default:break ja}}J[5996]=0;ga(44,4146,1900,811,2386);a=J[5996];J[5996]=0;if((a|0)!=1){break d}break V}J[5996]=0;aa(55,f+132|0,e|0);e=J[5996];J[5996]=0;if((e|0)==1){break V}i=0;m=O[J[f+136>>2]-8>>3]-O[J[f+84>>2]-8>>3];if(!(m>l)){break ha}k=h;l=m;}g=J[f+100>>2];if(g){e=g;d=J[f+104>>2];if((e|0)!=(d|0)){while(1){d=d-32|0;e=J[d+4>>2];ka:{if(!e){break ka}j=J[e+4>>2];J[e+4>>2]=j-1;if(j){break ka}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(g|0)){continue}break}e=J[f+100>>2];}J[f+104>>2]=g;$a(e);}g=J[f+120>>2];}if(g){e=g;d=J[f+124>>2];if((e|0)!=(d|0)){while(1){d=d-32|0;e=J[d+4>>2];la:{if(!e){break la}j=J[e+4>>2];J[e+4>>2]=j-1;if(j){break la}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(g|0)){continue}break}e=J[f+120>>2];}J[f+124>>2]=g;$a(e);}if(i){break W}h=h+1|0;g=J[a+8>>2];e=J[a+4>>2];if(h>>>0>=g-e>>2>>>0){break ba}continue}break}d=Z()|0;break U}d=J[f+80>>2];}J[5996]=0;c=$(3,4)|0;h=J[5996];J[5996]=0;if((h|0)==1){break Z}J[c>>2]=d+(k<<5);d=c+4|0;J[f+128>>2]=d;J[f+124>>2]=d;J[f+120>>2]=c;if((e|0)!=(g|0)){h=0;while(1){ma:{if((h|0)==(k|0)){break ma}c=J[f+132>>2]+(h<<5)|0;i=J[f+128>>2];if(i>>>0>d>>>0){J[d>>2]=c;d=d+4|0;J[f+124>>2]=d;break ma}na:{oa:{g=J[f+120>>2];o=d-g>>2;e=o+1|0;pa:{if(e>>>0>=1073741824){J[5996]=0;ca(56);break pa}i=i-g|0;j=i>>1;i=i>>>0>=2147483644?1073741823:e>>>0<j>>>0?j:e;if(!i){j=0;break na}if(i>>>0<1073741824){break oa}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break d}d=Z()|0;break X}J[5996]=0;j=$(3,i<<2)|0;e=J[5996];J[5996]=0;if((e|0)==1){break Y}}e=(o<<2)+j|0;J[e>>2]=c;c=e+4|0;if((d|0)!=(g|0)){while(1){e=e-4|0;d=d-4|0;J[e>>2]=J[d>>2];if((d|0)!=(g|0)){continue}break}d=J[f+120>>2];}J[f+128>>2]=(i<<2)+j;J[f+124>>2]=c;J[f+120>>2]=e;if(d){$a(d);}d=c;}h=h+1|0;if(h>>>0<J[a+8>>2]-J[a+4>>2]>>2>>>0){continue}break}}l=O[a+48>>3];J[5996]=0;Ea(53,b|0,24,f+120|0,+l,a+40|0);a=J[5996];J[5996]=0;if((a|0)!=1){a=J[f+120>>2];if(!a){break W}$a(a);break W}d=Z()|0;g=J[f+120>>2];break X}d=Z()|0;break T}d=Z()|0;break U}d=Z()|0;break T}d=Z()|0;}if(!g){break T}$a(g);break T}a=J[f+132>>2];if(a){d=J[f+136>>2];if((a|0)!=(d|0)){while(1){d=d-32|0;b=J[d+4>>2];qa:{if(!b){break qa}c=J[b+4>>2];J[b+4>>2]=c-1;if(c){break qa}Xa[J[J[b>>2]+8>>2]](b);bb(b);}if((a|0)!=(d|0)){continue}break}a=J[f+132>>2];}$a(a);}a=J[f+80>>2];if(a){d=J[f+84>>2];if((a|0)!=(d|0)){while(1){d=d-32|0;b=J[d+4>>2];ra:{if(!b){break ra}c=J[b+4>>2];J[b+4>>2]=c-1;if(c){break ra}Xa[J[J[b>>2]+8>>2]](b);bb(b);}if((a|0)!=(d|0)){continue}break}a=J[f+80>>2];}$a(a);}a=J[f+68>>2];if(a){J[f+72>>2]=a;$a(a);}a=J[f+56>>2];if(!a){break g}J[f+60>>2]=a;$a(a);break g}d=Z()|0;_b(f+100|0);}_b(f+120|0);}_b(f+132|0);_b(f+80|0);break c}e=J[a+4>>2];d=J[e+4>>2];g=J[e>>2];h=J[e+8>>2];e=cb(12);J[f+56>>2]=e;k=e+12|0;J[f+64>>2]=k;J[e+8>>2]=h;J[e+4>>2]=g;J[e>>2]=d;J[f+60>>2]=k;l=O[a+48>>3];J[5996]=0;ja(57,b|0,c|0,23,a+4|0,+l,0);a=J[5996];J[5996]=0;sa:{if((a|0)==1){break sa}J[5996]=0;ja(57,b|0,c|0,23,f+56|0,+l,0);a=J[5996];J[5996]=0;if((a|0)==1){break sa}$a(e);break g}break a}e=J[a+4>>2];d=J[e>>2];g=J[e+4>>2];e=cb(8);J[f+56>>2]=e;h=e+8|0;J[f+64>>2]=h;J[e>>2]=go(d,g,32);J[e+4>>2]=Wa;J[f+60>>2]=h;d=a+4|0;m=O[a+48>>3];p=1-m;ta:{if(l==0){J[5996]=0;ja(57,b|0,c|0,20,d|0,+m,0);a=J[5996];J[5996]=0;if((a|0)==1){break ta}J[5996]=0;ja(57,b|0,c|0,20,f+56|0,+p,0);a=J[5996];J[5996]=0;if((a|0)==1){break ta}}J[5996]=0;ja(57,b|0,c|0,19,d|0,+m,0);a=J[5996];J[5996]=0;if((a|0)==1){break ta}J[5996]=0;a=f+56|0;ja(57,b|0,c|0,19,a|0,+p,0);g=J[5996];J[5996]=0;if((g|0)==1){break ta}J[5996]=0;ja(57,b|0,c|0,21,d|0,+m,0);g=J[5996];J[5996]=0;if((g|0)==1){break ta}J[5996]=0;ja(57,b|0,c|0,21,a|0,+p,0);g=J[5996];J[5996]=0;if((g|0)==1){break ta}J[5996]=0;ja(57,b|0,c|0,22,d|0,+m,0);g=J[5996];J[5996]=0;if((g|0)==1){break ta}J[5996]=0;ja(57,b|0,c|0,22,a|0,+p,0);g=J[5996];J[5996]=0;if((g|0)==1){break ta}J[5996]=0;ja(57,b|0,c|0,22,d|0,+m,1);d=J[5996];J[5996]=0;if((d|0)==1){break ta}J[5996]=0;ja(57,b|0,c|0,22,a|0,+p,1);a=J[5996];J[5996]=0;if((a|0)==1){break ta}$a(e);break g}break a}e=J[a+4>>2];d=J[e>>2];g=J[e+4>>2];e=cb(8);J[f+56>>2]=e;h=e+8|0;J[f+64>>2]=h;J[e>>2]=go(d,g,32);J[e+4>>2]=Wa;J[f+60>>2]=h;a=a+4|0;ua:{if(l==0){J[5996]=0;ja(57,b|0,c|0,17,a|0,0,0);d=J[5996];J[5996]=0;if((d|0)==1){break ua}J[5996]=0;ja(57,b|0,c|0,17,f+56|0,0,0);d=J[5996];J[5996]=0;if((d|0)==1){break ua}}J[5996]=0;ja(57,b|0,c|0,18,a|0,0,0);a=J[5996];J[5996]=0;if((a|0)==1){break ua}J[5996]=0;ja(57,b|0,c|0,18,f+56|0,0,0);a=J[5996];J[5996]=0;if((a|0)==1){break ua}$a(e);break g}break a}hc(b,c,14,a+4|0,0,0);break g}hc(b,c,15,a+4|0,0,0);break g}hc(b,c,16,a+4|0,0,0);break g}hc(b,c,13,a+4|0,0,0);break g}hc(b,c,12,a+4|0,0,0);break g}a=a+4|0;hc(b,c,10,a,0,0);hc(b,c,11,a,0,0);break g}e=J[a+40>>2];k=J[a+44>>2];if(!K[24588]){J[6145]=0;J[6146]=0;J[6143]=0;J[6144]=0;J[6141]=0;J[6142]=0;H[24588]=1;}n=Yg(f+56|0);J[5996]=0;d=$(46,25)|0;g=J[5996];J[5996]=0;va:{wa:{if((g|0)!=1){J[f+52>>2]=0;J[f+44>>2]=0;J[f+48>>2]=0;H[f+84|0]=0;J[f+80>>2]=f+44;g=J[d+4>>2];i=J[d>>2];j=g-i|0;h=(j|0)/12|0;if((g|0)!=(i|0)){if(h>>>0>=357913942){J[5996]=0;ca(47);a=J[5996];J[5996]=0;if((a|0)!=1){break d}break wa}J[5996]=0;g=$(3,j|0)|0;i=J[5996];J[5996]=0;if((i|0)==1){break wa}J[f+48>>2]=g;J[f+44>>2]=g;J[f+52>>2]=g+P(h,12);h=J[d+4>>2];d=J[d>>2];J[5996]=0;d=ia(48,f+52|0,d|0,h|0,g|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){d=Z()|0;J[f+48>>2]=g;break va}J[f+48>>2]=d;}J[f+40>>2]=0;J[f+32>>2]=0;J[f+36>>2]=0;d=J[a+8>>2];g=J[a+4>>2];J[5996]=0;aa(49,f+32|0,d-g>>2);d=J[5996];J[5996]=0;xa:{if((d|0)!=1){ya:{za:{d=J[f+48>>2];g=J[f+44>>2];if((d|0)!=(g|0)){u=a+16|0;l=+(e>>>0)+ +(k|0)*4294967296;m=l+1;l=l*73+1;d=g;while(1){J[f+28>>2]=0;J[f+20>>2]=0;J[f+24>>2]=0;g=J[a+8>>2];e=J[a+4>>2];q=P(s,12);d=q+d|0;if(g-e>>2!=J[d+4>>2]-J[d>>2]>>3){break za}h=0;o=1;j=0;Aa:{if((e|0)!=(g|0)){Ba:{Ca:{Da:{while(1){d=j<<3;p=O[d+J[n+12>>2]>>3];v=O[d+J[n>>2]>>3];e=J[(j<<2)+e>>2];J[5996]=0;e=qa(50,e|0,+v,+p,c|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break Ca}d=d+J[q+J[f+44>>2]>>2]|0;g=J[d>>2];d=J[d+4>>2];k=J[e+4>>2];e=J[e>>2];J[5996]=0;oa(51,f+80|0,e|0,k|0,g|0,d|0);e=J[5996];J[5996]=0;if((e|0)!=1){g=J[f+28>>2];Ea:{if(g>>>0>h>>>0){J[h+8>>2]=0;J[h>>2]=0;J[h+4>>2]=0;J[h>>2]=J[f+80>>2];J[h+4>>2]=J[f+84>>2];J[h+8>>2]=J[f+88>>2];J[f+24>>2]=h+12;break Ea}Fa:{e=J[f+20>>2];k=(h-e|0)/12|0;d=k+1|0;Ga:{if(d>>>0>=357913942){J[5996]=0;ca(52);break Ga}g=(g-e|0)/12|0;i=g<<1;d=g>>>0>=178956970?357913941:d>>>0<i>>>0?i:d;if(d>>>0<357913942){break Fa}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break d}break Da}J[5996]=0;i=P(d,12);g=$(3,i|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break Da}d=g+P(k,12)|0;J[d>>2]=J[f+80>>2];J[d+4>>2]=J[f+84>>2];J[d+8>>2]=J[f+88>>2];J[f+88>>2]=0;J[f+80>>2]=0;J[f+84>>2]=0;g=g+i|0;k=d+12|0;Ha:{if((e|0)==(h|0)){J[f+28>>2]=g;J[f+24>>2]=k;J[f+20>>2]=d;break Ha}while(1){d=d-12|0;h=h-12|0;J[d>>2]=J[h>>2];J[d+4>>2]=J[h+4>>2];J[d+8>>2]=J[h+8>>2];J[h+8>>2]=0;J[h>>2]=0;J[h+4>>2]=0;if((e|0)!=(h|0)){continue}break}J[f+28>>2]=g;e=J[f+24>>2];J[f+24>>2]=k;h=J[f+20>>2];J[f+20>>2]=d;if((e|0)==(h|0)){break Ha}while(1){i=e-12|0;k=J[i>>2];if(k){r=e-8|0;d=J[r>>2];g=k;if((d|0)!=(g|0)){while(1){d=d-32|0;e=J[d+4>>2];Ia:{if(!e){break Ia}g=J[e+4>>2];J[e+4>>2]=g-1;if(g){break Ia}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(k|0)){continue}break}g=J[i>>2];}J[r>>2]=k;$a(g);}e=i;if((h|0)!=(e|0)){continue}break}}if(h){$a(h);}g=J[f+80>>2];if(!g){break Ea}e=g;d=J[f+84>>2];if((e|0)!=(d|0)){while(1){d=d-32|0;e=J[d+4>>2];Ja:{if(!e){break Ja}h=J[e+4>>2];J[e+4>>2]=h-1;if(h){break Ja}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(g|0)){continue}break}e=J[f+80>>2];}J[f+84>>2]=g;$a(e);}h=J[f+24>>2];e=h-12|0;o=P(J[e+4>>2]-J[e>>2]>>5,o);j=j+1|0;e=J[a+4>>2];if(j>>>0>=J[a+8>>2]-e>>2>>>0){break Ba}continue}break}d=Z()|0;break ya}d=Z()|0;_b(f+80|0);break ya}d=Z()|0;break ya}if(!o){break Aa}}k=0;Ka:{La:{Ma:{Na:{while(1){h=J[f+32>>2];if(J[a+8>>2]!=J[a+4>>2]){d=0;g=J[f+20>>2];e=k;while(1){i=P(d,12);j=i+g|0;g=J[j>>2];J[(d<<2)+h>>2]=g+((e>>>0)%(J[j+4>>2]-g>>5>>>0)<<5);j=e;g=J[f+20>>2];e=i+g|0;e=(j>>>0)/(J[e+4>>2]-J[e>>2]>>5>>>0)|0;d=d+1|0;if(d>>>0<J[a+8>>2]-J[a+4>>2]>>2>>>0){continue}break}}J[f+108>>2]=0;J[f+100>>2]=0;J[f+104>>2]=0;Oa:{Pa:{q=J[f+36>>2];if((q|0)!=(h|0)){while(1){i=J[h>>2];d=J[f+104>>2];Qa:{if((d|0)!=J[f+108>>2]){J[d>>2]=J[i>>2];e=J[i+4>>2];J[d+4>>2]=e;if(e){J[e+4>>2]=J[e+4>>2]+1;}J[f+104>>2]=d+8;break Qa}Ra:{g=J[f+100>>2];e=d-g|0;r=e>>3;j=r+1|0;Sa:{if(j>>>0>=536870912){J[5996]=0;ca(59);break Sa}t=e>>2;e=e>>>0>=2147483640?536870911:j>>>0<t>>>0?t:j;if(e>>>0<536870912){break Ra}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break d}d=Z()|0;break Ka}J[5996]=0;t=e<<3;j=$(3,t|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break Pa}e=j+(r<<3)|0;J[e>>2]=J[i>>2];i=J[i+4>>2];J[e+4>>2]=i;if(i){J[i+4>>2]=J[i+4>>2]+1;d=J[f+104>>2];}i=j+t|0;j=e+8|0;Ta:{if((d|0)==(g|0)){J[f+108>>2]=i;J[f+104>>2]=j;J[f+100>>2]=e;break Ta}while(1){e=e-8|0;d=d-8|0;J[e>>2]=J[d>>2];J[e+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;if((d|0)!=(g|0)){continue}break}J[f+108>>2]=i;d=J[f+104>>2];J[f+104>>2]=j;g=J[f+100>>2];J[f+100>>2]=e;if((d|0)==(g|0)){break Ta}while(1){d=d-8|0;e=J[d+4>>2];Ua:{if(!e){break Ua}i=J[e+4>>2];J[e+4>>2]=i-1;if(i){break Ua}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(g|0)){continue}break}}if(!g){break Qa}$a(g);}h=h+4|0;if((q|0)!=(h|0)){continue}break}}O[f+88>>3]=m;O[f+80>>3]=l;J[5996]=0;h=$(3,104)|0;e=J[5996];J[5996]=0;if((e|0)!=1){break Oa}break La}d=Z()|0;break Ka}J[h>>2]=7e3;J[h+4>>2]=0;J[h+8>>2]=0;J[5996]=0;J[f+132>>2]=J[f+100>>2];e=J[f+104>>2];d=J[f+108>>2];J[f+108>>2]=0;J[f+136>>2]=e;J[f+140>>2]=d;J[f+100>>2]=0;J[f+104>>2]=0;i=_(32,f+120|0,u|0)|0;e=J[5996];J[5996]=0;if((e|0)!=1){e=J[a+40>>2];J[5996]=0;j=xa(60,h+12|0,25,f+132|0,i|0,e|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break Na}g=J[i>>2];if(g){e=J[f+124>>2];d=g;if((e|0)!=(d|0)){while(1){d=e-12|0;if(H[e-1|0]<0){$a(J[d>>2]);}e=d;if((e|0)!=(g|0)){continue}break}d=J[i>>2];}J[f+124>>2]=g;$a(d);}e=J[f+132>>2];if(e){d=J[f+136>>2];if((e|0)!=(d|0)){while(1){d=d-8|0;g=J[d+4>>2];Va:{if(!g){break Va}i=J[g+4>>2];J[g+4>>2]=i-1;if(i){break Va}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((d|0)!=(e|0)){continue}break}e=J[f+132>>2];}$a(e);}J[f+116>>2]=h;J[f+112>>2]=j;J[5996]=0;e=J[f+116>>2];J[f+8>>2]=J[f+112>>2];J[f+12>>2]=e;ea(61,b|0,f+80|0,f+8|0);e=J[5996];J[5996]=0;if((e|0)==1){break La}e=J[f+100>>2];if(e){d=J[f+104>>2];if((e|0)!=(d|0)){while(1){d=d-8|0;g=J[d+4>>2];Wa:{if(!g){break Wa}h=J[g+4>>2];J[g+4>>2]=h-1;if(h){break Wa}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((d|0)!=(e|0)){continue}break}e=J[f+100>>2];}$a(e);}k=k+1|0;if((o|0)!=(k|0)){continue}break Aa}break}d=Z()|0;break Ma}d=Z()|0;rb(i);}lb(f+132|0);$a(h);break Ka}d=Z()|0;}lb(f+100|0);break ya}g=J[f+20>>2];if(g){d=J[f+24>>2];if((g|0)!=(d|0)){while(1){k=d-12|0;h=J[k>>2];if(h){e=h;i=d-8|0;d=J[i>>2];if((e|0)!=(d|0)){while(1){d=d-32|0;e=J[d+4>>2];Xa:{if(!e){break Xa}j=J[e+4>>2];J[e+4>>2]=j-1;if(j){break Xa}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((d|0)!=(h|0)){continue}break}e=J[k>>2];}J[i>>2]=h;$a(e);}d=k;if((g|0)!=(d|0)){continue}break}g=J[f+20>>2];}$a(g);}s=s+1|0;d=J[f+44>>2];if(s>>>0<(J[f+48>>2]-d|0)/12>>>0){continue}break}}a=J[f+32>>2];if(a){$a(a);d=J[f+44>>2];}if(d){e=d;g=J[f+48>>2];if((e|0)!=(g|0)){while(1){a=g-12|0;b=J[a>>2];if(b){J[g-8>>2]=b;$a(b);}g=a;if((a|0)!=(d|0)){continue}break}e=J[f+44>>2];}J[f+48>>2]=d;$a(e);}a=J[n+12>>2];if(a){J[n+16>>2]=a;$a(a);}a=J[n>>2];if(!a){break g}J[n+4>>2]=a;$a(a);break g}J[5996]=0;ga(44,5170,1900,642,2497);a=J[5996];J[5996]=0;if((a|0)!=1){break d}d=Z()|0;}Xc(f+20|0);break xa}d=Z()|0;}a=J[f+32>>2];if(a){$a(a);}Wc(f+44|0);break b}a=Z()|0;Mc(n);da(a|0);B();}d=Z()|0;}Nc(f+80|0);break b}e=a+4|0;a=a+16|0;Xg(b,c,2,e,a);Xg(b,c,3,e,a);break g}wd(b,c,6,a+4|0,a+28|0);break g}wd(b,c,8,a+4|0,a+28|0);break g}wd(b,c,7,a+4|0,a+28|0);break g}wd(b,c,9,a+4|0,a+28|0);}Ua=f+144|0;return}d=Z()|0;break c}a=J[f+132>>2];if(a){$a(a);}Wc(f+80|0);break c}B();}Mc(f+56|0);da(d|0);B();}Mc(n);da(d|0);B();}a=Z()|0;$a(e);da(a|0);B();}function ig(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0;q=Ua-48|0;Ua=q;a:{if(c>>>0<=2){c=c<<2;A=J[c+8972>>2];B=J[c+8960>>2];while(1){c=J[b+4>>2];b:{if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;c=K[c|0];break b}c=gb(b);}if((c|0)==32|c-9>>>0<5){continue}break}t=1;c:{d:{switch(c-43|0){case 0:case 2:break d;default:break c}}t=(c|0)==45?-1:1;c=J[b+4>>2];if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;c=K[c|0];break c}c=gb(b);}e:{f:{while(1){if(H[g+1031|0]==(c|32)){g:{if(g>>>0>6){break g}c=J[b+4>>2];if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;c=K[c|0];break g}c=gb(b);}g=g+1|0;if((g|0)!=8){continue}break f}break}if((g|0)!=3){m=(g|0)==8;if(m){break f}if(!d|g>>>0<4){break e}if(m){break f}}c=J[b+116>>2];if((c|0)>0|(c|0)>=0){J[b+4>>2]=J[b+4>>2]-1;}if(!d|g>>>0<4){break f}c=(c|0)<0;while(1){if(!c){J[b+4>>2]=J[b+4>>2]-1;}g=g-1|0;if(g>>>0>3){continue}break}}l=Ua-16|0;Ua=l;h=(D(Q(Q(t|0)*Q(Infinity))),v(2));b=h&2147483647;h:{if(b-8388608>>>0<=2130706431){c=b;b=b>>>7|0;c=c<<25;d=b+1065353216|0;break h}c=h<<25;d=h>>>7|2147418112;if(b>>>0>=2139095040){break h}c=0;d=0;if(!b){break h}c=b;b=S(b);Cb(l,c,0,0,0,b+81|0);j=J[l>>2];i=J[l+4>>2];c=J[l+8>>2];d=J[l+12>>2]^65536|16265-b<<16;}J[q>>2]=j;J[q+4>>2]=i;J[q+8>>2]=c;J[q+12>>2]=h&-2147483648|d;Ua=l+16|0;j=J[q+8>>2];i=J[q+12>>2];h=J[q>>2];k=J[q+4>>2];break a}i:{j:{k:{if(g){break k}g=0;while(1){if(H[g+2020|0]!=(c|32)){break k}l:{if(g>>>0>1){break l}c=J[b+4>>2];if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;c=K[c|0];break l}c=gb(b);}g=g+1|0;if((g|0)!=3){continue}break}break j}m:{switch(g|0){case 0:n:{if((c|0)!=48){break n}g=J[b+4>>2];o:{if((g|0)!=J[b+104>>2]){J[b+4>>2]=g+1;g=K[g|0];break o}g=gb(b);}if((g&-33)==88){m=0;f=Ua-432|0;Ua=f;c=J[b+4>>2];p:{if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;g=K[c|0];break p}g=gb(b);}q:{r:{while(1){if((g|0)!=48){s:{if((g|0)!=46){break q}c=J[b+4>>2];if((c|0)==J[b+104>>2]){break s}J[b+4>>2]=c+1;g=K[c|0];break r}}else {c=J[b+4>>2];if((c|0)!=J[b+104>>2]){e=1;J[b+4>>2]=c+1;g=K[c|0];}else {e=1;g=gb(b);}continue}break}g=gb(b);}p=1;if((g|0)!=48){break q}while(1){c=r;r=c-1|0;s=s-!c|0;c=J[b+4>>2];t:{if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;g=K[c|0];break t}g=gb(b);}if((g|0)==48){continue}break}e=1;}k=1073676288;u:{while(1){v:{c=g|32;w:{x:{E=g-48|0;if(E>>>0<10){break x}F=(g|0)!=46;if(F&c-97>>>0>5){break u}if(F){break x}if(p){break v}p=1;r=j;s=i;break w}c=(g|0)>57?c-87|0:E;y:{if((i|0)<=0&j>>>0<=7|(i|0)<0){m=c+(m<<4)|0;break y}if(!i&j>>>0<=28){Nb(f+48|0,c);ob(f+32|0,y,z,h,k,0,0,0,1073414144);y=J[f+32>>2];z=J[f+36>>2];h=J[f+40>>2];k=J[f+44>>2];ob(f+16|0,J[f+48>>2],J[f+52>>2],J[f+56>>2],J[f+60>>2],y,z,h,k);Hb(f,J[f+16>>2],J[f+20>>2],J[f+24>>2],J[f+28>>2],l,o,w,x);w=J[f+8>>2];x=J[f+12>>2];l=J[f>>2];o=J[f+4>>2];break y}if(C|!c){break y}ob(f+80|0,y,z,h,k,0,0,0,1073610752);Hb(f- -64|0,J[f+80>>2],J[f+84>>2],J[f+88>>2],J[f+92>>2],l,o,w,x);w=J[f+72>>2];x=J[f+76>>2];C=1;l=J[f+64>>2];o=J[f+68>>2];}j=j+1|0;i=j?i:i+1|0;e=1;}c=J[b+4>>2];if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;g=K[c|0];}else {g=gb(b);}continue}break}g=46;}z:{if(!e){c=J[b+116>>2];A:{B:{if((c|0)>0|(c|0)>=0){c=J[b+4>>2];J[b+4>>2]=c-1;if(!d){break B}J[b+4>>2]=c-2;if(!p){break A}J[b+4>>2]=c-3;break A}if(d){break A}}Yb(b,0,0);}fc(f+96|0,+(t|0)*0);l=J[f+96>>2];o=J[f+100>>2];c=J[f+108>>2];b=J[f+104>>2];break z}if((i|0)<=0&j>>>0<=7|(i|0)<0){h=j;k=i;while(1){m=m<<4;h=h+1|0;k=h?k:k+1|0;if((h|0)!=8|k){continue}break}}C:{D:{E:{if((g&-33)==80){h=hg(b,d);c=Wa;k=c;if(h|(c|0)!=-2147483648){break C}if(d){c=J[b+116>>2];if((c|0)>0|(c|0)>=0){break E}break D}l=0;o=0;Yb(b,0,0);c=0;b=0;break z}h=0;k=0;if(J[b+116>>2]<0){break C}}J[b+4>>2]=J[b+4>>2]-1;}h=0;k=0;}if(!m){fc(f+112|0,+(t|0)*0);l=J[f+112>>2];o=J[f+116>>2];c=J[f+124>>2];b=J[f+120>>2];break z}b=p?r:j;i=(p?s:i)<<2|b>>>30;c=h+(b<<2)|0;b=i+k|0;j=c-32|0;i=(c>>>0<h>>>0?b+1|0:b)-(c>>>0<32)|0;b=i;if(j>>>0>0-A>>>0&(b|0)>=0|(b|0)>0){J[5732]=68;Nb(f+160|0,t);ob(f+144|0,J[f+160>>2],J[f+164>>2],J[f+168>>2],J[f+172>>2],-1,-1,-1,2147418111);ob(f+128|0,J[f+144>>2],J[f+148>>2],J[f+152>>2],J[f+156>>2],-1,-1,-1,2147418111);l=J[f+128>>2];o=J[f+132>>2];c=J[f+140>>2];b=J[f+136>>2];break z}b=A-226|0;c=b>>31;if((i|0)>=(c|0)&b>>>0<=j>>>0|(c|0)<(i|0)){if((m|0)>=0){while(1){Hb(f+416|0,l,o,w,x,0,0,0,-1073807360);b=Rg(l,o,w,x,1073610752);c=(b|0)>=0;b=c;Hb(f+400|0,l,o,w,x,b?J[f+416>>2]:l,b?J[f+420>>2]:o,b?J[f+424>>2]:w,b?J[f+428>>2]:x);b=j;j=b-1|0;i=i-!b|0;w=J[f+408>>2];x=J[f+412>>2];l=J[f+400>>2];o=J[f+404>>2];m=c|m<<1;if((m|0)>=0){continue}break}}b=i-((A>>31)+(j>>>0<A>>>0)|0)|0;c=(j-A|0)+32|0;b=c>>>0<32?b+1|0:b;c=c>>>0<B>>>0&(b|0)<=0|(b|0)<0?(c|0)>0?c:0:B;F:{if((c|0)>=113){Nb(f+384|0,t);r=J[f+392>>2];s=J[f+396>>2];y=J[f+384>>2];z=J[f+388>>2];h=0;b=0;break F}fc(f+352|0,xe(144-c|0));Nb(f+336|0,t);y=J[f+336>>2];z=J[f+340>>2];r=J[f+344>>2];s=J[f+348>>2];kg(f+368|0,J[f+352>>2],J[f+356>>2],J[f+360>>2],J[f+364>>2],y,z,r,s);n=J[f+376>>2];u=J[f+380>>2];h=J[f+372>>2];b=J[f+368>>2];}d=!(m&1)&((yc(l,o,w,x,0,0,0,0)|0)!=0&(c|0)<32);Ec(f+320|0,d+m|0);ob(f+304|0,y,z,r,s,J[f+320>>2],J[f+324>>2],J[f+328>>2],J[f+332>>2]);c=b;Hb(f+272|0,J[f+304>>2],J[f+308>>2],J[f+312>>2],J[f+316>>2],b,h,n,u);b=d;ob(f+288|0,y,z,r,s,b?0:l,b?0:o,b?0:w,b?0:x);Hb(f+256|0,J[f+288>>2],J[f+292>>2],J[f+296>>2],J[f+300>>2],J[f+272>>2],J[f+276>>2],J[f+280>>2],J[f+284>>2]);he(f+240|0,J[f+256>>2],J[f+260>>2],J[f+264>>2],J[f+268>>2],c,h,n,u);b=J[f+240>>2];d=J[f+244>>2];c=J[f+248>>2];h=J[f+252>>2];if(!yc(b,d,c,h,0,0,0,0)){J[5732]=68;}jg(f+224|0,b,d,c,h,j);l=J[f+224>>2];o=J[f+228>>2];c=J[f+236>>2];b=J[f+232>>2];break z}J[5732]=68;Nb(f+208|0,t);ob(f+192|0,J[f+208>>2],J[f+212>>2],J[f+216>>2],J[f+220>>2],0,0,0,65536);ob(f+176|0,J[f+192>>2],J[f+196>>2],J[f+200>>2],J[f+204>>2],0,0,0,65536);l=J[f+176>>2];o=J[f+180>>2];c=J[f+188>>2];b=J[f+184>>2];}J[q+16>>2]=l;J[q+20>>2]=o;J[q+24>>2]=b;J[q+28>>2]=c;Ua=f+432|0;j=J[q+24>>2];i=J[q+28>>2];h=J[q+16>>2];k=J[q+20>>2];break a}if(J[b+116>>2]<0){break n}J[b+4>>2]=J[b+4>>2]-1;}g=b;m=c;f=d;d=0;e=Ua-8976|0;Ua=e;F=0-A|0;E=F-B|0;G:{H:{while(1){if((m|0)!=48){I:{if((m|0)!=46){break G}b=J[g+4>>2];if((b|0)==J[g+104>>2]){break I}J[g+4>>2]=b+1;m=K[b|0];break H}}else {b=J[g+4>>2];if((b|0)!=J[g+104>>2]){J[g+4>>2]=b+1;m=K[b|0];}else {m=gb(g);}d=1;continue}break}m=gb(g);}C=1;if((m|0)!=48){break G}while(1){b=j;j=b-1|0;i=i-!b|0;b=J[g+4>>2];J:{if((b|0)!=J[g+104>>2]){J[g+4>>2]=b+1;m=K[b|0];break J}m=gb(g);}if((m|0)==48){continue}break}d=1;}J[e+784>>2]=0;K:{L:{b=(m|0)==46;c=m-48|0;M:{N:{O:{if(b|c>>>0<=9){while(1){P:{if(b&1){if(!C){j=h;i=k;C=1;break P}b=!d;break O}h=h+1|0;k=h?k:k+1|0;if((p|0)<=2044){u=(m|0)==48?u:h;b=(e+784|0)+(p<<2)|0;if(n){c=(P(J[b>>2],10)+m|0)-48|0;}J[b>>2]=c;d=1;c=n+1|0;b=(c|0)==9;n=b?0:c;p=b+p|0;break P}if((m|0)==48){break P}J[e+8960>>2]=J[e+8960>>2]|1;u=18396;}b=J[g+4>>2];Q:{if((b|0)!=J[g+104>>2]){J[g+4>>2]=b+1;m=K[b|0];break Q}m=gb(g);}b=(m|0)==46;c=m-48|0;if(b|c>>>0<10){continue}break}}j=C?j:h;i=C?i:k;if(!(!d|(m&-33)!=69)){l=hg(g,f);b=Wa;o=b;R:{if(l|(b|0)!=-2147483648){break R}if(!f){break M}l=0;o=0;if(J[g+116>>2]<0){break R}J[g+4>>2]=J[g+4>>2]-1;}i=i+o|0;j=j+l|0;i=j>>>0<l>>>0?i+1|0:i;break L}b=!d;if((m|0)<0){break N}}if(J[g+116>>2]<0){break N}J[g+4>>2]=J[g+4>>2]-1;}if(!b){break L}J[5732]=28;}h=0;k=0;Yb(g,0,0);c=0;b=0;break K}b=J[e+784>>2];if(!b){fc(e,+(t|0)*0);h=J[e>>2];k=J[e+4>>2];c=J[e+12>>2];b=J[e+8>>2];break K}if(!(h>>>0>9&(k|0)>=0|(k|0)>0|((h|0)!=(j|0)|(i|0)!=(k|0))|(b>>>B|0?(B|0)<=30:0))){Nb(e+48|0,t);Ec(e+32|0,b);ob(e+16|0,J[e+48>>2],J[e+52>>2],J[e+56>>2],J[e+60>>2],J[e+32>>2],J[e+36>>2],J[e+40>>2],J[e+44>>2]);h=J[e+16>>2];k=J[e+20>>2];c=J[e+28>>2];b=J[e+24>>2];break K}if(j>>>0>F>>>1>>>0&(i|0)>=0|(i|0)>0){J[5732]=68;Nb(e+96|0,t);ob(e+80|0,J[e+96>>2],J[e+100>>2],J[e+104>>2],J[e+108>>2],-1,-1,-1,2147418111);ob(e- -64|0,J[e+80>>2],J[e+84>>2],J[e+88>>2],J[e+92>>2],-1,-1,-1,2147418111);h=J[e+64>>2];k=J[e+68>>2];c=J[e+76>>2];b=J[e+72>>2];break K}b=A-226|0;c=j>>>0<b>>>0;b=b>>31;if(c&(i|0)<=(b|0)|(b|0)>(i|0)){J[5732]=68;Nb(e+144|0,t);ob(e+128|0,J[e+144>>2],J[e+148>>2],J[e+152>>2],J[e+156>>2],0,0,0,65536);ob(e+112|0,J[e+128>>2],J[e+132>>2],J[e+136>>2],J[e+140>>2],0,0,0,65536);h=J[e+112>>2];k=J[e+116>>2];c=J[e+124>>2];b=J[e+120>>2];break K}if(n){if((n|0)<=8){b=(e+784|0)+(p<<2)|0;g=J[b>>2];while(1){g=P(g,10);n=n+1|0;if((n|0)!=9){continue}break}J[b>>2]=g;}p=p+1|0;}n=j;S:{if((j|0)<(u|0)|(u|0)>=9|(j|0)>17){break S}if((j|0)==9){Nb(e+192|0,t);Ec(e+176|0,J[e+784>>2]);ob(e+160|0,J[e+192>>2],J[e+196>>2],J[e+200>>2],J[e+204>>2],J[e+176>>2],J[e+180>>2],J[e+184>>2],J[e+188>>2]);h=J[e+160>>2];k=J[e+164>>2];c=J[e+172>>2];b=J[e+168>>2];break K}if((n|0)<=8){Nb(e+272|0,t);Ec(e+256|0,J[e+784>>2]);ob(e+240|0,J[e+272>>2],J[e+276>>2],J[e+280>>2],J[e+284>>2],J[e+256>>2],J[e+260>>2],J[e+264>>2],J[e+268>>2]);Nb(e+224|0,J[(0-n<<2)+8960>>2]);Ng(e+208|0,J[e+240>>2],J[e+244>>2],J[e+248>>2],J[e+252>>2],J[e+224>>2],J[e+228>>2],J[e+232>>2],J[e+236>>2]);h=J[e+208>>2];k=J[e+212>>2];c=J[e+220>>2];b=J[e+216>>2];break K}b=(P(n,-3)+B|0)+27|0;c=J[e+784>>2];if(c>>>b|0?(b|0)<=30:0){break S}Nb(e+352|0,t);Ec(e+336|0,c);ob(e+320|0,J[e+352>>2],J[e+356>>2],J[e+360>>2],J[e+364>>2],J[e+336>>2],J[e+340>>2],J[e+344>>2],J[e+348>>2]);Nb(e+304|0,J[(n<<2)+8888>>2]);ob(e+288|0,J[e+320>>2],J[e+324>>2],J[e+328>>2],J[e+332>>2],J[e+304>>2],J[e+308>>2],J[e+312>>2],J[e+316>>2]);h=J[e+288>>2];k=J[e+292>>2];c=J[e+300>>2];b=J[e+296>>2];break K}while(1){b=p;p=b-1|0;if(!J[(e+784|0)+(p<<2)>>2]){continue}break}u=0;d=(n|0)%9|0;T:{if(!d){c=0;break T}c=0;d=(n|0)<0?d+9|0:d;U:{if(!b){b=0;break U}j=J[(0-d<<2)+8960>>2];l=1e9/(j|0)|0;m=0;g=0;while(1){h=m;i=e+784|0;k=i+(g<<2)|0;m=J[k>>2];p=(m>>>0)/(j>>>0)|0;h=h+p|0;J[k>>2]=h;h=!h&(c|0)==(g|0);c=h?c+1&2047:c;n=h?n-9|0:n;m=P(l,m-P(j,p)|0);g=g+1|0;if((g|0)!=(b|0)){continue}break}if(!m){break U}J[i+(b<<2)>>2]=m;b=b+1|0;}n=(n-d|0)+9|0;}while(1){g=(e+784|0)+(c<<2)|0;V:{while(1){W:{if((n|0)<36){break W}if((n|0)!=36){break V}if(M[g>>2]<=10384592){break W}n=36;break V}p=b+2047|0;d=0;while(1){h=b;l=p&2047;m=(e+784|0)+(l<<2)|0;b=J[m>>2];k=b>>>3|0;j=d;d=b<<29;j=j+d|0;b=k;i=d>>>0>j>>>0?b+1|0:b;if(!i&j>>>0<1000000001){d=0;}else {d=eo(j,i,1e9);b=co(d,Wa,-1e9,-1);j=b+j|0;}J[m>>2]=j;b=(c|0)==(l|0)?h:j?h:l;j=h-1&2047;b=(j|0)!=(l|0)?h:b;p=l-1|0;if((c|0)!=(l|0)){continue}break}u=u-29|0;b=h;if(!d){continue}break}c=c-1&2047;if((c|0)==(b|0)){g=(b+2046&2047)<<2;b=e+784|0;h=g+b|0;J[h>>2]=J[h>>2]|J[b+(j<<2)>>2];b=j;}n=n+9|0;J[(e+784|0)+(c<<2)>>2]=d;continue}break}X:{Y:while(1){j=b+1&2047;l=(e+784|0)+((b-1&2047)<<2)|0;while(1){h=(n|0)>45?9:1;Z:{while(1){d=c;g=0;_:{while(1){$:{c=d+g&2047;if((c|0)==(b|0)){break $}c=J[(e+784|0)+(c<<2)>>2];i=J[(g<<2)+8912>>2];if(c>>>0<i>>>0){break $}if(c>>>0>i>>>0){break _}g=g+1|0;if((g|0)!=4){continue}}break}if((n|0)!=36){break _}g=0;j=0;i=0;h=0;k=0;while(1){c=d+g&2047;if((c|0)==(b|0)){b=b+1&2047;J[(e+(b<<2)|0)+780>>2]=0;}Ec(e+768|0,J[(e+784|0)+(c<<2)>>2]);ob(e+752|0,j,i,h,k,0,0,1342177280,1075633366);Hb(e+736|0,J[e+752>>2],J[e+756>>2],J[e+760>>2],J[e+764>>2],J[e+768>>2],J[e+772>>2],J[e+776>>2],J[e+780>>2]);h=J[e+744>>2];k=J[e+748>>2];j=J[e+736>>2];i=J[e+740>>2];g=g+1|0;if((g|0)!=4){continue}break}Nb(e+720|0,t);ob(e+704|0,j,i,h,k,J[e+720>>2],J[e+724>>2],J[e+728>>2],J[e+732>>2]);h=J[e+712>>2];k=J[e+716>>2];j=0;i=0;l=J[e+704>>2];o=J[e+708>>2];p=u+113|0;g=p-A|0;m=(g|0)<(B|0);c=m?(g|0)>0?g:0:B;if((c|0)<=112){break Z}break X}u=h+u|0;c=b;if((b|0)==(d|0)){continue}break}k=1e9>>>h|0;m=-1<<h^-1;g=0;c=d;while(1){i=g;p=e+784|0;g=p+(d<<2)|0;f=J[g>>2];i=i+(f>>>h|0)|0;J[g>>2]=i;i=!i&(c|0)==(d|0);c=i?c+1&2047:c;n=i?n-9|0:n;g=P(k,f&m);d=d+1&2047;if((d|0)!=(b|0)){continue}break}if(!g){continue}if((c|0)!=(j|0)){J[p+(b<<2)>>2]=g;b=j;continue Y}J[l>>2]=J[l>>2]|1;continue}break}break}fc(e+656|0,xe(225-c|0));kg(e+688|0,J[e+656>>2],J[e+660>>2],J[e+664>>2],J[e+668>>2],l,o,h,k);y=J[e+696>>2];z=J[e+700>>2];w=J[e+688>>2];x=J[e+692>>2];fc(e+640|0,xe(113-c|0));Hg(e+672|0,l,o,h,k,J[e+640>>2],J[e+644>>2],J[e+648>>2],J[e+652>>2]);j=J[e+672>>2];i=J[e+676>>2];r=J[e+680>>2];s=J[e+684>>2];he(e+624|0,l,o,h,k,j,i,r,s);Hb(e+608|0,w,x,y,z,J[e+624>>2],J[e+628>>2],J[e+632>>2],J[e+636>>2]);h=J[e+616>>2];k=J[e+620>>2];l=J[e+608>>2];o=J[e+612>>2];}n=d+4&2047;aa:{if((n|0)==(b|0)){break aa}n=J[(e+784|0)+(n<<2)>>2];ba:{if(n>>>0<=499999999){if(!n&(d+5&2047)==(b|0)){break ba}fc(e+496|0,+(t|0)*.25);Hb(e+480|0,j,i,r,s,J[e+496>>2],J[e+500>>2],J[e+504>>2],J[e+508>>2]);r=J[e+488>>2];s=J[e+492>>2];j=J[e+480>>2];i=J[e+484>>2];break ba}if((n|0)!=5e8){fc(e+592|0,+(t|0)*.75);Hb(e+576|0,j,i,r,s,J[e+592>>2],J[e+596>>2],J[e+600>>2],J[e+604>>2]);r=J[e+584>>2];s=J[e+588>>2];j=J[e+576>>2];i=J[e+580>>2];break ba}G=+(t|0);if((d+5&2047)==(b|0)){fc(e+528|0,G*.5);Hb(e+512|0,j,i,r,s,J[e+528>>2],J[e+532>>2],J[e+536>>2],J[e+540>>2]);r=J[e+520>>2];s=J[e+524>>2];j=J[e+512>>2];i=J[e+516>>2];break ba}fc(e+560|0,G*.75);Hb(e+544|0,j,i,r,s,J[e+560>>2],J[e+564>>2],J[e+568>>2],J[e+572>>2]);r=J[e+552>>2];s=J[e+556>>2];j=J[e+544>>2];i=J[e+548>>2];}if((c|0)>111){break aa}Hg(e+464|0,j,i,r,s,0,0,0,1073676288);if(yc(J[e+464>>2],J[e+468>>2],J[e+472>>2],J[e+476>>2],0,0,0,0)){break aa}Hb(e+448|0,j,i,r,s,0,0,0,1073676288);r=J[e+456>>2];s=J[e+460>>2];j=J[e+448>>2];i=J[e+452>>2];}Hb(e+432|0,l,o,h,k,j,i,r,s);he(e+416|0,J[e+432>>2],J[e+436>>2],J[e+440>>2],J[e+444>>2],w,x,y,z);h=J[e+424>>2];k=J[e+428>>2];l=J[e+416>>2];o=J[e+420>>2];ca:{if((E-2|0)>=(p&2147483647)){break ca}J[e+408>>2]=h;J[e+412>>2]=k&2147483647;J[e+400>>2]=l;J[e+404>>2]=o;ob(e+384|0,l,o,h,k,0,0,0,1073610752);d=Rg(J[e+400>>2],J[e+404>>2],J[e+408>>2],J[e+412>>2],1081081856);b=(d|0)>=0;h=b?J[e+392>>2]:h;k=b?J[e+396>>2]:k;l=b?J[e+384>>2]:l;o=b?J[e+388>>2]:o;u=b+u|0;if(!(m&((c|0)!=(g|0)|(d|0)<0)&(yc(j,i,r,s,0,0,0,0)|0)!=0)&(u+110|0)<=(E|0)){break ca}J[5732]=68;}jg(e+368|0,l,o,h,k,u);h=J[e+368>>2];k=J[e+372>>2];c=J[e+380>>2];b=J[e+376>>2];}J[q+40>>2]=b;J[q+44>>2]=c;J[q+32>>2]=h;J[q+36>>2]=k;Ua=e+8976|0;j=J[q+40>>2];i=J[q+44>>2];h=J[q+32>>2];k=J[q+36>>2];break a;case 3:break j;default:break m}}c=J[b+116>>2];if((c|0)>0|(c|0)>=0){J[b+4>>2]=J[b+4>>2]-1;}break i}da:{c=J[b+4>>2];ea:{if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;c=K[c|0];break ea}c=gb(b);}if((c|0)==40){g=1;break da}i=2147450880;if(J[b+116>>2]<0){break a}J[b+4>>2]=J[b+4>>2]-1;break a}while(1){fa:{c=J[b+4>>2];ga:{if((c|0)!=J[b+104>>2]){J[b+4>>2]=c+1;c=K[c|0];break ga}c=gb(b);}if(!(c-48>>>0<10|c-65>>>0<26|(c|0)==95)){if(c-97>>>0>=26){break fa}}g=g+1|0;continue}break}i=2147450880;if((c|0)==41){break a}c=J[b+116>>2];if((c|0)>0|(c|0)>=0){J[b+4>>2]=J[b+4>>2]-1;}ha:{if(d){if(g){break ha}break a}break i}while(1){if((c|0)>0|(c|0)>=0){J[b+4>>2]=J[b+4>>2]-1;}g=g-1|0;if(g){continue}break}break a}J[5732]=28;Yb(b,0,0);}i=0;}J[a>>2]=h;J[a+4>>2]=k;J[a+8>>2]=j;J[a+12>>2]=i;Ua=q+48|0;}function Bd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;c=Ua-112|0;Ua=c;f=J[b>>2];e=f;i=J[b+4>>2];a:{if(!i){break a}d=f+i|0;while(1){g=K[e|0];b:{if(!((g|0)!=123&(g|0)!=40)){h=h+1|0;break b}if(h){if((g|0)!=125&(g|0)!=41){break b}h=h-1|0;break b}h=0;c:{switch(g-41|0){case 0:case 3:break a;case 1:case 2:break b;default:break c}}if((g|0)==125){break a}}e=e+1|0;if((d|0)!=(e|0)){continue}break}e=d;}J[c+104>>2]=f;d=e-f|0;J[c+108>>2]=d;J[b+4>>2]=i-d;J[b>>2]=e;H[c+18|0]=0;I[c+16>>1]=27504;H[c+27|0]=2;d:{e:{f:{g:{h:{i:{j:{k:{if(K[f+2|0]!=40|d>>>0<4|(K[(d+f|0)-1|0]!=41|K[c+16|0]!=K[f|0])){break k}if(K[c+17|0]!=K[f+1|0]){break k}b=d-4|0;J[c+108>>2]=b;d=f+3|0;J[c+104>>2]=d;if(!(!b|(b|0)>17)){if(b>>>0>=2147483632){break g}l:{if(b>>>0<=10){H[c+27|0]=b;h=c+16|0;break l}e=(b|15)+1|0;h=cb(e);J[c+24>>2]=e|-2147483648;J[c+16>>2]=h;J[c+20>>2]=b;}H[fb(h,d,b)+b|0]=0;J[c+88>>2]=J[c+20>>2];b=K[c+23|0]|K[c+24|0]<<8|(K[c+25|0]<<16|K[c+26|0]<<24);H[c+91|0]=b;H[c+92|0]=b>>>8;H[c+93|0]=b>>>16;H[c+94|0]=b>>>24;J[5996]=0;d=J[c+16>>2];f=H[c+27|0];J[c+24>>2]=0;J[c+16>>2]=0;J[c+20>>2]=0;b=$(3,12)|0;e=J[5996];J[5996]=0;if((e|0)!=1){J[b>>2]=d;J[b+4>>2]=J[c+88>>2];d=K[c+91|0]|K[c+92|0]<<8|(K[c+93|0]<<16|K[c+94|0]<<24);H[b+7|0]=d;H[b+8|0]=d>>>8;H[b+9|0]=d>>>16;H[b+10|0]=d>>>24;H[b+11|0]=f;J[a+4>>2]=0;J[a+8>>2]=0;J[a>>2]=1;J[a+12>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+24>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;d=b+12|0;J[a+36>>2]=d;J[a+32>>2]=d;J[a+28>>2]=b;J[a+48>>2]=0;J[a+52>>2]=0;break h}e=Z()|0;rb(c+16|0);if((f|0)>=0){break j}$a(d);da(e|0);B();}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break h}H[c+21|0]=0;H[c+20|0]=K[1777];H[c+27|0]=5;J[c+16>>2]=K[1773]|K[1774]<<8|(K[1775]<<16|K[1776]<<24);m:{b=d>>>0<7;if(b|K[f+5|0]!=40|(K[(d+f|0)-1|0]!=41|K[c+16|0]!=K[f|0])){break m}if(K[c+17|0]!=K[f+1|0]|K[c+18|0]!=K[f+2|0]|(K[c+19|0]!=K[f+3|0]|K[c+20|0]!=K[f+4|0])){break m}g=d-7|0;J[c+108>>2]=g;d=f+6|0;J[c+104>>2]=d;if(g>>>0>=2147483632){break g}n:{o:{if(g>>>0>=11){b=(g|15)+1|0;e=cb(b);J[c+24>>2]=b|-2147483648;J[c+16>>2]=e;J[c+20>>2]=g;break o}H[c+27|0]=g;e=c+16|0;if(!g){break n}}f=g-1|0;i=g&7;p:{if(!i){b=d;break p}h=0;b=d;while(1){H[e|0]=K[b|0];e=e+1|0;b=b+1|0;h=h+1|0;if((i|0)!=(h|0)){continue}break}}if(f>>>0<7){break n}d=d+g|0;while(1){H[e|0]=K[b|0];H[e+1|0]=K[b+1|0];H[e+2|0]=K[b+2|0];H[e+3|0]=K[b+3|0];H[e+4|0]=K[b+4|0];H[e+5|0]=K[b+5|0];H[e+6|0]=K[b+6|0];H[e+7|0]=K[b+7|0];e=e+8|0;b=b+8|0;if((d|0)!=(b|0)){continue}break}}H[e|0]=0;b=jf(c+16|0,c+88|0);if(H[c+27|0]<0){$a(J[c+16>>2]);}if(!b){J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break h}b=J[c+88>>2];d=b-1|0;if(J[c+92>>2]==(!b|0)&d>>>0<=2147483646){J[a+4>>2]=0;J[a+8>>2]=0;J[a>>2]=3;J[a+52>>2]=b;J[a+12>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+48>>2]=0;break h}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break h}H[c+21|0]=0;H[c+20|0]=K[1783];H[c+27|0]=5;J[c+16>>2]=K[1779]|K[1780]<<8|(K[1781]<<16|K[1782]<<24);q:{if(K[f+5|0]!=40|b|(K[(d+f|0)-1|0]!=41|K[c+16|0]!=K[f|0])){break q}if(K[c+17|0]!=K[f+1|0]|K[c+18|0]!=K[f+2|0]|(K[c+19|0]!=K[f+3|0]|K[c+20|0]!=K[f+4|0])){break q}g=d-7|0;J[c+108>>2]=g;d=f+6|0;J[c+104>>2]=d;if(g>>>0>=2147483632){break g}r:{s:{if(g>>>0>=11){b=(g|15)+1|0;e=cb(b);J[c+24>>2]=b|-2147483648;J[c+16>>2]=e;J[c+20>>2]=g;break s}H[c+27|0]=g;e=c+16|0;if(!g){break r}}f=g-1|0;i=g&7;t:{if(!i){b=d;break t}h=0;b=d;while(1){H[e|0]=K[b|0];e=e+1|0;b=b+1|0;h=h+1|0;if((i|0)!=(h|0)){continue}break}}if(f>>>0<7){break r}d=d+g|0;while(1){H[e|0]=K[b|0];H[e+1|0]=K[b+1|0];H[e+2|0]=K[b+2|0];H[e+3|0]=K[b+3|0];H[e+4|0]=K[b+4|0];H[e+5|0]=K[b+5|0];H[e+6|0]=K[b+6|0];H[e+7|0]=K[b+7|0];e=e+8|0;b=b+8|0;if((d|0)!=(b|0)){continue}break}}H[e|0]=0;b=jf(c+16|0,c+88|0);if(H[c+27|0]<0){$a(J[c+16>>2]);}if(!b){J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break h}b=J[c+88>>2];d=b-1|0;if(J[c+92>>2]==(!b|0)&d>>>0<=2147483646){J[a+4>>2]=0;J[a+8>>2]=0;J[a>>2]=2;J[a+52>>2]=b;J[a+12>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+48>>2]=0;break h}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break h}H[c+22|0]=0;I[c+20>>1]=K[3881]|K[3882]<<8;H[c+27|0]=6;J[c+16>>2]=K[3877]|K[3878]<<8|(K[3879]<<16|K[3880]<<24);u:{if(K[f+6|0]!=40|d>>>0<8|(K[(d+f|0)-1|0]!=41|K[c+16|0]!=K[f|0])){break u}if(K[c+17|0]!=K[f+1|0]|K[c+18|0]!=K[f+2|0]|(K[c+19|0]!=K[f+3|0]|K[c+20|0]!=K[f+4|0])){break u}if(K[c+21|0]!=K[f+5|0]){break u}b=d-8|0;J[c+108>>2]=b;d=f+7|0;J[c+104>>2]=d;$c(c+16|0,d,b,32);b=J[c+20>>2];d=J[c+16>>2];if((b|0)!=(d|0)){J[a+4>>2]=0;J[a+8>>2]=0;J[a>>2]=7;J[a+16>>2]=d;J[a+12>>2]=0;J[a+20>>2]=b;b=J[c+24>>2];J[a+28>>2]=0;J[a+32>>2]=0;J[a+24>>2]=b;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;break h}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;if(!b){break h}$a(b);break h}H[c+25|0]=0;H[c+24|0]=K[4198];H[c+27|0]=9;b=K[4194]|K[4195]<<8|(K[4196]<<16|K[4197]<<24);J[c+16>>2]=K[4190]|K[4191]<<8|(K[4192]<<16|K[4193]<<24);J[c+20>>2]=b;v:{if(K[f+9|0]!=40|d>>>0<11|(K[(d+f|0)-1|0]!=41|K[c+16|0]!=K[f|0])){break v}if(K[c+17|0]!=K[f+1|0]|K[c+18|0]!=K[f+2|0]|(K[c+19|0]!=K[f+3|0]|K[c+20|0]!=K[f+4|0])){break v}if(K[c+21|0]!=K[f+5|0]|K[c+22|0]!=K[f+6|0]|(K[c+23|0]!=K[f+7|0]|K[c+24|0]!=K[f+8|0])){break v}b=d-11|0;J[c+108>>2]=b;d=f+10|0;J[c+104>>2]=d;$c(c+16|0,d,b,20);b=J[c+20>>2];d=J[c+16>>2];if((b|0)!=(d|0)){J[a+4>>2]=0;J[a+8>>2]=0;J[a>>2]=6;J[a+16>>2]=d;J[a+12>>2]=0;J[a+20>>2]=b;b=J[c+24>>2];J[a+28>>2]=0;J[a+32>>2]=0;J[a+24>>2]=b;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;break h}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;if(!b){break h}$a(b);break h}H[c+27|0]=7;H[c+23|0]=0;J[c+16>>2]=K[3869]|K[3870]<<8|(K[3871]<<16|K[3872]<<24);b=K[3872]|K[3873]<<8|(K[3874]<<16|K[3875]<<24);H[c+19|0]=b;H[c+20|0]=b>>>8;H[c+21|0]=b>>>16;H[c+22|0]=b>>>24;w:{if(K[f+7|0]!=40|d>>>0<9|(K[(d+f|0)-1|0]!=41|K[c+16|0]!=K[f|0])){break w}if(K[c+17|0]!=K[f+1|0]|K[c+18|0]!=K[f+2|0]|(K[c+19|0]!=K[f+3|0]|K[c+20|0]!=K[f+4|0])){break w}if(K[c+21|0]!=K[f+5|0]|K[c+22|0]!=K[f+6|0]){break w}b=d-9|0;J[c+108>>2]=b;d=f+8|0;J[c+104>>2]=d;$c(c+16|0,d,b,32);b=J[c+20>>2];d=J[c+16>>2];if((b|0)!=(d|0)){J[a+4>>2]=0;J[a+8>>2]=0;J[a>>2]=5;J[a+16>>2]=d;J[a+12>>2]=0;J[a+20>>2]=b;b=J[c+24>>2];J[a+28>>2]=0;J[a+32>>2]=0;J[a+24>>2]=b;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;break h}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;if(!b){break h}$a(b);break h}b=Kb(c+16|0,4182);d=fd(b,c+104|0);if(H[b+11|0]<0){$a(J[b>>2]);}if(d){$c(c+16|0,J[c+104>>2],J[c+108>>2],20);b=J[c+20>>2];d=J[c+16>>2];if((b|0)!=(d|0)){J[a+4>>2]=0;J[a+8>>2]=0;J[a>>2]=4;J[a+16>>2]=d;J[a+12>>2]=0;J[a+20>>2]=b;b=J[c+24>>2];J[a+28>>2]=0;J[a+32>>2]=0;J[a+24>>2]=b;J[a+36>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;break h}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;if(!b){break h}$a(b);break h}b=Kb(c+16|0,1743);d=fd(b,c+104|0);if(H[b+11|0]<0){$a(J[b>>2]);}if(d){J[c+96>>2]=0;J[c+88>>2]=0;J[c+92>>2]=0;J[c+84>>2]=0;J[c+76>>2]=0;J[c+80>>2]=0;J[5996]=0;b=c+16|0;ea(26,b|0,c+104|0,c+8|0);d=J[5996];J[5996]=0;if((d|0)!=1){J[5996]=0;aa(27,c+88|0,b|0);d=J[5996];J[5996]=0;x:{y:{if((d|0)!=1){Fb(b);b=J[c+92>>2];if(J[b-56>>2]){break y}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break x}e=Z()|0;Fb(c+16|0);break e}J[5996]=0;aa(28,c+76|0,J[c+8>>2]);d=J[5996];J[5996]=0;if((d|0)==1){break f}z:{A:{if(!J[c+108>>2]){break A}B:{C:{while(1){I[c+16>>1]=44;H[c+27|0]=1;b=c+16|0;d=c+104|0;if(!vb(b,d)){break z}J[5996]=0;ea(26,b|0,d|0,c+8|0);d=J[5996];J[5996]=0;if((d|0)==1){break C}J[5996]=0;aa(27,c+88|0,b|0);d=J[5996];J[5996]=0;if((d|0)==1){break B}Fb(b);b=J[c+92>>2];if(!J[b-56>>2]){break z}J[5996]=0;aa(28,c+76|0,J[c+8>>2]);d=J[5996];J[5996]=0;if((d|0)!=1){if(!J[c+108>>2]){break A}continue}break}e=Z()|0;break e}e=Z()|0;break e}e=Z()|0;Fb(c+16|0);break e}J[a>>2]=9;d=J[c+88>>2];J[a+8>>2]=b;J[a+4>>2]=d;J[a+12>>2]=J[c+96>>2];J[c+96>>2]=0;J[c+88>>2]=0;J[c+92>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+40>>2]=J[c+76>>2];J[a+44>>2]=J[c+80>>2];b=J[c+84>>2];J[a+52>>2]=0;J[a+48>>2]=b;break x}b=J[c+76>>2];J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;if(!b){break x}$a(b);}Oc(c+88|0);break h}e=Z()|0;break e}b=Kb(c+16|0,2464);d=fd(b,c+104|0);if(H[b+11|0]<0){$a(J[b>>2]);}if(d){J[c+96>>2]=0;J[c+88>>2]=0;J[c+92>>2]=0;J[5996]=0;b=c+16|0;aa(29,b|0,c+104|0);d=J[5996];J[5996]=0;D:{if((d|0)!=1){J[5996]=0;aa(27,c+88|0,b|0);d=J[5996];J[5996]=0;E:{F:{G:{if((d|0)!=1){Fb(b);e=J[c+92>>2];if(J[e-56>>2]){if(!J[c+108>>2]){break F}break G}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break E}e=Z()|0;Fb(c+16|0);break D}H:{I:{while(1){J[5996]=0;b=_(30,c+76|0,4354)|0;d=J[5996];J[5996]=0;J:{if((d|0)!=1){d=vb(b,c+104|0);if(H[c+87|0]<0){$a(J[b>>2]);}if(d){break J}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break E}e=Z()|0;break D}J[5996]=0;b=c+16|0;aa(29,b|0,c+104|0);d=J[5996];J[5996]=0;if((d|0)==1){break I}J[5996]=0;aa(27,c+88|0,b|0);d=J[5996];J[5996]=0;if((d|0)==1){break H}Fb(b);e=J[c+92>>2];if(J[e-56>>2]){if(!J[c+108>>2]){break F}continue}break}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break E}e=Z()|0;break D}e=Z()|0;Fb(c+16|0);break D}J[a>>2]=8;b=J[c+88>>2];J[a+8>>2]=e;J[a+4>>2]=b;J[a+12>>2]=J[c+96>>2];J[c+96>>2]=0;J[c+88>>2]=0;J[c+92>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;}Oc(c+88|0);break h}e=Z()|0;}break d}b=Kb(c+16|0,2197);d=fd(b,c+104|0);if(H[b+11|0]<0){$a(J[b>>2]);}if(!d){break i}e=0;h=J[c+104>>2];b=h;g=J[c+108>>2];K:{if(!g){break K}d=b+g|0;while(1){f=K[b|0];L:{if(!((f|0)!=123&(f|0)!=40)){e=e+1|0;break L}if(e){if((f|0)!=125&(f|0)!=41){break L}e=e-1|0;break L}e=0;M:{switch(f-41|0){case 0:case 3:break K;case 1:case 2:break L;default:break M}}if((f|0)==125){break K}}b=b+1|0;if((d|0)!=(b|0)){continue}break}b=d;}J[c+8>>2]=h;d=b-h|0;J[c+12>>2]=d;J[c+108>>2]=g-d;J[c+104>>2]=b;b=J[c+8>>2];d=Ad(c+16|0,b,b+J[c+12>>2]|0);f=c+4|0;b=0;e=Ua-16|0;Ua=e;g=K[d+11|0];h=g<<24>>24;h=(h|0)<0;g=h?J[d+4>>2]:g;N:{if(!g){break N}h=h?J[d>>2]:d;i=K[h|0];j=i-9&255;if(j>>>0<24&(8388639>>>j&1)){break N}j=K[(g+h|0)-1|0]-9|0;if((j&255)>>>0<24&(8388639>>>j&1)){break N}if((i|0)==45|(Gb(h)|0)!=(g|0)){break N}J[e+12>>2]=0;J[5732]=0;h=qe(H[d+11|0]<0?J[d>>2]:d,e+12|0,10,-1,0);if(f){J[f>>2]=h;}f=J[e+12>>2];if(!f|K[f|0]){break N}b=!J[5732];}Ua=e+16|0;if(H[d+11|0]<0){$a(J[d>>2]);}if(!b){J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break h}if(!J[c+4>>2]){J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break h}b=0;J[c+96>>2]=0;J[c+88>>2]=0;J[c+92>>2]=0;e=0;O:{P:{Q:{if(J[c+108>>2]){R:{S:{T:{while(1){J[5996]=0;b=_(30,c+76|0,4354)|0;d=J[5996];J[5996]=0;if((d|0)==1){break P}d=vb(b,c+104|0);if(H[c+87|0]<0){$a(J[b>>2]);}if(!d){J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break Q}J[5996]=0;b=c+16|0;aa(29,b|0,c+104|0);d=J[5996];J[5996]=0;if((d|0)==1){break T}J[5996]=0;aa(27,c+88|0,b|0);d=J[5996];J[5996]=0;if((d|0)==1){break S}Fb(b);e=J[c+92>>2];if(J[e-56>>2]){if(!J[c+108>>2]){break R}continue}break}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break Q}e=Z()|0;break O}e=Z()|0;Fb(c+16|0);break O}b=J[c+88>>2];}U:{d=(e-b|0)/56|0;if(d>>>0<=100){f=d;d=J[c+4>>2];if(f>>>0>=d>>>0){break U}}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;break Q}J[a+4>>2]=b;J[a>>2]=10;J[a+8>>2]=e;J[a+12>>2]=J[c+96>>2];J[c+96>>2]=0;J[c+88>>2]=0;J[c+92>>2]=0;J[a+48>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+52>>2]=d;}Oc(c+88|0);break h}e=Z()|0;}Oc(c+88|0);}da(e|0);B();}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;}Ua=c+112|0;return}ub();B();}e=Z()|0;}a=J[c+76>>2];if(a){$a(a);}}Oc(c+88|0);da(e|0);B();}function sn(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;f=Ua-160|0;Ua=f;J[f+152>>2]=0;J[f+144>>2]=0;J[f+148>>2]=0;o=d+1|0;l=1;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{while(1){e=K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);if((e|0)==(c|0)){break j}k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{x:{y:{z:{A:{if((c-e|0)<=0|c>>>0<=e>>>0){break A}h=e+1|0;g=0;k=K[e|0];B:{if(k>>>0>78){i=0;break B}i=k;C:{if(i>>>0<76){break C}D:{switch(i-76|0){case 0:if((c-h|0)<=0){break A}h=e+2|0;i=K[e+1|0];break C;case 1:if((c-h|0)<2){break A}h=e+3|0;i=K[e+1|0]|K[e+2|0]<<8;break C;default:break D}}if((c-h|0)<4){break A}h=e+5|0;i=K[e+1|0]|K[e+2|0]<<8|(K[e+3|0]<<16|K[e+4|0]<<24);}g=c-h|0;if((g|0)<0){break A}e=i;if(g>>>0<e>>>0){break A}E:{if(!e){i=0;g=0;break E}if((e|0)<0){J[5996]=0;ca(8);a=J[5996];J[5996]=0;if((a|0)==1){break z}break a}J[5996]=0;i=$(3,e|0)|0;j=J[5996];J[5996]=0;g=0;if((j|0)==1){break f}g=fb(i,h,e)+e|0;}h=e+h|0;}e=3;if(k-103>>>0<2){break k}H[b|0]=h;H[b+1|0]=h>>>8;H[b+2|0]=h>>>16;H[b+3|0]=h>>>24;if(!l){break y}e=0;if((d|0)<=0){break x}while(1){J[5996]=0;_(97,f+144|0,5573)|0;h=J[5996];J[5996]=0;if((h|0)==1){break w}e=e+1|0;if((e|0)!=(d|0)){continue}break}break x}b=K[f+155|0];d=b<<24>>24;i=(d|0)<0?J[f+148>>2]:b;c=i+8|0;if(c>>>0>=2147483632){J[5996]=0;ca(2);a=J[5996];J[5996]=0;if((a|0)!=1){break a}e=Z()|0;break d}F:{if(c>>>0<=10){J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;H[a+11|0]=c;break F}J[5996]=0;e=(c|15)+1|0;b=$(3,e|0)|0;h=J[5996];J[5996]=0;g=0;if((h|0)==1){break f}J[a+4>>2]=c;J[a>>2]=b;J[a+8>>2]=e|-2147483648;a=b;}a=eb(a,(d|0)<0?J[f+144>>2]:f+144|0,i)+i|0;H[a+8|0]=0;H[a|0]=32;H[a+1|0]=91;H[a+2|0]=101;H[a+3|0]=114;H[a+4|0]=114;H[a+5|0]=111;H[a+6|0]=114;H[a+7|0]=93;break c}e=Z()|0;break d}J[5996]=0;aa(98,f+144|0,32);e=J[5996];J[5996]=0;if((e|0)==1){break g}e=K[f+155|0];p=(e<<24>>24<0?J[f+148>>2]:e)-1|0;}G:{H:{I:{J:{K:{m=g-i|0;switch(m|0){case 0:break G;case 33:break I;case 32:break J;case 20:break K;default:break H}}J[5996]=0;j=$(3,20)|0;e=J[5996];J[5996]=0;if((e|0)==1){e=Z()|0;break h}e=j;H[e|0]=153;H[e+1|0]=153;H[e+2|0]=153;H[e+3|0]=153;H[e+4|0]=153;H[e+5|0]=153;H[e+6|0]=153;H[e+7|0]=153;H[e+16|0]=153;H[e+17|0]=153;H[e+18|0]=153;H[e+19|0]=153;H[e+8|0]=153;H[e+9|0]=153;H[e+10|0]=153;H[e+11|0]=153;H[e+12|0]=153;H[e+13|0]=153;H[e+14|0]=153;H[e+15|0]=153;h=i;if((g|0)==(h|0)){break p}while(1){if(K[h|0]==K[e|0]){e=e+1|0;h=h+1|0;if((g|0)!=(h|0)){continue}break p}break}$a(j);if(!(K[i|0]!=80|K[i+1|0]!=75|K[i+2|0]!=104)){L:{M:{while(1){e=g-1|0;if(!K[e|0]){g=e;if((e|0)!=(i|0)){continue}break M}break}g=(g-i|0)-3|0;if(g>>>0<2147483632){break L}}J[5996]=0;ca(2);a=J[5996];J[5996]=0;if((a|0)!=1){break a}e=Z()|0;break h}N:{O:{P:{Q:{R:{S:{T:{if(g>>>0<=10){H[f+111|0]=g;h=f+100|0;break T}J[5996]=0;e=(g|15)+1|0;h=$(3,e|0)|0;j=J[5996];J[5996]=0;if((j|0)==1){break S}J[f+100>>2]=h;J[f+104>>2]=g;J[f+108>>2]=e|-2147483648;}H[eb(h,i+3|0,g)+g|0]=0;J[5996]=0;g=ba(99,f+100|0,0,5383)|0;e=J[5996];J[5996]=0;if((e|0)==1){break R}J[f+120>>2]=J[g+8>>2];e=J[g+4>>2];J[f+112>>2]=J[g>>2];J[f+116>>2]=e;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;e=_(97,f+112|0,3723)|0;h=J[5996];J[5996]=0;if((h|0)==1){break Q}J[f+136>>2]=J[e+8>>2];h=J[e+4>>2];J[f+128>>2]=J[e>>2];J[f+132>>2]=h;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;h=K[f+139|0];j=h<<24>>24<0;ba(100,f+144|0,(j?J[f+128>>2]:f+128|0)|0,(j?J[f+132>>2]:h)|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break P}if(H[f+139|0]<0){$a(J[f+128>>2]);}if(H[f+123|0]<0){$a(J[e>>2]);}if(H[f+111|0]<0){$a(J[g>>2]);}if(!l){break m}break l}e=Z()|0;break h}e=Z()|0;break N}e=Z()|0;break O}e=Z()|0;if(H[f+139|0]>=0){break O}$a(J[f+128>>2]);}if(H[f+123|0]>=0){break N}$a(J[f+112>>2]);}if(H[f+111|0]>=0){break h}$a(J[f+100>>2]);break h}J[f+80>>2]=0;J[5996]=0;J[f+72>>2]=0;J[f+76>>2]=0;aa(101,f+72|0,40);e=J[5996];J[5996]=0;if((e|0)==1){break r}if(g>>>0>i>>>0){h=i+20|0;e=i;while(1){g=K[e|0];J[5996]=0;j=f+72|0;aa(98,j|0,H[(g>>>4|0)+6976|0]);k=J[5996];J[5996]=0;if((k|0)==1){break r}J[5996]=0;aa(98,j|0,H[(g&15)+6976|0]);g=J[5996];J[5996]=0;if((g|0)==1){break r}e=e+1|0;if((h|0)!=(e|0)){continue}break}}J[5996]=0;g=ba(99,f+72|0,0,3762)|0;e=J[5996];J[5996]=0;U:{V:{W:{X:{if((e|0)!=1){J[f+96>>2]=J[g+8>>2];e=J[g+4>>2];J[f+88>>2]=J[g>>2];J[f+92>>2]=e;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;e=_(97,f+88|0,3760)|0;h=J[5996];J[5996]=0;if((h|0)==1){break X}J[f+136>>2]=J[e+8>>2];h=J[e+4>>2];J[f+128>>2]=J[e>>2];J[f+132>>2]=h;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;h=K[f+139|0];j=h<<24>>24<0;ba(100,f+144|0,(j?J[f+128>>2]:f+128|0)|0,(j?J[f+132>>2]:h)|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break W}if(H[f+139|0]<0){$a(J[f+128>>2]);}if(H[f+99|0]<0){$a(J[e>>2]);}if(H[f+83|0]<0){$a(J[g>>2]);}if(!l){break m}break l}e=Z()|0;break U}e=Z()|0;break V}e=Z()|0;if(H[f+139|0]>=0){break V}$a(J[f+128>>2]);}if(H[f+99|0]>=0){break U}$a(J[f+88>>2]);}break q}J[5996]=0;j=$(3,32)|0;e=J[5996];J[5996]=0;if((e|0)==1){e=Z()|0;break h}e=j;H[e|0]=136;H[e+1|0]=136;H[e+2|0]=136;H[e+3|0]=136;H[e+4|0]=136;H[e+5|0]=136;H[e+6|0]=136;H[e+7|0]=136;H[e+24|0]=136;H[e+25|0]=136;H[e+26|0]=136;H[e+27|0]=136;H[e+28|0]=136;H[e+29|0]=136;H[e+30|0]=136;H[e+31|0]=136;H[e+16|0]=136;H[e+17|0]=136;H[e+18|0]=136;H[e+19|0]=136;H[e+20|0]=136;H[e+21|0]=136;H[e+22|0]=136;H[e+23|0]=136;H[e+8|0]=136;H[e+9|0]=136;H[e+10|0]=136;H[e+11|0]=136;H[e+12|0]=136;H[e+13|0]=136;H[e+14|0]=136;H[e+15|0]=136;h=i;if((g|0)==(h|0)){break p}while(1){q=K[h|0];r=K[e|0];if((q|0)==(r|0)){e=e+1|0;h=h+1|0;if((g|0)!=(h|0)){continue}}break}$a(j);if((q|0)==(r|0)){break o}if(!m){break G}if((m|0)!=33){break H}}if(K[i|0]!=2|K[i+1|0]!=80|(K[i+2|0]!=75|K[i+3|0]!=98)){break H}Y:{if((g|0)!=(i|0)){Z:{while(1){e=g-1|0;if(!K[e|0]){g=e;if((e|0)!=(i|0)){continue}break Z}break}g=(g-i|0)-4|0;if(g>>>0<2147483632){break Y}}g=i;}J[5996]=0;ca(2);a=J[5996];J[5996]=0;if((a|0)!=1){break a}e=Z()|0;break e}_:{$:{aa:{ba:{ca:{da:{ea:{if(g>>>0<=10){H[f+55|0]=g;h=f+44|0;break ea}J[5996]=0;e=(g|15)+1|0;h=$(3,e|0)|0;j=J[5996];J[5996]=0;if((j|0)==1){break da}J[f+44>>2]=h;J[f+48>>2]=g;J[f+52>>2]=e|-2147483648;}H[eb(h,i+4|0,g)+g|0]=0;J[5996]=0;g=ba(99,f+44|0,0,3762)|0;e=J[5996];J[5996]=0;if((e|0)==1){break ca}J[f- -64>>2]=J[g+8>>2];e=J[g+4>>2];J[f+56>>2]=J[g>>2];J[f+60>>2]=e;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;e=_(97,f+56|0,3760)|0;h=J[5996];J[5996]=0;if((h|0)==1){break ba}J[f+136>>2]=J[e+8>>2];h=J[e+4>>2];J[f+128>>2]=J[e>>2];J[f+132>>2]=h;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;h=K[f+139|0];j=h<<24>>24<0;ba(100,f+144|0,(j?J[f+128>>2]:f+128|0)|0,(j?J[f+132>>2]:h)|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break aa}if(H[f+139|0]<0){$a(J[f+128>>2]);}if(H[f+67|0]<0){$a(J[e>>2]);}if(H[f+55|0]<0){$a(J[g>>2]);}if(l){break l}break m}e=Z()|0;break h}e=Z()|0;break _}e=Z()|0;break $}e=Z()|0;if(H[f+139|0]>=0){break $}$a(J[f+128>>2]);}if(H[f+67|0]>=0){break _}$a(J[f+56>>2]);}if(H[f+55|0]>=0){break h}$a(J[f+44>>2]);break h}J[f+24>>2]=0;J[5996]=0;J[f+16>>2]=0;J[f+20>>2]=0;aa(101,f+16|0,m<<1);e=J[5996];J[5996]=0;if((e|0)==1){break t}if(g>>>0>i>>>0){h=i+m|0;e=i;while(1){g=K[e|0];J[5996]=0;j=f+16|0;aa(98,j|0,H[(g>>>4|0)+6976|0]);k=J[5996];J[5996]=0;if((k|0)==1){break t}J[5996]=0;aa(98,j|0,H[(g&15)+6976|0]);g=J[5996];J[5996]=0;if((g|0)==1){break t}e=e+1|0;if((h|0)!=(e|0)){continue}break}}J[5996]=0;g=ba(99,f+16|0,0,3762)|0;e=J[5996];J[5996]=0;fa:{ga:{ha:{ia:{if((e|0)!=1){J[f+40>>2]=J[g+8>>2];e=J[g+4>>2];J[f+32>>2]=J[g>>2];J[f+36>>2]=e;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;J[5996]=0;e=_(97,f+32|0,3760)|0;h=J[5996];J[5996]=0;if((h|0)==1){break ia}J[f+136>>2]=J[e+8>>2];h=J[e+4>>2];J[f+128>>2]=J[e>>2];J[f+132>>2]=h;J[e>>2]=0;J[e+4>>2]=0;J[e+8>>2]=0;J[5996]=0;h=K[f+139|0];j=h<<24>>24<0;ba(100,f+144|0,(j?J[f+128>>2]:f+128|0)|0,(j?J[f+132>>2]:h)|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break ha}if(H[f+139|0]<0){$a(J[f+128>>2]);}if(H[f+43|0]<0){$a(J[e>>2]);}if(H[f+27|0]<0){$a(J[g>>2]);}if(!l){break m}break l}e=Z()|0;break fa}e=Z()|0;break ga}e=Z()|0;if(H[f+139|0]>=0){break ga}$a(J[f+128>>2]);}if(H[f+43|0]>=0){break fa}$a(J[f+32>>2]);}break s}e=J[(k<<2)+5840>>2];g=Gb(e);if(g>>>0>=2147483632){J[5996]=0;ca(2);a=J[5996];J[5996]=0;if((a|0)!=1){break a}e=Z()|0;break h}ja:{ka:{la:{ma:{na:{oa:{pa:{qa:{ra:{sa:{ta:{ua:{va:{wa:{xa:{ya:{za:{Aa:{Ba:{if(g>>>0<=10){H[f+139|0]=g;h=f+128|0;break Ba}J[5996]=0;j=(g|15)+1|0;h=$(3,j|0)|0;m=J[5996];J[5996]=0;if((m|0)==1){break Aa}J[f+128>>2]=h;J[f+132>>2]=g;J[f+136>>2]=j|-2147483648;}H[eb(h,e,g)+g|0]=0;J[5996]=0;g=K[f+139|0];e=g<<24>>24<0;g=ba(100,f+144|0,(e?J[f+128>>2]:f+128|0)|0,(e?J[f+132>>2]:g)|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break za}if(H[f+139|0]<0){$a(J[f+128>>2]);}if(k-99>>>0>1){break n}J[5996]=0;aa(98,g|0,10);e=J[5996];J[5996]=0;if((e|0)==1){break g}J[5996]=0;e=f+128|0;ga(102,e|0,b|0,c|0,o|0);h=J[5996];J[5996]=0;if((h|0)==1){break ya}J[5996]=0;j=g;h=e;g=K[f+139|0];e=g<<24>>24<0;j=ba(100,j|0,(e?J[f+128>>2]:h)|0,(e?J[f+132>>2]:g)|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break xa}if(H[f+139|0]<0){$a(J[f+128>>2]);}h=K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);if((h|0)==(c|0)){break na}if(K[h|0]!=103){break va}e=0;if((d|0)>0){while(1){J[5996]=0;_(97,j|0,5573)|0;g=J[5996];J[5996]=0;if((g|0)==1){break v}e=e+1|0;if((e|0)!=(d|0)){continue}break}h=K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);}g=h+1|0;H[b|0]=g;H[b+1|0]=g>>>8;H[b+2|0]=g>>>16;H[b+3|0]=g>>>24;e=J[(K[h|0]<<2)+5840>>2];g=Gb(e);if(g>>>0<2147483632){break wa}J[5996]=0;ca(2);a=J[5996];J[5996]=0;if((a|0)!=1){break a}e=Z()|0;break h}e=Z()|0;break h}e=Z()|0;if(H[f+139|0]>=0){break h}$a(J[f+128>>2]);break h}e=Z()|0;break h}e=Z()|0;if(H[f+139|0]>=0){break h}$a(J[f+128>>2]);break h}Ca:{if(g>>>0<=10){H[f+11|0]=g;h=f;break Ca}J[5996]=0;k=(g|15)+1|0;h=$(3,k|0)|0;l=J[5996];J[5996]=0;if((l|0)==1){break ua}J[f>>2]=h;J[f+4>>2]=g;J[f+8>>2]=k|-2147483648;}H[eb(h,e,g)+g|0]=0;J[5996]=0;aa(98,f|0,10);g=J[5996];J[5996]=0;if((g|0)==1){break ta}J[f+136>>2]=J[f+8>>2];J[f+8>>2]=0;e=J[f+4>>2];g=J[f>>2];J[f+128>>2]=g;J[f+132>>2]=e;J[f>>2]=0;J[f+4>>2]=0;J[5996]=0;h=g;g=H[f+139|0];e=(g|0)<0;g=ba(100,j|0,(e?h:f+128|0)|0,(e?J[f+132>>2]:g&255)|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break sa}if(H[f+139|0]<0){$a(J[f+128>>2]);}if(H[f+11|0]<0){$a(J[f>>2]);}J[5996]=0;e=f+128|0;ga(102,e|0,b|0,c|0,o|0);h=J[5996];J[5996]=0;if((h|0)==1){break qa}J[5996]=0;k=g;h=e;g=K[f+139|0];e=g<<24>>24<0;ba(100,k|0,(e?J[f+128>>2]:h)|0,(e?J[f+132>>2]:g)|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break pa}if(H[f+139|0]<0){$a(J[f+128>>2]);}h=K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);}if((c|0)==(h|0)|K[h|0]!=104){break na}e=0;if((d|0)>0){while(1){J[5996]=0;_(97,j|0,5573)|0;g=J[5996];J[5996]=0;if((g|0)==1){break u}e=e+1|0;if((e|0)!=(d|0)){continue}break}h=K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);}g=h+1|0;H[b|0]=g;H[b+1|0]=g>>>8;H[b+2|0]=g>>>16;H[b+3|0]=g>>>24;e=J[(K[h|0]<<2)+5840>>2];g=Gb(e);if(g>>>0<2147483632){break oa}J[5996]=0;ca(2);a=J[5996];J[5996]=0;if((a|0)!=1){break a}e=Z()|0;break h}e=Z()|0;break h}e=Z()|0;break ra}e=Z()|0;if(H[f+139|0]>=0){break ra}$a(J[f+128>>2]);}if(H[f+11|0]>=0){break h}$a(J[f>>2]);break h}e=Z()|0;break h}e=Z()|0;if(H[f+139|0]>=0){break h}$a(J[f+128>>2]);break h}Da:{if(g>>>0<=10){H[f+11|0]=g;h=f;break Da}J[5996]=0;k=(g|15)+1|0;h=$(3,k|0)|0;l=J[5996];J[5996]=0;if((l|0)==1){break ma}J[f>>2]=h;J[f+4>>2]=g;J[f+8>>2]=k|-2147483648;}H[eb(h,e,g)+g|0]=0;J[5996]=0;aa(98,f|0,10);g=J[5996];J[5996]=0;if((g|0)==1){break la}J[f+136>>2]=J[f+8>>2];J[f+8>>2]=0;e=J[f+4>>2];g=J[f>>2];J[f+128>>2]=g;J[f+132>>2]=e;J[f>>2]=0;J[f+4>>2]=0;J[5996]=0;h=g;g=H[f+139|0];e=(g|0)<0;ba(100,j|0,(e?h:f+128|0)|0,(e?J[f+132>>2]:g&255)|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break ka}if(H[f+139|0]<0){$a(J[f+128>>2]);}if(H[f+11|0]>=0){break na}$a(J[f>>2]);}g=K[f+155|0];n=g<<24>>24<0?J[f+148>>2]:g;break l}e=Z()|0;break h}e=Z()|0;break ja}e=Z()|0;if(H[f+139|0]>=0){break ja}$a(J[f+128>>2]);}if(H[f+11|0]>=0){break h}$a(J[f>>2]);break h}e=Z()|0;break h}e=Z()|0;break h}e=Z()|0;break h}e=Z()|0;}if(H[f+27|0]>=0){break h}$a(J[f+16>>2]);break h}e=Z()|0;}if(H[f+83|0]>=0){break h}$a(J[f+72>>2]);break h}$a(j);}J[5996]=0;_(97,f+144|0,3719)|0;g=J[5996];J[5996]=0;if((g|0)==1){break g}}if(l){break l}}e=K[f+155|0];g=e<<24>>24;h=(g|0)<0;if((h?J[f+148>>2]:e)-n>>>0<81){break l}e=0;H[(h?J[f+144>>2]:f+144|0)+p|0]=10;n=p+1|0;if((d|0)<=0){break l}while(1){J[5996]=0;ba(99,f+144|0,n|0,5573)|0;g=J[5996];J[5996]=0;if((g|0)==1){break i}e=e+1|0;if((e|0)!=(d|0)){continue}break}}g=K[f+155|0];l=((g<<24>>24<0?J[f+148>>2]:g)|0)==(n|0);e=0;}if(i){$a(i);}if(!e){continue}break}if((e|0)!=3){break c}}Ea:{if(!l){J[5996]=0;aa(98,f+144|0,10);b=J[5996];J[5996]=0;if((b|0)==1){break Ea}}b=J[f+148>>2];J[a>>2]=J[f+144>>2];J[a+4>>2]=b;J[a+8>>2]=J[f+152>>2];break b}e=Z()|0;break d}e=Z()|0;}g=i;break e}g=i;}e=Z()|0;}if(!g){break d}$a(g);}if(H[f+155|0]<0){$a(J[f+144>>2]);}da(e|0);B();}if(H[f+155|0]>=0){break b}$a(J[f+144>>2]);}Ua=f+160|0;return}B();}function ah(){var a=0,b=0,c=0,d=0,e=0,f=0,g=0;while(1){b=a<<4;c=b+22944|0;J[b+22948>>2]=c;J[b+22952>>2]=c;a=a+1|0;if((a|0)!=64){continue}break}Cd(48);a=Ua-16|0;Ua=a;a:{if(Ga(a+12|0,a+8|0)|0){break a}b=sb((J[a+12>>2]<<2)+4|0);J[6181]=b;if(!b){break a}b=sb(J[a+8>>2]);if(b){c=J[6181];J[c+(J[a+12>>2]<<2)>>2]=0;if(!(Fa(c|0,b|0)|0)){break a}}J[6181]=0;}Ua=a+16|0;a=cb(64);J[5998]=a;J[5999]=62;J[6e3]=-2147483584;b=K[3832]|K[3833]<<8|(K[3834]<<16|K[3835]<<24);c=K[3828]|K[3829]<<8|(K[3830]<<16|K[3831]<<24);H[a+54|0]=c;H[a+55|0]=c>>>8;H[a+56|0]=c>>>16;H[a+57|0]=c>>>24;H[a+58|0]=b;H[a+59|0]=b>>>8;H[a+60|0]=b>>>16;H[a+61|0]=b>>>24;b=K[3826]|K[3827]<<8|(K[3828]<<16|K[3829]<<24);c=K[3822]|K[3823]<<8|(K[3824]<<16|K[3825]<<24);H[a+48|0]=c;H[a+49|0]=c>>>8;H[a+50|0]=c>>>16;H[a+51|0]=c>>>24;H[a+52|0]=b;H[a+53|0]=b>>>8;H[a+54|0]=b>>>16;H[a+55|0]=b>>>24;b=K[3818]|K[3819]<<8|(K[3820]<<16|K[3821]<<24);c=K[3814]|K[3815]<<8|(K[3816]<<16|K[3817]<<24);H[a+40|0]=c;H[a+41|0]=c>>>8;H[a+42|0]=c>>>16;H[a+43|0]=c>>>24;H[a+44|0]=b;H[a+45|0]=b>>>8;H[a+46|0]=b>>>16;H[a+47|0]=b>>>24;b=K[3810]|K[3811]<<8|(K[3812]<<16|K[3813]<<24);c=K[3806]|K[3807]<<8|(K[3808]<<16|K[3809]<<24);H[a+32|0]=c;H[a+33|0]=c>>>8;H[a+34|0]=c>>>16;H[a+35|0]=c>>>24;H[a+36|0]=b;H[a+37|0]=b>>>8;H[a+38|0]=b>>>16;H[a+39|0]=b>>>24;b=K[3802]|K[3803]<<8|(K[3804]<<16|K[3805]<<24);c=K[3798]|K[3799]<<8|(K[3800]<<16|K[3801]<<24);H[a+24|0]=c;H[a+25|0]=c>>>8;H[a+26|0]=c>>>16;H[a+27|0]=c>>>24;H[a+28|0]=b;H[a+29|0]=b>>>8;H[a+30|0]=b>>>16;H[a+31|0]=b>>>24;b=K[3794]|K[3795]<<8|(K[3796]<<16|K[3797]<<24);c=K[3790]|K[3791]<<8|(K[3792]<<16|K[3793]<<24);H[a+16|0]=c;H[a+17|0]=c>>>8;H[a+18|0]=c>>>16;H[a+19|0]=c>>>24;H[a+20|0]=b;H[a+21|0]=b>>>8;H[a+22|0]=b>>>16;H[a+23|0]=b>>>24;b=K[3786]|K[3787]<<8|(K[3788]<<16|K[3789]<<24);c=K[3782]|K[3783]<<8|(K[3784]<<16|K[3785]<<24);H[a+8|0]=c;H[a+9|0]=c>>>8;H[a+10|0]=c>>>16;H[a+11|0]=c>>>24;H[a+12|0]=b;H[a+13|0]=b>>>8;H[a+14|0]=b>>>16;H[a+15|0]=b>>>24;b=K[3778]|K[3779]<<8|(K[3780]<<16|K[3781]<<24);c=K[3774]|K[3775]<<8|(K[3776]<<16|K[3777]<<24);H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[a+4|0]=b;H[a+5|0]=b>>>8;H[a+6|0]=b>>>16;H[a+7|0]=b>>>24;H[a+62|0]=0;a=K[24003];b=a<<24>>24;b:{c:{d=(b|0)<0?J[5999]:a;a=d+12|0;if(a>>>0<2147483632){d:{if(a>>>0<=10){J[6004]=0;J[6005]=0;J[6006]=0;H[24027]=a;c=24016;break d}e=(a|15)+1|0;c=cb(e);J[6005]=a;J[6004]=c;J[6006]=e|-2147483648;}a=c;c=(b|0)>=0?23992:J[5998];a=eb(a,c,d)+d|0;H[a+12|0]=0;b=K[5207]|K[5208]<<8|(K[5209]<<16|K[5210]<<24);H[a+8|0]=b;H[a+9|0]=b>>>8;H[a+10|0]=b>>>16;H[a+11|0]=b>>>24;b=K[5203]|K[5204]<<8|(K[5205]<<16|K[5206]<<24);e=K[5199]|K[5200]<<8|(K[5201]<<16|K[5202]<<24);H[a|0]=e;H[a+1|0]=e>>>8;H[a+2|0]=e>>>16;H[a+3|0]=e>>>24;H[a+4|0]=b;H[a+5|0]=b>>>8;H[a+6|0]=b>>>16;H[a+7|0]=b>>>24;e:{a=d+8|0;f:{if(a>>>0>=2147483632){J[5996]=0;ca(2);b=J[5996];J[5996]=0;a=24028;if((b|0)==1){break f}break c}g:{if(a>>>0<=10){J[6007]=0;J[6008]=0;J[6009]=0;H[24039]=a;b=24028;break g}J[5996]=0;e=(a|15)+1|0;b=$(3,e|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){a=24028;break f}J[6008]=a;J[6007]=b;J[6009]=e|-2147483648;}a=eb(b,c,d)+d|0;H[a+8|0]=0;H[a|0]=32;H[a+1|0]=46;H[a+2|0]=44;H[a+3|0]=59;H[a+4|0]=45;H[a+5|0]=95;H[a+6|0]=63;H[a+7|0]=64;a=d+3|0;if(a>>>0>=2147483632){J[5996]=0;ca(2);b=J[5996];J[5996]=0;a=24040;if((b|0)!=1){break c}break f}h:{if(a>>>0<=10){J[6010]=0;J[6011]=0;J[6012]=0;H[24051]=a;b=24040;break h}J[5996]=0;e=(a|15)+1|0;b=$(3,e|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){a=24040;break f}J[6011]=a;J[6010]=b;J[6012]=e|-2147483648;}a=eb(b,c,d)+d|0;H[a+3|0]=0;H[a+2|0]=K[2557];b=K[2555]|K[2556]<<8;H[a|0]=b;H[a+1|0]=b>>>8;a=d+23|0;if(a>>>0>=2147483632){J[5996]=0;ca(2);b=J[5996];J[5996]=0;a=24052;if((b|0)!=1){break c}break f}J[5996]=0;e=(a|15)+1|0;b=$(3,e|0)|0;f=J[5996];J[5996]=0;if((f|0)!=1){break e}a=24052;}c=Z()|0;while(1){b=a-12|0;if(H[a-1|0]<0){$a(J[b>>2]);}a=b;if((a|0)!=24016){continue}break}da(c|0);B();}J[6014]=a;J[6013]=b;J[6015]=e|-2147483648;a=eb(b,c,d)+d|0;H[a+23|0]=0;b=K[5412]|K[5413]<<8|(K[5414]<<16|K[5415]<<24);c=K[5408]|K[5409]<<8|(K[5410]<<16|K[5411]<<24);H[a+15|0]=c;H[a+16|0]=c>>>8;H[a+17|0]=c>>>16;H[a+18|0]=c>>>24;H[a+19|0]=b;H[a+20|0]=b>>>8;H[a+21|0]=b>>>16;H[a+22|0]=b>>>24;b=K[5405]|K[5406]<<8|(K[5407]<<16|K[5408]<<24);c=K[5401]|K[5402]<<8|(K[5403]<<16|K[5404]<<24);H[a+8|0]=c;H[a+9|0]=c>>>8;H[a+10|0]=c>>>16;H[a+11|0]=c>>>24;H[a+12|0]=b;H[a+13|0]=b>>>8;H[a+14|0]=b>>>16;H[a+15|0]=b>>>24;b=K[5397]|K[5398]<<8|(K[5399]<<16|K[5400]<<24);c=K[5393]|K[5394]<<8|(K[5395]<<16|K[5396]<<24);H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[a+4|0]=b;H[a+5|0]=b>>>8;H[a+6|0]=b>>>16;H[a+7|0]=b>>>24;break b}ub();B();}B();}d=Ua-48|0;Ua=d;J[d+20>>2]=0;J[d+12>>2]=0;J[d+16>>2]=0;J[5996]=0;_(9,24064,d+12|0)|0;a=J[5996];J[5996]=0;i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{if((a|0)!=1){a=J[d+12>>2];if(a){$a(a);}a=cb(32);J[d+36>>2]=a;b=a+32|0;J[d+44>>2]=b;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;J[5996]=0;J[d+40>>2]=b;f=_(9,d+12|0,d+36|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break m}H[f+5|0]=1;J[6024]=J[f+8>>2];a=J[f+4>>2];J[6022]=J[f>>2];J[6023]=a;J[6025]=0;J[6026]=0;J[6027]=0;c=J[f+16>>2];b=J[f+12>>2];a=c-b|0;e=(a|0)/12|0;if((b|0)==(c|0)){break n}if(e>>>0<357913942){break r}J[5996]=0;ca(11);a=J[5996];J[5996]=0;if((a|0)==1){break q}B();}e=Z()|0;a=J[d+12>>2];if(!a){break i}$a(a);break i}J[5996]=0;a=$(3,a|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break q}J[6026]=a;J[6025]=a;J[6027]=a+P(e,12);J[5996]=0;b=ia(12,24108,b|0,c|0,a|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break o}e=Z()|0;J[6026]=a;break p}e=Z()|0;}c=J[6025];if(c){a=J[6026];b=c;if((a|0)!=(b|0)){while(1){b=a-12|0;g=J[b>>2];if(g){J[a-8>>2]=g;$a(g);}a=b;if((c|0)!=(a|0)){continue}break}b=J[6025];}J[6026]=c;$a(b);}c=J[f+12>>2];if(!c){break j}a=J[f+16>>2];b=c;if((a|0)!=(b|0)){while(1){b=a-12|0;g=J[b>>2];if(g){J[a-8>>2]=g;$a(g);}a=b;if((c|0)!=(a|0)){continue}break}b=J[f+12>>2];}J[f+16>>2]=c;$a(b);break j}J[6026]=b;c=J[f+12>>2];}if(c){a=J[f+16>>2];b=c;if((a|0)!=(b|0)){while(1){b=a-12|0;e=J[b>>2];if(e){J[a-8>>2]=e;$a(e);}a=b;if((c|0)!=(a|0)){continue}break}b=J[f+12>>2];}J[f+16>>2]=c;$a(b);}a=J[d+36>>2];if(a){$a(a);}a=cb(1);J[d+36>>2]=a;b=a+1|0;J[d+44>>2]=b;H[a|0]=1;J[5996]=0;J[d+40>>2]=b;_(9,24112,d+36|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break l}a=J[d+36>>2];if(a){$a(a);}J[6036]=0;J[6037]=0;J[6034]=1;J[6038]=0;J[6039]=0;H[24142]=0;I[12070]=0;J[6044]=0;J[6045]=0;J[6042]=-1;J[6043]=0;H[24163]=0;H[24164]=0;H[24165]=0;H[24166]=0;J[6040]=0;Ua=d+48|0;break k}e=Z()|0;break j}e=Z()|0;break j}d=Ua-48|0;Ua=d;J[d+20>>2]=0;J[d+12>>2]=0;J[d+16>>2]=0;J[5996]=0;_(9,24184,d+12|0)|0;a=J[5996];J[5996]=0;s:{t:{u:{v:{w:{x:{y:{z:{A:{B:{if((a|0)!=1){a=J[d+12>>2];if(a){$a(a);}a=cb(32);J[d+36>>2]=a;b=a+32|0;J[d+44>>2]=b;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;J[5996]=0;J[d+40>>2]=b;f=_(9,d+12|0,d+36|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break w}H[f+5|0]=1;J[6054]=J[f+8>>2];a=J[f+4>>2];J[6052]=J[f>>2];J[6053]=a;J[6055]=0;J[6056]=0;J[6057]=0;c=J[f+16>>2];b=J[f+12>>2];a=c-b|0;e=(a|0)/12|0;if((b|0)==(c|0)){break x}if(e>>>0<357913942){break B}J[5996]=0;ca(11);a=J[5996];J[5996]=0;if((a|0)==1){break A}B();}e=Z()|0;a=J[d+12>>2];if(!a){break i}$a(a);break i}J[5996]=0;a=$(3,a|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break A}J[6056]=a;J[6055]=a;J[6057]=a+P(e,12);J[5996]=0;b=ia(12,24228,b|0,c|0,a|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break y}e=Z()|0;J[6056]=a;break z}e=Z()|0;}c=J[6055];if(c){a=c;b=J[6056];if((a|0)!=(b|0)){while(1){a=b-12|0;g=J[a>>2];if(g){J[b-8>>2]=g;$a(g);}b=a;if((a|0)!=(c|0)){continue}break}a=J[6055];}J[6056]=c;$a(a);}c=J[f+12>>2];if(!c){break j}a=c;b=J[f+16>>2];if((a|0)!=(b|0)){while(1){a=b-12|0;g=J[a>>2];if(g){J[b-8>>2]=g;$a(g);}b=a;if((a|0)!=(c|0)){continue}break}a=J[f+12>>2];}J[f+16>>2]=c;$a(a);break j}J[6056]=b;c=J[f+12>>2];}if(c){a=c;b=J[f+16>>2];if((a|0)!=(b|0)){while(1){a=b-12|0;e=J[a>>2];if(e){J[b-8>>2]=e;$a(e);}b=a;if((a|0)!=(c|0)){continue}break}a=J[f+12>>2];}J[f+16>>2]=c;$a(a);}a=J[d+36>>2];if(a){$a(a);}a=cb(1);J[d+36>>2]=a;b=a+1|0;J[d+44>>2]=b;H[a|0]=1;J[5996]=0;J[d+40>>2]=b;_(9,24232,d+36|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break v}a=J[d+36>>2];if(a){$a(a);}J[6066]=0;J[6067]=0;J[6064]=1;J[6068]=0;J[6069]=0;H[24262]=0;I[12130]=0;J[6074]=0;J[6075]=0;J[6072]=-1;J[6073]=0;H[24283]=0;H[24284]=0;H[24285]=0;H[24286]=0;J[6070]=0;J[6076]=0;J[6077]=0;J[6078]=0;b=cb(56);J[b>>2]=0;J[b+4>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;J[b+32>>2]=0;J[b+36>>2]=0;J[b+24>>2]=0;J[b+28>>2]=0;J[b+16>>2]=0;J[b+20>>2]=0;J[b+8>>2]=0;J[b+12>>2]=0;mc(24304,b);a=cb(4);J[a>>2]=b;J[5996]=0;b=$(3,56)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break u}break t}e=Z()|0;break j}e=Z()|0;break j}J[b+16>>2]=0;J[b+20>>2]=0;J[b+4>>2]=a;J[b>>2]=21;a=a+4|0;J[b+12>>2]=a;J[b+8>>2]=a;J[b+24>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[b+36>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;mc(24304,b);J[6079]=b;b=cb(56);J[b+4>>2]=0;J[b+8>>2]=0;J[b>>2]=1;J[b+12>>2]=0;J[b+16>>2]=0;J[b+20>>2]=0;J[b+24>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[b+36>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;mc(24304,b);a=cb(4);J[a>>2]=b;J[5996]=0;b=$(3,56)|0;c=J[5996];J[5996]=0;if((c|0)==1){break t}J[b+16>>2]=0;J[b+20>>2]=0;J[b+4>>2]=a;J[b>>2]=21;a=a+4|0;J[b+12>>2]=a;J[b+8>>2]=a;J[b+24>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[b+36>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;mc(24304,b);J[6080]=b;Ua=d+48|0;break s}b=Z()|0;$a(a);da(b|0);B();}d=Ua-48|0;Ua=d;J[d+20>>2]=0;J[d+12>>2]=0;J[d+16>>2]=0;J[5996]=0;_(9,24592,d+12|0)|0;a=J[5996];J[5996]=0;C:{D:{E:{F:{G:{H:{I:{J:{if((a|0)!=1){a=J[d+12>>2];if(a){$a(a);}a=cb(32);J[d+36>>2]=a;b=a+32|0;J[d+44>>2]=b;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;J[5996]=0;J[d+40>>2]=b;f=_(9,d+12|0,d+36|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break E}H[f+5|0]=1;J[6156]=J[f+8>>2];a=J[f+4>>2];J[6154]=J[f>>2];J[6155]=a;J[6157]=0;J[6158]=0;J[6159]=0;c=J[f+16>>2];b=J[f+12>>2];a=c-b|0;e=(a|0)/12|0;if((b|0)==(c|0)){break F}if(e>>>0<357913942){break J}J[5996]=0;ca(11);a=J[5996];J[5996]=0;if((a|0)==1){break I}B();}e=Z()|0;a=J[d+12>>2];if(!a){break i}$a(a);break i}J[5996]=0;a=$(3,a|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break I}J[6158]=a;J[6157]=a;J[6159]=a+P(e,12);J[5996]=0;b=ia(12,24636,b|0,c|0,a|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break G}e=Z()|0;J[6158]=a;break H}e=Z()|0;}c=J[6157];if(c){a=J[6158];b=c;if((a|0)!=(b|0)){while(1){b=a-12|0;g=J[b>>2];if(g){J[a-8>>2]=g;$a(g);}a=b;if((c|0)!=(a|0)){continue}break}b=J[6157];}J[6158]=c;$a(b);}c=J[f+12>>2];if(!c){break j}a=J[f+16>>2];b=c;if((a|0)!=(b|0)){while(1){b=a-12|0;g=J[b>>2];if(g){J[a-8>>2]=g;$a(g);}a=b;if((c|0)!=(a|0)){continue}break}b=J[f+12>>2];}J[f+16>>2]=c;$a(b);break j}J[6158]=b;c=J[f+12>>2];}if(c){a=J[f+16>>2];b=c;if((a|0)!=(b|0)){while(1){b=a-12|0;e=J[b>>2];if(e){J[a-8>>2]=e;$a(e);}a=b;if((c|0)!=(a|0)){continue}break}b=J[f+12>>2];}J[f+16>>2]=c;$a(b);}a=J[d+36>>2];if(a){$a(a);}a=cb(1);J[d+36>>2]=a;b=a+1|0;J[d+44>>2]=b;H[a|0]=1;J[5996]=0;J[d+40>>2]=b;_(9,24640,d+36|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break D}a=J[d+36>>2];if(a){$a(a);}J[6168]=0;J[6169]=0;J[6166]=1;J[6170]=0;J[6171]=0;H[24670]=0;I[12334]=0;J[6176]=0;J[6177]=0;J[6174]=-1;J[6175]=0;H[24691]=0;H[24692]=0;H[24693]=0;H[24694]=0;J[6172]=0;Ua=d+48|0;break C}e=Z()|0;break j}e=Z()|0;break j}J[6178]=24816;return}a=J[d+36>>2];if(!a){break i}$a(a);}da(e|0);B();}function fn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;g=Ua-96|0;Ua=g;J[g+36>>2]=0;J[g+28>>2]=0;J[g+32>>2]=0;J[5996]=0;k=$(3,12)|0;c=J[5996];J[5996]=0;a:{if((c|0)!=1){r=g+36|0;H[k+8|0]=0;J[k+4>>2]=0;J[k>>2]=b;f=k+12|0;q=f;b:{while(1){i=f-12|0;c=i;j=J[c+4>>2];n=J[c>>2];d=J[n+32>>2];c:{d:{e:{h=J[n+36>>2]-d>>3;if(h>>>0>j>>>0){b=1;J[c+4>>2]=j+1;e=K[f-4|0];f:{g:{h:{c=J[n>>2];switch(c-11|0){case 0:break g;case 3:break f;default:break h}}b=0;if((j|0)!=1|(c|0)!=17){break f}}b=(e|0)!=0;}j=J[d+(j<<3)>>2];if(f>>>0<q>>>0){H[f+8|0]=b;J[f+4>>2]=0;J[f>>2]=j;f=f+12|0;break c}i:{d=(f-k|0)/12|0;i=d+1|0;j:{if(i>>>0>=357913942){J[5996]=0;ca(121);a=J[5996];J[5996]=0;if((a|0)==1){break j}break a}e=(q-k|0)/12|0;c=e<<1;c=e>>>0>=178956970?357913941:c>>>0>i>>>0?c:i;if(c>>>0<357913942){break i}J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}}l=Z()|0;break b}J[5996]=0;i=P(c,12);h=$(3,i|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break e}c=h+P(d,12)|0;H[c+8|0]=b;J[c+4>>2]=0;J[c>>2]=j;b=c;if((f|0)!=(k|0)){while(1){f=f-12|0;d=f;e=J[d+4>>2];b=b-12|0;J[b>>2]=J[d>>2];J[b+4>>2]=e;J[b+8>>2]=J[d+8>>2];if((d|0)!=(k|0)){continue}break}}q=h+i|0;f=c+12|0;if(k){$a(k);}k=b;break c}e=J[g+28>>2];c=J[g+32>>2]-e>>5;if(c>>>0<h>>>0){J[5996]=0;ga(44,5135,2210,439,2439);a=J[5996];J[5996]=0;if((a|0)!=1){break a}l=Z()|0;break b}b=K[f-4|0];J[5996]=0;oa(122,g+40|0,b|0,n|0,(e+(c<<5)|0)-(h<<5)|0,h|0);b=J[5996];J[5996]=0;if((b|0)==1){l=Z()|0;break b}b=J[g+64>>2];J[g+16>>2]=J[g+60>>2];J[g+20>>2]=b;J[g+24>>2]=J[g+68>>2];b=J[g+56>>2];J[g+8>>2]=J[g+52>>2];J[g+12>>2]=b;o=J[g+48>>2];m=J[g+44>>2];j=J[g+40>>2];b=J[g+32>>2];e=J[n+36>>2];c=J[n+32>>2];k:{if((e|0)==(c|0)){c=b;break k}e=e-c<<2;c=b-e|0;f=c+(e&-32)|0;if((f|0)!=(b|0)){while(1){d=g- -64|0;J[d>>2]=K[c+28|0]|K[c+29|0]<<8|(K[c+30|0]<<16|K[c+31|0]<<24);e=K[c+24|0]|K[c+25|0]<<8|(K[c+26|0]<<16|K[c+27|0]<<24);J[g+56>>2]=K[c+20|0]|K[c+21|0]<<8|(K[c+22|0]<<16|K[c+23|0]<<24);J[g+60>>2]=e;e=K[c+16|0]|K[c+17|0]<<8|(K[c+18|0]<<16|K[c+19|0]<<24);J[g+48>>2]=K[c+12|0]|K[c+13|0]<<8|(K[c+14|0]<<16|K[c+15|0]<<24);J[g+52>>2]=e;e=K[c+8|0]|K[c+9|0]<<8|(K[c+10|0]<<16|K[c+11|0]<<24);J[g+40>>2]=K[c+4|0]|K[c+5|0]<<8|(K[c+6|0]<<16|K[c+7|0]<<24);J[g+44>>2]=e;e=K[f+28|0]|K[f+29|0]<<8|(K[f+30|0]<<16|K[f+31|0]<<24);H[c+28|0]=e;H[c+29|0]=e>>>8;H[c+30|0]=e>>>16;H[c+31|0]=e>>>24;h=K[f+24|0]|K[f+25|0]<<8|(K[f+26|0]<<16|K[f+27|0]<<24);e=K[f+20|0]|K[f+21|0]<<8|(K[f+22|0]<<16|K[f+23|0]<<24);H[c+20|0]=e;H[c+21|0]=e>>>8;H[c+22|0]=e>>>16;H[c+23|0]=e>>>24;H[c+24|0]=h;H[c+25|0]=h>>>8;H[c+26|0]=h>>>16;H[c+27|0]=h>>>24;h=K[f+16|0]|K[f+17|0]<<8|(K[f+18|0]<<16|K[f+19|0]<<24);e=K[f+12|0]|K[f+13|0]<<8|(K[f+14|0]<<16|K[f+15|0]<<24);H[c+12|0]=e;H[c+13|0]=e>>>8;H[c+14|0]=e>>>16;H[c+15|0]=e>>>24;H[c+16|0]=h;H[c+17|0]=h>>>8;H[c+18|0]=h>>>16;H[c+19|0]=h>>>24;h=K[f+8|0]|K[f+9|0]<<8|(K[f+10|0]<<16|K[f+11|0]<<24);e=K[f+4|0]|K[f+5|0]<<8|(K[f+6|0]<<16|K[f+7|0]<<24);H[c+4|0]=e;H[c+5|0]=e>>>8;H[c+6|0]=e>>>16;H[c+7|0]=e>>>24;H[c+8|0]=h;H[c+9|0]=h>>>8;H[c+10|0]=h>>>16;H[c+11|0]=h>>>24;e=J[d>>2];H[f+28|0]=e;H[f+29|0]=e>>>8;H[f+30|0]=e>>>16;H[f+31|0]=e>>>24;d=J[g+60>>2];e=J[g+56>>2];H[f+20|0]=e;H[f+21|0]=e>>>8;H[f+22|0]=e>>>16;H[f+23|0]=e>>>24;H[f+24|0]=d;H[f+25|0]=d>>>8;H[f+26|0]=d>>>16;H[f+27|0]=d>>>24;d=J[g+52>>2];e=J[g+48>>2];H[f+12|0]=e;H[f+13|0]=e>>>8;H[f+14|0]=e>>>16;H[f+15|0]=e>>>24;H[f+16|0]=d;H[f+17|0]=d>>>8;H[f+18|0]=d>>>16;H[f+19|0]=d>>>24;d=J[g+44>>2];e=J[g+40>>2];H[f+4|0]=e;H[f+5|0]=e>>>8;H[f+6|0]=e>>>16;H[f+7|0]=e>>>24;H[f+8|0]=d;H[f+9|0]=d>>>8;H[f+10|0]=d>>>16;H[f+11|0]=d>>>24;e=J[c>>2];J[c>>2]=J[f>>2];J[f>>2]=e;c=c+32|0;f=f+32|0;if((f|0)!=(b|0)){continue}break}}if((b|0)!=(c|0)){while(1){e=b-32|0;if((K[e|0]|K[e+1|0]<<8|(K[e+2|0]<<16|K[e+3|0]<<24))>>>0>=29){b=b-24|0;$a(K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24));H[b|0]=0;H[b+1|0]=0;H[b+2|0]=0;H[b+3|0]=0;}b=e;if((c|0)!=(b|0)){continue}break}}J[g+32>>2]=c;}f=J[g+36>>2];if(f>>>0>c>>>0){H[c+4|0]=0;H[c+5|0]=0;H[c+6|0]=0;H[c+7|0]=0;H[c+8|0]=0;H[c+9|0]=0;H[c+10|0]=0;H[c+11|0]=0;H[c+28|0]=0;H[c+29|0]=0;H[c+30|0]=0;H[c+31|0]=0;H[c+20|0]=0;H[c+21|0]=0;H[c+22|0]=0;H[c+23|0]=0;H[c+24|0]=0;H[c+25|0]=0;H[c+26|0]=0;H[c+27|0]=0;H[c+12|0]=0;H[c+13|0]=0;H[c+14|0]=0;H[c+15|0]=0;H[c+16|0]=0;H[c+17|0]=0;H[c+18|0]=0;H[c+19|0]=0;H[c+8|0]=o;H[c+9|0]=o>>>8;H[c+10|0]=o>>>16;H[c+11|0]=o>>>24;H[c+4|0]=m;H[c+5|0]=m>>>8;H[c+6|0]=m>>>16;H[c+7|0]=m>>>24;e=J[g+12>>2];b=J[g+8>>2];H[c+12|0]=b;H[c+13|0]=b>>>8;H[c+14|0]=b>>>16;H[c+15|0]=b>>>24;H[c+16|0]=e;H[c+17|0]=e>>>8;H[c+18|0]=e>>>16;H[c+19|0]=e>>>24;e=J[g+20>>2];b=J[g+16>>2];H[c+20|0]=b;H[c+21|0]=b>>>8;H[c+22|0]=b>>>16;H[c+23|0]=b>>>24;H[c+24|0]=e;H[c+25|0]=e>>>8;H[c+26|0]=e>>>16;H[c+27|0]=e>>>24;b=J[g+24>>2];H[c+28|0]=b;H[c+29|0]=b>>>8;H[c+30|0]=b>>>16;H[c+31|0]=b>>>24;J[c>>2]=j;J[g+32>>2]=c+32;break d}l:{m:{n:{p=J[g+28>>2];d=c-p>>5;h=d+1|0;o:{if(h>>>0>=134217728){J[5996]=0;ca(123);break o}J[g+92>>2]=r;e=f-p|0;b=e>>4;h=e>>>0>=2147483616?134217727:b>>>0>h>>>0?b:h;if(!h){b=0;break m}if(h>>>0<134217728){break n}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}break l}J[5996]=0;b=$(3,h<<5)|0;e=J[5996];J[5996]=0;if((e|0)==1){break l}}J[g+76>>2]=b;l=(h<<5)+b|0;J[g+88>>2]=l;h=(d<<5)+b|0;J[g+80>>2]=h;d=h;H[d+24|0]=0;H[d+25|0]=0;H[d+26|0]=0;H[d+27|0]=0;H[d+28|0]=0;H[d+29|0]=0;H[d+30|0]=0;H[d+31|0]=0;H[d+16|0]=0;H[d+17|0]=0;H[d+18|0]=0;H[d+19|0]=0;H[d+20|0]=0;H[d+21|0]=0;H[d+22|0]=0;H[d+23|0]=0;H[d+8|0]=0;H[d+9|0]=0;H[d+10|0]=0;H[d+11|0]=0;H[d+12|0]=0;H[d+13|0]=0;H[d+14|0]=0;H[d+15|0]=0;H[d|0]=0;H[d+1|0]=0;H[d+2|0]=0;H[d+3|0]=0;H[d+4|0]=0;H[d+5|0]=0;H[d+6|0]=0;H[d+7|0]=0;J[g+56>>2]=K[d+28|0]|K[d+29|0]<<8|(K[d+30|0]<<16|K[d+31|0]<<24);b=K[d+24|0]|K[d+25|0]<<8|(K[d+26|0]<<16|K[d+27|0]<<24);J[g+48>>2]=K[d+20|0]|K[d+21|0]<<8|(K[d+22|0]<<16|K[d+23|0]<<24);J[g+52>>2]=b;b=K[d+16|0]|K[d+17|0]<<8|(K[d+18|0]<<16|K[d+19|0]<<24);J[g+40>>2]=K[d+12|0]|K[d+13|0]<<8|(K[d+14|0]<<16|K[d+15|0]<<24);J[g+44>>2]=b;H[d+8|0]=o;H[d+9|0]=o>>>8;H[d+10|0]=o>>>16;H[d+11|0]=o>>>24;H[d+4|0]=m;H[d+5|0]=m>>>8;H[d+6|0]=m>>>16;H[d+7|0]=m>>>24;b=J[g+24>>2];H[d+28|0]=b;H[d+29|0]=b>>>8;H[d+30|0]=b>>>16;H[d+31|0]=b>>>24;e=J[g+20>>2];b=J[g+16>>2];H[d+20|0]=b;H[d+21|0]=b>>>8;H[d+22|0]=b>>>16;H[d+23|0]=b>>>24;H[d+24|0]=e;H[d+25|0]=e>>>8;H[d+26|0]=e>>>16;H[d+27|0]=e>>>24;e=J[g+12>>2];b=J[g+8>>2];H[d+12|0]=b;H[d+13|0]=b>>>8;H[d+14|0]=b>>>16;H[d+15|0]=b>>>24;H[d+16|0]=e;H[d+17|0]=e>>>8;H[d+18|0]=e>>>16;H[d+19|0]=e>>>24;b=J[g+52>>2];J[g+16>>2]=J[g+48>>2];J[g+20>>2]=b;J[g+24>>2]=J[g+56>>2];b=J[g+44>>2];J[g+8>>2]=J[g+40>>2];J[g+12>>2]=b;J[d>>2]=j;b=d+32|0;J[g+84>>2]=b;p:{if((c|0)==(p|0)){e=c;}else {while(1){b=d;d=d-32|0;H[d|0]=0;H[d+1|0]=0;H[d+2|0]=0;H[d+3|0]=0;H[d+4|0]=0;H[d+5|0]=0;H[d+6|0]=0;H[d+7|0]=0;H[d+24|0]=0;H[d+25|0]=0;H[d+26|0]=0;H[d+27|0]=0;H[d+28|0]=0;H[d+29|0]=0;H[d+30|0]=0;H[d+31|0]=0;H[d+16|0]=0;H[d+17|0]=0;H[d+18|0]=0;H[d+19|0]=0;H[d+20|0]=0;H[d+21|0]=0;H[d+22|0]=0;H[d+23|0]=0;H[d+8|0]=0;H[d+9|0]=0;H[d+10|0]=0;H[d+11|0]=0;H[d+12|0]=0;H[d+13|0]=0;H[d+14|0]=0;H[d+15|0]=0;e=c;c=c-32|0;f=K[c|0]|K[c+1|0]<<8|(K[c+2|0]<<16|K[c+3|0]<<24);J[5996]=0;j=f>>>0<29?f:f-29|0;aa(124,d|0,j|0);f=J[5996];J[5996]=0;if((f|0)==1){break p}m=j+(K[d|0]|K[d+1|0]<<8|(K[d+2|0]<<16|K[d+3|0]<<24))|0;H[d|0]=m;H[d+1|0]=m>>>8;H[d+2|0]=m>>>16;H[d+3|0]=m>>>24;f=K[c|0]|K[c+1|0]<<8|(K[c+2|0]<<16|K[c+3|0]<<24);j=f>>>0<29;n=j?f:f-29|0;q:{if(!n){break q}f=b-28|0;b=b-24|0;f=m>>>0<29?f:K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);l=0;b=e-24|0;j=j?e-28|0:K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);b=j;e=n&7;if(e){while(1){H[f|0]=K[b|0];b=b+1|0;f=f+1|0;l=l+1|0;if((e|0)!=(l|0)){continue}break}}if(n>>>0<8){break q}e=j+n|0;while(1){H[f|0]=K[b|0];H[f+1|0]=K[b+1|0];H[f+2|0]=K[b+2|0];H[f+3|0]=K[b+3|0];H[f+4|0]=K[b+4|0];H[f+5|0]=K[b+5|0];H[f+6|0]=K[b+6|0];H[f+7|0]=K[b+7|0];f=f+8|0;b=b+8|0;if((e|0)!=(b|0)){continue}break}}if((c|0)!=(p|0)){continue}break}l=J[g+88>>2];f=J[g+36>>2];b=J[g+84>>2];c=J[g+32>>2];e=J[g+28>>2];}J[g+80>>2]=e;J[g+28>>2]=d;J[g+32>>2]=b;J[g+36>>2]=l;J[g+88>>2]=f;J[g+76>>2]=e;J[g+84>>2]=c;if((c|0)!=(e|0)){while(1){b=c-32|0;J[g+84>>2]=b;if((K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24))>>>0>=29){b=c-24|0;$a(K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24));H[b|0]=0;H[b+1|0]=0;H[b+2|0]=0;H[b+3|0]=0;b=J[g+84>>2];}c=b;if((e|0)!=(c|0)){continue}break}c=J[g+76>>2];}if(!c){break d}$a(c);f=i;break c}l=Z()|0;if((b|0)!=(h|0)){while(1){if((K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24))>>>0>=29){$a(K[b+8|0]|K[b+9|0]<<8|(K[b+10|0]<<16|K[b+11|0]<<24));H[b+8|0]=0;H[b+9|0]=0;H[b+10|0]=0;H[b+11|0]=0;}b=b+32|0;if((h|0)!=(b|0)){continue}break}}b=J[g+84>>2];c=J[g+80>>2];if((b|0)!=(c|0)){while(1){a=b-32|0;J[g+84>>2]=a;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0>=29){a=b-24|0;$a(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24));H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;a=J[g+84>>2];}b=a;if((c|0)!=(b|0)){continue}break}}a=J[g+76>>2];if(a){$a(a);}break b}l=Z()|0;if(j>>>0<29){break b}$a(o);break b}l=Z()|0;break b}f=i;}if((f|0)!=(k|0)){continue}break}b=J[g+32>>2];c=J[g+28>>2];if((b-c|0)!=32){J[5996]=0;ga(44,4102,2210,450,2439);a=J[5996];J[5996]=0;if((a|0)!=1){break a}l=Z()|0;break b}H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;i=g- -64|0;J[i>>2]=K[a+28|0]|K[a+29|0]<<8|(K[a+30|0]<<16|K[a+31|0]<<24);e=K[a+24|0]|K[a+25|0]<<8|(K[a+26|0]<<16|K[a+27|0]<<24);J[g+56>>2]=K[a+20|0]|K[a+21|0]<<8|(K[a+22|0]<<16|K[a+23|0]<<24);J[g+60>>2]=e;e=K[a+16|0]|K[a+17|0]<<8|(K[a+18|0]<<16|K[a+19|0]<<24);J[g+48>>2]=K[a+12|0]|K[a+13|0]<<8|(K[a+14|0]<<16|K[a+15|0]<<24);J[g+52>>2]=e;e=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);J[g+40>>2]=K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24);J[g+44>>2]=e;e=K[c+28|0]|K[c+29|0]<<8|(K[c+30|0]<<16|K[c+31|0]<<24);H[a+28|0]=e;H[a+29|0]=e>>>8;H[a+30|0]=e>>>16;H[a+31|0]=e>>>24;d=K[c+24|0]|K[c+25|0]<<8|(K[c+26|0]<<16|K[c+27|0]<<24);e=K[c+20|0]|K[c+21|0]<<8|(K[c+22|0]<<16|K[c+23|0]<<24);H[a+20|0]=e;H[a+21|0]=e>>>8;H[a+22|0]=e>>>16;H[a+23|0]=e>>>24;H[a+24|0]=d;H[a+25|0]=d>>>8;H[a+26|0]=d>>>16;H[a+27|0]=d>>>24;d=K[c+16|0]|K[c+17|0]<<8|(K[c+18|0]<<16|K[c+19|0]<<24);e=K[c+12|0]|K[c+13|0]<<8|(K[c+14|0]<<16|K[c+15|0]<<24);H[a+12|0]=e;H[a+13|0]=e>>>8;H[a+14|0]=e>>>16;H[a+15|0]=e>>>24;H[a+16|0]=d;H[a+17|0]=d>>>8;H[a+18|0]=d>>>16;H[a+19|0]=d>>>24;d=K[c+8|0]|K[c+9|0]<<8|(K[c+10|0]<<16|K[c+11|0]<<24);e=K[c+4|0]|K[c+5|0]<<8|(K[c+6|0]<<16|K[c+7|0]<<24);H[a+4|0]=e;H[a+5|0]=e>>>8;H[a+6|0]=e>>>16;H[a+7|0]=e>>>24;H[a+8|0]=d;H[a+9|0]=d>>>8;H[a+10|0]=d>>>16;H[a+11|0]=d>>>24;e=J[i>>2];H[c+28|0]=e;H[c+29|0]=e>>>8;H[c+30|0]=e>>>16;H[c+31|0]=e>>>24;i=J[g+60>>2];e=J[g+56>>2];H[c+20|0]=e;H[c+21|0]=e>>>8;H[c+22|0]=e>>>16;H[c+23|0]=e>>>24;H[c+24|0]=i;H[c+25|0]=i>>>8;H[c+26|0]=i>>>16;H[c+27|0]=i>>>24;i=J[g+52>>2];e=J[g+48>>2];H[c+12|0]=e;H[c+13|0]=e>>>8;H[c+14|0]=e>>>16;H[c+15|0]=e>>>24;H[c+16|0]=i;H[c+17|0]=i>>>8;H[c+18|0]=i>>>16;H[c+19|0]=i>>>24;i=J[g+44>>2];e=J[g+40>>2];H[c+4|0]=e;H[c+5|0]=e>>>8;H[c+6|0]=e>>>16;H[c+7|0]=e>>>24;H[c+8|0]=i;H[c+9|0]=i>>>8;H[c+10|0]=i>>>16;H[c+11|0]=i>>>24;J[a>>2]=J[c>>2];J[c>>2]=0;H[a+32|0]=1;if((b|0)!=(c|0)){while(1){a=b-32|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0>=29){b=b-24|0;$a(K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24));H[b|0]=0;H[b+1|0]=0;H[b+2|0]=0;H[b+3|0]=0;}b=a;if((c|0)!=(b|0)){continue}break}b=J[g+28>>2];}J[g+32>>2]=c;$a(b);if(k){$a(k);}Ua=g+96|0;return}Qg(g+28|0);if(k){$a(k);}da(l|0);B();}a=Z()|0;Qg(g+28|0);da(a|0);B();}B();}function xn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0;g=Ua-48|0;Ua=g;J[g+32>>2]=0;J[g+24>>2]=0;J[g+28>>2]=0;J[5996]=0;o=$(3,12)|0;d=J[5996];J[5996]=0;a:{if((d|0)!=1){J[o+4>>2]=0;J[o>>2]=b;r=g+40|0;x=g+12|0;y=o+12|0;f=y;b:{c:{d:{while(1){e:{D=f-12|0;b=D;d=J[b+4>>2];f:{g:{h:{i:{j:{s=J[b>>2];n=J[s+36>>2];z=J[s+32>>2];A=n-z>>3;if(d>>>0<A>>>0){J[b+4>>2]=d+1;i=J[(d<<3)+z>>2];if(f>>>0<y>>>0){J[f+4>>2]=0;J[f>>2]=i;f=f+12|0;break f}k:{e=(f-o|0)/12|0;h=e+1|0;l:{if(h>>>0>=357913942){J[5996]=0;ca(95);a=J[5996];J[5996]=0;if((a|0)==1){break l}break a}d=(y-o|0)/12|0;b=d<<1;b=d>>>0>=178956970?357913941:b>>>0>h>>>0?b:h;if(b>>>0<357913942){break k}J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}}b=Z()|0;break b}J[5996]=0;h=P(b,12);j=$(3,h|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break j}d=j+P(e,12)|0;J[d+4>>2]=0;J[d>>2]=i;b=d;if((f|0)!=(o|0)){while(1){f=f-12|0;e=J[f+4>>2];b=b-12|0;J[b>>2]=J[f>>2];J[b+4>>2]=e;J[b+8>>2]=J[f+8>>2];if((f|0)!=(o|0)){continue}break}}y=h+j|0;f=d+12|0;if(o){$a(o);}o=b;break f}k=J[g+24>>2];j=(J[g+28>>2]-k|0)/12|0;if(j>>>0<A>>>0){J[5996]=0;ga(44,5135,2210,439,2439);a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}if(K[s+88|0]?J[c>>2]!=(s|0):0){break h}C=J[s+12>>2];l=J[s+8>>2];J[g+36>>2]=r;J[g+40>>2]=0;J[g+44>>2]=0;v=(C-l|0)/12|0;m=0;b=r;e=0;if((l|0)==(C|0)){break i}while(1){m:{n:{o:{p:{f=r;q:{if((f|0)==(b|0)){break q}d=f;b=e;r:{if(e){while(1){f=b;b=J[b+4>>2];if(b){continue}break r}}while(1){f=J[d+8>>2];b=J[f>>2]==(d|0);d=f;if(b){continue}break}}w=J[l>>2];p=K[l+11|0];h=p<<24>>24;t=(h|0)<0;b=K[f+27|0];u=b<<24>>24<0;s:{d=J[l+4>>2];q=t?d:p;i=u?J[f+20>>2]:b;b=i>>>0>q>>>0?q:i;if(b){b=Eb(u?J[f+16>>2]:f+16|0,t?w:l,b);if(b){break s}}if(i>>>0<q>>>0){break q}break p}if((b|0)>=0){break p}}b=e?f:r;i=e?f+4|0:r;break o}b=r;i=b;if(!e){break o}b=(h|0)>=0;t=b?l:w;w=b?p:d;d=e;while(1){b=d;f=K[d+27|0];u=f<<24>>24<0;p=u?J[d+20>>2]:f;q=p>>>0<w>>>0;t:{u:{v:{w:{h=q?p:w;x:{if(h){f=u?J[d+16>>2]:d+16|0;d=Eb(t,f,h);if(!d){if(p>>>0>w>>>0){break x}break w}if((d|0)>=0){break w}break x}if(p>>>0<=w>>>0){break v}}i=b;d=J[b>>2];if(d){continue}break n}d=Eb(f,t,h);if(d){break u}}if(!q){break o}break t}if((d|0)>=0){break o}}i=b+4|0;d=J[b+4>>2];if(d){continue}break}break n}if(J[i>>2]){break m}}J[5996]=0;f=$(3,28)|0;d=J[5996];J[5996]=0;y:{if((d|0)!=1){h=f+16|0;if(H[l+11|0]>=0){d=J[l+4>>2];J[h>>2]=J[l>>2];J[h+4>>2]=d;J[h+8>>2]=J[l+8>>2];break y}e=J[l+4>>2];d=J[l>>2];J[5996]=0;ea(40,h|0,d|0,e|0);d=J[5996];J[5996]=0;if((d|0)!=1){break y}b=Z()|0;$a(f);Db(J[g+40>>2]);break b}b=Z()|0;Db(e);break b}J[f+8>>2]=b;J[f>>2]=0;J[f+4>>2]=0;J[i>>2]=f;b=J[J[g+36>>2]>>2];if(b){J[g+36>>2]=b;f=J[i>>2];}zd(J[g+40>>2],f);m=J[g+44>>2]+1|0;J[g+44>>2]=m;}l=l+12|0;if((C|0)==(l|0)){break i}b=J[g+36>>2];e=J[g+40>>2];continue}}b=Z()|0;break b}z:{A:{if((m|0)!=(v|0)){break A}if((n|0)!=(z|0)){t=k+P(j,12)|0;m=t+P(A,-12)|0;while(1){d=J[m+8>>2];if(d>>>0>v>>>0){b=J[g+36>>2];J[g+36>>2]=J[m>>2];J[m>>2]=b;b=J[g+40>>2];J[g+40>>2]=J[m+4>>2];J[m+4>>2]=b;b=J[g+44>>2];J[g+44>>2]=d;J[m+8>>2]=b;J[(J[g+44>>2]?J[g+40>>2]+8|0:g+36|0)>>2]=r;J[(b?J[m+4>>2]+8|0:m)>>2]=m+4;}v=d+v|0;j=J[m>>2];u=m+4|0;if((j|0)!=(u|0)){while(1){h=0;d=J[g+40>>2];B:{if(!d){f=r;l=f;break B}e=K[j+27|0];b=e<<24>>24>=0;n=b?j+16|0:J[j+16>>2];p=b?e:J[j+20>>2];l=r;while(1){f=d;b=K[d+27|0];k=b<<24>>24<0;q=k?J[d+20>>2]:b;i=q>>>0<p>>>0;C:{D:{E:{F:{e=i?q:p;G:{if(e){d=k?J[d+16>>2]:d+16|0;b=Eb(n,d,e);if(!b){if(p>>>0<q>>>0){break G}break F}if((b|0)>=0){break F}break G}if(p>>>0>=q>>>0){break E}}l=f;d=J[f>>2];if(d){continue}break B}b=Eb(d,n,e);if(b){break D}}if(i){break C}h=f;break B}if((b|0)<0){break C}h=f;break B}l=f+4|0;d=J[f+4>>2];if(d){continue}break}}e=j;i=J[e+4>>2];d=i;H:{if(d){while(1){b=d;d=J[d>>2];if(d){continue}break H}}while(1){b=J[e+8>>2];d=J[b>>2]!=(e|0);e=b;if(d){continue}break}}if(!h){e=j;I:{if(i){while(1){d=i;i=J[d>>2];if(i){continue}break I}}while(1){d=J[e+8>>2];h=J[d>>2]!=(e|0);e=d;if(h){continue}break}}if(J[m>>2]==(j|0)){J[m>>2]=d;}J[m+8>>2]=J[m+8>>2]-1;i=J[m+4>>2];J:{K:{e=j;h=J[e>>2];if(h){d=J[e+4>>2];if(!d){break K}while(1){e=d;d=J[d>>2];if(d){continue}break}}h=J[e+4>>2];if(h){break K}h=0;k=1;break J}J[h+8>>2]=J[e+8>>2];k=0;}n=J[e+8>>2];d=J[n>>2];L:{if((e|0)==(d|0)){J[n>>2]=h;if((e|0)==(i|0)){d=0;i=h;break L}d=J[n+4>>2];break L}J[n+4>>2]=h;}p=!K[e+12|0];if((e|0)!=(j|0)){n=J[j+8>>2];J[e+8>>2]=n;J[n+((J[J[j+8>>2]>>2]!=(j|0))<<2)>>2]=e;n=J[j>>2];J[e>>2]=n;J[n+8>>2]=e;n=J[j+4>>2];J[e+4>>2]=n;if(n){J[n+8>>2]=e;}H[e+12|0]=K[j+12|0];i=(i|0)==(j|0)?e:i;}M:{if(p|!i){break M}if(!k){H[h+12|0]=1;break M}N:{O:{while(1){P:{e=K[d+12|0];k=J[d+8>>2];Q:{if(J[k>>2]!=(d|0)){if(!e){H[d+12|0]=1;H[k+12|0]=0;h=J[k+4>>2];e=J[h>>2];J[k+4>>2]=e;if(e){J[e+8>>2]=k;}J[h+8>>2]=J[k+8>>2];e=J[k+8>>2];J[(((k|0)!=J[e>>2])<<2)+e>>2]=h;J[h>>2]=k;J[k+8>>2]=h;e=d;d=J[d>>2];i=(d|0)==(i|0)?e:i;d=J[d+4>>2];}e=J[d>>2];R:{if(!(K[e+12|0]?0:e)){h=J[d+4>>2];if(!(!h|K[h+12|0])){e=d;break R}H[d+12|0]=0;d=J[d+8>>2];if((i|0)==(d|0)){H[i+12|0]=1;break M}if(K[d+12|0]){break Q}H[d+12|0]=1;break M}h=J[d+4>>2];if(!(!h|K[h+12|0])){e=d;break R}H[e+12|0]=1;H[d+12|0]=0;h=J[e+4>>2];J[d>>2]=h;if(h){J[h+8>>2]=d;}J[e+8>>2]=J[d+8>>2];h=J[d+8>>2];J[((J[h>>2]!=(d|0))<<2)+h>>2]=e;J[e+4>>2]=d;J[d+8>>2]=e;h=d;}i=J[e+8>>2];H[e+12|0]=K[i+12|0];H[i+12|0]=1;H[h+12|0]=1;e=J[i+4>>2];d=J[e>>2];J[i+4>>2]=d;if(d){J[d+8>>2]=i;}J[e+8>>2]=J[i+8>>2];d=J[i+8>>2];J[(((i|0)!=J[d>>2])<<2)+d>>2]=e;J[e>>2]=i;J[i+8>>2]=e;break M}if(!e){H[d+12|0]=1;H[k+12|0]=0;e=J[d+4>>2];J[k>>2]=e;if(e){J[e+8>>2]=k;}J[d+8>>2]=J[k+8>>2];e=J[k+8>>2];J[(((k|0)!=J[e>>2])<<2)+e>>2]=d;J[d+4>>2]=k;J[k+8>>2]=d;i=(i|0)==(k|0)?d:i;d=J[k>>2];}h=J[d>>2];if(!(!h|K[h+12|0])){e=d;break N}e=J[d+4>>2];if(K[e+12|0]?0:e){break O}H[d+12|0]=0;d=J[d+8>>2];if(!K[d+12|0]|(d|0)==(i|0)){break P}}e=d;d=J[d+8>>2];d=J[(((e|0)==J[d>>2])<<2)+d>>2];continue}break}H[d+12|0]=1;break M}if(!(K[h+12|0]|!h)){e=d;break N}H[e+12|0]=1;H[d+12|0]=0;h=J[e>>2];J[d+4>>2]=h;if(h){J[h+8>>2]=d;}J[e+8>>2]=J[d+8>>2];h=J[d+8>>2];J[((J[h>>2]!=(d|0))<<2)+h>>2]=e;J[e>>2]=d;J[d+8>>2]=e;h=d;}i=J[e+8>>2];H[e+12|0]=K[i+12|0];H[i+12|0]=1;H[h+12|0]=1;e=J[i>>2];d=J[e+4>>2];J[i>>2]=d;if(d){J[d+8>>2]=i;}J[e+8>>2]=J[i+8>>2];d=J[i+8>>2];J[(((i|0)!=J[d>>2])<<2)+d>>2]=e;J[e+4>>2]=i;J[i+8>>2]=e;}J[j+8>>2]=f;J[j>>2]=0;J[j+4>>2]=0;J[l>>2]=j;d=J[J[g+36>>2]>>2];if(d){J[g+36>>2]=d;j=J[l>>2];}zd(J[g+40>>2],j);J[g+44>>2]=J[g+44>>2]+1;}j=b;if((b|0)!=(u|0)){continue}break}}if(J[g+44>>2]!=(v|0)){break A}m=m+12|0;if((t|0)!=(m|0)){continue}break}}J[g+8>>2]=J[g+36>>2];J[g+16>>2]=v;b=J[g+40>>2];J[g+12>>2]=b;S:{if(!v){J[g+8>>2]=x;break S}J[b+8>>2]=x;J[g+40>>2]=0;J[g+44>>2]=0;J[g+36>>2]=r;}b=1;break z}H[g+8|0]=0;b=0;}H[g+20|0]=b;Db(J[g+40>>2]);if(K[g+20|0]){break g}}H[a+12|0]=0;H[a|0]=0;break c}d=J[g+28>>2];h=J[s+36>>2]-J[s+32>>2]>>3;e=J[g+24>>2];b=((d+P(h,-12)|0)-e|0)/12|0;T:{if(!P(h,-12)){f=d;break T}i=e+P(b,12)|0;f=i;b=f+P((P(h,12)|0)/12|0,12)|0;if((d|0)!=(b|0)){while(1){Db(J[f+4>>2]);J[f>>2]=J[b>>2];h=J[b+4>>2];J[f+4>>2]=h;e=J[b+8>>2];J[f+8>>2]=e;j=f+4|0;U:{if(!e){J[f>>2]=j;break U}J[h+8>>2]=j;J[b+4>>2]=0;J[b+8>>2]=0;J[b>>2]=b+4;}f=f+12|0;b=b+12|0;if((d|0)!=(b|0)){continue}break}d=J[g+28>>2];}f=i+P((f-i|0)/12|0,12)|0;if((f|0)!=(d|0)){while(1){d=d-12|0;Db(J[d+4>>2]);if((d|0)!=(f|0)){continue}break}}J[g+28>>2]=f;}b=J[g+32>>2];V:{if(b>>>0>f>>>0){J[f>>2]=J[g+8>>2];d=J[g+12>>2];J[f+4>>2]=d;b=J[g+16>>2];J[f+8>>2]=b;e=f+4|0;W:{if(!b){J[f>>2]=e;break W}J[d+8>>2]=e;J[g+12>>2]=0;J[g+16>>2]=0;J[g+8>>2]=x;}J[g+28>>2]=f+12;break V}X:{Y:{k=J[g+24>>2];h=(f-k|0)/12|0;e=h+1|0;Z:{if(e>>>0>=357913942){J[5996]=0;ca(96);break Z}d=(b-k|0)/12|0;b=d<<1;d=d>>>0>=178956970?357913941:b>>>0>e>>>0?b:e;if(!d){e=0;break X}if(d>>>0<357913942){break Y}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}break e}J[5996]=0;e=$(3,P(d,12)|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break e}}b=P(h,12)+e|0;J[b>>2]=J[g+8>>2];j=J[g+12>>2];J[b+4>>2]=j;h=J[g+16>>2];J[b+8>>2]=h;d=P(d,12);i=b+4|0;_:{if(!h){J[b>>2]=i;break _}J[j+8>>2]=i;J[g+12>>2]=0;J[g+16>>2]=0;J[g+8>>2]=x;}l=d+e|0;i=b+12|0;$:{if((f|0)==(k|0)){J[g+32>>2]=l;J[g+28>>2]=i;J[g+24>>2]=b;break $}while(1){b=b-12|0;f=f-12|0;J[b>>2]=J[f>>2];j=b+4|0;h=f+4|0;e=J[h>>2];J[j>>2]=e;d=J[f+8>>2];J[b+8>>2]=d;aa:{if(!d){J[b>>2]=j;break aa}J[e+8>>2]=j;J[f>>2]=h;J[f+4>>2]=0;J[f+8>>2]=0;}if((f|0)!=(k|0)){continue}break}J[g+32>>2]=l;d=J[g+28>>2];J[g+28>>2]=i;f=J[g+24>>2];J[g+24>>2]=b;if((d|0)==(f|0)){break $}while(1){d=d-12|0;Db(J[d+4>>2]);if((d|0)!=(f|0)){continue}break}}if(!f){break V}$a(f);}if(K[g+20|0]){Db(J[g+12>>2]);}f=D;}if((f|0)!=(o|0)){continue}break d}break}b=Z()|0;if(!K[g+20|0]){break b}Db(J[g+12>>2]);break b}e=J[g+24>>2];if((J[g+28>>2]-e|0)!=12){J[5996]=0;ga(44,4102,2210,450,2439);a=J[5996];J[5996]=0;if((a|0)!=1){break a}b=Z()|0;break b}J[a>>2]=J[e>>2];c=J[e+4>>2];J[a+4>>2]=c;b=J[e+8>>2];J[a+8>>2]=b;d=a+4|0;ba:{if(!b){J[a>>2]=d;break ba}J[c+8>>2]=d;J[e+4>>2]=0;J[e+8>>2]=0;J[e>>2]=e+4;}H[a+12|0]=1;}a=J[g+24>>2];if(a){f=J[g+28>>2];if((a|0)!=(f|0)){while(1){f=f-12|0;Db(J[f+4>>2]);if((a|0)!=(f|0)){continue}break}}$a(a);}if(o){$a(o);}Ua=g+48|0;return}Ug(g+24|0);if(o){$a(o);}da(b|0);B();}a=Z()|0;Ug(g+24|0);da(a|0);B();}B();}function fg(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;e=Ua-144|0;Ua=e;d=Sb(e,0,144);J[d+76>>2]=-1;J[d+44>>2]=a;J[d+32>>2]=178;J[d+84>>2]=a;s=c;a=0;j=Ua-304|0;Ua=j;a:{b:{c:{d:{if(J[d+4>>2]){break d}Dg(d);if(J[d+4>>2]){break d}break c}h=K[b|0];if(!h){break a}e:{f:{g:{h:{while(1){i:{c=h&255;j:{if((c|0)==32|c-9>>>0<5){while(1){h=b;b=b+1|0;c=K[h+1|0];if((c|0)==32|c-9>>>0<5){continue}break}Yb(d,0,0);while(1){b=J[d+4>>2];k:{if((b|0)!=J[d+104>>2]){J[d+4>>2]=b+1;b=K[b|0];break k}b=gb(d);}if((b|0)==32|b-9>>>0<5){continue}break}b=J[d+4>>2];c=J[d+116>>2];if((c|0)>0|(c|0)>=0){b=b-1|0;J[d+4>>2]=b;}b=b-J[d+44>>2]|0;e=b;i=o+J[d+124>>2]|0;c=b>>31;b=m+J[d+120>>2]|0;i=c+(b>>>0<m>>>0?i+1|0:i)|0;m=b+e|0;o=m>>>0<b>>>0?i+1|0:i;break j}l:{m:{n:{if((c|0)==37){c=K[b+1|0];if((c|0)==42){break n}if((c|0)!=37){break m}}Yb(d,0,0);o:{if(K[b|0]==37){while(1){c=J[d+4>>2];p:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;h=K[c|0];break p}h=gb(d);}if((h|0)==32|h-9>>>0<5){continue}break}b=b+1|0;break o}c=J[d+4>>2];if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;h=K[c|0];break o}h=gb(d);}if(K[b|0]!=(h|0)){b=J[d+116>>2];if((b|0)>0|(b|0)>=0){J[d+4>>2]=J[d+4>>2]-1;}if((h|0)>=0){break a}g=0;if(t){break a}break c}c=J[d+4>>2]-J[d+44>>2]|0;h=c;f=o+J[d+124>>2]|0;e=c>>31;c=m+J[d+120>>2]|0;g=e+(c>>>0<m>>>0?f+1|0:f)|0;m=c+h|0;o=m>>>0<c>>>0?g+1|0:g;h=b;break j}l=0;b=b+2|0;break l}e=c-48|0;if(!(K[b+2|0]!=36|e>>>0>=10)){c=Ua-16|0;J[c+12>>2]=s;f=c;c=(e>>>0>1?(e<<2)-4|0:0)+s|0;J[f+8>>2]=c+4;l=J[c>>2];b=b+3|0;break l}l=J[s>>2];s=s+4|0;b=b+1|0;}c=0;while(1){f=K[b|0];if(f-48>>>0<10){b=b+1|0;c=(P(c,10)+f|0)-48|0;continue}break}r=0;if((f|0)==109){p=0;r=(l|0)!=0;f=K[b+1|0];b=b+1|0;a=0;}h=b+1|0;k=3;g=r;q:{r:{switch((f&255)-65|0){case 39:e=b+2|0;b=K[b+1|0]==104;h=b?e:h;k=b?-2:-1;break q;case 43:e=b+2|0;b=K[b+1|0]==108;h=b?e:h;k=b?3:1;break q;case 51:case 57:k=1;break q;case 11:k=2;break q;case 41:break q;case 0:case 2:case 4:case 5:case 6:case 18:case 23:case 26:case 32:case 34:case 35:case 36:case 37:case 38:case 40:case 45:case 46:case 47:case 50:case 52:case 55:break r;default:break e}}k=0;h=b;}e=K[h|0];b=(e&47)==3;u=b?1:k;q=b?e|32:e;s:{if((q|0)==91){break s}t:{if((q|0)!=110){if((q|0)!=99){break t}c=(c|0)<=1?1:c;break s}gg(l,u,m,o);break j}Yb(d,0,0);while(1){b=J[d+4>>2];u:{if((b|0)!=J[d+104>>2]){J[d+4>>2]=b+1;b=K[b|0];break u}b=gb(d);}if((b|0)==32|b-9>>>0<5){continue}break}b=J[d+4>>2];e=J[d+116>>2];if((e|0)>0|(e|0)>=0){b=b-1|0;J[d+4>>2]=b;}b=b-J[d+44>>2]|0;f=b;i=o+J[d+124>>2]|0;e=b>>31;b=m+J[d+120>>2]|0;o=e+(b>>>0<m>>>0?i+1|0:i)|0;m=b+f|0;o=m>>>0<b>>>0?o+1|0:o;}i=c;n=c>>31;Yb(d,c,n);b=J[d+4>>2];v:{if((b|0)!=J[d+104>>2]){J[d+4>>2]=b+1;break v}if((gb(d)|0)<0){break f}}b=J[d+116>>2];if((b|0)>0|(b|0)>=0){J[d+4>>2]=J[d+4>>2]-1;}b=16;w:{x:{y:{z:{A:{switch(q-88|0){default:b=q-65|0;if(b>>>0>6|!(1<<b&113)){break w}case 9:case 13:case 14:case 15:ig(j+8|0,d,u,0);c=J[d+4>>2]-J[d+44>>2]|0;if(J[d+120>>2]!=(0-c|0)|J[d+124>>2]!=(0-((c>>31)+((c|0)!=0)|0)|0)){break y}break g;case 3:case 11:case 27:if((q|16)==115){Sb(j+32|0,-1,257);H[j+32|0]=0;if((q|0)!=115){break x}H[j+65|0]=0;H[j+46|0]=0;I[j+42>>1]=0;I[j+44>>1]=0;break x}f=K[h+1|0];e=(f|0)==94;Sb(j+32|0,e,257);H[j+32|0]=0;b=e?h+2|0:h+1|0;B:{C:{D:{e=K[(e?2:1)+h|0];if((e|0)!=45){if((e|0)==93){break D}k=(f|0)!=94;break B}k=(f|0)!=94;H[j+78|0]=k;break C}k=(f|0)!=94;H[j+126|0]=k;}b=b+1|0;}h=b;while(1){f=K[h|0];E:{if((f|0)!=45){if(!f){break f}if((f|0)==93){break x}break E}f=45;g=K[h+1|0];if(!g|(g|0)==93){break E}e=h+1|0;b=K[h-1|0];F:{if(g>>>0<=b>>>0){f=g;break F}while(1){b=b+1|0;H[b+(j+32|0)|0]=k;f=K[e|0];if(f>>>0>b>>>0){continue}break}}h=e;}H[(f+j|0)+33|0]=k;h=h+1|0;continue}case 23:b=8;break z;case 12:case 29:b=10;break z;case 1:case 2:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 28:case 30:case 31:break w;case 0:case 24:case 32:break z;case 17:break A}}b=0;}e=0;i=0;f=0;g=0;w=0;v=Ua-16|0;Ua=v;G:{if((b|0)==1){J[5732]=28;break G}while(1){c=J[d+4>>2];H:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break H}c=gb(d);}if((c|0)==32|c-9>>>0<5){continue}break}I:{J:{switch(c-43|0){case 0:case 2:break J;default:break I}}w=(c|0)==45?-1:0;c=J[d+4>>2];if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break I}c=gb(d);}K:{L:{M:{N:{if(!((b|0)!=0&(b|0)!=16|(c|0)!=48)){c=J[d+4>>2];O:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break O}c=gb(d);}if((c&-33)==88){b=16;c=J[d+4>>2];P:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break P}c=gb(d);}if(K[c+8641|0]<16){break M}b=J[d+116>>2];if((b|0)>0|(b|0)>=0){J[d+4>>2]=J[d+4>>2]-1;}Yb(d,0,0);break G}if(b){break N}b=8;break M}b=b?b:10;if(b>>>0>K[c+8641|0]){break N}b=J[d+116>>2];if((b|0)>0|(b|0)>=0){J[d+4>>2]=J[d+4>>2]-1;}Yb(d,0,0);J[5732]=28;break G}if((b|0)!=10){break M}f=c-48|0;if(f>>>0<=9){c=0;while(1){c=P(c,10)+f|0;g=c>>>0<429496729;e=J[d+4>>2];Q:{if((e|0)!=J[d+104>>2]){J[d+4>>2]=e+1;b=K[e|0];break Q}b=gb(d);}f=b-48|0;if(g&f>>>0<=9){continue}break}e=c;}if(f>>>0>9){break K}b=co(e,0,10,0);g=Wa;while(1){e=b+f|0;i=e>>>0<f>>>0?g+1|0:g;b=(i|0)==429496729&e>>>0<2576980378|i>>>0<429496729;c=J[d+4>>2];R:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break R}c=gb(d);}k=c-48|0;if(!(b&k>>>0<=9)){b=10;if(k>>>0<=9){break L}break K}b=co(e,i,10,0);g=Wa;f=k;if((g|0)==-1&(f^-1)>>>0>=b>>>0|(g|0)!=-1){continue}break}b=10;break L}if(b-1&b){g=K[c+8641|0];if(g>>>0<b>>>0){while(1){f=P(b,f)+g|0;e=f>>>0<119304647;c=J[d+4>>2];S:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break S}c=gb(d);}g=K[c+8641|0];if(e&g>>>0<b>>>0){continue}break}e=f;}if(b>>>0<=g>>>0){break L}n=b;while(1){f=co(e,i,n,0);k=Wa;g=g&255;if((k|0)==-1&(g^-1)>>>0<f>>>0){break L}i=k;e=f+g|0;i=e>>>0<g>>>0?i+1|0:i;c=J[d+4>>2];T:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break T}c=gb(d);}g=K[c+8641|0];if(b>>>0<=g>>>0){break L}xb(v,n,0,0,0,e,i,0,0);if(!(J[v+8>>2]|J[v+12>>2])){continue}break}break L}k=H[(P(b,23)>>>5&7)+8897|0];f=K[c+8641|0];if(f>>>0<b>>>0){while(1){g=g<<k|f;e=g>>>0<134217728;c=J[d+4>>2];U:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break U}c=gb(d);}f=K[c+8641|0];if(e&f>>>0<b>>>0){continue}break}e=g;}if(b>>>0<=f>>>0){break L}n=k&31;if((k&63)>>>0>=32){g=0;n=-1>>>n|0;}else {g=-1>>>n|0;n=g|(1<<n)-1<<32-n;}if(!g&e>>>0>n>>>0){break L}while(1){x=f&255;c=e;f=k&31;if((k&63)>>>0>=32){i=c<<f;c=0;}else {i=(1<<f)-1&c>>>32-f|i<<f;c=c<<f;}e=x|c;c=J[d+4>>2];V:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break V}c=gb(d);}f=K[c+8641|0];if(b>>>0<=f>>>0){break L}if((g|0)==(i|0)&e>>>0<=n>>>0|g>>>0>i>>>0){continue}break}}if(K[c+8641|0]>=b>>>0){break K}while(1){c=J[d+4>>2];W:{if((c|0)!=J[d+104>>2]){J[d+4>>2]=c+1;c=K[c|0];break W}c=gb(d);}if(K[c+8641|0]<b>>>0){continue}break}J[5732]=68;e=-1;i=-1;w=0;}b=J[d+116>>2];if((b|0)>0|(b|0)>=0){J[d+4>>2]=J[d+4>>2]-1;}b=w;f=b^e;e=f-b|0;c=b>>31;i=(c^i)-((b>>>0>f>>>0)+c|0)|0;}Ua=v+16|0;c=J[d+4>>2]-J[d+44>>2]|0;if(J[d+120>>2]==(0-c|0)&J[d+124>>2]==(0-((c>>31)+((c|0)!=0)|0)|0)){break g}if(!(!l|(q|0)!=112)){J[l>>2]=e;break w}gg(l,u,e,i);break w}if(!l){break w}c=J[j+16>>2];f=J[j+20>>2];b=J[j+8>>2];e=J[j+12>>2];X:{switch(u|0){case 0:N[l>>2]=Vf(b,e,c,f);break w;case 1:O[l>>3]=ge(b,e,c,f);break w;case 2:break X;default:break w}}J[l>>2]=b;J[l+4>>2]=e;J[l+8>>2]=c;J[l+12>>2]=f;break w}k=(q|0)!=99;c=k?31:c+1|0;Y:{if((u|0)==1){f=l;if(r){f=sb(c<<2);if(!f){break h}}J[j+296>>2]=0;J[j+300>>2]=0;b=0;while(1){a=f;Z:{while(1){e=J[d+4>>2];_:{if((e|0)!=J[d+104>>2]){J[d+4>>2]=e+1;e=K[e|0];break _}e=gb(d);}if(!K[(e+j|0)+33|0]){break Z}H[j+27|0]=e;e=qd(j+28|0,j+27|0,1,j+296|0);if((e|0)==-2){continue}p=0;if((e|0)==-1){break f}if(a){J[(b<<2)+a>>2]=J[j+28>>2];b=b+1|0;}if(!r|(b|0)!=(c|0)){continue}break}g=1;b=c;c=b<<1|1;f=Vc(a,c<<2);if(f){continue}break e}break}p=0;c=a;if(j+296|0?J[j+296>>2]:0){break f}break Y}if(r){b=0;f=sb(c);if(!f){break h}while(1){a=f;while(1){e=J[d+4>>2];$:{if((e|0)!=J[d+104>>2]){J[d+4>>2]=e+1;e=K[e|0];break $}e=gb(d);}if(!K[(e+j|0)+33|0]){c=0;p=a;break Y}H[a+b|0]=e;b=b+1|0;if((c|0)!=(b|0)){continue}break}g=1;b=c;c=b<<1|1;f=Vc(a,c);if(f){continue}break}p=a;a=0;break e}b=0;if(l){while(1){a=J[d+4>>2];aa:{if((a|0)!=J[d+104>>2]){J[d+4>>2]=a+1;a=K[a|0];break aa}a=gb(d);}if(K[(a+j|0)+33|0]){H[b+l|0]=a;b=b+1|0;continue}else {c=0;a=l;p=a;break Y}}}while(1){a=J[d+4>>2];ba:{if((a|0)!=J[d+104>>2]){J[d+4>>2]=a+1;a=K[a|0];break ba}a=gb(d);}if(K[(a+j|0)+33|0]){continue}break}a=0;p=0;c=0;}f=J[d+4>>2];e=J[d+116>>2];if((e|0)>0|(e|0)>=0){f=f-1|0;J[d+4>>2]=f;}e=f-J[d+44>>2]|0;f=e+J[d+120>>2]|0;g=J[d+124>>2]+(e>>31)|0;g=f>>>0<e>>>0?g+1|0:g;if(!(g|f)|!(k|(f|0)==(i|0)&(g|0)==(n|0))){break i}if(r){J[l>>2]=a;}ca:{if((q|0)==99){break ca}if(c){J[(b<<2)+c>>2]=0;}if(!p){p=0;break ca}H[b+p|0]=0;}a=c;}b=J[d+4>>2]-J[d+44>>2]|0;e=b;f=o+J[d+124>>2]|0;c=b>>31;b=m+J[d+120>>2]|0;i=c+(b>>>0<m>>>0?f+1|0:f)|0;m=b+e|0;o=m>>>0<b>>>0?i+1|0:i;t=((l|0)!=0)+t|0;}b=h+1|0;h=K[h+1|0];if(h){continue}break a}break}a=c;break g}g=1;p=0;a=0;break e}g=r;break b}g=r;}if(t){break b}}t=-1;}if(!g){break a}$a(p);$a(a);}Ua=j+304|0;Ua=d+144|0;return t}function ao(a){a=a|0;var b=0,c=0,d=0,e=0,f=0,g=0;d=Ua-320|0;Ua=d;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{if(!K[24336]){J[d+208>>2]=0;J[d+200>>2]=0;J[d+204>>2]=0;J[5996]=0;ba(66,24324,d+200|0,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break w}b=J[d+200>>2];if(b){J[d+204>>2]=b;$a(b);}H[24336]=1;}if(!K[24352]){J[5996]=0;b=d+200|0;ea(68,b|0,1598,8);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+308|0,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24340,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break v}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24352]=1;}if(!K[24368]){J[5996]=0;b=d+200|0;ea(68,b|0,1194,10);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+296|0,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24356,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break u}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24368]=1;}if(!K[24384]){J[5996]=0;b=d+200|0;ea(68,b|0,2432,6);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+284|0,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24372,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break t}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24384]=1;}if(!K[24400]){J[5996]=0;b=d+200|0;ea(68,b|0,1492,6);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+272|0,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24388,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break s}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24400]=1;}if(!K[24416]){J[5996]=0;b=d+200|0;ea(68,b|0,1152,8);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+260|0,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24404,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break r}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24416]=1;}if(!K[24432]){J[5996]=0;b=d+200|0;ea(68,b|0,1526,8);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+248|0,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24420,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break q}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24432]=1;}if(!K[24448]){J[5996]=0;b=d+200|0;ea(68,b|0,1628,10);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+236|0,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24436,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break p}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24448]=1;}if(!K[24464]){J[5996]=0;b=d+116|0;ea(68,b|0,1435,7);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ea(68,d+124|0,1183,10);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;c=ba(69,d+200|0,b|0,2)|0;b=J[5996];J[5996]=0;if((b|0)==1){break c}J[5996]=0;e=d+80|0;ea(68,e|0,1478,7);f=J[5996];J[5996]=0;b=c+12|0;if((f|0)==1){break n}J[5996]=0;ea(68,d+88|0,1172,10);f=J[5996];J[5996]=0;if((f|0)==1){break n}J[5996]=0;f=ba(69,b|0,e|0,2)|0;e=J[5996];J[5996]=0;if((e|0)==1){break n}J[5996]=0;e=d+56|0;ea(68,e|0,1435,7);g=J[5996];J[5996]=0;b=c+24|0;if((g|0)==1){break n}J[5996]=0;ea(68,d- -64|0,1161,10);g=J[5996];J[5996]=0;if((g|0)==1){break n}J[5996]=0;g=ba(69,b|0,e|0,2)|0;e=J[5996];J[5996]=0;if((e|0)==1){break n}J[5996]=0;ba(66,24452,c|0,3)|0;b=J[5996];J[5996]=0;if((b|0)==1){break o}b=J[g>>2];if(b){J[c+28>>2]=b;$a(b);}b=J[f>>2];if(b){J[c+16>>2]=b;$a(b);}b=J[c>>2];if(b){J[c+4>>2]=b;$a(b);}H[24464]=1;}if(!K[24480]){J[5996]=0;b=d+116|0;ea(68,b|0,1628,10);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ea(68,d+124|0,1617,10);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+188|0,b|0,2)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24468,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break m}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24480]=1;}if(!K[24496]){J[5996]=0;b=d+116|0;ea(68,b|0,1462,8);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ea(68,d+124|0,1453,8);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+176|0,b|0,2)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24484,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break l}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24496]=1;}if(!K[24512]){J[5996]=0;b=d+116|0;ea(68,b|0,1443,9);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ea(68,d+124|0,1587,10);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+164|0,b|0,2)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24500,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break k}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24512]=1;}if(!K[24528]){J[5996]=0;b=d+116|0;ea(68,b|0,1443,9);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ea(68,d+124|0,1471,6);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;b=ba(69,d+152|0,b|0,2)|0;c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ba(66,24516,b|0,1)|0;c=J[5996];J[5996]=0;if((c|0)==1){break j}c=J[b>>2];if(c){J[b+4>>2]=c;$a(c);}H[24528]=1;}if(!K[24544]){J[5996]=0;b=d+80|0;ea(68,b|0,1535,9);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ea(68,d+88|0,1535,9);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;c=ba(69,d+116|0,b|0,2)|0;b=J[5996];J[5996]=0;if((b|0)==1){break c}J[5996]=0;e=d+56|0;ea(68,e|0,1555,9);f=J[5996];J[5996]=0;b=c+12|0;if((f|0)==1){break h}J[5996]=0;ea(68,d- -64|0,1555,9);f=J[5996];J[5996]=0;if((f|0)==1){break h}J[5996]=0;f=ba(69,b|0,e|0,2)|0;e=J[5996];J[5996]=0;if((e|0)==1){break h}J[5996]=0;e=d+32|0;ea(68,e|0,1545,9);g=J[5996];J[5996]=0;b=c+24|0;if((g|0)==1){break h}J[5996]=0;ea(68,d+40|0,1545,9);g=J[5996];J[5996]=0;if((g|0)==1){break h}J[5996]=0;g=ba(69,b|0,e|0,2)|0;e=J[5996];J[5996]=0;if((e|0)==1){break h}J[5996]=0;ba(66,24532,c|0,3)|0;b=J[5996];J[5996]=0;if((b|0)==1){break i}b=J[g>>2];if(b){J[c+28>>2]=b;$a(b);}b=J[f>>2];if(b){J[c+16>>2]=b;$a(b);}b=J[c>>2];if(b){J[c+4>>2]=b;$a(b);}H[24544]=1;}if(!K[24560]){J[5996]=0;b=d+56|0;ea(68,b|0,1443,9);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ea(68,d- -64|0,1517,8);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;ea(68,d+72|0,1587,10);c=J[5996];J[5996]=0;if((c|0)==1){break c}J[5996]=0;c=ba(69,d+80|0,b|0,3)|0;b=J[5996];J[5996]=0;if((b|0)==1){break c}J[5996]=0;e=d+32|0;ea(68,e|0,1443,9);f=J[5996];J[5996]=0;b=c+12|0;if((f|0)==1){break f}J[5996]=0;ea(68,d+40|0,1508,8);f=J[5996];J[5996]=0;if((f|0)==1){break f}J[5996]=0;ea(68,d+48|0,1576,10);f=J[5996];J[5996]=0;if((f|0)==1){break f}J[5996]=0;f=ba(69,b|0,e|0,3)|0;e=J[5996];J[5996]=0;if((e|0)==1){break f}J[5996]=0;e=d+8|0;ea(68,e|0,1443,9);g=J[5996];J[5996]=0;b=c+24|0;if((g|0)==1){break f}J[5996]=0;ea(68,d+16|0,1499,8);g=J[5996];J[5996]=0;if((g|0)==1){break f}J[5996]=0;ea(68,d+24|0,1565,10);g=J[5996];J[5996]=0;if((g|0)==1){break f}J[5996]=0;g=ba(69,b|0,e|0,3)|0;e=J[5996];J[5996]=0;if((e|0)==1){break f}J[5996]=0;ba(66,24548,c|0,3)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}b=J[g>>2];if(b){J[c+28>>2]=b;$a(b);}b=J[f>>2];if(b){J[c+16>>2]=b;$a(b);}b=J[c>>2];if(b){J[c+4>>2]=b;$a(b);}H[24560]=1;}if(!(50331647>>>a&1)){break e}Ua=d+320|0;return J[(a<<2)+6864>>2]}e=Z()|0;a=J[d+200>>2];if(!a){break d}J[d+204>>2]=a;$a(a);break d}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[g>>2];if(a){J[c+28>>2]=a;$a(a);}a=J[f>>2];if(a){J[c+16>>2]=a;$a(a);}a=J[c>>2];if(!a){break d}break a}e=Z()|0;while(1){a=b-12|0;d=J[a>>2];if(d){J[b-8>>2]=d;$a(d);}b=a;if((b|0)!=(c|0)){continue}break}break d}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[b>>2];if(!a){break d}break b}e=Z()|0;a=J[g>>2];if(a){J[c+28>>2]=a;$a(a);}a=J[f>>2];if(a){J[c+16>>2]=a;$a(a);}a=J[c>>2];if(!a){break d}break a}e=Z()|0;while(1){a=b-12|0;d=J[a>>2];if(d){J[b-8>>2]=d;$a(d);}b=a;if((b|0)!=(c|0)){continue}break}break d}e=Z()|0;a=J[g>>2];if(a){J[c+28>>2]=a;$a(a);}a=J[f>>2];if(a){J[c+16>>2]=a;$a(a);}a=J[c>>2];if(!a){break d}break a}e=Z()|0;while(1){a=b-12|0;d=J[a>>2];if(d){J[b-8>>2]=d;$a(d);}b=a;if((b|0)!=(c|0)){continue}break}break d}la(2350,1900,622,1759);B();}da(e|0);B();}da(Z()|0);B();}J[b+4>>2]=a;$a(a);da(e|0);B();}J[c+4>>2]=a;$a(a);da(e|0);B();}function wd(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;h=Ua-144|0;Ua=h;Yc(h+56|0,c,O[a+16>>3],O[a+24>>3],0,0);J[5996]=0;f=$(46,c|0)|0;g=J[5996];J[5996]=0;a:{b:{c:{if((g|0)!=1){J[h+52>>2]=0;J[h+44>>2]=0;J[h+48>>2]=0;H[h+128|0]=0;J[h+124>>2]=h+44;g=J[f+4>>2];j=J[f>>2];k=g-j|0;i=(k|0)/12|0;if((g|0)!=(j|0)){d:{e:{f:{if(i>>>0>=357913942){J[5996]=0;ca(47);a=J[5996];J[5996]=0;if((a|0)==1){break f}break a}J[5996]=0;g=$(3,k|0)|0;j=J[5996];J[5996]=0;if((j|0)==1){break f}J[h+48>>2]=g;J[h+44>>2]=g;J[h+52>>2]=g+P(i,12);i=J[f+4>>2];f=J[f>>2];J[5996]=0;f=ia(48,h+52|0,f|0,i|0,g|0)|0;i=J[5996];J[5996]=0;if((i|0)!=1){break d}f=Z()|0;J[h+48>>2]=g;break e}f=Z()|0;}Nc(h+124|0);break c}J[h+48>>2]=f;}J[h+40>>2]=0;J[h+32>>2]=0;J[h+36>>2]=0;f=J[d+4>>2];g=J[d>>2];J[5996]=0;aa(49,h+32|0,f-g>>2);f=J[5996];J[5996]=0;g:{if((f|0)!=1){f=J[h+48>>2];g=J[h+44>>2];if((f|0)==(g|0)){break b}f=g;h:{while(1){i:{J[h+28>>2]=0;J[h+20>>2]=0;J[h+24>>2]=0;i=J[d+4>>2];g=J[d>>2];n=P(s,12);f=n+f|0;if(i-g>>2!=J[f+4>>2]-J[f>>2]>>3){break i}j=0;r=1;k=0;j:{if((g|0)!=(i|0)){k:{l:{m:{while(1){f=k<<3;v=O[f+J[h+68>>2]>>3];w=O[f+J[h+56>>2]>>3];g=J[(k<<2)+g>>2];J[5996]=0;g=qa(50,g|0,+w,+v,b|0)|0;i=J[5996];J[5996]=0;if((i|0)==1){break l}f=f+J[n+J[h+44>>2]>>2]|0;i=J[f>>2];f=J[f+4>>2];m=J[g+4>>2];g=J[g>>2];J[5996]=0;oa(51,h+124|0,g|0,m|0,i|0,f|0);f=J[5996];J[5996]=0;if((f|0)!=1){i=J[h+28>>2];n:{if(i>>>0>j>>>0){J[j+8>>2]=0;J[j>>2]=0;J[j+4>>2]=0;J[j>>2]=J[h+124>>2];J[j+4>>2]=J[h+128>>2];J[j+8>>2]=J[h+132>>2];J[h+24>>2]=j+12;break n}o:{g=J[h+20>>2];m=(j-g|0)/12|0;f=m+1|0;p:{if(f>>>0>=357913942){J[5996]=0;ca(52);break p}i=(i-g|0)/12|0;l=i<<1;f=i>>>0>=178956970?357913941:f>>>0<l>>>0?l:f;if(f>>>0<357913942){break o}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}break m}J[5996]=0;l=P(f,12);i=$(3,l|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break m}f=i+P(m,12)|0;J[f>>2]=J[h+124>>2];J[f+4>>2]=J[h+128>>2];J[f+8>>2]=J[h+132>>2];J[h+132>>2]=0;J[h+124>>2]=0;J[h+128>>2]=0;i=i+l|0;m=f+12|0;q:{if((g|0)==(j|0)){J[h+28>>2]=i;J[h+24>>2]=m;J[h+20>>2]=f;break q}while(1){f=f-12|0;j=j-12|0;J[f>>2]=J[j>>2];J[f+4>>2]=J[j+4>>2];J[f+8>>2]=J[j+8>>2];J[j+8>>2]=0;J[j>>2]=0;J[j+4>>2]=0;if((g|0)!=(j|0)){continue}break}J[h+28>>2]=i;g=J[h+24>>2];J[h+24>>2]=m;j=J[h+20>>2];J[h+20>>2]=f;if((g|0)==(j|0)){break q}while(1){l=g-12|0;m=J[l>>2];if(m){o=g-8|0;f=J[o>>2];i=m;if((f|0)!=(i|0)){while(1){f=f-32|0;g=J[f+4>>2];r:{if(!g){break r}i=J[g+4>>2];J[g+4>>2]=i-1;if(i){break r}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((f|0)!=(m|0)){continue}break}i=J[l>>2];}J[o>>2]=m;$a(i);}g=l;if((j|0)!=(g|0)){continue}break}}if(j){$a(j);}i=J[h+124>>2];if(!i){break n}f=J[h+128>>2];g=i;if((f|0)!=(g|0)){while(1){f=f-32|0;g=J[f+4>>2];s:{if(!g){break s}j=J[g+4>>2];J[g+4>>2]=j-1;if(j){break s}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((f|0)!=(i|0)){continue}break}g=J[h+124>>2];}J[h+128>>2]=i;$a(g);}j=J[h+24>>2];f=j-12|0;r=P(J[f+4>>2]-J[f>>2]>>5,r);k=k+1|0;g=J[d>>2];if(k>>>0>=J[d+4>>2]-g>>2>>>0){break k}continue}break}f=Z()|0;break h}f=Z()|0;_b(h+124|0);break h}f=Z()|0;break h}if(!r){break j}}m=0;t:{u:{v:{w:{while(1){j=J[h+32>>2];if(J[d+4>>2]!=J[d>>2]){f=0;i=J[h+20>>2];g=m;while(1){k=P(f,12);l=k+i|0;i=J[l>>2];J[(f<<2)+j>>2]=i+((g>>>0)%(J[l+4>>2]-i>>5>>>0)<<5);l=g;i=J[h+20>>2];g=k+i|0;g=(l>>>0)/(J[g+4>>2]-J[g>>2]>>5>>>0)|0;f=f+1|0;if(f>>>0<J[d+4>>2]-J[d>>2]>>2>>>0){continue}break}}J[h+108>>2]=0;J[h+100>>2]=0;J[h+104>>2]=0;f=j;n=J[h+36>>2];if((f|0)!=(n|0)){x:{while(1){y:{k=J[j>>2];f=J[h+104>>2];z:{if((f|0)!=J[h+108>>2]){J[f>>2]=J[k>>2];g=J[k+4>>2];J[f+4>>2]=g;if(g){J[g+4>>2]=J[g+4>>2]+1;}J[h+104>>2]=f+8;break z}A:{i=J[h+100>>2];g=f-i|0;o=g>>3;l=o+1|0;B:{if(l>>>0>=536870912){J[5996]=0;ca(59);break B}p=g>>2;g=g>>>0>=2147483640?536870911:l>>>0<p>>>0?p:l;if(g>>>0<536870912){break A}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}f=Z()|0;break t}J[5996]=0;p=g<<3;l=$(3,p|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break y}g=l+(o<<3)|0;J[g>>2]=J[k>>2];k=J[k+4>>2];J[g+4>>2]=k;if(k){J[k+4>>2]=J[k+4>>2]+1;f=J[h+104>>2];}k=l+p|0;l=g+8|0;C:{if((f|0)==(i|0)){J[h+108>>2]=k;J[h+104>>2]=l;J[h+100>>2]=g;break C}while(1){g=g-8|0;f=f-8|0;J[g>>2]=J[f>>2];J[g+4>>2]=J[f+4>>2];J[f>>2]=0;J[f+4>>2]=0;if((f|0)!=(i|0)){continue}break}J[h+108>>2]=k;f=J[h+104>>2];J[h+104>>2]=l;i=J[h+100>>2];J[h+100>>2]=g;if((f|0)==(i|0)){break C}while(1){f=f-8|0;g=J[f+4>>2];D:{if(!g){break D}k=J[g+4>>2];J[g+4>>2]=k-1;if(k){break D}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((f|0)!=(i|0)){continue}break}}if(!i){break z}$a(i);}j=j+4|0;if((n|0)!=(j|0)){continue}break x}break}f=Z()|0;break t}j=J[h+36>>2];f=J[h+32>>2];}J[5996]=0;va(63,h+80|0,c|0,f|0,j|0,0);f=J[5996];J[5996]=0;if((f|0)==1){break u}J[5996]=0;j=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)==1){break u}J[j>>2]=7e3;J[j+4>>2]=0;J[j+8>>2]=0;p=J[h+100>>2];J[h+112>>2]=p;q=J[h+104>>2];J[h+116>>2]=q;l=J[h+108>>2];f=0;J[h+108>>2]=0;J[h+120>>2]=l;J[h+100>>2]=0;J[h+104>>2]=0;g=J[e>>2];n=J[e+4>>2];E:{if((g|0)==(n|0)){k=0;i=0;break E}o=n-g|0;if((o|0)<0){J[5996]=0;ca(8);a=J[5996];J[5996]=0;if((a|0)!=1){break a}f=Z()|0;break v}J[5996]=0;k=$(3,o|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break w}t=n+(g^-1)|0;i=0;f=k;u=o&7;if(u){while(1){H[f|0]=K[g|0];f=f+1|0;g=g+1|0;i=i+1|0;if((u|0)!=(i|0)){continue}break}}i=k+o|0;if(t>>>0<7){break E}while(1){H[f|0]=K[g|0];H[f+1|0]=K[g+1|0];H[f+2|0]=K[g+2|0];H[f+3|0]=K[g+3|0];H[f+4|0]=K[g+4|0];H[f+5|0]=K[g+5|0];H[f+6|0]=K[g+6|0];H[f+7|0]=K[g+7|0];f=f+8|0;g=g+8|0;if((n|0)!=(g|0)){continue}break}l=J[h+120>>2];q=J[h+116>>2];p=J[h+112>>2];}J[j+12>>2]=c;J[j+16>>2]=0;J[j+20>>2]=0;J[j+24>>2]=0;J[j+28>>2]=0;J[j+52>>2]=l;J[j+48>>2]=q;o=j+44|0;J[o>>2]=p;J[j+40>>2]=i;J[j+36>>2]=f;J[j+32>>2]=k;J[h+120>>2]=0;J[h+112>>2]=0;J[h+116>>2]=0;J[5996]=0;i=j+12|0;aa(86,j+56|0,i|0);f=J[5996];J[5996]=0;F:{if((f|0)==1){break F}J[5996]=0;aa(87,j+76|0,i|0);f=J[5996];J[5996]=0;if((f|0)==1){break F}J[5996]=0;f=$(88,i|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break F}J[j+92>>2]=f;g=0;l=0;k=J[j+44>>2];f=k;n=J[j+48>>2];if((f|0)!=(n|0)){while(1){g=J[J[f>>2]+84>>2]+g|0;f=f+8|0;if((n|0)!=(f|0)){continue}break}l=J[J[k>>2]+80>>2];}f=J[j+16>>2];p=J[j+12>>2];q=J[j+20>>2];t=J[j+24>>2];J[5996]=0;f=ka(89,p|0,l|0,g|0,f|0,n-k>>3,(t-q|0)/12|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break F}J[j+96>>2]=f;J[5996]=0;J[h+140>>2]=i;ea(90,h+124|0,i|0,h+140|0);f=J[5996];J[5996]=0;if((f|0)==1){break F}f=K[h+136|0];if(f){Db(J[h+128>>2]);}H[j+100|0]=f^1;J[h+128>>2]=j;J[h+124>>2]=i;J[5996]=0;f=J[h+128>>2];J[h+8>>2]=J[h+124>>2];J[h+12>>2]=f;ea(61,a|0,h+80|0,h+8|0);f=J[5996];J[5996]=0;if((f|0)==1){break u}g=J[h+100>>2];if(g){f=J[h+104>>2];if((g|0)!=(f|0)){while(1){f=f-8|0;i=J[f+4>>2];G:{if(!i){break G}j=J[i+4>>2];J[i+4>>2]=j-1;if(j){break G}Xa[J[J[i>>2]+8>>2]](i);bb(i);}if((f|0)!=(g|0)){continue}break}g=J[h+100>>2];}$a(g);}m=m+1|0;if((r|0)!=(m|0)){continue}break j}break}f=Z()|0;lb(o);a=J[j+32>>2];if(a){J[j+36>>2]=a;$a(a);}rb(j+20|0);break v}f=Z()|0;}lb(h+112|0);$a(j);break t}f=Z()|0;}lb(h+100|0);break h}i=J[h+20>>2];if(i){f=J[h+24>>2];if((i|0)!=(f|0)){while(1){k=f-12|0;j=J[k>>2];if(j){m=f-8|0;f=J[m>>2];g=j;if((f|0)!=(g|0)){while(1){f=f-32|0;g=J[f+4>>2];H:{if(!g){break H}l=J[g+4>>2];J[g+4>>2]=l-1;if(l){break H}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((f|0)!=(j|0)){continue}break}g=J[k>>2];}J[m>>2]=j;$a(g);}f=k;if((i|0)!=(f|0)){continue}break}i=J[h+20>>2];}$a(i);}s=s+1|0;f=J[h+44>>2];if(s>>>0<(J[h+48>>2]-f|0)/12>>>0){continue}break b}break}J[5996]=0;ga(44,5170,1900,642,2497);a=J[5996];J[5996]=0;if((a|0)!=1){break a}f=Z()|0;}Xc(h+20|0);break g}f=Z()|0;}a=J[h+32>>2];if(a){$a(a);}Wc(h+44|0);break c}f=Z()|0;}Mc(h+56|0);da(f|0);B();}a=J[h+32>>2];if(a){$a(a);f=J[h+44>>2];}if(f){g=f;i=J[h+48>>2];if((i|0)!=(f|0)){while(1){a=i-12|0;b=J[a>>2];if(b){J[i-8>>2]=b;$a(b);}i=a;if((i|0)!=(f|0)){continue}break}g=J[h+44>>2];}J[h+48>>2]=f;$a(g);}a=J[h+68>>2];if(a){J[h+72>>2]=a;$a(a);}a=J[h+56>>2];if(a){J[h+60>>2]=a;$a(a);}Ua=h+144|0;return}B();}function Wm(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;j=Ua-208|0;Ua=j;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{x:{y:{z:{k=Gb(a);if(k>>>0>=2147483632){J[5996]=0;ca(2);a=J[5996];J[5996]=0;if((a|0)==1){break z}break a}A:{if(k>>>0<=10){H[j+171|0]=k;n=j+160|0;break A}J[5996]=0;m=(k|15)+1|0;n=$(3,m|0)|0;l=J[5996];J[5996]=0;if((l|0)==1){break z}J[j+160>>2]=n;J[j+164>>2]=k;J[j+168>>2]=m|-2147483648;}H[fb(n,a,k)+k|0]=0;l=J[j+160>>2];a=K[j+171|0];p=a<<24>>24;k=(p|0)<0;o=k?l:j+160|0;r=k?J[j+164>>2]:a;k=o+r|0;n=-1;B:{while(1){if((k|0)==(o|0)){break B}k=k-1|0;m=K[k|0];s=m>>>0<=63;a=m&31;if((m&63)>>>0>=32){m=1<<a;a=0;}else {q=1<<a;m=q-1&1>>>32-a;a=q;}a=a&9728;if(s&(m&1|(a|0)!=0)){continue}break}n=k-o|0;}a=n+1|0;if(a>>>0>r>>>0){J[5996]=0;ca(108);a=J[5996];J[5996]=0;if((a|0)!=1){break a}k=fa(22864)|0;a=Va;break l}C:{if((p|0)<0){J[j+164>>2]=a;break C}H[j+171|0]=a;l=j+160|0;}H[a+l|0]=0;J[j+152>>2]=0;J[j+156>>2]=0;D:{if(H[j+171|0]>=0){J[j+144>>2]=J[j+168>>2];a=J[j+164>>2];J[j+136>>2]=J[j+160>>2];J[j+140>>2]=a;break D}J[5996]=0;ea(40,j+136|0,J[j+160>>2],J[j+164>>2]);a=J[5996];J[5996]=0;if((a|0)==1){break y}}J[5996]=0;a=j+172|0;aa(109,a|0,j+136|0);k=J[5996];J[5996]=0;if((k|0)==1){break x}m=a;a=H[j+183|0];k=(a|0)<0;J[j+104>>2]=k?J[j+172>>2]:m;J[j+108>>2]=k?J[j+176>>2]:a&255;J[5996]=0;a=J[j+108>>2];J[j+8>>2]=J[j+104>>2];J[j+12>>2]=a;aa(140,j+16|0,j+8|0);a=J[5996];J[5996]=0;if((a|0)==1){break w}a=J[j+20>>2];J[j+156>>2]=a;k=J[j+16>>2];J[j+152>>2]=k;if(H[j+183|0]<0){$a(J[j+172>>2]);}if(H[j+147|0]<0){$a(J[j+136>>2]);}E:{if(!k){break E}n=J[k+80>>2];if(!n|M[k+84>>2]>3600){break E}J[5996]=0;m=_(54,3557,1)|0;l=J[5996];J[5996]=0;if((l|0)==1){break u}if(!((n^-1)&m)){break r}}J[5996]=0;f=$(3,32)|0;g=J[5996];J[5996]=0;if((g|0)==1){break t}H[f+16|0]=0;g=K[2571]|K[2572]<<8|(K[2573]<<16|K[2574]<<24);h=K[2567]|K[2568]<<8|(K[2569]<<16|K[2570]<<24);H[f+8|0]=h;H[f+9|0]=h>>>8;H[f+10|0]=h>>>16;H[f+11|0]=h>>>24;H[f+12|0]=g;H[f+13|0]=g>>>8;H[f+14|0]=g>>>16;H[f+15|0]=g>>>24;g=K[2563]|K[2564]<<8|(K[2565]<<16|K[2566]<<24);h=K[2559]|K[2560]<<8|(K[2561]<<16|K[2562]<<24);H[f|0]=h;H[f+1|0]=h>>>8;H[f+2|0]=h>>>16;H[f+3|0]=h>>>24;H[f+4|0]=g;H[f+5|0]=g>>>8;H[f+6|0]=g>>>16;H[f+7|0]=g>>>24;g=((c|0)>=17?17:c)-1|0;H[fb(b,f,g)+g|0]=0;$a(f);J[5996]=0;f=$(3,32)|0;g=J[5996];J[5996]=0;if((g|0)==1){break s}H[f+16|0]=0;c=K[2571]|K[2572]<<8|(K[2573]<<16|K[2574]<<24);b=f;f=K[2567]|K[2568]<<8|(K[2569]<<16|K[2570]<<24);H[b+8|0]=f;H[b+9|0]=f>>>8;H[b+10|0]=f>>>16;H[b+11|0]=f>>>24;H[b+12|0]=c;H[b+13|0]=c>>>8;H[b+14|0]=c>>>16;H[b+15|0]=c>>>24;c=K[2563]|K[2564]<<8|(K[2565]<<16|K[2566]<<24);f=K[2559]|K[2560]<<8|(K[2561]<<16|K[2562]<<24);H[b|0]=f;H[b+1|0]=f>>>8;H[b+2|0]=f>>>16;H[b+3|0]=f>>>24;H[b+4|0]=c;H[b+5|0]=c>>>8;H[b+6|0]=c>>>16;H[b+7|0]=c>>>24;c=((e|0)>=17?17:e)-1|0;H[fb(d,b,c)+c|0]=0;$a(b);break q}k=fa(22864)|0;a=Va;break k}k=fa(22864)|0;a=Va;break m}k=fa(22864)|0;a=Va;break v}k=fa(22864)|0;a=Va;if(H[j+183|0]>=0){break v}$a(J[j+172>>2]);}if(H[j+147|0]>=0){break m}$a(J[j+136>>2]);break m}k=fa(22864)|0;a=Va;break m}k=fa(22864)|0;a=Va;break m}k=fa(22864)|0;a=Va;break m}a=J[k+84>>2];J[5996]=0;n=j+60|0;aa(115,n|0,a|0);a=J[5996];J[5996]=0;F:{G:{H:{I:{J:{K:{L:{M:{N:{O:{P:{Q:{R:{if((a|0)!=1){J[5996]=0;a=ba(99,n|0,0,5546)|0;n=J[5996];J[5996]=0;if((n|0)==1){break R}J[j+80>>2]=J[a+8>>2];n=J[a+4>>2];J[j+72>>2]=J[a>>2];J[j+76>>2]=n;J[a>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;J[5996]=0;n=_(97,j+72|0,3581)|0;m=J[5996];J[5996]=0;if((m|0)==1){break Q}J[j+96>>2]=J[n+8>>2];m=J[n+4>>2];J[j+88>>2]=J[n>>2];J[j+92>>2]=m;J[n>>2]=0;J[n+4>>2]=0;J[n+8>>2]=0;J[5996]=0;m=j+172|0;aa(141,m|0,j+152|0);l=J[5996];J[5996]=0;if((l|0)==1){break P}J[5996]=0;q=m;m=K[j+183|0];l=m<<24>>24<0;m=ba(100,j+88|0,(l?J[j+172>>2]:q)|0,(l?J[j+176>>2]:m)|0)|0;l=J[5996];J[5996]=0;if((l|0)==1){break O}J[j+112>>2]=J[m+8>>2];l=J[m+4>>2];J[j+104>>2]=J[m>>2];J[j+108>>2]=l;J[m>>2]=0;J[m+4>>2]=0;J[m+8>>2]=0;J[5996]=0;l=_(97,j+104|0,3570)|0;o=J[5996];J[5996]=0;if((o|0)==1){break N}J[j+128>>2]=J[l+8>>2];o=J[l+4>>2];J[j+120>>2]=J[l>>2];J[j+124>>2]=o;J[l>>2]=0;J[l+4>>2]=0;J[l+8>>2]=0;if(H[j+183|0]<0){$a(J[j+172>>2]);}if(H[m+11|0]<0){$a(J[m>>2]);}if(H[n+11|0]<0){$a(J[n>>2]);}if(H[a+11|0]<0){$a(J[a>>2]);}n=J[j+120>>2];a=K[j+131|0];m=a<<24>>24;l=(m|0)<0;q=l?n:j+120|0;a=l?J[j+124>>2]:a;l=c-1|0;a=(a|0)<(l|0)?a:l;H[fb(b,q,a)+a|0]=0;J[5996]=0;l=j+172|0;aa(117,l|0,k|0);a=J[5996];J[5996]=0;if((a|0)==1){break I}J[j+44>>2]=J[j+200>>2];a=J[j+196>>2];J[j+36>>2]=J[j+192>>2];J[j+40>>2]=a;a=J[j+188>>2];J[j+28>>2]=J[j+184>>2];J[j+32>>2]=a;a=J[j+180>>2];J[j+20>>2]=J[j+176>>2];J[j+24>>2]=a;a=J[j+172>>2];J[j+16>>2]=a;J[5996]=0;o=a>>>0<29;p=o?j+20|0:J[j+24>>2];J[j+172>>2]=p;r=j+48|0;ga(102,r|0,l|0,p+(o?a:a-29|0)|0,0);a=J[5996];J[5996]=0;if((a|0)==1){break H}a=J[j+48>>2];l=K[j+59|0];o=l<<24>>24;p=(o|0)<0;q=p?a:r;l=p?J[j+52>>2]:l;p=e-1|0;l=(l|0)<(p|0)?l:p;H[fb(d,q,l)+l|0]=0;if((o|0)<0){$a(a);}if(M[j+16>>2]>=29){$a(J[j+24>>2]);k=J[j+152>>2];}a=J[k+80>>2];if(!a|M[k+84>>2]>3600|(J[k+52>>2]+J[k+44>>2]>>>0>201|M[k+68>>2]>100)){break G}J[5996]=0;l=_(54,2049,1)|0;o=J[5996];J[5996]=0;if((o|0)==1){break p}if((a^-1)&l){break G}a=J[k+80>>2];J[5996]=0;l=_(54,2165,1)|0;o=J[5996];J[5996]=0;if((o|0)==1){break p}if(K[k+88|0]|(a^-1)&l){break G}H[j+176|0]=0;J[j+172>>2]=1702195828;H[j+183|0]=4;a=((i|0)>=5?5:i)-1|0;H[fb(h,j+172|0,a)+a|0]=0;break F}k=fa(22864)|0;a=Va;break m}k=fa(22864)|0;a=Va;break J}k=fa(22864)|0;a=Va;break K}k=fa(22864)|0;a=Va;break L}k=fa(22864)|0;a=Va;break M}k=fa(22864)|0;a=Va;if(H[j+115|0]>=0){break M}$a(J[j+104>>2]);}if(H[j+183|0]>=0){break L}$a(J[j+172>>2]);}if(H[j+99|0]>=0){break K}$a(J[j+88>>2]);}if(H[j+83|0]>=0){break J}$a(J[j+72>>2]);}if(H[j+71|0]>=0){break m}$a(J[j+60>>2]);break m}k=fa(22864)|0;break o}k=fa(22864)|0;a=Va;if(M[j+16>>2]<29){break n}$a(J[j+24>>2]);break n}H[j+176|0]=K[2354];H[j+183|0]=5;H[j+177|0]=0;J[j+172>>2]=K[2350]|K[2351]<<8|(K[2352]<<16|K[2353]<<24);a=((i|0)>=6?6:i)-1|0;H[fb(h,j+172|0,a)+a|0]=0;}J[5996]=0;a=$(118,k|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break p}S:{if(a){H[j+176|0]=0;J[j+172>>2]=1702195828;H[j+183|0]=4;a=((g|0)>=5?5:g)-1|0;H[fb(f,j+172|0,a)+a|0]=0;break S}H[j+176|0]=K[2354];H[j+183|0]=5;H[j+177|0]=0;J[j+172>>2]=K[2350]|K[2351]<<8|(K[2352]<<16|K[2353]<<24);a=((g|0)>=6?6:g)-1|0;H[fb(f,j+172|0,a)+a|0]=0;}if((m|0)<0){$a(n);}a=J[j+156>>2];}T:{if(!a){break T}b=J[a+4>>2];J[a+4>>2]=b-1;if(b){break T}Xa[J[J[a>>2]+8>>2]](a);bb(a);}if(H[j+171|0]>=0){break j}$a(J[j+160>>2]);break j}k=fa(22864)|0;}a=Va;}if((m|0)>=0){break m}$a(n);}mb(j+152|0);}if(H[j+171|0]>=0){break k}$a(J[j+160>>2]);}if((wa(22864)|0)!=(a|0)){break c}a=pa(k|0)|0;a=Xa[J[J[a>>2]+8>>2]](a)|0;J[5996]=0;g=_(30,j+120|0,a|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break i}J[5996]=0;a=ba(99,g|0,0,5474)|0;f=J[5996];J[5996]=0;if((f|0)==1){break h}J[j+168>>2]=J[a+8>>2];f=J[a+4>>2];J[j+160>>2]=J[a>>2];J[j+164>>2]=f;J[a>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;J[5996]=0;f=_(97,j+160|0,2611)|0;h=J[5996];J[5996]=0;if((h|0)==1){break g}J[j+24>>2]=J[f+8>>2];g=J[f+4>>2];J[j+16>>2]=J[f>>2];J[j+20>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;k=b;b=J[j+16>>2];g=K[j+27|0];h=g<<24>>24;i=(h|0)<0;g=i?J[j+20>>2]:g;c=c-1|0;c=(c|0)>(g|0)?g:c;H[fb(k,i?b:j+16|0,c)+c|0]=0;U:{if((h|0)>=0){break U}$a(b);if(H[f+11|0]>=0){break U}$a(J[f>>2]);}if(H[a+11|0]<0){$a(J[a>>2]);}J[5996]=0;a=_(30,j+16|0,5575)|0;b=J[5996];J[5996]=0;if((b|0)==1){break e}g=d;b=J[a>>2];c=K[a+11|0];d=c<<24>>24;f=(d|0)<0;h=f?b:a;a=f?J[a+4>>2]:c;c=e-1|0;a=(a|0)<(c|0)?a:c;H[fb(g,h,a)+a|0]=0;if((d|0)<0){$a(b);}ra();}Ua=j+208|0;return}k=Z()|0;break d}k=Z()|0;break f}k=Z()|0;if(H[j+171|0]>=0){break f}$a(J[j+160>>2]);}if(H[g+11|0]>=0){break d}$a(J[g>>2]);break d}k=Z()|0;}J[5996]=0;ca(110);a=J[5996];J[5996]=0;if((a|0)==1){break b}}da(k|0);B();}fa(0)|0;Vb();B();}B();}function Xg(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;h=Ua-160|0;Ua=h;Yc(h+48|0,c,O[a+16>>3],O[a+24>>3],0,0);J[5996]=0;g=$(46,c|0)|0;f=J[5996];J[5996]=0;a:{b:{c:{if((f|0)!=1){J[h+44>>2]=0;J[h+36>>2]=0;J[h+40>>2]=0;H[h+140|0]=0;J[h+136>>2]=h+36;f=J[g+4>>2];j=J[g>>2];m=f-j|0;i=(m|0)/12|0;if((f|0)!=(j|0)){d:{e:{f:{if(i>>>0>=357913942){J[5996]=0;ca(47);a=J[5996];J[5996]=0;if((a|0)==1){break f}break a}J[5996]=0;f=$(3,m|0)|0;j=J[5996];J[5996]=0;if((j|0)==1){break f}J[h+40>>2]=f;J[h+36>>2]=f;J[h+44>>2]=f+P(i,12);i=J[g+4>>2];g=J[g>>2];J[5996]=0;g=ia(48,h+44|0,g|0,i|0,f|0)|0;i=J[5996];J[5996]=0;if((i|0)!=1){break d}g=Z()|0;J[h+40>>2]=f;break e}g=Z()|0;}Nc(h+136|0);break c}J[h+40>>2]=g;}J[h+32>>2]=0;J[h+24>>2]=0;J[h+28>>2]=0;f=J[d+4>>2];g=J[d>>2];J[5996]=0;aa(49,h+24|0,f-g>>2);f=J[5996];J[5996]=0;g:{if((f|0)!=1){g=J[h+40>>2];f=J[h+36>>2];if((g|0)==(f|0)){break b}s=h+112|0;g=f;h:{while(1){i:{J[h+20>>2]=0;J[h+12>>2]=0;J[h+16>>2]=0;i=J[d+4>>2];f=J[d>>2];n=P(r,12);g=n+g|0;if(i-f>>2!=J[g+4>>2]-J[g>>2]>>3){break i}j=0;o=1;l=0;j:{if((f|0)!=(i|0)){k:{l:{m:{while(1){g=l<<3;t=O[g+J[h+60>>2]>>3];u=O[g+J[h+48>>2]>>3];f=J[(l<<2)+f>>2];J[5996]=0;f=qa(50,f|0,+u,+t,b|0)|0;i=J[5996];J[5996]=0;if((i|0)==1){break l}g=g+J[n+J[h+36>>2]>>2]|0;i=J[g>>2];g=J[g+4>>2];m=J[f+4>>2];f=J[f>>2];J[5996]=0;oa(51,h+136|0,f|0,m|0,i|0,g|0);f=J[5996];J[5996]=0;if((f|0)!=1){i=J[h+20>>2];n:{if(i>>>0>j>>>0){J[j+8>>2]=0;J[j>>2]=0;J[j+4>>2]=0;J[j>>2]=J[h+136>>2];J[j+4>>2]=J[h+140>>2];J[j+8>>2]=J[h+144>>2];J[h+16>>2]=j+12;break n}o:{f=J[h+12>>2];m=(j-f|0)/12|0;g=m+1|0;p:{if(g>>>0>=357913942){J[5996]=0;ca(52);break p}i=(i-f|0)/12|0;k=i<<1;g=i>>>0>=178956970?357913941:g>>>0<k>>>0?k:g;if(g>>>0<357913942){break o}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}break m}J[5996]=0;k=P(g,12);i=$(3,k|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break m}g=i+P(m,12)|0;J[g>>2]=J[h+136>>2];J[g+4>>2]=J[h+140>>2];J[g+8>>2]=J[h+144>>2];J[h+144>>2]=0;J[h+136>>2]=0;J[h+140>>2]=0;i=i+k|0;m=g+12|0;q:{if((f|0)==(j|0)){J[h+20>>2]=i;J[h+16>>2]=m;J[h+12>>2]=g;break q}while(1){g=g-12|0;j=j-12|0;J[g>>2]=J[j>>2];J[g+4>>2]=J[j+4>>2];J[g+8>>2]=J[j+8>>2];J[j+8>>2]=0;J[j>>2]=0;J[j+4>>2]=0;if((f|0)!=(j|0)){continue}break}J[h+20>>2]=i;f=J[h+16>>2];J[h+16>>2]=m;j=J[h+12>>2];J[h+12>>2]=g;if((f|0)==(j|0)){break q}while(1){k=f-12|0;m=J[k>>2];if(m){p=f-8|0;g=J[p>>2];i=m;if((g|0)!=(i|0)){while(1){g=g-32|0;f=J[g+4>>2];r:{if(!f){break r}i=J[f+4>>2];J[f+4>>2]=i-1;if(i){break r}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((g|0)!=(m|0)){continue}break}i=J[k>>2];}J[p>>2]=m;$a(i);}f=k;if((j|0)!=(f|0)){continue}break}}if(j){$a(j);}i=J[h+136>>2];if(!i){break n}f=i;g=J[h+140>>2];if((f|0)!=(g|0)){while(1){g=g-32|0;f=J[g+4>>2];s:{if(!f){break s}j=J[f+4>>2];J[f+4>>2]=j-1;if(j){break s}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((g|0)!=(i|0)){continue}break}f=J[h+136>>2];}J[h+140>>2]=i;$a(f);}j=J[h+16>>2];f=j-12|0;o=P(J[f+4>>2]-J[f>>2]>>5,o);l=l+1|0;f=J[d>>2];if(l>>>0>=J[d+4>>2]-f>>2>>>0){break k}continue}break}g=Z()|0;break h}g=Z()|0;_b(h+136|0);break h}g=Z()|0;break h}if(!o){break j}}m=0;t:{u:{v:{w:{x:{y:{while(1){j=J[h+24>>2];if(J[d+4>>2]!=J[d>>2]){g=0;i=J[h+12>>2];f=m;while(1){k=P(g,12);l=k+i|0;i=J[l>>2];J[(g<<2)+j>>2]=i+((f>>>0)%(J[l+4>>2]-i>>5>>>0)<<5);l=f;i=J[h+12>>2];f=k+i|0;f=(l>>>0)/(J[f+4>>2]-J[f>>2]>>5>>>0)|0;g=g+1|0;if(g>>>0<J[d+4>>2]-J[d>>2]>>2>>>0){continue}break}}J[h+100>>2]=0;J[h+92>>2]=0;J[h+96>>2]=0;g=j;n=J[h+28>>2];if((g|0)!=(n|0)){z:{while(1){A:{k=J[j>>2];g=J[h+96>>2];B:{if((g|0)!=J[h+100>>2]){J[g>>2]=J[k>>2];f=J[k+4>>2];J[g+4>>2]=f;if(f){J[f+4>>2]=J[f+4>>2]+1;}J[h+96>>2]=g+8;break B}C:{i=J[h+92>>2];f=g-i|0;p=f>>3;l=p+1|0;D:{if(l>>>0>=536870912){J[5996]=0;ca(59);break D}q=f>>2;f=f>>>0>=2147483640?536870911:l>>>0<q>>>0?q:l;if(f>>>0<536870912){break C}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}g=Z()|0;break t}J[5996]=0;q=f<<3;l=$(3,q|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break A}f=l+(p<<3)|0;J[f>>2]=J[k>>2];k=J[k+4>>2];J[f+4>>2]=k;if(k){J[k+4>>2]=J[k+4>>2]+1;g=J[h+96>>2];}k=l+q|0;l=f+8|0;E:{if((g|0)==(i|0)){J[h+100>>2]=k;J[h+96>>2]=l;J[h+92>>2]=f;break E}while(1){f=f-8|0;g=g-8|0;J[f>>2]=J[g>>2];J[f+4>>2]=J[g+4>>2];J[g>>2]=0;J[g+4>>2]=0;if((g|0)!=(i|0)){continue}break}J[h+100>>2]=k;g=J[h+96>>2];J[h+96>>2]=l;i=J[h+92>>2];J[h+92>>2]=f;if((g|0)==(i|0)){break E}while(1){g=g-8|0;f=J[g+4>>2];F:{if(!f){break F}k=J[f+4>>2];J[f+4>>2]=k-1;if(k){break F}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((g|0)!=(i|0)){continue}break}}if(!i){break B}$a(i);}j=j+4|0;if((n|0)!=(j|0)){continue}break z}break}g=Z()|0;break t}j=J[h+28>>2];g=J[h+24>>2];}J[5996]=0;va(63,h+72|0,c|0,g|0,j|0,0);f=J[5996];J[5996]=0;if((f|0)==1){break x}J[5996]=0;j=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)==1){break x}J[j>>2]=7e3;J[j+4>>2]=0;J[j+8>>2]=0;J[h+112>>2]=0;J[h+104>>2]=0;J[h+108>>2]=0;J[h+116>>2]=J[h+92>>2];f=J[h+100>>2];g=J[h+96>>2];J[h+100>>2]=0;J[h+120>>2]=g;J[h+124>>2]=f;J[h+92>>2]=0;J[h+96>>2]=0;H[h+132|0]=0;J[h+128>>2]=h+104;k=J[e+4>>2];g=J[e>>2];i=k-g|0;f=(i|0)/12|0;G:{if((g|0)!=(k|0)){if(f>>>0>=357913942){J[5996]=0;ca(41);a=J[5996];J[5996]=0;if((a|0)!=1){break a}g=Z()|0;break v}J[5996]=0;i=$(3,i|0)|0;l=J[5996];J[5996]=0;if((l|0)==1){break G}J[h+108>>2]=i;J[h+104>>2]=i;J[h+112>>2]=i+P(f,12);J[h+156>>2]=i;J[h+152>>2]=i;H[h+148|0]=0;J[h+136>>2]=s;J[h+144>>2]=h+156;J[h+140>>2]=h+152;f=i;while(1){H:{if(H[g+11|0]>=0){l=J[g+4>>2];J[f>>2]=J[g>>2];J[f+4>>2]=l;J[f+8>>2]=J[g+8>>2];break H}l=J[g+4>>2];n=J[g>>2];J[5996]=0;ea(40,f|0,n|0,l|0);f=J[5996];J[5996]=0;if((f|0)==1){break w}f=J[h+156>>2];}f=f+12|0;J[h+156>>2]=f;g=g+12|0;if((k|0)!=(g|0)){continue}break}J[h+108>>2]=f;}J[5996]=0;k=xa(60,j+12|0,c|0,h+116|0,h+104|0,0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break y}i=J[h+104>>2];if(i){f=J[h+108>>2];g=i;if((f|0)!=(g|0)){while(1){g=f-12|0;if(H[f-1|0]<0){$a(J[g>>2]);}f=g;if((i|0)!=(f|0)){continue}break}g=J[h+104>>2];}J[h+108>>2]=i;$a(g);}f=J[h+116>>2];if(f){g=J[h+120>>2];if((f|0)!=(g|0)){while(1){g=g-8|0;i=J[g+4>>2];I:{if(!i){break I}l=J[i+4>>2];J[i+4>>2]=l-1;if(l){break I}Xa[J[J[i>>2]+8>>2]](i);bb(i);}if((f|0)!=(g|0)){continue}break}f=J[h+116>>2];}$a(f);}J[h+140>>2]=j;J[h+136>>2]=k;J[5996]=0;f=J[h+140>>2];J[h>>2]=J[h+136>>2];J[h+4>>2]=f;ea(61,a|0,h+72|0,h|0);f=J[5996];J[5996]=0;if((f|0)==1){break x}f=J[h+92>>2];if(f){g=J[h+96>>2];if((f|0)!=(g|0)){while(1){g=g-8|0;i=J[g+4>>2];J:{if(!i){break J}j=J[i+4>>2];J[i+4>>2]=j-1;if(j){break J}Xa[J[J[i>>2]+8>>2]](i);bb(i);}if((f|0)!=(g|0)){continue}break}f=J[h+92>>2];}$a(f);}m=m+1|0;if((o|0)!=(m|0)){continue}break j}break}g=Z()|0;break v}g=Z()|0;rb(h+104|0);break u}g=Z()|0;break t}g=Z()|0;Wg(h+136|0);J[h+108>>2]=i;}Vg(h+128|0);}lb(h+116|0);$a(j);}lb(h+92|0);break h}i=J[h+12>>2];if(i){g=J[h+16>>2];if((i|0)!=(g|0)){while(1){m=g-12|0;j=J[m>>2];if(j){f=j;k=g-8|0;g=J[k>>2];if((f|0)!=(g|0)){while(1){g=g-32|0;f=J[g+4>>2];K:{if(!f){break K}o=J[f+4>>2];J[f+4>>2]=o-1;if(o){break K}Xa[J[J[f>>2]+8>>2]](f);bb(f);}if((g|0)!=(j|0)){continue}break}f=J[m>>2];}J[k>>2]=j;$a(f);}g=m;if((i|0)!=(g|0)){continue}break}i=J[h+12>>2];}$a(i);}r=r+1|0;g=J[h+36>>2];if(r>>>0<(J[h+40>>2]-g|0)/12>>>0){continue}break b}break}J[5996]=0;ga(44,5170,1900,642,2497);a=J[5996];J[5996]=0;if((a|0)!=1){break a}g=Z()|0;}Xc(h+12|0);break g}g=Z()|0;}a=J[h+24>>2];if(a){$a(a);}Wc(h+36|0);break c}g=Z()|0;}Mc(h+48|0);da(g|0);B();}a=J[h+24>>2];if(a){$a(a);g=J[h+36>>2];}if(g){f=g;i=J[h+40>>2];if((f|0)!=(i|0)){while(1){a=i-12|0;b=J[a>>2];if(b){J[i-8>>2]=b;$a(b);}i=a;if((i|0)!=(g|0)){continue}break}f=J[h+36>>2];}J[h+40>>2]=g;$a(f);}a=J[h+60>>2];if(a){J[h- -64>>2]=a;$a(a);}a=J[h+48>>2];if(a){J[h+52>>2]=a;$a(a);}Ua=h+160|0;return}B();}function Ng(a,b,c,d,e,f,g,h,i){var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,N=0,O=0,P=0,Q=0;k=Ua-336|0;Ua=k;m=h;n=i&65535;o=d;p=e&65535;t=(e^i)&-2147483648;r=i>>>16&32767;s=e>>>16&32767;a:{b:{if(r-32767>>>0>4294934529&s-32767>>>0>=4294934530){break b}j=e&2147483647;if(!(!d&(j|0)==2147418112?!(b|c):j>>>0<2147418112)){q=d;t=e|32768;break a}e=i&2147483647;if(!(!h&(e|0)==2147418112?!(f|g):e>>>0<2147418112)){q=h;t=i|32768;b=f;c=g;break a}if(!(b|d|(j^2147418112|c))){if(!(f|h|(e^2147418112|g))){b=0;c=0;t=2147450880;break a}t=t|2147418112;b=0;c=0;break a}if(!(f|h|(e^2147418112|g))){b=0;c=0;break a}if(!(b|d|(c|j))){b=!(f|h|(e|g));q=b?0:q;t=b?2147450880:t;b=0;c=0;break a}if(!(f|h|(e|g))){t=t|2147418112;b=0;c=0;break a}if((j|0)==65535|j>>>0<65535){d=!(o|p);i=d;j=d?b:o;d=d<<6;i=S(i?c:p);d=d+((i|0)==32?S(j)+32|0:i)|0;Cb(k+320|0,b,c,o,p,d-15|0);u=16-d|0;o=J[k+328>>2];p=J[k+332>>2];c=J[k+324>>2];b=J[k+320>>2];}if(e>>>0>65535){break b}d=!(n|m);h=d;i=d?f:m;d=d<<6;h=S(h?g:n);d=d+((h|0)==32?S(i)+32|0:h)|0;Cb(k+304|0,f,g,m,n,d-15|0);u=(d+u|0)-16|0;m=J[k+312>>2];n=J[k+316>>2];f=J[k+304>>2];g=J[k+308>>2];}e=n|65536;z=e;A=m;d=m;j=e<<15|d>>>17;e=d<<15|g>>>17;d=e;i=0-d|0;h=j;j=1963258675-(j+((d|0)!=0)|0)|0;xb(k+288|0,d,h,0,0,i,j,0,0);d=J[k+296>>2];xb(k+272|0,0-d|0,0-(J[k+300>>2]+((d|0)!=0)|0)|0,0,0,i,j,0,0);d=J[k+280>>2];i=d<<1|J[k+276>>2]>>>31;d=J[k+284>>2]<<1|d>>>31;xb(k+256|0,i,d,0,0,e,h,0,0);j=J[k+264>>2];xb(k+240|0,i,d,0,0,0-j|0,0-(J[k+268>>2]+((j|0)!=0)|0)|0,0,0);i=J[k+248>>2];j=i<<1|J[k+244>>2]>>>31;d=J[k+252>>2]<<1|i>>>31;xb(k+224|0,j,d,0,0,e,h,0,0);i=J[k+232>>2];xb(k+208|0,j,d,0,0,0-i|0,0-(J[k+236>>2]+((i|0)!=0)|0)|0,0,0);d=J[k+216>>2];i=d<<1|J[k+212>>2]>>>31;d=J[k+220>>2]<<1|d>>>31;xb(k+192|0,i,d,0,0,e,h,0,0);j=J[k+200>>2];xb(k+176|0,i,d,0,0,0-j|0,0-(J[k+204>>2]+((j|0)!=0)|0)|0,0,0);i=e;e=J[k+184>>2];d=h;m=e<<1|J[k+180>>2]>>>31;h=m-1|0;e=(J[k+188>>2]<<1|e>>>31)-!m|0;xb(k+160|0,i,d,0,0,h,e,0,0);d=h;xb(k+144|0,f<<15,g<<15|f>>>17,0,0,d,e,0,0);w=k+112|0;x=J[k+168>>2];h=J[k+172>>2];m=J[k+160>>2];i=J[k+152>>2];l=m+i|0;n=J[k+164>>2];j=n+J[k+156>>2]|0;j=i>>>0>l>>>0?j+1|0:j;i=j;j=(n|0)==(j|0)&l>>>0<m>>>0|j>>>0<n>>>0;n=j+x|0;j=j>>>0>n>>>0?h+1|0:h;m=!i&l>>>0>1|(i|0)!=0;h=n+m|0;j=m>>>0>h>>>0?j+1|0:j;xb(w,d,e,0,0,0-h|0,0-(((h|0)!=0)+j|0)|0,0,0);xb(k+128|0,1-l|0,0-((l>>>0>1)+i|0)|0,0,0,d,e,0,0);I=(s-r|0)+u|0;e=J[k+116>>2];w=e;d=J[k+112>>2];j=e<<1|d>>>31;i=d<<1;n=j;d=j;h=J[k+140>>2];y=h;e=J[k+136>>2];j=h<<1|e>>>31;l=e<<1|J[k+132>>2]>>>31;h=l+i|0;d=d+j|0;d=h>>>0<l>>>0?d+1|0:d;e=d;d=d-(h>>>0<13927)|0;v=d;x=d;l=0;j=p|65536;K=j;L=o;d=o;j=j<<1|d>>>31;O=d<<1;P=j;E=j;d=co(v,l,j,0);j=Wa;B=d;C=j;u=b<<1;d=c<<1|b>>>31;r=d;j=0;s=j;m=h-13927|0;v=(e|0)==(v|0)&m>>>0<h>>>0|e>>>0>v>>>0;e=(e|0)==(n|0)&h>>>0<i>>>0|e>>>0<n>>>0;d=J[k+120>>2];h=J[k+124>>2]<<1|d>>>31;d=d<<1|w>>>31;l=y>>>31|0;d=l+d|0;j=h;j=d>>>0<l>>>0?j+1|0:j;h=d;d=d+e|0;j=h>>>0>d>>>0?j+1|0:j;e=d;d=d+v|0;l=e>>>0>d>>>0?j+1|0:j;e=d-1|0;D=l-!d|0;y=0;i=co(r,s,D,y);d=i+B|0;h=Wa+C|0;h=d>>>0<i>>>0?h+1|0:h;n=(C|0)==(h|0)&d>>>0<B>>>0|h>>>0<C>>>0;B=e;N=c>>>31|0;G=N|o<<1;v=0;e=co(e,0,G,v);o=e+d|0;j=Wa+h|0;l=0;j=e>>>0>o>>>0?j+1|0:j;p=j;d=(j|0)==(h|0)&d>>>0>o>>>0|h>>>0>j>>>0;e=d;d=d+n|0;l=e>>>0>d>>>0?1:l;e=co(E,s,D,y);d=e+d|0;j=Wa+l|0;n=d;d=d>>>0<e>>>0?j+1|0:j;e=co(E,s,B,v);l=Wa;h=e;e=co(G,v,D,y);i=h+e|0;j=Wa+l|0;j=e>>>0>i>>>0?j+1|0:j;e=j;j=(l|0)==(j|0)&h>>>0>i>>>0|j>>>0<l>>>0;l=n+e|0;d=d+j|0;d=l>>>0<e>>>0?d+1|0:d;n=l;l=d;e=0;d=e+o|0;j=i+p|0;j=d>>>0<e>>>0?j+1|0:j;e=j;h=(j|0)==(p|0)&d>>>0<o>>>0|j>>>0<p>>>0;j=l;i=h;h=h+n|0;j=i>>>0>h>>>0?j+1|0:j;F=h;l=j;w=d;o=d;C=m;d=co(m,0,G,v);i=Wa;h=d;m=co(x,q,r,q);d=d+m|0;j=Wa+i|0;j=d>>>0<m>>>0?j+1|0:j;m=(i|0)==(j|0)&d>>>0<h>>>0|i>>>0>j>>>0;h=j;H=u&-2;i=co(B,v,H,0);p=i+d|0;j=Wa+j|0;j=i>>>0>p>>>0?j+1|0:j;i=j;d=(j|0)==(h|0)&d>>>0>p>>>0|h>>>0>j>>>0;h=0;j=d+m|0;d=(j>>>0<d>>>0?1:h)+e|0;n=j+o|0;d=n>>>0<j>>>0?d+1|0:d;j=l;o=d;d=(d|0)==(e|0)&n>>>0<w>>>0|d>>>0<e>>>0;e=d;d=d+F|0;j=e>>>0>d>>>0?j+1|0:j;Q=d;w=j;d=co(E,s,C,q);F=Wa;E=d;e=co(D,y,H,q);d=d+e|0;j=Wa+F|0;j=d>>>0<e>>>0?j+1|0:j;m=d;l=co(x,q,G,v);e=d+l|0;h=j;d=j+Wa|0;d=e>>>0<l>>>0?d+1|0:d;s=e;j=co(r,q,B,v);e=e+j|0;l=Wa+d|0;l=e>>>0<j>>>0?l+1|0:l;D=(d|0)==(l|0)&e>>>0<s>>>0|d>>>0>l>>>0;j=(h|0)==(F|0)&m>>>0<E>>>0|h>>>0<F>>>0;d=(d|0)==(h|0)&m>>>0>s>>>0|d>>>0<h>>>0;d=d+j|0;d=d+D|0;h=l;s=h+n|0;j=(d|y)+o|0;j=h>>>0>s>>>0?j+1|0:j;m=j;d=(o|0)==(j|0)&n>>>0>s>>>0|j>>>0<o>>>0;j=w;h=d;d=d+Q|0;j=h>>>0>d>>>0?j+1|0:j;y=d;o=j;d=co(x,q,H,q);x=Wa;n=d;h=co(r,q,C,q);d=d+h|0;j=Wa+x|0;j=d>>>0<h>>>0?j+1|0:j;w=0;h=(j|0)==(x|0)&d>>>0<n>>>0|j>>>0<x>>>0;n=j;d=j+p|0;j=(h|w)+i|0;j=d>>>0<n>>>0?j+1|0:j;i=(i|0)==(j|0)&d>>>0<p>>>0|i>>>0>j>>>0;h=j;j=e;p=0;e=p+d|0;l=h+j|0;j=0;l=e>>>0<p>>>0?l+1|0:l;d=(h|0)==(l|0)&d>>>0>e>>>0|h>>>0>l>>>0;e=d;d=d+i|0;j=(e>>>0>d>>>0?1:j)+m|0;l=o;e=d;d=d+s|0;j=e>>>0>d>>>0?j+1|0:j;e=j;h=(m|0)==(j|0)&d>>>0<s>>>0|j>>>0<m>>>0;i=h;h=h+y|0;l=i>>>0>h>>>0?l+1|0:l;i=l;c:{if((l|0)==131071|l>>>0<131071){L=O|N;K=v|P;xb(k+80|0,d,j,h,l,f,g,A,z);l=J[k+84>>2];n=l;j=b<<17;m=0;p=J[k+88>>2];c=m-p|0;b=J[k+80>>2];l=(l|b)!=0;o=c-l|0;p=(j-(J[k+92>>2]+(m>>>0<p>>>0)|0)|0)-(c>>>0<l>>>0)|0;m=0-b|0;n=0-(((b|0)!=0)+n|0)|0;b=I+16382|0;break c}d=(e&1)<<31|d>>>1;e=h<<31|e>>>1;h=(i&1)<<31|h>>>1;i=i>>>1|0;xb(k+96|0,d,e,h,i,f,g,A,z);o=J[k+100>>2];r=o;n=0;u=J[k+104>>2];m=n-u|0;l=J[k+96>>2];p=(o|l)!=0;o=m-p|0;p=((b<<16)-(J[k+108>>2]+(n>>>0<u>>>0)|0)|0)-(m>>>0<p>>>0)|0;m=0-l|0;n=0-(((l|0)!=0)+r|0)|0;u=b;r=c;b=I+16383|0;}if((b|0)>=32767){t=t|2147418112;b=0;c=0;break a}d:{if((b|0)>0){l=p<<1|o>>>31;o=o<<1|n>>>31;p=l;u=h;r=i&65535|b<<16;l=n<<1|m>>>31;i=m<<1;break d}if((b|0)<=-113){b=0;c=0;break a}xc(k- -64|0,d,e,h,i,1-b|0);Cb(k+48|0,u,r,L,K,b+112|0);d=J[k+64>>2];e=J[k+68>>2];u=J[k+72>>2];r=J[k+76>>2];xb(k+32|0,f,g,A,z,d,e,u,r);b=J[k+40>>2];c=J[k+56>>2];l=J[k+36>>2];o=b<<1|l>>>31;m=c-o|0;p=J[k+60>>2]-((J[k+44>>2]<<1|b>>>31)+(c>>>0<o>>>0)|0)|0;b=J[k+32>>2];h=l<<1|b>>>31;j=b<<1;i=J[k+52>>2];c=J[k+48>>2];b=(h|0)==(i|0)&j>>>0>c>>>0|h>>>0>i>>>0;o=m-b|0;p=p-(b>>>0>m>>>0)|0;l=i-((c>>>0<j>>>0)+h|0)|0;i=c-j|0;}b=i;xb(k+16|0,f,g,A,z,3,0,0,0);xb(k,f,g,A,z,5,0,0,0);c=0;h=l+c|0;j=d&1;b=b+j|0;h=i>>>0>b>>>0?h+1|0:h;i=b;g=(h|0)==(g|0)&f>>>0<i>>>0|g>>>0<h>>>0;l=p;b=(c|0)==(h|0)&i>>>0<j>>>0|c>>>0>h>>>0;f=b+o|0;l=b>>>0>f>>>0?l+1|0:l;j=e;b=(l|0)==(z|0);b=b&(f|0)==(A|0)?g:b&f>>>0>A>>>0|l>>>0>z>>>0;c=b;b=b+d|0;j=c>>>0>b>>>0?j+1|0:j;c=j;d=(e|0)==(j|0)&b>>>0<d>>>0|e>>>0>j>>>0;j=r;e=d;d=d+u|0;j=e>>>0>d>>>0?j+1|0:j;g=d;e=J[k+20>>2];n=(e|0)==(h|0)&M[k+16>>2]<i>>>0|e>>>0<h>>>0;e=J[k+28>>2];d=J[k+24>>2];e=j>>>0<2147418112&((d|0)==(f|0)&(e|0)==(l|0)?n:(e|0)==(l|0)&d>>>0<f>>>0|e>>>0<l>>>0);d=c;n=e;e=b+e|0;d=n>>>0>e>>>0?d+1|0:d;b=(c|0)==(d|0)&b>>>0>e>>>0|c>>>0>d>>>0;c=b;b=b+g|0;j=c>>>0>b>>>0?j+1|0:j;g=b;c=J[k+4>>2];h=(c|0)==(h|0)&M[k>>2]<i>>>0|c>>>0<h>>>0;c=J[k+12>>2];b=J[k+8>>2];b=j>>>0<2147418112&((b|0)==(f|0)&(c|0)==(l|0)?h:(c|0)==(l|0)&b>>>0<f>>>0|c>>>0<l>>>0);c=b;b=b+e|0;l=c>>>0>b>>>0?d+1|0:d;c=l;e=(d|0)==(l|0)&b>>>0<e>>>0|d>>>0>l>>>0;d=j;f=e;e=e+g|0;d=f>>>0>e>>>0?d+1|0:d;q=e|q;t=d|t;}J[a>>2]=b;J[a+4>>2]=c;J[a+8>>2]=q;J[a+12>>2]=t;Ua=k+336|0;}function hc(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;h=Ua-128|0;Ua=h;Yc(h+56|0,c,O[a+16>>3],O[a+24>>3],e,f);J[5996]=0;f=$(46,c|0)|0;g=J[5996];J[5996]=0;a:{b:{c:{if((g|0)!=1){J[h+52>>2]=0;J[h+44>>2]=0;J[h+48>>2]=0;H[h+84|0]=0;J[h+80>>2]=h+44;g=J[f+4>>2];j=J[f>>2];l=g-j|0;i=(l|0)/12|0;if((g|0)!=(j|0)){d:{e:{f:{if(i>>>0>=357913942){J[5996]=0;ca(47);a=J[5996];J[5996]=0;if((a|0)==1){break f}break a}J[5996]=0;g=$(3,l|0)|0;j=J[5996];J[5996]=0;if((j|0)==1){break f}J[h+48>>2]=g;J[h+44>>2]=g;J[h+52>>2]=g+P(i,12);i=J[f+4>>2];f=J[f>>2];J[5996]=0;f=ia(48,h+52|0,f|0,i|0,g|0)|0;i=J[5996];J[5996]=0;if((i|0)!=1){break d}f=Z()|0;J[h+48>>2]=g;break e}f=Z()|0;}Nc(h+80|0);break c}J[h+48>>2]=f;}J[h+40>>2]=0;J[h+32>>2]=0;J[h+36>>2]=0;f=J[d+4>>2];g=J[d>>2];J[5996]=0;aa(49,h+32|0,f-g>>2);f=J[5996];J[5996]=0;g:{if((f|0)!=1){f=J[h+48>>2];g=J[h+44>>2];if((f|0)==(g|0)){break b}f=g;h:{while(1){i:{J[h+28>>2]=0;J[h+20>>2]=0;J[h+24>>2]=0;i=J[d+4>>2];g=J[d>>2];o=P(r,12);f=o+f|0;if(i-g>>2!=J[f+4>>2]-J[f>>2]>>3){break i}j=0;n=1;m=0;j:{if((g|0)!=(i|0)){k:{l:{m:{while(1){f=m<<3;s=O[f+J[h+68>>2]>>3];t=O[f+J[h+56>>2]>>3];g=J[(m<<2)+g>>2];J[5996]=0;g=qa(50,g|0,+t,+s,b|0)|0;i=J[5996];J[5996]=0;if((i|0)==1){break l}f=f+J[o+J[h+44>>2]>>2]|0;i=J[f>>2];f=J[f+4>>2];l=J[g+4>>2];g=J[g>>2];J[5996]=0;oa(51,h+80|0,g|0,l|0,i|0,f|0);f=J[5996];J[5996]=0;if((f|0)!=1){i=J[h+28>>2];n:{if(i>>>0>j>>>0){J[j+8>>2]=0;J[j>>2]=0;J[j+4>>2]=0;J[j>>2]=J[h+80>>2];J[j+4>>2]=J[h+84>>2];J[j+8>>2]=J[h+88>>2];J[h+24>>2]=j+12;break n}o:{g=J[h+20>>2];l=(j-g|0)/12|0;f=l+1|0;p:{if(f>>>0>=357913942){J[5996]=0;ca(52);break p}i=(i-g|0)/12|0;k=i<<1;f=i>>>0>=178956970?357913941:f>>>0<k>>>0?k:f;if(f>>>0<357913942){break o}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}break m}J[5996]=0;k=P(f,12);i=$(3,k|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break m}f=i+P(l,12)|0;J[f>>2]=J[h+80>>2];J[f+4>>2]=J[h+84>>2];J[f+8>>2]=J[h+88>>2];J[h+88>>2]=0;J[h+80>>2]=0;J[h+84>>2]=0;i=i+k|0;l=f+12|0;q:{if((g|0)==(j|0)){J[h+28>>2]=i;J[h+24>>2]=l;J[h+20>>2]=f;break q}while(1){f=f-12|0;j=j-12|0;J[f>>2]=J[j>>2];J[f+4>>2]=J[j+4>>2];J[f+8>>2]=J[j+8>>2];J[j+8>>2]=0;J[j>>2]=0;J[j+4>>2]=0;if((g|0)!=(j|0)){continue}break}J[h+28>>2]=i;g=J[h+24>>2];J[h+24>>2]=l;j=J[h+20>>2];J[h+20>>2]=f;if((g|0)==(j|0)){break q}while(1){k=g-12|0;l=J[k>>2];if(l){p=g-8|0;f=J[p>>2];i=l;if((f|0)!=(i|0)){while(1){f=f-32|0;g=J[f+4>>2];r:{if(!g){break r}i=J[g+4>>2];J[g+4>>2]=i-1;if(i){break r}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((f|0)!=(l|0)){continue}break}i=J[k>>2];}J[p>>2]=l;$a(i);}g=k;if((j|0)!=(g|0)){continue}break}}if(j){$a(j);}i=J[h+80>>2];if(!i){break n}f=J[h+84>>2];g=i;if((f|0)!=(g|0)){while(1){f=f-32|0;g=J[f+4>>2];s:{if(!g){break s}j=J[g+4>>2];J[g+4>>2]=j-1;if(j){break s}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((f|0)!=(i|0)){continue}break}g=J[h+80>>2];}J[h+84>>2]=i;$a(g);}j=J[h+24>>2];f=j-12|0;n=P(J[f+4>>2]-J[f>>2]>>5,n);m=m+1|0;g=J[d>>2];if(m>>>0>=J[d+4>>2]-g>>2>>>0){break k}continue}break}f=Z()|0;break h}f=Z()|0;_b(h+80|0);break h}f=Z()|0;break h}if(!n){break j}}l=0;t:{u:{while(1){j=J[h+32>>2];if(J[d+4>>2]!=J[d>>2]){f=0;i=J[h+20>>2];g=l;while(1){k=P(f,12);m=k+i|0;i=J[m>>2];J[(f<<2)+j>>2]=i+((g>>>0)%(J[m+4>>2]-i>>5>>>0)<<5);m=g;i=J[h+20>>2];g=k+i|0;g=(m>>>0)/(J[g+4>>2]-J[g>>2]>>5>>>0)|0;f=f+1|0;if(f>>>0<J[d+4>>2]-J[d>>2]>>2>>>0){continue}break}}J[h+104>>2]=0;J[h+96>>2]=0;J[h+100>>2]=0;f=j;o=J[h+36>>2];if((f|0)!=(o|0)){v:{while(1){w:{k=J[j>>2];f=J[h+100>>2];x:{if((f|0)!=J[h+104>>2]){J[f>>2]=J[k>>2];g=J[k+4>>2];J[f+4>>2]=g;if(g){J[g+4>>2]=J[g+4>>2]+1;}J[h+100>>2]=f+8;break x}y:{i=J[h+96>>2];g=f-i|0;p=g>>3;m=p+1|0;z:{if(m>>>0>=536870912){J[5996]=0;ca(59);break z}q=g>>2;g=g>>>0>=2147483640?536870911:m>>>0<q>>>0?q:m;if(g>>>0<536870912){break y}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break a}f=Z()|0;break t}J[5996]=0;q=g<<3;m=$(3,q|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break w}g=m+(p<<3)|0;J[g>>2]=J[k>>2];k=J[k+4>>2];J[g+4>>2]=k;if(k){J[k+4>>2]=J[k+4>>2]+1;f=J[h+100>>2];}k=m+q|0;m=g+8|0;A:{if((f|0)==(i|0)){J[h+104>>2]=k;J[h+100>>2]=m;J[h+96>>2]=g;break A}while(1){g=g-8|0;f=f-8|0;J[g>>2]=J[f>>2];J[g+4>>2]=J[f+4>>2];J[f>>2]=0;J[f+4>>2]=0;if((f|0)!=(i|0)){continue}break}J[h+104>>2]=k;f=J[h+100>>2];J[h+100>>2]=m;i=J[h+96>>2];J[h+96>>2]=g;if((f|0)==(i|0)){break A}while(1){f=f-8|0;g=J[f+4>>2];B:{if(!g){break B}k=J[g+4>>2];J[g+4>>2]=k-1;if(k){break B}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((f|0)!=(i|0)){continue}break}}if(!i){break x}$a(i);}j=j+4|0;if((o|0)!=(j|0)){continue}break v}break}f=Z()|0;break t}j=J[h+36>>2];f=J[h+32>>2];}J[5996]=0;va(63,h+80|0,c|0,f|0,j|0,+e);f=J[5996];J[5996]=0;if((f|0)==1){break u}J[5996]=0;i=$(3,104)|0;f=J[5996];J[5996]=0;if((f|0)==1){break u}J[i>>2]=7e3;J[i+4>>2]=0;J[i+8>>2]=0;J[5996]=0;J[h+116>>2]=J[h+96>>2];f=J[h+104>>2];g=J[h+100>>2];J[h+104>>2]=0;J[h+120>>2]=g;J[h+124>>2]=f;J[h+96>>2]=0;J[h+100>>2]=0;k=ia(64,i+12|0,c|0,h+116|0,0)|0;f=J[5996];J[5996]=0;if((f|0)!=1){g=J[h+116>>2];if(g){f=J[h+120>>2];if((g|0)!=(f|0)){while(1){f=f-8|0;j=J[f+4>>2];C:{if(!j){break C}m=J[j+4>>2];J[j+4>>2]=m-1;if(m){break C}Xa[J[J[j>>2]+8>>2]](j);bb(j);}if((f|0)!=(g|0)){continue}break}g=J[h+116>>2];}$a(g);}J[h+112>>2]=i;J[h+108>>2]=k;J[5996]=0;f=J[h+112>>2];J[h+8>>2]=J[h+108>>2];J[h+12>>2]=f;ea(61,a|0,h+80|0,h+8|0);f=J[5996];J[5996]=0;if((f|0)==1){break u}g=J[h+96>>2];if(g){f=J[h+100>>2];if((g|0)!=(f|0)){while(1){f=f-8|0;i=J[f+4>>2];D:{if(!i){break D}j=J[i+4>>2];J[i+4>>2]=j-1;if(j){break D}Xa[J[J[i>>2]+8>>2]](i);bb(i);}if((f|0)!=(g|0)){continue}break}g=J[h+96>>2];}$a(g);}l=l+1|0;if((n|0)!=(l|0)){continue}break j}break}f=Z()|0;lb(h+116|0);$a(i);break t}f=Z()|0;}lb(h+96|0);break h}i=J[h+20>>2];if(i){f=J[h+24>>2];if((i|0)!=(f|0)){while(1){l=f-12|0;j=J[l>>2];if(j){k=f-8|0;f=J[k>>2];g=j;if((f|0)!=(g|0)){while(1){f=f-32|0;g=J[f+4>>2];E:{if(!g){break E}n=J[g+4>>2];J[g+4>>2]=n-1;if(n){break E}Xa[J[J[g>>2]+8>>2]](g);bb(g);}if((f|0)!=(j|0)){continue}break}g=J[l>>2];}J[k>>2]=j;$a(g);}f=l;if((i|0)!=(f|0)){continue}break}i=J[h+20>>2];}$a(i);}r=r+1|0;f=J[h+44>>2];if(r>>>0<(J[h+48>>2]-f|0)/12>>>0){continue}break b}break}J[5996]=0;ga(44,5170,1900,642,2497);a=J[5996];J[5996]=0;if((a|0)!=1){break a}f=Z()|0;}Xc(h+20|0);break g}f=Z()|0;}a=J[h+32>>2];if(a){$a(a);}Wc(h+44|0);break c}f=Z()|0;}Mc(h+56|0);da(f|0);B();}a=J[h+32>>2];if(a){$a(a);f=J[h+44>>2];}if(f){g=f;i=J[h+48>>2];if((i|0)!=(f|0)){while(1){a=i-12|0;b=J[a>>2];if(b){J[i-8>>2]=b;$a(b);}i=a;if((i|0)!=(f|0)){continue}break}g=J[h+44>>2];}J[h+48>>2]=f;$a(g);}a=J[h+68>>2];if(a){J[h+72>>2]=a;$a(a);}a=J[h+56>>2];if(a){J[h+60>>2]=a;$a(a);}Ua=h+128|0;return}B();}function tk(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;l=Ua-528|0;Ua=l;J[l+520>>2]=k;J[l+524>>2]=b;a:{b:{if(Tb(a,l+524|0)){J[f>>2]=J[f>>2]|4;a=0;break b}J[l+72>>2]=220;t=l+104|0;J[t>>2]=l+112;s=l+72|0;J[t+4>>2]=J[s>>2];o=J[t>>2];J[l+100>>2]=o;J[l+96>>2]=o+400;J[s>>2]=0;J[s+4>>2]=0;J[s+8>>2]=0;p=l+60|0;J[p>>2]=0;J[p+4>>2]=0;J[p+8>>2]=0;m=l+48|0;J[m>>2]=0;J[m+4>>2]=0;J[m+8>>2]=0;n=l+36|0;J[n>>2]=0;J[n+4>>2]=0;J[n+8>>2]=0;q=l+24|0;J[q>>2]=0;J[q+4>>2]=0;J[q+8>>2]=0;b=J[d>>2];J[5996]=0;sa(229,c|0,b|0,l+92|0,l+88|0,l+84|0,s|0,p|0,m|0,n|0,l+20|0);b=J[5996];J[5996]=0;if((b|0)!=1){J[j>>2]=J[i>>2];v=e&512;u=J[l+20>>2];e=0;while(1){c:{d:{e:{f:{g:{if((e|0)==4){break g}J[5996]=0;b=_(202,a|0,l+524|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(b){break g}h:{i:{j:{k:{l:{switch(H[(l+92|0)+e|0]){case 1:if((e|0)==3){break c}b=J[a>>2];J[5996]=0;b=$(203,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[5996]=0;b=ba(230,h|0,1,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(b){J[5996]=0;aa(231,l+12|0,a|0);b=J[5996];J[5996]=0;if((b|0)!=1){J[5996]=0;aa(232,q|0,J[l+12>>2]);b=J[5996];J[5996]=0;if((b|0)!=1){break k}}break a}J[f>>2]=J[f>>2]|4;a=0;break d;case 4:break h;case 2:break i;case 3:break j;case 0:break l;default:break c}}if((e|0)==3){break c}}while(1){J[5996]=0;b=_(202,a|0,l+524|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(b){break c}b=J[a>>2];J[5996]=0;b=$(203,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[5996]=0;b=ba(230,h|0,1,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(!b){break c}J[5996]=0;aa(231,l+12|0,a|0);b=J[5996];J[5996]=0;if((b|0)!=1){J[5996]=0;aa(232,q|0,J[l+12>>2]);b=J[5996];J[5996]=0;if((b|0)!=1){continue}}break}break a}m:{b=K[m+11|0];if(!((b&128)>>>7|0?J[m+4>>2]:b&127)){break m}b=J[a>>2];J[5996]=0;b=$(203,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(J[((K[m+11|0]&128)>>>7|0?J[m>>2]:m)>>2]!=(b|0)){break m}J[5996]=0;$(205,a|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}H[g|0]=0;b=K[m+11|0];r=((b&128)>>>7|0?J[m+4>>2]:b&127)>>>0>1?m:r;break c}n:{o:{k=J[n+4>>2];b=K[n+11|0];if((b&128)>>>7|0?k:b&127){b=J[a>>2];J[5996]=0;b=$(203,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(J[((K[n+11|0]&128)>>>7|0?J[n>>2]:n)>>2]==(b|0)){break o}k=J[n+4>>2];b=K[n+11|0];}c=K[m+11|0];c=(c&128)>>>7|0?J[m+4>>2]:c&127;if(!c|!((b&128)>>>7|0?k:b&127)){break n}J[f>>2]=J[f>>2]|4;a=0;break d}J[5996]=0;$(205,a|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}H[g|0]=1;b=K[n+11|0];r=((b&128)>>>7|0?J[n+4>>2]:b&127)>>>0>1?n:r;break c}b=(b&128)>>>7|0?k:b&127;if(!(b|c)){break c}H[g|0]=!b;break c}if(!(r|e>>>0<2|((e|0)==2&K[l+95|0]!=0|v))){r=0;break c}J[l+12>>2]=Mb(p);p:{if(!e|K[(e+l|0)+91|0]>1){break p}q:{while(1){c=qc(p);b=J[l+12>>2];if((c|0)==(b|0)){break q}b=J[b>>2];J[5996]=0;b=ba(230,h|0,1,b|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(!b){break q}J[l+12>>2]=J[l+12>>2]+4;continue}break}break a}b=Mb(p);b=J[l+12>>2]-b>>2;c=K[q+11|0];if(b>>>0<=((c&128)>>>7|0?J[q+4>>2]:c&127)>>>0){c=Rd(qc(q),0-b|0);d=qc(q);k=Mb(p);b=Ua-16|0;Ua=b;J[b+8>>2]=k;J[b+12>>2]=c;while(1){k=(c|0)!=(d|0);if(!(!k|J[c>>2]!=J[J[b+8>>2]>>2])){J[b+12>>2]=J[b+12>>2]+4;J[b+8>>2]=J[b+8>>2]+4;c=J[b+12>>2];continue}break}Ua=b+16|0;if(!k){break p}}J[l+8>>2]=Mb(p);J[l+12>>2]=J[l+8>>2];}J[l+8>>2]=J[l+12>>2];r:{while(1){if((qc(p)|0)==J[l+8>>2]){break r}J[5996]=0;b=_(202,a|0,l+524|0)|0;c=J[5996];J[5996]=0;s:{if((c|0)==1){break s}if(b){break r}b=J[a>>2];J[5996]=0;b=$(203,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break s}if(J[J[l+8>>2]>>2]!=(b|0)){break r}J[5996]=0;$(205,a|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}J[l+8>>2]=J[l+8>>2]+4;continue}break}break a}if(!v){break c}if((qc(p)|0)==J[l+8>>2]){break c}J[f>>2]=J[f>>2]|4;a=0;break d}b=0;w=J[l+84>>2];c=o;t:{while(1){u:{J[5996]=0;d=_(202,a|0,l+524|0)|0;k=J[5996];J[5996]=0;if((k|0)==1){break u}if(d){break t}d=J[a>>2];J[5996]=0;k=$(203,d|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}J[5996]=0;d=ba(230,h|0,64,k|0)|0;x=J[5996];J[5996]=0;if((x|0)==1){break a}v:{if(d){d=J[j>>2];if((d|0)==J[l+520>>2]){J[5996]=0;ea(233,i|0,j|0,l+520|0);d=J[5996];J[5996]=0;if((d|0)==1){break a}d=J[j>>2];}J[j>>2]=d+4;J[d>>2]=k;b=b+1|0;break v}d=K[s+11|0];if(!((d&128)>>>7|0?J[s+4>>2]:d&127)|!b|(k|0)!=(w|0)){break t}if(J[l+96>>2]==(o|0)){J[5996]=0;ea(226,t|0,l+100|0,l+96|0);c=J[5996];J[5996]=0;if((c|0)==1){break a}o=J[l+100>>2];}c=o+4|0;J[l+100>>2]=c;J[o>>2]=b;o=c;b=0;}J[5996]=0;$(205,a|0)|0;d=J[5996];J[5996]=0;if((d|0)!=1){continue}}break}break a}if(!b|J[t>>2]==(c|0)){break f}if(J[l+96>>2]==(c|0)){J[5996]=0;ea(226,t|0,l+100|0,l+96|0);c=J[5996];J[5996]=0;if((c|0)==1){break a}c=J[l+100>>2];}o=c+4|0;J[l+100>>2]=o;J[c>>2]=b;break e}J[l+20>>2]=u;w:{if(!r){break w}k=1;while(1){b=K[r+11|0];if(((b&128)>>>7|0?J[r+4>>2]:b&127)>>>0<=k>>>0){break w}J[5996]=0;b=_(202,a|0,l+524|0)|0;c=J[5996];J[5996]=0;x:{if((c|0)==1){break x}y:{if(!b){b=J[a>>2];J[5996]=0;b=$(203,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break x}if(J[(k<<2)+((K[r+11|0]&128)>>>7|0?J[r>>2]:r)>>2]==(b|0)){break y}}J[f>>2]=J[f>>2]|4;a=0;break d}J[5996]=0;$(205,a|0)|0;b=J[5996];J[5996]=0;k=k+1|0;if((b|0)!=1){continue}}break}break a}a=1;b=J[t>>2];if((b|0)==(o|0)){break d}a=0;J[l+12>>2]=0;zb(s,b,o,l+12|0);if(J[l+12>>2]){J[f>>2]=J[f>>2]|4;break d}a=1;break d}o=c;}z:{if((u|0)<=0){break z}J[5996]=0;b=_(202,a|0,l+524|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}A:{if(!b){b=J[a>>2];J[5996]=0;b=$(203,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(J[l+88>>2]==(b|0)){break A}}J[f>>2]=J[f>>2]|4;a=0;break d}J[5996]=0;b=$(205,a|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}while(1){if((u|0)<=0){u=0;break z}J[5996]=0;c=_(202,b|0,l+524|0)|0;d=J[5996];J[5996]=0;B:{if((d|0)==1){break B}C:{if(!c){c=J[b>>2];J[5996]=0;c=$(203,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break B}J[5996]=0;c=ba(230,h|0,64,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break B}if(c){break C}}J[f>>2]=J[f>>2]|4;a=0;break d}if(J[j>>2]==J[l+520>>2]){J[5996]=0;ea(233,i|0,j|0,l+520|0);c=J[5996];J[5996]=0;if((c|0)==1){break B}}c=J[b>>2];J[5996]=0;c=$(203,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break B}d=J[j>>2];J[j>>2]=d+4;J[d>>2]=c;J[5996]=0;$(205,b|0)|0;c=J[5996];J[5996]=0;u=u-1|0;if((c|0)!=1){continue}}break}break a}if(J[j>>2]!=J[i>>2]){break c}J[f>>2]=J[f>>2]|4;a=0;}ab(q);ab(n);ab(m);ab(p);ab(s);db(t);break b}e=e+1|0;continue}}break a}Ua=l+528|0;return a|0}a=Z()|0;ab(q);ab(n);ab(m);ab(p);ab(s);db(t);da(a|0);B();}function Ak(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;l=Ua-528|0;Ua=l;J[l+520>>2]=k;J[l+524>>2]=b;a:{b:{if(Ub(a,l+524|0)){J[f>>2]=J[f>>2]|4;a=0;break b}J[l+76>>2]=220;t=l+104|0;J[t>>2]=l+112;s=l+76|0;J[t+4>>2]=J[s>>2];o=J[t>>2];J[l+100>>2]=o;J[l+96>>2]=o+400;J[s>>2]=0;J[s+4>>2]=0;J[s+8>>2]=0;p=l- -64|0;J[p>>2]=0;J[p+4>>2]=0;J[p+8>>2]=0;m=l+52|0;J[m>>2]=0;J[m+4>>2]=0;J[m+8>>2]=0;n=l+40|0;J[n>>2]=0;J[n+4>>2]=0;J[n+8>>2]=0;q=l+28|0;J[q>>2]=0;J[q+4>>2]=0;J[q+8>>2]=0;b=J[d>>2];J[5996]=0;sa(223,c|0,b|0,l+92|0,l+91|0,l+90|0,s|0,p|0,m|0,n|0,l+24|0);b=J[5996];J[5996]=0;if((b|0)!=1){J[j>>2]=J[i>>2];w=e&512;u=J[l+24>>2];x=K[l+95|0];y=K[l+91|0];z=K[l+90|0];d=o;e=0;while(1){c:{d:{e:{f:{if((e|0)==4){break f}J[5996]=0;b=_(186,a|0,l+524|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(b){break f}b=0;g:{h:{i:{j:{k:{switch(H[(l+92|0)+e|0]){case 1:if((e|0)==3){break c}b=J[a>>2];J[5996]=0;b=$(187,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}c=J[h+8>>2];if(J[c+((b&255)<<2)>>2]&1&(b|0)>=0){J[5996]=0;aa(224,l+16|0,a|0);b=J[5996];J[5996]=0;if((b|0)!=1){J[5996]=0;aa(98,q|0,H[l+16|0]);b=J[5996];J[5996]=0;if((b|0)!=1){break j}}break a}J[f>>2]=J[f>>2]|4;a=0;break d;case 4:break g;case 2:break h;case 3:break i;case 0:break k;default:break c}}if((e|0)==3){break c}}while(1){J[5996]=0;b=_(186,a|0,l+524|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(b){break c}b=J[a>>2];J[5996]=0;b=$(187,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}c=J[h+8>>2];if(!(J[c+((b&255)<<2)>>2]&1&(b|0)>=0)){break c}J[5996]=0;aa(224,l+16|0,a|0);b=J[5996];J[5996]=0;if((b|0)!=1){J[5996]=0;aa(98,q|0,H[l+16|0]);b=J[5996];J[5996]=0;if((b|0)!=1){continue}}break}break a}l:{b=K[m+11|0];if(!((b&128)>>>7|0?J[m+4>>2]:b&127)){break l}b=J[a>>2];J[5996]=0;b=$(187,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(K[((K[m+11|0]&128)>>>7|0?J[m>>2]:m)|0]!=(b&255)){break l}J[5996]=0;$(189,a|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}H[g|0]=0;b=K[m+11|0];r=((b&128)>>>7|0?J[m+4>>2]:b&127)>>>0>1?m:r;break c}m:{n:{k=J[n+4>>2];b=K[n+11|0];if((b&128)>>>7|0?k:b&127){b=J[a>>2];J[5996]=0;b=$(187,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if(K[((K[n+11|0]&128)>>>7|0?J[n>>2]:n)|0]==(b&255)){break n}k=J[n+4>>2];b=K[n+11|0];}c=K[m+11|0];c=(c&128)>>>7|0?J[m+4>>2]:c&127;if(!c|!((b&128)>>>7|0?k:b&127)){break m}J[f>>2]=J[f>>2]|4;a=0;break d}J[5996]=0;$(189,a|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}H[g|0]=1;b=K[n+11|0];r=((b&128)>>>7|0?J[n+4>>2]:b&127)>>>0>1?n:r;break c}b=(b&128)>>>7|0?k:b&127;if(!(b|c)){break c}H[g|0]=!b;break c}if(!(r|e>>>0<2|((e|0)==2&(x|0)!=0|w))){r=0;break c}J[l+16>>2]=Mb(p);o:{if(!e|K[(e+l|0)+91|0]>1){break o}while(1){p:{c=sc(p);b=J[l+16>>2];if((c|0)==(b|0)){break p}c=J[h+8>>2];b=H[b|0];if((b|0)>=0){b=J[c+((b&255)<<2)>>2]&1;}else {b=0;}if(!b){break p}J[l+16>>2]=J[l+16>>2]+1;continue}break}b=Mb(p);b=J[l+16>>2]-b|0;c=K[q+11|0];if(b>>>0<=((c&128)>>>7|0?J[q+4>>2]:c&127)>>>0){c=Td(sc(q),0-b|0);k=sc(q);v=Mb(p);b=Ua-16|0;Ua=b;J[b+8>>2]=v;J[b+12>>2]=c;while(1){v=(c|0)!=(k|0);if(!(!v|K[c|0]!=K[J[b+8>>2]])){J[b+12>>2]=J[b+12>>2]+1;J[b+8>>2]=J[b+8>>2]+1;c=J[b+12>>2];continue}break}Ua=b+16|0;if(!v){break o}}J[l+12>>2]=Mb(p);J[l+16>>2]=J[l+12>>2];}J[l+12>>2]=J[l+16>>2];q:{while(1){if((sc(p)|0)==J[l+12>>2]){break q}J[5996]=0;b=_(186,a|0,l+524|0)|0;c=J[5996];J[5996]=0;r:{if((c|0)==1){break r}if(b){break q}b=J[a>>2];J[5996]=0;b=$(187,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break r}if(K[J[l+12>>2]]!=(b&255)){break q}J[5996]=0;$(189,a|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}J[l+12>>2]=J[l+12>>2]+1;continue}break}break a}if(!w){break c}if((sc(p)|0)==J[l+12>>2]){break c}J[f>>2]=J[f>>2]|4;a=0;break d}s:{while(1){t:{J[5996]=0;c=_(186,a|0,l+524|0)|0;k=J[5996];J[5996]=0;if((k|0)==1){break t}if(c){break s}c=J[a>>2];J[5996]=0;k=$(187,c|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}c=J[h+8>>2];u:{if((k|0)>=0?J[c+((k&255)<<2)>>2]&64:0){c=J[j>>2];if((c|0)==J[l+520>>2]){J[5996]=0;ea(225,i|0,j|0,l+520|0);c=J[5996];J[5996]=0;if((c|0)==1){break a}c=J[j>>2];}J[j>>2]=c+1;H[c|0]=k;b=b+1|0;break u}c=K[s+11|0];if(!((c&128)>>>7|0?J[s+4>>2]:c&127)|!b|(k&255)!=(z|0)){break s}if(J[l+96>>2]==(d|0)){J[5996]=0;ea(226,t|0,l+100|0,l+96|0);c=J[5996];J[5996]=0;if((c|0)==1){break a}d=J[l+100>>2];}o=d+4|0;J[l+100>>2]=o;J[d>>2]=b;d=o;b=0;}J[5996]=0;$(189,a|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){continue}}break}break a}if(!(!b|J[t>>2]==(o|0))){if(J[l+96>>2]==(o|0)){J[5996]=0;ea(226,t|0,l+100|0,l+96|0);c=J[5996];J[5996]=0;if((c|0)==1){break a}o=J[l+100>>2];}c=o+4|0;J[l+100>>2]=c;J[o>>2]=b;o=c;}if((u|0)<=0){break e}J[5996]=0;b=_(186,a|0,l+524|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}v:{if(!b){b=J[a>>2];J[5996]=0;b=$(187,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}if((b&255)==(y|0)){break v}}J[f>>2]=J[f>>2]|4;a=0;break d}J[5996]=0;b=$(189,a|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}while(1){if((u|0)<=0){u=0;break e}J[5996]=0;c=_(186,b|0,l+524|0)|0;d=J[5996];J[5996]=0;w:{if((d|0)==1){break w}x:{if(!c){c=J[b>>2];J[5996]=0;c=$(187,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break w}d=J[h+8>>2];if((c|0)>=0?J[d+((c&255)<<2)>>2]&64:0){break x}}J[f>>2]=J[f>>2]|4;a=0;break d}if(J[j>>2]==J[l+520>>2]){J[5996]=0;ea(225,i|0,j|0,l+520|0);c=J[5996];J[5996]=0;if((c|0)==1){break w}}c=J[b>>2];J[5996]=0;c=$(187,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break w}d=J[j>>2];J[j>>2]=d+1;H[d|0]=c;J[5996]=0;$(189,b|0)|0;c=J[5996];J[5996]=0;u=u-1|0;if((c|0)!=1){continue}}break}break a}J[l+24>>2]=u;y:{if(!r){break y}k=1;while(1){b=K[r+11|0];if(((b&128)>>>7|0?J[r+4>>2]:b&127)>>>0<=k>>>0){break y}J[5996]=0;b=_(186,a|0,l+524|0)|0;c=J[5996];J[5996]=0;z:{if((c|0)==1){break z}A:{if(!b){b=J[a>>2];J[5996]=0;b=$(187,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break z}if(K[((K[r+11|0]&128)>>>7|0?J[r>>2]:r)+k|0]==(b&255)){break A}}J[f>>2]=J[f>>2]|4;a=0;break d}J[5996]=0;$(189,a|0)|0;b=J[5996];J[5996]=0;k=k+1|0;if((b|0)!=1){continue}}break}break a}a=1;b=J[t>>2];if((b|0)==(o|0)){break d}a=0;J[l+16>>2]=0;zb(s,b,o,l+16|0);if(J[l+16>>2]){J[f>>2]=J[f>>2]|4;break d}a=1;break d}d=o;if(J[j>>2]!=J[i>>2]){break c}J[f>>2]=J[f>>2]|4;a=0;}ab(q);ab(n);ab(m);ab(p);ab(s);db(t);break b}e=e+1|0;continue}}break a}Ua=l+528|0;return a|0}a=Z()|0;ab(q);ab(n);ab(m);ab(p);ab(s);db(t);da(a|0);B();}function An(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;a:{b:{c:{d:{e:{f:{g:{switch(J[b>>2]){case 0:J[a+12>>2]=1;J[a+16>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;J[a>>2]=0;return;case 2:J[a+12>>2]=1;J[a+16>>2]=0;break b;case 3:J[a+12>>2]=1;J[a+16>>2]=0;J[a+4>>2]=1;J[a+8>>2]=0;J[a>>2]=3;return;case 4:case 5:J[a+12>>2]=0;J[a+16>>2]=0;J[a+4>>2]=1;J[a+8>>2]=0;J[a>>2]=1;return;case 6:case 7:case 8:case 9:J[a+12>>2]=0;J[a+16>>2]=0;J[a+4>>2]=1;J[a+8>>2]=0;J[a>>2]=4;return;case 17:b=J[b+32>>2];c=J[b+8>>2];h=J[c+52>>2];b=J[b>>2];f=J[b+52>>2];e=K[b+48|0];g=K[c+48|0];c=J[c+44>>2];b=J[b+44>>2];J[a+12>>2]=0;J[a+16>>2]=0;J[a>>2]=b+c;break a;case 18:b=J[b+32>>2];m=J[b+8>>2];h=J[m+52>>2];j=J[b>>2];f=J[j+52>>2];e=K[j+48|0];g=K[m+48|0];i=J[m+60>>2];d=J[j+60>>2];c=K[j+56|0];b=K[m+56|0];J[a>>2]=(J[j+44>>2]+J[m+44>>2]|0)+1;c=(c|0)!=0&(b|0)!=0;b=c&0;J[a+12>>2]=b|c;J[a+16>>2]=c?d+i|0:0;break a;case 19:b=J[b+32>>2];h=J[b>>2];g=J[h+60>>2];f=K[h+56|0]!=0;c=J[b+8>>2];l=f&K[c+48|0]!=0;e=l?g+J[c+52>>2]|0:0;b=(J[h+44>>2]+J[c+44>>2]|0)+1|0;i=J[c+60>>2];d=K[c+56|0];if(!(!K[h+48|0]|!d)){c=i+J[h+52>>2]|0;e=l?c>>>0>e>>>0?c:e:c;l=1;}J[a>>2]=b;J[a+4>>2]=l;J[a+8>>2]=e;e=f&(d|0)!=0;b=e&0;J[a+12>>2]=b|e;J[a+16>>2]=e?g+i|0:0;return;case 21:b=J[b+32>>2];c=J[b>>2];j=J[c+60>>2];m=J[b+8>>2];e=j+J[m+52>>2]|0;h=K[c+56|0];b=K[m+48|0]!=0&(h|0)!=0;g=(J[c+44>>2]+J[m+44>>2]|0)+3|0;d=b?e:0;h:{if(!K[c+48|0]){break h}if(!b){b=J[c+48>>2];f=b&-256;d=J[c+52>>2];break h}b=1;c=J[c+52>>2];d=c>>>0>e>>>0?c:e;}i=J[m+60>>2];e=K[m+56|0];J[a>>2]=g;c=b&255;b=0;J[a+4>>2]=c|(f|b);J[a+8>>2]=d|p;c=(h|0)!=0&(e|0)!=0;b=c?b:0;J[a+12>>2]=b|c;J[a+16>>2]=c?i+j|0:0;return;case 20:b=J[b+32>>2];i=J[b>>2];c=J[b+8>>2];d=J[i+60>>2]+J[c+52>>2]|0;b=K[c+48|0]!=0&K[i+56|0]!=0;e=(J[i+44>>2]+J[c+44>>2]|0)+2|0;c=b?d:0;i:{if(!K[i+48|0]){break i}if(!b){b=J[i+48>>2];f=b&-256;c=J[i+52>>2];break i}b=1;c=J[i+52>>2];c=c>>>0>d>>>0?c:d;}J[a+12>>2]=0;J[a+16>>2]=0;J[a>>2]=e;J[a+4>>2]=f|b&255;J[a+8>>2]=c|p;return;case 22:b=J[b+32>>2];d=J[b>>2];j=J[b+8>>2];f=J[d+44>>2]+J[j+44>>2]|0;j:{if(!K[d+48|0]){b=J[j+48>>2];h=b&-256;e=J[j+52>>2];break j}if(!K[j+48|0]){b=J[d+48>>2];h=b&-256;e=J[d+52>>2];break j}b=1;e=J[d+52>>2];c=J[j+52>>2];e=c>>>0<e>>>0?e:c;}i=f+3|0;k:{if(!K[d+56|0]){f=J[j+56>>2];g=f&-256;c=J[j+60>>2];break k}if(!K[j+56|0]){f=J[d+56>>2];g=f&-256;c=J[d+60>>2];break k}f=1;d=J[d+60>>2];c=J[j+60>>2];c=c>>>0<d>>>0?d:c;}J[a>>2]=i;J[a+12>>2]=f&255|g&-256;d=0;J[a+16>>2]=d|(c|d);J[a+4>>2]=b&255|h&-256;f=0;J[a+8>>2]=f|(e|f);return;case 23:b=J[b+32>>2];h=J[b+16>>2];f=J[b>>2];g=J[f+60>>2];i=K[f+56|0]!=0;d=i&K[h+48|0]!=0;e=d?J[h+52>>2]+g|0:0;b=J[b+8>>2];c=(J[h+44>>2]+(J[f+44>>2]+J[b+44>>2]|0)|0)+3|0;if(!(!K[b+48|0]|!K[f+48|0])){b=J[f+52>>2]+J[b+52>>2]|0;e=d?b>>>0>e>>>0?b:e:b;d=1;}f=J[h+60>>2];b=K[h+56|0];J[a>>2]=c;J[a+4>>2]=d;J[a+8>>2]=e;e=i&(b|0)!=0;b=e&0;J[a+12>>2]=b|e;J[a+16>>2]=e?f+g|0:0;return;case 25:c=J[b+12>>2];b=J[b+8>>2];J[a>>2]=1;b=(c-b|0)/12|0;c=1;J[a+12>>2]=c;J[a+16>>2]=b;J[a+4>>2]=c;J[a+8>>2]=b;return;case 11:case 12:case 16:d=J[J[b+32>>2]>>2];f=J[d+48>>2];e=J[d+52>>2];c=J[d+44>>2];b=J[d+60>>2];J[a+12>>2]=J[d+56>>2];J[a+16>>2]=b;J[a+4>>2]=f;J[a+8>>2]=e;J[a>>2]=c+1;return;case 10:d=J[J[b+32>>2]>>2];f=J[d+48>>2];e=J[d+52>>2];c=J[d+44>>2];b=J[d+60>>2];J[a+12>>2]=J[d+56>>2];J[a+16>>2]=b;J[a+4>>2]=f;J[a+8>>2]=e;J[a>>2]=c+2;return;case 13:b=J[J[b+32>>2]>>2];e=J[b+48>>2];c=J[b+52>>2];b=J[b+44>>2];J[a+12>>2]=1;J[a+16>>2]=0;J[a+4>>2]=e;J[a+8>>2]=c;J[a>>2]=b+3;return;case 15:b=J[J[b+32>>2]>>2];e=J[b+48>>2];c=J[b+52>>2];b=J[b+44>>2];J[a+12>>2]=1;J[a+16>>2]=0;J[a+4>>2]=e;J[a+8>>2]=c;J[a>>2]=b+4;return;case 14:c=J[J[b+32>>2]>>2];d=J[c+44>>2];f=J[c+80>>2];e=Wb(1239,1);b=J[J[b+32>>2]>>2];c=J[b+48>>2];b=J[b+52>>2];J[a+12>>2]=0;J[a+16>>2]=0;J[a+4>>2]=c;J[a+8>>2]=b;J[a>>2]=d+!(e&(f^-1));return;case 24:c=cb(8);J[c>>2]=1;J[c+4>>2]=0;l=c+8|0;n=J[b+32>>2];p=J[b+36>>2];if((n|0)!=(p|0)){while(1){e=J[n>>2];h=J[e+60>>2];g=K[e+56|0];d=J[c+4>>2];i=c;f=K[c|0];m=J[e+44>>2];J[5996]=0;e=$(3,8)|0;c=J[5996];J[5996]=0;l:{m:{if((c|0)!=1){c=d+h|0;d=(f|0)!=0&(g|0)!=0;f=d&0;J[e>>2]=d|f;J[e+4>>2]=d?c:0;g=e+8|0;c=l-i|0;r=c>>3;if(c>>>0>=9){break m}f=g;break l}f=Z()|0;c=i;break e}j=r>>>0<=2?2:r;l=1;f=g;while(1){q=J[n>>2];c=i+(l<<3)|0;k=J[q+60>>2]+J[c+4>>2]|0;d=c-8|0;o=K[d|0]!=0&K[q+48|0]!=0;h=K[c|0]!=0&K[q+56|0]!=0;c=h?k:0;d=o?J[q+52>>2]+J[d+4>>2]|0:0;c=h?o?c>>>0>d>>>0?c:d:k:d;o=h|o;n:{if(f>>>0<g>>>0){J[f>>2]=o;J[f+4>>2]=c;d=f;break n}h=f-e>>3;k=h+1|0;if(k>>>0>=536870912){J[5996]=0;ca(93);a=J[5996];J[5996]=0;if((a|0)==1){break f}break c}g=g-e|0;d=g>>2;k=g>>>0>=2147483640?536870911:d>>>0>k>>>0?d:k;o:{if(!k){g=0;break o}if(k>>>0>=536870912){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break c}break f}J[5996]=0;g=$(3,k<<3)|0;d=J[5996];J[5996]=0;if((d|0)==1){break f}}d=(h<<3)+g|0;J[d>>2]=o;J[d+4>>2]=c;g=(k<<3)+g|0;c=d;p:{if((e|0)!=(f|0)){while(1){f=f-8|0;h=J[f+4>>2];c=c-8|0;J[c>>2]=J[f>>2];J[c+4>>2]=h;if((e|0)!=(f|0)){continue}break}if(!e){break p}}$a(e);}e=c;}f=d+8|0;l=l+1|0;if((j|0)!=(l|0)){continue}break}}d=(i+(r<<3)|0)-8|0;c=J[n>>2];k=K[d|0]!=0&K[c+48|0]!=0;d=k?J[c+52>>2]+J[d+4>>2]|0:0;q:{if(f>>>0<g>>>0){J[f>>2]=k;J[f+4>>2]=d;l=f+8|0;c=e;break q}r:{s:{h=f-e>>3;j=h+1|0;t:{if(j>>>0>=536870912){J[5996]=0;ca(93);break t}g=g-e|0;c=g>>2;c=g>>>0>=2147483640?536870911:c>>>0>j>>>0?c:j;if(!c){c=0;break r}if(c>>>0<536870912){break s}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break c}break f}J[5996]=0;c=$(3,c<<3)|0;g=J[5996];J[5996]=0;if((g|0)==1){break f}}c=(h<<3)+c|0;J[c>>2]=k;J[c+4>>2]=d;l=c+8|0;if((e|0)!=(f|0)){while(1){f=f-8|0;d=J[f+4>>2];c=c-8|0;J[c>>2]=J[f>>2];J[c+4>>2]=d;if((e|0)!=(f|0)){continue}break}if(!e){break q}}$a(e);}s=(m+s|0)+1|0;$a(i);n=n+8|0;if((p|0)!=(n|0)){continue}break}}b=J[b+4>>2];if(b>>>0<=l-c>>3>>>0){b=(b<<3)+c|0;f=J[b>>2];e=J[b+4>>2];b=J[c+4>>2];J[a+12>>2]=J[c>>2];J[a+16>>2]=b;J[a+4>>2]=f;J[a+8>>2]=e;J[a>>2]=s;$a(c);return}J[5996]=0;ga(44,5118,2210,799,1422);a=J[5996];J[5996]=0;if((a|0)!=1){break c}f=Z()|0;if(!c){break d}break e;default:la(2350,2210,803,1422);B();case 1:break g}}J[a+12>>2]=0;J[a+16>>2]=0;break b}f=Z()|0;if(!e){c=i;break e}$a(e);c=i;}$a(c);}da(f|0);B();}B();}J[a+4>>2]=1;J[a+8>>2]=0;J[a>>2]=0;return}e=(e|0)!=0&(g|0)!=0;b=e&0;J[a+4>>2]=b|e;J[a+8>>2]=e?f+h|0:0;}function Em(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;e=Ua-80|0;Ua=e;d=cb(32);J[e+68>>2]=d;J[e+72>>2]=19;J[e+76>>2]=-2147483616;f=K[5568]|K[5569]<<8|(K[5570]<<16|K[5571]<<24);H[d+15|0]=f;H[d+16|0]=f>>>8;H[d+17|0]=f>>>16;H[d+18|0]=f>>>24;f=K[5565]|K[5566]<<8|(K[5567]<<16|K[5568]<<24);g=K[5561]|K[5562]<<8|(K[5563]<<16|K[5564]<<24);H[d+8|0]=g;H[d+9|0]=g>>>8;H[d+10|0]=g>>>16;H[d+11|0]=g>>>24;H[d+12|0]=f;H[d+13|0]=f>>>8;H[d+14|0]=f>>>16;H[d+15|0]=f>>>24;f=K[5557]|K[5558]<<8|(K[5559]<<16|K[5560]<<24);g=K[5553]|K[5554]<<8|(K[5555]<<16|K[5556]<<24);H[d|0]=g;H[d+1|0]=g>>>8;H[d+2|0]=g>>>16;H[d+3|0]=g>>>24;H[d+4|0]=f;H[d+5|0]=f>>>8;H[d+6|0]=f>>>16;H[d+7|0]=f>>>24;H[d+19|0]=0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{d=J[J[b>>2]+80>>2];q:{if(!d){J[5996]=0;_(97,e+68|0,2603)|0;d=J[5996];J[5996]=0;if((d|0)!=1){break q}break b}J[5996]=0;f=_(54,3557,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break p}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,66);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,2796,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break o}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,86);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,2777,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break n}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,87);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,3310,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break m}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,75);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,1029,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break l}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,122);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,1959,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break k}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,111);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,2029,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break j}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,110);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,2522,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break i}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,100);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,2315,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break h}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,102);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,2451,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break g}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,101);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,2049,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break f}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,109);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,1295,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break e}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,117);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,1681,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(!((d^-1)&f)){J[5996]=0;aa(98,e+68|0,115);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+80>>2];J[5996]=0;f=_(54,2165,1)|0;g=J[5996];J[5996]=0;if((g|0)==1){break c}if((d^-1)&f){break q}J[5996]=0;aa(98,e+68|0,107);d=J[5996];J[5996]=0;if((d|0)==1){break b}}d=J[J[b>>2]+84>>2];J[5996]=0;f=e+44|0;aa(115,f|0,d|0);d=J[5996];J[5996]=0;r:{s:{t:{u:{v:{w:{x:{y:{z:{A:{B:{C:{D:{E:{F:{if((d|0)!=1){J[5996]=0;d=ba(99,f|0,0,5487)|0;f=J[5996];J[5996]=0;if((f|0)==1){break F}J[e- -64>>2]=J[d+8>>2];f=J[d+4>>2];J[e+56>>2]=J[d>>2];J[e+60>>2]=f;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;f=K[e+67|0];g=f<<24>>24<0;f=ba(100,e+68|0,(g?J[e+56>>2]:e+56|0)|0,(g?J[e+60>>2]:f)|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break E}if(H[e+67|0]<0){$a(J[e+56>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}d=J[b>>2];g=J[d+52>>2];d=J[d+44>>2];J[5996]=0;h=e+32|0;aa(164,h|0,d+g|0);d=J[5996];J[5996]=0;if((d|0)==1){break C}J[5996]=0;d=ba(99,h|0,0,5459)|0;g=J[5996];J[5996]=0;if((g|0)==1){break B}J[e- -64>>2]=J[d+8>>2];g=J[d+4>>2];J[e+56>>2]=J[d>>2];J[e+60>>2]=g;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;h=f;f=K[e+67|0];g=f<<24>>24<0;f=ba(100,h|0,(g?J[e+56>>2]:e+56|0)|0,(g?J[e+60>>2]:f)|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break A}if(H[e+67|0]<0){$a(J[e+56>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}b=J[J[b>>2]+68>>2];J[5996]=0;d=e+20|0;aa(164,d|0,b+1|0);b=J[5996];J[5996]=0;if((b|0)==1){break y}J[5996]=0;b=ba(99,d|0,0,5524)|0;d=J[5996];J[5996]=0;if((d|0)==1){break x}J[e- -64>>2]=J[b+8>>2];d=J[b+4>>2];J[e+56>>2]=J[b>>2];J[e+60>>2]=d;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;h=f;d=K[e+67|0];f=d<<24>>24<0;d=ba(100,h|0,(f?J[e+56>>2]:e+56|0)|0,(f?J[e+60>>2]:d)|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break w}if(H[e+67|0]<0){$a(J[e+56>>2]);}if(H[b+11|0]<0){$a(J[b>>2]);}J[5996]=0;d=_(97,d|0,3759)|0;b=J[5996];J[5996]=0;if((b|0)==1){break u}J[e+16>>2]=J[d+8>>2];b=J[d+4>>2];J[e+8>>2]=J[d>>2];J[e+12>>2]=b;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;f=J[c>>2];g=J[c+4>>2];b=K[c+11|0];J[5996]=0;h=c;c=b<<24>>24<0;b=ba(100,e+8|0,(c?f:h)|0,(c?g:b)|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break t}J[e- -64>>2]=J[b+8>>2];c=J[b+4>>2];J[e+56>>2]=J[b>>2];J[e+60>>2]=c;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[5996]=0;c=_(97,e+56|0,3559)|0;f=J[5996];J[5996]=0;if((f|0)==1){break s}f=J[c+4>>2];J[a>>2]=J[c>>2];J[a+4>>2]=f;J[a+8>>2]=J[c+8>>2];J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;if(H[b+11|0]<0){$a(J[b>>2]);}if(H[d+11|0]<0){$a(J[d>>2]);}Ua=e+80|0;return}b=Z()|0;break a}b=Z()|0;break D}b=Z()|0;if(H[e+67|0]>=0){break D}$a(J[e+56>>2]);}if(H[e+55|0]>=0){break a}$a(J[e+44>>2]);break a}b=Z()|0;break a}b=Z()|0;break z}b=Z()|0;if(H[e+67|0]>=0){break z}$a(J[e+56>>2]);}if(H[e+43|0]>=0){break a}$a(J[e+32>>2]);break a}b=Z()|0;break a}b=Z()|0;break v}b=Z()|0;if(H[e+67|0]>=0){break v}$a(J[e+56>>2]);}if(H[e+31|0]>=0){break a}$a(J[e+20>>2]);break a}b=Z()|0;break a}b=Z()|0;break r}b=Z()|0;if(H[e+67|0]>=0){break r}$a(J[e+56>>2]);}if(H[e+19|0]>=0){break a}$a(J[e+8>>2]);break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;break a}b=Z()|0;}if(H[e+79|0]<0){$a(J[e+68>>2]);}da(b|0);B();}function Gg(a,b,c,d,e,f){a=a|0;b=+b;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0;m=Ua-560|0;Ua=m;J[m+44>>2]=0;A(+b);g=v(1)|0;v(0)|0;a:{if((g|0)<0){s=1;x=1222;b=-b;A(+b);g=v(1)|0;v(0)|0;break a}if(e&2048){s=1;x=1225;break a}s=e&1;x=s?1228:1223;z=!s;}b:{if((g&2146435072)==2146435072){g=s+3|0;Bb(a,32,c,g,e&-65537);wb(a,x,s);d=f&32;wb(a,b!=b?d?2020:3082:d?2300:3355,3);Bb(a,32,c,g,e^8192);o=(c|0)<(g|0)?g:c;break b}u=m+16|0;c:{d:{e:{b=Lg(b,m+44|0);b=b+b;if(b!=0){g=J[m+44>>2];J[m+44>>2]=g-1;w=f|32;if((w|0)!=97){break e}break c}w=f|32;if((w|0)==97){break c}j=J[m+44>>2];l=(d|0)<0?6:d;break d}j=g-29|0;J[m+44>>2]=j;b=b*268435456;l=(d|0)<0?6:d;}q=(m+48|0)+((j|0)>=0?288:0)|0;h=q;while(1){if(b<4294967296&b>=0){d=~~b>>>0;}else {d=0;}J[h>>2]=d;h=h+4|0;b=(b-+(d>>>0))*1e9;if(b!=0){continue}break}f:{if((j|0)<=0){d=j;g=h;i=q;break f}i=q;d=j;while(1){k=(d|0)>=29?29:d;g=h-4|0;g:{if(i>>>0>g>>>0){break g}n=0;while(1){d=J[g>>2];o=k&31;y=n;if((k&63)>>>0>=32){n=d<<o;d=0;}else {n=(1<<o)-1&d>>>32-o;d=d<<o;}o=y+d|0;n=n+p|0;n=eo(o,d>>>0>o>>>0?n+1|0:n,1e9);d=co(n,Wa,-1e9,0)+o|0;J[g>>2]=d;g=g-4|0;if(i>>>0<=g>>>0){continue}break}if(!n){break g}i=i-4|0;J[i>>2]=n;}while(1){g=h;if(i>>>0<g>>>0){h=g-4|0;if(!J[h>>2]){continue}}break}d=J[m+44>>2]-k|0;J[m+44>>2]=d;h=g;if((d|0)>0){continue}break}}if((d|0)<0){t=((l+25>>>0)/9|0)+1|0;p=(w|0)==102;while(1){d=0-d|0;o=(d|0)>=9?9:d;h:{if(g>>>0<=i>>>0){h=J[i>>2];break h}n=1e9>>>o|0;k=-1<<o^-1;d=0;h=i;while(1){y=d;d=J[h>>2];J[h>>2]=y+(d>>>o|0);d=P(n,d&k);h=h+4|0;if(h>>>0<g>>>0){continue}break}h=J[i>>2];if(!d){break h}J[g>>2]=d;g=g+4|0;}d=o+J[m+44>>2]|0;J[m+44>>2]=d;i=(!h<<2)+i|0;h=p?q:i;g=g-h>>2>(t|0)?h+(t<<2)|0:g;if((d|0)<0){continue}break}}d=0;i:{if(g>>>0<=i>>>0){break i}d=P(q-i>>2,9);h=10;k=J[i>>2];if(k>>>0<10){break i}while(1){d=d+1|0;h=P(h,10);if(k>>>0>=h>>>0){continue}break}}h=(l-((w|0)!=102?d:0)|0)-((w|0)==103&(l|0)!=0)|0;if((h|0)<(P(g-q>>2,9)-9|0)){n=h+9216|0;k=(n|0)/9|0;j=((((j|0)<0?4:292)+m|0)+(k<<2)|0)-4048|0;h=10;o=n+P(k,-9)|0;if((o|0)<=7){while(1){h=P(h,10);o=o+1|0;if((o|0)!=8){continue}break}}n=J[j>>2];t=(n>>>0)/(h>>>0)|0;p=P(t,h);k=j+4|0;j:{if((n|0)==(p|0)&(k|0)==(g|0)){break j}n=n-p|0;k:{if(!(t&1)){b=9007199254740992;if(!(H[j-4|0]&1)|((h|0)!=1e9|i>>>0>=j>>>0)){break k}}b=9007199254740994;}r=(g|0)==(k|0)?1:1.5;k=h>>>1|0;r=k>>>0>n>>>0?.5:(k|0)==(n|0)?r:1.5;if(!(K[x|0]!=45|z)){r=-r;b=-b;}J[j>>2]=p;if(b+r==b){break j}d=h+p|0;J[j>>2]=d;if(d>>>0>=1e9){while(1){J[j>>2]=0;j=j-4|0;if(j>>>0<i>>>0){i=i-4|0;J[i>>2]=0;}d=J[j>>2]+1|0;J[j>>2]=d;if(d>>>0>999999999){continue}break}}d=P(q-i>>2,9);h=10;k=J[i>>2];if(k>>>0<10){break j}while(1){d=d+1|0;h=P(h,10);if(k>>>0>=h>>>0){continue}break}}h=j+4|0;g=g>>>0>h>>>0?h:g;}while(1){k=g;n=g>>>0<=i>>>0;if(!n){g=g-4|0;if(!J[g>>2]){continue}}break}l:{if((w|0)!=103){j=e&8;break l}h=l?l:1;g=(h|0)>(d|0)&(d|0)>-5;l=(g?d^-1:-1)+h|0;f=(g?-1:-2)+f|0;j=e&8;if(j){break l}g=-9;m:{if(n){break m}j=J[k-4>>2];if(!j){break m}o=10;g=0;if((j>>>0)%10|0){break m}while(1){h=g;g=g+1|0;o=P(o,10);if(!((j>>>0)%(o>>>0)|0)){continue}break}g=h^-1;}h=P(k-q>>2,9);if((f&-33)==70){j=0;g=(g+h|0)-9|0;g=(g|0)>0?g:0;l=(g|0)>(l|0)?l:g;break l}j=0;g=((d+h|0)+g|0)-9|0;g=(g|0)>0?g:0;l=(g|0)>(l|0)?l:g;}o=-1;n=j|l;if(((n?2147483645:2147483646)|0)<(l|0)){break b}p=(((n|0)!=0)+l|0)+1|0;h=f&-33;n:{if((h|0)==70){if((p^2147483647)<(d|0)){break b}g=(d|0)>0?d:0;break n}g=d>>31;g=Jc((g^d)-g|0,0,u);if((u-g|0)<=1){while(1){g=g-1|0;H[g|0]=48;if((u-g|0)<2){continue}break}}t=g-2|0;H[t|0]=f;H[g-1|0]=(d|0)<0?45:43;g=u-t|0;if((g|0)>(p^2147483647)){break b}}d=g+p|0;if((d|0)>(s^2147483647)){break b}p=d+s|0;Bb(a,32,c,p,e);wb(a,x,s);Bb(a,48,c,p,e^65536);o:{p:{q:{if((h|0)==70){f=m+16|0;d=f|8;j=f|9;h=i>>>0>q>>>0?q:i;i=h;while(1){g=Jc(J[i>>2],0,j);r:{if((h|0)!=(i|0)){if(m+16>>>0>=g>>>0){break r}while(1){g=g-1|0;H[g|0]=48;if(m+16>>>0<g>>>0){continue}break}break r}if((g|0)!=(j|0)){break r}H[m+24|0]=48;g=d;}wb(a,g,j-g|0);i=i+4|0;if(q>>>0>=i>>>0){continue}break}if(n){wb(a,4352,1);}if((l|0)<=0|i>>>0>=k>>>0){break q}while(1){g=Jc(J[i>>2],0,j);if(g>>>0>m+16>>>0){while(1){g=g-1|0;H[g|0]=48;if(m+16>>>0<g>>>0){continue}break}}wb(a,g,(l|0)>=9?9:l);g=l-9|0;i=i+4|0;if(k>>>0<=i>>>0){break p}d=(l|0)>9;l=g;if(d){continue}break}break p}s:{if((l|0)<0){break s}q=i>>>0<k>>>0?k:i+4|0;f=m+16|0;d=f|8;k=f|9;h=i;while(1){g=Jc(J[h>>2],0,k);if((k|0)==(g|0)){H[m+24|0]=48;g=d;}t:{if((h|0)!=(i|0)){if(m+16>>>0>=g>>>0){break t}while(1){g=g-1|0;H[g|0]=48;if(m+16>>>0<g>>>0){continue}break}break t}wb(a,g,1);g=g+1|0;if(!(j|l)){break t}wb(a,4352,1);}f=k-g|0;wb(a,g,(f|0)<(l|0)?f:l);l=l-f|0;h=h+4|0;if(q>>>0<=h>>>0){break s}if((l|0)>=0){continue}break}}Bb(a,48,l+18|0,18,0);wb(a,t,u-t|0);break o}g=l;}Bb(a,48,g+9|0,9,0);}Bb(a,32,c,p,e^8192);o=(c|0)<(p|0)?p:c;break b}j=(f<<26>>31&9)+x|0;u:{if(d>>>0>11){break u}g=12-d|0;r=16;while(1){r=r*16;g=g-1|0;if(g){continue}break}if(K[j|0]==45){b=-(r+(-b-r));break u}b=b+r-r;}q=s|2;i=f&32;h=J[m+44>>2];g=h>>31;g=Jc((g^h)-g|0,0,u);if((u|0)==(g|0)){H[m+15|0]=48;g=m+15|0;}l=g-2|0;H[l|0]=f+15;H[g-1|0]=(h|0)<0?45:43;g=e&8;h=m+16|0;while(1){f=h;if(R(b)<2147483648){k=~~b;}else {k=-2147483648;}H[h|0]=i|K[k+7488|0];b=(b-+(k|0))*16;h=f+1|0;if(!(!((d|0)>0|g)&b==0|(h-(m+16|0)|0)!=1)){H[f+1|0]=46;h=f+2|0;}if(b!=0){continue}break}o=-1;g=u-l|0;f=g+q|0;if((2147483645-f|0)<(d|0)){break b}k=f;f=m+16|0;i=h-f|0;d=d?(i-2|0)<(d|0)?d+2|0:i:i;h=k+d|0;Bb(a,32,c,h,e);wb(a,j,q);Bb(a,48,c,h,e^65536);wb(a,f,i);Bb(a,48,d-i|0,0,0);wb(a,l,g);Bb(a,32,c,h,e^8192);o=(c|0)<(h|0)?h:c;}Ua=m+560|0;return o|0}function zn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;a:{b:{c:{d:{e:{f:{g:{switch(J[b>>2]){case 1:case 4:case 5:J[a+8>>2]=0;J[a+12>>2]=0;J[a>>2]=1;J[a+4>>2]=0;return;case 2:J[a+8>>2]=1;J[a+12>>2]=1;break a;case 3:J[a+8>>2]=1;J[a+12>>2]=2;J[a>>2]=1;J[a+4>>2]=2;return;case 6:case 7:case 8:case 9:J[a+8>>2]=0;J[a+12>>2]=0;break a;case 23:d=J[b+32>>2];b=J[d+16>>2];c=J[d>>2];e=J[c+76>>2];j=K[c+72|0]!=0;i=j&K[b+64|0]!=0;f=i?J[b+68>>2]+e|0:0;h:{if(!K[c+64|0]){break h}d=J[d+8>>2];if(!K[d+64|0]){break h}c=J[d+68>>2]+J[c+68>>2]|0;f=i?c>>>0>f>>>0?c:f:c;i=1;}d=J[b+76>>2];b=K[b+72|0];J[a>>2]=i;J[a+4>>2]=f;b=j&(b|0)!=0;c=b&0;J[a+8>>2]=b|c;J[a+12>>2]=b?d+e|0:0;return;case 17:b=J[b+32>>2];c=J[b+8>>2];d=J[c+68>>2];b=J[b>>2];f=J[b+68>>2];b=K[b+64|0];e=K[c+64|0];J[a+8>>2]=0;J[a+12>>2]=0;c=d+f|0;b=(b|0)!=0&(e|0)!=0;d=b&0;J[a>>2]=b|d;J[a+4>>2]=b?c:0;return;case 18:c=J[b+32>>2];b=J[c+8>>2];f=J[b+68>>2];d=J[c>>2];e=J[d+68>>2];j=K[d+64|0];g=K[b+64|0];c=J[b+76>>2]+J[d+76>>2]|0;b=K[d+72|0]!=0&K[b+72|0]!=0;d=b&0;J[a+8>>2]=b|d;J[a+12>>2]=b?c:0;b=(j|0)!=0&(g|0)!=0;d=b&0;J[a>>2]=b|d;J[a+4>>2]=b?e+f|0:0;return;case 19:c=J[b+32>>2];b=J[c+8>>2];f=J[b+76>>2];j=K[b+72|0]!=0;d=J[c>>2];i=j&K[d+64|0]!=0;c=i?f+J[d+68>>2]|0:0;e=J[d+76>>2];g=K[d+72|0];if(!(!g|!K[b+64|0])){b=e+J[b+68>>2]|0;c=i?b>>>0>c>>>0?b:c:b;i=1;}J[a>>2]=i;J[a+4>>2]=c;b=j&(g|0)!=0;d=b&0;J[a+8>>2]=b|d;J[a+12>>2]=b?e+f|0:0;return;case 20:b=J[b+32>>2];e=J[b+8>>2];c=J[b>>2];d=J[e+68>>2]+J[c+76>>2]|0;b=K[c+72|0]!=0&K[e+64|0]!=0;e=b?d:0;i:{if(!K[c+64|0]){break i}if(!b){b=J[c+64>>2];f=b&-256;e=J[c+68>>2];break i}b=1;c=J[c+68>>2];e=c>>>0>d>>>0?c:d;}c=e;J[a+8>>2]=0;J[a+12>>2]=0;J[a>>2]=f|b&255;J[a+4>>2]=c|j;return;case 21:b=J[b+32>>2];d=J[b+8>>2];c=J[b>>2];g=J[c+76>>2];e=J[d+68>>2]+g|0;i=K[c+72|0];b=(i|0)!=0&K[d+64|0]!=0;h=b?e:0;j:{if(!K[c+64|0]){break j}if(!b){b=J[c+64>>2];f=b&-256;h=J[c+68>>2];break j}b=1;c=J[c+68>>2];h=c>>>0>e>>>0?c:e;}e=h;c=J[d+76>>2];d=K[d+72|0];h=b&255;b=0;J[a>>2]=h|(f|b);J[a+4>>2]=e|j;e=c+g|0;c=b;b=(i|0)!=0&(d|0)!=0;c=b?c:0;J[a+8>>2]=b|c;J[a+12>>2]=b?e:0;return;case 22:d=J[b+32>>2];b=J[d+8>>2];f=K[b+64|0];c=f?J[b+68>>2]+1|0:0;e=J[d>>2];if(K[e+64|0]){d=J[e+68>>2]+1|0;c=f?c>>>0<d>>>0?d:c:d;f=1;}j=J[b+76>>2]+1|0;b=K[b+72|0];d=b?j:0;if(K[e+72|0]){e=J[e+76>>2]+1|0;d=b?d>>>0<e>>>0?e:d:e;b=1;}j=b;b=0;J[a+8>>2]=j|b;J[a+12>>2]=d;J[a>>2]=b|f;J[a+4>>2]=c;return;case 25:c=J[b+4>>2]+1|0;b=1;J[a+8>>2]=b;J[a+12>>2]=c;break b;case 10:case 11:case 12:case 16:b=J[J[b+32>>2]>>2];c=J[b+68>>2];J[a>>2]=J[b+64>>2];J[a+4>>2]=c;c=J[b+76>>2];J[a+8>>2]=J[b+72>>2];J[a+12>>2]=c;return;case 13:b=J[J[b+32>>2]>>2];c=J[b+68>>2];b=K[b+64|0];J[a+8>>2]=1;J[a+12>>2]=1;j=b;b=!b;J[a>>2]=j|b&0;J[a+4>>2]=b?0:c+1|0;return;case 14:c=J[J[b+32>>2]>>2];b=J[c+64>>2];c=J[c+68>>2];J[a+8>>2]=0;J[a+12>>2]=0;break b;case 15:c=J[J[b+32>>2]>>2];b=J[c+64>>2];c=J[c+68>>2];J[a+8>>2]=1;J[a+12>>2]=1;break b;case 24:c=cb(8);J[c>>2]=1;J[c+4>>2]=0;i=c+8|0;l=J[b+32>>2];o=J[b+36>>2];if((l|0)!=(o|0)){while(1){d=J[l>>2];e=J[d+76>>2];d=K[d+72|0];g=J[c+4>>2];j=c;k=K[c|0];J[5996]=0;f=$(3,8)|0;c=J[5996];J[5996]=0;k:{l:{if((c|0)!=1){c=e+g|0;d=(k|0)!=0&(d|0)!=0;e=d&0;J[f>>2]=d|e;J[f+4>>2]=d?c:0;g=f+8|0;c=i-j|0;k=c>>3;if(c>>>0>=9){break l}d=g;break k}d=Z()|0;c=j;break e}q=k>>>0<=2?2:k;i=1;d=g;while(1){c=J[l>>2];h=j+(i<<3)|0;m=J[c+76>>2]+J[h+4>>2]|0;n=h-8|0;e=K[n|0]!=0&K[c+64|0]!=0;h=K[h|0]!=0&K[c+72|0]!=0;p=h?m:0;c=e?J[c+68>>2]+J[n+4>>2]|0:0;c=h?e?c>>>0<p>>>0?p:c:m:c;m=e|h;m:{if(d>>>0<g>>>0){J[d>>2]=m;J[d+4>>2]=c;e=d;break m}n=d-f>>3;e=n+1|0;if(e>>>0>=536870912){J[5996]=0;ca(93);a=J[5996];J[5996]=0;if((a|0)==1){break f}break c}g=g-f|0;h=g>>2;h=g>>>0>=2147483640?536870911:e>>>0<h>>>0?h:e;n:{if(!h){g=0;break n}if(h>>>0>=536870912){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break c}break f}J[5996]=0;g=$(3,h<<3)|0;e=J[5996];J[5996]=0;if((e|0)==1){break f}}e=(n<<3)+g|0;J[e>>2]=m;J[e+4>>2]=c;g=(h<<3)+g|0;c=e;o:{if((d|0)!=(f|0)){while(1){d=d-8|0;h=J[d+4>>2];c=c-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=h;if((d|0)!=(f|0)){continue}break}if(!f){break o}}$a(f);}f=c;}d=e+8|0;i=i+1|0;if((q|0)!=(i|0)){continue}break}}c=(j+(k<<3)|0)-8|0;e=J[l>>2];i=K[c|0]!=0&K[e+64|0]!=0;e=i?J[e+68>>2]+J[c+4>>2]|0:0;p:{if(d>>>0<g>>>0){J[d>>2]=i;J[d+4>>2]=e;i=d+8|0;c=f;break p}q:{r:{k=d-f>>3;c=k+1|0;s:{if(c>>>0>=536870912){J[5996]=0;ca(93);break s}g=g-f|0;h=g>>2;c=g>>>0>=2147483640?536870911:c>>>0<h>>>0?h:c;if(!c){c=0;break q}if(c>>>0<536870912){break r}J[5996]=0;ca(35);}a=J[5996];J[5996]=0;if((a|0)!=1){break c}break f}J[5996]=0;c=$(3,c<<3)|0;g=J[5996];J[5996]=0;if((g|0)==1){break f}}c=(k<<3)+c|0;J[c>>2]=i;J[c+4>>2]=e;i=c+8|0;if((d|0)!=(f|0)){while(1){d=d-8|0;e=J[d+4>>2];c=c-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=e;if((d|0)!=(f|0)){continue}break}if(!f){break p}}$a(f);}$a(j);l=l+8|0;if((o|0)!=(l|0)){continue}break}}b=J[b+4>>2];if(b>>>0<=i-c>>3>>>0){b=(b<<3)+c|0;d=J[b>>2];b=J[b+4>>2];f=J[c+4>>2];J[a+8>>2]=J[c>>2];J[a+12>>2]=f;J[a>>2]=d;J[a+4>>2]=b;$a(c);return}J[5996]=0;ga(44,5118,2210,850,2317);a=J[5996];J[5996]=0;if((a|0)!=1){break c}d=Z()|0;if(!c){break d}break e;default:la(2350,2210,854,2317);B();case 0:break g}}J[a+8>>2]=1;J[a+12>>2]=0;J[a>>2]=0;J[a+4>>2]=0;return}d=Z()|0;if(!f){c=j;break e}$a(f);c=j;}$a(c);}da(d|0);B();}B();}J[a>>2]=b;J[a+4>>2]=c;return}J[a>>2]=1;J[a+4>>2]=1;}function Kg(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;h=Ua-80|0;Ua=h;J[h+76>>2]=b;x=h+55|0;q=h+56|0;a:{b:{c:{d:while(1){f=0;e:while(1){k=b;if((p^2147483647)<(f|0)){break c}p=f+p|0;f:{g:{h:{f=b;g=K[f|0];if(g){while(1){i:{b=g&255;j:{if(!b){b=f;break j}if((b|0)!=37){break i}g=f;while(1){if(K[g+1|0]!=37){b=g;break j}f=f+1|0;l=K[g+2|0];b=g+2|0;g=b;if((l|0)==37){continue}break}}f=f-k|0;w=p^2147483647;if((f|0)>(w|0)){break c}if(a){wb(a,k,f);}if(f){continue e}J[h+76>>2]=b;f=b+1|0;o=-1;g=H[b+1|0];if(!(K[b+2|0]!=36|g-48>>>0>=10)){o=g-48|0;r=1;f=b+3|0;}J[h+76>>2]=f;m=0;g=H[f|0];b=g-32|0;k:{if(b>>>0>31){l=f;break k}l=f;b=1<<b;if(!(b&75913)){break k}while(1){l=f+1|0;J[h+76>>2]=l;m=b|m;g=H[f+1|0];b=g-32|0;if(b>>>0>=32){break k}f=l;b=1<<b;if(b&75913){continue}break}}l:{if((g|0)==42){b=H[l+1|0];m:{if(!(K[l+2|0]!=36|b-48>>>0>=10)){b=b-48|0;n:{if(!a){J[(b<<2)+e>>2]=10;n=0;break n}n=J[(b<<3)+d>>2];}b=l+3|0;r=1;break m}if(r){break h}b=l+1|0;if(!a){J[h+76>>2]=b;r=0;n=0;break l}f=J[c>>2];J[c>>2]=f+4;n=J[f>>2];r=0;}J[h+76>>2]=b;if((n|0)>=0){break l}n=0-n|0;m=m|8192;break l}n=Jg(h+76|0);if((n|0)<0){break c}b=J[h+76>>2];}f=0;i=-1;g=0;o:{if(K[b|0]!=46){break o}if(K[b+1|0]==42){g=H[b+2|0];p:{if(!(K[b+3|0]!=36|g-48>>>0>=10)){g=g-48|0;b=b+4|0;q:{if(!a){J[(g<<2)+e>>2]=10;i=0;break q}i=J[(g<<3)+d>>2];}break p}if(r){break h}b=b+2|0;i=0;if(!a){break p}g=J[c>>2];J[c>>2]=g+4;i=J[g>>2];}J[h+76>>2]=b;g=(i^-1)>>>31|0;break o}J[h+76>>2]=b+1;i=Jg(h+76|0);b=J[h+76>>2];g=1;}t=g;while(1){s=f;j=28;u=b;g=H[b|0];if(g-123>>>0<4294967238){break b}b=b+1|0;f=K[(g+P(f,58)|0)+6959|0];if(f-1>>>0<8){continue}break}J[h+76>>2]=b;r:{if((f|0)!=27){if(!f){break b}if((o|0)>=0){if(!a){J[(o<<2)+e>>2]=f;continue d}f=(o<<3)+d|0;g=J[f+4>>2];J[h+64>>2]=J[f>>2];J[h+68>>2]=g;break r}if(!a){break f}Ig(h- -64|0,f,c);break r}if((o|0)>=0){break b}f=0;if(!a){continue e}}j=-1;if(K[a|0]&32){break a}g=m&-65537;m=m&8192?g:m;o=0;v=1212;l=q;s:{t:{u:{v:{w:{x:{y:{z:{A:{B:{C:{D:{E:{F:{G:{H:{f=H[u|0];f=s?(f&15)==3?f&-33:f:f;switch(f-88|0){case 11:break s;case 9:case 13:case 14:case 15:break t;case 27:break y;case 12:case 17:break B;case 23:break C;case 0:case 32:break D;case 24:break E;case 22:break F;case 29:break G;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 25:case 26:case 28:case 30:case 31:break g;default:break H}}I:{switch(f-65|0){case 0:case 4:case 5:case 6:break t;case 2:break w;case 1:case 3:break g;default:break I}}if((f|0)==83){break x}break g}g=J[h+64>>2];j=J[h+68>>2];f=1212;break A}f=0;J:{switch(s&255){case 0:J[J[h+64>>2]>>2]=p;continue e;case 1:J[J[h+64>>2]>>2]=p;continue e;case 2:g=J[h+64>>2];J[g>>2]=p;J[g+4>>2]=p>>31;continue e;case 3:I[J[h+64>>2]>>1]=p;continue e;case 4:H[J[h+64>>2]]=p;continue e;case 6:J[J[h+64>>2]>>2]=p;continue e;case 7:break J;default:continue e}}g=J[h+64>>2];J[g>>2]=p;J[g+4>>2]=p>>31;continue e}i=i>>>0<=8?8:i;m=m|8;f=120;}k=q;u=f&32;g=J[h+64>>2];j=J[h+68>>2];if(g|j){while(1){k=k-1|0;H[k|0]=u|K[(g&15)+7488|0];s=!j&g>>>0>15|(j|0)!=0;g=(j&15)<<28|g>>>4;j=j>>>4|0;if(s){continue}break}}if(!(J[h+64>>2]|J[h+68>>2])|!(m&8)){break z}v=(f>>>4|0)+1212|0;o=2;break z}f=q;k=J[h+68>>2];j=k;g=J[h+64>>2];if(k|g){while(1){f=f-1|0;H[f|0]=g&7|48;s=!j&g>>>0>7|(j|0)!=0;g=(j&7)<<29|g>>>3;j=j>>>3|0;if(s){continue}break}}k=f;if(!(m&8)){break z}f=q-f|0;i=(f|0)<(i|0)?i:f+1|0;break z}g=J[h+64>>2];f=J[h+68>>2];j=f;if((f|0)<0){k=0-(f+((g|0)!=0)|0)|0;j=k;g=0-g|0;J[h+64>>2]=g;J[h+68>>2]=k;o=1;f=1212;break A}if(m&2048){o=1;f=1213;break A}o=m&1;f=o?1214:1212;}v=f;k=Jc(g,j,q);}if((i|0)<0?t:0){break c}m=t?m&-65537:m;f=J[h+64>>2];g=J[h+68>>2];if(!(i|(f|g)!=0)){k=q;i=0;break g}f=!(f|g)+(q-k|0)|0;i=(f|0)<(i|0)?i:f;break g}f=J[h+64>>2];k=f?f:4806;f=k;l=i>>>0>=2147483647?2147483647:i;j=Zb(f,0,l);f=j?j-f|0:l;l=f+k|0;if((i|0)>=0){m=g;i=f;break g}m=g;i=f;if(K[l|0]){break c}break g}if(i){g=J[h+64>>2];break v}f=0;Bb(a,32,n,0,m);break u}J[h+12>>2]=0;J[h+8>>2]=J[h+64>>2];g=h+8|0;J[h+64>>2]=g;i=-1;}f=0;K:{while(1){k=J[g>>2];if(!k){break K}k=Mg(h+4|0,k);l=(k|0)<0;if(!(l|k>>>0>i-f>>>0)){g=g+4|0;f=f+k|0;if(i>>>0>f>>>0){continue}break K}break}if(l){break a}}j=61;if((f|0)<0){break b}Bb(a,32,n,f,m);if(!f){f=0;break u}l=0;g=J[h+64>>2];while(1){k=J[g>>2];if(!k){break u}j=h+4|0;k=Mg(j,k);l=k+l|0;if(l>>>0>f>>>0){break u}wb(a,j,k);g=g+4|0;if(f>>>0>l>>>0){continue}break}}Bb(a,32,n,f,m^8192);f=(f|0)<(n|0)?n:f;continue e}if((i|0)<0?t:0){break c}j=61;f=Gg(a,O[h+64>>3],n,i,m,f);if((f|0)>=0){continue e}break b}H[h+55|0]=J[h+64>>2];i=1;k=x;m=g;break g}g=K[f+1|0];f=f+1|0;continue}}j=p;if(a){break a}if(!r){break f}f=1;while(1){a=J[(f<<2)+e>>2];if(a){Ig((f<<3)+d|0,a,c);j=1;f=f+1|0;if((f|0)!=10){continue}break a}break}j=1;if(f>>>0>=10){break a}while(1){if(J[(f<<2)+e>>2]){break h}f=f+1|0;if((f|0)!=10){continue}break}break a}j=28;break b}l=l-k|0;i=(i|0)>(l|0)?i:l;if((i|0)>(o^2147483647)){break c}j=61;g=i+o|0;f=(g|0)<(n|0)?n:g;if((w|0)<(f|0)){break b}Bb(a,32,f,g,m);wb(a,v,o);Bb(a,48,f,g,m^65536);Bb(a,48,i,l,0);wb(a,k,l);Bb(a,32,f,g,m^8192);continue}break}break}j=0;break a}j=61;}J[5732]=j;j=-1;}Ua=h+80|0;return j}function un(a){a=a|0;var b=0,c=0,d=0,e=0,f=0;a:{if(a>>>0<=211){d=J[Eg(7504,7696,a)>>2];break a}if(a>>>0>=4294967292){a=Rb(8);J[5996]=0;d=$(167,a|0)|0;e=J[5996];J[5996]=0;if((e|0)!=1){na(d|0,22716,92);B();}d=Z()|0;ic(a);da(d|0);B();}f=(a>>>0)/210|0;d=P(f,210);e=Eg(7696,7888,a-d|0)-7696>>2;while(1){d=J[(e<<2)+7696>>2]+d|0;a=5;while(1){b:{if((a|0)==47){a=211;while(1){b=(d>>>0)/(a>>>0)|0;if(b>>>0<a>>>0){break a}if((P(a,b)|0)==(d|0)){break b}b=a+10|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+12|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+16|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+18|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+22|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+28|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+30|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+36|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+40|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+42|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+46|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+52|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+58|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+60|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+66|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+70|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+72|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+78|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+82|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+88|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+96|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+100|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+102|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+106|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+108|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+112|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+120|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+126|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+130|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+136|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+138|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+142|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+148|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+150|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+156|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+162|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+166|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+168|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+172|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+178|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+180|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+186|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+190|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+192|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+196|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+198|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}if((P(b,c)|0)==(d|0)){break b}b=a+208|0;c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}a=a+210|0;if((P(b,c)|0)!=(d|0)){continue}break}break b}b=J[(a<<2)+7504>>2];c=(d>>>0)/(b>>>0)|0;if(b>>>0>c>>>0){break a}a=a+1|0;if((P(b,c)|0)!=(d|0)){continue}}break}d=e+1|0;a=(d|0)==48;e=a?0:d;f=a+f|0;d=P(f,210);continue}}return d|0}function ob(a,b,c,d,e,f,g,h,i){var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0;k=Ua-96|0;Ua=k;u=i&65535;o=(e^i)&-2147483648;r=e&65535;y=r;Q=i>>>16&32767;R=e>>>16&32767;a:{b:{if(Q-32767>>>0>4294934529&R-32767>>>0>=4294934530){break b}s=e&2147483647;q=s;j=d;if(!(!d&(q|0)==2147418112?!(b|c):q>>>0<2147418112)){m=d;o=e|32768;break a}s=i&2147483647;p=s;e=h;if(!(!e&(p|0)==2147418112?!(f|g):p>>>0<2147418112)){m=e;o=i|32768;b=f;c=g;break a}if(!(b|j|(q^2147418112|c))){if(!(e|f|(g|p))){o=2147450880;b=0;c=0;break a}o=o|2147418112;b=0;c=0;break a}if(!(e|f|(p^2147418112|g))){e=b|j;d=c|q;b=0;c=0;if(!(d|e)){o=2147450880;break a}o=o|2147418112;break a}if(!(b|j|(c|q))){b=0;c=0;break a}if(!(e|f|(g|p))){b=0;c=0;break a}if((q|0)==65535|q>>>0<65535){j=!(d|r);i=j?b:d;s=j<<6;e=S(i)+32|0;i=S(j?c:r);i=s+((i|0)==32?e:i)|0;Cb(k+80|0,b,c,d,r,i-15|0);t=16-i|0;d=J[k+88>>2];y=J[k+92>>2];c=J[k+84>>2];b=J[k+80>>2];}if(p>>>0>65535){break b}i=!(h|u);e=i?f:h;r=i<<6;j=S(e)+32|0;e=S(i?g:u);e=r+((e|0)==32?j:e)|0;Cb(k- -64|0,f,g,h,u,e-15|0);t=(t-e|0)+16|0;h=J[k+72>>2];u=J[k+76>>2];f=J[k+64>>2];g=J[k+68>>2];}e=f;f=g<<15|f>>>17;i=e<<15;e=0;v=i&-32768;K=c;s=co(v,e,c,0);e=Wa;z=e;L=f;q=b;c=co(f,0,b,0);b=c+s|0;f=Wa+e|0;i=b;c=b>>>0<c>>>0?f+1|0:f;f=b;j=0;b=co(q,l,v,l);p=j+b|0;e=Wa+f|0;e=b>>>0>p>>>0?e+1|0:e;r=e;M=(f|0)==(e|0)&j>>>0>p>>>0|e>>>0<f>>>0;N=d;w=co(v,l,d,0);O=Wa;b=co(K,l,L,l);x=b+w|0;j=Wa+O|0;j=b>>>0>x>>>0?j+1|0:j;b=u<<15|h>>>17;A=h<<15|g>>>17;d=co(A,0,q,l);B=d+x|0;f=Wa+j|0;f=d>>>0>B>>>0?f+1|0:f;C=f;d=(c|0)==(z|0)&i>>>0<s>>>0|c>>>0<z>>>0;D=c+B|0;f=d+f|0;f=c>>>0>D>>>0?f+1|0:f;u=f;g=D;c=f;E=y|65536;y=co(v,l,E,n);P=Wa;d=co(N,m,L,l);F=d+y|0;e=Wa+P|0;e=d>>>0>F>>>0?e+1|0:e;i=e;G=b|-2147483648;b=co(G,0,q,l);H=b+F|0;f=Wa+e|0;f=b>>>0>H>>>0?f+1|0:f;d=co(A,m,K,l);b=d+H|0;I=f;f=f+Wa|0;z=b;s=b>>>0<d>>>0?f+1|0:f;f=b;b=0;q=b+g|0;e=c+f|0;e=b>>>0>q>>>0?e+1|0:e;v=e;f=e;b=q+M|0;c=b>>>0<q>>>0?f+1|0:f;t=((R+Q|0)+t|0)-16383|0;d=co(G,m,K,l);h=Wa;e=co(E,m,L,l);g=e+d|0;f=Wa+h|0;f=e>>>0>g>>>0?f+1|0:f;n=(h|0)==(f|0)&d>>>0>g>>>0|f>>>0<h>>>0;h=f;e=co(A,m,N,m);d=e+g|0;f=Wa+f|0;f=d>>>0<e>>>0?f+1|0:f;e=f;g=(f|0)==(h|0)&d>>>0<g>>>0|f>>>0<h>>>0;f=0;h=g;g=g+n|0;f=h>>>0>g>>>0?1:f;h=g;g=co(G,m,E,m);h=h+g|0;f=Wa+f|0;M=h;g=g>>>0>h>>>0?f+1|0:f;h=d;l=e;e=(j|0)==(O|0)&w>>>0>x>>>0|j>>>0<O>>>0;f=0;j=(j|0)==(C|0)&x>>>0>B>>>0|j>>>0>C>>>0;n=j;j=e+j|0;e=(n>>>0>j>>>0?1:f)+l|0;f=g;d=d+j|0;e=d>>>0<j>>>0?e+1|0:e;n=e;w=d;d=(e|0)==(l|0)&d>>>0<h>>>0|e>>>0<l>>>0;e=d;d=d+M|0;f=e>>>0>d>>>0?f+1|0:f;j=d;h=f;e=co(A,m,E,m);l=Wa;g=co(G,m,N,m);d=g+e|0;f=Wa+l|0;f=d>>>0<g>>>0?f+1|0:f;g=f;f=(l|0)==(f|0)&d>>>0<e>>>0|f>>>0<l>>>0;x=g+j|0;e=f+h|0;e=g>>>0>x>>>0?e+1|0:e;l=x;h=e;j=d;e=0;d=e+w|0;f=j+n|0;f=d>>>0<e>>>0?f+1|0:f;e=f;g=(n|0)==(f|0)&d>>>0<w>>>0|f>>>0<n>>>0;f=h;h=g;g=g+l|0;f=h>>>0>g>>>0?f+1|0:f;w=g;g=f;h=d;j=e;e=(s|0)==(I|0)&z>>>0<H>>>0|s>>>0<I>>>0;d=(i|0)==(P|0)&y>>>0>F>>>0|i>>>0<P>>>0;i=(i|0)==(I|0)&F>>>0>H>>>0|i>>>0>I>>>0;d=d+i|0;d=d+e|0;n=s;i=n+h|0;e=d+j|0;f=g;d=i;e=d>>>0<n>>>0?e+1|0:e;h=(e|0)==(j|0)&h>>>0>d>>>0|e>>>0<j>>>0;g=h+w|0;f=h>>>0>g>>>0?f+1|0:f;j=g;g=f;h=d;f=0;i=e;n=(u|0)==(v|0)&q>>>0<D>>>0|u>>>0>v>>>0;l=n;n=n+((u|0)==(C|0)&B>>>0>D>>>0|u>>>0<C>>>0)|0;e=e+(l>>>0>n>>>0?1:f)|0;f=g;d=d+n|0;e=d>>>0<n>>>0?e+1|0:e;h=(e|0)==(i|0)&d>>>0<h>>>0|e>>>0<i>>>0;g=h;h=h+j|0;f=g>>>0>h>>>0?f+1|0:f;i=f;c:{if(f&65536){t=t+1|0;break c}j=r>>>31|0;g=0;f=i<<1|h>>>31;h=h<<1|e>>>31;i=f;f=e<<1|d>>>31;d=d<<1|c>>>31;e=f;f=r<<1|p>>>31;p=p<<1;r=f;f=c<<1|b>>>31;b=b<<1|j;c=f|g;}if((t|0)>=32767){o=o|2147418112;b=0;c=0;break a}d:{if((t|0)<=0){g=1-t|0;if(g>>>0<=127){f=t+127|0;Cb(k+48|0,p,r,b,c,f);Cb(k+32|0,d,e,h,i,f);xc(k+16|0,p,r,b,c,g);xc(k,d,e,h,i,g);p=J[k+32>>2]|J[k+16>>2]|(J[k+48>>2]|J[k+56>>2]|(J[k+52>>2]|J[k+60>>2]))!=0;r=J[k+36>>2]|J[k+20>>2];b=J[k+40>>2]|J[k+24>>2];c=J[k+44>>2]|J[k+28>>2];d=J[k>>2];e=J[k+4>>2];g=J[k+8>>2];f=J[k+12>>2];break d}b=0;c=0;break a}g=h;f=i&65535|t<<16;}m=g|m;o=f|o;if(!(!b&(c|0)==-2147483648?!(p|r):(c|0)>0|(c|0)>=0)){b=d+1|0;j=b?e:e+1|0;e=o;c=j;d=!(j|b);m=d+m|0;o=d>>>0>m>>>0?e+1|0:e;break a}if(b|p|(c^-2147483648|r)){b=d;c=e;break a}f=e;b=d&1;c=b;b=b+d|0;c=c>>>0>b>>>0?f+1|0:f;d=(f|0)==(c|0)&b>>>0<d>>>0|c>>>0<f>>>0;f=o;m=d+m|0;o=m>>>0<d>>>0?f+1|0:f;}J[a>>2]=b;J[a+4>>2]=c;J[a+8>>2]=m;J[a+12>>2]=o;Ua=k+96|0;}function Pg(){var a=0,b=0,c=0;if(K[25020]){return J[6254]}J[6663]=0;J[6662]=22008;J[6662]=14144;J[6662]=12664;a=Ua-16|0;Ua=a;J[6664]=0;J[6665]=0;J[6666]=0;H[26792]=0;J[a+4>>2]=26656;c=J[a+4>>2];b=a+8|0;H[b+4|0]=0;J[b>>2]=c;J[5996]=0;ha(273,26656);c=J[5996];J[5996]=0;a:{if((c|0)!=1){ff(26656,30);H[b+4|0]=1;ef(b);Ua=a+16|0;break a}b=Z()|0;ef(a+8|0);da(b|0);B();}J[5996]=0;b=_(30,26800,3538)|0;a=J[5996];J[5996]=0;b:{c:{d:{if((a|0)!=1){df(26656);J[6581]=0;J[6580]=22008;J[6580]=14144;J[6580]=15252;J[5996]=0;ha(240,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6583]=0;J[6582]=22008;J[6582]=14144;J[6582]=15284;J[5996]=0;ha(241,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6585]=0;J[6584]=22008;J[6584]=14144;H[26348]=0;J[6586]=0;J[6584]=12684;J[6586]=12736;J[5996]=0;ha(242,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6589]=0;J[6588]=22008;J[6588]=14144;J[6588]=14200;J[5996]=0;ha(243,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6591]=0;J[6590]=22008;J[6590]=14144;J[6590]=14348;J[5996]=0;ha(244,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[5996]=0;ca(245);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[5996]=0;ha(246,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6597]=0;J[6596]=22008;J[6596]=14144;J[6596]=14496;J[5996]=0;ha(247,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6599]=0;J[6598]=22008;J[6598]=14144;J[6598]=14728;J[5996]=0;ha(248,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6601]=0;J[6600]=22008;J[6600]=14144;J[6600]=14612;J[5996]=0;ha(249,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6603]=0;J[6602]=22008;J[6602]=14144;J[6602]=14844;J[5996]=0;ha(250,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6605]=0;J[6604]=22008;J[6604]=14144;I[13212]=11310;J[6604]=13816;J[6607]=0;J[6608]=0;J[6609]=0;J[5996]=0;ha(251,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6611]=0;J[6610]=22008;J[6610]=14144;J[6612]=46;J[6613]=44;J[6610]=13856;J[6614]=0;J[6615]=0;J[6616]=0;J[5996]=0;ha(252,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6619]=0;J[6618]=22008;J[6618]=14144;J[6618]=15316;J[5996]=0;ha(253,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6621]=0;J[6620]=22008;J[6620]=14144;J[6620]=15560;J[5996]=0;ha(254,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6623]=0;J[6622]=22008;J[6622]=14144;J[6622]=15772;J[5996]=0;ha(255,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6625]=0;J[6624]=22008;J[6624]=14144;J[6624]=16004;J[5996]=0;ha(256,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6627]=0;J[6626]=22008;J[6626]=14144;J[6626]=16988;J[5996]=0;ha(257,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6629]=0;J[6628]=22008;J[6628]=14144;J[6628]=17136;J[5996]=0;ha(258,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6631]=0;J[6630]=22008;J[6630]=14144;J[6630]=17252;J[5996]=0;ha(259,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6633]=0;J[6632]=22008;J[6632]=14144;J[6632]=17368;J[5996]=0;ha(260,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6635]=0;J[6634]=22008;J[6634]=14144;J[6634]=17484;J[5996]=0;ha(261,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6637]=0;J[6636]=22008;J[6636]=14144;J[6636]=17648;J[5996]=0;ha(262,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6639]=0;J[6638]=22008;J[6638]=14144;J[6638]=17812;J[5996]=0;ha(263,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6641]=0;J[6640]=22008;J[6640]=14144;J[6640]=17976;J[5996]=0;ha(264,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6643]=0;J[6642]=22008;J[6642]=14144;J[6644]=19232;J[6644]=16252;J[6642]=16204;J[5996]=0;ha(265,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6647]=0;J[6646]=22008;J[6646]=14144;J[6648]=19268;J[6648]=16516;J[6646]=16468;J[5996]=0;ha(266,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[5996]=0;ca(267);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[5996]=0;ha(268,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[5996]=0;ca(269);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[5996]=0;ha(270,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6659]=0;J[6658]=22008;J[6658]=14144;J[6658]=18140;J[5996]=0;ha(271,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}J[6661]=0;J[6660]=22008;J[6660]=14144;J[6660]=18260;J[5996]=0;ha(272,26648);a=J[5996];J[5996]=0;if((a|0)==1){break d}break b}a=Z()|0;break c}a=Z()|0;ab(b);}gf(26656);da(a|0);B();}J[6253]=26648;H[25020]=1;J[6254]=25012;return 25012}function Ek(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0;h=Ua-48|0;Ua=h;J[h+44>>2]=b;J[e>>2]=0;i=J[d+28>>2];J[h>>2]=i;J[i+4>>2]=J[i+4>>2]+1;J[5996]=0;i=$(197,J[h>>2])|0;j=J[5996];J[5996]=0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{x:{y:{z:{A:{if((j|0)!=1){j=J[h>>2];k=J[j+4>>2]-1|0;J[j+4>>2]=k;if((k|0)==-1){Xa[J[J[j>>2]+8>>2]](j);}switch(g-65|0){case 54:break j;case 19:break k;case 18:break l;case 17:break m;case 49:break n;case 47:break o;case 45:case 51:break p;case 12:break q;case 44:break r;case 41:break s;case 8:break t;case 7:break u;case 5:break v;case 3:break w;case 35:case 36:break x;case 34:break y;case 1:case 33:case 39:break z;case 0:case 32:break A;case 2:case 4:case 6:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 20:case 21:case 22:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 37:case 38:case 40:case 42:case 43:case 46:case 48:case 50:case 52:case 53:break d;case 24:break f;case 56:break g;case 23:break h;case 55:break i;default:break e}}c=Z()|0;a=J[h>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}Bf(a,f+24|0,h+44|0,c,e,i);break b}Af(a,f+16|0,h+44|0,c,e,i);break b}g=Xa[J[J[a+8>>2]+12>>2]](a+8|0)|0;i=K[g+11|0];j=a;k=b;b=(i&128)>>>7|0;a=b?J[g>>2]:g;J[h+44>>2]=jc(j,k,c,d,e,f,a,a+((b?J[g+4>>2]:i&127)<<2)|0);break b}a=bc(h+44|0,c,e,i,2);b=J[e>>2];B:{if(!(a-1>>>0>30|b&4)){J[f+12>>2]=a;break B}J[e>>2]=b|4;}break b}g=J[3127];J[h+24>>2]=J[3126];J[h+28>>2]=g;g=J[3125];J[h+16>>2]=J[3124];J[h+20>>2]=g;g=J[3123];J[h+8>>2]=J[3122];J[h+12>>2]=g;g=J[3121];J[h>>2]=J[3120];J[h+4>>2]=g;J[h+44>>2]=jc(a,b,c,d,e,f,h,h+32|0);break b}g=J[3135];J[h+24>>2]=J[3134];J[h+28>>2]=g;g=J[3133];J[h+16>>2]=J[3132];J[h+20>>2]=g;g=J[3131];J[h+8>>2]=J[3130];J[h+12>>2]=g;g=J[3129];J[h>>2]=J[3128];J[h+4>>2]=g;J[h+44>>2]=jc(a,b,c,d,e,f,h,h+32|0);break b}a=bc(h+44|0,c,e,i,2);b=J[e>>2];C:{if(!((a|0)>23|b&4)){J[f+8>>2]=a;break C}J[e>>2]=b|4;}break b}a=bc(h+44|0,c,e,i,2);b=J[e>>2];D:{if(!(a-1>>>0>11|b&4)){J[f+8>>2]=a;break D}J[e>>2]=b|4;}break b}a=bc(h+44|0,c,e,i,3);b=J[e>>2];E:{if(!((a|0)>365|b&4)){J[f+28>>2]=a;break E}J[e>>2]=b|4;}break b}b=bc(h+44|0,c,e,i,2)-1|0;a=J[e>>2];F:{if(!(b>>>0>11|a&4)){J[f+16>>2]=b;break F}J[e>>2]=a|4;}break b}a=bc(h+44|0,c,e,i,2);b=J[e>>2];G:{if(!((a|0)>59|b&4)){J[f+4>>2]=a;break G}J[e>>2]=b|4;}break b}a=h+44|0;b=Ua-16|0;Ua=b;J[b+12>>2]=c;while(1){H:{if(Tb(a,b+12|0)){break H}c=J[a>>2];d=J[c+12>>2];I:{if((d|0)==J[c+16>>2]){c=Xa[J[J[c>>2]+36>>2]](c)|0;break I}c=J[d>>2];}if(!(Xa[J[J[i>>2]+12>>2]](i,1,c)|0)){break H}Hc(a);continue}break}if(Tb(a,b+12|0)){J[e>>2]=J[e>>2]|2;}Ua=b+16|0;break b}d=h+44|0;a=Xa[J[J[a+8>>2]+8>>2]](a+8|0)|0;b=K[a+11|0];g=(b&128)>>>7|0?J[a+4>>2]:b&127;b=K[a+23|0];J:{if((g|0)==(0-((b&128)>>>7|0?J[a+16>>2]:b&127)|0)){J[e>>2]=J[e>>2]|4;break J}c=ld(d,c,a,a+24|0,i,e,0);b=J[f+8>>2];if(!((c|0)!=(a|0)|(b|0)!=12)){J[f+8>>2]=0;break J}if(!((c-a|0)!=12|(b|0)>11)){J[f+8>>2]=b+12;}}break b}g=fb(h,12544,44);J[g+44>>2]=jc(a,b,c,d,e,f,g,g+44|0);break b}J[h+16>>2]=J[3152];g=J[3151];J[h+8>>2]=J[3150];J[h+12>>2]=g;g=J[3149];J[h>>2]=J[3148];J[h+4>>2]=g;J[h+44>>2]=jc(a,b,c,d,e,f,h,h+20|0);break b}a=bc(h+44|0,c,e,i,2);b=J[e>>2];K:{if(!((a|0)>60|b&4)){J[f>>2]=a;break K}J[e>>2]=b|4;}break b}g=J[3163];J[h+24>>2]=J[3162];J[h+28>>2]=g;g=J[3161];J[h+16>>2]=J[3160];J[h+20>>2]=g;g=J[3159];J[h+8>>2]=J[3158];J[h+12>>2]=g;g=J[3157];J[h>>2]=J[3156];J[h+4>>2]=g;J[h+44>>2]=jc(a,b,c,d,e,f,h,h+32|0);break b}a=bc(h+44|0,c,e,i,1);b=J[e>>2];L:{if(!((a|0)>6|b&4)){J[f+24>>2]=a;break L}J[e>>2]=b|4;}break b}a=Xa[J[J[a>>2]+20>>2]](a,b,c,d,e,f)|0;break a}g=Xa[J[J[a+8>>2]+24>>2]](a+8|0)|0;i=K[g+11|0];j=a;k=b;b=(i&128)>>>7|0;a=b?J[g>>2]:g;J[h+44>>2]=jc(j,k,c,d,e,f,a,a+((b?J[g+4>>2]:i&127)<<2)|0);break b}zf(f+20|0,h+44|0,c,e,i);break b}a=bc(h+44|0,c,e,i,4);if(!(K[e|0]&4)){J[f+20>>2]=a-1900;}break b}if((g|0)==37){break c}}J[e>>2]=J[e>>2]|4;break b}a=Ua-16|0;Ua=a;J[a+12>>2]=c;b=6;d=h+44|0;g=a+12|0;M:{N:{if(Tb(d,g)){break N}b=4;c=J[d>>2];f=J[c+12>>2];O:{if((f|0)==J[c+16>>2]){c=Xa[J[J[c>>2]+36>>2]](c)|0;break O}c=J[f>>2];}if((Xa[J[J[i>>2]+52>>2]](i,c,0)|0)!=37){break N}b=2;if(!Tb(Hc(d),g)){break M}}J[e>>2]=J[e>>2]|b;}Ua=a+16|0;}a=J[h+44>>2];}Ua=h+48|0;return a|0}function qh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0;g=J[b+4>>2]-J[b>>2]|0;a:{if(g>>>0<=75){c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;e=c>>>0<29?c:d;f=e+1|0;if(f>>>0>(c>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,f+(f>>>1|0)|0);c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;}h=c>>>0<29;f=e+(h?a+4|0:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(f+1|0,f,(h?c:d)-e|0);c=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[f|0]=g;break a}if(g>>>0<=255){c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;e=c>>>0<29?c:d;f=e+1|0;if(f>>>0>(c>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,f+(f>>>1|0)|0);c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;}h=a+4|0;g=c>>>0<29;f=e+(g?h:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(f+1|0,f,(g?c:d)-e|0);c=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[f|0]=76;g=J[b+4>>2]-J[b>>2]|0;c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;e=c>>>0<29?c:d;f=e+1|0;if(f>>>0>(c>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,f+(f>>>1|0)|0);c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;}i=h;h=c>>>0<29;f=e+(h?i:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(f+1|0,f,(h?c:d)-e|0);c=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[f|0]=g;break a}c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=c-29|0;f=c>>>0<29?c:e;d=f+1|0;i=c>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24);h=a+4|0;if(g>>>0<=65535){if(d>>>0>i>>>0){Ob(a,d+(d>>>1|0)|0);c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=c-29|0;}g=c>>>0<29;d=f+(g?h:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(d+1|0,d,(g?c:e)-f|0);c=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[d|0]=77;f=J[b+4>>2]-J[b>>2]|0;c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;g=c>>>0<29?c:d;e=g+2|0;if(e>>>0>(c>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,e+(e>>>1|0)|0);c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;}i=h;h=c>>>0<29;e=g+(h?i:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(e+2|0,e,(h?c:d)-g|0);c=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+2|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[e|0]=f;H[e+1|0]=f>>>8;break a}if(d>>>0>i>>>0){Ob(a,d+(d>>>1|0)|0);c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=c-29|0;}g=c>>>0<29;d=f+(g?h:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(d+1|0,d,(g?c:e)-f|0);c=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[d|0]=78;f=J[b+4>>2]-J[b>>2]|0;c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;g=c>>>0<29?c:d;e=g+4|0;if(e>>>0>(c>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,e+(e>>>1|0)|0);c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);d=c-29|0;}i=h;h=c>>>0<29;e=g+(h?i:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(e+4|0,e,(h?c:d)-g|0);c=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+4|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[e|0]=f;H[e+1|0]=f>>>8;H[e+2|0]=f>>>16;H[e+3|0]=f>>>24;}d=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=d-29|0;f=J[b+4>>2];b=J[b>>2];h=f-b|0;g=d>>>0<29?d:e;c=h+g|0;if(c>>>0>(d>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,c+(c>>>1|0)|0);d=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=d-29|0;}i=d>>>0<29;c=g+(i?a+4|0:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(h+c|0,c,(i?d:e)-g|0);d=h+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=d;H[a+1|0]=d>>>8;H[a+2|0]=d>>>16;H[a+3|0]=d>>>24;b:{if((b|0)==(f|0)){break b}e=f+(b^-1)|0;h=h&7;if(h){d=0;while(1){H[c|0]=K[b|0];b=b+1|0;c=c+1|0;d=d+1|0;if((h|0)!=(d|0)){continue}break}}if(e>>>0<7){break b}while(1){H[c|0]=K[b|0];H[c+1|0]=K[b+1|0];H[c+2|0]=K[b+2|0];H[c+3|0]=K[b+3|0];H[c+4|0]=K[b+4|0];H[c+5|0]=K[b+5|0];H[c+6|0]=K[b+6|0];H[c+7|0]=K[b+7|0];c=c+8|0;b=b+8|0;if((f|0)!=(b|0)){continue}break}}return a|0}function Kk(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0;h=Ua-16|0;Ua=h;J[h+12>>2]=b;J[e>>2]=0;i=J[d+28>>2];J[h>>2]=i;J[i+4>>2]=J[i+4>>2]+1;J[5996]=0;i=$(170,J[h>>2])|0;j=J[5996];J[5996]=0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{t:{u:{v:{w:{x:{y:{z:{A:{if((j|0)!=1){j=J[h>>2];k=J[j+4>>2]-1|0;J[j+4>>2]=k;if((k|0)==-1){Xa[J[J[j>>2]+8>>2]](j);}switch(g-65|0){case 54:break j;case 19:break k;case 18:break l;case 17:break m;case 49:break n;case 47:break o;case 45:case 51:break p;case 12:break q;case 44:break r;case 41:break s;case 8:break t;case 7:break u;case 5:break v;case 3:break w;case 35:case 36:break x;case 34:break y;case 1:case 33:case 39:break z;case 0:case 32:break A;case 2:case 4:case 6:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 20:case 21:case 22:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 37:case 38:case 40:case 42:case 43:case 46:case 48:case 50:case 52:case 53:break d;case 24:break f;case 56:break g;case 23:break h;case 55:break i;default:break e}}c=Z()|0;a=J[h>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}Ef(a,f+24|0,h+12|0,c,e,i);break b}Df(a,f+16|0,h+12|0,c,e,i);break b}g=Xa[J[J[a+8>>2]+12>>2]](a+8|0)|0;i=K[g+11|0];j=a;k=b;b=(i&128)>>>7|0;a=b?J[g>>2]:g;J[h+12>>2]=kc(j,k,c,d,e,f,a,a+(b?J[g+4>>2]:i&127)|0);break b}a=cc(h+12|0,c,e,i,2);b=J[e>>2];B:{if(!(a-1>>>0>30|b&4)){J[f+12>>2]=a;break B}J[e>>2]=b|4;}break b}J[h>>2]=623865125;J[h+4>>2]=2032480100;J[h+12>>2]=kc(a,b,c,d,e,f,h,h+8|0);break b}J[h>>2]=623728933;J[h+4>>2]=1680158061;J[h+12>>2]=kc(a,b,c,d,e,f,h,h+8|0);break b}a=cc(h+12|0,c,e,i,2);b=J[e>>2];C:{if(!((a|0)>23|b&4)){J[f+8>>2]=a;break C}J[e>>2]=b|4;}break b}a=cc(h+12|0,c,e,i,2);b=J[e>>2];D:{if(!(a-1>>>0>11|b&4)){J[f+8>>2]=a;break D}J[e>>2]=b|4;}break b}a=cc(h+12|0,c,e,i,3);b=J[e>>2];E:{if(!((a|0)>365|b&4)){J[f+28>>2]=a;break E}J[e>>2]=b|4;}break b}b=cc(h+12|0,c,e,i,2)-1|0;a=J[e>>2];F:{if(!(b>>>0>11|a&4)){J[f+16>>2]=b;break F}J[e>>2]=a|4;}break b}a=cc(h+12|0,c,e,i,2);b=J[e>>2];G:{if(!((a|0)>59|b&4)){J[f+4>>2]=a;break G}J[e>>2]=b|4;}break b}a=h+12|0;b=Ua-16|0;Ua=b;J[b+12>>2]=c;while(1){H:{if(Ub(a,b+12|0)){break H}c=J[a>>2];d=J[c+12>>2];I:{if((d|0)==J[c+16>>2]){c=Xa[J[J[c>>2]+36>>2]](c)|0;break I}c=K[d|0];}d=J[i+8>>2];c=c<<24>>24;if((c|0)>=0){c=J[d+((c&255)<<2)>>2]&1;}else {c=0;}if(!c){break H}Ic(a);continue}break}if(Ub(a,b+12|0)){J[e>>2]=J[e>>2]|2;}Ua=b+16|0;break b}d=h+12|0;a=Xa[J[J[a+8>>2]+8>>2]](a+8|0)|0;b=K[a+11|0];g=(b&128)>>>7|0?J[a+4>>2]:b&127;b=K[a+23|0];J:{if((g|0)==(0-((b&128)>>>7|0?J[a+16>>2]:b&127)|0)){J[e>>2]=J[e>>2]|4;break J}c=nd(d,c,a,a+24|0,i,e,0);b=J[f+8>>2];if(!((c|0)!=(a|0)|(b|0)!=12)){J[f+8>>2]=0;break J}if(!((c-a|0)!=12|(b|0)>11)){J[f+8>>2]=b+12;}}break b}g=K[12456]|K[12457]<<8|(K[12458]<<16|K[12459]<<24);H[h+7|0]=g;H[h+8|0]=g>>>8;H[h+9|0]=g>>>16;H[h+10|0]=g>>>24;g=K[12453]|K[12454]<<8|(K[12455]<<16|K[12456]<<24);J[h>>2]=K[12449]|K[12450]<<8|(K[12451]<<16|K[12452]<<24);J[h+4>>2]=g;J[h+12>>2]=kc(a,b,c,d,e,f,h,h+11|0);break b}H[h+4|0]=K[12464];J[h>>2]=K[12460]|K[12461]<<8|(K[12462]<<16|K[12463]<<24);J[h+12>>2]=kc(a,b,c,d,e,f,h,h+5|0);break b}a=cc(h+12|0,c,e,i,2);b=J[e>>2];K:{if(!((a|0)>60|b&4)){J[f>>2]=a;break K}J[e>>2]=b|4;}break b}J[h>>2]=624576549;J[h+4>>2]=1394948685;J[h+12>>2]=kc(a,b,c,d,e,f,h,h+8|0);break b}a=cc(h+12|0,c,e,i,1);b=J[e>>2];L:{if(!((a|0)>6|b&4)){J[f+24>>2]=a;break L}J[e>>2]=b|4;}break b}a=Xa[J[J[a>>2]+20>>2]](a,b,c,d,e,f)|0;break a}g=Xa[J[J[a+8>>2]+24>>2]](a+8|0)|0;i=K[g+11|0];j=a;k=b;b=(i&128)>>>7|0;a=b?J[g>>2]:g;J[h+12>>2]=kc(j,k,c,d,e,f,a,a+(b?J[g+4>>2]:i&127)|0);break b}Cf(f+20|0,h+12|0,c,e,i);break b}a=cc(h+12|0,c,e,i,4);if(!(K[e|0]&4)){J[f+20>>2]=a-1900;}break b}if((g|0)==37){break c}}J[e>>2]=J[e>>2]|4;break b}a=Ua-16|0;Ua=a;J[a+12>>2]=c;b=6;d=h+12|0;g=a+12|0;M:{N:{if(Ub(d,g)){break N}b=4;c=J[d>>2];f=J[c+12>>2];O:{if((f|0)==J[c+16>>2]){c=Xa[J[J[c>>2]+36>>2]](c)|0;break O}c=K[f|0];}if((Xa[J[J[i>>2]+36>>2]](i,c<<24>>24,0)|0)!=37){break N}b=2;if(!Ub(Ic(d),g)){break M}}J[e>>2]=J[e>>2]|b;}Ua=a+16|0;}a=J[h+12>>2];}Ua=h+16|0;return a|0}function Yc(a,b,c,d,e,f){var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;g=Ua-32|0;Ua=g;if(!K[24588]){J[6145]=0;J[6146]=0;J[6143]=0;J[6144]=0;J[6141]=0;J[6142]=0;H[24588]=1;}i=1-e;a:{b:{c:{d:{e:{f:{switch(b|0){case 10:case 11:case 12:case 16:b=cb(8);J[g+20>>2]=b;f=b+8|0;J[g+28>>2]=f;O[b>>3]=c;J[g+24>>2]=f;J[5996]=0;f=$(3,8)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}J[g+8>>2]=f;h=f+8|0;J[g+16>>2]=h;O[f>>3]=d;J[5996]=0;J[g+12>>2]=h;ba(65,a|0,g+20|0,g+8|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){$a(f);$a(b);break e}break c;case 13:case 14:case 15:b=cb(8);J[g+20>>2]=b;f=b+8|0;J[g+28>>2]=f;O[b>>3]=c;J[g+24>>2]=f;J[5996]=0;f=$(3,8)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}J[g+8>>2]=f;h=f+8|0;J[g+16>>2]=h;J[f>>2]=0;J[f+4>>2]=0;J[5996]=0;J[g+12>>2]=h;ba(65,a|0,g+20|0,g+8|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){$a(f);$a(b);break e}break c;case 17:case 18:b=cb(16);J[g+20>>2]=b;f=b+16|0;J[g+28>>2]=f;O[b+8>>3]=c;O[b>>3]=c;J[g+24>>2]=f;J[5996]=0;f=$(3,16)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}J[g+8>>2]=f;h=f+16|0;J[g+16>>2]=h;O[f+8>>3]=d;O[f>>3]=d;J[5996]=0;J[g+12>>2]=h;ba(65,a|0,g+20|0,g+8|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){$a(f);$a(b);break e}break c;case 19:b=cb(16);J[g+20>>2]=b;f=b+16|0;J[g+28>>2]=f;i=i*c;O[b+8>>3]=i;c=c*e;O[b>>3]=c;J[g+24>>2]=f;J[5996]=0;f=$(3,16)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}J[g+8>>2]=f;h=f+16|0;J[g+16>>2]=h;O[f+8>>3]=c+d;O[f>>3]=i+d;J[5996]=0;J[g+12>>2]=h;ba(65,a|0,g+20|0,g+8|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){$a(f);$a(b);break e}break c;case 21:b=cb(16);J[g+20>>2]=b;f=b+16|0;J[g+28>>2]=f;i=i*c;O[b+8>>3]=i;O[b>>3]=c*e;J[g+24>>2]=f;J[5996]=0;f=$(3,16)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}J[g+8>>2]=f;h=f+16|0;J[g+16>>2]=h;O[f+8>>3]=d;O[f>>3]=i+d;J[5996]=0;J[g+12>>2]=h;ba(65,a|0,g+20|0,g+8|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){$a(f);$a(b);break e}break c;case 20:b=cb(16);J[g+20>>2]=b;f=b+16|0;J[g+28>>2]=f;d=i*c;O[b+8>>3]=d;O[b>>3]=c*e;J[g+24>>2]=f;J[5996]=0;f=$(3,16)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}J[g+8>>2]=f;h=f+16|0;J[g+16>>2]=h;J[f+8>>2]=0;J[f+12>>2]=0;O[f>>3]=d;J[5996]=0;J[g+12>>2]=h;ba(65,a|0,g+20|0,g+8|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){$a(f);$a(b);break e}break c;case 22:b=cb(16);J[g+20>>2]=b;h=b+16|0;J[g+28>>2]=h;O[b+8>>3]=i*c;O[b>>3]=c*e;J[g+24>>2]=h;J[5996]=0;h=$(3,16)|0;j=J[5996];J[5996]=0;if((j|0)==1){break b}J[g+8>>2]=h;j=h+16|0;J[g+16>>2]=j;O[h+8>>3]=(f|0)==1?d:0;O[h>>3]=f?0:d;J[5996]=0;J[g+12>>2]=j;ba(65,a|0,g+20|0,g+8|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){$a(h);$a(b);break e}a=Z()|0;$a(h);break a;case 23:b=cb(24);J[g+20>>2]=b;f=b+24|0;J[g+28>>2]=f;i=i*c;O[b+16>>3]=i;c=c*e;O[b+8>>3]=c;O[b>>3]=c;J[g+24>>2]=f;J[5996]=0;f=$(3,24)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}J[g+8>>2]=f;h=f+24|0;J[g+16>>2]=h;O[f+16>>3]=d;J[f+8>>2]=0;J[f+12>>2]=0;O[f>>3]=i+d;J[5996]=0;J[g+12>>2]=h;ba(65,a|0,g+20|0,g+8|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){$a(f);$a(b);break e}break c;case 24:g:{h:{if(!f){f=0;break h}if(f>>>0>=536870912){break d}e=c*e;h=f<<3;k=cb(h);b=k;l=f&7;if(l){while(1){O[b>>3]=e;b=b+8|0;j=j+1|0;if((l|0)!=(j|0)){continue}break}}m=h+k|0;n=f-1&536870911;if(n>>>0>=7){while(1){O[b+56>>3]=e;O[b+48>>3]=e;O[b+40>>3]=e;O[b+32>>3]=e;O[b+24>>3]=e;O[b+16>>3]=e;O[b+8>>3]=e;O[b>>3]=e;b=b- -64|0;if((m|0)!=(b|0)){continue}break}}j=0;J[5996]=0;h=$(3,h|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break g}c=c*i+d;b=h;if(l){while(1){O[b>>3]=c;b=b+8|0;j=j+1|0;if((l|0)!=(j|0)){continue}break}}f=(f<<3)+h|0;if(n>>>0<7){break h}while(1){O[b+56>>3]=c;O[b+48>>3]=c;O[b+40>>3]=c;O[b+32>>3]=c;O[b+24>>3]=c;O[b+16>>3]=c;O[b+8>>3]=c;O[b>>3]=c;b=b- -64|0;if((f|0)!=(b|0)){continue}break}}J[a+12>>2]=h;J[a+8>>2]=m;J[a+4>>2]=m;J[a>>2]=k;J[a+20>>2]=f;J[a+16>>2]=f;break e}a=Z()|0;$a(k);da(a|0);B();default:la(2350,1900,558,1676);B();case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 25:break f}}Yg(a);}Ua=g+32|0;return}nb();B();}a=Z()|0;$a(f);break a}a=Z()|0;}$a(b);da(a|0);B();}function Zg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;a:{b:{e=J[c>>2];d=J[e+80>>2];c:{if(!d|M[e+84>>2]>3600|(J[e+52>>2]+J[e+44>>2]>>>0>201|M[e+68>>2]>100)){break c}J[5996]=0;h=_(54,2049,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break b}if((d^-1)&h){break c}d=J[e+80>>2];J[5996]=0;h=_(54,2165,1)|0;f=J[5996];J[5996]=0;if((f|0)==1){break b}if(K[e+88|0]|(d^-1)&h){break c}i=O[a+24>>3];k=i==0?0:i*O[b+8>>3];i=O[a+16>>3];g=J[e+84>>2];i=k+((i==0?0:i*O[b>>3])+ +(g>>>0));if(i>1e4){break c}f=J[e+80>>2];d:{e:{d=J[a>>2];h=J[a+4>>2];if((d|0)==(h|0)){break e}e=d;while(1){j=J[e>>2];f:{if(f&(J[j+80>>2]^-1)){break f}k=O[e+24>>3];if(k<i){break c}if(i<k){break f}if(g>>>0<=M[j+84>>2]){break c}}e=e+32|0;if((h|0)!=(e|0)){continue}break}e=f^-1;while(1){j=J[d>>2];g:{if(e&J[j+80>>2]){break g}k=O[d+24>>3];if(k<i){break g}if(g>>>0>=M[j+84>>2]|i<k){break e}}d=d+32|0;if((h|0)!=(d|0)){continue}break}e=h;break d}if((d|0)==(h|0)){e=h;break d}g=d+32|0;h:{if((g|0)==(h|0)){e=d;break h}j=f^-1;e=d;while(1){f=d;d=g;g=J[f+32>>2];i:{j:{if(j&J[g+80>>2]){break j}k=O[f+56>>3];if(k<i){break j}if(M[g+84>>2]<=M[J[c>>2]+84>>2]|i<k){break i}}l=J[f+36>>2];J[d>>2]=0;J[f+36>>2]=0;J[e>>2]=g;g=J[e+4>>2];J[e+4>>2]=l;k:{if(!g){break k}l=J[g+4>>2];J[g+4>>2]=l-1;if(l){break k}Xa[J[J[g>>2]+8>>2]](g);bb(g);}g=J[f+60>>2];J[e+24>>2]=J[f+56>>2];J[e+28>>2]=g;g=J[f+52>>2];J[e+16>>2]=J[f+48>>2];J[e+20>>2]=g;g=J[f+44>>2];J[e+8>>2]=J[f+40>>2];J[e+12>>2]=g;e=e+32|0;}g=d+32|0;if((g|0)!=(h|0)){continue}break}h=J[a+4>>2];}if((e|0)==(h|0)){e=h;break d}d=(h-e|0)+e|0;if((h|0)!=(d|0)){while(1){g=J[d>>2];j=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;f=J[e+4>>2];J[e>>2]=g;J[e+4>>2]=j;l:{if(!f){break l}g=J[f+4>>2];J[f+4>>2]=g-1;if(g){break l}Xa[J[J[f>>2]+8>>2]](f);bb(f);}f=J[d+12>>2];J[e+8>>2]=J[d+8>>2];J[e+12>>2]=f;f=J[d+28>>2];J[e+24>>2]=J[d+24>>2];J[e+28>>2]=f;f=J[d+20>>2];J[e+16>>2]=J[d+16>>2];J[e+20>>2]=f;e=e+32|0;d=d+32|0;if((h|0)!=(d|0)){continue}break}h=J[a+4>>2];}if((e|0)!=(h|0)){while(1){h=h-32|0;d=J[h+4>>2];m:{if(!d){break m}f=J[d+4>>2];J[d+4>>2]=f-1;if(f){break m}Xa[J[J[d>>2]+8>>2]](d);bb(d);}if((e|0)!=(h|0)){continue}break}}J[a+4>>2]=e;}f=J[a+8>>2];n:{if(f>>>0>e>>>0){J[e>>2]=J[c>>2];J[e+4>>2]=J[c+4>>2];J[c>>2]=0;J[c+4>>2]=0;d=J[b+12>>2];J[e+16>>2]=J[b+8>>2];J[e+20>>2]=d;d=J[b+4>>2];J[e+8>>2]=J[b>>2];J[e+12>>2]=d;O[e+24>>3]=i;J[a+4>>2]=e+32;break n}h=J[a>>2];g=e-h>>5;d=g+1|0;if(d>>>0>=134217728){J[5996]=0;ca(62);a=J[5996];J[5996]=0;if((a|0)==1){break b}break a}f=f-h|0;j=f>>4;d=f>>>0>=2147483616?134217727:d>>>0<j>>>0?j:d;if(d>>>0>=134217728){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break b}J[5996]=0;j=d<<5;f=$(3,j|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break b}d=f+(g<<5)|0;J[d>>2]=J[c>>2];J[d+4>>2]=J[c+4>>2];J[c>>2]=0;J[c+4>>2]=0;g=J[b+12>>2];J[d+16>>2]=J[b+8>>2];J[d+20>>2]=g;g=J[b+4>>2];J[d+8>>2]=J[b>>2];J[d+12>>2]=g;O[d+24>>3]=i;b=f+j|0;f=d+32|0;o:{if((e|0)!=(h|0)){while(1){d=d-32|0;e=e-32|0;J[d>>2]=J[e>>2];J[d+4>>2]=J[e+4>>2];J[e>>2]=0;J[e+4>>2]=0;g=J[e+28>>2];J[d+24>>2]=J[e+24>>2];J[d+28>>2]=g;g=J[e+20>>2];J[d+16>>2]=J[e+16>>2];J[d+20>>2]=g;g=J[e+12>>2];J[d+8>>2]=J[e+8>>2];J[d+12>>2]=g;if((e|0)!=(h|0)){continue}break}J[a+8>>2]=b;b=J[a+4>>2];J[a+4>>2]=f;e=J[a>>2];J[a>>2]=d;if((b|0)==(e|0)){break o}while(1){b=b-32|0;d=J[b+4>>2];p:{if(!d){break p}h=J[d+4>>2];J[d+4>>2]=h-1;if(h){break p}Xa[J[J[d>>2]+8>>2]](d);bb(d);}if((b|0)!=(e|0)){continue}break}break o}J[a+8>>2]=b;J[a+4>>2]=f;J[a>>2]=d;}if(!e){break n}$a(e);}J[a+32>>2]=J[a+32>>2]+1;}a=J[c+4>>2];q:{if(!a){break q}b=J[a+4>>2];J[a+4>>2]=b-1;if(b){break q}Xa[J[J[a>>2]+8>>2]](a);bb(a);}return}a=Z()|0;mb(c);da(a|0);B();}B();}function eh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=Q(0),j=0,k=0,l=0,m=0,n=Q(0),o=0;d=P(a,1540483477);d=P(d>>>24^d,1540483477)^1866966612;d=P(d>>>13^d,1540483477);g=d>>>15^d;a:{b:{c:{d:{h=J[b+4>>2];e:{if(!h){break e}e=J[b>>2];k=fo(h);d=h-1&g;f:{if(k>>>0<=1){break f}d=g;if(d>>>0<h>>>0){break f}d=(d>>>0)%(h>>>0)|0;}f=d;d=J[e+(f<<2)>>2];if(!d){break e}d=J[d>>2];if(!d){break e}if(k>>>0<=1){e=h-1|0;while(1){h=J[d+4>>2];g:{if((h|0)!=(g|0)){if((f|0)==(e&h)){break g}break e}if(J[d+8>>2]==(a|0)){break d}}d=J[d>>2];if(d){continue}break}break e}while(1){e=J[d+4>>2];h:{if((e|0)!=(g|0)){if(e>>>0>=h>>>0){e=(e>>>0)%(h>>>0)|0;}if((e|0)==(f|0)){break h}break e}if(J[d+8>>2]==(a|0)){break d}}d=J[d>>2];if(d){continue}break}}m=ze(a,b,c);if(!m){return 0}d=J[b+4>>2];if(!d){break c}e=d-1|0;if(e&d){c=d>>>0<=g>>>0?(g>>>0)%(d>>>0)|0:g;f=J[J[b>>2]+(c<<2)>>2];if(!f){break c}while(1){f=J[f>>2];if(!f){break c}e=J[f+4>>2];if((e|0)!=(g|0)){if(d>>>0<=e>>>0){e=(e>>>0)%(d>>>0)|0;}if((c|0)!=(e|0)){break c}}if(J[f+8>>2]!=(a|0)){continue}break}break b}c=e&g;f=J[J[b>>2]+(c<<2)>>2];if(!f){break c}while(1){f=J[f>>2];if(!f){break c}h=J[f+4>>2];if((h|0)!=(g|0)&(e&h)!=(c|0)){break c}if(J[f+8>>2]!=(a|0)){continue}break}break b}return J[d+12>>2]}h=cb(16);J[h+8>>2]=a;J[h+4>>2]=g;J[h>>2]=0;J[h+12>>2]=m;k=b+8|0;n=Q(J[b+12>>2]+1>>>0);i=N[b+16>>2];i:{if(!(!d|n>Q(i*Q(d>>>0)))){g=c;break i}e=2;c=(d-1&d)!=0|d>>>0<3|d<<1;i=Q(W(Q(n/i)));j:{if(i<Q(4294967296)&i>=Q(0)){a=~~i>>>0;break j}a=0;}a=a>>>0<c>>>0?c:a;k:{if((a|0)==1){break k}if(!(a&a-1)){e=a;break k}J[5996]=0;e=$(43,a|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break a}d=J[b+4>>2];}l:{m:{if(d>>>0>=e>>>0){if(d>>>0<=e>>>0){break l}c=d>>>0<3;i=Q(W(Q(Q(M[b+12>>2])/N[b+16>>2])));n:{if(i<Q(4294967296)&i>=Q(0)){a=~~i>>>0;break n}a=0;}o:{p:{if(c){break p}if(fo(d)>>>0>1){break p}a=a>>>0<2?a:1<<32-S(a-1|0);break o}J[5996]=0;a=$(43,a|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}}e=a>>>0<e>>>0?e:a;if(e>>>0>=d>>>0){d=J[b+4>>2];break l}if(!e){break m}}if(e>>>0>=1073741824){J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)==1){break a}B();}J[5996]=0;c=$(3,e<<2)|0;a=J[5996];J[5996]=0;if((a|0)==1){break a}a=J[b>>2];J[b>>2]=c;if(a){$a(a);}J[b+4>>2]=e;f=0;d=0;j=e-1|0;if(j>>>0>=3){c=e&-4;while(1){a=d<<2;J[a+J[b>>2]>>2]=0;J[J[b>>2]+(a|4)>>2]=0;J[J[b>>2]+(a|8)>>2]=0;J[J[b>>2]+(a|12)>>2]=0;d=d+4|0;if((c|0)!=(d|0)){continue}break}}a=e&3;if(a){while(1){J[J[b>>2]+(d<<2)>>2]=0;d=d+1|0;f=f+1|0;if((a|0)!=(f|0)){continue}break}}d=J[b+8>>2];if(!d){d=e;break l}c=J[d+4>>2];q:{if(e-1&e){c=c>>>0>=e>>>0?(c>>>0)%(e>>>0)|0:c;J[J[b>>2]+(c<<2)>>2]=k;f=J[d>>2];if(f){break q}d=e;break l}c=c&j;J[J[b>>2]+(c<<2)>>2]=k;a=J[d>>2];if(!a){d=e;break l}while(1){f=j&J[a+4>>2];r:{if((f|0)==(c|0)){d=a;break r}l=f<<2;o=l+J[b>>2]|0;if(J[o>>2]){J[d>>2]=J[a>>2];J[a>>2]=J[J[l+J[b>>2]>>2]>>2];J[J[l+J[b>>2]>>2]>>2]=a;break r}J[o>>2]=d;d=a;c=f;}a=J[d>>2];if(a){continue}break}d=e;break l}while(1){a=J[f+4>>2];if(e>>>0<=a>>>0){a=(a>>>0)%(e>>>0)|0;}s:{if((a|0)==(c|0)){d=f;break s}j=a<<2;l=j+J[b>>2]|0;if(!J[l>>2]){J[l>>2]=d;d=f;c=a;break s}J[d>>2]=J[f>>2];J[f>>2]=J[J[j+J[b>>2]>>2]>>2];J[J[j+J[b>>2]>>2]>>2]=f;}f=J[d>>2];if(f){continue}break}d=e;break l}a=J[b>>2];d=0;J[b>>2]=0;if(a){$a(a);}J[b+4>>2]=0;}a=d-1|0;if(!(a&d)){g=a&g;break i}if(d>>>0>g>>>0){break i}g=(g>>>0)%(d>>>0)|0;}a=J[b>>2]+(g<<2)|0;g=J[a>>2];t:{u:{if(!g){J[h>>2]=J[b+8>>2];J[b+8>>2]=h;J[a>>2]=k;a=J[h>>2];if(!a){break t}g=J[a+4>>2];a=d-1|0;v:{if(!(a&d)){g=a&g;break v}if(d>>>0>g>>>0){break v}g=(g>>>0)%(d>>>0)|0;}g=J[b>>2]+(g<<2)|0;break u}J[h>>2]=J[g>>2];}J[g>>2]=h;}J[b+12>>2]=J[b+12>>2]+1;}return m|0}a=Z()|0;$a(h);da(a|0);B();}function bo(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;i=Ua-16|0;Ua=i;J[i+8>>2]=0;J[i+12>>2]=0;k=i+8|0;J[i+4>>2]=k;a:{b:{c:{d:{e:{if((b|0)!=(c|0)){while(1){j=J[b>>2];g=J[j+80>>2];f:{if((g^-1)&d){break f}l=e&g;h=k;g=h;g:{m=J[i+8>>2];f=m;h:{if(!f){break h}while(1){g=f;f=J[g+16>>2];if(f>>>0>l>>>0){h=g;f=J[g>>2];if(f){continue}break h}if(f>>>0>=l>>>0){break g}f=J[g+4>>2];if(f){continue}break}h=g+4|0;}J[5996]=0;f=$(3,56)|0;p=J[5996];J[5996]=0;if((p|0)==1){break e}J[f+16>>2]=l;J[f+24>>2]=j;j=J[b+4>>2];J[f+28>>2]=j;if(j){J[j+4>>2]=J[j+4>>2]+1;}j=J[b+12>>2];J[f+32>>2]=J[b+8>>2];J[f+36>>2]=j;j=J[b+28>>2];J[f+48>>2]=J[b+24>>2];J[f+52>>2]=j;j=J[b+20>>2];J[f+40>>2]=J[b+16>>2];J[f+44>>2]=j;J[f+8>>2]=g;J[f>>2]=0;J[f+4>>2]=0;J[h>>2]=f;g=J[J[i+4>>2]>>2];if(g){J[i+4>>2]=g;f=J[h>>2];}zd(J[i+8>>2],f);J[i+12>>2]=J[i+12>>2]+1;break f}n=O[b+24>>3];o=O[g+48>>3];if(!(n<o)&(M[j+84>>2]<=M[J[g+24>>2]+84>>2]|n>o)){break f}h=J[b+4>>2];if(h){J[h+4>>2]=J[h+4>>2]+1;}J[g+24>>2]=j;f=J[g+28>>2];J[g+28>>2]=h;i:{if(!f){break i}h=J[f+4>>2];J[f+4>>2]=h-1;if(h){break i}Xa[J[J[f>>2]+8>>2]](f);bb(f);}f=J[b+12>>2];J[g+32>>2]=J[b+8>>2];J[g+36>>2]=f;f=J[b+28>>2];J[g+48>>2]=J[b+24>>2];J[g+52>>2]=f;f=J[b+20>>2];J[g+40>>2]=J[b+16>>2];J[g+44>>2]=f;}b=b+32|0;if((c|0)!=(b|0)){continue}break d}}J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;break a}g=Z()|0;break c}d=J[i+4>>2];J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;if((d|0)==(k|0)){break a}while(1){j:{g=J[a+4>>2];k:{if((g|0)!=J[a+8>>2]){J[g>>2]=J[d+24>>2];b=J[d+28>>2];J[g+4>>2]=b;if(b){J[b+4>>2]=J[b+4>>2]+1;}b=J[d+52>>2];J[g+24>>2]=J[d+48>>2];J[g+28>>2]=b;b=J[d+44>>2];J[g+16>>2]=J[d+40>>2];J[g+20>>2]=b;b=J[d+36>>2];J[g+8>>2]=J[d+32>>2];J[g+12>>2]=b;J[a+4>>2]=g+32;break k}b=J[a>>2];c=g-b|0;f=c>>5;e=f+1|0;if(e>>>0>=134217728){J[5996]=0;ca(62);b=J[5996];J[5996]=0;if((b|0)==1){break j}break b}h=c>>4;e=c>>>0>=2147483616?134217727:e>>>0<h>>>0?h:e;l:{if(!e){c=0;break l}if(e>>>0>=134217728){J[5996]=0;ca(35);b=J[5996];J[5996]=0;if((b|0)!=1){break b}break j}J[5996]=0;c=$(3,e<<5)|0;h=J[5996];J[5996]=0;if((h|0)==1){break j}}f=(f<<5)+c|0;J[f>>2]=J[d+24>>2];h=J[d+28>>2];J[f+4>>2]=h;if(h){J[h+4>>2]=J[h+4>>2]+1;g=J[a+4>>2];b=J[a>>2];}c=(e<<5)+c|0;e=J[d+36>>2];J[f+8>>2]=J[d+32>>2];J[f+12>>2]=e;e=J[d+52>>2];J[f+24>>2]=J[d+48>>2];J[f+28>>2]=e;e=J[d+44>>2];J[f+16>>2]=J[d+40>>2];J[f+20>>2]=e;e=f+32|0;m:{if((b|0)==(g|0)){J[a+8>>2]=c;J[a+4>>2]=e;J[a>>2]=f;break m}while(1){f=f-32|0;g=g-32|0;J[f>>2]=J[g>>2];J[f+4>>2]=J[g+4>>2];J[g>>2]=0;J[g+4>>2]=0;h=J[g+28>>2];J[f+24>>2]=J[g+24>>2];J[f+28>>2]=h;h=J[g+20>>2];J[f+16>>2]=J[g+16>>2];J[f+20>>2]=h;h=J[g+12>>2];J[f+8>>2]=J[g+8>>2];J[f+12>>2]=h;if((b|0)!=(g|0)){continue}break}J[a+8>>2]=c;g=J[a+4>>2];J[a+4>>2]=e;b=J[a>>2];J[a>>2]=f;if((b|0)==(g|0)){break m}while(1){g=g-32|0;c=J[g+4>>2];n:{if(!c){break n}e=J[c+4>>2];J[c+4>>2]=e-1;if(e){break n}Xa[J[J[c>>2]+8>>2]](c);bb(c);}if((b|0)!=(g|0)){continue}break}}if(!b){break k}$a(b);}f=J[d+4>>2];o:{if(f){while(1){g=f;f=J[g>>2];if(f){continue}break o}}while(1){g=J[d+8>>2];b=J[g>>2]!=(d|0);d=g;if(b){continue}break}}d=g;if((g|0)!=(k|0)){continue}break a}break}g=Z()|0;_b(a);m=J[i+8>>2];}yd(m);da(g|0);B();}B();}yd(J[i+8>>2]);Ua=i+16|0;}function Hb(a,b,c,d,e,f,g,h,i){var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=Ua-112|0;Ua=j;k=i&2147483647;a:{b:{m=e&2147483647;l=2147418112;n=!(b|c);if(!(d|m?m-l>>>0<2147549184:n)){p=k-l|0;if(!h&(p|0)==-2147418112?f|g:(p|0)==-2147418112&(h|0)!=0|p>>>0>2147549184){break b}}if(!(!d&(m|0)==2147418112?n:m>>>0<2147418112)){h=d;i=e|32768;f=b;g=c;break a}if(!(!h&(k|0)==2147418112?!(f|g):k>>>0<2147418112)){i=i|32768;break a}if(!(b|d|(m^2147418112|c))){l=d;d=!(b^f|d^h|(c^g|e^i^-2147483648));h=d?0:l;i=d?2147450880:e;f=d?0:b;g=d?0:c;break a}l=f|h;if(!(l|(k^2147418112|g))){break a}if(!(b|d|(c|m))){if(g|k|l){break a}f=b&f;g=c&g;h=d&h;i=e&i;break a}if(f|h|(g|k)){break b}f=b;g=c;h=d;i=e;break a}l=(k|0)==(m|0);s=l&(d|0)==(h|0)?(c|0)==(g|0)&b>>>0<f>>>0|c>>>0<g>>>0:l&d>>>0<h>>>0|k>>>0>m>>>0;n=s;m=n?f:b;p=n?g:c;l=n?i:e;t=l;n=n?h:d;q=l&65535;d=s?d:h;e=s?e:i;r=e;l=e>>>16&32767;o=t>>>16&32767;if(!o){e=!(n|q);i=e;k=e?m:n;e=e<<6;i=S(i?p:q);e=e+((i|0)==32?S(k)+32|0:i)|0;Cb(j+96|0,m,p,n,q,e-15|0);n=J[j+104>>2];q=J[j+108>>2];p=J[j+100>>2];o=16-e|0;m=J[j+96>>2];}f=s?b:f;g=s?c:g;h=d;i=r&65535;if(!l){b=!(d|i);e=b;k=b?f:d;b=b<<6;e=S(e?g:i);b=b+((e|0)==32?S(k)+32|0:e)|0;Cb(j+80|0,f,g,d,i,b-15|0);l=16-b|0;h=J[j+88>>2];i=J[j+92>>2];g=J[j+84>>2];f=J[j+80>>2];}c=i<<3|h>>>29;b=h<<3|g>>>29;c=c|524288;e=q<<3|n>>>29;q=n<<3|p>>>29;h=e;i=r^t;k=g<<3|f>>>29;d=f<<3;c:{if((l|0)==(o|0)){break c}e=o-l|0;if(e>>>0>127){b=0;c=0;k=0;d=1;break c}Cb(j- -64|0,d,k,b,c,128-e|0);xc(j+48|0,d,k,b,c,e);b=J[j+56>>2];c=J[j+60>>2];k=J[j+52>>2];d=J[j+48>>2]|(J[j+64>>2]|J[j+72>>2]|(J[j+68>>2]|J[j+76>>2]))!=0;}n=d;l=k;r=h|524288;k=p<<3|m>>>29;m=m<<3;d:{if((i|0)<0){f=0;g=0;h=0;i=0;if(!(m^n|b^q|(k^l|c^r))){break a}d=m-n|0;e=k-((m>>>0<n>>>0)+l|0)|0;f=q-b|0;g=(k|0)==(l|0)&m>>>0<n>>>0|k>>>0<l>>>0;h=f-g|0;b=(r-((b>>>0>q>>>0)+c|0)|0)-(f>>>0<g>>>0)|0;i=b;if(b>>>0>524287){break d}c=!(b|h);g=c;i=g?d:h;c=g<<6;g=S(g?e:b);c=c+((g|0)==32?S(i)+32|0:g)|0;f=b;b=c-12|0;Cb(j+32|0,d,e,h,f,b);o=o-b|0;h=J[j+40>>2];i=J[j+44>>2];d=J[j+32>>2];e=J[j+36>>2];break d}k=k+l|0;d=m+n|0;e=d>>>0<m>>>0?k+1|0:k;f=(l|0)==(e|0)&d>>>0<n>>>0|e>>>0<l>>>0;k=c+r|0;b=b+q|0;k=b>>>0<q>>>0?k+1|0:k;h=b+f|0;i=h>>>0<b>>>0?k+1|0:k;if(!(i&1048576)){break d}d=n&1|((e&1)<<31|d>>>1);e=h<<31|e>>>1;o=o+1|0;h=(i&1)<<31|h>>>1;i=i>>>1|0;}c=0;b=t&-2147483648;p=b;if((o|0)>=32767){h=c;i=b|2147418112;f=0;g=0;break a}l=0;e:{if((o|0)>0){l=o;break e}Cb(j+16|0,d,e,h,i,o+127|0);xc(j,d,e,h,i,1-o|0);d=J[j>>2]|(J[j+16>>2]|J[j+24>>2]|(J[j+20>>2]|J[j+28>>2]))!=0;e=J[j+4>>2];h=J[j+8>>2];i=J[j+12>>2];}m=d&7;d=(e&7)<<29|d>>>3;f=(m>>>0>4)+d|0;b=h<<29|e>>>3;g=d>>>0>f>>>0?b+1|0:b;d=(b|0)==(g|0)&d>>>0>f>>>0|b>>>0>g>>>0;b=c|((i&7)<<29|h>>>3);h=d+b|0;i=p|(i>>>3&65535|l<<16);i=b>>>0>h>>>0?i+1|0:i;f:{if((m|0)==4){b=0;k=g+b|0;d=f;c=f&1;f=f+c|0;g=d>>>0>f>>>0?k+1|0:k;b=(b|0)==(g|0)&c>>>0>f>>>0|b>>>0>g>>>0;h=b+h|0;i=b>>>0>h>>>0?i+1|0:i;break f}if(!m){break a}}}J[a>>2]=f;J[a+4>>2]=g;J[a+8>>2]=h;J[a+12>>2]=i;Ua=j+112|0;}function rh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;g=Ua-16|0;Ua=g;a:{f=c-!b|0;if(!((!f&b-1>>>0>15|(f|0)!=0)&(b&c)!=-1)){d=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=d-29|0;c=(d>>>0<29?d:e)+1|0;if(c>>>0>(d>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,c+(c>>>1|0)|0);d=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=d-29|0;}c=d>>>0<29;H[(c?a+4|0:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))+(c?d:e)|0]=b+80;b=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;break a}if(!(b|c)){d=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=d-29|0;b=(d>>>0<29?d:e)+1|0;if(b>>>0>(d>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,b+(b>>>1|0)|0);d=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=d-29|0;}b=d>>>0<29;H[(b?a+4|0:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))+(b?d:e)|0]=0;b=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;break a}J[g+12>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;f=b;b=c>>31;f=f^b;h=f-b|0;b=(b^c)-((f>>>0<b>>>0)+b|0)|0;b:{c:{d:{while(1){j=b;k=h;e:{if(d>>>0<e>>>0){H[d|0]=h;f=d;break e}m=d-i|0;h=m+1|0;if((h|0)<0){J[5996]=0;ca(8);a=J[5996];J[5996]=0;if((a|0)==1){break d}break b}f=e-i|0;b=f<<1;n=f>>>0>=1073741823?2147483647:b>>>0>h>>>0?b:h;f:{if(!n){h=0;break f}J[5996]=0;h=$(3,n|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break d}}f=h+m|0;H[f|0]=k;if((d|0)==(i|0)){b=f;}else {o=(i^-1)+d|0;l=0;e=f;b=m&3;if(b){while(1){e=e-1|0;d=d-1|0;H[e|0]=K[d|0];l=l+1|0;if((b|0)!=(l|0)){continue}break}}if(o>>>0>=3){while(1){H[e-1|0]=K[d-1|0];H[e-2|0]=K[d-2|0];H[e-3|0]=K[d-3|0];e=e-4|0;d=d-4|0;H[e|0]=K[d|0];if((d|0)!=(i|0)){continue}break}}d=i;b=h;}i=b;e=h+n|0;if(!d){break e}$a(d);}b=j>>>8|0;h=(j&255)<<24|k>>>8;d=f+1|0;if(!j&k>>>0>=256|j){continue}break}J[g+8>>2]=d;J[g+4>>2]=i;J[g+12>>2]=e;g:{h:{i:{b=H[f|0];if((b|0)<0){h=c>>>24&128;if(d>>>0<e>>>0){H[f+1|0]=h;J[g+8>>2]=f+2;break g}k=d-i|0;f=k+1|0;if((f|0)<0){J[5996]=0;ca(8);a=J[5996];J[5996]=0;if((a|0)!=1){break b}break d}c=e-i|0;b=c<<1;c=c>>>0>=1073741823?2147483647:b>>>0>f>>>0?b:f;j:{if(!c){f=0;break j}J[5996]=0;f=$(3,c|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break d}}e=f+k|0;H[e|0]=h;j=c+f|0;h=e+1|0;if((d|0)==(i|0)){break i}c=(i^-1)+d|0;b=k&3;if(b){l=0;while(1){e=e-1|0;d=d-1|0;H[e|0]=K[d|0];l=l+1|0;if((b|0)!=(l|0)){continue}break}}if(c>>>0>=3){while(1){H[e-1|0]=K[d-1|0];H[e-2|0]=K[d-2|0];H[e-3|0]=K[d-3|0];e=e-4|0;d=d-4|0;H[e|0]=K[d|0];if((d|0)!=(i|0)){continue}break}}J[g+12>>2]=j;J[g+8>>2]=h;J[g+4>>2]=f;if(!i){break g}break h}if((c|0)>0|(c|0)>=0){break g}H[f|0]=b|128;break g}J[g+12>>2]=j;J[g+8>>2]=h;J[g+4>>2]=e;}$a(i);}J[5996]=0;_(19,a|0,g+4|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[g+4>>2];if(!b){break a}$a(b);break a}d=Z()|0;a=J[g+4>>2];if(!a){break c}$a(a);da(d|0);B();}d=Z()|0;if(!i){break c}$a(i);}da(d|0);B();}B();}Ua=g+16|0;return a|0}function se(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;k=K[b+8|0]|K[b+9|0]<<8|(K[b+10|0]<<16|K[b+11|0]<<24);f=-29;g=K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);i=g>>>0<29;a:{g=i?g:g-29|0;if(g>>>0>=29){J[5996]=0;aa(124,a|0,g+(g>>>1|0)|0);f=J[5996];J[5996]=0;if((f|0)==1){break a}e=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);h=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);f=h-29|0;}j=a+4|0;l=h>>>0<29;e=l?j:e;eb(g+e|0,e,l?h:f);f=g+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=f;H[a+1|0]=f>>>8;H[a+2|0]=f>>>16;H[a+3|0]=f>>>24;b:{if(!g){break b}f=i?b+4|0:k;i=g&7;c:{if(!i){b=f;break c}h=0;b=f;while(1){H[e|0]=K[b|0];b=b+1|0;e=e+1|0;h=h+1|0;if((i|0)!=(h|0)){continue}break}}if(g>>>0<8){break b}f=f+g|0;while(1){H[e|0]=K[b|0];H[e+1|0]=K[b+1|0];H[e+2|0]=K[b+2|0];H[e+3|0]=K[b+3|0];H[e+4|0]=K[b+4|0];H[e+5|0]=K[b+5|0];H[e+6|0]=K[b+6|0];H[e+7|0]=K[b+7|0];e=e+8|0;b=b+8|0;if((f|0)!=(b|0)){continue}break}}k=K[c+8|0]|K[c+9|0]<<8|(K[c+10|0]<<16|K[c+11|0]<<24);e=K[c|0]|K[c+1|0]<<8|(K[c+2|0]<<16|K[c+3|0]<<24);h=e>>>0<29;b=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);f=b-29|0;g=h?e:e-29|0;i=b>>>0<29?b:f;e=g+i|0;if(e>>>0>(b>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){J[5996]=0;aa(124,a|0,e+(e>>>1|0)|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}b=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);f=b-29|0;}e=j;j=b>>>0<29;e=i+(j?e:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))|0;eb(g+e|0,e,(j?b:f)-i|0);b=g+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;d:{if(!g){break d}c=h?c+4|0:k;f=g&7;e:{if(!f){b=c;break e}h=0;b=c;while(1){H[e|0]=K[b|0];b=b+1|0;e=e+1|0;h=h+1|0;if((f|0)!=(h|0)){continue}break}}if(g>>>0<8){break d}c=c+g|0;while(1){H[e|0]=K[b|0];H[e+1|0]=K[b+1|0];H[e+2|0]=K[b+2|0];H[e+3|0]=K[b+3|0];H[e+4|0]=K[b+4|0];H[e+5|0]=K[b+5|0];H[e+6|0]=K[b+6|0];H[e+7|0]=K[b+7|0];e=e+8|0;b=b+8|0;if((c|0)!=(b|0)){continue}break}}b=J[d>>2];J[5996]=0;_(127,a|0,b|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}return}b=Z()|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0>=29){$a(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24));H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;}da(b|0);B();}function Zn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;f=Ua+-64|0;Ua=f;J[f+40>>2]=0;J[f+32>>2]=0;J[f+36>>2]=0;k=J[c>>2];n=J[c+4>>2];a:{b:{if((k|0)==(n|0)){c=k;break b}c:{d:{while(1){e:{j=J[k>>2];g=J[f+36>>2];f:{if((g|0)!=J[f+40>>2]){J[g>>2]=J[j>>2];i=J[j+4>>2];J[g+4>>2]=i;if(i){J[i+4>>2]=J[i+4>>2]+1;}J[f+36>>2]=g+8;break f}g:{i=J[f+32>>2];h=g-i|0;o=h>>3;l=o+1|0;h:{if(l>>>0>=536870912){J[5996]=0;ca(59);a=J[5996];J[5996]=0;if((a|0)==1){break h}break d}m=h>>2;h=h>>>0>=2147483640?536870911:l>>>0<m>>>0?m:l;if(h>>>0<536870912){break g}J[5996]=0;ca(35);a=J[5996];J[5996]=0;if((a|0)!=1){break d}}g=Z()|0;break a}J[5996]=0;m=h<<3;l=$(3,m|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break e}h=l+(o<<3)|0;J[h>>2]=J[j>>2];j=J[j+4>>2];J[h+4>>2]=j;if(j){J[j+4>>2]=J[j+4>>2]+1;g=J[f+36>>2];}j=l+m|0;l=h+8|0;i:{if((g|0)==(i|0)){J[f+40>>2]=j;J[f+36>>2]=l;J[f+32>>2]=h;break i}while(1){h=h-8|0;g=g-8|0;J[h>>2]=J[g>>2];J[h+4>>2]=J[g+4>>2];J[g>>2]=0;J[g+4>>2]=0;if((g|0)!=(i|0)){continue}break}J[f+40>>2]=j;g=J[f+36>>2];J[f+36>>2]=l;i=J[f+32>>2];J[f+32>>2]=h;if((g|0)==(i|0)){break i}while(1){g=g-8|0;h=J[g+4>>2];j:{if(!h){break j}j=J[h+4>>2];J[h+4>>2]=j-1;if(j){break j}Xa[J[J[h>>2]+8>>2]](h);bb(h);}if((g|0)!=(i|0)){continue}break}}if(!i){break f}$a(i);}k=k+4|0;if((n|0)!=(k|0)){continue}break c}break}g=Z()|0;break a}B();}k=J[c+4>>2];c=J[c>>2];}J[5996]=0;va(63,f+16|0,b|0,c|0,k|0,+d);c=J[5996];J[5996]=0;k:{if((c|0)==1){break k}J[5996]=0;c=$(3,104)|0;k=J[5996];J[5996]=0;if((k|0)==1){break k}J[c>>2]=7e3;J[c+4>>2]=0;J[c+8>>2]=0;J[f+52>>2]=J[f+32>>2];k=J[f+40>>2];g=J[f+36>>2];J[f+40>>2]=0;J[f+56>>2]=g;J[f+60>>2]=k;J[f+32>>2]=0;J[f+36>>2]=0;e=J[e>>2];J[5996]=0;k=ia(64,c+12|0,b|0,f+52|0,e|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[f+52>>2];if(b){g=J[f+56>>2];if((b|0)!=(g|0)){while(1){g=g-8|0;e=J[g+4>>2];l:{if(!e){break l}i=J[e+4>>2];J[e+4>>2]=i-1;if(i){break l}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((b|0)!=(g|0)){continue}break}b=J[f+52>>2];}$a(b);}J[f+48>>2]=c;J[f+44>>2]=k;J[5996]=0;b=J[f+48>>2];J[f+8>>2]=J[f+44>>2];J[f+12>>2]=b;ea(61,a|0,f+16|0,f+8|0);a=J[5996];J[5996]=0;if((a|0)==1){break k}a=J[f+32>>2];if(a){g=J[f+36>>2];if((a|0)!=(g|0)){while(1){g=g-8|0;b=J[g+4>>2];m:{if(!b){break m}c=J[b+4>>2];J[b+4>>2]=c-1;if(c){break m}Xa[J[J[b>>2]+8>>2]](b);bb(b);}if((a|0)!=(g|0)){continue}break}a=J[f+32>>2];}$a(a);}Ua=f- -64|0;return}g=Z()|0;lb(f+52|0);$a(c);break a}g=Z()|0;}lb(f+32|0);da(g|0);B();}function $g(a,b,c,d){a=a|0;b=+b;c=+c;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;g=Ua-48|0;Ua=g;a:{b:{if(J[a>>2]==21){j=d+4|0;c:{d:{e:{f:{e=J[d+4>>2];if(!e){break f}f=j;while(1){g:{h:{i:{i=J[e+16>>2];if(i>>>0<a>>>0){break i}if(a>>>0<i>>>0){break h}k=O[e+24>>3];if(k<b){break i}if(b<k){break h}h=O[e+32>>3]<c;i=h?e+4|0:e;f=h?f:e;break g}i=e+4|0;break g}i=e;f=e;}e=J[i>>2];if(e){continue}break}if((f|0)==(j|0)){break f}e=J[f+16>>2];if(e>>>0>a>>>0){break f}j:{if(a>>>0>e>>>0){break j}k=O[f+24>>3];if(k>b){break f}if(b>k){break j}if(O[f+32>>3]>c){break f}}if(O[f+56>>3]!=b){break e}if(O[f- -64>>3]!=c){break d}l=f+40|0;break a}J[g+40>>2]=0;O[g+32>>3]=c;O[g+24>>3]=b;J[g+16>>2]=0;J[g+8>>2]=0;J[g+12>>2]=0;e=J[a+4>>2];if((e|0)==J[a+8>>2]){J[5996]=0;ga(44,4277,1900,673,1984);a=J[5996];J[5996]=0;if((a|0)!=1){break c}break b}e=J[e>>2];J[5996]=0;ea(45,e|0,g+8|0,d|0);e=J[5996];J[5996]=0;if((e|0)==1){break b}k:{l:{e=j;i=J[e>>2];m:{if(!i){break m}while(1){n:{o:{e=i;f=J[e+16>>2];p:{if(f>>>0>a>>>0){break p}if(a>>>0>f>>>0){break n}k=O[e+24>>3];if(k>b){break p}if(b>k){break n}k=O[e+32>>3];if(!(k>c)){break o}}j=e;i=J[e>>2];if(i){continue}break m}if(!(c>k)){break l}}i=J[e+4>>2];if(i){continue}break}j=e+4|0;}J[5996]=0;h=$(3,80)|0;f=J[5996];J[5996]=0;if((f|0)==1){break b}J[h+16>>2]=a;O[h+32>>3]=c;O[h+24>>3]=b;l=h+40|0;J[l>>2]=J[g+8>>2];J[h+44>>2]=J[g+12>>2];J[h+48>>2]=J[g+16>>2];J[g+16>>2]=0;J[g+8>>2]=0;J[g+12>>2]=0;J[h+72>>2]=J[g+40>>2];i=J[g+36>>2];f=h- -64|0;J[f>>2]=J[g+32>>2];J[f+4>>2]=i;f=J[g+28>>2];J[h+56>>2]=J[g+24>>2];J[h+60>>2]=f;J[h+8>>2]=e;J[h>>2]=0;J[h+4>>2]=0;J[j>>2]=h;e=h;f=J[J[d>>2]>>2];if(f){J[d>>2]=f;e=J[j>>2];}zd(J[d+4>>2],e);J[d+8>>2]=J[d+8>>2]+1;j=J[a+4>>2];if(J[a+8>>2]-j>>>0>=5){f=J[h+72>>2];i=1;e=1;while(1){j=J[(e<<2)+j>>2];J[5996]=0;ea(45,j|0,l|0,d|0);j=J[5996];J[5996]=0;if((j|0)==1){break k}j=f;f=J[h+72>>2];i=(j|0)==(f|0)?i:e;e=e+1|0;j=J[a+4>>2];e=(e|0)==J[a+8>>2]-j>>2?1:e;if((i|0)!=(e|0)){continue}break}}d=J[g+8>>2];if(!d){break a}a=J[g+12>>2];if((d|0)!=(a|0)){while(1){a=a-32|0;e=J[a+4>>2];q:{if(!e){break q}f=J[e+4>>2];J[e+4>>2]=f-1;if(f){break q}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((a|0)!=(d|0)){continue}break}d=J[g+8>>2];}$a(d);break a}J[5996]=0;ga(44,2453,1900,676,1984);a=J[5996];J[5996]=0;if((a|0)!=1){break c}break b}break b}la(1940,1900,668,1984);B();}la(1841,1900,669,1984);}B();}la(3430,1900,664,1984);B();}a=Z()|0;_b(g+8|0);da(a|0);B();}Ua=g+48|0;return l|0}function hk(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;j=Ua-1056|0;Ua=j;J[j+16>>2]=f;J[j+20>>2]=g;J[j+24>>2]=h;J[j+28>>2]=i;a=j+944|0;J[j+940>>2]=a;l=od(a,100,2304,j+16|0);J[j+48>>2]=184;n=j+520|0;J[n>>2]=0;J[n+4>>2]=J[j+48>>2];J[j+48>>2]=184;m=j+512|0;J[m>>2]=0;J[m+4>>2]=J[j+48>>2];a:{b:{c:{d:{if(l>>>0<100){h=j+528|0;break d}a=jb();J[j>>2]=f;J[j+4>>2]=g;J[j+8>>2]=h;J[j+12>>2]=i;l=dc(j+940|0,a,2304,j);if((l|0)!=-1){a=J[j+940>>2];tb(n,a);tb(m,sb(l<<2));h=J[m>>2];if(h){break d}}J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)!=1){break a}l=Z()|0;break c}f=J[d+28>>2];J[j+508>>2]=f;J[f+4>>2]=J[f+4>>2]+1;J[5996]=0;r=$(197,J[j+508>>2])|0;f=J[5996];J[5996]=0;e:{f:{g:{h:{i:{j:{if((f|0)==1){break j}J[5996]=0;ga(208,r|0,a|0,a+l|0,h|0);f=J[5996];J[5996]=0;if((f|0)==1){break j}p=(l|0)>0?K[a|0]==45:p;g=j+484|0;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;a=j+472|0;J[a>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;f=j+460|0;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;J[5996]=0;sa(238,c|0,p|0,J[j+508>>2],j+504|0,j+500|0,j+496|0,g|0,a|0,f|0,j+456|0);c=J[5996];J[5996]=0;if((c|0)==1){break i}J[j+36>>2]=184;c=j+40|0;J[c>>2]=0;J[c+4>>2]=J[j+36>>2];i=j+48|0;o=J[j+456>>2];k:{if((o|0)<(l|0)){k=K[f+11|0];q=(l-o<<1)+((k&128)>>>7|0?J[f+4>>2]:k&127)|0;k=K[a+11|0];k=(q+((k&128)>>>7|0?J[a+4>>2]:k&127)|0)+1|0;break k}k=K[f+11|0];q=(k&128)>>>7|0?J[f+4>>2]:k&127;k=K[a+11|0];k=(q+((k&128)>>>7|0?J[a+4>>2]:k&127)|0)+2|0;}k=k+o|0;if(k>>>0<101){break h}tb(c,sb(k<<2));i=J[c>>2];if(i){break h}J[5996]=0;ca(185);b=J[5996];J[5996]=0;if((b|0)!=1){break a}break g}l=Z()|0;break e}l=Z()|0;break f}k=J[d+4>>2];J[5996]=0;ta(239,i|0,j+36|0,j+32|0,k|0,h|0,(l<<2)+h|0,r|0,p|0,j+504|0,J[j+500>>2],J[j+496>>2],g|0,a|0,f|0,o|0);h=J[5996];J[5996]=0;if((h|0)!=1){J[5996]=0;d=ka(219,b|0,i|0,J[j+36>>2],J[j+32>>2],d|0,e|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break b}}}l=Z()|0;db(c);}ab(f);ab(a);ab(g);}a=J[j+508>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}}db(m);db(n);da(l|0);B();}db(c);ab(f);ab(a);ab(g);a=J[j+508>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}db(m);db(n);Ua=j+1056|0;return d|0}B();}function ih(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=J[a+4>>2];d=J[a+8>>2];if(c>>>0<d>>>0){d=J[b>>2];J[c+12>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;J[c>>2]=d;J[c+4>>2]=J[b+4>>2];J[c+8>>2]=J[b+8>>2];J[c+12>>2]=J[b+12>>2];J[b+12>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[c+24>>2]=0;J[c+16>>2]=0;J[c+20>>2]=0;J[c+16>>2]=J[b+16>>2];J[c+20>>2]=J[b+20>>2];J[c+24>>2]=J[b+24>>2];J[b+24>>2]=0;J[b+16>>2]=0;J[b+20>>2]=0;J[c+36>>2]=0;J[c+28>>2]=0;J[c+32>>2]=0;J[c+28>>2]=J[b+28>>2];J[c+32>>2]=J[b+32>>2];J[c+36>>2]=J[b+36>>2];J[b+36>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[c+48>>2]=0;J[c+40>>2]=0;J[c+44>>2]=0;J[c+40>>2]=J[b+40>>2];J[c+44>>2]=J[b+44>>2];J[c+48>>2]=J[b+48>>2];J[b+48>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;J[c+52>>2]=J[b+52>>2];J[a+4>>2]=c+56;return}a:{b:{c:{e=J[a>>2];f=(c-e|0)/56|0;c=f+1|0;if(c>>>0<76695845){d=(d-e|0)/56|0;e=d<<1;c=d>>>0>=38347922?76695844:c>>>0<e>>>0?e:c;if(c>>>0>=76695845){break c}d=P(c,56);e=cb(d);c=e+P(f,56)|0;J[c>>2]=J[b>>2];J[c+4>>2]=J[b+4>>2];J[c+8>>2]=J[b+8>>2];J[c+12>>2]=J[b+12>>2];J[b+12>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[c+16>>2]=J[b+16>>2];J[c+20>>2]=J[b+20>>2];J[c+24>>2]=J[b+24>>2];J[b+24>>2]=0;J[b+16>>2]=0;J[b+20>>2]=0;J[c+28>>2]=J[b+28>>2];J[c+32>>2]=J[b+32>>2];J[c+36>>2]=J[b+36>>2];J[b+36>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[c+40>>2]=J[b+40>>2];J[c+44>>2]=J[b+44>>2];J[c+48>>2]=J[b+48>>2];J[b+48>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;J[c+52>>2]=J[b+52>>2];d=d+e|0;e=c+56|0;b=J[a+4>>2];f=J[a>>2];if((b|0)==(f|0)){break b}while(1){c=c-56|0;b=b-56|0;J[c>>2]=J[b>>2];J[c+4>>2]=J[b+4>>2];J[c+8>>2]=J[b+8>>2];J[c+12>>2]=J[b+12>>2];J[b+12>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[c+16>>2]=J[b+16>>2];J[c+20>>2]=J[b+20>>2];J[c+24>>2]=J[b+24>>2];J[b+24>>2]=0;J[b+16>>2]=0;J[b+20>>2]=0;J[c+28>>2]=J[b+28>>2];J[c+32>>2]=J[b+32>>2];J[c+36>>2]=J[b+36>>2];J[b+36>>2]=0;J[b+28>>2]=0;J[b+32>>2]=0;J[c+40>>2]=J[b+40>>2];J[c+44>>2]=J[b+44>>2];J[c+48>>2]=J[b+48>>2];J[b+48>>2]=0;J[b+40>>2]=0;J[b+44>>2]=0;J[c+52>>2]=J[b+52>>2];if((b|0)!=(f|0)){continue}break}J[a+8>>2]=d;d=J[a+4>>2];J[a+4>>2]=e;b=J[a>>2];J[a>>2]=c;if((b|0)==(d|0)){break a}while(1){d=Fb(d-56|0);if((d|0)!=(b|0)){continue}break}break a}nb();B();}Pb();B();}J[a+8>>2]=d;J[a+4>>2]=e;J[a>>2]=c;}if(b){$a(b);}}function lk(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;j=Ua-448|0;Ua=j;J[j+16>>2]=f;J[j+20>>2]=g;J[j+24>>2]=h;J[j+28>>2]=i;a=j+336|0;J[j+332>>2]=a;l=od(a,100,2304,j+16|0);J[j+48>>2]=184;n=j+216|0;J[n>>2]=0;J[n+4>>2]=J[j+48>>2];J[j+48>>2]=184;m=j+208|0;J[m>>2]=0;J[m+4>>2]=J[j+48>>2];a:{b:{c:{d:{if(l>>>0<100){h=j+224|0;break d}a=jb();J[j>>2]=f;J[j+4>>2]=g;J[j+8>>2]=h;J[j+12>>2]=i;l=dc(j+332|0,a,2304,j);if((l|0)!=-1){a=J[j+332>>2];tb(n,a);tb(m,sb(l));h=J[m>>2];if(h){break d}}J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)!=1){break a}l=Z()|0;break c}f=J[d+28>>2];J[j+204>>2]=f;J[f+4>>2]=J[f+4>>2]+1;J[5996]=0;r=$(170,J[j+204>>2])|0;f=J[5996];J[5996]=0;e:{f:{g:{h:{i:{j:{if((f|0)==1){break j}J[5996]=0;ga(195,r|0,a|0,a+l|0,h|0);f=J[5996];J[5996]=0;if((f|0)==1){break j}p=(l|0)>0?K[a|0]==45:p;g=j+184|0;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;a=j+172|0;J[a>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;f=j+160|0;J[f>>2]=0;J[f+4>>2]=0;J[f+8>>2]=0;J[5996]=0;sa(236,c|0,p|0,J[j+204>>2],j+200|0,j+199|0,j+198|0,g|0,a|0,f|0,j+156|0);c=J[5996];J[5996]=0;if((c|0)==1){break i}J[j+36>>2]=184;c=j+40|0;J[c>>2]=0;J[c+4>>2]=J[j+36>>2];i=j+48|0;o=J[j+156>>2];k:{if((o|0)<(l|0)){k=K[f+11|0];q=(l-o<<1)+((k&128)>>>7|0?J[f+4>>2]:k&127)|0;k=K[a+11|0];k=(q+((k&128)>>>7|0?J[a+4>>2]:k&127)|0)+1|0;break k}k=K[f+11|0];q=(k&128)>>>7|0?J[f+4>>2]:k&127;k=K[a+11|0];k=(q+((k&128)>>>7|0?J[a+4>>2]:k&127)|0)+2|0;}k=k+o|0;if(k>>>0<101){break h}tb(c,sb(k));i=J[c>>2];if(i){break h}J[5996]=0;ca(185);b=J[5996];J[5996]=0;if((b|0)!=1){break a}break g}l=Z()|0;break e}l=Z()|0;break f}k=J[d+4>>2];J[5996]=0;ta(237,i|0,j+36|0,j+32|0,k|0,h|0,h+l|0,r|0,p|0,j+200|0,H[j+199|0],H[j+198|0],g|0,a|0,f|0,o|0);h=J[5996];J[5996]=0;if((h|0)!=1){J[5996]=0;d=ka(213,b|0,i|0,J[j+36>>2],J[j+32>>2],d|0,e|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break b}}}l=Z()|0;db(c);}ab(f);ab(a);ab(g);}a=J[j+204>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}}db(m);db(n);da(l|0);B();}db(c);ab(f);ab(a);ab(g);a=J[j+204>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}db(m);db(n);Ua=j+448|0;return d|0}B();}function Vn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;var f=0,g=0,h=0,i=0,j=0;a:{b:{if(!(b-19>>>0>=7&e!=0)){f=1-e;c:{switch(b|0){case 24:if((c|0)!=(d|0)){while(1){b=J[c>>2];h=h+O[b+8>>3];g=g+O[b+16>>3];c=c+4|0;if((d|0)!=(c|0)){continue}break}}O[a+8>>3]=g;O[a>>3]=(f==0?0:f*g)+(e==0?0:h*e);return;case 3:J[a+8>>2]=0;J[a+12>>2]=1078034432;J[a>>2]=0;J[a+4>>2]=1079689216;return;case 6:case 7:case 8:case 9:J[a+8>>2]=0;J[a+12>>2]=1077968896;J[a>>2]=0;J[a+4>>2]=1077968896;return;case 10:case 11:case 12:case 16:b=J[c>>2];c=J[b+12>>2];J[a>>2]=J[b+8>>2];J[a+4>>2]=c;c=J[b+20>>2];J[a+8>>2]=J[b+16>>2];J[a+12>>2]=c;return;case 13:e=O[J[c>>2]+8>>3];J[a+8>>2]=0;J[a+12>>2]=1072693248;O[a>>3]=e+2;return;case 14:e=O[J[c>>2]+8>>3];J[a+8>>2]=0;J[a+12>>2]=2146435072;O[a>>3]=e;return;case 15:e=O[J[c>>2]+8>>3];J[a+8>>2]=0;J[a+12>>2]=1072693248;O[a>>3]=e;return;case 0:J[a+8>>2]=0;J[a+12>>2]=0;J[a>>2]=0;J[a+4>>2]=2146435072;return;case 17:e=O[J[c+4>>2]+8>>3];f=O[J[c>>2]+8>>3];J[a+8>>2]=0;J[a+12>>2]=2146435072;O[a>>3]=f+e;return;case 18:b=J[c+4>>2];e=O[b+16>>3];c=J[c>>2];f=O[c+16>>3];O[a>>3]=O[c+8>>3]+O[b+8>>3];O[a+8>>3]=f+e;return;case 19:b=J[c>>2];g=O[b+8>>3];c=J[c+4>>2];h=O[c+8>>3];i=O[c+16>>3];j=O[b+16>>3];O[a+8>>3]=i+j;O[a>>3]=(e==0?0:(g+i)*e)+(f==0?0:f*(j+h));return;case 20:case 21:b=J[c+4>>2];g=O[b+8>>3];c=J[c>>2];h=O[c+8>>3];i=O[c+16>>3];O[a+8>>3]=i+O[b+16>>3];O[a>>3]=(e==0?0:h*e)+(f==0?0:f*(i+g));return;case 22:b=J[c>>2];g=O[b+8>>3];c=J[c+4>>2];h=O[c+8>>3];i=O[c+16>>3]+1;j=O[b+16>>3]+2;O[a+8>>3]=i<j?i:j;O[a>>3]=(e==0?0:(g+2)*e)+(f==0?0:f*(h+1));return;case 23:b=J[c+8>>2];g=O[b+8>>3];h=O[J[c+4>>2]+8>>3];c=J[c>>2];i=O[c+8>>3];j=O[c+16>>3];O[a+8>>3]=j+O[b+16>>3];O[a>>3]=(e==0?0:(i+h)*e)+(f==0?0:f*(j+g));return;default:a=Rb(8);J[5996]=0;b=_(91,a|0,1318)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break b}b=Z()|0;ic(a);da(b|0);B();case 1:case 4:case 5:break a;case 2:break c}}J[a+8>>2]=0;J[a+12>>2]=1072693248;J[a>>2]=0;J[a+4>>2]=1079132160;return}la(4323,1900,476,1746);B();}na(b|0,22664,92);B();}J[a+8>>2]=0;J[a+12>>2]=2146435072;J[a>>2]=0;J[a+4>>2]=0;}function Hg(a,b,c,d,e,f,g,h,i){var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=Ua-128|0;Ua=j;a:{b:{c:{if(!yc(f,g,h,i,0,0,0,0)){break c}k=i&65535;n=i>>>16&32767;d:{e:{if((n|0)!=32767){l=4;if(n){break e}l=f|h|(g|k)?3:2;break d}l=!(f|h|(g|k));}}s=e>>>16|0;o=s&32767;if((o|0)==32767){break c}if(l){break b}}ob(j+16|0,b,c,d,e,f,g,h,i);b=J[j+16>>2];d=J[j+20>>2];e=J[j+24>>2];c=J[j+28>>2];Ng(j,b,d,e,c,b,d,e,c);d=J[j+8>>2];e=J[j+12>>2];h=J[j>>2];i=J[j+4>>2];break a}l=d;p=e&2147483647;k=p;n=h;m=i&2147483647;if((yc(b,c,l,k,f,g,h,m)|0)<=0){if(yc(b,c,l,k,f,g,h,m)){h=b;i=c;break a}ob(j+112|0,b,c,d,e,0,0,0,0);d=J[j+120>>2];e=J[j+124>>2];h=J[j+112>>2];i=J[j+116>>2];break a}q=i>>>16&32767;if(o){i=c;h=b;}else {ob(j+96|0,b,c,l,p,0,0,0,1081540608);l=J[j+104>>2];h=J[j+108>>2];p=h;o=(h>>>16|0)-120|0;i=J[j+100>>2];h=J[j+96>>2];}if(!q){ob(j+80|0,f,g,n,m,0,0,0,1081540608);n=J[j+88>>2];f=J[j+92>>2];m=f;q=(f>>>16|0)-120|0;g=J[j+84>>2];f=J[j+80>>2];}r=n;t=m&65535|65536;p=p&65535|65536;if((o|0)>(q|0)){while(1){m=l-r|0;k=(g|0)==(i|0)&f>>>0>h>>>0|g>>>0>i>>>0;n=m-k|0;k=(p-((l>>>0<r>>>0)+t|0)|0)-(k>>>0>m>>>0)|0;f:{if((k|0)>0|(k|0)>=0){l=h;h=h-f|0;i=i-((f>>>0>l>>>0)+g|0)|0;if(!(h|n|(i|k))){ob(j+32|0,b,c,d,e,0,0,0,0);d=J[j+40>>2];e=J[j+44>>2];h=J[j+32>>2];i=J[j+36>>2];break a}k=k<<1|n>>>31;l=n<<1|i>>>31;break f}k=p<<1|l>>>31;l=l<<1|i>>>31;}p=k;k=i<<1|h>>>31;h=h<<1;i=k;o=o-1|0;if((o|0)>(q|0)){continue}break}o=q;}m=l-r|0;k=(g|0)==(i|0)&f>>>0>h>>>0|g>>>0>i>>>0;n=m-k|0;k=(p-((l>>>0<r>>>0)+t|0)|0)-(k>>>0>m>>>0)|0;m=k;g:{if((k|0)<0){n=l;m=p;break g}l=h;h=h-f|0;i=i-((f>>>0>l>>>0)+g|0)|0;if(h|n|(i|m)){break g}ob(j+48|0,b,c,d,e,0,0,0,0);d=J[j+56>>2];e=J[j+60>>2];h=J[j+48>>2];i=J[j+52>>2];break a}if((m|0)==65535|m>>>0<65535){while(1){b=i>>>31|0;o=o-1|0;p=i<<1|h>>>31;h=h<<1;i=p;c=b;b=m<<1|n>>>31;n=c|n<<1;m=b;if(b>>>0<65536){continue}break}}b=s&32768;if((o|0)<=0){ob(j- -64|0,h,i,n,m&65535|(b|o+120)<<16,0,0,0,1065811968);d=J[j+72>>2];e=J[j+76>>2];h=J[j+64>>2];i=J[j+68>>2];break a}d=n;e=m&65535|(b|o)<<16;}J[a>>2]=h;J[a+4>>2]=i;J[a+8>>2]=d;J[a+12>>2]=e;Ua=j+128|0;}function tn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0;h=J[b>>2];f=K[b+11|0];g=f<<24>>24;c=(g|0)<0;i=J[b+4>>2];d=c?i:f;a:{if((d|0)<9){break a}f=c?h:b;e=f+d|0;while(1){c=f;while(1){c=Zb(c,115,d-8|0);if(!c){break a}if(Eb(c,4824,9)){c=c+1|0;d=e-c|0;if((d|0)>=9){continue}break a}break}if((c|0)==(e|0)){break a}c=c-f|0;if((c|0)==-1){break a}Lc(b,c,9,5034);h=J[b>>2];c=K[b+11|0];g=c<<24>>24;e=(g|0)<0;f=e?h:b;i=J[b+4>>2];d=e?i:c;e=f+d|0;if((d|0)>8){continue}break}}c=g<<24>>24;d=(c|0)<0?i:g&255;b:{if((d|0)<10){break b}f=(c|0)<0?h:b;e=f+d|0;while(1){c=f;while(1){c=Zb(c,104,d-9|0);if(!c){break b}if(Eb(c,4813,10)){c=c+1|0;d=e-c|0;if((d|0)>=10){continue}break b}break}if((c|0)==(e|0)){break b}c=c-f|0;if((c|0)==-1){break b}Lc(b,c,10,4960);h=J[b>>2];c=K[b+11|0];g=c<<24>>24;e=(g|0)<0;f=e?h:b;i=J[b+4>>2];d=e?i:c;e=f+d|0;if((d|0)>9){continue}break}}c=g<<24>>24<0;d=c?i:g&255;c:{if((d|0)<12){break c}f=c?h:b;e=f+d|0;while(1){c=f;while(1){c=Zb(c,114,d-11|0);if(!c){break c}if(Eb(c,4845,12)){c=c+1|0;d=e-c|0;if((d|0)>=12){continue}break c}break}if((c|0)==(e|0)){break c}c=c-f|0;if((c|0)==-1){break c}Lc(b,c,12,4908);h=J[b>>2];c=K[b+11|0];g=c<<24>>24;e=(g|0)<0;f=e?h:b;i=J[b+4>>2];d=e?i:c;e=f+d|0;if((d|0)>11){continue}break}}c=g<<24>>24;d=(c|0)<0?i:g&255;d:{if((d|0)<10){break d}f=(c|0)<0?h:b;e=f+d|0;while(1){c=f;while(1){c=Zb(c,104,d-9|0);if(!c){break d}if(Eb(c,4834,10)){c=c+1|0;d=e-c|0;if((d|0)>=10){continue}break d}break}if((c|0)==(e|0)){break d}c=c-f|0;if((c|0)==-1){break d}Lc(b,c,10,4858);h=J[b>>2];c=K[b+11|0];g=c<<24>>24;e=(g|0)<0;f=e?h:b;i=J[b+4>>2];d=e?i:c;e=f+d|0;if((d|0)>9){continue}break}}c=g<<24>>24<0;d=c?i:g&255;e:{if((d|0)<=0){break e}e=c?h:b;g=e+d|0;while(1){c=e;while(1){c=Zb(c,32,d);if(!c){break e}if(K[c|0]!=32){c=c+1|0;d=g-c|0;if((d|0)>0){continue}break e}break}if((c|0)==(g|0)){break e}c=c-e|0;if((c|0)==-1){break e}Lc(b,c,1,5575);c=K[b+11|0];f=c<<24>>24<0;e=f?J[b>>2]:b;d=f?J[b+4>>2]:c;g=e+d|0;if((d|0)>0){continue}break}}c=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=c;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;}\n\t\tfunction Sk(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;k=Ua-16|0;Ua=k;l=je(J[g>>2]);o=Zd(J[g>>2]);g=o;Xa[J[J[g>>2]+20>>2]](k+4|0,g);J[f>>2]=d;a:{b:{c:{i=a;g=K[i|0];switch(g-43|0){case 0:case 2:break c;default:break b}}J[5996]=0;g=_(216,l|0,g<<24>>24)|0;i=J[5996];J[5996]=0;if((i|0)==1){break a}i=J[f>>2];J[f>>2]=i+4;J[i>>2]=g;i=a+1|0;}d:{g=i;if(!((c-g|0)<=1|K[g|0]!=48|(K[g+1|0]|32)!=120)){J[5996]=0;i=_(216,l|0,48)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=J[f>>2];J[f>>2]=h+4;J[h>>2]=i;i=H[g+1|0];J[5996]=0;i=_(216,l|0,i|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=J[f>>2];J[f>>2]=h+4;J[h>>2]=i;i=g+2|0;g=i;while(1){if(c>>>0<=g>>>0){break d}h=H[g|0];jb();if(!(h-48>>>0<10|(h|32)-97>>>0<6)){break d}g=g+1|0;continue}}while(1){if(c>>>0<=g>>>0){break d}h=H[g|0];jb();if(h-48>>>0>=10){break d}g=g+1|0;continue}}e:{h=K[k+15|0];if(!((h&128)>>>7|0?J[k+8>>2]:h&127)){h=J[f>>2];J[5996]=0;ga(208,l|0,i|0,g|0,h|0);h=J[5996];J[5996]=0;if((h|0)==1){break a}J[f>>2]=J[f>>2]+(g-i<<2);break e}vc(i,g);J[5996]=0;q=$(206,o|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=i;while(1){if(g>>>0<=h>>>0){md((i-a<<2)+d|0,J[f>>2]);break e}j=k+4|0;m=(K[j+11|0]&128)>>>7|0;if(!(H[(m?J[j>>2]:j)+n|0]<=0|H[(m?J[j>>2]:j)+n|0]!=(p|0))){j=J[f>>2];J[f>>2]=j+4;J[j>>2]=q;p=0;j=K[k+15|0];n=(((j&128)>>>7|0?J[k+8>>2]:j&127)-1>>>0>n>>>0)+n|0;}j=H[h|0];J[5996]=0;j=_(216,l|0,j|0)|0;m=J[5996];J[5996]=0;if((m|0)!=1){m=J[f>>2];J[f>>2]=m+4;J[m>>2]=j;h=h+1|0;p=p+1|0;continue}break}break a}f:{while(1){if(c>>>0>g>>>0){i=K[g|0];if((i|0)==46){J[5996]=0;i=$(209,o|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}j=J[f>>2];h=j+4|0;J[f>>2]=h;J[j>>2]=i;g=g+1|0;break f}J[5996]=0;i=_(216,l|0,i<<24>>24)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=J[f>>2];J[f>>2]=h+4;J[h>>2]=i;g=g+1|0;continue}break}h=J[f>>2];}J[5996]=0;ga(208,l|0,g|0,c|0,h|0);i=J[5996];J[5996]=0;if((i|0)==1){break a}i=f;f=J[f>>2]+(c-g<<2)|0;J[i>>2]=f;J[e>>2]=(b|0)==(c|0)?f:(b-a<<2)+d|0;ab(k+4|0);Ua=k+16|0;return}a=Z()|0;ab(k+4|0);da(a|0);B();}function bl(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;k=Ua-16|0;Ua=k;l=le(J[g>>2]);o=de(J[g>>2]);g=o;Xa[J[J[g>>2]+20>>2]](k+4|0,g);J[f>>2]=d;a:{b:{c:{i=a;g=K[i|0];switch(g-43|0){case 0:case 2:break c;default:break b}}J[5996]=0;g=_(171,l|0,g<<24>>24)|0;i=J[5996];J[5996]=0;if((i|0)==1){break a}i=J[f>>2];J[f>>2]=i+1;H[i|0]=g;i=a+1|0;}d:{g=i;if(!((c-g|0)<=1|K[g|0]!=48|(K[g+1|0]|32)!=120)){J[5996]=0;i=_(171,l|0,48)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=J[f>>2];J[f>>2]=h+1;H[h|0]=i;i=H[g+1|0];J[5996]=0;i=_(171,l|0,i|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=J[f>>2];J[f>>2]=h+1;H[h|0]=i;i=g+2|0;g=i;while(1){if(c>>>0<=g>>>0){break d}h=H[g|0];jb();if(!(h-48>>>0<10|(h|32)-97>>>0<6)){break d}g=g+1|0;continue}}while(1){if(c>>>0<=g>>>0){break d}h=H[g|0];jb();if(h-48>>>0>=10){break d}g=g+1|0;continue}}e:{h=K[k+15|0];if(!((h&128)>>>7|0?J[k+8>>2]:h&127)){h=J[f>>2];J[5996]=0;ga(195,l|0,i|0,g|0,h|0);h=J[5996];J[5996]=0;if((h|0)==1){break a}J[f>>2]=J[f>>2]+(g-i|0);break e}vc(i,g);J[5996]=0;q=$(193,o|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=i;while(1){if(g>>>0<=h>>>0){vc((i-a|0)+d|0,J[f>>2]);break e}j=k+4|0;m=(K[j+11|0]&128)>>>7|0;if(!(H[(m?J[j>>2]:j)+n|0]<=0|H[(m?J[j>>2]:j)+n|0]!=(p|0))){j=J[f>>2];J[f>>2]=j+1;H[j|0]=q;p=0;j=K[k+15|0];n=(((j&128)>>>7|0?J[k+8>>2]:j&127)-1>>>0>n>>>0)+n|0;}j=H[h|0];J[5996]=0;j=_(171,l|0,j|0)|0;m=J[5996];J[5996]=0;if((m|0)!=1){m=J[f>>2];J[f>>2]=m+1;H[m|0]=j;h=h+1|0;p=p+1|0;continue}break}break a}while(1){f:{if(c>>>0>g>>>0){i=K[g|0];if((i|0)!=46){break f}J[5996]=0;i=$(196,o|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=J[f>>2];J[f>>2]=h+1;H[h|0]=i;g=g+1|0;}i=J[f>>2];J[5996]=0;ga(195,l|0,g|0,c|0,i|0);i=J[5996];J[5996]=0;if((i|0)==1){break a}i=f;f=J[f>>2]+(c-g|0)|0;J[i>>2]=f;J[e>>2]=(b|0)==(c|0)?f:(b-a|0)+d|0;ab(k+4|0);Ua=k+16|0;return}J[5996]=0;i=_(171,l|0,i<<24>>24)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}h=J[f>>2];J[f>>2]=h+1;H[h|0]=i;g=g+1|0;continue}}a=Z()|0;ab(k+4|0);da(a|0);B();}function bg(a,b,c,d){var e=0,f=0,g=0,h=0,i=0;e=J[b>>2];a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{l:{if(!d){break l}g=J[d>>2];if(!g){break l}if(!a){d=c;break j}J[d>>2]=0;d=c;break k}m:{if(!J[J[6178]>>2]){if(!a){break m}if(!c){break a}g=c;while(1){d=H[e|0];if(d){J[a>>2]=d&57343;a=a+4|0;e=e+1|0;g=g-1|0;if(g){continue}break a}break}J[a>>2]=0;J[b>>2]=0;return c-g|0}d=c;if(!a){break i}break g}return Gb(e)}f=1;break g}f=0;break h}f=1;}while(1){if(!f){f=K[e|0]>>>3|0;if((f-16|f+(g>>26))>>>0>7){break f}f=e+1|0;n:{if(!(g&33554432)){break n}if((K[f|0]&192)!=128){e=e-1|0;break d}f=e+2|0;if(!(g&524288)){break n}if((K[f|0]&192)!=128){e=e-1|0;break d}f=e+3|0;}e=f;d=d-1|0;f=1;continue}while(1){g=K[e|0];o:{if(e&3|g-1>>>0>126){break o}g=J[e>>2];if((g|g-16843009)&-2139062144){break o}while(1){d=d-4|0;g=J[e+4>>2];e=e+4|0;if(!((g-16843009|g)&-2139062144)){continue}break}}f=g&255;if(f-1>>>0<=126){d=d-1|0;e=e+1|0;continue}break}f=f-194|0;if(f>>>0>50){break e}e=e+1|0;g=J[(f<<2)+12208>>2];f=0;continue}}while(1){if(!f){if(!d){break a}while(1){p:{f=K[e|0];h=f-1|0;q:{r:{if(h>>>0>126){g=f;break r}if(e&3|d>>>0<5){break q}s:{while(1){g=J[e>>2];if((g|g-16843009)&-2139062144){break s}J[a>>2]=g&255;J[a+4>>2]=K[e+1|0];J[a+8>>2]=K[e+2|0];J[a+12>>2]=K[e+3|0];a=a+16|0;e=e+4|0;d=d-4|0;if(d>>>0>4){continue}break}g=K[e|0];}f=g&255;h=f-1|0;}if(h>>>0>126){break p}}J[a>>2]=f;a=a+4|0;e=e+1|0;d=d-1|0;if(d){continue}break a}break}f=f-194|0;if(f>>>0>50){break e}e=e+1|0;g=J[(f<<2)+12208>>2];f=1;continue}i=K[e|0];f=i>>>3|0;if((f-16|f+(g>>26))>>>0>7){break f}t:{u:{h=e+1|0;f=i-128|g<<6;v:{if((f|0)>=0){break v}i=K[h|0]-128|0;if(i>>>0>63){break u}h=e+2|0;f=i|f<<6;if((f|0)>=0){break v}h=K[h|0]-128|0;if(h>>>0>63){break u}f=h|f<<6;h=e+3|0;}e=h;J[a>>2]=f;d=d-1|0;a=a+4|0;break t}J[5732]=25;e=e-1|0;break c}f=0;continue}}e=e-1|0;if(g){break d}g=K[e|0];}if(g&255){break d}if(a){J[a>>2]=0;J[b>>2]=0;}return c-d|0}J[5732]=25;if(!a){break b}}J[b>>2]=e;}return -1}J[b>>2]=e;return c}function ul(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a=Ua-256|0;Ua=a;J[a+248>>2]=c;J[a+252>>2]=b;h=a+196|0;J[h>>2]=0;J[h+4>>2]=0;J[h+8>>2]=0;g=a+16|0;b=J[d+28>>2];J[g>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;b=$(170,J[a+16>>2])|0;c=J[5996];J[5996]=0;a:{b:{if((c|0)==1){break b}J[5996]=0;ga(195,b|0,12416,12442,a+208|0);b=J[5996];J[5996]=0;if((b|0)==1){break b}b=J[a+16>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}c=a+184|0;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;b=(K[c+11|0]&128)>>>7|0?(J[c+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,c|0,b|0);b=J[5996];J[5996]=0;if((b|0)!=1){c:{b=(K[c+11|0]&128)>>>7|0?J[c>>2]:c;J[a+180>>2]=b;J[a+12>>2]=g;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(186,a+252|0,a+248|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break d}d=J[a+180>>2];e:{if(!g){g=d;d=K[c+11|0];d=(d&128)>>>7|0?J[c+4>>2]:d&127;if((g|0)==(d+b|0)){J[5996]=0;aa(172,c|0,d<<1);b=J[5996];J[5996]=0;if((b|0)==1){break c}b=(K[c+11|0]&128)>>>7|0?(J[c+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,c|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break c}b=(K[c+11|0]&128)>>>7|0?J[c>>2]:c;J[a+180>>2]=d+b;}J[5996]=0;d=$(187,J[a+252>>2])|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(!Dc(d,16,b,a+180|0,a+8|0,0,J[h+4>>2],K[h+11|0],a+16|0,a+12|0,a+208|0)){break e}d=J[a+180>>2];}J[5996]=0;aa(172,c|0,d-b|0);b=J[5996];J[5996]=0;if((b|0)==1){break d}b=J[c>>2];d=(K[c+11|0]&128)>>>7|0;g=jb();J[a>>2]=f;if((Kf(d?b:c,g,a)|0)!=1){J[e>>2]=4;}J[5996]=0;b=_(186,a+252|0,a+248|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break d}if(b){J[e>>2]=J[e>>2]|2;}b=J[a+252>>2];ab(c);ab(h);Ua=a+256|0;return b|0}J[5996]=0;$(189,a+252|0)|0;d=J[5996];J[5996]=0;if((d|0)!=1){continue}}break}}}b=Z()|0;ab(c);break a}b=Z()|0;a=J[a+16>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}}ab(h);da(b|0);B();}function jl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a=Ua-320|0;Ua=a;J[a+312>>2]=c;J[a+316>>2]=b;h=a+196|0;J[h>>2]=0;J[h+4>>2]=0;J[h+8>>2]=0;g=a+16|0;b=J[d+28>>2];J[g>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;b=$(197,J[a+16>>2])|0;c=J[5996];J[5996]=0;a:{b:{if((c|0)==1){break b}J[5996]=0;ga(208,b|0,12416,12442,a+208|0);b=J[5996];J[5996]=0;if((b|0)==1){break b}b=J[a+16>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}c=a+184|0;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;b=(K[c+11|0]&128)>>>7|0?(J[c+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,c|0,b|0);b=J[5996];J[5996]=0;if((b|0)!=1){c:{b=(K[c+11|0]&128)>>>7|0?J[c>>2]:c;J[a+180>>2]=b;J[a+12>>2]=g;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(202,a+316|0,a+312|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break d}d=J[a+180>>2];e:{if(!g){g=d;d=K[c+11|0];d=(d&128)>>>7|0?J[c+4>>2]:d&127;if((g|0)==(d+b|0)){J[5996]=0;aa(172,c|0,d<<1);b=J[5996];J[5996]=0;if((b|0)==1){break c}b=(K[c+11|0]&128)>>>7|0?(J[c+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,c|0,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break c}b=(K[c+11|0]&128)>>>7|0?J[c>>2]:c;J[a+180>>2]=d+b;}J[5996]=0;d=$(203,J[a+316>>2])|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(!Cc(d,16,b,a+180|0,a+8|0,0,J[h+4>>2],K[h+11|0],a+16|0,a+12|0,a+208|0)){break e}d=J[a+180>>2];}J[5996]=0;aa(172,c|0,d-b|0);b=J[5996];J[5996]=0;if((b|0)==1){break d}b=J[c>>2];d=(K[c+11|0]&128)>>>7|0;g=jb();J[a>>2]=f;if((Kf(d?b:c,g,a)|0)!=1){J[e>>2]=4;}J[5996]=0;b=_(202,a+316|0,a+312|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break d}if(b){J[e>>2]=J[e>>2]|2;}b=J[a+316>>2];ab(c);ab(h);Ua=a+320|0;return b|0}J[5996]=0;$(205,a+316|0)|0;d=J[5996];J[5996]=0;if((d|0)!=1){continue}}break}}}b=Z()|0;ab(c);break a}b=Z()|0;a=J[a+16>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}}ab(h);da(b|0);B();}function ek(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;a=Ua-480|0;Ua=a;g=J[d+28>>2];J[a+476>>2]=g;J[g+4>>2]=J[g+4>>2]+1;J[5996]=0;o=$(197,J[a+476>>2])|0;g=J[5996];J[5996]=0;a:{b:{c:{d:{e:{if((g|0)!=1){i=K[f+11|0];g=(i&128)>>>7|0;if(g?J[f+4>>2]:i&127){g=J[(g?J[f>>2]:f)>>2];J[5996]=0;i=_(216,o|0,45)|0;k=J[5996];J[5996]=0;if((k|0)==1){break e}p=(g|0)==(i|0);}k=a+452|0;J[k>>2]=0;J[k+4>>2]=0;J[k+8>>2]=0;g=a+440|0;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;i=a+428|0;J[i>>2]=0;J[i+4>>2]=0;J[i+8>>2]=0;J[5996]=0;sa(238,c|0,p|0,J[a+476>>2],a+472|0,a+468|0,a+464|0,k|0,g|0,i|0,a+424|0);c=J[5996];J[5996]=0;if((c|0)==1){break d}J[a+4>>2]=184;l=a+8|0;J[l>>2]=0;J[l+4>>2]=J[a+4>>2];c=a+16|0;j=K[f+11|0];j=(j&128)>>>7|0?J[f+4>>2]:j&127;m=J[a+424>>2];f:{if((j|0)>(m|0)){h=K[i+11|0];n=(j-m<<1)+((h&128)>>>7|0?J[i+4>>2]:h&127)|0;h=K[g+11|0];h=(n+((h&128)>>>7|0?J[g+4>>2]:h&127)|0)+1|0;break f}h=K[i+11|0];n=(h&128)>>>7|0?J[i+4>>2]:h&127;h=K[g+11|0];h=(n+((h&128)>>>7|0?J[g+4>>2]:h&127)|0)+2|0;}g:{h=h+m|0;if(h>>>0>=101){tb(l,sb(h<<2));c=J[l>>2];if(!c){break g}j=K[f+11|0];j=(j&128)>>>7|0?J[f+4>>2]:j&127;}h=J[d+4>>2];f=(K[f+11|0]&128)>>>7|0?J[f>>2]:f;J[5996]=0;ta(239,c|0,a+4|0,a|0,h|0,f|0,f+(j<<2)|0,o|0,p|0,a+472|0,J[a+468>>2],J[a+464>>2],k|0,g|0,i|0,m|0);f=J[5996];J[5996]=0;if((f|0)==1){break c}J[5996]=0;d=ka(219,b|0,c|0,J[a+4>>2],J[a>>2],d|0,e|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break c}db(l);ab(i);ab(g);ab(k);b=J[a+476>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}Ua=a+480|0;return d|0}J[5996]=0;ca(185);b=J[5996];J[5996]=0;if((b|0)==1){break c}B();}f=Z()|0;break a}f=Z()|0;break a}f=Z()|0;break b}f=Z()|0;db(l);}ab(i);ab(g);ab(k);}a=J[a+476>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(f|0);B();}function ik(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;a=Ua-176|0;Ua=a;g=J[d+28>>2];J[a+172>>2]=g;J[g+4>>2]=J[g+4>>2]+1;J[5996]=0;o=$(170,J[a+172>>2])|0;g=J[5996];J[5996]=0;a:{b:{c:{d:{e:{if((g|0)!=1){i=K[f+11|0];g=(i&128)>>>7|0;if(g?J[f+4>>2]:i&127){g=K[(g?J[f>>2]:f)|0];J[5996]=0;i=_(171,o|0,45)|0;k=J[5996];J[5996]=0;if((k|0)==1){break e}p=(i&255)==(g|0);}k=a+152|0;J[k>>2]=0;J[k+4>>2]=0;J[k+8>>2]=0;g=a+140|0;J[g>>2]=0;J[g+4>>2]=0;J[g+8>>2]=0;i=a+128|0;J[i>>2]=0;J[i+4>>2]=0;J[i+8>>2]=0;J[5996]=0;sa(236,c|0,p|0,J[a+172>>2],a+168|0,a+167|0,a+166|0,k|0,g|0,i|0,a+124|0);c=J[5996];J[5996]=0;if((c|0)==1){break d}J[a+4>>2]=184;l=a+8|0;J[l>>2]=0;J[l+4>>2]=J[a+4>>2];c=a+16|0;j=K[f+11|0];j=(j&128)>>>7|0?J[f+4>>2]:j&127;m=J[a+124>>2];f:{if((j|0)>(m|0)){h=K[i+11|0];n=(j-m<<1)+((h&128)>>>7|0?J[i+4>>2]:h&127)|0;h=K[g+11|0];h=(n+((h&128)>>>7|0?J[g+4>>2]:h&127)|0)+1|0;break f}h=K[i+11|0];n=(h&128)>>>7|0?J[i+4>>2]:h&127;h=K[g+11|0];h=(n+((h&128)>>>7|0?J[g+4>>2]:h&127)|0)+2|0;}g:{h=h+m|0;if(h>>>0>=101){tb(l,sb(h));c=J[l>>2];if(!c){break g}j=K[f+11|0];j=(j&128)>>>7|0?J[f+4>>2]:j&127;}h=J[d+4>>2];f=(K[f+11|0]&128)>>>7|0?J[f>>2]:f;J[5996]=0;ta(237,c|0,a+4|0,a|0,h|0,f|0,f+j|0,o|0,p|0,a+168|0,H[a+167|0],H[a+166|0],k|0,g|0,i|0,m|0);f=J[5996];J[5996]=0;if((f|0)==1){break c}J[5996]=0;d=ka(213,b|0,c|0,J[a+4>>2],J[a>>2],d|0,e|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break c}db(l);ab(i);ab(g);ab(k);b=J[a+172>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}Ua=a+176|0;return d|0}J[5996]=0;ca(185);b=J[5996];J[5996]=0;if((b|0)==1){break c}B();}f=Z()|0;break a}f=Z()|0;break a}f=Z()|0;break b}f=Z()|0;db(l);}ab(i);ab(g);ab(k);}a=J[a+172>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(f|0);B();}function fk(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;J[c>>2]=a;v=d&512;w=h<<2;while(1){if((u|0)==4){e=K[n+11|0];if(((e&128)>>>7|0?J[n+4>>2]:e&127)>>>0>1){J[c>>2]=mf(Rd(Mb(n),1),qc(n),J[c>>2]);}d=d&176;if((d|0)!=16){if((d|0)==32){a=J[c>>2];}J[b>>2]=a;}}else {a:{b:{switch(H[i+u|0]){case 0:J[b>>2]=J[c>>2];break a;case 1:J[b>>2]=J[c>>2];h=Xa[J[J[g>>2]+44>>2]](g,32)|0;p=J[c>>2];J[c>>2]=p+4;J[p>>2]=h;break a;case 3:h=K[n+11|0];r=h&127;h=(h&128)>>>7|0;if(!(h?J[n+4>>2]:r)){break a}h=J[(h?J[n>>2]:n)>>2];p=J[c>>2];J[c>>2]=p+4;J[p>>2]=h;break a;case 2:if(!v){break a}h=K[m+11|0];if(!((h&128)>>>7|0?J[m+4>>2]:h&127)){break a}J[c>>2]=mf(Mb(m),qc(m),J[c>>2]);break a;case 4:break b;default:break a}}x=J[c>>2];e=e+w|0;h=e;while(1){c:{if(f>>>0<=h>>>0){break c}if(!(Xa[J[J[g>>2]+12>>2]](g,64,J[h>>2])|0)){break c}h=h+4|0;continue}break}if((o|0)>0){p=J[c>>2];q=o;while(1){if(!(!q|e>>>0>=h>>>0)){q=q-1|0;h=h-4|0;s=J[h>>2];r=p+4|0;J[c>>2]=r;J[p>>2]=s;p=r;continue}break}d:{if(!q){s=0;break d}s=Xa[J[J[g>>2]+44>>2]](g,48)|0;p=J[c>>2];}while(1){r=p+4|0;if((q|0)>0){J[p>>2]=s;q=q-1|0;p=r;continue}break}J[c>>2]=r;J[p>>2]=j;}e:{if((e|0)==(h|0)){p=Xa[J[J[g>>2]+44>>2]](g,48)|0;q=J[c>>2];h=q+4|0;J[c>>2]=h;J[q>>2]=p;break e}s=-1;p=K[l+11|0];r=(p&128)>>>7|0;if(r?J[l+4>>2]:p&127){s=H[(r?J[l>>2]:l)|0];}q=0;t=0;while(1){if((e|0)!=(h|0)){r=J[c>>2];f:{if((q|0)!=(s|0)){p=r;r=q;break f}p=r+4|0;J[c>>2]=p;J[r>>2]=k;r=0;t=t+1|0;s=K[l+11|0];if(t>>>0>=((s&128)>>>7|0?J[l+4>>2]:s&127)>>>0){s=q;break f}s=-1;q=((K[l+11|0]&128)>>>7|0?J[l>>2]:l)+t|0;if(K[q|0]==127){break f}s=H[q|0];}h=h-4|0;q=J[h>>2];J[c>>2]=p+4;J[p>>2]=q;q=r+1|0;continue}break}h=J[c>>2];}md(x,h);}u=u+1|0;continue}break}}function jk(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;J[c>>2]=a;w=d&512;while(1){if((u|0)==4){e=K[n+11|0];if(((e&128)>>>7|0?J[n+4>>2]:e&127)>>>0>1){J[c>>2]=nf(Td(Mb(n),1),sc(n),J[c>>2]);}d=d&176;if((d|0)!=16){if((d|0)==32){a=J[c>>2];}J[b>>2]=a;}}else {a:{b:{switch(H[i+u|0]){case 0:J[b>>2]=J[c>>2];break a;case 1:J[b>>2]=J[c>>2];p=Xa[J[J[g>>2]+28>>2]](g,32)|0;q=J[c>>2];J[c>>2]=q+1;H[q|0]=p;break a;case 3:p=K[n+11|0];q=(p&128)>>>7|0;if(!(q?J[n+4>>2]:p&127)){break a}p=K[(q?J[n>>2]:n)|0];q=J[c>>2];J[c>>2]=q+1;H[q|0]=p;break a;case 2:if(!w){break a}p=K[m+11|0];if(!((p&128)>>>7|0?J[m+4>>2]:p&127)){break a}J[c>>2]=nf(Mb(m),sc(m),J[c>>2]);break a;case 4:break b;default:break a}}q=J[g+8>>2];x=J[c>>2];e=e+h|0;r=e;while(1){c:{if(f>>>0<=r>>>0){break c}p=H[r|0];if((p|0)>=0){p=(J[q+((p&255)<<2)>>2]&64)!=0;}else {p=0;}if(!p){break c}r=r+1|0;continue}break}p=o;if((p|0)>0){while(1){if(!(!p|e>>>0>=r>>>0)){p=p-1|0;r=r-1|0;q=K[r|0];s=J[c>>2];J[c>>2]=s+1;H[s|0]=q;continue}break}if(p){q=Xa[J[J[g>>2]+28>>2]](g,48)|0;}else {q=0;}while(1){s=J[c>>2];J[c>>2]=s+1;if((p|0)>0){H[s|0]=q;p=p-1|0;continue}break}H[s|0]=j;}d:{if((e|0)==(r|0)){p=Xa[J[J[g>>2]+28>>2]](g,48)|0;q=J[c>>2];J[c>>2]=q+1;H[q|0]=p;break d}q=-1;p=K[l+11|0];s=p&127;p=(p&128)>>>7|0;if(p?J[l+4>>2]:s){q=H[(p?J[l>>2]:l)|0];}p=0;t=0;while(1){if((e|0)==(r|0)){break d}e:{if((p|0)!=(q|0)){s=p;break e}q=J[c>>2];J[c>>2]=q+1;H[q|0]=k;s=0;t=t+1|0;q=K[l+11|0];if(t>>>0>=((q&128)>>>7|0?J[l+4>>2]:q&127)>>>0){q=p;break e}q=-1;p=((K[l+11|0]&128)>>>7|0?J[l>>2]:l)+t|0;if(K[p|0]==127){break e}q=H[p|0];}r=r-1|0;p=K[r|0];v=J[c>>2];J[c>>2]=v+1;H[v|0]=p;p=s+1|0;continue}}vc(x,J[c>>2]);}u=u+1|0;continue}break}}function Fi(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;r=Ua-16|0;Ua=r;j=c;while(1){a:{if((d|0)==(j|0)){j=d;break a}if(!K[j|0]){break a}j=j+1|0;continue}break}J[h>>2]=f;J[e>>2]=c;while(1){b:{c:{d:{if((c|0)==(d|0)|(f|0)==(g|0)){break d}i=J[b+4>>2];J[r+8>>2]=J[b>>2];J[r+12>>2]=i;s=Ua-16|0;Ua=s;v=Xb(s+12|0,J[a+8>>2]);m=j-c|0;k=0;n=0;o=Ua-1040|0;Ua=o;q=J[e>>2];J[o+12>>2]=q;p=f?f:o+16|0;l=f?g-f>>2:256;e:{f:{g:{if(!(!q|!l)){while(1){i=m>>>2|0;if(!(m>>>0>131|i>>>0>=l>>>0)){i=q;break f}t=bg(p,o+12|0,i>>>0<l>>>0?i:l,b);i=J[o+12>>2];if((t|0)==-1){l=0;k=-1;break g}u=(o+16|0)!=(p|0)?t:0;l=l-u|0;p=(u<<2)+p|0;m=i?(m+q|0)-i|0:0;k=k+t|0;if(!i){break g}q=i;if(l){continue}break}break g}i=q;}if(!i){break e}}if(!(!l|!m)){n=i;i=k;while(1){h:{k=qd(p,n,m,b);i:{if(k+2>>>0<=2){j:{switch(k+1|0){case 1:n=0;break i;case 0:break e;default:break j}}J[b>>2]=0;break i}n=k+n|0;J[o+12>>2]=n;i=i+1|0;l=l-1|0;if(l){break h}}k=i;break e}p=p+4|0;m=m-k|0;k=i;if(m){continue}break}break e}n=i;}if(f){J[e>>2]=n;}Ua=o+1040|0;i=J[v>>2];if(i){J[6178]=(i|0)==-1?24816:i;}Ua=s+16|0;k:{l:{m:{n:{if((k|0)==-1){while(1){o:{J[h>>2]=f;if(J[e>>2]==(c|0)){break o}g=1;p:{q:{r:{b=Me(f,c,j-c|0,r+8|0,J[a+8>>2]);switch(b+2|0){case 0:break l;case 2:break p;case 1:break r;default:break q}}J[e>>2]=c;break n}g=b;}c=c+g|0;f=J[h>>2]+4|0;continue}break}J[e>>2]=c;break d}f=J[h>>2]+(k<<2)|0;J[h>>2]=f;if((f|0)==(g|0)){break k}c=J[e>>2];if((d|0)==(j|0)){j=d;continue}if(!Me(f,c,1,b,J[a+8>>2])){break m}}a=2;break c}J[h>>2]=J[h>>2]+4;c=J[e>>2]+1|0;J[e>>2]=c;j=c;while(1){if((d|0)==(j|0)){j=d;break b}if(!K[j|0]){break b}j=j+1|0;continue}}J[e>>2]=c;a=1;break c}c=J[e>>2];}a=(c|0)!=(d|0);}Ua=r+16|0;return a|0}f=J[h>>2];continue}}function nd(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;j=Ua-128|0;Ua=j;J[j+124>>2]=b;J[j+4>>2]=184;b=j+8|0;J[b>>2]=0;J[b+4>>2]=J[j+4>>2];o=b;k=j+16|0;l=(d-c|0)/12|0;a:{b:{if(l>>>0>=101){k=sb(l);if(!k){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break b}tb(o,k);}h=k;b=c;c:{d:{while(1){if((b|0)==(d|0)){e:while(1){f:{J[5996]=0;h=_(186,a|0,j+124|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break f}if((!l|h)==1){J[5996]=0;b=_(186,a|0,j+124|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break c}if(!b){break d}J[f>>2]=J[f>>2]|2;break d}b=J[a>>2];J[5996]=0;p=$(187,b|0)|0;b=J[5996];J[5996]=0;g:{if((b|0)!=1){if(g){break g}J[5996]=0;p=_(188,e|0,p|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break g}}break b}i=q+1|0;s=0;h=k;b=c;while(1){if((b|0)==(d|0)){q=i;if(!s){continue e}J[5996]=0;$(189,a|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){h=k;b=c;if(l+m>>>0<2){continue e}while(1){if((b|0)==(d|0)){continue e}h:{if(K[h|0]!=2){break h}i=K[b+11|0];if((((i&128)>>>7|0?J[b+4>>2]:i&127)|0)==(q|0)){break h}H[h|0]=0;m=m-1|0;}h=h+1|0;b=b+12|0;continue}}break b}i:{if(K[h|0]!=1){break i}r=K[((K[b+11|0]&128)>>>7|0?J[b>>2]:b)+q|0];j:{if(g){break j}J[5996]=0;r=_(188,e|0,r<<24>>24)|0;n=J[5996];J[5996]=0;if((n|0)!=1){break j}break b}k:{if((p&255)==(r&255)){s=1;n=K[b+11|0];if((i|0)!=(((n&128)>>>7|0?J[b+4>>2]:n&127)|0)){break i}H[h|0]=2;m=m+1|0;break k}H[h|0]=0;}l=l-1|0;}h=h+1|0;b=b+12|0;continue}}break}}else {i=K[b+11|0];i=!((i&128)>>>7|0?J[b+4>>2]:i&127);H[h|0]=i?2:1;m=i+m|0;l=l-i|0;h=h+1|0;b=b+12|0;continue}break}break b}l:{m:{while(1){if((c|0)==(d|0)){break m}if(K[k|0]!=2){k=k+1|0;c=c+12|0;continue}break}d=c;break l}J[f>>2]=J[f>>2]|4;}db(o);Ua=j+128|0;return d|0}}a=Z()|0;db(o);da(a|0);}B();}function ld(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;j=Ua-128|0;Ua=j;J[j+124>>2]=b;J[j+4>>2]=184;b=j+8|0;J[b>>2]=0;J[b+4>>2]=J[j+4>>2];o=b;k=j+16|0;l=(d-c|0)/12|0;a:{b:{if(l>>>0>=101){k=sb(l);if(!k){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break b}tb(o,k);}h=k;b=c;c:{d:{while(1){if((b|0)==(d|0)){e:while(1){f:{J[5996]=0;h=_(202,a|0,j+124|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break f}if((!l|h)==1){J[5996]=0;b=_(202,a|0,j+124|0)|0;a=J[5996];J[5996]=0;if((a|0)==1){break c}if(!b){break d}J[f>>2]=J[f>>2]|2;break d}b=J[a>>2];J[5996]=0;p=$(203,b|0)|0;b=J[5996];J[5996]=0;g:{if((b|0)!=1){if(g){break g}J[5996]=0;p=_(204,e|0,p|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){break g}}break b}i=q+1|0;s=0;h=k;b=c;while(1){if((b|0)==(d|0)){q=i;if(!s){continue e}J[5996]=0;$(205,a|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){h=k;b=c;if(l+m>>>0<2){continue e}while(1){if((b|0)==(d|0)){continue e}h:{if(K[h|0]!=2){break h}i=K[b+11|0];if((((i&128)>>>7|0?J[b+4>>2]:i&127)|0)==(q|0)){break h}H[h|0]=0;m=m-1|0;}h=h+1|0;b=b+12|0;continue}}break b}i:{if(K[h|0]!=1){break i}r=J[(q<<2)+((K[b+11|0]&128)>>>7|0?J[b>>2]:b)>>2];j:{if(g){break j}J[5996]=0;r=_(204,e|0,r|0)|0;n=J[5996];J[5996]=0;if((n|0)!=1){break j}break b}k:{if((p|0)==(r|0)){s=1;n=K[b+11|0];if((i|0)!=(((n&128)>>>7|0?J[b+4>>2]:n&127)|0)){break i}H[h|0]=2;m=m+1|0;break k}H[h|0]=0;}l=l-1|0;}h=h+1|0;b=b+12|0;continue}}break}}else {i=K[b+11|0];i=!((i&128)>>>7|0?J[b+4>>2]:i&127);H[h|0]=i?2:1;m=i+m|0;l=l-i|0;h=h+1|0;b=b+12|0;continue}break}break b}l:{m:{while(1){if((c|0)==(d|0)){break m}if(K[k|0]!=2){k=k+1|0;c=c+12|0;continue}break}d=c;break l}J[f>>2]=J[f>>2]|4;}db(o);Ua=j+128|0;return d|0}}a=Z()|0;db(o);da(a|0);}B();}function uk(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;h=Ua-624|0;Ua=h;J[h+616>>2]=c;J[h+620>>2]=b;J[h+16>>2]=220;i=h+200|0;J[i>>2]=h+208;a=h+16|0;J[i+4>>2]=J[a>>2];j=h+192|0;b=J[e+28>>2];J[j>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;k=$(197,J[h+192>>2])|0;b=J[5996];J[5996]=0;a:{b:{c:{d:{e:{f:{g:{if((b|0)!=1){H[h+191|0]=0;b=J[e+4>>2];J[5996]=0;b=ua(228,h+620|0,c|0,d|0,j|0,b|0,f|0,h+191|0,k|0,i|0,h+196|0,h+608|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break d}if(!b){break e}b=K[3833]|K[3834]<<8|(K[3835]<<16|K[3836]<<24);H[h+183|0]=b;H[h+184|0]=b>>>8;H[h+185|0]=b>>>16;H[h+186|0]=b>>>24;b=K[3830]|K[3831]<<8|(K[3832]<<16|K[3833]<<24);J[h+176>>2]=K[3826]|K[3827]<<8|(K[3828]<<16|K[3829]<<24);J[h+180>>2]=b;J[5996]=0;ga(208,k|0,h+176|0,h+186|0,h+128|0);b=J[5996];J[5996]=0;if((b|0)==1){break g}J[h+4>>2]=184;d=h+8|0;J[d>>2]=0;J[d+4>>2]=J[h+4>>2];e=a;b=J[h+196>>2];a=b-J[i>>2]|0;if((a|0)<393){break f}tb(d,sb((a>>2)+2|0));e=J[d>>2];if(e){break f}J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)==1){break c}break a}c=Z()|0;break b}c=Z()|0;break b}if(K[h+191|0]){H[e|0]=45;e=e+1|0;}c=J[i>>2];while(1){if(b>>>0<=c>>>0){H[e|0]=0;J[h>>2]=g;if((eg(h+16|0,h)|0)!=1){J[5996]=0;ha(222,1730);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break c}db(d);}else {a=h+128|0;H[e|0]=K[(h+176|0)+(Yd(a,a+40|0,J[c>>2])-a>>2)|0];e=e+1|0;c=c+4|0;b=J[h+196>>2];continue}break}}J[5996]=0;a=_(202,h+620|0,h+616|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break d}if(a){J[f>>2]=J[f>>2]|2;}c=J[h+620>>2];a=J[h+192>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}db(i);Ua=h+624|0;return c|0}c=Z()|0;break b}c=Z()|0;db(d);}a=J[h+192>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}db(i);da(c|0);B();}B();}function vj(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=J[a+4>>2];c=J[a>>2];d=e-c>>2;if(d>>>0<b>>>0){h=Ua-32|0;Ua=h;f=b-d|0;a:{if(f>>>0<=J[a+8>>2]-e>>2>>>0){ff(a,f);break a}g=a+16|0;d=h+12|0;c=Ua-16|0;Ua=c;e=f+(e-J[a>>2]>>2)|0;J[c+12>>2]=e;b:{b=_e();if(e>>>0<=b>>>0){e=J[a+8>>2]-J[a>>2]>>2;if(e>>>0<b>>>1>>>0){J[c+8>>2]=e<<1;b=J[(M[c+8>>2]<M[c+12>>2]?c+12|0:c+8|0)>>2];}Ua=c+16|0;break b}nb();B();}i=J[a+4>>2]-J[a>>2]>>2;e=Ua-16|0;Ua=e;J[d+12>>2]=0;J[d+16>>2]=g;c:{if(!b){c=0;b=0;break c}Ze(e+8|0,J[d+16>>2],b);c=J[e+8>>2];b=J[e+12>>2];}J[d>>2]=c;g=c+(i<<2)|0;J[d+8>>2]=g;J[d+4>>2]=g;J[d+12>>2]=c+(b<<2);Ua=e+16|0;c=Ua-16|0;Ua=c;J[c+4>>2]=J[d+8>>2];b=J[d+8>>2];J[c+12>>2]=d+8;J[c+8>>2]=b+(f<<2);b=J[c+4>>2];while(1){if(J[c+8>>2]!=(b|0)){J[b>>2]=0;b=J[c+4>>2]+4|0;J[c+4>>2]=b;continue}break}J[J[c+12>>2]>>2]=J[c+4>>2];Ua=c+16|0;e=Ua-16|0;Ua=e;J[e+12>>2]=J[a+4>>2];J[e+8>>2]=J[a>>2];J[e+4>>2]=J[d+4>>2];f=J[e+12>>2];i=J[e+4>>2];g=Ua-16|0;Ua=g;b=Ua-32|0;Ua=b;c=Ua-16|0;Ua=c;J[c+12>>2]=J[e+8>>2];J[b+24>>2]=f;J[b+28>>2]=J[c+12>>2];Ua=c+16|0;f=J[b+24>>2];j=J[b+28>>2];c=Ua-16|0;Ua=c;J[c+8>>2]=i;J[c+12>>2]=f;while(1){if((f|0)!=(j|0)){J[J[c+8>>2]-4>>2]=J[f-4>>2];J[c+12>>2]=J[c+12>>2]-4;J[c+8>>2]=J[c+8>>2]-4;f=J[c+12>>2];continue}break}J[b+16>>2]=f;J[b+20>>2]=J[c+8>>2];Ua=c+16|0;c=J[b+16>>2];J[b+12>>2]=J[b+20>>2];J[g+8>>2]=c;J[g+12>>2]=J[b+12>>2];Ua=b+32|0;Ua=g+16|0;J[d+4>>2]=J[g+12>>2];b=J[a>>2];J[a>>2]=J[d+4>>2];J[d+4>>2]=b;b=J[a+4>>2];J[a+4>>2]=J[d+8>>2];J[d+8>>2]=b;b=J[a+8>>2];J[a+8>>2]=J[d+12>>2];J[d+12>>2]=b;J[d>>2]=J[d+4>>2];Ua=e+16|0;b=J[d+4>>2];a=J[d+8>>2];while(1){if((a|0)!=(b|0)){a=a-4|0;J[d+8>>2]=a;continue}break}a=J[d>>2];if(a){bf(J[d+16>>2],a);}}Ua=h+32|0;return}if(b>>>0<d>>>0){af(a,c+(b<<2)|0);}}function Bk(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;h=Ua-272|0;Ua=h;J[h+264>>2]=c;J[h+268>>2]=b;J[h+16>>2]=220;i=h+152|0;J[i>>2]=h+160;a=h+16|0;J[i+4>>2]=J[a>>2];j=h+144|0;b=J[e+28>>2];J[j>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;k=$(170,J[h+144>>2])|0;b=J[5996];J[5996]=0;a:{b:{c:{d:{e:{f:{g:{if((b|0)!=1){H[h+143|0]=0;b=J[e+4>>2];J[5996]=0;b=ua(221,h+268|0,c|0,d|0,j|0,b|0,f|0,h+143|0,k|0,i|0,h+148|0,h+260|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break d}if(!b){break e}b=K[3833]|K[3834]<<8|(K[3835]<<16|K[3836]<<24);H[h+135|0]=b;H[h+136|0]=b>>>8;H[h+137|0]=b>>>16;H[h+138|0]=b>>>24;b=K[3830]|K[3831]<<8|(K[3832]<<16|K[3833]<<24);J[h+128>>2]=K[3826]|K[3827]<<8|(K[3828]<<16|K[3829]<<24);J[h+132>>2]=b;J[5996]=0;ga(195,k|0,h+128|0,h+138|0,h+118|0);b=J[5996];J[5996]=0;if((b|0)==1){break g}J[h+4>>2]=184;d=h+8|0;J[d>>2]=0;J[d+4>>2]=J[h+4>>2];e=a;b=J[h+148>>2];a=b-J[i>>2]|0;if((a|0)<99){break f}tb(d,sb(a+2|0));e=J[d>>2];if(e){break f}J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)==1){break c}break a}c=Z()|0;break b}c=Z()|0;break b}if(K[h+143|0]){H[e|0]=45;e=e+1|0;}c=J[i>>2];while(1){if(b>>>0<=c>>>0){H[e|0]=0;J[h>>2]=g;if((eg(h+16|0,h)|0)!=1){J[5996]=0;ha(222,1730);a=J[5996];J[5996]=0;if((a|0)!=1){break a}break c}db(d);}else {a=h+118|0;H[e|0]=K[((be(a,a+10|0,K[c|0])-h|0)+h|0)+10|0];e=e+1|0;c=c+1|0;b=J[h+148>>2];continue}break}}J[5996]=0;a=_(186,h+268|0,h+264|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break d}if(a){J[f>>2]=J[f>>2]|2;}c=J[h+268>>2];a=J[h+144>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}db(i);Ua=h+272|0;return c|0}c=Z()|0;break b}c=Z()|0;db(d);}a=J[h+144>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}db(i);da(c|0);B();}B();}function vl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;d=J[d+28>>2];a=Ua-272|0;Ua=a;J[a+264>>2]=c;J[a+268>>2]=b;$d(a+208|0,d,a+224|0,a+223|0,a+222|0);d=a+196|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;b=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,b|0);b=J[5996];J[5996]=0;a:{b:{c:{if((b|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+192>>2]=c;J[a+28>>2]=a+32;J[a+24>>2]=0;H[a+23|0]=1;H[a+22|0]=69;g=K[a+222|0]<<24>>24;i=K[a+223|0]<<24>>24;while(1){d:{J[5996]=0;b=_(186,a+268|0,a+264|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(b){break c}b=K[d+11|0];b=(b&128)>>>7|0?J[d+4>>2]:b&127;if(J[a+192>>2]==(b+c|0)){J[5996]=0;aa(172,d|0,b<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+192>>2]=b+c;}J[5996]=0;b=$(187,J[a+268>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(_d(b,a+23|0,a+22|0,c,a+192|0,i,g,a+208|0,a+32|0,a+28|0,a+24|0,a+224|0)){break c}J[5996]=0;$(189,a+268|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){continue}}break}break b}break b}b=K[a+219|0];e:{if(!((b&128)>>>7|0?J[a+212>>2]:b&127)|!K[a+23|0]){break e}b=J[a+28>>2];if((b-(a+32|0)|0)>159){break e}J[a+28>>2]=b+4;J[b>>2]=J[a+24>>2];}Lf(a,c,J[a+192>>2],e);b=J[a>>2];c=J[a+4>>2];g=J[a+12>>2];J[f+8>>2]=J[a+8>>2];J[f+12>>2]=g;J[f>>2]=b;J[f+4>>2]=c;zb(a+208|0,a+32|0,J[a+28>>2],e);J[5996]=0;b=_(186,a+268|0,a+264|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+268>>2];ab(d);ab(a+208|0);Ua=a+272|0;break a}}b=Z()|0;ab(d);ab(a+208|0);da(b|0);B();}return b|0}function kl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;d=J[d+28>>2];a=Ua-384|0;Ua=a;J[a+376>>2]=c;J[a+380>>2]=b;Xd(a+220|0,d,a+240|0,a+236|0,a+232|0);d=a+208|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;b=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,b|0);b=J[5996];J[5996]=0;a:{b:{c:{if((b|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+204>>2]=c;J[a+28>>2]=a+32;J[a+24>>2]=0;H[a+23|0]=1;H[a+22|0]=69;g=J[a+232>>2];i=J[a+236>>2];while(1){d:{J[5996]=0;b=_(202,a+380|0,a+376|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(b){break c}b=K[d+11|0];b=(b&128)>>>7|0?J[d+4>>2]:b&127;if(J[a+204>>2]==(b+c|0)){J[5996]=0;aa(172,d|0,b<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+204>>2]=b+c;}J[5996]=0;b=$(203,J[a+380>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Wd(b,a+23|0,a+22|0,c,a+204|0,i,g,a+220|0,a+32|0,a+28|0,a+24|0,a+240|0)){break c}J[5996]=0;$(205,a+380|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){continue}}break}break b}break b}b=K[a+231|0];e:{if(!((b&128)>>>7|0?J[a+224>>2]:b&127)|!K[a+23|0]){break e}b=J[a+28>>2];if((b-(a+32|0)|0)>159){break e}J[a+28>>2]=b+4;J[b>>2]=J[a+24>>2];}Lf(a,c,J[a+204>>2],e);b=J[a>>2];c=J[a+4>>2];g=J[a+12>>2];J[f+8>>2]=J[a+8>>2];J[f+12>>2]=g;J[f>>2]=b;J[f+4>>2]=c;zb(a+220|0,a+32|0,J[a+28>>2],e);J[5996]=0;b=_(202,a+380|0,a+376|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+380>>2];ab(d);ab(a+220|0);Ua=a+384|0;break a}}b=Z()|0;ab(d);ab(a+220|0);da(b|0);B();}return b|0}function al(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0;n=b;i=Ua-256|0;Ua=i;J[i+248>>2]=37;J[i+252>>2]=0;b=i+248|0;l=kd(b|1,3264,J[c+4>>2]);j=i+208|0;J[i+204>>2]=j;a=jb();a:{if(l){k=J[c+8>>2];m=i- -64|0;J[m>>2]=g;J[m+4>>2]=h;J[i+56>>2]=e;J[i+60>>2]=f;J[i+48>>2]=k;j=yb(j,30,a,b,i+48|0);break a}J[i+80>>2]=e;J[i+84>>2]=f;J[i+88>>2]=g;J[i+92>>2]=h;j=yb(i+208|0,30,a,i+248|0,i+80|0);}J[i+128>>2]=184;k=i+196|0;J[k>>2]=0;J[k+4>>2]=J[i+128>>2];b=i+208|0;a=b;b:{c:{d:{e:{if((j|0)>=30){a=jb();f:{if(l){j=J[c+8>>2];J[i+16>>2]=g;J[i+20>>2]=h;J[i+8>>2]=e;J[i+12>>2]=f;J[i>>2]=j;j=dc(i+204|0,a,i+248|0,i);break f}J[i+32>>2]=e;J[i+36>>2]=f;J[i+40>>2]=g;J[i+44>>2]=h;j=dc(i+204|0,a,i+248|0,i+32|0);}if((j|0)==-1){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)==1){break d}break e}a=J[i+204>>2];tb(k,a);}g=a+j|0;h=Lb(a,g,J[c+4>>2]);J[i+116>>2]=184;e=i+120|0;J[e>>2]=0;J[e+4>>2]=J[i+116>>2];g:{h:{if((i+208|0)==(a|0)){j=i+128|0;break h}j=sb(j<<1);if(!j){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)!=1){break e}a=Z()|0;break g}tb(e,j);b=a;}a=i+108|0;f=J[c+28>>2];J[a>>2]=f;J[f+4>>2]=J[f+4>>2]+1;J[5996]=0;ma(212,b|0,h|0,g|0,j|0,i+116|0,i+112|0,a|0);b=J[5996];J[5996]=0;i:{if((b|0)!=1){a=J[a>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}J[5996]=0;a=ka(213,n|0,j|0,J[i+116>>2],J[i+112>>2],c|0,d|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break i}db(e);db(k);Ua=i+256|0;break b}a=Z()|0;b=J[i+108>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}break g}a=Z()|0;}db(e);break c}B();}a=Z()|0;}db(k);da(a|0);B();}return a|0}function Rk(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0;n=b;i=Ua-416|0;Ua=i;J[i+408>>2]=37;J[i+412>>2]=0;b=i+408|0;l=kd(b|1,3264,J[c+4>>2]);j=i+368|0;J[i+364>>2]=j;a=jb();a:{if(l){k=J[c+8>>2];m=i- -64|0;J[m>>2]=g;J[m+4>>2]=h;J[i+56>>2]=e;J[i+60>>2]=f;J[i+48>>2]=k;j=yb(j,30,a,b,i+48|0);break a}J[i+80>>2]=e;J[i+84>>2]=f;J[i+88>>2]=g;J[i+92>>2]=h;j=yb(i+368|0,30,a,i+408|0,i+80|0);}J[i+128>>2]=184;k=i+356|0;J[k>>2]=0;J[k+4>>2]=J[i+128>>2];b=i+368|0;a=b;b:{c:{d:{e:{if((j|0)>=30){a=jb();f:{if(l){j=J[c+8>>2];J[i+16>>2]=g;J[i+20>>2]=h;J[i+8>>2]=e;J[i+12>>2]=f;J[i>>2]=j;j=dc(i+364|0,a,i+408|0,i);break f}J[i+32>>2]=e;J[i+36>>2]=f;J[i+40>>2]=g;J[i+44>>2]=h;j=dc(i+364|0,a,i+408|0,i+32|0);}if((j|0)==-1){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)==1){break d}break e}a=J[i+364>>2];tb(k,a);}g=a+j|0;h=Lb(a,g,J[c+4>>2]);J[i+116>>2]=184;e=i+120|0;J[e>>2]=0;J[e+4>>2]=J[i+116>>2];g:{h:{if((i+368|0)==(a|0)){j=i+128|0;break h}j=sb(j<<3);if(!j){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)!=1){break e}a=Z()|0;break g}tb(e,j);b=a;}a=i+108|0;f=J[c+28>>2];J[a>>2]=f;J[f+4>>2]=J[f+4>>2]+1;J[5996]=0;ma(218,b|0,h|0,g|0,j|0,i+116|0,i+112|0,a|0);b=J[5996];J[5996]=0;i:{if((b|0)!=1){a=J[a>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}J[5996]=0;a=ka(219,n|0,j|0,J[i+116>>2],J[i+112>>2],c|0,d|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break i}db(e);db(k);Ua=i+416|0;break b}a=Z()|0;b=J[i+108>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}break g}a=Z()|0;}db(e);break c}B();}a=Z()|0;}db(k);da(a|0);B();}return a|0}function te(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0;H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;j=K[b+8|0]|K[b+9|0]<<8|(K[b+10|0]<<16|K[b+11|0]<<24);e=-29;f=K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24);h=f>>>0<29;a:{f=h?f:f-29|0;if(f>>>0>=29){J[5996]=0;aa(124,a|0,f+(f>>>1|0)|0);e=J[5996];J[5996]=0;if((e|0)==1){break a}d=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);g=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=g-29|0;}i=g>>>0<29;d=i?a+4|0:d;eb(f+d|0,d,i?g:e);e=f+(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))|0;H[a|0]=e;H[a+1|0]=e>>>8;H[a+2|0]=e>>>16;H[a+3|0]=e>>>24;b:{if(!f){break b}e=h?b+4|0:j;h=f&7;c:{if(!h){b=e;break c}g=0;b=e;while(1){H[d|0]=K[b|0];b=b+1|0;d=d+1|0;g=g+1|0;if((h|0)!=(g|0)){continue}break}}if(f>>>0<8){break b}e=e+f|0;while(1){H[d|0]=K[b|0];H[d+1|0]=K[b+1|0];H[d+2|0]=K[b+2|0];H[d+3|0]=K[b+3|0];H[d+4|0]=K[b+4|0];H[d+5|0]=K[b+5|0];H[d+6|0]=K[b+6|0];H[d+7|0]=K[b+7|0];d=d+8|0;b=b+8|0;if((e|0)!=(b|0)){continue}break}}b=J[c>>2];J[5996]=0;_(127,a|0,b|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}return}b=Z()|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0>=29){$a(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24));H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;}da(b|0);B();}function zl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;d=J[d+28>>2];a=Ua-256|0;Ua=a;J[a+248>>2]=c;J[a+252>>2]=b;$d(a+192|0,d,a+208|0,a+207|0,a+206|0);d=a+180|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;b=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,b|0);b=J[5996];J[5996]=0;a:{b:{c:{if((b|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+176>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;H[a+7|0]=1;H[a+6|0]=69;h=K[a+206|0]<<24>>24;i=K[a+207|0]<<24>>24;while(1){d:{J[5996]=0;b=_(186,a+252|0,a+248|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(b){break c}b=K[d+11|0];b=(b&128)>>>7|0?J[d+4>>2]:b&127;if(J[a+176>>2]==(b+c|0)){J[5996]=0;aa(172,d|0,b<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+176>>2]=b+c;}J[5996]=0;b=$(187,J[a+252>>2])|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(_d(b,a+7|0,a+6|0,c,a+176|0,i,h,a+192|0,a+16|0,a+12|0,a+8|0,a+208|0)){break c}J[5996]=0;$(189,a+252|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){continue}}break}break b}break b}b=K[a+203|0];e:{if(!((b&128)>>>7|0?J[a+196>>2]:b&127)|!K[a+7|0]){break e}b=J[a+12>>2];if((b-(a+16|0)|0)>159){break e}J[a+12>>2]=b+4;J[b>>2]=J[a+8>>2];}N[f>>2]=Of(c,J[a+176>>2],e);zb(a+192|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(186,a+252|0,a+248|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+252>>2];ab(d);ab(a+192|0);Ua=a+256|0;break a}}b=Z()|0;ab(d);ab(a+192|0);da(b|0);B();}return b|0}function xl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;d=J[d+28>>2];a=Ua-256|0;Ua=a;J[a+248>>2]=c;J[a+252>>2]=b;$d(a+192|0,d,a+208|0,a+207|0,a+206|0);d=a+180|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;b=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,b|0);b=J[5996];J[5996]=0;a:{b:{c:{if((b|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+176>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;H[a+7|0]=1;H[a+6|0]=69;h=K[a+206|0]<<24>>24;i=K[a+207|0]<<24>>24;while(1){d:{J[5996]=0;b=_(186,a+252|0,a+248|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(b){break c}b=K[d+11|0];b=(b&128)>>>7|0?J[d+4>>2]:b&127;if(J[a+176>>2]==(b+c|0)){J[5996]=0;aa(172,d|0,b<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+176>>2]=b+c;}J[5996]=0;b=$(187,J[a+252>>2])|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(_d(b,a+7|0,a+6|0,c,a+176|0,i,h,a+192|0,a+16|0,a+12|0,a+8|0,a+208|0)){break c}J[5996]=0;$(189,a+252|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){continue}}break}break b}break b}b=K[a+203|0];e:{if(!((b&128)>>>7|0?J[a+196>>2]:b&127)|!K[a+7|0]){break e}b=J[a+12>>2];if((b-(a+16|0)|0)>159){break e}J[a+12>>2]=b+4;J[b>>2]=J[a+8>>2];}O[f>>3]=Mf(c,J[a+176>>2],e);zb(a+192|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(186,a+252|0,a+248|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+252>>2];ab(d);ab(a+192|0);Ua=a+256|0;break a}}b=Z()|0;ab(d);ab(a+192|0);da(b|0);B();}return b|0}function kc(a,b,c,d,e,f,g,h){var i=0,j=0,k=0;i=Ua-16|0;Ua=i;J[i+8>>2]=c;J[i+12>>2]=b;b=J[d+28>>2];J[i+4>>2]=b;J[b+4>>2]=J[b+4>>2]+1;c=0;J[5996]=0;j=$(170,J[i+4>>2])|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[i+4>>2];k=J[b+4>>2]-1|0;J[b+4>>2]=k;if((k|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}J[e>>2]=0;a:{while(1){if(c|(g|0)==(h|0)){break a}b:{if(Ub(i+12|0,i+8|0)){break b}c:{if((Xa[J[J[j>>2]+36>>2]](j,H[g|0],0)|0)==37){if((g+1|0)==(h|0)){break b}c=Xa[J[J[j>>2]+36>>2]](j,H[g+1|0],0)|0;d:{if(!((c|0)==69|(c&255)==48)){b=0;k=1;break d}if((g+2|0)==(h|0)){break b}b=c;c=Xa[J[J[j>>2]+36>>2]](j,H[g+2|0],0)|0;k=2;}J[i+12>>2]=Xa[J[J[a>>2]+36>>2]](a,J[i+12>>2],J[i+8>>2],d,e,f,c,b);g=(g+k|0)+1|0;break c}b=J[j+8>>2];c=H[g|0];if((c|0)>=0){c=J[b+((c&255)<<2)>>2]&1;}else {c=0;}if(c){while(1){e:{g=g+1|0;if((h|0)==(g|0)){g=h;break e}c=H[g|0];if((c|0)>=0){c=J[b+((c&255)<<2)>>2]&1;}else {c=0;}if(c){continue}}break}while(1){k=i+12|0;if(Ub(k,i+8|0)){break c}b=J[i+12>>2];c=J[b+12>>2];f:{if((c|0)==J[b+16>>2]){b=Xa[J[J[b>>2]+36>>2]](b)|0;break f}b=K[c|0];}c=J[j+8>>2];b=b<<24>>24;if((b|0)>=0){b=J[c+((b&255)<<2)>>2]&1;}else {b=0;}if(!b){break c}Ic(k);continue}}b=J[i+12>>2];c=J[b+12>>2];g:{if((c|0)==J[b+16>>2]){b=Xa[J[J[b>>2]+36>>2]](b)|0;break g}b=K[c|0];}if((Xa[J[J[j>>2]+12>>2]](j,b<<24>>24)|0)==(Xa[J[J[j>>2]+12>>2]](j,H[g|0])|0)){g=g+1|0;Ic(i+12|0);break c}J[e>>2]=4;}c=J[e>>2];continue}break}J[e>>2]=4;}if(Ub(i+12|0,i+8|0)){J[e>>2]=J[e>>2]|2;}Ua=i+16|0;return J[i+12>>2]}c=Z()|0;a=J[i+4>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function ml(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;d=J[d+28>>2];a=Ua-368|0;Ua=a;J[a+360>>2]=c;J[a+364>>2]=b;Xd(a+204|0,d,a+224|0,a+220|0,a+216|0);d=a+192|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;b=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,b|0);b=J[5996];J[5996]=0;a:{b:{c:{if((b|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+188>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;H[a+7|0]=1;H[a+6|0]=69;h=J[a+216>>2];i=J[a+220>>2];while(1){d:{J[5996]=0;b=_(202,a+364|0,a+360|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(b){break c}b=K[d+11|0];b=(b&128)>>>7|0?J[d+4>>2]:b&127;if(J[a+188>>2]==(b+c|0)){J[5996]=0;aa(172,d|0,b<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+188>>2]=b+c;}J[5996]=0;b=$(203,J[a+364>>2])|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(Wd(b,a+7|0,a+6|0,c,a+188|0,i,h,a+204|0,a+16|0,a+12|0,a+8|0,a+224|0)){break c}J[5996]=0;$(205,a+364|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){continue}}break}break b}break b}b=K[a+215|0];e:{if(!((b&128)>>>7|0?J[a+208>>2]:b&127)|!K[a+7|0]){break e}b=J[a+12>>2];if((b-(a+16|0)|0)>159){break e}J[a+12>>2]=b+4;J[b>>2]=J[a+8>>2];}N[f>>2]=Of(c,J[a+188>>2],e);zb(a+204|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(202,a+364|0,a+360|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+364>>2];ab(d);ab(a+204|0);Ua=a+368|0;break a}}b=Z()|0;ab(d);ab(a+204|0);da(b|0);B();}return b|0}function ll(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;d=J[d+28>>2];a=Ua-368|0;Ua=a;J[a+360>>2]=c;J[a+364>>2]=b;Xd(a+204|0,d,a+224|0,a+220|0,a+216|0);d=a+192|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;b=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,b|0);b=J[5996];J[5996]=0;a:{b:{c:{if((b|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+188>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;H[a+7|0]=1;H[a+6|0]=69;h=J[a+216>>2];i=J[a+220>>2];while(1){d:{J[5996]=0;b=_(202,a+364|0,a+360|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(b){break c}b=K[d+11|0];b=(b&128)>>>7|0?J[d+4>>2]:b&127;if(J[a+188>>2]==(b+c|0)){J[5996]=0;aa(172,d|0,b<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+188>>2]=b+c;}J[5996]=0;b=$(203,J[a+364>>2])|0;g=J[5996];J[5996]=0;if((g|0)==1){break d}if(Wd(b,a+7|0,a+6|0,c,a+188|0,i,h,a+204|0,a+16|0,a+12|0,a+8|0,a+224|0)){break c}J[5996]=0;$(205,a+364|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){continue}}break}break b}break b}b=K[a+215|0];e:{if(!((b&128)>>>7|0?J[a+208>>2]:b&127)|!K[a+7|0]){break e}b=J[a+12>>2];if((b-(a+16|0)|0)>159){break e}J[a+12>>2]=b+4;J[b>>2]=J[a+8>>2];}O[f>>3]=Mf(c,J[a+188>>2],e);zb(a+204|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(202,a+364|0,a+360|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+364>>2];ab(d);ab(a+204|0);Ua=a+368|0;break a}}b=Z()|0;ab(d);ab(a+204|0);da(b|0);B();}return b|0}function _c(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0;a:{b:{if(a-1&a|b>>>0>4294967239){break b}while(1){a=a>>>0<=8?8:a;e=J[5995];f=J[5994];b=b>>>0<=8?8:b+3&-4;c:{if(b>>>0<=127){g=(b>>>3|0)-1|0;break c}d=S(b);g=((b>>>29-d^4)-(d<<2)|0)+110|0;if(b>>>0<=4095){break c}d=((b>>>30-d^2)-(d<<1)|0)+71|0;g=d>>>0>=63?63:d;}c=g&31;if((g&63)>>>0>=32){d=0;c=e>>>c|0;}else {d=e>>>c|0;c=((1<<c)-1&e)<<32-c|f>>>c;}if(c|d){while(1){e=c;d:{if(d|e){f=d-1|0;h=f+1|0;c=f;f=e-1|0;h=(f|0)!=-1?h:c;c=S(d^h);c=(c|0)==32?S(e^f)+32|0:c;f=63-c|0;Wa=0-(c>>>0>63)|0;break d}Wa=0;f=64;}h=f;f=h&31;if((h&63)>>>0>=32){c=0;f=d>>>f|0;}else {c=d>>>f|0;f=((1<<f)-1&d)<<32-f|e>>>f;}d=c;g=g+h|0;h=g<<4;e=J[h+22952>>2];i=h+22944|0;e:{if((e|0)!=(i|0)){c=ye(e,a,b);if(c){break b}c=J[e+4>>2];J[c+8>>2]=J[e+8>>2];J[J[e+8>>2]+4>>2]=c;J[e+8>>2]=i;c=h+22948|0;J[e+4>>2]=J[c>>2];J[c>>2]=e;J[J[e+4>>2]+8>>2]=e;g=g+1|0;c=(d&1)<<31|f>>>1;d=d>>>1|0;break e}c=J[5995];J[5994]=J[5994]&go(-2,-1,g);J[5995]=Wa&c;c=f^1;}if(d|c){continue}break}f=J[5994];e=J[5995];}f:{if(e|f){d=S(e);h=63-((d|0)==32?S(f)+32|0:d)|0;c=h<<4;d=J[c+22952>>2];g:{if(!e&f>>>0<1073741824){break g}g=99;e=c+22944|0;if((e|0)==(d|0)){break g}while(1){if(!g){break g}c=ye(d,a,b);if(c){break b}g=g-1|0;d=J[d+8>>2];if((e|0)!=(d|0)){continue}break}d=e;}if(Cd(b+48|0)){break f}if(!d){break a}e=(h<<4)+22944|0;if((e|0)==(d|0)){break a}while(1){c=ye(d,a,b);if(c){break b}d=J[d+8>>2];if((e|0)!=(d|0)){continue}break}break a}if(!Cd(b+48|0)){break a}}c=0;if(a-1&a){break b}if(b>>>0<=4294967239){continue}break}}return c}return 0}function ql(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a=Ua-336|0;Ua=a;J[a+328>>2]=c;J[a+332>>2]=b;b=ec(J[d+4>>2]);i=Sc(J[d+28>>2],a+208|0);Rc(a+196|0,J[d+28>>2],a+324|0);d=a+184|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(202,a+332|0,a+328|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+180>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=g+c;}J[5996]=0;g=$(203,J[a+332>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Cc(g,b,c,a+180|0,a+8|0,J[a+324>>2],J[a+200>>2],K[a+207|0],a+16|0,a+12|0,i)){break c}J[5996]=0;$(205,a+332|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+207|0];e:{if(!((g&128)>>>7|0?J[a+200>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}J[f>>2]=Tf(c,J[a+180>>2],e,b);J[f+4>>2]=Wa;zb(a+196|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(202,a+332|0,a+328|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+332>>2];ab(d);ab(a+196|0);Ua=a+336|0;break a}}b=Z()|0;ab(d);ab(a+196|0);da(b|0);B();}return b|0}function ol(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a=Ua-336|0;Ua=a;J[a+328>>2]=c;J[a+332>>2]=b;b=ec(J[d+4>>2]);i=Sc(J[d+28>>2],a+208|0);Rc(a+196|0,J[d+28>>2],a+324|0);d=a+184|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(202,a+332|0,a+328|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+180>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=g+c;}J[5996]=0;g=$(203,J[a+332>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Cc(g,b,c,a+180|0,a+8|0,J[a+324>>2],J[a+200>>2],K[a+207|0],a+16|0,a+12|0,i)){break c}J[5996]=0;$(205,a+332|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+207|0];e:{if(!((g&128)>>>7|0?J[a+200>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}J[f>>2]=Pf(c,J[a+180>>2],e,b);J[f+4>>2]=Wa;zb(a+196|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(202,a+332|0,a+328|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+332>>2];ab(d);ab(a+196|0);Ua=a+336|0;break a}}b=Z()|0;ab(d);ab(a+196|0);da(b|0);B();}return b|0}function sl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a=Ua-336|0;Ua=a;J[a+328>>2]=c;J[a+332>>2]=b;b=ec(J[d+4>>2]);i=Sc(J[d+28>>2],a+208|0);Rc(a+196|0,J[d+28>>2],a+324|0);d=a+184|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(202,a+332|0,a+328|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+180>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=g+c;}J[5996]=0;g=$(203,J[a+332>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Cc(g,b,c,a+180|0,a+8|0,J[a+324>>2],J[a+200>>2],K[a+207|0],a+16|0,a+12|0,i)){break c}J[5996]=0;$(205,a+332|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+207|0];e:{if(!((g&128)>>>7|0?J[a+200>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}J[f>>2]=Yf(c,J[a+180>>2],e,b);zb(a+196|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(202,a+332|0,a+328|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+332>>2];ab(d);ab(a+196|0);Ua=a+336|0;break a}}b=Z()|0;ab(d);ab(a+196|0);da(b|0);B();}return b|0}function pl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a=Ua-336|0;Ua=a;J[a+328>>2]=c;J[a+332>>2]=b;b=ec(J[d+4>>2]);i=Sc(J[d+28>>2],a+208|0);Rc(a+196|0,J[d+28>>2],a+324|0);d=a+184|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(202,a+332|0,a+328|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+180>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=g+c;}J[5996]=0;g=$(203,J[a+332>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Cc(g,b,c,a+180|0,a+8|0,J[a+324>>2],J[a+200>>2],K[a+207|0],a+16|0,a+12|0,i)){break c}J[5996]=0;$(205,a+332|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+207|0];e:{if(!((g&128)>>>7|0?J[a+200>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}I[f>>1]=Sf(c,J[a+180>>2],e,b);zb(a+196|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(202,a+332|0,a+328|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+332>>2];ab(d);ab(a+196|0);Ua=a+336|0;break a}}b=Z()|0;ab(d);ab(a+196|0);da(b|0);B();}return b|0}function Jf(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;a=Ua-336|0;Ua=a;J[a+328>>2]=c;J[a+332>>2]=b;b=ec(J[d+4>>2]);i=Sc(J[d+28>>2],a+208|0);Rc(a+196|0,J[d+28>>2],a+324|0);d=a+184|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(202,a+332|0,a+328|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+180>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+180>>2]=g+c;}J[5996]=0;g=$(203,J[a+332>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Cc(g,b,c,a+180|0,a+8|0,J[a+324>>2],J[a+200>>2],K[a+207|0],a+16|0,a+12|0,i)){break c}J[5996]=0;$(205,a+332|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+207|0];e:{if(!((g&128)>>>7|0?J[a+200>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}J[f>>2]=Qf(c,J[a+180>>2],e,b);zb(a+196|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(202,a+332|0,a+328|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+332>>2];ab(d);ab(a+196|0);Ua=a+336|0;break a}}b=Z()|0;ab(d);ab(a+196|0);da(b|0);B();}return b|0}function Cl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=J[d+4>>2];d=J[d+28>>2];a=Ua-224|0;Ua=a;J[a+216>>2]=c;J[a+220>>2]=b;b=ec(g);Tc(a+200|0,d,a+215|0);d=a+188|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(186,a+220|0,a+216|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+184>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=g+c;}J[5996]=0;g=$(187,J[a+220>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Dc(g,b,c,a+184|0,a+8|0,H[a+215|0],J[a+204>>2],K[a+211|0],a+16|0,a+12|0,12416)){break c}J[5996]=0;$(189,a+220|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+211|0];e:{if(!((g&128)>>>7|0?J[a+204>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}J[f>>2]=Tf(c,J[a+184>>2],e,b);J[f+4>>2]=Wa;zb(a+200|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(186,a+220|0,a+216|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+220>>2];ab(d);ab(a+200|0);Ua=a+224|0;break a}}b=Z()|0;ab(d);ab(a+200|0);da(b|0);B();}return b|0}function Al(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=J[d+4>>2];d=J[d+28>>2];a=Ua-224|0;Ua=a;J[a+216>>2]=c;J[a+220>>2]=b;b=ec(g);Tc(a+200|0,d,a+215|0);d=a+188|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(186,a+220|0,a+216|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+184>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=g+c;}J[5996]=0;g=$(187,J[a+220>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Dc(g,b,c,a+184|0,a+8|0,H[a+215|0],J[a+204>>2],K[a+211|0],a+16|0,a+12|0,12416)){break c}J[5996]=0;$(189,a+220|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+211|0];e:{if(!((g&128)>>>7|0?J[a+204>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}J[f>>2]=Pf(c,J[a+184>>2],e,b);J[f+4>>2]=Wa;zb(a+200|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(186,a+220|0,a+216|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+220>>2];ab(d);ab(a+200|0);Ua=a+224|0;break a}}b=Z()|0;ab(d);ab(a+200|0);da(b|0);B();}return b|0}function Vc(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;a:{if(!a){a=_c(8,b);break a}if(!b){$a(a);a=0;break a}b:{if(b>>>0>4294967239){break b}h=b>>>0<=8?8:b+3&-4;b=h+8|0;c:{d:{k=a-4|0;f=k;e=J[f>>2];c=e+f|0;j=J[c>>2];g=j+c|0;e:{f:{if(J[g-4>>2]!=(j|0)){d=b+f|0;if(d+16>>>0<=g>>>0){e=J[c+4>>2];J[e+8>>2]=J[c+8>>2];J[J[c+8>>2]+4>>2]=e;c=g-d|0;J[d>>2]=c;J[(d+(c&-4)|0)-4>>2]=c|1;e=J[d>>2]-8|0;g:{if(e>>>0<=127){c=(e>>>3|0)-1|0;break g}g=S(e);c=((e>>>29-g^4)-(g<<2)|0)+110|0;if(e>>>0<=4095){break g}c=((e>>>30-g^2)-(g<<1)|0)+71|0;c=c>>>0>=63?63:c;}e=c<<4;J[d+4>>2]=e+22944;e=e+22952|0;J[d+8>>2]=J[e>>2];J[e>>2]=d;J[J[d+8>>2]+4>>2]=d;e=J[5995];d=c&31;if((c&63)>>>0>=32){c=1<<d;g=0;}else {g=1<<d;c=g-1&1>>>32-d;}J[5994]=g|J[5994];J[5995]=c|e;J[f>>2]=b;break d}if(d>>>0>g>>>0){break f}b=J[c+4>>2];J[b+8>>2]=J[c+8>>2];J[J[c+8>>2]+4>>2]=b;b=e+j|0;J[f>>2]=b;break d}if(e>>>0>=b+16>>>0){J[f>>2]=b;J[(f+(b&-4)|0)-4>>2]=b;d=b+f|0;b=e-b|0;J[d>>2]=b;J[(d+(b&-4)|0)-4>>2]=b|1;c=J[d>>2]-8|0;h:{if(c>>>0<=127){b=(c>>>3|0)-1|0;break h}f=S(c);b=((c>>>29-f^4)-(f<<2)|0)+110|0;if(c>>>0<=4095){break h}b=((c>>>30-f^2)-(f<<1)|0)+71|0;b=b>>>0>=63?63:b;}c=b<<4;J[d+4>>2]=c+22944;c=c+22952|0;J[d+8>>2]=J[c>>2];J[c>>2]=d;J[J[d+8>>2]+4>>2]=d;c=J[5995];d=b&31;if((b&63)>>>0>=32){b=1<<d;e=0;}else {e=1<<d;b=e-1&1>>>32-d;}J[5994]=e|J[5994];J[5995]=b|c;d=1;break c}d=1;if(b>>>0<=e>>>0){break e}}d=0;}break c}J[(f+(b&-4)|0)-4>>2]=b;d=1;}if(d){break a}b=_c(8,h);if(!b){break b}i=J[k>>2]-8|0;fb(b,a,h>>>0<i>>>0?h:i);$a(a);i=b;}a=i;}return a}function an(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0;d=Ua-160|0;Ua=d;J[d+72>>2]=8356;J[d+16>>2]=8336;h=d+72|0;c=h;J[c+20>>2]=0;e=d+20|0;J[c+24>>2]=e;J[c+12>>2]=0;J[c+4>>2]=4098;J[c+8>>2]=6;J[c+16>>2]=!e;Sb(c+32|0,0,40);yg(c+28|0);J[d+72>>2]=8316;J[d+16>>2]=8296;J[d+144>>2]=0;J[d+148>>2]=-1;J[e>>2]=7896;yg(e+4|0);J[e+24>>2]=0;J[e+28>>2]=0;J[e+16>>2]=0;J[e+20>>2]=0;J[e+8>>2]=0;J[e+12>>2]=0;J[e>>2]=7960;J[d+60>>2]=0;J[d+64>>2]=0;J[d+52>>2]=0;J[d+56>>2]=0;J[d+68>>2]=16;c=J[J[d+16>>2]-12>>2];J[5996]=0;g=Ca(129)|0;f=J[5996];J[5996]=0;a:{b:{if((f|0)==1){break b}f=c+(d+16|0)|0;c=J[f+28>>2];J[d+12>>2]=c;J[c+4>>2]=J[c+4>>2]+1;J[5996]=0;ea(130,d+156|0,f|0,g|0);c=J[5996];J[5996]=0;c:{if((c|0)==1){break c}c=J[d+156>>2];i=J[c+4>>2]-1|0;J[c+4>>2]=i;if((i|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}c=J[f+24>>2];if(c){f=J[J[c>>2]+8>>2];J[5996]=0;aa(f|0,c|0,g|0);f=J[5996];J[5996]=0;if((f|0)==1){break c}f=J[c+4>>2];J[d+152>>2]=f;J[f+4>>2]=J[f+4>>2]+1;Og(c+4|0,g);c=J[d+152>>2];g=J[c+4>>2]-1|0;J[c+4>>2]=g;if((g|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}}c=J[d+12>>2];g=J[c+4>>2]-1|0;J[c+4>>2]=g;if((g|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}b=J[b>>2];J[5996]=0;b=_(131,d+16|0,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break b}J[5996]=0;aa(132,a|0,e|0);a=J[5996];J[5996]=0;if((a|0)==1){break b}J[b>>2]=8296;J[d+72>>2]=8316;J[e>>2]=7960;if(H[b+47|0]<0){$a(J[d+52>>2]);}Qc(e);Od(h);Ua=d+160|0;return}a=Z()|0;b=J[d+12>>2];e=J[b+4>>2]-1|0;J[b+4>>2]=e;if((e|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}break a}a=Z()|0;}gd(d+16|0);da(a|0);B();}\n\t\tfunction Rf(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=J[d+4>>2];d=J[d+28>>2];a=Ua-224|0;Ua=a;J[a+216>>2]=c;J[a+220>>2]=b;b=ec(g);Tc(a+200|0,d,a+215|0);d=a+188|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(186,a+220|0,a+216|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+184>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=g+c;}J[5996]=0;g=$(187,J[a+220>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Dc(g,b,c,a+184|0,a+8|0,H[a+215|0],J[a+204>>2],K[a+211|0],a+16|0,a+12|0,12416)){break c}J[5996]=0;$(189,a+220|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+211|0];e:{if(!((g&128)>>>7|0?J[a+204>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}J[f>>2]=Qf(c,J[a+184>>2],e,b);zb(a+200|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(186,a+220|0,a+216|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+220>>2];ab(d);ab(a+200|0);Ua=a+224|0;break a}}b=Z()|0;ab(d);ab(a+200|0);da(b|0);B();}return b|0}function Dl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=J[d+4>>2];d=J[d+28>>2];a=Ua-224|0;Ua=a;J[a+216>>2]=c;J[a+220>>2]=b;b=ec(g);Tc(a+200|0,d,a+215|0);d=a+188|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(186,a+220|0,a+216|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+184>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=g+c;}J[5996]=0;g=$(187,J[a+220>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Dc(g,b,c,a+184|0,a+8|0,H[a+215|0],J[a+204>>2],K[a+211|0],a+16|0,a+12|0,12416)){break c}J[5996]=0;$(189,a+220|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+211|0];e:{if(!((g&128)>>>7|0?J[a+204>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}J[f>>2]=Yf(c,J[a+184>>2],e,b);zb(a+200|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(186,a+220|0,a+216|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+220>>2];ab(d);ab(a+200|0);Ua=a+224|0;break a}}b=Z()|0;ab(d);ab(a+200|0);da(b|0);B();}return b|0}function Bl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=J[d+4>>2];d=J[d+28>>2];a=Ua-224|0;Ua=a;J[a+216>>2]=c;J[a+220>>2]=b;b=ec(g);Tc(a+200|0,d,a+215|0);d=a+188|0;J[d>>2]=0;J[d+4>>2]=0;J[d+8>>2]=0;c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=c;J[a+12>>2]=a+16;J[a+8>>2]=0;while(1){d:{J[5996]=0;g=_(186,a+220|0,a+216|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(g){break c}g=K[d+11|0];g=(g&128)>>>7|0?J[d+4>>2]:g&127;if(J[a+184>>2]==(g+c|0)){J[5996]=0;aa(172,d|0,g<<1);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?(J[d+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,d|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break b}c=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+184>>2]=g+c;}J[5996]=0;g=$(187,J[a+220>>2])|0;h=J[5996];J[5996]=0;if((h|0)==1){break d}if(Dc(g,b,c,a+184|0,a+8|0,H[a+215|0],J[a+204>>2],K[a+211|0],a+16|0,a+12|0,12416)){break c}J[5996]=0;$(189,a+220|0)|0;g=J[5996];J[5996]=0;if((g|0)!=1){continue}}break}break b}break b}g=K[a+211|0];e:{if(!((g&128)>>>7|0?J[a+204>>2]:g&127)){break e}g=J[a+12>>2];if((g-(a+16|0)|0)>159){break e}J[a+12>>2]=g+4;J[g>>2]=J[a+8>>2];}I[f>>1]=Sf(c,J[a+184>>2],e,b);zb(a+200|0,a+16|0,J[a+12>>2],e);J[5996]=0;b=_(186,a+220|0,a+216|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if(b){J[e>>2]=J[e>>2]|2;}b=J[a+220>>2];ab(d);ab(a+200|0);Ua=a+224|0;break a}}b=Z()|0;ab(d);ab(a+200|0);da(b|0);B();}return b|0}function jc(a,b,c,d,e,f,g,h){var i=0,j=0,k=0;i=Ua-16|0;Ua=i;J[i+8>>2]=c;J[i+12>>2]=b;b=J[d+28>>2];J[i+4>>2]=b;J[b+4>>2]=J[b+4>>2]+1;b=0;J[5996]=0;j=$(197,J[i+4>>2])|0;c=J[5996];J[5996]=0;if((c|0)!=1){c=J[i+4>>2];k=J[c+4>>2]-1|0;J[c+4>>2]=k;if((k|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}J[e>>2]=0;a:{while(1){if(b|(g|0)==(h|0)){break a}b:{if(Tb(i+12|0,i+8|0)){break b}c:{if((Xa[J[J[j>>2]+52>>2]](j,J[g>>2],0)|0)==37){if((g+4|0)==(h|0)){break b}b=Xa[J[J[j>>2]+52>>2]](j,J[g+4>>2],0)|0;d:{if(!((b|0)==69|(b&255)==48)){c=0;k=1;break d}if((g+8|0)==(h|0)){break b}c=b;b=Xa[J[J[j>>2]+52>>2]](j,J[g+8>>2],0)|0;k=2;}J[i+12>>2]=Xa[J[J[a>>2]+36>>2]](a,J[i+12>>2],J[i+8>>2],d,e,f,b,c);g=((k<<2)+g|0)+4|0;break c}if(Xa[J[J[j>>2]+12>>2]](j,1,J[g>>2])|0){while(1){e:{g=g+4|0;if((h|0)==(g|0)){g=h;break e}if(Xa[J[J[j>>2]+12>>2]](j,1,J[g>>2])|0){continue}}break}while(1){k=i+12|0;if(Tb(k,i+8|0)){break c}b=J[i+12>>2];c=J[b+12>>2];f:{if((c|0)==J[b+16>>2]){b=Xa[J[J[b>>2]+36>>2]](b)|0;break f}b=J[c>>2];}if(!(Xa[J[J[j>>2]+12>>2]](j,1,b)|0)){break c}Hc(k);continue}}b=J[i+12>>2];c=J[b+12>>2];g:{if((c|0)==J[b+16>>2]){b=Xa[J[J[b>>2]+36>>2]](b)|0;break g}b=J[c>>2];}if((Xa[J[J[j>>2]+28>>2]](j,b)|0)==(Xa[J[J[j>>2]+28>>2]](j,J[g>>2])|0)){g=g+4|0;Hc(i+12|0);break c}J[e>>2]=4;}b=J[e>>2];continue}break}J[e>>2]=4;}if(Tb(i+12|0,i+8|0)){J[e>>2]=J[e>>2]|2;}Ua=i+16|0;return J[i+12>>2]}c=Z()|0;a=J[i+4>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function cl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=b;f=Ua-208|0;Ua=f;J[f+200>>2]=37;J[f+204>>2]=0;b=f+200|0;h=kd(b|1,5575,J[c+4>>2]);g=f+160|0;J[f+156>>2]=g;a=jb();a:{if(h){i=J[c+8>>2];O[f+40>>3]=e;J[f+32>>2]=i;g=yb(g,30,a,b,f+32|0);break a}O[f+48>>3]=e;g=yb(f+160|0,30,a,f+200|0,f+48|0);}J[f+80>>2]=184;i=f+148|0;J[i>>2]=0;J[i+4>>2]=J[f+80>>2];b=f+160|0;a=b;b:{c:{d:{e:{if((g|0)>=30){a=jb();f:{if(h){g=J[c+8>>2];O[f+8>>3]=e;J[f>>2]=g;g=dc(f+156|0,a,f+200|0,f);break f}O[f+16>>3]=e;g=dc(f+156|0,a,f+200|0,f+16|0);}if((g|0)==-1){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)==1){break d}break e}a=J[f+156>>2];tb(i,a);}k=a+g|0;m=Lb(a,k,J[c+4>>2]);J[f+68>>2]=184;h=f+72|0;J[h>>2]=0;J[h+4>>2]=J[f+68>>2];g:{h:{if((f+160|0)==(a|0)){g=f+80|0;break h}g=sb(g<<1);if(!g){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)!=1){break e}a=Z()|0;break g}tb(h,g);b=a;}a=f+60|0;j=J[c+28>>2];J[a>>2]=j;J[j+4>>2]=J[j+4>>2]+1;J[5996]=0;ma(212,b|0,m|0,k|0,g|0,f+68|0,f- -64|0,a|0);b=J[5996];J[5996]=0;i:{if((b|0)!=1){a=J[a>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}J[5996]=0;a=ka(213,l|0,g|0,J[f+68>>2],J[f+64>>2],c|0,d|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break i}db(h);db(i);Ua=f+208|0;break b}a=Z()|0;b=J[f+60>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}break g}a=Z()|0;}db(h);break c}B();}a=Z()|0;}db(i);da(a|0);B();}return a|0}function Tk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;l=b;f=Ua-368|0;Ua=f;J[f+360>>2]=37;J[f+364>>2]=0;b=f+360|0;h=kd(b|1,5575,J[c+4>>2]);g=f+320|0;J[f+316>>2]=g;a=jb();a:{if(h){i=J[c+8>>2];O[f+40>>3]=e;J[f+32>>2]=i;g=yb(g,30,a,b,f+32|0);break a}O[f+48>>3]=e;g=yb(f+320|0,30,a,f+360|0,f+48|0);}J[f+80>>2]=184;i=f+308|0;J[i>>2]=0;J[i+4>>2]=J[f+80>>2];b=f+320|0;a=b;b:{c:{d:{e:{if((g|0)>=30){a=jb();f:{if(h){g=J[c+8>>2];O[f+8>>3]=e;J[f>>2]=g;g=dc(f+316|0,a,f+360|0,f);break f}O[f+16>>3]=e;g=dc(f+316|0,a,f+360|0,f+16|0);}if((g|0)==-1){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)==1){break d}break e}a=J[f+316>>2];tb(i,a);}k=a+g|0;m=Lb(a,k,J[c+4>>2]);J[f+68>>2]=184;h=f+72|0;J[h>>2]=0;J[h+4>>2]=J[f+68>>2];g:{h:{if((f+320|0)==(a|0)){g=f+80|0;break h}g=sb(g<<3);if(!g){J[5996]=0;ca(185);a=J[5996];J[5996]=0;if((a|0)!=1){break e}a=Z()|0;break g}tb(h,g);b=a;}a=f+60|0;j=J[c+28>>2];J[a>>2]=j;J[j+4>>2]=J[j+4>>2]+1;J[5996]=0;ma(218,b|0,m|0,k|0,g|0,f+68|0,f- -64|0,a|0);b=J[5996];J[5996]=0;i:{if((b|0)!=1){a=J[a>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}J[5996]=0;a=ka(219,l|0,g|0,J[f+68>>2],J[f+64>>2],c|0,d|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break i}db(h);db(i);Ua=f+368|0;break b}a=Z()|0;b=J[f+60>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}break g}a=Z()|0;}db(h);break c}B();}a=Z()|0;}db(i);da(a|0);B();}return a|0}function Gi(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;n=Ua-16|0;Ua=n;b=c;while(1){a:{if((b|0)==(d|0)){b=d;break a}if(!J[b>>2]){break a}b=b+4|0;continue}break}J[h>>2]=f;J[e>>2]=c;while(1){b:{c:{if(!((c|0)==(d|0)|(f|0)==(g|0))){q=1;r=Ua-16|0;Ua=r;s=Xb(r+12|0,J[a+8>>2]);i=f;j=g-i|0;m=0;o=Ua-16|0;Ua=o;k=J[e>>2];p=b-c>>2;d:{if(!k|!p){break d}j=i?j:0;while(1){l=pe(j>>>0<4?o+12|0:i,J[k>>2]);if((l|0)==-1){m=-1;break d}if(i){if(j>>>0<=3){if(j>>>0<l>>>0){break d}fb(i,o+12|0,l);}j=j-l|0;i=i+l|0;}else {i=0;}if(!J[k>>2]){k=0;break d}m=m+l|0;k=k+4|0;p=p-1|0;if(p){continue}break}}if(i){J[e>>2]=k;}Ua=o+16|0;i=J[s>>2];if(i){J[6178]=(i|0)==-1?24816:i;}Ua=r+16|0;e:{f:{g:{h:{switch(m+1|0){case 0:J[h>>2]=f;while(1){i:{if(J[e>>2]==(c|0)){break i}b=Md(f,J[c>>2],J[a+8>>2]);if((b|0)==-1){break i}f=b+J[h>>2]|0;J[h>>2]=f;c=c+4|0;continue}break}J[e>>2]=c;break g;case 1:break c;default:break h}}f=m+J[h>>2]|0;J[h>>2]=f;if((f|0)==(g|0)){break e}if((b|0)==(d|0)){c=J[e>>2];b=d;continue}b=Md(n+12|0,0,J[a+8>>2]);if((b|0)!=-1){break f}}q=2;break c}c=n+12|0;if(g-J[h>>2]>>>0<b>>>0){break c}while(1){if(b){f=K[c|0];i=J[h>>2];J[h>>2]=i+1;H[i|0]=f;b=b-1|0;c=c+1|0;continue}break}c=J[e>>2]+4|0;J[e>>2]=c;b=c;while(1){if((b|0)==(d|0)){b=d;break b}if(!J[b>>2]){break b}b=b+4|0;continue}}c=J[e>>2];}q=(c|0)!=(d|0);}Ua=n+16|0;return q|0}f=J[h>>2];continue}}function Yk(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;k=Ua-16|0;Ua=k;m=je(J[g>>2]);g=Zd(J[g>>2]);Xa[J[J[g>>2]+20>>2]](k+4|0,g);a:{j=K[k+15|0];b:{if(!((j&128)>>>7|0?J[k+8>>2]:j&127)){J[5996]=0;ga(208,m|0,a|0,c|0,d|0);g=J[5996];J[5996]=0;if((g|0)==1){break b}g=(c-a<<2)+d|0;J[f>>2]=g;break a}J[f>>2]=d;c:{d:{j=a;i=K[j|0];switch(i-43|0){case 0:case 2:break d;default:break c}}J[5996]=0;j=_(216,m|0,i<<24>>24)|0;i=J[5996];J[5996]=0;if((i|0)==1){break b}i=J[f>>2];J[f>>2]=i+4;J[i>>2]=j;j=a+1|0;}if(!(K[j|0]!=48|(c-j|0)<2|(K[j+1|0]|32)!=120)){J[5996]=0;i=_(216,m|0,48)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}h=J[f>>2];J[f>>2]=h+4;J[h>>2]=i;i=H[j+1|0];J[5996]=0;i=_(216,m|0,i|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}h=J[f>>2];J[f>>2]=h+4;J[h>>2]=i;j=j+2|0;}vc(j,c);J[5996]=0;o=$(206,g|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break b}i=0;g=j;while(1){if(c>>>0<=g>>>0){md((j-a<<2)+d|0,J[f>>2]);g=J[f>>2];break a}h=k+4|0;l=(K[h+11|0]&128)>>>7|0;if(!(!K[(l?J[h>>2]:h)+i|0]|H[(l?J[h>>2]:h)+i|0]!=(n|0))){h=J[f>>2];J[f>>2]=h+4;J[h>>2]=o;n=0;l=i;i=K[k+15|0];i=l+(l>>>0<((i&128)>>>7|0?J[k+8>>2]:i&127)-1>>>0)|0;}h=H[g|0];J[5996]=0;h=_(216,m|0,h|0)|0;l=J[5996];J[5996]=0;if((l|0)!=1){l=J[f>>2];J[f>>2]=l+4;J[l>>2]=h;g=g+1|0;n=n+1|0;continue}break}}a=Z()|0;ab(k+4|0);da(a|0);B();}J[e>>2]=(b|0)==(c|0)?g:(b-a<<2)+d|0;ab(k+4|0);Ua=k+16|0;}function gl(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;k=Ua-16|0;Ua=k;m=le(J[g>>2]);g=de(J[g>>2]);Xa[J[J[g>>2]+20>>2]](k+4|0,g);a:{j=K[k+15|0];b:{if(!((j&128)>>>7|0?J[k+8>>2]:j&127)){J[5996]=0;ga(195,m|0,a|0,c|0,d|0);g=J[5996];J[5996]=0;if((g|0)==1){break b}g=(c-a|0)+d|0;J[f>>2]=g;break a}J[f>>2]=d;c:{d:{j=a;i=K[j|0];switch(i-43|0){case 0:case 2:break d;default:break c}}J[5996]=0;j=_(171,m|0,i<<24>>24)|0;i=J[5996];J[5996]=0;if((i|0)==1){break b}i=J[f>>2];J[f>>2]=i+1;H[i|0]=j;j=a+1|0;}if(!(K[j|0]!=48|(c-j|0)<2|(K[j+1|0]|32)!=120)){J[5996]=0;i=_(171,m|0,48)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}h=J[f>>2];J[f>>2]=h+1;H[h|0]=i;i=H[j+1|0];J[5996]=0;i=_(171,m|0,i|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}h=J[f>>2];J[f>>2]=h+1;H[h|0]=i;j=j+2|0;}vc(j,c);J[5996]=0;o=$(193,g|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break b}i=0;g=j;while(1){if(c>>>0<=g>>>0){vc((j-a|0)+d|0,J[f>>2]);g=J[f>>2];break a}h=k+4|0;l=(K[h+11|0]&128)>>>7|0;if(!(!K[(l?J[h>>2]:h)+i|0]|H[(l?J[h>>2]:h)+i|0]!=(n|0))){h=J[f>>2];J[f>>2]=h+1;H[h|0]=o;n=0;l=i;i=K[k+15|0];i=l+(l>>>0<((i&128)>>>7|0?J[k+8>>2]:i&127)-1>>>0)|0;}h=H[g|0];J[5996]=0;h=_(171,m|0,h|0)|0;l=J[5996];J[5996]=0;if((l|0)!=1){l=J[f>>2];J[f>>2]=l+1;H[l|0]=h;g=g+1|0;n=n+1|0;continue}break}}a=Z()|0;ab(k+4|0);da(a|0);B();}J[e>>2]=(b|0)==(c|0)?g:(b-a|0)+d|0;ab(k+4|0);Ua=k+16|0;}function Pe(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0;a=Ua-16|0;Ua=a;J[a+12>>2]=c;J[a+8>>2]=f;J[a+12>>2]=c;J[a+8>>2]=f;a:{b:{c:{while(1){c=J[a+12>>2];if(!(c>>>0>=d>>>0|f>>>0>=g>>>0)){i=H[c|0];j=i&255;d:{if((i|0)>=0){I[f>>1]=j;b=c+1|0;break d}b=2;if(i>>>0<4294967234){break b}if(i>>>0<=4294967263){if((d-c|0)<2){break c}i=K[c+1|0];if((i&192)!=128){break a}I[f>>1]=i&63|j<<6&1984;b=c+2|0;break d}if(i>>>0<=4294967279){if((d-c|0)<3){break c}k=K[c+2|0];i=K[c+1|0];e:{f:{if((j|0)!=237){if((j|0)!=224){break f}if((i&224)==160){break e}break a}if((i&224)==128){break e}break a}if((i&192)!=128){break a}}if((k&192)!=128){break a}I[f>>1]=k&63|((i&63)<<6|j<<12);b=c+3|0;break d}if(i>>>0>4294967284){break b}b=1;if((d-c|0)<4){break a}k=K[c+3|0];i=K[c+2|0];c=K[c+1|0];g:{h:{switch(j-240|0){case 0:if((c+112&255)>>>0>=48){break b}break g;case 4:if((c&240)!=128){break b}break g;default:break h}}if((c&192)!=128){break b}}if((i&192)!=128|(k&192)!=128){break b}if((g-f|0)<4){break a}b=2;j=j&7;if((c<<12&196608|j<<18)>>>0>1114111){break a}b=c<<2;I[f>>1]=(i>>>4&3|(b&192|j<<8|b&60))+16320|55296;J[a+8>>2]=f+2;I[f+2>>1]=i<<6&960|k&63|56320;b=J[a+12>>2]+4|0;}J[a+12>>2]=b;f=J[a+8>>2]+2|0;J[a+8>>2]=f;continue}break}b=c>>>0<d>>>0;break a}b=1;break a}b=2;}J[e>>2]=J[a+12>>2];J[h>>2]=J[a+8>>2];Ua=a+16|0;return b|0}function tl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-32|0;Ua=g;J[g+28>>2]=b;a:{b:{if(!(H[d+4|0]&1)){J[g>>2]=-1;b=Xa[J[J[a>>2]+16>>2]](a,b,c,d,e,g)|0;c:{switch(J[g>>2]){case 1:H[f|0]=1;break a;case 0:break b;default:break c}}H[f|0]=1;J[e>>2]=4;break a}a=J[d+28>>2];J[g>>2]=a;J[a+4>>2]=J[a+4>>2]+1;J[5996]=0;h=$(197,J[g>>2])|0;a=J[5996];J[5996]=0;d:{e:{f:{g:{if((a|0)!=1){a=J[g>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=J[d+28>>2];J[g>>2]=a;J[a+4>>2]=J[a+4>>2]+1;J[5996]=0;b=$(198,J[g>>2])|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}a=J[g>>2];d=J[a+4>>2]-1|0;J[a+4>>2]=d;if((d|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}J[5996]=0;aa(199,g|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){b=Z()|0;break d}J[5996]=0;aa(200,g|12,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break f}J[5996]=0;d=g+24|0;a=Ba(201,g+28|0,c|0,g|0,d|0,h|0,e|0,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break e}H[f|0]=(a|0)==(g|0);b=J[g+28>>2];while(1){d=ab(d-12|0);if((g|0)!=(d|0)){continue}break}break a}b=Z()|0;a=J[g>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}break d}b=Z()|0;a=J[g>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}break d}b=Z()|0;ab(g);break d}b=Z()|0;while(1){d=ab(d-12|0);if((g|0)!=(d|0)){continue}break}}da(b|0);B();}H[f|0]=0;}Ua=g+32|0;return b|0}function Hl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-32|0;Ua=g;J[g+28>>2]=b;a:{b:{if(!(H[d+4|0]&1)){J[g>>2]=-1;b=Xa[J[J[a>>2]+16>>2]](a,b,c,d,e,g)|0;c:{switch(J[g>>2]){case 1:H[f|0]=1;break a;case 0:break b;default:break c}}H[f|0]=1;J[e>>2]=4;break a}a=J[d+28>>2];J[g>>2]=a;J[a+4>>2]=J[a+4>>2]+1;J[5996]=0;h=$(170,J[g>>2])|0;a=J[5996];J[5996]=0;d:{e:{f:{g:{if((a|0)!=1){a=J[g>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=J[d+28>>2];J[g>>2]=a;J[a+4>>2]=J[a+4>>2]+1;J[5996]=0;b=$(180,J[g>>2])|0;a=J[5996];J[5996]=0;if((a|0)==1){break g}a=J[g>>2];d=J[a+4>>2]-1|0;J[a+4>>2]=d;if((d|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}J[5996]=0;aa(181,g|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){b=Z()|0;break d}J[5996]=0;aa(182,g|12,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break f}J[5996]=0;d=g+24|0;a=Ba(183,g+28|0,c|0,g|0,d|0,h|0,e|0,1)|0;b=J[5996];J[5996]=0;if((b|0)==1){break e}H[f|0]=(a|0)==(g|0);b=J[g+28>>2];while(1){d=ab(d-12|0);if((g|0)!=(d|0)){continue}break}break a}b=Z()|0;a=J[g>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}break d}b=Z()|0;a=J[g>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}break d}b=Z()|0;ab(g);break d}b=Z()|0;while(1){d=ab(d-12|0);if((g|0)!=(d|0)){continue}break}}da(b|0);B();}H[f|0]=0;}Ua=g+32|0;return b|0}function Lm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=Ua-32|0;Ua=e;a:{b:{c:{if((c|0)<=0){break c}while(1){h=b+g|0;if(K[h|0]!=41){g=g+1|0;if((c|0)!=(g|0)){continue}break c}break}if(g){break b}}H[a+16|0]=0;H[a|0]=0;break a}if(g>>>0<2147483632){d:{if(g>>>0<=10){H[e+31|0]=g;c=e+20|0;break d}f=(g|15)+1|0;c=cb(f);J[e+28>>2]=f|-2147483648;J[e+20>>2]=c;J[e+24>>2]=g;}i=g&7;if(i){f=0;while(1){H[c|0]=K[b|0];c=c+1|0;b=b+1|0;f=f+1|0;if((i|0)!=(f|0)){continue}break}}if(g>>>0>=8){while(1){H[c|0]=K[b|0];H[c+1|0]=K[b+1|0];H[c+2|0]=K[b+2|0];H[c+3|0]=K[b+3|0];H[c+4|0]=K[b+4|0];H[c+5|0]=K[b+5|0];H[c+6|0]=K[b+6|0];H[c+7|0]=K[b+7|0];c=c+8|0;b=b+8|0;if((h|0)!=(b|0)){continue}break}}H[c|0]=0;f=K[e+31|0];c=f<<24>>24;b=(c|0)<0;e:{f:{g:{f=b?J[e+24>>2]:f;h:{if(!f){break h}b=b?J[e+20>>2]:e+20|0;h=f+b|0;while(1){if(H[K[b|0]+5584|0]<0){break h}b=b+1|0;if((h|0)!=(b|0)){continue}break}if(!(f&1)){break g}}H[a+16|0]=0;H[a|0]=0;break f}J[5996]=0;aa(31,e+8|0,e+20|0);b=J[5996];J[5996]=0;if((b|0)==1){break e}c=J[e+12>>2];b=J[e+8>>2];i:{if((c-b|0)==(d|0)){d=J[e+16>>2];H[a+16|0]=1;J[a+12>>2]=g;J[a+8>>2]=d;J[a+4>>2]=c;J[a>>2]=b;break i}H[a+16|0]=0;H[a|0]=0;if(!b){break i}$a(b);}c=K[e+31|0];}if(c<<24>>24>=0){break a}$a(J[e+20>>2]);break a}a=Z()|0;if(H[e+31|0]<0){$a(J[e+20>>2]);}da(a|0);B();}ub();B();}Ua=e+32|0;}function wk(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a=Ua-144|0;Ua=a;J[a+136>>2]=c;J[a+140>>2]=b;J[a+20>>2]=220;b=a+24|0;J[b>>2]=a+32;i=a+20|0;J[b+4>>2]=J[i>>2];j=a+16|0;h=J[e+28>>2];J[j>>2]=h;J[h+4>>2]=J[h+4>>2]+1;J[5996]=0;h=$(170,J[a+16>>2])|0;k=J[5996];J[5996]=0;if((k|0)!=1){a:{H[a+15|0]=0;e=J[e+4>>2];J[5996]=0;c=ua(221,a+140|0,c|0,d|0,j|0,e|0,f|0,a+15|0,h|0,b|0,i|0,a+132|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}b:{c:{if(!c){break c}d:{if((K[g+11|0]&128)>>>7|0){H[J[g>>2]]=0;J[g+4>>2]=0;break d}H[g|0]=0;H[g+11|0]=0;}if(K[a+15|0]){J[5996]=0;c=_(171,h|0,45)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}J[5996]=0;aa(98,g|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break a}}J[5996]=0;d=_(171,h|0,48)|0;c=J[5996];J[5996]=0;if((c|0)==1){break b}e=J[a+20>>2];h=e-1|0;c=J[b>>2];d=d&255;while(1){if(!((d|0)!=K[c|0]|c>>>0>=h>>>0)){c=c+1|0;continue}break}J[5996]=0;ba(227,g|0,c|0,e|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break c}break a}J[5996]=0;c=_(186,a+140|0,a+136|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}if(c){J[f>>2]=J[f>>2]|2;}e=J[a+140>>2];c=J[a+16>>2];d=J[c+4>>2]-1|0;J[c+4>>2]=d;if((d|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}db(b);Ua=a+144|0;return e|0}}}d=Z()|0;a=J[a+16>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}db(b);da(d|0);B();}function ok(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a=Ua-448|0;Ua=a;J[a+440>>2]=c;J[a+444>>2]=b;J[a+20>>2]=220;b=a+24|0;J[b>>2]=a+32;i=a+20|0;J[b+4>>2]=J[i>>2];j=a+16|0;h=J[e+28>>2];J[j>>2]=h;J[h+4>>2]=J[h+4>>2]+1;J[5996]=0;h=$(197,J[a+16>>2])|0;k=J[5996];J[5996]=0;if((k|0)!=1){a:{H[a+15|0]=0;e=J[e+4>>2];J[5996]=0;c=ua(228,a+444|0,c|0,d|0,j|0,e|0,f|0,a+15|0,h|0,b|0,i|0,a+432|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}b:{c:{if(!c){break c}d:{if((K[g+11|0]&128)>>>7|0){J[J[g>>2]>>2]=0;J[g+4>>2]=0;break d}J[g>>2]=0;H[g+11|0]=0;}if(K[a+15|0]){J[5996]=0;c=_(216,h|0,45)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}J[5996]=0;aa(232,g|0,c|0);c=J[5996];J[5996]=0;if((c|0)==1){break a}}J[5996]=0;d=_(216,h|0,48)|0;c=J[5996];J[5996]=0;if((c|0)==1){break b}e=J[a+20>>2];h=e-4|0;c=J[b>>2];while(1){if(!((d|0)!=J[c>>2]|c>>>0>=h>>>0)){c=c+4|0;continue}break}J[5996]=0;ba(234,g|0,c|0,e|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break c}break a}J[5996]=0;c=_(202,a+444|0,a+440|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}if(c){J[f>>2]=J[f>>2]|2;}e=J[a+444>>2];c=J[a+16>>2];d=J[c+4>>2]-1|0;J[c+4>>2]=d;if((d|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}db(b);Ua=a+448|0;return e|0}}}d=Z()|0;a=J[a+16>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}db(b);da(d|0);B();}\n\t\tfunction Hh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;if(Jb(a,J[b+8>>2],e)){if(!(J[b+28>>2]==1|J[b+4>>2]!=(c|0))){J[b+28>>2]=d;}return}a:{if(Jb(a,J[b>>2],e)){if(!(J[b+16>>2]!=(c|0)&J[b+20>>2]!=(c|0))){if((d|0)!=1){break a}J[b+32>>2]=1;return}J[b+32>>2]=d;b:{if(J[b+44>>2]==4){break b}f=a+16|0;h=f+(J[a+12>>2]<<3)|0;d=0;c:{d:{while(1){e:{if(f>>>0>=h>>>0){break e}I[b+52>>1]=0;Fd(J[f>>2],J[f+4>>2],b,c,c,1,e);if(K[b+54|0]){break e}f:{if(!K[b+53|0]){break f}if(K[b+52|0]){if(J[b+24>>2]!=1){d=1;g=1;if(K[a+8|0]&2){break f}}J[b+44>>2]=3;return}d=1;if(!(H[a+8|0]&1)){break d}}f=f+8|0;continue}break}if(!d){break c}}J[b+44>>2]=3;if(!g){break b}break a}J[b+44>>2]=4;if(g){break a}}J[b+20>>2]=c;J[b+40>>2]=J[b+40>>2]+1;if(J[b+36>>2]!=1|J[b+24>>2]!=2){break a}H[b+54|0]=1;return}g=J[a+12>>2];cd(J[a+16>>2],J[a+20>>2],b,c,d,e);f=a+24|0;g=(a+16|0)+(g<<3)|0;if(f>>>0>=g>>>0){break a}a=J[a+8>>2];if(!(!(a&2)&J[b+36>>2]!=1)){while(1){if(K[b+54|0]){break a}cd(J[f>>2],J[f+4>>2],b,c,d,e);f=f+8|0;if(g>>>0>f>>>0){continue}break}break a}if(!(a&1)){while(1){if(K[b+54|0]|J[b+36>>2]==1){break a}cd(J[f>>2],J[f+4>>2],b,c,d,e);f=f+8|0;if(g>>>0>f>>>0){continue}break a}}while(1){if(K[b+54|0]|J[b+36>>2]==1&J[b+24>>2]==1){break a}cd(J[f>>2],J[f+4>>2],b,c,d,e);f=f+8|0;if(g>>>0>f>>>0){continue}break}}}function Qe(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0;a=Ua-16|0;Ua=a;J[a+12>>2]=c;J[a+8>>2]=f;J[a+12>>2]=c;J[a+8>>2]=f;c=J[a+12>>2];a:{while(1){if(c>>>0>=d>>>0){f=0;break a}b:{b=L[c>>1];c:{if(b>>>0<=127){f=1;c=J[a+8>>2];if((g-c|0)<=0){break a}J[a+8>>2]=c+1;H[c|0]=b;break c}if(b>>>0<=2047){c=J[a+8>>2];if((g-c|0)<2){break b}J[a+8>>2]=c+1;H[c|0]=b>>>6|192;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b&63|128;break c}if(b>>>0<=55295){c=J[a+8>>2];if((g-c|0)<3){break b}J[a+8>>2]=c+1;H[c|0]=b>>>12|224;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b>>>6&63|128;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b&63|128;break c}d:{e:{if(b>>>0<=56319){f=1;if((d-c|0)<4){break a}i=L[c+2>>1];if((i&64512)!=56320){break e}if((g-J[a+8>>2]|0)<4){break a}J[a+12>>2]=c+2;c=J[a+8>>2];J[a+8>>2]=c+1;f=c;c=(b>>>6&15)+1|0;H[f|0]=c>>>2|240;f=J[a+8>>2];J[a+8>>2]=f+1;H[f|0]=c<<4&48|b>>>2&15|128;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=i>>>6&15|b<<4&48|128;b=J[a+8>>2];J[a+8>>2]=b+1;H[b|0]=i&63|128;break c}if(b>>>0>=57344){break d}}f=2;break a}c=J[a+8>>2];if((g-c|0)<3){break b}J[a+8>>2]=c+1;H[c|0]=b>>>12|224;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b>>>6&63|128;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b&63|128;}c=J[a+12>>2]+2|0;J[a+12>>2]=c;continue}break}f=1;}J[e>>2]=J[a+12>>2];J[h>>2]=J[a+8>>2];Ua=a+16|0;return f|0}function Yn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;c=J[a+4>>2];d=J[a+8>>2];if(c>>>0<d>>>0){J[c>>2]=J[b>>2];J[c+4>>2]=J[b+4>>2];J[b>>2]=0;J[b+4>>2]=0;e=J[b+28>>2];J[c+24>>2]=J[b+24>>2];J[c+28>>2]=e;e=J[b+20>>2];J[c+16>>2]=J[b+16>>2];J[c+20>>2]=e;e=J[b+12>>2];J[c+8>>2]=J[b+8>>2];J[c+12>>2]=e;J[a+4>>2]=c+32;return}a:{h=J[a>>2];f=c-h>>5;e=f+1|0;if(e>>>0<134217728){d=d-h|0;g=d>>4;g=d>>>0>=2147483616?134217727:e>>>0<g>>>0?g:e;if(g){if(g>>>0>=134217728){break a}e=cb(g<<5);}else {e=0;}d=e+(f<<5)|0;J[d>>2]=J[b>>2];J[d+4>>2]=J[b+4>>2];J[b>>2]=0;J[b+4>>2]=0;f=J[b+28>>2];J[d+24>>2]=J[b+24>>2];J[d+28>>2]=f;f=J[b+20>>2];J[d+16>>2]=J[b+16>>2];J[d+20>>2]=f;f=J[b+12>>2];J[d+8>>2]=J[b+8>>2];J[d+12>>2]=f;f=d+32|0;if((c|0)!=(h|0)){while(1){d=d-32|0;c=c-32|0;J[d>>2]=J[c>>2];J[d+4>>2]=J[c+4>>2];J[c>>2]=0;J[c+4>>2]=0;b=J[c+28>>2];J[d+24>>2]=J[c+24>>2];J[d+28>>2]=b;b=J[c+20>>2];J[d+16>>2]=J[c+16>>2];J[d+20>>2]=b;b=J[c+12>>2];J[d+8>>2]=J[c+8>>2];J[d+12>>2]=b;if((c|0)!=(h|0)){continue}break}}J[a+8>>2]=e+(g<<5);b=J[a>>2];J[a>>2]=d;c=J[a+4>>2];J[a+4>>2]=f;if((b|0)!=(c|0)){while(1){c=c-32|0;a=J[c+4>>2];b:{if(!a){break b}e=J[a+4>>2];J[a+4>>2]=e-1;if(e){break b}Xa[J[J[a>>2]+8>>2]](a);bb(a);}if((b|0)!=(c|0)){continue}break}}if(b){$a(b);}return}nb();B();}Pb();B();}function hg(a,b){var c=0,d=0,e=0,f=0,g=0;a:{b:{c:{d:{e:{f:{c=J[a+4>>2];g:{if((c|0)!=J[a+104>>2]){J[a+4>>2]=c+1;c=K[c|0];break g}c=gb(a);}switch(c-43|0){case 0:case 2:break f;default:break e}}g=(c|0)==45;b=!b;c=J[a+4>>2];h:{if((c|0)!=J[a+104>>2]){J[a+4>>2]=c+1;c=K[c|0];break h}c=gb(a);}d=c-58|0;if(b|d>>>0>4294967285){break d}b=J[a+116>>2];if((b|0)>0|(b|0)>=0){break c}break a}d=c-58|0;}if(d>>>0<=4294967285){if(J[a+116>>2]<0){break a}break b}i:{if(c-48>>>0>=10){break i}while(1){e=(P(e,10)+c|0)-48|0;f=(e|0)<214748364;c=J[a+4>>2];j:{if((c|0)!=J[a+104>>2]){J[a+4>>2]=c+1;c=K[c|0];break j}c=gb(a);}b=c-48|0;if(f&b>>>0<=9){continue}break}f=e>>31;if(b>>>0>=10){break i}while(1){b=c;c=co(e,f,10,0);d=b+c|0;b=Wa;e=d-48|0;d=(c>>>0>d>>>0?b+1|0:b)-(d>>>0<48)|0;f=d;d=e>>>0<2061584302&(d|0)<=21474836|(d|0)<21474836;c=J[a+4>>2];k:{if((c|0)!=J[a+104>>2]){J[a+4>>2]=c+1;c=K[c|0];break k}c=gb(a);}b=c-48|0;if(d&b>>>0<=9){continue}break}if(b>>>0>=10){break i}while(1){b=J[a+4>>2];l:{if((b|0)!=J[a+104>>2]){J[a+4>>2]=b+1;b=K[b|0];break l}b=gb(a);}if(b-48>>>0<10){continue}break}}b=J[a+116>>2];if((b|0)>0|(b|0)>=0){J[a+4>>2]=J[a+4>>2]-1;}Wa=g?0-(((e|0)!=0)+f|0)|0:f;return g?0-e|0:e}J[a+4>>2]=J[a+4>>2]-1;}J[a+4>>2]=J[a+4>>2]-1;}Wa=-2147483648;return 0}function Se(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0;a=Ua-16|0;Ua=a;J[a+12>>2]=c;J[a+8>>2]=f;J[a+12>>2]=c;J[a+8>>2]=f;a:{b:{while(1){b=J[a+12>>2];if(!(d>>>0<=b>>>0|f>>>0>=g>>>0)){i=H[b|0];c=i&255;c:{if((i|0)>=0){i=1;break c}k=2;if(i>>>0<4294967234){break a}if(i>>>0<=4294967263){if((d-b|0)<2){break b}i=K[b+1|0];if((i&192)!=128){break a}c=i&63|c<<6&1984;i=2;break c}if(i>>>0<=4294967279){if((d-b|0)<3){break b}j=K[b+2|0];i=K[b+1|0];d:{e:{if((c|0)!=237){if((c|0)!=224){break e}if((i&224)==160){break d}break a}if((i&224)==128){break d}break a}if((i&192)!=128){break a}}if((j&192)!=128){break a}c=j&63|(c<<12&61440|(i&63)<<6);i=3;break c}if(i>>>0>4294967284){break a}if((d-b|0)<4){break b}l=K[b+3|0];m=K[b+2|0];j=K[b+1|0];f:{g:{switch(c-240|0){case 0:if((j+112&255)>>>0<48){break f}break a;case 4:if((j&240)==128){break f}break a;default:break g}}if((j&192)!=128){break a}}if((m&192)!=128|(l&192)!=128){break a}i=4;c=l&63|(m<<6&4032|(c<<18&1835008|(j&63)<<12));if(c>>>0>1114111){break a}}J[f>>2]=c;J[a+12>>2]=b+i;f=J[a+8>>2]+4|0;J[a+8>>2]=f;continue}break}k=b>>>0<d>>>0;break a}k=1;}J[e>>2]=J[a+12>>2];J[h>>2]=J[a+8>>2];Ua=a+16|0;return k|0}function Wn(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=Ua-32|0;Ua=f;J[a+8>>2]=0;J[a+12>>2]=0;J[a+4>>2]=e;J[a>>2]=b;J[a+16>>2]=0;J[a+8>>2]=J[d>>2];J[a+12>>2]=J[d+4>>2];J[a+16>>2]=J[d+8>>2];J[d+8>>2]=0;J[d>>2]=0;J[d+4>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+20>>2]=0;J[a+24>>2]=0;J[a+32>>2]=J[c>>2];J[a+36>>2]=J[c+4>>2];J[a+40>>2]=J[c+8>>2];J[c+8>>2]=0;J[c>>2]=0;J[c+4>>2]=0;J[5996]=0;aa(86,a+44|0,a|0);b=J[5996];J[5996]=0;a:{if((b|0)==1){break a}J[5996]=0;aa(87,a- -64|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}c=0;J[5996]=0;b=$(88,a|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}J[a+80>>2]=b;b=J[a+32>>2];e=J[a+36>>2];if((b|0)==(e|0)){d=0;}else {d=b;while(1){c=J[J[d>>2]+84>>2]+c|0;d=d+8|0;if((e|0)!=(d|0)){continue}break}d=J[J[b>>2]+80>>2];}g=J[a+4>>2];h=J[a>>2];i=J[a+8>>2];j=J[a+12>>2];J[5996]=0;b=ka(89,h|0,d|0,c|0,g|0,e-b>>3,(j-i|0)/12|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[a+84>>2]=b;J[5996]=0;J[f+28>>2]=a;ea(90,f+12|0,a|0,f+28|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}b=K[f+24|0];if(b){Db(J[f+16>>2]);}H[a+88|0]=b^1;Ua=f+32|0;return a|0}c=Z()|0;lb(a+32|0);b=J[a+20>>2];if(b){J[a+24>>2]=b;$a(b);}rb(a+8|0);da(c|0);B();}function Km(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;g=Ua-32|0;Ua=g;d=cb(104);J[d>>2]=7e3;J[d+4>>2]=0;J[d+8>>2]=0;e=J[c+8>>2];J[c+8>>2]=0;f=J[c>>2];h=J[c+4>>2];J[c>>2]=0;J[c+4>>2]=0;J[d+16>>2]=0;J[d+20>>2]=0;J[d+12>>2]=b;J[d+24>>2]=0;J[d+28>>2]=0;J[d+52>>2]=0;i=d+44|0;b=i;J[b>>2]=0;J[b+4>>2]=0;J[d+40>>2]=e;J[d+32>>2]=f;J[d+36>>2]=h;J[5996]=0;f=d+12|0;aa(86,d+56|0,f|0);b=J[5996];J[5996]=0;a:{if((b|0)==1){break a}J[5996]=0;aa(87,d+76|0,f|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}b=0;J[5996]=0;c=$(88,f|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break a}J[d+92>>2]=c;h=J[d+48>>2];e=J[d+44>>2];if((h|0)==(e|0)){c=0;}else {c=e;while(1){b=J[J[c>>2]+84>>2]+b|0;c=c+8|0;if((h|0)!=(c|0)){continue}break}c=J[J[e>>2]+80>>2];}j=J[d+16>>2];k=J[d+12>>2];l=J[d+20>>2];m=J[d+24>>2];J[5996]=0;b=ka(89,k|0,c|0,b|0,j|0,h-e>>3,(m-l|0)/12|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[d+96>>2]=b;J[5996]=0;J[g+28>>2]=f;ea(90,g+12|0,f|0,g+28|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}b=K[g+24|0];if(b){Db(J[g+16>>2]);}H[d+100|0]=b^1;J[a+4>>2]=d;J[a>>2]=f;Ua=g+32|0;return}b=Z()|0;lb(i);a=J[d+32>>2];if(a){J[d+36>>2]=a;$a(a);}rb(d+20|0);$a(d);da(b|0);B();}function sh(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-32|0;Ua=g;h=1;a:{b:{c:{d:{switch(a|0){case 3:h=24;break c;case 4:case 5:J[g+24>>2]=0;J[g+28>>2]=0;J[g+16>>2]=0;J[g+20>>2]=0;J[g+8>>2]=0;J[g+12>>2]=0;J[g>>2]=0;J[g+4>>2]=0;J[5996]=0;a=nc(g,d,0);b=J[5996];J[5996]=0;if((b|0)==1){h=Z()|0;if(M[g>>2]<29){break a}break b}a=J[a>>2];b=a>>>0<29;h=(b?a:a-29|0)+1|0;if(b){break c}$a(J[g+8>>2]);break c;case 6:case 7:h=39;break c;case 8:case 9:h=27;break c;case 25:h=(P(f,34)|d>>>0>16)+(f>>>0>16?4:3)|0;break c;case 17:h=c;break c;case 14:h=!(Wb(1239,1)&(b^-1))+c|0;break c;case 11:case 12:case 16:case 18:case 19:h=c+1|0;break c;case 10:case 20:h=c+2|0;break c;case 13:case 21:case 22:case 23:h=c+3|0;break c;case 15:h=c+4|0;break c;case 24:J[g+24>>2]=0;J[g+28>>2]=0;J[g+16>>2]=0;J[g+20>>2]=0;J[g+8>>2]=0;J[g+12>>2]=0;J[g>>2]=0;J[g+4>>2]=0;J[5996]=0;a=nc(g,d,0);b=J[5996];J[5996]=0;if((b|0)==1){h=Z()|0;if(M[g>>2]>=29){break b}break a}a=J[a>>2];b=a>>>0<29;h=(c+e|0)+(b?a:a-29|0)|0;if(b){break c}$a(J[g+8>>2]);break c;default:la(2350,1859,280,2003);B();case 0:case 1:break c;case 2:break d}}h=34;}Ua=g+32|0;return h|0}$a(J[g+8>>2]);}da(h|0);B();}function cn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;g=J[a+8>>2];e=J[a+4>>2];if(g-e>>>0>=b>>>0){d=e;h=b&7;if(h){while(1){H[d|0]=K[c|0];d=d+1|0;f=f+1|0;if((h|0)!=(f|0)){continue}break}}b=b+e|0;while(1){H[d|0]=K[c|0];H[d+1|0]=K[c|0];H[d+2|0]=K[c|0];H[d+3|0]=K[c|0];H[d+4|0]=K[c|0];H[d+5|0]=K[c|0];H[d+6|0]=K[c|0];H[d+7|0]=K[c|0];d=d+8|0;if((b|0)!=(d|0)){continue}break}J[a+4>>2]=b;return}d=J[a>>2];f=e-d|0;i=f+b|0;if((i|0)>=0){g=g-d|0;d=g<<1;i=g>>>0>=1073741823?2147483647:d>>>0>i>>>0?d:i;if(i){j=cb(i);}f=f+j|0;d=f;g=b&7;if(g){while(1){H[d|0]=K[c|0];d=d+1|0;h=h+1|0;if((g|0)!=(h|0)){continue}break}}h=b+f|0;while(1){H[d|0]=K[c|0];H[d+1|0]=K[c|0];H[d+2|0]=K[c|0];H[d+3|0]=K[c|0];H[d+4|0]=K[c|0];H[d+5|0]=K[c|0];H[d+6|0]=K[c|0];H[d+7|0]=K[c|0];d=d+8|0;if((h|0)!=(d|0)){continue}break}g=J[a>>2];if((g|0)!=(e|0)){d=(g^-1)+e|0;b=e-g&3;if(b){c=0;while(1){f=f-1|0;e=e-1|0;H[f|0]=K[e|0];c=c+1|0;if((b|0)!=(c|0)){continue}break}}if(d>>>0>=3){while(1){H[f-1|0]=K[e-1|0];H[f-2|0]=K[e-2|0];H[f-3|0]=K[e-3|0];f=f-4|0;e=e-4|0;H[f|0]=K[e|0];if((e|0)!=(g|0)){continue}break}}e=J[a>>2];}J[a+8>>2]=i+j;J[a+4>>2]=h;J[a>>2]=f;if(e){$a(e);}return}nb();B();}function qe(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=Ua-16|0;Ua=m;g=K[a|0];a:{if(!g){f=a;break a}f=a;b:{while(1){i=g<<24>>24;if(!((i|0)==32|i-9>>>0<5)){break b}g=K[f+1|0];f=f+1|0;if(g){continue}break}break a}c:{g=g&255;switch(g-43|0){case 0:case 2:break c;default:break a}}j=(g|0)==45?-1:0;f=f+1|0;}d:{if(!((c|16)!=16|K[f|0]!=48)){o=1;if((K[f+1|0]&223)==88){f=f+2|0;i=16;break d}f=f+1|0;i=c?c:8;break d}i=c?c:10;}c=0;while(1){e:{g=-48;k=H[f|0];f:{if((k-48&255)>>>0<10){break f}g=-87;if((k-97&255)>>>0<26){break f}g=-55;if((k-65&255)>>>0>25){break e}}n=g+k|0;if((n|0)>=(i|0)){break e}xb(m,i,0,0,0,l,h,0,0);g=1;g:{if(J[m+8>>2]|J[m+12>>2]){break g}p=co(l,h,i,0);k=Wa;if((k|0)==-1&(n^-1)>>>0<p>>>0){break g}h=k;l=n+p|0;h=l>>>0<n>>>0?h+1|0:h;o=1;g=c;}f=f+1|0;c=g;continue}break}if(b){J[b>>2]=o?f:a;}h:{i:{j:{if(c){J[5732]=68;a=d&1;j=a?0:j;l=d;h=e;break j}if((e|0)==(h|0)&d>>>0>l>>>0|e>>>0>h>>>0){break i}a=d&1;}if(!(a|j)){J[5732]=68;a=d;d=a-1|0;e=e-!a|0;break h}if((e|0)==(h|0)&d>>>0>=l>>>0|e>>>0>h>>>0){break i}J[5732]=68;break h}a=j^l;d=a-j|0;b=j>>31;e=(b^h)-((a>>>0<j>>>0)+b|0)|0;}Ua=m+16|0;Wa=e;return d}function gk(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0;k=Ua-16|0;Ua=k;a:{if(a){a=qf(c);b:{if(b){b=k+4|0;Xa[J[J[a>>2]+44>>2]](b,a);c=J[k+4>>2];H[d|0]=c;H[d+1|0]=c>>>8;H[d+2|0]=c>>>16;H[d+3|0]=c>>>24;Xa[J[J[a>>2]+32>>2]](b,a);break b}b=k+4|0;Xa[J[J[a>>2]+40>>2]](b,a);c=J[k+4>>2];H[d|0]=c;H[d+1|0]=c>>>8;H[d+2|0]=c>>>16;H[d+3|0]=c>>>24;Xa[J[J[a>>2]+28>>2]](b,a);}ac(i,b);ab(b);J[e>>2]=Xa[J[J[a>>2]+12>>2]](a);J[f>>2]=Xa[J[J[a>>2]+16>>2]](a);b=k+4|0;Xa[J[J[a>>2]+20>>2]](b,a);Ab(g,b);ab(b);Xa[J[J[a>>2]+24>>2]](b,a);ac(h,b);ab(b);a=Xa[J[J[a>>2]+36>>2]](a)|0;break a}a=pf(c);c:{if(b){b=k+4|0;Xa[J[J[a>>2]+44>>2]](b,a);c=J[k+4>>2];H[d|0]=c;H[d+1|0]=c>>>8;H[d+2|0]=c>>>16;H[d+3|0]=c>>>24;Xa[J[J[a>>2]+32>>2]](b,a);break c}b=k+4|0;Xa[J[J[a>>2]+40>>2]](b,a);c=J[k+4>>2];H[d|0]=c;H[d+1|0]=c>>>8;H[d+2|0]=c>>>16;H[d+3|0]=c>>>24;Xa[J[J[a>>2]+28>>2]](b,a);}ac(i,b);ab(b);J[e>>2]=Xa[J[J[a>>2]+12>>2]](a);J[f>>2]=Xa[J[J[a>>2]+16>>2]](a);b=k+4|0;Xa[J[J[a>>2]+20>>2]](b,a);Ab(g,b);ab(b);Xa[J[J[a>>2]+24>>2]](b,a);ac(h,b);ab(b);a=Xa[J[J[a>>2]+36>>2]](a)|0;}J[j>>2]=a;Ua=k+16|0;}function fb(a,b,c){var d=0,e=0,f=0;if(c>>>0>=512){Ia(a|0,b|0,c|0);return a}e=a+c|0;a:{if(!((a^b)&3)){b:{if(!(a&3)){c=a;break b}if(!c){c=a;break b}c=a;while(1){H[c|0]=K[b|0];b=b+1|0;c=c+1|0;if(!(c&3)){break b}if(c>>>0<e>>>0){continue}break}}d=e&-4;c:{if(d>>>0<64){break c}f=d+-64|0;if(f>>>0<c>>>0){break c}while(1){J[c>>2]=J[b>>2];J[c+4>>2]=J[b+4>>2];J[c+8>>2]=J[b+8>>2];J[c+12>>2]=J[b+12>>2];J[c+16>>2]=J[b+16>>2];J[c+20>>2]=J[b+20>>2];J[c+24>>2]=J[b+24>>2];J[c+28>>2]=J[b+28>>2];J[c+32>>2]=J[b+32>>2];J[c+36>>2]=J[b+36>>2];J[c+40>>2]=J[b+40>>2];J[c+44>>2]=J[b+44>>2];J[c+48>>2]=J[b+48>>2];J[c+52>>2]=J[b+52>>2];J[c+56>>2]=J[b+56>>2];J[c+60>>2]=J[b+60>>2];b=b- -64|0;c=c- -64|0;if(f>>>0>=c>>>0){continue}break}}if(c>>>0>=d>>>0){break a}while(1){J[c>>2]=J[b>>2];b=b+4|0;c=c+4|0;if(d>>>0>c>>>0){continue}break}break a}if(e>>>0<4){c=a;break a}d=e-4|0;if(d>>>0<a>>>0){c=a;break a}c=a;while(1){H[c|0]=K[b|0];H[c+1|0]=K[b+1|0];H[c+2|0]=K[b+2|0];H[c+3|0]=K[b+3|0];b=b+4|0;c=c+4|0;if(d>>>0>=c>>>0){continue}break}}if(c>>>0<e>>>0){while(1){H[c|0]=K[b|0];b=b+1|0;c=c+1|0;if((e|0)!=(c|0)){continue}break}}return a}function kk(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0;k=Ua-16|0;Ua=k;a:{if(a){a=tf(c);b:{if(b){b=k+4|0;Xa[J[J[a>>2]+44>>2]](b,a);c=J[k+4>>2];H[d|0]=c;H[d+1|0]=c>>>8;H[d+2|0]=c>>>16;H[d+3|0]=c>>>24;Xa[J[J[a>>2]+32>>2]](b,a);break b}b=k+4|0;Xa[J[J[a>>2]+40>>2]](b,a);c=J[k+4>>2];H[d|0]=c;H[d+1|0]=c>>>8;H[d+2|0]=c>>>16;H[d+3|0]=c>>>24;Xa[J[J[a>>2]+28>>2]](b,a);}Ab(i,b);ab(b);H[e|0]=Xa[J[J[a>>2]+12>>2]](a);H[f|0]=Xa[J[J[a>>2]+16>>2]](a);b=k+4|0;Xa[J[J[a>>2]+20>>2]](b,a);Ab(g,b);ab(b);Xa[J[J[a>>2]+24>>2]](b,a);Ab(h,b);ab(b);a=Xa[J[J[a>>2]+36>>2]](a)|0;break a}a=sf(c);c:{if(b){b=k+4|0;Xa[J[J[a>>2]+44>>2]](b,a);c=J[k+4>>2];H[d|0]=c;H[d+1|0]=c>>>8;H[d+2|0]=c>>>16;H[d+3|0]=c>>>24;Xa[J[J[a>>2]+32>>2]](b,a);break c}b=k+4|0;Xa[J[J[a>>2]+40>>2]](b,a);c=J[k+4>>2];H[d|0]=c;H[d+1|0]=c>>>8;H[d+2|0]=c>>>16;H[d+3|0]=c>>>24;Xa[J[J[a>>2]+28>>2]](b,a);}Ab(i,b);ab(b);H[e|0]=Xa[J[J[a>>2]+12>>2]](a);H[f|0]=Xa[J[J[a>>2]+16>>2]](a);b=k+4|0;Xa[J[J[a>>2]+20>>2]](b,a);Ab(g,b);ab(b);Xa[J[J[a>>2]+24>>2]](b,a);Ab(h,b);ab(b);a=Xa[J[J[a>>2]+36>>2]](a)|0;}J[j>>2]=a;Ua=k+16|0;}function Un(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=Ua-32|0;Ua=e;J[a+8>>2]=0;J[a+12>>2]=0;J[a+4>>2]=d;J[a>>2]=b;J[a+16>>2]=0;J[a+20>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;g=a+32|0;b=g;J[b>>2]=0;J[b+4>>2]=0;J[a+40>>2]=0;J[b>>2]=J[c>>2];J[a+36>>2]=J[c+4>>2];J[a+40>>2]=J[c+8>>2];J[c+8>>2]=0;J[c>>2]=0;J[c+4>>2]=0;J[5996]=0;aa(86,a+44|0,a|0);b=J[5996];J[5996]=0;a:{if((b|0)==1){break a}J[5996]=0;aa(87,a- -64|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}d=0;J[5996]=0;b=$(88,a|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[a+80>>2]=b;f=J[a+36>>2];b=J[a+32>>2];if((f|0)==(b|0)){c=0;}else {c=b;while(1){d=J[J[c>>2]+84>>2]+d|0;c=c+8|0;if((f|0)!=(c|0)){continue}break}c=J[J[b>>2]+80>>2];}h=J[a+4>>2];i=J[a>>2];j=J[a+8>>2];k=J[a+12>>2];J[5996]=0;b=ka(89,i|0,c|0,d|0,h|0,f-b>>3,(k-j|0)/12|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[a+84>>2]=b;J[5996]=0;J[e+28>>2]=a;ea(90,e+12|0,a|0,e+28|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}b=K[e+24|0];if(b){Db(J[e+16>>2]);}H[a+88|0]=b^1;Ua=e+32|0;return a|0}c=Z()|0;lb(g);b=J[a+20>>2];if(b){J[a+24>>2]=b;$a(b);}rb(a+8|0);da(c|0);B();}function Dm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=Ua-32|0;Ua=e;J[a+8>>2]=0;J[a+12>>2]=0;J[a+4>>2]=d;J[a>>2]=b;J[a+16>>2]=0;J[a+8>>2]=J[c>>2];J[a+12>>2]=J[c+4>>2];J[a+16>>2]=J[c+8>>2];J[c+8>>2]=0;J[c>>2]=0;J[c+4>>2]=0;J[a+36>>2]=0;J[a+40>>2]=0;J[a+28>>2]=0;J[a+32>>2]=0;J[a+20>>2]=0;J[a+24>>2]=0;J[5996]=0;aa(86,a+44|0,a|0);b=J[5996];J[5996]=0;a:{if((b|0)==1){break a}J[5996]=0;aa(87,a- -64|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}d=0;J[5996]=0;b=$(88,a|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[a+80>>2]=b;f=J[a+36>>2];b=J[a+32>>2];if((f|0)==(b|0)){c=0;}else {c=b;while(1){d=J[J[c>>2]+84>>2]+d|0;c=c+8|0;if((f|0)!=(c|0)){continue}break}c=J[J[b>>2]+80>>2];}g=J[a+4>>2];h=J[a>>2];i=J[a+8>>2];j=J[a+12>>2];J[5996]=0;b=ka(89,h|0,c|0,d|0,g|0,f-b>>3,(j-i|0)/12|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[a+84>>2]=b;J[5996]=0;J[e+28>>2]=a;ea(90,e+12|0,a|0,e+28|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}b=K[e+24|0];if(b){Db(J[e+16>>2]);}H[a+88|0]=b^1;Ua=e+32|0;return a|0}c=Z()|0;lb(a+32|0);b=J[a+20>>2];if(b){J[a+24>>2]=b;$a(b);}rb(a+8|0);da(c|0);B();}function Zm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;d=Ua-16|0;Ua=d;J[5996]=0;f=_(134,d+8|0,a|0)|0;c=J[5996];J[5996]=0;a:{b:{c:{if((c|0)!=1){d:{if(!K[f|0]){break d}c=J[(J[J[a>>2]-12>>2]+a|0)+28>>2];J[d+4>>2]=c;J[c+4>>2]=J[c+4>>2]+1;J[5996]=0;h=$(135,J[d+4>>2])|0;c=J[5996];J[5996]=0;e:{f:{if((c|0)!=1){c=J[d+4>>2];e=J[c+4>>2]-1|0;J[c+4>>2]=e;if((e|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}J[d+4>>2]=J[(J[J[a>>2]-12>>2]+a|0)+24>>2];c=J[J[a>>2]-12>>2];J[5996]=0;c=a+c|0;e=$(136,c|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break f}g=J[d+4>>2];J[5996]=0;b=xa(137,h|0,g|0,c|0,e|0,b|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break f}if(b){break d}b=J[J[a>>2]-12>>2];J[5996]=0;aa(138,a+b|0,5);b=J[5996];J[5996]=0;if((b|0)!=1){break d}b=fa(0)|0;break e}b=fa(0)|0;c=J[d+4>>2];e=J[c+4>>2]-1|0;J[c+4>>2]=e;if((e|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}break e}b=fa(0)|0;}ud(f);break c}ud(f);break b}b=fa(0)|0;}pa(b|0)|0;b=J[J[a>>2]-12>>2];J[5996]=0;ha(139,a+b|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}ra();}Ua=d+16|0;return a|0}a=Z()|0;J[5996]=0;ca(110);b=J[5996];J[5996]=0;if((b|0)!=1){da(a|0);B();}fa(0)|0;Vb();B();}function Sn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=Ua-32|0;Ua=e;J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;H[e+4|0]=0;J[e>>2]=a;a:{b:{c:{d:{e:{if(c){if(c>>>0>=357913942){J[5996]=0;ca(47);a=J[5996];J[5996]=0;if((a|0)==1){break c}break a}J[5996]=0;c=P(c,12);g=$(3,c|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break c}J[a+4>>2]=g;J[a>>2]=g;J[a+8>>2]=c+g;J[e+24>>2]=g;H[e+20|0]=0;J[e+8>>2]=a+8;j=b+c|0;J[e+16>>2]=e+28;J[e+12>>2]=e+24;d=g;while(1){J[d+8>>2]=0;J[d>>2]=0;J[d+4>>2]=0;f=J[b>>2];c=J[b+4>>2];if((f|0)!=(c|0)){h=c-f|0;if((h|0)<0){J[5996]=0;J[e+28>>2]=d;ca(84);b=J[5996];J[5996]=0;if((b|0)!=1){break a}c=Z()|0;b=J[d>>2];if(!b){break d}J[d+4>>2]=b;$a(b);break d}J[5996]=0;c=$(3,h|0)|0;i=J[5996];J[5996]=0;if((i|0)==1){break e}J[d+4>>2]=c;J[d>>2]=c;J[d+8>>2]=(h&-8)+c;h=J[b+4>>2];if((h|0)!=(f|0)){while(1){i=J[f+4>>2];J[c>>2]=J[f>>2];J[c+4>>2]=i;c=c+8|0;f=f+8|0;if((h|0)!=(f|0)){continue}break}}J[d+4>>2]=c;}d=d+12|0;b=b+12|0;if((j|0)!=(b|0)){continue}break}J[a+4>>2]=d;}Ua=e+32|0;return a|0}c=Z()|0;J[e+28>>2]=d;}Ed(e+8|0);J[a+4>>2]=g;break b}c=Z()|0;}Nc(e);da(c|0);B();}B();}function pk(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;h=J[b>>2];c=H[b+11|0];J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;b=(c|0)<0?h:b;c=0;h=0;a:{b:{c:{while(1){e=d;g=c;f=h;while(1){c=K[b|0];if(!(c-9>>>0>=5&(c|0)!=32)){b=b+1|0;continue}d=K[c+5584|0];if((d|0)==255){break a}c=K[K[b+1|0]+5584|0];if((c|0)==255){break a}b=b+2|0;h=c|d<<4;if((e|0)!=(f|0)){H[f|0]=h;f=f+1|0;J[a+4>>2]=f;continue}break}i=f-g|0;d=i+1|0;if((d|0)<0){J[5996]=0;ca(8);b=J[5996];J[5996]=0;if((b|0)==1){break c}B();}d:{c=i<<1;d=i>>>0>=1073741823?2147483647:c>>>0>d>>>0?c:d;e:{if(!d){j=0;break e}J[5996]=0;j=$(3,d|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break d}}c=i+j|0;H[c|0]=h;d=d+j|0;h=c+1|0;if((e|0)!=(g|0)){k=(g^-1)+f|0;f=0;i=i&3;if(i){while(1){c=c-1|0;e=e-1|0;H[c|0]=K[e|0];f=f+1|0;if((i|0)!=(f|0)){continue}break}}if(k>>>0>=3){while(1){H[c-1|0]=K[e-1|0];H[c-2|0]=K[e-2|0];H[c-3|0]=K[e-3|0];c=c-4|0;e=e-4|0;H[c|0]=K[e|0];if((e|0)!=(g|0)){continue}break}}c=j;}J[a+8>>2]=d;J[a+4>>2]=h;J[a>>2]=c;if(!g){continue}$a(g);continue}break}b=Z()|0;break b}b=Z()|0;g=J[a>>2];}if(g){J[a+4>>2]=g;$a(g);}da(b|0);B();}}function vd(a,b,c,d,e,f){var g=0,h=0;H[a|0]=0;H[a+1|0]=0;H[a+2|0]=0;H[a+3|0]=0;H[a+4|0]=0;H[a+5|0]=0;H[a+6|0]=0;H[a+7|0]=0;H[a+24|0]=0;H[a+25|0]=0;H[a+26|0]=0;H[a+27|0]=0;H[a+28|0]=0;H[a+29|0]=0;H[a+30|0]=0;H[a+31|0]=0;H[a+16|0]=0;H[a+17|0]=0;H[a+18|0]=0;H[a+19|0]=0;H[a+20|0]=0;H[a+21|0]=0;H[a+22|0]=0;H[a+23|0]=0;H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;H[a+12|0]=0;H[a+13|0]=0;H[a+14|0]=0;H[a+15|0]=0;J[5996]=0;g=_(127,a|0,130)|0;h=J[5996];J[5996]=0;if((h|0)!=1){a:{b=J[b>>2];J[5996]=0;b=nc(g,b,b>>31);g=J[5996];J[5996]=0;if((g|0)==1){break a}c=J[c>>2];J[5996]=0;b=_(127,b|0,c|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}c=J[d>>2];J[5996]=0;b=_(127,b|0,c|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[5996]=0;b=_(19,b|0,e|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}c=J[f>>2];J[5996]=0;_(127,b|0,c|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}return}}b=Z()|0;if((K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))>>>0>=29){$a(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24));H[a+8|0]=0;H[a+9|0]=0;H[a+10|0]=0;H[a+11|0]=0;}da(b|0);B();}function _d(a,b,c,d,e,f,g,h,i,j,k,l){a:{b:{if((a|0)==(f|0)){if(!K[b|0]){break a}f=0;H[b|0]=0;a=J[e>>2];J[e>>2]=a+1;H[a|0]=46;a=K[h+11|0];if(!((a&128)>>>7|0?J[h+4>>2]:a&127)){break b}a=J[j>>2];if((a-i|0)>159){break b}b=J[k>>2];J[j>>2]=a+4;J[a>>2]=b;return 0}c:{if((a|0)!=(g|0)){break c}f=K[h+11|0];if(!((f&128)>>>7|0?J[h+4>>2]:f&127)){break c}if(!K[b|0]){break a}f=0;a=J[j>>2];if((a-i|0)>159){break b}b=J[k>>2];J[j>>2]=a+4;J[a>>2]=b;J[k>>2]=0;return 0}f=-1;g=be(l,l+32|0,a)-l|0;if((g|0)>31){break b}a=H[g+12416|0];d:{e:{switch((g&-2)-22|0){case 2:b=J[e>>2];if((b|0)!=(d|0)){d=H[b-1|0];c=H[c|0];if(((d-97>>>0<26?d&95:d)|0)!=((c-97>>>0<26?c&95:c)|0)){break b}}J[e>>2]=b+1;H[b|0]=a;return 0;case 0:H[c|0]=80;break d;default:break e}}d=a-97>>>0<26?a&95:a;if((d|0)!=H[c|0]){break d}H[c|0]=d-65>>>0<26?d|32:d;if(!K[b|0]){break d}H[b|0]=0;b=K[h+11|0];if(!((b&128)>>>7|0?J[h+4>>2]:b&127)){break d}b=J[j>>2];if((b-i|0)>159){break d}c=J[k>>2];J[j>>2]=b+4;J[b>>2]=c;}b=J[e>>2];J[e>>2]=b+1;H[b|0]=a;f=0;if((g|0)>21){break b}J[k>>2]=J[k>>2]+1;}return f}return -1}function Wd(a,b,c,d,e,f,g,h,i,j,k,l){a:{b:{if((a|0)==(f|0)){if(!K[b|0]){break a}f=0;H[b|0]=0;a=J[e>>2];J[e>>2]=a+1;H[a|0]=46;a=K[h+11|0];if(!((a&128)>>>7|0?J[h+4>>2]:a&127)){break b}a=J[j>>2];if((a-i|0)>159){break b}b=J[k>>2];J[j>>2]=a+4;J[a>>2]=b;return 0}c:{if((a|0)!=(g|0)){break c}f=K[h+11|0];if(!((f&128)>>>7|0?J[h+4>>2]:f&127)){break c}if(!K[b|0]){break a}f=0;a=J[j>>2];if((a-i|0)>159){break b}b=J[k>>2];J[j>>2]=a+4;J[a>>2]=b;J[k>>2]=0;return 0}f=-1;g=Yd(l,l+128|0,a)-l|0;if((g|0)>124){break b}a=H[(g>>2)+12416|0];d:{e:{l=g&-5;if((l|0)!=88){if((l|0)!=96){break e}b=J[e>>2];if((b|0)!=(d|0)){d=H[b-1|0];c=H[c|0];if(((d-97>>>0<26?d&95:d)|0)!=((c-97>>>0<26?c&95:c)|0)){break b}}J[e>>2]=b+1;H[b|0]=a;return 0}H[c|0]=80;break d}d=a-97>>>0<26?a&95:a;if((d|0)!=H[c|0]){break d}H[c|0]=d-65>>>0<26?d|32:d;if(!K[b|0]){break d}H[b|0]=0;b=K[h+11|0];if(!((b&128)>>>7|0?J[h+4>>2]:b&127)){break d}b=J[j>>2];if((b-i|0)>159){break d}c=J[k>>2];J[j>>2]=b+4;J[b>>2]=c;}b=J[e>>2];J[e>>2]=b+1;H[b|0]=a;f=0;if((g|0)>84){break b}J[k>>2]=J[k>>2]+1;}return f}return -1}function Tl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;if((c|0)!=1){l=Ua-1040|0;Ua=l;q=J[5732];a:{b:{g=l+16|0;n=L[((c>>>0<=153?c:0)<<1)+21296>>1]+19372|0;b=J[J[6178]+20>>2];if(b){h=J[b+4>>2];d=J[b>>2];f=J[d>>2]+1794895138|0;i=wc(J[d+8>>2],f);j=wc(J[d+12>>2],f);e=wc(J[d+16>>2],f);c:{if(h>>>2>>>0<=i>>>0){break c}b=h-(i<<2)|0;if((e|j)&3|(b>>>0<=j>>>0|b>>>0<=e>>>0)){break c}r=e>>>2|0;s=j>>>2|0;while(1){m=i>>>1|0;j=m+o|0;e=j<<1;b=d+(e+s<<2)|0;p=wc(J[b>>2],f);b=wc(J[b+4>>2],f);if(b>>>0>=h>>>0|h-b>>>0<=p>>>0|K[d+(b+p|0)|0]){break c}b=Uc(n,b+d|0);if(!b){b=d+(e+r<<2)|0;e=wc(J[b>>2],f);b=wc(J[b+4>>2],f);if(b>>>0>=h>>>0|e>>>0>=h-b>>>0){break c}k=K[d+(b+e|0)|0]?0:b+d|0;break c}if((i|0)==1){break c}b=(b|0)<0;i=b?m:i-m|0;o=b?o:j;continue}}}k=k?k:n;b=Gb(k);d:{if(b>>>0>=1024){fb(g,k,1023);H[g+1023|0]=0;b=68;break d}fb(g,k,b+1|0);b=0;}if(b){if((b|0)!=28){break b}b=5575;}else {b=g;}break a}za();B();}if(!K[b|0]){J[l>>2]=c;od(g,1024,2507,l);b=g;}J[5732]=q;Kb(a,b);Ua=l+1040|0;return}Kb(a,1694);}function li(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;f=Ua-32|0;Ua=f;J[f+28>>2]=d;J[f+24>>2]=d;H[f+20|0]=0;J[f+8>>2]=a;J[f+16>>2]=f+28;J[f+12>>2]=f+24;a:{b:{c:{if((b|0)!=(c|0)){while(1){J[d+8>>2]=0;J[d>>2]=0;J[d+4>>2]=0;a=J[b+4>>2];e=J[b>>2];if((a|0)!=(e|0)){e=a-e|0;if((e|0)<0){J[5996]=0;ca(8);a=J[5996];J[5996]=0;if((a|0)==1){break c}B();}J[5996]=0;a=$(3,e|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break b}J[d+4>>2]=a;J[d>>2]=a;J[d+8>>2]=a+e;e=J[b>>2];g=J[b+4>>2];d:{if((e|0)==(g|0)){break d}j=(e^-1)+g|0;h=0;i=g-e&7;if(i){while(1){H[a|0]=K[e|0];a=a+1|0;e=e+1|0;h=h+1|0;if((i|0)!=(h|0)){continue}break}}if(j>>>0<7){break d}while(1){H[a|0]=K[e|0];H[a+1|0]=K[e+1|0];H[a+2|0]=K[e+2|0];H[a+3|0]=K[e+3|0];H[a+4|0]=K[e+4|0];H[a+5|0]=K[e+5|0];H[a+6|0]=K[e+6|0];H[a+7|0]=K[e+7|0];a=a+8|0;e=e+8|0;if((g|0)!=(e|0)){continue}break}}J[d+4>>2]=a;}d=d+12|0;J[f+28>>2]=d;b=b+12|0;if((c|0)!=(b|0)){continue}break}}Ua=f+32|0;return d|0}a=Z()|0;b=J[d>>2];if(!b){break a}J[d+4>>2]=b;$a(b);break a}a=Z()|0;}Ed(f+8|0);da(a|0);B();}function zd(a,b){var c=0,d=0,e=0;c=(a|0)==(b|0);H[b+12|0]=c;a:{if(c){break a}while(1){d=J[b+8>>2];if(K[d+12|0]){break a}b:{c=J[d+8>>2];e=J[c>>2];if((e|0)==(d|0)){e=J[c+4>>2];if(!(!e|K[e+12|0])){break b}c:{if(J[d>>2]==(b|0)){b=d;break c}b=J[d+4>>2];a=J[b>>2];J[d+4>>2]=a;if(a){J[a+8>>2]=d;c=J[d+8>>2];}J[b+8>>2]=c;a=J[d+8>>2];J[((J[a>>2]!=(d|0))<<2)+a>>2]=b;J[b>>2]=d;J[d+8>>2]=b;c=J[b+8>>2];d=J[c>>2];}H[b+12|0]=1;H[c+12|0]=0;a=J[d+4>>2];J[c>>2]=a;if(a){J[a+8>>2]=c;}J[d+8>>2]=J[c+8>>2];a=J[c+8>>2];J[((J[a>>2]!=(c|0))<<2)+a>>2]=d;J[d+4>>2]=c;J[c+8>>2]=d;return}if(!(K[e+12|0]|!e)){break b}d:{if(J[d>>2]!=(b|0)){b=d;break d}a=J[b+4>>2];J[d>>2]=a;if(a){J[a+8>>2]=d;c=J[d+8>>2];}J[b+8>>2]=c;a=J[d+8>>2];J[((J[a>>2]!=(d|0))<<2)+a>>2]=b;J[b+4>>2]=d;J[d+8>>2]=b;c=J[b+8>>2];}H[b+12|0]=1;H[c+12|0]=0;a=J[c+4>>2];b=J[a>>2];J[c+4>>2]=b;if(b){J[b+8>>2]=c;}J[a+8>>2]=J[c+8>>2];b=J[c+8>>2];J[((J[b>>2]!=(c|0))<<2)+b>>2]=a;J[a>>2]=c;J[c+8>>2]=a;break a}H[d+12|0]=1;H[c+12|0]=(a|0)==(c|0);H[e+12|0]=1;b=c;if((a|0)!=(c|0)){continue}break}}}function Tn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;a:{b:{c:{d:{e:{f:{e=J[b+4>>2];d=J[b>>2];if((e|0)!=(d|0)){d=e-d|0;if((d|0)<0){J[5996]=0;ca(85);b=J[5996];J[5996]=0;if((b|0)==1){break f}break a}J[5996]=0;e=$(3,d|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break f}J[a+4>>2]=e;J[a>>2]=e;J[a+8>>2]=(d&-8)+e;d=J[b>>2];b=J[b+4>>2];if((d|0)!=(b|0)){while(1){O[e>>3]=O[d>>3];e=e+8|0;d=d+8|0;if((b|0)!=(d|0)){continue}break}}J[a+4>>2]=e;}J[a+12>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;b=J[c+4>>2];e=J[c>>2];if((b|0)==(e|0)){break d}b=b-e|0;if((b|0)>=0){break e}J[5996]=0;ca(85);b=J[5996];J[5996]=0;if((b|0)!=1){break a}break c}d=Z()|0;break b}J[5996]=0;e=$(3,b|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break c}J[a+16>>2]=e;J[a+12>>2]=e;J[a+20>>2]=(b&-8)+e;d=J[c>>2];b=J[c+4>>2];if((d|0)!=(b|0)){while(1){O[e>>3]=O[d>>3];e=e+8|0;d=d+8|0;if((b|0)!=(d|0)){continue}break}}J[a+16>>2]=e;}return a|0}d=Z()|0;b=J[a+12>>2];if(!b){break b}J[a+16>>2]=b;$a(b);}b=J[a>>2];if(b){J[a+4>>2]=b;$a(b);}da(d|0);B();}B();}function Tm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;d=Ua-32|0;Ua=d;J[a+8>>2]=0;J[a+12>>2]=0;J[a+4>>2]=c;J[a>>2]=b;J[a+16>>2]=0;J[a+20>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;f=a+32|0;J[f>>2]=0;J[f+4>>2]=0;J[a+40>>2]=0;J[5996]=0;aa(86,a+44|0,a|0);b=J[5996];J[5996]=0;a:{if((b|0)==1){break a}J[5996]=0;aa(87,a- -64|0,a|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}b=0;J[5996]=0;c=$(88,a|0)|0;e=J[5996];J[5996]=0;if((e|0)==1){break a}J[a+80>>2]=c;e=J[a+32>>2];g=J[a+36>>2];if((e|0)==(g|0)){c=0;}else {c=e;while(1){b=J[J[c>>2]+84>>2]+b|0;c=c+8|0;if((g|0)!=(c|0)){continue}break}c=J[J[e>>2]+80>>2];}h=J[a+4>>2];i=J[a>>2];j=J[a+8>>2];k=J[a+12>>2];J[5996]=0;b=ka(89,i|0,c|0,b|0,h|0,g-e>>3,(k-j|0)/12|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[a+84>>2]=b;J[5996]=0;J[d+28>>2]=a;ea(90,d+12|0,a|0,d+28|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}b=K[d+24|0];if(b){Db(J[d+16>>2]);}H[a+88|0]=b^1;Ua=d+32|0;return a|0}c=Z()|0;lb(f);b=J[a+20>>2];if(b){J[a+24>>2]=b;$a(b);}rb(a+8|0);da(c|0);B();}\n\t\tfunction Pn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;a:{if(c){if(c>>>0>=536870912){J[5996]=0;ca(84);b=J[5996];J[5996]=0;if((b|0)==1){break a}B();}J[5996]=0;e=c<<3;d=$(3,e|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break a}J[a+4>>2]=d;J[a>>2]=d;J[a+8>>2]=d+e;f=c-1&536870911;g=c&7;b:{if(!g){c=b;break b}c=b;while(1){i=J[c+4>>2];J[d>>2]=J[c>>2];J[d+4>>2]=i;d=d+8|0;c=c+8|0;h=h+1|0;if((h|0)!=(g|0)){continue}break}}if(f>>>0>=7){b=b+e|0;while(1){e=J[c+4>>2];J[d>>2]=J[c>>2];J[d+4>>2]=e;e=J[c+12>>2];J[d+8>>2]=J[c+8>>2];J[d+12>>2]=e;e=J[c+20>>2];J[d+16>>2]=J[c+16>>2];J[d+20>>2]=e;e=J[c+28>>2];J[d+24>>2]=J[c+24>>2];J[d+28>>2]=e;e=J[c+36>>2];J[d+32>>2]=J[c+32>>2];J[d+36>>2]=e;e=J[c+44>>2];J[d+40>>2]=J[c+40>>2];J[d+44>>2]=e;e=J[c+52>>2];J[d+48>>2]=J[c+48>>2];J[d+52>>2]=e;e=J[c+60>>2];J[d+56>>2]=J[c+56>>2];J[d+60>>2]=e;d=d- -64|0;c=c- -64|0;if((b|0)!=(c|0)){continue}break}}J[a+4>>2]=d;}return a|0}c=Z()|0;b=J[a>>2];if(b){J[a+4>>2]=b;$a(b);}da(c|0);B();}function ge(a,b,c,d){var e=0,f=0,g=0,h=0;g=Ua-32|0;Ua=g;e=d&2147483647;h=e;f=e-1006698496|0;e=e-1140785152|0;a:{if((f|0)==(e|0)&0|e>>>0>f>>>0){e=c<<4|b>>>28;c=d<<4|c>>>28;b=b&268435455;if((b|0)==134217728&(a|0)!=0|b>>>0>134217728){f=c+1073741824|0;e=e+1|0;f=e?f:f+1|0;break a}f=c+1073741824|0;if(a|(b|0)!=134217728){break a}a=e&1;e=a+e|0;f=a>>>0>e>>>0?f+1|0:f;break a}if(!(!c&(h|0)==2147418112?!(a|b):h>>>0<2147418112)){a=d<<4|c>>>28;e=c<<4|b>>>28;f=a&524287|2146959360;break a}e=0;f=2146435072;if(h>>>0>1140785151){break a}f=0;h=h>>>16|0;if(h>>>0<15249){break a}e=d&65535|65536;Cb(g+16|0,a,b,c,e,h-15233|0);xc(g,a,b,c,e,15361-h|0);b=J[g+8>>2];e=b<<4;b=J[g+12>>2]<<4|b>>>28;c=J[g>>2];f=J[g+4>>2];h=f;e=f>>>28|e;f=b;a=h&268435455;b=c|(J[g+16>>2]|J[g+24>>2]|(J[g+20>>2]|J[g+28>>2]))!=0;if((a|0)==134217728&(b|0)!=0|a>>>0>134217728){e=e+1|0;f=e?f:f+1|0;break a}if(b|(a|0)!=134217728){break a}a=e;e=e+(e&1)|0;f=a>>>0>e>>>0?f+1|0:f;}Ua=g+32|0;x(0,e|0);x(1,d&-2147483648|f);return +z()}function pn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=Ua-16|0;Ua=d;J[d+12>>2]=b;if(b>>>0<2147483632){a:{if(((K[a+11|0]&128)>>>7|0?(J[a+8>>2]&2147483647)-1|0:10)>>>0>=b>>>0){break a}b=K[a+11|0];J[d+8>>2]=(b&128)>>>7|0?J[a+4>>2]:b&127;c=J[(M[d+12>>2]<M[d+8>>2]?d+8|0:d+12|0)>>2];if(c>>>0>=11){c=c+16&-16;e=c-1|0;c=(e|0)==11?c:e;}else {c=10;}if((c|0)==(((K[a+11|0]&128)>>>7|0?(J[a+8>>2]&2147483647)-1|0:10)|0)){break a}f=Ua-16|0;Ua=f;b=K[a+11|0];e=(b&128)>>>7|0?J[a+4>>2]:b&127;b:{c:{i=c>>>0<11;d:{if(i){j=1;g=c+1|0;h=J[a>>2];c=e;b=a;break d}g=c+1|0;e:{if(c>>>0>((K[a+11|0]&128)>>>7|0?(J[a+8>>2]&2147483647)-1|0:10)>>>0){Gc(f+8|0,g);break e}J[5996]=0;aa(289,f+8|0,g|0);b=J[5996];J[5996]=0;if((b|0)==1){break c}}g=J[f+12>>2];c=K[a+11|0];b=(c&128)>>>7|0;j=b;h=b?J[a>>2]:a;c=b?J[a+4>>2]:c&127;b=J[f+8>>2];}b=gc(b,h,c+1|0);if(j){$a(h);}if(!i){J[a+8>>2]=g|-2147483648;J[a+4>>2]=e;J[a>>2]=b;break b}H[a+11|0]=e;break b}pa(fa(0)|0)|0;ra();}Ua=f+16|0;}Ua=d+16|0;return}ub();B();}function Cd(a){var b=0,c=0,d=0,e=0,f=0;d=J[5726];c=a+7&-8;b=d+c|0;a:{b:{if(b>>>0<=d>>>0?c:0){break b}if(b>>>0>Ya()<<16>>>0){if(!(Qa(b|0)|0)){break b}}J[5726]=b;break a}J[5732]=48;d=-1;}if((d|0)!=-1){a=a+d|0;J[a-4>>2]=16;c=a-16|0;J[c>>2]=16;b=J[5992];if(b){f=J[b+8>>2];}else {f=0;}c:{d:{if((f|0)==(d|0)){e=d-(J[d-4>>2]&-2)|0;f=J[e-4>>2];J[b+8>>2]=a;a=e-(f&-2)|0;b=-16;if(!(H[(a+J[a>>2]|0)-4|0]&1)){break d}b=J[a+4>>2];J[b+8>>2]=J[a+8>>2];J[J[a+8>>2]+4>>2]=b;b=c-a|0;J[a>>2]=b;break c}J[d+12>>2]=16;J[d>>2]=16;J[d+8>>2]=a;J[d+4>>2]=b;J[5992]=d;b=16;}a=b+d|0;b=c-a|0;J[a>>2]=b;}J[((b&-4)+a|0)-4>>2]=b|1;c=J[a>>2]-8|0;e:{if(c>>>0<=127){b=(c>>>3|0)-1|0;break e}e=S(c);b=((c>>>29-e^4)-(e<<2)|0)+110|0;if(c>>>0<=4095){break e}b=((c>>>30-e^2)-(e<<1)|0)+71|0;b=b>>>0>=63?63:b;}c=b<<4;J[a+4>>2]=c+22944;c=c+22952|0;J[a+8>>2]=J[c>>2];J[c>>2]=a;J[J[a+8>>2]+4>>2]=a;c=J[5994];e=J[5995];a=b&31;if((b&63)>>>0>=32){b=1<<a;f=0;}else {f=1<<a;b=f-1&1>>>32-a;}J[5994]=f|c;J[5995]=b|e;}return (d|0)!=-1}function Te(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;a=Ua-16|0;Ua=a;J[a+12>>2]=c;J[a+8>>2]=f;J[a+12>>2]=c;J[a+8>>2]=f;b=J[a+12>>2];a:{while(1){if(b>>>0>=d>>>0){c=0;break a}c=2;b=J[b>>2];if(b>>>0>1114111|(b&-2048)==55296){break a}b:{c:{if(b>>>0<=127){c=1;f=J[a+8>>2];if((g-f|0)<=0){break a}J[a+8>>2]=f+1;H[f|0]=b;break c}if(b>>>0<=2047){c=J[a+8>>2];if((g-c|0)<2){break b}J[a+8>>2]=c+1;H[c|0]=b>>>6|192;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b&63|128;break c}c=J[a+8>>2];f=g-c|0;if(b>>>0<=65535){if((f|0)<3){break b}J[a+8>>2]=c+1;H[c|0]=b>>>12|224;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b>>>6&63|128;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b&63|128;break c}if((f|0)<4){break b}J[a+8>>2]=c+1;H[c|0]=b>>>18|240;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b>>>12&63|128;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b>>>6&63|128;c=J[a+8>>2];J[a+8>>2]=c+1;H[c|0]=b&63|128;}b=J[a+12>>2]+4|0;J[a+12>>2]=b;continue}break}c=1;}J[e>>2]=J[a+12>>2];J[h>>2]=J[a+8>>2];Ua=a+16|0;return c|0}function Yg(a){var b=0,c=0,d=0,e=0,f=0;J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;a:{b:{c:{d:{e:{f:{c=J[6141];d=J[6142];if((c|0)!=(d|0)){e=d-c|0;if((e|0)<0){J[5996]=0;ca(85);b=J[5996];J[5996]=0;if((b|0)==1){break f}break a}J[5996]=0;b=$(3,e|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break f}J[a+4>>2]=b;J[a>>2]=b;J[a+8>>2]=(e&-8)+b;while(1){O[b>>3]=O[c>>3];b=b+8|0;c=c+8|0;if((d|0)!=(c|0)){continue}break}J[a+4>>2]=b;}J[a+12>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;c=J[6144];d=J[6145];if((c|0)==(d|0)){break d}e=d-c|0;if((e|0)>=0){break e}J[5996]=0;ca(85);b=J[5996];J[5996]=0;if((b|0)!=1){break a}break c}c=Z()|0;break b}J[5996]=0;b=$(3,e|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break c}J[a+16>>2]=b;J[a+12>>2]=b;J[a+20>>2]=(e&-8)+b;while(1){O[b>>3]=O[c>>3];b=b+8|0;c=c+8|0;if((d|0)!=(c|0)){continue}break}J[a+16>>2]=b;}return a}c=Z()|0;b=J[a+12>>2];if(!b){break b}J[a+16>>2]=b;$a(b);}b=J[a>>2];if(b){J[a+4>>2]=b;$a(b);}da(c|0);B();}B();}function Oe(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;b=0;a=c;while(1){a:{if(a>>>0>=d>>>0|b>>>0>=e>>>0){break a}g=1;f=H[a|0];b:{if((f|0)>=0){break b}if(f>>>0<4294967234){break a}if(f>>>0<=4294967263){if((d-a|0)<2){break a}g=2;if((K[a+1|0]&192)!=128){break a}break b}g=f&255;if(f>>>0<=4294967279){if((d-a|0)<3){break a}h=K[a+2|0];f=K[a+1|0];c:{d:{if((g|0)!=237){if((g|0)!=224){break d}if((f&224)==160){break c}break a}if((f&224)!=128){break a}break c}if((f&192)!=128){break a}}g=3;if((h&192)!=128){break a}break b}if((d-a|0)<4|f>>>0>4294967284|e-b>>>0<2){break a}h=K[a+3|0];i=K[a+2|0];f=K[a+1|0];e:{f:{switch(g-240|0){case 0:if((f+112&255)>>>0>=48){break a}break e;case 4:if((f&240)!=128){break a}break e;default:break f}}if((f&192)!=128){break a}}if((i&192)!=128|(h&192)!=128|(g<<18&1835008|(f&48)<<12)>>>0>1114111){break a}b=b+1|0;g=4;}b=b+1|0;a=a+g|0;continue}break}return a-c|0}function gh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;c=Ua-32|0;Ua=c;J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;H[c+4|0]=0;J[c>>2]=a;e=J[b+4>>2];f=J[b>>2];g=e-f|0;d=(g|0)/12|0;a:{b:{c:{if((e|0)!=(f|0)){if(d>>>0>=357913942){J[5996]=0;ca(41);a=J[5996];J[5996]=0;if((a|0)==1){break c}B();}J[5996]=0;e=$(3,g|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break c}J[a+4>>2]=e;J[a>>2]=e;J[a+8>>2]=e+P(d,12);f=J[b+4>>2];b=J[b>>2];J[c+28>>2]=e;J[c+24>>2]=e;H[c+20|0]=0;J[c+8>>2]=a+8;J[c+16>>2]=c+28;J[c+12>>2]=c+24;d:{if((b|0)==(f|0)){d=e;break d}d=e;while(1){e:{if(H[b+11|0]>=0){g=J[b+4>>2];J[d>>2]=J[b>>2];J[d+4>>2]=g;J[d+8>>2]=J[b+8>>2];break e}g=J[b+4>>2];h=J[b>>2];J[5996]=0;ea(40,d|0,h|0,g|0);d=J[5996];J[5996]=0;if((d|0)==1){break b}d=J[c+28>>2];}d=d+12|0;J[c+28>>2]=d;b=b+12|0;if((f|0)!=(b|0)){continue}break}}J[a+4>>2]=d;}Ua=c+32|0;return a|0}b=Z()|0;break a}b=Z()|0;Wg(c+8|0);J[a+4>>2]=e;}Vg(c);da(b|0);B();}function Re(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;a=c;while(1){a:{if(e>>>0<=i>>>0|a>>>0>=d>>>0){break a}f=1;b=H[a|0];b:{if((b|0)>=0){break b}if(b>>>0<4294967234){break a}if(b>>>0<=4294967263){if((d-a|0)<2){break a}f=2;if((K[a+1|0]&192)!=128){break a}break b}g=b&255;if(b>>>0<=4294967279){if((d-a|0)<3){break a}h=K[a+2|0];b=K[a+1|0];c:{d:{if((g|0)!=237){if((g|0)!=224){break d}if((b&224)==160){break c}break a}if((b&224)!=128){break a}break c}if((b&192)!=128){break a}}f=3;if((h&192)!=128){break a}break b}if((d-a|0)<4|b>>>0>4294967284){break a}f=K[a+3|0];h=K[a+2|0];b=K[a+1|0];e:{f:{switch(g-240|0){case 0:if((b+112&255)>>>0>=48){break a}break e;case 4:if((b&240)!=128){break a}break e;default:break f}}if((b&192)!=128){break a}}if((h&192)!=128|(f&192)!=128){break a}f=4;if((g<<18&1835008|(b&48)<<12)>>>0>1114111){break a}}i=i+1|0;a=a+f|0;continue}break}return a-c|0}function zk(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0;k=Ua-16|0;Ua=k;l=j;a:{if(a){j=k+4|0;a=tf(b);Xa[J[J[a>>2]+44>>2]](j,a);b=J[k+4>>2];H[c|0]=b;H[c+1|0]=b>>>8;H[c+2|0]=b>>>16;H[c+3|0]=b>>>24;Xa[J[J[a>>2]+32>>2]](j,a);Ab(i,j);ab(j);Xa[J[J[a>>2]+28>>2]](j,a);Ab(h,j);ab(j);H[d|0]=Xa[J[J[a>>2]+12>>2]](a);H[e|0]=Xa[J[J[a>>2]+16>>2]](a);Xa[J[J[a>>2]+20>>2]](j,a);Ab(f,j);ab(j);Xa[J[J[a>>2]+24>>2]](j,a);Ab(g,j);ab(k+4|0);a=Xa[J[J[a>>2]+36>>2]](a)|0;break a}j=k+4|0;a=sf(b);Xa[J[J[a>>2]+44>>2]](j,a);b=J[k+4>>2];H[c|0]=b;H[c+1|0]=b>>>8;H[c+2|0]=b>>>16;H[c+3|0]=b>>>24;Xa[J[J[a>>2]+32>>2]](j,a);Ab(i,j);ab(j);Xa[J[J[a>>2]+28>>2]](j,a);Ab(h,j);ab(j);H[d|0]=Xa[J[J[a>>2]+12>>2]](a);H[e|0]=Xa[J[J[a>>2]+16>>2]](a);Xa[J[J[a>>2]+20>>2]](j,a);Ab(f,j);ab(j);Xa[J[J[a>>2]+24>>2]](j,a);Ab(g,j);ab(k+4|0);a=Xa[J[J[a>>2]+36>>2]](a)|0;}J[l>>2]=a;Ua=k+16|0;}function sk(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0;k=Ua-16|0;Ua=k;l=j;a:{if(a){j=k+4|0;a=qf(b);Xa[J[J[a>>2]+44>>2]](j,a);b=J[k+4>>2];H[c|0]=b;H[c+1|0]=b>>>8;H[c+2|0]=b>>>16;H[c+3|0]=b>>>24;Xa[J[J[a>>2]+32>>2]](j,a);ac(i,j);ab(j);Xa[J[J[a>>2]+28>>2]](j,a);ac(h,j);ab(j);J[d>>2]=Xa[J[J[a>>2]+12>>2]](a);J[e>>2]=Xa[J[J[a>>2]+16>>2]](a);Xa[J[J[a>>2]+20>>2]](j,a);Ab(f,j);ab(j);Xa[J[J[a>>2]+24>>2]](j,a);ac(g,j);ab(j);a=Xa[J[J[a>>2]+36>>2]](a)|0;break a}j=k+4|0;a=pf(b);Xa[J[J[a>>2]+44>>2]](j,a);b=J[k+4>>2];H[c|0]=b;H[c+1|0]=b>>>8;H[c+2|0]=b>>>16;H[c+3|0]=b>>>24;Xa[J[J[a>>2]+32>>2]](j,a);ac(i,j);ab(j);Xa[J[J[a>>2]+28>>2]](j,a);ac(h,j);ab(j);J[d>>2]=Xa[J[J[a>>2]+12>>2]](a);J[e>>2]=Xa[J[J[a>>2]+16>>2]](a);Xa[J[J[a>>2]+20>>2]](j,a);Ab(f,j);ab(j);Xa[J[J[a>>2]+24>>2]](j,a);ac(g,j);ab(j);a=Xa[J[J[a>>2]+36>>2]](a)|0;}J[l>>2]=a;Ua=k+16|0;}function gb(a){var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=J[a+112>>2];d=J[a+116>>2];g=(b|d)!=0;h=b;c=J[a+4>>2];f=J[a+44>>2];b=c-f|0;i=b;e=b+J[a+120>>2]|0;b=J[a+124>>2]+(b>>31)|0;a:{b=e>>>0<i>>>0?b+1|0:b;if(!(((b|0)>=(d|0)&e>>>0>=h>>>0|(b|0)>(d|0))&g)){d=Ua-16|0;Ua=d;c=-1;b:{if(Dg(a)){break b}if((Xa[J[a+32>>2]](a,d+15|0,1)|0)!=1){break b}c=K[d+15|0];}Ua=d+16|0;d=c;if((c|0)>=0){break a}f=J[a+44>>2];c=J[a+4>>2];}J[a+112>>2]=-1;J[a+116>>2]=-1;J[a+104>>2]=c;d=f-c|0;c=d+e|0;b=(d>>31)+b|0;J[a+120>>2]=c;J[a+124>>2]=c>>>0<d>>>0?b+1|0:b;return -1}c=e+1|0;b=c?b:b+1|0;h=J[a+4>>2];f=J[a+8>>2];e=J[a+116>>2];i=e;g=J[a+112>>2];c:{if(!(e|g)){break c}e=g-c|0;g=i-(b+(c>>>0>g>>>0)|0)|0;j=f-h|0;i=j>>31;if((g|0)>=(i|0)&e>>>0>=j>>>0|(g|0)>(i|0)){break c}f=e+h|0;}J[a+104>>2]=f;e=J[a+44>>2];f=e-h|0;c=f+c|0;b=(f>>31)+b|0;J[a+120>>2]=c;J[a+124>>2]=c>>>0<f>>>0?b+1|0:b;if(e>>>0>=h>>>0){H[h-1|0]=d;}return d}function $l(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;g=Ua-16|0;Ua=g;a:{b:{if((b|0)!=-1){i=J[a+8>>2];j=J[a+12>>2];d=J[a+24>>2];if((d|0)==J[a+28>>2]){e=-1;if(!(K[a+48|0]&16)){break a}k=J[a+44>>2];h=J[a+20>>2];J[5996]=0;c=a+32|0;aa(98,c|0,0);f=J[5996];J[5996]=0;if((f|0)==1){break b}f=(K[c+11|0]&128)>>>7|0?(J[c+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,c|0,f|0);f=J[5996];J[5996]=0;if((f|0)==1){break b}c=(K[c+11|0]&128)>>>7|0?J[c>>2]:c;e=K[a+43|0];J[a+28>>2]=c+((e&128)>>>7|0?J[a+36>>2]:e&127);J[a+20>>2]=c;J[a+24>>2]=c;J[a+24>>2]=J[a+24>>2]+(d-h|0);J[a+44>>2]=J[a+20>>2]+(k-h|0);d=J[a+24>>2];}J[g+12>>2]=d+1;d=a+44|0;c=g+12|0;c=J[(M[c>>2]<M[d>>2]?d:c)>>2];J[a+44>>2]=c;if(K[a+48|0]&8){d=a+32|0;d=(K[d+11|0]&128)>>>7|0?J[d>>2]:d;J[a+16>>2]=c;J[a+12>>2]=d+(j-i|0);J[a+8>>2]=d;}e=vg(a,b<<24>>24);break a}e=(b|0)!=-1?b:0;break a}pa(fa(0)|0)|0;ra();}Ua=g+16|0;return e|0}function Vf(a,b,c,d){var e=0,f=0,g=0,h=0;g=Ua-32|0;Ua=g;f=d&2147483647;e=f-1065418752|0;h=f-1082064896|0;a:{if((e|0)==(h|0)&0|e>>>0<h>>>0){f=(d&33554431)<<7|c>>>25;e=0;h=e;c=c&33554431;if(!(!e&(c|0)==16777216?!(a|b):!e&c>>>0<16777216)){e=f+1073741825|0;break a}e=f+1073741824|0;if(c^16777216|a|(b|h)){break a}e=(f&1)+e|0;break a}if(!(!c&(f|0)==2147418112?!(a|b):f>>>0<2147418112)){e=((d&33554431)<<7|c>>>25)&4194303|2143289344;break a}e=2139095040;if(f>>>0>1082064895){break a}e=0;f=f>>>16|0;if(f>>>0<16145){break a}e=d&65535|65536;Cb(g+16|0,a,b,c,e,f-16129|0);xc(g,a,b,c,e,16257-f|0);a=J[g+8>>2];e=(J[g+12>>2]&33554431)<<7|a>>>25;c=J[g>>2]|(J[g+16>>2]|J[g+24>>2]|(J[g+20>>2]|J[g+28>>2]))!=0;f=J[g+4>>2];b=0;a=a&33554431;if(!(!b&(a|0)==16777216?!(c|f):!b&a>>>0<16777216)){e=e+1|0;break a}if(a^16777216|c|(b|f)){break a}e=(e&1)+e|0;}Ua=g+32|0;return x(2,d&-2147483648|e),C()}function eo(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{if(b){if(!c){break j}break i}Wa=0;a=(a>>>0)/(c>>>0)|0;break a}if(!a){break h}break g}if(!(c-1&c)){break f}f=(S(c)+33|0)-S(b)|0;g=0-f|0;break d}Wa=0;a=(b>>>0)/0|0;break a}d=32-S(b)|0;if(d>>>0<31){break e}break c}if((c|0)==1){break b}f=c?31-S(c-1^c)|0:32;c=f&31;if((f&63)>>>0>=32){a=b>>>c|0;}else {d=b>>>c|0;a=((1<<c)-1&b)<<32-c|a>>>c;}Wa=d;break a}f=d+1|0;g=63-d|0;}d=f&63;e=d&31;if(d>>>0>=32){d=0;h=b>>>e|0;}else {d=b>>>e|0;h=((1<<e)-1&b)<<32-e|a>>>e;}g=g&63;e=g&31;if(g>>>0>=32){b=a<<e;a=0;}else {b=(1<<e)-1&a>>>32-e|b<<e;a=a<<e;}if(f){g=c-1|0;l=(g|0)==-1?-1:0;while(1){i=d<<1|h>>>31;d=h<<1|b>>>31;e=l-(i+(d>>>0>g>>>0)|0)>>31;j=c&e;h=d-j|0;d=i-(d>>>0<j>>>0)|0;b=b<<1|a>>>31;a=k|a<<1;k=e&1;f=f-1|0;if(f){continue}break}}Wa=b<<1|a>>>31;a=k|a<<1;break a}a=0;b=0;}Wa=b;}return a}function _l(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;i=J[b+44>>2];j=J[b+24>>2];if(i>>>0<j>>>0){J[b+44>>2]=j;i=j;}m=-1;n=-1;o=f&24;a:{if(!o|(e|0)==1&(o|0)==24){break a}if(i){g=b+32|0;g=i-((K[g+11|0]&128)>>>7|0?J[g>>2]:g)|0;k=g>>31;}b:{c:{switch(e|0){case 1:if(f&8){h=J[b+12>>2]-J[b+8>>2]|0;l=h>>31;break b}h=j-J[b+20>>2]|0;l=h>>31;break b;case 0:break b;case 2:break c;default:break a}}h=g;l=k;}d=d+l|0;c=c+h|0;d=h>>>0>c>>>0?d+1|0:d;if((d|0)<0|(c>>>0>g>>>0&(d|0)>=(k|0)|(d|0)>(k|0))){break a}e=f&8;d:{if(!(c|d)){break d}if(J[b+12>>2]?0:e){break a}if(!(f&16)){break d}if(!j){break a}}if(e){e=J[b+8>>2];J[b+16>>2]=i;J[b+12>>2]=c+e;J[b+8>>2]=e;}if(f&16){e=J[b+20>>2];J[b+28>>2]=J[b+28>>2];J[b+20>>2]=e;J[b+24>>2]=e;J[b+24>>2]=c+J[b+24>>2];}m=c;n=d;}J[a+8>>2]=m;J[a+12>>2]=n;J[a>>2]=0;J[a+4>>2]=0;}function fe(a){var b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=a;a:{if(b&3){while(1){c=K[b|0];if(!c|(c|0)==61){break a}b=b+1|0;if(b&3){continue}break}}c=J[b>>2];b:{if((c^-1)&c-16843009&-2139062144){break b}while(1){if((c^1027423549)-16843009&(c^-1)&-2139062144){break b}c=J[b+4>>2];b=b+4|0;if(!(c-16843009&(c^-1)&-2139062144)){continue}break}}while(1){c=b;d=K[b|0];if((d|0)!=61){b=b+1|0;if(d){continue}}break}b=c;}if((a|0)==(b|0)){return 0}f=b-a|0;c:{if(K[f+a|0]){break c}e=J[6181];if(!e){break c}b=J[e>>2];if(!b){break c}while(1){d:{g=a;c=b;h=f;d=0;e:{if(!f){break e}d=K[a|0];if(d){f:{while(1){i=K[c|0];if((i|0)!=(d|0)|!i){break f}h=h-1|0;if(!h){break f}c=c+1|0;d=K[g+1|0];g=g+1|0;if(d){continue}break}d=0;}}else {d=0;}d=d-K[c|0]|0;}if(!d){b=b+f|0;if(K[b|0]==61){break d}}b=J[e+4>>2];e=e+4|0;if(b){continue}break c}break}j=b+1|0;}return j}function Ob(a,b){a=a|0;b=b|0;var c=0,d=0;d=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);a:{b:{c:{if(b>>>0<=28){if(d>>>0<29){break c}b=K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24);fb(a+4|0,b,d-29|0);$a(b);b=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))-29|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;return}if(d>>>0>=29){c=Vc(K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24),b);H[a+8|0]=c;H[a+9|0]=c>>>8;H[a+10|0]=c>>>16;H[a+11|0]=c>>>24;if(!c){break b}H[a+4|0]=b;H[a+5|0]=b>>>8;H[a+6|0]=b>>>16;H[a+7|0]=b>>>24;return}c=sb(b);if(!c){break a}c=fb(c,a+4|0,d);H[a+4|0]=b;H[a+5|0]=b>>>8;H[a+6|0]=b>>>16;H[a+7|0]=b>>>24;H[a+8|0]=c;H[a+9|0]=c>>>8;H[a+10|0]=c>>>16;H[a+11|0]=c>>>24;b=d+29|0;H[a|0]=b;H[a+1|0]=b>>>8;H[a+2|0]=b>>>16;H[a+3|0]=b>>>24;}return}la(1370,2249,181,1040);B();}la(1357,2249,185,1040);B();}function pd(a,b,c,d){var e=0,f=0,g=0;e=Ua-160|0;Ua=e;f=b?a:e+158|0;J[e+148>>2]=f;a=-1;g=b-1|0;J[e+152>>2]=b>>>0>=g>>>0?g:0;e=Sb(e,0,144);J[e+76>>2]=-1;J[e+36>>2]=179;J[e+80>>2]=-1;J[e+44>>2]=e+159;J[e+84>>2]=e+148;a:{if((b|0)<0){J[5732]=61;break a}H[f|0]=0;f=0;b=Ua-208|0;Ua=b;J[b+204>>2]=d;a=b+160|0;Sb(a,0,40);J[b+200>>2]=J[b+204>>2];b:{if((Kg(0,c,b+200|0,b+80|0,a)|0)<0){a=-1;break b}d=J[e+76>>2]>=0;g=J[e>>2];J[e>>2]=g&-33;c:{d:{e:{if(!J[e+48>>2]){J[e+48>>2]=80;J[e+28>>2]=0;J[e+16>>2]=0;J[e+20>>2]=0;f=J[e+44>>2];J[e+44>>2]=b;break e}if(J[e+16>>2]){break d}}a=-1;if(Be(e)){break c}}a=Kg(e,c,b+200|0,b+80|0,b+160|0);}c=a;if(f){Xa[J[e+36>>2]](e,0,0)|0;J[e+48>>2]=0;J[e+44>>2]=f;J[e+28>>2]=0;a=J[e+20>>2];J[e+16>>2]=0;J[e+20>>2]=0;c=a?c:-1;}a=J[e>>2];J[e>>2]=a|g&32;a=a&32?-1:c;if(!d){break b}}Ua=b+208|0;}Ua=e+160|0;return a}function Ck(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;h=Ua-416|0;Ua=h;d=h+416|0;J[h+12>>2]=d;c=Ua-144|0;Ua=c;J[c+28>>2]=c+132;i=c+32|0;yf(J[a+8>>2],i,c+28|0,e,f,g);J[c+16>>2]=0;J[c+20>>2]=0;J[c+12>>2]=i;e=h+16|0;g=J[h+12>>2]-e>>2;f=Ua-16|0;Ua=f;a=Xb(f+12|0,J[a+8>>2]);g=bg(e,c+12|0,g,c+16|0);a=J[a>>2];if(a){J[6178]=(a|0)==-1?24816:a;}Ua=f+16|0;if((g|0)==-1){xf(2472);B();}J[h+12>>2]=e+(g<<2);Ua=c+144|0;c=Ua-16|0;Ua=c;a=Ua-32|0;Ua=a;f=Ua-16|0;Ua=f;J[f+12>>2]=J[h+12>>2];J[a+24>>2]=e;J[a+28>>2]=J[f+12>>2];Ua=f+16|0;f=J[a+24>>2];g=J[a+28>>2];e=Ua-16|0;Ua=e;J[e+12>>2]=b;while(1){if((f|0)!=(g|0)){pg(e+12|0,J[f>>2]);f=f+4|0;continue}break}J[a+16>>2]=g;J[a+20>>2]=J[e+12>>2];Ua=e+16|0;b=J[a+16>>2];J[a+12>>2]=J[a+20>>2];J[c+8>>2]=b;J[c+12>>2]=J[a+12>>2];Ua=a+32|0;Ua=c+16|0;Ua=d;return J[c+12>>2]}function Kc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0;e=Ua-32|0;Ua=e;h=e+32|0;c=h;d=e+21|0;f=c-d|0;a:{if((f|0)<=9){i=f;f=P(32-S(b|1)|0,1233)>>>12|0;g=61;if((i|0)<((M[(f<<2)+21616>>2]<=b>>>0)+f|0)){break a}}b:{if(b>>>0<=999999){if(b>>>0<=9999){if(b>>>0<=99){if(b>>>0<=9){H[d|0]=b+48;c=d+1|0;break b}c=uc(d,b);break b}if(b>>>0<=999){c=(b>>>0)/100|0;H[d|0]=c+48;c=uc(d+1|0,P(c,-100)+b|0);break b}c=Kd(d,b);break b}if(b>>>0<=99999){c=(b>>>0)/1e4|0;H[d|0]=c+48;c=Kd(d+1|0,P(c,-1e4)+b|0);break b}c=Jd(d,b);break b}if(b>>>0<=99999999){if(b>>>0<=9999999){c=(b>>>0)/1e6|0;H[d|0]=c+48;c=Jd(d+1|0,P(c,-1e6)+b|0);break b}c=Id(d,b);break b}if(b>>>0<=999999999){c=(b>>>0)/1e8|0;H[d|0]=c+48;c=Id(d+1|0,P(c,-1e8)+b|0);break b}c=(b>>>0)/1e8|0;c=Id(uc(d,c),P(c,-1e8)+b|0);}g=0;}J[e+16>>2]=g;J[e+12>>2]=c;td(a,d,J[e+12>>2]);Ua=h;}function ye(a,b,c){var d=0,e=0,f=0,g=0;d=a+4|0;e=(d+b|0)-1&0-b;b=J[a>>2];if(e+c>>>0<=(b+a|0)-4>>>0){f=J[a+4>>2];J[f+8>>2]=J[a+8>>2];J[J[a+8>>2]+4>>2]=f;if((d|0)!=(e|0)){e=e-d|0;f=a-(J[a-4>>2]&-2)|0;d=e+J[f>>2]|0;J[f>>2]=d;J[(f+(d&-4)|0)-4>>2]=d;a=a+e|0;b=b-e|0;J[a>>2]=b;}a:{if(c+24>>>0<=b>>>0){d=(a+c|0)+8|0;b=(b-c|0)-8|0;J[d>>2]=b;J[(d+(b&-4)|0)-4>>2]=b|1;e=J[d>>2]-8|0;b:{if(e>>>0<=127){b=(e>>>3|0)-1|0;break b}f=S(e);b=((e>>>29-f^4)-(f<<2)|0)+110|0;if(e>>>0<=4095){break b}b=((e>>>30-f^2)-(f<<1)|0)+71|0;b=b>>>0>=63?63:b;}e=b<<4;J[d+4>>2]=e+22944;e=e+22952|0;J[d+8>>2]=J[e>>2];J[e>>2]=d;J[J[d+8>>2]+4>>2]=d;e=J[5994];f=J[5995];d=b&31;if((b&63)>>>0>=32){b=1<<d;d=0;}else {g=1<<d;b=g-1&1>>>32-d;d=g;}J[5994]=d|e;J[5995]=b|f;b=c+8|0;J[a>>2]=b;J[((b&-4)+a|0)-4>>2]=b;break a}J[(a+b|0)-4>>2]=b;}a=a+4|0;}else {a=0;}return a}function $m(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;a:{b:{c:{d=J[a>>2];f=(J[a+4>>2]-d|0)/12|0;c=f+1|0;if(c>>>0<357913942){d=(J[a+8>>2]-d|0)/12|0;g=d<<1;d=d>>>0>=178956970?357913941:c>>>0<g>>>0?g:c;if(d){if(d>>>0>=357913942){break c}e=cb(P(d,12));}c=P(f,12)+e|0;f=J[b+4>>2];J[c>>2]=J[b>>2];J[c+4>>2]=f;J[c+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;e=P(d,12)+e|0;d=c+12|0;b=J[a+4>>2];f=J[a>>2];if((b|0)==(f|0)){break b}while(1){b=b-12|0;g=J[b+4>>2];c=c-12|0;J[c>>2]=J[b>>2];J[c+4>>2]=g;J[c+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;if((b|0)!=(f|0)){continue}break}J[a+8>>2]=e;e=J[a+4>>2];J[a+4>>2]=d;b=J[a>>2];J[a>>2]=c;if((b|0)==(e|0)){break a}while(1){a=e-12|0;if(H[e-1|0]<0){$a(J[a>>2]);}e=a;if((a|0)!=(b|0)){continue}break}break a}nb();B();}Pb();B();}J[a+8>>2]=e;J[a+4>>2]=d;J[a>>2]=c;}if(b){$a(b);}}function Lf(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;i=Ua-32|0;Ua=i;a:{b:{c:{if((b|0)!=(c|0)){k=J[5732];J[5732]=0;g=Ua-16|0;Ua=g;jb();f=Ua-16|0;Ua=f;e=Ua-16|0;Ua=e;ee(e,b,i+28|0,2);h=J[e>>2];j=J[e+4>>2];b=f;f=J[e+12>>2];J[b+8>>2]=J[e+8>>2];J[b+12>>2]=f;J[b>>2]=h;J[b+4>>2]=j;Ua=e+16|0;f=J[b>>2];h=J[b+4>>2];e=g;g=J[b+12>>2];J[e+8>>2]=J[b+8>>2];J[e+12>>2]=g;J[e>>2]=f;J[e+4>>2]=h;Ua=b+16|0;g=J[e>>2];f=J[e+4>>2];h=J[e+12>>2];b=i;J[b+16>>2]=J[e+8>>2];J[b+20>>2]=h;J[b+8>>2]=g;J[b+12>>2]=f;Ua=e+16|0;e=J[b+16>>2];f=J[b+20>>2];g=J[b+8>>2];h=J[b+12>>2];j=J[5732];if(!j){break c}if(J[b+28>>2]!=(c|0)){break b}l=g;m=h;n=e;o=f;if((j|0)!=68){break a}break b}J[d>>2]=4;break a}J[5732]=k;if(J[i+28>>2]==(c|0)){break a}}J[d>>2]=4;g=l;h=m;e=n;f=o;}J[a>>2]=g;J[a+4>>2]=h;J[a+8>>2]=e;J[a+12>>2]=f;Ua=i+32|0;}function Gm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;f=J[a+4>>2];e=J[a+8>>2];if(f>>>0<e>>>0){J[f>>2]=b;J[f+8>>2]=c;J[f+12>>2]=c>>31;b=J[d+4>>2];J[f+16>>2]=J[d>>2];J[f+20>>2]=b;J[a+4>>2]=f+24;return}a:{i=J[a>>2];g=(f-i|0)/24|0;h=g+1|0;if(h>>>0<178956971){j=P(g,24);e=(e-i|0)/24|0;g=e<<1;g=e>>>0>=89478485?178956970:g>>>0>h>>>0?g:h;if(g){if(g>>>0>=178956971){break a}h=cb(P(g,24));}else {h=0;}e=j+h|0;J[e+8>>2]=c;J[e+12>>2]=c>>31;J[e>>2]=b;b=J[d+4>>2];J[e+16>>2]=J[d>>2];J[e+20>>2]=b;b=e+24|0;if((f|0)!=(i|0)){while(1){f=f-24|0;d=J[f+4>>2];e=e-24|0;J[e>>2]=J[f>>2];J[e+4>>2]=d;c=J[f+20>>2];J[e+16>>2]=J[f+16>>2];J[e+20>>2]=c;c=J[f+12>>2];J[e+8>>2]=J[f+8>>2];J[e+12>>2]=c;if((f|0)!=(i|0)){continue}break}f=J[a>>2];}J[a+8>>2]=h+P(g,24);J[a+4>>2]=b;J[a>>2]=e;if(f){$a(f);}return}nb();B();}Pb();B();}function _k(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=Ua-32|0;Ua=f;J[f+28>>2]=b;a:{if(!(H[c+4|0]&1)){c=Xa[J[J[a>>2]+24>>2]](a,b,c,d,e)|0;break a}d=f+16|0;a=J[c+28>>2];J[d>>2]=a;J[a+4>>2]=J[a+4>>2]+1;J[5996]=0;a=$(198,J[f+16>>2])|0;b=J[5996];J[5996]=0;b:{if((b|0)!=1){b=J[d>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}c:{if(e){Xa[J[J[a>>2]+24>>2]](d,a);break c}Xa[J[J[a>>2]+28>>2]](f+16|0,a);}J[f+12>>2]=Mb(f+16|0);while(1){a=f+16|0;c=qc(a);b=J[f+12>>2];if((c|0)==(b|0)){c=J[f+28>>2];ab(a);break a}a=J[b>>2];J[5996]=0;_(214,f+28|0,a|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){J[f+12>>2]=J[f+12>>2]+4;continue}break}c=Z()|0;ab(f+16|0);break b}c=Z()|0;a=J[f+16>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}}da(c|0);B();}Ua=f+32|0;return c|0}function il(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=Ua-32|0;Ua=f;J[f+28>>2]=b;a:{if(!(H[c+4|0]&1)){c=Xa[J[J[a>>2]+24>>2]](a,b,c,d,e)|0;break a}d=f+16|0;a=J[c+28>>2];J[d>>2]=a;J[a+4>>2]=J[a+4>>2]+1;J[5996]=0;a=$(180,J[f+16>>2])|0;b=J[5996];J[5996]=0;b:{if((b|0)!=1){b=J[d>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}c:{if(e){Xa[J[J[a>>2]+24>>2]](d,a);break c}Xa[J[J[a>>2]+28>>2]](f+16|0,a);}J[f+12>>2]=Mb(f+16|0);while(1){a=f+16|0;c=sc(a);b=J[f+12>>2];if((c|0)==(b|0)){c=J[f+28>>2];ab(a);break a}a=H[b|0];J[5996]=0;_(210,f+28|0,a|0)|0;a=J[5996];J[5996]=0;if((a|0)!=1){J[f+12>>2]=J[f+12>>2]+1;continue}break}c=Z()|0;ab(f+16|0);break b}c=Z()|0;a=J[f+16>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}}da(c|0);B();}Ua=f+32|0;return c|0}function $n(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;f=Ua-32|0;Ua=f;J[f+24>>2]=d;H[f+20|0]=0;J[f+8>>2]=a;J[f+16>>2]=f+28;J[f+12>>2]=f+24;a:{b:{c:{if((b|0)!=(c|0)){while(1){J[d+8>>2]=0;J[d>>2]=0;J[d+4>>2]=0;a=J[b+4>>2];e=J[b>>2];if((a|0)!=(e|0)){e=a-e|0;if((e|0)<0){J[5996]=0;J[f+28>>2]=d;ca(84);a=J[5996];J[5996]=0;if((a|0)==1){break c}B();}J[5996]=0;a=$(3,e|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break b}J[d+4>>2]=a;J[d>>2]=a;J[d+8>>2]=(e&-8)+a;e=J[b>>2];g=J[b+4>>2];if((e|0)!=(g|0)){while(1){h=J[e+4>>2];J[a>>2]=J[e>>2];J[a+4>>2]=h;a=a+8|0;e=e+8|0;if((g|0)!=(e|0)){continue}break}}J[d+4>>2]=a;}d=d+12|0;b=b+12|0;if((c|0)!=(b|0)){continue}break}}Ua=f+32|0;return d|0}a=Z()|0;b=J[d>>2];if(!b){break a}J[d+4>>2]=b;$a(b);break a}a=Z()|0;J[f+28>>2]=d;}Ed(f+8|0);da(a|0);B();}function Fm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;f=J[a+4>>2];e=J[a+8>>2];if(f>>>0<e>>>0){J[f>>2]=b;J[f+16>>2]=d;J[f+20>>2]=d>>31;J[f+8>>2]=c;J[f+12>>2]=c>>31;J[a+4>>2]=f+24;return}a:{i=J[a>>2];g=(f-i|0)/24|0;h=g+1|0;if(h>>>0<178956971){j=P(g,24);e=(e-i|0)/24|0;g=e<<1;g=e>>>0>=89478485?178956970:g>>>0>h>>>0?g:h;if(g){if(g>>>0>=178956971){break a}h=cb(P(g,24));}else {h=0;}e=j+h|0;J[e+16>>2]=d;J[e+20>>2]=d>>31;J[e+8>>2]=c;J[e+12>>2]=c>>31;J[e>>2]=b;b=e+24|0;if((f|0)!=(i|0)){while(1){f=f-24|0;d=J[f+4>>2];e=e-24|0;J[e>>2]=J[f>>2];J[e+4>>2]=d;c=J[f+20>>2];J[e+16>>2]=J[f+16>>2];J[e+20>>2]=c;c=J[f+12>>2];J[e+8>>2]=J[f+8>>2];J[e+12>>2]=c;if((f|0)!=(i|0)){continue}break}f=J[a>>2];}J[a+8>>2]=h+P(g,24);J[a+4>>2]=b;J[a>>2]=e;if(f){$a(f);}return}nb();B();}Pb();B();}function Lc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;g=d;d=Gb(d);i=Ua-16|0;Ua=i;J[i+12>>2]=c;c=a;a:{b:{e=J[a+4>>2];a=K[a+11|0];h=(a&128)>>>7|0?e:a&127;if(h>>>0>=b>>>0){e=h-b|0;J[i+8>>2]=e;a=i+8|0;f=i+12|0;a=J[(M[a>>2]<M[f>>2]?a:f)>>2];f=(K[c+11|0]&128)>>>7|0?(J[c+8>>2]&2147483647)-1|0:10;if(a+(f-h|0)>>>0>=d>>>0){f=(K[c+11|0]&128)>>>7|0?J[c>>2]:c;c:{if((a|0)==(d|0)){a=d;break c}if((a|0)==(e|0)){a=e;break c}j=e-a|0;e=b+f|0;if(a>>>0>d>>>0){break b}d:{if(f+h>>>0<=g>>>0|e>>>0>=g>>>0){break d}if(a+e>>>0<=g>>>0){g=(d-a|0)+g|0;break d}oc(e,g,a);e=d-a|0;g=d+g|0;b=a+b|0;a=0;d=e;}e=b+f|0;oc(e+d|0,a+e|0,j);}oc(b+f|0,g,d);sd(c,f,(d+h|0)-a|0);break a}dd(c,f,d+h-(a+f)|0,h,b,a,d,g);break a}ue();B();}b=oc(e,g,d);oc(b+d|0,a+b|0,j);sd(c,f,(d+h|0)-a|0);}Ua=i+16|0;}function nk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=Ua-16|0;Ua=h;d=K[a+11|0];e=d&127;d=(d&128)>>>7|0;e=d?J[a+4>>2]:e;d=d?(J[a+8>>2]&2147483647)-1|0:1;f=c-b>>2;a:{if(!f){break a}b:{g=K[a+11|0];i=(g&128)>>>7|0?J[a>>2]:a;if(i>>>0<=b>>>0){g=(((g&128)>>>7|0?J[a+4>>2]:g&127)<<2)+i>>>0>=b>>>0;}else {g=0;}if(!g){if(d-e>>>0<f>>>0){of(a,d,(e-d|0)+f|0,e,e);}d=(e<<2)+((K[a+11|0]&128)>>>7|0?J[a>>2]:a)|0;while(1){if((b|0)==(c|0)){break b}J[d>>2]=J[b>>2];b=b+4|0;d=d+4|0;continue}}b=ag(h+4|0,b,c);c=K[b+11|0];f=(c&128)>>>7|0;d=f?J[b>>2]:b;e=J[b+4>>2];J[5996]=0;ba(235,a|0,d|0,(f?e:c&127)|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){ab(b);break a}a=Z()|0;ab(b);da(a|0);B();}J[d>>2]=0;b=e+f|0;c:{if((K[a+11|0]&128)>>>7|0){J[a+4>>2]=b;break c}H[a+11|0]=b;}}Ua=h+16|0;return a|0}function rm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;J[a+4>>2]=b;H[a|0]=0;b=J[J[b>>2]-12>>2]+b|0;if(!J[b+16>>2]){b=J[b+72>>2];if(b){a:{e=Ua-16|0;Ua=e;b:{c:{if(!J[(b+J[J[b>>2]-12>>2]|0)+24>>2]){break c}J[5996]=0;d=_(134,e+8|0,b|0)|0;c=J[5996];J[5996]=0;d:{if((c|0)!=1){e:{if(!K[d|0]){break e}c=J[(b+J[J[b>>2]-12>>2]|0)+24>>2];J[5996]=0;c=$(169,c|0)|0;f=J[5996];J[5996]=0;if((f|0)!=1){if((c|0)!=-1){break e}c=J[J[b>>2]-12>>2];J[5996]=0;aa(138,b+c|0,1);c=J[5996];J[5996]=0;if((c|0)!=1){break e}}c=fa(0)|0;ud(d);break d}ud(d);break c}c=fa(0)|0;}pa(c|0)|0;d=J[J[b>>2]-12>>2];J[5996]=0;ha(139,b+d|0);b=J[5996];J[5996]=0;if((b|0)==1){break b}ra();}Ua=e+16|0;break a}a=Z()|0;J[5996]=0;ca(110);b=J[5996];J[5996]=0;if((b|0)!=1){da(a|0);B();}fa(0)|0;Vb();B();}}H[a|0]=1;}return a|0}function Pm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;d=Ua-32|0;Ua=d;a:{b:{c:{if((c|0)<=0){break c}while(1){if(K[b+e|0]!=41){e=e+1|0;if((c|0)!=(e|0)){continue}break c}break}if(e){break b}}H[a+16|0]=0;H[a|0]=0;break a}d:{e:{if(e>>>0<=17){if(e>>>0>10){break e}H[d+31|0]=e;c=d+20|0;break d}H[a+16|0]=0;H[a|0]=0;break a}f=(e|15)+1|0;c=cb(f);J[d+28>>2]=f|-2147483648;J[d+20>>2]=c;J[d+24>>2]=e;}H[fb(c,b,e)+e|0]=0;c=J[d+20>>2];b=K[d+27|0]|K[d+28|0]<<8|(K[d+29|0]<<16|K[d+30|0]<<24);H[d+15|0]=b;H[d+16|0]=b>>>8;H[d+17|0]=b>>>16;H[d+18|0]=b>>>24;J[d+12>>2]=J[d+24>>2];f=K[d+31|0];J[a>>2]=c;J[a+4>>2]=J[d+12>>2];b=K[d+15|0]|K[d+16|0]<<8|(K[d+17|0]<<16|K[d+18|0]<<24);H[a+7|0]=b;H[a+8|0]=b>>>8;H[a+9|0]=b>>>16;H[a+10|0]=b>>>24;H[a+16|0]=1;J[a+12>>2]=e;H[a+11|0]=f;}Ua=d+32|0;}function Ac(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=Ua-16|0;Ua=g;a:{b:{c:{if(!a){break c}i=J[e+12>>2];j=c-b|0;if((j|0)>0){if((Xa[J[J[a>>2]+48>>2]](a,b,j)|0)!=(j|0)){break c}}b=d-b|0;b=(b|0)<(i|0)?i-b|0:0;if((b|0)>0){if(b>>>0>=2147483632){break a}d:{if(b>>>0>=11){i=(b|15)+1|0;h=cb(i);J[g+12>>2]=i|-2147483648;J[g+4>>2]=h;J[g+8>>2]=b;break d}H[g+15|0]=b;h=g+4|0;}H[Sb(h,f,b)+b|0]=0;f=J[J[a>>2]+48>>2];J[5996]=0;f=ba(f|0,a|0,(H[g+15|0]<0?J[g+4>>2]:g+4|0)|0,b|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break b}if(H[g+15|0]<0){$a(J[g+4>>2]);}h=0;if((b|0)!=(f|0)){break c}}b=d-c|0;if((b|0)>0){if((Xa[J[J[a>>2]+48>>2]](a,c,b)|0)!=(b|0)){break c}}J[e+12>>2]=0;h=a;}Ua=g+16|0;return h|0}a=Z()|0;if(H[g+15|0]<0){$a(J[g+4>>2]);}da(a|0);B();}ub();B();}function vk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;h=Ua-16|0;Ua=h;d=K[a+11|0];e=d&127;d=(d&128)>>>7|0;e=d?J[a+4>>2]:e;d=d?(J[a+8>>2]&2147483647)-1|0:10;f=c-b|0;a:{if(!f){break a}b:{g=K[a+11|0];i=(g&128)>>>7|0?J[a>>2]:a;if(i>>>0<=b>>>0){g=((g&128)>>>7|0?J[a+4>>2]:g&127)+i>>>0>=b>>>0;}else {g=0;}if(!g){if(d-e>>>0<f>>>0){Sd(a,d,(e-d|0)+f|0,e,e);}d=e+((K[a+11|0]&128)>>>7|0?J[a>>2]:a)|0;while(1){if((b|0)==(c|0)){break b}H[d|0]=K[b|0];b=b+1|0;d=d+1|0;continue}}b=td(h+4|0,b,c);c=K[b+11|0];f=(c&128)>>>7|0;d=f?J[b>>2]:b;e=J[b+4>>2];J[5996]=0;ba(100,a|0,d|0,(f?e:c&127)|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){ab(b);break a}a=Z()|0;ab(b);da(a|0);B();}H[d|0]=0;b=e+f|0;c:{if((K[a+11|0]&128)>>>7|0){J[a+4>>2]=b;break c}H[a+11|0]=b;}}Ua=h+16|0;return a|0}function eb(a,b,c){var d=0,e=0;a:{if((a|0)==(b|0)){break a}e=a+c|0;if(b-e>>>0<=0-(c<<1)>>>0){return fb(a,b,c)}d=(a^b)&3;b:{c:{if(a>>>0<b>>>0){if(d){d=a;break b}if(!(a&3)){d=a;break c}d=a;while(1){if(!c){break a}H[d|0]=K[b|0];b=b+1|0;c=c-1|0;d=d+1|0;if(d&3){continue}break}break c}d:{if(d){break d}if(e&3){while(1){if(!c){break a}c=c-1|0;d=c+a|0;H[d|0]=K[b+c|0];if(d&3){continue}break}}if(c>>>0<=3){break d}while(1){c=c-4|0;J[c+a>>2]=J[b+c>>2];if(c>>>0>3){continue}break}}if(!c){break a}while(1){c=c-1|0;H[c+a|0]=K[b+c|0];if(c){continue}break}break a}if(c>>>0<=3){break b}while(1){J[d>>2]=J[b>>2];b=b+4|0;d=d+4|0;c=c-4|0;if(c>>>0>3){continue}break}}if(!c){break a}while(1){H[d|0]=K[b|0];d=d+1|0;b=b+1|0;c=c-1|0;if(c){continue}break}}return a}function Ig(a,b,c){a:{switch(b-9|0){case 0:b=J[c>>2];J[c>>2]=b+4;J[a>>2]=J[b>>2];return;case 6:b=J[c>>2];J[c>>2]=b+4;b=I[b>>1];J[a>>2]=b;J[a+4>>2]=b>>31;return;case 7:b=J[c>>2];J[c>>2]=b+4;J[a>>2]=L[b>>1];J[a+4>>2]=0;return;case 8:b=J[c>>2];J[c>>2]=b+4;b=H[b|0];J[a>>2]=b;J[a+4>>2]=b>>31;return;case 9:b=J[c>>2];J[c>>2]=b+4;J[a>>2]=K[b|0];J[a+4>>2]=0;return;case 16:b=J[c>>2]+7&-8;J[c>>2]=b+8;O[a>>3]=O[b>>3];return;case 17:Fg(a,c);default:return;case 1:case 4:case 14:b=J[c>>2];J[c>>2]=b+4;b=J[b>>2];J[a>>2]=b;J[a+4>>2]=b>>31;return;case 2:case 5:case 11:case 15:b=J[c>>2];J[c>>2]=b+4;J[a>>2]=J[b>>2];J[a+4>>2]=0;return;case 3:case 10:case 12:case 13:break a}}b=J[c>>2]+7&-8;J[c>>2]=b+8;c=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=c;}function Xd(a,b,c,d,e){var f=0,g=0;f=Ua-16|0;Ua=f;J[f+12>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;b=$(197,J[f+12>>2])|0;g=J[5996];J[5996]=0;a:{if((g|0)==1){break a}J[5996]=0;ga(208,b|0,12416,12448,c|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}J[5996]=0;b=$(198,J[f+12>>2])|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[5996]=0;c=$(209,b|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break a}J[d>>2]=c;J[5996]=0;c=$(206,b|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}J[e>>2]=c;J[5996]=0;aa(207,a|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break a}a=J[f+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}Ua=f+16|0;return}c=Z()|0;a=J[f+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function $d(a,b,c,d,e){var f=0,g=0;f=Ua-16|0;Ua=f;J[f+12>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;b=$(170,J[f+12>>2])|0;g=J[5996];J[5996]=0;a:{if((g|0)==1){break a}J[5996]=0;ga(195,b|0,12416,12448,c|0);b=J[5996];J[5996]=0;if((b|0)==1){break a}J[5996]=0;b=$(180,J[f+12>>2])|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}J[5996]=0;c=$(196,b|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break a}H[d|0]=c;J[5996]=0;c=$(193,b|0)|0;d=J[5996];J[5996]=0;if((d|0)==1){break a}H[e|0]=c;J[5996]=0;aa(194,a|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break a}a=J[f+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}Ua=f+16|0;return}c=Z()|0;a=J[f+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function jg(a,b,c,d,e,f){var g=0;g=Ua-80|0;Ua=g;a:{if((f|0)>=16384){ob(g+32|0,b,c,d,e,0,0,0,2147352576);d=J[g+40>>2];e=J[g+44>>2];b=J[g+32>>2];c=J[g+36>>2];if(f>>>0<32767){f=f-16383|0;break a}ob(g+16|0,b,c,d,e,0,0,0,2147352576);f=((f|0)>=49149?49149:f)-32766|0;d=J[g+24>>2];e=J[g+28>>2];b=J[g+16>>2];c=J[g+20>>2];break a}if((f|0)>-16383){break a}ob(g- -64|0,b,c,d,e,0,0,0,7471104);d=J[g+72>>2];e=J[g+76>>2];b=J[g+64>>2];c=J[g+68>>2];if(f>>>0>4294934644){f=f+16269|0;break a}ob(g+48|0,b,c,d,e,0,0,0,7471104);f=((f|0)<=-48920?-48920:f)+32538|0;d=J[g+56>>2];e=J[g+60>>2];b=J[g+48>>2];c=J[g+52>>2];}ob(g,b,c,d,e,0,0,0,f+16383<<16);b=J[g+12>>2];J[a+8>>2]=J[g+8>>2];J[a+12>>2]=b;b=J[g+4>>2];J[a>>2]=J[g>>2];J[a+4>>2]=b;Ua=g+80|0;}function cc(a,b,c,d,e){var f=0,g=0,h=0,i=0;h=Ua-16|0;Ua=h;J[h+12>>2]=b;b=0;g=6;a:{b:{if(Ub(a,h+12|0)){break b}g=J[a>>2];f=J[g+12>>2];c:{if((f|0)==J[g+16>>2]){f=Xa[J[J[g>>2]+36>>2]](g)|0;break c}f=K[f|0];}g=4;i=J[d+8>>2];f=f<<24>>24;if((f|0)>=0){i=(J[((f&255)<<2)+i>>2]&64)!=0;}else {i=0;}if(!i){break b}b=Xa[J[J[d>>2]+36>>2]](d,f,0)|0;while(1){d:{b=b-48|0;f=Ic(a);if(Ub(f,h+12|0)|(e|0)<2){break d}g=J[f>>2];f=J[g+12>>2];e:{if((f|0)==J[g+16>>2]){g=Xa[J[J[g>>2]+36>>2]](g)|0;break e}g=K[f|0];}f=J[d+8>>2];g=g<<24>>24;if((g|0)>=0){f=(J[f+((g&255)<<2)>>2]&64)!=0;}else {f=0;}if(!f){break a}e=e-1|0;b=(Xa[J[J[d>>2]+36>>2]](d,g,0)|0)+P(b,10)|0;continue}break}g=2;if(!Ub(f,h+12|0)){break a}}J[c>>2]=J[c>>2]|g;}Ua=h+16|0;return b}function Wb(a,b){a=a|0;b=b|0;var c=0,d=0;a:{if((b|0)>0){d=a+b|0;while(1){b=1;b:{c:{switch(K[a|0]-66|0){default:a=Rb(8);J[5996]=0;b=_(17,a|0,2064)|0;c=J[5996];J[5996]=0;if((c|0)==1){break a}na(b|0,22528,7);B();case 20:b=2;break b;case 9:b=4;break b;case 21:b=8;break b;case 56:b=16;break b;case 45:b=32;break b;case 44:b=64;break b;case 34:b=128;break b;case 51:b=256;break b;case 35:b=512;break b;case 36:b=1024;break b;case 49:b=2048;break b;case 43:b=4096;break b;case 54:b=8192;break b;case 37:b=16384;break b;case 38:b=32768;break b;case 39:b=65536;break b;case 40:b=131072;break b;case 0:break b;case 41:break c}}b=262144;}c=b|c;a=a+1|0;if(d>>>0>a>>>0){continue}break}}return c|0}b=Z()|0;ic(a);da(b|0);B();}function Sb(a,b,c){var d=0,e=0,f=0,g=0;a:{if(!c){break a}H[a|0]=b;d=a+c|0;H[d-1|0]=b;if(c>>>0<3){break a}H[a+2|0]=b;H[a+1|0]=b;H[d-3|0]=b;H[d-2|0]=b;if(c>>>0<7){break a}H[a+3|0]=b;H[d-4|0]=b;if(c>>>0<9){break a}d=0-a&3;e=d+a|0;b=P(b&255,16843009);J[e>>2]=b;d=c-d&-4;c=d+e|0;J[c-4>>2]=b;if(d>>>0<9){break a}J[e+8>>2]=b;J[e+4>>2]=b;J[c-8>>2]=b;J[c-12>>2]=b;if(d>>>0<25){break a}J[e+24>>2]=b;J[e+20>>2]=b;J[e+16>>2]=b;J[e+12>>2]=b;J[c-16>>2]=b;J[c-20>>2]=b;J[c-24>>2]=b;J[c-28>>2]=b;g=e&4|24;c=d-g|0;if(c>>>0<32){break a}d=co(b,0,1,1);f=Wa;b=e+g|0;while(1){J[b+24>>2]=d;J[b+28>>2]=f;J[b+16>>2]=d;J[b+20>>2]=f;J[b+8>>2]=d;J[b+12>>2]=f;J[b>>2]=d;J[b+4>>2]=f;b=b+32|0;c=c-32|0;if(c>>>0>31){continue}break}}return a}function re(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;a:{d=J[a+4>>2];h=J[a>>2];f=d-h>>3;c=f+1|0;if(c>>>0<536870912){g=J[a+8>>2]-h|0;e=g>>2;c=g>>>0>=2147483640?536870911:c>>>0<e>>>0?e:c;if(c>>>0>=536870912){break a}e=f<<3;f=c<<3;g=cb(f);c=e+g|0;J[c>>2]=J[b>>2];J[c+4>>2]=J[b+4>>2];J[b>>2]=0;J[b+4>>2]=0;e=c+8|0;if((d|0)!=(h|0)){while(1){c=c-8|0;d=d-8|0;J[c>>2]=J[d>>2];J[c+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;if((d|0)!=(h|0)){continue}break}}J[a+8>>2]=f+g;b=J[a>>2];J[a>>2]=c;d=J[a+4>>2];J[a+4>>2]=e;if((b|0)!=(d|0)){while(1){d=d-8|0;a=J[d+4>>2];b:{if(!a){break b}c=J[a+4>>2];J[a+4>>2]=c-1;if(c){break b}Xa[J[J[a>>2]+8>>2]](a);bb(a);}if((b|0)!=(d|0)){continue}break}}if(b){$a(b);}return}nb();B();}Pb();B();}function jb(){var a=0,b=0,c=0,d=0;if(K[25008]){return J[6251]}c=Ua-32|0;Ua=c;a:{b:{while(1){b=c+8|0;d=dg(a,1<<a&2147483647?3538:5575);J[b+(a<<2)>>2]=d;if((d|0)==-1){break b}a=a+1|0;if((a|0)!=6){continue}break}a=19324;if(!Eb(b,19324,24)){break a}a=19348;if(!Eb(b,19348,24)){break a}a=0;if(!K[24780]){while(1){J[(a<<2)+24732>>2]=dg(a,5575);a=a+1|0;if((a|0)!=6){continue}break}H[24780]=1;J[6189]=J[6183];}a=24732;b=c+8|0;if(!Eb(b,24732,24)){break a}a=24756;if(!Eb(b,24756,24)){break a}a=sb(24);if(!a){break b}b=J[c+12>>2];J[a>>2]=J[c+8>>2];J[a+4>>2]=b;b=J[c+28>>2];J[a+16>>2]=J[c+24>>2];J[a+20>>2]=b;b=J[c+20>>2];J[a+8>>2]=J[c+16>>2];J[a+12>>2]=b;break a}a=0;}Ua=c+32|0;H[25008]=1;J[6251]=a;return a}function Fe(a,b){var c=0,d=0,e=0,f=0;c=Ua+-64|0;Ua=c;d=J[a>>2];e=J[d-4>>2];f=J[d-8>>2];J[c+28>>2]=0;J[c+32>>2]=0;J[c+36>>2]=0;J[c+40>>2]=0;J[c+44>>2]=0;J[c+48>>2]=0;J[c+52>>2]=0;J[c+56>>2]=0;d=0;H[c+59|0]=0;H[c+60|0]=0;H[c+61|0]=0;H[c+62|0]=0;J[c+20>>2]=0;J[c+24>>2]=0;J[c+16>>2]=22056;J[c+12>>2]=a;J[c+8>>2]=b;a=a+f|0;a:{if(Jb(e,b,0)){J[c+56>>2]=1;Xa[J[J[e>>2]+20>>2]](e,c+8|0,a,a,1,0);d=J[c+32>>2]==1?a:0;break a}Xa[J[J[e>>2]+24>>2]](e,c+8|0,a,1,0);b:{switch(J[c+44>>2]){case 0:d=J[c+48>>2]==1?J[c+36>>2]==1?J[c+40>>2]==1?J[c+28>>2]:0:0:0;break a;case 1:break b;default:break a}}if(J[c+32>>2]!=1){if(J[c+48>>2]|J[c+36>>2]!=1|J[c+40>>2]!=1){break a}}d=J[c+24>>2];}Ua=c- -64|0;return d}function dg(a,b){var c=0,d=0,e=0;a:{if(K[b|0]){break a}b=fe(3169);if(K[b|0]?b:0){break a}b=fe(P(a,12)+9024|0);if(K[b|0]?b:0){break a}b=fe(3321);if(K[b|0]?b:0){break a}b=3845;}b:{while(1){d=K[b+c|0];if(!(!d|(d|0)==47)){d=23;c=c+1|0;if((c|0)!=23){continue}break b}break}d=c;}e=3845;c:{d:{c=K[b|0];e:{f:{if(!(K[b+d|0]|(c|0)==46)){e=b;if((c|0)!=67){break f}}if(!K[e+1|0]){break e}}if(!Uc(e,3845)){break e}if(Uc(e,2764)){break d}}if(!a){c=9096;if(K[e+1|0]==46){break c}}return 0}c=J[6182];if(c){while(1){if(!Uc(e,c+8|0)){break c}c=J[c+32>>2];if(c){continue}break}}c=sb(36);if(c){J[c+4>>2]=20;J[c>>2]=8992;b=c+8|0;fb(b,e,d);H[b+d|0]=0;J[c+32>>2]=J[6182];J[6182]=c;}c=a|c?c:9096;}return c}function $a(a){var b=0,c=0,d=0,e=0,f=0;if(a){b=a-4|0;e=J[b>>2];d=e;c=b;f=J[a-8>>2];a=f&-2;if((a|0)!=(f|0)){c=b-a|0;f=J[c+4>>2];J[f+8>>2]=J[c+8>>2];J[J[c+8>>2]+4>>2]=f;d=a+d|0;}a=b+e|0;b=J[a>>2];if((b|0)!=J[(a+b|0)-4>>2]){e=J[a+4>>2];J[e+8>>2]=J[a+8>>2];J[J[a+8>>2]+4>>2]=e;d=b+d|0;}J[c>>2]=d;J[((d&-4)+c|0)-4>>2]=d|1;b=J[c>>2]-8|0;a:{if(b>>>0<=127){a=(b>>>3|0)-1|0;break a}d=S(b);a=((b>>>29-d^4)-(d<<2)|0)+110|0;if(b>>>0<=4095){break a}a=((b>>>30-d^2)-(d<<1)|0)+71|0;a=a>>>0>=63?63:a;}b=a<<4;J[c+4>>2]=b+22944;b=b+22952|0;J[c+8>>2]=J[b>>2];J[b>>2]=c;J[J[c+8>>2]+4>>2]=c;b=J[5994];d=J[5995];c=a&31;if((a&63)>>>0>=32){a=1<<c;e=0;}else {e=1<<c;a=e-1&1>>>32-c;}J[5994]=e|b;J[5995]=a|d;}}function Dc(a,b,c,d,e,f,g,h,i,j,k){var l=0,m=0,n=0;a:{b:{l=J[d>>2];if((l|0)!=(c|0)){break b}m=43;n=a&255;if((n|0)!=K[k+24|0]){m=45;if(K[k+25|0]!=(n|0)){break b}}J[d>>2]=c+1;H[c|0]=m;break a}c:{if(!(!((h&128)>>>7|0?g:h&127)|(a|0)!=(f|0))){h=0;a=J[j>>2];if((a-i|0)>159){break c}b=J[e>>2];J[j>>2]=a+4;J[a>>2]=b;break a}h=-1;a=be(k,k+26|0,a)-k|0;if((a|0)>23){break c}d:{e:{switch(b-8|0){case 0:case 2:if((a|0)<(b|0)){break d}break c;case 1:break d;default:break e}}if((b|0)!=16|(a|0)<22){break d}if((c|0)==(l|0)|(l-c|0)>2|K[l-1|0]!=48){break c}J[e>>2]=0;J[d>>2]=l+1;H[l|0]=K[a+12416|0];return 0}J[d>>2]=l+1;H[l|0]=K[a+12416|0];J[e>>2]=J[e>>2]+1;h=0;}return h}J[e>>2]=0;return 0}function Cc(a,b,c,d,e,f,g,h,i,j,k){var l=0,m=0;a:{b:{l=J[d>>2];if((l|0)!=(c|0)){break b}m=43;if(J[k+96>>2]!=(a|0)){m=45;if(J[k+100>>2]!=(a|0)){break b}}J[d>>2]=c+1;H[c|0]=m;break a}c:{if(!(!((h&128)>>>7|0?g:h&127)|(a|0)!=(f|0))){h=0;a=J[j>>2];if((a-i|0)>159){break c}b=J[e>>2];J[j>>2]=a+4;J[a>>2]=b;break a}h=-1;f=Yd(k,k+104|0,a)-k|0;if((f|0)>92){break c}a=f>>2;d:{e:{switch(b-8|0){case 0:case 2:if((a|0)<(b|0)){break d}break c;case 1:break d;default:break e}}if((b|0)!=16|(f|0)<88){break d}if((c|0)==(l|0)|(l-c|0)>2|K[l-1|0]!=48){break c}J[e>>2]=0;J[d>>2]=l+1;H[l|0]=K[a+12416|0];return 0}J[d>>2]=l+1;H[l|0]=K[a+12416|0];J[e>>2]=J[e>>2]+1;h=0;}return h}J[e>>2]=0;return 0}function mc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;c=J[a+4>>2];d=J[a+8>>2];if(c>>>0<d>>>0){J[c>>2]=b;J[a+4>>2]=c+4;return}a:{b:{c:{g=J[a>>2];e=c-g>>2;f=e+1|0;if(f>>>0<1073741824){h=e<<2;d=d-g|0;e=d>>1;d=d>>>0>=2147483644?1073741823:f>>>0<e>>>0?e:f;if(d){if(d>>>0>=1073741824){break c}e=cb(d<<2);}else {e=0;}f=h+e|0;J[f>>2]=b;b=e+(d<<2)|0;d=f+4|0;if((c|0)==(g|0)){break b}while(1){c=c-4|0;e=J[c>>2];J[c>>2]=0;f=f-4|0;J[f>>2]=e;if((c|0)!=(g|0)){continue}break}J[a+8>>2]=b;b=J[a+4>>2];J[a+4>>2]=d;c=J[a>>2];J[a>>2]=f;if((b|0)==(c|0)){break a}while(1){b=b-4|0;ad(b);if((b|0)!=(c|0)){continue}break}break a}nb();B();}Pb();B();}J[a+8>>2]=b;J[a+4>>2]=d;J[a>>2]=f;}if(c){$a(c);}}function bn(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;a:{if(b>>>0>=256){a=Rb(8);J[5996]=0;b=_(91,a|0,2394)|0;c=J[5996];J[5996]=0;if((c|0)!=1){break a}b=Z()|0;ic(a);da(b|0);B();}c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=c-29|0;f=c>>>0<29?c:e;d=f+1|0;if(d>>>0>(c>>>0<=28?28:K[a+4|0]|K[a+5|0]<<8|(K[a+6|0]<<16|K[a+7|0]<<24))>>>0){Ob(a,d+(d>>>1|0)|0);c=K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24);e=c-29|0;}g=c>>>0<29;d=(g?a+4|0:K[a+8|0]|K[a+9|0]<<8|(K[a+10|0]<<16|K[a+11|0]<<24))+f|0;eb(d+1|0,d,(g?c:e)-f|0);c=(K[a|0]|K[a+1|0]<<8|(K[a+2|0]<<16|K[a+3|0]<<24))+1|0;H[a|0]=c;H[a+1|0]=c>>>8;H[a+2|0]=c>>>16;H[a+3|0]=c>>>24;H[d|0]=b;return a|0}na(b|0,22664,92);B();}function Wk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=Ua-256|0;Ua=g;J[g+248>>2]=37;J[g+252>>2]=0;h=g+248|0;rc(h|1,2055,1,J[c+4>>2]);i=jb();J[g>>2]=e;J[g+4>>2]=f;a=g+224|0;e=yb(a,24,i,h,g)+a|0;i=Lb(a,e,J[c+4>>2]);f=g+20|0;h=J[c+28>>2];J[f>>2]=h;J[h+4>>2]=J[h+4>>2]+1;J[5996]=0;h=g+32|0;ma(215,a|0,i|0,e|0,h|0,g+28|0,g+24|0,f|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){a=J[f>>2];e=J[a+4>>2]-1|0;J[a+4>>2]=e;if((e|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=Bc(b,h,J[g+28>>2],J[g+24>>2],c,d);Ua=g+256|0;break a}c=Z()|0;a=J[g+20>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}return a|0}function Uk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=Ua-256|0;Ua=g;J[g+248>>2]=37;J[g+252>>2]=0;h=g+248|0;rc(h|1,2055,0,J[c+4>>2]);i=jb();J[g>>2]=e;J[g+4>>2]=f;a=g+224|0;e=yb(a,24,i,h,g)+a|0;i=Lb(a,e,J[c+4>>2]);f=g+20|0;h=J[c+28>>2];J[f>>2]=h;J[h+4>>2]=J[h+4>>2]+1;J[5996]=0;h=g+32|0;ma(215,a|0,i|0,e|0,h|0,g+28|0,g+24|0,f|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){a=J[f>>2];e=J[a+4>>2]-1|0;J[a+4>>2]=e;if((e|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=Bc(b,h,J[g+28>>2],J[g+24>>2],c,d);Ua=g+256|0;break a}c=Z()|0;a=J[g+20>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}return a|0}function fl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=Ua-112|0;Ua=g;J[g+104>>2]=37;J[g+108>>2]=0;h=g+104|0;rc(h|1,2055,1,J[c+4>>2]);i=jb();J[g>>2]=e;J[g+4>>2]=f;a=g+80|0;e=yb(a,24,i,h,g)+a|0;i=Lb(a,e,J[c+4>>2]);f=g+20|0;h=J[c+28>>2];J[f>>2]=h;J[h+4>>2]=J[h+4>>2]+1;J[5996]=0;h=g+32|0;ma(211,a|0,i|0,e|0,h|0,g+28|0,g+24|0,f|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){a=J[f>>2];e=J[a+4>>2]-1|0;J[a+4>>2]=e;if((e|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=Ac(b,h,J[g+28>>2],J[g+24>>2],c,d);Ua=g+112|0;break a}c=Z()|0;a=J[g+20>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}return a|0}function dl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=Ua-112|0;Ua=g;J[g+104>>2]=37;J[g+108>>2]=0;h=g+104|0;rc(h|1,2055,0,J[c+4>>2]);i=jb();J[g>>2]=e;J[g+4>>2]=f;a=g+80|0;e=yb(a,24,i,h,g)+a|0;i=Lb(a,e,J[c+4>>2]);f=g+20|0;h=J[c+28>>2];J[f>>2]=h;J[h+4>>2]=J[h+4>>2]+1;J[5996]=0;h=g+32|0;ma(211,a|0,i|0,e|0,h|0,g+28|0,g+24|0,f|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){a=J[f>>2];e=J[a+4>>2]-1|0;J[a+4>>2]=e;if((e|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=Ac(b,h,J[g+28>>2],J[g+24>>2],c,d);Ua=g+112|0;break a}c=Z()|0;a=J[g+20>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}return a|0}function Fh(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0;if(Jb(a,J[b+8>>2],f)){Hd(b,c,d,e);return}g=K[b+53|0];i=J[a+12>>2];H[b+53|0]=0;h=K[b+52|0];H[b+52|0]=0;Fd(J[a+16>>2],J[a+20>>2],b,c,d,e,f);j=K[b+52|0];h=(h|j)!=0;k=K[b+53|0];l=(g|k)!=0;g=a+24|0;i=(a+16|0)+(i<<3)|0;a:{if(g>>>0>=i>>>0){break a}while(1){if(K[b+54|0]){break a}b:{if(j){if(J[b+24>>2]==1){break a}if(K[a+8|0]&2){break b}break a}if(!k){break b}if(!(H[a+8|0]&1)){break a}}I[b+52>>1]=0;Fd(J[g>>2],J[g+4>>2],b,c,d,e,f);k=K[b+53|0];l=(k|l)!=0;j=K[b+52|0];h=(j|h)!=0;g=g+8|0;if(i>>>0>g>>>0){continue}break}}H[b+53|0]=l;H[b+52|0]=h;}function bc(a,b,c,d,e){var f=0,g=0,h=0,i=0;h=Ua-16|0;Ua=h;J[h+12>>2]=b;b=0;g=6;a:{b:{if(Tb(a,h+12|0)){break b}g=4;f=J[a>>2];i=J[f+12>>2];c:{if((i|0)==J[f+16>>2]){f=Xa[J[J[f>>2]+36>>2]](f)|0;break c}f=J[i>>2];}if(!(Xa[J[J[d>>2]+12>>2]](d,64,f)|0)){break b}b=Xa[J[J[d>>2]+52>>2]](d,f,0)|0;while(1){d:{b=b-48|0;f=Hc(a);if(Tb(f,h+12|0)|(e|0)<2){break d}g=J[f>>2];f=J[g+12>>2];e:{if((f|0)==J[g+16>>2]){g=Xa[J[J[g>>2]+36>>2]](g)|0;break e}g=J[f>>2];}if(!(Xa[J[J[d>>2]+12>>2]](d,64,g)|0)){break a}e=e-1|0;b=(Xa[J[J[d>>2]+52>>2]](d,g,0)|0)+P(b,10)|0;continue}break}g=2;if(!Tb(f,h+12|0)){break a}}J[c>>2]=J[c>>2]|g;}Ua=h+16|0;return b}function qd(a,b,c,d){var e=0,f=0,g=0,h=0;g=d?d:24720;d=J[g>>2];a:{b:{c:{if(!b){if(d){break c}return 0}e=-2;if(!c){break b}d:{if(d){e=c;break d}d=K[b|0];f=d<<24>>24;if((f|0)>=0){if(a){J[a>>2]=d;}return (f|0)!=0}if(!J[J[6178]>>2]){e=1;if(!a){break b}J[a>>2]=f&57343;return 1}d=d-194|0;if(d>>>0>50){break c}d=J[(d<<2)+12208>>2];e=c-1|0;if(!e){break a}b=b+1|0;}f=K[b|0];h=f>>>3|0;if((h-16|(d>>26)+h)>>>0>7){break c}while(1){e=e-1|0;d=f-128|d<<6;if((d|0)>=0){J[g>>2]=0;if(a){J[a>>2]=d;}return c-e|0}if(!e){break a}b=b+1|0;f=K[b|0];if((f&192)==128){continue}break}}J[g>>2]=0;J[5732]=25;e=-1;}return e}J[g>>2]=d;return -2}function Zk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=Ua-144|0;Ua=f;J[f+136>>2]=37;J[f+140>>2]=0;h=f+136|0;rc(h|1,2096,1,J[c+4>>2]);g=jb();J[f>>2]=e;a=f+123|0;e=yb(a,13,g,h,f)+a|0;i=Lb(a,e,J[c+4>>2]);h=f+4|0;g=J[c+28>>2];J[h>>2]=g;J[g+4>>2]=J[g+4>>2]+1;J[5996]=0;g=f+16|0;ma(215,a|0,i|0,e|0,g|0,f+12|0,f+8|0,h|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){a=J[h>>2];e=J[a+4>>2]-1|0;J[a+4>>2]=e;if((e|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=Bc(b,g,J[f+12>>2],J[f+8>>2],c,d);Ua=f+144|0;break a}c=Z()|0;a=J[f+4>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}return a|0}function Vk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=Ua-144|0;Ua=f;J[f+136>>2]=37;J[f+140>>2]=0;h=f+136|0;rc(h|1,2096,0,J[c+4>>2]);g=jb();J[f>>2]=e;a=f+123|0;e=yb(a,13,g,h,f)+a|0;i=Lb(a,e,J[c+4>>2]);h=f+4|0;g=J[c+28>>2];J[h>>2]=g;J[g+4>>2]=J[g+4>>2]+1;J[5996]=0;g=f+16|0;ma(215,a|0,i|0,e|0,g|0,f+12|0,f+8|0,h|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){a=J[h>>2];e=J[a+4>>2]-1|0;J[a+4>>2]=e;if((e|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=Bc(b,g,J[f+12>>2],J[f+8>>2],c,d);Ua=f+144|0;break a}c=Z()|0;a=J[f+4>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}return a|0}function hl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=Ua+-64|0;Ua=f;J[f+56>>2]=37;J[f+60>>2]=0;h=f+56|0;rc(h|1,2096,1,J[c+4>>2]);g=jb();J[f>>2]=e;a=f+43|0;e=yb(a,13,g,h,f)+a|0;i=Lb(a,e,J[c+4>>2]);h=f+4|0;g=J[c+28>>2];J[h>>2]=g;J[g+4>>2]=J[g+4>>2]+1;J[5996]=0;g=f+16|0;ma(211,a|0,i|0,e|0,g|0,f+12|0,f+8|0,h|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){a=J[h>>2];e=J[a+4>>2]-1|0;J[a+4>>2]=e;if((e|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=Ac(b,g,J[f+12>>2],J[f+8>>2],c,d);Ua=f- -64|0;break a}c=Z()|0;a=J[f+4>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}return a|0}function el(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=Ua+-64|0;Ua=f;J[f+56>>2]=37;J[f+60>>2]=0;h=f+56|0;rc(h|1,2096,0,J[c+4>>2]);g=jb();J[f>>2]=e;a=f+43|0;e=yb(a,13,g,h,f)+a|0;i=Lb(a,e,J[c+4>>2]);h=f+4|0;g=J[c+28>>2];J[h>>2]=g;J[g+4>>2]=J[g+4>>2]+1;J[5996]=0;g=f+16|0;ma(211,a|0,i|0,e|0,g|0,f+12|0,f+8|0,h|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){a=J[h>>2];e=J[a+4>>2]-1|0;J[a+4>>2]=e;if((e|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}a=Ac(b,g,J[f+12>>2],J[f+8>>2],c,d);Ua=f- -64|0;break a}c=Z()|0;a=J[f+4>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}return a|0}function jh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;J[c>>2]=0;a:{e=J[b+4>>2];if(!e){break a}f=J[b>>2];b:{c:{d:{while(1){d=H[f|0];g=J[c>>2];if((d|0)<((g?48:49)|0)|(d|0)>57){break d}d=(d+P(g,10)|0)-48|0;J[c>>2]=d>>>0>=65535?65535:d;e=e-1|0;J[b+4>>2]=e;f=f+1|0;J[b>>2]=f;if(e){continue}break}if(J[c>>2]){break c}break a}if(!g){break a}if((d|0)==64){break b}}J[a>>2]=0;J[a+4>>2]=0;J[a+48>>2]=0;J[a+52>>2]=0;J[a+40>>2]=0;J[a+44>>2]=0;J[a+32>>2]=0;J[a+36>>2]=0;J[a+24>>2]=0;J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;J[a+8>>2]=0;J[a+12>>2]=0;return}J[b+4>>2]=e-1;J[b>>2]=f+1;Bd(a,b);return}J[c>>2]=1;Bd(a,b);}function yc(a,b,c,d,e,f,g,h){var i=0,j=0,k=0,l=0;j=1;i=d&2147483647;l=i;k=(i|0)==2147418112;a:{if(k&!c?a|b:k&(c|0)!=0|i>>>0>2147418112){break a}i=h&2147483647;if(!g&(i|0)==2147418112?e|f:(i|0)==2147418112&(g|0)!=0|i>>>0>2147418112){break a}if(!(a|e|(c|g)|(b|f|(i|l)))){return 0}j=d&h;if((j|0)>0|(j|0)>=0){j=-1;if((c|0)==(g|0)&(d|0)==(h|0)?(b|0)==(f|0)&a>>>0<e>>>0|b>>>0<f>>>0:c>>>0<g>>>0&(d|0)<=(h|0)|(d|0)<(h|0)){break a}return (a^e|c^g|(b^f|d^h))!=0}j=-1;if((c|0)==(g|0)&(d|0)==(h|0)?(b|0)==(f|0)&a>>>0>e>>>0|b>>>0>f>>>0:c>>>0>g>>>0&(d|0)>=(h|0)|(d|0)>(h|0)){break a}j=(a^e|c^g|(b^f|d^h))!=0;}return j}function _n(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;a:{b:{e=J[a+4>>2];f=J[a>>2];d=e-f>>2;c:{if(d>>>0<b>>>0){g=b-d|0;c=J[a+8>>2];if(g>>>0<=c-e>>2>>>0){b=a;a=g<<2;J[b+4>>2]=Sb(e,0,a)+a;return}if(b>>>0>=1073741824){break b}c=c-f|0;h=c>>1;b=c>>>0>=2147483644?1073741823:b>>>0<h>>>0?h:b;if(b>>>0>=1073741824){break a}c=b<<2;b=cb(c);c=b+c|0;b=b+(d<<2)|0;d=g<<2;d=Sb(b,0,d)+d|0;if((e|0)!=(f|0)){while(1){b=b-4|0;e=e-4|0;J[b>>2]=J[e>>2];if((e|0)!=(f|0)){continue}break}}J[a+8>>2]=c;J[a+4>>2]=d;J[a>>2]=b;if(!f){break c}$a(f);return}if(b>>>0>=d>>>0){break c}J[a+4>>2]=(b<<2)+f;}return}nb();B();}Pb();B();}function Qk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;a=Ua-208|0;Ua=a;g=jb();J[a>>2]=e;e=a+176|0;h=yb(e,20,g,1937,a);g=h+e|0;i=Lb(e,g,J[c+4>>2]);f=J[c+28>>2];J[a+12>>2]=f;J[f+4>>2]=J[f+4>>2]+1;J[5996]=0;j=$(197,J[a+12>>2])|0;f=J[5996];J[5996]=0;if((f|0)!=1){f=J[a+12>>2];k=J[f+4>>2]-1|0;J[f+4>>2]=k;if((k|0)==-1){Xa[J[J[f>>2]+8>>2]](f);}f=e;e=a+16|0;Xa[J[J[j>>2]+48>>2]](j,f,g,e)|0;f=b;b=e+(h<<2)|0;b=Bc(f,e,(g|0)==(i|0)?b:(a+(i-a<<2)|0)-688|0,b,c,d);Ua=a+208|0;return b|0}c=Z()|0;a=J[a+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function Rb(a){var b=0,c=0,d=0,e=0,f=0;f=a+27&-4;a=f;b=a>>>0<=1?1:a;a=b;c=a+15&-16;a=a>>>0<c>>>0?c:a;if(a&15){a=0;}else {a=_c(16,a);}if(!a){a:{c=0;a=J[6705];if(!a){J[6705]=26844;I[13423]=125;I[13422]=128;a=J[6705];}d=(b+3>>>2|0)+1|0;while(1){b=0;b:{if(!a|(a|0)==27344){a=b;}else {b=L[a+2>>1];e=d+(b>>>0>d>>>0?b-d&3:0)|0;if(e>>>0<b>>>0){c=b-e|0;I[a+2>>1]=c;a=((c&65535)<<2)+a|0;I[a+2>>1]=e;I[a>>1]=0;a=a+4|0;break a}if(b>>>0<d>>>0){break b}b=L[a>>1];c:{if(!c){J[6705]=(b<<2)+26832;break c}I[c>>1]=b;}I[a>>1]=0;a=a+4|0;}break a}c=a;a=(L[a>>1]<<2)+26832|0;continue}}}if(!a){Vb();B();}return Sb(a,0,f)+24|0}function $k(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;a=Ua-96|0;Ua=a;g=jb();J[a>>2]=e;e=a- -64|0;h=yb(e,20,g,1937,a);g=h+e|0;i=Lb(e,g,J[c+4>>2]);f=J[c+28>>2];J[a+12>>2]=f;J[f+4>>2]=J[f+4>>2]+1;J[5996]=0;j=$(170,J[a+12>>2])|0;f=J[5996];J[5996]=0;if((f|0)!=1){f=J[a+12>>2];k=J[f+4>>2]-1|0;J[f+4>>2]=k;if((k|0)==-1){Xa[J[J[f>>2]+8>>2]](f);}f=e;e=a+16|0;Xa[J[J[j>>2]+32>>2]](j,f,g,e)|0;f=b;b=e+h|0;b=Ac(f,e,(g|0)==(i|0)?b:(a+(i-a|0)|0)-48|0,b,c,d);Ua=a+96|0;return b|0}c=Z()|0;a=J[a+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function He(a,b,c,d,e,f,g,h){var i=0,j=0,k=0,l=0;i=Ua-16|0;Ua=i;if(1073741806-b>>>0>=c>>>0){k=(K[a+11|0]&128)>>>7|0?J[a>>2]:a;j=i+4|0;l=j;if(b>>>0<=536870886){J[i+12>>2]=b<<1;J[i+4>>2]=b+c;c=J[(M[j>>2]<M[i+12>>2]?i+12|0:j)>>2];if(c>>>0>=2){j=c+4&-4;c=j-1|0;c=(c|0)==2?j:c;}else {c=1;}c=c+1|0;}else {c=1073741807;}Fc(l,c);c=J[i+4>>2];if(e){tc(c,k,e);}if(g){tc(c+(e<<2)|0,h,g);}j=e+f|0;h=d-j|0;if((d|0)!=(j|0)){d=e<<2;tc((d+c|0)+(g<<2)|0,(d+k|0)+(f<<2)|0,h);}if((b|0)!=1){$a(k);}J[a>>2]=c;J[a+8>>2]=J[i+8>>2]|-2147483648;b=a;a=h+(e+g|0)|0;J[b+4>>2]=a;J[c+(a<<2)>>2]=0;Ua=i+16|0;return}ub();B();}function Ad(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;e=c-b|0;if(e>>>0<2147483632){a:{if(e>>>0<=10){H[a+11|0]=e;d=a;break a}f=(e|15)+1|0;d=cb(f);J[a+8>>2]=f|-2147483648;J[a>>2]=d;J[a+4>>2]=e;}b:{if((b|0)==(c|0)){break b}f=(b^-1)+c|0;g=e&7;if(g){e=0;while(1){H[d|0]=K[b|0];d=d+1|0;b=b+1|0;e=e+1|0;if((g|0)!=(e|0)){continue}break}}if(f>>>0<7){break b}while(1){H[d|0]=K[b|0];H[d+1|0]=K[b+1|0];H[d+2|0]=K[b+2|0];H[d+3|0]=K[b+3|0];H[d+4|0]=K[b+4|0];H[d+5|0]=K[b+5|0];H[d+6|0]=K[b+6|0];H[d+7|0]=K[b+7|0];d=d+8|0;b=b+8|0;if((c|0)!=(b|0)){continue}break}}H[d|0]=0;return a|0}ub();B();}function $c(a,b,c,d){var e=0,f=0,g=0;e=Ua-32|0;Ua=e;if(c>>>0<2147483632){a:{b:{if(c>>>0>=11){g=(c|15)+1|0;f=cb(g);J[e+16>>2]=g|-2147483648;J[e+8>>2]=f;J[e+12>>2]=c;break b}H[e+19|0]=c;f=e+8|0;if(!c){break a}}f=fb(f,b,c)+c|0;}H[f|0]=0;J[5996]=0;aa(31,e+20|0,e+8|0);b=J[5996];J[5996]=0;c:{d:{if((b|0)!=1){if(H[e+19|0]<0){$a(J[e+8>>2]);}c=J[e+24>>2];b=J[e+20>>2];if((c-b|0)!=(d|0)){break d}J[a+4>>2]=c;J[a>>2]=b;J[a+8>>2]=J[e+28>>2];break c}a=Z()|0;if(H[e+19|0]<0){$a(J[e+8>>2]);}da(a|0);B();}J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;if(!b){break c}$a(b);}Ua=e+32|0;return}ub();B();}function dd(a,b,c,d,e,f,g,h){var i=0,j=0,k=0,l=0;i=Ua-16|0;Ua=i;if(2147483630-b>>>0>=c>>>0){k=(K[a+11|0]&128)>>>7|0?J[a>>2]:a;j=i+4|0;l=j;if(b>>>0<=1073741798){J[i+12>>2]=b<<1;J[i+4>>2]=b+c;c=J[(M[j>>2]<M[i+12>>2]?i+12|0:j)>>2];if(c>>>0>=11){j=c+16&-16;c=j-1|0;c=(c|0)==11?j:c;}else {c=10;}c=c+1|0;}else {c=2147483631;}Gc(l,c);c=J[i+4>>2];if(e){gc(c,k,e);}if(g){gc(c+e|0,h,g);}j=e+f|0;h=d-j|0;if((d|0)!=(j|0)){gc((c+e|0)+g|0,(e+k|0)+f|0,h);}if((b|0)!=10){$a(k);}J[a>>2]=c;J[a+8>>2]=J[i+8>>2]|-2147483648;b=a;a=h+(e+g|0)|0;J[b+4>>2]=a;H[a+c|0]=0;Ua=i+16|0;return}ub();B();}function Bc(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=Ua-16|0;Ua=i;a:{b:{if(!a){break b}g=J[e+12>>2];h=c-b|0;if((h|0)>0){h=h>>>2|0;if((Xa[J[J[a>>2]+48>>2]](a,b,h)|0)!=(h|0)){break b}}b=d-b>>2;g=(b|0)<(g|0)?g-b|0:0;if((g|0)>0){b=Hf(i+4|0,g,f);f=(K[b+11|0]&128)>>>7|0?J[b>>2]:b;J[5996]=0;f=ba(217,a|0,f|0,g|0)|0;h=J[5996];J[5996]=0;if((h|0)==1){break a}ab(b);if((f|0)!=(g|0)){break b}}b=d-c|0;if((b|0)>0){b=b>>>2|0;if((Xa[J[J[a>>2]+48>>2]](a,c,b)|0)!=(b|0)){break b}}J[e+12>>2]=0;j=a;}Ua=i+16|0;return j|0}a=Z()|0;ab(b);da(a|0);B();}function Mh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(Jb(a,J[b+8>>2],e)){if(!(J[b+28>>2]==1|J[b+4>>2]!=(c|0))){J[b+28>>2]=d;}return}a:{if(Jb(a,J[b>>2],e)){if(!(J[b+16>>2]!=(c|0)&J[b+20>>2]!=(c|0))){if((d|0)!=1){break a}J[b+32>>2]=1;return}J[b+32>>2]=d;b:{if(J[b+44>>2]==4){break b}I[b+52>>1]=0;a=J[a+8>>2];Xa[J[J[a>>2]+20>>2]](a,b,c,c,1,e);if(K[b+53|0]){J[b+44>>2]=3;if(!K[b+52|0]){break b}break a}J[b+44>>2]=4;}J[b+20>>2]=c;J[b+40>>2]=J[b+40>>2]+1;if(J[b+36>>2]!=1|J[b+24>>2]!=2){break a}H[b+54|0]=1;return}a=J[a+8>>2];Xa[J[J[a>>2]+24>>2]](a,b,c,d,e);}}function pb(a){var b=0,c=0,d=0,e=0;e=Ua-16|0;Ua=e;b=e+4|0;J[b+4>>2]=190;J[b>>2]=a;J[b+8>>2]=0;d=Ua-16|0;Ua=d;if(J[a>>2]!=-1){a:{c=d+12|0;J[c>>2]=b;b=d+8|0;J[b>>2]=c;while(1){c=J[a>>2];if((c|0)==1){continue}break}b:{if(!c){J[a>>2]=1;b=J[J[b>>2]>>2];J[5996]=0;ha(191,b|0);b=J[5996];J[5996]=0;if((b|0)==1){break b}J[a>>2]=-1;}break a}pa(fa(0)|0)|0;J[a>>2]=0;J[5996]=0;ca(192);a=J[5996];J[5996]=0;c:{if((a|0)==1){a=Z()|0;J[5996]=0;ca(110);b=J[5996];J[5996]=0;if((b|0)!=1){break c}fa(0)|0;Vb();}B();}da(a|0);B();}}Ua=d+16|0;Ua=e+16|0;return J[a+4>>2]-1|0}function Dk(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;c=Ua-128|0;Ua=c;J[c+12>>2]=c+116;d=J[a+8>>2];a=c+16|0;yf(d,a,c+12|0,e,f,g);e=Ua-16|0;Ua=e;g=Ua-32|0;Ua=g;d=Ua-16|0;Ua=d;J[d+12>>2]=J[c+12>>2];J[g+24>>2]=a;J[g+28>>2]=J[d+12>>2];Ua=d+16|0;f=J[g+24>>2];a=J[g+28>>2];d=Ua-16|0;Ua=d;J[d+12>>2]=b;while(1){if((a|0)!=(f|0)){sg(d+12|0,H[f|0]);f=f+1|0;continue}break}J[g+16>>2]=a;J[g+20>>2]=J[d+12>>2];Ua=d+16|0;a=J[g+16>>2];J[g+12>>2]=J[g+20>>2];J[e+8>>2]=a;J[e+12>>2]=J[g+12>>2];Ua=g+32|0;Ua=e+16|0;Ua=c+128|0;return J[e+12>>2]}function Sm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;J[5996]=0;e=$(3,24)|0;f=J[5996];J[5996]=0;a:{if((f|0)!=1){J[a+4>>2]=e;J[a>>2]=e;f=e+24|0;J[a+8>>2]=f;J[e>>2]=J[b>>2];J[e+4>>2]=J[b+4>>2];J[b>>2]=0;J[b+4>>2]=0;J[a+4>>2]=e+8;J[e+8>>2]=J[c>>2];J[e+12>>2]=J[c+4>>2];J[c>>2]=0;J[c+4>>2]=0;b=e+16|0;J[a+4>>2]=b;if(b>>>0<f>>>0){J[b>>2]=J[d>>2];J[b+4>>2]=J[d+4>>2];J[d>>2]=0;J[d+4>>2]=0;J[a+4>>2]=b+8;break a}J[5996]=0;aa(162,a|0,d|0);b=J[5996];J[5996]=0;if((b|0)!=1){break a}}b=Z()|0;lb(a);da(b|0);B();}}function Rm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;d=Ua-16|0;Ua=d;J[a>>2]=7e3;J[a+4>>2]=0;J[a+8>>2]=0;J[d+4>>2]=J[c>>2];J[d+8>>2]=J[c+4>>2];J[d+12>>2]=J[c+8>>2];J[c+8>>2]=0;J[c>>2]=0;J[c+4>>2]=0;J[5996]=0;ia(64,a+12|0,b|0,d+4|0,0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[d+4>>2];if(b){c=J[d+8>>2];if((b|0)!=(c|0)){while(1){c=c-8|0;e=J[c+4>>2];a:{if(!e){break a}f=J[e+4>>2];J[e+4>>2]=f-1;if(f){break a}Xa[J[J[e>>2]+8>>2]](e);bb(e);}if((b|0)!=(c|0)){continue}break}b=J[d+4>>2];}$a(b);}Ua=d+16|0;return a|0}a=Z()|0;lb(d+4|0);da(a|0);B();}function fc(a,b){var c=0,d=0,e=0,f=0,g=0,h=0,i=0;e=Ua-16|0;Ua=e;A(+b);g=v(1)|0;c=v(0)|0;d=g&2147483647;f=d+-1048576|0;a:{if((f|0)==2145386495|f>>>0<2145386495){h=c<<28;c=(d&15)<<28|c>>>4;d=(d>>>4|0)+1006632960|0;break a}if((d|0)==2146435072|d>>>0>2146435072){h=c<<28;c=(g&15)<<28|c>>>4;d=g>>>4|2147418112;break a}if(!(c|d)){c=0;d=0;break a}f=c;c=d?S(d):S(c)+32|0;Cb(e,f,d,0,0,c+49|0);i=J[e>>2];h=J[e+4>>2];f=15372-c<<16;c=J[e+8>>2];d=f|J[e+12>>2]^65536;}J[a>>2]=i;J[a+4>>2]=h;J[a+8>>2]=c;J[a+12>>2]=g&-2147483648|d;Ua=e+16|0;}function hm(a){a=a|0;var b=0,c=0,d=0,e=0;c=J[a+76>>2];if((c|0)==-1){c=a;d=Ua-16|0;Ua=d;a=J[a+28>>2];J[d+12>>2]=a;J[a+4>>2]=J[a+4>>2]+1;J[5996]=0;a=$(170,J[d+12>>2])|0;b=J[5996];J[5996]=0;a:{b:{if((b|0)==1){break b}J[5996]=0;a=_(171,a|0,32)|0;b=J[5996];J[5996]=0;if((b|0)==1){break b}b=J[d+12>>2];e=J[b+4>>2]-1|0;J[b+4>>2]=e;if((e|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}Ua=d+16|0;break a}b=Z()|0;a=J[d+12>>2];c=J[a+4>>2]-1|0;J[a+4>>2]=c;if((c|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(b|0);B();}b=c;c=a;J[b+76>>2]=a;}return c<<24>>24}function ch(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;c=J[a+4>>2];d=J[a+8>>2];if(c>>>0<d>>>0){J[c>>2]=b;J[a+4>>2]=c+4;return}a:{g=J[a>>2];e=c-g>>2;f=e+1|0;if(f>>>0<1073741824){h=e<<2;d=d-g|0;e=d>>1;e=d>>>0>=2147483644?1073741823:e>>>0>f>>>0?e:f;if(e){if(e>>>0>=1073741824){break a}f=cb(e<<2);}else {f=0;}d=h+f|0;J[d>>2]=b;b=d+4|0;if((c|0)!=(g|0)){while(1){d=d-4|0;c=c-4|0;J[d>>2]=J[c>>2];if((c|0)!=(g|0)){continue}break}c=J[a>>2];}J[a+8>>2]=f+(e<<2);J[a+4>>2]=b;J[a>>2]=d;if(c){$a(c);}return}nb();B();}Pb();B();}function Hm(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;e=Ua-16|0;Ua=e;f=cb(104);J[f>>2]=7e3;J[f+4>>2]=0;J[f+8>>2]=0;J[e+4>>2]=J[c>>2];J[e+8>>2]=J[c+4>>2];J[e+12>>2]=J[c+8>>2];J[c+8>>2]=0;J[c>>2]=0;J[c+4>>2]=0;J[5996]=0;g=ia(163,f+12|0,b|0,e+4|0,d|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){d=J[e+4>>2];if(d){b=J[e+8>>2];if((d|0)!=(b|0)){while(1){c=b-12|0;if(H[b-1|0]<0){$a(J[c>>2]);}b=c;if((c|0)!=(d|0)){continue}break}}$a(d);}J[a+4>>2]=f;J[a>>2]=g;Ua=e+16|0;return}a=Z()|0;rb(e+4|0);$a(f);da(a|0);B();}function Yf(a,b,c,d){var e=0,f=0,g=0;e=Ua-16|0;Ua=e;a:{b:{if((a|0)!=(b|0)){c:{g=J[5732];J[5732]=0;jb();a=Uf(a,e+12|0,d);d=Wa;d:{f=J[5732];if(f){if(J[e+12>>2]!=(b|0)){break c}if((f|0)!=68){break d}J[c>>2]=4;b=2147483647;if(!!a&(d|0)>=0|(d|0)>0){break a}break b}J[5732]=g;if(J[e+12>>2]==(b|0)){break d}break c}if((d|0)<0&a>>>0<=2147483647|(d|0)<-1){J[c>>2]=4;break b}if((d|0)>=0&a>>>0>=2147483648|(d|0)>0){J[c>>2]=4;b=2147483647;break a}b=a;break a}}J[c>>2]=4;b=0;break a}b=-2147483648;}Ua=e+16|0;return b}function xc(a,b,c,d,e,f){var g=0,h=0,i=0,j=0;a:{if(f&64){c=f+-64|0;b=c&31;if((c&63)>>>0>=32){c=0;b=e>>>b|0;}else {c=e>>>b|0;b=((1<<b)-1&e)<<32-b|d>>>b;}d=0;e=0;break a}if(!f){break a}i=d;h=64-f|0;g=h&31;if((h&63)>>>0>=32){h=d<<g;j=0;}else {h=(1<<g)-1&i>>>32-g|e<<g;j=i<<g;}i=b;b=f&31;if((f&63)>>>0>=32){g=0;b=c>>>b|0;}else {g=c>>>b|0;b=((1<<b)-1&c)<<32-b|i>>>b;}b=j|b;c=g|h;g=d;d=f&31;if((f&63)>>>0>=32){h=0;d=e>>>d|0;}else {h=e>>>d|0;d=((1<<d)-1&e)<<32-d|g>>>d;}e=h;}J[a>>2]=b;J[a+4>>2]=c;J[a+8>>2]=d;J[a+12>>2]=e;}function Rc(a,b,c){var d=0,e=0,f=0;d=Ua-16|0;Ua=d;J[d+12>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;b=$(198,J[d+12>>2])|0;e=J[5996];J[5996]=0;a:{if((e|0)==1){break a}J[5996]=0;e=$(206,b|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break a}J[c>>2]=e;J[5996]=0;aa(207,a|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break a}a=J[d+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}Ua=d+16|0;return}c=Z()|0;a=J[d+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function Tc(a,b,c){var d=0,e=0,f=0;d=Ua-16|0;Ua=d;J[d+12>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;b=$(180,J[d+12>>2])|0;e=J[5996];J[5996]=0;a:{if((e|0)==1){break a}J[5996]=0;e=$(193,b|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break a}H[c|0]=e;J[5996]=0;aa(194,a|0,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break a}a=J[d+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}Ua=d+16|0;return}c=Z()|0;a=J[d+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function sj(a){if(K[25148]){return J[6286]}if(!K[26240]){H[26240]=1;}ib(25952,18680);ib(25964,18712);ib(25976,18748);ib(25988,18772);ib(26e3,18796);ib(26012,18812);ib(26024,18832);ib(26036,18852);ib(26048,18880);ib(26060,18920);ib(26072,18952);ib(26084,18988);ib(26096,19024);ib(26108,19040);ib(26120,19056);ib(26132,19072);ib(26144,18796);ib(26156,19088);ib(26168,19104);ib(26180,19120);ib(26192,19136);ib(26204,19152);ib(26216,19168);ib(26228,19184);H[25148]=1;J[6286]=25952;return 25952}function qn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;f=Gb(c);a:{d=K[a+11|0];e=d&127;d=(d&128)>>>7|0;e=d?J[a+4>>2]:e;if(e>>>0>=b>>>0){d=d?(J[a+8>>2]&2147483647)-1|0:10;if(d-e>>>0>=f>>>0){if(!f){break a}d=(K[a+11|0]&128)>>>7|0?J[a>>2]:a;h=d+b|0;if((b|0)!=(e|0)){g=b+d|0;oc(g+f|0,g,e-b|0);c=(c>>>0>=g>>>0?d+e>>>0>c>>>0?f:0:0)+c|0;}oc(h,c,f);b=f+e|0;b:{if((K[a+11|0]&128)>>>7|0){J[a+4>>2]=b;break b}H[a+11|0]=b;}H[b+d|0]=0;break a}dd(a,d,(f+e|0)-d|0,e,b,0,f,c);break a}ue();B();}return a|0}function hh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0;e=J[a+4>>2];if((e|0)!=J[a+8>>2]){J[e>>2]=b;J[a+4>>2]=e+4;return}a:{g=J[a>>2];f=e-g|0;c=f>>2;d=c+1|0;if(d>>>0<1073741824){h=c<<2;c=f>>1;c=f>>>0>=2147483644?1073741823:c>>>0>d>>>0?c:d;if(c){if(c>>>0>=1073741824){break a}f=cb(c<<2);}else {f=0;}d=h+f|0;J[d>>2]=b;b=d+4|0;if((e|0)!=(g|0)){while(1){d=d-4|0;e=e-4|0;J[d>>2]=J[e>>2];if((e|0)!=(g|0)){continue}break}}J[a+8>>2]=f+(c<<2);J[a+4>>2]=b;J[a>>2]=d;if(g){$a(g);}return}nb();B();}Pb();B();}function Cb(a,b,c,d,e,f){var g=0,h=0,i=0;a:{if(f&64){e=f+-64|0;f=b;d=e&31;if((e&63)>>>0>=32){e=f<<d;d=0;}else {e=(1<<d)-1&f>>>32-d|c<<d;d=f<<d;}b=0;c=0;break a}if(!f){break a}h=d;g=f&31;if((f&63)>>>0>=32){i=d<<g;h=0;}else {i=(1<<g)-1&h>>>32-g|e<<g;h=h<<g;}g=b;e=64-f|0;d=e&31;if((e&63)>>>0>=32){e=0;d=c>>>d|0;}else {e=c>>>d|0;d=((1<<d)-1&c)<<32-d|g>>>d;}d=h|d;e=e|i;h=b;g=f&31;if((f&63)>>>0>=32){i=b<<g;b=0;}else {i=(1<<g)-1&h>>>32-g|c<<g;b=h<<g;}c=i;}J[a>>2]=b;J[a+4>>2]=c;J[a+8>>2]=d;J[a+12>>2]=e;}function vn(a){a=a|0;var b=0,c=0,d=0,e=0;e=J[a+44>>2];if(e){b=e;d=J[a+48>>2];if((b|0)!=(d|0)){while(1){d=d-8|0;c=J[d+4>>2];a:{if(!c){break a}b=J[c+4>>2];J[c+4>>2]=b-1;if(b){break a}Xa[J[J[c>>2]+8>>2]](c);bb(c);}if((d|0)!=(e|0)){continue}break}b=J[a+44>>2];}J[a+48>>2]=e;$a(b);}b=J[a+32>>2];if(b){J[a+36>>2]=b;$a(b);}c=J[a+20>>2];if(c){d=c;b=J[a+24>>2];if((c|0)!=(b|0)){while(1){e=b-12|0;if(H[b-1|0]<0){$a(J[e>>2]);}b=e;if((c|0)!=(b|0)){continue}break}d=J[a+20>>2];}J[a+24>>2]=c;$a(d);}}function Sl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=Ua-16|0;Ua=e;J[e>>2]=c;J[e+4>>2]=d;J[e+8>>2]=c;J[e+12>>2]=d;c=Ua-32|0;Ua=c;b=Kb(c+8|0,b);J[5996]=0;d=c+20|0;ea(174,d|0,e|0,b|0);f=J[5996];J[5996]=0;a:{b:{c:{if((f|0)!=1){J[5996]=0;a=_(175,a|0,d|0)|0;f=J[5996];J[5996]=0;if((f|0)==1){break c}ab(d);ab(b);J[a>>2]=21872;b=J[e+4>>2];J[a+8>>2]=J[e>>2];J[a+12>>2]=b;Ua=c+32|0;break a}a=Z()|0;break b}a=Z()|0;ab(c+20|0);}ab(b);da(a|0);B();}J[a>>2]=8492;Ua=e+16|0;return a|0}function ej(a){if(K[25140]){return J[6284]}if(!K[25936]){H[25936]=1;}hb(25648,1065);hb(25660,1056);hb(25672,2204);hb(25684,2058);hb(25696,1135);hb(25708,2381);hb(25720,1073);hb(25732,1297);hb(25744,1802);hb(25756,1785);hb(25768,1793);hb(25780,1812);hb(25792,2024);hb(25804,2543);hb(25816,1837);hb(25828,1683);hb(25840,1135);hb(25852,1965);hb(25864,2051);hb(25876,2280);hb(25888,1924);hb(25900,1386);hb(25912,1263);hb(25924,2539);H[25140]=1;J[6284]=25648;return 25648}function of(a,b,c,d,e){var f=0,g=0,h=0,i=0;f=Ua-16|0;Ua=f;if(1073741807-b>>>0>=c>>>0){h=(K[a+11|0]&128)>>>7|0?J[a>>2]:a;g=f+4|0;i=g;if(b>>>0<=536870886){J[f+12>>2]=b<<1;J[f+4>>2]=b+c;c=J[(M[g>>2]<M[f+12>>2]?f+12|0:g)>>2];if(c>>>0>=2){g=c+4&-4;c=g-1|0;c=(c|0)==2?g:c;}else {c=1;}c=c+1|0;}else {c=1073741807;}Fc(i,c);c=J[f+4>>2];if(e){tc(c,h,e);}if((d|0)!=(e|0)){g=e<<2;tc(g+c|0,g+h|0,d-e|0);}if((b|0)!=1){$a(h);}J[a>>2]=c;J[a+8>>2]=J[f+8>>2]|-2147483648;Ua=f+16|0;return}ub();B();}function Sd(a,b,c,d,e){var f=0,g=0,h=0,i=0;f=Ua-16|0;Ua=f;if(2147483631-b>>>0>=c>>>0){h=(K[a+11|0]&128)>>>7|0?J[a>>2]:a;g=f+4|0;i=g;if(b>>>0<=1073741798){J[f+12>>2]=b<<1;J[f+4>>2]=b+c;c=J[(M[g>>2]<M[f+12>>2]?f+12|0:g)>>2];if(c>>>0>=11){g=c+16&-16;c=g-1|0;c=(c|0)==11?g:c;}else {c=10;}c=c+1|0;}else {c=2147483631;}Gc(i,c);c=J[f+4>>2];if(e){gc(c,h,e);}if((d|0)!=(e|0)){gc(c+e|0,e+h|0,d-e|0);}if((b|0)!=10){$a(h);}J[a>>2]=c;J[a+8>>2]=J[f+8>>2]|-2147483648;Ua=f+16|0;return}ub();B();}function wm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;e=Ua-16|0;Ua=e;while(1){a:{if((c|0)<=(f|0)){break a}g=J[a+16>>2];d=J[a+12>>2];b:{if(g>>>0>d>>>0){J[e+12>>2]=2147483647;J[e+8>>2]=g-d;J[e+4>>2]=c-f;h=b;g=d;b=e+4|0;d=e+8|0;b=J[b>>2]<J[d>>2]?b:d;d=e+12|0;d=J[(J[b>>2]<J[d>>2]?b:d)>>2];b=gc(h,g,d);J[a+12>>2]=J[a+12>>2]+d;b=b+d|0;break b}d=Xa[J[J[a>>2]+40>>2]](a)|0;if((d|0)==-1){break a}H[b|0]=d<<24>>24;d=1;b=b+1|0;}f=d+f|0;continue}break}Ua=e+16|0;return f|0}function fh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=cb(56);a:{b:{if((c|0)==(d|0)){d=0;c=0;break b}f=d-c|0;if((f|0)<0){J[5996]=0;ca(8);a=J[5996];J[5996]=0;if((a|0)==1){break a}B();}J[5996]=0;d=$(3,f|0)|0;g=J[5996];J[5996]=0;if((g|0)==1){break a}c=fb(d,c,f)+f|0;}J[e+4>>2]=0;J[e+8>>2]=0;J[e>>2]=b;J[e+40>>2]=0;J[e+44>>2]=0;J[e+28>>2]=d;J[e+12>>2]=0;J[e+16>>2]=0;J[e+20>>2]=0;J[e+24>>2]=0;J[e+36>>2]=c;J[e+32>>2]=c;mc(a,e);return e|0}a=Z()|0;$a(e);da(a|0);B();}function Zb(a,b,c){var d=0,e=0;d=(c|0)!=0;a:{b:{c:{if(!(a&3)|!c){break c}e=b&255;while(1){if((e|0)==K[a|0]){break b}c=c-1|0;d=(c|0)!=0;a=a+1|0;if(!(a&3)){break c}if(c){continue}break}}if(!d){break a}d=b&255;if(!((d|0)==K[a|0]|c>>>0<4)){d=P(d,16843009);while(1){e=d^J[a>>2];if((e^-1)&e-16843009&-2139062144){break b}a=a+4|0;c=c-4|0;if(c>>>0>3){continue}break}}if(!c){break a}}b=b&255;while(1){if((b|0)==K[a|0]){return a}a=a+1|0;c=c-1|0;if(c){continue}break}}return 0}function ck(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0;a:{if(!((K[f+11|0]&128)>>>7|0)){b=J[f+4>>2];J[a>>2]=J[f>>2];J[a+4>>2]=b;J[a+8>>2]=J[f+8>>2];break a}e=J[f>>2];d=Ua-16|0;Ua=d;b:{c:{c=J[f+4>>2];d:{if(c>>>0<2){H[a+11|0]=c;break d}if(c>>>0>=1073741808){break c}g=d+8|0;if(c>>>0>=2){f=c+4&-4;b=f-1|0;b=(b|0)==2?f:b;}else {b=1;}Fc(g,b+1|0);b=J[d+8>>2];J[a>>2]=b;J[a+8>>2]=J[d+12>>2]|-2147483648;J[a+4>>2]=c;a=b;}tc(a,e,c+1|0);Ua=d+16|0;break b}ub();B();}}}function ud(a){var b=0,c=0;a:{b=J[a+4>>2];b=J[J[b>>2]-12>>2]+b|0;b:{if(!J[b+24>>2]|J[b+16>>2]|!(K[b+5|0]&32)){break b}if((Ha()|0)>0){break b}b=J[a+4>>2];b=J[(J[J[b>>2]-12>>2]+b|0)+24>>2];J[5996]=0;b=$(169,b|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){if((b|0)!=-1){break b}a=J[a+4>>2];b=J[J[a>>2]-12>>2];J[5996]=0;aa(138,a+b|0,1);a=J[5996];J[5996]=0;if((a|0)!=1){break b}}pa(fa(0)|0)|0;J[5996]=0;ca(110);a=J[5996];J[5996]=0;if((a|0)==1){break a}}return}fa(0)|0;Vb();B();}function Sf(a,b,c,d){var e=0,f=0,g=0,h=0;e=Ua-16|0;Ua=e;a:{b:{if((a|0)!=(b|0)){c:{d:{f=K[a|0];if((f|0)!=45){break d}a=a+1|0;if((b|0)!=(a|0)){break d}break c}h=J[5732];J[5732]=0;jb();a=ae(a,e+12|0,d);d=Wa;g=J[5732];e:{if(g){if(J[e+12>>2]!=(b|0)){break c}if(!d&a>>>0>65535|d|(g|0)==68){break e}break b}J[5732]=h;if(J[e+12>>2]!=(b|0)){break c}if(!d&a>>>0<65536){break b}}J[c>>2]=4;a=65535;break a}}J[c>>2]=4;a=0;break a}a=(f|0)==45?0-a|0:a;}Ua=e+16|0;return a&65535}function jf(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;e=Ua-16|0;Ua=e;d=K[a+11|0];c=d<<24>>24;c=(c|0)<0;d=c?J[a+4>>2]:d;a:{if(!d){break a}c=c?J[a>>2]:a;g=K[c|0];f=g-9&255;if(f>>>0<24&(8388639>>>f&1)){break a}f=K[(c+d|0)-1|0]-9|0;if((f&255)>>>0<24&(8388639>>>f&1)){break a}if((g|0)==45|(Gb(c)|0)!=(d|0)){break a}J[e+12>>2]=0;J[5732]=0;a=hf(H[a+11|0]<0?J[a>>2]:a,e+12|0,10);c=Wa;if(b){J[b>>2]=a;J[b+4>>2]=c;}a=J[e+12>>2];if(!a|K[a|0]){break a}h=!J[5732];}Ua=e+16|0;return h}function Pf(a,b,c,d){var e=0,f=0,g=0,h=0;e=Ua-16|0;Ua=e;a:{if((a|0)!=(b|0)){b:{c:{f=K[a|0];if((f|0)!=45){break c}a=a+1|0;if((b|0)!=(a|0)){break c}break b}h=J[5732];J[5732]=0;jb();a=ae(a,e+12|0,d);d=Wa;d:{g=J[5732];if(g){if(J[e+12>>2]!=(b|0)){break b}if((g|0)!=68){break d}J[c>>2]=4;a=-1;b=-1;break a}J[5732]=h;if(J[e+12>>2]==(b|0)){break d}break b}b=a;c=(f|0)==45;a=c?0-b|0:b;b=c?0-(d+((b|0)!=0)|0)|0:d;break a}}J[c>>2]=4;a=0;b=0;}Ua=e+16|0;Wa=b;return a}function Qm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=Ua-16|0;Ua=d;J[a>>2]=7e3;J[a+4>>2]=0;J[a+8>>2]=0;J[d+4>>2]=J[c>>2];J[d+8>>2]=J[c+4>>2];J[d+12>>2]=J[c+8>>2];J[c+8>>2]=0;J[c>>2]=0;J[c+4>>2]=0;J[5996]=0;ia(163,a+12|0,b|0,d+4|0,0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){e=J[d+4>>2];if(e){b=J[d+8>>2];if((e|0)!=(b|0)){while(1){c=b-12|0;if(H[b-1|0]<0){$a(J[c>>2]);}b=c;if((c|0)!=(e|0)){continue}break}}$a(e);}Ua=d+16|0;return a|0}a=Z()|0;rb(d+4|0);da(a|0);B();}function hd(a,b){var c=0,d=0,e=0,f=0,g=0;e=Ua-16|0;Ua=e;d=K[a+11|0];c=d<<24>>24;c=(c|0)<0;d=c?J[a+4>>2]:d;a:{if(!d){break a}c=c?J[a>>2]:a;f=K[c|0]-9&255;if(f>>>0<24&(8388639>>>f&1)){break a}f=K[(c+d|0)-1|0]-9|0;if((f&255)>>>0<24&(8388639>>>f&1)){break a}if((Gb(c)|0)!=(d|0)){break a}J[e+12>>2]=0;J[5732]=0;a=kf(H[a+11|0]<0?J[a>>2]:a,e+12|0,10);c=Wa;if(b){J[b>>2]=a;J[b+4>>2]=c;}a=J[e+12>>2];if(!a|K[a|0]){break a}g=!J[5732];}Ua=e+16|0;return g}function Sc(a,b){var c=0,d=0;c=Ua-16|0;Ua=c;J[c+12>>2]=a;J[a+4>>2]=J[a+4>>2]+1;J[5996]=0;a=$(197,J[c+12>>2])|0;d=J[5996];J[5996]=0;a:{b:{if((d|0)==1){break b}J[5996]=0;ga(208,a|0,12416,12442,b|0);a=J[5996];J[5996]=0;if((a|0)==1){break b}a=J[c+12>>2];d=J[a+4>>2]-1|0;J[a+4>>2]=d;if((d|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}Ua=c+16|0;break a}d=Z()|0;a=J[c+12>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(d|0);B();}return b}function Nk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-16|0;Ua=g;J[g+12>>2]=b;b=J[d+28>>2];J[g+8>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;h=$(170,J[g+8>>2])|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[g+8>>2];d=J[b+4>>2]-1|0;J[b+4>>2]=d;if((d|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}Ef(a,f+24|0,g+12|0,c,e,h);Ua=g+16|0;return J[g+12>>2]}c=Z()|0;a=J[g+8>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function Mk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-16|0;Ua=g;J[g+12>>2]=b;b=J[d+28>>2];J[g+8>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;h=$(170,J[g+8>>2])|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[g+8>>2];d=J[b+4>>2]-1|0;J[b+4>>2]=d;if((d|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}Df(a,f+16|0,g+12|0,c,e,h);Ua=g+16|0;return J[g+12>>2]}c=Z()|0;a=J[g+8>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function Hk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-16|0;Ua=g;J[g+12>>2]=b;b=J[d+28>>2];J[g+8>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;h=$(197,J[g+8>>2])|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[g+8>>2];d=J[b+4>>2]-1|0;J[b+4>>2]=d;if((d|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}Bf(a,f+24|0,g+12|0,c,e,h);Ua=g+16|0;return J[g+12>>2]}c=Z()|0;a=J[g+8>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function Gk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-16|0;Ua=g;J[g+12>>2]=b;b=J[d+28>>2];J[g+8>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;h=$(197,J[g+8>>2])|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[g+8>>2];d=J[b+4>>2]-1|0;J[b+4>>2]=d;if((d|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}Af(a,f+16|0,g+12|0,c,e,h);Ua=g+16|0;return J[g+12>>2]}c=Z()|0;a=J[g+8>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function pe(a,b){a:{if(a){if(b>>>0<=127){break a}b:{if(!J[J[6178]>>2]){if((b&-128)==57216){break a}break b}if(b>>>0<=2047){H[a+1|0]=b&63|128;H[a|0]=b>>>6|192;return 2}if(!((b&-8192)!=57344&b>>>0>=55296)){H[a+2|0]=b&63|128;H[a|0]=b>>>12|224;H[a+1|0]=b>>>6&63|128;return 3}if(b-65536>>>0<=1048575){H[a+3|0]=b&63|128;H[a|0]=b>>>18|240;H[a+2|0]=b>>>6&63|128;H[a+1|0]=b>>>12&63|128;return 4}}J[5732]=25;a=-1;}else {a=1;}return a}H[a|0]=b;return 1}function ic(a){var b=0,c=0,d=0,e=0,f=0;a:{d=a-24|0;a=d;if(a>>>0<27344&a>>>0>=26832){b=a-4|0;e=J[6705];c=e;while(1){a=c;if(!(!a|(a|0)==27344)){c=L[a+2>>1];if((a+(c<<2)|0)==(b|0)){I[a+2>>1]=c+L[d-2>>1];break a}if((a|0)==((L[b+2>>1]<<2)+b|0)){c=d-2|0;I[c>>1]=L[a+2>>1]+L[c>>1];if(!f){J[6705]=b;I[b>>1]=L[a>>1];break a}I[f>>1]=b-26832>>>2;break a}else {c=(L[a>>1]<<2)+26832|0;f=a;continue}}break}I[b>>1]=e-26832>>>2;J[6705]=b;break a}$a(d);}}function Rg(a,b,c,d,e){var f=0,g=0,h=0;h=-1;g=d&2147483647;f=(g|0)==2147418112;a:{if(f&!c?a|b:f&(c|0)!=0|g>>>0>2147418112){break a}f=e&2147483647;if(((f|0)==2147418112&0|f>>>0>2147418112)&(f|0)!=2147418112){break a}if(!(a|c|(f|g|b))){return 0}f=d&e;if((f|0)>0|(f|0)>=0){if(((c|0)!=0|(d|0)!=(e|0))&(d|0)<(e|0)){break a}return (a|c|(d^e|b))!=0}if(!c&(d|0)==(e|0)?a|b:(c|0)!=0&(d|0)>=(e|0)|(d|0)>(e|0)){break a}h=(a|c|(d^e|b))!=0;}return h}function Lk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0;a=Ua-16|0;Ua=a;J[a+12>>2]=b;b=J[d+28>>2];J[a+8>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;g=$(170,J[a+8>>2])|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[a+8>>2];d=J[b+4>>2]-1|0;J[b+4>>2]=d;if((d|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}Cf(f+20|0,a+12|0,c,e,g);Ua=a+16|0;return J[a+12>>2]}c=Z()|0;a=J[a+8>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function Fk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0;a=Ua-16|0;Ua=a;J[a+12>>2]=b;b=J[d+28>>2];J[a+8>>2]=b;J[b+4>>2]=J[b+4>>2]+1;J[5996]=0;g=$(197,J[a+8>>2])|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=J[a+8>>2];d=J[b+4>>2]-1|0;J[b+4>>2]=d;if((d|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}zf(f+20|0,a+12|0,c,e,g);Ua=a+16|0;return J[a+12>>2]}c=Z()|0;a=J[a+8>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}function Hf(a,b,c){var d=0,e=0,f=0,g=0,h=0;e=a;g=Ua-16|0;Ua=g;a:{if(b>>>0<1073741808){b:{if(b>>>0<2){H[e+11|0]=b;break b}h=g+8|0;if(b>>>0>=2){f=b+4&-4;d=f-1|0;d=(d|0)==2?f:d;}else {d=1;}Fc(h,d+1|0);d=J[g+8>>2];J[e>>2]=d;J[e+8>>2]=J[g+12>>2]|-2147483648;J[e+4>>2]=b;e=d;}f=Ua-16|0;Ua=f;J[f+12>>2]=c;c=e;d=b;while(1){if(d){J[c>>2]=J[f+12>>2];d=d-1|0;c=c+4|0;continue}break}Ua=f+16|0;J[(b<<2)+e>>2]=0;Ua=g+16|0;break a}ub();B();}return a}function xb(a,b,c,d,e,f,g,h,i){var j=0,k=0,l=0,m=0;i=co(b,c,h,i);h=Wa;e=co(d,e,f,g);i=e+i|0;d=Wa+h|0;h=e>>>0>i>>>0?d+1|0:d;j=g;e=0;k=c;d=0;c=co(g,e,c,d);g=c+i|0;i=Wa+h|0;l=g;c=c>>>0>g>>>0?i+1|0:i;g=co(f,0,b,0);h=Wa;i=0;d=co(f,i,k,d);h=h+d|0;f=Wa+i|0;f=d>>>0>h>>>0?f+1|0:f;i=f+l|0;d=c;f=f>>>0>i>>>0?d+1|0:d;b=co(b,m,j,e)+h|0;e=Wa;e=b>>>0<h>>>0?e+1|0:e;h=e+i|0;i=f;J[a+8>>2]=h;J[a+12>>2]=e>>>0>h>>>0?i+1|0:i;J[a>>2]=g;J[a+4>>2]=b;}function Qf(a,b,c,d){var e=0,f=0,g=0,h=0;e=Ua-16|0;Ua=e;a:{b:{if((a|0)!=(b|0)){c:{d:{f=K[a|0];if((f|0)!=45){break d}a=a+1|0;if((b|0)!=(a|0)){break d}break c}h=J[5732];J[5732]=0;jb();a=ae(a,e+12|0,d);d=Wa;g=J[5732];e:{if(g){if(J[e+12>>2]!=(b|0)){break c}if((g|0)==68|d){break e}break b}J[5732]=h;if(J[e+12>>2]!=(b|0)){break c}if(!d){break b}}J[c>>2]=4;a=-1;break a}}J[c>>2]=4;a=0;break a}a=(f|0)==45?0-a|0:a;}Ua=e+16|0;return a}function ie(a,b){a=a|0;b=b|0;var c=0,d=0;a:{d=K[a+11|0];c=d&127;d=(d&128)>>>7|0;c=d?J[a+4>>2]:c;if(c>>>0<b>>>0){b=b-c|0;if(b){d=d?(J[a+8>>2]&2147483647)-1|0:10;c=K[a+11|0];c=(c&128)>>>7|0?J[a+4>>2]:c&127;if(d-c>>>0<b>>>0){Sd(a,d,c+(b-d|0)|0,c,c);}d=(K[a+11|0]&128)>>>7|0?J[a>>2]:a;og(d+c|0,b,0);b=b+c|0;b:{if((K[a+11|0]&128)>>>7|0){J[a+4>>2]=b;break b}H[a+11|0]=b;}H[b+d|0]=0;}break a}sd(a,(K[a+11|0]&128)>>>7|0?J[a>>2]:a,b);}}function qb(a,b,c){var d=0,e=0,f=0;e=Ua-16|0;Ua=e;J[b+4>>2]=J[b+4>>2]+1;f=a+8|0;d=e+12|0;J[d>>2]=b;a:{b=J[a+12>>2];a=J[a+8>>2];if(b-a>>2>>>0<=c>>>0){J[5996]=0;aa(274,f|0,c+1|0);a=J[5996];J[5996]=0;if((a|0)==1){break a}a=J[f>>2];}a=(c<<2)+a|0;b=J[a>>2];if(b){a=J[b+4>>2]-1|0;J[b+4>>2]=a;if((a|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}a=J[f>>2]+(c<<2)|0;}b=J[d>>2];J[d>>2]=0;J[a>>2]=b;$e(d);Ua=e+16|0;return}a=Z()|0;$e(d);da(a|0);B();}function Im(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;d=Ua-16|0;Ua=d;a:{b:{c:{if((b|0)!=(c|0)){c=c-b|0;if((c|0)<18){break c}}H[a+12|0]=0;H[a|0]=0;break b}if(c>>>0>=2147483632){break a}d:{if(c>>>0<=10){H[d+15|0]=c;e=d+4|0;break d}f=(c|15)+1|0;e=cb(f);J[d+12>>2]=f|-2147483648;J[d+4>>2]=e;J[d+8>>2]=c;}H[fb(e,b,c)+c|0]=0;J[a+8>>2]=J[d+12>>2];b=J[d+8>>2];J[a>>2]=J[d+4>>2];J[a+4>>2]=b;H[a+12|0]=1;}Ua=d+16|0;return}ub();B();}function Uh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=Ua-16|0;Ua=e;a:{f=J[b>>2];if(f){d=K[c+11|0];if((d&128)>>>7|0?J[c+4>>2]:d&127){Sg(c,5570);f=J[b>>2];}d=e+4|0;b=J[b+4>>2];Xa[J[J[b>>2]+24>>2]](d,b,f);J[5996]=0;_(290,c|0,d|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}ab(d);}b=J[c+4>>2];J[a>>2]=J[c>>2];J[a+4>>2]=b;J[a+8>>2]=J[c+8>>2];J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;Ua=e+16|0;return}a=Z()|0;ab(e+4|0);da(a|0);B();}function Fb(a){var b=0,c=0,d=0;b=J[a+40>>2];if(b){J[a+44>>2]=b;$a(b);}c=J[a+28>>2];if(c){d=c;b=J[a+32>>2];if((c|0)!=(b|0)){while(1){d=b-12|0;if(H[b-1|0]<0){$a(J[d>>2]);}b=d;if((c|0)!=(b|0)){continue}break}d=J[a+28>>2];}J[a+32>>2]=c;$a(d);}b=J[a+16>>2];if(b){J[a+20>>2]=b;$a(b);}c=J[a+4>>2];if(c){b=c;d=J[a+8>>2];if((b|0)!=(d|0)){while(1){d=Fb(d-56|0);if((c|0)!=(d|0)){continue}break}b=J[a+4>>2];}J[a+8>>2]=c;$a(b);}return a}function zb(a,b,c,d){var e=0,f=0,g=0;a:{e=K[a+11|0];if(!((e&128)>>>7|0?J[a+4>>2]:e&127)|(c-b|0)<5){break a}md(b,c);e=c-4|0;c=(K[a+11|0]&128)>>>7|0?J[a>>2]:a;f=J[a+4>>2];a=K[a+11|0];g=c+((a&128)>>>7|0?f:a&127)|0;b:{while(1){c:{a=H[c|0];f=a-127|0;if(b>>>0>=e>>>0){break c}if((a|0)!=J[b>>2]&(f&255)>>>0>=130){break b}b=b+4|0;c=((g-c|0)>1)+c|0;continue}break}if((f&255)>>>0<130|a>>>0>J[e>>2]-1>>>0){break a}}J[d>>2]=4;}}function Xc(a){var b=0,c=0,d=0,e=0,f=0,g=0,h=0;d=J[a>>2];if(d){b=d;c=J[a+4>>2];if((b|0)!=(c|0)){while(1){f=c-12|0;e=J[f>>2];if(e){b=e;g=c-8|0;c=J[g>>2];if((b|0)!=(c|0)){while(1){c=c-32|0;b=J[c+4>>2];a:{if(!b){break a}h=J[b+4>>2];J[b+4>>2]=h-1;if(h){break a}Xa[J[J[b>>2]+8>>2]](b);bb(b);}if((c|0)!=(e|0)){continue}break}b=J[f>>2];}J[g>>2]=e;$a(b);}c=f;if((d|0)!=(c|0)){continue}break}b=J[a>>2];}J[a+4>>2]=d;$a(b);}}function td(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0;d=a;g=Ua-16|0;Ua=g;a:{f=c-b|0;if(f>>>0<2147483632){b:{if(f>>>0<11){H[d+11|0]=f;break b}i=g+8|0;if(f>>>0>=11){h=f+16&-16;e=h-1|0;e=(e|0)==11?h:e;}else {e=10;}Gc(i,e+1|0);e=J[g+8>>2];J[d>>2]=e;J[d+8>>2]=J[g+12>>2]|-2147483648;J[d+4>>2]=f;d=e;}while(1){if((b|0)!=(c|0)){H[d|0]=K[b|0];d=d+1|0;b=b+1|0;continue}break}H[d|0]=0;Ua=g+16|0;break a}ub();B();}return a}function ag(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0;d=a;g=Ua-16|0;Ua=g;a:{f=c-b>>2;if(f>>>0<1073741808){b:{if(f>>>0<2){H[d+11|0]=f;break b}i=g+8|0;if(f>>>0>=2){h=f+4&-4;e=h-1|0;e=(e|0)==2?h:e;}else {e=1;}Fc(i,e+1|0);e=J[g+8>>2];J[d>>2]=e;J[d+8>>2]=J[g+12>>2]|-2147483648;J[d+4>>2]=f;d=e;}while(1){if((b|0)!=(c|0)){J[d>>2]=J[b>>2];d=d+4|0;b=b+4|0;continue}break}J[d>>2]=0;Ua=g+16|0;break a}ub();B();}return a}\n\t\tfunction pm(a,b){a=a|0;b=b|0;var c=0,d=0;b=!J[a+24>>2]|(J[a+16>>2]|b);J[a+16>>2]=b;if(b&J[a+20>>2]){a=Ua-16|0;Ua=a;c=Rb(16);a=a+8|0;b=Ua-16|0;Ua=b;if(!K[24716]){H[24716]=1;}J[b+12>>2]=22908;J[b+8>>2]=1;d=J[b+12>>2];J[a>>2]=J[b+8>>2];J[a+4>>2]=d;Ua=b+16|0;b=J[a+4>>2];a=J[a>>2];J[5996]=0;a=Ja(176,c|0,1821,a|0,b|0)|0;b=J[5996];J[5996]=0;if((b|0)!=1){na(a|0,8576,177);B();}a=Z()|0;ic(c);da(a|0);B();}}function tm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;e=Ua-16|0;Ua=e;while(1){a:{if((c|0)<=(f|0)){break a}d=J[a+24>>2];g=J[a+28>>2];if(d>>>0>=g>>>0){if((Xa[J[J[a>>2]+52>>2]](a,K[b|0])|0)==-1){break a}f=f+1|0;b=b+1|0;}else {J[e+12>>2]=g-d;J[e+8>>2]=c-f;h=d;d=e+8|0;g=e+12|0;d=J[(J[d>>2]<J[g>>2]?d:g)>>2];gc(h,b,d);J[a+24>>2]=d+J[a+24>>2];f=d+f|0;b=b+d|0;}continue}break}Ua=e+16|0;return f|0}function go(a,b,c){var d=0,e=0,f=0,g=0;g=c&63;f=g;e=f&31;if(f>>>0>=32){f=-1>>>e|0;}else {d=-1>>>e|0;f=d|(1<<e)-1<<32-e;}f=f&a;d=b&d;e=g&31;if(g>>>0>=32){d=f<<e;g=0;}else {d=(1<<e)-1&f>>>32-e|d<<e;g=f<<e;}f=d;e=0-c&63;d=e&31;if(e>>>0>=32){d=-1<<d;c=0;}else {c=-1<<d;d=c|(1<<d)-1&-1>>>32-d;}a=c&a;b=b&d;d=e&31;if(e>>>0>=32){c=0;a=b>>>d|0;}else {c=b>>>d|0;a=((1<<d)-1&b)<<32-d|a>>>d;}a=a|g;Wa=c|f;return a}\n\t\tfunction wb(a,b,c){var d=0,e=0,f=0;if(!(K[a|0]&32)){a:{d=b;b=a;a=J[b+16>>2];b:{if(!a){if(Be(b)){break b}a=J[b+16>>2];}f=J[b+20>>2];if(a-f>>>0<c>>>0){Xa[J[b+36>>2]](b,d,c)|0;break a}c:{if(J[b+80>>2]<0){break c}a=c;while(1){e=a;if(!a){break c}a=a-1|0;if(K[d+a|0]!=10){continue}break}if(Xa[J[b+36>>2]](b,d,e)>>>0<e>>>0){break b}d=d+e|0;c=c-e|0;f=J[b+20>>2];}fb(f,d,c);J[b+20>>2]=J[b+20>>2]+c;}}}}function am(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;e=J[a+44>>2];c=J[a+24>>2];if(e>>>0<c>>>0){J[a+44>>2]=c;e=c;}c=J[a+12>>2];f=J[a+8>>2];d=-1;a:{if(c>>>0<=f>>>0){break a}if((b|0)==-1){J[a+16>>2]=e;J[a+12>>2]=c-1;J[a+8>>2]=f;return ((b|0)!=-1?b:0)|0}g=b<<24>>24;if(!(J[a+48>>2]&16)){d=-1;if((g|0)!=H[c-1|0]){break a}}J[a+16>>2]=e;J[a+12>>2]=c-1;J[a+8>>2]=f;H[J[a+12>>2]]=g;d=b;}return d|0}function Yh(a,b,c){a=a|0;b=b|0;c=+c;var d=0,e=0,f=0;f=Ua-16|0;Ua=f;d=K[b+11|0];d=(d&128)>>>7|0?J[b+4>>2]:d&127;while(1){a:{e=(K[b+11|0]&128)>>>7|0?J[b>>2]:b;O[f>>3]=c;e=od(e,d+1|0,2314,f);b:{if((e|0)>=0){if(d>>>0>=e>>>0){break a}d=e;break b}d=d<<1|1;}ie(b,d);continue}break}ie(b,e);d=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=d;J[a+8>>2]=J[b+8>>2];J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;Ua=f+16|0;}function Of(a,b,c){var d=0,e=0,f=Q(0),g=0,h=Q(0);e=Ua-16|0;Ua=e;a:{b:{c:{if((a|0)!=(b|0)){g=J[5732];J[5732]=0;jb();d=Ua-16|0;Ua=d;ee(d,a,e+12|0,0);f=Vf(J[d>>2],J[d+4>>2],J[d+8>>2],J[d+12>>2]);Ua=d+16|0;a=J[5732];if(!a){break c}if(J[e+12>>2]!=(b|0)){break b}h=f;if((a|0)!=68){break a}break b}J[c>>2]=4;break a}J[5732]=g;if(J[e+12>>2]==(b|0)){break a}}J[c>>2]=4;f=h;}Ua=e+16|0;return f}function Mf(a,b,c){var d=0,e=0,f=0,g=0,h=0;e=Ua-16|0;Ua=e;a:{b:{c:{if((a|0)!=(b|0)){g=J[5732];J[5732]=0;jb();d=Ua-16|0;Ua=d;ee(d,a,e+12|0,1);f=ge(J[d>>2],J[d+4>>2],J[d+8>>2],J[d+12>>2]);Ua=d+16|0;a=J[5732];if(!a){break c}if(J[e+12>>2]!=(b|0)){break b}h=f;if((a|0)!=68){break a}break b}J[c>>2]=4;break a}J[5732]=g;if(J[e+12>>2]==(b|0)){break a}}J[c>>2]=4;f=h;}Ua=e+16|0;return f}function mk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=(K[a+11|0]&128)>>>7|0?(J[a+8>>2]&2147483647)-1|0:1;f=K[a+11|0];d=f;d=(d&128)>>>7|0?J[a+4>>2]:d&127;a:{if(e-d>>>0>=c>>>0){if(!c){break a}e=(f&128)>>>7|0?J[a>>2]:a;tc(e+(d<<2)|0,b,c);b=c+d|0;b:{if((K[a+11|0]&128)>>>7|0){J[a+4>>2]=b;break b}H[a+11|0]=b;}J[e+(b<<2)>>2]=0;return a|0}He(a,e,d+(c-e|0)|0,d,d,0,c,b);}return a|0}function Bi(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;while(1){a:{if((c|0)==(d|0)|e>>>0<=i>>>0){break a}g=1;h=Ua-16|0;Ua=h;f=Xb(h+12|0,J[a+8>>2]);j=qd(0,c,d-c|0,b?b:24840);f=J[f>>2];if(f){J[6178]=(f|0)==-1?24816:f;}Ua=h+16|0;b:{switch(j+2|0){default:g=j;break;case 0:case 1:break a;case 2:break b}}i=i+1|0;k=g+k|0;c=c+g|0;continue}break}return k|0}function kd(a,b,c){var d=0,e=0;if(c&2048){H[a|0]=43;a=a+1|0;}if(c&1024){H[a|0]=35;a=a+1|0;}d=c&260;if((d|0)!=260){H[a|0]=46;H[a+1|0]=42;a=a+2|0;}c=c&16384;while(1){e=K[b|0];if(e){H[a|0]=e;a=a+1|0;b=b+1|0;continue}break}a:{b:{if((d|0)!=256){if((d|0)!=4){break b}b=c?70:102;break a}b=c?69:101;break a}b=c?65:97;if((d|0)==260){break a}b=c?71:103;}H[a|0]=b;return (d|0)!=260}function ve(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=(K[a+11|0]&128)>>>7|0?(J[a+8>>2]&2147483647)-1|0:10;f=K[a+11|0];d=f;d=(d&128)>>>7|0?J[a+4>>2]:d&127;a:{if(e-d>>>0>=c>>>0){if(!c){break a}e=(f&128)>>>7|0?J[a>>2]:a;gc(e+d|0,b,c);b=c+d|0;b:{if((K[a+11|0]&128)>>>7|0){J[a+4>>2]=b;break b}H[a+11|0]=b;}H[b+e|0]=0;return a|0}dd(a,e,d+(c-e|0)|0,d,d,0,c,b);}return a|0}function Gh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(Jb(a,J[b+8>>2],e)){if(!(J[b+28>>2]==1|J[b+4>>2]!=(c|0))){J[b+28>>2]=d;}return}a:{if(!Jb(a,J[b>>2],e)){break a}if(!(J[b+16>>2]!=(c|0)&J[b+20>>2]!=(c|0))){if((d|0)!=1){break a}J[b+32>>2]=1;return}J[b+20>>2]=c;J[b+32>>2]=d;J[b+40>>2]=J[b+40>>2]+1;if(!(J[b+36>>2]!=1|J[b+24>>2]!=2)){H[b+54|0]=1;}J[b+44>>2]=4;}}function uf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=Ua-16|0;Ua=e;i=J[b>>2];d=J[c>>2];g=J[a>>2];f=d-g|0;f=f>>>0>=2147483647?-1:(d|0)==(g|0)?4:f<<1;d=J[a+4>>2]==220;h=Vc(d?0:g,f);if(h){if(!d){J[a>>2]=0;}J[e+4>>2]=184;d=e+8|0;J[d>>2]=h;J[d+4>>2]=J[e+4>>2];a=rf(a,d);db(d);J[b>>2]=J[a>>2]+(i-g|0);J[c>>2]=J[a>>2]+(f&-4);Ua=e+16|0;return}ce();B();}function gn(a,b){a=a|0;b=+b;var c=0,d=0,e=0;d=Ua-16|0;Ua=d;c=d+4|0;J[c>>2]=0;J[c+4>>2]=0;J[c+8>>2]=0;e=(K[c+11|0]&128)>>>7|0?(J[c+8>>2]&2147483647)-1|0:10;J[5996]=0;aa(172,c|0,e|0);e=J[5996];J[5996]=0;if((e|0)==1){a=Z()|0;ab(c);da(a|0);B();}J[5996]=0;Pa(120,a|0,c|0,+b);a=J[5996];J[5996]=0;if((a|0)!=1){ab(c);Ua=d+16|0;return}a=Z()|0;ab(d+4|0);da(a|0);B();}function fd(a,b){var c=0,d=0,e=0,f=0,g=0,h=0;c=K[a+11|0];d=c<<24>>24;f=J[b+4>>2];d=(d|0)<0;c=d?J[a+4>>2]:c;a:{if(f>>>0<c+2>>>0){break a}e=J[b>>2];g=c+e|0;if(K[g|0]!=40|K[(e+f|0)-1|0]!=41){break a}if(c){a=d?J[a>>2]:a;d=c+a|0;while(1){if(K[a|0]!=K[e|0]){return 0}e=e+1|0;a=a+1|0;if((d|0)!=(a|0)){continue}break}}J[b+4>>2]=(f-c|0)-2;h=1;J[b>>2]=g+1;}return h}function Tf(a,b,c,d){var e=0,f=0,g=0;e=Ua-16|0;Ua=e;a:{if((a|0)!=(b|0)){g=J[5732];J[5732]=0;jb();a=Uf(a,e+12|0,d);d=Wa;f=J[5732];b:{if(f){if(J[e+12>>2]!=(b|0)){break b}if((f|0)!=68){break a}J[c>>2]=4;b=!!a&(d|0)>=0|(d|0)>0;a=b?-1:0;d=b?2147483647:-2147483648;break a}J[5732]=g;if(J[e+12>>2]==(b|0)){break a}}}J[c>>2]=4;a=0;d=0;}Ua=e+16|0;Wa=d;return a}function Ol(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0;e=J[a+84>>2];f=J[e>>2];d=J[e+4>>2];h=J[a+28>>2];g=J[a+20>>2]-h|0;g=d>>>0<g>>>0?d:g;if(g){fb(f,h,g);f=g+J[e>>2]|0;J[e>>2]=f;d=J[e+4>>2]-g|0;J[e+4>>2]=d;}d=c>>>0>d>>>0?d:c;if(d){fb(f,b,d);f=d+J[e>>2]|0;J[e>>2]=f;J[e+4>>2]=J[e+4>>2]-d;}H[f|0]=0;b=J[a+44>>2];J[a+28>>2]=b;J[a+20>>2]=b;return c|0}function xk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,i=0;e=Ua-16|0;Ua=e;i=J[b>>2];g=J[a>>2];d=J[c>>2]-g|0;f=d<<1;f=d>>>0>=2147483647?-1:f>>>0<=1?1:f;d=J[a+4>>2]==220;h=Vc(d?0:g,f);if(h){if(!d){J[a>>2]=0;}J[e+4>>2]=184;d=e+8|0;J[d>>2]=h;J[d+4>>2]=J[e+4>>2];a=rf(a,d);db(d);J[b>>2]=J[a>>2]+(i-g|0);J[c>>2]=f+J[a>>2];Ua=e+16|0;return}ce();B();}function Hd(a,b,c,d){H[a+53|0]=1;a:{if(J[a+4>>2]!=(c|0)){break a}H[a+52|0]=1;c=J[a+16>>2];b:{if(!c){J[a+36>>2]=1;J[a+24>>2]=d;J[a+16>>2]=b;if((d|0)!=1){break a}if(J[a+48>>2]==1){break b}break a}if((b|0)==(c|0)){c=J[a+24>>2];if((c|0)==2){J[a+24>>2]=d;c=d;}if(J[a+48>>2]!=1){break a}if((c|0)==1){break b}break a}J[a+36>>2]=J[a+36>>2]+1;}H[a+54|0]=1;}}function Oh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=Ua+-64|0;Ua=d;e=1;a:{if(Jb(a,b,0)){break a}e=0;if(!b){break a}b=Fe(b,22104);e=0;if(!b){break a}Sb(d+12|0,0,52);J[d+56>>2]=1;J[d+20>>2]=-1;J[d+16>>2]=a;J[d+8>>2]=b;Xa[J[J[b>>2]+28>>2]](b,d+8|0,J[c>>2],1);a=J[d+32>>2];if((a|0)==1){J[c>>2]=J[d+24>>2];}e=(a|0)==1;}a=e;Ua=d- -64|0;return a|0}function tj(a){if(K[25132]){return J[6282]}if(!K[25640]){H[25640]=1;}ib(25472,18340);ib(25484,18368);ib(25496,18396);ib(25508,18428);ib(25520,18468);ib(25532,18504);ib(25544,18532);ib(25556,18568);ib(25568,18584);ib(25580,18600);ib(25592,18616);ib(25604,18632);ib(25616,18648);ib(25628,18664);H[25132]=1;J[6282]=25472;return 25472}function en(a){a=a|0;var b=0,c=0;b=J[a+80>>2];a:{if(!b|M[a+84>>2]>3600){break a}if(Wb(3557,1)&(b^-1)){break a}b=J[a+80>>2];if(!b|M[a+84>>2]>3600|(J[a+52>>2]+J[a+44>>2]>>>0>201|M[a+68>>2]>100)){break a}if(Wb(2049,1)&(b^-1)){break a}b=J[a+80>>2];if(Wb(2165,1)&(b^-1)|K[a+88|0]){break a}a=J[a+80>>2];c=!(Wb(1681,1)&(a^-1));}return c|0}function Zc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;e=Ua-16|0;Ua=e;a:{b:{if(c>>>0<11){H[a+11|0]=c;break b}if(c>>>0>=2147483632){break a}g=e+8|0;if(c>>>0>=11){f=c+16&-16;d=f-1|0;d=(d|0)==11?f:d;}else {d=10;}Gc(g,d+1|0);d=J[e+8>>2];J[a>>2]=d;J[a+8>>2]=J[e+12>>2]|-2147483648;J[a+4>>2]=c;a=d;}gc(a,b,c+1|0);Ua=e+16|0;return}ub();B();}function ib(a,b){var c=0,d=0,e=0,f=0;a:{c=We(b);d=(K[a+11|0]&128)>>>7|0?(J[a+8>>2]&2147483647)-1|0:1;if(c>>>0<=d>>>0){b=eb((K[a+11|0]&128)>>>7|0?J[a>>2]:a,b,c<<2);b:{if((K[a+11|0]&128)>>>7|0){J[a+4>>2]=c;break b}H[a+11|0]=c;}J[(c<<2)+b>>2]=0;break a}e=a;f=J[a+4>>2];a=K[a+11|0];a=(a&128)>>>7|0?f:a&127;He(e,d,c-d|0,a,0,a,c,b);}}function Qg(a){var b=0,c=0,d=0;d=J[a>>2];if(d){b=J[a+4>>2];c=d;if((b|0)!=(c|0)){while(1){c=b-32|0;if((K[c|0]|K[c+1|0]<<8|(K[c+2|0]<<16|K[c+3|0]<<24))>>>0>=29){b=b-24|0;$a(K[b|0]|K[b+1|0]<<8|(K[b+2|0]<<16|K[b+3|0]<<24));H[b|0]=0;H[b+1|0]=0;H[b+2|0]=0;H[b+3|0]=0;}b=c;if((d|0)!=(b|0)){continue}break}c=J[a>>2];}J[a+4>>2]=d;$a(c);}}function Ei(a,b){a=a|0;b=b|0;var c=0,d=0;H[a+6|0]=0;I[a+4>>1]=0;J[a>>2]=1;c=J[b>>2];d=J[b+4>>2];J[a+20>>2]=0;J[a+12>>2]=0;J[a+16>>2]=0;J[a+8>>2]=(d-c|0)+1;c=cb(12);J[a+16>>2]=c;J[a+12>>2]=c;d=c+12|0;J[a+20>>2]=d;J[c>>2]=J[b>>2];J[c+4>>2]=J[b+4>>2];J[c+8>>2]=J[b+8>>2];J[b+8>>2]=0;J[b>>2]=0;J[b+4>>2]=0;J[a+16>>2]=d;return a|0}function dh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,f=0,g=0,h=0;e=cb(56);f=J[c+8>>2];J[c+8>>2]=0;g=J[c>>2];h=J[c+4>>2];J[c>>2]=0;J[c+4>>2]=0;J[e+16>>2]=0;J[e+20>>2]=0;J[e+12>>2]=f;J[e+4>>2]=g;J[e+8>>2]=h;J[e>>2]=b;J[e+24>>2]=0;J[e+28>>2]=0;J[e+32>>2]=0;J[e+36>>2]=0;J[e+40>>2]=0;J[e+44>>2]=0;O[e+48>>3]=d;mc(a,e);return e|0}function fj(a){if(K[25124]){return J[6280]}if(!K[25464]){H[25464]=1;}hb(25296,1114);hb(25308,1121);hb(25320,1087);hb(25332,1095);hb(25344,1078);hb(25356,1128);hb(25368,1105);hb(25380,1961);hb(25392,1999);hb(25404,2336);hb(25416,2493);hb(25428,1273);hb(25440,2172);hb(25452,1390);H[25124]=1;J[6280]=25296;return 25296}function zc(a,b){var c=0,d=0,e=0,f=0,g=0;a:{c=We(b);e=Ua-16|0;Ua=e;if(c>>>0<1073741808){b:{if(c>>>0<2){H[a+11|0]=c;break b}g=e+8|0;if(c>>>0>=2){f=c+4&-4;d=f-1|0;d=(d|0)==2?f:d;}else {d=1;}Fc(g,d+1|0);d=J[e+8>>2];J[a>>2]=d;J[a+8>>2]=J[e+12>>2]|-2147483648;J[a+4>>2]=c;a=d;}J[tc(a,b,c)+(c<<2)>>2]=0;Ua=e+16|0;break a}ub();B();}}function dc(a,b,c,d){var e=0,f=0,g=0,h=0;e=Ua-16|0;Ua=e;J[e+12>>2]=d;g=Xb(e+8|0,b);b=Ua-16|0;Ua=b;d=J[e+12>>2];J[b+12>>2]=d;J[b+8>>2]=d;f=-1;d=pd(0,0,c,d);a:{if((d|0)<0){break a}h=a;d=d+1|0;a=sb(d);J[h>>2]=a;if(!a){break a}f=pd(a,d,c,J[b+12>>2]);}Ua=b+16|0;a=J[g>>2];if(a){J[6178]=(a|0)==-1?24816:a;}Ua=e+16|0;return f}function bh(a,b,c){a=a|0;b=b|0;c=+c;var d=0,e=0,f=0,g=0;d=cb(56);e=J[b+8>>2];J[b+8>>2]=0;f=J[b>>2];g=J[b+4>>2];J[b>>2]=0;J[b+4>>2]=0;J[d+16>>2]=0;J[d+20>>2]=0;J[d+12>>2]=e;J[d+4>>2]=f;J[d+8>>2]=g;J[d>>2]=12;J[d+24>>2]=0;J[d+28>>2]=0;J[d+32>>2]=0;J[d+36>>2]=0;J[d+40>>2]=0;J[d+44>>2]=0;O[d+48>>3]=c;mc(a,d);return d|0}function xe(a){var b=0;b=1;a:{if((a|0)>=1024){b=898846567431158e293;if(a>>>0<2047){a=a-1023|0;break a}b=Infinity;a=((a|0)>=3069?3069:a)-2046|0;break a}if((a|0)>-1023){break a}b=2004168360008973e-307;if(a>>>0>4294965304){a=a+969|0;break a}b=0;a=((a|0)<=-2960?-2960:a)+1938|0;}x(0,0);x(1,a+1023<<20);return b*+z()}function xd(a){var b=0,c=0,d=0,e=0;if(a){xd(J[a>>2]);xd(J[a+4>>2]);d=J[a+40>>2];if(d){b=d;c=J[a+44>>2];if((b|0)!=(c|0)){while(1){c=c-32|0;b=J[c+4>>2];a:{if(!b){break a}e=J[b+4>>2];J[b+4>>2]=e-1;if(e){break a}Xa[J[J[b>>2]+8>>2]](b);bb(b);}if((d|0)!=(c|0)){continue}break}b=J[a+40>>2];}J[a+44>>2]=d;$a(b);}$a(a);}}function Di(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;g=Ua-16|0;Ua=g;J[e>>2]=c;b=g+12|0;a=Md(b,0,J[a+8>>2]);f=2;a:{if(a+1>>>0<2){break a}c=a-1|0;f=1;if(c>>>0>d-J[e>>2]>>>0){break a}while(1){if(c){a=K[b|0];d=J[e>>2];J[e>>2]=d+1;H[d|0]=a;c=c-1|0;b=b+1|0;continue}break}f=0;}a=f;Ua=g+16|0;return a|0}function rc(a,b,c,d){var e=0;a:{if(!(d&2048)){break a}e=d&74;if(!c|((e|0)==8|(e|0)==64)){break a}H[a|0]=43;a=a+1|0;}if(d&512){H[a|0]=35;a=a+1|0;}while(1){e=K[b|0];if(e){H[a|0]=e;a=a+1|0;b=b+1|0;continue}break}e=d&74;b=111;b:{if((e|0)==64){break b}b=d&16384?88:120;if((e|0)==8){break b}b=c?100:117;}H[a|0]=b;}function ad(a){var b=0,c=0,d=0;b=J[a>>2];J[a>>2]=0;if(b){a=J[b+28>>2];if(a){J[b+32>>2]=a;$a(a);}c=J[b+16>>2];if(c){a=c;d=J[b+20>>2];if((a|0)!=(d|0)){while(1){a=d-12|0;if(H[d-1|0]<0){$a(J[a>>2]);}d=a;if((a|0)!=(c|0)){continue}break}a=J[b+16>>2];}J[b+20>>2]=c;$a(a);}a=J[b+4>>2];if(a){J[b+8>>2]=a;$a(a);}$a(b);}}function Om(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;J[a+8>>2]=0;J[a>>2]=0;J[a+4>>2]=0;J[5996]=0;c=$(3,12)|0;d=J[5996];J[5996]=0;if((d|0)!=1){J[a>>2]=c;d=c+12|0;J[a+8>>2]=d;J[c+8>>2]=J[b+8>>2];e=J[b+4>>2];J[c>>2]=J[b>>2];J[c+4>>2]=e;J[b>>2]=0;J[b+4>>2]=0;J[b+8>>2]=0;J[a+4>>2]=d;return}b=Z()|0;rb(a);da(b|0);B();}function Jk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-32|0;Ua=g;h=J[3163];J[g+24>>2]=J[3162];J[g+28>>2]=h;h=J[3161];J[g+16>>2]=J[3160];J[g+20>>2]=h;h=J[3159];J[g+8>>2]=J[3158];J[g+12>>2]=h;h=J[3157];J[g>>2]=J[3156];J[g+4>>2]=h;h=a;a=g+32|0;b=jc(h,b,c,d,e,f,g,a);Ua=a;return b|0}function bm(a){a=a|0;var b=0,c=0,d=0,e=0;c=J[a+44>>2];b=J[a+24>>2];if(c>>>0<b>>>0){J[a+44>>2]=b;c=b;}d=-1;a:{if(!(K[a+48|0]&8)){break a}b=J[a+16>>2];if(b>>>0<c>>>0){e=J[a+8>>2];b=J[a+12>>2];J[a+16>>2]=c;J[a+12>>2]=b;J[a+8>>2]=e;b=J[a+16>>2];}a=J[a+12>>2];if(a>>>0>=b>>>0){break a}d=K[a|0];}return d|0}function Ih(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;if(Jb(a,J[b+8>>2],0)){Gd(b,c,d);return}f=J[a+12>>2];Ee(J[a+16>>2],J[a+20>>2],b,c,d);e=a+24|0;a=(a+16|0)+(f<<3)|0;a:{if(e>>>0>=a>>>0){break a}while(1){Ee(J[e>>2],J[e+4>>2],b,c,d);if(K[b+54|0]){break a}e=e+8|0;if(a>>>0>e>>>0){continue}break}}}function vb(a,b){var c=0,d=0,e=0,f=0,g=0;d=K[a+11|0];c=d<<24>>24;c=(c|0)<0;e=c?J[a+4>>2]:d;f=J[b+4>>2];if(e>>>0<=f>>>0){d=J[b>>2];if(e){a=c?J[a>>2]:a;g=e+a|0;c=d;while(1){if(K[a|0]!=K[c|0]){return 0}c=c+1|0;a=a+1|0;if((g|0)!=(a|0)){continue}break}}J[b+4>>2]=f-e;J[b>>2]=d+e;a=1;}else {a=0;}return a}function Gb(a){var b=0,c=0,d=0;a:{b:{b=a;if(!(b&3)){break b}if(!K[b|0]){return 0}while(1){b=b+1|0;if(!(b&3)){break b}if(K[b|0]){continue}break}break a}while(1){c=b;b=b+4|0;d=J[c>>2];if(!((d^-1)&d-16843009&-2139062144)){continue}break}while(1){b=c;c=b+1|0;if(K[b|0]){continue}break}}return b-a|0}function Eb(a,b,c){var d=0,e=0;a:{b:{if(c>>>0>=4){if((a|b)&3){break b}while(1){if(J[a>>2]!=J[b>>2]){break b}b=b+4|0;a=a+4|0;c=c-4|0;if(c>>>0>3){continue}break}}if(!c){break a}}while(1){d=K[a|0];e=K[b|0];if((d|0)==(e|0)){b=b+1|0;a=a+1|0;c=c-1|0;if(c){continue}break a}break}return d-e|0}return 0}function qk(a,b){a=a|0;b=b|0;var c=0,d=0;a:{b:{c=K[a+11|0];c:{d:{if((c&128)>>>7|0){d=(J[a+8>>2]&2147483647)-1|0;c=J[a+4>>2];if((d|0)==(c|0)){break d}break c}d=1;c=c&127;if((c|0)!=1){break b}}of(a,d,1,d,d);c=d;}d=J[a>>2];J[a+4>>2]=c+1;break a}H[a+11|0]=c+1;d=a;}a=(c<<2)+d|0;J[a>>2]=b;J[a+4>>2]=0;}function Nb(a,b){var c=0,d=0,e=0,f=0;d=Ua-16|0;Ua=d;a:{if(!b){b=0;break a}c=b>>31;e=(c^b)-c|0;c=S(e);Cb(d,e,0,0,0,c+81|0);e=0+J[d+8>>2]|0;c=(J[d+12>>2]^65536)+(16414-c<<16)|0;c=e>>>0<f>>>0?c+1|0:c;f=b&-2147483648|c;c=J[d+4>>2];b=J[d>>2];}J[a>>2]=b;J[a+4>>2]=c;J[a+8>>2]=e;J[a+12>>2]=f;Ua=d+16|0;}function mf(a,b,c){var d=0,e=0,f=0;e=Ua-16|0;Ua=e;d=Ua-32|0;Ua=d;f=Ua-16|0;Ua=f;J[f+12>>2]=b;J[d+24>>2]=a;J[d+28>>2]=J[f+12>>2];Ua=f+16|0;me(d+16|0,J[d+24>>2],J[d+28>>2],c);a=Rd(a,J[d+16>>2]-a>>2);J[d+12>>2]=J[d+20>>2];J[e+8>>2]=a;J[e+12>>2]=J[d+12>>2];Ua=d+32|0;Ua=e+16|0;return J[e+12>>2]}function ee(a,b,c,d){var e=0,f=0,g=0,h=0;e=Ua-160|0;Ua=e;J[e+60>>2]=b;J[e+20>>2]=b;J[e+24>>2]=-1;f=e+16|0;Yb(f,0,0);ig(e,f,d,1);d=J[e+8>>2];g=J[e+12>>2];f=J[e>>2];h=J[e+4>>2];if(c){J[c>>2]=((J[e+20>>2]+J[e+136>>2]|0)-J[e+60>>2]|0)+b;}J[a+8>>2]=d;J[a+12>>2]=g;J[a>>2]=f;J[a+4>>2]=h;Ua=e+160|0;}function nf(a,b,c){var d=0,e=0,f=0;e=Ua-16|0;Ua=e;d=Ua-32|0;Ua=d;f=Ua-16|0;Ua=f;J[f+12>>2]=b;J[d+24>>2]=a;J[d+28>>2]=J[f+12>>2];Ua=f+16|0;me(d+16|0,J[d+24>>2],J[d+28>>2],c);a=Td(a,J[d+16>>2]-a|0);J[d+12>>2]=J[d+20>>2];J[e+8>>2]=a;J[e+12>>2]=J[d+12>>2];Ua=d+32|0;Ua=e+16|0;return J[e+12>>2]}function rn(a,b){a=a|0;b=b|0;var c=0,d=0;a:{b:{c=K[a+11|0];c:{d:{if((c&128)>>>7|0){d=(J[a+8>>2]&2147483647)-1|0;c=J[a+4>>2];if((d|0)==(c|0)){break d}break c}d=10;c=c&127;if((c|0)!=10){break b}}Sd(a,d,1,d,d);c=d;}d=J[a>>2];J[a+4>>2]=c+1;break a}H[a+11|0]=c+1;d=a;}a=d+c|0;H[a|0]=b;H[a+1|0]=0;}function Nl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=(e-d|0)+b|0;a:{while(1){if((d|0)!=(e|0)){a=-1;if((b|0)==(c|0)){break a}f=H[b|0];g=H[d|0];if((f|0)<(g|0)){break a}if((f|0)>(g|0)){return 1}else {d=d+1|0;b=b+1|0;continue}}break}a=(c|0)!=(h|0);}return a|0}function oe(a){a=a|0;var b=0,c=0;J[a>>2]=8512;J[5996]=0;aa(133,a|0,0);b=J[5996];J[5996]=0;if((b|0)!=1){b=J[a+28>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}$a(J[a+32>>2]);$a(J[a+36>>2]);$a(J[a+48>>2]);$a(J[a+60>>2]);return a|0}fa(0)|0;Vb();B();}function Jc(a,b,c){var d=0,e=0,f=0;a:{if(!b){d=a;break a}while(1){d=eo(a,b,10);e=Wa;a=co(d,e,246,0)+a|0;c=c-1|0;H[c|0]=a|48;f=b>>>0>9;a=d;b=e;if(f){continue}break}}if(d){while(1){c=c-1|0;a=(d>>>0)/10|0;H[c|0]=P(a,246)+d|48;b=d>>>0>9;d=a;if(b){continue}break}}return c}function _b(a){var b=0,c=0,d=0,e=0;d=J[a>>2];if(d){b=d;c=J[a+4>>2];if((b|0)!=(c|0)){while(1){c=c-32|0;b=J[c+4>>2];a:{if(!b){break a}e=J[b+4>>2];J[b+4>>2]=e-1;if(e){break a}Xa[J[J[b>>2]+8>>2]](b);bb(b);}if((d|0)!=(c|0)){continue}break}b=J[a>>2];}J[a+4>>2]=d;$a(b);}}function lb(a){var b=0,c=0,d=0,e=0;d=J[a>>2];if(d){b=d;c=J[a+4>>2];if((b|0)!=(c|0)){while(1){c=c-8|0;b=J[c+4>>2];a:{if(!b){break a}e=J[b+4>>2];J[b+4>>2]=e-1;if(e){break a}Xa[J[J[b>>2]+8>>2]](b);bb(b);}if((d|0)!=(c|0)){continue}break}b=J[a>>2];}J[a+4>>2]=d;$a(b);}}function Ec(a,b){var c=0,d=0,e=0,f=0;c=Ua-16|0;Ua=c;a:{if(!b){b=0;break a}d=b;b=S(b);Cb(c,d,0,0,0,b+81|0);d=0+J[c+8>>2]|0;b=(J[c+12>>2]^65536)+(16414-b<<16)|0;f=e>>>0>d>>>0?b+1|0:b;e=J[c+4>>2];b=J[c>>2];}J[a>>2]=b;J[a+4>>2]=e;J[a+8>>2]=d;J[a+12>>2]=f;Ua=c+16|0;}function _m(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=J[b+28>>2];J[a>>2]=d;J[d+4>>2]=J[d+4>>2]+1;Og(b+28|0,c);J[5996]=0;aa(133,b|0,1);b=J[5996];J[5996]=0;if((b|0)==1){c=Z()|0;a=J[a>>2];b=J[a+4>>2]-1|0;J[a+4>>2]=b;if((b|0)==-1){Xa[J[J[a>>2]+8>>2]](a);}da(c|0);B();}}function Kl(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;a:{while(1){if((d|0)!=(e|0)){a=-1;if((b|0)==(c|0)){break a}f=J[b>>2];g=J[d>>2];if((f|0)<(g|0)){break a}if((f|0)>(g|0)){return 1}else {d=d+4|0;b=b+4|0;continue}}break}a=(b|0)!=(c|0);}return a|0}function Ie(a){a=a|0;var b=0,c=0,d=0,e=0;J[a>>2]=12664;e=a+8|0;while(1){b=J[a+8>>2];if(J[a+12>>2]-b>>2>>>0>c>>>0){b=J[b+(c<<2)>>2];if(b){d=J[b+4>>2]-1|0;J[b+4>>2]=d;if((d|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}}c=c+1|0;continue}break}ab(a+152|0);gf(e);return a|0}function Nc(a){var b=0,c=0,d=0,e=0,f=0;a:{if(K[a+4|0]){break a}e=J[a>>2];b=J[e>>2];if(!b){break a}c=b;d=J[e+4>>2];if((d|0)!=(b|0)){while(1){c=d-12|0;f=J[c>>2];if(f){J[d-8>>2]=f;$a(f);}d=c;if((d|0)!=(b|0)){continue}break}c=J[J[a>>2]>>2];}J[e+4>>2]=b;$a(c);}}function Dg(a){var b=0,c=0;b=J[a+72>>2];J[a+72>>2]=b-1|b;if(J[a+20>>2]!=J[a+28>>2]){Xa[J[a+36>>2]](a,0,0)|0;}J[a+28>>2]=0;J[a+16>>2]=0;J[a+20>>2]=0;b=J[a>>2];if(b&4){J[a>>2]=b|32;return -1}c=J[a+44>>2]+J[a+48>>2]|0;J[a+8>>2]=c;J[a+4>>2]=c;return b<<27>>31}function hb(a,b){var c=0,d=0,e=0,f=0;a:{c=Gb(b);d=(K[a+11|0]&128)>>>7|0?(J[a+8>>2]&2147483647)-1|0:10;if(c>>>0<=d>>>0){sd(a,oc((K[a+11|0]&128)>>>7|0?J[a>>2]:a,b,c),c);break a}e=a;f=J[a+4>>2];a=K[a+11|0];a=(a&128)>>>7|0?f:a&127;dd(e,d,c-d|0,a,0,a,c,b);}}function Yb(a,b,c){var d=0,e=0,f=0,g=0;J[a+112>>2]=b;J[a+116>>2]=c;e=J[a+4>>2];d=J[a+44>>2]-e|0;J[a+120>>2]=d;J[a+124>>2]=d>>31;d=J[a+8>>2];a:{if(!(b|c)){break a}f=d-e|0;g=f>>31;if((c|0)>=(g|0)&b>>>0>=f>>>0|(c|0)>(g|0)){break a}d=b+e|0;}J[a+104>>2]=d;}function Lg(a,b){var c=0,d=0,e=0;A(+a);d=v(1)|0;e=v(0)|0;c=d>>>20&2047;if((c|0)!=2047){if(!c){if(a==0){c=0;}else {a=Lg(a*0x10000000000000000,b);c=J[b>>2]+-64|0;}J[b>>2]=c;return a}J[b>>2]=c-1022;x(0,e|0);x(1,d&-2146435073|1071644672);a=+z();}return a}function Vg(a){var b=0,c=0,d=0,e=0;a:{if(K[a+4|0]){break a}e=J[a>>2];b=J[e>>2];if(!b){break a}c=b;d=J[e+4>>2];if((b|0)!=(d|0)){while(1){c=d-12|0;if(H[d-1|0]<0){$a(J[c>>2]);}d=c;if((d|0)!=(b|0)){continue}break}c=J[J[a>>2]>>2];}J[e+4>>2]=b;$a(c);}}function ff(a,b){var c=0,d=0;d=Ua-16|0;Ua=d;c=d+4|0;J[c>>2]=a;a=J[a+4>>2];J[c+4>>2]=a;J[c+8>>2]=a+(b<<2);b=J[c+4>>2];a=J[c+8>>2];while(1){if((a|0)==(b|0)){J[J[c>>2]+4>>2]=J[c+4>>2];Ua=d+16|0;}else {J[b>>2]=0;b=b+4|0;J[c+4>>2]=b;continue}break}}function Vb(){var a=0;a=J[5728];J[5996]=0;ca(a|0);a=J[5996];J[5996]=0;a:{if((a|0)!=1){J[5996]=0;ca(291);a=J[5996];J[5996]=0;if((a|0)!=1){break a}}pa(fa(0)|0)|0;J[5996]=0;ca(291);a=J[5996];J[5996]=0;if((a|0)!=1){break a}fa(0)|0;Vb();}B();}function Ag(a,b,c,d){var e=0,f=0;e=Ua-32|0;Ua=e;f=Ua-16|0;Ua=f;J[f+12>>2]=c;J[e+24>>2]=b;J[e+28>>2]=J[f+12>>2];Ua=f+16|0;me(e+16|0,J[e+24>>2],J[e+28>>2],d);b=J[e+16>>2];J[e+12>>2]=J[e+20>>2];J[a>>2]=b;J[a+4>>2]=J[e+12>>2];Ua=e+32|0;}function Lb(a,b,c){c=c&176;if((c|0)==32){return b}a:{if((c|0)!=16){break a}b:{c:{c=K[a|0];switch(c-43|0){case 0:case 2:break c;default:break b}}return a+1|0}if((c|0)!=48|(b-a|0)<2|(K[a+1|0]|32)!=120){break a}a=a+2|0;}return a}function Ym(a,b){a=a|0;b=b|0;var c=0,d=0;c=J[b+48>>2];if(c&16){d=J[b+44>>2];c=J[b+24>>2];if(d>>>0<c>>>0){J[b+44>>2]=c;d=c;}td(a,J[b+20>>2],d);return}if(c&8){td(a,J[b+8>>2],J[b+16>>2]);return}J[a>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;}function Rh(a){a=a|0;var b=0,c=0;a:{b:{if(!a){break b}b=a-24|0;c=J[b>>2]-1|0;J[b>>2]=c;if(K[b+13|0]|c){break b}b=J[b+8>>2];if(b){J[5996]=0;$(b|0,a|0)|0;b=J[5996];J[5996]=0;if((b|0)==1){break a}}ic(a);}return}fa(0)|0;Vb();B();}function Eg(a,b,c){var d=0,e=0,f=0,g=0;d=Ua-16|0;Ua=d;b=b-a>>2;while(1){if(b){J[d+12>>2]=a;e=b>>>1|0;J[d+12>>2]=J[d+12>>2]+(e<<2);f=J[d+12>>2];g=M[f>>2]<c>>>0;a=g?f+4|0:a;b=g?(e^-1)+b|0:e;continue}break}Ua=d+16|0;return a}function Kb(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=Gb(b);if(c>>>0<2147483632){a:{if(c>>>0<=10){H[a+11|0]=c;d=a;break a}e=(c|15)+1|0;d=cb(e);J[a+8>>2]=e|-2147483648;J[a>>2]=d;J[a+4>>2]=c;}H[eb(d,b,c)+c|0]=0;return a|0}ub();B();}function Ik(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=Xa[J[J[a+8>>2]+20>>2]](a+8|0)|0;h=K[g+11|0];i=a;j=b;b=(h&128)>>>7|0;a=b?J[g>>2]:g;return jc(i,j,c,d,e,f,a,a+((b?J[g+4>>2]:h&127)<<2)|0)|0}function Qn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;a:{if(K[b|0]!=47){while(1){if((c|0)==(d|0)){e=Wb(b,c);b=0;break a}d=d+1|0;if(K[d+b|0]!=47){continue}break}}e=Wb(b,d);b=Wb((b+d|0)+1|0,(d^-1)+c|0);}J[a+4>>2]=b;J[a>>2]=e;}function co(a,b,c,d){var e=0,f=0,g=0,h=0,i=0,j=0;e=c>>>16|0;f=a>>>16|0;j=P(e,f);g=c&65535;h=a&65535;i=P(g,h);f=(i>>>16|0)+P(f,g)|0;e=(f&65535)+P(e,h)|0;Wa=(P(b,c)+j|0)+P(a,d)+(f>>>16)+(e>>>16)|0;return i&65535|e<<16}function Ok(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=Xa[J[J[a+8>>2]+20>>2]](a+8|0)|0;h=K[g+11|0];i=a;j=b;b=(h&128)>>>7|0;a=b?J[g>>2]:g;return kc(i,j,c,d,e,f,a,a+(b?J[g+4>>2]:h&127)|0)|0}function pg(a,b){a=a|0;b=b|0;var c=0,d=0;c=J[a>>2];a:{if(!c){break a}d=J[c+24>>2];b:{if((d|0)==J[c+28>>2]){b=Xa[J[J[c>>2]+52>>2]](c,b)|0;break b}J[c+24>>2]=d+4;J[d>>2]=b;}if((b|0)!=-1){break a}J[a>>2]=0;}return a|0}function Jm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=cb(104);J[d>>2]=7e3;J[d+4>>2]=0;J[d+8>>2]=0;J[5996]=0;b=ba(143,d+12|0,b|0,c|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){a=Z()|0;$a(d);da(a|0);B();}J[a+4>>2]=d;J[a>>2]=b;}function Gd(a,b,c){var d=0;d=J[a+16>>2];if(!d){J[a+36>>2]=1;J[a+24>>2]=c;J[a+16>>2]=b;return}a:{if((b|0)==(d|0)){if(J[a+24>>2]!=2){break a}J[a+24>>2]=c;return}H[a+54|0]=1;J[a+24>>2]=2;J[a+36>>2]=J[a+36>>2]+1;}}function Ed(a){var b=0,c=0,d=0;a:{if(K[a+12|0]){break a}b=J[J[a+8>>2]>>2];d=J[J[a+4>>2]>>2];if((b|0)==(d|0)){break a}while(1){a=b-12|0;c=J[a>>2];if(c){J[b-8>>2]=c;$a(c);}b=a;if((a|0)!=(d|0)){continue}break}}}function yf(a,b,c,d,e,f){var g=0;g=Ua-16|0;Ua=g;H[g+15|0]=0;H[g+14|0]=f;H[g+13|0]=e;H[g+12|0]=37;if(f){e=K[g+13|0];H[g+13|0]=K[g+14|0];H[g+14|0]=e;}J[c>>2]=(Ta(b|0,J[c>>2]-b|0,g+12|0,d|0,a|0)|0)+b;Ua=g+16|0;}function Bb(a,b,c,d,e){var f=0;f=Ua-256|0;Ua=f;if(!(e&73728|(c|0)<=(d|0))){d=c-d|0;c=d>>>0<256;Sb(f,b&255,c?d:256);if(!c){while(1){wb(a,f,256);d=d-256|0;if(d>>>0>255){continue}break}}wb(a,f,d);}Ua=f+256|0;}function Wc(a){var b=0,c=0,d=0,e=0;b=J[a>>2];if(b){c=b;d=J[a+4>>2];if((d|0)!=(b|0)){while(1){c=d-12|0;e=J[c>>2];if(e){J[d-8>>2]=e;$a(e);}d=c;if((d|0)!=(b|0)){continue}break}c=J[a>>2];}J[a+4>>2]=b;$a(c);}}function wi(a){a=a|0;var b=0,c=0,d=0;a=J[6019];if(a){b=a;c=J[6020];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6019];}J[6020]=a;$a(b);}}function ph(a){a=a|0;var b=0,c=0,d=0;a=J[6049];if(a){b=a;c=J[6050];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6049];}J[6050]=a;$a(b);}}function on(a){a=a|0;var b=0,c=0,d=0;a=J[6151];if(a){b=a;c=J[6152];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6151];}J[6152]=a;$a(b);}}function oh(a){a=a|0;var b=0,c=0,d=0;a=J[6055];if(a){b=a;c=J[6056];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6055];}J[6056]=a;$a(b);}}function nn(a){a=a|0;var b=0,c=0,d=0;a=J[6157];if(a){b=a;c=J[6158];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6157];}J[6158]=a;$a(b);}}function nh(a){a=a|0;var b=0,c=0,d=0;a=J[6061];if(a){b=a;c=J[6062];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6061];}J[6062]=a;$a(b);}}function mn(a){a=a|0;var b=0,c=0,d=0;a=J[6163];if(a){b=a;c=J[6164];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6163];}J[6164]=a;$a(b);}}function mh(a){a=a|0;var b=0,c=0,d=0;a=J[6067];if(a){b=a;c=J[6068];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6067];}J[6068]=a;$a(b);}}function ln(a){a=a|0;var b=0,c=0,d=0;a=J[6169];if(a){b=a;c=J[6170];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6169];}J[6170]=a;$a(b);}}function lh(a){a=a|0;var b=0,c=0,d=0;a=J[6073];if(a){b=a;c=J[6074];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6073];}J[6074]=a;$a(b);}}function kn(a){a=a|0;var b=0,c=0,d=0;a=J[6175];if(a){b=a;c=J[6176];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6175];}J[6176]=a;$a(b);}}function ci(a){a=a|0;var b=0,c=0,d=0;a=J[6025];if(a){b=a;c=J[6026];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6025];}J[6026]=a;$a(b);}}function Zh(a){a=a|0;var b=0,c=0,d=0;a=J[6031];if(a){b=a;c=J[6032];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6031];}J[6032]=a;$a(b);}}function Rn(a){a=a|0;var b=0,c=0,d=0;a=J[6081];if(a){b=a;c=J[6082];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6081];}J[6082]=a;$a(b);}}function Qh(a){a=a|0;var b=0,c=0,d=0;a=J[6037];if(a){b=a;c=J[6038];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6037];}J[6038]=a;$a(b);}}function On(a){a=a|0;var b=0,c=0,d=0;a=J[6085];if(a){b=a;c=J[6086];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6085];}J[6086]=a;$a(b);}}function Nn(a){a=a|0;var b=0,c=0,d=0;a=J[6089];if(a){b=a;c=J[6090];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6089];}J[6090]=a;$a(b);}}function Mn(a){a=a|0;var b=0,c=0,d=0;a=J[6093];if(a){b=a;c=J[6094];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6093];}J[6094]=a;$a(b);}}function Ln(a){a=a|0;var b=0,c=0,d=0;a=J[6097];if(a){b=a;c=J[6098];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6097];}J[6098]=a;$a(b);}}function Kn(a){a=a|0;var b=0,c=0,d=0;a=J[6101];if(a){b=a;c=J[6102];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6101];}J[6102]=a;$a(b);}}function Jn(a){a=a|0;var b=0,c=0,d=0;a=J[6105];if(a){b=a;c=J[6106];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6105];}J[6106]=a;$a(b);}}function Jh(a){a=a|0;var b=0,c=0,d=0;a=J[6043];if(a){b=a;c=J[6044];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6043];}J[6044]=a;$a(b);}}function Jg(a){var b=0,c=0,d=0;d=J[a>>2];while(1){c=H[d|0];if(c-48>>>0<10){d=d+1|0;J[a>>2]=d;if(b>>>0<=214748364){c=c-48|0;b=P(b,10);b=(c|0)>(b^2147483647)?-1:c+b|0;}else {b=-1;}continue}break}return b}function In(a){a=a|0;var b=0,c=0,d=0;a=J[6109];if(a){b=a;c=J[6110];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6109];}J[6110]=a;$a(b);}}function Hn(a){a=a|0;var b=0,c=0,d=0;a=J[6113];if(a){b=a;c=J[6114];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6113];}J[6114]=a;$a(b);}}function Gn(a){a=a|0;var b=0,c=0,d=0;a=J[6117];if(a){b=a;c=J[6118];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6117];}J[6118]=a;$a(b);}}function Fn(a){a=a|0;var b=0,c=0,d=0;a=J[6121];if(a){b=a;c=J[6122];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6121];}J[6122]=a;$a(b);}}function En(a){a=a|0;var b=0,c=0,d=0;a=J[6125];if(a){b=a;c=J[6126];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6125];}J[6126]=a;$a(b);}}function Dn(a){a=a|0;var b=0,c=0,d=0;a=J[6129];if(a){b=a;c=J[6130];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6129];}J[6130]=a;$a(b);}}function Cn(a){a=a|0;var b=0,c=0,d=0;a=J[6133];if(a){b=a;c=J[6134];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6133];}J[6134]=a;$a(b);}}function Bn(a){a=a|0;var b=0,c=0,d=0;a=J[6137];if(a){b=a;c=J[6138];if((c|0)!=(a|0)){while(1){b=c-12|0;d=J[b>>2];if(d){J[c-8>>2]=d;$a(d);}c=b;if((c|0)!=(a|0)){continue}break}b=J[6137];}J[6138]=a;$a(b);}}function Wg(a){var b=0,c=0;a:{if(K[a+12|0]){break a}b=J[J[a+8>>2]>>2];c=J[J[a+4>>2]>>2];if((b|0)==(c|0)){break a}while(1){a=b-12|0;if(H[b-1|0]<0){$a(J[a>>2]);}b=a;if((a|0)!=(c|0)){continue}break}}}function lc(a,b){var c=0;b=pb(b);c=J[a+12>>2];a=J[a+8>>2];if(b>>>0<c-a>>2>>>0){c=J[a+(b<<2)>>2]!=0;}else {c=0;}if(!c){a=Rb(4);J[a>>2]=22892;J[a>>2]=22736;na(a|0,22872,173);B();}return J[a+(b<<2)>>2]}function rb(a){var b=0,c=0,d=0;b=J[a>>2];if(b){c=b;d=J[a+4>>2];if((b|0)!=(d|0)){while(1){c=d-12|0;if(H[d-1|0]<0){$a(J[c>>2]);}d=c;if((d|0)!=(b|0)){continue}break}c=J[a>>2];}J[a+4>>2]=b;$a(c);}}function gg(a,b,c,d){a:{if(!a){break a}b:{switch(b+2|0){case 0:H[a|0]=c;return;case 1:I[a>>1]=c;return;case 2:case 3:J[a>>2]=c;return;case 5:break b;default:break a}}J[a>>2]=c;J[a+4>>2]=d;}}function Be(a){var b=0;b=J[a+72>>2];J[a+72>>2]=b-1|b;b=J[a>>2];if(b&8){J[a>>2]=b|32;return -1}J[a+4>>2]=0;J[a+8>>2]=0;b=J[a+44>>2];J[a+28>>2]=b;J[a+20>>2]=b;J[a+16>>2]=b+J[a+48>>2];return 0}function he(a,b,c,d,e,f,g,h,i){var j=0;j=Ua-16|0;Ua=j;Hb(j,b,c,d,e,f,g,h,i^-2147483648);d=J[j>>2];c=J[j+4>>2];b=J[j+12>>2];J[a+8>>2]=J[j+8>>2];J[a+12>>2]=b;J[a>>2]=d;J[a+4>>2]=c;Ua=j+16|0;}function cb(a){a=a|0;var b=0;a=a>>>0<=1?1:a;a:{while(1){b=sb(a);if(b){break a}b=J[6704];if(b){Xa[b|0]();continue}break}a=Rb(4);J[a>>2]=22892;J[a>>2]=22364;na(a|0,22448,5);B();}return b|0}function Uc(a,b){var c=0,d=0;c=K[a|0];d=K[b|0];a:{if(!c|(c|0)!=(d|0)){break a}while(1){d=K[b+1|0];c=K[a+1|0];if(!c){break a}b=b+1|0;a=a+1|0;if((c|0)==(d|0)){continue}break}}return c-d|0}function Pl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;e=J[a+84>>2];d=c+256|0;f=Zb(e,0,d);d=f?f-e|0:d;c=c>>>0>d>>>0?d:c;fb(b,e,c);b=e+d|0;J[a+84>>2]=b;J[a+8>>2]=b;J[a+4>>2]=c+e;return c|0}function Pk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=Ua-16|0;Ua=g;J[g+8>>2]=624576549;J[g+12>>2]=1394948685;h=a;a=g+16|0;b=kc(h,b,c,d,e,f,g+8|0,a);Ua=a;return b|0}function xi(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;while(1){if((b|0)!=(c|0)){a=J[b>>2];if(a>>>0<=127){a=J[(a<<2)+12736>>2];}else {a=0;}J[d>>2]=a;d=d+4|0;b=b+4|0;continue}break}return c|0}function rg(a){var b=0,c=0;b=J[a>>2];if(b){c=J[b+12>>2];a:{if((c|0)==J[b+16>>2]){b=Xa[J[J[b>>2]+36>>2]](b)|0;break a}b=J[c>>2];}if((b|0)!=-1){return !J[a>>2]}J[a>>2]=0;}return 1}function xg(a){var b=0,c=0;b=J[a>>2];if(b){c=J[b+12>>2];a:{if((c|0)==J[b+16>>2]){b=Xa[J[J[b>>2]+36>>2]](b)|0;break a}b=K[c|0];}if((b|0)!=-1){return !J[a>>2]}J[a>>2]=0;}return 1}function Ug(a){var b=0,c=0,d=0;b=J[a>>2];if(b){d=b;c=J[a+4>>2];if((c|0)!=(b|0)){while(1){c=c-12|0;Db(J[c+4>>2]);if((b|0)!=(c|0)){continue}break}d=J[a>>2];}J[a+4>>2]=b;$a(d);}}function Nm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=cb(104);J[5996]=0;b=ba(147,d|0,b|0,c|0)|0;c=J[5996];J[5996]=0;if((c|0)==1){a=Z()|0;$a(d);da(a|0);B();}J[a+4>>2]=b;J[a>>2]=b+12;}function ui(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a:{while(1){if((c|0)==(d|0)){break a}a=J[c>>2];if(!(a>>>0>127|!(J[(a<<2)+12736>>2]&b))){c=c+4|0;continue}break}d=c;}return d|0}function vi(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;while(1){a:{if((c|0)!=(d|0)){a=J[c>>2];if(a>>>0>127|!(J[(a<<2)+12736>>2]&b)){break a}}else {c=d;}return c|0}c=c+4|0;continue}}function Ci(a){a=a|0;var b=0,c=0;b=Ua-16|0;Ua=b;c=J[Xb(b+12|0,J[a+8>>2])>>2];if(c){J[6178]=(c|0)==-1?24816:c;}Ua=b+16|0;a=J[a+8>>2];if(!a){return 1}return (Le(a)|0)==1|0}function yd(a){var b=0,c=0;if(a){yd(J[a>>2]);yd(J[a+4>>2]);b=J[a+28>>2];a:{if(!b){break a}c=J[b+4>>2];J[b+4>>2]=c-1;if(c){break a}Xa[J[J[b>>2]+8>>2]](b);bb(b);}$a(a);}}function wj(a){a=a|0;var b=0,c=0;b=Ua-16|0;Ua=b;if(_e()>>>0<=29){nb();B();}Ze(b+8|0,a+16|0,30);c=J[b+8>>2];J[a+4>>2]=c;J[a>>2]=c;J[a+8>>2]=(J[b+12>>2]<<2)+c;Ua=b+16|0;}function Oc(a){var b=0,c=0,d=0;b=J[a>>2];if(b){d=b;c=J[a+4>>2];if((c|0)!=(b|0)){while(1){c=Fb(c-56|0);if((c|0)!=(b|0)){continue}break}d=J[a>>2];}J[a+4>>2]=b;$a(d);}}function kh(a){a=a|0;var b=0,c=0;a=J[6076];if(a){c=a;b=J[6077];if((b|0)!=(a|0)){while(1){b=b-4|0;ad(b);if((a|0)!=(b|0)){continue}break}c=J[6076];}J[6077]=a;$a(c);}}function Dh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=Ua-16|0;Ua=d;J[d+12>>2]=J[c>>2];a=Xa[J[J[a>>2]+16>>2]](a,b,d+12|0)|0;if(a){J[c>>2]=J[d+12>>2];}Ua=d+16|0;return a|0}function Il(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;a=0;while(1){if((b|0)!=(c|0)){a=J[b>>2]+(a<<4)|0;d=a&-268435456;a=(d|d>>>24)^a;b=b+4|0;continue}break}return a|0}function zi(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;a=Ua-16|0;Ua=a;J[a+12>>2]=e;J[a+8>>2]=d-c;Ua=a+16|0;b=a+8|0;a=a+12|0;return J[(M[b>>2]<M[a>>2]?b:a)>>2]}function yb(a,b,c,d,e){var f=0;f=Ua-16|0;Ua=f;J[f+12>>2]=e;c=Xb(f+8|0,c);b=pd(a,b,d,J[f+12>>2]);a=J[c>>2];if(a){J[6178]=(a|0)==-1?24816:a;}Ua=f+16|0;return b}function Ll(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;a=0;while(1){if((b|0)!=(c|0)){a=H[b|0]+(a<<4)|0;d=a&-268435456;a=(d|d>>>24)^a;b=b+1|0;continue}break}return a|0}function Mm(a,b){a=a|0;b=b|0;var c=0;c=J[a+4>>2];if(c>>>0<M[a+8>>2]){J[c>>2]=J[b>>2];J[c+4>>2]=J[b+4>>2];J[b>>2]=0;J[b+4>>2]=0;J[a+4>>2]=c+8;return}re(a,b);}function tb(a,b){var c=0;c=J[a>>2];J[a>>2]=b;a:{if(c){a=J[a+4>>2];J[5996]=0;ha(a|0,c|0);a=J[5996];J[5996]=0;if((a|0)==1){break a}}return}fa(0)|0;Vb();B();}function Kf(a,b,c){var d=0;d=Ua-16|0;Ua=d;J[d+12>>2]=c;b=Xb(d+8|0,b);c=fg(a,1937,J[d+12>>2]);a=J[b>>2];if(a){J[6178]=(a|0)==-1?24816:a;}Ua=d+16|0;return c}function si(a,b,c){a=a|0;b=b|0;c=c|0;while(1){if((b|0)!=(c|0)){a=J[b>>2];if(a>>>0<=127){a=J[(a<<2)+11184>>2];}J[b>>2]=a;b=b+4|0;continue}break}return c|0}function yg(a){var b=0,c=0;J[5996]=0;c=Ca(168)|0;b=J[5996];J[5996]=0;if((b|0)!=1){b=a;a=J[c>>2];J[b>>2]=a;J[a+4>>2]=J[a+4>>2]+1;return}fa(0)|0;Vb();B();}function qi(a,b,c){a=a|0;b=b|0;c=c|0;while(1){if((b|0)!=(c|0)){a=J[b>>2];if(a>>>0<=127){a=J[(a<<2)+9648>>2];}J[b>>2]=a;b=b+4|0;continue}break}return c|0}function qc(a){var b=0,c=0,d=0;b=Ua-16|0;Ua=b;c=K[a+11|0];d=(c&128)>>>7|0;J[b+12>>2]=(d?J[a>>2]:a)+((d?J[a+4>>2]:c&127)<<2);Ua=b+16|0;return J[b+12>>2]}function ni(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;while(1){if((b|0)!=(c|0)){a=J[b>>2];H[e|0]=a>>>0<128?a:d;e=e+1|0;b=b+4|0;continue}break}return c|0}function Og(a,b){var c=0,d=0;c=J[b>>2];J[c+4>>2]=J[c+4>>2]+1;c=J[a>>2];d=J[c+4>>2]-1|0;J[c+4>>2]=d;if((d|0)==-1){Xa[J[J[c>>2]+8>>2]](c);}J[a>>2]=J[b>>2];}function md(a,b){var c=0;a:{if((a|0)==(b|0)){break a}while(1){b=b-4|0;if(b>>>0<=a>>>0){break a}c=J[a>>2];J[a>>2]=J[b>>2];J[b>>2]=c;a=a+4|0;continue}}}function Wh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=Ua-16|0;Ua=d;Xa[J[J[a>>2]+12>>2]](d+8|0,a,b);Ua=d+16|0;return J[d+12>>2]==J[c+4>>2]&J[d+8>>2]==J[c>>2]}function xf(a){a=a|0;var b=0,c=0;b=Rb(8);J[5996]=0;a=_(91,b|0,a|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){na(a|0,22664,92);B();}a=Z()|0;ic(b);da(a|0);B();}function ji(a,b,c){a=a|0;b=b|0;c=c|0;while(1){if((b|0)!=(c|0)){a=H[b|0];if((a|0)>=0){a=J[(a<<2)+11184>>2];}H[b|0]=a;b=b+1|0;continue}break}return c|0}function ei(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;while(1){if((b|0)!=(c|0)){a=H[b|0];H[e|0]=(a|0)<0?d:a;e=e+1|0;b=b+1|0;continue}break}return c|0}function hi(a,b,c){a=a|0;b=b|0;c=c|0;while(1){if((b|0)!=(c|0)){a=H[b|0];if((a|0)>=0){a=J[(a<<2)+9648>>2];}H[b|0]=a;b=b+1|0;continue}break}return c|0}function Nh(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if(Jb(a,J[b+8>>2],f)){Hd(b,c,d,e);return}a=J[a+8>>2];Xa[J[J[a>>2]+20>>2]](a,b,c,d,e,f);}function sc(a){var b=0,c=0,d=0;b=Ua-16|0;Ua=b;c=K[a+11|0];d=(c&128)>>>7|0;J[b+12>>2]=(d?J[a>>2]:a)+(d?J[a+4>>2]:c&127);Ua=b+16|0;return J[b+12>>2]}function Rl(a,b){a=a|0;b=b|0;var c=0,d=0;c=J[a+40>>2];while(1){if(c){c=c-1|0;d=c<<2;Xa[J[J[a+32>>2]+d>>2]](b,a,J[d+J[a+36>>2]>>2]);continue}break}}function vc(a,b){var c=0;a:{if((a|0)==(b|0)){break a}while(1){b=b-1|0;if(b>>>0<=a>>>0){break a}c=K[a|0];H[a|0]=K[b|0];H[b|0]=c;a=a+1|0;continue}}}function _e(){var a=0,b=0;a=Ua-16|0;Ua=a;J[a+12>>2]=1073741823;J[a+8>>2]=2147483647;Ua=a+16|0;b=a+8|0;a=a+12|0;return J[(M[b>>2]<M[a>>2]?b:a)>>2]}function ac(a,b){var c=0;if((K[a+11|0]&128)>>>7|0){$a(J[a>>2]);}c=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=c;J[a+8>>2]=J[b+8>>2];H[b+11|0]=0;J[b>>2]=0;}function Ud(a,b){var c=0;if(!((K[b+11|0]&128)>>>7|0)){c=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=c;J[a+8>>2]=J[b+8>>2];return}Zc(a,J[b>>2],J[b+4>>2]);}function rj(a){if(K[25164]){return J[6290]}if(!K[26312]){H[26312]=1;}ib(26288,19200);ib(26300,19212);H[25164]=1;J[6290]=26288;return 26288}function Ab(a,b){var c=0;if((K[a+11|0]&128)>>>7|0){$a(J[a>>2]);}c=J[b+4>>2];J[a>>2]=J[b>>2];J[a+4>>2]=c;J[a+8>>2]=J[b+8>>2];H[b+11|0]=0;H[b|0]=0;}function ue(){var a=0,b=0,c=0;b=Rb(8);J[5996]=0;a=$(125,b|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){na(a|0,22632,7);B();}a=Z()|0;ic(b);da(a|0);B();}function dj(a){if(K[25156]){return J[6288]}if(!K[26280]){H[26280]=1;}hb(26256,3116);hb(26268,3113);H[25156]=1;J[6288]=26256;return 26256}function If(a){var b=0,c=0;b=Rb(8);J[5996]=0;a=_(6,b|0,a|0)|0;c=J[5996];J[5996]=0;if((c|0)!=1){na(a|0,22580,7);B();}a=Z()|0;ic(b);da(a|0);B();}function Ee(a,b,c,d,e){var f=0;f=c;c=0;a:{if(!d){break a}c=b>>8;if(!(b&1)){break a}c=J[c+J[d>>2]>>2];}Xa[J[J[a>>2]+28>>2]](a,f,c+d|0,b&2?e:2);}function og(a,b,c){var d=0;d=Ua-16|0;Ua=d;H[d+15|0]=c;c=a;while(1){if(b){H[c|0]=K[d+15|0];b=b-1|0;c=c+1|0;continue}break}Ua=d+16|0;return a}function Le(a){var b=0,c=0;b=Ua-16|0;Ua=b;a=Xb(b+12|0,a);c=J[J[6178]>>2]?4:1;a=J[a>>2];if(a){J[6178]=(a|0)==-1?24816:a;}Ua=b+16|0;return c}function vg(a,b){var c=0;c=J[a+24>>2];if((c|0)==J[a+28>>2]){return Xa[J[J[a>>2]+52>>2]](a,b&255)|0}J[a+24>>2]=c+1;H[c|0]=b;return b&255}function Me(a,b,c,d,e){var f=0;f=Ua-16|0;Ua=f;e=Xb(f+12|0,e);b=qd(a,b,c,d);a=J[e>>2];if(a){J[6178]=(a|0)==-1?24816:a;}Ua=f+16|0;return b}function Qc(a){a=a|0;var b=0,c=0;J[a>>2]=7896;b=J[a+4>>2];c=J[b+4>>2]-1|0;J[b+4>>2]=c;if((c|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}return a|0}function bi(){var a=0;if(K[25032]){return J[6257]}a=J[Pg()>>2];J[6256]=a;J[a+4>>2]=J[a+4>>2]+1;H[25032]=1;J[6257]=25024;return 25024}function nl(a){if(H[24063]<0){$a(J[6013]);}if(H[24051]<0){$a(J[6010]);}if(H[24039]<0){$a(J[6007]);}if(H[24027]<0){$a(J[6004]);}}function mm(a){a=a|0;var b=0;b=J[a+12>>2];a:{if((b|0)==J[a+16>>2]){a=Xa[J[J[a>>2]+36>>2]](a)|0;break a}a=K[b|0];}return a<<24>>24}function pi(a,b,c,d){b=b|0;c=c|0;d=d|0;while(1){if((b|0)!=(c|0)){J[d>>2]=H[b|0];d=d+4|0;b=b+1|0;continue}break}return c|0}function gd(a){a=a|0;J[a+56>>2]=8316;J[a>>2]=8296;J[a+4>>2]=7960;if(H[a+47|0]<0){$a(J[a+36>>2]);}Qc(a+4|0);Od(a+56|0);return a|0}function Md(a,b,c){var d=0;d=Ua-16|0;Ua=d;c=Xb(d+12|0,c);b=pe(a,b);a=J[c>>2];if(a){J[6178]=(a|0)==-1?24816:a;}Ua=d+16|0;return b}function Df(a,b,c,d,e,f){a=Xa[J[J[a+8>>2]+4>>2]](a+8|0)|0;a=nd(c,d,a,a+288|0,f,e,0)-a|0;if((a|0)<=287){J[b>>2]=((a|0)/12|0)%12;}}function Af(a,b,c,d,e,f){a=Xa[J[J[a+8>>2]+4>>2]](a+8|0)|0;a=ld(c,d,a,a+288|0,f,e,0)-a|0;if((a|0)<=287){J[b>>2]=((a|0)/12|0)%12;}}function um(a){a=a|0;var b=0;if((Xa[J[J[a>>2]+36>>2]](a)|0)!=-1){b=a;a=J[a+12>>2];J[b+12>>2]=a+1;a=K[a|0];}else {a=-1;}return a|0}function gi(a,b,c,d){b=b|0;c=c|0;d=d|0;while(1){if((b|0)!=(c|0)){H[d|0]=K[b|0];d=d+1|0;b=b+1|0;continue}break}return c|0}function bb(a){var b=0,c=0;a:{b=a+8|0;if(J[b>>2]){c=b;b=J[b>>2]-1|0;J[c>>2]=b;if((b|0)!=-1){break a}}Xa[J[J[a>>2]+16>>2]](a);}}function Lh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(Jb(a,J[b+8>>2],0)){Gd(b,c,d);return}a=J[a+8>>2];Xa[J[J[a>>2]+28>>2]](a,b,c,d);}function Ef(a,b,c,d,e,f){a=Xa[J[J[a+8>>2]>>2]](a+8|0)|0;a=nd(c,d,a,a+168|0,f,e,0)-a|0;if((a|0)<=167){J[b>>2]=((a|0)/12|0)%7;}}function Bf(a,b,c,d,e,f){a=Xa[J[J[a+8>>2]>>2]](a+8|0)|0;a=ld(c,d,a,a+168|0,f,e,0)-a|0;if((a|0)<=167){J[b>>2]=((a|0)/12|0)%7;}}function me(a,b,c,d){var e=0,f=0;e=Ua-16|0;Ua=e;f=b;b=c-b|0;J[e+12>>2]=eb(d,f,b)+b;J[a>>2]=c;J[a+4>>2]=J[e+12>>2];Ua=e+16|0;}function dm(a){a=a|0;var b=0;b=J[a+12>>2];a:{if((b|0)==J[a+16>>2]){a=Xa[J[J[a>>2]+36>>2]](a)|0;break a}a=J[b>>2];}return a|0}function mb(a){var b=0;a:{a=J[a+4>>2];if(!a){break a}b=J[a+4>>2];J[a+4>>2]=b-1;if(b){break a}Xa[J[J[a>>2]+8>>2]](a);bb(a);}}function Th(a,b){a=a|0;b=b|0;var c=0;c=a;a=K[b+11|0];return ve(c,(a&128)>>>7|0?J[b>>2]:b,(a&128)>>>7|0?J[b+4>>2]:a&127)|0}function qg(a){var b=0;b=J[a+12>>2];if((b|0)==J[a+16>>2]){return Xa[J[J[a>>2]+40>>2]](a)|0}J[a+12>>2]=b+4;return J[b>>2]}function wg(a){var b=0;b=J[a+12>>2];if((b|0)==J[a+16>>2]){return Xa[J[J[a>>2]+40>>2]](a)|0}J[a+12>>2]=b+1;return K[b|0]}function Fg(a,b){a=a|0;b=b|0;var c=0;c=b;b=J[b>>2]+7&-8;J[c>>2]=b+16;O[a>>3]=ge(J[b>>2],J[b+4>>2],J[b+8>>2],J[b+12>>2]);}function be(a,b,c){c=c&255;while(1){a:{if((a|0)!=(b|0)){if((c|0)!=K[a|0]){break a}}else {a=b;}return a}a=a+1|0;continue}}function El(a){a=a|0;var b=0,c=0;c=J[a+4>>2];b=J[a>>2];a=J[a+8>>2];b=b+(a>>1)|0;if(a&1){c=J[c+J[b>>2]>>2];}Xa[c|0](b);}function kg(a,b,c,d,e,f,g,h,i){J[a>>2]=b;J[a+4>>2]=c;J[a+8>>2]=d;J[a+12>>2]=e&65535|(i>>>16&32768|e>>>16&32767)<<16;}function $e(a){var b=0;b=J[a>>2];J[a>>2]=0;if(b){a=J[b+4>>2]-1|0;J[b+4>>2]=a;if((a|0)==-1){Xa[J[J[b>>2]+8>>2]](b);}}}function sg(a,b){a=a|0;b=b|0;var c=0;c=J[a>>2];a:{if(!c){break a}if((vg(c,b)|0)!=-1){break a}J[a>>2]=0;}return a|0}function Yd(a,b,c){while(1){a:{if((a|0)!=(b|0)){if(J[a>>2]!=(c|0)){break a}}else {a=b;}return a}a=a+4|0;continue}}function Fd(a,b,c,d,e,f,g){var h=0;h=b>>8;if(b&1){h=J[J[e>>2]+h>>2];}Xa[J[J[a>>2]+20>>2]](a,c,d,e+h|0,b&2?f:2,g);}function Ld(a,b){var c=0,d=0;c=Gb(b);d=cb(c+13|0);J[d+8>>2]=0;J[d+4>>2]=c;J[d>>2]=c;J[a>>2]=fb(d+12|0,b,c+1|0);}function Jb(a,b,c){if(!c){return J[a+4>>2]==J[b+4>>2]}if((a|0)==(b|0)){return 1}return !Uc(J[a+4>>2],J[b+4>>2])}function zm(a,b,c,d,e,f){a=a|0;J[a+8>>2]=-1;J[a+12>>2]=-1;J[a>>2]=0;J[a+4>>2]=0;}function _h(a,b){a=a|0;b=b|0;J[a>>2]=22892;J[a>>2]=22500;Ld(a+4|0,(K[b+11|0]&128)>>>7|0?J[b>>2]:b);return a|0}function Rd(a,b){var c=0;c=Ua-16|0;Ua=c;J[c+12>>2]=a;a=c+12|0;J[a>>2]=J[a>>2]+(b<<2);Ua=c+16|0;return J[a>>2]}function zf(a,b,c,d,e){b=bc(b,c,d,e,4);if(!(K[d|0]&4)){J[a>>2]=((b|0)<69?b+2e3|0:(b|0)<100?b+1900|0:b)-1900;}}function Mb(a){var b=0;b=Ua-16|0;Ua=b;J[b+12>>2]=(K[a+11|0]&128)>>>7|0?J[a>>2]:a;Ua=b+16|0;return J[b+12>>2]}function Cf(a,b,c,d,e){b=cc(b,c,d,e,4);if(!(K[d|0]&4)){J[a>>2]=((b|0)<69?b+2e3|0:(b|0)<100?b+1900|0:b)-1900;}}function cd(a,b,c,d,e,f){var g=0;g=b>>8;if(b&1){g=J[J[d>>2]+g>>2];}Xa[J[J[a>>2]+24>>2]](a,c,d+g|0,b&2?e:2,f);}function Ke(a,b,c,d,e,f,g,h){c=c|0;e=e|0;f=f|0;h=h|0;J[e>>2]=c;J[h>>2]=f;return 3}function Td(a,b){var c=0;c=Ua-16|0;Ua=c;J[c+12>>2]=a;a=c+12|0;J[a>>2]=J[a>>2]+b;Ua=c+16|0;return J[a>>2]}function ec(a){a:{a=a&74;if(a){if((a|0)==64){return 8}if((a|0)!=8){break a}return 16}return 0}return 10}function Xb(a,b){var c=0;c=J[6178];if(b){J[6178]=(b|0)==-1?24816:b;}J[a>>2]=(c|0)==24816?-1:c;return a}function Ze(a,b,c){a:{if(!(K[b+120|0]|c>>>0>30)){H[b+120|0]=1;break a}b=$f(c);}J[a+4>>2]=c;J[a>>2]=b;}function af(a,b){J[a+4>>2];J[a+4>>2]=b;}function Yl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Xa[J[J[b>>2]+16>>2]](a,b,J[c+8>>2],J[c+12>>2],0,d);}function Mc(a){var b=0;b=J[a+12>>2];if(b){J[a+16>>2]=b;$a(b);}b=J[a>>2];if(b){J[a+4>>2]=b;$a(b);}}function Eh(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;if(Jb(a,J[b+8>>2],f)){Hd(b,c,d,e);}}function xm(a,b,c,d){a=a|0;J[a+8>>2]=-1;J[a+12>>2]=-1;J[a>>2]=0;J[a+4>>2]=0;}function gm(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Xa[J[J[a>>2]+24>>2]](a,b,c,d,e)|0}function We(a){var b=0,c=0;c=a;while(1){b=c;c=b+4|0;if(J[b>>2]){continue}break}return b-a>>2}function Je(a){a=a|0;var b=0;J[a>>2]=12684;b=J[a+8>>2];if(!(!b|!K[a+12|0])){$a(b);}return a|0}function Pb(){var a=0;a=Rb(4);J[a>>2]=22892;J[a>>2]=22364;J[a>>2]=22384;na(a|0,22460,5);B();}function sd(a,b,c){a:{if((K[a+11|0]&128)>>>7|0){J[a+4>>2]=c;break a}H[a+11|0]=c;}H[b+c|0]=0;}function od(a,b,c,d){var e=0;e=Ua-16|0;Ua=e;J[e+12>>2]=d;a=pd(a,b,c,d);Ua=e+16|0;return a}function eg(a,b){var c=0;c=Ua-16|0;Ua=c;J[c+12>>2]=b;a=fg(a,2310,b);Ua=c+16|0;return a}function cg(a){if((a|0)!=0&(a|0)!=19324&(a|0)!=19348&(a|0)!=24732&(a|0)!=24756){$a(a);}}function yk(a,b){a=a|0;b=b|0;var c=0;c=wg(J[b>>2]);J[a+4>>2]=J[b>>2];H[a|0]=c<<24>>24;}function wf(a,b){a=a|0;b=b|0;b=Ua-16|0;Ua=b;H[a+11|0]=1;H[og(a,1,45)+1|0]=0;Ua=b+16|0;}function tc(a,b,c){var d=0;d=Ua-16|0;Ua=d;Ag(d+8|0,b,(c<<2)+b|0,a);Ua=d+16|0;return a}function ki(a,b){b=b|0;if((b|0)>=0){b=J[((b&255)<<2)+11184>>2];}return b<<24>>24}function Xn(a){a=a|0;a=J[6144];if(a){J[6145]=a;$a(a);}a=J[6141];if(a){J[6142]=a;$a(a);}}function Bg(a,b,c){var d=0;d=Ua-16|0;Ua=d;Ag(d+8|0,a,b,c);Ua=d+16|0;return J[d+12>>2]}function ii(a,b){b=b|0;if((b|0)>=0){b=J[((b&255)<<2)+9648>>2];}return b<<24>>24}function De(a){var b=0;a=J[a>>2]-12|0;b=J[a+8>>2]-1|0;J[a+8>>2]=b;if((b|0)<0){$a(a);}}function Db(a){if(a){Db(J[a>>2]);Db(J[a+4>>2]);if(H[a+27|0]<0){$a(J[a+16>>2]);}$a(a);}}function ij(a){a=a|0;a=26312;while(1){a=ab(a-12|0);if((a|0)!=26288){continue}break}}function hj(a){a=a|0;a=26240;while(1){a=ab(a-12|0);if((a|0)!=25952){continue}break}}function gj(a){a=a|0;a=25640;while(1){a=ab(a-12|0);if((a|0)!=25472){continue}break}}function Wi(a){a=a|0;a=26280;while(1){a=ab(a-12|0);if((a|0)!=26256){continue}break}}function Vi(a){a=a|0;a=25936;while(1){a=ab(a-12|0);if((a|0)!=25648){continue}break}}function Ui(a){a=a|0;a=25464;while(1){a=ab(a-12|0);if((a|0)!=25296){continue}break}}function Ne(a){a=a|0;J[a>>2]=13768;if(J[a+8>>2]!=(jb()|0)){cg(J[a+8>>2]);}return a|0}function rf(a,b){var c=0;c=J[b>>2];J[b>>2]=0;tb(a,c);J[a+4>>2]=J[b+4>>2];return a}function cf(a){var b=0;b=J[a>>2];if(J[b>>2]){df(b);a=J[a>>2];bf(a+16|0,J[a>>2]);}}function yi(a,b,c){b=b|0;c=c|0;return (J[(c<<2)+12736>>2]&b)!=0&c>>>0<=127}function uh(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;Xa[a|0](b,c,d,e,f);}function Vd(a,b){a=a|0;b=b|0;J[a>>2]=22892;J[a>>2]=22480;Ld(a+4|0,b);return a|0}function Tg(a,b){a=a|0;b=b|0;J[a>>2]=22892;J[a>>2]=22500;Ld(a+4|0,b);return a|0}function th(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Xa[a|0](b,c,d,e)|0}function rk(a,b){a=a|0;b=b|0;var c=0;c=qg(J[b>>2]);J[a+4>>2]=J[b>>2];J[a>>2]=c;}function Yj(){J[6593]=0;J[6592]=22008;J[6592]=14144;J[6592]=13768;J[6594]=jb();}function fo(a){var b=0;while(1){if(a){a=a-1&a;b=b+1|0;continue}break}return b}function ce(){var a=0;a=Rb(4);J[a>>2]=22892;J[a>>2]=22364;na(a|0,22448,5);B();}function Kh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(Jb(a,J[b+8>>2],0)){Gd(b,c,d);}}function Kd(a,b){var c=0;c=a;a=(b>>>0)/100|0;return uc(uc(c,a),P(a,-100)+b|0)}function Jd(a,b){var c=0;c=a;a=(b>>>0)/1e4|0;return Kd(uc(c,a),P(a,-1e4)+b|0)}function Id(a,b){var c=0;c=a;a=(b>>>0)/1e6|0;return Jd(uc(c,a),P(a,-1e6)+b|0)}function yl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Xa[J[J[a>>2]+32>>2]](a,b,c,d)|0;}function rl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Xa[J[J[a>>2]+48>>2]](a,b,c,d)|0;}function gf(a){var b=0,c=0;b=Ua-16|0;Ua=b;c=b+12|0;J[c>>2]=a;cf(c);Ua=b+16|0;}function ti(a,b){b=b|0;if(b>>>0<=127){b=J[(b<<2)+11184>>2];}return b|0}function Vh(a,b,c){a=a|0;b=b|0;c=c|0;return J[b+4>>2]==(a|0)&J[b>>2]==(c|0)}function Cj(){J[6651]=0;J[6650]=22008;J[6650]=14144;Ye(26608);J[6650]=16704;}function Aj(){J[6655]=0;J[6654]=22008;J[6654]=14144;Ye(26624);J[6654]=16860;}function ri(a,b){b=b|0;if(b>>>0<=127){b=J[(b<<2)+9648>>2];}return b|0}function qj(a){if(!K[25260]){zc(25248,14004);H[25260]=1;}return 25248}function oj(a){if(!K[25292]){zc(25280,14088);H[25292]=1;}return 25280}function mj(a){if(!K[25196]){zc(25184,13932);H[25196]=1;}return 25184}function kj(a){if(!K[25228]){zc(25216,13968);H[25228]=1;}return 25216}function fm(a,b,c){a=a|0;b=b|0;c=c|0;return Xa[J[J[a>>2]+12>>2]](a,b,c)|0}function cm(a,b,c){a=a|0;b=b|0;c=c|0;return Xa[J[J[a>>2]+48>>2]](a,b,c)|0}function cj(a){if(!K[25244]){Kb(25232,2743);H[25244]=1;}return 25232}function aj(a){if(!K[25276]){Kb(25264,1928);H[25276]=1;}return 25264}function _i(a){if(!K[25180]){Kb(25168,1139);H[25180]=1;}return 25168}function Yi(a){if(!K[25212]){Kb(25200,2881);H[25212]=1;}return 25200}function Pc(a,b,c,d,e){c=c|0;e=e|0;J[e>>2]=c;return 3}function pc(a,b){a=a|0;H[a|0]=2;H[a+1|0]=3;H[a+2|0]=0;H[a+3|0]=4;}function om(a){a=a|0;J[a+16>>2]=J[a+16>>2]|1;if(H[a+20|0]&1){Aa();B();}}function vh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Xa[a|0](b,c,d,e);}function Pd(a){a=a|0;if(J[a+8>>2]!=(jb()|0)){cg(J[a+8>>2]);}return a|0}function xh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Xa[a|0](b,c,d)|0}function dk(a,b,c,d,e,f){a=a|0;f=f|0;Ud(a,f);}function wc(a,b){return b?a<<24|(a&65280)<<8|(a>>>8&65280|a>>>24):a}function oi(a,b,c){b=b|0;c=c|0;return (b>>>0<128?b:c)<<24>>24}function Gc(a,b){a=a|0;b=b|0;var c=0;c=cb(b);J[a+4>>2]=b;J[a>>2]=c;}function bf(a,b){a:{if((a|0)==(b|0)){H[b+120|0]=0;break a}$a(b);}}function Fl(a){a=a|0;var b=0;b=J[6259]+1|0;J[6259]=b;J[a+4>>2]=b;}function tg(a,b){a=a|0;b=b|0;return Xa[J[J[a>>2]+28>>2]](a,b)|0}function Xk(a,b){a=a|0;b=b|0;a=Vd(a,b);J[a>>2]=22548;return a|0}function Vl(a,b){a=a|0;b=b|0;return Xa[J[J[a>>2]+44>>2]](a,b)|0}function Gl(a,b){a=a|0;b=b|0;return Xa[J[J[a>>2]+12>>2]](a,b)|0}function Ch(a){a=a|0;if(!a){return 0}return (Fe(a,22200)|0)!=0|0}function Ai(a){a=a|0;a=J[a+8>>2];if(!a){return 1}return Le(a)|0}function em(a,b){a=a|0;b=b|0;if(!J[5996]){J[5996]=a;J[5997]=b;}}function Qb(a,b){a=a|0;J[a>>2]=0;J[a+4>>2]=0;J[a+8>>2]=0;}function ab(a){if((K[a+11|0]&128)>>>7|0){$a(J[a>>2]);}return a}function $f(a){if(a>>>0>=1073741824){Pb();B();}return cb(a<<2)}function wh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Xa[a|0](b,c,d);}function ng(a){a=a|0;J[a>>2]=7960;ab(a+32|0);return Qc(a)|0}function fi(a,b,c){b=b|0;c=c|0;return ((b|0)<0?c:b)|0}function Xm(a){a=a|0;a=Vd(a,2284);J[a>>2]=22600;return a|0}function Xh(a,b,c){a=a|0;b=b|0;c=c|0;J[a+4>>2]=b;J[a>>2]=c;}function Cm(a){a=a|0;a=Tg(a,1241);J[a>>2]=22684;return a|0}function Ve(a){a=a|0;J[a>>2]=13856;ab(a+16|0);return a|0}function Ue(a){a=a|0;J[a>>2]=13816;ab(a+12|0);return a|0}function we(a){a=a|0;J[a>>2]=22500;De(a+4|0);return a|0}function Ff(a){a=a|0;J[a>>2]=22480;De(a+4|0);return a|0}function uc(a,b){b=(b<<1)+21664|0;return Bg(b,b+2|0,a)}function lm(a){a=a|0;return ke(J[J[a>>2]-12>>2]+a|0)|0}function _f(a,b){a=a|0;b=b|0;Xa[J[J[b>>2]+24>>2]](a,b);}function Zf(a,b){a=a|0;b=b|0;Xa[J[J[b>>2]+28>>2]](a,b);}function Xl(a){a=a|0;return gd(J[J[a>>2]-12>>2]+a|0)|0}function Wf(a,b){a=a|0;b=b|0;Xa[J[J[b>>2]+20>>2]](a,b);}function Sh(a){a=a|0;if(a){a=a-24|0;J[a>>2]=J[a>>2]+1;}}function Ml(a,b,c,d){a=a|0;c=c|0;d=d|0;Ad(a,c,d);}function Jl(a,b,c,d){a=a|0;c=c|0;d=d|0;ag(a,c,d);}function Fc(a,b){var c=0;c=$f(b);J[a+4>>2]=b;J[a>>2]=c;}function qm(a){a=a|0;return Xa[J[J[a>>2]+24>>2]](a)|0}function kf(a,b,c){a=qe(a,b,c,0,-2147483648);return a}function Xf(a){a=a|0;return Xa[J[J[a>>2]+16>>2]](a)|0}function Nf(a){a=a|0;return Xa[J[J[a>>2]+12>>2]](a)|0}function Sg(a,b){a=a|0;b=b|0;return ve(a,b,Gb(b))|0}function Ub(a,b){a=a|0;b=b|0;return xg(a)^xg(b)^1}function Tb(a,b){a=a|0;b=b|0;return rg(a)^rg(b)^1}function wl(a){if(H[24003]<0){$a(J[5998]);}}function jm(a){a=a|0;a=Ua-a&-16;Ua=a;return a|0}function Mg(a,b){if(!a){return 0}return pe(a,b)}function Am(a,b,c){a=a|0;return a|0}function nc(a,b,c){return Oa(18,a|0,b|0,c|0)|0}function lf(a,b,c){return -1}function km(a){a=a|0;ug(J[J[a>>2]-12>>2]+a|0);}function hf(a,b,c){a=qe(a,b,c,-1,-1);return a}function Wl(a){a=a|0;mg(J[J[a>>2]-12>>2]+a|0);}function bd(a,b,c,d){Ma(152,a|0,b|0,c|0,d|0);}function Ae(a,b,c,d){La(155,a|0,b|0,c|0,d|0);}function wn(a){a=a|0;J[a>>2]=7e3;return a|0}function uj(a){a=a|0;Xa[J[J[a>>2]+4>>2]](a);}function Ic(a){a=a|0;wg(J[a>>2]);return a|0}function Hc(a){a=a|0;qg(J[a>>2]);return a|0}function zj(a){a=a|0;qb(a,26616,pb(24916));}function yj(a){a=a|0;qb(a,26632,pb(24988));}function xj(a){a=a|0;qb(a,26640,pb(24996));}function bk(a){a=a|0;qb(a,26320,pb(24844));}function ak(a){a=a|0;qb(a,26328,pb(24852));}function _j(a){a=a|0;qb(a,26352,pb(25040));}function Zj(a){a=a|0;qb(a,26360,pb(25056));}function Xj(a){a=a|0;qb(a,26368,pb(25064));}function Wj(a){a=a|0;qb(a,26384,pb(25072));}function Vj(a){a=a|0;qb(a,26392,pb(25088));}function Uj(a){a=a|0;qb(a,26400,pb(25080));}function Tj(a){a=a|0;qb(a,26408,pb(25096));}function Sj(a){a=a|0;qb(a,26416,pb(25104));}function Rj(a){a=a|0;qb(a,26440,pb(25112));}function Qj(a){a=a|0;qb(a,26472,pb(24860));}function Pj(a){a=a|0;qb(a,26480,pb(24868));}function Oj(a){a=a|0;qb(a,26488,pb(24876));}function Nj(a){a=a|0;qb(a,26496,pb(24884));}function Mj(a){a=a|0;qb(a,26504,pb(24924));}function Lj(a){a=a|0;qb(a,26512,pb(24932));}function Kj(a){a=a|0;qb(a,26520,pb(24940));}function Jj(a){a=a|0;qb(a,26528,pb(24948));}function Ij(a){a=a|0;qb(a,26536,pb(24956));}function Hj(a){a=a|0;qb(a,26544,pb(24964));}function Gj(a){a=a|0;qb(a,26552,pb(24972));}function Fj(a){a=a|0;qb(a,26560,pb(24980));}function Ej(a){a=a|0;qb(a,26568,pb(24892));}function Dj(a){a=a|0;qb(a,26584,pb(24900));}function Bj(a){a=a|0;qb(a,26600,pb(24908));}function $j(a){a=a|0;qb(a,26336,pb(25048));}function le(a){a=a|0;return lc(a,25048)|0}function ke(a){a=a|0;Od(a+4|0);return a|0}function je(a){a=a|0;return lc(a,25040)|0}function im(a){a=a|0;return lc(a,24876)|0}function gc(a,b,c){Bg(b,b+c|0,a);return a}function de(a){a=a|0;return lc(a,25104)|0}function Zd(a){a=a|0;return lc(a,25112)|0}function Qi(a,b){a=a|0;b=b|0;Ud(a,b+16|0);}function Ki(a,b){a=a|0;b=b|0;Ud(a,b+12|0);}function Pi(a,b){a=a|0;zc(a,13888);}function Oi(a,b){a=a|0;zc(a,13908);}function zg(a,b){b=b|0;return b|0}function vf(a,b){a=a|0;Hf(a,1,45);}function ae(a,b,c){a=hf(a,b,c);return a}function Uf(a,b,c){a=kf(a,b,c);return a}function Ji(a,b){a=a|0;Kb(a,2331);}function Ii(a,b){a=a|0;Kb(a,2350);}function id(a){return 2147483647}function Ri(a){a=a|0;return J[a+12>>2]}function sb(a){a=a|0;return _c(8,a)|0}function Si(a){a=a|0;return J[a+8>>2]}function Cg(a,b){return -1}function Ce(a){a=a|0;return J[a+4>>2]}function $h(a,b){return 0}function Mi(a){a=a|0;return H[a+8|0]}function Li(a){a=a|0;return H[a+9|0]}function oc(a,b,c){return eb(a,b,c)}function lg(a){a=a|0;return we(a)|0}function ef(a){if(!K[a+4|0]){cf(a);}}function tf(a){return lc(a,24932)}function sf(a){return lc(a,24924)}function qf(a){return lc(a,24948)}function pf(a){return lc(a,24940)}function zh(a){return 2176}function yh(a){return 1304}function Ul(a){return 2042}function Bh(a){return 1969}function Ah(a){return 2524}function jd(a){return 127}function $b(a){a=a|0;return a|0}function ug(a){a=a|0;$a(ke(a));}function rd(a){a=a|0;$a(we(a));}function pj(a){ab(25248);}function nj(a){ab(25280);}function mi(a){a=a|0;$a(Je(a));}function mg(a){a=a|0;$a(gd(a));}function lj(a){ab(25184);}function jj(a){ab(25216);}function di(a){a=a|0;$a(Ie(a));}function bj(a){ab(25232);}function Zl(a){a=a|0;$a(ng(a));}function Zi(a){ab(25168);}function Xi(a){ab(25200);}function Xe(a){a=a|0;$a(Pd(a));}function Ti(a){a=a|0;$a(Ve(a));}function Ql(a){a=a|0;$a(oe(a));}function Ni(a){a=a|0;$a(Ue(a));}function Hi(a){a=a|0;$a(Ne(a));}function Dd(a){a=a|0;$a(Ff(a));}function Bm(a){a=a|0;$a(Qc(a));}function $i(a){ab(25264);}function vm(a){return -1}function ed(a){return 4}function Qd(a){return 1}function Ib(a){return 0}function Gf(a){return 2}function ne(a,b){}function df(a){af(a,J[a>>2]);}function Ye(a){J[a>>2]=jb();}function ub(){If(2284);B();}function nb(){If(1687);B();}function kb(a){a=a|0;$a(a);}function ym(a){a=a|0;Va=a;}function sm(){return Ua|0}function nm(a){a=a|0;Ua=a;}function ai(a){B();}function db(a){tb(a,0);}function Ph(){Ge();B();}function Ge(){za();B();}function Od(a){oe(a);}function Nd(a){}\n\t\t// EMSCRIPTEN_END_FUNCS\n\t\te=K;p();var Xa=c([null,wl,ub,cb,nl,$b,Xk,Ff,nb,Ei,wi,nb,li,ci,Zh,Qh,Jh,Vd,rh,qh,ph,oh,nh,mh,lh,kh,jh,ih,hh,Bd,Kb,pk,gh,mc,nb,Pb,fh,eh,dh,ch,Zc,nb,bh,un,la,_g,ao,nb,$n,_n,$g,bo,nb,Zn,Wb,Yn,nb,hc,Xn,nb,Wn,Zg,nb,Vn,Un,Tn,Sn,Rn,Qn,Pn,On,Nn,Mn,Ln,Kn,Jn,In,Hn,Gn,Fn,En,Dn,Cn,Bn,nb,nb,An,zn,yn,sh,xn,Tg,we,nb,nb,nb,nb,Sg,rn,qn,ve,pn,sn,on,nn,mn,ln,kn,ue,tn,ra,ze,nb,hn,Lc,Kc,gn,fn,en,an,Yh,nb,dn,nb,Ob,Xm,cn,bn,se,Pg,_m,Zm,Ym,Rl,rm,im,hm,gm,pm,om,Vm,Um,nb,Tm,re,Sm,Rm,Qm,Pm,Om,Nm,Mm,Lm,Km,Ad,Jm,Im,$m,Hm,Gm,Fm,Em,re,Dm,Kc,Gg,Fg,Cm,bi,qm,le,tg,ie,$b,Uh,_h,Sl,lg,Pl,Ol,de,_f,Zf,nd,kb,ce,Ub,mm,Gl,Ic,Fl,El,Aa,Xf,Wf,yl,Nf,je,Zd,_f,Zf,ld,Tb,dm,tg,Hc,Xf,Wf,rl,Nf,sg,gl,bl,Ac,pg,Yk,Vl,cm,Sk,Bc,Nd,Ak,xf,zk,yk,xk,uf,vk,tk,sk,fm,rk,qk,uf,nk,mk,kk,jk,gk,fk,bk,ak,$j,_j,Zj,Yj,Xj,Wj,Vj,Uj,Tj,Sj,Rj,Qj,Pj,Oj,Nj,Mj,Lj,Kj,Jj,Ij,Hj,Gj,Fj,Ej,Dj,Cj,Bj,Aj,zj,yj,xj,wj,vj,gj,hj,ij,pj,nj,lj,jj,Ui,Vi,Wi,bj,$i,Zi,Xi,Gc,Th,Ge,wn,kb,vn,$h,kb,Qc,Bm,ne,Am,zm,xm,Ib,Ib,wm,vm,um,Cg,tm,Cg,ng,Zl,_l,Yl,bm,am,$l,gd,mg,Xl,Wl,ke,ug,lm,km,$b,kb,Ul,Xh,Wh,Vh,Tl,rd,Ce,oe,Ql,Ie,di,uj,Je,mi,ki,ji,ii,hi,zg,gi,fi,ei,Ne,Hi,Gi,Fi,Di,Ci,Ib,Bi,Ai,Ue,Ni,Mi,Li,Ki,Ji,Ii,Ve,Ti,Si,Ri,Qi,Pi,Oi,$b,kb,kb,yi,xi,vi,ui,ti,si,ri,qi,zg,pi,oi,ni,kb,Ke,Ke,Pc,Qd,Qd,zi,Qd,kb,Qe,Pe,Pc,Ib,Ib,Oe,ed,kb,Qe,Pe,Pc,Ib,Ib,Oe,ed,kb,Te,Se,Pc,Ib,Ib,Re,ed,kb,Te,Se,Pc,Ib,Ib,Re,ed,$b,kb,Nl,Ml,Ll,$b,kb,Kl,Jl,Il,kb,Hl,Dl,Cl,Bl,Rf,Rf,Al,zl,xl,vl,ul,kb,tl,sl,ql,pl,Jf,Jf,ol,ml,ll,kl,jl,kb,il,hl,fl,el,dl,cl,al,$k,kb,_k,Zk,Wk,Vk,Uk,Tk,Rk,Qk,$b,kb,Gf,Pk,Ok,Nk,Mk,Lk,Kk,fj,ej,dj,cj,aj,_i,Yi,$b,kb,Gf,Jk,Ik,Hk,Gk,Fk,Ek,tj,sj,rj,qj,oj,mj,kj,Pd,Xe,Dk,Pd,Xe,Ck,kb,jd,jd,Qb,Qb,Qb,wf,Ib,pc,pc,kb,jd,jd,Qb,Qb,Qb,wf,Ib,pc,pc,kb,id,id,Qb,Qb,Qb,vf,Ib,pc,pc,kb,id,id,Qb,Qb,Qb,vf,Ib,pc,pc,kb,Bk,wk,kb,uk,ok,kb,lk,ik,kb,hk,ek,kb,lf,dk,ne,kb,lf,ck,ne,lg,rd,$b,ai,Ph,za,$b,kb,Nd,Nd,Oh,Fh,Hh,Ih,kb,Ah,kb,zh,Dd,Ce,rd,Dd,Dd,rd,kb,yh,kb,Eh,Gh,Kh,kb,Nh,Mh,Lh,kb,Bh]);function Ya(){return G.byteLength/65536|0}return {\"Y\":ah,\"Z\":kb,\"_\":sb,\"$\":jn,\"aa\":Wm,\"ba\":Xa,\"ca\":em,\"da\":ym,\"ea\":sm,\"fa\":nm,\"ga\":jm,\"ha\":Rh,\"ia\":Sh,\"ja\":Dh,\"ka\":Ch,\"la\":xh,\"ma\":wh,\"na\":vh,\"oa\":vh,\"pa\":uh,\"qa\":th}}return Za(_a)}\n\t\t// EMSCRIPTEN_END_ASM\n\n\n\t\t)(info);},instantiate:function(binary,info){return {then:function(ok){var module=new WebAssembly.Module(binary);ok({\"instance\":new WebAssembly.Instance(module,info)});}}},RuntimeError:Error};wasmBinary=[];if(typeof WebAssembly!=\"object\"){abort(\"no native wasm support detected\");}var wasmMemory;var ABORT=false;function assert(condition,text){if(!condition){abort(text);}}var HEAP8,HEAPU8,HEAP32,HEAPU32;function updateMemoryViews(){var b=wasmMemory.buffer;Module[\"HEAP8\"]=HEAP8=new Int8Array(b);Module[\"HEAP16\"]=new Int16Array(b);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(b);Module[\"HEAPU16\"]=new Uint16Array(b);Module[\"HEAP32\"]=HEAP32=new Int32Array(b);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(b);Module[\"HEAPF32\"]=new Float32Array(b);Module[\"HEAPF64\"]=new Float64Array(b);}var INITIAL_MEMORY=Module[\"INITIAL_MEMORY\"]||16777216;assert(INITIAL_MEMORY>=65536,\"INITIAL_MEMORY should be larger than STACK_SIZE, was \"+INITIAL_MEMORY+\"! (STACK_SIZE=\"+65536+\")\");if(Module[\"wasmMemory\"]){wasmMemory=Module[\"wasmMemory\"];}else {wasmMemory=new WebAssembly.Memory({\"initial\":INITIAL_MEMORY/65536,\"maximum\":INITIAL_MEMORY/65536});}updateMemoryViews();INITIAL_MEMORY=wasmMemory.buffer.byteLength;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){callRuntimeCallbacks(__ATINIT__);}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnInit(cb){__ATINIT__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}var runDependencies=0;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies);}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies);}if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what);}what=\"Aborted(\"+what+\")\";err(what);ABORT=true;what+=\". Build with -sASSERTIONS for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}var wasmBinaryFile;wasmBinaryFile=\"bindings.wasm\";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile);}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}var binary=tryParseAsDataURI(file);if(binary){return binary}throw \"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)\"}function instantiateSync(file,info){var module;var binary=getBinarySync(file);module=new WebAssembly.Module(binary);var instance=new WebAssembly.Instance(module,info);return [instance,module]}function createWasm(){var info={\"a\":wasmImports};function receiveInstance(instance,module){var exports=instance.exports;wasmExports=exports;wasmTable=wasmExports[\"ba\"];addOnInit(wasmExports[\"Y\"]);removeRunDependency();return exports}addRunDependency();if(Module[\"instantiateWasm\"]){try{return Module[\"instantiateWasm\"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e);}}var result=instantiateSync(wasmBinaryFile,info);return receiveInstance(result[0])}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module);}};var UTF8Decoder=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf8\"):undefined;var UTF8ArrayToString=(heapOrArray,idx,maxBytesToRead)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str=\"\";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2;}else {u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63;}if(u0<65536){str+=String.fromCharCode(u0);}else {var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):\"\";var ___assert_fail=(condition,filename,line,func)=>{abort(`Assertion failed: ${UTF8ToString(condition)}, at: `+[filename?UTF8ToString(filename):\"unknown filename\",line,func?UTF8ToString(func):\"unknown function\"]);};var exceptionCaught=[];var uncaughtExceptionCount=0;var ___cxa_begin_catch=ptr=>{var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--;}info.set_rethrown(false);exceptionCaught.push(info);___cxa_increment_exception_refcount(info.excPtr);return info.get_exception_ptr()};var exceptionLast=0;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0;};function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type;};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor;};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught;};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown;};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr;};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr};}var ___resumeException=ptr=>{if(!exceptionLast){exceptionLast=ptr;}throw exceptionLast};var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var arg in args){var caughtType=args[arg];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};var ___cxa_find_matching_catch_2=()=>findMatchingCatch([]);var ___cxa_find_matching_catch_3=arg0=>findMatchingCatch([arg0]);var ___cxa_find_matching_catch_4=(arg0,arg1)=>findMatchingCatch([arg0,arg1]);var ___cxa_rethrow=()=>{var info=exceptionCaught.pop();if(!info){abort(\"no exception to throw\");}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++;}exceptionLast=ptr;throw exceptionLast};var ___cxa_throw=(ptr,type,destructor)=>{var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast};var ___cxa_uncaught_exceptions=()=>uncaughtExceptionCount;var _abort=()=>{abort(\"\");};var _emscripten_memcpy_big=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var abortOnCannotGrowMemory=requestedSize=>{abort(\"OOM\");};var _emscripten_resize_heap=requestedSize=>{HEAPU8.length;abortOnCannotGrowMemory();};var ENV={};var getExecutableName=()=>thisProgram||\"./this.program\";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(typeof navigator==\"object\"&&navigator.languages&&navigator.languages[0]||\"C\").replace(\"-\",\"_\")+\".UTF-8\";var env={\"USER\":\"web_user\",\"LOGNAME\":\"web_user\",\"PATH\":\"/\",\"PWD\":\"/\",\"HOME\":\"/home/web_user\",\"LANG\":lang,\"_\":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x];}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`);}getEnvStrings.strings=strings;}return getEnvStrings.strings};var stringToAscii=(str,buffer)=>{for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i);}HEAP8[buffer>>0]=0;};var _environ_get=(__environ,environ_buf)=>{var bufSize=0;getEnvStrings().forEach((string,i)=>{var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1;});return 0};var _environ_sizes_get=(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(string=>bufSize+=string.length+1);HEAPU32[penviron_buf_size>>2]=bufSize;return 0};var _llvm_eh_typeid_for=type=>type;var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var arraySum=(array,index)=>{var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum};var MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];var addDays=(date,days)=>{var newDate=new Date(date.getTime());while(days>0){var leap=isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1);}else {newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1);}}else {newDate.setDate(newDate.getDate()+days);return newDate}}return newDate};var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++;}else if(c<=2047){len+=2;}else if(c>=55296&&c<=57343){len+=4;++i;}else {len+=3;}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023;}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}else {if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}}heap[outIdx]=0;return outIdx-startIdx};function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer);};var _strftime=(s,maxsize,format,tm)=>{var tm_zone=HEAPU32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):\"\"};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={\"%c\":\"%a %b %d %H:%M:%S %Y\",\"%D\":\"%m/%d/%y\",\"%F\":\"%Y-%m-%d\",\"%h\":\"%b\",\"%r\":\"%I:%M:%S %p\",\"%R\":\"%H:%M\",\"%T\":\"%H:%M:%S\",\"%x\":\"%m/%d/%y\",\"%X\":\"%H:%M:%S\",\"%Ec\":\"%c\",\"%EC\":\"%C\",\"%Ex\":\"%m/%d/%y\",\"%EX\":\"%H:%M:%S\",\"%Ey\":\"%y\",\"%EY\":\"%Y\",\"%Od\":\"%d\",\"%Oe\":\"%e\",\"%OH\":\"%H\",\"%OI\":\"%I\",\"%Om\":\"%m\",\"%OM\":\"%M\",\"%OS\":\"%S\",\"%Ou\":\"%u\",\"%OU\":\"%U\",\"%OV\":\"%V\",\"%Ow\":\"%w\",\"%OW\":\"%W\",\"%Oy\":\"%y\"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,\"g\"),EXPANSION_RULES_1[rule]);}var WEEKDAYS=[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"];var MONTHS=[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"];function leadingSomething(value,digits,character){var str=typeof value==\"number\"?value.toString():value||\"\";while(str.length<digits){str=character[0]+str;}return str}function leadingNulls(value,digits){return leadingSomething(value,digits,\"0\")}function compareByDay(date1,date2){function sgn(value){return value<0?-1:value>0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate());}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}return thisDate.getFullYear()}return thisDate.getFullYear()-1}var EXPANSION_RULES_2={\"%a\":date=>WEEKDAYS[date.tm_wday].substring(0,3),\"%A\":date=>WEEKDAYS[date.tm_wday],\"%b\":date=>MONTHS[date.tm_mon].substring(0,3),\"%B\":date=>MONTHS[date.tm_mon],\"%C\":date=>{var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},\"%d\":date=>leadingNulls(date.tm_mday,2),\"%e\":date=>leadingSomething(date.tm_mday,2,\" \"),\"%g\":date=>getWeekBasedYear(date).toString().substring(2),\"%G\":date=>getWeekBasedYear(date),\"%H\":date=>leadingNulls(date.tm_hour,2),\"%I\":date=>{var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},\"%j\":date=>leadingNulls(date.tm_mday+arraySum(isLeapYear(date.tm_year+1900)?MONTH_DAYS_LEAP:MONTH_DAYS_REGULAR,date.tm_mon-1),3),\"%m\":date=>leadingNulls(date.tm_mon+1,2),\"%M\":date=>leadingNulls(date.tm_min,2),\"%n\":()=>\"\\n\",\"%p\":date=>{if(date.tm_hour>=0&&date.tm_hour<12){return \"AM\"}return \"PM\"},\"%S\":date=>leadingNulls(date.tm_sec,2),\"%t\":()=>\"\\t\",\"%u\":date=>date.tm_wday||7,\"%U\":date=>{var days=date.tm_yday+7-date.tm_wday;return leadingNulls(Math.floor(days/7),2)},\"%V\":date=>{var val=Math.floor((date.tm_yday+7-(date.tm_wday+6)%7)/7);if((date.tm_wday+371-date.tm_yday-2)%7<=2){val++;}if(!val){val=52;var dec31=(date.tm_wday+7-date.tm_yday-1)%7;if(dec31==4||dec31==5&&isLeapYear(date.tm_year%400-1)){val++;}}else if(val==53){var jan1=(date.tm_wday+371-date.tm_yday)%7;if(jan1!=4&&(jan1!=3||!isLeapYear(date.tm_year)))val=1;}return leadingNulls(val,2)},\"%w\":date=>date.tm_wday,\"%W\":date=>{var days=date.tm_yday+7-(date.tm_wday+6)%7;return leadingNulls(Math.floor(days/7),2)},\"%y\":date=>(date.tm_year+1900).toString().substring(2),\"%Y\":date=>date.tm_year+1900,\"%z\":date=>{var off=date.tm_gmtoff;var ahead=off>=0;off=Math.abs(off)/60;off=off/60*100+off%60;return (ahead?\"+\":\"-\")+String(\"0000\"+off).slice(-4)},\"%Z\":date=>date.tm_zone,\"%%\":()=>\"%\"};pattern=pattern.replace(/%%/g,\"\\0\\0\");for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,\"g\"),EXPANSION_RULES_2[rule](date));}}pattern=pattern.replace(/\\0\\0/g,\"%\");var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1};var _strftime_l=(s,maxsize,format,tm,loc)=>_strftime(s,maxsize,format,tm);var wasmTableMirror=[];var getWasmTableEntry=funcPtr=>{var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr);}return func};var getCFunc=ident=>{var func=Module[\"_\"+ident];return func};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={\"string\":str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str);}return ret},\"array\":arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\"){return UTF8ToString(ret)}if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i]);}else {cArgs[i]=args[i];}}}var ret=func.apply(null,cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret};var cwrap=(ident,returnType,argTypes,opts)=>{var numericArgs=!argTypes||argTypes.every(type=>type===\"number\"||type===\"boolean\");var numericRet=returnType!==\"string\";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return function(){return ccall(ident,returnType,argTypes,arguments)}};var wasmImports={p:___assert_fail,t:___cxa_begin_catch,v:___cxa_end_catch,b:___cxa_find_matching_catch_2,j:___cxa_find_matching_catch_3,V:___cxa_find_matching_catch_4,E:___cxa_rethrow,r:___cxa_throw,L:___cxa_uncaught_exceptions,h:___resumeException,D:_abort,M:_emscripten_memcpy_big,U:_emscripten_resize_heap,J:_environ_get,K:_environ_sizes_get,G:invoke_i,d:invoke_ii,u:invoke_iiddi,c:invoke_iii,W:invoke_iiid,f:invoke_iiii,C:invoke_iiiid,m:invoke_iiiii,B:invoke_iiiiii,o:invoke_iiiiiii,F:invoke_iiiiiiii,y:invoke_iiiiiiiiiiii,N:invoke_iiij,S:invoke_iij,g:invoke_v,l:invoke_vi,H:invoke_vid,e:invoke_vii,T:invoke_viid,i:invoke_viii,I:invoke_viiidi,k:invoke_viiii,z:invoke_viiiid,n:invoke_viiiidi,s:invoke_viiiii,q:invoke_viiiiiii,w:invoke_viiiiiiiiii,x:invoke_viiiiiiiiiiiiiii,O:invoke_viiij,P:invoke_viij,R:invoke_vij,Q:invoke_viji,A:_llvm_eh_typeid_for,a:wasmMemory,X:_strftime_l};var wasmExports=createWasm();wasmExports[\"Y\"];wasmExports[\"__errno_location\"];wasmExports[\"__cxa_free_exception\"];Module[\"_free\"]=wasmExports[\"Z\"];Module[\"_malloc\"]=wasmExports[\"_\"];Module[\"_miniscript_compile\"]=wasmExports[\"$\"];Module[\"_miniscript_analyze\"]=wasmExports[\"aa\"];var _setThrew=wasmExports[\"ca\"];var setTempRet0=wasmExports[\"da\"];var stackSave=wasmExports[\"ea\"];var stackRestore=wasmExports[\"fa\"];var stackAlloc=wasmExports[\"ga\"];var ___cxa_decrement_exception_refcount=wasmExports[\"ha\"];var ___cxa_increment_exception_refcount=wasmExports[\"ia\"];var ___cxa_can_catch=wasmExports[\"ja\"];var ___cxa_is_pointer_type=wasmExports[\"ka\"];var dynCall_iij=Module[\"dynCall_iij\"]=wasmExports[\"la\"];var dynCall_vij=Module[\"dynCall_vij\"]=wasmExports[\"ma\"];var dynCall_viji=Module[\"dynCall_viji\"]=wasmExports[\"na\"];var dynCall_viij=Module[\"dynCall_viij\"]=wasmExports[\"oa\"];var dynCall_viiij=Module[\"dynCall_viiij\"]=wasmExports[\"pa\"];var dynCall_iiij=Module[\"dynCall_iiij\"]=wasmExports[\"qa\"];function invoke_v(index){var sp=stackSave();try{getWasmTableEntry(index)();}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiiid(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiid(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiddi(index,a1,a2,a3,a4){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiidi(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiiidi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_vid(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_i(index){var sp=stackSave();try{return getWasmTableEntry(index)()}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viid(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iij(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iij(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_vij(index,a1,a2,a3){var sp=stackSave();try{dynCall_vij(index,a1,a2,a3);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viji(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viji(index,a1,a2,a3,a4);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viij(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viij(index,a1,a2,a3,a4);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_viiij(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiij(index,a1,a2,a3,a4,a5);}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function invoke_iiij(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiij(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);}}function intArrayFromBase64(s){try{var decoded=atob(s);var bytes=new Uint8Array(decoded.length);for(var i=0;i<decoded.length;++i){bytes[i]=decoded.charCodeAt(i);}return bytes}catch(_){throw new Error(\"Converting base64 string to bytes failed.\")}}function tryParseAsDataURI(filename){if(!isDataURI(filename)){return}return intArrayFromBase64(filename.slice(dataURIPrefix.length))}Module[\"cwrap\"]=cwrap;Module[\"UTF8ToString\"]=UTF8ToString;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun();}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\");},1);doRun();},1);}else {doRun();}}if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()();}}run();\n\n\n\t\t  return moduleArg\n\t\t}\n\n\t\t);\n\t\t})();\n\t\tmodule.exports = Module; \n\t} (bindings$1));\n\treturn bindings$1.exports;\n}\n\nvar bindingsExports = requireBindings();\nvar bindings = /*@__PURE__*/getDefaultExportFromCjs(bindingsExports);\n\n// Initial author: Pieter Wuille ( https://github.com/sipa/miniscript/blob/master/index.html)\n// Adapted by Jose-Luis Landabaso - https://bitcoinerlab.com:\n//  compilePolicy, compileMiniscript with issane, issanesublevel and cleanAsm\n\nconst Module = bindings();\n\nconst em_miniscript_compile = Module.cwrap('miniscript_compile', 'none', [\n  'string',\n  'number',\n  'number',\n  'number',\n  'number',\n  'number',\n  'number'\n]);\nconst em_miniscript_analyze = Module.cwrap('miniscript_analyze', 'none', [\n  'string',\n  'number',\n  'number',\n  'number',\n  'number'\n]);\n\nconst cleanAsm = asm =>\n  asm\n    .trim()\n    .replace(/\\n/g, ' ')\n    .replace(/ +(?= )/g, '');\n\n/**\n * @typedef {Object} CompilePolicyResult\n * @property {string} miniscript - The compiled miniscript expression.\n * @property {string} asm - The compiled miniscript as Bitcoin asm code.\n * @property {boolean} issane - Whether the miniscript is sane at the top level.\n * @property {boolean} issanesublevel - Whether the miniscript is sane at the sublevel.\n */\n\n/**\n * @typedef {Object} CompileMiniscriptResult\n * @property {string} asm - The Bitcoin asm code of the compiled miniscript expression.\n * @property {boolean} issane - Whether the miniscript is sane at the top level.\n * @property {boolean} issanesublevel - Whether the miniscript is sane at the sublevel.\n */\n\n\n/**\n * Compiles a miniscript policy into a miniscript expression (if possible).\n * @function\n *\n * @param {string} policy - The miniscript policy to compile.\n * @returns {CompilePolicyResult}\n */\nconst compilePolicy = policy => {\n  const miniscript = Module._malloc(10000);\n  const cost = Module._malloc(500);\n  const asm = Module._malloc(100000);\n  const issane = Module._malloc(10);\n  const issanesublevel = Module._malloc(10);\n  em_miniscript_compile(\n    policy,\n    miniscript,\n    10000,\n    cost,\n    500,\n    asm,\n    100000,\n    issane,\n    10,\n    issanesublevel,\n    10\n  );\n  const result = {\n    miniscript: Module.UTF8ToString(miniscript),\n    asm: cleanAsm(Module.UTF8ToString(asm)),\n    issane: Module.UTF8ToString(issane) === 'true' ? true : false,\n    issanesublevel:\n      Module.UTF8ToString(issanesublevel) === 'true' ? true : false\n  };\n  Module._free(miniscript);\n  Module._free(cost);\n  Module._free(asm);\n  Module._free(issane);\n  Module._free(issanesublevel);\n\n  return result;\n};\n\n/**\n * Compiles a miniscript expression and returns its asm code.\n * @function\n *\n * @param {string} miniscript - A miniscript expression.\n * @returns {CompileMiniscriptResult}\n */\nconst compileMiniscript = miniscript => {\n  const analysis = Module._malloc(50000);\n  const asm = Module._malloc(100000);\n  const issane = Module._malloc(10);\n  const issanesublevel = Module._malloc(10);\n  em_miniscript_analyze(\n    miniscript,\n    analysis,\n    50000,\n    asm,\n    100000,\n    issane,\n    10,\n    issanesublevel,\n    10\n  );\n  const result_asm = Module.UTF8ToString(asm);\n  const result_issane = Module.UTF8ToString(issane);\n  const result_issanesublebel = Module.UTF8ToString(issanesublevel);\n  Module._free(analysis);\n  Module._free(asm);\n  Module._free(issane);\n  Module._free(issanesublevel);\n\n  return {\n    asm: cleanAsm(result_asm),\n    issane: result_issane === 'true' ? true : false,\n    issanesublevel: result_issanesublebel === 'true' ? true : false\n  };\n};\n\n// Copyright (c) 2022 Jose-Luis Landabaso - https://bitcoinerlab.com\n// Distributed under the MIT software license\n\n\n/**\n * @typedef {Object} Solution\n * @property {number} nSequence - the maximum nSequence time of all the sat() or dsat() expressions in the solution.\n * @property {number} nLockTime - the maximum nLockTime of all the sat() or dsat() expressions in the solution.\n * @property {string} asm - the resulting witness after combining all the sat() or dsat() expressions.\n */\n\n/**\n * @typedef {Object} Satisfactions\n * @property {Solution[]} sats - An array of {@link Solution} objects representing the sat() expressions.\n * @property {Solution[]} dsats - An array of {@link Solution} objects representing the dsat() expressions.\n * @see {@link Solution}\n */\n\n/**\n * @typedef {Object} SatisfierResult\n * @property {Solution[]} nonMalleableSats - An array of {@link Solution} objects representing the non-malleable sat() expressions.\n * @property {Solution[]} malleableSats - An array of {@link Solution} objects representing the malleable sat() expressions.\n * @property {Solution[]} unknownSats - An array of {@link Solution} objects representing the sat() expressions that contain some of the `unknown` pieces of information.\n * @see {@link Solution}\n */\n\n\n/**\n * Computes the weight units (WU) of a witness.\n * @param {string} asm - the witness to compute the WU of.\n * @returns {number} the weight units (WU) of the witness.\n */\nfunction witnessWU(asm) {\n  // Split the witness string into an array of substrings\n  // a miniscipt witness is either, <sig..., <sha256..., <hash256...,\n  // <ripemd160..., <hash160...,  <... (for pubkeys) 0 or 1\n  const substrings = asm.split(' ');\n\n  // Initialize the sum to 0\n  let wu = 0;\n\n  // Iterate over the array of substrings\n  for (const substring of substrings) {\n    if (substring === '') ;\n    // Check if the substring starts with \"<sig\"\n    else if (substring.startsWith('<sig')) {\n      //https://en.bitcoin.it/wiki/BIP_0137\n      //Signatures are either 73, 72, or 71 bytes long\n      //Also https://bitcoin.stackexchange.com/a/77192/89665\n      wu += 74; //73 + push op code\n    }\n    //\n    // preimages:\n    else if (\n      substring.startsWith('<sha256_preimage(') ||\n      substring.startsWith('<hash256_preimage(') ||\n      substring.startsWith('<ripemd160_preimage(') ||\n      substring.startsWith('<hash160_preimage(') ||\n      substring.startsWith('<random_preimage()>')\n    ) {\n      //any preimage is checked against <32> with SIZE <32> EQUALVERIFY:\n      //See the miniscript Translation table:\n      //https://bitcoin.sipa.be/miniscript/\n      //SIZE <32> EQUALVERIFY {SHA256,RIPEMD,160,HASH160,HASH256} <h> EQUAL\n      wu += 33; //32 + push op code\n    }\n    // Pub keys\n    else if (substring.startsWith('<')) {\n      //https://en.bitcoin.it/wiki/BIP_0137\n      //Compressed public keys are 33 bytes\n      wu += 34; //33 + push op code\n    } else if (substring === '1' || substring === '0') {\n      wu += 1;\n    } else {\n      throw new Error(`Invalid witness substring ${substring}`);\n    }\n  }\n\n  // Return the final wu\n  return wu;\n}\n\n/**\n * Performs a malleability analysis on an array of sat() solutions.\n * @param {Solution[]} sats - the array of sat() solutions to perform the analysis on.\n * @returns {Object} An object with two keys:\n *   - `nonMalleableSats`: an array of {@link Solution} objects representing the non-malleable sat() expressions.\n *   - `malleableSats`: an array of {@link Solution} objects representing the malleable sat() expressions.\n * @see {@link Solution}\n */\nfunction malleabilityAnalysis(sats) {\n  sats = sats\n    .map(sat => {\n      //Deep copy the objects so that this function is pure\n      //(does not mutate sats)\n      sat = { ...sat };\n      //Extract the signatures used in this witness as an array\n      sat.signatures = sat.asm.split(' ').filter(op => {\n        return op.startsWith('<sig');\n      });\n      //A non-zero solution without a signature is malleable, and a solution\n      //without signature is unacceptable anyway\n      if (sat.signatures.length === 0) {\n        sat.dontuse = true;\n      }\n      //<random_preimage()> is a dissatisfaction for a preimage. It is\n      //interchangable for any 32 bytes random number and thus, it is malleable.\n      if (sat.asm.includes('<random_preimage()>')) {\n        sat.dontuse = true;\n      }\n      return sat;\n    })\n    // Sort sats by weight unit in ascending order\n    .sort((a, b) => witnessWU(a.asm) - witnessWU(b.asm));\n\n  for (const sat of sats) {\n    //For the same nLockTime and nSequence, check if otherSat signatures are a\n    //subset of sat. If this is the case then sat cannot be used.\n    //\"For the same nLockTime and nSequence\" condition is set because signatures\n    //change for each tuple of (nLockTime, nSequence):\n    for (const otherSat of sats) {\n      if (\n        otherSat !== sat &&\n        //for the same nLockTime and nSequence\n        otherSat.nLockTime === sat.nLockTime &&\n        otherSat.nSequence === sat.nSequence &&\n        //is otherSat.signatures equal or a subset of sat.signatures?\n        otherSat.signatures.every(sig => sat.signatures.includes(sig))\n      ) {\n        //sat is for example <sig(key1)> <sig(key2)> and otherSat is <sig(key1)>\n        //otherSat cannot be used because an attacker could use it to create\n        //<sig(key1)\n        sat.dontuse = true;\n      }\n    }\n  }\n\n  const nonMalleableSats = sats.filter(sat => !sat.dontuse);\n  const malleableSats = sats.filter(sat => sat.dontuse);\n\n  //Clean the objects before returning them\n  for (const sats of [nonMalleableSats, malleableSats]) {\n    sats.forEach(sat => {\n      delete sat.signatures;\n      delete sat.dontuse;\n    });\n  }\n\n  return { nonMalleableSats, malleableSats };\n}\n\n/**\n * Determines whether the specified argument of the given miniscript expression\n * is a scalar.\n * @param {string} functionName - the name of the function to check.\n * @param {number} argPosition - the position of the argument to check,\n * starting from 0.\n * @returns {boolean} `true` if the specified argument of the given function is\n * a scalar; `false` otherwise.\n */\nfunction isScalarArg(functionName, argPosition) {\n  switch (functionName) {\n    case 'pk_k':\n    case 'pk_h':\n    case 'older':\n    case 'after':\n    case 'sha256':\n    case 'ripemd160':\n    case 'hash256':\n    case 'hash160':\n    case 'multi':\n      return true;\n    case 'thresh':\n      if (argPosition === 0) return true;\n  }\n  return false;\n}\n\n/**\n * Evaluates a miniscript expression and returns its satisfactions.\n *\n * This function is called recursively to find subexpressions\n * within subexpressions until all the arguments of a subexpression are\n * scalars.\n *\n * @param {string} miniscript - A miniscript expression.\n *\n * @returns {Satisfactions} - The satisfactions.\n */\nconst evaluate = miniscript => {\n  if (typeof miniscript !== 'string')\n    throw new Error('Invalid expression: ' + miniscript);\n  //convert wrappers like this \"sln:\" into \"s:l:n:\"\n  while (miniscript.match(/^[a-z]{2,}:/)) {\n    miniscript = miniscript.replace(/^[a-z]{2,}:/, match =>\n      match.replace(match[0], match[0] + ':')\n    );\n  }\n  //https://bitcoin.sipa.be/miniscript/\n  //The pk, pkh, and and_n fragments and t:, l:, and u: wrappers are syntactic\n  //sugar for other miniscripts:\n  miniscript = miniscript\n    .replace(/^pk\\(/, 'c:pk_k(')\n    .replace(/^pkh\\(/, 'c:pk_h(')\n    .replace(/^and_n\\(.*\\)/, match =>\n      match.replace('and_n', 'andor').replace(/\\)$/, ',0)')\n    )\n    .replace(/^t:(.*)/, match => match.replace('t:', 'and_v(') + ',1)')\n    .replace(/^l:(.*)/, match => match.replace('l:', 'or_i(0,') + ')')\n    .replace(/^u:(.*)/, match => match.replace('u:', 'or_i(') + ',0)');\n  const reFunctionName = String.raw`([^\\(:]*)`;\n  const matchFunctionName = miniscript.match(reFunctionName);\n  if (!matchFunctionName) throw new Error('Invalid expression: ' + miniscript);\n  const functionName = matchFunctionName[0];\n  if (typeof satisfactionsMaker[functionName] !== 'function')\n    throw new Error(functionName + ' not implemented');\n\n  let args;\n  if (miniscript[functionName.length] === '(')\n    args = miniscript.substring(functionName.length + 1, miniscript.length - 1);\n  else if (miniscript[functionName.length] === ':')\n    args = miniscript.substring(functionName.length + 1);\n\n  //the function arguments for satisfactionsMaker[functionName]:\n  //They will be called like using ES6 spread operator:\n  //satisfactionsMaker[functionName](...satisfactionMakerArgs)\n  const satisfactionMakerArgs = [];\n  if (args) {\n    let lastCommaPosition = -1;\n    let argLevel = 0; //argLevel tracks nested parenthesis\n    let argPosition = 0; //argPosition tracks argument order within functionName\n    for (let i = 0; i < args.length; i++) {\n      args[i] === '(' && argLevel++;\n      args[i] === ')' && argLevel--;\n      if (argLevel === 0) {\n        let arg;\n        if (args[i] === ',') {\n          arg = args.substring(lastCommaPosition + 1, i);\n          lastCommaPosition = i;\n        } else if (i === args.length - 1) {\n          arg = args.substring(lastCommaPosition + 1);\n        }\n        if (arg) {\n          if (isScalarArg(functionName, argPosition)) {\n            //This is the case when arg is a scalar value that will be directly\n            //passed to a satisfier maker function (arg is not a nested\n            //miniscript expression).\n            //That is, arg is one of these: a key or a hash or an nLockTime,\n            //nSequence, or the k (number of keys) in thresh/multi.\n            satisfactionMakerArgs.push(arg);\n          } else {\n            //arg is a miniscript expression that has to be further evaluated:\n            satisfactionMakerArgs.push(evaluate(arg));\n          }\n          argPosition++;\n        }\n      }\n    }\n  }\n\n  return satisfactionsMaker[functionName](...satisfactionMakerArgs);\n};\n\n/**\n * Obtains the satisfactions of a miniscript.\n * @function\n *\n * @param {string} miniscript - A miniscript expression.\n * @param {object} [options]\n * @param {string[]} [options.unknowns] - An array with the pieces of information that\n * cannot be used to construct solutions because they are unknown.\n *\n * For example, if a honest user cannot sign with `key`, doesn't know the\n * preimage of `H` and the preimage of `e946029032eae1752e181bebab65de15cf0b93aaac4ee0ffdcfccb683c874d43` then `unknown` must be:\n * ```\n * [\n *   '<sig(key)>',\n *   '<ripemd160_preimage(H)>',\n *   '<sha256_preimage(e946029032eae1752e181bebab65de15cf0b93aaac4ee0ffdcfccb683c874d43)>'\n * ]\n * ```\n *\n * Note that an expression will allways be NOT sane if it is NOT sane at the the\n * miniscript top level as per {@link https://bitcoin.sipa.be/miniscript/\n * Wuille's algorithm}.\n *\n * For example; if a miniscript is NOT sane at the top level because it can be\n * satisfyed using only preimages, then setting preimages as unknowns will not\n * change this behaviour.\n *\n * The reason for this limitation is that the satisfier uses an unmodified\n * version of Wuille's algorithm as an initial precondition before finding\n * solutions. If the miniscript is sane, then unknowns can be set to produce\n * more possible solutions, including preimages, as described above.\n *\n * @param {string[]} [options.knowns] - An array\n * with the only pieces of information that can be used to build satisfactions.\n * This is the complimentary to unknowns. Only `knowns` or `unknowns` must be\n * passed.\n *\n * If neither knowns and unknowns is passed then it is assumed that there are\n * no unknowns, in other words, that all pieces of information are known.\n *\n * @returns {SatisfierResult}\n *\n * @see {@link Solution}\n */\nconst satisfier = (miniscript, options = {}) => {\n  let { unknowns, knowns } = options;\n  const { issane, issanesublevel } = compileMiniscript(miniscript);\n\n  if (!issane) {\n    throw new Error(`Miniscript ${miniscript} is not sane.`);\n  }\n\n  if (typeof unknowns === 'undefined' && typeof knowns === 'undefined') {\n    unknowns = [];\n  } else if (typeof unknowns !== 'undefined' && typeof knowns !== 'undefined') {\n    throw new Error(`Cannot pass both knowns and unknowns`);\n  } else if (\n    (knowns && !Array.isArray(knowns)) ||\n    (unknowns && !Array.isArray(unknowns))\n  ) {\n    throw new Error(`Incorrect types for unknowns / knowns`);\n  }\n\n  const knownSats = [];\n  const unknownSats = [];\n  const sats = evaluate(miniscript).sats || [];\n  sats.map(sat => {\n    if (typeof sat.nSequence === 'undefined') delete sat.nSequence;\n    if (typeof sat.nLockTime === 'undefined') delete sat.nLockTime;\n    //Clean format: 1 consecutive spaces at most, no leading & trailing spaces\n    sat.asm = sat.asm.replace(/  +/g, ' ').trim();\n\n    if (unknowns) {\n      if (unknowns.some(unknown => sat.asm.includes(unknown))) {\n        unknownSats.push(sat);\n      } else {\n        knownSats.push(sat);\n      }\n    } else {\n      const delKnowns = knowns.reduce(\n        (acc, known) => acc.replace(known, ''),\n        sat.asm\n      );\n      if (\n        delKnowns.match(\n          /<sig\\(|<sha256_preimage\\(|<hash256_preimage\\(|<ripemd160_preimage\\(|<hash160_preimage\\(/\n        )\n      ) {\n        //Even thought all known pieces of information are removed, there are\n        //still other pieces of info needed. Thus, this sat is unkown.\n        unknownSats.push(sat);\n      } else {\n        knownSats.push(sat);\n      }\n    }\n  });\n\n  return { ...malleabilityAnalysis(knownSats), unknownSats };\n};\n\nexports.compileMiniscript = compileMiniscript;\nexports.compilePolicy = compilePolicy;\nexports.satisfier = satisfier;\n{\n  \"name\": \"@bitcoinerlab/miniscript\",\n  \"author\": \"Jose-Luis Landabaso <landabaso@gmail.com>\",\n  \"license\": \"MIT\",\n  \"keywords\": [\n    \"miniscript\",\n    \"satisfier\",\n    \"bitcoin\",\n    \"policy\",\n    \"asm\",\n    \"descriptors\"\n  ],\n  \"homepage\": \"https://bitcoinerlab.com/modules/miniscript\",\n  \"version\": \"1.4.3\",\n  \"description\": \"Bitcoin Miniscript, a high-level language for describing Bitcoin spending conditions. It includes a Policy and Miniscript compiler, as well as a novel Satisfier for generating expressive witness scripts.\",\n  \"main\": \"dist/index.js\",\n  \"types\": \"types/index.d.ts\",\n  \"scripts\": {\n    \"build\": \"rollup -c --bundleConfigAsCjs\",\n    \"build:prod\": \"NODE_ENV=production rollup -c --bundleConfigAsCjs\",\n    \"prepublishOnly\": \"npm test\",\n    \"test\": \"make clean && make && npm run build:prod && jest\",\n    \"example\": \"node ./example.js\",\n    \"docs\": \"typedoc --options ./node_modules/@bitcoinerlab/configs/js_typedoc.json\",\n    \"webdocs\": \"typedoc --options ./node_modules/@bitcoinerlab/configs/js_webtypedoc.json\"\n  },\n  \"COMMENT_babel\": \"Babel plugins are are only needed for the jest testing environment. Jest needs to use commonjs. Also, jest cannot handle ESM converted code, since it uses 'import.meta.url'. See src/bindings.js. babel-plugin-transform-import-meta fixes it.\",\n  \"babel\": {\n    \"env\": {\n      \"test\": {\n        \"plugins\": [\n          \"@babel/plugin-transform-modules-commonjs\",\n          \"babel-plugin-transform-import-meta\"\n        ]\n      }\n    }\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/bitcoinerlab/miniscript.git\"\n  },\n  \"devDependencies\": {\n    \"@babel/plugin-transform-modules-commonjs\": \"^7.19.6\",\n    \"@bitcoinerlab/configs\": \"^2.0.0\",\n    \"@rollup/plugin-commonjs\": \"^29.0.0\",\n    \"babel-plugin-transform-import-meta\": \"^2.2.0\",\n    \"rollup\": \"^3.29.5\"\n  },\n  \"dependencies\": {\n    \"bip68\": \"^1.0.4\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinerlab/miniscript/issues\"\n  }\n}\n'use strict';\n\nvar secp256k1 = require('@noble/curves/secp256k1');\nvar mod = require('@noble/curves/abstract/modular');\nvar utils = require('@noble/curves/abstract/utils');\n\nfunction _interopNamespaceDefault(e) {\n  var n = Object.create(null);\n  if (e) {\n    Object.keys(e).forEach(function (k) {\n      if (k !== 'default') {\n        var d = Object.getOwnPropertyDescriptor(e, k);\n        Object.defineProperty(n, k, d.get ? d : {\n          enumerable: true,\n          get: function () { return e[k]; }\n        });\n      }\n    });\n  }\n  n.default = e;\n  return Object.freeze(n);\n}\n\nvar mod__namespace = /*#__PURE__*/_interopNamespaceDefault(mod);\nvar utils__namespace = /*#__PURE__*/_interopNamespaceDefault(utils);\n\n/*\n * Copyright (c) 2023 Jose-Luis Landabaso\n * Distributed under the MIT software license.\n *\n * This file includes code from the following sources:\n *  * Paul Miller's @noble/secp256k1 (specifically, the privateAdd,\n *    privateNegate, pointAddScalar, and pointMultiply functions).\n *  * Some pieces from tiny-secp256k1\n *    (https://github.com/bitcoinjs/tiny-secp256k1)\n *  * It also uses code from BitGo's BitGoJS library\n *    (https://github.com/BitGo/BitGoJS)\n *\n * This package's tests are based on modified versions of tests from\n * tiny-secp256k1 (https://github.com/bitcoinjs/tiny-secp256k1/tests).\n */\n\nconst Point = secp256k1.secp256k1.ProjectivePoint;\n\nconst THROW_BAD_PRIVATE = \"Expected Private\";\nconst THROW_BAD_POINT = \"Expected Point\";\nconst THROW_BAD_TWEAK = \"Expected Tweak\";\nconst THROW_BAD_HASH = \"Expected Hash\";\nconst THROW_BAD_SIGNATURE = \"Expected Signature\";\nconst THROW_BAD_EXTRA_DATA = \"Expected Extra Data (32 bytes)\";\nconst THROW_BAD_SCALAR = \"Expected Scalar\";\nconst THROW_BAD_RECOVERY_ID = \"Bad Recovery Id\";\n\nconst HASH_SIZE = 32;\nconst TWEAK_SIZE = 32;\nconst BN32_N = new Uint8Array([\n  255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n  254, 186, 174, 220, 230, 175, 72, 160, 59, 191, 210, 94, 140, 208, 54, 65, 65,\n]);\nconst EXTRA_DATA_SIZE = 32;\nconst BN32_ZERO = new Uint8Array(32);\nconst BN32_P_MINUS_N = new Uint8Array([\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 69, 81, 35, 25, 80, 183, 95,\n  196, 64, 45, 161, 114, 47, 201, 186, 238,\n]);\nconst _1n = BigInt(1);\n\nfunction isUint8Array(value) {\n  return value instanceof Uint8Array;\n}\n\nfunction cmpBN32(data1, data2) {\n  for (let i = 0; i < 32; ++i) {\n    if (data1[i] !== data2[i]) {\n      return data1[i] < data2[i] ? -1 : 1;\n    }\n  }\n  return 0;\n}\n\nfunction isZero(x) {\n  return cmpBN32(x, BN32_ZERO) === 0;\n}\n\nfunction isTweak(tweak) {\n  if (\n    !(tweak instanceof Uint8Array) ||\n    tweak.length !== TWEAK_SIZE ||\n    cmpBN32(tweak, BN32_N) >= 0\n  ) {\n    return false;\n  }\n  return true;\n}\n\nfunction isSignature(signature) {\n  return (\n    signature instanceof Uint8Array &&\n    signature.length === 64 &&\n    cmpBN32(signature.subarray(0, 32), BN32_N) < 0 &&\n    cmpBN32(signature.subarray(32, 64), BN32_N) < 0\n  );\n}\n\nfunction isSigrLessThanPMinusN(signature) {\n  return (\n    isUint8Array(signature) &&\n    signature.length === 64 &&\n    cmpBN32(signature.subarray(0, 32), BN32_P_MINUS_N) < 0\n  );\n}\n\nfunction isSignatureNonzeroRS(signature) {\n  return !(\n    isZero(signature.subarray(0, 32)) || isZero(signature.subarray(32, 64))\n  );\n}\n\nfunction isHash(h) {\n  return h instanceof Uint8Array && h.length === HASH_SIZE;\n}\n\nfunction isExtraData(e) {\n  return (\n    e === undefined || (e instanceof Uint8Array && e.length === EXTRA_DATA_SIZE)\n  );\n}\n\nfunction normalizeScalar(scalar) {\n  let num;\n  if (typeof scalar === \"bigint\") {\n    num = scalar;\n  } else if (\n    typeof scalar === \"number\" &&\n    Number.isSafeInteger(scalar) &&\n    scalar >= 0\n  ) {\n    num = BigInt(scalar);\n  } else if (typeof scalar === \"string\") {\n    if (scalar.length !== 64)\n      throw new Error(\"Expected 32 bytes of private scalar\");\n    num = utils__namespace.hexToNumber(scalar);\n  } else if (scalar instanceof Uint8Array) {\n    if (scalar.length !== 32)\n      throw new Error(\"Expected 32 bytes of private scalar\");\n    num = utils__namespace.bytesToNumberBE(scalar);\n  } else {\n    throw new TypeError(\"Expected valid private scalar\");\n  }\n  if (num < 0) throw new Error(\"Expected private scalar >= 0\");\n  return num;\n}\n\nfunction normalizePrivateKey(privateKey) {\n  return secp256k1.secp256k1.utils.normPrivateKeyToScalar(privateKey);\n}\n\nfunction _privateAdd(privateKey, tweak) {\n  const p = normalizePrivateKey(privateKey);\n  const t = normalizeScalar(tweak);\n  const add = utils__namespace.numberToBytesBE(mod__namespace.mod(p + t, secp256k1.secp256k1.CURVE.n), 32);\n  return secp256k1.secp256k1.utils.isValidPrivateKey(add) ? add : null;\n}\n\nfunction _privateSub(privateKey, tweak) {\n  const p = normalizePrivateKey(privateKey);\n  const t = normalizeScalar(tweak);\n  const sub = utils__namespace.numberToBytesBE(mod__namespace.mod(p - t, secp256k1.secp256k1.CURVE.n), 32);\n  return secp256k1.secp256k1.utils.isValidPrivateKey(sub) ? sub : null;\n}\n\nfunction _privateNegate(privateKey) {\n  const p = normalizePrivateKey(privateKey);\n  const not = utils__namespace.numberToBytesBE(secp256k1.secp256k1.CURVE.n - p, 32);\n  return secp256k1.secp256k1.utils.isValidPrivateKey(not) ? not : null;\n}\n\nfunction _pointAddScalar(p, tweak, isCompressed) {\n  const P = fromHex(p);\n  const t = normalizeScalar(tweak);\n  // multiplyAndAddUnsafe(P, scalar, 1) = P + scalar*G\n  const Q = Point.BASE.multiplyAndAddUnsafe(P, t, _1n);\n  if (!Q) throw new Error(\"Tweaked point at infinity\");\n  return Q.toRawBytes(isCompressed);\n}\n\nfunction _pointMultiply(p, tweak, isCompressed) {\n  const P = fromHex(p);\n  const h = typeof tweak === \"string\" ? tweak : utils__namespace.bytesToHex(tweak);\n  const t = utils__namespace.hexToNumber(h);\n  return P.multiply(t).toRawBytes(isCompressed);\n}\n\nfunction assumeCompression(compressed, p) {\n  if (compressed === undefined) {\n    return p !== undefined ? isPointCompressed(p) : true;\n  }\n  return !!compressed;\n}\n\nfunction throwToNull(fn) {\n  try {\n    return fn();\n  } catch (e) {\n    return null;\n  }\n}\n\nfunction fromXOnly(bytes) {\n  return secp256k1.schnorr.utils.lift_x(utils__namespace.bytesToNumberBE(bytes));\n}\n\nfunction fromHex(bytes) {\n  return bytes.length === 32 ? fromXOnly(bytes) : Point.fromHex(bytes);\n}\n\nfunction _isPoint(p, xOnly) {\n  if ((p.length === 32) !== xOnly) return false;\n  try {\n    if (xOnly) return !!fromXOnly(p);\n    else return !!Point.fromHex(p);\n  } catch (e) {\n    return false;\n  }\n}\n\nfunction isPoint(p) {\n  return _isPoint(p, false);\n}\n\nfunction isPointCompressed(p) {\n  const PUBLIC_KEY_COMPRESSED_SIZE = 33;\n  return _isPoint(p, false) && p.length === PUBLIC_KEY_COMPRESSED_SIZE;\n}\n\nfunction isPrivate(d) {\n  return secp256k1.secp256k1.utils.isValidPrivateKey(d);\n}\n\nfunction isXOnlyPoint(p) {\n  return _isPoint(p, true);\n}\n\nfunction xOnlyPointAddTweak(p, tweak) {\n  if (!isXOnlyPoint(p)) {\n    throw new Error(THROW_BAD_POINT);\n  }\n  if (!isTweak(tweak)) {\n    throw new Error(THROW_BAD_TWEAK);\n  }\n  return throwToNull(() => {\n    const P = _pointAddScalar(p, tweak, true);\n    const parity = P[0] % 2 === 1 ? 1 : 0;\n    return { parity, xOnlyPubkey: P.slice(1) };\n  });\n}\n\nfunction xOnlyPointFromPoint(p) {\n  if (!isPoint(p)) {\n    throw new Error(THROW_BAD_POINT);\n  }\n  return p.slice(1, 33);\n}\n\nfunction pointFromScalar(sk, compressed) {\n  if (!isPrivate(sk)) {\n    throw new Error(THROW_BAD_PRIVATE);\n  }\n  return throwToNull(() =>\n    secp256k1.secp256k1.getPublicKey(sk, assumeCompression(compressed)),\n  );\n}\n\nfunction xOnlyPointFromScalar(d) {\n  if (!isPrivate(d)) {\n    throw new Error(THROW_BAD_PRIVATE);\n  }\n  return xOnlyPointFromPoint(pointFromScalar(d));\n}\n\nfunction pointCompress(p, compressed) {\n  if (!isPoint(p)) {\n    throw new Error(THROW_BAD_POINT);\n  }\n  return fromHex(p).toRawBytes(assumeCompression(compressed, p));\n}\n\nfunction pointMultiply(a, tweak, compressed) {\n  if (!isPoint(a)) {\n    throw new Error(THROW_BAD_POINT);\n  }\n  if (!isTweak(tweak)) {\n    throw new Error(THROW_BAD_TWEAK);\n  }\n  return throwToNull(() =>\n    _pointMultiply(a, tweak, assumeCompression(compressed, a)),\n  );\n}\n\nfunction pointAdd(a, b, compressed) {\n  if (!isPoint(a) || !isPoint(b)) {\n    throw new Error(THROW_BAD_POINT);\n  }\n  return throwToNull(() => {\n    const A = fromHex(a);\n    const B = fromHex(b);\n    if (A.equals(B.negate())) {\n      return null;\n    } else {\n      return A.add(B).toRawBytes(assumeCompression(compressed, a));\n    }\n  });\n}\n\nfunction pointAddScalar(p, tweak, compressed) {\n  if (!isPoint(p)) {\n    throw new Error(THROW_BAD_POINT);\n  }\n  if (!isTweak(tweak)) {\n    throw new Error(THROW_BAD_TWEAK);\n  }\n  return throwToNull(() =>\n    _pointAddScalar(p, tweak, assumeCompression(compressed, p)),\n  );\n}\n\nfunction privateAdd(d, tweak) {\n  if (!isPrivate(d)) {\n    throw new Error(THROW_BAD_PRIVATE);\n  }\n  if (!isTweak(tweak)) {\n    throw new Error(THROW_BAD_TWEAK);\n  }\n  return throwToNull(() => _privateAdd(d, tweak));\n}\n\nfunction privateSub(d, tweak) {\n  if (!isPrivate(d)) {\n    throw new Error(THROW_BAD_PRIVATE);\n  }\n  if (!isTweak(tweak)) {\n    throw new Error(THROW_BAD_TWEAK);\n  }\n  return throwToNull(() => _privateSub(d, tweak));\n}\n\nfunction privateNegate(d) {\n  if (!isPrivate(d)) {\n    throw new Error(THROW_BAD_PRIVATE);\n  }\n  return _privateNegate(d);\n}\n\nfunction sign(h, d, e) {\n  if (!isPrivate(d)) {\n    throw new Error(THROW_BAD_PRIVATE);\n  }\n  if (!isHash(h)) {\n    throw new Error(THROW_BAD_SCALAR);\n  }\n  if (!isExtraData(e)) {\n    throw new Error(THROW_BAD_EXTRA_DATA);\n  }\n  return secp256k1.secp256k1.sign(h, d, { extraEntropy: e }).toCompactRawBytes();\n}\n\nfunction signRecoverable(h, d, e) {\n  if (!isPrivate(d)) {\n    throw new Error(THROW_BAD_PRIVATE);\n  }\n  if (!isHash(h)) {\n    throw new Error(THROW_BAD_SCALAR);\n  }\n  if (!isExtraData(e)) {\n    throw new Error(THROW_BAD_EXTRA_DATA);\n  }\n  const sig = secp256k1.secp256k1.sign(h, d, { extraEntropy: e });\n  return {\n    signature: sig.toCompactRawBytes(),\n    recoveryId: sig.recovery,\n  };\n}\n\nfunction signSchnorr(h, d, e) {\n  if (!isPrivate(d)) {\n    throw new Error(THROW_BAD_PRIVATE);\n  }\n  if (!isHash(h)) {\n    throw new Error(THROW_BAD_SCALAR);\n  }\n  if (!isExtraData(e)) {\n    throw new Error(THROW_BAD_EXTRA_DATA);\n  }\n  return secp256k1.schnorr.sign(h, d, e);\n}\n\nfunction recover(h, signature, recoveryId, compressed) {\n  if (!isHash(h)) {\n    throw new Error(THROW_BAD_HASH);\n  }\n\n  if (!isSignature(signature) || !isSignatureNonzeroRS(signature)) {\n    throw new Error(THROW_BAD_SIGNATURE);\n  }\n\n  if (recoveryId & 2) {\n    if (!isSigrLessThanPMinusN(signature))\n      throw new Error(THROW_BAD_RECOVERY_ID);\n  }\n  if (!isXOnlyPoint(signature.subarray(0, 32))) {\n    throw new Error(THROW_BAD_SIGNATURE);\n  }\n\n  const s =\n    secp256k1.secp256k1.Signature.fromCompact(signature).addRecoveryBit(recoveryId);\n  const Q = s.recoverPublicKey(h);\n  if (!Q) throw new Error(THROW_BAD_SIGNATURE);\n  return Q.toRawBytes(assumeCompression(compressed));\n}\n\nfunction verify(h, Q, signature, strict) {\n  if (!isPoint(Q)) {\n    throw new Error(THROW_BAD_POINT);\n  }\n  if (!isSignature(signature)) {\n    throw new Error(THROW_BAD_SIGNATURE);\n  }\n  if (!isHash(h)) {\n    throw new Error(THROW_BAD_SCALAR);\n  }\n  return secp256k1.secp256k1.verify(signature, h, Q, { lowS: strict });\n}\n\nfunction verifySchnorr(h, Q, signature) {\n  if (!isXOnlyPoint(Q)) {\n    throw new Error(THROW_BAD_POINT);\n  }\n  if (!isSignature(signature)) {\n    throw new Error(THROW_BAD_SIGNATURE);\n  }\n  if (!isHash(h)) {\n    throw new Error(THROW_BAD_SCALAR);\n  }\n  return secp256k1.schnorr.verify(signature, h, Q);\n}\n\nexports.isPoint = isPoint;\nexports.isPointCompressed = isPointCompressed;\nexports.isPrivate = isPrivate;\nexports.isXOnlyPoint = isXOnlyPoint;\nexports.pointAdd = pointAdd;\nexports.pointAddScalar = pointAddScalar;\nexports.pointCompress = pointCompress;\nexports.pointFromScalar = pointFromScalar;\nexports.pointMultiply = pointMultiply;\nexports.privateAdd = privateAdd;\nexports.privateNegate = privateNegate;\nexports.privateSub = privateSub;\nexports.recover = recover;\nexports.sign = sign;\nexports.signRecoverable = signRecoverable;\nexports.signSchnorr = signSchnorr;\nexports.verify = verify;\nexports.verifySchnorr = verifySchnorr;\nexports.xOnlyPointAddTweak = xOnlyPointAddTweak;\nexports.xOnlyPointFromPoint = xOnlyPointFromPoint;\nexports.xOnlyPointFromScalar = xOnlyPointFromScalar;\n{\n  \"name\": \"@bitcoinerlab/secp256k1\",\n  \"homepage\": \"https://bitcoinerlab.com/secp256k1\",\n  \"version\": \"1.2.0\",\n  \"description\": \"A library for performing elliptic curve operations on the secp256k1 curve. It is designed to integrate into the BitcoinJS & BitcoinerLAB ecosystems and uses the audited noble-secp256k1 library. It is compatible with environments that do not support WASM, such as React Native.\",\n  \"main\": \"dist/index.js\",\n  \"types\": \"types/index.d.ts\",\n  \"scripts\": {\n    \"build\": \"rollup -c --bundleConfigAsCjs\",\n    \"prepublishOnly\": \"npm run build && npm test\",\n    \"test\": \"npx babel-node --plugins @babel/plugin-transform-modules-commonjs ./test/index.js | npx tap-summary\",\n    \"example\": \"npx babel-node --plugins @babel/plugin-transform-modules-commonjs ./example.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/bitcoinerlab/secp256k1.git\"\n  },\n  \"keywords\": [\n    \"secp256k1\",\n    \"noble\",\n    \"bitcoinjs\",\n    \"ecpair\",\n    \"bip32\",\n    \"factory\",\n    \"no-WASM\",\n    \"pure-Javascript\"\n  ],\n  \"author\": \"Jose-Luis Landabaso\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinerlab/secp256k1/issues\"\n  },\n  \"devDependencies\": {\n    \"@babel/node\": \"^7.20.7\",\n    \"@babel/plugin-transform-modules-commonjs\": \"^7.20.11\",\n    \"bip32\": \"^3.1.0\",\n    \"ecpair\": \"^2.1.0\",\n    \"rollup\": \"^3.9.1\",\n    \"rollup-plugin-commonjs\": \"^10.1.0\",\n    \"tap-summary\": \"^4.0.0\",\n    \"tape\": \"^5.6.1\"\n  },\n  \"dependencies\": {\n    \"@noble/curves\": \"^1.7.0\"\n  }\n}\nconst { Pull, Push, HEADERBYTES, KEYBYTES, ABYTES } = require('sodium-secretstream')\nconst sodium = require('sodium-universal')\nconst crypto = require('hypercore-crypto')\nconst { Duplex, Writable, getStreamError } = require('streamx')\nconst b4a = require('b4a')\nconst Timeout = require('timeout-refresh')\nconst unslab = require('unslab')\nconst Bridge = require('./lib/bridge')\nconst Handshake = require('./lib/handshake')\n\nconst IDHEADERBYTES = HEADERBYTES + 32\nconst [NS_INITIATOR, NS_RESPONDER, NS_SEND] = crypto.namespace('hyperswarm/secret-stream', 3)\nconst MAX_ATOMIC_WRITE = 256 * 256 * 256 - 1\n\nmodule.exports = class NoiseSecretStream extends Duplex {\n  constructor(isInitiator, rawStream, opts = {}) {\n    super({ mapWritable: toBuffer })\n\n    if (typeof isInitiator !== 'boolean') {\n      throw new Error('isInitiator should be a boolean')\n    }\n\n    this.noiseStream = this\n    this.isInitiator = isInitiator\n    this.rawStream = null\n\n    this.publicKey = opts.publicKey || null\n    this.remotePublicKey = opts.remotePublicKey || null\n    this.handshakeHash = null\n    this.connected = false\n    this.keepAlive = opts.keepAlive || 0\n    this.timeout = 0\n    this.enableSend = opts.enableSend !== false\n\n    // pointer for upstream to set data here if they want\n    this.userData = null\n\n    let openedDone = null\n    this.opened = new Promise((resolve) => {\n      openedDone = resolve\n    })\n\n    this.rawBytesWritten = 0\n    this.rawBytesRead = 0\n\n    // metadata used by 'hyperdht'\n    this.relay = null\n    this.puncher = null\n\n    // unwrapped raw stream\n    this._rawStream = null\n\n    // handshake state\n    this._handshake = null\n    this._handshakePattern = opts.pattern || null\n    this._handshakeDone = null\n\n    // message parsing state\n    this._state = 0\n    this._len = 0\n    this._tmp = 1\n    this._message = null\n\n    this._openedDone = openedDone\n    this._startDone = null\n    this._drainDone = null\n    this._outgoingPlain = null\n    this._outgoingWrapped = null\n    this._utp = null\n    this._setup = true\n    this._ended = 2\n    this._encrypt = null\n    this._decrypt = null\n    this._timeoutTimer = null\n    this._keepAliveTimer = null\n    this._sendState = null\n\n    if (opts.autoStart !== false) this.start(rawStream, opts)\n\n    // wiggle it to trigger open immediately (TODO add streamx option for this)\n    this.resume()\n    this.pause()\n  }\n\n  static keyPair(seed) {\n    return Handshake.keyPair(seed)\n  }\n\n  static id(handshakeHash, isInitiator, id) {\n    return streamId(handshakeHash, isInitiator, id)\n  }\n\n  setTimeout(ms) {\n    if (!ms) ms = 0\n\n    this._clearTimeout()\n    this.timeout = ms\n\n    if (!ms || this.rawStream === null) return\n\n    this._timeoutTimer = Timeout.once(ms, destroyTimeout, this)\n    this._timeoutTimer.unref()\n  }\n\n  setKeepAlive(ms) {\n    if (!ms) ms = 0\n\n    this._clearKeepAlive()\n\n    this.keepAlive = ms\n\n    if (!ms || this.rawStream === null) return\n\n    this._keepAliveTimer = Timeout.on(ms, sendKeepAlive, this)\n    this._keepAliveTimer.unref()\n  }\n\n  sendKeepAlive() {\n    const empty = this.alloc(0)\n    this.write(empty)\n  }\n\n  start(rawStream, opts = {}) {\n    if (rawStream) {\n      this.rawStream = rawStream\n      this._rawStream = rawStream\n      if (typeof this.rawStream.setContentSize === 'function') {\n        this._utp = rawStream\n      }\n    } else {\n      this.rawStream = new Bridge(this)\n      this._rawStream = this.rawStream.reverse\n    }\n\n    this.rawStream.on('error', this._onrawerror.bind(this))\n    this.rawStream.on('close', this._onrawclose.bind(this))\n\n    this._startHandshake(opts.handshake, opts.keyPair || null)\n    this._continueOpen(null)\n\n    if (this.destroying) return\n\n    if (opts.data) this._onrawdata(opts.data)\n    if (opts.ended) this._onrawend()\n\n    if (this.keepAlive > 0 && this._keepAliveTimer === null) {\n      this.setKeepAlive(this.keepAlive)\n    }\n\n    if (this.timeout > 0 && this._timeoutTimer === null) {\n      this.setTimeout(this.timeout)\n    }\n  }\n\n  async flush() {\n    if ((await this.opened) === false) return false\n    if ((await Writable.drained(this)) === false) return false\n    if (this.destroying) return false\n\n    if (this.rawStream !== null && this.rawStream.flush) {\n      return await this.rawStream.flush()\n    }\n\n    return true\n  }\n\n  _continueOpen(err) {\n    if (err) this.destroy(err)\n    if (this._startDone === null) return\n    const done = this._startDone\n    this._startDone = null\n    this._open(done)\n  }\n\n  _onkeypairpromise(p) {\n    const self = this\n    const cont = this._continueOpen.bind(this)\n\n    p.then(onkeypair, cont)\n\n    function onkeypair(kp) {\n      self._onkeypair(kp)\n      cont(null)\n    }\n  }\n\n  _onkeypair(keyPair) {\n    const pattern = this._handshakePattern || 'XX'\n    const remotePublicKey = this.remotePublicKey\n\n    this._handshake = new Handshake(this.isInitiator, keyPair, remotePublicKey, pattern)\n    this.publicKey = this._handshake.keyPair.publicKey\n  }\n\n  _startHandshake(handshake, keyPair) {\n    if (handshake) {\n      const { tx, rx, hash, publicKey, remotePublicKey } = handshake\n      this._setupSecretStream(tx, rx, hash, publicKey, remotePublicKey)\n      return\n    }\n\n    if (!keyPair) keyPair = Handshake.keyPair()\n\n    if (typeof keyPair.then === 'function') {\n      this._onkeypairpromise(keyPair)\n    } else {\n      this._onkeypair(keyPair)\n    }\n  }\n\n  _onrawerror(err) {\n    this.destroy(err)\n  }\n\n  _onrawclose() {\n    if (this._ended !== 0) this.destroy()\n  }\n\n  _onrawdata(data) {\n    let offset = 0\n\n    if (this._timeoutTimer !== null) {\n      this._timeoutTimer.refresh()\n    }\n\n    do {\n      switch (this._state) {\n        case 0: {\n          while (this._tmp !== 0x1000000 && offset < data.byteLength) {\n            const v = data[offset++]\n            this._len += this._tmp * v\n            this._tmp *= 256\n          }\n\n          if (this._tmp === 0x1000000) {\n            this._tmp = 0\n            this._state = 1\n            const unprocessed = data.byteLength - offset\n            if (unprocessed < this._len && this._utp !== null)\n              this._utp.setContentSize(this._len - unprocessed)\n          }\n\n          break\n        }\n\n        case 1: {\n          const missing = this._len - this._tmp\n          const end = missing + offset\n\n          if (this._message === null && end <= data.byteLength) {\n            this._message = data.subarray(offset, end)\n            offset += missing\n            this._incoming()\n            break\n          }\n\n          const unprocessed = data.byteLength - offset\n\n          if (this._message === null) {\n            this._message = b4a.allocUnsafe(this._len)\n          }\n\n          b4a.copy(data, this._message, this._tmp, offset)\n          this._tmp += unprocessed\n\n          if (end <= data.byteLength) {\n            offset += missing\n            this._incoming()\n          } else {\n            offset += unprocessed\n          }\n\n          break\n        }\n      }\n    } while (offset < data.byteLength && !this.destroying)\n  }\n\n  _onrawend() {\n    this._ended--\n    this.push(null)\n  }\n\n  _onrawdrain() {\n    const drain = this._drainDone\n    if (drain === null) return\n    this._drainDone = null\n    drain()\n  }\n\n  _read(cb) {\n    this.rawStream.resume()\n    cb(null)\n  }\n\n  _incoming() {\n    const message = this._message\n\n    this._state = 0\n    this._len = 0\n    this._tmp = 1\n    this._message = null\n\n    if (this._setup === true) {\n      if (this._handshake) {\n        this._onhandshakert(this._handshake.recv(message))\n      } else {\n        if (message.byteLength !== IDHEADERBYTES) {\n          this.destroy(new Error('Invalid header message received'))\n          return\n        }\n\n        const remoteId = message.subarray(0, 32)\n        const expectedId = streamId(this.handshakeHash, !this.isInitiator)\n        const header = message.subarray(32)\n\n        if (!b4a.equals(expectedId, remoteId)) {\n          this.destroy(new Error('Invalid header received'))\n          return\n        }\n\n        this._decrypt.init(header)\n        this._setup = false // setup is now done\n      }\n      return\n    }\n\n    if (message.byteLength < ABYTES) {\n      this.destroy(new Error('Invalid message received'))\n      return\n    }\n\n    this.rawBytesRead += message.byteLength\n\n    const plain = message.subarray(1, message.byteLength - ABYTES + 1)\n\n    try {\n      this._decrypt.next(message, plain)\n    } catch (err) {\n      this.destroy(err)\n      return\n    }\n\n    // If keep alive is selective, eat the empty buffers (ie assume the other side has it enabled also)\n    if (plain.byteLength === 0 && this.keepAlive !== 0) return\n\n    if (this.push(plain) === false) {\n      this.rawStream.pause()\n    }\n  }\n\n  _onhandshakert(h) {\n    if (this._handshakeDone === null) return\n\n    if (h !== null) {\n      if (h.data) this._rawStream.write(h.data)\n      if (!h.tx) return\n    }\n\n    const done = this._handshakeDone\n    const publicKey = this._handshake.keyPair.publicKey\n\n    this._handshakeDone = null\n    this._handshake = null\n\n    if (h === null) return done(new Error('Noise handshake failed'))\n\n    this._setupSecretStream(h.tx, h.rx, h.hash, publicKey, h.remotePublicKey)\n    this._resolveOpened(true)\n    done(null)\n  }\n\n  _setupSecretStream(tx, rx, handshakeHash, publicKey, remotePublicKey) {\n    const buf = b4a.allocUnsafeSlow(3 + IDHEADERBYTES)\n    writeUint24le(IDHEADERBYTES, buf)\n\n    this._encrypt = new Push(unslab(tx.subarray(0, KEYBYTES)), undefined, buf.subarray(3 + 32))\n    this._decrypt = new Pull(unslab(rx.subarray(0, KEYBYTES)))\n\n    this.publicKey = publicKey\n    this.remotePublicKey = remotePublicKey\n    this.handshakeHash = handshakeHash\n\n    const id = buf.subarray(3, 3 + 32)\n    streamId(handshakeHash, this.isInitiator, id)\n\n    // initialize secretbox state for unordered messages\n    this._setupSecretSend(handshakeHash)\n\n    this.emit('handshake')\n    // if rawStream is a bridge, also emit it there\n    if (this.rawStream !== this._rawStream) this.rawStream.emit('handshake')\n\n    if (this.destroying) return\n\n    this._rawStream.write(buf)\n  }\n\n  _setupSecretSend(handshakeHash) {\n    this._sendState = b4a.allocUnsafeSlow(32 + 32 + 8 + 8)\n    const encrypt = this._sendState.subarray(0, 32) // secrets\n    const decrypt = this._sendState.subarray(32, 64)\n    const counter = this._sendState.subarray(64, 72) // nonce\n    const initial = this._sendState.subarray(72)\n\n    const inputs = this.isInitiator\n      ? [\n          [NS_INITIATOR, NS_SEND],\n          [NS_RESPONDER, NS_SEND]\n        ]\n      : [\n          [NS_RESPONDER, NS_SEND],\n          [NS_INITIATOR, NS_SEND]\n        ]\n\n    sodium.crypto_generichash_batch(encrypt, inputs[0], handshakeHash)\n    sodium.crypto_generichash_batch(decrypt, inputs[1], handshakeHash)\n\n    sodium.randombytes_buf(initial)\n    counter.set(initial)\n  }\n\n  _open(cb) {\n    // no autostart or no handshake yet\n    if (this._rawStream === null || (this._handshake === null && this._encrypt === null)) {\n      this._startDone = cb\n      return\n    }\n\n    this._rawStream.on('data', this._onrawdata.bind(this))\n    this._rawStream.on('end', this._onrawend.bind(this))\n    this._rawStream.on('drain', this._onrawdrain.bind(this))\n\n    if (this.enableSend) this._rawStream.on('message', this._onmessage.bind(this))\n\n    if (this._encrypt !== null) {\n      this._resolveOpened(true)\n      return cb(null)\n    }\n\n    this._handshakeDone = cb\n\n    if (this.isInitiator) this._onhandshakert(this._handshake.send())\n  }\n\n  _predestroy() {\n    if (this.rawStream) {\n      const error = getStreamError(this)\n      this.rawStream.destroy(error)\n    }\n\n    if (this._startDone !== null) {\n      const done = this._startDone\n      this._startDone = null\n      done(new Error('Stream destroyed'))\n    }\n\n    if (this._handshakeDone !== null) {\n      const done = this._handshakeDone\n      this._handshakeDone = null\n      done(new Error('Stream destroyed'))\n    }\n\n    if (this._drainDone !== null) {\n      const done = this._drainDone\n      this._drainDone = null\n      done(new Error('Stream destroyed'))\n    }\n  }\n\n  _write(data, cb) {\n    let wrapped = this._outgoingWrapped\n\n    if (data !== this._outgoingPlain) {\n      wrapped = b4a.allocUnsafe(data.byteLength + 3 + ABYTES)\n      wrapped.set(data, 4)\n    } else {\n      this._outgoingWrapped = this._outgoingPlain = null\n    }\n\n    if (wrapped.byteLength - 3 > MAX_ATOMIC_WRITE) {\n      return cb(\n        new Error(\n          'Message is too large for an atomic write. Max size is ' + MAX_ATOMIC_WRITE + ' bytes.'\n        )\n      )\n    }\n    this.rawBytesWritten += wrapped.byteLength\n\n    writeUint24le(wrapped.byteLength - 3, wrapped)\n    // offset 4 so we can do it in-place\n    this._encrypt.next(wrapped.subarray(4, 4 + data.byteLength), wrapped.subarray(3))\n\n    if (this._keepAliveTimer !== null) this._keepAliveTimer.refresh()\n\n    if (this._rawStream.write(wrapped) === false) {\n      this._drainDone = cb\n    } else {\n      cb(null)\n    }\n  }\n\n  _final(cb) {\n    this._clearKeepAlive()\n    this._ended--\n    this._rawStream.end()\n    cb(null)\n  }\n\n  _resolveOpened(val) {\n    if (this._openedDone === null) return\n    const opened = this._openedDone\n    this._openedDone = null\n    opened(val)\n    if (!val) return\n    this.connected = true\n    this.emit('connect')\n  }\n\n  _clearTimeout() {\n    if (this._timeoutTimer === null) return\n    this._timeoutTimer.destroy()\n    this._timeoutTimer = null\n    this.timeout = 0\n  }\n\n  _clearKeepAlive() {\n    if (this._keepAliveTimer === null) return\n    this._keepAliveTimer.destroy()\n    this._keepAliveTimer = null\n    this.keepAlive = 0\n  }\n\n  _destroy(cb) {\n    this._clearKeepAlive()\n    this._clearTimeout()\n    this._resolveOpened(false)\n    cb(null)\n  }\n\n  _boxMessage(buffer) {\n    const MB = sodium.crypto_secretbox_MACBYTES // 16\n    const NB = sodium.crypto_secretbox_NONCEBYTES // 24\n\n    const counter = this._sendState.subarray(64, 72)\n    sodium.sodium_increment(counter)\n    if (b4a.equals(counter, this._sendState.subarray(72))) {\n      this.destroy(new Error('udp send nonce exchausted'))\n      return\n    }\n\n    const secret = this._sendState.subarray(0, 32)\n    const envelope = b4a.allocUnsafe(8 + MB + buffer.byteLength)\n    const nonce = envelope.subarray(0, NB)\n    const ciphertext = envelope.subarray(8)\n\n    b4a.fill(nonce, 0) // pad suffix\n    nonce.set(counter)\n\n    sodium.crypto_secretbox_easy(ciphertext, buffer, nonce, secret)\n    return envelope\n  }\n\n  send(buffer) {\n    if (!this._sendState) return\n    if (!this.rawStream?.send) return // udx-stream expected\n\n    const message = this._boxMessage(buffer)\n    return this.rawStream.send(message)\n  }\n\n  trySend(buffer) {\n    if (!this._sendState) return\n    if (!this.rawStream?.trySend) return // udx-stream expected\n\n    const message = this._boxMessage(buffer)\n    this.rawStream.trySend(message)\n  }\n\n  _onmessage(buffer) {\n    if (!this._sendState) return // messages before handshake are dropped\n\n    const MB = sodium.crypto_secretbox_MACBYTES // 16\n    const NB = sodium.crypto_secretbox_NONCEBYTES // 24\n\n    if (buffer.byteLength < NB) return // Invalid message\n\n    const nonce = b4a.allocUnsafe(NB)\n    b4a.fill(nonce, 0)\n    nonce.set(buffer.subarray(0, 8))\n\n    const secret = this._sendState.subarray(32, 64)\n    const ciphertext = buffer.subarray(8)\n    const plain = buffer.subarray(8, buffer.byteLength - MB)\n\n    if (ciphertext.byteLength < MB) return // invalid message\n\n    const success = sodium.crypto_secretbox_open_easy(plain, ciphertext, nonce, secret)\n\n    if (success) this.emit('message', plain)\n  }\n\n  alloc(len) {\n    const buf = b4a.allocUnsafe(len + 3 + ABYTES)\n    this._outgoingWrapped = buf\n    this._outgoingPlain = buf.subarray(4, buf.byteLength - ABYTES + 1)\n    return this._outgoingPlain\n  }\n\n  toJSON() {\n    return {\n      isInitiator: this.isInitiator,\n      publicKey: this.publicKey && b4a.toString(this.publicKey, 'hex'),\n      remotePublicKey: this.remotePublicKey && b4a.toString(this.remotePublicKey, 'hex'),\n      connected: this.connected,\n      destroying: this.destroying,\n      destroyed: this.destroyed,\n      rawStream: this.rawStream && this.rawStream.toJSON ? this.rawStream.toJSON() : null\n    }\n  }\n}\n\nfunction writeUint24le(n, buf) {\n  buf[0] = n & 255\n  buf[1] = (n >>> 8) & 255\n  buf[2] = (n >>> 16) & 255\n}\n\nfunction streamId(handshakeHash, isInitiator, out = b4a.allocUnsafe(32)) {\n  sodium.crypto_generichash(out, isInitiator ? NS_INITIATOR : NS_RESPONDER, handshakeHash)\n  return out\n}\n\nfunction toBuffer(data) {\n  return typeof data === 'string' ? b4a.from(data) : data\n}\n\nfunction destroyTimeout() {\n  this.destroy(new Error('Stream timed out'))\n}\n\nfunction sendKeepAlive() {\n  const empty = this.alloc(0)\n  this.write(empty)\n}\nconst { Duplex, Writable } = require('streamx')\n\nclass ReversePassThrough extends Duplex {\n  constructor(s) {\n    super()\n    this._stream = s\n    this._ondrain = null\n  }\n\n  _write(data, cb) {\n    if (this._stream.push(data) === false) {\n      this._stream._ondrain = cb\n    } else {\n      cb(null)\n    }\n  }\n\n  _final(cb) {\n    this._stream.push(null)\n    cb(null)\n  }\n\n  _read(cb) {\n    const ondrain = this._ondrain\n    this._ondrain = null\n    if (ondrain) ondrain()\n    cb(null)\n  }\n}\n\nmodule.exports = class Bridge extends Duplex {\n  constructor(noiseStream) {\n    super()\n\n    this.noiseStream = noiseStream\n\n    this._ondrain = null\n    this.reverse = new ReversePassThrough(this)\n  }\n\n  get publicKey() {\n    return this.noiseStream.publicKey\n  }\n\n  get remotePublicKey() {\n    return this.noiseStream.remotePublicKey\n  }\n\n  get handshakeHash() {\n    return this.noiseStream.handshakeHash\n  }\n\n  flush() {\n    return Writable.drained(this)\n  }\n\n  _read(cb) {\n    const ondrain = this._ondrain\n    this._ondrain = null\n    if (ondrain) ondrain()\n    cb(null)\n  }\n\n  _write(data, cb) {\n    if (this.reverse.push(data) === false) {\n      this.reverse._ondrain = cb\n    } else {\n      cb(null)\n    }\n  }\n\n  _final(cb) {\n    this.reverse.push(null)\n    cb(null)\n  }\n}\nconst sodium = require('sodium-universal')\nconst curve = require('noise-curve-ed')\nconst Noise = require('noise-handshake')\nconst b4a = require('b4a')\n\nconst EMPTY = b4a.alloc(0)\n\nmodule.exports = class Handshake {\n  constructor(isInitiator, keyPair, remotePublicKey, pattern) {\n    this.isInitiator = isInitiator\n    this.keyPair = keyPair\n    this.noise = new Noise(pattern, isInitiator, keyPair, { curve })\n    this.noise.initialise(EMPTY, remotePublicKey)\n    this.destroyed = false\n  }\n\n  static keyPair(seed) {\n    const publicKey = b4a.alloc(32)\n    const secretKey = b4a.alloc(64)\n    if (seed) sodium.crypto_sign_seed_keypair(publicKey, secretKey, seed)\n    else sodium.crypto_sign_keypair(publicKey, secretKey)\n    return { publicKey, secretKey }\n  }\n\n  recv(data) {\n    try {\n      this.noise.recv(data)\n      if (this.noise.complete) return this._return(null)\n      return this.send()\n    } catch {\n      this.destroy()\n      return null\n    }\n  }\n\n  // note that the data returned here is framed so we don't have to do an extra copy\n  // when sending it...\n  send() {\n    try {\n      const data = this.noise.send()\n      const wrap = b4a.allocUnsafe(data.byteLength + 3)\n\n      writeUint24le(data.byteLength, wrap)\n      wrap.set(data, 3)\n\n      return this._return(wrap)\n    } catch {\n      this.destroy()\n      return null\n    }\n  }\n\n  destroy() {\n    if (this.destroyed) return\n    this.destroyed = true\n  }\n\n  _return(data) {\n    const tx = this.noise.complete ? b4a.toBuffer(this.noise.tx) : null\n    const rx = this.noise.complete ? b4a.toBuffer(this.noise.rx) : null\n    const hash = this.noise.complete ? b4a.toBuffer(this.noise.hash) : null\n    const remotePublicKey = this.noise.complete ? b4a.toBuffer(this.noise.rs) : null\n\n    return {\n      data,\n      remotePublicKey,\n      hash,\n      tx,\n      rx\n    }\n  }\n}\n\nfunction writeUint24le(n, buf) {\n  buf[0] = n & 255\n  buf[1] = (n >>> 8) & 255\n  buf[2] = (n >>> 16) & 255\n}\n{\n  \"name\": \"@hyperswarm/secret-stream\",\n  \"version\": \"6.9.1\",\n  \"description\": \"Secret stream backed by Noise and libsodium's secretstream\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"lib/**.js\"\n  ],\n  \"dependencies\": {\n    \"b4a\": \"^1.1.0\",\n    \"hypercore-crypto\": \"^3.3.1\",\n    \"noise-curve-ed\": \"^2.0.1\",\n    \"noise-handshake\": \"^4.0.0\",\n    \"sodium-secretstream\": \"^1.1.0\",\n    \"sodium-universal\": \"^5.0.0\",\n    \"streamx\": \"^2.14.0\",\n    \"timeout-refresh\": \"^2.0.0\",\n    \"unslab\": \"^1.3.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"udx-native\": \"^1.13.2\"\n  },\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"lint\": \"prettier --check .\",\n    \"test\": \"brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/hyperswarm-secret-stream.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/hyperswarm-secret-stream/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/hyperswarm-secret-stream\"\n}\n'use strict';\n\nconst Client = require('./lib/client');\n\nclass ElectrumClient extends Client {\n\tconstructor(port, host, protocol, options, callbacks) {\n\t\tsuper(port, host, protocol, options, callbacks);\n\n\t\tthis.onConnectCallback = (callbacks && callbacks.onConnect) ? callbacks.onConnect : null;\n\t\tthis.onCloseCallback = (callbacks && callbacks.onClose) ? callbacks.onClose : null;\n\t\tthis.onLogCallback = (callbacks && callbacks.onLog) ? callbacks.onLog : function(str) {\n\t\t\tconsole.log(str);\n\t\t};\n\n\t\tthis.timeLastCall = 0;\n\t}\n\n\tinitElectrum(electrumConfig, persistencePolicy = { retryPeriod: 10000, maxRetry: 1000, pingPeriod: 120000, callback: null }) {\n\t\tthis.persistencePolicy = persistencePolicy;\n\t\tthis.electrumConfig = electrumConfig;\n\t\tthis.timeLastCall = 0;\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.connect().then(() => {\n\t\t\t\tthis.server_version(this.electrumConfig.client, this.electrumConfig.version).then((versionInfo) => {\n\t\t\t\t\tthis.versionInfo = versionInfo;\n\n\t\t\t\t\tif (this.onConnectCallback != null) {\n\t\t\t\t\t\tthis.onConnectCallback(this, this.versionInfo);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(this);\n\n\t\t\t\t}).catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t\t}).catch((err) => {\n\t\t\t\treject(err);\n\t\t\t});\n\t\t});\n\t}\n\n\t// Override parent\n\trequest(method, params) {\n\t\tthis.timeLastCall = new Date().getTime();\n\n\t\tconst parentPromise = super.request(method, params);\n\n\t\treturn parentPromise.then(response => {\n\t\t\tthis.keepAlive();\n\n\t\t\treturn response;\n\t\t});\n\t}\n\n\trequestBatch(method, params, secondParam) {\n\t\tthis.timeLastCall = new Date().getTime();\n\n\t\tconst parentPromise = super.requestBatch(method, params, secondParam);\n\n\t\treturn parentPromise.then(response => {\n\t\t\tthis.keepAlive();\n\n\t\t\treturn response;\n\t\t});\n\t}\n\n\tonClose() {\n\t\tsuper.onClose();\n\n\t\tconst list = [\n\t\t\t'server.peers.subscribe',\n\t\t\t'blockchain.numblocks.subscribe',\n\t\t\t'blockchain.headers.subscribe',\n\t\t\t'blockchain.address.subscribe',\n\t\t];\n\n\t\tlist.forEach(event => this.subscribe.removeAllListeners(event));\n\n\t\tvar retryPeriod = 10000;\n\t\tif (this.persistencePolicy != null && this.persistencePolicy.retryPeriod > 0) {\n\t\t\tretryPeriod = this.persistencePolicy.retryPeriod;\n\t\t}\n\n\t\tif (this.onCloseCallback != null) {\n\t\t\tthis.onCloseCallback(this);\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tif (this.persistencePolicy != null && this.persistencePolicy.maxRetry > 0) {\n\t\t\t\tthis.reconnect().catch((err) => {\n\t\t\t\t\tthis.onError(err);\n\t\t\t\t});\n\n\t\t\t\tthis.persistencePolicy.maxRetry -= 1;\n\n\t\t\t} else if (this.persistencePolicy != null && this.persistencePolicy.callback != null) {\n\t\t\t\tthis.persistencePolicy.callback();\n\n\t\t\t} else if (this.persistencePolicy == null) {\n\t\t\t\tthis.reconnect().catch((err) => {\n\t\t\t\t\tthis.onError(err);\n\t\t\t\t});\n\t\t\t}\n\t\t}, retryPeriod);\n\t}\n\n\t// ElectrumX persistancy\n\tkeepAlive() {\n\t\tif (this.timeout != null) {\n\t\t\tclearTimeout(this.timeout);\n\t\t}\n\n\t\tvar pingPeriod = 120000;\n\t\tif (this.persistencePolicy != null && this.persistencePolicy.pingPeriod > 0) {\n\t\t\tpingPeriod = this.persistencePolicy.pingPeriod;\n\t\t}\n\n\t\tthis.timeout = setTimeout(() => {\n\t\t\tif (this.timeLastCall !== 0 && new Date().getTime() > this.timeLastCall + pingPeriod) {\n\t\t\t\tthis.server_ping().catch((reason) => {\n\t\t\t\t\tthis.log('Keep-Alive ping failed: ', reason);\n\t\t\t\t});\n\t\t\t}\n\t\t}, pingPeriod);\n\t}\n\n\tclose() {\n\t\tsuper.close();\n\n\t\tif (this.timeout != null) {\n\t\t\tclearTimeout(this.timeout);\n\t\t}\n\n\t\tthis.reconnect = this.reconnect = this.onClose = this.keepAlive = () => {}; // dirty hack to make it stop reconnecting\n\t}\n\n\treconnect() {\n\t\tthis.log(\"Electrum attempting reconnect...\");\n\t\t\n\t\tthis.initSocket();\n\n\t\tif (this.persistencePolicy != null) {\n\t\t\treturn this.initElectrum(this.electrumConfig, this.persistencePolicy);\n\t\t\t\n\t\t} else {\n\t\t\treturn this.initElectrum(this.electrumConfig);\n\t\t}\n\t}\n\n\tlog(str) {\n\t\tthis.onLogCallback(str);\n\t}\n\n\t// ElectrumX API\n\tserver_version(client_name, protocol_version) {\n\t\treturn this.request('server.version', [client_name, protocol_version]);\n\t}\n\tserver_banner() {\n\t\treturn this.request('server.banner', []);\n\t}\n\tserver_features() {\n\t\treturn this.request('server.features', []);\n\t}\n\tserver_ping() {\n\t\treturn this.request('server.ping', []);\n\t}\n\tserver_addPeer(features) {\n\t\treturn this.request('server.add_peer', [features]);\n\t}\n\tserverDonation_address() {\n\t\treturn this.request('server.donation_address', []);\n\t}\n\tserverPeers_subscribe() {\n\t\treturn this.request('server.peers.subscribe', []);\n\t}\n\tblockchainAddress_getProof(address) {\n\t\treturn this.request('blockchain.address.get_proof', [address]);\n\t}\n\tblockchainScripthash_getBalance(scripthash) {\n\t\treturn this.request('blockchain.scripthash.get_balance', [scripthash]);\n\t}\n\tblockchainScripthash_getBalanceBatch(scripthash) {\n\t\treturn this.requestBatch('blockchain.scripthash.get_balance', scripthash);\n\t}\n\tblockchainScripthash_listunspentBatch(scripthash) {\n\t\treturn this.requestBatch('blockchain.scripthash.listunspent', scripthash);\n\t}\n\tblockchainScripthash_getHistory(scripthash) {\n\t\treturn this.request('blockchain.scripthash.get_history', [scripthash]);\n\t}\n\tblockchainScripthash_getHistoryBatch(scripthash) {\n\t\treturn this.requestBatch('blockchain.scripthash.get_history', scripthash);\n\t}\n\tblockchainScripthash_getMempool(scripthash) {\n\t\treturn this.request('blockchain.scripthash.get_mempool', [scripthash]);\n\t}\n\tblockchainScripthash_listunspent(scripthash) {\n\t\treturn this.request('blockchain.scripthash.listunspent', [scripthash]);\n\t}\n\tblockchainScripthash_subscribe(scripthash) {\n\t\treturn this.request('blockchain.scripthash.subscribe', [scripthash]);\n\t}\n\tblockchainBlock_getHeader(height) {\n\t\treturn this.request('blockchain.block.get_header', [height]);\n\t}\n\tblockchainBlock_headers(start_height, count) {\n\t\treturn this.request('blockchain.block.headeres', [start_height, count]);\n\t}\n\tblockchainEstimatefee(number) {\n\t\treturn this.request('blockchain.estimatefee', [number]);\n\t}\n\tblockchainHeaders_subscribe(raw) {\n\t\treturn this.request('blockchain.headers.subscribe', [raw || false]);\n\t}\n\tblockchain_relayfee() {\n\t\treturn this.request('blockchain.relayfee', []);\n\t}\n\tblockchainTransaction_broadcast(rawtx) {\n\t\treturn this.request('blockchain.transaction.broadcast', [rawtx]);\n\t}\n\tblockchainTransaction_get(tx_hash, verbose) {\n\t\treturn this.request('blockchain.transaction.get', [tx_hash, verbose || false]);\n\t}\n\tblockchainTransaction_getBatch(tx_hash, verbose) {\n\t\treturn this.requestBatch('blockchain.transaction.get', tx_hash, verbose);\n\t}\n\tblockchainTransaction_getMerkle(tx_hash, height) {\n\t\treturn this.request('blockchain.transaction.get_merkle', [tx_hash, height]);\n\t}\n\tmempool_getFeeHistogram() {\n\t\treturn this.request('mempool.get_fee_histogram', []);\n\t}\n\t// ---------------------------------\n\t// protocol 1.1 deprecated method\n\t// ---------------------------------\n\tblockchainUtxo_getAddress(tx_hash, index) {\n\t\treturn this.request('blockchain.utxo.get_address', [tx_hash, index]);\n\t}\n\tblockchainNumblocks_subscribe() {\n\t\treturn this.request('blockchain.numblocks.subscribe', []);\n\t}\n\t// ---------------------------------\n\t// protocol 1.2 deprecated method\n\t// ---------------------------------\n\tblockchainBlock_getChunk(index) {\n\t\treturn this.request('blockchain.block.get_chunk', [index]);\n\t}\n\tblockchainAddress_getBalance(address) {\n\t\treturn this.request('blockchain.address.get_balance', [address]);\n\t}\n\tblockchainAddress_getHistory(address) {\n\t\treturn this.request('blockchain.address.get_history', [address]);\n\t}\n\tblockchainAddress_getMempool(address) {\n\t\treturn this.request('blockchain.address.get_mempool', [address]);\n\t}\n\tblockchainAddress_listunspent(address) {\n\t\treturn this.request('blockchain.address.listunspent', [address]);\n\t}\n\tblockchainAddress_subscribe(address) {\n\t\treturn this.request('blockchain.address.subscribe', [address]);\n\t}\n}\n\nmodule.exports = ElectrumClient;\n/**\n * Simple wrapper to mimick Socket class from NET package, since TLS package has slightly different API.\n * We implement several methods that TCP sockets are expected to have. We will proxy call them as soon as\n * real TLS socket will be created (TLS socket created after connection).\n */\nclass TlsSocketWrapper {\n\tconstructor(tls) {\n\t\tthis._tls = tls; // dependency injection lol\n\t\tthis._socket = false;\n\t\t// defaults:\n\t\tthis._timeout = 5000;\n\t\tthis._encoding = 'utf8';\n\t\tthis._keepAliveEneblad = true;\n\t\tthis._keepAliveinitialDelay = 0;\n\t\tthis._noDelay = true;\n\t\tthis._listeners = {};\n\t}\n\n\tsetTimeout(timeout) {\n\t\tif (this._socket) this._socket.setTimeout(timeout);\n\t\tthis._timeout = timeout;\n\t}\n\n\tsetEncoding(encoding) {\n\t\tif (this._socket) this._socket.setEncoding(encoding);\n\t\tthis._encoding = encoding;\n\t}\n\n\tsetKeepAlive(enabled, initialDelay) {\n\t\tif (this._socket) this._socket.setKeepAlive(enabled, initialDelay);\n\t\tthis._keepAliveEneblad = enabled;\n\t\tthis._keepAliveinitialDelay = initialDelay;\n\t}\n\n\tsetNoDelay(noDelay) {\n\t\tif (this._socket) this._socket.setNoDelay(noDelay);\n\t\tthis._noDelay = noDelay;\n\t}\n\n\ton(event, listener) {\n\t\tthis._listeners[event] = this._listeners[event] || [];\n\t\tthis._listeners[event].push(listener);\n\t}\n\n\tremoveListener(event, listener) {\n\t\tthis._listeners[event] = this._listeners[event] || [];\n\t\tlet newListeners = [];\n\n\t\tlet found = false;\n\t\tfor (let savedListener of this._listeners[event]) {\n\t\t\tif (savedListener == listener) {\n\t\t\t\t// found our listener\n\t\t\t\tfound = true;\n\t\t\t\t// we just skip it\n\t\t\t} else {\n\t\t\t\t// other listeners should go back to original array\n\t\t\t\tnewListeners.push(savedListener);\n\t\t\t}\n\t\t}\n\n\t\tif (found) {\n\t\t\tthis._listeners[event] = newListeners;\n\t\t} else {\n\t\t\t// something went wrong, lets just cleanup all listeners\n\t\t\tthis._listeners[event] = [];\n\t\t}\n\t}\n\n\tconnect(port, host, callback) {\n\t\t// resulting TLSSocket extends <net.Socket>\n\t\tthis._socket = this._tls.connect({ port: port, host: host, rejectUnauthorized: false }, () => {\n\t\t\treturn callback();\n\t\t});\n\n\t\t// setting everything that was set to this proxy class\n\n\t\tthis._socket.setTimeout(this._timeout);\n\t\tthis._socket.setEncoding(this._encoding);\n\t\tthis._socket.setKeepAlive(this._keepAliveEneblad, this._keepAliveinitialDelay);\n\t\tthis._socket.setNoDelay(this._noDelay);\n\n\t\t// resubscribing to events on newly created socket so we could proxy them to already established listeners\n\n\t\tthis._socket.on('data', data => {\n\t\t\tthis._passOnEvent('data', data);\n\t\t});\n\t\tthis._socket.on('error', data => {\n\t\t\tthis._passOnEvent('error', data);\n\t\t});\n\t\tthis._socket.on('close', data => {\n\t\t\tthis._passOnEvent('close', data);\n\t\t});\n\t\tthis._socket.on('connect', data => {\n\t\t\tthis._passOnEvent('connect', data);\n\t\t});\n\t\tthis._socket.on('connection', data => {\n\t\t\tthis._passOnEvent('connection', data);\n\t\t});\n\t}\n\n\t_passOnEvent(event, data) {\n\t\tthis._listeners[event] = this._listeners[event] || [];\n\t\tfor (let savedListener of this._listeners[event]) {\n\t\t\tsavedListener(data);\n\t\t}\n\t}\n\n\temit(event, data) {\n\t\tthis._socket.emit(event, data);\n\t}\n\n\tend() {\n\t\tthis._socket.end();\n\t}\n\n\tdestroy() {\n\t\tthis._socket.destroy();\n\t}\n\n\twrite(data) {\n\t\tthis._socket.write(data);\n\t}\n}\n\nmodule.exports = TlsSocketWrapper;\n'use strict';\nlet net = require('net');\nlet tls = require('tls');\nconst TIMEOUT = 60000;\n\nconst TlsSocketWrapper = require('./TlsSocketWrapper.js');\nconst EventEmitter = require('events').EventEmitter;\nconst util = require('./util');\n\nclass Client {\n\n\tconstructor(port, host, protocol, options, callbacks) {\n\t\tthis.id = 0;\n\t\tthis.port = port;\n\t\tthis.host = host;\n\t\tthis.callback_message_queue = {};\n\t\tthis.subscribe = new EventEmitter();\n\t\tthis.mp = new util.MessageParser((body, n) => {\n\t\t\tthis.onMessage(body, n);\n\t\t});\n\t\tthis._protocol = protocol; // saving defaults\n\t\tthis._options = options;\n\n\t\tthis.onErrorCallback = (callbacks && callbacks.onError) ? callbacks.onError : null;\n\n\t\tthis.initSocket(protocol, options);\n\t}\n\n\tinitSocket(protocol, options) {\n\t\tprotocol = protocol || this._protocol;\n\t\toptions = options || this._options;\n\t\tswitch (protocol) {\n\t\t\tcase 'tcp':\n\t\t\t\tthis.conn = new net.Socket();\n\t\t\t\tbreak;\n\t\t\tcase 'tls':\n\t\t\tcase 'ssl':\n\t\t\t\tif (!tls) {\n\t\t\t\t\tthrow new Error(\"Package 'tls' not available\");\n\t\t\t\t}\n\n\t\t\t\tthis.conn = new TlsSocketWrapper(tls);\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error('unknown protocol');\n\t\t}\n\n\t\tthis.conn.setTimeout(TIMEOUT);\n\t\tthis.conn.setEncoding('utf8');\n\t\tthis.conn.setKeepAlive(true, 0);\n\t\tthis.conn.setNoDelay(true);\n\t\tthis.conn.on('connect', () => {\n\t\t\tthis.conn.setTimeout(0);\n\t\t\tthis.onConnect();\n\t\t});\n\t\tthis.conn.on('close', e => {\n\t\t\tthis.onClose(e);\n\t\t});\n\t\tthis.conn.on('data', chunk => {\n\t\t\tthis.conn.setTimeout(0);\n\t\t\tthis.onRecv(chunk);\n\t\t});\n\t\tthis.conn.on('error', e => {\n\t\t\tthis.onError(e);\n\t\t});\n\t\tthis.status = 0;\n\t}\n\n\tconnect() {\n\t\tif (this.status === 1) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tthis.status = 1;\n\t\treturn this.connectSocket(this.conn, this.port, this.host);\n\t}\n\n\tconnectSocket(conn, port, host) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst errorHandler = e => reject(e);\n\t\t\t\n\t\t\tconn.on('error', errorHandler);\n\n\t\t\tconn.connect(port, host, () => {\n\t\t\t\tconn.removeListener('error', errorHandler);\n\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}\n\n\tclose() {\n\t\tif (this.status === 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis.conn.end();\n\t\tthis.conn.destroy();\n\t\tthis.status = 0;\n\t}\n\n\trequest(method, params) {\n\t\tif (this.status === 0) {\n\t\t\treturn Promise.reject(new Error('Connection to server lost, please retry'));\n\t\t}\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst id = ++this.id;\n\t\t\tconst content = util.makeRequest(method, params, id);\n\t\t\tthis.callback_message_queue[id] = util.createPromiseResult(resolve, reject);\n\t\t\tthis.conn.write(content + '\\n');\n\t\t});\n\t}\n\n\trequestBatch(method, params, secondParam) {\n\t\tif (this.status === 0) {\n\t\t\treturn Promise.reject(new Error('Connection to server lost, please retry'));\n\t\t}\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet arguments_far_calls = {};\n\t\t\tlet contents = [];\n\t\t\tfor (let param of params) {\n\t\t\t\tconst id = ++this.id;\n\t\t\t\tif (secondParam !== undefined) {\n\t\t\t\t\tcontents.push(util.makeRequest(method, [param, secondParam], id));\n\t\t\t\t} else {\n\t\t\t\t\tcontents.push(util.makeRequest(method, [param], id));\n\t\t\t\t}\n\t\t\t\targuments_far_calls[id] = param;\n\t\t\t}\n\t\t\tconst content = '[' + contents.join(',') + ']';\n\t\t\tthis.callback_message_queue[this.id] = util.createPromiseResultBatch(resolve, reject, arguments_far_calls);\n\t\t\t// callback will exist only for max id\n\t\t\tthis.conn.write(content + '\\n');\n\t\t});\n\t}\n\n\tresponse(msg) {\n\t\tlet callback;\n\t\tif (!msg.id && msg[0] && msg[0].id) {\n\t\t\t// this is a response from batch request\n\t\t\tfor (let m of msg) {\n\t\t\t\tif (m.id && this.callback_message_queue[m.id]) {\n\t\t\t\t\tcallback = this.callback_message_queue[m.id];\n\t\t\t\t\tdelete this.callback_message_queue[m.id];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tcallback = this.callback_message_queue[msg.id];\n\t\t}\n\n\t\tif (callback) {\n\t\t\tdelete this.callback_message_queue[msg.id];\n\t\t\tif (msg.error) {\n\t\t\t\tcallback(msg.error);\n\t\t\t} else {\n\t\t\t\tcallback(null, msg.result || msg);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\"Error getting callback while handling response\");\n\t\t}\n\t}\n\n\tonMessage(body, n) {\n\t\tconst msg = JSON.parse(body);\n\t\tif (msg instanceof Array) {\n\t\t\tthis.response(msg);\n\t\t} else {\n\t\t\tif (msg.id !== void 0) {\n\t\t\t\tthis.response(msg);\n\t\t\t} else {\n\t\t\t\tthis.subscribe.emit(msg.method, msg.params);\n\t\t\t}\n\t\t}\n\t}\n\n\tonConnect() {\n\t}\n\n\tonClose(e) {\n\t\tthis.status = 0;\n\n\t\tObject.keys(this.callback_message_queue).forEach(key => {\n\t\t\tthis.callback_message_queue[key](new Error('close connect'));\n\t\t\tdelete this.callback_message_queue[key];\n\t\t});\n\t}\n\n\tonRecv(chunk) {\n\t\tthis.mp.run(chunk);\n\t}\n\n\tonError(e) {\n\t\tif (this.onErrorCallback != null) {\n\t\t\tthis.onErrorCallback(e);\n\t\t}\n\t}\n}\n\nmodule.exports = Client;\n'use strict';\n\nconst makeRequest = (exports.makeRequest = (method, params, id) => {\n\treturn JSON.stringify({\n\t\tjsonrpc: '2.0',\n\t\tmethod: method,\n\t\tparams: params,\n\t\tid: id,\n\t});\n});\n\nconst createRecuesiveParser = (exports.createRecuesiveParser = (max_depth, delimiter) => {\n\tconst MAX_DEPTH = max_depth;\n\tconst DELIMITER = delimiter;\n\tconst recursiveParser = (n, buffer, callback) => {\n\t\tif (buffer.length === 0) {\n\t\t\treturn { code: 0, buffer: buffer };\n\t\t}\n\t\tif (n > MAX_DEPTH) {\n\t\t\treturn { code: 1, buffer: buffer };\n\t\t}\n\t\tconst xs = buffer.split(DELIMITER);\n\t\tif (xs.length === 1) {\n\t\t\treturn { code: 0, buffer: buffer };\n\t\t}\n\t\tcallback(xs.shift(), n);\n\t\treturn recursiveParser(n + 1, xs.join(DELIMITER), callback);\n\t};\n\treturn recursiveParser;\n});\n\nconst createPromiseResult = (exports.createPromiseResult = (resolve, reject) => {\n\treturn (err, result) => {\n\t\tif (err) reject(err);\n\t\telse resolve(result);\n\t};\n});\n\nconst createPromiseResultBatch = (exports.createPromiseResultBatch = (resolve, reject, argz) => {\n\treturn (err, result) => {\n\t\tif (result && result[0] && result[0].id) {\n\t\t\t// this is a batch request response\n\t\t\tfor (let r of result) {\n\t\t\t\tr.param = argz[r.id];\n\t\t\t}\n\t\t}\n\t\tif (err) reject(err);\n\t\telse resolve(result);\n\t};\n});\n\nclass MessageParser {\n\tconstructor(callback) {\n\t\tthis.buffer = '';\n\t\tthis.callback = callback;\n\t\tthis.recursiveParser = createRecuesiveParser(20, '\\n');\n\t}\n\trun(chunk) {\n\t\tthis.buffer += chunk;\n\t\twhile (true) {\n\t\t\tconst res = this.recursiveParser(0, this.buffer, this.callback);\n\t\t\tthis.buffer = res.buffer;\n\t\t\tif (res.code === 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\nexports.MessageParser = MessageParser;\n{\n\t\"name\": \"@mempool/electrum-client\",\n\t\"version\": \"1.1.9\",\n\t\"description\": \"Electrum protocol client for Node.js\",\n\t\"main\": \"index.js\",\n\t\"scripts\": {\n\t\t\"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n\t},\n\t\"dependencies\": {},\n\t\"devDependencies\": {},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git://github.com/mempool/electrum-client.git\"\n\t},\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/mempool/electrum-client/issues\"\n\t},\n\t\"keywords\": [\n\t\t\"bitcoin\",\n\t\t\"electrum\",\n\t\t\"electrumx\"\n\t],\n\t\"engines\": {\n\t\t\"node\": \">=6\"\n\t},\n\t\"contributors\": [\n\t\t{ \"name\": \"Yuki Akiyama\" },\n\t\t{ \"name\": \"7kharov\" },\n\t\t{ \"name\": \"overtorment\" },\n\t\t{ \"name\": \"janoside\" },\n\t\t{ \"name\": \"softsimon\" }\n\t],\n\t\"license\": \"MIT\"\n}\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getHash = getHash;\nexports.createCurve = createCurve;\n/**\n * Utilities for short weierstrass curves, combined with noble-hashes.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nconst weierstrass_ts_1 = require(\"./abstract/weierstrass.js\");\n/** connects noble-curves to noble-hashes */\nfunction getHash(hash) {\n    return { hash };\n}\n/** @deprecated use new `weierstrass()` and `ecdsa()` methods */\nfunction createCurve(curveDef, defHash) {\n    const create = (hash) => (0, weierstrass_ts_1.weierstrass)({ ...curveDef, hash: hash });\n    return { ...create(defHash), create };\n}\n//# sourceMappingURL=_shortw_utils.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wNAF = void 0;\nexports.negateCt = negateCt;\nexports.normalizeZ = normalizeZ;\nexports.mulEndoUnsafe = mulEndoUnsafe;\nexports.pippenger = pippenger;\nexports.precomputeMSMUnsafe = precomputeMSMUnsafe;\nexports.validateBasic = validateBasic;\nexports._createCurveFields = _createCurveFields;\n/**\n * Methods for elliptic curve multiplication by scalars.\n * Contains wNAF, pippenger.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nconst utils_ts_1 = require(\"../utils.js\");\nconst modular_ts_1 = require(\"./modular.js\");\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nfunction negateCt(condition, item) {\n    const neg = item.negate();\n    return condition ? neg : item;\n}\n/**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n */\nfunction normalizeZ(c, points) {\n    const invertedZs = (0, modular_ts_1.FpInvertBatch)(c.Fp, points.map((p) => p.Z));\n    return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i])));\n}\nfunction validateW(W, bits) {\n    if (!Number.isSafeInteger(W) || W <= 0 || W > bits)\n        throw new Error('invalid window size, expected [1..' + bits + '], got W=' + W);\n}\nfunction calcWOpts(W, scalarBits) {\n    validateW(W, scalarBits);\n    const windows = Math.ceil(scalarBits / W) + 1; // W=8 33. Not 32, because we skip zero\n    const windowSize = 2 ** (W - 1); // W=8 128. Not 256, because we skip zero\n    const maxNumber = 2 ** W; // W=8 256\n    const mask = (0, utils_ts_1.bitMask)(W); // W=8 255 == mask 0b11111111\n    const shiftBy = BigInt(W); // W=8 8\n    return { windows, windowSize, mask, maxNumber, shiftBy };\n}\nfunction calcOffsets(n, window, wOpts) {\n    const { windowSize, mask, maxNumber, shiftBy } = wOpts;\n    let wbits = Number(n & mask); // extract W bits.\n    let nextN = n >> shiftBy; // shift number by W bits.\n    // What actually happens here:\n    // const highestBit = Number(mask ^ (mask >> 1n));\n    // let wbits2 = wbits - 1; // skip zero\n    // if (wbits2 & highestBit) { wbits2 ^= Number(mask); // (~);\n    // split if bits > max: +224 => 256-32\n    if (wbits > windowSize) {\n        // we skip zero, which means instead of `>= size-1`, we do `> size`\n        wbits -= maxNumber; // -32, can be maxNumber - wbits, but then we need to set isNeg here.\n        nextN += _1n; // +256 (carry)\n    }\n    const offsetStart = window * windowSize;\n    const offset = offsetStart + Math.abs(wbits) - 1; // -1 because we skip zero\n    const isZero = wbits === 0; // is current window slice a 0?\n    const isNeg = wbits < 0; // is current window slice negative?\n    const isNegF = window % 2 !== 0; // fake random statement for noise\n    const offsetF = offsetStart; // fake offset for noise\n    return { nextN, offset, isZero, isNeg, isNegF, offsetF };\n}\nfunction validateMSMPoints(points, c) {\n    if (!Array.isArray(points))\n        throw new Error('array expected');\n    points.forEach((p, i) => {\n        if (!(p instanceof c))\n            throw new Error('invalid point at index ' + i);\n    });\n}\nfunction validateMSMScalars(scalars, field) {\n    if (!Array.isArray(scalars))\n        throw new Error('array of scalars expected');\n    scalars.forEach((s, i) => {\n        if (!field.isValid(s))\n            throw new Error('invalid scalar at index ' + i);\n    });\n}\n// Since points in different groups cannot be equal (different object constructor),\n// we can have single place to store precomputes.\n// Allows to make points frozen / immutable.\nconst pointPrecomputes = new WeakMap();\nconst pointWindowSizes = new WeakMap();\nfunction getW(P) {\n    // To disable precomputes:\n    // return 1;\n    return pointWindowSizes.get(P) || 1;\n}\nfunction assert0(n) {\n    if (n !== _0n)\n        throw new Error('invalid wNAF');\n}\n/**\n * Elliptic curve multiplication of Point by scalar. Fragile.\n * Table generation takes **30MB of ram and 10ms on high-end CPU**,\n * but may take much longer on slow devices. Actual generation will happen on\n * first call of `multiply()`. By default, `BASE` point is precomputed.\n *\n * Scalars should always be less than curve order: this should be checked inside of a curve itself.\n * Creates precomputation tables for fast multiplication:\n * - private scalar is split by fixed size windows of W bits\n * - every window point is collected from window's table & added to accumulator\n * - since windows are different, same point inside tables won't be accessed more than once per calc\n * - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n * - +1 window is neccessary for wNAF\n * - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n *\n * @todo Research returning 2d JS array of windows, instead of a single window.\n * This would allow windows to be in different memory locations\n */\nclass wNAF {\n    // Parametrized with a given Point class (not individual point)\n    constructor(Point, bits) {\n        this.BASE = Point.BASE;\n        this.ZERO = Point.ZERO;\n        this.Fn = Point.Fn;\n        this.bits = bits;\n    }\n    // non-const time multiplication ladder\n    _unsafeLadder(elm, n, p = this.ZERO) {\n        let d = elm;\n        while (n > _0n) {\n            if (n & _1n)\n                p = p.add(d);\n            d = d.double();\n            n >>= _1n;\n        }\n        return p;\n    }\n    /**\n     * Creates a wNAF precomputation window. Used for caching.\n     * Default window size is set by `utils.precompute()` and is equal to 8.\n     * Number of precomputed points depends on the curve size:\n     * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n     * - 𝑊 is the window size\n     * - 𝑛 is the bitlength of the curve order.\n     * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n     * @param point Point instance\n     * @param W window size\n     * @returns precomputed point tables flattened to a single array\n     */\n    precomputeWindow(point, W) {\n        const { windows, windowSize } = calcWOpts(W, this.bits);\n        const points = [];\n        let p = point;\n        let base = p;\n        for (let window = 0; window < windows; window++) {\n            base = p;\n            points.push(base);\n            // i=1, bc we skip 0\n            for (let i = 1; i < windowSize; i++) {\n                base = base.add(p);\n                points.push(base);\n            }\n            p = base.double();\n        }\n        return points;\n    }\n    /**\n     * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n     * More compact implementation:\n     * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541\n     * @returns real and fake (for const-time) points\n     */\n    wNAF(W, precomputes, n) {\n        // Scalar should be smaller than field order\n        if (!this.Fn.isValid(n))\n            throw new Error('invalid scalar');\n        // Accumulators\n        let p = this.ZERO;\n        let f = this.BASE;\n        // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n        // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n        // there is negate now: it is possible that negated element from low value\n        // would be the same as high element, which will create carry into next window.\n        // It's not obvious how this can fail, but still worth investigating later.\n        const wo = calcWOpts(W, this.bits);\n        for (let window = 0; window < wo.windows; window++) {\n            // (n === _0n) is handled and not early-exited. isEven and offsetF are used for noise\n            const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo);\n            n = nextN;\n            if (isZero) {\n                // bits are 0: add garbage to fake point\n                // Important part for const-time getPublicKey: add random \"noise\" point to f.\n                f = f.add(negateCt(isNegF, precomputes[offsetF]));\n            }\n            else {\n                // bits are 1: add to result point\n                p = p.add(negateCt(isNeg, precomputes[offset]));\n            }\n        }\n        assert0(n);\n        // Return both real and fake points: JIT won't eliminate f.\n        // At this point there is a way to F be infinity-point even if p is not,\n        // which makes it less const-time: around 1 bigint multiply.\n        return { p, f };\n    }\n    /**\n     * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.\n     * @param acc accumulator point to add result of multiplication\n     * @returns point\n     */\n    wNAFUnsafe(W, precomputes, n, acc = this.ZERO) {\n        const wo = calcWOpts(W, this.bits);\n        for (let window = 0; window < wo.windows; window++) {\n            if (n === _0n)\n                break; // Early-exit, skip 0 value\n            const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo);\n            n = nextN;\n            if (isZero) {\n                // Window bits are 0: skip processing.\n                // Move to next window.\n                continue;\n            }\n            else {\n                const item = precomputes[offset];\n                acc = acc.add(isNeg ? item.negate() : item); // Re-using acc allows to save adds in MSM\n            }\n        }\n        assert0(n);\n        return acc;\n    }\n    getPrecomputes(W, point, transform) {\n        // Calculate precomputes on a first run, reuse them after\n        let comp = pointPrecomputes.get(point);\n        if (!comp) {\n            comp = this.precomputeWindow(point, W);\n            if (W !== 1) {\n                // Doing transform outside of if brings 15% perf hit\n                if (typeof transform === 'function')\n                    comp = transform(comp);\n                pointPrecomputes.set(point, comp);\n            }\n        }\n        return comp;\n    }\n    cached(point, scalar, transform) {\n        const W = getW(point);\n        return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar);\n    }\n    unsafe(point, scalar, transform, prev) {\n        const W = getW(point);\n        if (W === 1)\n            return this._unsafeLadder(point, scalar, prev); // For W=1 ladder is ~x2 faster\n        return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev);\n    }\n    // We calculate precomputes for elliptic curve point multiplication\n    // using windowed method. This specifies window size and\n    // stores precomputed values. Usually only base point would be precomputed.\n    createCache(P, W) {\n        validateW(W, this.bits);\n        pointWindowSizes.set(P, W);\n        pointPrecomputes.delete(P);\n    }\n    hasCache(elm) {\n        return getW(elm) !== 1;\n    }\n}\nexports.wNAF = wNAF;\n/**\n * Endomorphism-specific multiplication for Koblitz curves.\n * Cost: 128 dbl, 0-256 adds.\n */\nfunction mulEndoUnsafe(Point, point, k1, k2) {\n    let acc = point;\n    let p1 = Point.ZERO;\n    let p2 = Point.ZERO;\n    while (k1 > _0n || k2 > _0n) {\n        if (k1 & _1n)\n            p1 = p1.add(acc);\n        if (k2 & _1n)\n            p2 = p2.add(acc);\n        acc = acc.double();\n        k1 >>= _1n;\n        k2 >>= _1n;\n    }\n    return { p1, p2 };\n}\n/**\n * Pippenger algorithm for multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n * 30x faster vs naive addition on L=4096, 10x faster than precomputes.\n * For N=254bit, L=1, it does: 1024 ADD + 254 DBL. For L=5: 1536 ADD + 254 DBL.\n * Algorithmically constant-time (for same L), even when 1 point + scalar, or when scalar = 0.\n * @param c Curve Point constructor\n * @param fieldN field over CURVE.N - important that it's not over CURVE.P\n * @param points array of L curve points\n * @param scalars array of L scalars (aka secret keys / bigints)\n */\nfunction pippenger(c, fieldN, points, scalars) {\n    // If we split scalars by some window (let's say 8 bits), every chunk will only\n    // take 256 buckets even if there are 4096 scalars, also re-uses double.\n    // TODO:\n    // - https://eprint.iacr.org/2024/750.pdf\n    // - https://tches.iacr.org/index.php/TCHES/article/view/10287\n    // 0 is accepted in scalars\n    validateMSMPoints(points, c);\n    validateMSMScalars(scalars, fieldN);\n    const plength = points.length;\n    const slength = scalars.length;\n    if (plength !== slength)\n        throw new Error('arrays of points and scalars must have equal length');\n    // if (plength === 0) throw new Error('array must be of length >= 2');\n    const zero = c.ZERO;\n    const wbits = (0, utils_ts_1.bitLen)(BigInt(plength));\n    let windowSize = 1; // bits\n    if (wbits > 12)\n        windowSize = wbits - 3;\n    else if (wbits > 4)\n        windowSize = wbits - 2;\n    else if (wbits > 0)\n        windowSize = 2;\n    const MASK = (0, utils_ts_1.bitMask)(windowSize);\n    const buckets = new Array(Number(MASK) + 1).fill(zero); // +1 for zero array\n    const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;\n    let sum = zero;\n    for (let i = lastBits; i >= 0; i -= windowSize) {\n        buckets.fill(zero);\n        for (let j = 0; j < slength; j++) {\n            const scalar = scalars[j];\n            const wbits = Number((scalar >> BigInt(i)) & MASK);\n            buckets[wbits] = buckets[wbits].add(points[j]);\n        }\n        let resI = zero; // not using this will do small speed-up, but will lose ct\n        // Skip first bucket, because it is zero\n        for (let j = buckets.length - 1, sumI = zero; j > 0; j--) {\n            sumI = sumI.add(buckets[j]);\n            resI = resI.add(sumI);\n        }\n        sum = sum.add(resI);\n        if (i !== 0)\n            for (let j = 0; j < windowSize; j++)\n                sum = sum.double();\n    }\n    return sum;\n}\n/**\n * Precomputed multi-scalar multiplication (MSM, Pa + Qb + Rc + ...).\n * @param c Curve Point constructor\n * @param fieldN field over CURVE.N - important that it's not over CURVE.P\n * @param points array of L curve points\n * @returns function which multiplies points with scaars\n */\nfunction precomputeMSMUnsafe(c, fieldN, points, windowSize) {\n    /**\n     * Performance Analysis of Window-based Precomputation\n     *\n     * Base Case (256-bit scalar, 8-bit window):\n     * - Standard precomputation requires:\n     *   - 31 additions per scalar × 256 scalars = 7,936 ops\n     *   - Plus 255 summary additions = 8,191 total ops\n     *   Note: Summary additions can be optimized via accumulator\n     *\n     * Chunked Precomputation Analysis:\n     * - Using 32 chunks requires:\n     *   - 255 additions per chunk\n     *   - 256 doublings\n     *   - Total: (255 × 32) + 256 = 8,416 ops\n     *\n     * Memory Usage Comparison:\n     * Window Size | Standard Points | Chunked Points\n     * ------------|-----------------|---------------\n     *     4-bit   |     520         |      15\n     *     8-bit   |    4,224        |     255\n     *    10-bit   |   13,824        |   1,023\n     *    16-bit   |  557,056        |  65,535\n     *\n     * Key Advantages:\n     * 1. Enables larger window sizes due to reduced memory overhead\n     * 2. More efficient for smaller scalar counts:\n     *    - 16 chunks: (16 × 255) + 256 = 4,336 ops\n     *    - ~2x faster than standard 8,191 ops\n     *\n     * Limitations:\n     * - Not suitable for plain precomputes (requires 256 constant doublings)\n     * - Performance degrades with larger scalar counts:\n     *   - Optimal for ~256 scalars\n     *   - Less efficient for 4096+ scalars (Pippenger preferred)\n     */\n    validateW(windowSize, fieldN.BITS);\n    validateMSMPoints(points, c);\n    const zero = c.ZERO;\n    const tableSize = 2 ** windowSize - 1; // table size (without zero)\n    const chunks = Math.ceil(fieldN.BITS / windowSize); // chunks of item\n    const MASK = (0, utils_ts_1.bitMask)(windowSize);\n    const tables = points.map((p) => {\n        const res = [];\n        for (let i = 0, acc = p; i < tableSize; i++) {\n            res.push(acc);\n            acc = acc.add(p);\n        }\n        return res;\n    });\n    return (scalars) => {\n        validateMSMScalars(scalars, fieldN);\n        if (scalars.length > points.length)\n            throw new Error('array of scalars must be smaller than array of points');\n        let res = zero;\n        for (let i = 0; i < chunks; i++) {\n            // No need to double if accumulator is still zero.\n            if (res !== zero)\n                for (let j = 0; j < windowSize; j++)\n                    res = res.double();\n            const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize);\n            for (let j = 0; j < scalars.length; j++) {\n                const n = scalars[j];\n                const curr = Number((n >> shiftBy) & MASK);\n                if (!curr)\n                    continue; // skip zero scalars chunks\n                res = res.add(tables[j][curr - 1]);\n            }\n        }\n        return res;\n    };\n}\n// TODO: remove\n/** @deprecated */\nfunction validateBasic(curve) {\n    (0, modular_ts_1.validateField)(curve.Fp);\n    (0, utils_ts_1.validateObject)(curve, {\n        n: 'bigint',\n        h: 'bigint',\n        Gx: 'field',\n        Gy: 'field',\n    }, {\n        nBitLength: 'isSafeInteger',\n        nByteLength: 'isSafeInteger',\n    });\n    // Set defaults\n    return Object.freeze({\n        ...(0, modular_ts_1.nLength)(curve.n, curve.nBitLength),\n        ...curve,\n        ...{ p: curve.Fp.ORDER },\n    });\n}\nfunction createField(order, field, isLE) {\n    if (field) {\n        if (field.ORDER !== order)\n            throw new Error('Field.ORDER must match order: Fp == p, Fn == n');\n        (0, modular_ts_1.validateField)(field);\n        return field;\n    }\n    else {\n        return (0, modular_ts_1.Field)(order, { isLE });\n    }\n}\n/** Validates CURVE opts and creates fields */\nfunction _createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) {\n    if (FpFnLE === undefined)\n        FpFnLE = type === 'edwards';\n    if (!CURVE || typeof CURVE !== 'object')\n        throw new Error(`expected valid ${type} CURVE object`);\n    for (const p of ['p', 'n', 'h']) {\n        const val = CURVE[p];\n        if (!(typeof val === 'bigint' && val > _0n))\n            throw new Error(`CURVE.${p} must be positive bigint`);\n    }\n    const Fp = createField(CURVE.p, curveOpts.Fp, FpFnLE);\n    const Fn = createField(CURVE.n, curveOpts.Fn, FpFnLE);\n    const _b = type === 'weierstrass' ? 'b' : 'd';\n    const params = ['Gx', 'Gy', 'a', _b];\n    for (const p of params) {\n        // @ts-ignore\n        if (!Fp.isValid(CURVE[p]))\n            throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`);\n    }\n    CURVE = Object.freeze(Object.assign({}, CURVE));\n    return { CURVE, Fp, Fn };\n}\n//# sourceMappingURL=curve.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._DST_scalar = void 0;\nexports.expand_message_xmd = expand_message_xmd;\nexports.expand_message_xof = expand_message_xof;\nexports.hash_to_field = hash_to_field;\nexports.isogenyMap = isogenyMap;\nexports.createHasher = createHasher;\nconst utils_ts_1 = require(\"../utils.js\");\nconst modular_ts_1 = require(\"./modular.js\");\n// Octet Stream to Integer. \"spec\" implementation of os2ip is 2.5x slower vs bytesToNumberBE.\nconst os2ip = utils_ts_1.bytesToNumberBE;\n// Integer to Octet Stream (numberToBytesBE)\nfunction i2osp(value, length) {\n    anum(value);\n    anum(length);\n    if (value < 0 || value >= 1 << (8 * length))\n        throw new Error('invalid I2OSP input: ' + value);\n    const res = Array.from({ length }).fill(0);\n    for (let i = length - 1; i >= 0; i--) {\n        res[i] = value & 0xff;\n        value >>>= 8;\n    }\n    return new Uint8Array(res);\n}\nfunction strxor(a, b) {\n    const arr = new Uint8Array(a.length);\n    for (let i = 0; i < a.length; i++) {\n        arr[i] = a[i] ^ b[i];\n    }\n    return arr;\n}\nfunction anum(item) {\n    if (!Number.isSafeInteger(item))\n        throw new Error('number expected');\n}\nfunction normDST(DST) {\n    if (!(0, utils_ts_1.isBytes)(DST) && typeof DST !== 'string')\n        throw new Error('DST must be Uint8Array or string');\n    return typeof DST === 'string' ? (0, utils_ts_1.utf8ToBytes)(DST) : DST;\n}\n/**\n * Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits.\n * [RFC 9380 5.3.1](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1).\n */\nfunction expand_message_xmd(msg, DST, lenInBytes, H) {\n    (0, utils_ts_1.abytes)(msg);\n    anum(lenInBytes);\n    DST = normDST(DST);\n    // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3\n    if (DST.length > 255)\n        DST = H((0, utils_ts_1.concatBytes)((0, utils_ts_1.utf8ToBytes)('H2C-OVERSIZE-DST-'), DST));\n    const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H;\n    const ell = Math.ceil(lenInBytes / b_in_bytes);\n    if (lenInBytes > 65535 || ell > 255)\n        throw new Error('expand_message_xmd: invalid lenInBytes');\n    const DST_prime = (0, utils_ts_1.concatBytes)(DST, i2osp(DST.length, 1));\n    const Z_pad = i2osp(0, r_in_bytes);\n    const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str\n    const b = new Array(ell);\n    const b_0 = H((0, utils_ts_1.concatBytes)(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime));\n    b[0] = H((0, utils_ts_1.concatBytes)(b_0, i2osp(1, 1), DST_prime));\n    for (let i = 1; i <= ell; i++) {\n        const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime];\n        b[i] = H((0, utils_ts_1.concatBytes)(...args));\n    }\n    const pseudo_random_bytes = (0, utils_ts_1.concatBytes)(...b);\n    return pseudo_random_bytes.slice(0, lenInBytes);\n}\n/**\n * Produces a uniformly random byte string using an extendable-output function (XOF) H.\n * 1. The collision resistance of H MUST be at least k bits.\n * 2. H MUST be an XOF that has been proved indifferentiable from\n *    a random oracle under a reasonable cryptographic assumption.\n * [RFC 9380 5.3.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2).\n */\nfunction expand_message_xof(msg, DST, lenInBytes, k, H) {\n    (0, utils_ts_1.abytes)(msg);\n    anum(lenInBytes);\n    DST = normDST(DST);\n    // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3\n    // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8));\n    if (DST.length > 255) {\n        const dkLen = Math.ceil((2 * k) / 8);\n        DST = H.create({ dkLen }).update((0, utils_ts_1.utf8ToBytes)('H2C-OVERSIZE-DST-')).update(DST).digest();\n    }\n    if (lenInBytes > 65535 || DST.length > 255)\n        throw new Error('expand_message_xof: invalid lenInBytes');\n    return (H.create({ dkLen: lenInBytes })\n        .update(msg)\n        .update(i2osp(lenInBytes, 2))\n        // 2. DST_prime = DST || I2OSP(len(DST), 1)\n        .update(DST)\n        .update(i2osp(DST.length, 1))\n        .digest());\n}\n/**\n * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F.\n * [RFC 9380 5.2](https://www.rfc-editor.org/rfc/rfc9380#section-5.2).\n * @param msg a byte string containing the message to hash\n * @param count the number of elements of F to output\n * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above\n * @returns [u_0, ..., u_(count - 1)], a list of field elements.\n */\nfunction hash_to_field(msg, count, options) {\n    (0, utils_ts_1._validateObject)(options, {\n        p: 'bigint',\n        m: 'number',\n        k: 'number',\n        hash: 'function',\n    });\n    const { p, k, m, hash, expand, DST } = options;\n    if (!(0, utils_ts_1.isHash)(options.hash))\n        throw new Error('expected valid hash');\n    (0, utils_ts_1.abytes)(msg);\n    anum(count);\n    const log2p = p.toString(2).length;\n    const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above\n    const len_in_bytes = count * m * L;\n    let prb; // pseudo_random_bytes\n    if (expand === 'xmd') {\n        prb = expand_message_xmd(msg, DST, len_in_bytes, hash);\n    }\n    else if (expand === 'xof') {\n        prb = expand_message_xof(msg, DST, len_in_bytes, k, hash);\n    }\n    else if (expand === '_internal_pass') {\n        // for internal tests only\n        prb = msg;\n    }\n    else {\n        throw new Error('expand must be \"xmd\" or \"xof\"');\n    }\n    const u = new Array(count);\n    for (let i = 0; i < count; i++) {\n        const e = new Array(m);\n        for (let j = 0; j < m; j++) {\n            const elm_offset = L * (j + i * m);\n            const tv = prb.subarray(elm_offset, elm_offset + L);\n            e[j] = (0, modular_ts_1.mod)(os2ip(tv), p);\n        }\n        u[i] = e;\n    }\n    return u;\n}\nfunction isogenyMap(field, map) {\n    // Make same order as in spec\n    const coeff = map.map((i) => Array.from(i).reverse());\n    return (x, y) => {\n        const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));\n        // 6.6.3\n        // Exceptional cases of iso_map are inputs that cause the denominator of\n        // either rational function to evaluate to zero; such cases MUST return\n        // the identity point on E.\n        const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(field, [xd, yd], true);\n        x = field.mul(xn, xd_inv); // xNum / xDen\n        y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev)\n        return { x, y };\n    };\n}\nexports._DST_scalar = (0, utils_ts_1.utf8ToBytes)('HashToScalar-');\n/** Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}. */\nfunction createHasher(Point, mapToCurve, defaults) {\n    if (typeof mapToCurve !== 'function')\n        throw new Error('mapToCurve() must be defined');\n    function map(num) {\n        return Point.fromAffine(mapToCurve(num));\n    }\n    function clear(initial) {\n        const P = initial.clearCofactor();\n        if (P.equals(Point.ZERO))\n            return Point.ZERO; // zero will throw in assert\n        P.assertValidity();\n        return P;\n    }\n    return {\n        defaults,\n        hashToCurve(msg, options) {\n            const opts = Object.assign({}, defaults, options);\n            const u = hash_to_field(msg, 2, opts);\n            const u0 = map(u[0]);\n            const u1 = map(u[1]);\n            return clear(u0.add(u1));\n        },\n        encodeToCurve(msg, options) {\n            const optsDst = defaults.encodeDST ? { DST: defaults.encodeDST } : {};\n            const opts = Object.assign({}, defaults, optsDst, options);\n            const u = hash_to_field(msg, 1, opts);\n            const u0 = map(u[0]);\n            return clear(u0);\n        },\n        /** See {@link H2CHasher} */\n        mapToCurve(scalars) {\n            if (!Array.isArray(scalars))\n                throw new Error('expected array of bigints');\n            for (const i of scalars)\n                if (typeof i !== 'bigint')\n                    throw new Error('expected array of bigints');\n            return clear(map(scalars));\n        },\n        // hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393\n        // RFC 9380, draft-irtf-cfrg-bbs-signatures-08\n        hashToScalar(msg, options) {\n            // @ts-ignore\n            const N = Point.Fn.ORDER;\n            const opts = Object.assign({}, defaults, { p: N, m: 1, DST: exports._DST_scalar }, options);\n            return hash_to_field(msg, 1, opts)[0][0];\n        },\n    };\n}\n//# sourceMappingURL=hash-to-curve.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isNegativeLE = void 0;\nexports.mod = mod;\nexports.pow = pow;\nexports.pow2 = pow2;\nexports.invert = invert;\nexports.tonelliShanks = tonelliShanks;\nexports.FpSqrt = FpSqrt;\nexports.validateField = validateField;\nexports.FpPow = FpPow;\nexports.FpInvertBatch = FpInvertBatch;\nexports.FpDiv = FpDiv;\nexports.FpLegendre = FpLegendre;\nexports.FpIsSquare = FpIsSquare;\nexports.nLength = nLength;\nexports.Field = Field;\nexports.FpSqrtOdd = FpSqrtOdd;\nexports.FpSqrtEven = FpSqrtEven;\nexports.hashToPrivateScalar = hashToPrivateScalar;\nexports.getFieldBytesLength = getFieldBytesLength;\nexports.getMinHashLength = getMinHashLength;\nexports.mapHashToField = mapHashToField;\n/**\n * Utils for modular division and fields.\n * Field over 11 is a finite (Galois) field is integer number operations `mod 11`.\n * There is no division: it is replaced by modular multiplicative inverse.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nconst utils_ts_1 = require(\"../utils.js\");\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = /* @__PURE__ */ BigInt(2), _3n = /* @__PURE__ */ BigInt(3);\n// prettier-ignore\nconst _4n = /* @__PURE__ */ BigInt(4), _5n = /* @__PURE__ */ BigInt(5), _7n = /* @__PURE__ */ BigInt(7);\n// prettier-ignore\nconst _8n = /* @__PURE__ */ BigInt(8), _9n = /* @__PURE__ */ BigInt(9), _16n = /* @__PURE__ */ BigInt(16);\n// Calculates a modulo b\nfunction mod(a, b) {\n    const result = a % b;\n    return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\nfunction pow(num, power, modulo) {\n    return FpPow(Field(modulo), num, power);\n}\n/** Does `x^(2^power)` mod p. `pow2(30, 4)` == `30^(2^4)` */\nfunction pow2(x, power, modulo) {\n    let res = x;\n    while (power-- > _0n) {\n        res *= res;\n        res %= modulo;\n    }\n    return res;\n}\n/**\n * Inverses number over modulo.\n * Implemented using [Euclidean GCD](https://brilliant.org/wiki/extended-euclidean-algorithm/).\n */\nfunction invert(number, modulo) {\n    if (number === _0n)\n        throw new Error('invert: expected non-zero number');\n    if (modulo <= _0n)\n        throw new Error('invert: expected positive modulus, got ' + modulo);\n    // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n    let a = mod(number, modulo);\n    let b = modulo;\n    // prettier-ignore\n    let x = _0n, y = _1n, u = _1n, v = _0n;\n    while (a !== _0n) {\n        // JIT applies optimization if those two lines follow each other\n        const q = b / a;\n        const r = b % a;\n        const m = x - u * q;\n        const n = y - v * q;\n        // prettier-ignore\n        b = a, a = r, x = u, y = v, u = m, v = n;\n    }\n    const gcd = b;\n    if (gcd !== _1n)\n        throw new Error('invert: does not exist');\n    return mod(x, modulo);\n}\nfunction assertIsSquare(Fp, root, n) {\n    if (!Fp.eql(Fp.sqr(root), n))\n        throw new Error('Cannot find square root');\n}\n// Not all roots are possible! Example which will throw:\n// const NUM =\n// n = 72057594037927816n;\n// Fp = Field(BigInt('0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab'));\nfunction sqrt3mod4(Fp, n) {\n    const p1div4 = (Fp.ORDER + _1n) / _4n;\n    const root = Fp.pow(n, p1div4);\n    assertIsSquare(Fp, root, n);\n    return root;\n}\nfunction sqrt5mod8(Fp, n) {\n    const p5div8 = (Fp.ORDER - _5n) / _8n;\n    const n2 = Fp.mul(n, _2n);\n    const v = Fp.pow(n2, p5div8);\n    const nv = Fp.mul(n, v);\n    const i = Fp.mul(Fp.mul(nv, _2n), v);\n    const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n    assertIsSquare(Fp, root, n);\n    return root;\n}\n// Based on RFC9380, Kong algorithm\n// prettier-ignore\nfunction sqrt9mod16(P) {\n    const Fp_ = Field(P);\n    const tn = tonelliShanks(P);\n    const c1 = tn(Fp_, Fp_.neg(Fp_.ONE)); //  1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n    const c2 = tn(Fp_, c1); //  2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n    const c3 = tn(Fp_, Fp_.neg(c1)); //  3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n    const c4 = (P + _7n) / _16n; //  4. c4 = (q + 7) / 16        # Integer arithmetic\n    return (Fp, n) => {\n        let tv1 = Fp.pow(n, c4); //  1. tv1 = x^c4\n        let tv2 = Fp.mul(tv1, c1); //  2. tv2 = c1 * tv1\n        const tv3 = Fp.mul(tv1, c2); //  3. tv3 = c2 * tv1\n        const tv4 = Fp.mul(tv1, c3); //  4. tv4 = c3 * tv1\n        const e1 = Fp.eql(Fp.sqr(tv2), n); //  5.  e1 = (tv2^2) == x\n        const e2 = Fp.eql(Fp.sqr(tv3), n); //  6.  e2 = (tv3^2) == x\n        tv1 = Fp.cmov(tv1, tv2, e1); //  7. tv1 = CMOV(tv1, tv2, e1)  # Select tv2 if (tv2^2) == x\n        tv2 = Fp.cmov(tv4, tv3, e2); //  8. tv2 = CMOV(tv4, tv3, e2)  # Select tv3 if (tv3^2) == x\n        const e3 = Fp.eql(Fp.sqr(tv2), n); //  9.  e3 = (tv2^2) == x\n        const root = Fp.cmov(tv1, tv2, e3); // 10.  z = CMOV(tv1, tv2, e3)   # Select sqrt from tv1 & tv2\n        assertIsSquare(Fp, root, n);\n        return root;\n    };\n}\n/**\n * Tonelli-Shanks square root search algorithm.\n * 1. https://eprint.iacr.org/2012/685.pdf (page 12)\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * @param P field order\n * @returns function that takes field Fp (created from P) and number n\n */\nfunction tonelliShanks(P) {\n    // Initialization (precomputation).\n    // Caching initialization could boost perf by 7%.\n    if (P < _3n)\n        throw new Error('sqrt is not defined for small field');\n    // Factor P - 1 = Q * 2^S, where Q is odd\n    let Q = P - _1n;\n    let S = 0;\n    while (Q % _2n === _0n) {\n        Q /= _2n;\n        S++;\n    }\n    // Find the first quadratic non-residue Z >= 2\n    let Z = _2n;\n    const _Fp = Field(P);\n    while (FpLegendre(_Fp, Z) === 1) {\n        // Basic primality test for P. After x iterations, chance of\n        // not finding quadratic non-residue is 2^x, so 2^1000.\n        if (Z++ > 1000)\n            throw new Error('Cannot find square root: probably non-prime P');\n    }\n    // Fast-path; usually done before Z, but we do \"primality test\".\n    if (S === 1)\n        return sqrt3mod4;\n    // Slow-path\n    // TODO: test on Fp2 and others\n    let cc = _Fp.pow(Z, Q); // c = z^Q\n    const Q1div2 = (Q + _1n) / _2n;\n    return function tonelliSlow(Fp, n) {\n        if (Fp.is0(n))\n            return n;\n        // Check if n is a quadratic residue using Legendre symbol\n        if (FpLegendre(Fp, n) !== 1)\n            throw new Error('Cannot find square root');\n        // Initialize variables for the main loop\n        let M = S;\n        let c = Fp.mul(Fp.ONE, cc); // c = z^Q, move cc from field _Fp into field Fp\n        let t = Fp.pow(n, Q); // t = n^Q, first guess at the fudge factor\n        let R = Fp.pow(n, Q1div2); // R = n^((Q+1)/2), first guess at the square root\n        // Main loop\n        // while t != 1\n        while (!Fp.eql(t, Fp.ONE)) {\n            if (Fp.is0(t))\n                return Fp.ZERO; // if t=0 return R=0\n            let i = 1;\n            // Find the smallest i >= 1 such that t^(2^i) ≡ 1 (mod P)\n            let t_tmp = Fp.sqr(t); // t^(2^1)\n            while (!Fp.eql(t_tmp, Fp.ONE)) {\n                i++;\n                t_tmp = Fp.sqr(t_tmp); // t^(2^2)...\n                if (i === M)\n                    throw new Error('Cannot find square root');\n            }\n            // Calculate the exponent for b: 2^(M - i - 1)\n            const exponent = _1n << BigInt(M - i - 1); // bigint is important\n            const b = Fp.pow(c, exponent); // b = 2^(M - i - 1)\n            // Update variables\n            M = i;\n            c = Fp.sqr(b); // c = b^2\n            t = Fp.mul(t, c); // t = (t * b^2)\n            R = Fp.mul(R, b); // R = R*b\n        }\n        return R;\n    };\n}\n/**\n * Square root for a finite field. Will try optimized versions first:\n *\n * 1. P ≡ 3 (mod 4)\n * 2. P ≡ 5 (mod 8)\n * 3. P ≡ 9 (mod 16)\n * 4. Tonelli-Shanks algorithm\n *\n * Different algorithms can give different roots, it is up to user to decide which one they want.\n * For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n */\nfunction FpSqrt(P) {\n    // P ≡ 3 (mod 4) => √n = n^((P+1)/4)\n    if (P % _4n === _3n)\n        return sqrt3mod4;\n    // P ≡ 5 (mod 8) => Atkin algorithm, page 10 of https://eprint.iacr.org/2012/685.pdf\n    if (P % _8n === _5n)\n        return sqrt5mod8;\n    // P ≡ 9 (mod 16) => Kong algorithm, page 11 of https://eprint.iacr.org/2012/685.pdf (algorithm 4)\n    if (P % _16n === _9n)\n        return sqrt9mod16(P);\n    // Tonelli-Shanks algorithm\n    return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nconst isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\nexports.isNegativeLE = isNegativeLE;\n// prettier-ignore\nconst FIELD_FIELDS = [\n    'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n    'eql', 'add', 'sub', 'mul', 'pow', 'div',\n    'addN', 'subN', 'mulN', 'sqrN'\n];\nfunction validateField(field) {\n    const initial = {\n        ORDER: 'bigint',\n        MASK: 'bigint',\n        BYTES: 'number',\n        BITS: 'number',\n    };\n    const opts = FIELD_FIELDS.reduce((map, val) => {\n        map[val] = 'function';\n        return map;\n    }, initial);\n    (0, utils_ts_1._validateObject)(field, opts);\n    // const max = 16384;\n    // if (field.BYTES < 1 || field.BYTES > max) throw new Error('invalid field');\n    // if (field.BITS < 1 || field.BITS > 8 * max) throw new Error('invalid field');\n    return field;\n}\n// Generic field functions\n/**\n * Same as `pow` but for Fp: non-constant-time.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n */\nfunction FpPow(Fp, num, power) {\n    if (power < _0n)\n        throw new Error('invalid exponent, negatives unsupported');\n    if (power === _0n)\n        return Fp.ONE;\n    if (power === _1n)\n        return num;\n    let p = Fp.ONE;\n    let d = num;\n    while (power > _0n) {\n        if (power & _1n)\n            p = Fp.mul(p, d);\n        d = Fp.sqr(d);\n        power >>= _1n;\n    }\n    return p;\n}\n/**\n * Efficiently invert an array of Field elements.\n * Exception-free. Will return `undefined` for 0 elements.\n * @param passZero map 0 to 0 (instead of undefined)\n */\nfunction FpInvertBatch(Fp, nums, passZero = false) {\n    const inverted = new Array(nums.length).fill(passZero ? Fp.ZERO : undefined);\n    // Walk from first to last, multiply them by each other MOD p\n    const multipliedAcc = nums.reduce((acc, num, i) => {\n        if (Fp.is0(num))\n            return acc;\n        inverted[i] = acc;\n        return Fp.mul(acc, num);\n    }, Fp.ONE);\n    // Invert last element\n    const invertedAcc = Fp.inv(multipliedAcc);\n    // Walk from last to first, multiply them by inverted each other MOD p\n    nums.reduceRight((acc, num, i) => {\n        if (Fp.is0(num))\n            return acc;\n        inverted[i] = Fp.mul(acc, inverted[i]);\n        return Fp.mul(acc, num);\n    }, invertedAcc);\n    return inverted;\n}\n// TODO: remove\nfunction FpDiv(Fp, lhs, rhs) {\n    return Fp.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, Fp.ORDER) : Fp.inv(rhs));\n}\n/**\n * Legendre symbol.\n * Legendre constant is used to calculate Legendre symbol (a | p)\n * which denotes the value of a^((p-1)/2) (mod p).\n *\n * * (a | p) ≡ 1    if a is a square (mod p), quadratic residue\n * * (a | p) ≡ -1   if a is not a square (mod p), quadratic non residue\n * * (a | p) ≡ 0    if a ≡ 0 (mod p)\n */\nfunction FpLegendre(Fp, n) {\n    // We can use 3rd argument as optional cache of this value\n    // but seems unneeded for now. The operation is very fast.\n    const p1mod2 = (Fp.ORDER - _1n) / _2n;\n    const powered = Fp.pow(n, p1mod2);\n    const yes = Fp.eql(powered, Fp.ONE);\n    const zero = Fp.eql(powered, Fp.ZERO);\n    const no = Fp.eql(powered, Fp.neg(Fp.ONE));\n    if (!yes && !zero && !no)\n        throw new Error('invalid Legendre symbol result');\n    return yes ? 1 : zero ? 0 : -1;\n}\n// This function returns True whenever the value x is a square in the field F.\nfunction FpIsSquare(Fp, n) {\n    const l = FpLegendre(Fp, n);\n    return l === 1;\n}\n// CURVE.n lengths\nfunction nLength(n, nBitLength) {\n    // Bit size, byte size of CURVE.n\n    if (nBitLength !== undefined)\n        (0, utils_ts_1.anumber)(nBitLength);\n    const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n    const nByteLength = Math.ceil(_nBitLength / 8);\n    return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Creates a finite field. Major performance optimizations:\n * * 1. Denormalized operations like mulN instead of mul.\n * * 2. Identical object shape: never add or remove keys.\n * * 3. `Object.freeze`.\n * Fragile: always run a benchmark on a change.\n * Security note: operations don't check 'isValid' for all elements for performance reasons,\n * it is caller responsibility to check this.\n * This is low-level code, please make sure you know what you're doing.\n *\n * Note about field properties:\n * * CHARACTERISTIC p = prime number, number of elements in main subgroup.\n * * ORDER q = similar to cofactor in curves, may be composite `q = p^m`.\n *\n * @param ORDER field order, probably prime, or could be composite\n * @param bitLen how many bits the field consumes\n * @param isLE (default: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nfunction Field(ORDER, bitLenOrOpts, // TODO: use opts only in v2?\nisLE = false, opts = {}) {\n    if (ORDER <= _0n)\n        throw new Error('invalid field: expected ORDER > 0, got ' + ORDER);\n    let _nbitLength = undefined;\n    let _sqrt = undefined;\n    let modFromBytes = false;\n    let allowedLengths = undefined;\n    if (typeof bitLenOrOpts === 'object' && bitLenOrOpts != null) {\n        if (opts.sqrt || isLE)\n            throw new Error('cannot specify opts in two arguments');\n        const _opts = bitLenOrOpts;\n        if (_opts.BITS)\n            _nbitLength = _opts.BITS;\n        if (_opts.sqrt)\n            _sqrt = _opts.sqrt;\n        if (typeof _opts.isLE === 'boolean')\n            isLE = _opts.isLE;\n        if (typeof _opts.modFromBytes === 'boolean')\n            modFromBytes = _opts.modFromBytes;\n        allowedLengths = _opts.allowedLengths;\n    }\n    else {\n        if (typeof bitLenOrOpts === 'number')\n            _nbitLength = bitLenOrOpts;\n        if (opts.sqrt)\n            _sqrt = opts.sqrt;\n    }\n    const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, _nbitLength);\n    if (BYTES > 2048)\n        throw new Error('invalid field: expected ORDER of <= 2048 bytes');\n    let sqrtP; // cached sqrtP\n    const f = Object.freeze({\n        ORDER,\n        isLE,\n        BITS,\n        BYTES,\n        MASK: (0, utils_ts_1.bitMask)(BITS),\n        ZERO: _0n,\n        ONE: _1n,\n        allowedLengths: allowedLengths,\n        create: (num) => mod(num, ORDER),\n        isValid: (num) => {\n            if (typeof num !== 'bigint')\n                throw new Error('invalid field element: expected bigint, got ' + typeof num);\n            return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n        },\n        is0: (num) => num === _0n,\n        // is valid and invertible\n        isValidNot0: (num) => !f.is0(num) && f.isValid(num),\n        isOdd: (num) => (num & _1n) === _1n,\n        neg: (num) => mod(-num, ORDER),\n        eql: (lhs, rhs) => lhs === rhs,\n        sqr: (num) => mod(num * num, ORDER),\n        add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n        sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n        mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n        pow: (num, power) => FpPow(f, num, power),\n        div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n        // Same as above, but doesn't normalize\n        sqrN: (num) => num * num,\n        addN: (lhs, rhs) => lhs + rhs,\n        subN: (lhs, rhs) => lhs - rhs,\n        mulN: (lhs, rhs) => lhs * rhs,\n        inv: (num) => invert(num, ORDER),\n        sqrt: _sqrt ||\n            ((n) => {\n                if (!sqrtP)\n                    sqrtP = FpSqrt(ORDER);\n                return sqrtP(f, n);\n            }),\n        toBytes: (num) => (isLE ? (0, utils_ts_1.numberToBytesLE)(num, BYTES) : (0, utils_ts_1.numberToBytesBE)(num, BYTES)),\n        fromBytes: (bytes, skipValidation = true) => {\n            if (allowedLengths) {\n                if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) {\n                    throw new Error('Field.fromBytes: expected ' + allowedLengths + ' bytes, got ' + bytes.length);\n                }\n                const padded = new Uint8Array(BYTES);\n                // isLE add 0 to right, !isLE to the left.\n                padded.set(bytes, isLE ? 0 : padded.length - bytes.length);\n                bytes = padded;\n            }\n            if (bytes.length !== BYTES)\n                throw new Error('Field.fromBytes: expected ' + BYTES + ' bytes, got ' + bytes.length);\n            let scalar = isLE ? (0, utils_ts_1.bytesToNumberLE)(bytes) : (0, utils_ts_1.bytesToNumberBE)(bytes);\n            if (modFromBytes)\n                scalar = mod(scalar, ORDER);\n            if (!skipValidation)\n                if (!f.isValid(scalar))\n                    throw new Error('invalid field element: outside of range 0..ORDER');\n            // NOTE: we don't validate scalar here, please use isValid. This done such way because some\n            // protocol may allow non-reduced scalar that reduced later or changed some other way.\n            return scalar;\n        },\n        // TODO: we don't need it here, move out to separate fn\n        invertBatch: (lst) => FpInvertBatch(f, lst),\n        // We can't move this out because Fp6, Fp12 implement it\n        // and it's unclear what to return in there.\n        cmov: (a, b, c) => (c ? b : a),\n    });\n    return Object.freeze(f);\n}\n// Generic random scalar, we can do same for other fields if via Fp2.mul(Fp2.ONE, Fp2.random)?\n// This allows unsafe methods like ignore bias or zero. These unsafe, but often used in different protocols (if deterministic RNG).\n// which mean we cannot force this via opts.\n// Not sure what to do with randomBytes, we can accept it inside opts if wanted.\n// Probably need to export getMinHashLength somewhere?\n// random(bytes?: Uint8Array, unsafeAllowZero = false, unsafeAllowBias = false) {\n//   const LEN = !unsafeAllowBias ? getMinHashLength(ORDER) : BYTES;\n//   if (bytes === undefined) bytes = randomBytes(LEN); // _opts.randomBytes?\n//   const num = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n//   // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0\n//   const reduced = unsafeAllowZero ? mod(num, ORDER) : mod(num, ORDER - _1n) + _1n;\n//   return reduced;\n// },\nfunction FpSqrtOdd(Fp, elm) {\n    if (!Fp.isOdd)\n        throw new Error(\"Field doesn't have isOdd\");\n    const root = Fp.sqrt(elm);\n    return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nfunction FpSqrtEven(Fp, elm) {\n    if (!Fp.isOdd)\n        throw new Error(\"Field doesn't have isOdd\");\n    const root = Fp.sqrt(elm);\n    return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field).\n * Which makes it slightly more biased, less secure.\n * @deprecated use `mapKeyToField` instead\n */\nfunction hashToPrivateScalar(hash, groupOrder, isLE = false) {\n    hash = (0, utils_ts_1.ensureBytes)('privateHash', hash);\n    const hashLen = hash.length;\n    const minLen = nLength(groupOrder).nByteLength + 8;\n    if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n        throw new Error('hashToPrivateScalar: expected ' + minLen + '-1024 bytes of input, got ' + hashLen);\n    const num = isLE ? (0, utils_ts_1.bytesToNumberLE)(hash) : (0, utils_ts_1.bytesToNumberBE)(hash);\n    return mod(num, groupOrder - _1n) + _1n;\n}\n/**\n * Returns total number of bytes consumed by the field element.\n * For example, 32 bytes for usual 256-bit weierstrass curve.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of field\n */\nfunction getFieldBytesLength(fieldOrder) {\n    if (typeof fieldOrder !== 'bigint')\n        throw new Error('field order must be bigint');\n    const bitLength = fieldOrder.toString(2).length;\n    return Math.ceil(bitLength / 8);\n}\n/**\n * Returns minimal amount of bytes that can be safely reduced\n * by field order.\n * Should be 2^-128 for 128-bit curve such as P256.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of target hash\n */\nfunction getMinHashLength(fieldOrder) {\n    const length = getFieldBytesLength(fieldOrder);\n    return length + Math.ceil(length / 2);\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 48 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final\n * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nfunction mapHashToField(key, fieldOrder, isLE = false) {\n    const len = key.length;\n    const fieldLen = getFieldBytesLength(fieldOrder);\n    const minLen = getMinHashLength(fieldOrder);\n    // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings.\n    if (len < 16 || len < minLen || len > 1024)\n        throw new Error('expected ' + minLen + '-1024 bytes of input, got ' + len);\n    const num = isLE ? (0, utils_ts_1.bytesToNumberLE)(key) : (0, utils_ts_1.bytesToNumberBE)(key);\n    // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0\n    const reduced = mod(num, fieldOrder - _1n) + _1n;\n    return isLE ? (0, utils_ts_1.numberToBytesLE)(reduced, fieldLen) : (0, utils_ts_1.numberToBytesBE)(reduced, fieldLen);\n}\n//# sourceMappingURL=modular.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isHash = exports.validateObject = exports.memoized = exports.notImplemented = exports.createHmacDrbg = exports.bitMask = exports.bitSet = exports.bitGet = exports.bitLen = exports.aInRange = exports.inRange = exports.asciiToBytes = exports.copyBytes = exports.equalBytes = exports.ensureBytes = exports.numberToVarBytesBE = exports.numberToBytesLE = exports.numberToBytesBE = exports.bytesToNumberLE = exports.bytesToNumberBE = exports.hexToNumber = exports.numberToHexUnpadded = exports.abool = exports.utf8ToBytes = exports.randomBytes = exports.isBytes = exports.hexToBytes = exports.concatBytes = exports.bytesToUtf8 = exports.bytesToHex = exports.anumber = exports.abytes = void 0;\n/**\n * Deprecated module: moved from curves/abstract/utils.js to curves/utils.js\n * @module\n */\nconst u = require(\"../utils.js\");\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.abytes = u.abytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.anumber = u.anumber;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.bytesToHex = u.bytesToHex;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.bytesToUtf8 = u.bytesToUtf8;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.concatBytes = u.concatBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.hexToBytes = u.hexToBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.isBytes = u.isBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.randomBytes = u.randomBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.utf8ToBytes = u.utf8ToBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.abool = u.abool;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.numberToHexUnpadded = u.numberToHexUnpadded;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.hexToNumber = u.hexToNumber;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.bytesToNumberBE = u.bytesToNumberBE;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.bytesToNumberLE = u.bytesToNumberLE;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.numberToBytesBE = u.numberToBytesBE;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.numberToBytesLE = u.numberToBytesLE;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.numberToVarBytesBE = u.numberToVarBytesBE;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.ensureBytes = u.ensureBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.equalBytes = u.equalBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.copyBytes = u.copyBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.asciiToBytes = u.asciiToBytes;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.inRange = u.inRange;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.aInRange = u.aInRange;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.bitLen = u.bitLen;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.bitGet = u.bitGet;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.bitSet = u.bitSet;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.bitMask = u.bitMask;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.createHmacDrbg = u.createHmacDrbg;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.notImplemented = u.notImplemented;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.memoized = u.memoized;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.validateObject = u.validateObject;\n/** @deprecated moved to `@noble/curves/utils.js` */\nexports.isHash = u.isHash;\n//# sourceMappingURL=utils.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DER = exports.DERErr = void 0;\nexports._splitEndoScalar = _splitEndoScalar;\nexports._normFnElement = _normFnElement;\nexports.weierstrassN = weierstrassN;\nexports.SWUFpSqrtRatio = SWUFpSqrtRatio;\nexports.mapToCurveSimpleSWU = mapToCurveSimpleSWU;\nexports.ecdh = ecdh;\nexports.ecdsa = ecdsa;\nexports.weierstrassPoints = weierstrassPoints;\nexports._legacyHelperEquat = _legacyHelperEquat;\nexports.weierstrass = weierstrass;\n/**\n * Short Weierstrass curve methods. The formula is: y² = x³ + ax + b.\n *\n * ### Design rationale for types\n *\n * * Interaction between classes from different curves should fail:\n *   `k256.Point.BASE.add(p256.Point.BASE)`\n * * For this purpose we want to use `instanceof` operator, which is fast and works during runtime\n * * Different calls of `curve()` would return different classes -\n *   `curve(params) !== curve(params)`: if somebody decided to monkey-patch their curve,\n *   it won't affect others\n *\n * TypeScript can't infer types for classes created inside a function. Classes is one instance\n * of nominative types in TypeScript and interfaces only check for shape, so it's hard to create\n * unique type for every function call.\n *\n * We can use generic types via some param, like curve opts, but that would:\n *     1. Enable interaction between `curve(params)` and `curve(params)` (curves of same params)\n *     which is hard to debug.\n *     2. Params can be generic and we can't enforce them to be constant value:\n *     if somebody creates curve from non-constant params,\n *     it would be allowed to interact with other curves with non-constant params\n *\n * @todo https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#unique-symbol\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nconst hmac_js_1 = require(\"@noble/hashes/hmac.js\");\nconst utils_1 = require(\"@noble/hashes/utils\");\nconst utils_ts_1 = require(\"../utils.js\");\nconst curve_ts_1 = require(\"./curve.js\");\nconst modular_ts_1 = require(\"./modular.js\");\n// We construct basis in such way that den is always positive and equals n, but num sign depends on basis (not on secret value)\nconst divNearest = (num, den) => (num + (num >= 0 ? den : -den) / _2n) / den;\n/**\n * Splits scalar for GLV endomorphism.\n */\nfunction _splitEndoScalar(k, basis, n) {\n    // Split scalar into two such that part is ~half bits: `abs(part) < sqrt(N)`\n    // Since part can be negative, we need to do this on point.\n    // TODO: verifyScalar function which consumes lambda\n    const [[a1, b1], [a2, b2]] = basis;\n    const c1 = divNearest(b2 * k, n);\n    const c2 = divNearest(-b1 * k, n);\n    // |k1|/|k2| is < sqrt(N), but can be negative.\n    // If we do `k1 mod N`, we'll get big scalar (`> sqrt(N)`): so, we do cheaper negation instead.\n    let k1 = k - c1 * a1 - c2 * a2;\n    let k2 = -c1 * b1 - c2 * b2;\n    const k1neg = k1 < _0n;\n    const k2neg = k2 < _0n;\n    if (k1neg)\n        k1 = -k1;\n    if (k2neg)\n        k2 = -k2;\n    // Double check that resulting scalar less than half bits of N: otherwise wNAF will fail.\n    // This should only happen on wrong basises. Also, math inside is too complex and I don't trust it.\n    const MAX_NUM = (0, utils_ts_1.bitMask)(Math.ceil((0, utils_ts_1.bitLen)(n) / 2)) + _1n; // Half bits of N\n    if (k1 < _0n || k1 >= MAX_NUM || k2 < _0n || k2 >= MAX_NUM) {\n        throw new Error('splitScalar (endomorphism): failed, k=' + k);\n    }\n    return { k1neg, k1, k2neg, k2 };\n}\nfunction validateSigFormat(format) {\n    if (!['compact', 'recovered', 'der'].includes(format))\n        throw new Error('Signature format must be \"compact\", \"recovered\", or \"der\"');\n    return format;\n}\nfunction validateSigOpts(opts, def) {\n    const optsn = {};\n    for (let optName of Object.keys(def)) {\n        // @ts-ignore\n        optsn[optName] = opts[optName] === undefined ? def[optName] : opts[optName];\n    }\n    (0, utils_ts_1._abool2)(optsn.lowS, 'lowS');\n    (0, utils_ts_1._abool2)(optsn.prehash, 'prehash');\n    if (optsn.format !== undefined)\n        validateSigFormat(optsn.format);\n    return optsn;\n}\nclass DERErr extends Error {\n    constructor(m = '') {\n        super(m);\n    }\n}\nexports.DERErr = DERErr;\n/**\n * ASN.1 DER encoding utilities. ASN is very complex & fragile. Format:\n *\n *     [0x30 (SEQUENCE), bytelength, 0x02 (INTEGER), intLength, R, 0x02 (INTEGER), intLength, S]\n *\n * Docs: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/, https://luca.ntop.org/Teaching/Appunti/asn1.html\n */\nexports.DER = {\n    // asn.1 DER encoding utils\n    Err: DERErr,\n    // Basic building block is TLV (Tag-Length-Value)\n    _tlv: {\n        encode: (tag, data) => {\n            const { Err: E } = exports.DER;\n            if (tag < 0 || tag > 256)\n                throw new E('tlv.encode: wrong tag');\n            if (data.length & 1)\n                throw new E('tlv.encode: unpadded data');\n            const dataLen = data.length / 2;\n            const len = (0, utils_ts_1.numberToHexUnpadded)(dataLen);\n            if ((len.length / 2) & 128)\n                throw new E('tlv.encode: long form length too big');\n            // length of length with long form flag\n            const lenLen = dataLen > 127 ? (0, utils_ts_1.numberToHexUnpadded)((len.length / 2) | 128) : '';\n            const t = (0, utils_ts_1.numberToHexUnpadded)(tag);\n            return t + lenLen + len + data;\n        },\n        // v - value, l - left bytes (unparsed)\n        decode(tag, data) {\n            const { Err: E } = exports.DER;\n            let pos = 0;\n            if (tag < 0 || tag > 256)\n                throw new E('tlv.encode: wrong tag');\n            if (data.length < 2 || data[pos++] !== tag)\n                throw new E('tlv.decode: wrong tlv');\n            const first = data[pos++];\n            const isLong = !!(first & 128); // First bit of first length byte is flag for short/long form\n            let length = 0;\n            if (!isLong)\n                length = first;\n            else {\n                // Long form: [longFlag(1bit), lengthLength(7bit), length (BE)]\n                const lenLen = first & 127;\n                if (!lenLen)\n                    throw new E('tlv.decode(long): indefinite length not supported');\n                if (lenLen > 4)\n                    throw new E('tlv.decode(long): byte length is too big'); // this will overflow u32 in js\n                const lengthBytes = data.subarray(pos, pos + lenLen);\n                if (lengthBytes.length !== lenLen)\n                    throw new E('tlv.decode: length bytes not complete');\n                if (lengthBytes[0] === 0)\n                    throw new E('tlv.decode(long): zero leftmost byte');\n                for (const b of lengthBytes)\n                    length = (length << 8) | b;\n                pos += lenLen;\n                if (length < 128)\n                    throw new E('tlv.decode(long): not minimal encoding');\n            }\n            const v = data.subarray(pos, pos + length);\n            if (v.length !== length)\n                throw new E('tlv.decode: wrong value length');\n            return { v, l: data.subarray(pos + length) };\n        },\n    },\n    // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n    // since we always use positive integers here. It must always be empty:\n    // - add zero byte if exists\n    // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n    _int: {\n        encode(num) {\n            const { Err: E } = exports.DER;\n            if (num < _0n)\n                throw new E('integer: negative integers are not allowed');\n            let hex = (0, utils_ts_1.numberToHexUnpadded)(num);\n            // Pad with zero byte if negative flag is present\n            if (Number.parseInt(hex[0], 16) & 0b1000)\n                hex = '00' + hex;\n            if (hex.length & 1)\n                throw new E('unexpected DER parsing assertion: unpadded hex');\n            return hex;\n        },\n        decode(data) {\n            const { Err: E } = exports.DER;\n            if (data[0] & 128)\n                throw new E('invalid signature integer: negative');\n            if (data[0] === 0x00 && !(data[1] & 128))\n                throw new E('invalid signature integer: unnecessary leading zero');\n            return (0, utils_ts_1.bytesToNumberBE)(data);\n        },\n    },\n    toSig(hex) {\n        // parse DER signature\n        const { Err: E, _int: int, _tlv: tlv } = exports.DER;\n        const data = (0, utils_ts_1.ensureBytes)('signature', hex);\n        const { v: seqBytes, l: seqLeftBytes } = tlv.decode(0x30, data);\n        if (seqLeftBytes.length)\n            throw new E('invalid signature: left bytes after parsing');\n        const { v: rBytes, l: rLeftBytes } = tlv.decode(0x02, seqBytes);\n        const { v: sBytes, l: sLeftBytes } = tlv.decode(0x02, rLeftBytes);\n        if (sLeftBytes.length)\n            throw new E('invalid signature: left bytes after parsing');\n        return { r: int.decode(rBytes), s: int.decode(sBytes) };\n    },\n    hexFromSig(sig) {\n        const { _tlv: tlv, _int: int } = exports.DER;\n        const rs = tlv.encode(0x02, int.encode(sig.r));\n        const ss = tlv.encode(0x02, int.encode(sig.s));\n        const seq = rs + ss;\n        return tlv.encode(0x30, seq);\n    },\n};\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\nfunction _normFnElement(Fn, key) {\n    const { BYTES: expected } = Fn;\n    let num;\n    if (typeof key === 'bigint') {\n        num = key;\n    }\n    else {\n        let bytes = (0, utils_ts_1.ensureBytes)('private key', key);\n        try {\n            num = Fn.fromBytes(bytes);\n        }\n        catch (error) {\n            throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof key}`);\n        }\n    }\n    if (!Fn.isValidNot0(num))\n        throw new Error('invalid private key: out of range [1..N-1]');\n    return num;\n}\n/**\n * Creates weierstrass Point constructor, based on specified curve options.\n *\n * @example\n```js\nconst opts = {\n  p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'),\n  n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'),\n  h: BigInt(1),\n  a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'),\n  b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'),\n  Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'),\n  Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'),\n};\nconst p256_Point = weierstrass(opts);\n```\n */\nfunction weierstrassN(params, extraOpts = {}) {\n    const validated = (0, curve_ts_1._createCurveFields)('weierstrass', params, extraOpts);\n    const { Fp, Fn } = validated;\n    let CURVE = validated.CURVE;\n    const { h: cofactor, n: CURVE_ORDER } = CURVE;\n    (0, utils_ts_1._validateObject)(extraOpts, {}, {\n        allowInfinityPoint: 'boolean',\n        clearCofactor: 'function',\n        isTorsionFree: 'function',\n        fromBytes: 'function',\n        toBytes: 'function',\n        endo: 'object',\n        wrapPrivateKey: 'boolean',\n    });\n    const { endo } = extraOpts;\n    if (endo) {\n        // validateObject(endo, { beta: 'bigint', splitScalar: 'function' });\n        if (!Fp.is0(CURVE.a) || typeof endo.beta !== 'bigint' || !Array.isArray(endo.basises)) {\n            throw new Error('invalid endo: expected \"beta\": bigint and \"basises\": array');\n        }\n    }\n    const lengths = getWLengths(Fp, Fn);\n    function assertCompressionIsSupported() {\n        if (!Fp.isOdd)\n            throw new Error('compression is not supported: Field does not have .isOdd()');\n    }\n    // Implements IEEE P1363 point encoding\n    function pointToBytes(_c, point, isCompressed) {\n        const { x, y } = point.toAffine();\n        const bx = Fp.toBytes(x);\n        (0, utils_ts_1._abool2)(isCompressed, 'isCompressed');\n        if (isCompressed) {\n            assertCompressionIsSupported();\n            const hasEvenY = !Fp.isOdd(y);\n            return (0, utils_ts_1.concatBytes)(pprefix(hasEvenY), bx);\n        }\n        else {\n            return (0, utils_ts_1.concatBytes)(Uint8Array.of(0x04), bx, Fp.toBytes(y));\n        }\n    }\n    function pointFromBytes(bytes) {\n        (0, utils_ts_1._abytes2)(bytes, undefined, 'Point');\n        const { publicKey: comp, publicKeyUncompressed: uncomp } = lengths; // e.g. for 32-byte: 33, 65\n        const length = bytes.length;\n        const head = bytes[0];\n        const tail = bytes.subarray(1);\n        // No actual validation is done here: use .assertValidity()\n        if (length === comp && (head === 0x02 || head === 0x03)) {\n            const x = Fp.fromBytes(tail);\n            if (!Fp.isValid(x))\n                throw new Error('bad point: is not on curve, wrong x');\n            const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n            let y;\n            try {\n                y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n            }\n            catch (sqrtError) {\n                const err = sqrtError instanceof Error ? ': ' + sqrtError.message : '';\n                throw new Error('bad point: is not on curve, sqrt error' + err);\n            }\n            assertCompressionIsSupported();\n            const isYOdd = Fp.isOdd(y); // (y & _1n) === _1n;\n            const isHeadOdd = (head & 1) === 1; // ECDSA-specific\n            if (isHeadOdd !== isYOdd)\n                y = Fp.neg(y);\n            return { x, y };\n        }\n        else if (length === uncomp && head === 0x04) {\n            // TODO: more checks\n            const L = Fp.BYTES;\n            const x = Fp.fromBytes(tail.subarray(0, L));\n            const y = Fp.fromBytes(tail.subarray(L, L * 2));\n            if (!isValidXY(x, y))\n                throw new Error('bad point: is not on curve');\n            return { x, y };\n        }\n        else {\n            throw new Error(`bad point: got length ${length}, expected compressed=${comp} or uncompressed=${uncomp}`);\n        }\n    }\n    const encodePoint = extraOpts.toBytes || pointToBytes;\n    const decodePoint = extraOpts.fromBytes || pointFromBytes;\n    function weierstrassEquation(x) {\n        const x2 = Fp.sqr(x); // x * x\n        const x3 = Fp.mul(x2, x); // x² * x\n        return Fp.add(Fp.add(x3, Fp.mul(x, CURVE.a)), CURVE.b); // x³ + a * x + b\n    }\n    // TODO: move top-level\n    /** Checks whether equation holds for given x, y: y² == x³ + ax + b */\n    function isValidXY(x, y) {\n        const left = Fp.sqr(y); // y²\n        const right = weierstrassEquation(x); // x³ + ax + b\n        return Fp.eql(left, right);\n    }\n    // Validate whether the passed curve params are valid.\n    // Test 1: equation y² = x³ + ax + b should work for generator point.\n    if (!isValidXY(CURVE.Gx, CURVE.Gy))\n        throw new Error('bad curve params: generator point');\n    // Test 2: discriminant Δ part should be non-zero: 4a³ + 27b² != 0.\n    // Guarantees curve is genus-1, smooth (non-singular).\n    const _4a3 = Fp.mul(Fp.pow(CURVE.a, _3n), _4n);\n    const _27b2 = Fp.mul(Fp.sqr(CURVE.b), BigInt(27));\n    if (Fp.is0(Fp.add(_4a3, _27b2)))\n        throw new Error('bad curve params: a or b');\n    /** Asserts coordinate is valid: 0 <= n < Fp.ORDER. */\n    function acoord(title, n, banZero = false) {\n        if (!Fp.isValid(n) || (banZero && Fp.is0(n)))\n            throw new Error(`bad point coordinate ${title}`);\n        return n;\n    }\n    function aprjpoint(other) {\n        if (!(other instanceof Point))\n            throw new Error('ProjectivePoint expected');\n    }\n    function splitEndoScalarN(k) {\n        if (!endo || !endo.basises)\n            throw new Error('no endo');\n        return _splitEndoScalar(k, endo.basises, Fn.ORDER);\n    }\n    // Memoized toAffine / validity check. They are heavy. Points are immutable.\n    // Converts Projective point to affine (x, y) coordinates.\n    // Can accept precomputed Z^-1 - for example, from invertBatch.\n    // (X, Y, Z) ∋ (x=X/Z, y=Y/Z)\n    const toAffineMemo = (0, utils_ts_1.memoized)((p, iz) => {\n        const { X, Y, Z } = p;\n        // Fast-path for normalized points\n        if (Fp.eql(Z, Fp.ONE))\n            return { x: X, y: Y };\n        const is0 = p.is0();\n        // If invZ was 0, we return zero point. However we still want to execute\n        // all operations, so we replace invZ with a random number, 1.\n        if (iz == null)\n            iz = is0 ? Fp.ONE : Fp.inv(Z);\n        const x = Fp.mul(X, iz);\n        const y = Fp.mul(Y, iz);\n        const zz = Fp.mul(Z, iz);\n        if (is0)\n            return { x: Fp.ZERO, y: Fp.ZERO };\n        if (!Fp.eql(zz, Fp.ONE))\n            throw new Error('invZ was invalid');\n        return { x, y };\n    });\n    // NOTE: on exception this will crash 'cached' and no value will be set.\n    // Otherwise true will be return\n    const assertValidMemo = (0, utils_ts_1.memoized)((p) => {\n        if (p.is0()) {\n            // (0, 1, 0) aka ZERO is invalid in most contexts.\n            // In BLS, ZERO can be serialized, so we allow it.\n            // (0, 0, 0) is invalid representation of ZERO.\n            if (extraOpts.allowInfinityPoint && !Fp.is0(p.Y))\n                return;\n            throw new Error('bad point: ZERO');\n        }\n        // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n        const { x, y } = p.toAffine();\n        if (!Fp.isValid(x) || !Fp.isValid(y))\n            throw new Error('bad point: x or y not field elements');\n        if (!isValidXY(x, y))\n            throw new Error('bad point: equation left != right');\n        if (!p.isTorsionFree())\n            throw new Error('bad point: not in prime-order subgroup');\n        return true;\n    });\n    function finishEndo(endoBeta, k1p, k2p, k1neg, k2neg) {\n        k2p = new Point(Fp.mul(k2p.X, endoBeta), k2p.Y, k2p.Z);\n        k1p = (0, curve_ts_1.negateCt)(k1neg, k1p);\n        k2p = (0, curve_ts_1.negateCt)(k2neg, k2p);\n        return k1p.add(k2p);\n    }\n    /**\n     * Projective Point works in 3d / projective (homogeneous) coordinates:(X, Y, Z) ∋ (x=X/Z, y=Y/Z).\n     * Default Point works in 2d / affine coordinates: (x, y).\n     * We're doing calculations in projective, because its operations don't require costly inversion.\n     */\n    class Point {\n        /** Does NOT validate if the point is valid. Use `.assertValidity()`. */\n        constructor(X, Y, Z) {\n            this.X = acoord('x', X);\n            this.Y = acoord('y', Y, true);\n            this.Z = acoord('z', Z);\n            Object.freeze(this);\n        }\n        static CURVE() {\n            return CURVE;\n        }\n        /** Does NOT validate if the point is valid. Use `.assertValidity()`. */\n        static fromAffine(p) {\n            const { x, y } = p || {};\n            if (!p || !Fp.isValid(x) || !Fp.isValid(y))\n                throw new Error('invalid affine point');\n            if (p instanceof Point)\n                throw new Error('projective point not allowed');\n            // (0, 0) would've produced (0, 0, 1) - instead, we need (0, 1, 0)\n            if (Fp.is0(x) && Fp.is0(y))\n                return Point.ZERO;\n            return new Point(x, y, Fp.ONE);\n        }\n        static fromBytes(bytes) {\n            const P = Point.fromAffine(decodePoint((0, utils_ts_1._abytes2)(bytes, undefined, 'point')));\n            P.assertValidity();\n            return P;\n        }\n        static fromHex(hex) {\n            return Point.fromBytes((0, utils_ts_1.ensureBytes)('pointHex', hex));\n        }\n        get x() {\n            return this.toAffine().x;\n        }\n        get y() {\n            return this.toAffine().y;\n        }\n        /**\n         *\n         * @param windowSize\n         * @param isLazy true will defer table computation until the first multiplication\n         * @returns\n         */\n        precompute(windowSize = 8, isLazy = true) {\n            wnaf.createCache(this, windowSize);\n            if (!isLazy)\n                this.multiply(_3n); // random number\n            return this;\n        }\n        // TODO: return `this`\n        /** A point on curve is valid if it conforms to equation. */\n        assertValidity() {\n            assertValidMemo(this);\n        }\n        hasEvenY() {\n            const { y } = this.toAffine();\n            if (!Fp.isOdd)\n                throw new Error(\"Field doesn't support isOdd\");\n            return !Fp.isOdd(y);\n        }\n        /** Compare one point to another. */\n        equals(other) {\n            aprjpoint(other);\n            const { X: X1, Y: Y1, Z: Z1 } = this;\n            const { X: X2, Y: Y2, Z: Z2 } = other;\n            const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n            const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n            return U1 && U2;\n        }\n        /** Flips point to one corresponding to (x, -y) in Affine coordinates. */\n        negate() {\n            return new Point(this.X, Fp.neg(this.Y), this.Z);\n        }\n        // Renes-Costello-Batina exception-free doubling formula.\n        // There is 30% faster Jacobian formula, but it is not complete.\n        // https://eprint.iacr.org/2015/1060, algorithm 3\n        // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n        double() {\n            const { a, b } = CURVE;\n            const b3 = Fp.mul(b, _3n);\n            const { X: X1, Y: Y1, Z: Z1 } = this;\n            let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n            let t0 = Fp.mul(X1, X1); // step 1\n            let t1 = Fp.mul(Y1, Y1);\n            let t2 = Fp.mul(Z1, Z1);\n            let t3 = Fp.mul(X1, Y1);\n            t3 = Fp.add(t3, t3); // step 5\n            Z3 = Fp.mul(X1, Z1);\n            Z3 = Fp.add(Z3, Z3);\n            X3 = Fp.mul(a, Z3);\n            Y3 = Fp.mul(b3, t2);\n            Y3 = Fp.add(X3, Y3); // step 10\n            X3 = Fp.sub(t1, Y3);\n            Y3 = Fp.add(t1, Y3);\n            Y3 = Fp.mul(X3, Y3);\n            X3 = Fp.mul(t3, X3);\n            Z3 = Fp.mul(b3, Z3); // step 15\n            t2 = Fp.mul(a, t2);\n            t3 = Fp.sub(t0, t2);\n            t3 = Fp.mul(a, t3);\n            t3 = Fp.add(t3, Z3);\n            Z3 = Fp.add(t0, t0); // step 20\n            t0 = Fp.add(Z3, t0);\n            t0 = Fp.add(t0, t2);\n            t0 = Fp.mul(t0, t3);\n            Y3 = Fp.add(Y3, t0);\n            t2 = Fp.mul(Y1, Z1); // step 25\n            t2 = Fp.add(t2, t2);\n            t0 = Fp.mul(t2, t3);\n            X3 = Fp.sub(X3, t0);\n            Z3 = Fp.mul(t2, t1);\n            Z3 = Fp.add(Z3, Z3); // step 30\n            Z3 = Fp.add(Z3, Z3);\n            return new Point(X3, Y3, Z3);\n        }\n        // Renes-Costello-Batina exception-free addition formula.\n        // There is 30% faster Jacobian formula, but it is not complete.\n        // https://eprint.iacr.org/2015/1060, algorithm 1\n        // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n        add(other) {\n            aprjpoint(other);\n            const { X: X1, Y: Y1, Z: Z1 } = this;\n            const { X: X2, Y: Y2, Z: Z2 } = other;\n            let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n            const a = CURVE.a;\n            const b3 = Fp.mul(CURVE.b, _3n);\n            let t0 = Fp.mul(X1, X2); // step 1\n            let t1 = Fp.mul(Y1, Y2);\n            let t2 = Fp.mul(Z1, Z2);\n            let t3 = Fp.add(X1, Y1);\n            let t4 = Fp.add(X2, Y2); // step 5\n            t3 = Fp.mul(t3, t4);\n            t4 = Fp.add(t0, t1);\n            t3 = Fp.sub(t3, t4);\n            t4 = Fp.add(X1, Z1);\n            let t5 = Fp.add(X2, Z2); // step 10\n            t4 = Fp.mul(t4, t5);\n            t5 = Fp.add(t0, t2);\n            t4 = Fp.sub(t4, t5);\n            t5 = Fp.add(Y1, Z1);\n            X3 = Fp.add(Y2, Z2); // step 15\n            t5 = Fp.mul(t5, X3);\n            X3 = Fp.add(t1, t2);\n            t5 = Fp.sub(t5, X3);\n            Z3 = Fp.mul(a, t4);\n            X3 = Fp.mul(b3, t2); // step 20\n            Z3 = Fp.add(X3, Z3);\n            X3 = Fp.sub(t1, Z3);\n            Z3 = Fp.add(t1, Z3);\n            Y3 = Fp.mul(X3, Z3);\n            t1 = Fp.add(t0, t0); // step 25\n            t1 = Fp.add(t1, t0);\n            t2 = Fp.mul(a, t2);\n            t4 = Fp.mul(b3, t4);\n            t1 = Fp.add(t1, t2);\n            t2 = Fp.sub(t0, t2); // step 30\n            t2 = Fp.mul(a, t2);\n            t4 = Fp.add(t4, t2);\n            t0 = Fp.mul(t1, t4);\n            Y3 = Fp.add(Y3, t0);\n            t0 = Fp.mul(t5, t4); // step 35\n            X3 = Fp.mul(t3, X3);\n            X3 = Fp.sub(X3, t0);\n            t0 = Fp.mul(t3, t1);\n            Z3 = Fp.mul(t5, Z3);\n            Z3 = Fp.add(Z3, t0); // step 40\n            return new Point(X3, Y3, Z3);\n        }\n        subtract(other) {\n            return this.add(other.negate());\n        }\n        is0() {\n            return this.equals(Point.ZERO);\n        }\n        /**\n         * Constant time multiplication.\n         * Uses wNAF method. Windowed method may be 10% faster,\n         * but takes 2x longer to generate and consumes 2x memory.\n         * Uses precomputes when available.\n         * Uses endomorphism for Koblitz curves.\n         * @param scalar by which the point would be multiplied\n         * @returns New point\n         */\n        multiply(scalar) {\n            const { endo } = extraOpts;\n            if (!Fn.isValidNot0(scalar))\n                throw new Error('invalid scalar: out of range'); // 0 is invalid\n            let point, fake; // Fake point is used to const-time mult\n            const mul = (n) => wnaf.cached(this, n, (p) => (0, curve_ts_1.normalizeZ)(Point, p));\n            /** See docs for {@link EndomorphismOpts} */\n            if (endo) {\n                const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar);\n                const { p: k1p, f: k1f } = mul(k1);\n                const { p: k2p, f: k2f } = mul(k2);\n                fake = k1f.add(k2f);\n                point = finishEndo(endo.beta, k1p, k2p, k1neg, k2neg);\n            }\n            else {\n                const { p, f } = mul(scalar);\n                point = p;\n                fake = f;\n            }\n            // Normalize `z` for both points, but return only real one\n            return (0, curve_ts_1.normalizeZ)(Point, [point, fake])[0];\n        }\n        /**\n         * Non-constant-time multiplication. Uses double-and-add algorithm.\n         * It's faster, but should only be used when you don't care about\n         * an exposed secret key e.g. sig verification, which works over *public* keys.\n         */\n        multiplyUnsafe(sc) {\n            const { endo } = extraOpts;\n            const p = this;\n            if (!Fn.isValid(sc))\n                throw new Error('invalid scalar: out of range'); // 0 is valid\n            if (sc === _0n || p.is0())\n                return Point.ZERO;\n            if (sc === _1n)\n                return p; // fast-path\n            if (wnaf.hasCache(this))\n                return this.multiply(sc);\n            if (endo) {\n                const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc);\n                const { p1, p2 } = (0, curve_ts_1.mulEndoUnsafe)(Point, p, k1, k2); // 30% faster vs wnaf.unsafe\n                return finishEndo(endo.beta, p1, p2, k1neg, k2neg);\n            }\n            else {\n                return wnaf.unsafe(p, sc);\n            }\n        }\n        multiplyAndAddUnsafe(Q, a, b) {\n            const sum = this.multiplyUnsafe(a).add(Q.multiplyUnsafe(b));\n            return sum.is0() ? undefined : sum;\n        }\n        /**\n         * Converts Projective point to affine (x, y) coordinates.\n         * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch\n         */\n        toAffine(invertedZ) {\n            return toAffineMemo(this, invertedZ);\n        }\n        /**\n         * Checks whether Point is free of torsion elements (is in prime subgroup).\n         * Always torsion-free for cofactor=1 curves.\n         */\n        isTorsionFree() {\n            const { isTorsionFree } = extraOpts;\n            if (cofactor === _1n)\n                return true;\n            if (isTorsionFree)\n                return isTorsionFree(Point, this);\n            return wnaf.unsafe(this, CURVE_ORDER).is0();\n        }\n        clearCofactor() {\n            const { clearCofactor } = extraOpts;\n            if (cofactor === _1n)\n                return this; // Fast-path\n            if (clearCofactor)\n                return clearCofactor(Point, this);\n            return this.multiplyUnsafe(cofactor);\n        }\n        isSmallOrder() {\n            // can we use this.clearCofactor()?\n            return this.multiplyUnsafe(cofactor).is0();\n        }\n        toBytes(isCompressed = true) {\n            (0, utils_ts_1._abool2)(isCompressed, 'isCompressed');\n            this.assertValidity();\n            return encodePoint(Point, this, isCompressed);\n        }\n        toHex(isCompressed = true) {\n            return (0, utils_ts_1.bytesToHex)(this.toBytes(isCompressed));\n        }\n        toString() {\n            return `<Point ${this.is0() ? 'ZERO' : this.toHex()}>`;\n        }\n        // TODO: remove\n        get px() {\n            return this.X;\n        }\n        get py() {\n            return this.X;\n        }\n        get pz() {\n            return this.Z;\n        }\n        toRawBytes(isCompressed = true) {\n            return this.toBytes(isCompressed);\n        }\n        _setWindowSize(windowSize) {\n            this.precompute(windowSize);\n        }\n        static normalizeZ(points) {\n            return (0, curve_ts_1.normalizeZ)(Point, points);\n        }\n        static msm(points, scalars) {\n            return (0, curve_ts_1.pippenger)(Point, Fn, points, scalars);\n        }\n        static fromPrivateKey(privateKey) {\n            return Point.BASE.multiply(_normFnElement(Fn, privateKey));\n        }\n    }\n    // base / generator point\n    Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n    // zero / infinity / identity point\n    Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO); // 0, 1, 0\n    // math field\n    Point.Fp = Fp;\n    // scalar field\n    Point.Fn = Fn;\n    const bits = Fn.BITS;\n    const wnaf = new curve_ts_1.wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits);\n    Point.BASE.precompute(8); // Enable precomputes. Slows down first publicKey computation by 20ms.\n    return Point;\n}\n// Points start with byte 0x02 when y is even; otherwise 0x03\nfunction pprefix(hasEvenY) {\n    return Uint8Array.of(hasEvenY ? 0x02 : 0x03);\n}\n/**\n * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.\n * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.\n * b = True and y = sqrt(u / v) if (u / v) is square in F, and\n * b = False and y = sqrt(Z * (u / v)) otherwise.\n * @param Fp\n * @param Z\n * @returns\n */\nfunction SWUFpSqrtRatio(Fp, Z) {\n    // Generic implementation\n    const q = Fp.ORDER;\n    let l = _0n;\n    for (let o = q - _1n; o % _2n === _0n; o /= _2n)\n        l += _1n;\n    const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n    // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.\n    // 2n ** c1 == 2n << (c1-1)\n    const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);\n    const _2n_pow_c1 = _2n_pow_c1_1 * _2n;\n    const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1)  # Integer arithmetic\n    const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2            # Integer arithmetic\n    const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1                # Integer arithmetic\n    const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1)                  # Integer arithmetic\n    const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n    const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n    let sqrtRatio = (u, v) => {\n        let tv1 = c6; // 1. tv1 = c6\n        let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n        let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n        tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n        let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n        tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n        tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n        tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n        tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n        let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n        tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n        let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n        tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n        tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n        tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n        tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n        // 17. for i in (c1, c1 - 1, ..., 2):\n        for (let i = c1; i > _1n; i--) {\n            let tv5 = i - _2n; // 18.    tv5 = i - 2\n            tv5 = _2n << (tv5 - _1n); // 19.    tv5 = 2^tv5\n            let tvv5 = Fp.pow(tv4, tv5); // 20.    tv5 = tv4^tv5\n            const e1 = Fp.eql(tvv5, Fp.ONE); // 21.    e1 = tv5 == 1\n            tv2 = Fp.mul(tv3, tv1); // 22.    tv2 = tv3 * tv1\n            tv1 = Fp.mul(tv1, tv1); // 23.    tv1 = tv1 * tv1\n            tvv5 = Fp.mul(tv4, tv1); // 24.    tv5 = tv4 * tv1\n            tv3 = Fp.cmov(tv2, tv3, e1); // 25.    tv3 = CMOV(tv2, tv3, e1)\n            tv4 = Fp.cmov(tvv5, tv4, e1); // 26.    tv4 = CMOV(tv5, tv4, e1)\n        }\n        return { isValid: isQR, value: tv3 };\n    };\n    if (Fp.ORDER % _4n === _3n) {\n        // sqrt_ratio_3mod4(u, v)\n        const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4     # Integer arithmetic\n        const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n        sqrtRatio = (u, v) => {\n            let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n            const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n            tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n            let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n            y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n            const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n            const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n            const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n            let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n            return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n        };\n    }\n    // No curves uses that\n    // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n    return sqrtRatio;\n}\n/**\n * Simplified Shallue-van de Woestijne-Ulas Method\n * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2\n */\nfunction mapToCurveSimpleSWU(Fp, opts) {\n    (0, modular_ts_1.validateField)(Fp);\n    const { A, B, Z } = opts;\n    if (!Fp.isValid(A) || !Fp.isValid(B) || !Fp.isValid(Z))\n        throw new Error('mapToCurveSimpleSWU: invalid opts');\n    const sqrtRatio = SWUFpSqrtRatio(Fp, Z);\n    if (!Fp.isOdd)\n        throw new Error('Field does not have .isOdd()');\n    // Input: u, an element of F.\n    // Output: (x, y), a point on E.\n    return (u) => {\n        // prettier-ignore\n        let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n        tv1 = Fp.sqr(u); // 1.  tv1 = u^2\n        tv1 = Fp.mul(tv1, Z); // 2.  tv1 = Z * tv1\n        tv2 = Fp.sqr(tv1); // 3.  tv2 = tv1^2\n        tv2 = Fp.add(tv2, tv1); // 4.  tv2 = tv2 + tv1\n        tv3 = Fp.add(tv2, Fp.ONE); // 5.  tv3 = tv2 + 1\n        tv3 = Fp.mul(tv3, B); // 6.  tv3 = B * tv3\n        tv4 = Fp.cmov(Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7.  tv4 = CMOV(Z, -tv2, tv2 != 0)\n        tv4 = Fp.mul(tv4, A); // 8.  tv4 = A * tv4\n        tv2 = Fp.sqr(tv3); // 9.  tv2 = tv3^2\n        tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n        tv5 = Fp.mul(tv6, A); // 11. tv5 = A * tv6\n        tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n        tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n        tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n        tv5 = Fp.mul(tv6, B); // 15. tv5 = B * tv6\n        tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n        x = Fp.mul(tv1, tv3); // 17.   x = tv1 * tv3\n        const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n        y = Fp.mul(tv1, u); // 19.   y = tv1 * u  -> Z * u^3 * y1\n        y = Fp.mul(y, value); // 20.   y = y * y1\n        x = Fp.cmov(x, tv3, isValid); // 21.   x = CMOV(x, tv3, is_gx1_square)\n        y = Fp.cmov(y, value, isValid); // 22.   y = CMOV(y, y1, is_gx1_square)\n        const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23.  e1 = sgn0(u) == sgn0(y)\n        y = Fp.cmov(Fp.neg(y), y, e1); // 24.   y = CMOV(-y, y, e1)\n        const tv4_inv = (0, modular_ts_1.FpInvertBatch)(Fp, [tv4], true)[0];\n        x = Fp.mul(x, tv4_inv); // 25.   x = x / tv4\n        return { x, y };\n    };\n}\nfunction getWLengths(Fp, Fn) {\n    return {\n        secretKey: Fn.BYTES,\n        publicKey: 1 + Fp.BYTES,\n        publicKeyUncompressed: 1 + 2 * Fp.BYTES,\n        publicKeyHasPrefix: true,\n        signature: 2 * Fn.BYTES,\n    };\n}\n/**\n * Sometimes users only need getPublicKey, getSharedSecret, and secret key handling.\n * This helper ensures no signature functionality is present. Less code, smaller bundle size.\n */\nfunction ecdh(Point, ecdhOpts = {}) {\n    const { Fn } = Point;\n    const randomBytes_ = ecdhOpts.randomBytes || utils_ts_1.randomBytes;\n    const lengths = Object.assign(getWLengths(Point.Fp, Fn), { seed: (0, modular_ts_1.getMinHashLength)(Fn.ORDER) });\n    function isValidSecretKey(secretKey) {\n        try {\n            return !!_normFnElement(Fn, secretKey);\n        }\n        catch (error) {\n            return false;\n        }\n    }\n    function isValidPublicKey(publicKey, isCompressed) {\n        const { publicKey: comp, publicKeyUncompressed } = lengths;\n        try {\n            const l = publicKey.length;\n            if (isCompressed === true && l !== comp)\n                return false;\n            if (isCompressed === false && l !== publicKeyUncompressed)\n                return false;\n            return !!Point.fromBytes(publicKey);\n        }\n        catch (error) {\n            return false;\n        }\n    }\n    /**\n     * Produces cryptographically secure secret key from random of size\n     * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.\n     */\n    function randomSecretKey(seed = randomBytes_(lengths.seed)) {\n        return (0, modular_ts_1.mapHashToField)((0, utils_ts_1._abytes2)(seed, lengths.seed, 'seed'), Fn.ORDER);\n    }\n    /**\n     * Computes public key for a secret key. Checks for validity of the secret key.\n     * @param isCompressed whether to return compact (default), or full key\n     * @returns Public key, full when isCompressed=false; short when isCompressed=true\n     */\n    function getPublicKey(secretKey, isCompressed = true) {\n        return Point.BASE.multiply(_normFnElement(Fn, secretKey)).toBytes(isCompressed);\n    }\n    function keygen(seed) {\n        const secretKey = randomSecretKey(seed);\n        return { secretKey, publicKey: getPublicKey(secretKey) };\n    }\n    /**\n     * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n     */\n    function isProbPub(item) {\n        if (typeof item === 'bigint')\n            return false;\n        if (item instanceof Point)\n            return true;\n        const { secretKey, publicKey, publicKeyUncompressed } = lengths;\n        if (Fn.allowedLengths || secretKey === publicKey)\n            return undefined;\n        const l = (0, utils_ts_1.ensureBytes)('key', item).length;\n        return l === publicKey || l === publicKeyUncompressed;\n    }\n    /**\n     * ECDH (Elliptic Curve Diffie Hellman).\n     * Computes shared public key from secret key A and public key B.\n     * Checks: 1) secret key validity 2) shared key is on-curve.\n     * Does NOT hash the result.\n     * @param isCompressed whether to return compact (default), or full key\n     * @returns shared public key\n     */\n    function getSharedSecret(secretKeyA, publicKeyB, isCompressed = true) {\n        if (isProbPub(secretKeyA) === true)\n            throw new Error('first arg must be private key');\n        if (isProbPub(publicKeyB) === false)\n            throw new Error('second arg must be public key');\n        const s = _normFnElement(Fn, secretKeyA);\n        const b = Point.fromHex(publicKeyB); // checks for being on-curve\n        return b.multiply(s).toBytes(isCompressed);\n    }\n    const utils = {\n        isValidSecretKey,\n        isValidPublicKey,\n        randomSecretKey,\n        // TODO: remove\n        isValidPrivateKey: isValidSecretKey,\n        randomPrivateKey: randomSecretKey,\n        normPrivateKeyToScalar: (key) => _normFnElement(Fn, key),\n        precompute(windowSize = 8, point = Point.BASE) {\n            return point.precompute(windowSize, false);\n        },\n    };\n    return Object.freeze({ getPublicKey, getSharedSecret, keygen, Point, utils, lengths });\n}\n/**\n * Creates ECDSA signing interface for given elliptic curve `Point` and `hash` function.\n * We need `hash` for 2 features:\n * 1. Message prehash-ing. NOT used if `sign` / `verify` are called with `prehash: false`\n * 2. k generation in `sign`, using HMAC-drbg(hash)\n *\n * ECDSAOpts are only rarely needed.\n *\n * @example\n * ```js\n * const p256_Point = weierstrass(...);\n * const p256_sha256 = ecdsa(p256_Point, sha256);\n * const p256_sha224 = ecdsa(p256_Point, sha224);\n * const p256_sha224_r = ecdsa(p256_Point, sha224, { randomBytes: (length) => { ... } });\n * ```\n */\nfunction ecdsa(Point, hash, ecdsaOpts = {}) {\n    (0, utils_1.ahash)(hash);\n    (0, utils_ts_1._validateObject)(ecdsaOpts, {}, {\n        hmac: 'function',\n        lowS: 'boolean',\n        randomBytes: 'function',\n        bits2int: 'function',\n        bits2int_modN: 'function',\n    });\n    const randomBytes = ecdsaOpts.randomBytes || utils_ts_1.randomBytes;\n    const hmac = ecdsaOpts.hmac ||\n        ((key, ...msgs) => (0, hmac_js_1.hmac)(hash, key, (0, utils_ts_1.concatBytes)(...msgs)));\n    const { Fp, Fn } = Point;\n    const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn;\n    const { keygen, getPublicKey, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts);\n    const defaultSigOpts = {\n        prehash: false,\n        lowS: typeof ecdsaOpts.lowS === 'boolean' ? ecdsaOpts.lowS : false,\n        format: undefined, //'compact' as ECDSASigFormat,\n        extraEntropy: false,\n    };\n    const defaultSigOpts_format = 'compact';\n    function isBiggerThanHalfOrder(number) {\n        const HALF = CURVE_ORDER >> _1n;\n        return number > HALF;\n    }\n    function validateRS(title, num) {\n        if (!Fn.isValidNot0(num))\n            throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`);\n        return num;\n    }\n    function validateSigLength(bytes, format) {\n        validateSigFormat(format);\n        const size = lengths.signature;\n        const sizer = format === 'compact' ? size : format === 'recovered' ? size + 1 : undefined;\n        return (0, utils_ts_1._abytes2)(bytes, sizer, `${format} signature`);\n    }\n    /**\n     * ECDSA signature with its (r, s) properties. Supports compact, recovered & DER representations.\n     */\n    class Signature {\n        constructor(r, s, recovery) {\n            this.r = validateRS('r', r); // r in [1..N-1];\n            this.s = validateRS('s', s); // s in [1..N-1];\n            if (recovery != null)\n                this.recovery = recovery;\n            Object.freeze(this);\n        }\n        static fromBytes(bytes, format = defaultSigOpts_format) {\n            validateSigLength(bytes, format);\n            let recid;\n            if (format === 'der') {\n                const { r, s } = exports.DER.toSig((0, utils_ts_1._abytes2)(bytes));\n                return new Signature(r, s);\n            }\n            if (format === 'recovered') {\n                recid = bytes[0];\n                format = 'compact';\n                bytes = bytes.subarray(1);\n            }\n            const L = Fn.BYTES;\n            const r = bytes.subarray(0, L);\n            const s = bytes.subarray(L, L * 2);\n            return new Signature(Fn.fromBytes(r), Fn.fromBytes(s), recid);\n        }\n        static fromHex(hex, format) {\n            return this.fromBytes((0, utils_ts_1.hexToBytes)(hex), format);\n        }\n        addRecoveryBit(recovery) {\n            return new Signature(this.r, this.s, recovery);\n        }\n        recoverPublicKey(messageHash) {\n            const FIELD_ORDER = Fp.ORDER;\n            const { r, s, recovery: rec } = this;\n            if (rec == null || ![0, 1, 2, 3].includes(rec))\n                throw new Error('recovery id invalid');\n            // ECDSA recovery is hard for cofactor > 1 curves.\n            // In sign, `r = q.x mod n`, and here we recover q.x from r.\n            // While recovering q.x >= n, we need to add r+n for cofactor=1 curves.\n            // However, for cofactor>1, r+n may not get q.x:\n            // r+n*i would need to be done instead where i is unknown.\n            // To easily get i, we either need to:\n            // a. increase amount of valid recid values (4, 5...); OR\n            // b. prohibit non-prime-order signatures (recid > 1).\n            const hasCofactor = CURVE_ORDER * _2n < FIELD_ORDER;\n            if (hasCofactor && rec > 1)\n                throw new Error('recovery id is ambiguous for h>1 curve');\n            const radj = rec === 2 || rec === 3 ? r + CURVE_ORDER : r;\n            if (!Fp.isValid(radj))\n                throw new Error('recovery id 2 or 3 invalid');\n            const x = Fp.toBytes(radj);\n            const R = Point.fromBytes((0, utils_ts_1.concatBytes)(pprefix((rec & 1) === 0), x));\n            const ir = Fn.inv(radj); // r^-1\n            const h = bits2int_modN((0, utils_ts_1.ensureBytes)('msgHash', messageHash)); // Truncate hash\n            const u1 = Fn.create(-h * ir); // -hr^-1\n            const u2 = Fn.create(s * ir); // sr^-1\n            // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1). unsafe is fine: there is no private data.\n            const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2));\n            if (Q.is0())\n                throw new Error('point at infinify');\n            Q.assertValidity();\n            return Q;\n        }\n        // Signatures should be low-s, to prevent malleability.\n        hasHighS() {\n            return isBiggerThanHalfOrder(this.s);\n        }\n        toBytes(format = defaultSigOpts_format) {\n            validateSigFormat(format);\n            if (format === 'der')\n                return (0, utils_ts_1.hexToBytes)(exports.DER.hexFromSig(this));\n            const r = Fn.toBytes(this.r);\n            const s = Fn.toBytes(this.s);\n            if (format === 'recovered') {\n                if (this.recovery == null)\n                    throw new Error('recovery bit must be present');\n                return (0, utils_ts_1.concatBytes)(Uint8Array.of(this.recovery), r, s);\n            }\n            return (0, utils_ts_1.concatBytes)(r, s);\n        }\n        toHex(format) {\n            return (0, utils_ts_1.bytesToHex)(this.toBytes(format));\n        }\n        // TODO: remove\n        assertValidity() { }\n        static fromCompact(hex) {\n            return Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', hex), 'compact');\n        }\n        static fromDER(hex) {\n            return Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', hex), 'der');\n        }\n        normalizeS() {\n            return this.hasHighS() ? new Signature(this.r, Fn.neg(this.s), this.recovery) : this;\n        }\n        toDERRawBytes() {\n            return this.toBytes('der');\n        }\n        toDERHex() {\n            return (0, utils_ts_1.bytesToHex)(this.toBytes('der'));\n        }\n        toCompactRawBytes() {\n            return this.toBytes('compact');\n        }\n        toCompactHex() {\n            return (0, utils_ts_1.bytesToHex)(this.toBytes('compact'));\n        }\n    }\n    // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n    // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n    // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n    // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n    const bits2int = ecdsaOpts.bits2int ||\n        function bits2int_def(bytes) {\n            // Our custom check \"just in case\", for protection against DoS\n            if (bytes.length > 8192)\n                throw new Error('input is too large');\n            // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n            // for some cases, since bytes.length * 8 is not actual bitLength.\n            const num = (0, utils_ts_1.bytesToNumberBE)(bytes); // check for == u8 done here\n            const delta = bytes.length * 8 - fnBits; // truncate to nBitLength leftmost bits\n            return delta > 0 ? num >> BigInt(delta) : num;\n        };\n    const bits2int_modN = ecdsaOpts.bits2int_modN ||\n        function bits2int_modN_def(bytes) {\n            return Fn.create(bits2int(bytes)); // can't use bytesToNumberBE here\n        };\n    // Pads output with zero as per spec\n    const ORDER_MASK = (0, utils_ts_1.bitMask)(fnBits);\n    /** Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`. */\n    function int2octets(num) {\n        // IMPORTANT: the check ensures working for case `Fn.BYTES != Fn.BITS * 8`\n        (0, utils_ts_1.aInRange)('num < 2^' + fnBits, num, _0n, ORDER_MASK);\n        return Fn.toBytes(num);\n    }\n    function validateMsgAndHash(message, prehash) {\n        (0, utils_ts_1._abytes2)(message, undefined, 'message');\n        return prehash ? (0, utils_ts_1._abytes2)(hash(message), undefined, 'prehashed message') : message;\n    }\n    /**\n     * Steps A, D of RFC6979 3.2.\n     * Creates RFC6979 seed; converts msg/privKey to numbers.\n     * Used only in sign, not in verify.\n     *\n     * Warning: we cannot assume here that message has same amount of bytes as curve order,\n     * this will be invalid at least for P521. Also it can be bigger for P224 + SHA256.\n     */\n    function prepSig(message, privateKey, opts) {\n        if (['recovered', 'canonical'].some((k) => k in opts))\n            throw new Error('sign() legacy options not supported');\n        const { lowS, prehash, extraEntropy } = validateSigOpts(opts, defaultSigOpts);\n        message = validateMsgAndHash(message, prehash); // RFC6979 3.2 A: h1 = H(m)\n        // We can't later call bits2octets, since nested bits2int is broken for curves\n        // with fnBits % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n        // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n        const h1int = bits2int_modN(message);\n        const d = _normFnElement(Fn, privateKey); // validate secret key, convert to bigint\n        const seedArgs = [int2octets(d), int2octets(h1int)];\n        // extraEntropy. RFC6979 3.6: additional k' (optional).\n        if (extraEntropy != null && extraEntropy !== false) {\n            // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n            // gen random bytes OR pass as-is\n            const e = extraEntropy === true ? randomBytes(lengths.secretKey) : extraEntropy;\n            seedArgs.push((0, utils_ts_1.ensureBytes)('extraEntropy', e)); // check for being bytes\n        }\n        const seed = (0, utils_ts_1.concatBytes)(...seedArgs); // Step D of RFC6979 3.2\n        const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n        // Converts signature params into point w r/s, checks result for validity.\n        // To transform k => Signature:\n        // q = k⋅G\n        // r = q.x mod n\n        // s = k^-1(m + rd) mod n\n        // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n        // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n        // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n        function k2sig(kBytes) {\n            // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n            // Important: all mod() calls here must be done over N\n            const k = bits2int(kBytes); // mod n, not mod p\n            if (!Fn.isValidNot0(k))\n                return; // Valid scalars (including k) must be in 1..N-1\n            const ik = Fn.inv(k); // k^-1 mod n\n            const q = Point.BASE.multiply(k).toAffine(); // q = k⋅G\n            const r = Fn.create(q.x); // r = q.x mod n\n            if (r === _0n)\n                return;\n            const s = Fn.create(ik * Fn.create(m + r * d)); // Not using blinding here, see comment above\n            if (s === _0n)\n                return;\n            let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n            let normS = s;\n            if (lowS && isBiggerThanHalfOrder(s)) {\n                normS = Fn.neg(s); // if lowS was passed, ensure s is always\n                recovery ^= 1; // // in the bottom half of N\n            }\n            return new Signature(r, normS, recovery); // use normS, not s\n        }\n        return { seed, k2sig };\n    }\n    /**\n     * Signs message hash with a secret key.\n     *\n     * ```\n     * sign(m, d) where\n     *   k = rfc6979_hmac_drbg(m, d)\n     *   (x, y) = G × k\n     *   r = x mod n\n     *   s = (m + dr) / k mod n\n     * ```\n     */\n    function sign(message, secretKey, opts = {}) {\n        message = (0, utils_ts_1.ensureBytes)('message', message);\n        const { seed, k2sig } = prepSig(message, secretKey, opts); // Steps A, D of RFC6979 3.2.\n        const drbg = (0, utils_ts_1.createHmacDrbg)(hash.outputLen, Fn.BYTES, hmac);\n        const sig = drbg(seed, k2sig); // Steps B, C, D, E, F, G\n        return sig;\n    }\n    function tryParsingSig(sg) {\n        // Try to deduce format\n        let sig = undefined;\n        const isHex = typeof sg === 'string' || (0, utils_ts_1.isBytes)(sg);\n        const isObj = !isHex &&\n            sg !== null &&\n            typeof sg === 'object' &&\n            typeof sg.r === 'bigint' &&\n            typeof sg.s === 'bigint';\n        if (!isHex && !isObj)\n            throw new Error('invalid signature, expected Uint8Array, hex string or Signature instance');\n        if (isObj) {\n            sig = new Signature(sg.r, sg.s);\n        }\n        else if (isHex) {\n            try {\n                sig = Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', sg), 'der');\n            }\n            catch (derError) {\n                if (!(derError instanceof exports.DER.Err))\n                    throw derError;\n            }\n            if (!sig) {\n                try {\n                    sig = Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', sg), 'compact');\n                }\n                catch (error) {\n                    return false;\n                }\n            }\n        }\n        if (!sig)\n            return false;\n        return sig;\n    }\n    /**\n     * Verifies a signature against message and public key.\n     * Rejects lowS signatures by default: see {@link ECDSAVerifyOpts}.\n     * Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n     *\n     * ```\n     * verify(r, s, h, P) where\n     *   u1 = hs^-1 mod n\n     *   u2 = rs^-1 mod n\n     *   R = u1⋅G + u2⋅P\n     *   mod(R.x, n) == r\n     * ```\n     */\n    function verify(signature, message, publicKey, opts = {}) {\n        const { lowS, prehash, format } = validateSigOpts(opts, defaultSigOpts);\n        publicKey = (0, utils_ts_1.ensureBytes)('publicKey', publicKey);\n        message = validateMsgAndHash((0, utils_ts_1.ensureBytes)('message', message), prehash);\n        if ('strict' in opts)\n            throw new Error('options.strict was renamed to lowS');\n        const sig = format === undefined\n            ? tryParsingSig(signature)\n            : Signature.fromBytes((0, utils_ts_1.ensureBytes)('sig', signature), format);\n        if (sig === false)\n            return false;\n        try {\n            const P = Point.fromBytes(publicKey);\n            if (lowS && sig.hasHighS())\n                return false;\n            const { r, s } = sig;\n            const h = bits2int_modN(message); // mod n, not mod p\n            const is = Fn.inv(s); // s^-1 mod n\n            const u1 = Fn.create(h * is); // u1 = hs^-1 mod n\n            const u2 = Fn.create(r * is); // u2 = rs^-1 mod n\n            const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); // u1⋅G + u2⋅P\n            if (R.is0())\n                return false;\n            const v = Fn.create(R.x); // v = r.x mod n\n            return v === r;\n        }\n        catch (e) {\n            return false;\n        }\n    }\n    function recoverPublicKey(signature, message, opts = {}) {\n        const { prehash } = validateSigOpts(opts, defaultSigOpts);\n        message = validateMsgAndHash(message, prehash);\n        return Signature.fromBytes(signature, 'recovered').recoverPublicKey(message).toBytes();\n    }\n    return Object.freeze({\n        keygen,\n        getPublicKey,\n        getSharedSecret,\n        utils,\n        lengths,\n        Point,\n        sign,\n        verify,\n        recoverPublicKey,\n        Signature,\n        hash,\n    });\n}\n/** @deprecated use `weierstrass` in newer releases */\nfunction weierstrassPoints(c) {\n    const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c);\n    const Point = weierstrassN(CURVE, curveOpts);\n    return _weierstrass_new_output_to_legacy(c, Point);\n}\nfunction _weierstrass_legacy_opts_to_new(c) {\n    const CURVE = {\n        a: c.a,\n        b: c.b,\n        p: c.Fp.ORDER,\n        n: c.n,\n        h: c.h,\n        Gx: c.Gx,\n        Gy: c.Gy,\n    };\n    const Fp = c.Fp;\n    let allowedLengths = c.allowedPrivateKeyLengths\n        ? Array.from(new Set(c.allowedPrivateKeyLengths.map((l) => Math.ceil(l / 2))))\n        : undefined;\n    const Fn = (0, modular_ts_1.Field)(CURVE.n, {\n        BITS: c.nBitLength,\n        allowedLengths: allowedLengths,\n        modFromBytes: c.wrapPrivateKey,\n    });\n    const curveOpts = {\n        Fp,\n        Fn,\n        allowInfinityPoint: c.allowInfinityPoint,\n        endo: c.endo,\n        isTorsionFree: c.isTorsionFree,\n        clearCofactor: c.clearCofactor,\n        fromBytes: c.fromBytes,\n        toBytes: c.toBytes,\n    };\n    return { CURVE, curveOpts };\n}\nfunction _ecdsa_legacy_opts_to_new(c) {\n    const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c);\n    const ecdsaOpts = {\n        hmac: c.hmac,\n        randomBytes: c.randomBytes,\n        lowS: c.lowS,\n        bits2int: c.bits2int,\n        bits2int_modN: c.bits2int_modN,\n    };\n    return { CURVE, curveOpts, hash: c.hash, ecdsaOpts };\n}\nfunction _legacyHelperEquat(Fp, a, b) {\n    /**\n     * y² = x³ + ax + b: Short weierstrass curve formula. Takes x, returns y².\n     * @returns y²\n     */\n    function weierstrassEquation(x) {\n        const x2 = Fp.sqr(x); // x * x\n        const x3 = Fp.mul(x2, x); // x² * x\n        return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x³ + a * x + b\n    }\n    return weierstrassEquation;\n}\nfunction _weierstrass_new_output_to_legacy(c, Point) {\n    const { Fp, Fn } = Point;\n    function isWithinCurveOrder(num) {\n        return (0, utils_ts_1.inRange)(num, _1n, Fn.ORDER);\n    }\n    const weierstrassEquation = _legacyHelperEquat(Fp, c.a, c.b);\n    return Object.assign({}, {\n        CURVE: c,\n        Point: Point,\n        ProjectivePoint: Point,\n        normPrivateKeyToScalar: (key) => _normFnElement(Fn, key),\n        weierstrassEquation,\n        isWithinCurveOrder,\n    });\n}\nfunction _ecdsa_new_output_to_legacy(c, _ecdsa) {\n    const Point = _ecdsa.Point;\n    return Object.assign({}, _ecdsa, {\n        ProjectivePoint: Point,\n        CURVE: Object.assign({}, c, (0, modular_ts_1.nLength)(Point.Fn.ORDER, Point.Fn.BITS)),\n    });\n}\n// _ecdsa_legacy\nfunction weierstrass(c) {\n    const { CURVE, curveOpts, hash, ecdsaOpts } = _ecdsa_legacy_opts_to_new(c);\n    const Point = weierstrassN(CURVE, curveOpts);\n    const signs = ecdsa(Point, hash, ecdsaOpts);\n    return _ecdsa_new_output_to_legacy(c, signs);\n}\n//# sourceMappingURL=weierstrass.js.map{\n  \"name\": \"@noble/curves\",\n  \"version\": \"1.9.7\",\n  \"description\": \"Audited & minimal JS implementation of elliptic curve cryptography\",\n  \"files\": [\n    \"*.js\",\n    \"*.js.map\",\n    \"*.d.ts\",\n    \"*.d.ts.map\",\n    \"esm\",\n    \"src\",\n    \"abstract\",\n    \"!oprf.*\",\n    \"!webcrypto.*\"\n  ],\n  \"scripts\": {\n    \"bench\": \"npm run bench:install; cd test/benchmark; node secp256k1.js; node curves.js; node utils.js; node bls.js\",\n    \"bench:install\": \"cd test/benchmark; npm install; npm install ../.. --install-links\",\n    \"build\": \"tsc && tsc -p tsconfig.cjs.json\",\n    \"build:release\": \"npx jsbt esbuild test/build\",\n    \"build:clean\": \"rm {.,esm,abstract,esm/abstract}/*.{js,d.ts,d.ts.map,js.map} 2> /dev/null\",\n    \"lint\": \"prettier --check 'src/**/*.{js,ts}' 'test/*.js'\",\n    \"format\": \"prettier --write 'src/**/*.{js,ts}' 'test/*.js'\",\n    \"test\": \"node --disable-warning=ExperimentalWarning test/index.js\",\n    \"test:bun\": \"bun test/index.js\",\n    \"test:deno\": \"deno --allow-env --allow-read test/index.js\",\n    \"test:coverage\": \"npm install --no-save c8@10.1.2 && npx c8 npm test\"\n  },\n  \"author\": \"Paul Miller (https://paulmillr.com)\",\n  \"homepage\": \"https://paulmillr.com/noble/\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/paulmillr/noble-curves.git\"\n  },\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"@noble/hashes\": \"1.8.0\"\n  },\n  \"devDependencies\": {\n    \"@paulmillr/jsbt\": \"0.4.0\",\n    \"@types/node\": \"22.15.21\",\n    \"fast-check\": \"4.1.1\",\n    \"micro-bmark\": \"0.4.2\",\n    \"micro-should\": \"0.5.3\",\n    \"prettier\": \"3.5.3\",\n    \"typescript\": \"5.8.3\"\n  },\n  \"sideEffects\": false,\n  \"main\": \"index.js\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./esm/index.js\",\n      \"require\": \"./index.js\"\n    },\n    \"./abstract/bls\": {\n      \"import\": \"./esm/abstract/bls.js\",\n      \"require\": \"./abstract/bls.js\"\n    },\n    \"./abstract/curve\": {\n      \"import\": \"./esm/abstract/curve.js\",\n      \"require\": \"./abstract/curve.js\"\n    },\n    \"./abstract/edwards\": {\n      \"import\": \"./esm/abstract/edwards.js\",\n      \"require\": \"./abstract/edwards.js\"\n    },\n    \"./abstract/hash-to-curve\": {\n      \"import\": \"./esm/abstract/hash-to-curve.js\",\n      \"require\": \"./abstract/hash-to-curve.js\"\n    },\n    \"./abstract/modular\": {\n      \"import\": \"./esm/abstract/modular.js\",\n      \"require\": \"./abstract/modular.js\"\n    },\n    \"./abstract/montgomery\": {\n      \"import\": \"./esm/abstract/montgomery.js\",\n      \"require\": \"./abstract/montgomery.js\"\n    },\n    \"./abstract/poseidon\": {\n      \"import\": \"./esm/abstract/poseidon.js\",\n      \"require\": \"./abstract/poseidon.js\"\n    },\n    \"./abstract/tower\": {\n      \"import\": \"./esm/abstract/tower.js\",\n      \"require\": \"./abstract/tower.js\"\n    },\n    \"./abstract/utils\": {\n      \"import\": \"./esm/abstract/utils.js\",\n      \"require\": \"./abstract/utils.js\"\n    },\n    \"./abstract/weierstrass\": {\n      \"import\": \"./esm/abstract/weierstrass.js\",\n      \"require\": \"./abstract/weierstrass.js\"\n    },\n    \"./abstract/fft\": {\n      \"import\": \"./esm/abstract/fft.js\",\n      \"require\": \"./abstract/fft.js\"\n    },\n    \"./_shortw_utils\": {\n      \"import\": \"./esm/_shortw_utils.js\",\n      \"require\": \"./_shortw_utils.js\"\n    },\n    \"./bls12-381\": {\n      \"import\": \"./esm/bls12-381.js\",\n      \"require\": \"./bls12-381.js\"\n    },\n    \"./bn254\": {\n      \"import\": \"./esm/bn254.js\",\n      \"require\": \"./bn254.js\"\n    },\n    \"./ed448\": {\n      \"import\": \"./esm/ed448.js\",\n      \"require\": \"./ed448.js\"\n    },\n    \"./ed25519\": {\n      \"import\": \"./esm/ed25519.js\",\n      \"require\": \"./ed25519.js\"\n    },\n    \"./index\": {\n      \"import\": \"./esm/index.js\",\n      \"require\": \"./index.js\"\n    },\n    \"./jubjub\": {\n      \"import\": \"./esm/jubjub.js\",\n      \"require\": \"./jubjub.js\"\n    },\n    \"./misc\": {\n      \"import\": \"./esm/misc.js\",\n      \"require\": \"./misc.js\"\n    },\n    \"./nist\": {\n      \"import\": \"./esm/nist.js\",\n      \"require\": \"./nist.js\"\n    },\n    \"./p256\": {\n      \"import\": \"./esm/p256.js\",\n      \"require\": \"./p256.js\"\n    },\n    \"./p384\": {\n      \"import\": \"./esm/p384.js\",\n      \"require\": \"./p384.js\"\n    },\n    \"./p521\": {\n      \"import\": \"./esm/p521.js\",\n      \"require\": \"./p521.js\"\n    },\n    \"./pasta\": {\n      \"import\": \"./esm/pasta.js\",\n      \"require\": \"./pasta.js\"\n    },\n    \"./secp256k1\": {\n      \"import\": \"./esm/secp256k1.js\",\n      \"require\": \"./secp256k1.js\"\n    },\n    \"./utils\": {\n      \"import\": \"./esm/utils.js\",\n      \"require\": \"./utils.js\"\n    },\n    \"./abstract/bls.js\": {\n      \"import\": \"./esm/abstract/bls.js\",\n      \"require\": \"./abstract/bls.js\"\n    },\n    \"./abstract/curve.js\": {\n      \"import\": \"./esm/abstract/curve.js\",\n      \"require\": \"./abstract/curve.js\"\n    },\n    \"./abstract/edwards.js\": {\n      \"import\": \"./esm/abstract/edwards.js\",\n      \"require\": \"./abstract/edwards.js\"\n    },\n    \"./abstract/hash-to-curve.js\": {\n      \"import\": \"./esm/abstract/hash-to-curve.js\",\n      \"require\": \"./abstract/hash-to-curve.js\"\n    },\n    \"./abstract/modular.js\": {\n      \"import\": \"./esm/abstract/modular.js\",\n      \"require\": \"./abstract/modular.js\"\n    },\n    \"./abstract/montgomery.js\": {\n      \"import\": \"./esm/abstract/montgomery.js\",\n      \"require\": \"./abstract/montgomery.js\"\n    },\n    \"./abstract/poseidon.js\": {\n      \"import\": \"./esm/abstract/poseidon.js\",\n      \"require\": \"./abstract/poseidon.js\"\n    },\n    \"./abstract/tower.js\": {\n      \"import\": \"./esm/abstract/tower.js\",\n      \"require\": \"./abstract/tower.js\"\n    },\n    \"./abstract/utils.js\": {\n      \"import\": \"./esm/abstract/utils.js\",\n      \"require\": \"./abstract/utils.js\"\n    },\n    \"./abstract/weierstrass.js\": {\n      \"import\": \"./esm/abstract/weierstrass.js\",\n      \"require\": \"./abstract/weierstrass.js\"\n    },\n    \"./abstract/fft.js\": {\n      \"import\": \"./esm/abstract/fft.js\",\n      \"require\": \"./abstract/fft.js\"\n    },\n    \"./_shortw_utils.js\": {\n      \"import\": \"./esm/_shortw_utils.js\",\n      \"require\": \"./_shortw_utils.js\"\n    },\n    \"./bls12-381.js\": {\n      \"import\": \"./esm/bls12-381.js\",\n      \"require\": \"./bls12-381.js\"\n    },\n    \"./bn254.js\": {\n      \"import\": \"./esm/bn254.js\",\n      \"require\": \"./bn254.js\"\n    },\n    \"./utils.js\": {\n      \"import\": \"./esm/utils.js\",\n      \"require\": \"./utils.js\"\n    },\n    \"./ed448.js\": {\n      \"import\": \"./esm/ed448.js\",\n      \"require\": \"./ed448.js\"\n    },\n    \"./ed25519.js\": {\n      \"import\": \"./esm/ed25519.js\",\n      \"require\": \"./ed25519.js\"\n    },\n    \"./index.js\": {\n      \"import\": \"./esm/index.js\",\n      \"require\": \"./index.js\"\n    },\n    \"./jubjub.js\": {\n      \"import\": \"./esm/jubjub.js\",\n      \"require\": \"./jubjub.js\"\n    },\n    \"./misc.js\": {\n      \"import\": \"./esm/misc.js\",\n      \"require\": \"./misc.js\"\n    },\n    \"./nist.js\": {\n      \"import\": \"./esm/nist.js\",\n      \"require\": \"./nist.js\"\n    },\n    \"./p256.js\": {\n      \"import\": \"./esm/p256.js\",\n      \"require\": \"./p256.js\"\n    },\n    \"./p384.js\": {\n      \"import\": \"./esm/p384.js\",\n      \"require\": \"./p384.js\"\n    },\n    \"./p521.js\": {\n      \"import\": \"./esm/p521.js\",\n      \"require\": \"./p521.js\"\n    },\n    \"./pasta.js\": {\n      \"import\": \"./esm/pasta.js\",\n      \"require\": \"./pasta.js\"\n    },\n    \"./secp256k1.js\": {\n      \"import\": \"./esm/secp256k1.js\",\n      \"require\": \"./secp256k1.js\"\n    }\n  },\n  \"engines\": {\n    \"node\": \"^14.21.3 || >=16\"\n  },\n  \"keywords\": [\n    \"elliptic\",\n    \"curve\",\n    \"cryptography\",\n    \"secp256k1\",\n    \"ed25519\",\n    \"p256\",\n    \"p384\",\n    \"p521\",\n    \"secp256r1\",\n    \"ed448\",\n    \"x25519\",\n    \"ed25519\",\n    \"bls12-381\",\n    \"bn254\",\n    \"alt_bn128\",\n    \"bls\",\n    \"noble\",\n    \"ecc\",\n    \"ecdsa\",\n    \"eddsa\",\n    \"weierstrass\",\n    \"montgomery\",\n    \"edwards\",\n    \"schnorr\",\n    \"fft\"\n  ],\n  \"funding\": \"https://paulmillr.com/funding/\"\n}\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.encodeToCurve = exports.hashToCurve = exports.secp256k1_hasher = exports.schnorr = exports.secp256k1 = void 0;\n/**\n * SECG secp256k1. See [pdf](https://www.secg.org/sec2-v2.pdf).\n *\n * Belongs to Koblitz curves: it has efficiently-computable GLV endomorphism ψ,\n * check out {@link EndomorphismOpts}. Seems to be rigid (not backdoored).\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nconst sha2_js_1 = require(\"@noble/hashes/sha2.js\");\nconst utils_js_1 = require(\"@noble/hashes/utils.js\");\nconst _shortw_utils_ts_1 = require(\"./_shortw_utils.js\");\nconst hash_to_curve_ts_1 = require(\"./abstract/hash-to-curve.js\");\nconst modular_ts_1 = require(\"./abstract/modular.js\");\nconst weierstrass_ts_1 = require(\"./abstract/weierstrass.js\");\nconst utils_ts_1 = require(\"./utils.js\");\n// Seems like generator was produced from some seed:\n// `Point.BASE.multiply(Point.Fn.inv(2n, N)).toAffine().x`\n// // gives short x 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63n\nconst secp256k1_CURVE = {\n    p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'),\n    n: BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'),\n    h: BigInt(1),\n    a: BigInt(0),\n    b: BigInt(7),\n    Gx: BigInt('0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n    Gy: BigInt('0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8'),\n};\nconst secp256k1_ENDO = {\n    beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'),\n    basises: [\n        [BigInt('0x3086d221a7d46bcde86c90e49284eb15'), -BigInt('0xe4437ed6010e88286f547fa90abfe4c3')],\n        [BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'), BigInt('0x3086d221a7d46bcde86c90e49284eb15')],\n    ],\n};\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */\nfunction sqrtMod(y) {\n    const P = secp256k1_CURVE.p;\n    // prettier-ignore\n    const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n    // prettier-ignore\n    const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n    const b2 = (y * y * y) % P; // x^3, 11\n    const b3 = (b2 * b2 * y) % P; // x^7\n    const b6 = ((0, modular_ts_1.pow2)(b3, _3n, P) * b3) % P;\n    const b9 = ((0, modular_ts_1.pow2)(b6, _3n, P) * b3) % P;\n    const b11 = ((0, modular_ts_1.pow2)(b9, _2n, P) * b2) % P;\n    const b22 = ((0, modular_ts_1.pow2)(b11, _11n, P) * b11) % P;\n    const b44 = ((0, modular_ts_1.pow2)(b22, _22n, P) * b22) % P;\n    const b88 = ((0, modular_ts_1.pow2)(b44, _44n, P) * b44) % P;\n    const b176 = ((0, modular_ts_1.pow2)(b88, _88n, P) * b88) % P;\n    const b220 = ((0, modular_ts_1.pow2)(b176, _44n, P) * b44) % P;\n    const b223 = ((0, modular_ts_1.pow2)(b220, _3n, P) * b3) % P;\n    const t1 = ((0, modular_ts_1.pow2)(b223, _23n, P) * b22) % P;\n    const t2 = ((0, modular_ts_1.pow2)(t1, _6n, P) * b2) % P;\n    const root = (0, modular_ts_1.pow2)(t2, _2n, P);\n    if (!Fpk1.eql(Fpk1.sqr(root), y))\n        throw new Error('Cannot find square root');\n    return root;\n}\nconst Fpk1 = (0, modular_ts_1.Field)(secp256k1_CURVE.p, { sqrt: sqrtMod });\n/**\n * secp256k1 curve, ECDSA and ECDH methods.\n *\n * Field: `2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n`\n *\n * @example\n * ```js\n * import { secp256k1 } from '@noble/curves/secp256k1';\n * const { secretKey, publicKey } = secp256k1.keygen();\n * const msg = new TextEncoder().encode('hello');\n * const sig = secp256k1.sign(msg, secretKey);\n * const isValid = secp256k1.verify(sig, msg, publicKey) === true;\n * ```\n */\nexports.secp256k1 = (0, _shortw_utils_ts_1.createCurve)({ ...secp256k1_CURVE, Fp: Fpk1, lowS: true, endo: secp256k1_ENDO }, sha2_js_1.sha256);\n// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code.\n// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\nconst TAGGED_HASH_PREFIXES = {};\nfunction taggedHash(tag, ...messages) {\n    let tagP = TAGGED_HASH_PREFIXES[tag];\n    if (tagP === undefined) {\n        const tagH = (0, sha2_js_1.sha256)((0, utils_ts_1.utf8ToBytes)(tag));\n        tagP = (0, utils_ts_1.concatBytes)(tagH, tagH);\n        TAGGED_HASH_PREFIXES[tag] = tagP;\n    }\n    return (0, sha2_js_1.sha256)((0, utils_ts_1.concatBytes)(tagP, ...messages));\n}\n// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03\nconst pointToBytes = (point) => point.toBytes(true).slice(1);\nconst Pointk1 = /* @__PURE__ */ (() => exports.secp256k1.Point)();\nconst hasEven = (y) => y % _2n === _0n;\n// Calculate point, scalar and bytes\nfunction schnorrGetExtPubKey(priv) {\n    const { Fn, BASE } = Pointk1;\n    const d_ = (0, weierstrass_ts_1._normFnElement)(Fn, priv);\n    const p = BASE.multiply(d_); // P = d'⋅G; 0 < d' < n check is done inside\n    const scalar = hasEven(p.y) ? d_ : Fn.neg(d_);\n    return { scalar, bytes: pointToBytes(p) };\n}\n/**\n * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point.\n * @returns valid point checked for being on-curve\n */\nfunction lift_x(x) {\n    const Fp = Fpk1;\n    if (!Fp.isValidNot0(x))\n        throw new Error('invalid x: Fail if x ≥ p');\n    const xx = Fp.create(x * x);\n    const c = Fp.create(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.\n    let y = Fp.sqrt(c); // Let y = c^(p+1)/4 mod p. Same as sqrt().\n    // Return the unique point P such that x(P) = x and\n    // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise.\n    if (!hasEven(y))\n        y = Fp.neg(y);\n    const p = Pointk1.fromAffine({ x, y });\n    p.assertValidity();\n    return p;\n}\nconst num = utils_ts_1.bytesToNumberBE;\n/**\n * Create tagged hash, convert it to bigint, reduce modulo-n.\n */\nfunction challenge(...args) {\n    return Pointk1.Fn.create(num(taggedHash('BIP0340/challenge', ...args)));\n}\n/**\n * Schnorr public key is just `x` coordinate of Point as per BIP340.\n */\nfunction schnorrGetPublicKey(secretKey) {\n    return schnorrGetExtPubKey(secretKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G)\n}\n/**\n * Creates Schnorr signature as per BIP340. Verifies itself before returning anything.\n * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous.\n */\nfunction schnorrSign(message, secretKey, auxRand = (0, utils_js_1.randomBytes)(32)) {\n    const { Fn } = Pointk1;\n    const m = (0, utils_ts_1.ensureBytes)('message', message);\n    const { bytes: px, scalar: d } = schnorrGetExtPubKey(secretKey); // checks for isWithinCurveOrder\n    const a = (0, utils_ts_1.ensureBytes)('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array\n    const t = Fn.toBytes(d ^ num(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a)\n    const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m)\n    // Let k' = int(rand) mod n. Fail if k' = 0. Let R = k'⋅G\n    const { bytes: rx, scalar: k } = schnorrGetExtPubKey(rand);\n    const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.\n    const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).\n    sig.set(rx, 0);\n    sig.set(Fn.toBytes(Fn.create(k + e * d)), 32);\n    // If Verify(bytes(P), m, sig) (see below) returns failure, abort\n    if (!schnorrVerify(sig, m, px))\n        throw new Error('sign: Invalid signature produced');\n    return sig;\n}\n/**\n * Verifies Schnorr signature.\n * Will swallow errors & return false except for initial type validation of arguments.\n */\nfunction schnorrVerify(signature, message, publicKey) {\n    const { Fn, BASE } = Pointk1;\n    const sig = (0, utils_ts_1.ensureBytes)('signature', signature, 64);\n    const m = (0, utils_ts_1.ensureBytes)('message', message);\n    const pub = (0, utils_ts_1.ensureBytes)('publicKey', publicKey, 32);\n    try {\n        const P = lift_x(num(pub)); // P = lift_x(int(pk)); fail if that fails\n        const r = num(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.\n        if (!(0, utils_ts_1.inRange)(r, _1n, secp256k1_CURVE.p))\n            return false;\n        const s = num(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.\n        if (!(0, utils_ts_1.inRange)(s, _1n, secp256k1_CURVE.n))\n            return false;\n        // int(challenge(bytes(r)||bytes(P)||m))%n\n        const e = challenge(Fn.toBytes(r), pointToBytes(P), m);\n        // R = s⋅G - e⋅P, where -eP == (n-e)P\n        const R = BASE.multiplyUnsafe(s).add(P.multiplyUnsafe(Fn.neg(e)));\n        const { x, y } = R.toAffine();\n        // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.\n        if (R.is0() || !hasEven(y) || x !== r)\n            return false;\n        return true;\n    }\n    catch (error) {\n        return false;\n    }\n}\n/**\n * Schnorr signatures over secp256k1.\n * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\n * @example\n * ```js\n * import { schnorr } from '@noble/curves/secp256k1';\n * const { secretKey, publicKey } = schnorr.keygen();\n * // const publicKey = schnorr.getPublicKey(secretKey);\n * const msg = new TextEncoder().encode('hello');\n * const sig = schnorr.sign(msg, secretKey);\n * const isValid = schnorr.verify(sig, msg, publicKey);\n * ```\n */\nexports.schnorr = (() => {\n    const size = 32;\n    const seedLength = 48;\n    const randomSecretKey = (seed = (0, utils_js_1.randomBytes)(seedLength)) => {\n        return (0, modular_ts_1.mapHashToField)(seed, secp256k1_CURVE.n);\n    };\n    // TODO: remove\n    exports.secp256k1.utils.randomSecretKey;\n    function keygen(seed) {\n        const secretKey = randomSecretKey(seed);\n        return { secretKey, publicKey: schnorrGetPublicKey(secretKey) };\n    }\n    return {\n        keygen,\n        getPublicKey: schnorrGetPublicKey,\n        sign: schnorrSign,\n        verify: schnorrVerify,\n        Point: Pointk1,\n        utils: {\n            randomSecretKey: randomSecretKey,\n            randomPrivateKey: randomSecretKey,\n            taggedHash,\n            // TODO: remove\n            lift_x,\n            pointToBytes,\n            numberToBytesBE: utils_ts_1.numberToBytesBE,\n            bytesToNumberBE: utils_ts_1.bytesToNumberBE,\n            mod: modular_ts_1.mod,\n        },\n        lengths: {\n            secretKey: size,\n            publicKey: size,\n            publicKeyHasPrefix: false,\n            signature: size * 2,\n            seed: seedLength,\n        },\n    };\n})();\nconst isoMap = /* @__PURE__ */ (() => (0, hash_to_curve_ts_1.isogenyMap)(Fpk1, [\n    // xNum\n    [\n        '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7',\n        '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581',\n        '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262',\n        '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c',\n    ],\n    // xDen\n    [\n        '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b',\n        '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14',\n        '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n    ],\n    // yNum\n    [\n        '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c',\n        '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3',\n        '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931',\n        '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84',\n    ],\n    // yDen\n    [\n        '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b',\n        '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573',\n        '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f',\n        '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n    ],\n].map((i) => i.map((j) => BigInt(j)))))();\nconst mapSWU = /* @__PURE__ */ (() => (0, weierstrass_ts_1.mapToCurveSimpleSWU)(Fpk1, {\n    A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'),\n    B: BigInt('1771'),\n    Z: Fpk1.create(BigInt('-11')),\n}))();\n/** Hashing / encoding to secp256k1 points / field. RFC 9380 methods. */\nexports.secp256k1_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports.secp256k1.Point, (scalars) => {\n    const { x, y } = mapSWU(Fpk1.create(scalars[0]));\n    return isoMap(x, y);\n}, {\n    DST: 'secp256k1_XMD:SHA-256_SSWU_RO_',\n    encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_',\n    p: Fpk1.ORDER,\n    m: 1,\n    k: 128,\n    expand: 'xmd',\n    hash: sha2_js_1.sha256,\n}))();\n/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */\nexports.hashToCurve = (() => exports.secp256k1_hasher.hashToCurve)();\n/** @deprecated use `import { secp256k1_hasher } from '@noble/curves/secp256k1.js';` */\nexports.encodeToCurve = (() => exports.secp256k1_hasher.encodeToCurve)();\n//# sourceMappingURL=secp256k1.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.notImplemented = exports.bitMask = exports.utf8ToBytes = exports.randomBytes = exports.isBytes = exports.hexToBytes = exports.concatBytes = exports.bytesToUtf8 = exports.bytesToHex = exports.anumber = exports.abytes = void 0;\nexports.abool = abool;\nexports._abool2 = _abool2;\nexports._abytes2 = _abytes2;\nexports.numberToHexUnpadded = numberToHexUnpadded;\nexports.hexToNumber = hexToNumber;\nexports.bytesToNumberBE = bytesToNumberBE;\nexports.bytesToNumberLE = bytesToNumberLE;\nexports.numberToBytesBE = numberToBytesBE;\nexports.numberToBytesLE = numberToBytesLE;\nexports.numberToVarBytesBE = numberToVarBytesBE;\nexports.ensureBytes = ensureBytes;\nexports.equalBytes = equalBytes;\nexports.copyBytes = copyBytes;\nexports.asciiToBytes = asciiToBytes;\nexports.inRange = inRange;\nexports.aInRange = aInRange;\nexports.bitLen = bitLen;\nexports.bitGet = bitGet;\nexports.bitSet = bitSet;\nexports.createHmacDrbg = createHmacDrbg;\nexports.validateObject = validateObject;\nexports.isHash = isHash;\nexports._validateObject = _validateObject;\nexports.memoized = memoized;\n/**\n * Hex, bytes and number utilities.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nconst utils_js_1 = require(\"@noble/hashes/utils.js\");\nvar utils_js_2 = require(\"@noble/hashes/utils.js\");\nObject.defineProperty(exports, \"abytes\", { enumerable: true, get: function () { return utils_js_2.abytes; } });\nObject.defineProperty(exports, \"anumber\", { enumerable: true, get: function () { return utils_js_2.anumber; } });\nObject.defineProperty(exports, \"bytesToHex\", { enumerable: true, get: function () { return utils_js_2.bytesToHex; } });\nObject.defineProperty(exports, \"bytesToUtf8\", { enumerable: true, get: function () { return utils_js_2.bytesToUtf8; } });\nObject.defineProperty(exports, \"concatBytes\", { enumerable: true, get: function () { return utils_js_2.concatBytes; } });\nObject.defineProperty(exports, \"hexToBytes\", { enumerable: true, get: function () { return utils_js_2.hexToBytes; } });\nObject.defineProperty(exports, \"isBytes\", { enumerable: true, get: function () { return utils_js_2.isBytes; } });\nObject.defineProperty(exports, \"randomBytes\", { enumerable: true, get: function () { return utils_js_2.randomBytes; } });\nObject.defineProperty(exports, \"utf8ToBytes\", { enumerable: true, get: function () { return utils_js_2.utf8ToBytes; } });\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nfunction abool(title, value) {\n    if (typeof value !== 'boolean')\n        throw new Error(title + ' boolean expected, got ' + value);\n}\n// tmp name until v2\nfunction _abool2(value, title = '') {\n    if (typeof value !== 'boolean') {\n        const prefix = title && `\"${title}\"`;\n        throw new Error(prefix + 'expected boolean, got type=' + typeof value);\n    }\n    return value;\n}\n// tmp name until v2\n/** Asserts something is Uint8Array. */\nfunction _abytes2(value, length, title = '') {\n    const bytes = (0, utils_js_1.isBytes)(value);\n    const len = value?.length;\n    const needsLen = length !== undefined;\n    if (!bytes || (needsLen && len !== length)) {\n        const prefix = title && `\"${title}\" `;\n        const ofLen = needsLen ? ` of length ${length}` : '';\n        const got = bytes ? `length=${len}` : `type=${typeof value}`;\n        throw new Error(prefix + 'expected Uint8Array' + ofLen + ', got ' + got);\n    }\n    return value;\n}\n// Used in weierstrass, der\nfunction numberToHexUnpadded(num) {\n    const hex = num.toString(16);\n    return hex.length & 1 ? '0' + hex : hex;\n}\nfunction hexToNumber(hex) {\n    if (typeof hex !== 'string')\n        throw new Error('hex string expected, got ' + typeof hex);\n    return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian\n}\n// BE: Big Endian, LE: Little Endian\nfunction bytesToNumberBE(bytes) {\n    return hexToNumber((0, utils_js_1.bytesToHex)(bytes));\n}\nfunction bytesToNumberLE(bytes) {\n    (0, utils_js_1.abytes)(bytes);\n    return hexToNumber((0, utils_js_1.bytesToHex)(Uint8Array.from(bytes).reverse()));\n}\nfunction numberToBytesBE(n, len) {\n    return (0, utils_js_1.hexToBytes)(n.toString(16).padStart(len * 2, '0'));\n}\nfunction numberToBytesLE(n, len) {\n    return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nfunction numberToVarBytesBE(n) {\n    return (0, utils_js_1.hexToBytes)(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'secret key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nfunction ensureBytes(title, hex, expectedLength) {\n    let res;\n    if (typeof hex === 'string') {\n        try {\n            res = (0, utils_js_1.hexToBytes)(hex);\n        }\n        catch (e) {\n            throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e);\n        }\n    }\n    else if ((0, utils_js_1.isBytes)(hex)) {\n        // Uint8Array.from() instead of hash.slice() because node.js Buffer\n        // is instance of Uint8Array, and its slice() creates **mutable** copy\n        res = Uint8Array.from(hex);\n    }\n    else {\n        throw new Error(title + ' must be hex string or Uint8Array');\n    }\n    const len = res.length;\n    if (typeof expectedLength === 'number' && len !== expectedLength)\n        throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len);\n    return res;\n}\n// Compares 2 u8a-s in kinda constant time\nfunction equalBytes(a, b) {\n    if (a.length !== b.length)\n        return false;\n    let diff = 0;\n    for (let i = 0; i < a.length; i++)\n        diff |= a[i] ^ b[i];\n    return diff === 0;\n}\n/**\n * Copies Uint8Array. We can't use u8a.slice(), because u8a can be Buffer,\n * and Buffer#slice creates mutable copy. Never use Buffers!\n */\nfunction copyBytes(bytes) {\n    return Uint8Array.from(bytes);\n}\n/**\n * Decodes 7-bit ASCII string to Uint8Array, throws on non-ascii symbols\n * Should be safe to use for things expected to be ASCII.\n * Returns exact same result as utf8ToBytes for ASCII or throws.\n */\nfunction asciiToBytes(ascii) {\n    return Uint8Array.from(ascii, (c, i) => {\n        const charCode = c.charCodeAt(0);\n        if (c.length !== 1 || charCode > 127) {\n            throw new Error(`string contains non-ASCII character \"${ascii[i]}\" with code ${charCode} at position ${i}`);\n        }\n        return charCode;\n    });\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\n// export const utf8ToBytes: typeof utf8ToBytes_ = utf8ToBytes_;\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\n// export const bytesToUtf8: typeof bytesToUtf8_ = bytesToUtf8_;\n// Is positive bigint\nconst isPosBig = (n) => typeof n === 'bigint' && _0n <= n;\nfunction inRange(n, min, max) {\n    return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;\n}\n/**\n * Asserts min <= n < max. NOTE: It's < max and not <= max.\n * @example\n * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n)\n */\nfunction aInRange(title, n, min, max) {\n    // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)?\n    // consider P=256n, min=0n, max=P\n    // - a for min=0 would require -1:          `inRange('x', x, -1n, P)`\n    // - b would commonly require subtraction:  `inRange('x', x, 0n, P - 1n)`\n    // - our way is the cleanest:               `inRange('x', x, 0n, P)\n    if (!inRange(n, min, max))\n        throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n);\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n * TODO: merge with nLength in modular\n */\nfunction bitLen(n) {\n    let len;\n    for (len = 0; n > _0n; n >>= _1n, len += 1)\n        ;\n    return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nfunction bitGet(n, pos) {\n    return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nfunction bitSet(n, pos, value) {\n    return n | ((value ? _1n : _0n) << BigInt(pos));\n}\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nconst bitMask = (n) => (_1n << BigInt(n)) - _1n;\nexports.bitMask = bitMask;\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n *   const drbg = createHmacDRBG<Key>(32, 32, hmac);\n *   drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nfunction createHmacDrbg(hashLen, qByteLen, hmacFn) {\n    if (typeof hashLen !== 'number' || hashLen < 2)\n        throw new Error('hashLen must be a number');\n    if (typeof qByteLen !== 'number' || qByteLen < 2)\n        throw new Error('qByteLen must be a number');\n    if (typeof hmacFn !== 'function')\n        throw new Error('hmacFn must be a function');\n    // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n    const u8n = (len) => new Uint8Array(len); // creates Uint8Array\n    const u8of = (byte) => Uint8Array.of(byte); // another shortcut\n    let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n    let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n    let i = 0; // Iterations counter, will throw when over 1000\n    const reset = () => {\n        v.fill(1);\n        k.fill(0);\n        i = 0;\n    };\n    const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n    const reseed = (seed = u8n(0)) => {\n        // HMAC-DRBG reseed() function. Steps D-G\n        k = h(u8of(0x00), seed); // k = hmac(k || v || 0x00 || seed)\n        v = h(); // v = hmac(k || v)\n        if (seed.length === 0)\n            return;\n        k = h(u8of(0x01), seed); // k = hmac(k || v || 0x01 || seed)\n        v = h(); // v = hmac(k || v)\n    };\n    const gen = () => {\n        // HMAC-DRBG generate() function\n        if (i++ >= 1000)\n            throw new Error('drbg: tried 1000 values');\n        let len = 0;\n        const out = [];\n        while (len < qByteLen) {\n            v = h();\n            const sl = v.slice();\n            out.push(sl);\n            len += v.length;\n        }\n        return (0, utils_js_1.concatBytes)(...out);\n    };\n    const genUntil = (seed, pred) => {\n        reset();\n        reseed(seed); // Steps D-G\n        let res = undefined; // Step H: grind until k is in [1..n-1]\n        while (!(res = pred(gen())))\n            reseed();\n        reset();\n        return res;\n    };\n    return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n    bigint: (val) => typeof val === 'bigint',\n    function: (val) => typeof val === 'function',\n    boolean: (val) => typeof val === 'boolean',\n    string: (val) => typeof val === 'string',\n    stringOrUint8Array: (val) => typeof val === 'string' || (0, utils_js_1.isBytes)(val),\n    isSafeInteger: (val) => Number.isSafeInteger(val),\n    array: (val) => Array.isArray(val),\n    field: (val, object) => object.Fp.isValid(val),\n    hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record<K extends string | number | symbol, T> = { [P in K]: T; }\nfunction validateObject(object, validators, optValidators = {}) {\n    const checkField = (fieldName, type, isOptional) => {\n        const checkVal = validatorFns[type];\n        if (typeof checkVal !== 'function')\n            throw new Error('invalid validator function');\n        const val = object[fieldName];\n        if (isOptional && val === undefined)\n            return;\n        if (!checkVal(val, object)) {\n            throw new Error('param ' + String(fieldName) + ' is invalid. Expected ' + type + ', got ' + val);\n        }\n    };\n    for (const [fieldName, type] of Object.entries(validators))\n        checkField(fieldName, type, false);\n    for (const [fieldName, type] of Object.entries(optValidators))\n        checkField(fieldName, type, true);\n    return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\nfunction isHash(val) {\n    return typeof val === 'function' && Number.isSafeInteger(val.outputLen);\n}\nfunction _validateObject(object, fields, optFields = {}) {\n    if (!object || typeof object !== 'object')\n        throw new Error('expected valid options object');\n    function checkField(fieldName, expectedType, isOpt) {\n        const val = object[fieldName];\n        if (isOpt && val === undefined)\n            return;\n        const current = typeof val;\n        if (current !== expectedType || val === null)\n            throw new Error(`param \"${fieldName}\" is invalid: expected ${expectedType}, got ${current}`);\n    }\n    Object.entries(fields).forEach(([k, v]) => checkField(k, v, false));\n    Object.entries(optFields).forEach(([k, v]) => checkField(k, v, true));\n}\n/**\n * throws not implemented error\n */\nconst notImplemented = () => {\n    throw new Error('not implemented');\n};\nexports.notImplemented = notImplemented;\n/**\n * Memoizes (caches) computation result.\n * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed.\n */\nfunction memoized(fn) {\n    const map = new WeakMap();\n    return (arg, ...args) => {\n        const val = map.get(arg);\n        if (val !== undefined)\n            return val;\n        const computed = fn(arg, ...args);\n        map.set(arg, computed);\n        return computed;\n    };\n}\n//# sourceMappingURL=utils.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SHA512_IV = exports.SHA384_IV = exports.SHA224_IV = exports.SHA256_IV = exports.HashMD = void 0;\nexports.setBigUint64 = setBigUint64;\nexports.Chi = Chi;\nexports.Maj = Maj;\n/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nconst utils_ts_1 = require(\"./utils.js\");\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nfunction setBigUint64(view, byteOffset, value, isLE) {\n    if (typeof view.setBigUint64 === 'function')\n        return view.setBigUint64(byteOffset, value, isLE);\n    const _32n = BigInt(32);\n    const _u32_max = BigInt(0xffffffff);\n    const wh = Number((value >> _32n) & _u32_max);\n    const wl = Number(value & _u32_max);\n    const h = isLE ? 4 : 0;\n    const l = isLE ? 0 : 4;\n    view.setUint32(byteOffset + h, wh, isLE);\n    view.setUint32(byteOffset + l, wl, isLE);\n}\n/** Choice: a ? b : c */\nfunction Chi(a, b, c) {\n    return (a & b) ^ (~a & c);\n}\n/** Majority function, true if any two inputs is true. */\nfunction Maj(a, b, c) {\n    return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nclass HashMD extends utils_ts_1.Hash {\n    constructor(blockLen, outputLen, padOffset, isLE) {\n        super();\n        this.finished = false;\n        this.length = 0;\n        this.pos = 0;\n        this.destroyed = false;\n        this.blockLen = blockLen;\n        this.outputLen = outputLen;\n        this.padOffset = padOffset;\n        this.isLE = isLE;\n        this.buffer = new Uint8Array(blockLen);\n        this.view = (0, utils_ts_1.createView)(this.buffer);\n    }\n    update(data) {\n        (0, utils_ts_1.aexists)(this);\n        data = (0, utils_ts_1.toBytes)(data);\n        (0, utils_ts_1.abytes)(data);\n        const { view, buffer, blockLen } = this;\n        const len = data.length;\n        for (let pos = 0; pos < len;) {\n            const take = Math.min(blockLen - this.pos, len - pos);\n            // Fast path: we have at least one block in input, cast it to view and process\n            if (take === blockLen) {\n                const dataView = (0, utils_ts_1.createView)(data);\n                for (; blockLen <= len - pos; pos += blockLen)\n                    this.process(dataView, pos);\n                continue;\n            }\n            buffer.set(data.subarray(pos, pos + take), this.pos);\n            this.pos += take;\n            pos += take;\n            if (this.pos === blockLen) {\n                this.process(view, 0);\n                this.pos = 0;\n            }\n        }\n        this.length += data.length;\n        this.roundClean();\n        return this;\n    }\n    digestInto(out) {\n        (0, utils_ts_1.aexists)(this);\n        (0, utils_ts_1.aoutput)(out, this);\n        this.finished = true;\n        // Padding\n        // We can avoid allocation of buffer for padding completely if it\n        // was previously not allocated here. But it won't change performance.\n        const { buffer, view, blockLen, isLE } = this;\n        let { pos } = this;\n        // append the bit '1' to the message\n        buffer[pos++] = 0b10000000;\n        (0, utils_ts_1.clean)(this.buffer.subarray(pos));\n        // we have less than padOffset left in buffer, so we cannot put length in\n        // current block, need process it and pad again\n        if (this.padOffset > blockLen - pos) {\n            this.process(view, 0);\n            pos = 0;\n        }\n        // Pad until full block byte with zeros\n        for (let i = pos; i < blockLen; i++)\n            buffer[i] = 0;\n        // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n        // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n        // So we just write lowest 64 bits of that value.\n        setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n        this.process(view, 0);\n        const oview = (0, utils_ts_1.createView)(out);\n        const len = this.outputLen;\n        // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n        if (len % 4)\n            throw new Error('_sha2: outputLen should be aligned to 32bit');\n        const outLen = len / 4;\n        const state = this.get();\n        if (outLen > state.length)\n            throw new Error('_sha2: outputLen bigger than state');\n        for (let i = 0; i < outLen; i++)\n            oview.setUint32(4 * i, state[i], isLE);\n    }\n    digest() {\n        const { buffer, outputLen } = this;\n        this.digestInto(buffer);\n        const res = buffer.slice(0, outputLen);\n        this.destroy();\n        return res;\n    }\n    _cloneInto(to) {\n        to || (to = new this.constructor());\n        to.set(...this.get());\n        const { blockLen, buffer, length, finished, destroyed, pos } = this;\n        to.destroyed = destroyed;\n        to.finished = finished;\n        to.length = length;\n        to.pos = pos;\n        if (length % blockLen)\n            to.buffer.set(buffer);\n        return to;\n    }\n    clone() {\n        return this._cloneInto();\n    }\n}\nexports.HashMD = HashMD;\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexports.SHA256_IV = Uint32Array.from([\n    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexports.SHA224_IV = Uint32Array.from([\n    0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexports.SHA384_IV = Uint32Array.from([\n    0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n    0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexports.SHA512_IV = Uint32Array.from([\n    0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n    0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n//# sourceMappingURL=_md.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toBig = exports.shrSL = exports.shrSH = exports.rotrSL = exports.rotrSH = exports.rotrBL = exports.rotrBH = exports.rotr32L = exports.rotr32H = exports.rotlSL = exports.rotlSH = exports.rotlBL = exports.rotlBH = exports.add5L = exports.add5H = exports.add4L = exports.add4H = exports.add3L = exports.add3H = void 0;\nexports.add = add;\nexports.fromBig = fromBig;\nexports.split = split;\n/**\n * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.\n * @todo re-check https://issues.chromium.org/issues/42212588\n * @module\n */\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\nfunction fromBig(n, le = false) {\n    if (le)\n        return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n    return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n    const len = lst.length;\n    let Ah = new Uint32Array(len);\n    let Al = new Uint32Array(len);\n    for (let i = 0; i < len; i++) {\n        const { h, l } = fromBig(lst[i], le);\n        [Ah[i], Al[i]] = [h, l];\n    }\n    return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\nexports.toBig = toBig;\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nexports.shrSH = shrSH;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.shrSL = shrSL;\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nexports.rotrSH = rotrSH;\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.rotrSL = rotrSL;\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nexports.rotrBH = rotrBH;\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\nexports.rotrBL = rotrBL;\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nexports.rotr32H = rotr32H;\nconst rotr32L = (h, _l) => h;\nexports.rotr32L = rotr32L;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nexports.rotlSH = rotlSH;\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nexports.rotlSL = rotlSL;\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nexports.rotlBH = rotlBH;\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nexports.rotlBL = rotlBL;\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n    const l = (Al >>> 0) + (Bl >>> 0);\n    return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nexports.add3L = add3L;\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nexports.add3H = add3H;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nexports.add4L = add4L;\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nexports.add4H = add4H;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nexports.add5L = add5L;\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\nexports.add5H = add5H;\n// prettier-ignore\nconst u64 = {\n    fromBig, split, toBig,\n    shrSH, shrSL,\n    rotrSH, rotrSL, rotrBH, rotrBL,\n    rotr32H, rotr32L,\n    rotlSH, rotlSL, rotlBH, rotlBL,\n    add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexports.default = u64;\n//# sourceMappingURL=_u64.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.crypto = void 0;\n/**\n * Internal webcrypto alias.\n * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+.\n * Falls back to Node.js built-in crypto for Node.js <=v14.\n * See utils.ts for details.\n * @module\n */\n// @ts-ignore\nconst nc = require(\"node:crypto\");\nexports.crypto = nc && typeof nc === 'object' && 'webcrypto' in nc\n    ? nc.webcrypto\n    : nc && typeof nc === 'object' && 'randomBytes' in nc\n        ? nc\n        : undefined;\n//# sourceMappingURL=cryptoNode.js.map/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { Hash, abytes, aexists, aoutput, clean, createView, toBytes } from \"./utils.js\";\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nexport function setBigUint64(view, byteOffset, value, isLE) {\n    if (typeof view.setBigUint64 === 'function')\n        return view.setBigUint64(byteOffset, value, isLE);\n    const _32n = BigInt(32);\n    const _u32_max = BigInt(0xffffffff);\n    const wh = Number((value >> _32n) & _u32_max);\n    const wl = Number(value & _u32_max);\n    const h = isLE ? 4 : 0;\n    const l = isLE ? 0 : 4;\n    view.setUint32(byteOffset + h, wh, isLE);\n    view.setUint32(byteOffset + l, wl, isLE);\n}\n/** Choice: a ? b : c */\nexport function Chi(a, b, c) {\n    return (a & b) ^ (~a & c);\n}\n/** Majority function, true if any two inputs is true. */\nexport function Maj(a, b, c) {\n    return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nexport class HashMD extends Hash {\n    constructor(blockLen, outputLen, padOffset, isLE) {\n        super();\n        this.finished = false;\n        this.length = 0;\n        this.pos = 0;\n        this.destroyed = false;\n        this.blockLen = blockLen;\n        this.outputLen = outputLen;\n        this.padOffset = padOffset;\n        this.isLE = isLE;\n        this.buffer = new Uint8Array(blockLen);\n        this.view = createView(this.buffer);\n    }\n    update(data) {\n        aexists(this);\n        data = toBytes(data);\n        abytes(data);\n        const { view, buffer, blockLen } = this;\n        const len = data.length;\n        for (let pos = 0; pos < len;) {\n            const take = Math.min(blockLen - this.pos, len - pos);\n            // Fast path: we have at least one block in input, cast it to view and process\n            if (take === blockLen) {\n                const dataView = createView(data);\n                for (; blockLen <= len - pos; pos += blockLen)\n                    this.process(dataView, pos);\n                continue;\n            }\n            buffer.set(data.subarray(pos, pos + take), this.pos);\n            this.pos += take;\n            pos += take;\n            if (this.pos === blockLen) {\n                this.process(view, 0);\n                this.pos = 0;\n            }\n        }\n        this.length += data.length;\n        this.roundClean();\n        return this;\n    }\n    digestInto(out) {\n        aexists(this);\n        aoutput(out, this);\n        this.finished = true;\n        // Padding\n        // We can avoid allocation of buffer for padding completely if it\n        // was previously not allocated here. But it won't change performance.\n        const { buffer, view, blockLen, isLE } = this;\n        let { pos } = this;\n        // append the bit '1' to the message\n        buffer[pos++] = 0b10000000;\n        clean(this.buffer.subarray(pos));\n        // we have less than padOffset left in buffer, so we cannot put length in\n        // current block, need process it and pad again\n        if (this.padOffset > blockLen - pos) {\n            this.process(view, 0);\n            pos = 0;\n        }\n        // Pad until full block byte with zeros\n        for (let i = pos; i < blockLen; i++)\n            buffer[i] = 0;\n        // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n        // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n        // So we just write lowest 64 bits of that value.\n        setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n        this.process(view, 0);\n        const oview = createView(out);\n        const len = this.outputLen;\n        // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n        if (len % 4)\n            throw new Error('_sha2: outputLen should be aligned to 32bit');\n        const outLen = len / 4;\n        const state = this.get();\n        if (outLen > state.length)\n            throw new Error('_sha2: outputLen bigger than state');\n        for (let i = 0; i < outLen; i++)\n            oview.setUint32(4 * i, state[i], isLE);\n    }\n    digest() {\n        const { buffer, outputLen } = this;\n        this.digestInto(buffer);\n        const res = buffer.slice(0, outputLen);\n        this.destroy();\n        return res;\n    }\n    _cloneInto(to) {\n        to || (to = new this.constructor());\n        to.set(...this.get());\n        const { blockLen, buffer, length, finished, destroyed, pos } = this;\n        to.destroyed = destroyed;\n        to.finished = finished;\n        to.length = length;\n        to.pos = pos;\n        if (length % blockLen)\n            to.buffer.set(buffer);\n        return to;\n    }\n    clone() {\n        return this._cloneInto();\n    }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n    0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n    0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n    0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n    0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n    0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n//# sourceMappingURL=_md.js.map/**\n * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array.\n * @todo re-check https://issues.chromium.org/issues/42212588\n * @module\n */\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\nfunction fromBig(n, le = false) {\n    if (le)\n        return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n    return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n    const len = lst.length;\n    let Ah = new Uint32Array(len);\n    let Al = new Uint32Array(len);\n    for (let i = 0; i < len; i++) {\n        const { h, l } = fromBig(lst[i], le);\n        [Ah[i], Al[i]] = [h, l];\n    }\n    return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n    const l = (Al >>> 0) + (Bl >>> 0);\n    return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig };\n// prettier-ignore\nconst u64 = {\n    fromBig, split, toBig,\n    shrSH, shrSL,\n    rotrSH, rotrSL, rotrBH, rotrBL,\n    rotr32H, rotr32L,\n    rotlSH, rotlSL, rotlBH, rotlBL,\n    add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map/**\n * Internal webcrypto alias.\n * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+.\n * Falls back to Node.js built-in crypto for Node.js <=v14.\n * See utils.ts for details.\n * @module\n */\n// @ts-ignore\nimport * as nc from 'node:crypto';\nexport const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc\n    ? nc.webcrypto\n    : nc && typeof nc === 'object' && 'randomBytes' in nc\n        ? nc\n        : undefined;\n//# sourceMappingURL=cryptoNode.js.map/**\n * HMAC: RFC2104 message authentication code.\n * @module\n */\nimport { abytes, aexists, ahash, clean, Hash, toBytes } from \"./utils.js\";\nexport class HMAC extends Hash {\n    constructor(hash, _key) {\n        super();\n        this.finished = false;\n        this.destroyed = false;\n        ahash(hash);\n        const key = toBytes(_key);\n        this.iHash = hash.create();\n        if (typeof this.iHash.update !== 'function')\n            throw new Error('Expected instance of class which extends utils.Hash');\n        this.blockLen = this.iHash.blockLen;\n        this.outputLen = this.iHash.outputLen;\n        const blockLen = this.blockLen;\n        const pad = new Uint8Array(blockLen);\n        // blockLen can be bigger than outputLen\n        pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n        for (let i = 0; i < pad.length; i++)\n            pad[i] ^= 0x36;\n        this.iHash.update(pad);\n        // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n        this.oHash = hash.create();\n        // Undo internal XOR && apply outer XOR\n        for (let i = 0; i < pad.length; i++)\n            pad[i] ^= 0x36 ^ 0x5c;\n        this.oHash.update(pad);\n        clean(pad);\n    }\n    update(buf) {\n        aexists(this);\n        this.iHash.update(buf);\n        return this;\n    }\n    digestInto(out) {\n        aexists(this);\n        abytes(out, this.outputLen);\n        this.finished = true;\n        this.iHash.digestInto(out);\n        this.oHash.update(out);\n        this.oHash.digestInto(out);\n        this.destroy();\n    }\n    digest() {\n        const out = new Uint8Array(this.oHash.outputLen);\n        this.digestInto(out);\n        return out;\n    }\n    _cloneInto(to) {\n        // Create new instance without calling constructor since key already in state and we don't know it.\n        to || (to = Object.create(Object.getPrototypeOf(this), {}));\n        const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n        to = to;\n        to.finished = finished;\n        to.destroyed = destroyed;\n        to.blockLen = blockLen;\n        to.outputLen = outputLen;\n        to.oHash = oHash._cloneInto(to.oHash);\n        to.iHash = iHash._cloneInto(to.iHash);\n        return to;\n    }\n    clone() {\n        return this._cloneInto();\n    }\n    destroy() {\n        this.destroyed = true;\n        this.oHash.destroy();\n        this.iHash.destroy();\n    }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n * @example\n * import { hmac } from '@noble/hashes/hmac';\n * import { sha256 } from '@noble/hashes/sha2';\n * const mac1 = hmac(sha256, 'key', 'message');\n */\nexport const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map{\n  \"type\": \"module\",\n  \"sideEffects\": false,\n  \"browser\": {\n    \"node:crypto\": false\n  },\n  \"node\": {\n    \"./crypto\": \"./esm/cryptoNode.js\"\n  }\n}\n/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, rotr } from \"./utils.js\";\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n    0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n    0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n    0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n    0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n    0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n    0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n    0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n    0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nexport class SHA256 extends HashMD {\n    constructor(outputLen = 32) {\n        super(64, outputLen, 8, false);\n        // We cannot use array here since array allows indexing by variable\n        // which means optimizer/compiler cannot use registers.\n        this.A = SHA256_IV[0] | 0;\n        this.B = SHA256_IV[1] | 0;\n        this.C = SHA256_IV[2] | 0;\n        this.D = SHA256_IV[3] | 0;\n        this.E = SHA256_IV[4] | 0;\n        this.F = SHA256_IV[5] | 0;\n        this.G = SHA256_IV[6] | 0;\n        this.H = SHA256_IV[7] | 0;\n    }\n    get() {\n        const { A, B, C, D, E, F, G, H } = this;\n        return [A, B, C, D, E, F, G, H];\n    }\n    // prettier-ignore\n    set(A, B, C, D, E, F, G, H) {\n        this.A = A | 0;\n        this.B = B | 0;\n        this.C = C | 0;\n        this.D = D | 0;\n        this.E = E | 0;\n        this.F = F | 0;\n        this.G = G | 0;\n        this.H = H | 0;\n    }\n    process(view, offset) {\n        // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n        for (let i = 0; i < 16; i++, offset += 4)\n            SHA256_W[i] = view.getUint32(offset, false);\n        for (let i = 16; i < 64; i++) {\n            const W15 = SHA256_W[i - 15];\n            const W2 = SHA256_W[i - 2];\n            const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n            const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n            SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n        }\n        // Compression function main loop, 64 rounds\n        let { A, B, C, D, E, F, G, H } = this;\n        for (let i = 0; i < 64; i++) {\n            const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n            const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n            const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n            const T2 = (sigma0 + Maj(A, B, C)) | 0;\n            H = G;\n            G = F;\n            F = E;\n            E = (D + T1) | 0;\n            D = C;\n            C = B;\n            B = A;\n            A = (T1 + T2) | 0;\n        }\n        // Add the compressed chunk to the current hash value\n        A = (A + this.A) | 0;\n        B = (B + this.B) | 0;\n        C = (C + this.C) | 0;\n        D = (D + this.D) | 0;\n        E = (E + this.E) | 0;\n        F = (F + this.F) | 0;\n        G = (G + this.G) | 0;\n        H = (H + this.H) | 0;\n        this.set(A, B, C, D, E, F, G, H);\n    }\n    roundClean() {\n        clean(SHA256_W);\n    }\n    destroy() {\n        this.set(0, 0, 0, 0, 0, 0, 0, 0);\n        clean(this.buffer);\n    }\n}\nexport class SHA224 extends SHA256 {\n    constructor() {\n        super(28);\n        this.A = SHA224_IV[0] | 0;\n        this.B = SHA224_IV[1] | 0;\n        this.C = SHA224_IV[2] | 0;\n        this.D = SHA224_IV[3] | 0;\n        this.E = SHA224_IV[4] | 0;\n        this.F = SHA224_IV[5] | 0;\n        this.G = SHA224_IV[6] | 0;\n        this.H = SHA224_IV[7] | 0;\n    }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n    '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n    '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n    '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n    '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n    '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n    '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n    '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n    '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n    '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n    '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n    '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n    '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n    '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n    '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n    '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n    '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n    '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n    '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n    '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n    '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends HashMD {\n    constructor(outputLen = 64) {\n        super(128, outputLen, 16, false);\n        // We cannot use array here since array allows indexing by variable\n        // which means optimizer/compiler cannot use registers.\n        // h -- high 32 bits, l -- low 32 bits\n        this.Ah = SHA512_IV[0] | 0;\n        this.Al = SHA512_IV[1] | 0;\n        this.Bh = SHA512_IV[2] | 0;\n        this.Bl = SHA512_IV[3] | 0;\n        this.Ch = SHA512_IV[4] | 0;\n        this.Cl = SHA512_IV[5] | 0;\n        this.Dh = SHA512_IV[6] | 0;\n        this.Dl = SHA512_IV[7] | 0;\n        this.Eh = SHA512_IV[8] | 0;\n        this.El = SHA512_IV[9] | 0;\n        this.Fh = SHA512_IV[10] | 0;\n        this.Fl = SHA512_IV[11] | 0;\n        this.Gh = SHA512_IV[12] | 0;\n        this.Gl = SHA512_IV[13] | 0;\n        this.Hh = SHA512_IV[14] | 0;\n        this.Hl = SHA512_IV[15] | 0;\n    }\n    // prettier-ignore\n    get() {\n        const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n        return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n    }\n    // prettier-ignore\n    set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n        this.Ah = Ah | 0;\n        this.Al = Al | 0;\n        this.Bh = Bh | 0;\n        this.Bl = Bl | 0;\n        this.Ch = Ch | 0;\n        this.Cl = Cl | 0;\n        this.Dh = Dh | 0;\n        this.Dl = Dl | 0;\n        this.Eh = Eh | 0;\n        this.El = El | 0;\n        this.Fh = Fh | 0;\n        this.Fl = Fl | 0;\n        this.Gh = Gh | 0;\n        this.Gl = Gl | 0;\n        this.Hh = Hh | 0;\n        this.Hl = Hl | 0;\n    }\n    process(view, offset) {\n        // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n        for (let i = 0; i < 16; i++, offset += 4) {\n            SHA512_W_H[i] = view.getUint32(offset);\n            SHA512_W_L[i] = view.getUint32((offset += 4));\n        }\n        for (let i = 16; i < 80; i++) {\n            // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n            const W15h = SHA512_W_H[i - 15] | 0;\n            const W15l = SHA512_W_L[i - 15] | 0;\n            const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n            const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n            // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n            const W2h = SHA512_W_H[i - 2] | 0;\n            const W2l = SHA512_W_L[i - 2] | 0;\n            const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n            const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n            // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n            const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n            const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n            SHA512_W_H[i] = SUMh | 0;\n            SHA512_W_L[i] = SUMl | 0;\n        }\n        let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n        // Compression function main loop, 80 rounds\n        for (let i = 0; i < 80; i++) {\n            // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n            const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n            const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n            //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n            const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n            const CHIl = (El & Fl) ^ (~El & Gl);\n            // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n            // prettier-ignore\n            const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n            const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n            const T1l = T1ll | 0;\n            // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n            const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n            const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n            const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n            const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n            Hh = Gh | 0;\n            Hl = Gl | 0;\n            Gh = Fh | 0;\n            Gl = Fl | 0;\n            Fh = Eh | 0;\n            Fl = El | 0;\n            ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n            Dh = Ch | 0;\n            Dl = Cl | 0;\n            Ch = Bh | 0;\n            Cl = Bl | 0;\n            Bh = Ah | 0;\n            Bl = Al | 0;\n            const All = u64.add3L(T1l, sigma0l, MAJl);\n            Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n            Al = All | 0;\n        }\n        // Add the compressed chunk to the current hash value\n        ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n        ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n        ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n        ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n        ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n        ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n        ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n        ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n        this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n    }\n    roundClean() {\n        clean(SHA512_W_H, SHA512_W_L);\n    }\n    destroy() {\n        clean(this.buffer);\n        this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n    }\n}\nexport class SHA384 extends SHA512 {\n    constructor() {\n        super(48);\n        this.Ah = SHA384_IV[0] | 0;\n        this.Al = SHA384_IV[1] | 0;\n        this.Bh = SHA384_IV[2] | 0;\n        this.Bl = SHA384_IV[3] | 0;\n        this.Ch = SHA384_IV[4] | 0;\n        this.Cl = SHA384_IV[5] | 0;\n        this.Dh = SHA384_IV[6] | 0;\n        this.Dl = SHA384_IV[7] | 0;\n        this.Eh = SHA384_IV[8] | 0;\n        this.El = SHA384_IV[9] | 0;\n        this.Fh = SHA384_IV[10] | 0;\n        this.Fl = SHA384_IV[11] | 0;\n        this.Gh = SHA384_IV[12] | 0;\n        this.Gl = SHA384_IV[13] | 0;\n        this.Hh = SHA384_IV[14] | 0;\n        this.Hl = SHA384_IV[15] | 0;\n    }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n    0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n    0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n    0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n    0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\nexport class SHA512_224 extends SHA512 {\n    constructor() {\n        super(28);\n        this.Ah = T224_IV[0] | 0;\n        this.Al = T224_IV[1] | 0;\n        this.Bh = T224_IV[2] | 0;\n        this.Bl = T224_IV[3] | 0;\n        this.Ch = T224_IV[4] | 0;\n        this.Cl = T224_IV[5] | 0;\n        this.Dh = T224_IV[6] | 0;\n        this.Dl = T224_IV[7] | 0;\n        this.Eh = T224_IV[8] | 0;\n        this.El = T224_IV[9] | 0;\n        this.Fh = T224_IV[10] | 0;\n        this.Fl = T224_IV[11] | 0;\n        this.Gh = T224_IV[12] | 0;\n        this.Gl = T224_IV[13] | 0;\n        this.Hh = T224_IV[14] | 0;\n        this.Hl = T224_IV[15] | 0;\n    }\n}\nexport class SHA512_256 extends SHA512 {\n    constructor() {\n        super(32);\n        this.Ah = T256_IV[0] | 0;\n        this.Al = T256_IV[1] | 0;\n        this.Bh = T256_IV[2] | 0;\n        this.Bl = T256_IV[3] | 0;\n        this.Ch = T256_IV[4] | 0;\n        this.Cl = T256_IV[5] | 0;\n        this.Dh = T256_IV[6] | 0;\n        this.Dl = T256_IV[7] | 0;\n        this.Eh = T256_IV[8] | 0;\n        this.El = T256_IV[9] | 0;\n        this.Fh = T256_IV[10] | 0;\n        this.Fl = T256_IV[11] | 0;\n        this.Gh = T256_IV[12] | 0;\n        this.Gl = T256_IV[13] | 0;\n        this.Hh = T256_IV[14] | 0;\n        this.Hl = T256_IV[15] | 0;\n    }\n}\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new SHA224());\n/** SHA2-512 hash function from RFC 4634. */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new SHA384());\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new SHA512_224());\n//# sourceMappingURL=sha2.js.map/**\n * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.\n *\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n *\n * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n * @deprecated\n */\nimport { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n, } from \"./sha2.js\";\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA256 = SHA256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha256 = sha256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA224 = SHA224n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha224 = sha224n;\n//# sourceMappingURL=sha256.js.map/**\n * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow.\n *\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf).\n * @module\n * @deprecated\n */\nimport { SHA384 as SHA384n, sha384 as sha384n, sha512_224 as sha512_224n, SHA512_224 as SHA512_224n, sha512_256 as sha512_256n, SHA512_256 as SHA512_256n, SHA512 as SHA512n, sha512 as sha512n, } from \"./sha2.js\";\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA512 = SHA512n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha512 = sha512n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA384 = SHA384n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha384 = sha384n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA512_224 = SHA512_224n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha512_224 = sha512_224n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const SHA512_256 = SHA512_256n;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexport const sha512_256 = sha512_256n;\n//# sourceMappingURL=sha512.js.map/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nexport function isBytes(a) {\n    return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is positive integer. */\nexport function anumber(n) {\n    if (!Number.isSafeInteger(n) || n < 0)\n        throw new Error('positive integer expected, got ' + n);\n}\n/** Asserts something is Uint8Array. */\nexport function abytes(b, ...lengths) {\n    if (!isBytes(b))\n        throw new Error('Uint8Array expected');\n    if (lengths.length > 0 && !lengths.includes(b.length))\n        throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n/** Asserts something is hash */\nexport function ahash(h) {\n    if (typeof h !== 'function' || typeof h.create !== 'function')\n        throw new Error('Hash should be wrapped by utils.createHasher');\n    anumber(h.outputLen);\n    anumber(h.blockLen);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nexport function aexists(instance, checkFinished = true) {\n    if (instance.destroyed)\n        throw new Error('Hash instance has been destroyed');\n    if (checkFinished && instance.finished)\n        throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nexport function aoutput(out, instance) {\n    abytes(out);\n    const min = instance.outputLen;\n    if (out.length < min) {\n        throw new Error('digestInto() expects output buffer of length at least ' + min);\n    }\n}\n/** Cast u8 / u16 / u32 to u8. */\nexport function u8(arr) {\n    return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** Cast u8 / u16 / u32 to u32. */\nexport function u32(arr) {\n    return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nexport function clean(...arrays) {\n    for (let i = 0; i < arrays.length; i++) {\n        arrays[i].fill(0);\n    }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nexport function createView(arr) {\n    return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nexport function rotr(word, shift) {\n    return (word << (32 - shift)) | (word >>> shift);\n}\n/** The rotate left (circular left shift) operation for uint32 */\nexport function rotl(word, shift) {\n    return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/** The byte swap operation for uint32 */\nexport function byteSwap(word) {\n    return (((word << 24) & 0xff000000) |\n        ((word << 8) & 0xff0000) |\n        ((word >>> 8) & 0xff00) |\n        ((word >>> 24) & 0xff));\n}\n/** Conditionally byte swap if on a big-endian platform */\nexport const swap8IfBE = isLE\n    ? (n) => n\n    : (n) => byteSwap(n);\n/** @deprecated */\nexport const byteSwapIfBE = swap8IfBE;\n/** In place byte swap for Uint32Array */\nexport function byteSwap32(arr) {\n    for (let i = 0; i < arr.length; i++) {\n        arr[i] = byteSwap(arr[i]);\n    }\n    return arr;\n}\nexport const swap32IfBE = isLE\n    ? (u) => u\n    : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n    abytes(bytes);\n    // @ts-ignore\n    if (hasHexBuiltin)\n        return bytes.toHex();\n    // pre-caching improves the speed 6x\n    let hex = '';\n    for (let i = 0; i < bytes.length; i++) {\n        hex += hexes[bytes[i]];\n    }\n    return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n    if (ch >= asciis._0 && ch <= asciis._9)\n        return ch - asciis._0; // '2' => 50-48\n    if (ch >= asciis.A && ch <= asciis.F)\n        return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n    if (ch >= asciis.a && ch <= asciis.f)\n        return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n    return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n    if (typeof hex !== 'string')\n        throw new Error('hex string expected, got ' + typeof hex);\n    // @ts-ignore\n    if (hasHexBuiltin)\n        return Uint8Array.fromHex(hex);\n    const hl = hex.length;\n    const al = hl / 2;\n    if (hl % 2)\n        throw new Error('hex string expected, got unpadded hex of length ' + hl);\n    const array = new Uint8Array(al);\n    for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n        const n1 = asciiToBase16(hex.charCodeAt(hi));\n        const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n        if (n1 === undefined || n2 === undefined) {\n            const char = hex[hi] + hex[hi + 1];\n            throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n        }\n        array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n    }\n    return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nexport const nextTick = async () => { };\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nexport async function asyncLoop(iters, tick, cb) {\n    let ts = Date.now();\n    for (let i = 0; i < iters; i++) {\n        cb(i);\n        // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n        const diff = Date.now() - ts;\n        if (diff >= 0 && diff < tick)\n            continue;\n        await nextTick();\n        ts += diff;\n    }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n    if (typeof str !== 'string')\n        throw new Error('string expected');\n    return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nexport function bytesToUtf8(bytes) {\n    return new TextDecoder().decode(bytes);\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n    if (typeof data === 'string')\n        data = utf8ToBytes(data);\n    abytes(data);\n    return data;\n}\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nexport function kdfInputToBytes(data) {\n    if (typeof data === 'string')\n        data = utf8ToBytes(data);\n    abytes(data);\n    return data;\n}\n/** Copies several Uint8Arrays into one. */\nexport function concatBytes(...arrays) {\n    let sum = 0;\n    for (let i = 0; i < arrays.length; i++) {\n        const a = arrays[i];\n        abytes(a);\n        sum += a.length;\n    }\n    const res = new Uint8Array(sum);\n    for (let i = 0, pad = 0; i < arrays.length; i++) {\n        const a = arrays[i];\n        res.set(a, pad);\n        pad += a.length;\n    }\n    return res;\n}\nexport function checkOpts(defaults, opts) {\n    if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n        throw new Error('options should be object or undefined');\n    const merged = Object.assign(defaults, opts);\n    return merged;\n}\n/** For runtime check if class implements interface */\nexport class Hash {\n}\n/** Wraps hash function, creating an interface on top of it */\nexport function createHasher(hashCons) {\n    const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n    const tmp = hashCons();\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = () => hashCons();\n    return hashC;\n}\nexport function createOptHasher(hashCons) {\n    const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n    const tmp = hashCons({});\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = (opts) => hashCons(opts);\n    return hashC;\n}\nexport function createXOFer(hashCons) {\n    const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n    const tmp = hashCons({});\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = (opts) => hashCons(opts);\n    return hashC;\n}\nexport const wrapConstructor = createHasher;\nexport const wrapConstructorWithOpts = createOptHasher;\nexport const wrapXOFConstructorWithOpts = createXOFer;\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nexport function randomBytes(bytesLength = 32) {\n    if (crypto && typeof crypto.getRandomValues === 'function') {\n        return crypto.getRandomValues(new Uint8Array(bytesLength));\n    }\n    // Legacy Node.js compatibility\n    if (crypto && typeof crypto.randomBytes === 'function') {\n        return Uint8Array.from(crypto.randomBytes(bytesLength));\n    }\n    throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hmac = exports.HMAC = void 0;\n/**\n * HMAC: RFC2104 message authentication code.\n * @module\n */\nconst utils_ts_1 = require(\"./utils.js\");\nclass HMAC extends utils_ts_1.Hash {\n    constructor(hash, _key) {\n        super();\n        this.finished = false;\n        this.destroyed = false;\n        (0, utils_ts_1.ahash)(hash);\n        const key = (0, utils_ts_1.toBytes)(_key);\n        this.iHash = hash.create();\n        if (typeof this.iHash.update !== 'function')\n            throw new Error('Expected instance of class which extends utils.Hash');\n        this.blockLen = this.iHash.blockLen;\n        this.outputLen = this.iHash.outputLen;\n        const blockLen = this.blockLen;\n        const pad = new Uint8Array(blockLen);\n        // blockLen can be bigger than outputLen\n        pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n        for (let i = 0; i < pad.length; i++)\n            pad[i] ^= 0x36;\n        this.iHash.update(pad);\n        // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n        this.oHash = hash.create();\n        // Undo internal XOR && apply outer XOR\n        for (let i = 0; i < pad.length; i++)\n            pad[i] ^= 0x36 ^ 0x5c;\n        this.oHash.update(pad);\n        (0, utils_ts_1.clean)(pad);\n    }\n    update(buf) {\n        (0, utils_ts_1.aexists)(this);\n        this.iHash.update(buf);\n        return this;\n    }\n    digestInto(out) {\n        (0, utils_ts_1.aexists)(this);\n        (0, utils_ts_1.abytes)(out, this.outputLen);\n        this.finished = true;\n        this.iHash.digestInto(out);\n        this.oHash.update(out);\n        this.oHash.digestInto(out);\n        this.destroy();\n    }\n    digest() {\n        const out = new Uint8Array(this.oHash.outputLen);\n        this.digestInto(out);\n        return out;\n    }\n    _cloneInto(to) {\n        // Create new instance without calling constructor since key already in state and we don't know it.\n        to || (to = Object.create(Object.getPrototypeOf(this), {}));\n        const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n        to = to;\n        to.finished = finished;\n        to.destroyed = destroyed;\n        to.blockLen = blockLen;\n        to.outputLen = outputLen;\n        to.oHash = oHash._cloneInto(to.oHash);\n        to.iHash = iHash._cloneInto(to.iHash);\n        return to;\n    }\n    clone() {\n        return this._cloneInto();\n    }\n    destroy() {\n        this.destroyed = true;\n        this.oHash.destroy();\n        this.iHash.destroy();\n    }\n}\nexports.HMAC = HMAC;\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n * @example\n * import { hmac } from '@noble/hashes/hmac';\n * import { sha256 } from '@noble/hashes/sha2';\n * const mac1 = hmac(sha256, 'key', 'message');\n */\nconst hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nexports.hmac = hmac;\nexports.hmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ripemd160 = exports.RIPEMD160 = exports.md5 = exports.MD5 = exports.sha1 = exports.SHA1 = void 0;\n/**\n\nSHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions.\nDon't use them in a new protocol. What \"weak\" means:\n\n- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.\n- No practical pre-image attacks (only theoretical, 2^123.4)\n- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151\n * @module\n */\nconst _md_ts_1 = require(\"./_md.js\");\nconst utils_ts_1 = require(\"./utils.js\");\n/** Initial SHA1 state */\nconst SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n    0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Reusable temporary buffer\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\n/** SHA1 legacy hash class. */\nclass SHA1 extends _md_ts_1.HashMD {\n    constructor() {\n        super(64, 20, 8, false);\n        this.A = SHA1_IV[0] | 0;\n        this.B = SHA1_IV[1] | 0;\n        this.C = SHA1_IV[2] | 0;\n        this.D = SHA1_IV[3] | 0;\n        this.E = SHA1_IV[4] | 0;\n    }\n    get() {\n        const { A, B, C, D, E } = this;\n        return [A, B, C, D, E];\n    }\n    set(A, B, C, D, E) {\n        this.A = A | 0;\n        this.B = B | 0;\n        this.C = C | 0;\n        this.D = D | 0;\n        this.E = E | 0;\n    }\n    process(view, offset) {\n        for (let i = 0; i < 16; i++, offset += 4)\n            SHA1_W[i] = view.getUint32(offset, false);\n        for (let i = 16; i < 80; i++)\n            SHA1_W[i] = (0, utils_ts_1.rotl)(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n        // Compression function main loop, 80 rounds\n        let { A, B, C, D, E } = this;\n        for (let i = 0; i < 80; i++) {\n            let F, K;\n            if (i < 20) {\n                F = (0, _md_ts_1.Chi)(B, C, D);\n                K = 0x5a827999;\n            }\n            else if (i < 40) {\n                F = B ^ C ^ D;\n                K = 0x6ed9eba1;\n            }\n            else if (i < 60) {\n                F = (0, _md_ts_1.Maj)(B, C, D);\n                K = 0x8f1bbcdc;\n            }\n            else {\n                F = B ^ C ^ D;\n                K = 0xca62c1d6;\n            }\n            const T = ((0, utils_ts_1.rotl)(A, 5) + F + E + K + SHA1_W[i]) | 0;\n            E = D;\n            D = C;\n            C = (0, utils_ts_1.rotl)(B, 30);\n            B = A;\n            A = T;\n        }\n        // Add the compressed chunk to the current hash value\n        A = (A + this.A) | 0;\n        B = (B + this.B) | 0;\n        C = (C + this.C) | 0;\n        D = (D + this.D) | 0;\n        E = (E + this.E) | 0;\n        this.set(A, B, C, D, E);\n    }\n    roundClean() {\n        (0, utils_ts_1.clean)(SHA1_W);\n    }\n    destroy() {\n        this.set(0, 0, 0, 0, 0);\n        (0, utils_ts_1.clean)(this.buffer);\n    }\n}\nexports.SHA1 = SHA1;\n/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */\nexports.sha1 = (0, utils_ts_1.createHasher)(() => new SHA1());\n/** Per-round constants */\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\nconst K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/** md5 initial state: same as sha1, but 4 u32 instead of 5. */\nconst MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\n// Reusable temporary buffer\nconst MD5_W = /* @__PURE__ */ new Uint32Array(16);\n/** MD5 legacy hash class. */\nclass MD5 extends _md_ts_1.HashMD {\n    constructor() {\n        super(64, 16, 8, true);\n        this.A = MD5_IV[0] | 0;\n        this.B = MD5_IV[1] | 0;\n        this.C = MD5_IV[2] | 0;\n        this.D = MD5_IV[3] | 0;\n    }\n    get() {\n        const { A, B, C, D } = this;\n        return [A, B, C, D];\n    }\n    set(A, B, C, D) {\n        this.A = A | 0;\n        this.B = B | 0;\n        this.C = C | 0;\n        this.D = D | 0;\n    }\n    process(view, offset) {\n        for (let i = 0; i < 16; i++, offset += 4)\n            MD5_W[i] = view.getUint32(offset, true);\n        // Compression function main loop, 64 rounds\n        let { A, B, C, D } = this;\n        for (let i = 0; i < 64; i++) {\n            let F, g, s;\n            if (i < 16) {\n                F = (0, _md_ts_1.Chi)(B, C, D);\n                g = i;\n                s = [7, 12, 17, 22];\n            }\n            else if (i < 32) {\n                F = (0, _md_ts_1.Chi)(D, B, C);\n                g = (5 * i + 1) % 16;\n                s = [5, 9, 14, 20];\n            }\n            else if (i < 48) {\n                F = B ^ C ^ D;\n                g = (3 * i + 5) % 16;\n                s = [4, 11, 16, 23];\n            }\n            else {\n                F = C ^ (B | ~D);\n                g = (7 * i) % 16;\n                s = [6, 10, 15, 21];\n            }\n            F = F + A + K[i] + MD5_W[g];\n            A = D;\n            D = C;\n            C = B;\n            B = B + (0, utils_ts_1.rotl)(F, s[i % 4]);\n        }\n        // Add the compressed chunk to the current hash value\n        A = (A + this.A) | 0;\n        B = (B + this.B) | 0;\n        C = (C + this.C) | 0;\n        D = (D + this.D) | 0;\n        this.set(A, B, C, D);\n    }\n    roundClean() {\n        (0, utils_ts_1.clean)(MD5_W);\n    }\n    destroy() {\n        this.set(0, 0, 0, 0);\n        (0, utils_ts_1.clean)(this.buffer);\n    }\n}\nexports.MD5 = MD5;\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n */\nexports.md5 = (0, utils_ts_1.createHasher)(() => new MD5());\n// RIPEMD-160\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n    7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\nconst idxLR = /* @__PURE__ */ (() => {\n    const L = [Id160];\n    const R = [Pi160];\n    const res = [L, R];\n    for (let i = 0; i < 4; i++)\n        for (let j of res)\n            j.push(j[i].map((k) => Rho160[k]));\n    return res;\n})();\nconst idxL = /* @__PURE__ */ (() => idxLR[0])();\nconst idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\nconst shifts160 = /* @__PURE__ */ [\n    [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n    [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n    [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n    [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n    [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nconst shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nconst shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\nconst Kl160 = /* @__PURE__ */ Uint32Array.from([\n    0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\nconst Kr160 = /* @__PURE__ */ Uint32Array.from([\n    0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// It's called f() in spec.\nfunction ripemd_f(group, x, y, z) {\n    if (group === 0)\n        return x ^ y ^ z;\n    if (group === 1)\n        return (x & y) | (~x & z);\n    if (group === 2)\n        return (x | ~y) ^ z;\n    if (group === 3)\n        return (x & z) | (y & ~z);\n    return x ^ (y | ~z);\n}\n// Reusable temporary buffer\nconst BUF_160 = /* @__PURE__ */ new Uint32Array(16);\nclass RIPEMD160 extends _md_ts_1.HashMD {\n    constructor() {\n        super(64, 20, 8, true);\n        this.h0 = 0x67452301 | 0;\n        this.h1 = 0xefcdab89 | 0;\n        this.h2 = 0x98badcfe | 0;\n        this.h3 = 0x10325476 | 0;\n        this.h4 = 0xc3d2e1f0 | 0;\n    }\n    get() {\n        const { h0, h1, h2, h3, h4 } = this;\n        return [h0, h1, h2, h3, h4];\n    }\n    set(h0, h1, h2, h3, h4) {\n        this.h0 = h0 | 0;\n        this.h1 = h1 | 0;\n        this.h2 = h2 | 0;\n        this.h3 = h3 | 0;\n        this.h4 = h4 | 0;\n    }\n    process(view, offset) {\n        for (let i = 0; i < 16; i++, offset += 4)\n            BUF_160[i] = view.getUint32(offset, true);\n        // prettier-ignore\n        let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n        // Instead of iterating 0 to 80, we split it into 5 groups\n        // And use the groups in constants, functions, etc. Much simpler\n        for (let group = 0; group < 5; group++) {\n            const rGroup = 4 - group;\n            const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore\n            const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n            const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore\n            for (let i = 0; i < 16; i++) {\n                const tl = ((0, utils_ts_1.rotl)(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0;\n                al = el, el = dl, dl = (0, utils_ts_1.rotl)(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n            }\n            // 2 loops are 10% faster\n            for (let i = 0; i < 16; i++) {\n                const tr = ((0, utils_ts_1.rotl)(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0;\n                ar = er, er = dr, dr = (0, utils_ts_1.rotl)(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n            }\n        }\n        // Add the compressed chunk to the current hash value\n        this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n    }\n    roundClean() {\n        (0, utils_ts_1.clean)(BUF_160);\n    }\n    destroy() {\n        this.destroyed = true;\n        (0, utils_ts_1.clean)(this.buffer);\n        this.set(0, 0, 0, 0, 0);\n    }\n}\nexports.RIPEMD160 = RIPEMD160;\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\n */\nexports.ripemd160 = (0, utils_ts_1.createHasher)(() => new RIPEMD160());\n//# sourceMappingURL=legacy.js.map{\n  \"name\": \"@noble/hashes\",\n  \"version\": \"1.8.0\",\n  \"description\": \"Audited & minimal 0-dependency JS implementation of SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF & Scrypt\",\n  \"files\": [\n    \"/*.js\",\n    \"/*.js.map\",\n    \"/*.d.ts\",\n    \"/*.d.ts.map\",\n    \"esm\",\n    \"src/*.ts\"\n  ],\n  \"scripts\": {\n    \"bench\": \"node benchmark/noble.js\",\n    \"bench:compare\": \"MBENCH_DIMS='algorithm,buffer,library' node benchmark/hashes.js\",\n    \"bench:compare-hkdf\": \"MBENCH_DIMS='algorithm,length,library' node benchmark/hkdf.js\",\n    \"bench:compare-scrypt\": \"MBENCH_DIMS='iters,library' MBENCH_FILTER='async' node benchmark/scrypt.js\",\n    \"bench:install\": \"cd benchmark; npm install; npm install .. --install-links\",\n    \"build\": \"npm run build:clean; tsc && tsc -p tsconfig.cjs.json\",\n    \"build:clean\": \"rm -f *.{js,d.ts,js.map,d.ts.map} esm/*.{js,js.map,d.ts.map}\",\n    \"build:release\": \"npx jsbt esbuild test/build\",\n    \"lint\": \"prettier --check 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'\",\n    \"format\": \"prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'\",\n    \"test\": \"node --import ./test/esm-register.js test/index.js\",\n    \"test:bun\": \"bun test/index.js\",\n    \"test:deno\": \"deno --allow-env --allow-read --import-map=./test/import_map.json test/index.js\",\n    \"test:dos\": \"node --import ./test/esm-register.js test/slow-dos.test.js\",\n    \"test:big\": \"node --import ./test/esm-register.js test/slow-big.test.js\",\n    \"test:kdf\": \"node --import ./test/esm-register.js test/slow-kdf.test.js\"\n  },\n  \"author\": \"Paul Miller (https://paulmillr.com)\",\n  \"homepage\": \"https://paulmillr.com/noble/\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/paulmillr/noble-hashes.git\"\n  },\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"@paulmillr/jsbt\": \"0.3.3\",\n    \"fast-check\": \"3.0.0\",\n    \"micro-bmark\": \"0.4.1\",\n    \"micro-should\": \"0.5.2\",\n    \"prettier\": \"3.5.3\",\n    \"typescript\": \"5.8.3\"\n  },\n  \"engines\": {\n    \"node\": \"^14.21.3 || >=16\"\n  },\n  \"exports\": {\n    \".\": {\n      \"import\": \"./esm/index.js\",\n      \"require\": \"./index.js\"\n    },\n    \"./crypto\": {\n      \"node\": {\n        \"import\": \"./esm/cryptoNode.js\",\n        \"default\": \"./cryptoNode.js\"\n      },\n      \"import\": \"./esm/crypto.js\",\n      \"default\": \"./crypto.js\"\n    },\n    \"./_assert\": {\n      \"import\": \"./esm/_assert.js\",\n      \"require\": \"./_assert.js\"\n    },\n    \"./_md\": {\n      \"import\": \"./esm/_md.js\",\n      \"require\": \"./_md.js\"\n    },\n    \"./argon2\": {\n      \"import\": \"./esm/argon2.js\",\n      \"require\": \"./argon2.js\"\n    },\n    \"./blake1\": {\n      \"import\": \"./esm/blake1.js\",\n      \"require\": \"./blake1.js\"\n    },\n    \"./blake2\": {\n      \"import\": \"./esm/blake2.js\",\n      \"require\": \"./blake2.js\"\n    },\n    \"./blake2b\": {\n      \"import\": \"./esm/blake2b.js\",\n      \"require\": \"./blake2b.js\"\n    },\n    \"./blake2s\": {\n      \"import\": \"./esm/blake2s.js\",\n      \"require\": \"./blake2s.js\"\n    },\n    \"./blake3\": {\n      \"import\": \"./esm/blake3.js\",\n      \"require\": \"./blake3.js\"\n    },\n    \"./eskdf\": {\n      \"import\": \"./esm/eskdf.js\",\n      \"require\": \"./eskdf.js\"\n    },\n    \"./hkdf\": {\n      \"import\": \"./esm/hkdf.js\",\n      \"require\": \"./hkdf.js\"\n    },\n    \"./hmac\": {\n      \"import\": \"./esm/hmac.js\",\n      \"require\": \"./hmac.js\"\n    },\n    \"./legacy\": {\n      \"import\": \"./esm/legacy.js\",\n      \"require\": \"./legacy.js\"\n    },\n    \"./pbkdf2\": {\n      \"import\": \"./esm/pbkdf2.js\",\n      \"require\": \"./pbkdf2.js\"\n    },\n    \"./ripemd160\": {\n      \"import\": \"./esm/ripemd160.js\",\n      \"require\": \"./ripemd160.js\"\n    },\n    \"./scrypt\": {\n      \"import\": \"./esm/scrypt.js\",\n      \"require\": \"./scrypt.js\"\n    },\n    \"./sha1\": {\n      \"import\": \"./esm/sha1.js\",\n      \"require\": \"./sha1.js\"\n    },\n    \"./sha2\": {\n      \"import\": \"./esm/sha2.js\",\n      \"require\": \"./sha2.js\"\n    },\n    \"./sha3-addons\": {\n      \"import\": \"./esm/sha3-addons.js\",\n      \"require\": \"./sha3-addons.js\"\n    },\n    \"./sha3\": {\n      \"import\": \"./esm/sha3.js\",\n      \"require\": \"./sha3.js\"\n    },\n    \"./sha256\": {\n      \"import\": \"./esm/sha256.js\",\n      \"require\": \"./sha256.js\"\n    },\n    \"./sha512\": {\n      \"import\": \"./esm/sha512.js\",\n      \"require\": \"./sha512.js\"\n    },\n    \"./utils\": {\n      \"import\": \"./esm/utils.js\",\n      \"require\": \"./utils.js\"\n    },\n    \"./_assert.js\": {\n      \"import\": \"./esm/_assert.js\",\n      \"require\": \"./_assert.js\"\n    },\n    \"./_md.js\": {\n      \"import\": \"./esm/_md.js\",\n      \"require\": \"./_md.js\"\n    },\n    \"./argon2.js\": {\n      \"import\": \"./esm/argon2.js\",\n      \"require\": \"./argon2.js\"\n    },\n    \"./blake1.js\": {\n      \"import\": \"./esm/blake1.js\",\n      \"require\": \"./blake1.js\"\n    },\n    \"./blake2.js\": {\n      \"import\": \"./esm/blake2.js\",\n      \"require\": \"./blake2.js\"\n    },\n    \"./blake2b.js\": {\n      \"import\": \"./esm/blake2b.js\",\n      \"require\": \"./blake2b.js\"\n    },\n    \"./blake2s.js\": {\n      \"import\": \"./esm/blake2s.js\",\n      \"require\": \"./blake2s.js\"\n    },\n    \"./blake3.js\": {\n      \"import\": \"./esm/blake3.js\",\n      \"require\": \"./blake3.js\"\n    },\n    \"./eskdf.js\": {\n      \"import\": \"./esm/eskdf.js\",\n      \"require\": \"./eskdf.js\"\n    },\n    \"./hkdf.js\": {\n      \"import\": \"./esm/hkdf.js\",\n      \"require\": \"./hkdf.js\"\n    },\n    \"./hmac.js\": {\n      \"import\": \"./esm/hmac.js\",\n      \"require\": \"./hmac.js\"\n    },\n    \"./legacy.js\": {\n      \"import\": \"./esm/legacy.js\",\n      \"require\": \"./legacy.js\"\n    },\n    \"./pbkdf2.js\": {\n      \"import\": \"./esm/pbkdf2.js\",\n      \"require\": \"./pbkdf2.js\"\n    },\n    \"./ripemd160.js\": {\n      \"import\": \"./esm/ripemd160.js\",\n      \"require\": \"./ripemd160.js\"\n    },\n    \"./scrypt.js\": {\n      \"import\": \"./esm/scrypt.js\",\n      \"require\": \"./scrypt.js\"\n    },\n    \"./sha1.js\": {\n      \"import\": \"./esm/sha1.js\",\n      \"require\": \"./sha1.js\"\n    },\n    \"./sha2.js\": {\n      \"import\": \"./esm/sha2.js\",\n      \"require\": \"./sha2.js\"\n    },\n    \"./sha3-addons.js\": {\n      \"import\": \"./esm/sha3-addons.js\",\n      \"require\": \"./sha3-addons.js\"\n    },\n    \"./sha3.js\": {\n      \"import\": \"./esm/sha3.js\",\n      \"require\": \"./sha3.js\"\n    },\n    \"./sha256.js\": {\n      \"import\": \"./esm/sha256.js\",\n      \"require\": \"./sha256.js\"\n    },\n    \"./sha512.js\": {\n      \"import\": \"./esm/sha512.js\",\n      \"require\": \"./sha512.js\"\n    },\n    \"./utils.js\": {\n      \"import\": \"./esm/utils.js\",\n      \"require\": \"./utils.js\"\n    }\n  },\n  \"sideEffects\": false,\n  \"browser\": {\n    \"node:crypto\": false,\n    \"./crypto\": \"./crypto.js\"\n  },\n  \"keywords\": [\n    \"sha\",\n    \"sha2\",\n    \"sha3\",\n    \"sha256\",\n    \"sha512\",\n    \"keccak\",\n    \"kangarootwelve\",\n    \"ripemd160\",\n    \"blake2\",\n    \"blake3\",\n    \"hmac\",\n    \"hkdf\",\n    \"pbkdf2\",\n    \"scrypt\",\n    \"kdf\",\n    \"hash\",\n    \"cryptography\",\n    \"security\",\n    \"noble\"\n  ],\n  \"funding\": \"https://paulmillr.com/funding/\"\n}\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pbkdf2 = pbkdf2;\nexports.pbkdf2Async = pbkdf2Async;\n/**\n * PBKDF (RFC 2898). Can be used to create a key from password and salt.\n * @module\n */\nconst hmac_ts_1 = require(\"./hmac.js\");\n// prettier-ignore\nconst utils_ts_1 = require(\"./utils.js\");\n// Common prologue and epilogue for sync/async functions\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n    (0, utils_ts_1.ahash)(hash);\n    const opts = (0, utils_ts_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts);\n    const { c, dkLen, asyncTick } = opts;\n    (0, utils_ts_1.anumber)(c);\n    (0, utils_ts_1.anumber)(dkLen);\n    (0, utils_ts_1.anumber)(asyncTick);\n    if (c < 1)\n        throw new Error('iterations (c) should be >= 1');\n    const password = (0, utils_ts_1.kdfInputToBytes)(_password);\n    const salt = (0, utils_ts_1.kdfInputToBytes)(_salt);\n    // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n    const DK = new Uint8Array(dkLen);\n    // U1 = PRF(Password, Salt + INT_32_BE(i))\n    const PRF = hmac_ts_1.hmac.create(hash, password);\n    const PRFSalt = PRF._cloneInto().update(salt);\n    return { c, dkLen, asyncTick, DK, PRF, PRFSalt };\n}\nfunction pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {\n    PRF.destroy();\n    PRFSalt.destroy();\n    if (prfW)\n        prfW.destroy();\n    (0, utils_ts_1.clean)(u);\n    return DK;\n}\n/**\n * PBKDF2-HMAC: RFC 2898 key derivation function\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated\n * @param salt - cryptographic salt\n * @param opts - {c, dkLen} where c is work factor and dkLen is output message size\n * @example\n * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });\n */\nfunction pbkdf2(hash, password, salt, opts) {\n    const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n    let prfW; // Working copy\n    const arr = new Uint8Array(4);\n    const view = (0, utils_ts_1.createView)(arr);\n    const u = new Uint8Array(PRF.outputLen);\n    // DK = T1 + T2 + ⋯ + Tdklen/hlen\n    for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n        // Ti = F(Password, Salt, c, i)\n        const Ti = DK.subarray(pos, pos + PRF.outputLen);\n        view.setInt32(0, ti, false);\n        // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n        // U1 = PRF(Password, Salt + INT_32_BE(i))\n        (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n        Ti.set(u.subarray(0, Ti.length));\n        for (let ui = 1; ui < c; ui++) {\n            // Uc = PRF(Password, Uc−1)\n            PRF._cloneInto(prfW).update(u).digestInto(u);\n            for (let i = 0; i < Ti.length; i++)\n                Ti[i] ^= u[i];\n        }\n    }\n    return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\n/**\n * PBKDF2-HMAC: RFC 2898 key derivation function. Async version.\n * @example\n * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 });\n */\nasync function pbkdf2Async(hash, password, salt, opts) {\n    const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n    let prfW; // Working copy\n    const arr = new Uint8Array(4);\n    const view = (0, utils_ts_1.createView)(arr);\n    const u = new Uint8Array(PRF.outputLen);\n    // DK = T1 + T2 + ⋯ + Tdklen/hlen\n    for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n        // Ti = F(Password, Salt, c, i)\n        const Ti = DK.subarray(pos, pos + PRF.outputLen);\n        view.setInt32(0, ti, false);\n        // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n        // U1 = PRF(Password, Salt + INT_32_BE(i))\n        (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n        Ti.set(u.subarray(0, Ti.length));\n        await (0, utils_ts_1.asyncLoop)(c - 1, asyncTick, () => {\n            // Uc = PRF(Password, Uc−1)\n            PRF._cloneInto(prfW).update(u).digestInto(u);\n            for (let i = 0; i < Ti.length; i++)\n                Ti[i] ^= u[i];\n        });\n    }\n    return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\n//# sourceMappingURL=pbkdf2.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ripemd160 = exports.RIPEMD160 = void 0;\n/**\n * RIPEMD-160 legacy hash function.\n * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\n * @module\n * @deprecated\n */\nconst legacy_ts_1 = require(\"./legacy.js\");\n/** @deprecated Use import from `noble/hashes/legacy` module */\nexports.RIPEMD160 = legacy_ts_1.RIPEMD160;\n/** @deprecated Use import from `noble/hashes/legacy` module */\nexports.ripemd160 = legacy_ts_1.ripemd160;\n//# sourceMappingURL=ripemd160.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sha1 = exports.SHA1 = void 0;\n/**\n * SHA1 (RFC 3174) legacy hash function.\n * @module\n * @deprecated\n */\nconst legacy_ts_1 = require(\"./legacy.js\");\n/** @deprecated Use import from `noble/hashes/legacy` module */\nexports.SHA1 = legacy_ts_1.SHA1;\n/** @deprecated Use import from `noble/hashes/legacy` module */\nexports.sha1 = legacy_ts_1.sha1;\n//# sourceMappingURL=sha1.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sha512_224 = exports.sha512_256 = exports.sha384 = exports.sha512 = exports.sha224 = exports.sha256 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA384 = exports.SHA512 = exports.SHA224 = exports.SHA256 = void 0;\n/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\nconst _md_ts_1 = require(\"./_md.js\");\nconst u64 = require(\"./_u64.js\");\nconst utils_ts_1 = require(\"./utils.js\");\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n    0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n    0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n    0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n    0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n    0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n    0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n    0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n    0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nclass SHA256 extends _md_ts_1.HashMD {\n    constructor(outputLen = 32) {\n        super(64, outputLen, 8, false);\n        // We cannot use array here since array allows indexing by variable\n        // which means optimizer/compiler cannot use registers.\n        this.A = _md_ts_1.SHA256_IV[0] | 0;\n        this.B = _md_ts_1.SHA256_IV[1] | 0;\n        this.C = _md_ts_1.SHA256_IV[2] | 0;\n        this.D = _md_ts_1.SHA256_IV[3] | 0;\n        this.E = _md_ts_1.SHA256_IV[4] | 0;\n        this.F = _md_ts_1.SHA256_IV[5] | 0;\n        this.G = _md_ts_1.SHA256_IV[6] | 0;\n        this.H = _md_ts_1.SHA256_IV[7] | 0;\n    }\n    get() {\n        const { A, B, C, D, E, F, G, H } = this;\n        return [A, B, C, D, E, F, G, H];\n    }\n    // prettier-ignore\n    set(A, B, C, D, E, F, G, H) {\n        this.A = A | 0;\n        this.B = B | 0;\n        this.C = C | 0;\n        this.D = D | 0;\n        this.E = E | 0;\n        this.F = F | 0;\n        this.G = G | 0;\n        this.H = H | 0;\n    }\n    process(view, offset) {\n        // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n        for (let i = 0; i < 16; i++, offset += 4)\n            SHA256_W[i] = view.getUint32(offset, false);\n        for (let i = 16; i < 64; i++) {\n            const W15 = SHA256_W[i - 15];\n            const W2 = SHA256_W[i - 2];\n            const s0 = (0, utils_ts_1.rotr)(W15, 7) ^ (0, utils_ts_1.rotr)(W15, 18) ^ (W15 >>> 3);\n            const s1 = (0, utils_ts_1.rotr)(W2, 17) ^ (0, utils_ts_1.rotr)(W2, 19) ^ (W2 >>> 10);\n            SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n        }\n        // Compression function main loop, 64 rounds\n        let { A, B, C, D, E, F, G, H } = this;\n        for (let i = 0; i < 64; i++) {\n            const sigma1 = (0, utils_ts_1.rotr)(E, 6) ^ (0, utils_ts_1.rotr)(E, 11) ^ (0, utils_ts_1.rotr)(E, 25);\n            const T1 = (H + sigma1 + (0, _md_ts_1.Chi)(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n            const sigma0 = (0, utils_ts_1.rotr)(A, 2) ^ (0, utils_ts_1.rotr)(A, 13) ^ (0, utils_ts_1.rotr)(A, 22);\n            const T2 = (sigma0 + (0, _md_ts_1.Maj)(A, B, C)) | 0;\n            H = G;\n            G = F;\n            F = E;\n            E = (D + T1) | 0;\n            D = C;\n            C = B;\n            B = A;\n            A = (T1 + T2) | 0;\n        }\n        // Add the compressed chunk to the current hash value\n        A = (A + this.A) | 0;\n        B = (B + this.B) | 0;\n        C = (C + this.C) | 0;\n        D = (D + this.D) | 0;\n        E = (E + this.E) | 0;\n        F = (F + this.F) | 0;\n        G = (G + this.G) | 0;\n        H = (H + this.H) | 0;\n        this.set(A, B, C, D, E, F, G, H);\n    }\n    roundClean() {\n        (0, utils_ts_1.clean)(SHA256_W);\n    }\n    destroy() {\n        this.set(0, 0, 0, 0, 0, 0, 0, 0);\n        (0, utils_ts_1.clean)(this.buffer);\n    }\n}\nexports.SHA256 = SHA256;\nclass SHA224 extends SHA256 {\n    constructor() {\n        super(28);\n        this.A = _md_ts_1.SHA224_IV[0] | 0;\n        this.B = _md_ts_1.SHA224_IV[1] | 0;\n        this.C = _md_ts_1.SHA224_IV[2] | 0;\n        this.D = _md_ts_1.SHA224_IV[3] | 0;\n        this.E = _md_ts_1.SHA224_IV[4] | 0;\n        this.F = _md_ts_1.SHA224_IV[5] | 0;\n        this.G = _md_ts_1.SHA224_IV[6] | 0;\n        this.H = _md_ts_1.SHA224_IV[7] | 0;\n    }\n}\nexports.SHA224 = SHA224;\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// Round contants\n// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n    '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n    '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n    '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n    '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n    '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n    '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n    '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n    '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n    '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n    '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n    '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n    '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n    '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n    '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n    '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n    '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n    '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n    '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n    '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n    '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable temporary buffers\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nclass SHA512 extends _md_ts_1.HashMD {\n    constructor(outputLen = 64) {\n        super(128, outputLen, 16, false);\n        // We cannot use array here since array allows indexing by variable\n        // which means optimizer/compiler cannot use registers.\n        // h -- high 32 bits, l -- low 32 bits\n        this.Ah = _md_ts_1.SHA512_IV[0] | 0;\n        this.Al = _md_ts_1.SHA512_IV[1] | 0;\n        this.Bh = _md_ts_1.SHA512_IV[2] | 0;\n        this.Bl = _md_ts_1.SHA512_IV[3] | 0;\n        this.Ch = _md_ts_1.SHA512_IV[4] | 0;\n        this.Cl = _md_ts_1.SHA512_IV[5] | 0;\n        this.Dh = _md_ts_1.SHA512_IV[6] | 0;\n        this.Dl = _md_ts_1.SHA512_IV[7] | 0;\n        this.Eh = _md_ts_1.SHA512_IV[8] | 0;\n        this.El = _md_ts_1.SHA512_IV[9] | 0;\n        this.Fh = _md_ts_1.SHA512_IV[10] | 0;\n        this.Fl = _md_ts_1.SHA512_IV[11] | 0;\n        this.Gh = _md_ts_1.SHA512_IV[12] | 0;\n        this.Gl = _md_ts_1.SHA512_IV[13] | 0;\n        this.Hh = _md_ts_1.SHA512_IV[14] | 0;\n        this.Hl = _md_ts_1.SHA512_IV[15] | 0;\n    }\n    // prettier-ignore\n    get() {\n        const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n        return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n    }\n    // prettier-ignore\n    set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n        this.Ah = Ah | 0;\n        this.Al = Al | 0;\n        this.Bh = Bh | 0;\n        this.Bl = Bl | 0;\n        this.Ch = Ch | 0;\n        this.Cl = Cl | 0;\n        this.Dh = Dh | 0;\n        this.Dl = Dl | 0;\n        this.Eh = Eh | 0;\n        this.El = El | 0;\n        this.Fh = Fh | 0;\n        this.Fl = Fl | 0;\n        this.Gh = Gh | 0;\n        this.Gl = Gl | 0;\n        this.Hh = Hh | 0;\n        this.Hl = Hl | 0;\n    }\n    process(view, offset) {\n        // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n        for (let i = 0; i < 16; i++, offset += 4) {\n            SHA512_W_H[i] = view.getUint32(offset);\n            SHA512_W_L[i] = view.getUint32((offset += 4));\n        }\n        for (let i = 16; i < 80; i++) {\n            // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n            const W15h = SHA512_W_H[i - 15] | 0;\n            const W15l = SHA512_W_L[i - 15] | 0;\n            const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n            const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n            // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n            const W2h = SHA512_W_H[i - 2] | 0;\n            const W2l = SHA512_W_L[i - 2] | 0;\n            const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n            const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n            // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n            const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n            const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n            SHA512_W_H[i] = SUMh | 0;\n            SHA512_W_L[i] = SUMl | 0;\n        }\n        let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n        // Compression function main loop, 80 rounds\n        for (let i = 0; i < 80; i++) {\n            // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n            const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n            const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n            //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n            const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n            const CHIl = (El & Fl) ^ (~El & Gl);\n            // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n            // prettier-ignore\n            const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n            const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n            const T1l = T1ll | 0;\n            // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n            const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n            const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n            const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n            const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n            Hh = Gh | 0;\n            Hl = Gl | 0;\n            Gh = Fh | 0;\n            Gl = Fl | 0;\n            Fh = Eh | 0;\n            Fl = El | 0;\n            ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n            Dh = Ch | 0;\n            Dl = Cl | 0;\n            Ch = Bh | 0;\n            Cl = Bl | 0;\n            Bh = Ah | 0;\n            Bl = Al | 0;\n            const All = u64.add3L(T1l, sigma0l, MAJl);\n            Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n            Al = All | 0;\n        }\n        // Add the compressed chunk to the current hash value\n        ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n        ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n        ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n        ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n        ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n        ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n        ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n        ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n        this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n    }\n    roundClean() {\n        (0, utils_ts_1.clean)(SHA512_W_H, SHA512_W_L);\n    }\n    destroy() {\n        (0, utils_ts_1.clean)(this.buffer);\n        this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n    }\n}\nexports.SHA512 = SHA512;\nclass SHA384 extends SHA512 {\n    constructor() {\n        super(48);\n        this.Ah = _md_ts_1.SHA384_IV[0] | 0;\n        this.Al = _md_ts_1.SHA384_IV[1] | 0;\n        this.Bh = _md_ts_1.SHA384_IV[2] | 0;\n        this.Bl = _md_ts_1.SHA384_IV[3] | 0;\n        this.Ch = _md_ts_1.SHA384_IV[4] | 0;\n        this.Cl = _md_ts_1.SHA384_IV[5] | 0;\n        this.Dh = _md_ts_1.SHA384_IV[6] | 0;\n        this.Dl = _md_ts_1.SHA384_IV[7] | 0;\n        this.Eh = _md_ts_1.SHA384_IV[8] | 0;\n        this.El = _md_ts_1.SHA384_IV[9] | 0;\n        this.Fh = _md_ts_1.SHA384_IV[10] | 0;\n        this.Fl = _md_ts_1.SHA384_IV[11] | 0;\n        this.Gh = _md_ts_1.SHA384_IV[12] | 0;\n        this.Gl = _md_ts_1.SHA384_IV[13] | 0;\n        this.Hh = _md_ts_1.SHA384_IV[14] | 0;\n        this.Hl = _md_ts_1.SHA384_IV[15] | 0;\n    }\n}\nexports.SHA384 = SHA384;\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See `test/misc/sha2-gen-iv.js`.\n */\n/** SHA512/224 IV */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n    0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n    0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA512/256 IV */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n    0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n    0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\nclass SHA512_224 extends SHA512 {\n    constructor() {\n        super(28);\n        this.Ah = T224_IV[0] | 0;\n        this.Al = T224_IV[1] | 0;\n        this.Bh = T224_IV[2] | 0;\n        this.Bl = T224_IV[3] | 0;\n        this.Ch = T224_IV[4] | 0;\n        this.Cl = T224_IV[5] | 0;\n        this.Dh = T224_IV[6] | 0;\n        this.Dl = T224_IV[7] | 0;\n        this.Eh = T224_IV[8] | 0;\n        this.El = T224_IV[9] | 0;\n        this.Fh = T224_IV[10] | 0;\n        this.Fl = T224_IV[11] | 0;\n        this.Gh = T224_IV[12] | 0;\n        this.Gl = T224_IV[13] | 0;\n        this.Hh = T224_IV[14] | 0;\n        this.Hl = T224_IV[15] | 0;\n    }\n}\nexports.SHA512_224 = SHA512_224;\nclass SHA512_256 extends SHA512 {\n    constructor() {\n        super(32);\n        this.Ah = T256_IV[0] | 0;\n        this.Al = T256_IV[1] | 0;\n        this.Bh = T256_IV[2] | 0;\n        this.Bl = T256_IV[3] | 0;\n        this.Ch = T256_IV[4] | 0;\n        this.Cl = T256_IV[5] | 0;\n        this.Dh = T256_IV[6] | 0;\n        this.Dl = T256_IV[7] | 0;\n        this.Eh = T256_IV[8] | 0;\n        this.El = T256_IV[9] | 0;\n        this.Fh = T256_IV[10] | 0;\n        this.Fl = T256_IV[11] | 0;\n        this.Gh = T256_IV[12] | 0;\n        this.Gl = T256_IV[13] | 0;\n        this.Hh = T256_IV[14] | 0;\n        this.Hl = T256_IV[15] | 0;\n    }\n}\nexports.SHA512_256 = SHA512_256;\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nexports.sha256 = (0, utils_ts_1.createHasher)(() => new SHA256());\n/** SHA2-224 hash function from RFC 4634 */\nexports.sha224 = (0, utils_ts_1.createHasher)(() => new SHA224());\n/** SHA2-512 hash function from RFC 4634. */\nexports.sha512 = (0, utils_ts_1.createHasher)(() => new SHA512());\n/** SHA2-384 hash function from RFC 4634. */\nexports.sha384 = (0, utils_ts_1.createHasher)(() => new SHA384());\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexports.sha512_256 = (0, utils_ts_1.createHasher)(() => new SHA512_256());\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf).\n */\nexports.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224());\n//# sourceMappingURL=sha2.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sha224 = exports.SHA224 = exports.sha256 = exports.SHA256 = void 0;\n/**\n * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.\n *\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n *\n * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n * @deprecated\n */\nconst sha2_ts_1 = require(\"./sha2.js\");\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.SHA256 = sha2_ts_1.SHA256;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.sha256 = sha2_ts_1.sha256;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.SHA224 = sha2_ts_1.SHA224;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.sha224 = sha2_ts_1.sha224;\n//# sourceMappingURL=sha256.js.map\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sha512_256 = exports.SHA512_256 = exports.sha512_224 = exports.SHA512_224 = exports.sha384 = exports.SHA384 = exports.sha512 = exports.SHA512 = void 0;\n/**\n * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow.\n *\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf).\n * @module\n * @deprecated\n */\nconst sha2_ts_1 = require(\"./sha2.js\");\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.SHA512 = sha2_ts_1.SHA512;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.sha512 = sha2_ts_1.sha512;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.SHA384 = sha2_ts_1.SHA384;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.sha384 = sha2_ts_1.sha384;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.SHA512_224 = sha2_ts_1.SHA512_224;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.sha512_224 = sha2_ts_1.sha512_224;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.SHA512_256 = sha2_ts_1.SHA512_256;\n/** @deprecated Use import from `noble/hashes/sha2` module */\nexports.sha512_256 = sha2_ts_1.sha512_256;\n//# sourceMappingURL=sha512.js.map\"use strict\";\n/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = void 0;\nexports.isBytes = isBytes;\nexports.anumber = anumber;\nexports.abytes = abytes;\nexports.ahash = ahash;\nexports.aexists = aexists;\nexports.aoutput = aoutput;\nexports.u8 = u8;\nexports.u32 = u32;\nexports.clean = clean;\nexports.createView = createView;\nexports.rotr = rotr;\nexports.rotl = rotl;\nexports.byteSwap = byteSwap;\nexports.byteSwap32 = byteSwap32;\nexports.bytesToHex = bytesToHex;\nexports.hexToBytes = hexToBytes;\nexports.asyncLoop = asyncLoop;\nexports.utf8ToBytes = utf8ToBytes;\nexports.bytesToUtf8 = bytesToUtf8;\nexports.toBytes = toBytes;\nexports.kdfInputToBytes = kdfInputToBytes;\nexports.concatBytes = concatBytes;\nexports.checkOpts = checkOpts;\nexports.createHasher = createHasher;\nexports.createOptHasher = createOptHasher;\nexports.createXOFer = createXOFer;\nexports.randomBytes = randomBytes;\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nconst crypto_1 = require(\"@noble/hashes/crypto\");\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nfunction isBytes(a) {\n    return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is positive integer. */\nfunction anumber(n) {\n    if (!Number.isSafeInteger(n) || n < 0)\n        throw new Error('positive integer expected, got ' + n);\n}\n/** Asserts something is Uint8Array. */\nfunction abytes(b, ...lengths) {\n    if (!isBytes(b))\n        throw new Error('Uint8Array expected');\n    if (lengths.length > 0 && !lengths.includes(b.length))\n        throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n/** Asserts something is hash */\nfunction ahash(h) {\n    if (typeof h !== 'function' || typeof h.create !== 'function')\n        throw new Error('Hash should be wrapped by utils.createHasher');\n    anumber(h.outputLen);\n    anumber(h.blockLen);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nfunction aexists(instance, checkFinished = true) {\n    if (instance.destroyed)\n        throw new Error('Hash instance has been destroyed');\n    if (checkFinished && instance.finished)\n        throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nfunction aoutput(out, instance) {\n    abytes(out);\n    const min = instance.outputLen;\n    if (out.length < min) {\n        throw new Error('digestInto() expects output buffer of length at least ' + min);\n    }\n}\n/** Cast u8 / u16 / u32 to u8. */\nfunction u8(arr) {\n    return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** Cast u8 / u16 / u32 to u32. */\nfunction u32(arr) {\n    return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nfunction clean(...arrays) {\n    for (let i = 0; i < arrays.length; i++) {\n        arrays[i].fill(0);\n    }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nfunction createView(arr) {\n    return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nfunction rotr(word, shift) {\n    return (word << (32 - shift)) | (word >>> shift);\n}\n/** The rotate left (circular left shift) operation for uint32 */\nfunction rotl(word, shift) {\n    return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Is current platform little-endian? Most are. Big-Endian platform: IBM */\nexports.isLE = (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/** The byte swap operation for uint32 */\nfunction byteSwap(word) {\n    return (((word << 24) & 0xff000000) |\n        ((word << 8) & 0xff0000) |\n        ((word >>> 8) & 0xff00) |\n        ((word >>> 24) & 0xff));\n}\n/** Conditionally byte swap if on a big-endian platform */\nexports.swap8IfBE = exports.isLE\n    ? (n) => n\n    : (n) => byteSwap(n);\n/** @deprecated */\nexports.byteSwapIfBE = exports.swap8IfBE;\n/** In place byte swap for Uint32Array */\nfunction byteSwap32(arr) {\n    for (let i = 0; i < arr.length; i++) {\n        arr[i] = byteSwap(arr[i]);\n    }\n    return arr;\n}\nexports.swap32IfBE = exports.isLE\n    ? (u) => u\n    : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nfunction bytesToHex(bytes) {\n    abytes(bytes);\n    // @ts-ignore\n    if (hasHexBuiltin)\n        return bytes.toHex();\n    // pre-caching improves the speed 6x\n    let hex = '';\n    for (let i = 0; i < bytes.length; i++) {\n        hex += hexes[bytes[i]];\n    }\n    return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n    if (ch >= asciis._0 && ch <= asciis._9)\n        return ch - asciis._0; // '2' => 50-48\n    if (ch >= asciis.A && ch <= asciis.F)\n        return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n    if (ch >= asciis.a && ch <= asciis.f)\n        return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n    return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nfunction hexToBytes(hex) {\n    if (typeof hex !== 'string')\n        throw new Error('hex string expected, got ' + typeof hex);\n    // @ts-ignore\n    if (hasHexBuiltin)\n        return Uint8Array.fromHex(hex);\n    const hl = hex.length;\n    const al = hl / 2;\n    if (hl % 2)\n        throw new Error('hex string expected, got unpadded hex of length ' + hl);\n    const array = new Uint8Array(al);\n    for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n        const n1 = asciiToBase16(hex.charCodeAt(hi));\n        const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n        if (n1 === undefined || n2 === undefined) {\n            const char = hex[hi] + hex[hi + 1];\n            throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n        }\n        array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n    }\n    return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n */\nconst nextTick = async () => { };\nexports.nextTick = nextTick;\n/** Returns control to thread each 'tick' ms to avoid blocking. */\nasync function asyncLoop(iters, tick, cb) {\n    let ts = Date.now();\n    for (let i = 0; i < iters; i++) {\n        cb(i);\n        // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n        const diff = Date.now() - ts;\n        if (diff >= 0 && diff < tick)\n            continue;\n        await (0, exports.nextTick)();\n        ts += diff;\n    }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nfunction utf8ToBytes(str) {\n    if (typeof str !== 'string')\n        throw new Error('string expected');\n    return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Converts bytes to string using UTF8 encoding.\n * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc'\n */\nfunction bytesToUtf8(bytes) {\n    return new TextDecoder().decode(bytes);\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nfunction toBytes(data) {\n    if (typeof data === 'string')\n        data = utf8ToBytes(data);\n    abytes(data);\n    return data;\n}\n/**\n * Helper for KDFs: consumes uint8array or string.\n * When string is passed, does utf8 decoding, using TextDecoder.\n */\nfunction kdfInputToBytes(data) {\n    if (typeof data === 'string')\n        data = utf8ToBytes(data);\n    abytes(data);\n    return data;\n}\n/** Copies several Uint8Arrays into one. */\nfunction concatBytes(...arrays) {\n    let sum = 0;\n    for (let i = 0; i < arrays.length; i++) {\n        const a = arrays[i];\n        abytes(a);\n        sum += a.length;\n    }\n    const res = new Uint8Array(sum);\n    for (let i = 0, pad = 0; i < arrays.length; i++) {\n        const a = arrays[i];\n        res.set(a, pad);\n        pad += a.length;\n    }\n    return res;\n}\nfunction checkOpts(defaults, opts) {\n    if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n        throw new Error('options should be object or undefined');\n    const merged = Object.assign(defaults, opts);\n    return merged;\n}\n/** For runtime check if class implements interface */\nclass Hash {\n}\nexports.Hash = Hash;\n/** Wraps hash function, creating an interface on top of it */\nfunction createHasher(hashCons) {\n    const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n    const tmp = hashCons();\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = () => hashCons();\n    return hashC;\n}\nfunction createOptHasher(hashCons) {\n    const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n    const tmp = hashCons({});\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = (opts) => hashCons(opts);\n    return hashC;\n}\nfunction createXOFer(hashCons) {\n    const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n    const tmp = hashCons({});\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = (opts) => hashCons(opts);\n    return hashC;\n}\nexports.wrapConstructor = createHasher;\nexports.wrapConstructorWithOpts = createOptHasher;\nexports.wrapXOFConstructorWithOpts = createXOFer;\n/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */\nfunction randomBytes(bytesLength = 32) {\n    if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') {\n        return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));\n    }\n    // Legacy Node.js compatibility\n    if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === 'function') {\n        return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength));\n    }\n    throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */\n/**\n * 4KB JS implementation of secp256k1 signatures & ECDH. Compliant with RFC6979.\n * @module\n */\nconst B256 = 2n ** 256n;\nconst P = B256 - 0x1000003d1n; // curve's field prime\nconst N = B256 - 0x14551231950b75fc4402da1732fc9bebfn; // curve (group) order\nconst Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n; // base point x\nconst Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n; // base point y\n/**\n * secp256k1 curve parameters. Equation is x³ + ax + b.\n * Gx and Gy are generator coordinates. p is field order, n is group order.\n */\nconst CURVE = {\n    p: P, n: N, a: 0n, b: 7n, Gx, Gy\n}; // exported variables incl. a, b\nconst fLen = 32; // field / group byte length\nconst curve = (x) => M(M(x * x) * x + CURVE.b); // x³ + ax + b weierstrass formula; a=0\nconst err = (m = '') => { throw new Error(m); }; // error helper, messes-up stack trace\nconst isB = (n) => typeof n === 'bigint'; // is big integer\nconst isS = (s) => typeof s === 'string'; // is string\nconst fe = (n) => isB(n) && 0n < n && n < P; // is field element (invertible)\nconst ge = (n) => isB(n) && 0n < n && n < N; // is group element\nconst isu8 = (a) => (a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'));\nconst au8 = (a, l) => // assert is Uint8Array (of specific length)\n !isu8(a) || (typeof l === 'number' && l > 0 && a.length !== l) ?\n    err('Uint8Array expected') : a;\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst toU8 = (a, len) => au8(isS(a) ? h2b(a) : u8n(au8(a)), len); // norm(hex/u8a) to u8a\nconst M = (a, b = P) => {\n    const r = a % b;\n    return r >= 0n ? r : b + r;\n};\nconst aPoint = (p) => (p instanceof Point ? p : err('Point expected')); // is 3d point\n/** Point in 3d xyz projective coordinates. 3d takes less inversions than 2d. */\nclass Point {\n    constructor(px, py, pz) {\n        this.px = px;\n        this.py = py;\n        this.pz = pz;\n        Object.freeze(this);\n    }\n    /** Create 3d xyz point from 2d xy. (0, 0) => (0, 1, 0), not (0, 0, 1) */\n    static fromAffine(p) {\n        return ((p.x === 0n) && (p.y === 0n)) ? I : new Point(p.x, p.y, 1n);\n    }\n    /** Convert Uint8Array or hex string to Point. */\n    static fromHex(hex) {\n        hex = toU8(hex); // convert hex string to Uint8Array\n        let p = undefined;\n        const head = hex[0], tail = hex.subarray(1); // first byte is prefix, rest is data\n        const x = slc(tail, 0, fLen), len = hex.length; // next 32 bytes are x coordinate\n        if (len === 33 && [0x02, 0x03].includes(head)) { // compressed points: 33b, start\n            if (!fe(x))\n                err('Point hex invalid: x not FE'); // with byte 0x02 or 0x03. Check if 0<x<P\n            let y = sqrt(curve(x)); // x³ + ax + b is right side of equation\n            const isYOdd = (y & 1n) === 1n; // y² is equivalent left-side. Calculate y²:\n            const headOdd = (head & 1) === 1; // y = √y²; there are two solutions: y, -y\n            if (headOdd !== isYOdd)\n                y = M(-y); // determine proper solution\n            p = new Point(x, y, 1n); // create point\n        } // Uncompressed points: 65b, start with 0x04\n        if (len === 65 && head === 0x04)\n            p = new Point(x, slc(tail, fLen, 2 * fLen), 1n);\n        return p ? p.ok() : err('Point invalid: not on curve'); // Verify the result\n    }\n    /** Create point from a private key. */\n    static fromPrivateKey(k) { return G.mul(toPriv(k)); }\n    get x() { return this.aff().x; } // .x, .y will call expensive toAffine:\n    get y() { return this.aff().y; } // should be used with care.\n    /** Equality check: compare points P&Q. */\n    equals(other) {\n        const { px: X1, py: Y1, pz: Z1 } = this;\n        const { px: X2, py: Y2, pz: Z2 } = aPoint(other); // isPoint() checks class equality\n        const X1Z2 = M(X1 * Z2), X2Z1 = M(X2 * Z1);\n        const Y1Z2 = M(Y1 * Z2), Y2Z1 = M(Y2 * Z1);\n        return X1Z2 === X2Z1 && Y1Z2 === Y2Z1;\n    }\n    /** Flip point over y coordinate. */\n    negate() { return new Point(this.px, M(-this.py), this.pz); }\n    /** Point doubling: P+P, complete formula. */\n    double() { return this.add(this); }\n    /**\n     * Point addition: P+Q, complete, exception-free formula\n     * (Renes-Costello-Batina, algo 1 of [2015/1060](https://eprint.iacr.org/2015/1060)).\n     * Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n     */\n    add(other) {\n        const { px: X1, py: Y1, pz: Z1 } = this;\n        const { px: X2, py: Y2, pz: Z2 } = aPoint(other);\n        const { a, b } = CURVE;\n        let X3 = 0n, Y3 = 0n, Z3 = 0n;\n        const b3 = M(b * 3n);\n        let t0 = M(X1 * X2), t1 = M(Y1 * Y2), t2 = M(Z1 * Z2), t3 = M(X1 + Y1); // step 1\n        let t4 = M(X2 + Y2); // step 5\n        t3 = M(t3 * t4);\n        t4 = M(t0 + t1);\n        t3 = M(t3 - t4);\n        t4 = M(X1 + Z1);\n        let t5 = M(X2 + Z2); // step 10\n        t4 = M(t4 * t5);\n        t5 = M(t0 + t2);\n        t4 = M(t4 - t5);\n        t5 = M(Y1 + Z1);\n        X3 = M(Y2 + Z2); // step 15\n        t5 = M(t5 * X3);\n        X3 = M(t1 + t2);\n        t5 = M(t5 - X3);\n        Z3 = M(a * t4);\n        X3 = M(b3 * t2); // step 20\n        Z3 = M(X3 + Z3);\n        X3 = M(t1 - Z3);\n        Z3 = M(t1 + Z3);\n        Y3 = M(X3 * Z3);\n        t1 = M(t0 + t0); // step 25\n        t1 = M(t1 + t0);\n        t2 = M(a * t2);\n        t4 = M(b3 * t4);\n        t1 = M(t1 + t2);\n        t2 = M(t0 - t2); // step 30\n        t2 = M(a * t2);\n        t4 = M(t4 + t2);\n        t0 = M(t1 * t4);\n        Y3 = M(Y3 + t0);\n        t0 = M(t5 * t4); // step 35\n        X3 = M(t3 * X3);\n        X3 = M(X3 - t0);\n        t0 = M(t3 * t1);\n        Z3 = M(t5 * Z3);\n        Z3 = M(Z3 + t0); // step 40\n        return new Point(X3, Y3, Z3);\n    }\n    mul(n, safe = true) {\n        if (!safe && n === 0n)\n            return I; // in unsafe mode, allow zero\n        if (!ge(n))\n            err('scalar invalid'); // must be 0 < n < CURVE.n\n        if (this.equals(G))\n            return wNAF(n).p; // use precomputes for base point\n        let p = I, f = G; // init result point & fake point\n        for (let d = this; n > 0n; d = d.double(), n >>= 1n) { // double-and-add ladder\n            if (n & 1n)\n                p = p.add(d); // if bit is present, add to point\n            else if (safe)\n                f = f.add(d); // if not, add to fake for timing safety\n        }\n        return p;\n    }\n    mulAddQUns(R, u1, u2) {\n        return this.mul(u1, false).add(R.mul(u2, false)).ok(); // Unsafe: do NOT use for stuff related\n    } // to private keys. Doesn't use Shamir trick\n    /** Convert point to 2d xy affine point. (x, y, z) ∋ (x=x/z, y=y/z) */\n    toAffine() {\n        const { px: x, py: y, pz: z } = this;\n        if (this.equals(I))\n            return { x: 0n, y: 0n }; // fast-path for zero point\n        if (z === 1n)\n            return { x, y }; // if z is 1, pass affine coordinates as-is\n        const iz = inv(z, P); // z^-1: invert z\n        if (M(z * iz) !== 1n)\n            err('inverse invalid'); // (z * z^-1) must be 1, otherwise bad math\n        return { x: M(x * iz), y: M(y * iz) }; // x = x*z^-1; y = y*z^-1\n    }\n    /** Checks if the point is valid and on-curve. */\n    assertValidity() {\n        const { x, y } = this.aff(); // convert to 2d xy affine point.\n        if (!fe(x) || !fe(y))\n            err('Point invalid: x or y'); // x and y must be in range 0 < n < P\n        return M(y * y) === curve(x) ? // y² = x³ + ax + b, must be equal\n            this : err('Point invalid: not on curve');\n    }\n    multiply(n) { return this.mul(n); } // Aliases to compress code\n    aff() { return this.toAffine(); }\n    ok() { return this.assertValidity(); }\n    toHex(isCompressed = true) {\n        const { x, y } = this.aff(); // convert to 2d xy affine point\n        const head = isCompressed ? ((y & 1n) === 0n ? '02' : '03') : '04'; // 0x02, 0x03, 0x04 prefix\n        return head + n2h(x) + (isCompressed ? '' : n2h(y)); // prefix||x and ||y\n    }\n    toRawBytes(isCompressed = true) {\n        return h2b(this.toHex(isCompressed)); // re-use toHex(), convert hex to bytes\n    }\n}\n/** Generator / base point */\nPoint.BASE = new Point(Gx, Gy, 1n);\n/** Identity / zero point */\nPoint.ZERO = new Point(0n, 1n, 0n);\nconst { BASE: G, ZERO: I } = Point; // Generator, identity points\nconst padh = (n, pad) => n.toString(16).padStart(pad, '0');\nconst b2h = (b) => Array.from(au8(b)).map(e => padh(e, 2)).join(''); // bytes to hex\nconst C = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; // ASCII characters\nconst _ch = (ch) => {\n    if (ch >= C._0 && ch <= C._9)\n        return ch - C._0; // '2' => 50-48\n    if (ch >= C.A && ch <= C.F)\n        return ch - (C.A - 10); // 'B' => 66-(65-10)\n    if (ch >= C.a && ch <= C.f)\n        return ch - (C.a - 10); // 'b' => 98-(97-10)\n    return;\n};\nconst h2b = (hex) => {\n    const e = 'hex invalid';\n    if (!isS(hex))\n        return err(e);\n    const hl = hex.length, al = hl / 2;\n    if (hl % 2)\n        return err(e);\n    const array = u8n(al);\n    for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { // treat each char as ASCII\n        const n1 = _ch(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n        const n2 = _ch(hex.charCodeAt(hi + 1)); // parse second char\n        if (n1 === undefined || n2 === undefined)\n            return err(e);\n        array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n    }\n    return array;\n};\nconst b2n = (b) => BigInt('0x' + (b2h(b) || '0')); // bytes to number\nconst slc = (b, from, to) => b2n(b.slice(from, to)); // slice bytes num\nconst n2b = (num) => {\n    return isB(num) && num >= 0n && num < B256 ? h2b(padh(num, 2 * fLen)) : err('bigint expected');\n};\nconst n2h = (num) => b2h(n2b(num)); // number to 32b hex\nconst concatB = (...arrs) => {\n    const r = u8n(arrs.reduce((sum, a) => sum + au8(a).length, 0)); // create u8a of summed length\n    let pad = 0; // walk through each array,\n    arrs.forEach(a => { r.set(a, pad); pad += a.length; }); // ensure they have proper type\n    return r;\n};\nconst inv = (num, md) => {\n    if (num === 0n || md <= 0n)\n        err('no inverse n=' + num + ' mod=' + md); // no neg exponent for now\n    let a = M(num, md), b = md, x = 0n, y = 1n, u = 1n, v = 0n;\n    while (a !== 0n) { // uses euclidean gcd algorithm\n        const q = b / a, r = b % a; // not constant-time\n        const m = x - u * q, n = y - v * q;\n        b = a, a = r, x = u, y = v, u = m, v = n;\n    }\n    return b === 1n ? M(x, md) : err('no inverse'); // b is gcd at this point\n};\nconst sqrt = (n) => {\n    let r = 1n; // So, a special, fast case. Paper: \"Square Roots from 1;24,51,10 to Dan Shanks\".\n    for (let num = n, e = (P + 1n) / 4n; e > 0n; e >>= 1n) { // powMod: modular exponentiation.\n        if (e & 1n)\n            r = (r * num) % P; // Uses exponentiation by squaring.\n        num = (num * num) % P; // Not constant-time.\n    }\n    return M(r * r) === n ? r : err('sqrt invalid'); // check if result is valid\n};\nconst toPriv = (p) => {\n    if (!isB(p))\n        p = b2n(toU8(p, fLen)); // convert to bigint when bytes\n    return ge(p) ? p : err('private key invalid 3'); // check if bigint is in range\n};\nconst high = (n) => n > (N >> 1n); // if a number is bigger than CURVE.n/2\n/** Creates 33/65-byte public key from 32-byte private key. */\nconst getPublicKey = (privKey, isCompressed = true) => {\n    return Point.fromPrivateKey(privKey).toRawBytes(isCompressed);\n};\n/** ECDSA Signature class. Supports only compact 64-byte representation, not DER. */\nclass Signature {\n    constructor(r, s, recovery) {\n        this.r = r;\n        this.s = s;\n        this.recovery = recovery;\n        this.assertValidity(); // recovery bit is optional when\n    } // constructed outside.\n    /** Create signature from 64b compact (r || s) representation. */\n    static fromCompact(hex) {\n        hex = toU8(hex, 64); // compact repr is (32b r)||(32b s)\n        return new Signature(slc(hex, 0, fLen), slc(hex, fLen, 2 * fLen));\n    }\n    assertValidity() { return ge(this.r) && ge(this.s) ? this : err(); } // 0 < r or s < CURVE.n\n    /** Create new signature, with added recovery bit. */\n    addRecoveryBit(rec) {\n        return new Signature(this.r, this.s, rec);\n    }\n    hasHighS() { return high(this.s); }\n    normalizeS() {\n        return high(this.s) ? new Signature(this.r, M(-this.s, N), this.recovery) : this;\n    }\n    /** ECDSA public key recovery. Requires msg hash and recovery id. */\n    recoverPublicKey(msgh) {\n        const { r, s, recovery: rec } = this; // secg.org/sec1-v2.pdf 4.1.6\n        if (![0, 1, 2, 3].includes(rec))\n            err('recovery id invalid'); // check recovery id\n        const h = bits2int_modN(toU8(msgh, fLen)); // Truncate hash\n        const radj = rec === 2 || rec === 3 ? r + N : r; // If rec was 2 or 3, q.x is bigger than n\n        if (radj >= P)\n            err('q.x invalid'); // ensure q.x is still a field element\n        const head = (rec & 1) === 0 ? '02' : '03'; // head is 0x02 or 0x03\n        const R = Point.fromHex(head + n2h(radj)); // concat head + hex repr of r\n        const ir = inv(radj, N); // r^-1\n        const u1 = M(-h * ir, N); // -hr^-1\n        const u2 = M(s * ir, N); // sr^-1\n        return G.mulAddQUns(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n    }\n    /** Uint8Array 64b compact (r || s) representation. */\n    toCompactRawBytes() { return h2b(this.toCompactHex()); }\n    /** Hex string 64b compact (r || s) representation. */\n    toCompactHex() { return n2h(this.r) + n2h(this.s); }\n}\nconst bits2int = (bytes) => {\n    const delta = bytes.length * 8 - 256; // RFC suggests optional truncating via bits2octets\n    if (delta > 1024)\n        err('msg invalid'); // our CUSTOM check, \"just-in-case\"\n    const num = b2n(bytes); // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which\n    return delta > 0 ? num >> BigInt(delta) : num; // matches bits2int. bits2int can produce res>N.\n};\nconst bits2int_modN = (bytes) => {\n    return M(bits2int(bytes), N); // with 0: BAD for trunc as per RFC vectors\n};\nconst i2o = (num) => n2b(num); // int to octets\nconst cr = () => // We support: 1) browsers 2) node.js 19+ 3) deno, other envs with crypto\n typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\nlet _hmacSync; // Can be redefined by use in utils; built-ins don't provide it\nconst optS = { lowS: true }; // opts for sign()\nconst optV = { lowS: true }; // standard opts for verify()\nconst prepSig = (msgh, priv, opts = optS) => {\n    if (['der', 'recovered', 'canonical'].some(k => k in opts))\n        err('option not supported'); // legacy opts\n    let { lowS } = opts; // generates low-s sigs by default\n    if (lowS == null)\n        lowS = true; // RFC6979 3.2: we skip step A\n    const h1i = bits2int_modN(toU8(msgh)); // msg bigint\n    const h1o = i2o(h1i); // msg octets\n    const d = toPriv(priv); // validate private key, convert to bigint\n    const seed = [i2o(d), h1o]; // Step D of RFC6979 3.2\n    let ent = opts.extraEntropy; // RFC6979 3.6: additional k' (optional)\n    if (ent) // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n        seed.push(ent === true ? etc.randomBytes(fLen) : toU8(ent)); // true == fetch from CSPRNG\n    const m = h1i; // convert msg to bigint\n    const k2sig = (kBytes) => {\n        const k = bits2int(kBytes); // RFC6979 method.\n        if (!ge(k))\n            return; // Check 0 < k < CURVE.n\n        const ik = inv(k, N); // k^-1 mod n, NOT mod P\n        const q = G.mul(k).aff(); // q = Gk\n        const r = M(q.x, N); // r = q.x mod n\n        if (r === 0n)\n            return; // r=0 invalid\n        const s = M(ik * M(m + M(d * r, N), N), N); // s = k^-1(m + rd) mod n\n        if (s === 0n)\n            return; // s=0 invalid\n        let normS = s; // normalized S\n        let rec = (q.x === r ? 0 : 2) | Number(q.y & 1n); // recovery bit\n        if (lowS && high(s)) { // if lowS was passed, ensure s is always\n            normS = M(-s, N); // in the bottom half of CURVE.n\n            rec ^= 1;\n        }\n        return new Signature(r, normS, rec); // use normS, not s\n    };\n    return { seed: concatB(...seed), k2sig };\n};\nfunction hmacDrbg(asynchronous) {\n    let v = u8n(fLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n    let k = u8n(fLen); // Steps B, C of RFC6979 3.2: set hashLen, in our case always same\n    let i = 0; // Iterations counter, will throw when over 1000\n    const reset = () => { v.fill(1); k.fill(0); i = 0; };\n    const _e = 'drbg: tried 1000 values';\n    if (asynchronous) { // asynchronous=true\n        const h = (...b) => etc.hmacSha256Async(k, v, ...b); // hmac(k)(v, ...values)\n        const reseed = async (seed = u8n()) => {\n            k = await h(u8n([0x00]), seed); // k = hmac(K || V || 0x00 || seed)\n            v = await h(); // v = hmac(K || V)\n            if (seed.length === 0)\n                return;\n            k = await h(u8n([0x01]), seed); // k = hmac(K || V || 0x01 || seed)\n            v = await h(); // v = hmac(K || V)\n        };\n        const gen = async () => {\n            if (i++ >= 1000)\n                err(_e);\n            v = await h(); // v = hmac(K || V)\n            return v;\n        };\n        return async (seed, pred) => {\n            reset(); // the returned fn, don't, it's: 1. slower (JIT). 2. unsafe (async race conditions)\n            await reseed(seed); // Steps D-G\n            let res = undefined; // Step H: grind until k is in [1..n-1]\n            while (!(res = pred(await gen())))\n                await reseed(); // test predicate until it returns ok\n            reset();\n            return res;\n        };\n    }\n    else {\n        const h = (...b) => {\n            const f = _hmacSync;\n            if (!f)\n                err('etc.hmacSha256Sync not set');\n            return f(k, v, ...b); // hmac(k)(v, ...values)\n        };\n        const reseed = (seed = u8n()) => {\n            k = h(u8n([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n            v = h(); // v = hmac(k || v)\n            if (seed.length === 0)\n                return;\n            k = h(u8n([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n            v = h(); // v = hmac(k || v)\n        };\n        const gen = () => {\n            if (i++ >= 1000)\n                err(_e);\n            v = h(); // v = hmac(k || v)\n            return v;\n        };\n        return (seed, pred) => {\n            reset();\n            reseed(seed); // Steps D-G\n            let res = undefined; // Step H: grind until k is in [1..n-1]\n            while (!(res = pred(gen())))\n                reseed(); // test predicate until it returns ok\n            reset();\n            return res;\n        };\n    }\n}\n;\n/** ECDSA signature generation. via secg.org/sec1-v2.pdf 4.1.2 + RFC6979 deterministic k. */\n/**\n * Sign a msg hash using secp256k1. Async.\n * It is advised to use `extraEntropy: true` (from RFC6979 3.6) to prevent fault attacks.\n * Worst case: if randomness source for extraEntropy is bad, it would be as secure as if\n * the option has not been used.\n * @param msgh - message HASH, not message itself e.g. sha256(message)\n * @param priv - private key\n * @param opts - `lowS: true` to prevent malleability (s >= CURVE.n/2), `extraEntropy: boolean | Hex` to improve sig security.\n */\nconst signAsync = async (msgh, priv, opts = optS) => {\n    const { seed, k2sig } = prepSig(msgh, priv, opts); // Extract arguments for hmac-drbg\n    return hmacDrbg(true)(seed, k2sig); // Re-run drbg until k2sig returns ok\n};\n/**\n * Sign a msg hash using secp256k1.\n * It is advised to use `extraEntropy: true` (from RFC6979 3.6) to prevent fault attacks.\n * Worst case: if randomness source for extraEntropy is bad, it would be as secure as if\n * the option has not been used.\n * @param msgh - message HASH, not message itself e.g. sha256(message)\n * @param priv - private key\n * @param opts - `lowS: true` to prevent malleability (s >= CURVE.n/2), `extraEntropy: boolean | Hex` to improve sig security.\n * @example\n * const sig = sign(sha256('hello'), privKey, { extraEntropy: true }).toCompactRawBytes();\n */\nconst sign = (msgh, priv, opts = optS) => {\n    const { seed, k2sig } = prepSig(msgh, priv, opts); // Extract arguments for hmac-drbg\n    return hmacDrbg(false)(seed, k2sig); // Re-run drbg until k2sig returns ok\n};\n/**\n * Verify a signature using secp256k1.\n * @param sig - signature, 64-byte or Signature instance\n * @param msgh - message HASH, not message itself e.g. sha256(message)\n * @param pub - public key\n * @param opts - { lowS: true } is default, prohibits s >= CURVE.n/2 to prevent malleability\n */\nconst verify = (sig, msgh, pub, opts = optV) => {\n    let { lowS } = opts; // ECDSA signature verification\n    if (lowS == null)\n        lowS = true; // Default lowS=true\n    if ('strict' in opts)\n        err('option not supported'); // legacy param\n    let sig_, h, P; // secg.org/sec1-v2.pdf 4.1.4\n    const rs = sig && typeof sig === 'object' && 'r' in sig; // Previous ver supported DER sigs. We\n    if (!rs && (toU8(sig).length !== 2 * fLen)) // throw error when DER is suspected now.\n        err('signature must be 64 bytes');\n    try {\n        sig_ = rs ? new Signature(sig.r, sig.s).assertValidity() : Signature.fromCompact(sig);\n        h = bits2int_modN(toU8(msgh)); // Truncate hash\n        P = pub instanceof Point ? pub.ok() : Point.fromHex(pub); // Validate public key\n    }\n    catch (e) {\n        return false;\n    } // Check sig for validity in both cases\n    if (!sig_)\n        return false;\n    const { r, s } = sig_;\n    if (lowS && high(s))\n        return false; // lowS bans sig.s >= CURVE.n/2\n    let R;\n    try {\n        const is = inv(s, N); // s^-1\n        const u1 = M(h * is, N); // u1 = hs^-1 mod n\n        const u2 = M(r * is, N); // u2 = rs^-1 mod n\n        R = G.mulAddQUns(P, u1, u2).aff(); // R = u1⋅G + u2⋅P\n    }\n    catch (error) {\n        return false;\n    }\n    if (!R)\n        return false; // stop if R is identity / zero point\n    const v = M(R.x, N); // R.x must be in N's field, not P's\n    return v === r; // mod(R.x, n) == r\n};\n/**\n * Elliptic Curve Diffie-Hellman (ECDH) on secp256k1.\n * Result is **NOT hashed**. Use hash on it if you need.\n * @param privA private key A\n * @param pubB public key B\n * @param isCompressed 33-byte or 65-byte output\n * @returns public key C\n */\nconst getSharedSecret = (privA, pubB, isCompressed = true) => {\n    return Point.fromHex(pubB).mul(toPriv(privA)).toRawBytes(isCompressed); // ECDH\n};\nconst hashToPrivateKey = (hash) => {\n    hash = toU8(hash); // produces private keys with modulo bias\n    if (hash.length < fLen + 8 || hash.length > 1024)\n        err('expected 40-1024b'); // being neglible.\n    const num = M(b2n(hash), N - 1n); // takes n+8 bytes\n    return n2b(num + 1n); // returns (hash mod n-1)+1\n};\n/** Math, hex, byte helpers. Not in `utils` because utils share API with noble-curves. */\nconst etc = {\n    hexToBytes: h2b,\n    bytesToHex: b2h,\n    concatBytes: concatB,\n    bytesToNumberBE: b2n,\n    numberToBytesBE: n2b,\n    mod: M,\n    invert: inv, // math utilities\n    hmacSha256Async: async (key, ...msgs) => {\n        const c = cr(); // async HMAC-SHA256, no sync built-in!\n        const s = c && c.subtle; // For React Native support, see README.\n        if (!s)\n            return err('etc.hmacSha256Async or crypto.subtle must be defined'); // Uses webcrypto built-in cryptography.\n        const k = await s.importKey('raw', key, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign']);\n        return u8n(await s.sign('HMAC', k, concatB(...msgs)));\n    },\n    hmacSha256Sync: _hmacSync, // For TypeScript. Actual logic is below\n    hashToPrivateKey: hashToPrivateKey,\n    randomBytes: (len = 32) => {\n        const crypto = cr(); // Must be shimmed in node.js <= 18 to prevent error. See README.\n        if (!crypto || !crypto.getRandomValues)\n            err('crypto.getRandomValues must be defined');\n        return crypto.getRandomValues(u8n(len));\n    },\n};\n/** Curve-specific utilities for private keys. */\nconst utils = {\n    normPrivateKeyToScalar: toPriv,\n    isValidPrivateKey: (key) => { try {\n        return !!toPriv(key);\n    }\n    catch (e) {\n        return false;\n    } },\n    randomPrivateKey: () => hashToPrivateKey(etc.randomBytes(fLen + 16)), // FIPS 186 B.4.1.\n    precompute: (w = 8, p = G) => { p.multiply(3n); w; return p; }, // no-op\n};\nObject.defineProperties(etc, { hmacSha256Sync: {\n        configurable: false, get() { return _hmacSync; }, set(f) { if (!_hmacSync)\n            _hmacSync = f; },\n    } });\nconst W = 8; // Precomputes-related code. W = window size\nconst precompute = () => {\n    const points = []; // 10x sign(), 2x verify(). To achieve this,\n    const windows = 256 / W + 1; // app needs to spend 40ms+ to calculate\n    let p = G, b = p; // a lot of points related to base point G.\n    for (let w = 0; w < windows; w++) { // Points are stored in array and used\n        b = p; // any time Gx multiplication is done.\n        points.push(b); // They consume 16-32 MiB of RAM.\n        for (let i = 1; i < 2 ** (W - 1); i++) {\n            b = b.add(p);\n            points.push(b);\n        }\n        p = b.double(); // Precomputes don't speed-up getSharedKey,\n    } // which multiplies user point by scalar,\n    return points; // when precomputes are using base point\n};\nlet Gpows = undefined; // precomputes for base point G\nconst wNAF = (n) => {\n    // Compared to other point mult methods,\n    const comp = Gpows || (Gpows = precompute()); // stores 2x less points using subtraction\n    const neg = (cnd, p) => { let n = p.negate(); return cnd ? n : p; }; // negate\n    let p = I, f = G; // f must be G, or could become I in the end\n    const windows = 1 + 256 / W; // W=8 17 windows\n    const wsize = 2 ** (W - 1); // W=8 128 window size\n    const mask = BigInt(2 ** W - 1); // W=8 will create mask 0b11111111\n    const maxNum = 2 ** W; // W=8 256\n    const shiftBy = BigInt(W); // W=8 8\n    for (let w = 0; w < windows; w++) {\n        const off = w * wsize;\n        let wbits = Number(n & mask); // extract W bits.\n        n >>= shiftBy; // shift number by W bits.\n        if (wbits > wsize) {\n            wbits -= maxNum;\n            n += 1n;\n        } // split if bits > max: +224 => 256-32\n        const off1 = off, off2 = off + Math.abs(wbits) - 1; // offsets, evaluate both\n        const cnd1 = w % 2 !== 0, cnd2 = wbits < 0; // conditions, evaluate both\n        if (wbits === 0) {\n            f = f.add(neg(cnd1, comp[off1])); // bits are 0: add garbage to fake point\n        }\n        else { //          ^ can't add off2, off2 = I\n            p = p.add(neg(cnd2, comp[off2])); // bits are 1: add to result point\n        }\n    }\n    return { p, f }; // return both real and fake points for JIT\n}; // !! you can disable precomputes by commenting-out call of the wNAF() inside Point#mul()\nexport { getPublicKey, sign, signAsync, verify, CURVE, // Remove the export to easily use in REPL\ngetSharedSecret, etc, utils, Point as ProjectivePoint, Signature }; // envs like browser console\n{\n  \"name\": \"@noble/secp256k1\",\n  \"version\": \"2.2.3\",\n  \"description\": \"Fastest 4KB JS implementation of secp256k1 ECDH & ECDSA signatures compliant with RFC6979\",\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"index.ts\"\n  ],\n  \"type\": \"module\",\n  \"main\": \"index.js\",\n  \"module\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"sideEffects\": false,\n  \"scripts\": {\n    \"build\": \"tsc\",\n    \"build:min\": \"cd test/build; npm install; npm run terser\",\n    \"build:mingz\": \"npm run --silent build:min | gzip -c8\",\n    \"build:release\": \"npm run --silent build:min > test/build/noble-secp256k1.min.js; npm run --silent build:mingz > test/build/noble-secp256k1.min.js.gz\",\n    \"test\": \"node test/index.js\",\n    \"test:webcrypto\": \"node test/index.webcrypto.js\",\n    \"bench\": \"node test/benchmark.js\",\n    \"loc\": \"echo \\\"`npm run --silent build:min | wc -c` symbols `wc -l < index.ts` LOC, `npm run --silent build:mingz | wc -c`B gzipped\\\"\"\n  },\n  \"author\": \"Paul Miller (https://paulmillr.com)\",\n  \"homepage\": \"https://paulmillr.com/noble/\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/paulmillr/noble-secp256k1.git\"\n  },\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"@noble/hashes\": \"1.7.0\",\n    \"@paulmillr/jsbt\": \"0.2.1\",\n    \"fast-check\": \"3.0.0\",\n    \"micro-bmark\": \"0.3.1\",\n    \"micro-should\": \"0.4.0\",\n    \"typescript\": \"5.5.2\"\n  },\n  \"keywords\": [\n    \"secp256k1\",\n    \"rfc6979\",\n    \"signature\",\n    \"ecdsa\",\n    \"noble\",\n    \"cryptography\",\n    \"elliptic curve\",\n    \"ecc\",\n    \"curve\",\n    \"schnorr\",\n    \"bitcoin\",\n    \"ethereum\"\n  ],\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    }\n  },\n  \"funding\": \"https://paulmillr.com/funding/\"\n}\n\"use strict\";\n/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.bytes = exports.stringToBytes = exports.str = exports.bytesToString = exports.hex = exports.utf8 = exports.bech32m = exports.bech32 = exports.base58check = exports.createBase58check = exports.base58xmr = exports.base58xrp = exports.base58flickr = exports.base58 = exports.base64urlnopad = exports.base64url = exports.base64nopad = exports.base64 = exports.base32crockford = exports.base32hexnopad = exports.base32hex = exports.base32nopad = exports.base32 = exports.base16 = exports.utils = void 0;\nfunction isBytes(a) {\n    return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is Uint8Array. */\nfunction abytes(b, ...lengths) {\n    if (!isBytes(b))\n        throw new Error('Uint8Array expected');\n    if (lengths.length > 0 && !lengths.includes(b.length))\n        throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\nfunction isArrayOf(isString, arr) {\n    if (!Array.isArray(arr))\n        return false;\n    if (arr.length === 0)\n        return true;\n    if (isString) {\n        return arr.every((item) => typeof item === 'string');\n    }\n    else {\n        return arr.every((item) => Number.isSafeInteger(item));\n    }\n}\n// no abytes: seems to have 10% slowdown. Why?!\nfunction afn(input) {\n    if (typeof input !== 'function')\n        throw new Error('function expected');\n    return true;\n}\nfunction astr(label, input) {\n    if (typeof input !== 'string')\n        throw new Error(`${label}: string expected`);\n    return true;\n}\nfunction anumber(n) {\n    if (!Number.isSafeInteger(n))\n        throw new Error(`invalid integer: ${n}`);\n}\nfunction aArr(input) {\n    if (!Array.isArray(input))\n        throw new Error('array expected');\n}\nfunction astrArr(label, input) {\n    if (!isArrayOf(true, input))\n        throw new Error(`${label}: array of strings expected`);\n}\nfunction anumArr(label, input) {\n    if (!isArrayOf(false, input))\n        throw new Error(`${label}: array of numbers expected`);\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction chain(...args) {\n    const id = (a) => a;\n    // Wrap call in closure so JIT can inline calls\n    const wrap = (a, b) => (c) => a(b(c));\n    // Construct chain of args[-1].encode(args[-2].encode([...]))\n    const encode = args.map((x) => x.encode).reduceRight(wrap, id);\n    // Construct chain of args[0].decode(args[1].decode(...))\n    const decode = args.map((x) => x.decode).reduce(wrap, id);\n    return { encode, decode };\n}\n/**\n * Encodes integer radix representation to array of strings using alphabet and back.\n * Could also be array of strings.\n * @__NO_SIDE_EFFECTS__\n */\nfunction alphabet(letters) {\n    // mapping 1 to \"b\"\n    const lettersA = typeof letters === 'string' ? letters.split('') : letters;\n    const len = lettersA.length;\n    astrArr('alphabet', lettersA);\n    // mapping \"b\" to 1\n    const indexes = new Map(lettersA.map((l, i) => [l, i]));\n    return {\n        encode: (digits) => {\n            aArr(digits);\n            return digits.map((i) => {\n                if (!Number.isSafeInteger(i) || i < 0 || i >= len)\n                    throw new Error(`alphabet.encode: digit index outside alphabet \"${i}\". Allowed: ${letters}`);\n                return lettersA[i];\n            });\n        },\n        decode: (input) => {\n            aArr(input);\n            return input.map((letter) => {\n                astr('alphabet.decode', letter);\n                const i = indexes.get(letter);\n                if (i === undefined)\n                    throw new Error(`Unknown letter: \"${letter}\". Allowed: ${letters}`);\n                return i;\n            });\n        },\n    };\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction join(separator = '') {\n    astr('join', separator);\n    return {\n        encode: (from) => {\n            astrArr('join.decode', from);\n            return from.join(separator);\n        },\n        decode: (to) => {\n            astr('join.decode', to);\n            return to.split(separator);\n        },\n    };\n}\n/**\n * Pad strings array so it has integer number of bits\n * @__NO_SIDE_EFFECTS__\n */\nfunction padding(bits, chr = '=') {\n    anumber(bits);\n    astr('padding', chr);\n    return {\n        encode(data) {\n            astrArr('padding.encode', data);\n            while ((data.length * bits) % 8)\n                data.push(chr);\n            return data;\n        },\n        decode(input) {\n            astrArr('padding.decode', input);\n            let end = input.length;\n            if ((end * bits) % 8)\n                throw new Error('padding: invalid, string should have whole number of bytes');\n            for (; end > 0 && input[end - 1] === chr; end--) {\n                const last = end - 1;\n                const byte = last * bits;\n                if (byte % 8 === 0)\n                    throw new Error('padding: invalid, string has too much padding');\n            }\n            return input.slice(0, end);\n        },\n    };\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction normalize(fn) {\n    afn(fn);\n    return { encode: (from) => from, decode: (to) => fn(to) };\n}\n/**\n * Slow: O(n^2) time complexity\n */\nfunction convertRadix(data, from, to) {\n    // base 1 is impossible\n    if (from < 2)\n        throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`);\n    if (to < 2)\n        throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`);\n    aArr(data);\n    if (!data.length)\n        return [];\n    let pos = 0;\n    const res = [];\n    const digits = Array.from(data, (d) => {\n        anumber(d);\n        if (d < 0 || d >= from)\n            throw new Error(`invalid integer: ${d}`);\n        return d;\n    });\n    const dlen = digits.length;\n    while (true) {\n        let carry = 0;\n        let done = true;\n        for (let i = pos; i < dlen; i++) {\n            const digit = digits[i];\n            const fromCarry = from * carry;\n            const digitBase = fromCarry + digit;\n            if (!Number.isSafeInteger(digitBase) ||\n                fromCarry / from !== carry ||\n                digitBase - digit !== fromCarry) {\n                throw new Error('convertRadix: carry overflow');\n            }\n            const div = digitBase / to;\n            carry = digitBase % to;\n            const rounded = Math.floor(div);\n            digits[i] = rounded;\n            if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase)\n                throw new Error('convertRadix: carry overflow');\n            if (!done)\n                continue;\n            else if (!rounded)\n                pos = i;\n            else\n                done = false;\n        }\n        res.push(carry);\n        if (done)\n            break;\n    }\n    for (let i = 0; i < data.length - 1 && data[i] === 0; i++)\n        res.push(0);\n    return res.reverse();\n}\nconst gcd = (a, b) => (b === 0 ? a : gcd(b, a % b));\nconst radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - gcd(from, to));\nconst powers = /* @__PURE__ */ (() => {\n    let res = [];\n    for (let i = 0; i < 40; i++)\n        res.push(2 ** i);\n    return res;\n})();\n/**\n * Implemented with numbers, because BigInt is 5x slower\n */\nfunction convertRadix2(data, from, to, padding) {\n    aArr(data);\n    if (from <= 0 || from > 32)\n        throw new Error(`convertRadix2: wrong from=${from}`);\n    if (to <= 0 || to > 32)\n        throw new Error(`convertRadix2: wrong to=${to}`);\n    if (radix2carry(from, to) > 32) {\n        throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`);\n    }\n    let carry = 0;\n    let pos = 0; // bitwise position in current element\n    const max = powers[from];\n    const mask = powers[to] - 1;\n    const res = [];\n    for (const n of data) {\n        anumber(n);\n        if (n >= max)\n            throw new Error(`convertRadix2: invalid data word=${n} from=${from}`);\n        carry = (carry << from) | n;\n        if (pos + from > 32)\n            throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`);\n        pos += from;\n        for (; pos >= to; pos -= to)\n            res.push(((carry >> (pos - to)) & mask) >>> 0);\n        const pow = powers[pos];\n        if (pow === undefined)\n            throw new Error('invalid carry');\n        carry &= pow - 1; // clean carry, otherwise it will cause overflow\n    }\n    carry = (carry << (to - pos)) & mask;\n    if (!padding && pos >= from)\n        throw new Error('Excess padding');\n    if (!padding && carry > 0)\n        throw new Error(`Non-zero padding: ${carry}`);\n    if (padding && pos > 0)\n        res.push(carry >>> 0);\n    return res;\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction radix(num) {\n    anumber(num);\n    const _256 = 2 ** 8;\n    return {\n        encode: (bytes) => {\n            if (!isBytes(bytes))\n                throw new Error('radix.encode input should be Uint8Array');\n            return convertRadix(Array.from(bytes), _256, num);\n        },\n        decode: (digits) => {\n            anumArr('radix.decode', digits);\n            return Uint8Array.from(convertRadix(digits, num, _256));\n        },\n    };\n}\n/**\n * If both bases are power of same number (like `2**8 <-> 2**64`),\n * there is a linear algorithm. For now we have implementation for power-of-two bases only.\n * @__NO_SIDE_EFFECTS__\n */\nfunction radix2(bits, revPadding = false) {\n    anumber(bits);\n    if (bits <= 0 || bits > 32)\n        throw new Error('radix2: bits should be in (0..32]');\n    if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32)\n        throw new Error('radix2: carry overflow');\n    return {\n        encode: (bytes) => {\n            if (!isBytes(bytes))\n                throw new Error('radix2.encode input should be Uint8Array');\n            return convertRadix2(Array.from(bytes), 8, bits, !revPadding);\n        },\n        decode: (digits) => {\n            anumArr('radix2.decode', digits);\n            return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding));\n        },\n    };\n}\nfunction unsafeWrapper(fn) {\n    afn(fn);\n    return function (...args) {\n        try {\n            return fn.apply(null, args);\n        }\n        catch (e) { }\n    };\n}\nfunction checksum(len, fn) {\n    anumber(len);\n    afn(fn);\n    return {\n        encode(data) {\n            if (!isBytes(data))\n                throw new Error('checksum.encode: input should be Uint8Array');\n            const sum = fn(data).slice(0, len);\n            const res = new Uint8Array(data.length + len);\n            res.set(data);\n            res.set(sum, data.length);\n            return res;\n        },\n        decode(data) {\n            if (!isBytes(data))\n                throw new Error('checksum.decode: input should be Uint8Array');\n            const payload = data.slice(0, -len);\n            const oldChecksum = data.slice(-len);\n            const newChecksum = fn(payload).slice(0, len);\n            for (let i = 0; i < len; i++)\n                if (newChecksum[i] !== oldChecksum[i])\n                    throw new Error('Invalid checksum');\n            return payload;\n        },\n    };\n}\n// prettier-ignore\nexports.utils = {\n    alphabet, chain, checksum, convertRadix, convertRadix2, radix, radix2, join, padding,\n};\n// RFC 4648 aka RFC 3548\n// ---------------------\n/**\n * base16 encoding from RFC 4648.\n * @example\n * ```js\n * base16.encode(Uint8Array.from([0x12, 0xab]));\n * // => '12AB'\n * ```\n */\nexports.base16 = chain(radix2(4), alphabet('0123456789ABCDEF'), join(''));\n/**\n * base32 encoding from RFC 4648. Has padding.\n * Use `base32nopad` for unpadded version.\n * Also check out `base32hex`, `base32hexnopad`, `base32crockford`.\n * @example\n * ```js\n * base32.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'CKVQ===='\n * base32.decode('CKVQ====');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexports.base32 = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join(''));\n/**\n * base32 encoding from RFC 4648. No padding.\n * Use `base32` for padded version.\n * Also check out `base32hex`, `base32hexnopad`, `base32crockford`.\n * @example\n * ```js\n * base32nopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'CKVQ'\n * base32nopad.decode('CKVQ');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexports.base32nopad = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join(''));\n/**\n * base32 encoding from RFC 4648. Padded. Compared to ordinary `base32`, slightly different alphabet.\n * Use `base32hexnopad` for unpadded version.\n * @example\n * ```js\n * base32hex.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ALG===='\n * base32hex.decode('2ALG====');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexports.base32hex = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join(''));\n/**\n * base32 encoding from RFC 4648. No padding. Compared to ordinary `base32`, slightly different alphabet.\n * Use `base32hex` for padded version.\n * @example\n * ```js\n * base32hexnopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ALG'\n * base32hexnopad.decode('2ALG');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexports.base32hexnopad = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join(''));\n/**\n * base32 encoding from RFC 4648. Doug Crockford's version.\n * https://www.crockford.com/base32.html\n * @example\n * ```js\n * base32crockford.encode(Uint8Array.from([0x12, 0xab]));\n * // => '2ANG'\n * base32crockford.decode('2ANG');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexports.base32crockford = chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1')));\n// Built-in base64 conversion https://caniuse.com/mdn-javascript_builtins_uint8array_frombase64\n// prettier-ignore\nconst hasBase64Builtin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toBase64 === 'function' &&\n    typeof Uint8Array.fromBase64 === 'function')();\nconst decodeBase64Builtin = (s, isUrl) => {\n    astr('base64', s);\n    const re = isUrl ? /^[A-Za-z0-9=_-]+$/ : /^[A-Za-z0-9=+/]+$/;\n    const alphabet = isUrl ? 'base64url' : 'base64';\n    if (s.length > 0 && !re.test(s))\n        throw new Error('invalid base64');\n    return Uint8Array.fromBase64(s, { alphabet, lastChunkHandling: 'strict' });\n};\n/**\n * base64 from RFC 4648. Padded.\n * Use `base64nopad` for unpadded version.\n * Also check out `base64url`, `base64urlnopad`.\n * Falls back to built-in function, when available.\n * @example\n * ```js\n * base64.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs='\n * base64.decode('Eqs=');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\n// prettier-ignore\nexports.base64 = hasBase64Builtin ? {\n    encode(b) { abytes(b); return b.toBase64(); },\n    decode(s) { return decodeBase64Builtin(s, false); },\n} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join(''));\n/**\n * base64 from RFC 4648. No padding.\n * Use `base64` for padded version.\n * @example\n * ```js\n * base64nopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs'\n * base64nopad.decode('Eqs');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexports.base64nopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), join(''));\n/**\n * base64 from RFC 4648, using URL-safe alphabet. Padded.\n * Use `base64urlnopad` for unpadded version.\n * Falls back to built-in function, when available.\n * @example\n * ```js\n * base64url.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs='\n * base64url.decode('Eqs=');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\n// prettier-ignore\nexports.base64url = hasBase64Builtin ? {\n    encode(b) { abytes(b); return b.toBase64({ alphabet: 'base64url' }); },\n    decode(s) { return decodeBase64Builtin(s, true); },\n} : chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), padding(6), join(''));\n/**\n * base64 from RFC 4648, using URL-safe alphabet. No padding.\n * Use `base64url` for padded version.\n * @example\n * ```js\n * base64urlnopad.encode(Uint8Array.from([0x12, 0xab]));\n * // => 'Eqs'\n * base64urlnopad.decode('Eqs');\n * // => Uint8Array.from([0x12, 0xab])\n * ```\n */\nexports.base64urlnopad = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'), join(''));\n// base58 code\n// -----------\nconst genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => chain(radix(58), alphabet(abc), join(''));\n/**\n * base58: base64 without ambigous characters +, /, 0, O, I, l.\n * Quadratic (O(n^2)) - so, can't be used on large inputs.\n * @example\n * ```js\n * base58.decode('01abcdef');\n * // => '3UhJW'\n * ```\n */\nexports.base58 = genBase58('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz');\n/**\n * base58: flickr version. Check out `base58`.\n */\nexports.base58flickr = genBase58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ');\n/**\n * base58: XRP version. Check out `base58`.\n */\nexports.base58xrp = genBase58('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz');\n// Data len (index) -> encoded block len\nconst XMR_BLOCK_LEN = [0, 2, 3, 5, 6, 7, 9, 10, 11];\n/**\n * base58: XMR version. Check out `base58`.\n * Done in 8-byte blocks (which equals 11 chars in decoding). Last (non-full) block padded with '1' to size in XMR_BLOCK_LEN.\n * Block encoding significantly reduces quadratic complexity of base58.\n */\nexports.base58xmr = {\n    encode(data) {\n        let res = '';\n        for (let i = 0; i < data.length; i += 8) {\n            const block = data.subarray(i, i + 8);\n            res += exports.base58.encode(block).padStart(XMR_BLOCK_LEN[block.length], '1');\n        }\n        return res;\n    },\n    decode(str) {\n        let res = [];\n        for (let i = 0; i < str.length; i += 11) {\n            const slice = str.slice(i, i + 11);\n            const blockLen = XMR_BLOCK_LEN.indexOf(slice.length);\n            const block = exports.base58.decode(slice);\n            for (let j = 0; j < block.length - blockLen; j++) {\n                if (block[j] !== 0)\n                    throw new Error('base58xmr: wrong padding');\n            }\n            res = res.concat(Array.from(block.slice(block.length - blockLen)));\n        }\n        return Uint8Array.from(res);\n    },\n};\n/**\n * Method, which creates base58check encoder.\n * Requires function, calculating sha256.\n */\nconst createBase58check = (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), exports.base58);\nexports.createBase58check = createBase58check;\n/**\n * Use `createBase58check` instead.\n * @deprecated\n */\nexports.base58check = exports.createBase58check;\nconst BECH_ALPHABET = chain(alphabet('qpzry9x8gf2tvdw0s3jn54khce6mua7l'), join(''));\nconst POLYMOD_GENERATORS = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3];\nfunction bech32Polymod(pre) {\n    const b = pre >> 25;\n    let chk = (pre & 0x1ffffff) << 5;\n    for (let i = 0; i < POLYMOD_GENERATORS.length; i++) {\n        if (((b >> i) & 1) === 1)\n            chk ^= POLYMOD_GENERATORS[i];\n    }\n    return chk;\n}\nfunction bechChecksum(prefix, words, encodingConst = 1) {\n    const len = prefix.length;\n    let chk = 1;\n    for (let i = 0; i < len; i++) {\n        const c = prefix.charCodeAt(i);\n        if (c < 33 || c > 126)\n            throw new Error(`Invalid prefix (${prefix})`);\n        chk = bech32Polymod(chk) ^ (c >> 5);\n    }\n    chk = bech32Polymod(chk);\n    for (let i = 0; i < len; i++)\n        chk = bech32Polymod(chk) ^ (prefix.charCodeAt(i) & 0x1f);\n    for (let v of words)\n        chk = bech32Polymod(chk) ^ v;\n    for (let i = 0; i < 6; i++)\n        chk = bech32Polymod(chk);\n    chk ^= encodingConst;\n    return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]], 30, 5, false));\n}\n/**\n * @__NO_SIDE_EFFECTS__\n */\nfunction genBech32(encoding) {\n    const ENCODING_CONST = encoding === 'bech32' ? 1 : 0x2bc830a3;\n    const _words = radix2(5);\n    const fromWords = _words.decode;\n    const toWords = _words.encode;\n    const fromWordsUnsafe = unsafeWrapper(fromWords);\n    function encode(prefix, words, limit = 90) {\n        astr('bech32.encode prefix', prefix);\n        if (isBytes(words))\n            words = Array.from(words);\n        anumArr('bech32.encode', words);\n        const plen = prefix.length;\n        if (plen === 0)\n            throw new TypeError(`Invalid prefix length ${plen}`);\n        const actualLength = plen + 7 + words.length;\n        if (limit !== false && actualLength > limit)\n            throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`);\n        const lowered = prefix.toLowerCase();\n        const sum = bechChecksum(lowered, words, ENCODING_CONST);\n        return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}`;\n    }\n    function decode(str, limit = 90) {\n        astr('bech32.decode input', str);\n        const slen = str.length;\n        if (slen < 8 || (limit !== false && slen > limit))\n            throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`);\n        // don't allow mixed case\n        const lowered = str.toLowerCase();\n        if (str !== lowered && str !== str.toUpperCase())\n            throw new Error(`String must be lowercase or uppercase`);\n        const sepIndex = lowered.lastIndexOf('1');\n        if (sepIndex === 0 || sepIndex === -1)\n            throw new Error(`Letter \"1\" must be present between prefix and data only`);\n        const prefix = lowered.slice(0, sepIndex);\n        const data = lowered.slice(sepIndex + 1);\n        if (data.length < 6)\n            throw new Error('Data must be at least 6 characters long');\n        const words = BECH_ALPHABET.decode(data).slice(0, -6);\n        const sum = bechChecksum(prefix, words, ENCODING_CONST);\n        if (!data.endsWith(sum))\n            throw new Error(`Invalid checksum in ${str}: expected \"${sum}\"`);\n        return { prefix, words };\n    }\n    const decodeUnsafe = unsafeWrapper(decode);\n    function decodeToBytes(str) {\n        const { prefix, words } = decode(str, false);\n        return { prefix, words, bytes: fromWords(words) };\n    }\n    function encodeFromBytes(prefix, bytes) {\n        return encode(prefix, toWords(bytes));\n    }\n    return {\n        encode,\n        decode,\n        encodeFromBytes,\n        decodeToBytes,\n        decodeUnsafe,\n        fromWords,\n        fromWordsUnsafe,\n        toWords,\n    };\n}\n/**\n * bech32 from BIP 173. Operates on words.\n * For high-level, check out scure-btc-signer:\n * https://github.com/paulmillr/scure-btc-signer.\n */\nexports.bech32 = genBech32('bech32');\n/**\n * bech32m from BIP 350. Operates on words.\n * It was to mitigate `bech32` weaknesses.\n * For high-level, check out scure-btc-signer:\n * https://github.com/paulmillr/scure-btc-signer.\n */\nexports.bech32m = genBech32('bech32m');\n/**\n * UTF-8-to-byte decoder. Uses built-in TextDecoder / TextEncoder.\n * @example\n * ```js\n * const b = utf8.decode(\"hey\"); // => new Uint8Array([ 104, 101, 121 ])\n * const str = utf8.encode(b); // \"hey\"\n * ```\n */\nexports.utf8 = {\n    encode: (data) => new TextDecoder().decode(data),\n    decode: (str) => new TextEncoder().encode(str),\n};\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\n// prettier-ignore\nconst hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === 'function' &&\n    typeof Uint8Array.fromHex === 'function')();\n// prettier-ignore\nconst hexBuiltin = {\n    encode(data) { abytes(data); return data.toHex(); },\n    decode(s) { astr('hex', s); return Uint8Array.fromHex(s); },\n};\n/**\n * hex string decoder. Uses built-in function, when available.\n * @example\n * ```js\n * const b = hex.decode(\"0102ff\"); // => new Uint8Array([ 1, 2, 255 ])\n * const str = hex.encode(b); // \"0102ff\"\n * ```\n */\nexports.hex = hasHexBuiltin\n    ? hexBuiltin\n    : chain(radix2(4), alphabet('0123456789abcdef'), join(''), normalize((s) => {\n        if (typeof s !== 'string' || s.length % 2 !== 0)\n            throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);\n        return s.toLowerCase();\n    }));\n// prettier-ignore\nconst CODERS = {\n    utf8: exports.utf8, hex: exports.hex, base16: exports.base16, base32: exports.base32, base64: exports.base64, base64url: exports.base64url, base58: exports.base58, base58xmr: exports.base58xmr\n};\nconst coderTypeError = 'Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr';\n/** @deprecated */\nconst bytesToString = (type, bytes) => {\n    if (typeof type !== 'string' || !CODERS.hasOwnProperty(type))\n        throw new TypeError(coderTypeError);\n    if (!isBytes(bytes))\n        throw new TypeError('bytesToString() expects Uint8Array');\n    return CODERS[type].encode(bytes);\n};\nexports.bytesToString = bytesToString;\n/** @deprecated */\nexports.str = exports.bytesToString; // as in python, but for bytes only\n/** @deprecated */\nconst stringToBytes = (type, str) => {\n    if (!CODERS.hasOwnProperty(type))\n        throw new TypeError(coderTypeError);\n    if (typeof str !== 'string')\n        throw new TypeError('stringToBytes() expects string');\n    return CODERS[type].decode(str);\n};\nexports.stringToBytes = stringToBytes;\n/** @deprecated */\nexports.bytes = exports.stringToBytes;\n//# sourceMappingURL=index.js.map{\n  \"name\": \"@scure/base\",\n  \"version\": \"1.2.6\",\n  \"description\": \"Secure, audited & 0-dep implementation of base64, bech32, base58, base32 & base16\",\n  \"files\": [\n    \"lib/index.js\",\n    \"lib/index.js.map\",\n    \"lib/index.d.ts\",\n    \"lib/index.d.ts.map\",\n    \"lib/esm/index.js\",\n    \"lib/esm/index.js.map\",\n    \"lib/esm/index.d.ts\",\n    \"lib/esm/index.d.ts.map\",\n    \"lib/esm/package.json\",\n    \"index.ts\"\n  ],\n  \"main\": \"./lib/index.js\",\n  \"module\": \"./lib/esm/index.js\",\n  \"types\": \"./lib/index.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./lib/esm/index.js\",\n      \"require\": \"./lib/index.js\"\n    }\n  },\n  \"scripts\": {\n    \"bench\": \"node test/benchmark/index.js\",\n    \"build\": \"tsc && tsc -p tsconfig.cjs.json\",\n    \"build:release\": \"npx jsbt esbuild test/build\",\n    \"lint\": \"prettier --check index.ts\",\n    \"format\": \"prettier --write index.ts\",\n    \"test\": \"node test/index.js\",\n    \"test:bun\": \"bun test/index.js\",\n    \"test:deno\": \"deno --allow-env --allow-read test/index.js && deno test/deno.ts\"\n  },\n  \"sideEffects\": false,\n  \"author\": \"Paul Miller (https://paulmillr.com)\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://paulmillr.com/noble/#scure\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/paulmillr/scure-base.git\"\n  },\n  \"devDependencies\": {\n    \"@noble/hashes\": \"1.8.0\",\n    \"@paulmillr/jsbt\": \"0.3.3\",\n    \"@types/node\": \"22.15.23\",\n    \"fast-check\": \"4.1.1\",\n    \"micro-bmark\": \"0.4.2\",\n    \"micro-should\": \"0.5.3\",\n    \"prettier\": \"3.5.3\",\n    \"typescript\": \"5.8.3\"\n  },\n  \"keywords\": [\n    \"bech32\",\n    \"bech32m\",\n    \"base64\",\n    \"base58\",\n    \"base32\",\n    \"base16\",\n    \"rfc4648\",\n    \"rfc3548\",\n    \"crockford\",\n    \"encode\",\n    \"encoder\",\n    \"base-x\",\n    \"base\"\n  ],\n  \"funding\": \"https://paulmillr.com/funding/\"\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\n/** @typedef {import('bitcoinjs-lib').Transaction} BtcTransactionReceipt */\n\n/** @typedef {import('@tetherto/wdk-wallet').FeeRates} FeeRates */\n/** @typedef {import('@tetherto/wdk-wallet').KeyPair} KeyPair */\n/** @typedef {import('@tetherto/wdk-wallet').TransactionResult} TransactionResult */\n/** @typedef {import('@tetherto/wdk-wallet').TransferOptions} TransferOptions */\n/** @typedef {import('@tetherto/wdk-wallet').TransferResult} TransferResult */\n\n/** @typedef {import('./src/wallet-account-read-only-btc.js').BtcTransaction} BtcTransaction */\n/** @typedef {import('./src/wallet-account-read-only-btc.js').BtcWalletConfig} BtcWalletConfig */\n\nexport { default } from './src/wallet-manager-btc.js'\n\nexport { default as WalletAccountReadOnlyBtc } from './src/wallet-account-read-only-btc.js'\n\nexport { default as WalletAccountBtc } from './src/wallet-account-btc.js'\n{\n  \"name\": \"@tetherto/wdk-wallet-btc\",\n  \"version\": \"1.0.0-beta.4\",\n  \"description\": \"A simple package to manage BIP-32 wallets for the bitcoin blockchain.\",\n  \"keywords\": [\n    \"wdk\",\n    \"wallet\",\n    \"bip-32\",\n    \"bitcoin\"\n  ],\n  \"author\": \"Tether\",\n  \"license\": \"Apache-2.0\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/tetherto/wdk-wallet-btc.git\"\n  },\n  \"main\": \"index.js\",\n  \"type\": \"module\",\n  \"types\": \"./types\",\n  \"scripts\": {\n    \"build:types\": \"tsc\",\n    \"lint\": \"standard\",\n    \"lint:fix\": \"standard --fix\",\n    \"test\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest\",\n    \"test:coverage\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage\"\n  },\n  \"dependencies\": {\n    \"@bitcoinerlab/coinselect\": \"1.3.1\",\n    \"@bitcoinerlab/descriptors\": \"2.3.1\",\n    \"@bitcoinerlab/secp256k1\": \"1.2.0\",\n    \"@mempool/electrum-client\": \"1.1.9\",\n    \"@tetherto/wdk-wallet\": \"^1.0.0-beta.1\",\n    \"bare-node-runtime\": \"^1.1.4\",\n    \"bip32\": \"4.0.0\",\n    \"bip39\": \"3.1.0\",\n    \"bitcoinjs-lib\": \"6.1.7\",\n    \"bitcoinjs-message\": \"2.2.0\",\n    \"lru-cache\": \"11.2.2\",\n    \"p-limit\": \"7.1.1\",\n    \"sodium-universal\": \"5.0.1\"\n  },\n  \"devDependencies\": {\n    \"cross-env\": \"7.0.3\",\n    \"jest\": \"29.7.0\",\n    \"standard\": \"17.1.2\",\n    \"typescript\": \"5.8.3\",\n    \"zeromq\": \"6.4.2\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./types/index.d.ts\",\n      \"bare\": \"./bare.js\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": {\n      \"default\": \"./package.json\"\n    }\n  },\n  \"publishConfig\": {\n    \"access\": \"public\",\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"standard\": {\n    \"ignore\": [\n      \"bare.js\",\n      \"tests/**/*.js\"\n    ]\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport MempoolElectrumClient from '@mempool/electrum-client'\n\n/**\n * @typedef {Object} ElectrumConfig\n * @property {string} [client] - The name of the client reported to the server (default: 'wdk-wallet').\n * @property {string} [version] - The electrum protocol version (default: '1.4').\n */\n\n/**\n * @typedef {Object} PersistencePolicy\n * @property {number} [maxRetry] - The maximum reconnection attempts before failing (default: 2).\n * @property {number} [retryPeriod] - The delay between reconnect attempts, in ms (default: 1_000).\n * @property {number} [pingPeriod] - The delay between keep-alive pings, in ms (default: 120_000).\n * @property {(err: Error | null) => void} [callback] - An optional status callback.\n */\n\n/**\n * A thin wrapper around {@link @mempool/electrum-client} that lazily initializes the underlying\n * electrum connection on first rpc call.\n *\n * The instance returned from the constructor is a proxy that intercepts all method calls\n * except `close`, `initElectrum`, and `reconnect` and ensures the client is initialized.\n */\nexport default class ElectrumClient extends MempoolElectrumClient {\n  /**\n   * Create a new electrum client wrapper.\n   *\n   * @param {number} port - The electrum server's port.\n   * @param {string} host - The electrum server's hostname.\n   * @param {'tcp' | 'tls' | 'ssl'} protocol - The transport protocol to use.\n   * @param {PersistencePolicy} [persistencePolicy] - The persistence policy.\n   */\n  constructor (port, host, protocol, persistencePolicy = { }) {\n    super(port, host, protocol)\n\n    const { retryPeriod = 1_000, maxRetry = 2, pingPeriod = 120_000, callback = null } = persistencePolicy\n\n    /**\n     * @private\n     * @type {ElectrumConfig}\n     **/\n    this._electrumConfig = {\n      client: '@tetherto/wdk-wallet-btc',\n      version: '1.4'\n    }\n\n    /**\n     * @private\n     * @type {PersistencePolicy}\n     **/\n    this._persistencePolicy = { retryPeriod, maxRetry, pingPeriod, callback }\n\n    /**\n     * @private\n     * @type {Promise<void> | null}\n     */\n    this._ready = null\n\n    const _this = this\n\n    return new Proxy(this, {\n      get (target, prop, receiver) {\n        const value = Reflect.get(target, prop, receiver)\n\n        if (typeof value !== 'function') {\n          return value\n        }\n\n        if (prop === 'close' || prop === 'initElectrum' || prop === 'reconnect') {\n          return value.bind(target)\n        }\n\n        return async function (...args) {\n          await _this._ensure()\n          return value.apply(target, args)\n        }\n      }\n    })\n  }\n\n  /**\n   * Ensures the electrum connection is initialized. If a previous attempt failed or the\n   * client was closed, a new initialization is attempted.\n   *\n   * @private\n   * @param {number} [timeout] - The timeout, in ms (default: 15_000).\n   * @returns {Promise<void>}\n   */\n  _ensure (timeout = 15_000) {\n    if (this._ready) {\n      return this._ready\n    }\n\n    const initElectrum = super.initElectrum(this._electrumConfig, this._persistencePolicy)\n\n    const timeoutTask = new Promise((resolve, reject) => {\n      const timer = setTimeout(() => reject(new Error('Electrum client initialization time out.')), timeout)\n      timer.unref()\n    })\n\n    this._ready = Promise.race([initElectrum, timeoutTask]).catch(error => {\n      this._ready = null\n      throw error\n    })\n\n    return this._ready\n  }\n\n  /**\n   * Recreates the underlying socket and reinitializes the session.\n   *\n   * @returns {Promise<void>}\n   */\n  reconnect () {\n    this.initSocket()\n\n    const initElectrum = super.initElectrum(this._electrumConfig, this._persistencePolicy)\n\n    this._ready = initElectrum.catch(error => {\n      this._ready = null\n      throw error\n    })\n\n    return this._ready\n  }\n\n  /**\n   * Closes the connection.\n   *\n   * @returns {void}\n   */\n  close () {\n    super.close()\n    this._ready = null\n    this.reconnect = ElectrumClient.prototype.reconnect.bind(this)\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport { hmac } from '@noble/hashes/hmac'\nimport { sha512 } from '@noble/hashes/sha512'\nimport { address as btcAddress, initEccLib, networks, payments, Psbt, Transaction } from 'bitcoinjs-lib'\nimport { BIP32Factory } from 'bip32'\nimport pLimit from 'p-limit'\nimport { LRUCache } from 'lru-cache'\n\nimport * as bip39 from 'bip39'\nimport * as ecc from '@bitcoinerlab/secp256k1'\nimport * as bitcoinMessage from 'bitcoinjs-message'\n\n// eslint-disable-next-line camelcase\nimport { sodium_memzero } from 'sodium-universal'\n\nimport WalletAccountReadOnlyBtc from './wallet-account-read-only-btc.js'\n\n/** @typedef {import('@tetherto/wdk-wallet').IWalletAccount} IWalletAccount */\n\n/** @typedef {import('@tetherto/wdk-wallet').KeyPair} KeyPair */\n/** @typedef {import('@tetherto/wdk-wallet').TransactionResult} TransactionResult */\n/** @typedef {import('@tetherto/wdk-wallet').TransferOptions} TransferOptions */\n/** @typedef {import('@tetherto/wdk-wallet').TransferResult} TransferResult */\n\n/** @typedef {import('./wallet-account-read-only-btc.js').BtcTransaction} BtcTransaction */\n/** @typedef {import('./wallet-account-read-only-btc.js').BtcWalletConfig} BtcWalletConfig */\n\n/**\n * @typedef {Object} BtcTransfer\n * @property {string} txid - The transaction's id.\n * @property {string} address - The user's own address.\n * @property {number} vout - The index of the output in the transaction.\n * @property {number} height - The block height (if unconfirmed, 0).\n * @property {bigint} value - The value of the transfer (in satoshis).\n * @property {\"incoming\" | \"outgoing\"} direction - The direction of the transfer.\n * @property {bigint} [fee] - The fee paid for the full transaction (in satoshis).\n * @property {string} [recipient] - The receiving address for outgoing transfers.\n */\n\nconst MASTER_SECRET = Buffer.from('Bitcoin seed', 'utf8')\n\nconst BITCOIN = {\n  wif: 0x80,\n  bip32: { public: 0x0488b21e, private: 0x0488ade4 },\n  messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n  bech32: 'bc',\n  pubKeyHash: 0x00,\n  scriptHash: 0x05\n}\n\nconst MAX_CONCURRENT_REQUESTS = 8\nconst MAX_CACHE_ENTRIES = 1000\nconst REQUEST_BATCH_SIZE = 64\n\nconst bip32 = BIP32Factory(ecc)\n\ninitEccLib(ecc)\n\nfunction derivePath (seed, path) {\n  const masterKeyAndChainCodeBuffer = hmac(sha512, MASTER_SECRET, seed)\n\n  const privateKey = masterKeyAndChainCodeBuffer.slice(0, 32)\n  const chainCode = masterKeyAndChainCodeBuffer.slice(32)\n\n  const masterNode = bip32.fromPrivateKey(Buffer.from(privateKey), Buffer.from(chainCode), BITCOIN)\n  const account = masterNode.derivePath(path)\n\n  sodium_memzero(masterKeyAndChainCodeBuffer)\n  sodium_memzero(privateKey)\n  sodium_memzero(chainCode)\n\n  return { masterNode, account }\n}\n\n/** @implements {IWalletAccount} */\nexport default class WalletAccountBtc extends WalletAccountReadOnlyBtc {\n  /**\n   * Creates a new bitcoin wallet account.\n   *\n   * @param {string | Uint8Array} seed - The wallet's [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) seed phrase.\n   * @param {string} path - The derivation path suffix (e.g. \"0'/0/0\").\n   * @param {BtcWalletConfig} [config] - The configuration object.\n   */\n  constructor (seed, path, config = {}) {\n    if (typeof seed === 'string') {\n      if (!bip39.validateMnemonic(seed)) {\n        throw new Error('The seed phrase is invalid.')\n      }\n\n      seed = bip39.mnemonicToSeedSync(seed)\n    }\n\n    const bip = config.bip ?? 84\n\n    if (![44, 84].includes(bip)) {\n      throw new Error('Invalid bip specification. Supported bips: 44, 84.')\n    }\n\n    const netdp = config.network === 'bitcoin' ? 0 : 1\n    const fullPath = `m/${bip}'/${netdp}'/${path}`\n\n    const { masterNode, account } = derivePath(seed, fullPath)\n\n    const network = networks[config.network] || networks.bitcoin\n\n    const { address } = bip === 44\n      ? payments.p2pkh({ pubkey: account.publicKey, network })\n      : payments.p2wpkh({ pubkey: account.publicKey, network })\n\n    super(address, config)\n\n    /**\n     * The wallet account configuration.\n     *\n     * @protected\n     * @type {BtcWalletConfig}\n     */\n    this._config = config\n\n    /** @private */\n    this._path = fullPath\n\n    /** @private */\n    this._bip = bip\n\n    /** @private */\n    this._masterNode = masterNode\n\n    /** @private */\n    this._account = account\n  }\n\n  /**\n   * The derivation path's index of this account.\n   *\n   * @type {number}\n   */\n  get index () {\n    return +this._path.split('/').pop()\n  }\n\n  /**\n   * The derivation path of this account.\n   *\n   * @type {string}\n   */\n  get path () {\n    return this._path\n  }\n\n  /**\n   * The account's key pair.\n   *\n   * @type {KeyPair}\n   */\n  get keyPair () {\n    return {\n      privateKey: this._account ? new Uint8Array(this._account.privateKey) : null,\n      publicKey: new Uint8Array(this._account.publicKey)\n    }\n  }\n\n  /**\n   * Signs a message.\n   *\n   * @param {string} message - The message to sign.\n   * @returns {Promise<string>} The message's signature.\n   */\n  async sign (message) {\n    return bitcoinMessage\n      .sign(\n        message,\n        this._account.privateKey,\n        true,\n        this._bip === 84 ? { segwitType: 'p2wpkh' } : undefined\n      )\n      .toString('base64')\n  }\n\n  /**\n   * Verifies a message's signature.\n   *\n   * @param {string} message - The original message.\n   * @param {string} signature - The signature to verify.\n   * @returns {Promise<boolean>} True if the signature is valid.\n   */\n  async verify (message, signature) {\n    return bitcoinMessage\n      .verify(\n        message,\n        await this.getAddress(),\n        signature,\n        null,\n        true\n      )\n  }\n\n  /**\n   * Sends a transaction.\n   *\n   * @param {BtcTransaction} tx - The transaction.\n   * @returns {Promise<TransactionResult>} The transaction's result.\n   */\n  async sendTransaction ({ to, value, feeRate, confirmationTarget = 1 }) {\n    const address = await this.getAddress()\n\n    if (!feeRate) {\n      const feeEstimate = await this._electrumClient.blockchainEstimatefee(confirmationTarget)\n      feeRate = this._toBigInt(Math.max(feeEstimate * 100_000, 1))\n    }\n\n    const { utxos, fee, changeValue } = await this._planSpend({\n      fromAddress: address,\n      toAddress: to,\n      amount: value,\n      feeRate\n    })\n\n    const tx = await this._getRawTransaction({ utxos, to, value, fee, feeRate, changeValue })\n\n    await this._electrumClient.blockchainTransaction_broadcast(tx.hex)\n\n    return { hash: tx.txid, fee: tx.fee }\n  }\n\n  /**\n   * Transfers a token to another address.\n   *\n   * @param {TransferOptions} options - The transfer's options.\n   * @returns {Promise<TransferResult>} The transfer's result.\n   */\n  async transfer (options) {\n    throw new Error(\"The 'transfer' method is not supported on the bitcoin blockchain.\")\n  }\n\n  /**\n   * Returns the bitcoin transfers history of the account.\n   *\n   * @param {Object} [options] - The options.\n   * @param {\"incoming\" | \"outgoing\" | \"all\"} [options.direction] - If set, only returns transfers with the given direction (default: \"all\").\n   * @param {number} [options.limit] - The number of transfers to return (default: 10).\n   * @param {number} [options.skip] - The number of transfers to skip (default: 0).\n   * @returns {Promise<BtcTransfer[]>} The bitcoin transfers.\n   */\n  async getTransfers (options = {}) {\n    const {\n      direction = 'all',\n      limit = 10,\n      skip = 0\n    } = options\n\n    const network = this._network\n    const scriptHash = await this._getScriptHash()\n    const history = await this._electrumClient.blockchainScripthash_getHistory(scriptHash)\n\n    const address = await this.getAddress()\n    const myScript = btcAddress.toOutputScript(address, network)\n\n    const txCache = new LRUCache({ max: MAX_CACHE_ENTRIES })\n    const prevUtxoCache = new LRUCache({ max: MAX_CACHE_ENTRIES })\n    const limitConcurrency = pLimit(MAX_CONCURRENT_REQUESTS)\n\n    const fetchTransaction = async (txid) => {\n      const cached = txCache.get(txid)\n      if (cached) return cached\n      const hex = await limitConcurrency(() =>\n        this._electrumClient.blockchainTransaction_get(txid, false)\n      )\n      const tx = Transaction.fromHex(hex)\n      txCache.set(txid, tx)\n      return tx\n    }\n\n    const getPrevUtxo = async (input) => {\n      const prevTxId = Buffer.from(input.hash).reverse().toString('hex')\n      const prevKey = `${prevTxId}:${input.index}`\n      const cached = prevUtxoCache.get(prevKey)\n      if (cached !== undefined) return cached\n      const isCoinbasePrevUtxo = prevTxId === '0'.repeat(64)\n      if (isCoinbasePrevUtxo) { prevUtxoCache.set(prevKey, null); return null }\n      const prevTx = await fetchTransaction(prevTxId)\n      const prevTxUtxo = prevTx.outs[input.index] || null\n      const prevUtxo = prevTxUtxo ? { script: prevTxUtxo.script, value: BigInt(prevTxUtxo.value) } : null\n      prevUtxoCache.set(prevKey, prevUtxo)\n      return prevUtxo\n    }\n\n    const processHistoryItem = async (item) => {\n      let tx\n      try {\n        tx = await fetchTransaction(item.tx_hash)\n      } catch (err) {\n        console.warn('Failed to fetch transaction', item.tx_hash, err)\n        return []\n      }\n      const prevUtxos = await Promise.all(\n        tx.ins.map((input) => getPrevUtxo(input).catch((err) => {\n          console.warn('Failed to fetch prevUtxo', input, err)\n          return null\n        }))\n      )\n\n      let totalInputValue = 0n\n      let isOutgoingTx = false\n      for (const prevUtxo of prevUtxos) {\n        if (!prevUtxo || typeof prevUtxo.value !== 'bigint') continue\n        totalInputValue += prevUtxo.value\n        const isOurPrevUtxo = prevUtxo.script && prevUtxo.script.equals(myScript)\n        isOutgoingTx = isOutgoingTx || isOurPrevUtxo\n      }\n\n      const utxos = tx.outs\n      let totalUtxoValue = 0n\n      for (const utxo of utxos) totalUtxoValue += BigInt(utxo.value)\n\n      const fee = totalInputValue > 0n ? totalInputValue - totalUtxoValue : null\n\n      const rows = []\n      for (let vout = 0; vout < utxos.length; vout++) {\n        const utxo = utxos[vout]\n        const utxoValue = BigInt(utxo.value)\n        const isSelfUtxo = utxo.script.equals(myScript)\n        let directionType = null\n        if (isSelfUtxo && !isOutgoingTx) directionType = 'incoming'\n        else if (!isSelfUtxo && isOutgoingTx) directionType = 'outgoing'\n        else if (isSelfUtxo && isOutgoingTx) directionType = 'change'\n        else continue\n        if (directionType === 'change') continue\n        if (direction !== 'all' && direction !== directionType) continue\n\n        let recipient = null\n        try {\n          recipient = btcAddress.fromOutputScript(utxo.script, network)\n        } catch (err) {\n          console.warn('Failed to decode recipient address', utxo, err)\n        }\n\n        rows.push({\n          txid: item.tx_hash,\n          height: item.height,\n          value: utxoValue,\n          vout,\n          direction: directionType,\n          recipient,\n          fee,\n          address\n        })\n      }\n      return rows\n    }\n\n    const transfers = []\n    const filteredHistory = history.slice(skip)\n    for (let i = 0; i < filteredHistory.length && transfers.length < limit; i += REQUEST_BATCH_SIZE) {\n      const window = filteredHistory.slice(i, i + REQUEST_BATCH_SIZE)\n      const settled = await Promise.allSettled(\n        window.map((item) =>\n          processHistoryItem(item).catch((err) => {\n            console.warn('Failed to process history item', item, err)\n            return []\n          })\n        )\n      )\n      for (const res of settled) {\n        if (transfers.length >= limit) break\n        if (res.status !== 'fulfilled') continue\n        const rows = res.value || []\n        for (const row of rows) {\n          transfers.push(row)\n          if (transfers.length >= limit) break\n        }\n      }\n    }\n\n    return transfers\n  }\n\n  /**\n   * Returns a read-only copy of the account.\n   *\n   * @returns {Promise<WalletAccountReadOnlyBtc>} The read-only account.\n   */\n  async toReadOnlyAccount () {\n    const btcReadOnlyAccount = new WalletAccountReadOnlyBtc(this._address, this._config)\n\n    return btcReadOnlyAccount\n  }\n\n  /**\n   * Disposes the wallet account, erasing the private key from memory and closing the connection with the electrum server.\n   */\n  dispose () {\n    sodium_memzero(this._account.privateKey)\n    sodium_memzero(this._account.chainCode)\n\n    sodium_memzero(this._masterNode.privateKey)\n    sodium_memzero(this._masterNode.chainCode)\n\n    this._account = undefined\n\n    this._masterNode = undefined\n\n    this._electrumClient.close()\n  }\n\n  /** @private */\n  async _getRawTransaction ({ utxos, to, value, fee, feeRate, changeValue }) {\n    feeRate = this._toBigInt(feeRate)\n    if (feeRate < 1n) feeRate = 1n\n    value = this._toBigInt(value)\n    changeValue = this._toBigInt(changeValue)\n    fee = this._toBigInt(fee)\n\n    const legacyPrevTxCache = new Map()\n    const getPrevTxHex = async (txid) => {\n      if (legacyPrevTxCache.has(txid)) return legacyPrevTxCache.get(txid)\n      const hex = await this._electrumClient.blockchainTransaction_get(txid, false)\n      legacyPrevTxCache.set(txid, hex)\n      return hex\n    }\n\n    const buildAndSign = async (rcptVal, chgVal) => {\n      const psbt = new Psbt({ network: this._network })\n\n      for (const utxo of utxos) {\n        const baseInput = {\n          hash: utxo.tx_hash,\n          index: utxo.tx_pos,\n          bip32Derivation: [{\n            masterFingerprint: this._masterNode.fingerprint,\n            path: this._path,\n            pubkey: this._account.publicKey\n          }]\n        }\n\n        if (this._bip === 84) {\n          psbt.addInput({\n            ...baseInput,\n            witnessUtxo: {\n              script: Buffer.from(utxo.vout.scriptPubKey.hex, 'hex'),\n              value: Number(utxo.value)\n            }\n          })\n        } else {\n          const prevHex = await getPrevTxHex(utxo.tx_hash)\n          psbt.addInput({\n            ...baseInput,\n            nonWitnessUtxo: Buffer.from(prevHex, 'hex')\n          })\n        }\n      }\n\n      psbt.addOutput({ address: to, value: Number(rcptVal) })\n      if (chgVal > 0n) psbt.addOutput({ address: await this.getAddress(), value: Number(chgVal) })\n\n      utxos.forEach((_, index) => psbt.signInputHD(index, this._masterNode))\n      psbt.finalizeAllInputs()\n\n      return psbt.extractTransaction()\n    }\n\n    let currentRecipientAmnt = value\n    let currentChange = changeValue\n\n    let tx = await buildAndSign(currentRecipientAmnt, currentChange)\n    let vsize = tx.virtualSize()\n    let requiredFee = BigInt(vsize) * feeRate\n\n    if (requiredFee <= fee) {\n      return { txid: tx.getId(), hex: tx.toHex(), fee, vsize }\n    }\n\n    const dustLimit = this._dustLimit\n\n    const delta = requiredFee - fee\n    fee = requiredFee\n\n    if (currentChange > 0n) {\n      let newChange = currentChange - delta\n      if (newChange <= dustLimit) newChange = 0n\n      currentChange = newChange\n      tx = await buildAndSign(currentRecipientAmnt, currentChange)\n    } else {\n      const newRecipientAmnt = currentRecipientAmnt - delta\n      if (newRecipientAmnt <= dustLimit) {\n        throw new Error(`The amount after fees must be bigger than the dust limit (= ${dustLimit}).`)\n      }\n      currentRecipientAmnt = newRecipientAmnt\n      tx = await buildAndSign(currentRecipientAmnt, currentChange)\n    }\n\n    vsize = tx.virtualSize()\n    requiredFee = BigInt(vsize) * feeRate\n    if (requiredFee > fee) throw new Error('Fee shortfall after output rebalance.')\n\n    return { txid: tx.getId(), hex: tx.toHex(), fee, vsize }\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nimport { WalletAccountReadOnly } from '@tetherto/wdk-wallet'\n\nimport { coinselect } from '@bitcoinerlab/coinselect'\nimport { DescriptorsFactory } from '@bitcoinerlab/descriptors'\nimport * as ecc from '@bitcoinerlab/secp256k1'\n\nimport { address as btcAddress, crypto, networks, Transaction } from 'bitcoinjs-lib'\n\nimport ElectrumClient from './electrum-client.js'\n\n/** @typedef {import('@bitcoinerlab/coinselect').OutputWithValue} OutputWithValue */\n/** @typedef {import('bitcoinjs-lib').Network} Network */\n/** @typedef {import('bitcoinjs-lib').Transaction} BtcTransactionReceipt */\n\n/** @typedef {import('@tetherto/wdk-wallet').TransactionResult} TransactionResult */\n/** @typedef {import('@tetherto/wdk-wallet').TransferOptions} TransferOptions */\n/** @typedef {import('@tetherto/wdk-wallet').TransferResult} TransferResult */\n\n/**\n * @typedef {Object} BtcTransaction\n * @property {string} to - The transaction's recipient.\n * @property {number | bigint} value - The amount of bitcoins to send to the recipient (in satoshis).\n * @property {number} [confirmationTarget] - Optional confirmation target in blocks (default: 1).\n * @property {number | bigint} [feeRate] - Optional fee rate in satoshis per virtual byte. If provided, this value overrides the fee rate estimated from the blockchain (default: undefined).\n * */\n\n/**\n * @typedef {Object} BtcWalletConfig\n * @property {string} [host] - The electrum server's hostname (default: \"electrum.blockstream.info\").\n * @property {number} [port] - The electrum server's port (default: 50001).\n * @property {\"bitcoin\" | \"regtest\" | \"testnet\"} [network] The name of the network to use (default: \"bitcoin\").\n * @property {\"tcp\" | \"tls\" | \"ssl\"} [protocol] - The transport protocol to use (default: \"tcp\").\n * @property {44 | 84} [bip] - The BIP address type used for key and address derivation.\n *   - 44: [BIP-44 (P2PKH / legacy)](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)\n *   - 84: [BIP-84 (P2WPKH / native SegWit)](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki)\n *   - Default: 84 (P2WPKH).\n * */\n\n/**\n * @typedef {Object} BtcMaxSpendableResult\n * @property {bigint} amount - The maximum spendable amount in satoshis.\n * @property {bigint} fee - The estimated network fee in satoshis.\n * @property {bigint} changeValue - The estimated change value in satoshis.\n */\n\nconst { Output } = DescriptorsFactory(ecc)\n\nconst MIN_TX_FEE_SATS = 141\nconst MAX_UTXO_INPUTS = 200\n\nconst BIP_BY_ADDRESS_PREFIX = {\n  1: 44,\n  m: 44,\n  n: 44,\n  bc1q: 84,\n  tb1q: 84,\n  bcrt1q: 84\n}\n\nconst DUST_LIMIT = {\n  44: 546n,\n  84: 294n\n}\n\nexport default class WalletAccountReadOnlyBtc extends WalletAccountReadOnly {\n  /**\n   * Creates a new bitcoin read-only wallet account.\n   *\n   * @param {string} address - The account's address.\n   * @param {Omit<BtcWalletConfig, 'bip'>} [config] - The configuration object.\n   */\n  constructor (address, config = {}) {\n    super(address)\n\n    /**\n     * The read-only wallet account configuration.\n     *\n     * @protected\n     * @type {Omit<BtcWalletConfig, 'bip'>}\n     */\n    this._config = config\n\n    /**\n     * The network.\n     *\n     * @protected\n     * @type {Network}\n     */\n    this._network = networks[this._config.network] || networks.bitcoin\n\n    /**\n     * An electrum client to interact with the bitcoin node.\n     *\n     * @protected\n     * @type {ElectrumClient}\n     */\n    this._electrumClient = new ElectrumClient(\n      config.port || 50_001,\n      config.host || 'electrum.blockstream.info',\n      config.protocol || 'tcp',\n      { retryPeriod: 1_000, maxRetry: 2, pingPeriod: 120_000, callback: null }\n    )\n\n    const prefix = Object.keys(BIP_BY_ADDRESS_PREFIX).find(p => address.startsWith(p))\n    const bip = BIP_BY_ADDRESS_PREFIX[prefix] || 44\n\n    /**\n     * The dust limit in satoshis based on the BIP type.\n     *\n     * @private\n     * @type {number}\n     */\n    this._dustLimit = DUST_LIMIT[bip]\n  }\n\n  /**\n   * Returns the account's bitcoin balance.\n   *\n   * @returns {Promise<bigint>} The bitcoin balance (in satoshis).\n   */\n  async getBalance () {\n    const scriptHash = await this._getScriptHash()\n\n    const { confirmed } = await this._electrumClient.blockchainScripthash_getBalance(scriptHash)\n\n    return BigInt(confirmed)\n  }\n\n  /**\n   * Returns the account balance for a specific token.\n   *\n   * @param {string} tokenAddress - The smart contract address of the token.\n   * @returns {Promise<bigint>} The token balance (in base unit).\n   */\n  async getTokenBalance (tokenAddress) {\n    throw new Error(\"The 'getTokenBalance' method is not supported on the bitcoin blockchain.\")\n  }\n\n  /**\n   * Quotes the costs of a send transaction operation.\n   *\n   * @param {BtcTransaction} tx - The transaction.\n   * @returns {Promise<Omit<TransactionResult, 'hash'>>} The transaction's quotes.\n   */\n  async quoteSendTransaction ({ to, value, feeRate, confirmationTarget = 1 }) {\n    const address = await this.getAddress()\n\n    if (!feeRate) {\n      const feeEstimate = await this._electrumClient.blockchainEstimatefee(confirmationTarget)\n      feeRate = this._toBigInt(Math.max(feeEstimate * 100_000, 1))\n    }\n\n    const { fee } = await this._planSpend({\n      fromAddress: address,\n      toAddress: to,\n      amount: value,\n      feeRate\n    })\n\n    return { fee: BigInt(fee) }\n  }\n\n  /**\n   * Quotes the costs of a transfer operation.\n   *\n   * @param {TransferOptions} options - The transfer's options.\n   * @returns {Promise<Omit<TransferResult, 'hash'>>} The transfer's quotes.\n   */\n  async quoteTransfer (options) {\n    throw new Error(\"The 'quoteTransfer' method is not supported on the bitcoin blockchain.\")\n  }\n\n  /**\n   * Returns a transaction's receipt.\n   *\n   * @param {string} hash - The transaction's hash.\n   * @returns {Promise<BtcTransactionReceipt | null>} – The receipt, or null if the transaction has not been included in a block yet.\n   */\n  async getTransactionReceipt (hash) {\n    if (!/^[0-9a-fA-F]{64}$/.test(hash)) {\n      throw new Error(\"The 'getTransactionReceipt(hash)' method requires a valid transaction hash to fetch the receipt.\")\n    }\n\n    const scriptHash = await this._getScriptHash()\n    const history = await this._electrumClient.blockchainScripthash_getHistory(scriptHash)\n    const item = Array.isArray(history) ? history.find(h => h?.tx_hash === hash) : null\n\n    if (!item || !item.height || item.height <= 0) {\n      return null\n    }\n\n    const hex = await this._electrumClient.blockchainTransaction_get(hash, false)\n\n    const transaction = Transaction.fromHex(hex)\n\n    return transaction\n  }\n\n  /**\n   * Returns the maximum spendable amount (in satoshis) that can be sent in\n   * a single transaction, after subtracting estimated transaction fees.\n   *\n   * The maximum spendable amount can differ from the wallet's total balance.\n   * A transaction can only include up to MAX_UTXO_INPUTS (default: 200) unspents.\n   * Wallets holding more than this limit cannot spend their full balance in a\n   * single transaction.\n   *\n   * @returns {Promise<BtcMaxSpendableResult>} The maximum spendable result.\n   */\n  async getMaxSpendable () {\n    const fromAddress = await this.getAddress()\n    const feeRateRaw = await this._electrumClient.blockchainEstimatefee(1)\n    const feeRate = Math.max(Number(feeRateRaw) * 100_000, 1)\n\n    const scriptHash = await this._getScriptHash()\n    const unspent = await this._electrumClient.blockchainScripthash_listunspent(scriptHash)\n    if (!unspent || unspent.length === 0) {\n      return { amount: 0n, fee: 0n, changeValue: 0n }\n    }\n\n    const addr = String(fromAddress).toLowerCase()\n    const isP2WPKH =\n      addr.startsWith('bc1q') ||\n      addr.startsWith('tb1q') ||\n      addr.startsWith('bcrt1q')\n    const inputVBytes = isP2WPKH ? 68 : 148\n\n    const perInputFee = Math.ceil(inputVBytes * feeRate)\n    let spendableUtxos = unspent.filter(u => (u.value - perInputFee) > 0)\n    if (spendableUtxos.length === 0) {\n      return { amount: 0n, fee: 0n, changeValue: 0n }\n    }\n\n    if (spendableUtxos.length > MAX_UTXO_INPUTS) {\n      spendableUtxos = spendableUtxos\n        .sort((a, b) => b.value - a.value)\n        .slice(0, MAX_UTXO_INPUTS)\n    }\n\n    const totalInputValueSats = spendableUtxos.reduce((sum, u) => sum + u.value, 0)\n    const inputCount = spendableUtxos.length\n    const txOverheadVBytes = 11\n    const outputVBytes = 34\n\n    const twoOutputsVSize = txOverheadVBytes + (inputCount * inputVBytes) + (2 * outputVBytes)\n    const twoOutputsFeeSats = Math.max(Math.ceil(twoOutputsVSize * feeRate), MIN_TX_FEE_SATS)\n    const twoOutputsRecipientAmountSats = totalInputValueSats - twoOutputsFeeSats - Number(this._dustLimit)\n    if (twoOutputsRecipientAmountSats > Number(this._dustLimit)) {\n      return {\n        amount: BigInt(twoOutputsRecipientAmountSats),\n        fee: BigInt(twoOutputsFeeSats),\n        changeValue: this._dustLimit\n      }\n    }\n\n    const oneOutputVSize = txOverheadVBytes + (inputCount * inputVBytes) + outputVBytes\n    const oneOutputFeeSats = Math.max(Math.ceil(oneOutputVSize * feeRate), MIN_TX_FEE_SATS)\n    const oneOutputRecipientAmountSats = totalInputValueSats - oneOutputFeeSats\n    if (oneOutputRecipientAmountSats <= this._dustLimit) {\n      return { amount: 0n, fee: 0n, changeValue: 0n }\n    }\n\n    return {\n      amount: BigInt(oneOutputRecipientAmountSats),\n      fee: BigInt(oneOutputFeeSats),\n      changeValue: 0n\n    }\n  }\n\n  /**\n   * Computes the sha-256 hash of the output script for this wallet's address, reverses the byte order,\n   * and returns it as a hex string.\n   *\n   * @protected\n   * @returns {Promise<string>} The reversed sha-256 script hash as a hex-encoded string.\n   */\n  async _getScriptHash () {\n    const address = await this.getAddress()\n    const script = btcAddress.toOutputScript(address, this._network)\n    const hash = crypto.sha256(script)\n\n    const buffer = Buffer.from(hash).reverse()\n\n    return buffer.toString('hex')\n  }\n\n  /** @private */\n  _toBigInt (v) { return typeof v === 'bigint' ? v : BigInt(Math.round(Number(v))) }\n\n  /**\n   * Builds and returns a fee-aware funding plan for sending a transaction.\n   *\n   * Uses descriptors + coinselect to choose inputs, at a given feeRate (sats/vB). Returns the selected\n   * UTXOs (in the shape expected by the PSBT builder), the computed fee, and the resulting change value.\n   *\n   * @protected\n   * @param {Object} tx - The transaction.\n   * @param {string} tx.fromAddress - The sender's address.\n   * @param {string} tx.toAddress - The recipient's address.\n   * @param {number | bigint} tx.amount - The amount to send (in satoshis).\n   * @param {number | bigint} tx.feeRate - The fee rate (in sats/vB).\n   * @returns {Promise<{ utxos: OutputWithValue[], fee: number, changeValue: number }>} - The funding plan.\n   */\n  async _planSpend ({ fromAddress, toAddress, amount, feeRate }) {\n    amount = this._toBigInt(amount)\n    feeRate = this._toBigInt(feeRate)\n    if (feeRate < 1n) feeRate = 1n\n\n    if (amount <= this._dustLimit) {\n      throw new Error(`The amount must be bigger than the dust limit (= ${this._dustLimit}).`)\n    }\n\n    const network = this._network\n\n    const fromAddressScriptHex = btcAddress.toOutputScript(fromAddress, network).toString('hex')\n    const fromAddressOutput = new Output({ descriptor: `addr(${fromAddress})`, network })\n    const toAddressOutput = new Output({ descriptor: `addr(${toAddress})`, network })\n\n    const scriptHash = await this._getScriptHash()\n\n    const unspent = await this._electrumClient.blockchainScripthash_listunspent(scriptHash)\n\n    if (!unspent || unspent.length === 0) {\n      throw new Error('No unspent outputs available.')\n    }\n\n    const utxosForCoinSelect = unspent.map(u => ({\n      output: fromAddressOutput,\n      value: u.value,\n      __ref: u\n    }))\n\n    const result = coinselect({\n      utxos: utxosForCoinSelect,\n      remainder: fromAddressOutput,\n      targets: [{ output: toAddressOutput, value: Number(amount) }],\n      feeRate: Number(feeRate)\n    })\n\n    if (!result) {\n      throw new Error('Insufficient balance to send the transaction.')\n    }\n\n    if (result.utxos.length > MAX_UTXO_INPUTS) {\n      throw new Error('Exceeded maximum allowed inputs for transaction.')\n    }\n\n    const fee = this._toBigInt(Math.max(result.fee ?? 0, MIN_TX_FEE_SATS))\n\n    const utxos = result.utxos.map(({ __ref }) => ({\n      ...__ref,\n      vout: {\n        value: this._toBigInt(__ref.value),\n        scriptPubKey: { hex: fromAddressScriptHex }\n      }\n    }))\n\n    const total = utxos.reduce((s, u) => s + this._toBigInt(u.value), 0n)\n    const changeValue = total - fee - amount\n\n    if (changeValue < 0n) {\n      throw new Error('Insufficient balance after fees.')\n    }\n\n    if (changeValue <= this._dustLimit) {\n      return {\n        utxos,\n        fee: fee + changeValue,\n        changeValue: 0n\n      }\n    }\n\n    return { utxos, fee, changeValue }\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport WalletManager from '@tetherto/wdk-wallet'\n\nimport WalletAccountBtc from './wallet-account-btc.js'\n\n/** @typedef {import('@tetherto/wdk-wallet').FeeRates} FeeRates */\n\n/** @typedef {import('./wallet-account-btc.js').BtcWalletConfig} BtcWalletConfig */\n\nconst MEMPOOL_SPACE_URL = 'https://mempool.space'\n\nexport default class WalletManagerBtc extends WalletManager {\n  /**\n   * Creates a new wallet manager for the bitcoin blockchain.\n   *\n   * @param {string | Uint8Array} seed - The wallet's [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) seed phrase.\n   * @param {BtcWalletConfig} [config] - The configuration object.\n   */\n  constructor (seed, config = {}) {\n    super(seed, config)\n  }\n\n  /**\n   * Returns the wallet account at a specific index (defaults to [BIP-84](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki); set config.bip=44 for [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)).\n   *\n   * @example\n   * // Returns the account with derivation path\n   * // For mainnet (bitcoin): m/84'/0'/0'/0/1\n   * // For testnet or regtest: m/84'/1'/0'/0/1\n   * const account = await wallet.getAccount(1);\n   * @param {number} [index] - The index of the account to get (default: 0).\n   * @returns {Promise<WalletAccountBtc>} The account.\n   */\n  async getAccount (index = 0) {\n    return await this.getAccountByPath(`0'/0/${index}`)\n  }\n\n  /**\n   * Returns the wallet account at a specific derivation path.\n   *\n   * @example\n   * // Returns the account with derivation path:\n   * // For mainnet (bitcoin): m/84'/0'/0'/0/1\n   * // For testnet or regtest: m/84'/1'/0'/0/1\n   * const account = await wallet.getAccountByPath(\"0'/0/1\");\n   * @param {string} path - The derivation path (e.g. \"0'/0/0\").\n   * @returns {Promise<WalletAccountBtc>} The account.\n   */\n  async getAccountByPath (path) {\n    if (!this._accounts[path]) {\n      const account = new WalletAccountBtc(this._seed, path, this._config)\n\n      this._accounts[path] = account\n    }\n\n    return this._accounts[path]\n  }\n\n  /**\n   * Returns the current fee rates.\n   *\n   * @returns {Promise<FeeRates>} The fee rates (in satoshis).\n   */\n  async getFeeRates () {\n    const response = await fetch(`${MEMPOOL_SPACE_URL}/api/v1/fees/recommended`)\n\n    const { fastestFee, hourFee } = await response.json()\n\n    return {\n      normal: BigInt(hourFee),\n      fast: BigInt(fastestFee)\n    }\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\n/** @typedef {import('ethers').TransactionReceipt} EvmTransactionReceipt */\n\n/** @typedef {import('@tetherto/wdk-wallet').FeeRates} FeeRates */\n/** @typedef {import('@tetherto/wdk-wallet').KeyPair} KeyPair */\n/** @typedef {import('@tetherto/wdk-wallet').TransactionResult} TransactionResult */\n/** @typedef {import('@tetherto/wdk-wallet').TransferOptions} TransferOptions */\n/** @typedef {import('@tetherto/wdk-wallet').TransferResult} TransferResult */\n\n/** @typedef {import('./src/wallet-account-read-only-evm.js').EvmTransaction} EvmTransaction */\n/** @typedef {import('./src/wallet-account-read-only-evm.js').EvmWalletConfig} EvmWalletConfig */\n/** @typedef {import('./src/wallet-account-evm.js').ApproveOptions} ApproveOptions */\n\nexport { default } from './src/wallet-manager-evm.js'\n\nexport { default as WalletAccountReadOnlyEvm } from './src/wallet-account-read-only-evm.js'\n\nexport { default as WalletAccountEvm } from './src/wallet-account-evm.js'\n{\n  \"name\": \"@tetherto/wdk-wallet-evm\",\n  \"version\": \"1.0.0-beta.4\",\n  \"description\": \"A simple package to manage BIP-32 wallets for evm blockchains.\",\n  \"keywords\": [\n    \"wdk\",\n    \"wallet\",\n    \"bip-32\",\n    \"ethereum\"\n  ],\n  \"author\": \"Tether\",\n  \"license\": \"Apache-2.0\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/tetherto/wdk-wallet-evm.git\"\n  },\n  \"main\": \"index.js\",\n  \"type\": \"module\",\n  \"types\": \"./types\",\n  \"scripts\": {\n    \"build:types\": \"tsc\",\n    \"lint\": \"standard\",\n    \"lint:fix\": \"standard --fix\",\n    \"test\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest\",\n    \"test:coverage\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage\",\n    \"test:integration\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest tests/integration\",\n    \"test:integration:coverage\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest tests/integration --coverage\"\n  },\n  \"dependencies\": {\n    \"@noble/curves\": \"1.9.2\",\n    \"@noble/hashes\": \"1.8.0\",\n    \"@noble/secp256k1\": \"2.2.3\",\n    \"@tetherto/wdk-wallet\": \"^1.0.0-beta.1\",\n    \"bare-node-runtime\": \"^1.1.4\",\n    \"bip39\": \"3.1.0\",\n    \"ethers\": \"6.14.3\",\n    \"sodium-universal\": \"5.0.1\"\n  },\n  \"devDependencies\": {\n    \"@nomicfoundation/hardhat-ethers\": \"3.0.9\",\n    \"cross-env\": \"7.0.3\",\n    \"hardhat\": \"2.24.2\",\n    \"jest\": \"29.7.0\",\n    \"standard\": \"17.1.2\",\n    \"typescript\": \"5.8.3\"\n  },\n  \"overrides\": {\n    \"cookie\": \"1.0.2\",\n    \"tmp\": \"0.2.5\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./types/index.d.ts\",\n      \"bare\": \"./bare.js\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": {\n      \"default\": \"./package.json\"\n    }\n  },\n  \"publishConfig\": {\n    \"access\": \"public\",\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"standard\": {\n    \"ignore\": [\n      \"bare.js\",\n      \"tests/**/*.js\"\n    ]\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nimport {\n  assert, assertArgument, assertPrivate, BaseWallet, computeHmac, dataSlice, defineProperties,\n  getBytes, getNumber, hexlify, isBytesLike, ripemd160, sha256\n} from 'ethers'\n\nimport * as secp256k1 from '@noble/secp256k1'\n\nimport MemorySafeSigningKey from './signing-key.js'\n\nconst MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100])\n\nconst HardenedBit = 0x80000000\n\nconst _guard = { }\n\nfunction serI (index, chainCode, publicKey, privateKeyBuffer) {\n  const data = new Uint8Array(37)\n\n  if (index & HardenedBit) {\n    assert(privateKeyBuffer != null, 'cannot derive child of neutered node', 'UNSUPPORTED_OPERATION', {\n      operation: 'deriveChild'\n    })\n\n    data.set(getBytes(privateKeyBuffer), 1)\n  } else {\n    data.set(getBytes(publicKey))\n  }\n\n  for (let i = 24; i >= 0; i -= 8) { data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff) }\n  const I = getBytes(computeHmac('sha512', chainCode, data))\n\n  return { IL: I.slice(0, 32), IR: I.slice(32) }\n}\n\nfunction derivePath (node, path) {\n  const components = path.split('/')\n\n  assertArgument(components.length > 0, 'invalid path', 'path', path)\n\n  if (components[0] === 'm') {\n    assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with \"m/\") for a node at non-zero depth ${node.depth}`, 'path', path)\n    components.shift()\n  }\n\n  let result = node\n  for (let i = 0; i < components.length; i++) {\n    const component = components[i]\n\n    if (component.match(/^[0-9]+'$/)) {\n      const index = parseInt(component.substring(0, component.length - 1))\n      assertArgument(index < HardenedBit, 'invalid path index', `path[${i}]`, component)\n      result = result.deriveChild(HardenedBit + index)\n    } else if (component.match(/^[0-9]+$/)) {\n      const index = parseInt(component)\n      assertArgument(index < HardenedBit, 'invalid path index', `path[${i}]`, component)\n      result = result.deriveChild(index)\n    } else {\n      assertArgument(false, 'invalid path component', `path[${i}]`, component)\n    }\n  }\n\n  return result\n}\n\nfunction addToPrivateKey (privateKey, x) {\n  let carry = 0\n\n  for (let i = 31; i >= 0; i--) {\n    const sum = privateKey[i] + x[i] + carry\n    privateKey[i] = sum & 0xff\n    carry = sum >> 8\n  }\n\n  return carry > 0\n}\n\nfunction subtractCurveOrderFromPrivateKey (privateKey) {\n  let carry = 0\n\n  for (let i = 31; i >= 0; i--) {\n    const curveOrderByte = Number((secp256k1.CURVE.n >> BigInt(8 * (31 - i))) & 0xffn)\n    const diff = privateKey[i] - curveOrderByte - carry\n    privateKey[i] = diff < 0 ? diff + 256 : diff\n    carry = diff < 0 ? 1 : 0\n  }\n}\n\nfunction compareWithCurveOrder (buffer, offset = 0) {\n  for (let i = 0; i < 32; i++) {\n    const curveOrderByte = Number((secp256k1.CURVE.n >> BigInt(8 * (31 - i))) & 0xffn)\n    if (buffer[offset + i] > curveOrderByte) return 1\n    if (buffer[offset + i] < curveOrderByte) return -1\n  }\n\n  return 0\n}\n\n/** @internal */\nexport default class MemorySafeHDNodeWallet extends BaseWallet {\n  constructor (guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) {\n    super(signingKey, provider)\n    assertPrivate(guard, _guard, 'MemorySafeHDNodeWallet')\n\n    defineProperties(this, { publicKey: signingKey.compressedPublicKey })\n\n    const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4)\n    defineProperties(this, {\n      parentFingerprint,\n      fingerprint,\n      chainCode,\n      path,\n      index,\n      depth\n    })\n\n    defineProperties(this, { mnemonic })\n  }\n\n  connect (provider) {\n    return new MemorySafeHDNodeWallet(_guard, this.signingKey, this.parentFingerprint,\n      this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider)\n  }\n\n  get privateKeyBuffer () {\n    return this.signingKey.privateKeyBuffer\n  }\n\n  get publicKeyBuffer () {\n    return this.signingKey.publicKeyBuffer\n  }\n\n  deriveChild (_index) {\n    const index = getNumber(_index, 'index')\n    assertArgument(index <= 0xffffffff, 'invalid index', 'index', index)\n\n    let path = this.path\n    if (path) {\n      path += '/' + (index & ~HardenedBit)\n      if (index & HardenedBit) { path += \"'\" }\n    }\n\n    const { IR, IL } = serI(index, this.chainCode, this.publicKey, this.privateKeyBuffer)\n\n    const overflow = addToPrivateKey(this.privateKeyBuffer, IL)\n\n    if (overflow || compareWithCurveOrder(this.privateKeyBuffer) >= 0) {\n      subtractCurveOrderFromPrivateKey(this.privateKeyBuffer)\n    }\n\n    const ki = new MemorySafeSigningKey(this.privateKeyBuffer)\n\n    return new MemorySafeHDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR),\n      path, index, this.depth + 1, this.mnemonic, this.provider)\n  }\n\n  derivePath (path) {\n    return derivePath(this, path)\n  }\n\n  dispose () {\n    this.signingKey.dispose()\n  }\n\n  static fromSeed (seed) {\n    return MemorySafeHDNodeWallet._fromSeed(seed, null)\n  }\n\n  static _fromSeed (_seed, mnemonic) {\n    assertArgument(isBytesLike(_seed), 'invalid seed', 'seed', '[REDACTED]')\n\n    const seed = getBytes(_seed, 'seed')\n    assertArgument(seed.length >= 16 && seed.length <= 64, 'invalid seed', 'seed', '[REDACTED]')\n\n    const I = getBytes(computeHmac('sha512', MasterSecret, seed))\n    const signingKey = new MemorySafeSigningKey(I.slice(0, 32))\n\n    return new MemorySafeHDNodeWallet(_guard, signingKey, '0x00000000', hexlify(I.slice(32)),\n      'm', 0, 0, mnemonic, null)\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nimport { hmac } from '@noble/hashes/hmac'\nimport { sha256 } from '@noble/hashes/sha256'\nimport * as secp256k1 from '@noble/secp256k1'\n\nimport { assertArgument, dataLength, getBytesCopy, Signature, SigningKey, toBeHex } from 'ethers'\n\n// eslint-disable-next-line camelcase\nimport { sodium_memzero } from 'sodium-universal'\n\nconst NULL = '0x0000000000000000000000000000000000000000000000000000000000000000'\n\nsecp256k1.etc.hmacSha256Sync = (key, ...messages) => {\n  return hmac(sha256, key, secp256k1.etc.concatBytes(...messages))\n}\n\n/** @internal */\nexport default class MemorySafeSigningKey extends SigningKey {\n  constructor (privateKeyBuffer) {\n    super(NULL)\n\n    this._privateKeyBuffer = privateKeyBuffer\n\n    this._publicKeyBuffer = secp256k1.getPublicKey(privateKeyBuffer, true)\n  }\n\n  get publicKey () {\n    return SigningKey.computePublicKey(this._privateKeyBuffer)\n  }\n\n  get compressedPublicKey () {\n    return SigningKey.computePublicKey(this._privateKeyBuffer, true)\n  }\n\n  get privateKeyBuffer () {\n    return this._privateKeyBuffer\n  }\n\n  get publicKeyBuffer () {\n    return this._publicKeyBuffer\n  }\n\n  sign (digest) {\n    assertArgument(dataLength(digest) === 32, 'invalid digest length', 'digest', digest)\n\n    const sig = secp256k1.sign(getBytesCopy(digest), this._privateKeyBuffer, {\n      lowS: true\n    })\n\n    return Signature.from({\n      r: toBeHex(sig.r, 32),\n      s: toBeHex(sig.s, 32),\n      v: (sig.recovery ? 0x1c : 0x1b)\n    })\n  }\n\n  dispose () {\n    sodium_memzero(this._privateKeyBuffer)\n\n    this._privateKeyBuffer = undefined\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nimport { verifyMessage, Contract } from 'ethers'\n\nimport * as bip39 from 'bip39'\n\nimport WalletAccountReadOnlyEvm from './wallet-account-read-only-evm.js'\n\nimport MemorySafeHDNodeWallet from './memory-safe/hd-node-wallet.js'\n\n/** @typedef {import('ethers').HDNodeWallet} HDNodeWallet */\n\n/** @typedef {import('@tetherto/wdk-wallet').IWalletAccount} IWalletAccount */\n\n/** @typedef {import('@tetherto/wdk-wallet').KeyPair} KeyPair */\n/** @typedef {import('@tetherto/wdk-wallet').TransactionResult} TransactionResult */\n/** @typedef {import('@tetherto/wdk-wallet').TransferOptions} TransferOptions */\n/** @typedef {import('@tetherto/wdk-wallet').TransferResult} TransferResult */\n\n/** @typedef {import('./wallet-account-read-only-evm.js').EvmTransaction} EvmTransaction */\n/** @typedef {import('./wallet-account-read-only-evm.js').EvmWalletConfig} EvmWalletConfig */\n\n/**\n * @typedef {Object} ApproveOptions\n * @property {string} token - The address of the token to approve.\n * @property {string} spender - The spender’s address.\n * @property {number | bigint} amount - The amount of tokens to approve to the spender.\n */\n\nconst BIP_44_ETH_DERIVATION_PATH_PREFIX = \"m/44'/60'\"\nconst USDT_MAINNET_ADDRESS = '0xdAC17F958D2ee523a2206206994597C13D831ec7'\n\n/** @implements {IWalletAccount} */\nexport default class WalletAccountEvm extends WalletAccountReadOnlyEvm {\n  /**\n   * Creates a new evm wallet account.\n   *\n   * @param {string | Uint8Array} seed - The wallet's [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) seed phrase.\n   * @param {string} path - The BIP-44 derivation path (e.g. \"0'/0/0\").\n   * @param {EvmWalletConfig} [config] - The configuration object.\n   */\n  constructor (seed, path, config = {}) {\n    if (typeof seed === 'string') {\n      if (!bip39.validateMnemonic(seed)) {\n        throw new Error('The seed phrase is invalid.')\n      }\n\n      seed = bip39.mnemonicToSeedSync(seed)\n    }\n\n    path = BIP_44_ETH_DERIVATION_PATH_PREFIX + '/' + path\n\n    const account = MemorySafeHDNodeWallet.fromSeed(seed)\n      .derivePath(path)\n\n    super(account.address, config)\n\n    /**\n     * The wallet account configuration.\n     *\n     * @protected\n     * @type {EvmWalletConfig}\n     */\n    this._config = config\n\n    /**\n     * The account.\n     *\n     * @protected\n     * @type {HDNodeWallet}\n     */\n    this._account = account\n\n    if (this._provider) {\n      this._account = this._account.connect(this._provider)\n    }\n  }\n\n  /**\n   * The derivation path's index of this account.\n   *\n   * @type {number}\n   */\n  get index () {\n    return this._account.index\n  }\n\n  /**\n   * The derivation path of this account (see [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)).\n   *\n   * @type {string}\n   */\n  get path () {\n    return this._account.path\n  }\n\n  /**\n   * The account's key pair.\n   *\n   * @type {KeyPair}\n   */\n  get keyPair () {\n    return {\n      privateKey: this._account.privateKeyBuffer,\n      publicKey: this._account.publicKeyBuffer\n    }\n  }\n\n  /**\n   * Signs a message.\n   *\n   * @param {string} message - The message to sign.\n   * @returns {Promise<string>} The message's signature.\n   */\n  async sign (message) {\n    return await this._account.signMessage(message)\n  }\n\n  /**\n   * Verifies a message's signature.\n   *\n   * @param {string} message - The original message.\n   * @param {string} signature - The signature to verify.\n   * @returns {Promise<boolean>} True if the signature is valid.\n   */\n  async verify (message, signature) {\n    const address = await verifyMessage(message, signature)\n\n    return address.toLowerCase() === this._account.address.toLowerCase()\n  }\n\n  /**\n   * Sends a transaction.\n   *\n   * @param {EvmTransaction} tx - The transaction.\n   * @returns {Promise<TransactionResult>} The transaction's result.\n   */\n  async sendTransaction (tx) {\n    if (!this._account.provider) {\n      throw new Error('The wallet must be connected to a provider to send transactions.')\n    }\n\n    const { fee } = await this.quoteSendTransaction(tx)\n\n    const { hash } = await this._account.sendTransaction({\n      from: await this.getAddress(),\n      ...tx\n    })\n\n    return { hash, fee }\n  }\n\n  /**\n   * Transfers a token to another address.\n   *\n   * @param {TransferOptions} options - The transfer's options.\n   * @returns {Promise<TransferResult>} The transfer's result.\n   */\n  async transfer (options) {\n    if (!this._account.provider) {\n      throw new Error('The wallet must be connected to a provider to transfer tokens.')\n    }\n\n    const tx = await WalletAccountEvm._getTransferTransaction(options)\n\n    const { fee } = await this.quoteSendTransaction(tx)\n\n    if (this._config.transferMaxFee !== undefined && fee >= this._config.transferMaxFee) {\n      throw new Error('Exceeded maximum fee cost for transfer operation.')\n    }\n\n    const { hash } = await this._account.sendTransaction(tx)\n\n    return { hash, fee }\n  }\n\n  /**\n   * Approves a specific amount of tokens to a spender.\n   *\n   * @param {ApproveOptions} options The approve options.\n   * @returns {Promise<TransactionResult>} The transaction’s result.\n   * @throws {Error} If trying to approve usdts on ethereum with allowance not equal to zero (due to the usdt allowance reset requirement).\n   */\n  async approve (options) {\n    if (!this._account.provider) {\n      throw new Error('The wallet must be connected to a provider to approve funds.')\n    }\n\n    const { token, spender, amount } = options\n    const { chainId } = await this._provider.getNetwork()\n\n    if (chainId === 1n && token.toLowerCase() === USDT_MAINNET_ADDRESS.toLowerCase()) {\n      const currentAllowance = await this.getAllowance(token, spender)\n      if (currentAllowance > 0n && BigInt(amount) > 0n) {\n        throw new Error(\n          'USDT requires the current allowance to be reset to 0 before setting a new non-zero value. Please send an \"approve\" transaction with an amount of 0 first.'\n        )\n      }\n    }\n\n    const abi = ['function approve(address spender, uint256 amount) returns (bool)']\n    const contract = new Contract(token, abi, this._provider)\n\n    const tx = {\n      to: token,\n      value: 0,\n      data: contract.interface.encodeFunctionData('approve', [spender, amount])\n    }\n\n    return await this.sendTransaction(tx)\n  }\n\n  /**\n   * Returns a read-only copy of the account.\n   *\n   * @returns {Promise<WalletAccountReadOnlyEvm>} The read-only account.\n   */\n  async toReadOnlyAccount () {\n    const readOnlyAccount = new WalletAccountReadOnlyEvm(this._account.address, this._config)\n\n    return readOnlyAccount\n  }\n\n  /**\n   * Disposes the wallet account, erasing the private key from the memory.\n   */\n  dispose () {\n    this._account.dispose()\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nimport { WalletAccountReadOnly } from '@tetherto/wdk-wallet'\n\nimport { BrowserProvider, Contract, JsonRpcProvider } from 'ethers'\n\n/** @typedef {import('ethers').Provider} Provider */\n/** @typedef {import('ethers').Eip1193Provider} Eip1193Provider */\n/** @typedef {import('ethers').TransactionReceipt} EvmTransactionReceipt */\n\n/** @typedef {import('@tetherto/wdk-wallet').TransactionResult} TransactionResult */\n/** @typedef {import('@tetherto/wdk-wallet').TransferOptions} TransferOptions */\n/** @typedef {import('@tetherto/wdk-wallet').TransferResult} TransferResult */\n\n/**\n * @typedef {Object} EvmTransaction\n * @property {string} to - The transaction's recipient.\n * @property {number | bigint} value - The amount of ethers to send to the recipient (in weis).\n * @property {string} [data] - The transaction's data in hex format.\n * @property {number | bigint} [gasLimit] - The maximum amount of gas this transaction is permitted to use.\n * @property {number | bigint} [gasPrice] - The price (in wei) per unit of gas this transaction will pay.\n * @property {number | bigint} [maxFeePerGas] - The maximum price (in wei) per unit of gas this transaction will pay for the combined [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) block's base fee and this transaction's priority fee.\n * @property {number | bigint} [maxPriorityFeePerGas] - The price (in wei) per unit of gas this transaction will allow in addition to the [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) block's base fee to bribe miners into giving this transaction priority. This is included in the maxFeePerGas, so this will not affect the total maximum cost set with maxFeePerGas.\n */\n\n/**\n * @typedef {Object} EvmWalletConfig\n * @property {string | Eip1193Provider} [provider] - The url of the rpc provider, or an instance of a class that implements eip-1193.\n * @property {number | bigint} [transferMaxFee] - The maximum fee amount for transfer operations.\n */\n\nexport default class WalletAccountReadOnlyEvm extends WalletAccountReadOnly {\n  /**\n   * Creates a new evm read-only wallet account.\n   *\n   * @param {string} address - The account's address.\n   * @param {Omit<EvmWalletConfig, 'transferMaxFee'>} [config] - The configuration object.\n   */\n  constructor (address, config = { }) {\n    super(address)\n\n    /**\n     * The read-only wallet account configuration.\n     *\n     * @protected\n     * @type {Omit<EvmWalletConfig, 'transferMaxFee'>}\n     */\n    this._config = config\n\n    const { provider } = config\n\n    if (provider) {\n      /**\n       * An ethers provider to interact with a node of the blockchain.\n       *\n       * @protected\n       * @type {Provider | undefined}\n       */\n      this._provider = typeof provider === 'string'\n        ? new JsonRpcProvider(provider)\n        : new BrowserProvider(provider)\n    }\n  }\n\n  /**\n   * Returns the account's eth balance.\n   *\n   * @returns {Promise<bigint>} The eth balance (in weis).\n   */\n  async getBalance () {\n    if (!this._provider) {\n      throw new Error('The wallet must be connected to a provider to retrieve balances.')\n    }\n\n    const address = await this.getAddress()\n\n    const balance = await this._provider.getBalance(address)\n\n    return balance\n  }\n\n  /**\n   * Returns the account balance for a specific token.\n   *\n   * @param {string} tokenAddress - The smart contract address of the token.\n   * @returns {Promise<bigint>} The token balance (in base unit).\n   */\n  async getTokenBalance (tokenAddress) {\n    if (!this._provider) {\n      throw new Error('The wallet must be connected to a provider to retrieve token balances.')\n    }\n\n    const address = await this.getAddress()\n\n    const abi = ['function balanceOf(address owner) view returns (uint256)']\n    const contract = new Contract(tokenAddress, abi, this._provider)\n    const balance = await contract.balanceOf(address)\n\n    return balance\n  }\n\n  /**\n   * Quotes the costs of a send transaction operation.\n   *\n   * @param {EvmTransaction} tx - The transaction.\n   * @returns {Promise<Omit<TransactionResult, 'hash'>>} The transaction's quotes.\n   */\n  async quoteSendTransaction (tx) {\n    if (!this._provider) {\n      throw new Error('The wallet must be connected to a provider to quote send transaction operations.')\n    }\n\n    const gas = await this._provider.estimateGas({\n      from: await this.getAddress(),\n      ...tx\n    })\n\n    const { maxFeePerGas } = await this._provider.getFeeData()\n\n    return { fee: gas * maxFeePerGas }\n  }\n\n  /**\n   * Quotes the costs of a transfer operation.\n   *\n   * @param {TransferOptions} options - The transfer's options.\n   * @returns {Promise<Omit<TransferResult, 'hash'>>} The transfer's quotes.\n   */\n  async quoteTransfer (options) {\n    if (!this._provider) {\n      throw new Error('The wallet must be connected to a provider to quote transfer operations.')\n    }\n\n    const tx = await WalletAccountReadOnlyEvm._getTransferTransaction(options)\n\n    const result = await this.quoteSendTransaction(tx)\n\n    return result\n  }\n\n  /**\n   * Returns a transaction's receipt.\n   *\n   * @param {string} hash - The transaction's hash.\n   * @returns {Promise<EvmTransactionReceipt | null>} – The receipt, or null if the transaction has not been included in a block yet.\n   */\n  async getTransactionReceipt (hash) {\n    if (!this._provider) {\n      throw new Error('The wallet must be connected to a provider to fetch transaction receipts.')\n    }\n\n    return await this._provider.getTransactionReceipt(hash)\n  }\n\n  /**\n   * Returns the current allowance for the given token and spender.\n   * @param {string} token The token’s address.\n   * @param {string} spender The spender’s address.\n   * @returns {Promise<bigint>} The allowance.\n   */\n  async getAllowance (token, spender) {\n    if (!this._provider) {\n      throw new Error('The wallet must be connected to a provider to retrieve allowances.')\n    }\n\n    const address = await this.getAddress()\n    const abi = ['function allowance(address owner, address spender) view returns (uint256)']\n    const contract = new Contract(token, abi, this._provider)\n    const allowance = await contract.allowance(address, spender)\n    return allowance\n  }\n\n  /**\n   * Returns an evm transaction to execute the given token transfer.\n   *\n   * @protected\n   * @param {TransferOptions} options - The transfer's options.\n   * @returns {Promise<EvmTransaction>} The evm transaction.\n   */\n  static async _getTransferTransaction (options) {\n    const { token, recipient, amount } = options\n\n    const abi = ['function transfer(address to, uint256 amount) returns (bool)']\n\n    const contract = new Contract(token, abi)\n\n    const tx = {\n      to: token,\n      value: 0,\n      data: contract.interface.encodeFunctionData('transfer', [recipient, amount])\n    }\n\n    return tx\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nimport WalletManager from '@tetherto/wdk-wallet'\n\nimport { BrowserProvider, JsonRpcProvider } from 'ethers'\n\nimport WalletAccountEvm from './wallet-account-evm.js'\n\n/** @typedef {import('ethers').Provider} Provider */\n\n/** @typedef {import(\"@tetherto/wdk-wallet\").FeeRates} FeeRates */\n\n/** @typedef {import('./wallet-account-evm.js').EvmWalletConfig} EvmWalletConfig */\n\nexport default class WalletManagerEvm extends WalletManager {\n  /**\n   * Multiplier for normal fee rate calculations (in %).\n   *\n   * @protected\n   * @type {bigint}\n   */\n  static _FEE_RATE_NORMAL_MULTIPLIER = 110n\n\n  /**\n   * Multiplier for fast fee rate calculations (in %).\n   *\n   * @protected\n   * @type {bigint}\n   */\n  static _FEE_RATE_FAST_MULTIPLIER = 200n\n\n  /**\n   * Creates a new wallet manager for evm blockchains.\n   *\n   * @param {string | Uint8Array} seed - The wallet's [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) seed phrase.\n   * @param {EvmWalletConfig} [config] - The configuration object.\n   */\n  constructor (seed, config = {}) {\n    super(seed, config)\n\n    /**\n     * The evm wallet configuration.\n     *\n     * @protected\n     * @type {EvmWalletConfig}\n     */\n    this._config = config\n\n    const { provider } = config\n\n    if (provider) {\n      /**\n       * An ethers provider to interact with a node of the blockchain.\n       *\n       * @protected\n       * @type {Provider | undefined}\n       */\n      this._provider = typeof provider === 'string'\n        ? new JsonRpcProvider(provider)\n        : new BrowserProvider(provider)\n    }\n  }\n\n  /**\n   * Returns the wallet account at a specific index (see [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)).\n   *\n   * @example\n   * // Returns the account with derivation path m/44'/60'/0'/0/1\n   * const account = await wallet.getAccount(1);\n   * @param {number} [index] - The index of the account to get (default: 0).\n   * @returns {Promise<WalletAccountEvm>} The account.\n   */\n  async getAccount (index = 0) {\n    return await this.getAccountByPath(`0'/0/${index}`)\n  }\n\n  /**\n   * Returns the wallet account at a specific BIP-44 derivation path.\n   *\n   * @example\n   * // Returns the account with derivation path m/44'/60'/0'/0/1\n   * const account = await wallet.getAccountByPath(\"0'/0/1\");\n   * @param {string} path - The derivation path (e.g. \"0'/0/0\").\n   * @returns {Promise<WalletAccountEvm>} The account.\n   */\n  async getAccountByPath (path) {\n    if (!this._accounts[path]) {\n      const account = new WalletAccountEvm(this.seed, path, this._config)\n\n      this._accounts[path] = account\n    }\n\n    return this._accounts[path]\n  }\n\n  /**\n   * Returns the current fee rates.\n   *\n   * @returns {Promise<FeeRates>} The fee rates (in weis).\n   */\n  async getFeeRates () {\n    if (!this._provider) {\n      throw new Error('The wallet must be connected to a provider to get fee rates.')\n    }\n\n    const { maxFeePerGas } = await this._provider.getFeeData()\n\n    return {\n      normal: maxFeePerGas * WalletManagerEvm._FEE_RATE_NORMAL_MULTIPLIER / 100n,\n      fast: maxFeePerGas * WalletManagerEvm._FEE_RATE_FAST_MULTIPLIER / 100n\n    }\n  }\n}\n// ⚠️  PATCHED FOR BARE v1.24.3 COMPATIBILITY\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport 'bare-node-runtime/global'\n\nexport * from './index.js'\n\nexport { default } from './index.js'\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\n/** @typedef {import('./src/wallet-manager.js').FeeRates} FeeRates */\n/** @typedef {import('./src/wallet-manager.js').WalletConfig} WalletConfig */\n\n/** @typedef {import('./src/wallet-account-read-only.js').Transaction} Transaction */\n/** @typedef {import('./src/wallet-account-read-only.js').TransactionResult} TransactionResult */\n/** @typedef {import('./src/wallet-account-read-only.js').TransferOptions} TransferOptions */\n/** @typedef {import('./src/wallet-account-read-only.js').TransferResult} TransferResult */\n\n/** @typedef {import('./src/wallet-account.js').KeyPair} KeyPair */\n\nexport { default } from './src/wallet-manager.js'\n\nexport { default as WalletAccountReadOnly, IWalletAccountReadOnly } from './src/wallet-account-read-only.js'\n\nexport { IWalletAccount } from './src/wallet-account.js'\n\nexport { NotImplementedError } from './src/errors.js'\n{\n  \"name\": \"@tetherto/wdk-wallet\",\n  \"version\": \"1.0.0-beta.6\",\n  \"description\": \"A simple package to manage BIP-32 wallets.\",\n  \"keywords\": [\"wdk\", \"wallet\", \"bip-32\"],\n  \"author\": \"Tether\",\n  \"license\": \"Apache-2.0\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/tetherto/wdk-wallet.git\"\n  },\n  \"main\": \"index.js\",\n  \"type\": \"module\",\n  \"types\": \"./types\",\n  \"scripts\": {\n    \"build:types\": \"tsc\",\n    \"lint\": \"standard\",\n    \"lint:fix\": \"standard --fix\",\n    \"test\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest\",\n    \"test:coverage\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage\"\n  },\n  \"dependencies\": {\n    \"bare-node-runtime\": \"^1.1.4\",\n    \"bip39\": \"3.1.0\"\n  },\n  \"devDependencies\": {\n    \"cross-env\": \"7.0.3\",\n    \"jest\": \"29.7.0\",\n    \"standard\": \"17.1.2\",\n    \"typescript\": \"5.8.3\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./types/index.d.ts\",\n      \"bare\": \"./bare.js\",\n      \"default\": \"./index.js\"\n    },\n    \"./protocols\": {\n      \"types\": \"./types/src/protocols/index.d.ts\",\n      \"default\": \"./src/protocols/index.js\"\n    },\n    \"./package\": {\n      \"default\": \"./package.json\"\n    }\n  },\n  \"publishConfig\": {\n    \"access\": \"public\",\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"standard\": {\n    \"ignore\": [\n      \"bare.js\",\n      \"tests/**/*.js\"\n    ]\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nexport class NotImplementedError extends Error {\n  /**\n   * Create a new not implemented error.\n   *\n   * @param {string} methodName - The method's name.\n   */\n  constructor (methodName) {\n    super(`Method '${methodName}' must be implemented.`)\n\n    this.name = 'NotImplementedError'\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport { NotImplementedError } from '../errors.js'\n\n/** @typedef {import('../wallet-account-read-only.js').IWalletAccountReadOnly} IWalletAccountReadOnly */\n\n/** @typedef {import('../wallet-account.js').IWalletAccount} IWalletAccount */\n\n/**\n * @typedef {Object} BridgeProtocolConfig\n * @property {number | bigint} [bridgeMaxFee] - The maximum fee amount for bridge operations.\n */\n\n/**\n * @typedef {Object} BridgeOptions\n * @property {string} targetChain - The identifier of the destination blockchain (e.g., \"arbitrum\").\n * @property {string} recipient - The address of the recipient.\n * @property {string} token - The address of the token to bridge.\n * @property {number | bigint} amount - The amount of tokenss to bridge to the destination chain (in base unit).\n */\n\n/**\n * @typedef {Object} BridgeResult\n * @property {string} hash - The hash of the bridge operation.\n * @property {bigint} fee - The gas cost.\n * @property {bigint} bridgeFee - The amount of native tokens paid to the bridge protocol.\n */\n\n/** @interface */\nexport class IBridgeProtocol {\n  /**\n   * Bridges a token to a different blockchain.\n   *\n   * @param {BridgeOptions} options - The bridge's options.\n   * @returns {Promise<BridgeResult>} The bridge's result.\n   */\n  async bridge (options) {\n    throw new NotImplementedError('bridge(options)')\n  }\n\n  /**\n   * Quotes the costs of a bridge operation.\n   *\n   * @param {BridgeOptions} options - The bridge's options.\n   * @returns {Promise<Omit<BridgeResult, 'hash'>>} The bridge's quotes.\n   */\n  async quoteBridge (options) {\n    throw new NotImplementedError('quoteBridge(options)')\n  }\n}\n\n/**\n * @abstract\n * @implements {IBridgeProtocol}\n */\nexport default class BridgeProtocol {\n  /**\n   * Creates a new read-only bridge protocol.\n   *\n   * @overload\n   * @param {IWalletAccountReadOnly} account - The wallet account to use to interact with the protocol.\n   * @param {BridgeProtocolConfig} [config] - The bridge protocol configuration.\n   */\n\n  /**\n   * Creates a new bridge protocol.\n   *\n   * @overload\n   * @param {IWalletAccount} account - The wallet account to use to interact with the protocol.\n   * @param {BridgeProtocolConfig} [config] - The bridge protocol configuration.\n   */\n  constructor (account, config = {}) {\n    /**\n     * The wallet account to use to interact with the protocol.\n     *\n     * @protected\n     * @type {IWalletAccountReadOnly | IWalletAccount}\n     */\n    this._account = account\n\n    /**\n     * The bridge protocol configuration.\n     *\n     * @protected\n     * @type {BridgeProtocolConfig}\n     */\n    this._config = config\n  }\n\n  /**\n   * Bridges a token to a different blockchain.\n   *\n   * @abstract\n   * @param {BridgeOptions} options - The bridge's options.\n   * @returns {Promise<BridgeResult>} The bridge's result.\n   */\n  async bridge (options) {\n    throw new NotImplementedError('bridge(options)')\n  }\n\n  /**\n   * Quotes the costs of a bridge operation.\n   *\n   * @abstract\n   * @param {BridgeOptions} options - The bridge's options.\n   * @returns {Promise<Omit<BridgeResult, 'hash'>>} The bridge's quotes.\n   */\n  async quoteBridge (options) {\n    throw new NotImplementedError('quoteBridge(options)')\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport { NotImplementedError } from '../errors.js'\n\n/** @typedef {import('../wallet-account-read-only.js').IWalletAccountReadOnly} IWalletAccountReadOnly */\n\n/** @typedef {import('../wallet-account.js').IWalletAccount} IWalletAccount */\n\n/**\n * Standardized status for an on/off-ramp transaction.\n * @typedef {'in_progress' | 'failed' | 'completed'} FiatTransactionStatus\n */\n\n/**\n * A protocol-agnostic, standardized object representing the details of an on/off-ramp transaction.\n * @typedef {Object} FiatTransactionDetail\n * @property {FiatTransactionStatus} status - The current status of the transaction.\n * @property {string} cryptoAsset - The provider-specific code of the crypto asset (e.g., 'btc').\n * @property {string} fiatCurrency - The currency's ISO 4217 code (e.g., 'USD').\n */\n\n/**\n * A protocol-agnostic, standardized object representing a supported crypto asset.\n * @typedef {Object} SupportedCryptoAsset\n * @property {string} code - Provider-specific asset code for the crypto asset.\n * @property {string} networkCode - The network code for the asset, if applicable (e.g., 'ethereum', 'tron').\n * @property {number} decimals - The on-chain number of decimal places for the asset's base unit (e.g., 18 for ETH).\n * @property {string} [name] - The asset's full name (e.g., 'Bitcoin').\n */\n\n/**\n * A protocol-agnostic, standardized object representing a supported fiat currency.\n * @typedef {Object} SupportedFiatCurrency\n * @property {string} code - The currency's ISO 4217 code (e.g., 'USD').\n * @property {number} decimals - The number of decimal places for the currency's smallest unit (e.g., 2 for USD, 0 for JPY).\n * @property {string} [name] - The currency's full name (e.g., 'United States Dollar').\n */\n\n/**\n * A protocol-agnostic, standardized object representing a supported country.\n * @typedef {Object} SupportedCountry\n * @property {string} code - The country's ISO 3166-1 alpha-2 or alpha-3 code.\n * @property {boolean} isBuyAllowed - Whether buying is supported in this country.\n * @property {boolean} isSellAllowed - Whether selling is supported in this country.\n * @property {string} [name] - The country's common name.\n */\n\n/**\n * @typedef {BuyCommonOptions & (BuyExactCryptoAmountOptions | BuyWithFiatAmountOptions)} BuyOptions\n */\n\n/**\n * @typedef {Object} BuyCommonOptions\n * @property {string} cryptoAsset - The provider-specific code of the crypto asset to purchase.\n * @property {string} fiatCurrency - The currency's ISO 4217 code (e.g., 'USD').\n * @property {string} [recipient] - The wallet address to receive the purchased crypto asset. Defaults to the account's address.\n */\n\n/**\n * @typedef {Object} BuyExactCryptoAmountOptions\n * @property {number | bigint} cryptoAmount - The amount of crypto asset to buy, in its base unit (e.g., wei for ETH).\n * @property {never} [fiatAmount] - The amount of fiat currency to spend, in its smallest unit (e.g., cents for USD).\n */\n\n/**\n * @typedef {Object} BuyWithFiatAmountOptions\n * @property {number | bigint} fiatAmount - The amount of fiat currency to spend, in its smallest unit (e.g., cents for USD).\n * @property {never} [cryptoAmount] - The amount of crypto asset to buy, in its base unit (e.g., wei for ETH).\n */\n\n/**\n * @typedef {Object} BuyResult\n * @property {string} buyUrl - The URL for the user to complete the purchase.\n */\n\n/**\n * @typedef {SellCommonOptions & (SellExactCryptoAmountOptions | SellForFiatAmountOptions)} SellOptions\n */\n\n/**\n * @typedef {Object} SellCommonOptions\n * @property {string} cryptoAsset - The provider-specific code of the crypto asset to sell.\n * @property {string} fiatCurrency - The currency's ISO 4217 code (e.g., 'USD').\n * @property {string} [refundAddress] - The wallet address to receive refunds in case of failure. Defaults to the account's address.\n */\n\n/**\n * @typedef {Object} SellExactCryptoAmountOptions\n * @property {number | bigint} cryptoAmount - The amount of crypto asset to sell, in its base unit (e.g., wei for ETH).\n * @property {never} [fiatAmount] - The amount of fiat currency to receive, in its smallest unit (e.g., cents for USD).\n */\n\n/**\n * @typedef {Object} SellForFiatAmountOptions\n * @property {number | bigint} fiatAmount - The amount of fiat currency to receive, in its smallest unit (e.g., cents for USD).\n * @property {never} [cryptoAmount] - The amount of crypto asset to sell, in its base unit (e.g., wei for ETH).\n */\n\n/**\n * @typedef {Object} SellResult\n * @property {string} sellUrl - The URL for the user to complete the sale.\n */\n\n/**\n * A protocol-agnostic, standardized object representing a quote for an on/off-ramp transaction.\n * @typedef {Object} FiatQuote\n * @property {bigint} cryptoAmount - The amount of the crypto asset, in its base unit (e.g., wei).\n * @property {bigint} fiatAmount - The amount of the fiat currency, in its smallest unit (e.g., cents).\n * @property {bigint} fee - The fee charged for the transaction, denominated in the smallest unit of the fiat currency.\n * @property {string} rate - The effective exchange rate, expressed as a string to avoid precision loss (e.g., a rate of \"3000.50\" for ETH/USD means 1 ETH = 3000.50 USD). Note: This rate applies to the standard units (e.g., ETH and USD).\n */\n\n/**\n * @interface\n */\nexport class IFiatProtocol {\n  /**\n   * Gets a quote for a crypto asset purchase.\n   * @param {Omit<BuyOptions, 'recipient'>} options - The options for the buy operation.\n   * @returns {Promise<FiatQuote>} A quote for the transaction.\n   */\n  async quoteBuy (options) {\n    throw new NotImplementedError('quoteBuy(options)')\n  }\n\n  /**\n   * Generates a widget URL for a user to purchase a crypto asset with fiat currency.\n   * @param {BuyOptions} options - The options for the buy operation.\n   * @returns {Promise<BuyResult>} The operation's result.\n   */\n  async buy (options) {\n    throw new NotImplementedError('buy(options)')\n  }\n\n  /**\n   * Gets a quote for a crypto asset sale.\n   * @param {Omit<SellOptions, 'refundAddress'>} options - The options for the sell operation.\n   * @returns {Promise<FiatQuote>} A quote for the transaction.\n   */\n  async quoteSell (options) {\n    throw new NotImplementedError('quoteSell(options)')\n  }\n\n  /**\n   * Generates a widget URL for a user to sell a crypto asset for fiat currency.\n   * @param {SellOptions} options - The options for the sell operation.\n   * @returns {Promise<SellResult>} The operation's result.\n   */\n  async sell (options) {\n    throw new NotImplementedError('sell(options)')\n  }\n\n  /**\n   * Retrieves the details of a specific transaction from the provider.\n   * @param {string} txId - The unique identifier of the transaction.\n   * @returns {Promise<FiatTransactionDetail>} The transaction details.\n   */\n  async getTransactionDetail (txId) {\n    throw new NotImplementedError('getTransactionDetail(txId)')\n  }\n\n  /**\n   * Retrieves a list of supported crypto assets from the provider.\n   * @returns {Promise<SupportedCryptoAsset[]>} An array of supported crypto assets.\n   */\n  async getSupportedCryptoAssets () {\n    throw new NotImplementedError('getSupportedCryptoAssets()')\n  }\n\n  /**\n   * Retrieves a list of supported fiat currencies from the provider.\n   * @returns {Promise<SupportedFiatCurrency[]>} An array of supported fiat currencies.\n   */\n  async getSupportedFiatCurrencies () {\n    throw new NotImplementedError('getSupportedFiatCurrencies()')\n  }\n\n  /**\n   * Retrieves a list of supported countries from the provider.\n   * @returns {Promise<SupportedCountry[]>} An array of supported countries.\n   */\n  async getSupportedCountries () {\n    throw new NotImplementedError('getSupportedCountries()')\n  }\n}\n\n/**\n * @abstract\n * @implements {IFiatProtocol}\n */\nexport default class FiatProtocol {\n  /**\n   * Creates a new interface to the protocol without binding it to a wallet account.\n   *\n   * @overload\n   * @param {undefined} [account] - The wallet account to use to interact with the protocol.\n   */\n  /**\n   * Creates a new read-only interface to the protocol.\n   *\n   * @overload\n   * @param {IWalletAccountReadOnly} account - The wallet account to use to interact with the protocol.\n   */\n  /**\n   * Creates a new interface to the protocol.\n   *\n   * @overload\n   * @param {IWalletAccount} account - The wallet account to use to interact with the protocol.\n   */\n  constructor (account) {\n    /**\n     * The wallet account to use to interact with the protocol.\n     *\n     * @protected\n     * @type {IWalletAccountReadOnly | IWalletAccount | undefined}\n     */\n    this._account = account\n  }\n\n  /**\n   * Gets a quote for a crypto asset purchase.\n   * @param {Omit<BuyOptions, 'recipient'>} options - The options for the buy operation.\n   * @returns {Promise<FiatQuote>} A quote for the transaction.\n   */\n  async quoteBuy (options) {\n    throw new NotImplementedError('quoteBuy(options)')\n  }\n\n  /**\n   * Generates a URL for a user to purchase a crypto asset with fiat currency.\n   * @param {BuyOptions} options - The options for the buy operation.\n   * @returns {Promise<BuyResult>} The URL for the user to complete the purchase.\n   */\n  async buy (options) {\n    throw new NotImplementedError('buy(options)')\n  }\n\n  /**\n   * Gets a quote for a crypto asset sale.\n   * @param {Omit<SellOptions, 'refundAddress'>} options - The options for the sell operation.\n   * @returns {Promise<FiatQuote>} A quote for the transaction.\n   */\n  async quoteSell (options) {\n    throw new NotImplementedError('quoteSell(options)')\n  }\n\n  /**\n   * Generates a URL for a user to sell a crypto asset for fiat currency.\n   * @param {SellOptions} options - The options for the sell operation.\n   * @returns {Promise<SellResult>} The URL for the user to complete the sale.\n   */\n  async sell (options) {\n    throw new NotImplementedError('sell(options)')\n  }\n\n  /**\n   * Retrieves the details of a specific transaction from the provider.\n   * @param {string} txId - The unique identifier of the transaction.\n   * @returns {Promise<FiatTransactionDetail>} The transaction details.\n   */\n  async getTransactionDetail (txId) {\n    throw new NotImplementedError('getTransactionDetail(txId)')\n  }\n\n  /**\n   * Retrieves a list of supported crypto assets from the provider.\n   * @returns {Promise<SupportedCryptoAsset[]>} An array of supported crypto assets.\n   */\n  async getSupportedCryptoAssets () {\n    throw new NotImplementedError('getSupportedCryptoAssets()')\n  }\n\n  /**\n   * Retrieves a list of supported fiat currencies from the provider.\n   * @returns {Promise<SupportedFiatCurrency[]>} An array of supported fiat currencies.\n   */\n  async getSupportedFiatCurrencies () {\n    throw new NotImplementedError('getSupportedFiatCurrencies()')\n  }\n\n  /**\n   * Retrieves a list of supported countries or regions from the provider.\n   * @returns {Promise<SupportedCountry[]>} An array of supported countries.\n   */\n  async getSupportedCountries () {\n    throw new NotImplementedError('getSupportedCountries()')\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\n/** @typedef {import('./swap-protocol.js').SwapProtocolConfig} SwapProtocolConfig */\n/** @typedef {import('./swap-protocol.js').SwapOptions} SwapOptions */\n/** @typedef {import('./swap-protocol.js').SwapResult} SwapResult */\n\n/** @typedef {import('./bridge-protocol.js').BridgeProtocolConfig} BridgeProtocolConfig */\n/** @typedef {import('./bridge-protocol.js').BridgeOptions} BridgeOptions */\n/** @typedef {import('./bridge-protocol.js').BridgeResult} BridgeResult */\n\n/** @typedef {import('./lending-protocol.js').SupplyOptions} SupplyOptions */\n/** @typedef {import('./lending-protocol.js').SupplyResult} SupplyResult */\n/** @typedef {import('./lending-protocol.js').WithdrawOptions} WithdrawOptions */\n/** @typedef {import('./lending-protocol.js').WithdrawResult} WithdrawResult */\n/** @typedef {import('./lending-protocol.js').BorrowOptions} BorrowOptions */\n/** @typedef {import('./lending-protocol.js').BorrowResult} BorrowResult */\n/** @typedef {import('./lending-protocol.js').RepayOptions} RepayOptions */\n/** @typedef {import('./lending-protocol.js').RepayResult} RepayResult */\n\n/** @typedef {import('./fiat-protocol.js').BuyOptions} BuyOptions */\n/** @typedef {import('./fiat-protocol.js').BuyCommonOptions} BuyCommonOptions */\n/** @typedef {import('./fiat-protocol.js').BuyExactCryptoAmountOptions} BuyExactCryptoAmountOptions */\n/** @typedef {import('./fiat-protocol.js').BuyWithFiatAmountOptions} BuyWithFiatAmountOptions */\n/** @typedef {import('./fiat-protocol.js').BuyResult} BuyResult */\n\n/** @typedef {import('./fiat-protocol.js').SellOptions} SellOptions */\n/** @typedef {import('./fiat-protocol.js').SellCommonOptions} SellCommonOptions */\n/** @typedef {import('./fiat-protocol.js').SellExactCryptoAmountOptions} SellExactCryptoAmountOptions */\n/** @typedef {import('./fiat-protocol.js').SellForFiatAmountOptions} SellForFiatAmountOptions */\n/** @typedef {import('./fiat-protocol.js').SellResult} SellResult */\n\n/** @typedef {import('./fiat-protocol.js').FiatQuote} FiatQuote */\n\n/** @typedef {import('./fiat-protocol.js').FiatTransactionStatus} FiatTransactionStatus */\n/** @typedef {import('./fiat-protocol.js').FiatTransactionDetail} FiatTransactionDetail */\n\n/** @typedef {import('./fiat-protocol.js').SupportedCryptoAsset} SupportedCryptoAsset */\n/** @typedef {import('./fiat-protocol.js').SupportedFiatCurrency} SupportedFiatCurrency */\n/** @typedef {import('./fiat-protocol.js').SupportedCountry} SupportedCountry */\n\nexport { default as SwapProtocol, ISwapProtocol } from './swap-protocol.js'\n\nexport { default as BridgeProtocol, IBridgeProtocol } from './bridge-protocol.js'\n\nexport { default as LendingProtocol, ILendingProtocol } from './lending-protocol.js'\n\nexport { default as FiatProtocol, IFiatProtocol } from './fiat-protocol.js'\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport { NotImplementedError } from '../errors.js'\n\n/** @typedef {import('../wallet-account-read-only.js').IWalletAccountReadOnly} IWalletAccountReadOnly */\n\n/** @typedef {import('../wallet-account.js').IWalletAccount} IWalletAccount */\n\n/**\n * @typedef {Object} SupplyOptions\n * @property {string} token - The address of the token to supply.\n * @property {number | bigint} amount - The amount of tokens to supply (in base unit).\n * @property {string} [onBehalfOf] - The address on behalf of which the supply operation should be performed. If not set, the supply operation will be performed on behalf of the account itself.\n */\n\n/**\n * @typedef {Object} SupplyResult\n * @property {string} hash - The hash of the supply operation.\n * @property {bigint} fee - The gas cost.\n */\n\n/**\n * @typedef {Object} WithdrawOptions\n * @property {string} token - The address of the token to withdraw.\n * @property {number | bigint} amount - The amount of tokens to withdraw (in base unit).\n * @property {string} [to] - The address that should receive the tokens. If not set, the account itself will receive the funds.\n */\n\n/**\n * @typedef {Object} WithdrawResult\n * @property {string} hash - The hash of the withdraw operation.\n * @property {bigint} fee - The gas cost.\n */\n\n/**\n * @typedef {Object} BorrowOptions\n * @property {string} token - The address of the token to borrow.\n * @property {number | bigint} amount - The amount of tokens to borrow (in base unit).\n * @property {string} [onBehalfOf] - The address on behalf of which the borrow operation should be performed. If not set, the borrow operation will be performed on behalf of the account itself.\n */\n\n/**\n * @typedef {Object} BorrowResult\n * @property {string} hash - The hash of the borrow operation.\n * @property {bigint} fee - The gas cost.\n */\n\n/**\n * @typedef {Object} RepayOptions\n * @property {string} token - The address of the token to repay.\n * @property {number | bigint} amount - The amount of tokens to repay (in base unit).\n * @property {string} [onBehalfOf] - The address on behalf of which the repay operation should be performed. If not set, the repay operation will be performed on behalf of the account itself.\n */\n\n/**\n * @typedef {Object} RepayResult\n * @property {string} hash - The hash of the repay operation.\n * @property {bigint} fee - The gas cost.\n */\n\n/** @interface */\nexport class ILendingProtocol {\n  /**\n   * Supplies a specific token amount to the lending pool.\n   *\n   * @param {SupplyOptions} options - The supply's options.\n   * @returns {Promise<SupplyResult>} The supply's result.\n   */\n  async supply (options) {\n    throw new NotImplementedError('supply(options)')\n  }\n\n  /**\n   * Quotes the costs of a supply operation.\n   *\n   * @param {SupplyOptions} options - The supply's options.\n   * @returns {Promise<Omit<SupplyResult, 'hash'>>} The supply's costs.\n   */\n  async quoteSupply (options) {\n    throw new NotImplementedError('quoteSupply(options)')\n  }\n\n  /**\n   * Withdraws a specific token amount from the pool.\n   *\n   * @param {WithdrawOptions} options - The withdraw's options.\n   * @returns {Promise<WithdrawResult>} The withdraw's result.\n   */\n  async withdraw (options) {\n    throw new NotImplementedError('withdraw(options)')\n  }\n\n  /**\n   * Quotes the costs of a withdraw operation.\n   *\n   * @param {WithdrawOptions} options - The withdraw's options.\n   * @returns {Promise<Omit<WithdrawResult, 'hash'>>} The withdraw's costs.\n   */\n  async quoteWithdraw (options) {\n    throw new NotImplementedError('quoteWithdraw(options)')\n  }\n\n  /**\n   * Borrows a specific token amount.\n   *\n   * @param {BorrowOptions} options - The borrow's options.\n   * @returns {Promise<BorrowResult>} The borrow's result.\n   */\n  async borrow (options) {\n    throw new NotImplementedError('borrow(options)')\n  }\n\n  /**\n   * Quotes the costs of a borrow operation.\n   *\n   * @param {BorrowOptions} options - The borrow's options.\n   * @returns {Promise<Omit<BorrowResult, 'hash'>>} The borrow's costs.\n   */\n  async quoteBorrow (options) {\n    throw new NotImplementedError('quoteBorrow(options)')\n  }\n\n  /**\n   * Repays a specific token amount.\n   *\n   * @param {RepayOptions} options - The borrow's options.\n   * @returns {Promise<RepayResult>} The repay's result.\n   */\n  async repay (options) {\n    throw new NotImplementedError('repay(options)')\n  }\n\n  /**\n   * Quotes the costs of a repay operation.\n   *\n   * @param {RepayOptions} options - The repay's options.\n   * @returns {Promise<Omit<RepayResult, 'hash'>>} The repay's costs.\n   */\n  async quoteRepay (options) {\n    throw new NotImplementedError('quoteRepay(options)')\n  }\n}\n\n/**\n * @abstract\n * @implements {ILendingProtocol}\n */\nexport default class LendingProtocol {\n  /**\n   * Creates a new read-only lending protocol.\n   *\n   * @overload\n   * @param {IWalletAccountReadOnly} account - The wallet account to use to interact with the protocol.\n   */\n\n  /**\n   * Creates a new lending protocol.\n   *\n   * @overload\n   * @param {IWalletAccount} account - The wallet account to use to interact with the protocol.\n   */\n  constructor (account) {\n    /**\n     * The wallet account to use to interact with the protocol.\n     *\n     * @protected\n     * @type {IWalletAccountReadOnly | IWalletAccount}\n     */\n    this._account = account\n  }\n\n  /**\n   * Supplies a specific token amount to the lending pool.\n   *\n   * @abstract\n   * @param {SupplyOptions} options - The supply's options.\n   * @returns {Promise<SupplyResult>} The supply's result.\n   */\n  async supply (options) {\n    throw new NotImplementedError('supply(options)')\n  }\n\n  /**\n   * Quotes the costs of a supply operation.\n   *\n   * @abstract\n   * @param {SupplyOptions} options - The supply's options.\n   * @returns {Promise<Omit<SupplyResult, 'hash'>>} The supply's costs.\n   */\n  async quoteSupply (options) {\n    throw new NotImplementedError('quoteSupply(options)')\n  }\n\n  /**\n   * Withdraws a specific token amount from the pool.\n   *\n   * @abstract\n   * @param {WithdrawOptions} options - The withdraw's options.\n   * @returns {Promise<WithdrawResult>} The withdraw's result.\n   */\n  async withdraw (options) {\n    throw new NotImplementedError('withdraw(options)')\n  }\n\n  /**\n   * Quotes the costs of a withdraw operation.\n   *\n   * @abstract\n   * @param {WithdrawOptions} options - The withdraw's options.\n   * @returns {Promise<Omit<WithdrawResult, 'hash'>>} The withdraw's costs.\n   */\n  async quoteWithdraw (options) {\n    throw new NotImplementedError('quoteWithdraw(options)')\n  }\n\n  /**\n   * Borrows a specific token amount.\n   *\n   * @abstract\n   * @param {BorrowOptions} options - The borrow's options.\n   * @returns {Promise<BorrowResult>} The borrow's result.\n   */\n  async borrow (options) {\n    throw new NotImplementedError('borrow(options)')\n  }\n\n  /**\n   * Quotes the costs of a borrow operation.\n   *\n   * @abstract\n   * @param {BorrowOptions} options - The borrow's options.\n   * @returns {Promise<Omit<BorrowResult, 'hash'>>} The borrow's costs.\n   */\n  async quoteBorrow (options) {\n    throw new NotImplementedError('quoteBorrow(options)')\n  }\n\n  /**\n   * Repays a specific token amount.\n   *\n   * @abstract\n   * @param {RepayOptions} options - The borrow's options.\n   * @returns {Promise<RepayResult>} The repay's result.\n   */\n  async repay (options) {\n    throw new NotImplementedError('repay(options)')\n  }\n\n  /**\n   * Quotes the costs of a repay operation.\n   *\n   * @abstract\n   * @param {RepayOptions} options - The repay's options.\n   * @returns {Promise<Omit<RepayResult, 'hash'>>} The repay's costs.\n   */\n  async quoteRepay (options) {\n    throw new NotImplementedError('quoteRepay(options)')\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport { NotImplementedError } from '../errors.js'\n\n/** @typedef {import('../wallet-account-read-only.js').IWalletAccountReadOnly} IWalletAccountReadOnly */\n\n/** @typedef {import('../wallet-account.js').IWalletAccount} IWalletAccount */\n\n/**\n * @typedef {Object} SwapProtocolConfig\n * @property {number | bigint} [swapMaxFee] - The maximum fee amount for swap operations.\n */\n\n/**\n * @typedef {SwapCommonOptions & (SwapBuyOptions | SwapSellOptions)} SwapOptions\n */\n\n/**\n * @typedef {Object} SwapCommonOptions\n * @property {string} tokenIn - The address of the token to sell.\n * @property {string} tokenOut - The address of the token to buy.\n * @property {string} [to] - The address that will receive the output tokens. If not set, the account itself will receive the funds.\n */\n\n/**\n * @typedef {Object} SwapBuyOptions\n * @property {never} [tokenInAmount] - The amount of input tokens to sell (in base unit).\n * @property {number | bigint} tokenOutAmount - The amount of output tokens to buy (in base unit).\n */\n\n/**\n * @typedef {Object} SwapSellOptions\n * @property {number | bigint} tokenInAmount - The amount of input tokens to sell (in base unit).\n * @property {never} [tokenOutAmount] - The amount of output tokens to buy (in base unit).\n */\n\n/**\n * @typedef {Object} SwapResult\n * @property {string} hash - The hash of the swap operation.\n * @property {bigint} fee - The gas cost.\n * @property {bigint} tokenInAmount - The amount of input tokens sold.\n * @property {bigint} tokenOutAmount - The amount of output tokens bought.\n */\n\n/** @interface */\nexport class ISwapProtocol {\n  /**\n   * Swaps a pair of tokens.\n   *\n   * @param {SwapOptions} options - The swap's options.\n   * @returns {Promise<SwapResult>} The swap's result.\n   */\n  async swap (options) {\n    throw new NotImplementedError('swap(options)')\n  }\n\n  /**\n   * Quotes the costs of a swap operation.\n   *\n   * @param {SwapOptions} options - The swap's options.\n   * @returns {Promise<Omit<SwapResult, 'hash'>>} The swap's quotes.\n   */\n  async quoteSwap (options) {\n    throw new NotImplementedError('quoteSwap(options)')\n  }\n}\n\n/**\n * @abstract\n * @implements {ISwapProtocol}\n */\nexport default class SwapProtocol {\n  /**\n   * Creates a new read-only swap protocol.\n   *\n   * @overload\n   * @param {IWalletAccountReadOnly} account - The wallet account to use to interact with the protocol.\n   * @param {SwapProtocolConfig} [config] - The swap protocol configuration.\n   */\n\n  /**\n   * Creates a new swap protocol.\n   *\n   * @overload\n   * @param {IWalletAccount} account - The wallet account to use to interact with the protocol.\n   * @param {SwapProtocolConfig} [config] - The swap protocol configuration.\n   */\n  constructor (account, config = {}) {\n    /**\n     * The wallet account to use to interact with the protocol.\n     *\n     * @protected\n     * @type {IWalletAccountReadOnly | IWalletAccount}\n     */\n    this._account = account\n\n    /**\n     * The swap protocol configuration.\n     *\n     * @protected\n     * @type {SwapProtocolConfig}\n     */\n    this._config = config\n  }\n\n  /**\n   * Swaps a pair of tokens.\n   *\n   * @abstract\n   * @param {SwapOptions} options - The swap's options.\n   * @returns {Promise<SwapResult>} The swap's result.\n   */\n  async swap (options) {\n    throw new NotImplementedError('swap(options)')\n  }\n\n  /**\n   * Quotes the costs of a swap operation.\n   *\n   * @abstract\n   * @param {SwapOptions} options - The swap's options.\n   * @returns {Promise<Omit<SwapResult, 'hash'>>} The swap's quotes.\n   */\n  async quoteSwap (options) {\n    throw new NotImplementedError('quoteSwap(options)')\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport { NotImplementedError } from './errors.js'\n\n/**\n * @typedef {Object} Transaction\n * @property {string} to - The transaction's recipient.\n * @property {number | bigint} value - The amount of native tokens to send to the recipient (in base unit).\n */\n\n/**\n * @typedef {Object} TransactionResult\n * @property {string} hash - The transaction's hash.\n * @property {bigint} fee - The gas cost.\n */\n\n/**\n * @typedef {Object} TransferOptions\n * @property {string} token - The address of the token to transfer.\n * @property {string} recipient - The address of the recipient.\n * @property {number | bigint} amount - The amount of tokens to transfer to the recipient (in base units).\n */\n\n/**\n * @typedef {Object} TransferResult\n * @property {string} hash - The hash of the transfer operation.\n * @property {bigint} fee - The gas cost.\n */\n\n/** @interface */\nexport class IWalletAccountReadOnly {\n  /**\n   * Returns the account's address.\n   *\n   * @returns {Promise<string>} The account's address.\n   */\n  async getAddress () {\n    throw new NotImplementedError('getAddress()')\n  }\n\n  /**\n   * Returns the account's native token balance.\n   *\n   * @returns {Promise<bigint>} The native token balance.\n   */\n  async getBalance () {\n    throw new NotImplementedError('getBalance()')\n  }\n\n  /**\n   * Returns the account balance for a specific token.\n   *\n   * @param {string} tokenAddress - The smart contract address of the token.\n   * @returns {Promise<bigint>} The token balance.\n   */\n  async getTokenBalance (tokenAddress) {\n    throw new NotImplementedError('getTokenBalance(tokenAddress)')\n  }\n\n  /**\n   * Quotes the costs of a send transaction operation.\n   *\n   * @param {Transaction} tx - The transaction.\n   * @returns {Promise<Omit<TransactionResult, 'hash'>>} The transaction's quotes.\n   */\n  async quoteSendTransaction (tx) {\n    throw new NotImplementedError('quoteSendTransaction(tx)')\n  }\n\n  /**\n   * Quotes the costs of a transfer operation.\n   *\n   * @param {TransferOptions} options - The transfer's options.\n   * @returns {Promise<Omit<TransferResult, 'hash'>>} The transfer's quotes.\n   */\n  async quoteTransfer (options) {\n    throw new NotImplementedError('quoteTransfer(options)')\n  }\n\n  /**\n   * Returns a transaction's receipt.\n   *\n   * @param {string} hash - The transaction's hash.\n   * @returns {Promise<unknown | null>} The receipt, or null if the transaction has not been included in a block yet.\n   */\n  async getTransactionReceipt (hash) {\n    throw new NotImplementedError('getTransactionReceipt(hash)')\n  }\n}\n\n/**\n * @abstract\n * @implements {IWalletAccountReadOnly}\n */\nexport default class WalletAccountReadOnly {\n  /**\n   * Creates a new read-only wallet account.\n   *\n   * @param {string} [address] - The account's address.\n   */\n  constructor (address) {\n    /** @private */\n    this.__address = address\n  }\n\n  /**\n   * The account's address.\n   *\n   * @protected\n   * @type {string | undefined}\n   */\n  get _address () {\n    return this.__address\n  }\n\n  /**\n   * Returns the account's address.\n   *\n   * @returns {Promise<string>} The account's address.\n   */\n  async getAddress () {\n    if (!this._address) {\n      throw new Error(\"The account's address must be set to perform this operation.\")\n    }\n\n    return this._address\n  }\n\n  /**\n   * Returns the account's native token balance.\n   *\n   * @abstract\n   * @returns {Promise<bigint>} The native token balance.\n   */\n  async getBalance () {\n    throw new NotImplementedError('getBalance()')\n  }\n\n  /**\n   * Returns the account balance for a specific token.\n   *\n   * @abstract\n   * @param {string} tokenAddress - The smart contract address of the token.\n   * @returns {Promise<bigint>} The token balance.\n   */\n  async getTokenBalance (tokenAddress) {\n    throw new NotImplementedError('getTokenBalance(tokenAddress)')\n  }\n\n  /**\n   * Quotes the costs of a send transaction operation.\n   *\n   * @abstract\n   * @param {Transaction} tx - The transaction.\n   * @returns {Promise<Omit<TransactionResult, 'hash'>>} The transaction's quotes.\n   */\n  async quoteSendTransaction (tx) {\n    throw new NotImplementedError('quoteSendTransaction(tx)')\n  }\n\n  /**\n   * Quotes the costs of a transfer operation.\n   *\n   * @abstract\n   * @param {TransferOptions} options - The transfer's options.\n   * @returns {Promise<Omit<TransferResult, 'hash'>>} The transfer's quotes.\n   */\n  async quoteTransfer (options) {\n    throw new NotImplementedError('quoteTransfer(options)')\n  }\n\n  /**\n   * Returns a transaction's receipt.\n   *\n   * @abstract\n   * @param {string} hash - The transaction's hash.\n   * @returns {Promise<unknown | null>} The receipt, or null if the transaction has not been included in a block yet.\n   */\n  async getTransactionReceipt (hash) {\n    throw new NotImplementedError('getTransactionReceipt(hash)')\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport { IWalletAccountReadOnly } from './wallet-account-read-only.js'\n\nimport { NotImplementedError } from './errors.js'\n\n/** @typedef {import('./wallet-account-read-only.js').Transaction} Transaction */\n/** @typedef {import('./wallet-account-read-only.js').TransactionResult} TransactionResult */\n\n/** @typedef {import('./wallet-account-read-only.js').TransferOptions} TransferOptions */\n/** @typedef {import('./wallet-account-read-only.js').TransferResult} TransferResult */\n\n/**\n * @typedef {Object} KeyPair\n * @property {Uint8Array} publicKey - The public key.\n * @property {Uint8Array | null} privateKey - The private key (null if the account has been disposed).\n */\n\n/** @interface */\nexport class IWalletAccount extends IWalletAccountReadOnly {\n  /**\n   * The derivation path's index of this account.\n   *\n   * @type {number}\n   */\n  get index () {\n    throw new NotImplementedError('index')\n  }\n\n  /**\n   * The derivation path of this account (see [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)).\n   *\n   * @type {string}\n   */\n  get path () {\n    throw new NotImplementedError('path')\n  }\n\n  /**\n   * The account's key pair.\n   *\n   * @type {KeyPair}\n   */\n  get keyPair () {\n    throw new NotImplementedError('keyPair')\n  }\n\n  /**\n   * Signs a message.\n   *\n   * @param {string} message - The message to sign.\n   * @returns {Promise<string>} The message's signature.\n   */\n  async sign (message) {\n    throw new NotImplementedError('sign(message)')\n  }\n\n  /**\n   * Verifies a message's signature.\n   *\n   * @param {string} message - The original message.\n   * @param {string} signature - The signature to verify.\n   * @returns {Promise<boolean>} True if the signature is valid.\n   */\n  async verify (message, signature) {\n    throw new NotImplementedError('verify(message, signature)')\n  }\n\n  /**\n   * Sends a transaction.\n   *\n   * @param {Transaction} tx - The transaction.\n   * @returns {Promise<TransactionResult>} The transaction's result.\n   */\n  async sendTransaction (tx) {\n    throw new NotImplementedError('sendTransaction(tx)')\n  }\n\n  /**\n   * Transfers a token to another address.\n   *\n   * @param {TransferOptions} options - The transfer's options.\n   * @returns {Promise<TransferResult>} The transfer's result.\n   */\n  async transfer (options) {\n    throw new NotImplementedError('transfer(options)')\n  }\n\n  /**\n   * Returns a read-only copy of the account.\n   *\n   * @returns {Promise<IWalletAccountReadOnly>} The read-only account.\n   */\n  async toReadOnlyAccount () {\n    throw new NotImplementedError('toReadOnlyAccount()')\n  }\n\n  /**\n   * Disposes the wallet account, erasing the private key from the memory.\n   */\n  dispose () {\n    throw new NotImplementedError('dispose()')\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n'use strict'\n\nimport * as bip39 from 'bip39'\n\nimport { NotImplementedError } from './errors.js'\n\n/** @typedef {import('./wallet-account.js').IWalletAccount} IWalletAccount */\n\n/**\n * @typedef {Object} WalletConfig\n * @property {number | bigint} [transferMaxFee] - The maximum fee amount for transfer operations.\n */\n\n/**\n * @typedef {Object} FeeRates\n * @property {bigint} normal - The fee rate for transaction sent with normal priority.\n * @property {bigint} fast - The fee rate for transaction sent with fast priority.\n */\n\n/** @abstract */\nexport default class WalletManager {\n  /**\n   * Creates a new wallet manager.\n   *\n   * @param {string | Uint8Array} seed - The wallet's [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) seed phrase.\n   * @param {WalletConfig} [config] - The wallet configuration.\n   */\n  constructor (seed, config = { }) {\n    if (typeof seed === 'string') {\n      if (!WalletManager.isValidSeedPhrase(seed)) {\n        throw new Error('The seed phrase is invalid.')\n      }\n\n      seed = bip39.mnemonicToSeedSync(seed)\n    }\n\n    /** @private */\n    this._seed = seed\n\n    /**\n     * The wallet configuration.\n     *\n     * @protected\n     * @type {WalletConfig}\n     */\n    this._config = config\n\n    /**\n     * A map between derivation paths and wallet accounts. The {@link dispose} method will automatically dispose\n     * all the accounts in this map, so developers are encouraged to map all accounts accessed through the\n     * {@link getAccount} and {@link getAccountByPath} methods.\n     *\n     * @protected\n     * @type {{ [path: string]: IWalletAccount }}\n     */\n    this._accounts = {}\n  }\n\n  /**\n   * Returns a random [BIP-39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) seed phrase.\n   *\n   * @returns {string} The seed phrase.\n   */\n  static getRandomSeedPhrase () {\n    return bip39.generateMnemonic()\n  }\n\n  /**\n   * Checks if a seed phrase is valid.\n   *\n   * @param {string} seedPhrase - The seed phrase.\n   * @returns {boolean} True if the seed phrase is valid.\n   */\n  static isValidSeedPhrase (seedPhrase) {\n    return bip39.validateMnemonic(seedPhrase)\n  }\n\n  /**\n   * The seed phrase of the wallet.\n   *\n   * @type {Uint8Array}\n   */\n  get seed () {\n    return this._seed\n  }\n\n  /**\n   * Returns the wallet account at a specific index (see [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)).\n   *\n   * @abstract\n   * @param {number} [index] - The index of the account to get (default: 0).\n   * @returns {Promise<IWalletAccount>} The account.\n   */\n  async getAccount (index = 0) {\n    throw new NotImplementedError('getAccount(index)')\n  }\n\n  /**\n   * Returns the wallet account at a specific [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) derivation path.\n   *\n   * @abstract\n   * @param {string} path - The derivation path (e.g. \"0'/0/0\").\n   * @returns {Promise<IWalletAccount>} The account.\n   */\n  async getAccountByPath (path) {\n    throw new NotImplementedError('getAccountByPath(path)')\n  }\n\n  /**\n   * Returns the current fee rates.\n   *\n   * @abstract\n   * @returns {Promise<FeeRates>} The fee rates (in base unit).\n   */\n  async getFeeRates () {\n    throw new NotImplementedError('getFeeRates()')\n  }\n\n  /**\n   * Disposes all the wallet accounts, erasing their private keys from the memory.\n   */\n  dispose () {\n    for (const account of Object.values(this._accounts)) {\n      if (account.keyPair.privateKey) {\n        account.dispose()\n      }\n    }\n\n    this._accounts = {}\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\n/** @typedef {import('./src/wdk-manager.js').IWalletAccount} IWalletAccount */\n/** @typedef {import('./src/wdk-manager.js').FeeRates} FeeRates */\n/** @typedef {import('./src/wdk-manager.js').MiddlewareFunction} MiddlewareFunction */\n\n/** @typedef {import('./src/wallet-account-with-protocols.js').IWalletAccountWithProtocols} IWalletAccountWithProtocols */\n\nexport { default } from './src/wdk-manager.js'\n{\n  \"name\": \"@tetherto/wdk\",\n  \"version\": \"1.0.0-beta.5\",\n  \"description\": \"A flexible manager that can register and manage multiple wallet instances for different blockchains dynamically.\",\n  \"keywords\": [\n    \"wdk\",\n    \"core\"\n  ],\n  \"author\": \"Tether\",\n  \"license\": \"Apache-2.0\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/tetherto/wdk-core.git\"\n  },\n  \"main\": \"index.js\",\n  \"type\": \"module\",\n  \"types\": \"./types\",\n  \"scripts\": {\n    \"build:types\": \"tsc\",\n    \"lint\": \"standard\",\n    \"lint:fix\": \"standard --fix\",\n    \"test\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest\",\n    \"test:coverage\": \"cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage\"\n  },\n  \"dependencies\": {\n    \"@tetherto/wdk-wallet\": \"^1.0.0-beta.6\",\n    \"bare-node-runtime\": \"^1.1.4\"\n  },\n  \"devDependencies\": {\n    \"cross-env\": \"7.0.3\",\n    \"jest\": \"30.1.3\",\n    \"standard\": \"17.1.2\",\n    \"typescript\": \"5.8.3\"\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./types/index.d.ts\",\n      \"bare\": \"./bare.js\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": {\n      \"default\": \"./package.json\"\n    }\n  },\n  \"publishConfig\": {\n    \"access\": \"public\",\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"standard\": {\n    \"ignore\": [\n      \"bare.js\",\n      \"tests/**/*.js\"\n    ]\n  }\n}\n// Copyright 2024 Tether Operations Limited\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nimport WalletManager from '@tetherto/wdk-wallet'\n\nimport { SwapProtocol, BridgeProtocol, LendingProtocol, FiatProtocol } from '@tetherto/wdk-wallet/protocols'\n\n/** @typedef {import('@tetherto/wdk-wallet').IWalletAccount} IWalletAccount */\n\n/** @typedef {import('@tetherto/wdk-wallet').FeeRates} FeeRates */\n\n/** @typedef {import('./wallet-account-with-protocols.js').IWalletAccountWithProtocols} IWalletAccountWithProtocols */\n\n/** @typedef {<A extends IWalletAccount>(account: A) => Promise<void>} MiddlewareFunction */\n\nexport default class WDK {\n  /**\n   * Creates a new wallet development kit instance.\n   *\n   * @param {string | Uint8Array} seed - The wallet's BIP-39 seed phrase.\n   * @throws {Error} If the seed is not valid.\n   */\n  constructor (seed) {\n    if (!WDK.isValidSeed(seed)) {\n      throw new Error('Invalid seed.')\n    }\n\n    /** @private */\n    this._seed = seed\n\n    /** @private */\n    this._wallets = new Map()\n\n    /** @private */\n    this._protocols = { swap: { }, bridge: { }, lending: { }, fiat: { } }\n\n    /** @private */\n    this._middlewares = { }\n  }\n\n  /**\n   * Returns a random BIP-39 seed phrase.\n   *\n   * @returns {string} The seed phrase.\n   */\n  static getRandomSeedPhrase () {\n    return WalletManager.getRandomSeedPhrase()\n  }\n\n  /**\n   * Checks if a seed is valid.\n   *\n   * @param {string | Uint8Array} seed - The seed.\n   * @returns {boolean} True if the seed is valid.\n   */\n  static isValidSeed (seed) {\n    if (seed instanceof Uint8Array) {\n      return seed.length >= 16 && seed.length <= 64\n    }\n\n    return WalletManager.isValidSeedPhrase(seed)\n  }\n\n  /**\n   * Registers a new wallet to WDK.\n   *\n   * @template {typeof WalletManager} W\n   * @param {string} blockchain - The name of the blockchain the wallet must be bound to. Can be any string (e.g., \"ethereum\").\n   * @param {W} WalletManager - The wallet manager class.\n   * @param {ConstructorParameters<W>[1]} config - The configuration object.\n   * @returns {WDK} The wdk instance.\n   */\n  registerWallet (blockchain, WalletManager, config) {\n    const wallet = new WalletManager(this._seed, config)\n\n    this._wallets.set(blockchain, wallet)\n\n    return this\n  }\n\n  /**\n   * Registers a new protocol to WDK.\n   *\n   * The label must be unique in the scope of the blockchain and the type of protocol (i.e., there can't be two protocols of the\n   * same type bound to the same blockchain with the same label).\n   *\n   * @see {@link IWalletAccountWithProtocols#registerProtocol} to register protocols only for specific accounts.\n   * @template {typeof SwapProtocol | typeof BridgeProtocol | typeof LendingProtocol | typeof FiatProtocol} P\n   * @param {string} blockchain - The name of the blockchain the protocol must be bound to. Can be any string (e.g., \"ethereum\").\n   * @param {string} label - The label.\n   * @param {P} Protocol - The protocol class.\n   * @param {ConstructorParameters<P>[1]} config - The protocol configuration.\n   * @returns {WDK} The wdk instance.\n   */\n  registerProtocol (blockchain, label, Protocol, config) {\n    if (Protocol.prototype instanceof SwapProtocol) {\n      this._protocols.swap[blockchain] ??= { }\n\n      this._protocols.swap[blockchain][label] = { Protocol, config }\n    } else if (Protocol.prototype instanceof BridgeProtocol) {\n      this._protocols.bridge[blockchain] ??= { }\n\n      this._protocols.bridge[blockchain][label] = { Protocol, config }\n    } else if (Protocol.prototype instanceof LendingProtocol) {\n      this._protocols.lending[blockchain] ??= { }\n\n      this._protocols.lending[blockchain][label] = { Protocol, config }\n    } else if (Protocol.prototype instanceof FiatProtocol) {\n      this._protocols.fiat[blockchain] ??= { }\n\n      this._protocols.fiat[blockchain][label] = { Protocol, config }\n    }\n\n    return this\n  }\n\n  /**\n   * Registers a new middleware to WDK.\n   *\n   * It's possible to register multiple middlewares for the same blockchain, which will be called sequentially.\n   *\n   * @param {string} blockchain - The name of the blockchain the middleware must be bound to. Can be any string (e.g., \"ethereum\").\n   * @param {MiddlewareFunction} middleware - A callback function that is called each time the user derives a new account.\n   * @returns {WDK} The wdk instance.\n   */\n  registerMiddleware (blockchain, middleware) {\n    this._middlewares[blockchain] ??= []\n\n    this._middlewares[blockchain].push(middleware)\n\n    return this\n  }\n\n  /**\n   * Returns the wallet account for a specific blockchain and index (see BIP-44).\n   *\n   * @param {string} blockchain - The name of the blockchain (e.g., \"ethereum\").\n   * @param {number} [index] - The index of the account to get (default: 0).\n   * @returns {Promise<IWalletAccountWithProtocols>} The account.\n   * @throws {Error} If no wallet has been registered for the given blockchain.\n   */\n  async getAccount (blockchain, index = 0) {\n    if (!this._wallets.has(blockchain)) {\n      throw new Error(`No wallet registered for blockchain: ${blockchain}.`)\n    }\n\n    const wallet = this._wallets.get(blockchain)\n\n    const account = await wallet.getAccount(index)\n\n    await this._runMiddlewares(account, { blockchain })\n\n    this._registerProtocols(account, { blockchain })\n\n    return account\n  }\n\n  /**\n   * Returns the wallet account for a specific blockchain and BIP-44 derivation path.\n   *\n   * @param {string} blockchain - The name of the blockchain (e.g., \"ethereum\").\n   * @param {string} path - The derivation path (e.g., \"0'/0/0\").\n   * @returns {Promise<IWalletAccountWithProtocols>} The account.\n   * @throws {Error} If no wallet has been registered for the given blockchain.\n   */\n  async getAccountByPath (blockchain, path) {\n    if (!this._wallets.has(blockchain)) {\n      throw new Error(`No wallet registered for blockchain: ${blockchain}.`)\n    }\n\n    const wallet = this._wallets.get(blockchain)\n\n    const account = await wallet.getAccountByPath(path)\n\n    await this._runMiddlewares(account, { blockchain })\n\n    this._registerProtocols(account, { blockchain })\n\n    return account\n  }\n\n  /**\n   * Returns the current fee rates for a specific blockchain.\n   *\n   * @param {string} blockchain - The name of the blockchain (e.g., \"ethereum\").\n   * @returns {Promise<FeeRates>} The fee rates (in base unit).\n   * @throws {Error} If no wallet has been registered for the given blockchain.\n   */\n  async getFeeRates (blockchain) {\n    if (!this._wallets.has(blockchain)) {\n      throw new Error(`No wallet registered for blockchain: ${blockchain}.`)\n    }\n\n    const wallet = this._wallets.get(blockchain)\n\n    const feeRates = await wallet.getFeeRates()\n\n    return feeRates\n  }\n\n  /**\n   * Disposes and unregisters all the wallets, erasing any sensitive data from the memory.\n   */\n  dispose () {\n    for (const [, wallet] of this._wallets) {\n      wallet.dispose()\n    }\n\n    this._wallets.clear()\n  }\n\n  /** @private */\n  async _runMiddlewares (account, { blockchain }) {\n    if (this._middlewares[blockchain]) {\n      for (const middleware of this._middlewares[blockchain]) {\n        await middleware(account)\n      }\n    }\n  }\n\n  /** @private */\n  _registerProtocols (account, { blockchain }) {\n    const protocols = { swap: { }, bridge: { }, lending: { }, fiat: { } }\n\n    account.registerProtocol = (label, Protocol, config) => {\n      if (Protocol.prototype instanceof SwapProtocol) {\n        protocols.swap[label] = new Protocol(account, config)\n      } else if (Protocol.prototype instanceof BridgeProtocol) {\n        protocols.bridge[label] = new Protocol(account, config)\n      } else if (Protocol.prototype instanceof LendingProtocol) {\n        protocols.lending[label] = new Protocol(account, config)\n      } else if (Protocol.prototype instanceof FiatProtocol) {\n        protocols.fiat[label] = new Protocol(account, config)\n      }\n\n      return account\n    }\n\n    account.getSwapProtocol = (label) => {\n      if (this._protocols.swap[blockchain]?.[label]) {\n        const { Protocol, config } = this._protocols.swap[blockchain][label]\n\n        const protocol = new Protocol(account, config)\n\n        return protocol\n      }\n\n      if (protocols.swap[label]) {\n        return protocols.swap[label]\n      }\n\n      throw new Error(`No swap protocol registered for label: ${label}.`)\n    }\n\n    account.getBridgeProtocol = (label) => {\n      if (this._protocols.bridge[blockchain]?.[label]) {\n        const { Protocol, config } = this._protocols.bridge[blockchain][label]\n\n        const protocol = new Protocol(account, config)\n\n        return protocol\n      }\n\n      if (protocols.bridge[label]) {\n        return protocols.bridge[label]\n      }\n\n      throw new Error(`No bridge protocol registered for label: ${label}.`)\n    }\n\n    account.getLendingProtocol = (label) => {\n      if (this._protocols.lending[blockchain]?.[label]) {\n        const { Protocol, config } = this._protocols.lending[blockchain][label]\n\n        const protocol = new Protocol(account, config)\n\n        return protocol\n      }\n\n      if (protocols.lending[label]) {\n        return protocols.lending[label]\n      }\n\n      throw new Error(`No lending protocol registered for label: ${label}.`)\n    }\n\n    account.getFiatProtocol = (label) => {\n      if (this._protocols.fiat[blockchain]?.[label]) {\n        const { Protocol, config } = this._protocols.fiat[blockchain][label]\n\n        const protocol = new Protocol(account, config)\n\n        return protocol\n      }\n\n      if (protocols.fiat[label]) {\n        return protocols.fiat[label]\n      }\n\n      throw new Error(`No fiat protocol registered for label: ${label}.`)\n    }\n  }\n}\n/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _AES_key, _AES_Kd, _AES_Ke;\n// Number of rounds by keysize\nconst numberOfRounds = { 16: 10, 24: 12, 32: 14 };\n// Round constant words\nconst rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n// S-box and Inverse S-box (S is for Substitution)\nconst S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16];\nconst Si = [0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n// Transformations for encryption\nconst T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\nconst T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\nconst T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\nconst T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n// Transformations for decryption\nconst T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\nconst T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\nconst T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\nconst T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n// Transformations for decryption key expansion\nconst U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\nconst U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\nconst U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\nconst U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\nfunction convertToInt32(bytes) {\n    const result = [];\n    for (let i = 0; i < bytes.length; i += 4) {\n        result.push((bytes[i] << 24) | (bytes[i + 1] << 16) | (bytes[i + 2] << 8) | bytes[i + 3]);\n    }\n    return result;\n}\nexport class AES {\n    get key() { return __classPrivateFieldGet(this, _AES_key, \"f\").slice(); }\n    constructor(key) {\n        _AES_key.set(this, void 0);\n        _AES_Kd.set(this, void 0);\n        _AES_Ke.set(this, void 0);\n        if (!(this instanceof AES)) {\n            throw Error('AES must be instanitated with `new`');\n        }\n        __classPrivateFieldSet(this, _AES_key, new Uint8Array(key), \"f\");\n        const rounds = numberOfRounds[this.key.length];\n        if (rounds == null) {\n            throw new TypeError('invalid key size (must be 16, 24 or 32 bytes)');\n        }\n        // encryption round keys\n        __classPrivateFieldSet(this, _AES_Ke, [], \"f\");\n        // decryption round keys\n        __classPrivateFieldSet(this, _AES_Kd, [], \"f\");\n        for (let i = 0; i <= rounds; i++) {\n            __classPrivateFieldGet(this, _AES_Ke, \"f\").push([0, 0, 0, 0]);\n            __classPrivateFieldGet(this, _AES_Kd, \"f\").push([0, 0, 0, 0]);\n        }\n        const roundKeyCount = (rounds + 1) * 4;\n        const KC = this.key.length / 4;\n        // convert the key into ints\n        const tk = convertToInt32(this.key);\n        // copy values into round key arrays\n        let index;\n        for (let i = 0; i < KC; i++) {\n            index = i >> 2;\n            __classPrivateFieldGet(this, _AES_Ke, \"f\")[index][i % 4] = tk[i];\n            __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds - index][i % 4] = tk[i];\n        }\n        // key expansion (fips-197 section 5.2)\n        let rconpointer = 0;\n        let t = KC, tt;\n        while (t < roundKeyCount) {\n            tt = tk[KC - 1];\n            tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n                (S[(tt >> 8) & 0xFF] << 16) ^\n                (S[tt & 0xFF] << 8) ^\n                S[(tt >> 24) & 0xFF] ^\n                (rcon[rconpointer] << 24));\n            rconpointer += 1;\n            // key expansion (for non-256 bit)\n            if (KC != 8) {\n                for (let i = 1; i < KC; i++) {\n                    tk[i] ^= tk[i - 1];\n                }\n                // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n            }\n            else {\n                for (let i = 1; i < (KC / 2); i++) {\n                    tk[i] ^= tk[i - 1];\n                }\n                tt = tk[(KC / 2) - 1];\n                tk[KC / 2] ^= (S[tt & 0xFF] ^\n                    (S[(tt >> 8) & 0xFF] << 8) ^\n                    (S[(tt >> 16) & 0xFF] << 16) ^\n                    (S[(tt >> 24) & 0xFF] << 24));\n                for (let i = (KC / 2) + 1; i < KC; i++) {\n                    tk[i] ^= tk[i - 1];\n                }\n            }\n            // copy values into round key arrays\n            let i = 0, r, c;\n            while (i < KC && t < roundKeyCount) {\n                r = t >> 2;\n                c = t % 4;\n                __classPrivateFieldGet(this, _AES_Ke, \"f\")[r][c] = tk[i];\n                __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds - r][c] = tk[i++];\n                t++;\n            }\n        }\n        // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n        for (let r = 1; r < rounds; r++) {\n            for (let c = 0; c < 4; c++) {\n                tt = __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][c];\n                __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][c] = (U1[(tt >> 24) & 0xFF] ^\n                    U2[(tt >> 16) & 0xFF] ^\n                    U3[(tt >> 8) & 0xFF] ^\n                    U4[tt & 0xFF]);\n            }\n        }\n    }\n    encrypt(plaintext) {\n        if (plaintext.length != 16) {\n            throw new TypeError('invalid plaintext size (must be 16 bytes)');\n        }\n        const rounds = __classPrivateFieldGet(this, _AES_Ke, \"f\").length - 1;\n        const a = [0, 0, 0, 0];\n        // convert plaintext to (ints ^ key)\n        let t = convertToInt32(plaintext);\n        for (let i = 0; i < 4; i++) {\n            t[i] ^= __classPrivateFieldGet(this, _AES_Ke, \"f\")[0][i];\n        }\n        // apply round transforms\n        for (let r = 1; r < rounds; r++) {\n            for (let i = 0; i < 4; i++) {\n                a[i] = (T1[(t[i] >> 24) & 0xff] ^\n                    T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n                    T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n                    T4[t[(i + 3) % 4] & 0xff] ^\n                    __classPrivateFieldGet(this, _AES_Ke, \"f\")[r][i]);\n            }\n            t = a.slice();\n        }\n        // the last round is special\n        const result = new Uint8Array(16);\n        let tt = 0;\n        for (let i = 0; i < 4; i++) {\n            tt = __classPrivateFieldGet(this, _AES_Ke, \"f\")[rounds][i];\n            result[4 * i] = (S[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n            result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n            result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n            result[4 * i + 3] = (S[t[(i + 3) % 4] & 0xff] ^ tt) & 0xff;\n        }\n        return result;\n    }\n    decrypt(ciphertext) {\n        if (ciphertext.length != 16) {\n            throw new TypeError('invalid ciphertext size (must be 16 bytes)');\n        }\n        const rounds = __classPrivateFieldGet(this, _AES_Kd, \"f\").length - 1;\n        const a = [0, 0, 0, 0];\n        // convert plaintext to (ints ^ key)\n        let t = convertToInt32(ciphertext);\n        for (let i = 0; i < 4; i++) {\n            t[i] ^= __classPrivateFieldGet(this, _AES_Kd, \"f\")[0][i];\n        }\n        // apply round transforms\n        for (let r = 1; r < rounds; r++) {\n            for (let i = 0; i < 4; i++) {\n                a[i] = (T5[(t[i] >> 24) & 0xff] ^\n                    T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n                    T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n                    T8[t[(i + 1) % 4] & 0xff] ^\n                    __classPrivateFieldGet(this, _AES_Kd, \"f\")[r][i]);\n            }\n            t = a.slice();\n        }\n        // the last round is special\n        const result = new Uint8Array(16);\n        let tt = 0;\n        for (let i = 0; i < 4; i++) {\n            tt = __classPrivateFieldGet(this, _AES_Kd, \"f\")[rounds][i];\n            result[4 * i] = (Si[(t[i] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n            result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n            result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n            result[4 * i + 3] = (Si[t[(i + 1) % 4] & 0xff] ^ tt) & 0xff;\n        }\n        return result;\n    }\n}\n_AES_key = new WeakMap(), _AES_Kd = new WeakMap(), _AES_Ke = new WeakMap();\n//# sourceMappingURL=aes.js.mapexport { AES } from \"./aes.js\";\nexport { ModeOfOperation } from \"./mode.js\";\nexport { CBC } from \"./mode-cbc.js\";\nexport { CFB } from \"./mode-cfb.js\";\nexport { CTR } from \"./mode-ctr.js\";\nexport { ECB } from \"./mode-ecb.js\";\nexport { OFB } from \"./mode-ofb.js\";\nexport { pkcs7Pad, pkcs7Strip } from \"./padding.js\";\n//# sourceMappingURL=index.js.map// Cipher Block Chaining\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _CBC_iv, _CBC_lastBlock;\nimport { ModeOfOperation } from \"./mode.js\";\nexport class CBC extends ModeOfOperation {\n    constructor(key, iv) {\n        super(\"ECC\", key, CBC);\n        _CBC_iv.set(this, void 0);\n        _CBC_lastBlock.set(this, void 0);\n        if (iv) {\n            if (iv.length % 16) {\n                throw new TypeError(\"invalid iv size (must be 16 bytes)\");\n            }\n            __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(iv), \"f\");\n        }\n        else {\n            __classPrivateFieldSet(this, _CBC_iv, new Uint8Array(16), \"f\");\n        }\n        __classPrivateFieldSet(this, _CBC_lastBlock, this.iv, \"f\");\n    }\n    get iv() { return new Uint8Array(__classPrivateFieldGet(this, _CBC_iv, \"f\")); }\n    encrypt(plaintext) {\n        if (plaintext.length % 16) {\n            throw new TypeError(\"invalid plaintext size (must be multiple of 16 bytes)\");\n        }\n        const ciphertext = new Uint8Array(plaintext.length);\n        for (let i = 0; i < plaintext.length; i += 16) {\n            for (let j = 0; j < 16; j++) {\n                __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j] ^= plaintext[i + j];\n            }\n            __classPrivateFieldSet(this, _CBC_lastBlock, this.aes.encrypt(__classPrivateFieldGet(this, _CBC_lastBlock, \"f\")), \"f\");\n            ciphertext.set(__classPrivateFieldGet(this, _CBC_lastBlock, \"f\"), i);\n        }\n        return ciphertext;\n    }\n    decrypt(ciphertext) {\n        if (ciphertext.length % 16) {\n            throw new TypeError(\"invalid ciphertext size (must be multiple of 16 bytes)\");\n        }\n        const plaintext = new Uint8Array(ciphertext.length);\n        for (let i = 0; i < ciphertext.length; i += 16) {\n            const block = this.aes.decrypt(ciphertext.subarray(i, i + 16));\n            for (let j = 0; j < 16; j++) {\n                plaintext[i + j] = block[j] ^ __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j];\n                __classPrivateFieldGet(this, _CBC_lastBlock, \"f\")[j] = ciphertext[i + j];\n            }\n        }\n        return plaintext;\n    }\n}\n_CBC_iv = new WeakMap(), _CBC_lastBlock = new WeakMap();\n//# sourceMappingURL=mode-cbc.js.map// Cipher Feedback\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _CFB_instances, _CFB_iv, _CFB_shiftRegister, _CFB_shift;\nimport { ModeOfOperation } from \"./mode.js\";\nexport class CFB extends ModeOfOperation {\n    constructor(key, iv, segmentSize = 8) {\n        super(\"CFB\", key, CFB);\n        _CFB_instances.add(this);\n        _CFB_iv.set(this, void 0);\n        _CFB_shiftRegister.set(this, void 0);\n        // This library currently only handles byte-aligned segmentSize\n        if (!Number.isInteger(segmentSize) || (segmentSize % 8)) {\n            throw new TypeError(\"invalid segmentSize\");\n        }\n        Object.defineProperties(this, {\n            segmentSize: { enumerable: true, value: segmentSize }\n        });\n        if (iv) {\n            if (iv.length % 16) {\n                throw new TypeError(\"invalid iv size (must be 16 bytes)\");\n            }\n            __classPrivateFieldSet(this, _CFB_iv, new Uint8Array(iv), \"f\");\n        }\n        else {\n            __classPrivateFieldSet(this, _CFB_iv, new Uint8Array(16), \"f\");\n        }\n        __classPrivateFieldSet(this, _CFB_shiftRegister, this.iv, \"f\");\n    }\n    get iv() { return new Uint8Array(__classPrivateFieldGet(this, _CFB_iv, \"f\")); }\n    encrypt(plaintext) {\n        if (8 * plaintext.length % this.segmentSize) {\n            throw new TypeError(\"invalid plaintext size (must be multiple of segmentSize bytes)\");\n        }\n        const segmentSize = this.segmentSize / 8;\n        const ciphertext = new Uint8Array(plaintext);\n        for (let i = 0; i < ciphertext.length; i += segmentSize) {\n            const xorSegment = this.aes.encrypt(__classPrivateFieldGet(this, _CFB_shiftRegister, \"f\"));\n            for (let j = 0; j < segmentSize; j++) {\n                ciphertext[i + j] ^= xorSegment[j];\n            }\n            __classPrivateFieldGet(this, _CFB_instances, \"m\", _CFB_shift).call(this, ciphertext.subarray(i));\n        }\n        return ciphertext;\n    }\n    decrypt(ciphertext) {\n        if (8 * ciphertext.length % this.segmentSize) {\n            throw new TypeError(\"invalid ciphertext size (must be multiple of segmentSize bytes)\");\n        }\n        const segmentSize = this.segmentSize / 8;\n        const plaintext = new Uint8Array(ciphertext);\n        for (let i = 0; i < plaintext.length; i += segmentSize) {\n            const xorSegment = this.aes.encrypt(__classPrivateFieldGet(this, _CFB_shiftRegister, \"f\"));\n            for (let j = 0; j < segmentSize; j++) {\n                plaintext[i + j] ^= xorSegment[j];\n            }\n            __classPrivateFieldGet(this, _CFB_instances, \"m\", _CFB_shift).call(this, ciphertext.subarray(i));\n        }\n        return plaintext;\n    }\n}\n_CFB_iv = new WeakMap(), _CFB_shiftRegister = new WeakMap(), _CFB_instances = new WeakSet(), _CFB_shift = function _CFB_shift(data) {\n    const segmentSize = this.segmentSize / 8;\n    // Shift the register\n    __classPrivateFieldGet(this, _CFB_shiftRegister, \"f\").set(__classPrivateFieldGet(this, _CFB_shiftRegister, \"f\").subarray(segmentSize));\n    __classPrivateFieldGet(this, _CFB_shiftRegister, \"f\").set(data.subarray(0, segmentSize), 16 - segmentSize);\n};\n//# sourceMappingURL=mode-cfb.js.map// Counter Mode\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _CTR_remaining, _CTR_remainingIndex, _CTR_counter;\nimport { ModeOfOperation } from \"./mode.js\";\nexport class CTR extends ModeOfOperation {\n    constructor(key, initialValue) {\n        super(\"CTR\", key, CTR);\n        // Remaining bytes for the one-time pad\n        _CTR_remaining.set(this, void 0);\n        _CTR_remainingIndex.set(this, void 0);\n        // The current counter\n        _CTR_counter.set(this, void 0);\n        __classPrivateFieldSet(this, _CTR_counter, new Uint8Array(16), \"f\");\n        __classPrivateFieldGet(this, _CTR_counter, \"f\").fill(0);\n        __classPrivateFieldSet(this, _CTR_remaining, __classPrivateFieldGet(this, _CTR_counter, \"f\"), \"f\"); // This will be discarded immediately\n        __classPrivateFieldSet(this, _CTR_remainingIndex, 16, \"f\");\n        if (initialValue == null) {\n            initialValue = 1;\n        }\n        if (typeof (initialValue) === \"number\") {\n            this.setCounterValue(initialValue);\n        }\n        else {\n            this.setCounterBytes(initialValue);\n        }\n    }\n    get counter() { return new Uint8Array(__classPrivateFieldGet(this, _CTR_counter, \"f\")); }\n    setCounterValue(value) {\n        if (!Number.isInteger(value) || value < 0 || value > Number.MAX_SAFE_INTEGER) {\n            throw new TypeError(\"invalid counter initial integer value\");\n        }\n        for (let index = 15; index >= 0; --index) {\n            __classPrivateFieldGet(this, _CTR_counter, \"f\")[index] = value % 256;\n            value = Math.floor(value / 256);\n        }\n    }\n    setCounterBytes(value) {\n        if (value.length !== 16) {\n            throw new TypeError(\"invalid counter initial Uint8Array value length\");\n        }\n        __classPrivateFieldGet(this, _CTR_counter, \"f\").set(value);\n    }\n    increment() {\n        for (let i = 15; i >= 0; i--) {\n            if (__classPrivateFieldGet(this, _CTR_counter, \"f\")[i] === 255) {\n                __classPrivateFieldGet(this, _CTR_counter, \"f\")[i] = 0;\n            }\n            else {\n                __classPrivateFieldGet(this, _CTR_counter, \"f\")[i]++;\n                break;\n            }\n        }\n    }\n    encrypt(plaintext) {\n        var _a, _b;\n        const crypttext = new Uint8Array(plaintext);\n        for (let i = 0; i < crypttext.length; i++) {\n            if (__classPrivateFieldGet(this, _CTR_remainingIndex, \"f\") === 16) {\n                __classPrivateFieldSet(this, _CTR_remaining, this.aes.encrypt(__classPrivateFieldGet(this, _CTR_counter, \"f\")), \"f\");\n                __classPrivateFieldSet(this, _CTR_remainingIndex, 0, \"f\");\n                this.increment();\n            }\n            crypttext[i] ^= __classPrivateFieldGet(this, _CTR_remaining, \"f\")[__classPrivateFieldSet(this, _CTR_remainingIndex, (_b = __classPrivateFieldGet(this, _CTR_remainingIndex, \"f\"), _a = _b++, _b), \"f\"), _a];\n        }\n        return crypttext;\n    }\n    decrypt(ciphertext) {\n        return this.encrypt(ciphertext);\n    }\n}\n_CTR_remaining = new WeakMap(), _CTR_remainingIndex = new WeakMap(), _CTR_counter = new WeakMap();\n//# sourceMappingURL=mode-ctr.js.map// Electronic Code Book\nimport { ModeOfOperation } from \"./mode.js\";\nexport class ECB extends ModeOfOperation {\n    constructor(key) {\n        super(\"ECB\", key, ECB);\n    }\n    encrypt(plaintext) {\n        if (plaintext.length % 16) {\n            throw new TypeError(\"invalid plaintext size (must be multiple of 16 bytes)\");\n        }\n        const crypttext = new Uint8Array(plaintext.length);\n        for (let i = 0; i < plaintext.length; i += 16) {\n            crypttext.set(this.aes.encrypt(plaintext.subarray(i, i + 16)), i);\n        }\n        return crypttext;\n    }\n    decrypt(crypttext) {\n        if (crypttext.length % 16) {\n            throw new TypeError(\"invalid ciphertext size (must be multiple of 16 bytes)\");\n        }\n        const plaintext = new Uint8Array(crypttext.length);\n        for (let i = 0; i < crypttext.length; i += 16) {\n            plaintext.set(this.aes.decrypt(crypttext.subarray(i, i + 16)), i);\n        }\n        return plaintext;\n    }\n}\n//# sourceMappingURL=mode-ecb.js.map// Output Feedback\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _OFB_iv, _OFB_lastPrecipher, _OFB_lastPrecipherIndex;\nimport { ModeOfOperation } from \"./mode.js\";\nexport class OFB extends ModeOfOperation {\n    constructor(key, iv) {\n        super(\"OFB\", key, OFB);\n        _OFB_iv.set(this, void 0);\n        _OFB_lastPrecipher.set(this, void 0);\n        _OFB_lastPrecipherIndex.set(this, void 0);\n        if (iv) {\n            if (iv.length % 16) {\n                throw new TypeError(\"invalid iv size (must be 16 bytes)\");\n            }\n            __classPrivateFieldSet(this, _OFB_iv, new Uint8Array(iv), \"f\");\n        }\n        else {\n            __classPrivateFieldSet(this, _OFB_iv, new Uint8Array(16), \"f\");\n        }\n        __classPrivateFieldSet(this, _OFB_lastPrecipher, this.iv, \"f\");\n        __classPrivateFieldSet(this, _OFB_lastPrecipherIndex, 16, \"f\");\n    }\n    get iv() { return new Uint8Array(__classPrivateFieldGet(this, _OFB_iv, \"f\")); }\n    encrypt(plaintext) {\n        var _a, _b;\n        if (plaintext.length % 16) {\n            throw new TypeError(\"invalid plaintext size (must be multiple of 16 bytes)\");\n        }\n        const ciphertext = new Uint8Array(plaintext);\n        for (let i = 0; i < ciphertext.length; i++) {\n            if (__classPrivateFieldGet(this, _OFB_lastPrecipherIndex, \"f\") === 16) {\n                __classPrivateFieldSet(this, _OFB_lastPrecipher, this.aes.encrypt(__classPrivateFieldGet(this, _OFB_lastPrecipher, \"f\")), \"f\");\n                __classPrivateFieldSet(this, _OFB_lastPrecipherIndex, 0, \"f\");\n            }\n            ciphertext[i] ^= __classPrivateFieldGet(this, _OFB_lastPrecipher, \"f\")[__classPrivateFieldSet(this, _OFB_lastPrecipherIndex, (_b = __classPrivateFieldGet(this, _OFB_lastPrecipherIndex, \"f\"), _a = _b++, _b), \"f\"), _a];\n        }\n        return ciphertext;\n    }\n    decrypt(ciphertext) {\n        if (ciphertext.length % 16) {\n            throw new TypeError(\"invalid ciphertext size (must be multiple of 16 bytes)\");\n        }\n        return this.encrypt(ciphertext);\n    }\n}\n_OFB_iv = new WeakMap(), _OFB_lastPrecipher = new WeakMap(), _OFB_lastPrecipherIndex = new WeakMap();\n//# sourceMappingURL=mode-ofb.js.mapimport { AES } from \"./aes.js\";\nexport class ModeOfOperation {\n    constructor(name, key, cls) {\n        if (cls && !(this instanceof cls)) {\n            throw new Error(`${name} must be instantiated with \"new\"`);\n        }\n        Object.defineProperties(this, {\n            aes: { enumerable: true, value: new AES(key) },\n            name: { enumerable: true, value: name }\n        });\n    }\n}\n//# sourceMappingURL=mode.js.map{\n  \"type\": \"module\"\n}\nexport function pkcs7Pad(data) {\n    const padder = 16 - (data.length % 16);\n    const result = new Uint8Array(data.length + padder);\n    result.set(data);\n    for (let i = data.length; i < result.length; i++) {\n        result[i] = padder;\n    }\n    return result;\n}\nexport function pkcs7Strip(data) {\n    if (data.length < 16) {\n        throw new TypeError('PKCS#7 invalid length');\n    }\n    const padder = data[data.length - 1];\n    if (padder > 16) {\n        throw new TypeError('PKCS#7 padding byte out of range');\n    }\n    const length = data.length - padder;\n    for (let i = 0; i < padder; i++) {\n        if (data[length + i] !== padder) {\n            throw new TypeError('PKCS#7 invalid padding byte');\n        }\n    }\n    return new Uint8Array(data.subarray(0, length));\n}\n//# sourceMappingURL=padding.js.mapconst c = require('compact-encoding')\nconst IndexEncoder = require('index-encoder')\n\nconst Checkout = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.key)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.fixed32.encode(state, m.key)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    return {\n      key: c.fixed32.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst Clock = c.array(Checkout)\n\nconst IndexCheckpoint = {\n  preencode(state, m) {\n    c.fixed64.preencode(state, m.signature)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.fixed64.encode(state, m.signature)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    return {\n      signature: c.fixed64.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst KeyV0 = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.key)\n  },\n  encode(state, m) {\n    c.fixed32.encode(state, m.key)\n  },\n  decode(state) {\n    return {\n      key: c.fixed32.decode(state),\n      length: -1\n    }\n  }\n}\n\nconst KeysV0 = c.array(KeyV0)\n\nconst WakeupV0 = {\n  preencode(state, m) {\n    c.uint.preencode(state, 0) // version\n    c.uint.preencode(state, m.type)\n\n    if (m.type === 1) {\n      KeysV0.preencode(state, m.writers)\n    }\n  },\n  encode(state, m) {\n    c.uint.encode(state, 0) // version\n    c.uint.encode(state, m.type)\n\n    if (m.type === 1) {\n      KeysV0.encode(state, m.writers)\n    }\n  },\n  decode(state) {\n    const v = c.uint.decode(state)\n    if (v !== 0) throw new Error('Unsupported version: ' + v)\n\n    const type = c.uint.decode(state)\n    const m = { version: 0, type, writers: null }\n\n    if (m.type === 1) {\n      m.writers = KeysV0.decode(state)\n    }\n\n    return m\n  }\n}\n\nconst Wakeup = {\n  preencode(state, m) {\n    if (m.version === 0) return WakeupV0.preencode(state, m)\n\n    c.uint.preencode(state, 1) // version\n    c.uint.preencode(state, m.type)\n\n    if (m.type === 1) {\n      Clock.preencode(state, m.writers)\n    }\n  },\n  encode(state, m) {\n    if (m.version === 0) return WakeupV0.encode(state, m)\n\n    c.uint.encode(state, 1) // version\n    c.uint.encode(state, m.type)\n\n    if (m.type === 1) {\n      Clock.encode(state, m.writers)\n    }\n  },\n  decode(state) {\n    const start = state.start\n    const v = c.uint.decode(state)\n\n    if (v > 1) throw new Error('Unsupported version: ' + v)\n\n    if (v === 0) {\n      state.start = start\n      return WakeupV0.decode(state)\n    }\n\n    const type = c.uint.decode(state)\n    const m = { version: 1, type, writers: null }\n\n    if (m.type === 1) {\n      m.writers = Clock.decode(state)\n    }\n\n    return m\n  }\n}\n\nconst BootRecordV0 = {\n  preencode() {\n    throw new Error('version 0 records cannot be encoded')\n  },\n  encode() {\n    throw new Error('version 0 records cannot be encoded')\n  },\n  decode(state) {\n    const indexed = Checkout.decode(state)\n    const heads = Clock.decode(state)\n\n    // one cause initial recover is not ff recovery\n    return {\n      version: 0,\n      key: indexed.key,\n      systemLength: indexed.length,\n      indexersUpdated: false,\n      fastForwarding: false,\n      recoveries: 1,\n      migrating: false,\n      heads\n    }\n  }\n}\n\nconst Checkpointer = {\n  preencode(state, idx) {\n    c.uint.preencode(state, idx.checkpointer)\n    if (idx.checkpoint !== null) IndexCheckpoint.preencode(state, idx.checkpoint)\n  },\n  encode(state, idx) {\n    c.uint.encode(state, idx.checkpointer)\n    if (idx.checkpoint !== null) IndexCheckpoint.encode(state, idx.checkpoint)\n  },\n  decode(state) {\n    const checkpointer = c.uint.decode(state)\n    const checkpoint = checkpointer ? null : IndexCheckpoint.decode(state)\n\n    return {\n      checkpointer,\n      checkpoint\n    }\n  }\n}\n\nconst CheckpointerArray = c.array(Checkpointer)\n\nconst Indexer = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.signature)\n    c.fixed32.preencode(state, m.namespace)\n    c.fixed32.preencode(state, m.publicKey)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.signature)\n    c.fixed32.encode(state, m.namespace)\n    c.fixed32.encode(state, m.publicKey)\n  },\n  decode(state) {\n    return {\n      signature: c.uint.decode(state),\n      namespace: c.fixed32.decode(state),\n      publicKey: c.fixed32.decode(state)\n    }\n  }\n}\n\nconst Indexers = c.array(Indexer)\n\nconst DigestV0 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.pointer)\n    if (m.pointer === 0) {\n      Indexers.preencode(state, m.indexers)\n    }\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.pointer)\n    if (m.pointer === 0) {\n      Indexers.encode(state, m.indexers)\n    }\n  },\n  decode(state) {\n    const pointer = c.uint.decode(state)\n    return {\n      pointer,\n      indexers: pointer === 0 ? Indexers.decode(state) : null\n    }\n  }\n}\n\nconst Digest = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.pointer)\n    if (m.pointer === 0) {\n      c.fixed32.preencode(state, m.key)\n    }\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.pointer)\n    if (m.pointer === 0) {\n      c.fixed32.encode(state, m.key)\n    }\n  },\n  decode(state) {\n    const pointer = c.uint.decode(state)\n    return {\n      pointer,\n      key: pointer === 0 ? c.fixed32.decode(state) : null\n    }\n  }\n}\n\nconst Node = {\n  preencode(state, m) {\n    Clock.preencode(state, m.heads)\n    c.uint.preencode(state, m.batch)\n    c.buffer.preencode(state, m.value)\n  },\n  encode(state, m) {\n    Clock.encode(state, m.heads)\n    c.uint.encode(state, m.batch)\n    c.buffer.encode(state, m.value)\n  },\n  decode(state, m) {\n    return {\n      heads: Clock.decode(state),\n      batch: c.uint.decode(state),\n      value: c.buffer.decode(state)\n    }\n  }\n}\n\nconst Additional = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.pointer)\n    if (m.pointer === 0) {\n      AdditionalData.preencode(state, m.data)\n    }\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.pointer)\n    if (m.pointer === 0) {\n      AdditionalData.encode(state, m.data)\n    }\n  },\n  decode(state) {\n    const pointer = c.uint.decode(state)\n    return {\n      pointer,\n      data: pointer === 0 ? AdditionalData.decode(state) : null\n    }\n  }\n}\n\nconst AdditionalData = {\n  preencode(state, m) {\n    c.uint.preencode(state, 0)\n  },\n  encode(state, m) {\n    c.uint.encode(state, 0) // empty for now, for the future\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n    return {\n      encryptionId: flags & 1 ? c.fixed32.decode(state) : null, // to help validate the encryption key used\n      abi: flags & 2 ? c.uint.decode(state) : 0\n    }\n  }\n}\n\nconst OplogMessageV1 = {\n  preencode(state, m) {\n    throw new Error('Encoding not supported')\n  },\n  encode(state, m) {\n    throw new Error('Encoding not supported')\n  },\n  decode(state) {\n    const maxSupportedVersion = c.uint.decode(state)\n\n    const flags = c.uint.decode(state)\n\n    const isCheckpointer = (flags & 1) !== 0\n\n    const chk = isCheckpointer ? CheckpointerArray.decode(state) : null\n    const digest = isCheckpointer ? Digest.decode(state) : null\n\n    const node = Node.decode(state)\n\n    return {\n      version: 1,\n      maxSupportedVersion,\n      digest,\n      checkpoint: chk ? { system: chk[0], encryption: null, user: chk.slice(1) } : null,\n      optimistic: (flags & 2) !== 0,\n      node\n    }\n  }\n}\n\nconst OplogMessageV0 = {\n  preencode(state, m) {\n    throw new Error('Encoding not supported')\n  },\n  encode(state, m) {\n    throw new Error('Encoding not supported')\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    const isCheckpointer = (flags & 1) !== 0\n\n    if (isCheckpointer) DigestV0.decode(state)\n    const chk = isCheckpointer ? CheckpointerArray.decode(state) : null\n    const node = Node.decode(state)\n    Additional.decode(state)\n    const maxSupportedVersion = state.start < state.end ? c.uint.decode(state) : 0\n\n    return {\n      version: 0,\n      maxSupportedVersion,\n      digest: null,\n      checkpoint: chk ? { system: chk[0], encryption: null, user: chk.slice(1) } : null,\n      optimistic: null,\n      node\n    }\n  }\n}\n\n// prefix 0 is reserved for future manifest\nconst LINEARIZER_PREFIX = 1\n\nconst LinearizerKey = {\n  preencode(state, seq) {\n    IndexEncoder.UINT.preencode(state, LINEARIZER_PREFIX)\n    IndexEncoder.UINT.preencode(state, seq)\n  },\n  encode(state, seq) {\n    IndexEncoder.UINT.encode(state, LINEARIZER_PREFIX)\n    IndexEncoder.UINT.encode(state, seq)\n  },\n  decode(state) {\n    IndexEncoder.UINT.decode(state)\n    return IndexEncoder.UINT.decode(state)\n  }\n}\n\nfunction infoLegacyMap(info) {\n  return {\n    version: info.version,\n    members: info.members,\n    pendingIndexers: info.pendingIndexers,\n    indexers: info.indexers,\n    heads: info.heads,\n    views: info.views,\n    encryptionLength: 0,\n    entropy: null\n  }\n}\n\nmodule.exports = {\n  Wakeup,\n  BootRecordV0,\n  OplogMessageV0,\n  OplogMessageV1,\n  LinearizerKey,\n  infoLegacyMap\n}\n// This file is autogenerated by the hyperschema compiler\n// Schema Version: 1\n/* eslint-disable camelcase */\n/* eslint-disable quotes */\n\nconst { c } = require('hyperschema/runtime')\nconst external0 = require('../../legacy.js')\n\nconst VERSION = 1\n\n// eslint-disable-next-line no-unused-vars\nlet version = VERSION\n\n// @autobase/checkout\nconst encoding0 = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.key)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.fixed32.encode(state, m.key)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    const r0 = c.fixed32.decode(state)\n    const r1 = c.uint.decode(state)\n\n    return {\n      key: r0,\n      length: r1\n    }\n  }\n}\n\n// @autobase/clock\nconst encoding1 = c.array(encoding0)\n\n// @autobase/index-checkpoint\nconst encoding2 = {\n  preencode(state, m) {\n    c.fixed64.preencode(state, m.signature)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.fixed64.encode(state, m.signature)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    const r0 = c.fixed64.decode(state)\n    const r1 = c.uint.decode(state)\n\n    return {\n      signature: r0,\n      length: r1\n    }\n  }\n}\n\nconst encoding3 = external0.Wakeup\n\nconst encoding4 = external0.BootRecordV0\n\n// @autobase/boot-record-raw\nconst encoding5 = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.key)\n    c.uint.preencode(state, m.systemLength)\n    state.end++ // max flag is 4 so always one byte\n\n    if (m.recoveries) c.uint.preencode(state, m.recoveries)\n  },\n  encode(state, m) {\n    const flags = (m.indexersUpdated ? 1 : 0) | (m.fastForwarding ? 2 : 0) | (m.recoveries ? 4 : 0)\n\n    c.fixed32.encode(state, m.key)\n    c.uint.encode(state, m.systemLength)\n    c.uint.encode(state, flags)\n\n    if (m.recoveries) c.uint.encode(state, m.recoveries)\n  },\n  decode(state, version) {\n    if (version === undefined) version = c.uint.decode(state)\n    const r0 = c.fixed32.decode(state)\n    const r1 = c.uint.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      version,\n      key: r0,\n      systemLength: r1,\n      indexersUpdated: (flags & 1) !== 0,\n      fastForwarding: (flags & 2) !== 0,\n      recoveries: (flags & 4) !== 0 ? c.uint.decode(state) : 0\n    }\n  }\n}\n\n// @autobase/boot-record\nconst encoding6 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.version)\n    switch (m.version) {\n      case 0:\n        encoding4.preencode(state, m)\n        break\n      case 1:\n      case 2:\n      case 3:\n        encoding5.preencode(state, m)\n        break\n      default:\n        throw new Error('Unsupported version')\n    }\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.version)\n    switch (m.version) {\n      case 0:\n        encoding4.encode(state, m)\n        break\n      case 1:\n      case 2:\n      case 3:\n        encoding5.encode(state, m)\n        break\n      default:\n        throw new Error('Unsupported version')\n    }\n  },\n  decode(state) {\n    const version = c.uint.decode(state)\n    switch (version) {\n      case 0: {\n        const decoded = encoding4.decode(state, version)\n        return decoded\n      }\n      case 1:\n      case 2:\n      case 3: {\n        const decoded = encoding5.decode(state, version)\n        return decoded\n      }\n      default:\n        throw new Error('Unsupported version')\n    }\n  }\n}\n\n// @autobase/checkpointer\nconst encoding7 = {\n  preencode(state, m) {\n    state.end++ // max flag is 2 so always one byte\n\n    if (m.checkpointer) c.uint.preencode(state, m.checkpointer)\n    if (m.checkpoint) encoding2.preencode(state, m.checkpoint)\n  },\n  encode(state, m) {\n    const flags = (m.checkpointer ? 1 : 0) | (m.checkpoint ? 2 : 0)\n\n    c.uint.encode(state, flags)\n\n    if (m.checkpointer) c.uint.encode(state, m.checkpointer)\n    if (m.checkpoint) encoding2.encode(state, m.checkpoint)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      checkpointer: (flags & 1) !== 0 ? c.uint.decode(state) : 0,\n      checkpoint: (flags & 2) !== 0 ? encoding2.decode(state) : null\n    }\n  }\n}\n\n// @autobase/checkpoint.user\nconst encoding8_2 = c.array(encoding7)\n\n// @autobase/checkpoint\nconst encoding8 = {\n  preencode(state, m) {\n    state.end++ // max flag is 4 so always one byte\n\n    if (m.system) encoding7.preencode(state, m.system)\n    if (m.encryption) encoding7.preencode(state, m.encryption)\n    if (m.user) encoding8_2.preencode(state, m.user)\n  },\n  encode(state, m) {\n    const flags = (m.system ? 1 : 0) | (m.encryption ? 2 : 0) | (m.user ? 4 : 0)\n\n    c.uint.encode(state, flags)\n\n    if (m.system) encoding7.encode(state, m.system)\n    if (m.encryption) encoding7.encode(state, m.encryption)\n    if (m.user) encoding8_2.encode(state, m.user)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      system: (flags & 1) !== 0 ? encoding7.decode(state) : null,\n      encryption: (flags & 2) !== 0 ? encoding7.decode(state) : null,\n      user: (flags & 4) !== 0 ? encoding8_2.decode(state) : null\n    }\n  }\n}\n\n// @autobase/digest\nconst encoding9 = {\n  preencode(state, m) {\n    state.end++ // max flag is 2 so always one byte\n\n    if (m.pointer) c.uint.preencode(state, m.pointer)\n    if (m.key) c.fixed32.preencode(state, m.key)\n  },\n  encode(state, m) {\n    const flags = (m.pointer ? 1 : 0) | (m.key ? 2 : 0)\n\n    c.uint.encode(state, flags)\n\n    if (m.pointer) c.uint.encode(state, m.pointer)\n    if (m.key) c.fixed32.encode(state, m.key)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      pointer: (flags & 1) !== 0 ? c.uint.decode(state) : 0,\n      key: (flags & 2) !== 0 ? c.fixed32.decode(state) : null\n    }\n  }\n}\n\n// @autobase/node\nconst encoding10 = {\n  preencode(state, m) {\n    encoding1.preencode(state, m.heads)\n    c.uint.preencode(state, m.batch)\n    c.buffer.preencode(state, m.value)\n  },\n  encode(state, m) {\n    encoding1.encode(state, m.heads)\n    c.uint.encode(state, m.batch)\n    c.buffer.encode(state, m.value)\n  },\n  decode(state) {\n    const r0 = encoding1.decode(state)\n    const r1 = c.uint.decode(state)\n    const r2 = c.buffer.decode(state)\n\n    return {\n      heads: r0,\n      batch: r1,\n      value: r2\n    }\n  }\n}\n\n// @autobase/trace.system\nconst encoding11_0 = c.array(c.uint)\n// @autobase/trace.encryption\nconst encoding11_1 = encoding11_0\n\n// @autobase/trace\nconst encoding11 = {\n  preencode(state, m) {\n    encoding11_0.preencode(state, m.system)\n    encoding11_1.preencode(state, m.encryption)\n    encoding11_2.preencode(state, m.user)\n  },\n  encode(state, m) {\n    encoding11_0.encode(state, m.system)\n    encoding11_1.encode(state, m.encryption)\n    encoding11_2.encode(state, m.user)\n  },\n  decode(state) {\n    const r0 = encoding11_0.decode(state)\n    const r1 = encoding11_1.decode(state)\n    const r2 = encoding11_2.decode(state)\n\n    return {\n      system: r0,\n      encryption: r1,\n      user: r2\n    }\n  }\n}\n\nconst encoding12 = external0.OplogMessageV0\n\nconst encoding13 = external0.OplogMessageV1\n\n// @autobase/oplog-message-v2.checkpoint\nconst encoding14_1 = c.frame(encoding8)\n// @autobase/oplog-message-v2.digest\nconst encoding14_2 = c.frame(encoding9)\n// @autobase/oplog-message-v2.trace\nconst encoding14_4 = c.frame(encoding11)\n\n// @autobase/oplog-message-v2\nconst encoding14 = {\n  preencode(state, m) {\n    encoding10.preencode(state, m.node)\n    state.end++ // max flag is 8 so always one byte\n\n    if (m.checkpoint) encoding14_1.preencode(state, m.checkpoint)\n    if (m.digest) encoding14_2.preencode(state, m.digest)\n    if (m.trace) encoding14_4.preencode(state, m.trace)\n  },\n  encode(state, m) {\n    const flags =\n      (m.checkpoint ? 1 : 0) | (m.digest ? 2 : 0) | (m.optimistic ? 4 : 0) | (m.trace ? 8 : 0)\n\n    encoding10.encode(state, m.node)\n    c.uint.encode(state, flags)\n\n    if (m.checkpoint) encoding14_1.encode(state, m.checkpoint)\n    if (m.digest) encoding14_2.encode(state, m.digest)\n    if (m.trace) encoding14_4.encode(state, m.trace)\n  },\n  decode(state, version) {\n    if (version === undefined) version = c.uint.decode(state)\n    const r0 = encoding10.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      version,\n      node: r0,\n      checkpoint: (flags & 1) !== 0 ? encoding14_1.decode(state) : null,\n      digest: (flags & 2) !== 0 ? encoding14_2.decode(state) : null,\n      optimistic: (flags & 4) !== 0,\n      trace: (flags & 8) !== 0 ? encoding14_4.decode(state) : null\n    }\n  }\n}\n\n// @autobase/oplog-message\nconst encoding15 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.version)\n    switch (m.version) {\n      case 0:\n        encoding12.preencode(state, m)\n        break\n      case 1:\n        encoding13.preencode(state, m)\n        break\n      case 2:\n        encoding14.preencode(state, m)\n        break\n      default:\n        throw new Error('Unsupported version')\n    }\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.version)\n    switch (m.version) {\n      case 0:\n        encoding12.encode(state, m)\n        break\n      case 1:\n        encoding13.encode(state, m)\n        break\n      case 2:\n        encoding14.encode(state, m)\n        break\n      default:\n        throw new Error('Unsupported version')\n    }\n  },\n  decode(state) {\n    const version = c.uint.decode(state)\n    switch (version) {\n      case 0: {\n        const decoded = encoding12.decode(state, version)\n        return decoded\n      }\n      case 1: {\n        const decoded = encoding13.decode(state, version)\n        return decoded\n      }\n      case 2: {\n        const decoded = encoding14.decode(state, version)\n        return decoded\n      }\n      default:\n        throw new Error('Unsupported version')\n    }\n  }\n}\n\n// @autobase/info-v1.pendingIndexers\nconst encoding16_1 = c.array(c.fixed32)\n\n// @autobase/info-v1\nconst encoding16 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.members)\n    encoding16_1.preencode(state, m.pendingIndexers)\n    encoding1.preencode(state, m.indexers)\n    encoding1.preencode(state, m.heads)\n    encoding1.preencode(state, m.views)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.members)\n    encoding16_1.encode(state, m.pendingIndexers)\n    encoding1.encode(state, m.indexers)\n    encoding1.encode(state, m.heads)\n    encoding1.encode(state, m.views)\n  },\n  decode(state, version) {\n    if (version === undefined) version = c.uint.decode(state)\n    const r0 = c.uint.decode(state)\n    const r1 = encoding16_1.decode(state)\n    const r2 = encoding1.decode(state)\n    const r3 = encoding1.decode(state)\n    const r4 = encoding1.decode(state)\n\n    return {\n      version,\n      members: r0,\n      pendingIndexers: r1,\n      indexers: r2,\n      heads: r3,\n      views: r4\n    }\n  }\n}\n\n// @autobase/info-v2.pendingIndexers\nconst encoding17_1 = encoding16_1\n\n// @autobase/info-v2\nconst encoding17 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.members)\n    encoding17_1.preencode(state, m.pendingIndexers)\n    encoding1.preencode(state, m.indexers)\n    encoding1.preencode(state, m.heads)\n    encoding1.preencode(state, m.views)\n    c.uint.preencode(state, m.encryptionLength)\n    state.end++ // max flag is 1 so always one byte\n\n    if (m.entropy) c.fixed32.preencode(state, m.entropy)\n  },\n  encode(state, m) {\n    const flags = m.entropy ? 1 : 0\n\n    c.uint.encode(state, m.members)\n    encoding17_1.encode(state, m.pendingIndexers)\n    encoding1.encode(state, m.indexers)\n    encoding1.encode(state, m.heads)\n    encoding1.encode(state, m.views)\n    c.uint.encode(state, m.encryptionLength)\n    c.uint.encode(state, flags)\n\n    if (m.entropy) c.fixed32.encode(state, m.entropy)\n  },\n  decode(state, version) {\n    if (version === undefined) version = c.uint.decode(state)\n    const r0 = c.uint.decode(state)\n    const r1 = encoding17_1.decode(state)\n    const r2 = encoding1.decode(state)\n    const r3 = encoding1.decode(state)\n    const r4 = encoding1.decode(state)\n    const r5 = c.uint.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      version,\n      members: r0,\n      pendingIndexers: r1,\n      indexers: r2,\n      heads: r3,\n      views: r4,\n      encryptionLength: r5,\n      entropy: (flags & 1) !== 0 ? c.fixed32.decode(state) : null\n    }\n  }\n}\n\n// @autobase/info\nconst encoding18 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.version)\n    switch (m.version) {\n      case 0:\n      case 1:\n        encoding16.preencode(state, m)\n        break\n      case 2:\n        encoding17.preencode(state, m)\n        break\n      default:\n        throw new Error('Unsupported version')\n    }\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.version)\n    switch (m.version) {\n      case 0:\n      case 1:\n        encoding16.encode(state, m)\n        break\n      case 2:\n        encoding17.encode(state, m)\n        break\n      default:\n        throw new Error('Unsupported version')\n    }\n  },\n  decode(state) {\n    const version = c.uint.decode(state)\n    switch (version) {\n      case 0:\n      case 1: {\n        const decoded = encoding16.decode(state, version)\n        const map = external0.infoLegacyMap\n        return map(decoded)\n      }\n      case 2: {\n        const decoded = encoding17.decode(state, version)\n        return decoded\n      }\n      default:\n        throw new Error('Unsupported version')\n    }\n  }\n}\n\n// @autobase/member\nconst encoding19 = {\n  preencode(state, m) {\n    state.end++ // max flag is 2 so always one byte\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    const flags = (m.isIndexer ? 1 : 0) | (m.isRemoved ? 2 : 0)\n\n    c.uint.encode(state, flags)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      isIndexer: (flags & 1) !== 0,\n      isRemoved: (flags & 2) !== 0,\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst encoding20 = external0.LinearizerKey\n\n// @autobase/linearizer-update\nconst encoding21 = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.key)\n    c.uint.preencode(state, m.length)\n    c.uint.preencode(state, m.batch)\n    c.uint.preencode(state, m.systemLength)\n    state.end++ // max flag is 1 so always one byte\n  },\n  encode(state, m) {\n    const flags = m.indexers ? 1 : 0\n\n    c.fixed32.encode(state, m.key)\n    c.uint.encode(state, m.length)\n    c.uint.encode(state, m.batch)\n    c.uint.encode(state, m.systemLength)\n    c.uint.encode(state, flags)\n  },\n  decode(state) {\n    const r0 = c.fixed32.decode(state)\n    const r1 = c.uint.decode(state)\n    const r2 = c.uint.decode(state)\n    const r3 = c.uint.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      key: r0,\n      length: r1,\n      batch: r2,\n      systemLength: r3,\n      indexers: (flags & 1) !== 0\n    }\n  }\n}\n\n// @autobase/encryption-descriptor\nconst encoding22 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.type)\n    c.buffer.preencode(state, m.payload)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.type)\n    c.buffer.encode(state, m.payload)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = c.buffer.decode(state)\n\n    return {\n      type: r0,\n      payload: r1\n    }\n  }\n}\n\n// @autobase/manifest-data\nconst encoding23 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.version)\n    state.end++ // max flag is 2 so always one byte\n\n    if (m.legacyBlocks) c.uint.preencode(state, m.legacyBlocks)\n    if (m.namespace) c.fixed32.preencode(state, m.namespace)\n  },\n  encode(state, m) {\n    const flags = (m.legacyBlocks ? 1 : 0) | (m.namespace ? 2 : 0)\n\n    c.uint.encode(state, m.version)\n    c.uint.encode(state, flags)\n\n    if (m.legacyBlocks) c.uint.encode(state, m.legacyBlocks)\n    if (m.namespace) c.fixed32.encode(state, m.namespace)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      version: r0,\n      legacyBlocks: (flags & 1) !== 0 ? c.uint.decode(state) : 0,\n      namespace: (flags & 2) !== 0 ? c.fixed32.decode(state) : null\n    }\n  }\n}\n\n// @autobase/user-view-trace.blocks\nconst encoding24_1 = encoding11_0\n\n// @autobase/user-view-trace\nconst encoding24 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.view)\n    encoding24_1.preencode(state, m.blocks)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.view)\n    encoding24_1.encode(state, m.blocks)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = encoding24_1.decode(state)\n\n    return {\n      view: r0,\n      blocks: r1\n    }\n  }\n}\n\n// @autobase/trace.user, deferred due to recusive use\nconst encoding11_2 = c.array(encoding24)\n\nfunction setVersion(v) {\n  version = v\n}\n\nfunction encode(name, value, v = VERSION) {\n  version = v\n  return c.encode(getEncoding(name), value)\n}\n\nfunction decode(name, buffer, v = VERSION) {\n  version = v\n  return c.decode(getEncoding(name), buffer)\n}\n\nfunction getEnum(name) {\n  switch (name) {\n    default:\n      throw new Error('Enum not found ' + name)\n  }\n}\n\nfunction getEncoding(name) {\n  switch (name) {\n    case '@autobase/checkout':\n      return encoding0\n    case '@autobase/clock':\n      return encoding1\n    case '@autobase/index-checkpoint':\n      return encoding2\n    case '@autobase/wakeup':\n      return encoding3\n    case '@autobase/boot-record-v0':\n      return encoding4\n    case '@autobase/boot-record-raw':\n      return encoding5\n    case '@autobase/boot-record':\n      return encoding6\n    case '@autobase/checkpointer':\n      return encoding7\n    case '@autobase/checkpoint':\n      return encoding8\n    case '@autobase/digest':\n      return encoding9\n    case '@autobase/node':\n      return encoding10\n    case '@autobase/trace':\n      return encoding11\n    case '@autobase/oplog-message-v0':\n      return encoding12\n    case '@autobase/oplog-message-v1':\n      return encoding13\n    case '@autobase/oplog-message-v2':\n      return encoding14\n    case '@autobase/oplog-message':\n      return encoding15\n    case '@autobase/info-v1':\n      return encoding16\n    case '@autobase/info-v2':\n      return encoding17\n    case '@autobase/info':\n      return encoding18\n    case '@autobase/member':\n      return encoding19\n    case '@autobase/linearizer-key':\n      return encoding20\n    case '@autobase/linearizer-update':\n      return encoding21\n    case '@autobase/encryption-descriptor':\n      return encoding22\n    case '@autobase/manifest-data':\n      return encoding23\n    case '@autobase/user-view-trace':\n      return encoding24\n    default:\n      throw new Error('Encoder not found ' + name)\n  }\n}\n\nfunction getStruct(name, v = VERSION) {\n  const enc = getEncoding(name)\n  return {\n    preencode(state, m) {\n      version = v\n      enc.preencode(state, m)\n    },\n    encode(state, m) {\n      version = v\n      enc.encode(state, m)\n    },\n    decode(state) {\n      version = v\n      return enc.decode(state)\n    }\n  }\n}\n\nconst resolveStruct = getStruct // compat\n\nmodule.exports = {\n  resolveStruct,\n  getStruct,\n  getEnum,\n  getEncoding,\n  encode,\n  decode,\n  setVersion,\n  version\n}\nconst b4a = require('b4a')\nconst ReadyResource = require('ready-resource')\nconst debounceify = require('debounceify')\nconst c = require('compact-encoding')\nconst safetyCatch = require('safety-catch')\nconst hypercoreId = require('hypercore-id-encoding')\nconst assert = require('nanoassert')\nconst SignalPromise = require('signal-promise')\nconst CoreCoupler = require('core-coupler')\nconst ProtomuxWakeup = require('protomux-wakeup')\nconst rrp = require('resolve-reject-promise')\nconst Hypercore = require('hypercore')\nconst ScopeLock = require('scope-lock')\nconst encryptionEncoding = require('encryption-encoding')\n\nconst LocalState = require('./lib/local-state.js')\nconst Linearizer = require('./lib/linearizer.js')\nconst SystemView = require('./lib/system.js')\nconst { EncryptionView } = require('./lib/encryption.js')\nconst UpdateChanges = require('./lib/updates.js')\nconst messages = require('./lib/messages.js')\nconst Timer = require('./lib/timer.js')\nconst Writer = require('./lib/writer.js')\nconst { encodeValue, decodeValue } = require('./lib/values.js')\nconst ActiveWriters = require('./lib/active-writers.js')\nconst AutoWakeup = require('./lib/wakeup.js')\n\nconst FastForward = require('./lib/fast-forward.js')\nconst AutoStore = require('./lib/store.js')\nconst ApplyState = require('./lib/apply-state.js')\nconst AppendBatch = require('./lib/append-batch.js')\nconst { PublicApplyCalls } = require('./lib/apply-calls.js')\nconst boot = require('./lib/boot.js')\nconst { MAX_AUTOBASE_VERSION, BOOT_RECORD_VERSION } = require('./lib/caps.js')\n\nconst inspect = Symbol.for('nodejs.util.inspect.custom')\nconst INTERRUPT = new Error('Apply interrupted')\nconst BINARY_ENCODING = c.from('binary')\n\nconst RECOVERIES = 3\n\n// default is to automatically ack\nconst DEFAULT_ACK_INTERVAL = 10_000\nconst DEFAULT_ACK_THRESHOLD = 4\n\nconst REMOTE_ADD_BATCH = 64\nconst REMOTE_ADD_BATCH_SANITY = 4096\nconst MIN_FF_WAIT = 300_000 // wait at least 5min before attempting to ff again after failure\n\nclass WakeupHandler {\n  constructor(base, discoveryKey) {\n    this.active = true\n    this.discoveryKey = discoveryKey\n    this.base = base\n  }\n\n  onpeeractive(peer, session) {\n    this.base._bumpWakeupPeer(peer)\n  }\n\n  onlookup(req, peer, session) {\n    const wakeup = this.base._getWakeup()\n    if (wakeup.length === 0) return\n    session.announce(peer, wakeup)\n  }\n\n  onannounce(wakeup, peer, session) {\n    if (this.base.isFastForwarding()) {\n      this.base._needsWakeupRequest = true\n      return\n    }\n    this.base.hintWakeup(wakeup)\n  }\n}\n\nmodule.exports = class Autobase extends ReadyResource {\n  constructor(store, bootstrap, handlers = {}) {\n    if (Array.isArray(bootstrap)) bootstrap = bootstrap[0] // TODO: just a quick compat, lets remove soon\n\n    if (bootstrap && typeof bootstrap !== 'string' && !b4a.isBuffer(bootstrap)) {\n      handlers = bootstrap\n      bootstrap = null\n    }\n\n    super()\n\n    const key = bootstrap ? toKey(bootstrap) : null\n\n    this.id = null\n    this.key = key\n    this.discoveryKey = null\n    this.backoff = handlers.backoff || null\n\n    this.keyPair = null\n    this.valueEncoding = c.from(handlers.valueEncoding || 'binary')\n    this.store = store\n    this.globalCache = store.globalCache || null\n    this.migrated = false\n\n    this.encrypted = handlers.encrypted || !!handlers.encryptionKey\n    this.encrypt = !!handlers.encrypt\n    this.encryptionKey = null\n    this.encryption = null\n    this.blindEncryption = handlers.blindEncryption || null\n\n    this.activeBatch = null // maintained by the append-batch\n\n    this.local = null\n    this.localWriter = null\n    this.isIndexer = false\n\n    this.activeWriters = new ActiveWriters()\n    this.linearizer = null\n    this.updating = false\n\n    this.nukeTip = !!handlers.nukeTip\n\n    this.wakeupOwner = !handlers.wakeup\n    this.wakeupCapability = null\n    this.wakeupProtocol = handlers.wakeup || new ProtomuxWakeup()\n    this.wakeupSession = null\n\n    this._primaryBootstrap = null\n\n    this.fastForwardEnabled = handlers.fastForward !== false\n    this.fastForwarding = null\n    this.fastForwardTo = null\n    this.fastForwardFailedAt = 0\n    this.fastForwardMinimum = FastForward.MINIMUM\n\n    this.bigBatches = !!handlers.bigBatches\n\n    this._bootstrapWriters = [] // might contain dups, but thats ok\n    this._bootstrapWritersChanged = false\n\n    this._flushSignal = new SignalPromise()\n    this._flushing = 0\n\n    this._checkWriters = []\n    this._optimistic = -1\n    this._appended = 0\n    this._appending = null\n    this._wakeup = new AutoWakeup(this)\n    this._wakeupHints = new Map()\n    this._wakeupPeerBound = this._wakeupPeer.bind(this)\n    this._coupler = null\n\n    this._updateLocalCore = null\n    this._lock = new ScopeLock()\n\n    this._needsWakeupRequest = false\n    this._needsWakeup = true\n    this._needsWakeupHeads = true\n\n    this._updates = []\n    this._handlers = handlers || {}\n    this._warn = emitWarning.bind(this)\n    this._lastError = null\n\n    this._draining = false\n    this._writable = null\n    this._advancing = null\n    this._interrupting = false\n    this._caughtup = false\n\n    this.paused = false\n\n    this._bump = debounceify(() => {\n      this._advancing = this._advance()\n      return this._advancing\n    })\n\n    this._onremotewriterchangeBound = this._onremotewriterchange.bind(this)\n    this._onlocalwriterchangeBound = this._onlocalwriterchange.bind(this)\n\n    this._preopen = null\n\n    this._hasOpen = !!this._handlers.open\n    this._hasApply = !!this._handlers.apply\n    this._hasOptimisticApply = !!this._handlers.optimistic\n    this._hasUpdate = !!this._handlers.update\n    this._hasClose = !!this._handlers.close\n\n    this._viewStore = new AutoStore(this)\n    this._applyState = null\n\n    this.view = null\n    this.core = null\n    this.version = -1\n    this.interrupted = null\n    this.recoveries = RECOVERIES\n\n    const { ackInterval = DEFAULT_ACK_INTERVAL, ackThreshold = DEFAULT_ACK_THRESHOLD } = handlers\n\n    this._ackInterval = ackInterval\n    this._ackThreshold = ackThreshold\n    this._ackTickThreshold = ackThreshold\n    this._ackTick = 0\n\n    this._ackTimer = null\n    this._acking = false\n\n    this._waiting = new SignalPromise()\n\n    this.view = this._hasOpen\n      ? this._handlers.open(this._viewStore, new PublicApplyCalls(this))\n      : null\n    this.core = this._viewStore.get({ name: '_system' })\n\n    if (this.fastForwardEnabled && isObject(handlers.fastForward)) {\n      this._runFastForward(\n        new FastForward(this, handlers.fastForward.key, { verified: false })\n      ).catch(noop)\n    }\n\n    this.ready().catch(safetyCatch)\n  }\n\n  [inspect](depth, opts) {\n    let indent = ''\n    if (typeof opts.indentationLvl === 'number') {\n      while (indent.length < opts.indentationLvl) indent += ' '\n    }\n\n    return indent + 'Autobase { ... }'\n  }\n\n  // just compat, use .key\n  get bootstrap() {\n    return this.key\n  }\n\n  // TODO: compat, will be removed\n  get bootstraps() {\n    return [this.bootstrap]\n  }\n\n  get appending() {\n    return this._appending !== null && this._appending.length > 0\n  }\n\n  get writable() {\n    return this.localWriter !== null && !this.localWriter.isRemoved\n  }\n\n  get ackable() {\n    return this.localWriter !== null && this.localWriter.isActiveIndexer\n  }\n\n  get signedLength() {\n    return this.core.signedLength\n  }\n\n  get indexedLength() {\n    return this._applyState ? this._applyState.indexedLength : 0\n  }\n\n  get length() {\n    return this.core.length\n  }\n\n  get flushing() {\n    return this._flushing > 0\n  }\n\n  hash() {\n    return this.core.treeHash()\n  }\n\n  // deprecated, use .core.key\n  getSystemKey() {\n    return this.core.key\n  }\n\n  get system() {\n    return this._applyState && this._applyState.system\n  }\n\n  // deprecated\n  async getIndexedInfo() {\n    if (this.opened === false) await this.ready()\n    return (\n      this._applyState && this._applyState.system.getIndexedInfo(this._applyState.indexedLength)\n    )\n  }\n\n  _isActiveIndexer() {\n    return this.localWriter ? this.localWriter.isActiveIndexer : false\n  }\n\n  replicate(isInitiator, opts) {\n    const stream = this.store.replicate(isInitiator, opts)\n    this.wakeupProtocol.addStream(stream)\n    return stream\n  }\n\n  heads() {\n    if (!this._applyState || !this._applyState.opened) return []\n    const nodes = new Array(this._applyState.system.heads.length)\n    for (let i = 0; i < this._applyState.system.heads.length; i++)\n      nodes[i] = this._applyState.system.heads[i]\n    return nodes.sort(compareNodes)\n  }\n\n  async export() {\n    const exporting = [this.store.storage.export(this.local.discoveryKey), this._viewStore.export()]\n\n    const [local, views] = await Promise.all(exporting)\n\n    return {\n      local,\n      views\n    }\n  }\n\n  hintWakeup(hints) {\n    if (!Array.isArray(hints)) hints = [hints]\n    for (const { key, length } of hints) {\n      const hex = b4a.toString(key, 'hex')\n      const prev = this._wakeupHints.get(hex)\n      if (!prev || length === -1 || prev < length) this._wakeupHints.set(hex, length)\n    }\n    this._queueBump()\n  }\n\n  setBigBatches(bool = true) {\n    this.bigBatches = bool\n  }\n\n  _queueBump() {\n    this._bump().catch(safetyCatch)\n  }\n\n  async _runPreOpen() {\n    if (this._handlers.wait) await this._handlers.wait()\n\n    await this.store.ready()\n\n    this.keyPair = (await this._handlers.keyPair) || null\n\n    if (this._handlers.encryptionKey !== null) {\n      this.encryptionKey = await this._handlers.encryptionKey\n    }\n\n    const result = await boot(this.store, this.key, {\n      encryptionKey: this.encryptionKey,\n      encrypt: this.encrypt,\n      keyPair: this.keyPair,\n      blindEncryption: this.blindEncryption\n    })\n\n    this._primaryBootstrap = result.bootstrap\n    this.local = result.local\n\n    this.key = result.bootstrap.key\n    this.discoveryKey = result.bootstrap.discoveryKey\n    this.id = result.bootstrap.id\n\n    this.encryptionKey = result.encryptionKey\n\n    if (this.encrypted) {\n      assert(this.encryptionKey !== null, 'Encryption key is expected')\n    }\n\n    if (this.encryptionKey) {\n      this.encryption = new EncryptionView(this, null)\n\n      this.local.setEncryption(this.getWriterEncryption())\n      this._primaryBootstrap.setEncryption(this.getWriterEncryption())\n    }\n\n    if (this.nukeTip) await this._nukeTip()\n\n    this.local.on('append', this._onlocalwriterchangeBound)\n\n    this.wakeupCapability = (await this._handlers.wakeupCapability) || {\n      key: this.key,\n      discoveryKey: this.discoveryKey\n    }\n    this.setWakeup(this.wakeupCapability.key, this.wakeupCapability.discoveryKey)\n  }\n\n  async _nukeTipBatch(key, length) {\n    const core = this.store.get({ key, active: false })\n    await core.ready()\n\n    const batch = core.session({ name: 'batch' })\n    await batch.ready()\n    if (batch.length > length) await batch.truncate(length)\n    await batch.close()\n\n    await core.close()\n  }\n\n  // TODO: not atomic atm, so more of a (very useful) debug helper\n  async _nukeTip() {\n    const pointer = await this.local.getUserData('autobase/boot')\n    if (!pointer) return\n\n    const boot = c.decode(messages.BootRecord, pointer)\n\n    await LocalState.clear(this.local)\n\n    await this._nukeTipBatch(boot.key, boot.systemLength)\n\n    const core = this.store.get({ key: boot.key, active: false, encryption: null })\n    const encCore = await EncryptionView.setSystemEncryption(this, core)\n\n    const batch = core.session({ name: 'batch' })\n    await batch.ready()\n\n    const info = await SystemView.getIndexedInfo(batch, boot.systemLength)\n    await batch.close()\n\n    for (const view of info.views) {\n      // ensure any views ref'ed by system are consistent as well\n      await this._nukeTipBatch(view.key, view.length)\n    }\n\n    if (boot.heads) this.hintWakeup(boot.heads)\n    if (this.local.length) this.hintWakeup([{ key: this.local.key, length: this.local.length }])\n\n    await core.close()\n    if (encCore) await encCore.close()\n  }\n\n  _bumpWakeupPeer(peer) {\n    if (this._coupler) this._coupler.update(peer.stream)\n  }\n\n  async _rotateLocalWriter(newLocal) {\n    assert(!this.appending, 'Cannot rotate a newLocal writer if an append is in progress')\n\n    const oldLocal = this.local\n\n    if (this._applyState) await this._applyState.close()\n\n    this.local = newLocal\n    this.local.on('append', this._onlocalwriterchangeBound)\n\n    this.localWriter = null\n    this._updateLocalCore = null\n\n    const store = this._viewStore.atomize()\n\n    const local = store.getLocal()\n    await local.ready()\n\n    await LocalState.moveTo(oldLocal, local)\n\n    await local.setUserData('referrer', this.key)\n    if (this.encryptionKey) {\n      if (this.blindEncryption) {\n        const encrypted = await encryptionEncoding.encrypt(\n          this.encryptionKey,\n          this.blindEncryption.encrypt\n        )\n        await local.setUserData('autobase/blind-encryption', encrypted)\n      } else {\n        await local.setUserData('autobase/encryption', this.encryptionKey)\n      }\n    }\n\n    await store.flush()\n    await store.close()\n\n    await this._primaryBootstrap.setUserData('autobase/local', local.key)\n\n    await this._clearWriters()\n    await oldLocal.close()\n\n    // done, soft reboot\n\n    await this._viewStore.updateLocal()\n\n    await this._clearWriters()\n\n    this._applyState = new ApplyState(this)\n    await this._applyState.ready()\n    await this._makeLinearizerFromViewState()\n\n    this._caughtup = false\n\n    this._rebooted()\n\n    this.emit('rotate-local-writer')\n  }\n\n  async setLocal(key, { keyPair } = {}) {\n    if (!this.opened) await this.ready()\n\n    const manifest = keyPair\n      ? { version: this.store.manifestVersion, signers: [{ publicKey: keyPair.publicKey }] }\n      : null\n    if (!key) key = Hypercore.key(manifest)\n    // If the keys are the same, no need to rotate\n    if (b4a.equals(key, this.local.key)) return\n\n    const encryption = this.encryptionKey ? this.getWriterEncryption() : null\n\n    const local = this.store.get({\n      key,\n      manifest,\n      active: false,\n      exclusive: true,\n      encryption,\n      valueEncoding: messages.OplogMessage\n    })\n    await local.ready()\n\n    this._updateLocalCore = local\n\n    let runs = 0\n    while (!this._interrupting && this.appending && runs++ < 16) await this.update()\n    await this._bump()\n  }\n\n  setWakeup(cap, discoveryKey) {\n    if (this.wakeupSession) this.wakeupSession.destroy()\n    if (!discoveryKey && b4a.equals(cap, this.key)) discoveryKey = this.discoveryKey\n    this.wakeupSession = this.wakeupProtocol.session(\n      cap,\n      new WakeupHandler(this, discoveryKey || null)\n    )\n\n    // incase this session has active peers already, bump the coupler\n    for (const peer of this.wakeupSession.peers) {\n      if (peer.active) this._bumpWakeupPeer(peer)\n    }\n  }\n\n  async _getMigrationPointer(key, length) {\n    const core = this.store.get({ key, active: false, encryption: null })\n    const encCore = await EncryptionView.setSystemEncryption(this, core)\n\n    const min = core.manifest && core.manifest.prologue ? core.manifest.prologue.length : 0\n\n    for (let i = length - 1; i >= min; i--) {\n      if (!(await core.has(i))) continue\n\n      const sys = new SystemView(core, { checkout: i + 1 })\n      await sys.ready()\n\n      let good = true\n\n      for (const v of sys.views) {\n        const vc = this.store.get({ key: v.key, active: false })\n        await vc.ready()\n        if (vc.length < v.length) good = false\n        await vc.close()\n      }\n\n      await sys.close()\n      if (!good) continue\n\n      return i + 1\n    }\n\n    await core.close()\n    if (encCore) await encCore.close()\n\n    return min\n  }\n\n  // migrating from 6 -> latest\n  async _migrate6(key, length) {\n    const core = this.store.get({ key, active: false })\n    await core.ready()\n    const batch = core.session({ name: 'batch', overwrite: true, checkout: length })\n    await batch.ready()\n    await batch.close()\n    await core.close()\n  }\n\n  // called by view-store for bootstrapping\n  async _getSystemInfo() {\n    const boot = await this._getBootRecord()\n    if (!boot.key) return null\n\n    const migrated = !!boot.heads\n    const indexedLength = boot.systemLength\n\n    if (migrated) {\n      // ensure system batch is consistent on initial migration\n      await this._migrate6(boot.key, indexedLength)\n    }\n\n    const core = this.store.get({ key: boot.key, encryption: null, active: false })\n    await core.ready()\n\n    const batch = core.session({ name: 'batch' })\n    const encCore = await EncryptionView.setSystemEncryption(this, batch)\n\n    const info = await SystemView.getIndexedInfo(batch, indexedLength)\n\n    if (encCore) await encCore.close()\n    await batch.close()\n    await core.close()\n\n    if (info.version > MAX_AUTOBASE_VERSION) {\n      throw new Error('Autobase upgrade required.')\n    }\n\n    // just compat\n    if (migrated) {\n      this.migrated = true\n\n      for (const view of info.views) {\n        // ensure any views ref'ed by system are consistent as well\n        await this._migrate6(view.key, view.length)\n      }\n\n      if (boot.heads) this.hintWakeup(boot.heads)\n      if (this.local.length) this.hintWakeup([{ key: this.local.key, length: this.local.length }])\n    }\n\n    return {\n      key: boot.key,\n      indexers: info.indexers,\n      views: info.views,\n      entropy: info.entropy\n    }\n  }\n\n  // called by the apply state for bootstrapping\n  async _getBootRecord() {\n    await this._preopen\n\n    const pointer = await this.local.getUserData('autobase/boot')\n\n    const boot = pointer\n      ? c.decode(messages.BootRecord, pointer)\n      : {\n          version: BOOT_RECORD_VERSION,\n          key: null,\n          systemLength: 0,\n          indexersUpdated: false,\n          fastForwarding: false,\n          recoveries: RECOVERIES,\n          heads: null\n        }\n\n    if (boot.heads) {\n      const len = await this._getMigrationPointer(boot.key, boot.systemLength)\n      if (len !== boot.systemLength)\n        this._warn(\n          new Error(\n            'Invalid pointer in migration, correcting (' + len + ' vs ' + boot.systemLength + ')'\n          )\n        )\n      boot.systemLength = len\n    }\n\n    return boot\n  }\n\n  static async getBootRecord(store, key) {\n    const result = await boot(store, key, { exclusive: false })\n    await result.bootstrap.close()\n    await result.local.close()\n    return result.boot\n  }\n\n  _interrupt(reason) {\n    assert(!!this._applyState.applying, 'Interrupt is only allowed in apply')\n    this._interrupting = true\n    if (reason) this.interrupted = reason\n    throw INTERRUPT\n  }\n\n  async flush() {\n    if (this._flushing === 0) return\n    return this._flushSignal.wait()\n  }\n\n  async advance() {\n    if (this.opened === false) await this.ready()\n    await this._advancing\n  }\n\n  recouple() {\n    if (this._coupler) this._coupler.destroy()\n    const core = this._viewStore.getSystemCore()\n    this._coupler = new CoreCoupler(core, this._wakeupPeerBound)\n  }\n\n  _updateBootstrapWriters() {\n    const writers = this.linearizer.getBootstrapWriters()\n\n    // first clear all, but without applying it for churn reasons\n    for (const writer of this._bootstrapWriters) {\n      writer.isBootstrap = false\n      writer.isCoupled = false\n    }\n\n    // all passed are bootstraps\n    for (const writer of writers) {\n      writer.isCoupled = true\n      writer.setBootstrap(true)\n    }\n\n    // reset activity on old ones, all should be in sync now\n    for (const writer of this._bootstrapWriters) {\n      if (writer.isBootstrap === false) writer.setBootstrap(false)\n    }\n\n    this._bootstrapWriters = writers\n    this._bootstrapWritersChanged = false\n  }\n\n  async _openLinearizer() {\n    if (this._applyState.system.bootstrapping) {\n      await this._makeLinearizer(null)\n      this._bootstrapLinearizer()\n      return\n    }\n\n    await this._makeLinearizerFromViewState()\n  }\n\n  async _catchupApplyState() {\n    if (await this._applyState.shouldMigrate()) {\n      await this._migrate()\n    } else if (!(await this._applyState.catchup(this.linearizer))) {\n      return false\n    }\n\n    this._caughtup = true\n    return true\n  }\n\n  async _open() {\n    this._preopen = this._runPreOpen()\n    await this._preopen\n\n    if (this.closing) return\n\n    this._applyState = new ApplyState(this)\n\n    try {\n      await this._applyState.ready()\n    } catch (err) {\n      if (this.closing) return\n\n      try {\n        await this._applyState.close()\n      } catch {}\n\n      try {\n        await this.core.ready()\n      } catch {}\n\n      this._applyState = null\n      if (this.closing) return\n\n      throw err\n    }\n\n    try {\n      await this._openLinearizer()\n      await this.core.ready()\n      await this._wakeup.ready()\n    } catch (err) {\n      if (this.closing) return\n      throw err\n    }\n\n    if (this.core.length - this._applyState.indexedLength > this._ackTickThreshold) {\n      this._ackTick = this._ackTickThreshold\n    }\n    if (this.localWriter && this._ackInterval) {\n      this._startAckTimer()\n    }\n\n    this._updateBootstrapWriters()\n\n    this.recouple()\n    this._queueFastForward()\n\n    // queue a full bump that handles wakeup etc (not legal to wait for that here)\n    this._queueBump()\n  }\n\n  async _close() {\n    await this.flush() // flush all pending non network io\n    this._interrupting = true\n    await Promise.resolve() // defer one tick\n\n    if (this.wakeupSession) this.wakeupSession.destroy()\n    if (this.wakeupOwner) this.wakeupProtocol.destroy()\n\n    if (this.fastForwarding) await this.fastForwarding.close()\n\n    if (this._coupler) this._coupler.destroy()\n    this._coupler = null\n    this._waiting.notify(null)\n\n    await this.activeWriters.clear()\n\n    const closing = this._advancing ? this._advancing.catch(safetyCatch) : null\n\n    await this._clearWriters()\n    if (this._primaryBootstrap) await this._primaryBootstrap.close()\n    await this.local.close()\n\n    if (this._ackTimer) {\n      this._ackTimer.stop()\n      await this._ackTimer.flush()\n    }\n\n    await this._wakeup.close()\n\n    if (this._hasClose) await this._handlers.close(this.view)\n    if (this._applyState) await this._applyState.close()\n\n    await this._viewStore.close()\n    await this.core.close()\n    await this.store.close()\n\n    if (this._writable) this._writable.resolve(false)\n\n    await closing\n  }\n\n  getLastError() {\n    return this._lastError\n  }\n\n  _onError(err) {\n    if (this.closing) return\n\n    this._lastError = err\n\n    if (err === INTERRUPT) {\n      this.emit('interrupt', this.interrupted)\n      this.emit('update')\n      return\n    }\n\n    this.close().catch(safetyCatch)\n\n    // if no one is listening we should crash! we cannot rely on the EE here\n    // as this is wrapped in a promise so instead of nextTick throw it\n    if (ReadyResource.listenerCount(this, 'error') === 0) {\n      crashSoon(err)\n      return\n    }\n\n    this.emit('error', err)\n  }\n\n  async _closeWriter(w) {\n    this.activeWriters.delete(w)\n    await w.close()\n  }\n\n  async _gcWriters() {\n    // just return early, why not\n    if (this._checkWriters.length === 0) return\n\n    while (this._checkWriters.length > 0) {\n      const w = this._checkWriters.pop()\n\n      // doesnt hurt\n      w.updateActivity()\n\n      if (!w.flushed()) continue\n\n      const unqueued = this._wakeup.unqueue(w.core.key, w.core.length)\n\n      if (!unqueued || w.isActiveIndexer) continue\n      if (this.localWriter === w) continue\n\n      await this._closeWriter(w)\n    }\n\n    await this._wakeup.flush()\n  }\n\n  _startAckTimer() {\n    if (this._ackTimer) return\n    this._ackTimer = new Timer(this._backgroundAck.bind(this), this._ackInterval)\n    this._bumpAckTimer()\n  }\n\n  _bumpAckTimer() {\n    if (!this._ackTimer) return\n    this._ackTimer.bump()\n  }\n\n  async update() {\n    if (this.opened === false) await this.ready()\n\n    try {\n      await this._bump()\n      if (this._acking) await this._bump() // if acking just rebump incase it was triggered from above...\n    } catch (err) {\n      if (this._interrupting) return\n      throw err\n    }\n  }\n\n  // runs in bg, not allowed to throw\n  // TODO: refactor so this only moves the writer affected to a updated set\n  async _onremotewriterchange() {\n    this._bumpAckTimer()\n\n    try {\n      await this._bump()\n    } catch {}\n  }\n\n  _onlocalwriterchange() {\n    if (!this.localWriter || this.localWriter.isRemoved) this._queueBump()\n  }\n\n  _onwakeup() {\n    this._needsWakeup = true\n    this._queueBump()\n  }\n\n  isFastForwarding() {\n    if (this.fastForwardTo !== null) return true\n    return this.fastForwardEnabled && this.fastForwarding !== null\n  }\n\n  _backgroundAck() {\n    return this.ack(true)\n  }\n\n  async ack(bg = false) {\n    if (this.opened === false) await this.ready()\n    if (this.localWriter === null || this._acking || this._interrupting || this._appending !== null)\n      return\n\n    if (this._applyState === null) {\n      try {\n        await this._bump()\n      } catch {}\n      if (this._applyState === null || this._interrupting) return\n    }\n\n    const applyState = this._applyState\n    if (applyState.opened === false) await applyState.ready()\n\n    const isPendingIndexer = applyState.isLocalPendingIndexer()\n\n    // if no one is waiting for our index manifest, wait for FF before pushing an ack\n    if ((!isPendingIndexer && this.isFastForwarding()) || this._interrupting) return\n\n    const isIndexer = applyState.isLocalIndexer() || isPendingIndexer\n    if (!isIndexer) return\n\n    this._acking = true\n\n    try {\n      await this._bump()\n    } catch (err) {\n      if (!this._interrupting) throw err\n    }\n\n    if (this._interrupting || !this.localWriter || this.localWriter.closed) {\n      this._acking = false\n      return\n    }\n\n    // avoid lumping acks together due to the bump wait here\n    if (this._ackTimer && bg) await this._ackTimer.asapStandalone()\n    if (this._interrupting || applyState.closing) {\n      this._acking = false\n      return\n    }\n\n    const alwaysWrite = isPendingIndexer || (await applyState.shouldWrite())\n    if (this._interrupting || applyState.closing) {\n      this._acking = false\n      return\n    }\n\n    const hasPendingIndexers = applyState.system.indexers.length > this.linearizer.indexers.length\n\n    if (alwaysWrite || this.linearizer.shouldAck(this.localWriter, hasPendingIndexers)) {\n      try {\n        if (this.localWriter && !this.localWriter.closed) await this.append(null)\n      } catch (err) {\n        if (!this._interrupting) throw err\n      }\n    }\n\n    if (!this._interrupting) {\n      this._updateAckThreshold()\n      this._bumpAckTimer()\n    }\n\n    this._acking = false\n  }\n\n  views() {\n    if (this._applyState) return this._applyState.store.listViews()\n    return this._viewStore.listViews()\n  }\n\n  batch() {\n    return new AppendBatch(this)\n  }\n\n  async append(value, opts) {\n    if (this.opened === false) await this.ready()\n    if (this._advancing !== null) await this._advancing\n    while (this.activeBatch) await this.activeBatch.flushed()\n    return this._appendBatch(value, opts)\n  }\n\n  async _appendBatch(value, opts) {\n    if (this._interrupting) throw new Error('Autobase is closing')\n    if (value && this.valueEncoding !== BINARY_ENCODING)\n      value = normalize(this.valueEncoding, value)\n\n    const optimistic = !!opts && !!opts.optimistic && !!value\n\n    // we wanna allow acks so interdexers can flush\n    if (\n      !optimistic &&\n      (this.localWriter === null || (this.localWriter.isRemoved && value !== null))\n    ) {\n      throw new Error('Not writable')\n    }\n\n    if (this._appending === null) this._appending = []\n\n    let len = 0\n    if (Array.isArray(value)) {\n      for (const v of value) len = this._append(v)\n    } else {\n      len = this._append(value)\n    }\n\n    const localLength = this.local.length\n\n    if (optimistic) this._optimistic = this._appending.length - 1\n    const target = this._appended + this._appending.length\n\n    // await in case append is in current tick\n    if (this._advancing) await this._advancing\n\n    let runs = 0\n\n    // bump until we've flushed the nodes\n    while (this._appended < target && !this._interrupting) {\n      await this._bump()\n      // safety\n      if (runs++ >= 16 && this.localWriter && this.localWriter.idle()) break\n    }\n\n    if (this._advancing) await this._advancing\n    if (this._interrupting) throw new Error('Autobase is closing')\n\n    return localLength + len\n  }\n\n  _append(value) {\n    // if prev value is an ack that hasnt been flushed, skip it\n    if (this._appending.length > 0) {\n      if (value === null) return this._appending.length\n      if (this._appending[this._appending.length - 1] === null) {\n        this._appending.pop()\n      }\n    }\n    return this._appending.push(value)\n  }\n\n  static decodeValue(value, opts) {\n    return decodeValue(value, opts)\n  }\n\n  static encodeValue(value, opts) {\n    return encodeValue(value, opts)\n  }\n\n  static async getLocalKey(store, opts = {}) {\n    const core = opts.keyPair\n      ? store.get({ ...opts, active: false })\n      : store.get({ ...opts, name: 'local', active: false })\n    await core.ready()\n    const key = core.key\n    await core.close()\n    return key\n  }\n\n  static getLocalCore(store, handlers, encryptionKey) {\n    const encryption = !encryptionKey ? null : { key: encryptionKey }\n    const opts = {\n      ...handlers,\n      compat: false,\n      active: false,\n      exclusive: true,\n      valueEncoding: messages.OplogMessage,\n      encryption\n    }\n    return opts.keyPair ? store.get(opts) : store.get({ ...opts, name: 'local' })\n  }\n\n  static async getUserData(core) {\n    const view = await core.getUserData('autobase/view')\n\n    return {\n      referrer: await core.getUserData('referrer'),\n      view: view ? b4a.toString(view) : null\n    }\n  }\n\n  static async isAutobase(core, opts = {}) {\n    const block = await core.get(0, opts)\n    if (!block) throw new Error('Core is empty.')\n    if (!b4a.isBuffer(block)) return isAutobaseMessage(block)\n\n    try {\n      const m = c.decode(messages.OplogMessage, block)\n      return isAutobaseMessage(m)\n    } catch {\n      return false\n    }\n  }\n\n  // no guarantees where the user data is stored, just that its associated with the base\n  async setUserData(key, val) {\n    await this._preopen\n    const core = this._primaryBootstrap === null ? this.local : this._primaryBootstrap\n\n    await core.setUserData(key, val)\n  }\n\n  async getUserData(key) {\n    await this._preopen\n    const core = this._primaryBootstrap === null ? this.local : this._primaryBootstrap\n\n    return await core.getUserData(key)\n  }\n\n  _needsLocalWriter() {\n    return this.localWriter === null || this.localWriter.closed\n  }\n\n  // no guarantees about writer.isActiveIndexer property here\n  async _getWriterByKey(key, len, seen, allowGC, isAdded, system) {\n    assert(this._draining === true || (this.opening && !this.opened) || this._optimistic > -1)\n\n    await this._lock.lock()\n\n    if (this._interrupting) {\n      this._lock.unlock()\n      throw new Error('Autobase is closing')\n    }\n\n    try {\n      let w = this.activeWriters.get(key)\n\n      const alreadyActive = !!w\n      const sys = system || this._applyState.system\n      const writerInfo = await sys.get(key)\n\n      if (len === -1) {\n        if (!allowGC && writerInfo === null) {\n          if (w) w.isRemoved = !isAdded\n          return null\n        }\n\n        len = writerInfo === null ? 0 : writerInfo.length\n      }\n\n      const isActive = writerInfo !== null && (isAdded || !writerInfo.isRemoved)\n      const isRemoved = !isActive\n\n      if (w) {\n        w.isRemoved = isRemoved\n      } else {\n        w = this._makeWriter(key, len, isActive, isRemoved)\n        if (!w) return null\n      }\n\n      if (isRemoved && sys.bootstrapping && b4a.equals(w.core.key, this.key)) {\n        w.isRemoved = false\n      }\n\n      if (this._isLocalCore(w.core) && this._needsLocalWriter()) {\n        this._setLocalWriter(w)\n      }\n\n      w.seen(seen)\n\n      if (alreadyActive) return w\n\n      await w.ready()\n\n      if (this._isLocalCore(w.core) && this._needsLocalWriter()) {\n        this._setLocalWriter(w)\n      }\n\n      if (allowGC && w.flushed()) {\n        this._wakeup.unqueue(key, len)\n        if (w !== this.localWriter) {\n          await w.close()\n          return w\n        }\n      }\n\n      this.activeWriters.add(w)\n      this._checkWriters.push(w)\n\n      assert(w.opened)\n      assert(!w.closed)\n\n      w.updateActivity()\n      return w\n    } finally {\n      this._lock.unlock()\n    }\n  }\n\n  _updateAll() {\n    const p = []\n    for (const w of this.activeWriters) p.push(w.update(null).catch(safetyCatch))\n    return Promise.all(p)\n  }\n\n  getWriterEncryption() {\n    if (!this.encryptionKey) return null\n    return this.encryption.getWriterEncryption()\n  }\n\n  _makeWriterCore(key) {\n    if (this.closing) throw new Error('Autobase is closing')\n    if (this._interrupting) throw INTERRUPT()\n\n    const local = b4a.equals(key, this.local.key)\n    const encryption = this.getWriterEncryption()\n\n    const core = local\n      ? this.local.session({ valueEncoding: messages.OplogMessage, encryption, active: false })\n      : this.store.get({\n          key,\n          compat: false,\n          writable: false,\n          valueEncoding: messages.OplogMessage,\n          encryption,\n          active: false\n        })\n\n    return core\n  }\n\n  _makeWriter(key, length, isActive, isRemoved) {\n    const core = this._makeWriterCore(key)\n    const w = new Writer(this, core, length, isRemoved)\n\n    if (this._isLocalCore(core)) {\n      if (isActive) this._setLocalWriter(w) // only set active writer\n      return w\n    }\n\n    core.on('append', this._onremotewriterchangeBound)\n    core.on('download', this._onremotewriterchangeBound)\n    core.on('manifest', this._onremotewriterchangeBound)\n\n    return w\n  }\n\n  _updateLinearizer(indexers, heads) {\n    // only current active indexers are reset to true below\n    for (const w of this.activeWriters) w.isActiveIndexer = false\n    if (this.localWriter) this.localWriter.isActiveIndexer = false\n\n    for (const writer of indexers) writer.isActiveIndexer = true\n\n    if (this._isActiveIndexer() && !this.isIndexer) {\n      this._setLocalIndexer()\n    } else if (!this._isActiveIndexer() && this.isIndexer) {\n      this._clearLocalIndexer()\n    }\n\n    this.linearizer = new Linearizer(indexers, { heads, writers: this.activeWriters })\n\n    this._updateAckThreshold()\n  }\n\n  async _updateLocalWriter(sys) {\n    if (this.localWriter !== null && !this.localWriter.closed) return\n    await this._getWriterByKey(this.local.key, -1, 0, true, false, sys)\n  }\n\n  async _bootstrapLinearizer() {\n    const bootstrap = this._makeWriter(this.key, 0, true, false)\n\n    this.activeWriters.add(bootstrap)\n    this._checkWriters.push(bootstrap)\n    await bootstrap.ready()\n    this._ensureWakeup(bootstrap)\n\n    this._updateLinearizer([bootstrap], [])\n  }\n\n  async _makeLinearizer(sys) {\n    if (sys === null) {\n      return this._bootstrapLinearizer()\n    }\n\n    if (this.opened || (await sys.hasLocal(this.local.key))) {\n      await this._updateLocalWriter(sys)\n    }\n\n    const indexers = []\n\n    for (const head of sys.indexers) {\n      const writer = await this._getWriterByKey(head.key, head.length, 0, false, false, sys)\n      indexers.push(writer)\n    }\n\n    if (!this._isActiveIndexer()) {\n      for (const key of sys.pendingIndexers) {\n        if (b4a.equals(key, this.local.key)) {\n          this._setLocalIndexer()\n          break\n        }\n      }\n    }\n\n    this._updateLinearizer(indexers, sys.heads)\n\n    for (const { key, length } of sys.heads) {\n      await this._getWriterByKey(key, length, 0, false, false, sys)\n    }\n  }\n\n  async _clearWriters() {\n    await this.activeWriters.clear()\n    if (this.localWriter !== null) await this.localWriter.close()\n    this._checkWriters = []\n  }\n\n  async _makeLinearizerFromViewState() {\n    const sys = await this._applyState.getIndexedSystem()\n    await this._makeLinearizer(sys)\n    await sys.close()\n  }\n\n  async _runForceFastForward() {\n    await this.core.ready()\n    if (this.closing) return\n    const rec = this._applyState ? await this._applyState.recoverAt() : null\n    await this._runFastForward(\n      new FastForward(this, this.core.key, { force: true, length: rec ? rec.length : 0 })\n    )\n  }\n\n  // general repair method for trying to recover\n  async repair() {\n    await this.forceFastForward()\n  }\n\n  async forceFastForward() {\n    if (this.isFastForwarding()) return\n    await this._runForceFastForward()\n    await this.update()\n  }\n\n  async _applyFastForward() {\n    if (\n      !this.fastForwardTo.force &&\n      this.fastForwardTo.length < this.core.length + this.fastForwardTo.minimum\n    ) {\n      this.fastForwardTo = null\n      this._updateActivity()\n      // still not worth it\n      return\n    }\n\n    const changes = this._hasUpdate ? new UpdateChanges(this) : null\n    if (changes) changes.track(this._applyState)\n\n    // close existing state\n    if (this._applyState) await this._applyState.close()\n\n    const { key, length, views, indexers, manifestVersion, entropy } = this.fastForwardTo\n\n    const from = this.core.signedLength\n    const ffed = new Set()\n\n    this._flushing++\n    try {\n      const store = this._viewStore.atomize()\n\n      const migrated = !b4a.equals(key, this.core.key)\n\n      const systemRef = await this._viewStore.findViewByKey(key, indexers, manifestVersion, entropy)\n      ffed.add(systemRef)\n\n      if (migrated) {\n        await this._applyFastForwardMigration(systemRef, { key, length })\n      } else {\n        await systemRef.catchup(store.atom, length)\n      }\n\n      for (const v of views) {\n        const ref = await this._viewStore.findViewByKey(v.key, indexers, manifestVersion, entropy)\n        if (!ref) continue // unknown, view ignored\n        ffed.add(ref)\n\n        if (migrated) {\n          await this._applyFastForwardMigration(ref, v)\n        } else {\n          await ref.catchup(store.atom, v.length)\n        }\n      }\n\n      if (ffed.size !== store.getViewCount()) {\n        for (const ref of store.getViews()) {\n          if (ffed.has(ref)) continue\n          await ref.catchup(store.atom, 0) // its gone\n        }\n      }\n\n      // migrate zero length cores\n      if (migrated) {\n        const manifests = await this._viewStore.getIndexerManifests(indexers)\n\n        for (const [name, ref] of this._viewStore.byName) {\n          if (ffed.has(ref)) continue\n          await this._migrateView(manifests, null, name, 0, manifestVersion, entropy, [], null)\n        }\n      }\n\n      const value = c.encode(messages.BootRecord, {\n        version: BOOT_RECORD_VERSION,\n        key,\n        systemLength: length,\n        indexersUpdated: false,\n        fastForwarding: true,\n        recoveries: RECOVERIES\n      })\n\n      const local = store.getLocal()\n      await local.ready()\n      await local.setUserData('autobase/boot', value)\n\n      await LocalState.clear(local)\n\n      if (changes) changes.finalise()\n\n      await store.flush()\n      await store.close()\n    } finally {\n      if (--this._flushing === 0) this._flushSignal.notify()\n    }\n\n    const to = this.core.signedLength\n\n    for (const ref of ffed) await ref.release()\n\n    this.recoveries = RECOVERIES\n    this.fastForwardTo = null\n    this._queueFastForward()\n\n    await this._clearWriters()\n\n    this._applyState = new ApplyState(this)\n    await this._applyState.ready()\n\n    if (changes) await this._handlers.update(this._applyState.view, changes)\n\n    if (await this._applyState.shouldMigrate()) {\n      await this._migrate()\n    } else {\n      await this._makeLinearizerFromViewState()\n      await this._applyState.catchup(this.linearizer)\n    }\n\n    if (!this.localWriter || this.localWriter.closed) {\n      await this._updateLocalWriter(this._applyState.system)\n    }\n\n    this._caughtup = true\n\n    this._rebooted()\n    this.emit('fast-forward', to, from)\n  }\n\n  // TODO: not atomic in regards to the ff, fix that\n  async _applyFastForwardMigration(ref, v) {\n    const next = this.store.get(v.key)\n    await next.ready()\n\n    const prologue = next.manifest && next.manifest.prologue\n\n    if (prologue && prologue.length > 0 && ref.core.length >= prologue.length) {\n      try {\n        await next.core.copyPrologue(ref.core.state)\n      } catch {\n        // we might be missing some nodes for this, just ignore, only an optimisation\n      }\n    }\n\n    const batch = next.session({ name: 'batch', overwrite: true, checkout: v.length })\n    await batch.ready()\n\n    // remake the batch, reset from our prologue in case it replicated inbetween\n    // TODO: we should really have an HC function for this\n\n    await ref.batch.state.moveTo(batch, batch.length)\n    await batch.close()\n\n    ref.migrated(this, next)\n  }\n\n  async _migrateView(\n    indexerManifests,\n    source,\n    name,\n    indexedLength,\n    manifestVersion,\n    entropy,\n    linked,\n    manifestData\n  ) {\n    const ref = this._viewStore.byName.get(name)\n\n    const prologue =\n      indexedLength === 0\n        ? null\n        : { length: indexedLength, hash: await source.treeHash(indexedLength) }\n\n    if (manifestData === null && ref.core.manifest.userData !== null) {\n      manifestData = ref.core.manifest.userData\n    }\n\n    const next = this._viewStore.getViewCore(\n      indexerManifests,\n      name,\n      prologue,\n      manifestVersion,\n      entropy,\n      linked,\n      manifestData\n    )\n    await next.ready()\n\n    if (indexedLength > 0) {\n      await next.core.copyPrologue(source.state)\n    }\n\n    // remake the batch, reset from our prologue in case it replicated inbetween\n    // TODO: we should really have an HC function for this\n    const batch = next.session({ name: 'batch', overwrite: true, checkout: indexedLength })\n    await batch.ready()\n\n    if (source !== null) {\n      while (batch.length < source.length) {\n        await batch.append(await source.get(batch.length))\n      }\n    }\n\n    await ref.batch.state.moveTo(batch, batch.length)\n    await batch.close()\n\n    ref.migrated(this, next)\n\n    return ref\n  }\n\n  async _premigrate() {\n    this._flushing++\n    try {\n      const length = this._applyState.indexedLength\n      const system = this._applyState.system\n\n      const info = await system.getIndexedInfo(length)\n      const indexerManifests = await this._viewStore.getIndexerManifests(info.indexers)\n\n      const { views, systemView, encryptionView } = this._applyState\n\n      const manifestVersion = this._applyState.system.core.manifest.version\n\n      for (const view of views) {\n        const v = this._applyState.getViewFromSystem(view, info)\n        const indexedLength = v ? v.length : 0\n\n        const ref = this._viewStore.getViewByName(view.name)\n        const source = ref.getCore()\n        await source.ready()\n\n        await this._migrateView(\n          indexerManifests,\n          source,\n          view.name,\n          indexedLength,\n          manifestVersion,\n          info.entropy,\n          null,\n          null\n        )\n      }\n\n      const source = encryptionView.ref.getCore()\n      await source.ready()\n\n      const enc = await this._migrateView(\n        indexerManifests,\n        source,\n        '_encryption',\n        info.encryptionLength,\n        manifestVersion,\n        info.entropy,\n        null,\n        null\n      )\n\n      const linked = [enc.core.key]\n\n      const sysCore = systemView.ref.getCore()\n      const ref = await this._migrateView(\n        indexerManifests,\n        sysCore,\n        '_system',\n        length,\n        manifestVersion,\n        info.entropy,\n        linked,\n        null,\n        null\n      )\n\n      return ref.core.key\n    } finally {\n      if (--this._flushing === 0) this._flushSignal.notify()\n    }\n  }\n\n  async _migrate() {\n    return this._reboot(await this._premigrate())\n  }\n\n  async _reboot(key) {\n    await this._clearWriters()\n    await this._makeLinearizerFromViewState()\n\n    await this._applyState.finalize(key)\n\n    this._applyState = new ApplyState(this)\n\n    await this._applyState.ready()\n    await this._applyState.catchup(this.linearizer)\n\n    // end soft shutdown\n\n    this._queueFastForward()\n\n    this._rebooted()\n  }\n\n  _rebooted() {\n    this.recouple()\n    this._updateActivity()\n\n    this.emit('reboot')\n\n    // ensure we re-evalute our state\n    this._bootstrapWritersChanged = true\n    this._needsWakeup = true\n\n    this.updating = true\n    this._queueBump()\n  }\n\n  _setLocalWriter(w) {\n    this.localWriter = w\n    if (this._ackInterval) this._startAckTimer()\n  }\n\n  _unsetLocalWriter() {\n    if (!this.localWriter) return\n\n    this._closeWriter(this.localWriter)\n    if (this.localWriter.isActiveIndexer) this._clearLocalIndexer()\n\n    this.localWriter = null\n  }\n\n  _setLocalIndexer() {\n    assert(this.localWriter !== null)\n\n    this.isIndexer = true\n    this.emit('is-indexer')\n  }\n\n  _clearLocalIndexer() {\n    assert(this.localWriter !== null)\n\n    if (this._ackTimer) this._ackTimer.stop()\n\n    this.isIndexer = false\n    this._ackTimer = null\n\n    this.emit('is-non-indexer')\n  }\n\n  _isLocalCore(core) {\n    return core.writable && core.id === this.local.id\n  }\n\n  _addLocalHeads() {\n    // not writable atm, will prop be writable in a subsequent bump tho\n    if (!this.localWriter || this.localWriter.closed) return null\n    // safety, localwriter is still processing, should prop be an assertion\n    if (!this.localWriter.idle()) return null\n\n    const length = this._optimistic === -1 ? this._appending.length : this._optimistic || 1\n\n    const nodes = new Array(length)\n    for (let i = 0; i < length; i++) {\n      const heads = this.linearizer.getHeads()\n      const deps = new Set(this.linearizer.heads)\n      const batch = length - i\n      const value = this._appending[i]\n\n      const node = this.localWriter.append(value, heads, batch, deps, this._optimistic === 0)\n\n      this.linearizer.addHead(node)\n      nodes[i] = node\n    }\n\n    return nodes\n  }\n\n  _flushLocalHeads(length) {\n    this._appending = length === this._appending.length ? null : this._appending.slice(length)\n    this._appended += length\n\n    if (this._optimistic > -1 && this._optimistic < length) this._optimistic = -1\n  }\n\n  async _addRemoteHeads() {\n    let added = 0\n\n    while (\n      added < REMOTE_ADD_BATCH ||\n      (this.bigBatches && !this._indexersIdle() && added < REMOTE_ADD_BATCH_SANITY)\n    ) {\n      await this._updateAll()\n\n      let advanced = 0\n\n      for (const w of this.activeWriters) {\n        let node = w.advance()\n        if (node === null) continue\n\n        advanced += node.batch\n\n        while (true) {\n          this.linearizer.addHead(node)\n          if (node.batch === 1) break\n          node = w.advance()\n        }\n      }\n\n      if (advanced === 0) {\n        if (this.bigBatches && !this._indexersIdle() && (await this._waitForIndexers())) continue\n        break\n      }\n\n      added += advanced\n    }\n\n    return added\n  }\n\n  async _waitForIndexers() {\n    const promises = []\n\n    for (const w of this.linearizer.indexers) {\n      if (w.idle()) continue\n      if (await w.core.has(w.length)) continue\n      promises.push(w.core.get(w.length, { timeout: 3000 }))\n    }\n\n    for (const result of await Promise.allSettled(promises)) {\n      if (result.status !== 'rejected') return true\n    }\n\n    return false\n  }\n\n  _indexersIdle() {\n    for (const w of this.linearizer.indexers) {\n      if (!w.idle()) return false\n    }\n    return true\n  }\n\n  async _drain() {\n    const writable = this.writable\n\n    while (!this._interrupting && !this.paused) {\n      if (this.fastForwardTo !== null) {\n        await this._applyFastForward()\n        continue // revaluate conditions...\n      }\n\n      // we defer this to post ready so its not blocking reading the views\n      if (this._caughtup === false) {\n        // if the catchup fails, just force ff it to recover, less user pain\n        if (!(await this._catchupApplyState())) {\n          await this._runForceFastForward()\n        }\n        continue\n      }\n\n      const remoteAdded = await this._addRemoteHeads()\n      const localNodes = this._appending !== null ? this._addLocalHeads() : null\n\n      if (this._interrupting) return\n\n      if (remoteAdded > 0 || localNodes !== null) {\n        this.updating = true\n      }\n\n      const u = this.linearizer.update()\n      const update = u\n        ? await this._applyState.update(u, localNodes)\n        : { reboot: false, migrated: false }\n\n      if (localNodes) this._flushLocalHeads(localNodes.length)\n\n      if (!update.reboot) {\n        if (this._applyState.shouldFlush()) {\n          await this._applyState.flush()\n          this.updating = true\n        }\n\n        if (this._checkWriters.length > 0) {\n          await this._gcWriters()\n          continue // rerun the update loop as a writer might have been added\n        }\n        if (remoteAdded >= REMOTE_ADD_BATCH) continue\n        break\n      }\n\n      await this._gcWriters()\n      await this._reboot(this._applyState.key)\n    }\n\n    // emit state changes post drain\n    if (writable !== this.writable) {\n      if (this.writable && this._writable) this._writable.resolve(true)\n      this.emit(writable ? 'unwritable' : 'writable')\n    }\n  }\n\n  _wakeupPeer(stream) {\n    if (!this.wakeupSession) return\n    const wakeup = this._getWakeup()\n    if (wakeup.length === 0) return\n    this.wakeupSession.announceByStream(stream, wakeup)\n  }\n\n  _getWakeup() {\n    const writers = []\n\n    for (const w of this.activeWriters) {\n      if (w.isActiveIndexer || w.flushed()) continue\n      writers.push({ key: w.core.key, length: w.length })\n    }\n\n    return writers\n  }\n\n  async _wakeupWriter(key, length) {\n    this._ensureWakeup(await this._getWriterByKey(key, -1, length, true, false, null))\n  }\n\n  // ensure wakeup on an existing writer (the writer calls this in addition to above)\n  _ensureWakeup(w) {\n    if (w === null || w.isBootstrap === true) return\n    w.setBootstrap(true) // even if turn false at end of drain, hypercore makes them linger a bit so no churn\n    this._bootstrapWriters.push(w)\n    this._bootstrapWritersChanged = true\n  }\n\n  async _drainWakeup() {\n    const promises = []\n\n    // warmup all the below gets\n    if (this._needsWakeup) {\n      for (const { key, length } of this._wakeup) {\n        const w = this.activeWriters.get(key)\n        if (w) {\n          if (w.length < length) w.seen(length)\n          continue\n        }\n        promises.push(this._applyState.system.get(key))\n      }\n\n      if (this._needsWakeupHeads) {\n        for (const { key } of await this._applyState.system.heads) {\n          if (this.activeWriters.has(key)) continue\n          promises.push(this._applyState.system.get(key))\n        }\n      }\n    }\n    for (const [hex, length] of this._wakeupHints) {\n      const key = b4a.from(hex, 'hex')\n      if (length !== -1) {\n        const w = this.activeWriters.get(key)\n        if (w) {\n          if (w.length < length) w.seen(length)\n          continue\n        }\n      }\n      promises.push(this._applyState.system.get(key))\n    }\n\n    await Promise.allSettled(promises)\n\n    if (this._needsWakeup === true) {\n      this._needsWakeup = false\n\n      for (const { key, length } of this._wakeup) {\n        if (this.activeWriters.has(key)) continue\n        await this._wakeupWriter(key, length)\n      }\n\n      if (this._needsWakeupHeads === true) {\n        this._needsWakeupHeads = false\n\n        for (const { key } of await this._applyState.system.heads) {\n          if (this.activeWriters.has(key)) continue\n          await this._wakeupWriter(key, 0)\n        }\n      }\n    }\n\n    for (const [hex, length] of this._wakeupHints) {\n      const key = b4a.from(hex, 'hex')\n      if (this.activeWriters.has(key)) continue\n      if (length !== -1) {\n        const info = await this._applyState.system.get(key)\n        if (info && length <= info.length) continue // stale hint\n      }\n      await this._wakeupWriter(key, length === -1 ? 0 : length)\n    }\n\n    this._wakeupHints.clear()\n  }\n\n  pause() {\n    this.paused = true\n  }\n\n  resume() {\n    this.paused = false\n    this._queueBump()\n  }\n\n  waitForWritable() {\n    if (this.writable) return Promise.resolve(true)\n    if (!this._writable) this._writable = rrp()\n    return this._writable.promise\n  }\n\n  async _drainWithInterupt() {\n    while (true) {\n      try {\n        await this._drain()\n        return\n      } catch (err) {\n        if (this.closing || !this.fastForwardTo) throw err\n        if (Date.now() - this.fastForwardFailedAt < MIN_FF_WAIT) throw err\n        this.fastForwardFailedAt = Date.now()\n        // if an FF is enabled retry\n      }\n    }\n  }\n\n  async _advance() {\n    if (this.opened === false) await this.ready()\n    if (this.paused || this._interrupting) return\n\n    this._draining = true\n\n    if (this._updateLocalCore !== null) {\n      await this._rotateLocalWriter(this._updateLocalCore)\n    }\n\n    const local = this.local.length\n\n    try {\n      await this._drainWithInterupt()\n\n      // must run post drain so the linearizer is caught up\n      if (this._caughtup && (this._needsWakeup === true || this._wakeupHints.size > 0))\n        await this._drainWakeup()\n\n      // check if we should update local writer\n      if (!this.localWriter || this.localWriter.closed) {\n        await this._updateLocalWriter(this._applyState.system)\n      }\n\n      this._draining = false\n    } catch (err) {\n      this._onError(err)\n      return\n    }\n\n    if (this._interrupting) return\n\n    if (this.localWriter && !this.localWriter.closed) {\n      if (this._applyState.isLocalPendingIndexer()) this.ack().catch(noop)\n      else if (this._triggerAckAsap()) this._ackTimer.asap()\n    }\n\n    // keep bootstraps in sync with linearizer\n    if (this.updating === true || this._bootstrapWritersChanged === true) {\n      this._updateBootstrapWriters()\n    }\n\n    if (this.updating === true) {\n      this.updating = false\n\n      if (local !== this.local.length) this._resetAckTick()\n      else this._ackTick++\n\n      if (!this._interrupting) this.emit('update')\n      this._waiting.notify(null)\n    }\n\n    if (!this._interrupting) await this._gcWriters()\n  }\n\n  _triggerAckAsap() {\n    if (!this._ackTimer) return false\n\n    // flush if threshold is reached and we are not already acking\n    if (this._ackTickThreshold && !this._acking && this._ackTick >= this._ackTickThreshold) {\n      if (this._ackTimer) {\n        for (const w of this.linearizer.indexers) {\n          if (w.core.length > w.length) return false // wait for the normal ack cycle in this case\n        }\n      }\n\n      return true\n    }\n\n    return false\n  }\n\n  _queueFastForward() {\n    if (!this.core.opened) return\n    // should have a better way to get this\n    const latestSignedLength = this.core.core.state.length\n\n    if (!this.fastForwardEnabled || this.fastForwarding !== null || this._interrupting) return\n\n    if (latestSignedLength - this.core.length < this.fastForwardMinimum) return\n    if (this.fastForwardTo !== null) return\n    if (Date.now() - this.fastForwardFailedAt < MIN_FF_WAIT) return\n\n    this._runFastForward(\n      new FastForward(this, this.core.key, { minimum: this.fastForwardMinimum })\n    ).catch(noop)\n  }\n\n  _queueStaticFastForward(key) {\n    if (!this.fastForwardEnabled || this.fastForwarding !== null || this._interrupting) return\n    if (this.fastForwardTo !== null) return\n    if (Date.now() - this.fastForwardFailedAt < MIN_FF_WAIT) return\n\n    this._runFastForward(new FastForward(this, key, { verified: false })).catch(noop)\n  }\n\n  _updateActivity() {\n    this.activeWriters.updateActivity()\n    if (this._applyState) {\n      if (this.isFastForwarding()) this._applyState.pause()\n      else this._applyState.resume()\n    }\n\n    // in case we ignored wakeups case we were fast forwarding, request them now if not\n    if (this._needsWakeupRequest && !this.isFastForwarding() && this.wakeupSession) {\n      this._needsWakeupRequest = false\n\n      this.wakeupSession.broadcastLookup({})\n    }\n  }\n\n  _preferFastForward() {\n    this.fastForwardMinimum = 1\n    this._queueFastForward()\n  }\n\n  _postApply() {\n    this.fastForwardMinimum = FastForward.MINIMUM\n  }\n\n  async _runFastForward(ff) {\n    this.fastForwarding = ff\n\n    this._updateActivity()\n\n    const result = await ff.upgrade()\n    await ff.close()\n\n    if (this.fastForwarding === ff) this.fastForwarding = null\n\n    if (!result) {\n      if (ff.failed) this.fastForwardFailedAt = Date.now()\n      else this._queueFastForward()\n      this._updateActivity()\n      return\n    }\n\n    this.fastForwardFailedAt = 0\n    this.fastForwardTo = result\n\n    if (this._applyState && this._applyState.applying && this.fastForwardMinimum === 1) {\n      await this._applyState.close()\n    }\n\n    this._bumpAckTimer()\n    this._queueBump()\n  }\n\n  // triggered from apply\n  async _addWriter(key, sys) {\n    // just compat for old version\n    assert(!!this._applyState.applying, 'System changes are only allowed in apply')\n\n    const writer =\n      (await this._getWriterByKey(key, -1, 0, false, true, sys)) ||\n      this._makeWriter(key, 0, true, false)\n    await writer.ready()\n\n    if (!this.activeWriters.has(key)) {\n      this.activeWriters.add(writer)\n      this._checkWriters.push(writer)\n      this._ensureWakeup(writer)\n    }\n\n    // fetch any nodes needed for dependents\n    this._queueBump()\n  }\n\n  // triggered from apply\n  _removeWriter(key) {\n    // just compat for old version\n    const w = this.activeWriters.get(key)\n    if (w) w.isRemoved = true\n\n    this._queueBump()\n  }\n\n  removeable(key) {\n    return this._applyState ? this._applyState.removeable(key) : false\n  }\n\n  _updateAckThreshold() {\n    if (this._ackThreshold === 0) return\n    if (this._ackTimer) this._ackTimer.bau()\n    this._ackTick = 0\n    this._ackTickThreshold = random2over1(this.linearizer.indexers.length * this._ackThreshold)\n  }\n\n  _resetAckTick() {\n    this._ackTick = 0\n    if (this._ackTimer) this._ackTimer.bau()\n  }\n\n  _shiftWriter(w) {\n    w.shift()\n    if (w.flushed()) this._checkWriters.push(w)\n  }\n}\n\nfunction toKey(k) {\n  return b4a.isBuffer(k) ? k : hypercoreId.decode(k)\n}\n\nfunction isAutobaseMessage(msg) {\n  return msg.checkpoint ? msg.checkpoint.length > 0 : msg.checkpoint === null\n}\n\nfunction compareNodes(a, b) {\n  return b4a.compare(a.key, b.key)\n}\n\nfunction random2over1(n) {\n  return Math.floor(n + Math.random() * n)\n}\n\nfunction noop() {}\n\nfunction crashSoon(err) {\n  queueMicrotask(() => {\n    throw err\n  })\n  throw err\n}\n\nfunction isObject(obj) {\n  return typeof obj === 'object' && obj !== null\n}\n\nfunction emitWarning(err) {\n  safetyCatch(err)\n  this.emit('warning', err)\n}\n\nfunction normalize(valueEncoding, value) {\n  const state = { buffer: null, start: 0, end: 0 }\n  valueEncoding.preencode(state, value)\n  state.buffer = b4a.allocUnsafe(state.end)\n  valueEncoding.encode(state, value)\n  state.start = 0\n  return valueEncoding.decode(state)\n}\nconst b4a = require('b4a')\n\nmodule.exports = class ActiveWriters {\n  constructor() {\n    this.map = new Map()\n  }\n\n  get size() {\n    return this.map.size\n  }\n\n  [Symbol.iterator]() {\n    return this.map.values()\n  }\n\n  get(key) {\n    return this.map.get(b4a.toString(key, 'hex')) || null\n  }\n\n  has(key) {\n    return this.get(key) !== null\n  }\n\n  add(writer) {\n    this.map.set(b4a.toString(writer.core.key, 'hex'), writer)\n  }\n\n  delete(writer) {\n    this.map.delete(b4a.toString(writer.core.key, 'hex'))\n  }\n\n  updateActivity() {\n    for (const w of this.map.values()) w.updateActivity()\n  }\n\n  clear() {\n    const p = []\n    for (const w of this.map.values()) p.push(w.close())\n    this.map.clear()\n\n    return Promise.all(p)\n  }\n}\nconst SignalPromise = require('signal-promise')\n\nmodule.exports = class AppendBatch {\n  constructor(base) {\n    this.base = base\n    this.blocks = []\n    this.closed = false\n    this.flushing = false\n    this._flushed = null\n  }\n\n  async _acquire() {\n    while (this.base.activeBatch !== null && this.base.activeBatch !== this)\n      await this.base.activeBatch.flushed()\n    this.base.activeBatch = this\n  }\n\n  async append(value) {\n    if (this.base.opened === false) await this.base.ready()\n    if (this.base._advancing !== null) await this.base._advancing\n\n    if (this.closed) throw new Error('Batch is closed')\n    if (this.base.activeBatch !== this) await this._acquire()\n    if (this.closed) throw new Error('Batch is closed')\n\n    this.blocks.push(value)\n    return this.base.local.length + this.blocks.length\n  }\n\n  async flush() {\n    if (this.closed) throw new Error('Batch is closed')\n    if (this.flushing) return this.flushed()\n    this.flushing = true\n    if (this.blocks.length) await this.base._appendBatch(this.blocks)\n    return this.close()\n  }\n\n  flushed() {\n    if (this.closed) return Promise.resolve()\n    if (this._flushed) return this._flushed.wait()\n    this._flushed = new SignalPromise()\n    return this._flushed.wait()\n  }\n\n  close() {\n    if (this.base.activeBatch !== this) return\n    this.base.activeBatch = null\n    this.closed = true\n    if (this._flushed) this._flushed.notify(null)\n  }\n}\nclass PublicApplyCalls {\n  constructor(base) {\n    this.base = base\n    this.internal = false\n  }\n\n  get discoveryKey() {\n    return this.base.discoveryKey\n  }\n\n  get key() {\n    return this.base.key\n  }\n\n  get id() {\n    return this.base.id\n  }\n\n  async addWriter() {\n    throw new Error('Not allowed on the public view')\n  }\n\n  async ackWriter() {\n    throw new Error('Not allowed on the public view')\n  }\n\n  async removeWriter() {\n    throw new Error('Not allowed on the public view')\n  }\n\n  preferFastForward() {\n    throw new Error('Not allowed on the public view')\n  }\n\n  interrupt() {\n    throw new Error('Not allowed on the public view')\n  }\n\n  removeable() {\n    throw new Error('Not allowed on the public view')\n  }\n\n  fork() {\n    throw new Error('Not allowed on the public view')\n  }\n\n  anchor() {\n    throw new Error('Not allowed on the public view')\n  }\n}\n\nclass PrivateApplyCalls extends PublicApplyCalls {\n  constructor(state) {\n    super(state.base)\n    this.state = state\n    this.internal = true\n  }\n\n  get system() {\n    return this.state.system\n  }\n\n  async addWriter(key, { indexer = true, isIndexer = indexer } = {}) {\n    // just compat for old version\n    await this.state.system.add(key, { isIndexer })\n    await this.base._addWriter(key, this.state.system)\n  }\n\n  async ackWriter(key) {\n    await this.state.system.ack(key)\n  }\n\n  async removeWriter(key) {\n    // just compat for old version\n    if (!this.state.removeable(key)) {\n      throw new Error('Not allowed to remove the last indexer')\n    }\n\n    await this.state.system.remove(key)\n    this.base._removeWriter(key)\n  }\n\n  preferFastForward() {\n    this.base._preferFastForward()\n  }\n\n  interrupt(reason) {\n    this.base._interrupt(reason)\n  }\n\n  removeable(key) {\n    return this.state.removeable(key)\n  }\n\n  async fork(indexerKeys, system) {\n    if (!(await this.state.validateFork(indexerKeys, system))) return false\n\n    const indexers = indexerKeys.map(toIndexer)\n\n    this.state.pendingFork = { indexers, length: system.length }\n\n    return true\n  }\n\n  async createAnchor() {\n    return await this.state.createAnchor()\n  }\n}\n\nmodule.exports = { PublicApplyCalls, PrivateApplyCalls }\n\nfunction toIndexer(key) {\n  return { key, length: 0 } // length is not used, just for api compat\n}\nconst ReadyResource = require('ready-resource')\nconst assert = require('nanoassert')\nconst c = require('compact-encoding')\nconst crypto = require('hypercore-crypto')\nconst b4a = require('b4a')\nconst safetyCatch = require('safety-catch')\n\nconst { partialSignature } = require('hypercore/lib/multisig.js')\n\nconst SystemView = require('./system.js')\nconst { AutobaseEncryption } = require('./encryption.js')\nconst UpdateChanges = require('./updates.js')\nconst messages = require('./messages.js')\nconst { PrivateApplyCalls } = require('./apply-calls.js')\nconst { encodeValue } = require('./values.js')\nconst Fork = require('./fork.js')\nconst LocalState = require('./local-state.js')\nconst { OPLOG_VERSION, BOOT_RECORD_VERSION } = require('./caps.js')\n\n// todo: expose this as an option\nconst SHOULD_SIGN_THRESHOLD = 0\n\nclass CheckpointCore {\n  constructor(view, core, signer, paused) {\n    this.view = view\n    this.core = core\n    this.signer = signer\n    this.length = 0\n    this.digest = null\n    this.signatures = { system: null, encryption: null, user: [] }\n    this.closed = false\n    this.paused = paused\n  }\n\n  pause() {\n    this.paused = true\n  }\n\n  resume() {\n    if (!this.paused) return\n    this.paused = false\n    this.updateBackground()\n  }\n\n  async update() {\n    if (await this.updateCheckpoints()) await this.view.maybeSigned()\n  }\n\n  async updateCheckpoints() {\n    if (this.core.length <= this.length || this.closed || this.paused) return false\n\n    const length = this.core.length\n    const value = await this.core.get(length - 1)\n\n    if (length <= this.length || this.closed || !value.digest || this.paused) return false\n\n    const [digest, checkpoints] = await Promise.all([\n      this._inflateDigest(length, value.digest),\n      this._inflateAllCheckpoints(length, value.checkpoint)\n    ])\n\n    if (length <= this.length || this.closed || !digest || !checkpoints || this.paused) return false\n    for (let i = 0; i < checkpoints.length; i++) {\n      if (checkpoints[i] === null) return false\n    }\n\n    this.length = length\n    this.digest = digest\n    this.signatures = checkpoints\n\n    return true\n  }\n\n  updateBackground() {\n    return this.update().catch(safetyCatch)\n  }\n\n  updateInternalSignatures(length, signatures) {\n    this.signatures.system = updateSignature(length, signatures.system, this.signatures.system)\n    this.signatures.encryption = updateSignature(\n      length,\n      signatures.encryption,\n      this.signatures.encryption\n    )\n  }\n\n  updateUserSignatures(length, signatures) {\n    this.signatures.user = updateSignatures(length, signatures, this.signatures.user)\n  }\n\n  makeCheckpoints(length) {\n    return {\n      system: makeCheckpoint(length, this.signatures.system),\n      encryption: makeCheckpoint(length, this.signatures.encryption),\n      user: makeCheckpoints(length, this.signatures.user)\n    }\n  }\n\n  makeDigest(length, key) {\n    if (this.digest && (this.digest.key === key || b4a.equals(this.digest.key, key))) {\n      return { key: null, pointer: length - this.digest.at }\n    }\n    this.digest = { key, at: length }\n    return { key, pointer: 0 }\n  }\n\n  async ready() {\n    await this.core.ready()\n    this.core.on('append', this.updateBackground.bind(this))\n    if (this.core.writable) await this.updateCheckpoints()\n    this.updateBackground()\n  }\n\n  signedLength() {\n    return this.signatures.system ? this.signatures.system.length : 0\n  }\n\n  close() {\n    this.closed = true\n    return this.core.close()\n  }\n\n  async _inflateDigest(length, dig) {\n    if (!dig) return null\n\n    if (dig.pointer === 0) {\n      return { key: dig.key, at: length }\n    }\n\n    const len = length - dig.pointer\n\n    if (this.digest && len === this.digest.at) return this.digest\n    if (len <= 0) return null\n\n    const { digest } = await this.core.get(len - 1)\n    if (!digest || !digest.key) return null\n\n    return { key: digest.key, at: len }\n  }\n\n  _sameSignatures(b, a) {\n    return (\n      sameSignature(a.system, b.system) &&\n      sameSignature(a.encryption, b.encryption) &&\n      sameSignatures(a.user, b.user)\n    )\n  }\n\n  async _inflateAllCheckpoints(length, checkpoints) {\n    if (!checkpoints) return { system: null, encryption: null, user: [] }\n    if (this._sameSignatures(checkpoints, this.signatures)) return this.signatures\n\n    const system = this._inflateSystemCheckpoint(checkpoints.system, length)\n    const encryption = this._inflateEncryptionCheckpoint(checkpoints.encryption, length)\n\n    const user = checkpoints.user ? new Array(checkpoints.user.length) : []\n\n    for (let i = 0; i < user.length; i++) {\n      const chk = checkpoints.user[i]\n      user[i] = this._inflateUserCheckpoint(chk, i, length)\n    }\n\n    const [systemCheckpoint, encryptionCheckpoint, userCheckpoints] = await Promise.all([\n      system,\n      encryption,\n      Promise.all(user)\n    ])\n\n    return {\n      system: systemCheckpoint,\n      encryption: encryptionCheckpoint,\n      user: userCheckpoints\n    }\n  }\n\n  async _inflateSystemCheckpoint(chk, coreLength) {\n    if (chk.checkpoint) {\n      const { signature, length } = chk.checkpoint\n      return { signature, length, at: coreLength }\n    }\n\n    const len = coreLength - chk.checkpointer\n    if (this.signatures.system && this.signatures.system.at === len) {\n      return this.signatures.system\n    }\n\n    if (len <= 0) return null\n\n    const { checkpoint } = await this.core.get(len - 1)\n    if (!checkpoint || !checkpoint.system || !checkpoint.system.checkpoint) return null\n\n    const { signature, length } = checkpoint.system.checkpoint\n    return { signature, length, at: len }\n  }\n\n  async _inflateEncryptionCheckpoint(chk, coreLength) {\n    if (!chk) return { length: 0, signature: null, at: 0 }\n\n    if (chk.checkpoint) {\n      const { signature, length } = chk.checkpoint\n      return { signature, length, at: coreLength }\n    }\n\n    const len = coreLength - chk.checkpointer\n    if (this.signatures.encryption && this.signatures.encryption.at === len) {\n      return this.signatures.encryption\n    }\n\n    if (len <= 0) return null\n\n    const { checkpoint } = await this.core.get(len - 1)\n    if (!checkpoint || !checkpoint.encryption || !checkpoint.encryption.checkpoint) return null\n\n    const { signature, length } = checkpoint.encryption.checkpoint\n    return { signature, length, at: len }\n  }\n\n  async _inflateUserCheckpoint(chk, i, coreLength) {\n    if (chk.checkpoint) {\n      const { signature, length } = chk.checkpoint\n      return { signature, length, at: coreLength }\n    }\n\n    const len = coreLength - chk.checkpointer\n    if (i < this.signatures.user.length && this.signatures.user[i].at === len) {\n      return this.signatures.user[i]\n    }\n\n    if (len <= 0) return null\n\n    const { checkpoint } = await this.core.get(len - 1)\n    if (!checkpoint || i >= checkpoint.user.length || !checkpoint.user[i].checkpoint) return null\n\n    const { signature, length } = checkpoint.user[i].checkpoint\n    return { signature, length, at: len }\n  }\n}\n\nmodule.exports = class ApplyState extends ReadyResource {\n  constructor(base) {\n    super()\n\n    this.base = base\n    this.encryption = this.base.encryption\n    this.valueEncoding = base.valueEncoding\n    this.store = base._viewStore.atomize()\n    this.key = null\n    this.system = null\n    this.view = null\n    this.views = []\n    this.systemView = null\n    this.encryptionView = null\n    this.hostcalls = null\n    this.changes = base._hasUpdate ? new UpdateChanges(base) : null\n\n    this.updates = []\n\n    this.local = null\n    this.localState = null\n\n    this.fastForwarding = false\n    this.indexersUpdated = false\n    this.quorum = 0\n    this.needsIndexedLengthUpdate = false\n    this.interrupted = false\n    this.applying = null\n    this.applyBatch = null\n\n    this.localCheckpoint = null\n    this.localIndexer = false\n\n    this.systemUpgrade = null\n\n    this.checkpoints = []\n    this.pendingViews = null\n    this.pendingFork = null\n    this.dirty = false\n  }\n\n  shouldFlush() {\n    return this.dirty\n  }\n\n  async shouldWrite() {\n    if (!this.localIndexer || !this.localCheckpoint || !this.localCheckpoint.core.opened) {\n      return false\n    }\n\n    const info = await this.system.getIndexedInfo(this.indexedLength)\n    if (!info.views.length) return false\n\n    const { encryption, user } = this.localCheckpoint.signatures\n\n    // todo: does this condition hold for soft-fork?\n    if (info.views.length > user.length) return true\n\n    for (let i = 0; i < info.views.length; i++) {\n      if (user[i].length + SHOULD_SIGN_THRESHOLD < info.views[i].length) return true\n    }\n\n    // always flush encryption signature\n    if (info.encryptionLength !== 0) {\n      if (!encryption || encryption.length < info.encryptionLength) return true\n    }\n\n    return false\n  }\n\n  get indexedLength() {\n    return this.systemView ? this.systemView.indexedLength : 0\n  }\n\n  get systemRef() {\n    return this.systemView ? this.systemView.ref : null\n  }\n\n  async validateFork(indexerKeys, system) {\n    if (!b4a.equals(system.key, this.system.core.key)) return false\n    if (this.pendingIndexedLength() < system.length) return false\n    for (const key of indexerKeys) {\n      const info = await this.system.get(key)\n\n      // writer should be active and we need manifest\n      if (!info || !info.length || info.isRemoved) return false\n    }\n    return true\n  }\n\n  async shouldMigrate() {\n    if (!this.fastForwarding && !this.indexersUpdated) return false\n    if (this.system.indexers.length === 0) return false // genesis\n\n    // sanity, prefer migration\n    if (!this.system.core.manifest || !this.system.core.manifest.signers) return true\n\n    // easy mode\n    if (this.system.indexers.length !== this.system.core.manifest.signers.length) {\n      return true\n    }\n\n    const manifests = await this.store.getIndexerManifests(this.system.indexers)\n\n    for (let i = 0; i < this.system.core.manifest.signers.length; i++) {\n      const { publicKey } = this.system.core.manifest.signers[i]\n      if (!b4a.equals(publicKey, manifests[i].signers[0].publicKey)) return true\n    }\n\n    return false\n  }\n\n  isLocalPendingIndexer() {\n    if (this.system.pendingIndexers.length === 0) return false\n    const key = this.base.local.key\n    for (const k of this.system.pendingIndexers) {\n      if (b4a.equals(k, key)) return !b4a.equals(this.base.key, key) && this.base.local.length === 0\n    }\n    return false\n  }\n\n  removeable(key) {\n    if (this.system.indexers.length !== 1) return true\n    return !b4a.equals(this.system.indexers[0].key, key)\n  }\n\n  isLocalIndexer() {\n    return !!this.localCheckpoint\n  }\n\n  _createCheckpointCore(key, active, signer, paused) {\n    const encryption = this.base.getWriterEncryption(key)\n\n    const session = this.base.store.get({\n      key,\n      valueEncoding: messages.OplogMessage,\n      encryption,\n      active\n    })\n\n    return new CheckpointCore(this, session, signer, paused)\n  }\n\n  async _openInternalView(name, indexedLength) {\n    const core = this.store.get({ name })\n    await core.ready()\n    await core.setUserData('referrer', this.base.key)\n    await core.setUserData('autobase/view', b4a.from(name))\n\n    const ref = this.store.getViewByName(name)\n\n    return { ref, core, indexedLength }\n  }\n\n  async _open() {\n    try {\n      await this._boot()\n    } catch (err) {\n      await this._free()\n      throw err\n    }\n  }\n\n  async _boot() {\n    const boot = await this.base._getBootRecord()\n\n    this.systemView = await this._openInternalView('_system', boot.systemLength)\n    this.encryptionView = await this._openInternalView('_encryption', -1)\n\n    const sysCore = this.systemView.core\n    if (sysCore.manifest.version >= 2) {\n      if (this.encryption !== null) await this.encryption.reload(this.encryptionView.core)\n    }\n\n    const system = new SystemView(sysCore)\n    await system.ready()\n\n    // reset so we dont track _system or _encryption\n    this.store.opened = []\n\n    this.hostcalls = new PrivateApplyCalls(this)\n    const view = this.base._hasOpen ? this.base._handlers.open(this.store, this.hostcalls) : null\n\n    this.view = view\n    this.system = system\n\n    // ensure all are ready\n    for (const v of this.store.opened) await v.atomicBatch.ready()\n\n    this.key = system.core.key\n\n    this.fastForwarding = boot.fastForwarding\n    this.indexersUpdated = boot.indexersUpdated\n    this.quorum = sysCore.manifest ? sysCore.manifest.quorum : 0\n\n    const added = new Set()\n\n    for (let i = 0; i < system.views.length; i++) {\n      const { key, length } = system.views[i]\n      const v = await this.store.findViewByKey(\n        key,\n        system.indexers,\n        sysCore.manifest.version,\n        system.entropy\n      )\n\n      if (v === null) {\n        this.views.push({ name: null, key, length, core: null, ref: null, mappedIndex: i })\n        continue\n      }\n\n      await v.atomicBatch.ready()\n      await v.core.setUserData('referrer', this.base.key)\n      await v.core.setUserData('autobase/view', b4a.from(v.name))\n\n      this.views.push({ name: v.name, key, length, core: v.atomicBatch, ref: v, mappedIndex: i })\n\n      added.add(v)\n    }\n\n    for (const v of this.store.opened) {\n      if (added.has(v)) continue\n      const core = v.atomicBatch\n\n      this.views.push({\n        name: v.name,\n        key: core.key,\n        length: core.length,\n        core,\n        ref: v,\n        mappedIndex: -1\n      })\n    }\n\n    this.local = this.store.getLocal()\n    await this.local.ready()\n\n    this.localState = new LocalState(this.local)\n\n    let isLocalIndexer = false\n\n    const paused = this.base.isFastForwarding()\n    const inf = await this.system.getIndexedInfo()\n\n    for (let i = 0; i < inf.indexers.length; i++) {\n      const idx = inf.indexers[i]\n      const chk = this._createCheckpointCore(idx.key, true, i, paused)\n      await chk.ready()\n      this.checkpoints.push(chk)\n      if (b4a.equals(idx.key, this.base.local.key)) isLocalIndexer = true\n    }\n\n    const shouldSign = this.quorum > 0 && isLocalIndexer\n\n    if (shouldSign) {\n      this.localIndexer = true\n      await this._startLocalCheckpoint()\n    }\n\n    await this._refreshWriters()\n\n    // deferred\n    this.maybeSigned().catch(noop)\n  }\n\n  async _startLocalCheckpoint() {\n    for (const chk of this.checkpoints) {\n      if (chk.core.id === this.base.local.id) {\n        this.localCheckpoint = chk\n        return\n      }\n    }\n\n    this.localCheckpoint = this._createCheckpointCore(this.base.local.key, false, 0, false)\n    await this.localCheckpoint.ready()\n  }\n\n  interrupt() {\n    this.interrupted = true\n    this.pause()\n  }\n\n  pause() {\n    for (const chk of this.checkpoints) {\n      if (chk !== this.localCheckpoint) chk.pause()\n    }\n  }\n\n  resume() {\n    for (const chk of this.checkpoints) {\n      if (chk !== this.localCheckpoint) chk.resume()\n    }\n  }\n\n  _checkSystemUpgrade() {\n    if (this.systemUpgrade) return\n\n    const tally = new Map()\n\n    for (const chk of this.checkpoints) {\n      if (chk.signedLength() <= this.system.core.signedLength) continue\n      if (!chk.digest) continue\n\n      const id = b4a.toString(chk.digest.key, 'hex')\n      const cnt = (tally.get(id) || 0) + 1\n\n      if (cnt >= this.quorum) {\n        this.systemUpgrade = chk.digest.key\n        this.base._queueStaticFastForward(this.systemUpgrade)\n        return\n      }\n\n      tally.set(id, cnt)\n    }\n  }\n\n  mapIndexToView(index) {\n    for (const { mappedIndex, ref } of this.views) {\n      if (mappedIndex === index) return ref\n    }\n  }\n\n  async maybeSigned() {\n    if (this.opened === false) await this.ready()\n    if (this.interrupted) return\n\n    const thres = this.checkpoints.length - this.quorum\n    if (thres < 0 || this.checkpoints.length <= thres) return\n\n    this.checkpoints.sort(cmpCheckpoints)\n\n    const signableLength = this.checkpoints[thres].signedLength()\n    if (signableLength <= this.system.core.signedLength) return\n\n    const expected = this.system.core.key\n\n    if (signableLength > this.indexedLength) {\n      if (!b4a.equals(expected, this.checkpoints[thres].digest.key)) this._checkSystemUpgrade()\n      this.needsIndexedLengthUpdate = true\n      return\n    }\n\n    for (let i = thres; i < this.checkpoints.length; i++) {\n      const chk = this.checkpoints[i]\n      // we must agree on what the system is obvs\n      if (!b4a.equals(expected, chk.digest.key)) {\n        this._checkSystemUpgrade()\n        return\n      }\n      // if we dont have the indexed state ourself, then no way for us to verify / patch\n      if (!chk.signatures.system || chk.signatures.system.length > this.indexedLength) {\n        this.needsIndexedLengthUpdate = true\n        return\n      }\n    }\n\n    this.needsIndexedLengthUpdate = false\n\n    const chk = []\n    for (let i = thres; i < this.checkpoints.length; i++) {\n      chk.push({ signer: this.checkpoints[i].signer, signatures: this.checkpoints[i].signatures })\n    }\n\n    const { system } = this.checkpoints[thres].signatures\n\n    await this._assembleMultisig(system.length, chk)\n  }\n\n  async _assembleMultisig(signableLength, checkpoints) {\n    const views = new Array(this.views.length + 2) // +2 is system + encryption\n\n    const sys = await this.system.getIndexedInfo(signableLength)\n\n    if (this.interrupted) return\n\n    if (this.pendingViews && this.pendingViews[0].length >= signableLength) {\n      return\n    }\n\n    views[0] = createCheckpointSignature(signableLength, this.systemView, checkpoints.length)\n\n    if (sys.encryptionLength) {\n      views[1] = createCheckpointSignature(\n        sys.encryptionLength,\n        this.encryptionView,\n        checkpoints.length\n      )\n    }\n\n    const offset = 2 // system + encryption\n\n    for (let i = offset; i < views.length; i++) {\n      const view = this.views[i - offset]\n      const core = view.core\n\n      const v = this.getViewFromSystem(view, sys)\n      const length = v ? v.length : 0\n\n      if (!core || length <= core.signedLength) continue\n\n      const viewIndex = view.mappedIndex + offset\n      views[viewIndex] = createCheckpointSignature(length, view, checkpoints.length)\n    }\n\n    for (let i = 0; i < checkpoints.length; i++) {\n      addCheckpointSignatures(views, checkpoints, i)\n    }\n\n    const promises = []\n    for (const view of views) {\n      if (!view) continue\n\n      for (let i = 0; i < view.signatures.length; i++) {\n        promises.push(setPartialSignature(view, i))\n      }\n    }\n\n    await Promise.all(promises)\n\n    // check that the state still looks good, couple replicate inbetween...\n    for (const v of views) {\n      if (!v) continue\n\n      for (let i = 0; i < v.signatures.length; i++) {\n        if (!v.partials[i]) return\n      }\n    }\n\n    if (this.interrupted) return\n\n    if (this.pendingViews && this.pendingViews[0].length >= signableLength) {\n      return\n    }\n    // skipped system for whatever reason...\n    if (!views[0]) return\n\n    this.pendingViews = views\n    this.dirty = true\n\n    // TODO: only needed if not updating, wont crash so keeping for now, just less efficient\n    this.base._queueBump()\n  }\n\n  _close() {\n    if (this.interrupted) return\n    return this._free()\n  }\n\n  async _free() {\n    this.interrupted = true\n    if (this.applying) this._postApply()\n    for (const chk of this.checkpoints) await chk.close()\n    if (this.localCheckpoint) await this.localCheckpoint.close()\n    if (this.view && this.base._hasClose) await this.base._handlers.close(this.view)\n    if (this.system) await this.system.close()\n\n    const promises = []\n    for (const v of this.views) {\n      if (v.ref) promises.push(v.ref.release())\n    }\n\n    if (this.systemView) promises.push(this.systemView.ref.release())\n    if (this.encryptionView) promises.push(this.encryptionView.ref.release())\n\n    await Promise.all(promises)\n    await this.store.close()\n  }\n\n  _pushUpdate(u) {\n    u.version = 1\n    u.seq = this.updates.length === 0 ? 0 : this.updates[this.updates.length - 1].seq + 1\n    u.systemLength = this.systemView.core.length\n    this.updates.push(u)\n    this.localState.insertUpdate(u)\n  }\n\n  async catchup(linearizer) {\n    if (!this.opened) await this.ready()\n    if (!this.system.heads.length) return true\n\n    const writers = new Map()\n\n    // load linearizer...\n    const updates = await this.localState.listUpdates()\n    const sys = await this.system.checkout(this.indexedLength)\n\n    for (const node of updates) {\n      const hex = b4a.toString(node.key, 'hex')\n\n      let w = writers.get(hex)\n\n      if (w === undefined) {\n        // TODO: we actually have all the writer info already but our current methods make it hard to reuse that\n        w = await this.base._getWriterByKey(node.key, -1, 0, true, false, sys)\n        writers.set(hex, w)\n      }\n\n      if (w.length >= node.length) {\n        this.base._warn(new Error('Update expects writer to be consumed here'))\n        return false\n      }\n\n      while (w.length < node.length) {\n        await w.update(sys)\n\n        const next = w.advance()\n        if (!next) {\n          this.base._warn(new Error('Node must exist for catchup'))\n          return false\n        }\n\n        linearizer.addHead(next)\n      }\n    }\n\n    await sys.close()\n\n    this.updates = updates\n\n    if (this.indexersUpdated) {\n      this.indexersUpdated = false\n      // if we updated the indexers, invalidate all the internal state and reapply it\n      await this.truncate(this.indexedLength)\n      await this._rollbackViews()\n\n      if (this.tx === null) this.tx = this.local.state.storage.write()\n\n      while (\n        this.updates.length > 0 &&\n        this.updates[this.updates.length - 1].systemLength >= this.indexedLength\n      ) {\n        const u = this.updates.pop()\n        this.localState.deleteUpdate(u)\n      }\n    } else {\n      // otherwise we know the internal state is correct, so we carry on\n      linearizer.update()\n    }\n\n    // must refresh the writers here so isRemoved is up to date\n    await this._refreshWriters()\n    return true\n  }\n\n  async getIndexedSystem() {\n    if (this.opened === false) await this.ready()\n\n    const indexedLength = this.pendingFork ? this.pendingFork.length : this.indexedLength\n\n    const sys = await this.system.checkout(indexedLength)\n    await sys.ready()\n    return sys\n  }\n\n  getViewFromSystem(view, sys = this.system) {\n    if (view.mappedIndex === -1 || view.mappedIndex >= sys.views.length) return null\n    return sys.views[view.mappedIndex]\n  }\n\n  async recoverAt() {\n    if (!this.systemRef) await this.ready()\n\n    await this.systemRef.core.ready()\n\n    const lt = this.systemRef.core.core.state.length\n\n    for await (const { length, info } of SystemView.flushes(this.systemRef.core.session(), {\n      reverse: true,\n      lt\n    })) {\n      let consistent = true\n\n      for (let i = 0; i < info.views.length; i++) {\n        if (i >= this.views.length) continue\n        if (!b4a.equals(info.views[i].key, this.views[i].key)) continue\n\n        if (info.views[i].length > this.views[i].core.core.state.length) {\n          consistent = false\n          break\n        }\n      }\n\n      if (consistent) {\n        return {\n          length,\n          force: true,\n          key: this.system.core.key,\n          indexers: info.indexers,\n          views: info.views\n        }\n      }\n    }\n\n    return null\n  }\n\n  bootstrap() {\n    return this.system.add(this.base.key, { isIndexer: true, isPending: false })\n  }\n\n  async undo(popped) {\n    if (!popped) return\n\n    let indexersUpdated = false\n    while (popped > 0) {\n      const u = this.updates.pop()\n      this.localState.deleteUpdate(u)\n      popped -= u.batch\n      if (u.indexers) indexersUpdated = true\n    }\n\n    const u = this.updates.length === 0 ? null : this.updates[this.updates.length - 1]\n    const systemLength = u ? u.systemLength : this.indexedLength\n\n    await this.truncate(systemLength)\n    if (indexersUpdated) await this._rollbackViews()\n  }\n\n  async truncate(systemLength) {\n    if (this.opened === false) await this.ready()\n    if (systemLength === this.system.core.length) return\n\n    await this.system.core.truncate(systemLength)\n\n    const migrated = await this.system.update()\n\n    if (this.encryptionView.core.length !== this.system.encryptionLength) {\n      await this.encryptionView.core.truncate(this.system.encryptionLength)\n    }\n\n    for (const view of this.views) {\n      if (!view.core) continue\n\n      const v = this.getViewFromSystem(view)\n\n      if (v && view.core.length === v.length) continue\n      if (v === null) view.mappedIndex = -1 // unmap\n\n      await view.core.truncate(v ? v.length : 0)\n    }\n\n    if (!migrated) return\n\n    await this._refreshWriters()\n    await this._rollbackViews()\n  }\n\n  async _refreshWriters() {\n    // TODO: add the seq at which we updated the state to the writer instance.\n    // then we know if it was truncated out without the lookup, meaning faster truncations\n    for (const w of this.base.activeWriters) {\n      const data = await this.system.get(w.core.key)\n      const bootstrapper = this.system.core.length === 0 && b4a.equals(w.core.key, this.base.key)\n      const isRemoved = data ? data.isRemoved : !bootstrapper\n      w.isRemoved = isRemoved\n    }\n  }\n\n  async _updateSystem() {\n    if (!(await this.system.update())) return\n    await this._refreshWriters()\n    await this._rollbackViews()\n  }\n\n  async _signViewCore(core, length) {\n    const s = await core.signable(length, 0)\n    const signature = crypto.sign(s, this.base.local.keyPair.secretKey)\n    return { signature, length }\n  }\n\n  async _signInternalViewCores(sys) {\n    return {\n      system: await this._signViewCore(this.systemView.core, this.systemView.indexedLength),\n      encryption: await this._signViewCore(this.encryptionView.core, sys.encryptionLength)\n    }\n  }\n\n  async _signUserViewCores(sys) {\n    const promises = new Array(sys.views.length)\n\n    for (let i = 0; i < this.views.length; i++) {\n      const view = this.views[i]\n\n      const v = this.getViewFromSystem(view, sys)\n      const indexedLength = v ? v.length : 0\n\n      if (!indexedLength) continue\n\n      const viewIndex = view.mappedIndex\n      promises[viewIndex] = this._signViewCore(view.ref.atomicBatch, indexedLength)\n    }\n\n    return Promise.all(promises)\n  }\n\n  async finalize(key) {\n    this.localState.setBootRecord({\n      version: BOOT_RECORD_VERSION,\n      key,\n      systemLength: this.systemView.indexedLength,\n      indexersUpdated: true,\n      fastForwarding: false,\n      recoveries: this.base.recoveries\n    })\n\n    await this.localState.flush()\n\n    await this.store.flush()\n    await this.close()\n  }\n\n  async _flush(localNodes) {\n    if (localNodes) await this._appendLocalNodes(localNodes)\n\n    this.localState.setBootRecord({\n      version: BOOT_RECORD_VERSION,\n      key: this.key,\n      systemLength: this.systemView.indexedLength,\n      indexersUpdated: false,\n      fastForwarding: false,\n      recoveries: this.base.recoveries\n    })\n\n    await this.localState.flush()\n\n    if (this.localCheckpoint) {\n      // we have to flush here so the chkpoint can update\n      // could run the checkpoint on the batch but also no big dead\n      // as the \"should we sign\" check is rerun on boot...\n      await this.store.flush()\n      await this.localCheckpoint.update()\n    }\n\n    if (this.pendingViews) {\n      const views = this.pendingViews\n      this.pendingViews = null\n\n      for (let i = views.length - 1; i >= 0; i--) {\n        const v = views[i]\n        if (!v || v.length <= v.core.signedLength) continue\n        const signature = v.core.core.verifier.assemble(v.partials)\n        try {\n          await v.ref.commit(this.store.atom, v.length, signature)\n        } catch (err) {\n          // TODO: we should prevalidate all signatures instead of during commit so it can be all or nothing, just slighly\n          // friendlier ux. missing hc api for that\n          if (!this.base.closing) this.base._warn(err)\n          break\n        }\n      }\n    }\n\n    await this.store.flush()\n\n    this.fastForwarding = false\n    if (this.pendingViews === null) this.dirty = false\n  }\n\n  _indexUpdates(indexed) {\n    let shift = 0\n    while (indexed > 0) indexed -= this.updates[shift++].batch\n\n    const last = this.updates[shift - 1]\n\n    this.systemView.indexedLength = last.systemLength\n\n    for (let i = 0; i < shift; i++) this.localState.deleteUpdate(this.updates[i])\n    this.updates.splice(0, shift)\n\n    if (!this.needsIndexedLengthUpdate) return\n    this.maybeSigned().catch(noop)\n  }\n\n  pendingIndexedLength() {\n    let indexed = this.applying.indexed.length\n    if (!this.applying || !this.updates.length || !indexed) return this.indexedLength\n\n    let pos = 0\n    while (indexed > 0 && pos < this.updates.length) {\n      indexed -= this.updates[pos++].batch\n    }\n\n    const last = this.updates[pos - 1]\n    return last.systemLength\n  }\n\n  async _assertNode(node, batch) {\n    // helpful dag helper, so kept here\n\n    const v = (await this.system.get(node.writer.core.key)) || { length: 0, isRemoved: false }\n    const expected = v.length + batch\n    if (node.length === expected) return\n\n    console.trace(\n      'INVALID_INSERTION',\n      'length=',\n      node.length,\n      'key=',\n      node.writer.core.key,\n      'local=',\n      node.writer.core.writable,\n      'batch=',\n      batch,\n      'dag=',\n      v\n    )\n\n    process.exit(1)\n  }\n\n  _postApply() {\n    this.applyBatch = this.applying = null\n    this.base._postApply()\n  }\n\n  async _optimisticApply(u, node, indexed) {\n    const checkpoint = this.system.checkpoint()\n\n    this.system.addHead(node)\n\n    const applyBatch = []\n    const key = node.writer.core.key\n\n    applyBatch.push({\n      indexed,\n      optimistic: true,\n      from: node.writer.core,\n      length: node.length,\n      value: node.value,\n      heads: node.actualHeads\n    })\n\n    const pre = await this.system.get(key)\n    const preLength = pre ? pre.length : 0\n\n    let failed = false\n\n    this.applying = u\n    this.applyBatch = applyBatch\n    try {\n      await this.base._handlers.apply(applyBatch, this.view, this.hostcalls)\n    } catch (err) {\n      if (this.base.closing) throw err\n      failed = true\n    }\n    this._postApply()\n\n    if (!failed) {\n      const post = await this.system.get(key)\n      // check if acked by addWriter/removeWriter/ackWriter\n      if (!post || preLength === post.length) failed = true\n    }\n\n    if (!failed) {\n      // technically we only need to to this is the writer was removed, but hey, tricky logic\n      await this._refreshWriters()\n      return true\n    }\n\n    // it failed! rollback...\n\n    this.system.applyCheckpoint(checkpoint)\n\n    if (this.encryptionView.core.length !== this.system.encryptionLength) {\n      await this.encryptionView.core.truncate(this.system.encryptionLength)\n    }\n\n    for (const view of this.views) {\n      const viewLength = view.core ? view.core.length : view.length\n      const viewLookup = this.getViewFromSystem(view)\n      const viewSystemLength = viewLookup ? viewLookup.length : 0\n      if (viewSystemLength === viewLength) continue\n      await view.core.truncate(viewSystemLength)\n    }\n\n    await this._refreshWriters()\n\n    await this._rollbackViews()\n    return false\n  }\n\n  _startTrace(node) {\n    this.systemRef.tracer.start()\n    this.encryptionView.ref.tracer.start()\n    for (let i = 0; i < this.views.length; i++) this.views[i].ref.tracer.start()\n  }\n\n  _endTrace(node) {\n    const trace = {\n      system: this.systemRef.tracer.end(),\n      encryption: this.encryptionView.ref.tracer.end(),\n      user: []\n    }\n\n    for (let i = 0; i < this.views.length; i++) {\n      const blocks = this.views[i].ref.tracer.end()\n      if (blocks.length) trace.user.push({ view: i, blocks })\n    }\n\n    if (trace.system.length || trace.encryption.length || trace.user.length) node.trace = trace\n  }\n\n  async update(u, localNodes) {\n    if (this.changes !== null) this.changes.track(this)\n\n    let batch = 0\n    let applyBatch = []\n    let indexersUpdated = 0\n\n    let j = 0\n    let i = 0\n    let forkedAt = -1\n\n    while (i < Math.min(u.indexed.length, u.shared)) {\n      const node = u.indexed[i++]\n\n      if (node.batch > 1) continue\n      this.base._shiftWriter(node.writer)\n\n      const update = this.updates[j++]\n\n      if (update.indexers) {\n        indexersUpdated = i\n        break\n      }\n    }\n\n    if (u.undo) await this.undo(u.undo)\n\n    if (this.system.bootstrapping) await this.bootstrap()\n\n    await this._updateSystem()\n\n    // Organize by view\n    const warmupSystemView = []\n    const warmupEncryptionView = []\n    const warmupUserView = new Array(this.views.length)\n\n    for (let k = u.shared; k < u.length; k++) {\n      const indexed = k < u.indexed.length\n      const node = indexed ? u.indexed[k] : u.tip[k - u.indexed.length]\n      if (!node.trace) continue\n\n      if (node.trace.system.length) warmupSystemView.push(...node.trace.system)\n      if (node.trace.encryption.length) warmupEncryptionView.push(...node.trace.encryption)\n\n      for (const trace of node.trace.user) {\n        // Assert (as warning) that trace view should only be currently indexed views\n        if (trace.view >= this.views.length) {\n          console.warn(\n            'Oplog block trace contains OOB view index',\n            'trace view',\n            trace.view,\n            'views.length',\n            this.views.length\n          )\n          continue\n        }\n\n        warmupUserView[trace.view] = warmupUserView[trace.view] || []\n        warmupUserView[trace.view].push(...trace.blocks)\n      }\n    }\n\n    // Request per view\n    if (warmupSystemView.length) this.systemView.core.download({ blocks: warmupSystemView })\n    if (warmupEncryptionView.length)\n      this.encryptionView.core.download({ blocks: warmupEncryptionView })\n    for (let k = 0; k < warmupUserView.length; k++) {\n      const blocks = warmupUserView[k]\n      if (!blocks) continue\n\n      const view = this.views[k]\n      view.core.download({ blocks })\n    }\n\n    for (i = u.shared; i < u.length; i++) {\n      if (this.base.backoff !== null && this.base.backoff.backoff()) await this.base.backoff.wait()\n\n      const indexed = i < u.indexed.length\n      const node = indexed ? u.indexed[i] : u.tip[i - u.indexed.length]\n\n      batch++\n\n      if (node.writer.core.writable) this._startTrace(node)\n\n      const optimist =\n        node.writer.isRemoved &&\n        node.optimistic &&\n        batch === 1 &&\n        this.base._hasOptimisticApply === true &&\n        (await this._optimisticApply(u, node, indexed))\n\n      if (!optimist) {\n        if (node.writer.isRemoved && !node.writer.isActiveIndexer) {\n          if (node.batch > 1) continue\n          // in case someone is linking this node and they are not removed\n          const u = {\n            seq: 0,\n            key: node.writer.core.key,\n            length: node.length,\n            batch,\n            systemLength: 0,\n            indexers: false\n          }\n          this._pushUpdate(u)\n          batch = 0\n          assert(applyBatch.length === 0, 'Apply batch should not have been modified')\n          continue\n        }\n\n        // in prod we prop need to disable this assertion as its pretty expensive,\n        // but it catches a lot of bugs, so here for debugs\n        // await this._assertNode(node, batch)\n\n        const deps = node.causalDependencies()\n\n        // oldest -> newest\n        for (let i = deps.length - 1; i >= 1; i--) {\n          const d = deps[i]\n          if (await this.system.linkable(d.writer.core.key, d.length)) {\n            this.system.addHead(deps[i])\n          }\n        }\n\n        this.system.addHead(deps[0])\n\n        if (node.value !== null && !node.writer.isRemoved) {\n          applyBatch.push({\n            indexed,\n            optimistic: false,\n            from: node.writer.core,\n            length: node.length,\n            value: node.value,\n            heads: node.actualHeads\n          })\n        }\n\n        if (node.batch > 1) continue\n\n        if (applyBatch.length && this.base._hasApply === true) {\n          this.applying = u\n          this.applyBatch = applyBatch\n          await this.base._handlers.apply(applyBatch, this.view, this.hostcalls)\n          if (forkedAt === -1 && this.pendingFork) forkedAt = i\n          this._postApply()\n        }\n      }\n\n      const update = {\n        seq: 0,\n        key: node.writer.core.key,\n        length: node.length,\n        batch,\n        systemLength: 0,\n        indexers: false\n      }\n\n      update.indexers = !!this.system.indexerUpdate\n\n      if (this.system.indexerUpdate) await this._generateNextViews()\n\n      await this.system.flush(this.views)\n      await this.system.update()\n\n      if (node.writer.core.writable) this._endTrace(node)\n\n      batch = 0\n      applyBatch = []\n\n      this._pushUpdate(update)\n\n      if (!indexed || indexersUpdated) continue\n\n      this.base._shiftWriter(node.writer)\n\n      if (update.indexers) {\n        indexersUpdated = i + 1\n      }\n    }\n\n    if (this.pendingFork) {\n      const pending = this.pendingFork\n      if (pending.length > this.indexedLength) this._indexUpdates(u.indexed.length)\n\n      const fork = new Fork(this.base, this.store, this, pending)\n      const forked = await fork.upgrade()\n\n      if (!forked) throw new Error('Fork failed')\n\n      await this._flush(localNodes)\n\n      return {\n        reboot: true,\n        migrated: false\n      }\n    }\n\n    if (u.indexed.length) {\n      this._indexUpdates(indexersUpdated || u.indexed.length)\n    }\n\n    const migrated = indexersUpdated !== 0\n    if (migrated) this.key = await this.base._premigrate()\n\n    if (this.changes !== null) {\n      this.changes.finalise()\n      await this.base._handlers.update(this.view, this.changes)\n    }\n\n    await this._flush(localNodes)\n\n    return {\n      reboot: migrated,\n      migrated\n    }\n  }\n\n  flush() {\n    return this._flush(null)\n  }\n\n  async _appendLocalNodes(localNodes) {\n    if (localNodes.length === 0) return // just in case\n\n    const blocks = new Array(localNodes.length)\n    const local = this.local\n\n    if (!local.opened) await local.ready()\n\n    for (let i = 0; i < blocks.length; i++) {\n      const { value, heads, batch, optimistic, trace } = localNodes[i]\n\n      blocks[i] = {\n        version: OPLOG_VERSION,\n        maxSupportedVersion: this.base.maxSupportedVersion,\n        checkpoint: null,\n        digest: null,\n        optimistic,\n        node: {\n          heads,\n          batch,\n          value: value === null ? null : c.encode(this.base.valueEncoding, value)\n        },\n        trace\n      }\n    }\n\n    if (this.localIndexer) {\n      const signedLength = this.localCheckpoint.signedLength()\n      const local = this.local\n\n      let signedAt = 0\n      let internalSignatures = null\n      let signatures = null\n\n      if (this.indexedLength > signedLength) {\n        const sys = await this.system.getIndexedInfo(this.indexedLength)\n        internalSignatures = await this._signInternalViewCores(sys)\n        signatures = await this._signUserViewCores(sys)\n        signedAt = local.length + blocks.length\n      }\n\n      for (let i = 0; i < blocks.length; i++) {\n        const length = local.length + i + 1\n        if (length === signedAt) {\n          this.localCheckpoint.updateInternalSignatures(length, internalSignatures)\n          this.localCheckpoint.updateUserSignatures(length, signatures)\n        }\n\n        const blk = blocks[i]\n\n        blk.checkpoint = this.localCheckpoint.makeCheckpoints(length)\n        blk.digest = this.localCheckpoint.makeDigest(length, this.key)\n      }\n    } else {\n      if (!this.localCheckpoint) await this._startLocalCheckpoint()\n\n      for (let i = 0; i < blocks.length; i++) {\n        const length = local.length + i + 1\n        blocks[i].digest = this.localCheckpoint.makeDigest(length, this.key)\n      }\n    }\n\n    await local.append(blocks)\n  }\n\n  async _rollbackViews() {\n    // encryption view key is not in system so no need to handle here\n    for (const view of this.views) {\n      const v = this.getViewFromSystem(view)\n\n      if (v) {\n        view.key = v.key\n      } else {\n        await this._resetView(view)\n      }\n    }\n  }\n\n  async createAnchor() {\n    const node = this.applyBatch[this.applyBatch.length - 1]\n    const key = node.from.key\n    const length = node.length\n\n    const info = await this.system.get(key, { unflushed: true })\n\n    if (!info || info.length < length) throw new Error('Anchor node is not in system')\n\n    const state = { start: 0, end: 40, buffer: b4a.alloc(40) }\n    c.fixed32.encode(state, key)\n    c.uint64.encode(state, length)\n\n    const namespace = crypto.hash(state.buffer)\n    const manifestData = c.encode(messages.ManifestData, { version: 0, legacyBlocks: 0, namespace })\n\n    const padding = this.encryption ? AutobaseEncryption.PADDING : 0\n    const block = encodeValue(null, { heads: [{ key, length }], padding })\n    if (this.encryption) await this.encryption.encryptAnchor(block, namespace)\n\n    const root = { index: 0, size: block.byteLength, hash: crypto.data(block) }\n    const hash = crypto.tree([root])\n    const prologue = { hash, length: 1 }\n\n    const core = this.store.createAnchorCore(prologue, manifestData)\n    await core.ready()\n\n    if (core.length === 0) await core.append(block, { writable: true, maxLength: 1 })\n\n    await this.system.add(core.key, { isIndexer: false, length: 0 })\n    await this.base._addWriter(core.key, this.system)\n\n    const anchor = { key: core.key, length: core.length }\n\n    await core.close()\n    await this.base.hintWakeup(anchor)\n\n    return anchor\n  }\n\n  async _resetView(view) {\n    const manifests = await this.store.getIndexerManifests(this.system.indexers)\n\n    const manifestData = view.core ? view.core.manifest.userData : null\n    view.key = await this.store.createView(\n      manifests,\n      view.name,\n      null,\n      this.system.core.manifest.version,\n      this.system.entropy,\n      null,\n      manifestData\n    ) // will never be system so no linked\n    view.length = 0\n  }\n\n  async _generateNextViews() {\n    const sys = this.system\n\n    // note, this is very state dependent so can ONLY be called at the exact time an indexer upgrade occurs\n    const manifests = await this.store.getIndexerManifests(sys.indexers)\n    const entropy = sys.version < 2 ? null : sys.getEntropy(sys.indexers, sys.flushLength())\n\n    for (const v of this.views) {\n      const manifestData = v.core ? v.core.manifest.userData : null\n\n      const prologue = await getPrologue(v)\n      const key = await this.store.createView(\n        manifests,\n        v.name,\n        prologue,\n        sys.core.manifest.version,\n        entropy,\n        null,\n        manifestData\n      )\n\n      v.key = key\n    }\n  }\n}\n\nasync function getPrologue(view) {\n  const length = view.core ? view.core.length : view.length\n  if (!length) return null\n\n  const hash = await view.core.treeHash(length)\n\n  return {\n    hash,\n    length\n  }\n}\n\nfunction noop() {}\n\nfunction cmpCheckpoints(a, b) {\n  return a.signedLength() - b.signedLength()\n}\n\nfunction sameSignature(a, b) {\n  if (!a || !b) return a === b\n  return a.length === b.length\n}\n\nfunction sameSignatures(a, b) {\n  if (!a || !b) return a === b\n  if (a.length !== b.length) return false\n  for (let i = 0; i < a.length; i++) {\n    if (a[i].length !== b[i].length) return false\n  }\n  return true\n}\n\nfunction createCheckpointSignature(length, view, checkpoints) {\n  return {\n    length,\n    core: view.core,\n    ref: view.ref,\n    signatures: new Array(checkpoints),\n    partials: new Array(checkpoints)\n  }\n}\n\nfunction addCheckpointSignatures(pending, checkpoints, index) {\n  const { signer, signatures } = checkpoints[index]\n\n  pending[0].signatures[index] = {\n    signature: signatures.system.signature,\n    length: signatures.system.length,\n    signer\n  }\n\n  if (pending[1]) {\n    pending[1].signatures[index] = {\n      signature: signatures.encryption.signature,\n      length: signatures.encryption.length,\n      signer\n    }\n  }\n\n  for (let i = 2; i < pending.length; i++) {\n    if (!pending[i]) continue\n\n    const { length, signature } = signatures.user[i - 2]\n\n    pending[i].signatures[index] = {\n      signature,\n      length,\n      signer\n    }\n  }\n}\n\nasync function setPartialSignature(view, index) {\n  const sig = view.signatures[index]\n  if (sig.length < view.length && sig.length > 0) await view.core.get(sig.length - 1)\n\n  view.partials[index] = await partialSignature(\n    view.core,\n    sig.signer,\n    view.length,\n    sig.length,\n    sig.signature\n  )\n}\n\nfunction updateSignature(length, sig, existing) {\n  return sig ? { signature: sig.signature, length: sig.length, at: length } : existing\n}\n\nfunction updateSignatures(length, signatures, existing) {\n  const updated = new Array(signatures.length)\n\n  for (let i = 0; i < updated.length; i++) {\n    updated[i] = updateSignature(length, signatures[i], i < existing.length ? existing[i] : null)\n  }\n\n  return updated\n}\n\nfunction makeCheckpoint(length, chk) {\n  if (!chk) return null\n\n  const checkpointer = length - chk.at\n\n  return {\n    checkpointer,\n    checkpoint: checkpointer === 0 ? { signature: chk.signature, length: chk.length } : null\n  }\n}\n\nfunction makeCheckpoints(length, signatures) {\n  if (!signatures.length) return null\n\n  const checkpoints = new Array(signatures.length)\n\n  for (let i = 0; i < signatures.length; i++) {\n    checkpoints[i] = makeCheckpoint(length, signatures[i])\n  }\n\n  return checkpoints\n}\nconst c = require('compact-encoding')\nconst encryptionEncoding = require('encryption-encoding')\nconst messages = require('./messages.js')\n\nmodule.exports = async function boot(\n  corestore,\n  key,\n  { encrypt, encryptionKey, keyPair, exclusive = true, blindEncryption } = {}\n) {\n  const result = {\n    key: null,\n    local: null,\n    bootstrap: null,\n    encryptionKey: null,\n    boot: null\n  }\n\n  const manifest = keyPair\n    ? { version: corestore.manifestVersion, signers: [{ publicKey: keyPair.publicKey }] }\n    : null\n\n  if (key) {\n    result.key = key\n\n    const bootstrap = corestore.get({ key, active: false, valueEncoding: messages.OplogMessage })\n    await bootstrap.ready()\n\n    const localKey = await bootstrap.getUserData('autobase/local')\n\n    if (keyPair) {\n      result.local = corestore.get({\n        keyPair,\n        active: false,\n        exclusive,\n        valueEncoding: messages.OplogMessage,\n        manifest\n      })\n    } else {\n      if (bootstrap.writable && !localKey) {\n        result.local = bootstrap.session({\n          active: false,\n          exclusive,\n          valueEncoding: messages.OplogMessage\n        })\n      } else {\n        const local = localKey\n          ? corestore.get({\n              key: localKey,\n              active: false,\n              exclusive,\n              valueEncoding: messages.OplogMessage\n            })\n          : corestore.get({\n              name: 'local',\n              active: false,\n              exclusive,\n              valueEncoding: messages.OplogMessage\n            })\n\n        await local.ready()\n        result.local = local\n      }\n    }\n\n    result.bootstrap = bootstrap\n  } else {\n    result.local = keyPair\n      ? corestore.get({\n          keyPair,\n          manifest,\n          active: false,\n          exclusive,\n          valueEncoding: messages.OplogMessage\n        })\n      : corestore.get({\n          name: 'local',\n          active: false,\n          exclusive,\n          valueEncoding: messages.OplogMessage\n        })\n    await result.local.ready()\n\n    const key = await result.local.getUserData('referrer')\n    if (key) {\n      result.key = key\n      result.bootstrap = corestore.get({ key, active: false, valueEncoding: messages.OplogMessage })\n      await result.bootstrap.ready()\n    } else {\n      result.key = result.local.key\n      result.bootstrap = result.local.session({\n        active: false,\n        valueEncoding: messages.OplogMessage\n      })\n      await result.bootstrap.setUserData('autobase/local', result.local.key)\n    }\n  }\n\n  if (key || keyPair) {\n    await result.bootstrap.setUserData('referrer', result.key)\n    await result.bootstrap.setUserData('autobase/local', result.local.key)\n    await result.local.setUserData('referrer', result.key)\n  }\n\n  const [encryptionKeyBuffer, encryptionKeyEncryptedBuffer, pointer] = await Promise.all([\n    result.local.getUserData('autobase/encryption'),\n    result.local.getUserData('autobase/blind-encryption'),\n    result.local.getUserData('autobase/boot')\n  ])\n\n  if (pointer) {\n    result.boot = c.decode(messages.BootRecord, pointer)\n  }\n\n  if (encryptionKeyBuffer) {\n    // if not encoded, replace\n    if (blindEncryption) {\n      const encrypted = await encryptionEncoding.encrypt(\n        encryptionKeyBuffer,\n        blindEncryption.encrypt\n      )\n      await result.local.setUserData('autobase/blind-encryption', encrypted)\n      await result.local.setUserData('autobase/encryption', null)\n    }\n\n    result.encryptionKey = encryptionKeyBuffer\n  }\n\n  if (encryptionKeyEncryptedBuffer) {\n    const { value, rotated } = await encryptionEncoding.decrypt(\n      encryptionKeyEncryptedBuffer,\n      blindEncryption.decrypt\n    )\n\n    if (rotated) {\n      const encrypted = await encryptionEncoding.encrypt(value, blindEncryption.encrypt)\n      await result.local.setUserData('autobase/blind-encryption', encrypted)\n    }\n\n    result.encryptionKey = value\n  }\n\n  if (!result.encryptionKey && (encryptionKey || encrypt)) {\n    if (!encryptionKey) {\n      encryptionKey = (await corestore.createKeyPair('autobase/encryption')).secretKey.subarray(\n        0,\n        32\n      )\n    }\n\n    if (blindEncryption) {\n      const encrypted = await encryptionEncoding.encrypt(encryptionKey, blindEncryption.encrypt)\n      await result.local.setUserData('autobase/blind-encryption', encrypted)\n    } else {\n      await result.bootstrap.setUserData('autobase/encryption', encryptionKey) // legacy support\n      await result.local.setUserData('autobase/encryption', encryptionKey)\n    }\n    result.encryptionKey = encryptionKey\n  }\n\n  return result\n}\nconst crypto = require('hypercore-crypto')\n\nconst OPLOG_VERSION = 2\nconst DEFAULT_AUTOBASE_VERSION = 1 // default\nconst MAX_AUTOBASE_VERSION = 2 // optional fork support\nconst BOOT_RECORD_VERSION = 3\n\nconst [NS_SIGNER_NAMESPACE, NS_VIEW_BLOCK_KEY, NS_HASH_KEY, NS_ENCRYPTION] = crypto.namespace(\n  'autobase',\n  4\n)\n\nmodule.exports = {\n  OPLOG_VERSION,\n  DEFAULT_AUTOBASE_VERSION,\n  MAX_AUTOBASE_VERSION,\n  BOOT_RECORD_VERSION,\n  NS_SIGNER_NAMESPACE,\n  NS_VIEW_BLOCK_KEY,\n  NS_HASH_KEY,\n  NS_ENCRYPTION\n}\nconst BufferMap = require('tiny-buffer-map')\n\n// This is basically just a Map atm, but leaving it as an abstraction for now\n// in case we wanna optimize it for our exact usecase\n\nmodule.exports = class Clock {\n  constructor() {\n    this.seen = new BufferMap()\n  }\n\n  get size() {\n    return this.seen.size\n  }\n\n  has(key) {\n    return this.seen.has(key)\n  }\n\n  includes(key, length) {\n    return this.seen.has(key) && this.seen.get(key) >= length\n  }\n\n  get(key) {\n    return this.seen.get(key) || 0\n  }\n\n  set(key, len) {\n    this.seen.set(key, len)\n    return len\n  }\n\n  add(clock) {\n    for (const [key, l] of clock) {\n      if (this.get(key) < l) this.set(key, l)\n    }\n  }\n\n  [Symbol.iterator]() {\n    return this.seen[Symbol.iterator]()\n  }\n}\nconst BufferMap = require('tiny-buffer-map')\n\nconst Clock = require('./clock.js')\n\nconst UNSEEN = 0\nconst NEWER = 1\nconst ACKED = 2\n\n// Consensus machine for Autobase. Sort DAG nodes using\n// vector clocks to determine a globally consistent view\n\nmodule.exports = class Consensus {\n  constructor(indexers) {\n    this.merges = new Set()\n    this.majority = (indexers.length >>> 1) + 1\n    this.indexers = indexers\n    this.removed = new Clock()\n    this.updated = false\n\n    this.writers = new BufferMap()\n    for (const idx of this.indexers) {\n      this.writers.set(idx.core.key, idx)\n    }\n  }\n\n  addHead(node) {\n    if (!node.writer.isActiveIndexer) return\n    if (this._isMerge(node)) this.merges.add(node)\n    this.updated = true\n    return node\n  }\n\n  /* Indexer Only DAG methods */\n\n  _tails(node, tails) {\n    const tailSet = new Set()\n    for (const t of tails) {\n      if (node.clock.includes(t.writer.core.key, t.length)) tailSet.add(t)\n    }\n\n    return tailSet\n  }\n\n  _tailsAndMerges(node, tails) {\n    const all = this._tails(node, tails)\n    for (const m of this.merges) {\n      if (m !== node && node.clock.includes(m.writer.core.key, m.length)) {\n        all.add(m)\n      }\n    }\n    return all\n  }\n\n  _isMerge(node) {\n    if (!node.writer.isActiveIndexer) return false\n\n    const deps = []\n\n    for (const idx of this.indexers) {\n      let seq = node.clock.get(idx.core.key) - 1\n\n      if (idx === node.writer) seq--\n\n      const head = idx.get(seq)\n      if (!head || this.removed.includes(head.writer.core.key, head.length)) continue\n\n      let isDep = true\n      for (let i = 0; i < deps.length; i++) {\n        const d = deps[i]\n        if (d === head) continue\n\n        if (d.clock.includes(head.writer.core.key, head.length)) {\n          isDep = false\n          break\n        }\n\n        if (head.clock.includes(d.writer.core.key, d.length)) {\n          const popped = deps.pop()\n          if (d === popped) continue\n          deps[i--] = popped\n        }\n      }\n\n      if (isDep) deps.push(head)\n    }\n\n    return deps.length > 1\n  }\n\n  _indexerTails() {\n    const tails = new Set()\n    for (const idx of this.indexers) {\n      const length = this.removed.has(idx.core.key) ? this.removed.get(idx.core.key) : idx.indexed\n\n      const head = idx.get(length)\n      if (!head || this.removed.includes(head.writer.core.key, head.length)) continue\n\n      let isTail = true\n      for (const t of tails) {\n        if (head.clock.includes(t.writer.core.key, t.length)) {\n          isTail = false\n          break\n        }\n\n        if (t.clock.includes(head.writer.core.key, head.length)) {\n          tails.delete(t)\n        }\n      }\n\n      if (isTail) tails.add(head)\n    }\n\n    return tails\n  }\n\n  // parent is newer if for any node in parent's view,\n  // either node can see object or object can see node\n  _strictlyNewer(object, parent) {\n    if (!parent.clock.includes(object.writer.core.key, object.length)) return false\n\n    for (const [key, latest] of parent.clock) {\n      const oldest = this.removed.get(key)\n      if (latest <= oldest) continue // check quickly if we removed it\n\n      // get the NEXT node from the writer from the objects pov, adjust if its removed\n      let length = object.clock.get(key)\n      if (length <= oldest) length = oldest\n\n      // sanity check, likely not needed as someone has checked this before, but it's free\n      if (latest < length) return false\n\n      // if the same, they have both seen it, continue\n      if (latest === length) continue\n\n      const writer = this.writers.get(key)\n\n      // might not be in the removed set but the writer can tell us if it was indexed...\n      const next = writer && writer.get(length >= writer.indexed ? length : writer.indexed)\n\n      // no next, its been indexed, both seen it\n      if (!next) continue\n\n      // if the NEXT node has seen the object its fine - newer\n      if (next.clock.includes(object.writer.core.key, object.length)) continue\n\n      // otherwise the parent must also NOT have seen the next node\n      if (latest < next.length) continue\n\n      return false\n    }\n\n    return true\n  }\n\n  _acks(target) {\n    const acks = target.writer.isActiveIndexer ? [target] : [] // TODO: can be cached on the target node in future (ie if we add one we dont have to check it again)\n\n    for (const idx of this.indexers) {\n      if (idx === target.writer) continue\n\n      let next = target.clock.get(idx.core.key)\n      if (next < idx.nodes.offset) next = idx.nodes.offset\n\n      const nextIndexNode = idx.get(next >= idx.indexed ? next : idx.indexed)\n\n      // no node - no ack\n      if (!nextIndexNode) continue\n\n      // if the next index node does not see the target, no ack\n      if (!nextIndexNode.clock.includes(target.writer.core.key, target.length)) continue\n\n      // if the next index node is not strictly newer, skip to avoid ambig...\n      if (!this._strictlyNewer(target, nextIndexNode)) continue\n\n      acks.push(nextIndexNode)\n    }\n\n    return acks\n  }\n\n  acksFromNode(target, view) {\n    const acks = new Set()\n\n    if (!view || !view.clock.includes(target.writer.core.key, target.length)) return acks\n\n    acks.add(view.writer)\n\n    for (const idx of this.indexers) {\n      if (idx === view.writer) continue\n\n      const length = view.clock.get(idx.core.key)\n      if (!length) continue\n\n      if (target.clock.includes(idx.core.key, length)) continue\n\n      const head = idx.get(length - 1)\n      if (!head) continue\n\n      if (head.clock.includes(target.writer.core.key, target.length)) {\n        acks.add(idx)\n      }\n    }\n\n    return acks\n  }\n\n  _ackedAt(acks, parent) {\n    let seen = 0\n    let missing = acks.length\n\n    for (const node of acks) {\n      missing--\n\n      if (!parent.clock.includes(node.writer.core.key, node.length)) {\n        if (seen + missing < this.majority) return false\n        continue\n      }\n\n      if (++seen >= this.majority) return true\n    }\n\n    return false\n  }\n\n  confirms(indexer, target, acks, length) {\n    if (!length || this.removed.get(indexer.core.key) >= length) return UNSEEN\n    // def feels like there is a smarter way of doing this part\n    // ie we just wanna find a node from the indexer that is strictly newer than target\n    // and seens a maj of the acks - thats it\n\n    let jump = true\n    let newer = true\n\n    for (let i = length - 1; i >= 0; i--) {\n      const head = indexer.get(i)\n      if (head === null) return UNSEEN\n\n      let seen = 0\n\n      for (const node of acks) {\n        // if (node.writer === indexer) continue\n        if (!head.clock.includes(node.writer.core.key, node.length)) continue\n        if (++seen >= this.majority) break\n      }\n\n      if (!newer && seen < this.majority) {\n        break\n      }\n\n      if (!this._strictlyNewer(target, head)) {\n        // all strictly newer nodes are clustered together so bisect until we find the cluster\n        if (jump) {\n          jump = false\n\n          let t = length - 1\n          let b = 0\n\n          while (t > b) {\n            const mid = (t + b) >>> 1\n            const node = indexer.get(mid)\n\n            if (\n              node === null ||\n              !node.clock.includes(target.writer.core.key, target.length) ||\n              this._strictlyNewer(target, node)\n            ) {\n              b = mid + 1\n            } else {\n              t = mid - 1\n            }\n          }\n\n          // + 2 in case we are off by one and the i--. its fine, just an optimisation\n          if (b + 1 < i) i = b + 2\n        }\n\n        newer = false\n        continue\n      } else if (seen < this.majority) {\n        return NEWER\n      }\n\n      return ACKED\n    }\n\n    return UNSEEN\n  }\n\n  _isConfirmed(target, parent = null) {\n    const acks = this._acks(target)\n    const confs = new Set()\n\n    if (acks.length < this.majority) return false\n    let allNewer = true\n\n    for (const indexer of this.indexers) {\n      const length = parent\n        ? parent.writer === indexer\n          ? parent.length - 1\n          : parent.clock.get(indexer.core.key)\n        : indexer.length\n\n      const result = this.confirms(indexer, target, acks, length)\n\n      if (result === ACKED) {\n        confs.add(indexer)\n        if (confs.size >= this.majority) {\n          return true\n        }\n      }\n\n      if (result === UNSEEN) allNewer = false\n    }\n\n    if (parent) return this._isConfirmableAt(target, parent, acks, confs)\n\n    return allNewer\n  }\n\n  _isConfirmableAt(target, parent, acks, confs) {\n    if (!this._ackedAt(acks, parent)) return false\n\n    let potential = confs.size\n\n    for (const indexer of this.indexers) {\n      if (confs.has(indexer)) continue\n\n      const length = parent.clock.get(indexer.core.key)\n      const isSeen = target.clock.includes(indexer.core.key, length)\n\n      // if the target has seen the latest node, it can freely be used to confirm the target later\n      // otherwise, check if a newer node is strictly newer...\n      if (!isSeen) {\n        const head = indexer.get(length - 1)\n\n        // the next indexer head HAS to be strictly newer - meaning the current one has to be also.\n        if (\n          head &&\n          !this.removed.includes(head.writer.core.key, head.length) &&\n          !this._strictlyNewer(target, head)\n        ) {\n          continue\n        }\n      }\n\n      if (++potential >= this.majority) return true\n    }\n\n    return false\n  }\n\n  // this can get called multiple times for same node\n  remove(node) {\n    this.merges.delete(node)\n    this.removed.set(node.writer.core.key, node.length)\n    return node\n  }\n\n  shift() {\n    if (!this.updated) return []\n\n    const tails = this._indexerTails()\n\n    for (const tail of tails) {\n      if (this._isConfirmed(tail)) {\n        return [this.remove(tail)]\n      }\n    }\n\n    for (const merge of this.merges) {\n      if (this._isConfirmed(merge)) {\n        return this._yieldNext(merge, tails)\n      }\n    }\n\n    this.updated = false\n    return []\n  }\n\n  // yields next indexer node\n  _yieldNext(node, tails) {\n    // only stop when we find a tail\n    while (!tails.has(node)) {\n      let next = null\n\n      // for merges check if one fork is confirmed\n      for (const t of this._tailsAndMerges(node, tails)) {\n        if (this._isConfirmed(t, node)) {\n          next = t\n          break\n        }\n      }\n\n      if (next) {\n        node = next\n        continue\n      }\n\n      // otherwise yield all tails\n      const tailSet = []\n      for (const t of this._tails(node, tails)) {\n        tailSet.push(this.remove(t))\n      }\n\n      return tailSet\n    }\n\n    return [this.remove(node)]\n  }\n\n  shouldAck(writer) {\n    for (const t of this._indexerTails()) {\n      if (t.writer === writer) continue\n      if (this._shouldAckNode(t, writer)) return true\n    }\n\n    return false\n  }\n\n  _shouldAckNode(target, writer) {\n    const head = writer.head()\n    const next = target.clock.get(writer.core.key)\n    const nextIndexNode = writer.get(next >= writer.indexed ? next : writer.indexed)\n\n    // if we have no next node and we didn't write target then ack\n    if (!nextIndexNode && writer !== target.writer) return true\n\n    // shortcuts if we have next node\n    if (nextIndexNode) {\n      // if the next node does not see the target, should ack\n      if (!nextIndexNode.clock.includes(target.writer.core.key, target.length)) {\n        return !head.clock.includes(target.writer.core.key, target.length)\n      }\n\n      // if the next node is not strictly newer, no point acking\n      if (!this._strictlyNewer(target, nextIndexNode)) return false\n    }\n\n    // now check if we can double confirm\n    const acks = this._acks(target)\n\n    // need enough to double confirm\n    if (acks.length >= this.majority) {\n      return this.confirms(writer, target, acks, writer.length) === UNSEEN\n    }\n\n    return false\n  }\n}\nconst HypercoreEncryption = require('hypercore/lib/default-encryption.js')\nconst sodium = require('sodium-universal')\nconst crypto = require('hypercore-crypto')\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\nconst rrp = require('resolve-reject-promise')\nconst ReadyResource = require('ready-resource')\n\nconst SystemView = require('./system.js')\nconst { EncryptionDescriptor, ManifestData } = require('./messages.js')\nconst { NS_VIEW_BLOCK_KEY, NS_HASH_KEY, NS_ENCRYPTION } = require('./caps.js')\n\nconst nonce = b4a.alloc(sodium.crypto_stream_NONCEBYTES)\nconst hash = nonce.subarray(0, sodium.crypto_generichash_BYTES_MIN)\n\nclass AutobaseEncryption {\n  static PADDING = 8\n\n  constructor(encryption) {\n    this.encryption = encryption\n\n    this.compat = null\n    this.keys = null\n    this.keysById = new Map()\n  }\n\n  get id() {\n    return this.keys ? this.keys.id : 0\n  }\n\n  padding() {\n    return AutobaseEncryption.PADDING\n  }\n\n  isCompat() {\n    return false\n  }\n\n  load(keys) {\n    if (this.keys === null) this.keys = keys\n  }\n\n  async update(ctx) {\n    if (this.id !== 0 && this.id === this.encryption.id) return\n    const keys = await this.get(this.encryption.id, ctx)\n    if (keys) this.keys = keys\n  }\n\n  async get(id, ctx) {\n    if (this.keysById.has(id)) return this.keysById.get(id)\n\n    const keys = await this.getKeys(id, ctx)\n    this.keysById.set(id, keys)\n\n    return keys\n  }\n\n  async getKeys(id, ctx) {\n    const entropy = await this.encryption.get(id)\n    if (!entropy) return null\n\n    const block = this.blockKey(entropy, ctx)\n    const hash = crypto.hash([NS_HASH_KEY, block])\n\n    return {\n      id,\n      block,\n      hash\n    }\n  }\n\n  blockKey(entropy, ctx) {\n    return this.encryption.blockKey(entropy, ctx)\n  }\n\n  async _ensureCompat(ctx) {\n    if (!this.compat) this.compat = this.compatKeys(ctx)\n  }\n\n  compatKeys() {\n    throw new Error('Compatability method is not specified')\n  }\n\n  async encrypt(index, block, fork, ctx) {\n    if (this.isCompat(ctx, index)) {\n      this._ensureCompat(ctx)\n      return HypercoreEncryption.encrypt(\n        index,\n        block,\n        fork,\n        this.compat.block,\n        this.compat.blinding\n      )\n    }\n\n    await this.update(ctx)\n\n    encryptBlock(index, block, this.keys.id, this.keys.block, this.keys.hash)\n  }\n\n  async decrypt(index, block, ctx) {\n    if (this.isCompat(ctx, index)) {\n      this._ensureCompat(ctx)\n      return HypercoreEncryption.decrypt(index, block, this.compat.block)\n    }\n\n    const padding = block.subarray(0, AutobaseEncryption.PADDING)\n    block = block.subarray(AutobaseEncryption.PADDING)\n\n    const type = padding[0]\n    switch (type) {\n      case 0:\n        return block // unencrypted\n\n      case 1:\n        break\n\n      default:\n        throw new Error('Unrecognised encryption type')\n    }\n\n    const id = c.uint32.decode({ start: 4, end: 8, buffer: padding })\n\n    const keys = await this.get(id, ctx)\n\n    c.uint64.encode({ start: 0, end: 8, buffer: nonce }, index)\n    nonce.set(padding, 8, 16)\n\n    // Decrypt the block using the full nonce\n    decrypt(block, nonce, keys.block)\n  }\n}\n\nclass ViewEncryption extends AutobaseEncryption {\n  constructor(encryption, name) {\n    super(encryption)\n    this.name = name\n  }\n\n  isCompat(ctx, index) {\n    if (ctx.manifest.version <= 1) return true\n    if (!ctx.manifest.userData) return false\n    const { legacyBlocks } = c.decode(ManifestData, ctx.manifest.userData)\n    return index < legacyBlocks\n  }\n\n  compatKeys() {\n    const { bootstrap, encryptionKey } = this.encryption.base\n    const block = getCompatBlockKey(bootstrap, encryptionKey, this.name)\n    return {\n      block,\n      blinding: crypto.hash(block)\n    }\n  }\n\n  blockKey(entropy) {\n    return getCompatBlockKey(this.encryption.base.bootstrap, entropy, this.name)\n  }\n}\n\nclass WriterEncryption extends AutobaseEncryption {\n  isCompat(ctx) {\n    return ctx.manifest.version <= 1\n  }\n\n  compatKeys(ctx) {\n    return HypercoreEncryption.deriveKeys(this.encryption.base.encryptionKey, ctx.key)\n  }\n\n  blockKey(entropy, ctx) {\n    if (ctx.manifest.userData) {\n      const userData = c.decode(ManifestData, ctx.manifest.userData)\n      if (userData.namespace !== null) {\n        return this.encryption.blockKey(entropy, { key: userData.namespace })\n      }\n    }\n\n    return this.encryption.blockKey(entropy, ctx)\n  }\n}\n\nclass EncryptionView extends ReadyResource {\n  constructor(base, core) {\n    super()\n\n    this.base = base\n    this.core = core || null\n\n    this.sessions = new Map()\n\n    this._initialising = null\n  }\n\n  async _open() {\n    await this.initialised()\n    await this.core.ready()\n  }\n\n  initialised() {\n    if (this.core !== null) return this.core.ready()\n    if (this._initialising) return this._initialising\n\n    this._initialising = rrp()\n\n    return this._initialising.promise\n  }\n\n  _close() {\n    if (this._initialising) {\n      this._initialising.reject(new Error('Encryption closed'))\n      this._initialising = null\n    }\n\n    if (this.core) return this.core.close()\n  }\n\n  get bootstrapped() {\n    return !!(this.core && this.core.length > 0)\n  }\n\n  get id() {\n    return this.core ? this.core.length : 0\n  }\n\n  _createPayload(key) {\n    return key\n  }\n\n  async reload(core) {\n    if (this.core) await this.core.close()\n\n    this.core = core\n    await this.core.ready()\n\n    if (this._initialising) {\n      this._initialising.resolve()\n      this._initialising = null\n    }\n  }\n\n  unpack(type, payload) {\n    if (type > 0) throw new Error('Unsupported version')\n    return payload\n  }\n\n  async update(key) {\n    const payload = await this._createPayload(key)\n    const desc = { type: 0, payload }\n\n    await this.core.append(c.encode(EncryptionDescriptor, desc))\n  }\n\n  async _preload() {\n    await this.ready()\n    return this.id()\n  }\n\n  getViewEncryption(name) {\n    if (this.sessions.has(name)) return this.sessions.get(name)\n\n    const encryption = new ViewEncryption(this, name)\n    this.sessions.set(name, encryption)\n\n    return encryption\n  }\n\n  getWriterEncryption() {\n    return new WriterEncryption(this)\n  }\n\n  async encryptAnchor(block, namespace) {\n    const entropy = await this.get(this.id)\n    if (!entropy) return null\n\n    const blockKey = this.blockKey(entropy, { key: namespace })\n    const hashKey = crypto.hash([NS_HASH_KEY, block])\n\n    encryptBlock(0, block, this.id, blockKey, hashKey)\n  }\n\n  blockKey(entropy, ctx) {\n    return getBlockKey(this.base.bootstrap, this.base.encryptionKey, entropy, ctx.key)\n  }\n\n  async get(encryptionId) {\n    if (encryptionId === 0) return SystemView.GENESIS_ENTROPY\n\n    if (!this.core) await this.initialised()\n\n    const index = encryptionId - 1\n    const desc = await this.core.get(index)\n    const { type, payload } = c.decode(EncryptionDescriptor, desc)\n\n    const key = this.unpack(type, payload)\n    return key\n  }\n\n  getSystemEncryption() {\n    return this.getViewEncryption('_system')\n  }\n\n  static namespace(entropy) {\n    return crypto.hash([NS_ENCRYPTION, entropy])\n  }\n\n  static getBlockKey(bootstrap, encryptionKey, entropy, hypercoreKey) {\n    return getBlockKey(bootstrap, encryptionKey, entropy, hypercoreKey)\n  }\n\n  static getSystemEncryption(base, core) {\n    const view = new EncryptionView(base, core)\n    return view.getSystemEncryption()\n  }\n\n  static async setSystemEncryption(base, core, opts) {\n    if (base.encryptionKey === null) return null\n\n    await core.ready()\n    if (core.manifest.version === 1) {\n      const key = getCompatBlockKey(base.bootstrap, base.encryptionKey, '_system')\n      return core.setEncryptionKey(key, { block: true })\n    }\n\n    if (!core.manifest.linked.length) {\n      throw new Error('System manifest does not link encryption view')\n    }\n\n    const enc = base.store.get({ key: core.manifest.linked[0], active: false })\n    const encryption = EncryptionView.getSystemEncryption(base, enc)\n\n    await core.setEncryption(encryption, opts)\n\n    return enc\n  }\n}\n\nmodule.exports = {\n  AutobaseEncryption,\n  EncryptionView\n}\n\nfunction encrypt(block, nonce, key) {\n  sodium.crypto_stream_xor(block, block, nonce, key)\n}\n\nfunction decrypt(block, nonce, key) {\n  return encrypt(block, nonce, key) // symmetric\n}\n\nfunction getBlockKey(bootstrap, encryptionKey, entropy, hypercoreKey) {\n  return (\n    encryptionKey &&\n    crypto.hash([NS_VIEW_BLOCK_KEY, bootstrap, encryptionKey, entropy, hypercoreKey])\n  )\n}\n\nfunction getCompatBlockKey(bootstrap, encryptionKey, name) {\n  if (typeof name === 'string') return getCompatBlockKey(bootstrap, encryptionKey, b4a.from(name))\n  return encryptionKey && crypto.hash([NS_VIEW_BLOCK_KEY, bootstrap, encryptionKey, name])\n}\n\nfunction blockhash(block, padding, hashKey) {\n  sodium.crypto_generichash(hash, block, hashKey)\n  padding.set(hash.subarray(0, 8)) // copy first 8 bytes of hash\n  hash.fill(0) // clear nonce buffer\n}\n\nfunction encryptBlock(index, block, id, blockKey, hashKey) {\n  const padding = block.subarray(0, AutobaseEncryption.PADDING)\n  block = block.subarray(AutobaseEncryption.PADDING)\n\n  blockhash(block, padding, hashKey)\n  c.uint32.encode({ start: 4, end: 8, buffer: padding }, id)\n\n  c.uint64.encode({ start: 0, end: 8, buffer: nonce }, index)\n\n  padding[0] = 1 // version in plaintext\n\n  nonce.set(padding, 8, 16)\n\n  // The combination of index, key id, fork id and block hash is very likely\n  // to be unique for a given Hypercore and therefore our nonce is suitable\n  encrypt(block, nonce, blockKey)\n}\nconst rrp = require('resolve-reject-promise')\nconst safetyCatch = require('safety-catch')\n\nconst SystemView = require('./system.js')\nconst { EncryptionView } = require('./encryption.js')\n\nconst DEFAULT_OP_TIMEOUT = 5_000\nconst DEFAULT_MIN_FF = 16\n\nmodule.exports = class FastForward {\n  constructor(\n    base,\n    key,\n    {\n      timeout = DEFAULT_OP_TIMEOUT,\n      verified = true,\n      minimum = DEFAULT_MIN_FF,\n      force = false,\n      length = 0\n    } = {}\n  ) {\n    this.base = base\n    this.key = key\n    this.timeout = timeout\n    this.force = force\n    this.core = base.store.get({ key, active: true, encryption: null })\n    this.length = length\n    this.views = []\n    this.encryption = null\n    this.entropy = null\n    this.indexers = []\n    this.minimum = minimum\n    this.verified = verified\n    this.waiting = new Set()\n    this.cores = [this.core]\n    this.system = null\n    this.destroyed = false\n    this.upgrading = null\n    this.failed = false\n  }\n\n  static MINIMUM = DEFAULT_MIN_FF\n\n  async upgrade() {\n    try {\n      if (!this.upgrading) this.upgrading = this._upgrade()\n\n      if (!(await this.upgrading)) return null\n\n      return {\n        length: this.length,\n        force: this.force,\n        key: this.key,\n        indexers: this.indexers,\n        views: this.views,\n        entropy: this.entropy,\n        manifestVersion: this.core.manifest.version,\n        minimum: this.minimum\n      }\n    } catch (err) {\n      safetyCatch(err)\n      this.failed = true\n      return null\n    } finally {\n      await this.close()\n    }\n  }\n\n  _waitForAppend(core) {\n    if (core.length > 0) return Promise.resolve()\n\n    const promise = rrp()\n    const timeout = setTimeout(this.close.bind(this), this.timeout)\n    const wait = { promise, timeout }\n\n    this.waiting.add(wait)\n\n    core.once('append', () => {\n      this.waiting.delete(wait)\n      clearTimeout(timeout)\n      promise.resolve()\n    })\n\n    return promise.promise\n  }\n\n  _minLength() {\n    return this.base.core.length + this.minimum\n  }\n\n  async _upgrade() {\n    await this.core.ready()\n\n    if (!this.verified) await this._waitForAppend(this.core)\n    if (this.destroyed) return false\n\n    if (this.core.manifest.linked) {\n      const appends = []\n\n      for (const key of this.core.manifest.linked) {\n        const core = this.base.store.get({ key, active: true })\n        this.cores.push(core)\n\n        await core.ready()\n        appends.push(this._waitForAppend(core))\n      }\n\n      await Promise.all(appends)\n    }\n\n    if (this.length === 0) this.length = this.core.length\n\n    // note we use the persisted length here, as we might as well continue that work as thats ~ the same length\n    if (!this.force && this.length < this._minLength()) return false\n    if (this.length === 0) return false\n\n    await this.core.get(this.length - 1, { timeout: this.timeout })\n    await this.base.ready()\n\n    if (this.destroyed) return false\n\n    if (this.base.encryptionKey && !(await this._ensureEncryption())) return false\n    if (this.destroyed) return false\n\n    this.system = new SystemView(this.core, { checkout: this.length })\n    await this.system.ready()\n    if (this.destroyed) return false\n\n    this.entropy = this.system.entropy\n\n    if (this.core.manifest.version >= 2) {\n      const linked = this.core.manifest.linked\n\n      if (this.system.encryptionLength === 0 || linked === null || !linked.length) {\n        return false\n      }\n\n      // technically diverges from system.views to include encryption here, but makes sense\n      this.views.push({\n        key: linked[0],\n        length: this.system.encryptionLength\n      })\n    }\n\n    const promises = []\n\n    // ensure local key is locally available always\n    promises.push(this.system.get(this.base.local.key, { timeout: this.timeout }))\n\n    if (this.encryption && this.encryption.core) {\n      promises.push(\n        this.encryption.core.get(this.system.encryptionLength - 1, { timeout: this.timeout })\n      )\n    }\n\n    for (const v of this.system.views) {\n      this.views.push(v)\n      const core = this.base.store.get({ key: v.key, active: true })\n      this.cores.push(core)\n      if (!v.length) continue // encryption view can be 0 length\n      promises.push(core.get(v.length - 1, { timeout: this.timeout }))\n    }\n\n    for (const idx of this.system.indexers) {\n      this.indexers.push(idx)\n      if (idx.length === 0) continue // need to make sure we have manifest...\n      const core = this.base.store.get({ key: idx.key, active: true })\n      this.cores.push(core)\n      promises.push(core.get(idx.length - 1, { timeout: this.timeout }))\n      promises.push(this.system.get(idx.key, { timeout: this.timeout }))\n    }\n\n    for (const head of this.system.heads) {\n      promises.push(this.system.get(head.key, { timeout: this.timeout }))\n    }\n\n    await Promise.all(promises)\n    if (this.destroyed) return false\n\n    return true\n  }\n\n  async _ensureEncryption() {\n    // only need encryption if we migrated\n    if (this.core.encryption !== null) return true\n\n    const encCore = this.core.manifest.version <= 1 ? null : this.cores[1]\n\n    // expects internal views to be loaded in order\n    this.encryption = new EncryptionView(this.base, encCore)\n    const encryption = this.encryption.getViewEncryption('_system')\n\n    await this.core.setEncryption(encryption)\n\n    return true\n  }\n\n  async close() {\n    this.destroyed = true\n    for (const { promise, timeout } of this.waiting) {\n      clearTimeout(timeout)\n      promise.resolve() // silently bail\n    }\n    if (this.system) await this.system.close()\n    if (this.encryption) await this.encryption.close()\n    for (const core of this.cores) await core.close()\n    await this.core.close()\n  }\n}\nconst c = require('compact-encoding')\n\nconst SystemView = require('./system.js')\nconst { EncryptionView } = require('./encryption.js')\nconst { ManifestData } = require('./messages.js')\n\nmodule.exports = class Fork {\n  constructor(base, store, state, fork) {\n    this.base = base\n    this.store = store\n    this.state = state\n    this.indexers = fork.indexers\n    this.length = fork.length\n    this.system = null\n    this.encryption = null\n    this.manifests = null\n    this.cores = []\n  }\n\n  async upgrade() {\n    try {\n      await this._upgrade()\n      return true\n    } catch {\n      return false\n    } finally {\n      await this.close()\n    }\n  }\n\n  async _upgrade() {\n    this.manifests = await this.store.getIndexerManifests(this.indexers)\n\n    this.system = new SystemView(await this._get('_system', this.length))\n    this.encryption = new EncryptionView(this, await this._get('_encryption', -1))\n\n    await this.system.ready()\n    await this.encryption.ready()\n\n    this.entropy = this.system.getEntropy(this.indexers, this.length)\n    this.manifestVersion = Math.max(this.system.core.manifest.version, 2) // >= 2 to signal new encryption\n\n    const views = []\n    for (const view of this.state.views) {\n      const v = this.getViewFromSystem(view, this.system)\n      const indexedLength = v ? v.length : 0\n\n      const session = await this._get(view.name, indexedLength)\n      await session.ready()\n\n      const next = await this.createView(view.name, session, null)\n      await next.ready()\n\n      await this._migrate(view.ref, next, view.core, indexedLength)\n\n      // update key\n      views.push({ key: next.key, length: indexedLength })\n    }\n\n    // internal views are explicitly migrated\n\n    const entropy = EncryptionView.namespace(this.entropy)\n    await this.encryption.update(entropy)\n\n    const system = this.store.getViewByName('_system')\n    const encryption = this.store.getViewByName('_encryption')\n\n    const enc = await this.createView('_encryption', this.encryption.core, null)\n    await enc.ready()\n\n    await this._migrate(encryption, enc, this.encryption.core, this.encryption.core.length)\n\n    await this.system.fork(this.indexers, this.manifests, this.encryption.core.length, views)\n\n    const sys = await this.createView('_system', this.system.core, [enc.key])\n    await sys.ready()\n\n    await this._migrate(system, sys, this.system.core, this.system.core.length)\n  }\n\n  async createView(name, core, linked) {\n    const prologue = await getPrologue(core)\n    const manifestData = this._manifestData(core)\n\n    return this.store.getViewCore(\n      this.manifests,\n      name,\n      prologue,\n      this.manifestVersion,\n      this.entropy,\n      linked,\n      manifestData\n    )\n  }\n\n  async _get(name, length) {\n    const core = this.store.get({ name })\n    this.cores.push(core)\n\n    if (length !== -1) await core.truncate(length)\n\n    return core\n  }\n\n  getViewFromSystem(view) {\n    if (view.mappedIndex === -1 || view.mappedIndex >= this.system.views.length) return null\n    return this.system.views[view.mappedIndex]\n  }\n\n  _manifestData(session) {\n    if (session.manifest.version > 1) return session.manifest.userData\n    return c.encode(ManifestData, { version: 0, legacyBlocks: session.length })\n  }\n\n  async _migrate(ref, next, source, length) {\n    if (length > 0) {\n      await next.core.copyPrologue(source.state)\n    }\n\n    // remake the batch, reset from our prologue in case it replicated inbetween\n    // TODO: we should really have an HC function for this\n    const batch = next.session({ name: 'batch', overwrite: true, checkout: length })\n    await batch.ready()\n\n    if (source !== null) {\n      while (batch.length < source.length) {\n        await batch.append(await source.get(batch.length))\n      }\n    }\n\n    await ref.batch.state.moveTo(batch, batch.length)\n    await batch.close()\n\n    ref.migrated(this.base, next)\n  }\n\n  async close() {\n    this.destroyed = true\n    if (this.system) await this.system.close()\n    if (this.encryption) await this.encryption.close()\n    for (const core of this.cores) await core.close()\n  }\n}\n\nasync function getPrologue(core) {\n  if (!core.length) return null\n\n  return {\n    hash: await core.treeHash(),\n    length: core.length\n  }\n}\nconst b4a = require('b4a')\nconst assert = require('nanoassert')\n\nconst Clock = require('./clock.js')\nconst Consensus = require('./consensus.js')\nconst Topolist = require('./topolist.js')\n\nclass Node {\n  constructor(writer, length, value, heads, batch, dependencies, optimistic, trace) {\n    this.writer = writer\n    this.length = length\n    this.value = value\n    this.heads = heads\n    this.actualHeads = heads.slice(0) // TODO: we should remove this and just not mutate heads...\n\n    this.dependents = new Set()\n    this.dependencies = dependencies\n    this.index = 0 // used by topolist\n\n    this.optimistic = optimistic && batch === 1 && !!value\n\n    this.batch = batch\n    this.dropped = 0\n    this.trace = trace\n\n    this.clock = new Clock()\n\n    this.yielded = false\n    this.yielding = false\n  }\n\n  isTail() {\n    return this.dependencies.size === this.dropped\n  }\n\n  causalDependencies(idx) {\n    const order = [this]\n    const stack = [this]\n\n    let visited = null\n\n    while (stack.length > 0) {\n      const node = stack.pop()\n      for (const dep of node.dependencies) {\n        if (!dep.writer.isRemoved || dep.writer.isActiveIndexer) continue\n\n        // TODO: replace with \"coloring\" but ok for now, tiny set\n        if (visited === null) visited = new Set()\n        if (visited.has(dep)) continue\n        visited.add(dep)\n\n        stack.push(dep)\n        order.push(dep)\n      }\n    }\n\n    return order\n  }\n\n  clear() {\n    this.clock = null\n    this.dependents = null\n    return this\n  }\n\n  reset() {\n    this.yielded = false\n    this.yielding = false\n    for (const dep of this.dependents) dep.dependencies.add(this)\n    this.dependents.clear()\n  }\n\n  active() {\n    for (const dep of this.dependencies) {\n      if (dep.yielded) {\n        this.dependencies.delete(dep) // nodes might be yielded during buffering\n      } else {\n        dep.dependents.add(this)\n        this.clock.add(dep.clock)\n      }\n    }\n\n    if (this.writer.isActiveIndexer) this.clock.set(this.writer.core.key, this.length)\n  }\n\n  tieBreak(node) {\n    return tieBreak(this, node)\n  }\n\n  hasDependency(dep) {\n    for (const h of this.actualHeads) {\n      if (sameNode(h, dep)) return true\n    }\n    return false\n  }\n\n  get ref() {\n    return this.writer.core.key.toString('hex').slice(0, 2) + ':' + this.length\n  }\n}\n\nmodule.exports = class Linearizer {\n  constructor(indexers, { heads = [], writers = new Map() } = {}) {\n    this.heads = new Set()\n    this.tails = new Set()\n    this.tip = new Topolist()\n    this.size = 0 // useful for debugging\n    this.updated = false\n    this.indexersUpdated = false\n    this.writers = writers\n\n    this.consensus = new Consensus(indexers)\n    this._initialHeads = heads.slice(0)\n    this._strictlyAdded = null\n\n    for (const { key, length } of heads) {\n      this.consensus.removed.set(key, length)\n    }\n  }\n\n  get indexers() {\n    return this.consensus.indexers\n  }\n\n  static createNode(writer, length, value, heads, batch, dependencies, optimistic, trace) {\n    return new Node(writer, length, value, heads, batch, dependencies, optimistic, trace)\n  }\n\n  // returns the global links of the dag, use this to link against the current state of the dag\n  // TODO: rename to heads() and move the sets to _ props\n  getHeads() {\n    const heads = this._initialHeads.slice(0)\n    for (const node of this.heads) heads.push({ key: node.writer.core.key, length: node.length })\n    return heads\n  }\n\n  // TODO: might contain dups atm, nbd for how we use it, returns an array of writers you can \"pull\"\n  // to get the full dag view at any time\n  getBootstrapWriters() {\n    const writers = []\n\n    for (const head of this.heads) writers.push(head.writer)\n    for (let i = 0; i < this.consensus.indexers.length; i++)\n      writers.push(this.consensus.indexers[i])\n\n    return writers\n  }\n\n  addHead(node) {\n    node.active()\n\n    // 99.99% of the time _initialHeads is empty...\n    if (this._initialHeads.length > 0) this._updateInitialHeads(node)\n\n    if (node.isTail()) {\n      this.tails.add(node)\n    }\n\n    for (const head of this.heads) {\n      if (node.hasDependency(head)) {\n        this.heads.delete(head)\n      }\n    }\n\n    this.tip.add(node)\n    if (node.writer.isActiveIndexer) this.consensus.addHead(node)\n\n    this.size++\n    this.heads.add(node)\n\n    this.updated = true\n\n    return node\n  }\n\n  update() {\n    if (!this.updated) return null\n    this.updated = false\n\n    // get the indexed nodes\n    const indexed = []\n    while (true) {\n      const nodes = this.consensus.shift()\n      if (!nodes.length) break\n\n      this._yield(nodes, indexed)\n    }\n\n    return this.tip.flush(indexed)\n  }\n\n  _updateInitialHeads(node) {\n    for (const head of node.actualHeads) {\n      for (let i = 0; i < this._initialHeads.length; i++) {\n        const { key, length } = this._initialHeads[i]\n        if (length !== head.length || !b4a.equals(key, head.key)) continue\n        this._initialHeads.splice(i--, 1)\n      }\n    }\n  }\n\n  /* Ack methods */\n\n  shouldAck(writer, pending = false) {\n    if (!writer || !writer.isActiveIndexer) return false\n\n    // all indexers have to flushed to the dag before we ack as a quick \"debounce\"\n    for (const w of this.indexers) {\n      if (w.length !== w.available) return false\n    }\n\n    let isHead = false\n\n    // if ANY head is not an indexer ack\n    for (const head of this.heads) {\n      if (!head.writer.isActiveIndexer) return true\n      if (head.writer === writer) isHead = true\n    }\n\n    if (this.heads.size === 1 && isHead) {\n      return false // never self-ack!\n    }\n\n    const visited = new Set()\n\n    // check if there is non-null value\n    let valueCheck = false\n\n    for (const tail of this.tails) {\n      if (pending || this._nonNull(tail, visited)) {\n        valueCheck = true\n        break\n      }\n    }\n\n    if (!valueCheck) return false\n\n    if (this.consensus.shouldAck(writer)) return true\n\n    return this._shouldAckHeads(writer, pending)\n  }\n\n  // check if there is any value above this node\n  _nonNull(target, visited) {\n    const stack = [target]\n\n    while (stack.length) {\n      const node = stack.pop()\n\n      if (visited.has(node)) continue\n      if (node.value !== null) return true\n\n      visited.add(node)\n\n      for (const dep of node.dependents) {\n        stack.push(dep)\n      }\n    }\n\n    return false\n  }\n\n  // ack if any head is closer to confirming a value\n  _shouldAckHeads(writer, pending) {\n    const prev = writer.head()\n\n    for (const head of this.heads) {\n      // only check other writers heads\n      if (head.writer === writer) continue\n\n      const stack = [head]\n      const visited = new Set()\n\n      while (stack.length) {\n        const node = stack.pop()\n\n        if (visited.has(node)) continue\n        visited.add(node)\n\n        if (pending || node.value !== null) {\n          const acks = this.consensus.acksFromNode(node, head)\n          const prevAcks = this.consensus.acksFromNode(node, prev)\n\n          // head sees more acks\n          if (acks.size > prevAcks.size) return true\n\n          for (const idx of acks) {\n            // head sees acks that writer does not\n            if (!prevAcks.has(idx)) return true\n          }\n\n          // both seen, no point going any further down\n          if (prevAcks.size && acks.size) continue\n        }\n\n        stack.push(...node.dependencies)\n      }\n    }\n\n    return false\n  }\n\n  /* Full DAG methods */\n\n  _yield(nodes, indexed = []) {\n    const offset = indexed.length\n    const tails = []\n\n    // determine which nodes are yielded\n    while (nodes.length) {\n      const node = nodes.pop()\n\n      if (node.yielding) continue\n      node.yielding = true\n\n      if (node.isTail()) tails.push(node)\n\n      nodes.push(...node.dependencies)\n    }\n\n    while (tails.length) {\n      let tail = tails.pop()\n\n      for (tail of this._removeBatch(tail)) {\n        Topolist.add(tail, indexed, offset)\n      }\n\n      for (const dep of tail.dependents) {\n        if (dep.isTail() && dep.yielding) tails.push(dep)\n      }\n    }\n\n    return indexed\n  }\n\n  _isFutureTail(node) {\n    let dropped = node.dropped\n\n    // a tail has no unyielded dependencies\n    for (const dep of node.dependencies) {\n      if (dep.yielded) continue\n      if (dropped === 0) return false\n      dropped--\n    }\n\n    return true\n  }\n\n  _removeNode(node) {\n    this.tails.delete(node)\n    this.heads.delete(node)\n    this.consensus.remove(node)\n\n    // update the tailset\n    for (const d of node.dependents) {\n      if (d.yielding && d.dependencies.has(node))\n        d.dropped++ // keep links for the indexed batch\n      else d.dependencies.delete(node)\n      if (this._isFutureTail(d)) this.tails.add(d)\n    }\n\n    node.yielded = true\n    this.size--\n\n    if (this.heads.size === 0) {\n      // in case of a single writer the dag might drain immediately...\n      this._initialHeads.push({ key: node.writer.core.key, length: node.length })\n    }\n\n    return node\n  }\n\n  _removeBatch(node) {\n    const batch = [this._removeNode(node)]\n\n    while (node.batch !== 1) {\n      // its a batch!\n      if (node.dependents.size === 0) {\n        // bad batch node, auto correct\n        const next = node.writer.get(node.length)\n        if (next && next.batch === node.batch - 1) node.dependents.add(next)\n      }\n\n      assert(node.dependents.size === 1, 'Batch is linked partially, which is not allowed')\n\n      node = getFirst(node.dependents)\n      batch.push(this._removeNode(node))\n    }\n\n    return batch\n  }\n}\n\nfunction tieBreak(a, b) {\n  return Topolist.compare(a, b) < 0 // lowest key wis\n}\n\nfunction getFirst(set) {\n  return set[Symbol.iterator]().next().value\n}\n\nfunction sameNode(a, b) {\n  return b4a.equals(a.key, b.writer.core.key) && a.length === b.length\n}\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\n\nconst messages = require('./messages.js')\n\nconst GTE = b4a.from([messages.LINEARIZER_PREFIX])\nconst LT = b4a.from([messages.LINEARIZER_PREFIX + 1])\n\nmodule.exports = class LocalState {\n  constructor(core) {\n    this.core = core\n    this.tx = null\n  }\n\n  static clear(core) {\n    const tx = core.state.storage.write()\n    tx.deleteLocalRange(GTE, LT)\n    return tx.flush()\n  }\n\n  static async moveTo(src, dst) {\n    const boot = await src.getUserData('autobase/boot')\n    const tx = dst.state.storage.write()\n\n    tx.deleteLocalRange(GTE, LT)\n\n    for await (const data of src.state.storage.createLocalStream({ gte: GTE, lt: LT })) {\n      tx.putLocal(data.key, data.value)\n    }\n\n    tx.putUserData('autobase/boot', boot)\n\n    await tx.flush()\n  }\n\n  setBootRecord(boot) {\n    if (this.tx === null) this.tx = this.core.state.storage.write()\n\n    this.tx.putUserData('autobase/boot', c.encode(messages.BootRecord, boot))\n  }\n\n  async listUpdates() {\n    const updates = []\n\n    for await (const data of this.core.state.storage.createLocalStream({ gte: GTE, lt: LT })) {\n      const update = c.decode(messages.LinearizerUpdate, data.value)\n      const seq = c.decode(messages.LinearizerKey, data.key)\n      update.seq = seq\n      updates.push(update)\n    }\n\n    return updates\n  }\n\n  clearUpdates() {\n    if (this.tx === null) this.tx = this.core.state.storage.write()\n\n    this.tx.deleteLocalRange(GTE, LT)\n  }\n\n  deleteUpdate(update) {\n    if (this.tx === null) this.tx = this.core.state.storage.write()\n\n    this.tx.deleteLocal(c.encode(messages.LinearizerKey, update.seq))\n  }\n\n  insertUpdate(update) {\n    if (this.tx === null) this.tx = this.core.state.storage.write()\n\n    this.tx.putLocal(\n      c.encode(messages.LinearizerKey, update.seq),\n      c.encode(messages.LinearizerUpdate, update)\n    )\n  }\n\n  flush() {\n    if (!this.tx) return Promise.resolve()\n\n    const flushing = this.tx.flush()\n    this.tx = null\n    return flushing\n  }\n}\nconst schema = require('../encoding/spec/autobase')\n\nmodule.exports = {\n  Wakeup: schema.resolveStruct('@autobase/wakeup'),\n  Clock: schema.resolveStruct('@autobase/clock'),\n  Checkout: schema.resolveStruct('@autobase/checkout'),\n  BootRecord: schema.resolveStruct('@autobase/boot-record'),\n  OplogMessage: schema.resolveStruct('@autobase/oplog-message'),\n  Checkpoint: schema.resolveStruct('@autobase/checkpoint'),\n  Info: schema.resolveStruct('@autobase/info'),\n  Member: schema.resolveStruct('@autobase/member'),\n  ManifestData: schema.resolveStruct('@autobase/manifest-data'),\n  LINEARIZER_PREFIX: 1,\n  LinearizerKey: schema.resolveStruct('@autobase/linearizer-key'),\n  LinearizerUpdate: schema.resolveStruct('@autobase/linearizer-update'),\n  EncryptionDescriptor: schema.resolveStruct('@autobase/encryption-descriptor')\n}\nconst DEFAULT_SIZE = 32\n\nmodule.exports = class NodeBuffer {\n  constructor(offset, hwm) {\n    this.hwm = hwm || DEFAULT_SIZE\n    this.defaultHwm = this.hwm\n    this.mask = this.hwm - 1\n    this.top = 0\n    this.btm = 0\n    this.buffer = new Array(this.hwm)\n    this.offset = offset || 0\n    this.length = this.offset\n  }\n\n  get size() {\n    return this.length - this.offset\n  }\n\n  isEmpty() {\n    return this.length === this.offset\n  }\n\n  isFull() {\n    return this.size === this.buffer.length\n  }\n\n  grow() {\n    this.hwm <<= 1\n\n    const size = this.size\n    const buffer = new Array(this.hwm)\n    const mask = this.hwm - 1\n\n    for (let i = 0; i < size; i++) {\n      buffer[i] = this.buffer[(this.btm + i) & this.mask]\n    }\n\n    this.mask = mask\n    this.top = size\n    this.btm = 0\n    this.buffer = buffer\n  }\n\n  push(data) {\n    if (this.isFull()) this.grow()\n\n    this.buffer[this.top] = data\n    this.top = (this.top + 1) & this.mask\n\n    return this.length++\n  }\n\n  shift() {\n    if (this.isEmpty()) return null\n\n    const last = this.buffer[this.btm]\n\n    this.buffer[this.btm] = undefined\n    this.btm = (this.btm + 1) & this.mask\n    this.offset++\n\n    // reset on empty\n    if (this.isEmpty() && this.hwm !== this.defaultHwm) {\n      this.buffer = new Array(this.defaultHwm)\n      this.hwm = this.buffer.length\n      this.mask = this.hwm - 1\n      this.top = this.btm = 0\n    }\n\n    return last\n  }\n\n  get(seq) {\n    if (seq < this.offset || seq >= this.length) return null\n    return this.buffer[(this.btm + (seq - this.offset)) & this.mask]\n  }\n}\nconst b4a = require('b4a')\nconst c = require('compact-encoding')\nconst crypto = require('hypercore-crypto')\nconst Hypercore = require('hypercore')\n\nconst messages = require('./messages.js')\n\nconst DEFAULT_MANIFEST_VERSION = 1\nconst INDEX_VERSION = 1\nconst MAX_TRACE_PER_VIEW = 256\n\nconst EMPTY = b4a.alloc(0)\n\nconst [NS_SIGNER_NAMESPACE] = crypto.namespace('autobase', 1)\n\nclass ViewCore {\n  constructor(name, core, base) {\n    this.name = name\n    this.core = null\n    this.batch = null\n    this.atomicBatch = null\n    this.tracer = new Tracer()\n\n    this.migrated(base, core)\n  }\n\n  getCore() {\n    return this.atomicBatch || this.batch || this.core\n  }\n\n  migrated(base, core) {\n    // TODO: close old core if present, for now we just close when the autobase is closed indirectly\n    // atm its unsafe to do as moveTo has a bug due to a missing read lock in hc\n    this.core = core\n\n    if (this.name === '_system') {\n      const ff = base._queueFastForward.bind(base)\n      this.core.on('append', ff)\n      this.core.ready().then(ff, ff)\n    }\n  }\n\n  async matchesKey(key) {\n    if (!this.core.opened) await this.core.ready()\n    return b4a.equals(this.core.key, key)\n  }\n\n  async matchesNamespace(target) {\n    if (!this.core.opened) await this.core.ready()\n\n    if (this.core.manifest && this.core.manifest.signers.length > 0) {\n      const ns = this.core.manifest.signers[0].namespace\n      if (b4a.equals(ns, target)) return true\n    }\n\n    return false\n  }\n\n  async commit(atom, length, signature) {\n    // TODO: is this how its supposed be done atomic wise?\n    await this.core.commit(this._getAtomicBatch(atom), { length, signature })\n  }\n\n  async release() {\n    if (!this.atomicBatch) return\n    await this.atomicBatch.ready()\n    const sessions = this.atomicBatch.state.sessions\n    for (let i = sessions.length - 1; i >= 0; i--) {\n      if (!sessions[i]) break // closed before us\n      await sessions[i].close()\n    }\n    await this.atomicBatch.close()\n    this.atomicBatch = null\n  }\n\n  _getAtomicBatch(atom) {\n    if (this.atomicBatch === null) {\n      this.atomicBatch = this.batch.session({ atom, writable: true })\n    }\n\n    return this.atomicBatch\n  }\n\n  async catchup(atom, length) {\n    await this.release()\n    const batch = this._getAtomicBatch(atom)\n    await batch.ready()\n    await batch.state.catchup(length)\n  }\n\n  createSession(atom, valueEncoding) {\n    if (this.batch === null) {\n      this.batch = this.core.session({ name: 'batch', writable: true })\n    }\n\n    const s = atom\n      ? this._getAtomicBatch(atom).session({\n          valueEncoding,\n          writable: true,\n          onseq: this.tracer.onseq.bind(this.tracer)\n        })\n      : this.batch.session({ valueEncoding, writable: false })\n\n    return s\n  }\n}\n\nclass Tracer {\n  constructor() {\n    this.enabled = false\n    this.seen = new Set()\n  }\n\n  start() {\n    this.enabled = true\n    this.seen.clear()\n  }\n\n  end() {\n    this.enabled = false\n    return [...this.seen.values()]\n  }\n\n  onseq(seq, core) {\n    if (!this.enabled) return\n    if (this.seen.size >= MAX_TRACE_PER_VIEW) return\n    if (seq >= core.signedLength) return\n\n    this.seen.add(seq)\n  }\n}\n\nclass AutoStore {\n  constructor(base, byName) {\n    this.base = base\n    this.store = base.store\n    this.byName = byName || new Map()\n    this.opened = []\n    this.atom = null\n    this.local = null\n  }\n\n  async close() {\n    if (this.local) await this.local.close()\n    for (const v of this.byName.values()) {\n      await v.release()\n    }\n    if (this.atom) return\n    for (const v of this.byName.values()) {\n      if (v.core) await v.core.close()\n      if (v.batch) await v.batch.close()\n    }\n  }\n\n  async export() {\n    const views = []\n\n    for (const [name, value] of this.byName) {\n      const core = await this.store.storage.export(value.core.discoveryKey, { batches: true })\n      views.push({ name, core })\n    }\n\n    return views\n  }\n\n  atomize() {\n    const store = new AutoStore(this.base, this.byName)\n    store.atom = this.store.storage.createAtom()\n    return store\n  }\n\n  async updateLocal() {\n    if (!this.local) return\n    await this.local.close()\n    this.local = null\n  }\n\n  flush() {\n    return this.atom ? this.atom.flush() : Promise.resolve()\n  }\n\n  get(opts, moreOpts) {\n    if (typeof opts === 'string') opts = { name: opts }\n    if (moreOpts) opts = { ...opts, ...moreOpts }\n\n    const { name, valueEncoding = null } = opts\n\n    if (!name) throw new Error('name is required')\n    return this.getViewByName(name).createSession(this.atom, valueEncoding)\n  }\n\n  getViewByName(name) {\n    let view = this.byName.get(name)\n\n    if (!view) {\n      const preload = this._preload(name)\n      const core = this.base.store.get({ preload })\n      view = new ViewCore(name, core, this.base)\n      this.byName.set(name, view)\n    }\n\n    if (this.opened.indexOf(view) === -1) {\n      this.opened.push(view)\n    }\n\n    return view\n  }\n\n  getLocal() {\n    if (this.local !== null) return this.local\n\n    this.local = this.base.local.session({\n      atom: this.atom,\n      valueEncoding: messages.OplogMessage,\n      encryption: this.base.getWriterEncryption(this.base.local.key),\n      active: false\n    })\n\n    return this.local\n  }\n\n  getViews() {\n    return [...this.byName.values()]\n  }\n\n  getViewCount() {\n    return this.byName.size\n  }\n\n  getSystemView() {\n    return this.getViewByName('_system')\n  }\n\n  getSystemCore() {\n    return this.getSystemView().core\n  }\n\n  getEncryption(name) {\n    if (!this.base.encryptionKey) return null\n    if (name === '_encryption') return null\n\n    return this.base.encryption.getViewEncryption(name)\n  }\n\n  async getIndexerManifests(entries) {\n    const manifests = []\n    for (const { key } of entries) {\n      const core = this.store.get({ key, active: false })\n      await core.ready()\n      if (!core.manifest) continue // danger but only for bootstrapping...\n      manifests.push(core.manifest)\n      await core.close()\n    }\n    return manifests\n  }\n\n  getViewCore(indexerManifests, name, prologue, manifestVersion, entropy, linked, manifestData) {\n    const manifest = this._createManifest(\n      indexerManifests,\n      name,\n      prologue,\n      manifestVersion,\n      entropy,\n      linked,\n      manifestData\n    )\n\n    return this.base.store.get({\n      manifest,\n      exclusive: false,\n      encryption: this.getEncryption(name)\n    })\n  }\n\n  listViews() {\n    const views = []\n    for (const [name, ref] of this.byName) {\n      const core = ref.batch || ref.core\n      views.push({ name, key: core.key, length: core.length, signedLength: core.signedLength })\n    }\n    return views\n  }\n\n  createAnchorCore(prologue, manifestData) {\n    const manifest = {\n      version: 2,\n      hash: 'blake2b',\n      prologue,\n      allowPatch: false,\n      quorum: 0,\n      signers: [],\n      userData: manifestData,\n      linked: null\n    }\n\n    const core = this.store.get({\n      manifest,\n      active: false\n    })\n\n    return core\n  }\n\n  async createView(\n    indexerManifests,\n    name,\n    prologue,\n    manifestVersion,\n    entropy,\n    linked,\n    manifestData\n  ) {\n    const manifest = this._createManifest(\n      indexerManifests,\n      name,\n      prologue,\n      manifestVersion,\n      entropy,\n      linked,\n      manifestData\n    )\n\n    const core = this.store.get({\n      key: Hypercore.key(manifest),\n      manifest,\n      active: false\n    })\n\n    await core.ready()\n    const key = core.key\n\n    await core.close()\n    return key\n  }\n\n  async _preload(name) {\n    await Promise.resolve()\n\n    if (!this.base.opening) throw new Error('Autobase failed to open')\n    await this.base._preopen\n\n    const boot = (await this.base._getSystemInfo()) || {\n      key: this.getBootstrapSystemKey(),\n      indexers: [],\n      views: [],\n      entropy: null\n    }\n    const indexerManifests = await this.getIndexerManifests(boot.indexers)\n\n    // no system, everything is fresh\n    if (boot.indexers.length === 0) {\n      return this._freshCorePreload(indexerManifests, name, boot.entropy)\n    }\n\n    // asking for the system, just return it, easy\n    if (name === '_system') {\n      return {\n        key: boot.key,\n        exclusive: false,\n        encryption: this.getEncryption(name)\n      }\n    }\n\n    if (name === '_encryption') {\n      const core = this.getSystemCore()\n      await core.ready()\n\n      if (!core.manifest.linked) {\n        return this._freshCorePreload(indexerManifests, name, boot.entropy)\n      }\n\n      return {\n        key: core.manifest.linked[0],\n        exclusive: false,\n        encryption: null\n      }\n    }\n\n    // infer which view\n    const v = await this.findViewByName(indexerManifests, boot.views, name, boot.entropy)\n\n    // new view, fresh\n    if (v === null) {\n      return this._freshCorePreload(indexerManifests, name, boot.entropy)\n    }\n\n    return {\n      key: v.key,\n      exclusive: false,\n      encryption: this.getEncryption(name)\n    }\n  }\n\n  _freshCorePreload(indexerManifests, name, entropy) {\n    if (name === '_system') return this._freshSystemPreload(indexerManifests, entropy)\n\n    return {\n      manifest: this._createManifest(\n        indexerManifests,\n        name,\n        null,\n        DEFAULT_MANIFEST_VERSION,\n        entropy,\n        [],\n        null\n      ),\n      exclusive: true,\n      encryption: this.getEncryption(name)\n    }\n  }\n\n  _freshSystemPreload(indexerManifests, entropy) {\n    return {\n      manifest: this._createSystemManifest(\n        indexerManifests,\n        null,\n        DEFAULT_MANIFEST_VERSION,\n        entropy,\n        null\n      ),\n      exclusive: true,\n      encryption: this.getEncryption('_system')\n    }\n  }\n\n  _deriveStaticHash(name) {\n    // key doesnt matter...\n    return crypto.hash([this.base.key, b4a.from(name)])\n  }\n\n  _deriveNamespace(name, entropy) {\n    const encryptionId = crypto.hash(this.base.encryptionKey || EMPTY)\n    const version = c.encode(c.uint, INDEX_VERSION)\n    const bootstrap = this.base.key\n\n    return crypto.hash([\n      NS_SIGNER_NAMESPACE,\n      version,\n      bootstrap,\n      encryptionId,\n      entropy,\n      b4a.from(name)\n    ])\n  }\n\n  async _getCoreManifest(key) {\n    const core = this.store.get({ key, active: false })\n    await core.ready()\n    const manifest = core.manifest\n    await core.close()\n    return manifest\n  }\n\n  getBootstrapSystemKey() {\n    return Hypercore.key(this._createSystemManifest([], null, DEFAULT_MANIFEST_VERSION, null))\n  }\n\n  async findViewByKey(key, indexers, manifestVersion, entropy) {\n    for (const v of this.byName.values()) {\n      if (await v.matchesKey(key)) return v\n    }\n\n    const manifest = await this._getCoreManifest(key)\n    const target = manifest && manifest.signers.length ? manifest.signers[0].namespace : null\n\n    if (target) {\n      for (const v of this.byName.values()) {\n        if (await v.matchesNamespace(target)) return v\n      }\n    }\n\n    const indexerManifests = await this.getIndexerManifests(indexers)\n\n    if (entropy === null) {\n      entropy = indexerManifests[0].signers[0].namespace\n    }\n\n    if (target) {\n      for (const v of this.byName.values()) {\n        const namespace = this._deriveNamespace(v.name, entropy)\n        if (b4a.equals(namespace, target)) return v\n      }\n    }\n\n    // prob the empty prologue, we dont have manifest for those in FF if len=0\n    for (const v of this.byName.values()) {\n      const manifestData = v.core ? v.core.manifest.userData : null\n      const manifest = this._createManifest(\n        indexerManifests,\n        v.name,\n        null,\n        manifestVersion,\n        entropy,\n        [],\n        manifestData\n      )\n      const manifestKey = Hypercore.key(manifest)\n\n      if (!b4a.equals(manifestKey, key)) continue\n\n      // we didnt have the core! this is because it is empty, ensure its on disk\n      const core = this.store.get({ key: manifestKey, manifest, active: false })\n      await core.ready()\n      await core.close()\n\n      return v\n    }\n\n    return null\n  }\n\n  async findViewByName(indexerManifests, views, name, entropy) {\n    if (indexerManifests.length === 0) return null\n\n    if (entropy === null) entropy = indexerManifests[0].signers[0].namespace\n    const namespace = this._deriveNamespace(name, entropy)\n\n    for (const v of views) {\n      const manifest = await this._getCoreManifest(v.key)\n      if (manifest.signers.length === 0) continue\n\n      const signer = manifest.signers[0]\n\n      if (b4a.equals(signer.namespace, namespace)) return v\n    }\n\n    return null\n  }\n\n  _createManifest(indexerManifests, name, prologue, version, entropy, linked, manifestData) {\n    if (!indexerManifests.length) {\n      prologue = {\n        hash: this._deriveStaticHash(name),\n        length: 0\n      }\n    } else if (prologue && prologue.length === 0) {\n      // just in case\n      prologue = null\n    }\n\n    const signers = []\n\n    if (indexerManifests.length && entropy === null) {\n      entropy = indexerManifests[0].signers[0].namespace\n    }\n\n    for (const manifest of indexerManifests) {\n      const signer = manifest.signers[0]\n\n      signers.push({\n        namespace: this._deriveNamespace(name, entropy),\n        signature: 'ed25519',\n        publicKey: signer.publicKey\n      })\n    }\n\n    return {\n      version,\n      hash: 'blake2b',\n      prologue,\n      allowPatch: true,\n      quorum: Math.min(signers.length, (signers.length >> 1) + 1),\n      signers,\n      userData: manifestData,\n      linked: version > 1 ? linked : null\n    }\n  }\n\n  _createSystemManifest(indexerManifests, prologue, version, entropy, manifestData) {\n    if (prologue !== null) throw new Error('Can only derive fresh system core')\n\n    const linked = []\n\n    if (version > DEFAULT_MANIFEST_VERSION) {\n      const encManifest = this._createManifest(\n        indexerManifests,\n        '_encryption',\n        null,\n        version,\n        entropy,\n        [],\n        manifestData\n      )\n      linked.push(Hypercore.key(encManifest))\n    }\n\n    return this._createManifest(\n      indexerManifests,\n      '_system',\n      null,\n      version,\n      entropy,\n      linked,\n      manifestData\n    )\n  }\n}\n\nmodule.exports = AutoStore\nconst Hyperbee = require('hyperbee')\nconst SubEncoder = require('sub-encoder')\nconst ReadyResource = require('ready-resource')\nconst b4a = require('b4a')\nconst c = require('compact-encoding')\nconst crypto = require('hypercore-crypto')\n\nconst { Info, Member } = require('./messages.js')\nconst { DEFAULT_AUTOBASE_VERSION } = require('./caps.js')\n\nconst subs = new SubEncoder()\n\nconst DIGEST = subs.sub(b4a.from([0]))\nconst MEMBERS = subs.sub(b4a.from([1]))\n\nconst INFO_KEY = DIGEST.encode('info')\n\nconst [GENESIS_ENTROPY, NS_ENTROPY] = crypto.namespace('autobase/entropy', 2)\n\nmodule.exports = class SystemView extends ReadyResource {\n  constructor(core, { checkout = 0, empty = false } = {}) {\n    super()\n\n    this.core = core\n\n    // sessions is a workaround for batches not having sessions atm...\n    this.db = new Hyperbee(core, {\n      keyEncoding: 'binary',\n      extension: false,\n      checkout,\n      sessions: typeof core.session === 'function'\n    })\n\n    this.version = DEFAULT_AUTOBASE_VERSION\n    this.members = 0\n    this.pendingIndexers = []\n    this.indexers = []\n    this.heads = []\n    this.views = []\n    this.encryptionLength = 0\n    this.entropy = null\n\n    this.indexerUpdate = false\n\n    this._empty = empty\n    this._fork = 0\n    this._length = 0\n    this._changes = []\n    this._indexerMap = new Map()\n    this._clockUpdates = new Map()\n  }\n\n  static GENESIS_ENTROPY = GENESIS_ENTROPY\n\n  static async getIndexedInfo(core, length) {\n    const sys = new this(core.session())\n\n    try {\n      return await sys.getIndexedInfo(length)\n    } finally {\n      await sys.close()\n    }\n  }\n\n  static async *flushes(core, { reverse, lt = core.length, gte = 0, wait = true } = {}) {\n    if (lt <= 0) return\n\n    // ensure block\n    await core.get(lt - 1)\n    const sys = new SystemView(core)\n\n    try {\n      for await (const data of sys.db.createHistoryStream({ lt, gte, wait, reverse: true })) {\n        if (!b4a.equals(data.key, INFO_KEY)) continue\n        const info = c.decode(Info, data.value)\n        yield { length: data.seq + 1, info }\n      }\n    } finally {\n      await sys.close()\n    }\n  }\n\n  get bootstrapping() {\n    return this.members === 0\n  }\n\n  async checkout(length) {\n    const checkout = new SystemView(this.core.session(), {\n      checkout: length,\n      empty: length === 0\n    })\n\n    await checkout.ready()\n\n    return checkout\n  }\n\n  async _open() {\n    // this should NEVER fail, if so we have a bug elsewhere (should always be consistent)\n    const info = this._empty\n      ? null\n      : await this.db.get('info', {\n          valueEncoding: Info,\n          keyEncoding: DIGEST,\n          update: false,\n          wait: false\n        })\n    await this._reset(info)\n  }\n\n  async _close() {\n    await this.db.close()\n  }\n\n  async getIndexedInfo(length = this.core.signedLength) {\n    if (this.opened === false) await this.ready()\n\n    if (length === this.core.length) {\n      return {\n        version: this.version,\n        members: this.members,\n        pendingIndexers: this.pendingIndexers,\n        indexers: this.indexers,\n        heads: this.heads,\n        views: this.views,\n        encryptionLength: this.encryptionLength,\n        entropy: this.entropy\n      }\n    }\n\n    const node = length === 0 ? null : await this.db.getBySeq(length - 1)\n    if (node === null) {\n      return {\n        version: DEFAULT_AUTOBASE_VERSION,\n        members: 0,\n        pendingIndexers: [],\n        indexers: [],\n        heads: [],\n        views: [],\n        encryptionLength: 0,\n        entropy: null\n      }\n    }\n\n    return c.decode(Info, node.value)\n  }\n\n  static sameIndexers(a, b) {\n    if (a.length !== b.length) return false\n\n    for (let i = 0; i < a.length; i++) {\n      if (!b4a.equals(a[i].key, b[i].core.key)) return false\n    }\n\n    return true\n  }\n\n  sameIndexers(indexers) {\n    return SystemView.sameIndexers(this.indexers, indexers)\n  }\n\n  async history(since) {\n    const checkout = this.db.checkout(since)\n    const seen = new Map()\n\n    const nodes = []\n    const updates = []\n\n    const checkoutNode = since === 0 ? null : await this.db.getBySeq(since - 1)\n\n    let prevInfo = checkoutNode === null ? null : c.decode(Info, checkoutNode.value)\n    let updateBatch = 0\n\n    for await (const data of this.db.createHistoryStream({ gte: since })) {\n      if (b4a.equals(data.key, INFO_KEY)) {\n        const info = c.decode(Info, data.value)\n\n        updates.push({\n          batch: updateBatch,\n          indexers: prevInfo === null || !sameIndexers(info, prevInfo),\n          systemLength: data.seq + 1\n        })\n\n        prevInfo = info\n        updateBatch = 0\n        continue\n      }\n\n      const key = data.key.subarray(2)\n      const hex = b4a.toString(key, 'hex')\n      const len = c.decode(Member, data.value).length\n\n      if (!seen.has(hex)) {\n        const node = await checkout.get(data.key)\n        if (node === null) {\n          seen.set(hex, 0)\n        } else {\n          const { length } = c.decode(Member, node.value)\n          seen.set(hex, length)\n        }\n      }\n\n      const prev = seen.get(hex)\n      const batch = len - prev\n      seen.set(hex, len)\n\n      if (batch === 0) continue\n\n      updateBatch += batch\n\n      if (nodes.length > 0) {\n        const top = nodes[nodes.length - 1]\n        if (b4a.equals(top.key, key)) {\n          top.length = len\n          top.batch += batch\n          continue\n        }\n      }\n\n      nodes.push({\n        key,\n        length: len,\n        batch\n      })\n    }\n\n    await checkout.close()\n\n    return { updates, nodes }\n  }\n\n  async update() {\n    if (this.opened === false) await this.ready()\n\n    if (this._fork === this.core.fork && this._length === this.core.length) return false\n\n    await this._reset(\n      this._empty ? null : await this.db.get('info', { valueEncoding: Info, keyEncoding: DIGEST })\n    )\n    return true\n  }\n\n  async _reset(info) {\n    this.version = info === null ? DEFAULT_AUTOBASE_VERSION : info.value.version\n    this.members = info === null ? 0 : info.value.members\n    this.pendingIndexers = info === null ? [] : info.value.pendingIndexers\n    this.indexers = info === null ? [] : info.value.indexers\n    this.heads = info === null ? [] : info.value.heads\n    this.views = info === null ? [] : info.value.views\n    this.encryptionLength = info === null ? 0 : info.value.encryptionLength\n    this.entropy = info === null ? null : info.value.entropy\n\n    this.indexerUpdate = false\n    this._indexerMap.clear()\n    this._clockUpdates.clear()\n    this._length = this.core.length\n    this._fork = this.core.fork\n    this._changes = []\n\n    for (const idx of this.indexers) {\n      this._indexerMap.set(b4a.toString(idx.key, 'hex'), idx)\n    }\n  }\n\n  // helper used by apply-state\n  flushLength() {\n    const header = this.core.length ? 0 : 1 // account for header\n\n    let updates = this._changes.length + this._clockUpdates.size\n    for (const { key } of this._changes) {\n      const hex = b4a.toString(key, 'hex')\n      if (this._clockUpdates.has(hex)) updates-- // shared are skipped\n    }\n\n    return header + this.core.length + updates + 1\n  }\n\n  async flush(views) {\n    const batch = this.db.batch({ update: false })\n\n    for (let i = 0; i < this._changes.length; i++) {\n      const c = this._changes[i]\n      if (this._clockUpdates.has(b4a.toString(c.key, 'hex'))) continue\n      await batch.put(c.key, c.value, { valueEncoding: Member, keyEncoding: MEMBERS })\n    }\n\n    for (const [hex, length] of this._clockUpdates) {\n      const isIndexer = this._indexerMap.get(hex) !== undefined\n      const key = b4a.from(hex, 'hex')\n\n      const info = await this._get(key, 0)\n\n      const value = { isIndexer, isRemoved: info ? info.isRemoved : true, length }\n      await batch.put(key, value, { valueEncoding: Member, keyEncoding: MEMBERS })\n    }\n\n    if (this.indexerUpdate) {\n      this._refreshEntropy(this.core.length + batch.length + 1)\n    }\n\n    this._clockUpdates.clear()\n\n    let maxIndex = -1\n    for (const view of views) {\n      if (view.mappedIndex > maxIndex) maxIndex = view.mappedIndex\n    }\n\n    while (this.views.length > maxIndex + 1) this.views.pop()\n\n    for (const view of views) {\n      const length = view.core ? view.core.length : view.length\n      if (!length) continue\n\n      const v = { key: view.key, length }\n\n      if (view.mappedIndex !== -1) {\n        this.views[view.mappedIndex] = v\n      } else {\n        view.mappedIndex = this.views.push(v) - 1\n      }\n    }\n\n    const info = {\n      version: this.version,\n      members: this.members,\n      pendingIndexers: this.pendingIndexers,\n      indexers: this.indexers,\n      heads: this.heads,\n      views: this.views,\n      encryptionLength: this.encryptionLength,\n      entropy: this.entropy\n    }\n\n    await batch.put('info', info, { valueEncoding: Info, keyEncoding: DIGEST })\n    await batch.flush()\n\n    this._length = this.core.length // should be ok\n    this._changes = []\n\n    if (this.indexerUpdate) this.indexerUpdate = false\n  }\n\n  getEntropy(indexers, length) {\n    return generateEntropy(indexers, length, this.entropy)\n  }\n\n  _refreshEntropy(length) {\n    if (this.version < 2) return\n    this.entropy = this.getEntropy(this.indexers, length)\n  }\n\n  checkpoint() {\n    return {\n      version: this.version,\n      members: this.members,\n      pendingIndexers: this.pendingIndexers.slice(0),\n      indexers: cloneNodes(this.indexers),\n      heads: cloneNodes(this.heads),\n      views: cloneNodes(this.views),\n      indexerUpdate: this.indexerUpdate,\n      encryptionLength: this.encryptionLength,\n      entropy: this.entropy ? b4a.from(this.entropy) : null,\n      changes: this._changes.slice(0),\n      clockUpdates: new Map([...this._clockUpdates])\n    }\n  }\n\n  applyCheckpoint(checkpoint) {\n    this.version = checkpoint.version\n    this.members = checkpoint.members\n    this.pendingIndexers = checkpoint.pendingIndexers\n    this.indexers = checkpoint.indexers\n    this.heads = checkpoint.heads\n    this.views = checkpoint.views\n    this.indexerUpdate = checkpoint.indexerUpdate\n    this.encryptionLength = checkpoint.encryptionLength\n    this.entropy = checkpoint.entropy\n\n    this._changes = checkpoint.changes\n    this._clockUpdates = checkpoint.clockUpdates\n\n    this._indexerMap = new Map()\n    for (const idx of this.indexers) {\n      this._indexerMap.set(b4a.toString(idx.key, 'hex'), idx)\n    }\n  }\n\n  addHead(node) {\n    const h = { key: node.writer.core.key, length: node.length }\n\n    for (let i = 0; i < this.heads.length; i++) {\n      const head = this.heads[i]\n\n      if (!hasDependency(node, head)) {\n        if (!b4a.equals(node.writer.core.key, head.key)) continue\n\n        // todo: remove in next major because bug was fixed here:\n        // https://github.com/holepunchto/autobase-next/pull/237\n\n        // filter out any bad heads introduced by a bug to\n        // prevent inconsistencies being written to the oplog\n        if (head.length > h.length) return false\n      }\n\n      const popped = this.heads.pop()\n      if (popped !== head) this.heads[i--] = popped\n    }\n\n    this.heads.push(h)\n\n    const hex = b4a.toString(h.key, 'hex')\n\n    this._clockUpdates.set(hex, h.length)\n\n    if (this.pendingIndexers.length > 0) {\n      for (let i = 0; i < this.pendingIndexers.length; i++) {\n        if (!b4a.equals(this.pendingIndexers[i], h.key)) continue\n        this._updateIndexer(h.key, h.length, true, i)\n        return true\n      }\n    }\n\n    const idx = this._indexerMap.get(hex)\n    if (idx !== undefined) {\n      idx.length = h.length\n    }\n\n    return false\n  }\n\n  _updateIndexer(key, length, isIndexer, i) {\n    const hex = b4a.toString(key, 'hex')\n\n    if (!isIndexer) {\n      const existing = this._indexerMap.get(hex)\n      if (existing) {\n        this.indexerUpdate = true\n        this.indexers.splice(this.indexers.indexOf(existing), 1)\n        this._indexerMap.delete(hex)\n      }\n      return\n    }\n\n    for (; i < this.pendingIndexers.length; i++) {\n      if (b4a.equals(this.pendingIndexers[i], key)) {\n        break\n      }\n    }\n\n    if (length === 0) {\n      if (i >= this.pendingIndexers.length) this.pendingIndexers.push(key)\n      return\n    }\n\n    if (i < this.pendingIndexers.length) {\n      const top = this.pendingIndexers.pop()\n      if (i < this.pendingIndexers.length) this.pendingIndexers[i] = top\n    }\n\n    const idx = this._indexerMap.get(hex)\n\n    if (idx === undefined) {\n      const newIdx = { key, length }\n      this._indexerMap.set(hex, newIdx)\n      this.indexers.push(newIdx)\n\n      // bootstrap is \"silently\" added so that initial views have no prologue\n      if (!this.bootstrapping) this.indexerUpdate = true\n    } else {\n      idx.length = length\n    }\n  }\n\n  _seenLength(key) {\n    return this._clockUpdates.get(b4a.toString(key, 'hex')) || 0\n  }\n\n  async ack(key) {\n    const value = await this._get(key, 0)\n    const length = this._seenLength(key)\n    if (value && value.length === length) return\n\n    const isIndexer = value ? value.isIndexer : false\n    const isRemoved = value ? value.isRemoved : true\n\n    this._changes.push({ key, value: { isIndexer, isRemoved, length } })\n  }\n\n  async add(key, { isIndexer = false, length = this._seenLength(key) } = {}) {\n    let value = null\n    let found = false\n    let changed = true\n\n    for (let i = this._changes.length - 1; i >= 0; i--) {\n      const c = this._changes[i]\n      if (b4a.equals(key, c.key)) {\n        value = c.value\n        found = true\n        break\n      }\n    }\n\n    if (!found) {\n      const node = await this.db.get(key, { valueEncoding: Member, keyEncoding: MEMBERS })\n\n      if (node) {\n        value = node.value\n        found = true\n      }\n    }\n\n    let wasTracked = false\n    let wasIndexer = false\n\n    if (found) {\n      if (!value.isRemoved) wasTracked = true\n      if (value.isIndexer) wasIndexer = true\n      if (length < value.length) length = value.length\n      if (value.length === length && value.isIndexer === isIndexer && value.isRemoved === false)\n        changed = false\n    }\n\n    if (changed) {\n      this._changes.push({ key, value: { isIndexer, isRemoved: false, length } })\n    }\n\n    if (!wasTracked) this.members++\n    if (wasIndexer || isIndexer) this._updateIndexer(key, length, isIndexer, 0)\n  }\n\n  async remove(key) {\n    let isIndexer = false\n\n    for (const idx of this.indexers) {\n      isIndexer = b4a.equals(idx.key, key)\n      if (isIndexer) break\n    }\n\n    if (isIndexer) this._updateIndexer(key, null, false, 0)\n\n    let value = null\n    let found = false\n\n    for (let i = this._changes.length - 1; i >= 0; i--) {\n      const c = this._changes[i]\n      if (b4a.equals(key, c.key)) {\n        value = c.value\n        found = true\n        break\n      }\n    }\n\n    if (!found) {\n      const node = await this.db.get(key, { valueEncoding: Member, keyEncoding: MEMBERS })\n      if (node) {\n        value = node.value\n        found = true\n      }\n    }\n\n    const changed = !found || !value.isRemoved\n    const wasTracked = found && !value.isRemoved\n    const length = found ? value.length : 0\n\n    if (changed) {\n      this._changes.push({ key, value: { isIndexer: false, isRemoved: true, length } })\n    }\n\n    if (wasTracked) this.members--\n\n    return isIndexer\n  }\n\n  async linkable(key, length) {\n    const len = this._seenLength(key)\n    if (len > 0) return length > len\n\n    const info = await this._get(key, 0)\n    const prevLength = info ? info.length : 0\n\n    return length > prevLength\n  }\n\n  async has(key, opts) {\n    // could be optimised...\n    return (await this.get(key, opts)) !== null\n  }\n\n  async _get(key, timeout) {\n    let value = null\n    let found = false\n\n    for (let i = this._changes.length - 1; i >= 0; i--) {\n      const c = this._changes[i]\n      if (b4a.equals(key, c.key)) {\n        value = c.value\n        found = true\n        break\n      }\n    }\n\n    if (!found) {\n      const node = await this.db.get(key, { timeout, valueEncoding: Member, keyEncoding: MEMBERS })\n      if (node) {\n        value = node.value\n        found = true\n      }\n    }\n\n    return found ? value : null\n  }\n\n  async get(key, opts = {}) {\n    if (this._empty) return null\n\n    let value = await this._get(key, opts.timeout || 0)\n\n    if (opts.unflushed) {\n      const hex = b4a.toString(key, 'hex')\n\n      for (let i = this._changes.length - 1; i >= 0; i--) {\n        const c = this._changes[i]\n        if (b4a.equals(c.key, key)) value = c.value\n      }\n\n      if (this._clockUpdates.has(hex)) value.length = this._clockUpdates.get(hex)\n    }\n\n    return opts.onlyActive !== false || !value.isRemoved ? value : null\n  }\n\n  async hasLocal(key) {\n    if (this._empty) return false\n    try {\n      const node = await this.db.get(key, {\n        valueEncoding: Member,\n        keyEncoding: MEMBERS,\n        update: false,\n        wait: false\n      })\n      return node !== null\n    } catch {\n      return false\n    }\n  }\n\n  async getLocalLength(key) {\n    if (this._empty) return 0\n    try {\n      const node = await this.db.get(key, {\n        valueEncoding: Member,\n        keyEncoding: MEMBERS,\n        update: false,\n        wait: false\n      })\n      return node === null ? 0 : node.value.length\n    } catch {\n      return 0\n    }\n  }\n\n  list() {\n    // note, NOT safe to use during apply atm\n    return this.db.createReadStream({\n      valueEncoding: Member,\n      keyEncoding: MEMBERS\n    })\n  }\n\n  async isIndexed(key, length) {\n    const co = this.db.checkout(this.core.indexedLength)\n    try {\n      const node = await co.get(key, { valueEncoding: Member, keyEncoding: MEMBERS })\n      return node !== null && node.value.length >= length\n    } finally {\n      await co.close()\n    }\n  }\n\n  async fork(indexers, manifests, encryptionLength, views) {\n    this.indexers = []\n    this.pendingIndexers = []\n    this.views = views\n\n    if (this.version < 2) this.version = 2 // bump to enable entropy\n\n    for (const { key } of indexers) {\n      // todo: probably need to check isRemoved etc\n      const { length } = await this.get(key)\n      this.indexers.push({ key, length })\n    }\n\n    this._refreshEntropy(this.core.length)\n\n    const blocks = []\n\n    // truncate needs to respect hypercore batch\n    let truncate = this.core.length - 1\n    for await (const data of this.db.createHistoryStream({ lt: truncate, reverse: true })) {\n      if (b4a.equals(data.key, INFO_KEY)) {\n        truncate = data.seq + 1\n        break\n      }\n\n      blocks.push(data)\n    }\n\n    await this.core.truncate(truncate, this.core.fork)\n\n    const batch = this.db.batch({ update: false })\n    await batch.ready()\n\n    for (const { key, value } of blocks) {\n      await batch.put(key, value)\n    }\n\n    const info = {\n      version: this.version,\n      members: this.members,\n      pendingIndexers: this.pendingIndexers,\n      indexers: this.indexers,\n      heads: this.heads,\n      views: this.views,\n      encryptionLength,\n      entropy: this.entropy\n    }\n\n    await batch.put('info', info, { valueEncoding: Info, keyEncoding: DIGEST })\n    await batch.flush()\n\n    await this._reset(await this.db.get('info', { valueEncoding: Info, keyEncoding: DIGEST }))\n\n    return truncate\n  }\n}\n\nfunction hasDependency(node, dep) {\n  for (const h of node.actualHeads) {\n    if (sameNode(h, dep)) return true\n  }\n  return false\n}\n\nfunction sameNode(a, b) {\n  return b4a.equals(a.key, b.key) && a.length === b.length\n}\n\nfunction sameIndexers(a, b) {\n  if (a.views.length > 0 && b.views.length > 0) return b4a.equals(a.views[0].key, b.views[0].key)\n  if (a.indexers.length !== b.indexers.length) return false\n\n  for (let i = 0; i < a.indexers.length; i++) {\n    if (!b4a.equals(a.indexers[i].key, b.indexers[i].key)) return false\n  }\n\n  return true\n}\n\nfunction cloneNodes(arr) {\n  const c = []\n  for (let i = 0; i < arr.length; i++) {\n    c.push({ key: arr[i].key, length: arr[i].length })\n  }\n  return c\n}\n\nfunction generateEntropy(indexers, length, entropy) {\n  const buffer = b4a.alloc(8 + 32 + indexers.length * 32)\n  const state = { start: 0, end: buffer.byteLength, buffer }\n\n  c.uint64.encode(state, length)\n  c.fixed32.encode(state, entropy || GENESIS_ENTROPY)\n  for (const { key } of indexers) c.fixed32.encode(state, key)\n\n  return crypto.hash([NS_ENTROPY, buffer])\n}\nconst safetyCatch = require('safety-catch')\n\nconst MAX_WAIT = 2 * 60 * 1000\nconst DEFAULT_INTERVAL = 10 * 1000\n\nmodule.exports = class Timer {\n  constructor(handler, interval, opts = {}) {\n    this.handler = handler || noop\n    this.interval = interval || DEFAULT_INTERVAL\n    this.limit = opts.limit || MAX_WAIT\n\n    this._executing = null\n\n    this._limit = random2over1(this.limit)\n    this._timer = null\n    this._resolve = null\n    this._start = 0\n    this._stopped = false\n    this._asap = false\n    this._standalone = new Set()\n\n    this._unref = opts.unref !== false\n    this._timerCallback = this._executeBackground.bind(this)\n  }\n\n  _executeBackground() {\n    this._executing = this._execute()\n    this._executing.catch(safetyCatch) // make sure it doesnt crash in the bg\n  }\n\n  async _execute() {\n    this._asap = false\n    await this.handler()\n    this._start = 0\n    this._executing = null\n    this.bump()\n  }\n\n  bump() {\n    if (this._stopped || this._executing || this._asap) return\n\n    if (!this._start) this._start = Date.now()\n    else if (Date.now() - this._start > this._limit) return\n\n    const interval = random2over1(this.interval)\n\n    clearTimeout(this._timer)\n    this._timer = setTimeout(this._timerCallback, interval)\n    if (this._unref && this._timer.unref) this._timer.unref()\n  }\n\n  async trigger() {\n    if (this._stopped) return\n    if (this._executing) await this._executing\n    if (this._stopped) return\n\n    clearTimeout(this._timer)\n    this._timer = null\n\n    this._executeBackground()\n    await this._executing\n  }\n\n  async flush() {\n    if (this._executing) await this._executing\n  }\n\n  // business-as-usual\n  bau() {\n    if (!this._asap) return\n    this._asap = false\n    this.bump()\n  }\n\n  asap() {\n    if (this._asap) return\n    this._asap = true\n\n    const interval = Math.floor((Math.random() * this.interval) / 3)\n    clearTimeout(this._timer)\n    this._timer = setTimeout(this._timerCallback, interval)\n    if (this._unref && this._timer.unref) this._timer.unref()\n  }\n\n  stop() {\n    if (this._timer) clearTimeout(this._timer)\n    this._timer = null\n    this._start = 0\n    this._asap = false\n    this._stopped = true\n\n    for (const { timer, resolve } of this._standalone) {\n      clearTimeout(timer)\n      resolve()\n    }\n\n    this._standalone.clear()\n  }\n\n  asapStandalone() {\n    const interval = Math.floor((Math.random() * this.interval) / 3)\n    return new Promise((resolve) => {\n      const ref = { timer: null, resolve }\n      ref.timer = setTimeout(resolveStandalone, interval, ref, this._standalone)\n      if (ref.timer.unref) ref.timer.unref()\n      this._standalone.add(ref)\n    })\n  }\n\n  unref() {\n    if (this._timer && this._timer.unref) this._timer.unref()\n  }\n}\n\nfunction resolveStandalone(ref, set) {\n  set.delete(ref)\n  ref.resolve()\n}\n\n// random value x between n <= x < 2n\nfunction random2over1(n) {\n  return Math.floor(n + Math.random() * n)\n}\n\nfunction noop() {}\nconst b4a = require('b4a')\nconst assert = require('nanoassert')\n\nmodule.exports = class TopoList {\n  constructor() {\n    this.tip = []\n    this.undo = 0\n    this.shared = 0\n  }\n\n  static compare(a, b) {\n    return cmp(a, b)\n  }\n\n  static add(node, indexed, offset) {\n    addSorted(node, indexed, offset)\n  }\n\n  mark() {\n    this.shared = this.tip.length\n    this.undo = 0\n  }\n\n  // todo: bump to new api that just tracks undo\n  flush(indexed = []) {\n    if (indexed.length) this._applyIndexed(indexed)\n\n    const u = {\n      shared: this.shared,\n      undo: this.undo,\n      length: indexed.length + this.tip.length,\n      indexed,\n      tip: this.tip\n    }\n\n    this.mark()\n\n    return u\n  }\n\n  print() {\n    return this.tip.map((n) => n.writer.core.key.toString() + n.length)\n  }\n\n  _applyIndexed(nodes) {\n    assert(nodes.length <= this.tip.length, 'Indexed batch cannot exceed tip')\n\n    let shared = 0\n\n    for (; shared < nodes.length; shared++) {\n      if (this.tip[shared] !== nodes[shared]) break\n    }\n\n    // reordering\n    if (shared < nodes.length) this._track(shared)\n\n    const tip = []\n\n    for (let i = shared; i < this.tip.length; i++) {\n      const node = this.tip[i]\n      if (node.yielded) continue\n      const s = addSorted(node, tip, 0)\n      if (s === tip.length - 1) continue\n      this._track(shared + s)\n    }\n\n    this.tip = tip\n  }\n\n  add(node) {\n    const shared = addSorted(node, this.tip, 0)\n    this._track(shared)\n  }\n\n  _track(shared) {\n    if (shared < this.shared) {\n      this.undo += this.shared - shared\n      this.shared = shared\n    }\n  }\n}\n\nfunction hasOptimisticDeps(node) {\n  for (const d of node.dependencies) {\n    if (d.optimistic) return true\n  }\n  return false\n}\n\n// this can be optimised to only return optimistic nodes that we will \"touch\" when moving down the node\nfunction getOptimisticDeps(node, list) {\n  const deps = new Set()\n  const stack = [node]\n\n  while (stack.length > 0) {\n    const next = stack.pop()\n    if (deps.has(next)) continue\n    if (next.optimistic && next !== node) deps.add(next)\n    for (const d of next.dependencies) {\n      if (d.optimistic) stack.push(d)\n    }\n  }\n\n  const result = []\n\n  for (let i = list.length - 1; deps.size !== result.length && i >= 0; i--) {\n    const n = list[i]\n    if (deps.has(n)) result.push(n)\n  }\n\n  return result.reverse()\n}\n\nfunction addSortedOptimistic(node, list, offset) {\n  const opt = getOptimisticDeps(node, list)\n  const pos = new Uint32Array(opt.length)\n\n  for (let i = 0; i < opt.length; i++) {\n    const n = opt[i]\n    pos[i] = n.index\n    moveDown(n, list, offset)\n  }\n\n  moveDownAndUp(node, list, offset)\n\n  for (let i = opt.length - 1; i >= 0; i--) {\n    moveOptimisticUp(opt[i], list, offset)\n  }\n\n  let shared = node.index\n\n  for (let i = 0; i < opt.length; i++) {\n    const idx = pos[i]\n    const n = opt[i]\n\n    if (idx === n.index) continue\n\n    if (idx < shared) shared = idx\n    if (n.index < shared) shared = n.index\n  }\n\n  return shared\n}\n\nfunction addSorted(node, list, offset) {\n  list.push(node)\n  node.index = list.length - 1\n\n  // \"slow\" path, 1% of nodes\n  if (hasOptimisticDeps(node)) return addSortedOptimistic(node, list, offset)\n\n  moveDownAndUp(node, list, offset)\n  return node.index\n}\n\nfunction moveDown(node, list, offset) {\n  while (node.index > offset) {\n    const prev = list[node.index - 1]\n    if (links(node, prev)) break\n    list[(prev.index = node.index)] = prev\n    list[--node.index] = node\n  }\n}\n\nfunction moveOptimisticUp(node, list, offset) {\n  // if optimistic move all the way up\n  while (node.index < list.length - 1) {\n    const next = list[node.index + 1]\n    if (links(next, node)) break\n    list[(next.index = node.index)] = next\n    list[++node.index] = node\n  }\n\n  // stable sort in case multiple children\n  while (node.index > offset) {\n    const prev = list[node.index - 1]\n    if (!prev.optimistic) break\n    const c = cmp(prev, node)\n    if (c <= 0) break\n    list[(prev.index = node.index)] = prev\n    list[--node.index] = node\n  }\n}\n\nfunction moveNonOptimisticUp(node, list, offset) {\n  // stable sort against next non optimistic node\n  while (node.index < list.length - 1) {\n    const next = list[node.index + 1]\n    const c = cmpNonOptimistic(node, next, list)\n    if (c <= 0) break\n    list[(next.index = node.index)] = next\n    list[++node.index] = node\n  }\n}\n\nfunction moveDownAndUp(node, list, offset) {\n  moveDown(node, list, offset)\n\n  if (node.optimistic) moveOptimisticUp(node, list, offset)\n  else moveNonOptimisticUp(node, list, offset)\n}\n\nfunction links(a, b) {\n  if (b.dependents.has(a)) return true\n  return a.length > 0 && b.length === a.length - 1 && a.writer === b.writer\n}\n\nfunction cmpNonOptimistic(a, b, list) {\n  if (!b.optimistic) return cmp(a, b)\n\n  for (let i = b.index + 1; i < list.length; i++) {\n    const node = list[i]\n    if (!node.optimistic) return cmp(a, node)\n  }\n\n  return -1\n}\n\nfunction cmp(a, b) {\n  return links(b, a) ? -1 : cmpUnlinked(a, b)\n}\n\nfunction cmpUnlinked(a, b) {\n  const c = b4a.compare(a.writer.core.key, b.writer.core.key)\n  return c === 0 ? (a.length < b.length ? -1 : 1) : c\n}\nmodule.exports = class UpdateChanges {\n  constructor(base) {\n    this.base = base\n    this.byName = new Map()\n    this.tracking = null\n  }\n\n  get discoveryKey() {\n    return this.base.discoveryKey\n  }\n\n  get key() {\n    return this.base.key\n  }\n\n  get id() {\n    return this.base.id\n  }\n\n  get system() {\n    return this.base.system\n  }\n\n  track(state) {\n    this.tracking = []\n    this.byName.clear()\n\n    if (!state) return\n\n    for (const v of state.views) {\n      if (v.ref) this._add(v.ref)\n    }\n\n    this._add(state.systemView.ref)\n    this._add(state.encryptionView.ref)\n  }\n\n  _add(ref) {\n    this.tracking.push({ ref, from: ref.atomicBatch ? ref.atomicBatch.length : 0 })\n  }\n\n  finalise() {\n    if (this.tracking === null) return\n\n    for (const { ref, from } of this.tracking) {\n      const core = ref.atomicBatch || ref.batch\n      const trunc = ref.atomicBatch ? ref.atomicBatch.state.lastTruncation : null\n\n      this.byName.set(ref.name, {\n        from,\n        to: core ? core.length : from,\n        shared: trunc ? trunc.to : from\n      })\n    }\n\n    this.tracking = null\n  }\n\n  get(name) {\n    return this.byName.get(name)\n  }\n}\nconst crypto = require('hypercore-crypto')\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\n\nconst { OPLOG_VERSION } = require('./caps.js')\nconst { OplogMessage } = require('./messages.js')\nconst { EncryptionView } = require('./encryption.js')\n\nmodule.exports = {\n  encodeValue,\n  decodeValue\n}\n\nfunction encodeValue(value, opts = {}) {\n  const state = { start: 0, end: 0, buffer: null }\n\n  const message = {\n    version: opts.version || OPLOG_VERSION,\n    digest: null,\n    checkpoint: null,\n    optimistic: !!opts.optimistic,\n    node: {\n      heads: opts.heads || [],\n      batch: 1,\n      value\n    }\n  }\n\n  OplogMessage.preencode(state, message)\n\n  if (opts.padding) {\n    state.start = opts.padding\n    state.end += opts.padding\n  }\n\n  state.buffer = b4a.alloc(state.end)\n\n  OplogMessage.encode(state, message)\n\n  if (!opts.encrypted) return state.buffer\n\n  if (!opts.optimistic) {\n    throw new Error('Encoding an encrypted value is not supported')\n  }\n\n  const padding = b4a.alloc(16) // min hash length is 16\n  crypto.hash(state.buffer, padding)\n  padding[0] = 0\n\n  return b4a.concat([padding.subarray(0, 8), state.buffer])\n}\n\nasync function decodeValue(value, { autobase, encryptionKey, key, manifest, index = 0 } = {}) {\n  if (encryptionKey) {\n    const e = new EncryptionView({ encryptionKey, bootstrap: autobase })\n    const w = e.getWriterEncryption()\n\n    await w.decrypt(index, value, { key, manifest })\n    value = value.subarray(8)\n  }\n\n  const op = c.decode(OplogMessage, value)\n  return op.node.value\n}\nconst b4a = require('b4a')\nconst c = require('compact-encoding')\nconst safetyCatch = require('safety-catch')\nconst ReadyResource = require('ready-resource')\n\nconst WakeupEntry = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.key)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.fixed32.encode(state, m.key)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    return {\n      key: c.fixed32.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nmodule.exports = class AutoWakeup extends ReadyResource {\n  constructor(base) {\n    super()\n\n    this.base = base\n    this.flushing = null\n\n    this._rootStore = this.base.store\n    this._addBound = this.add.bind(this)\n    this._preupdateBound = this._preupdate.bind(this)\n    this._needsFlush = false\n    this._map = new Map()\n  }\n\n  [Symbol.iterator]() {\n    return this._map.values()\n  }\n\n  async _preupdate(batch, key) {\n    this.queue(key, batch.length)\n    await this.flush()\n    this.base._onwakeup()\n  }\n\n  async _save() {\n    const slab = b4a.allocUnsafe(8 + this._map.size * 40) // 32 + 8\n    const state = { start: 0, end: 0, buffer: slab }\n\n    c.uint.encode(state, this._map.size)\n    for (const m of this._map.values()) WakeupEntry.encode(state, m)\n\n    await this.base.local.setUserData('autobase/wakeup', slab.subarray(0, state.start))\n  }\n\n  async _load() {\n    const buffer = await this.base.local.getUserData('autobase/wakeup')\n    if (!buffer) return\n\n    const state = { start: 0, end: buffer.byteLength, buffer }\n\n    let len = c.uint.decode(state)\n    while (len-- > 0) {\n      const m = WakeupEntry.decode(state)\n      this._map.set(b4a.toString(m.key, 'hex'), m)\n    }\n  }\n\n  async _open() {\n    await this._load()\n\n    this._rootStore.watch(this._addBound)\n\n    for (const core of this._rootStore.cores) {\n      if (core.opened === false) await core.ready().catch(noop)\n      if (!core.closing) this.add(core)\n    }\n  }\n\n  async _close() {\n    this._rootStore.unwatch(this._addBound)\n\n    for (const core of this._rootStore.cores) {\n      if (core.opened && !core.closing) this.remove(core)\n    }\n\n    this._map.clear()\n\n    while (this.flushing) {\n      try {\n        await this.flushing\n      } catch {}\n    }\n  }\n\n  queue(key, length) {\n    const hex = b4a.toString(key, 'hex')\n    const m = this._map.get(hex)\n\n    if (m && m.length > length) {\n      return false\n    }\n\n    this._needsFlush = true\n    this._map.set(hex, { key, length })\n\n    return true\n  }\n\n  unqueue(key, length) {\n    const hex = b4a.toString(key, 'hex')\n    const m = this._map.get(hex)\n\n    if (!m) return true\n    if (m.length > length) return false\n\n    this._needsFlush = true\n    this._map.delete(hex)\n\n    return true\n  }\n\n  async flush() {\n    if (this.closing) throw new Error('Closing')\n\n    // wait for someone\n    if (this.flushing) await this.flushing\n\n    // if another still active they flushed us\n    if (this.flushing) return this.flushing\n\n    if (this._needsFlush === false) return\n    this._needsFlush = false\n\n    try {\n      this.flushing = this._save()\n      return await this.flushing\n    } finally {\n      this.flushing = null\n    }\n  }\n\n  add(core) {\n    return this._add(core).catch(safetyCatch)\n  }\n\n  remove(core) {\n    return this._remove(core)\n  }\n\n  async _add(core) {\n    if (core.opened === false) await core.ready()\n    if (core.closing) return false\n\n    // local writer, no need\n    if (core === this.base.local.core) return false\n\n    const rx = core.storage.read()\n\n    const referrerPromise = rx.getUserData('referrer')\n    const viewPromise = rx.getUserData('autobase/view')\n\n    rx.tryFlush()\n\n    const [referrer, view] = await Promise.all([referrerPromise, viewPromise])\n    if (view) return false\n\n    if (referrer === null || !b4a.equals(referrer, this.base.key)) return false\n\n    core.preupdate = this._preupdateBound\n\n    return true\n  }\n\n  _remove(core) {\n    if (core.preupdate !== this._preupdateBound) return false\n    core.preupdate = null\n    return true\n  }\n}\n\nfunction noop() {}\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\nconst ReadyResource = require('ready-resource')\nconst assert = require('nanoassert')\nconst SignalPromise = require('signal-promise')\n\nconst Linearizer = require('./linearizer.js')\nconst NodeBuffer = require('./node-buffer.js')\n\nconst MAX_PRELOAD = 4\nconst MAX_PREFETCH = 256\n\nmodule.exports = class Writer extends ReadyResource {\n  constructor(base, core, length, isRemoved) {\n    super()\n\n    this.base = base\n    this.core = core\n    this.isRemoved = isRemoved\n    this.updated = false\n    this.range = null\n    this.nodes = new NodeBuffer(length)\n    this.node = null\n    this.isActive = false\n    this.isCurrentlyCoupled = false\n    this.isCoupled = false // maintained by updateBootstrapWriters\n    this.isBootstrap = false // maintained by updateBootstrapWriters\n    this.isActiveIndexer = false\n    this.available = length\n    this.length = length\n    this.seenLength = 0\n    this.recover = false\n    this.frozen = false\n\n    this.syncSignal = null\n  }\n\n  _pause() {\n    if (!this.range) return\n    this.range.destroy()\n    this.range = null\n  }\n\n  _resume() {\n    if (this.range) {\n      // if we didnt fill up the preload buffer yet, do not commit to more work\n      if (this.range.range.end === this.nodes.length + MAX_PREFETCH) return\n      this.range.destroy()\n    }\n    this.range = this.core.download({\n      start: this.nodes.length,\n      end: this.nodes.length + MAX_PREFETCH,\n      linear: true\n    })\n  }\n\n  _updateCoupling() {\n    if (!this.base._coupler || this.isCoupled === this.isCurrentlyCoupled) return\n\n    if (this.isCurrentlyCoupled) this.base._coupler.remove(this.core)\n    else this.base._coupler.add(this.core)\n\n    this.isCurrentlyCoupled = this.isCoupled\n  }\n\n  _removeCouple() {\n    if (this.base._coupler && !this.isCoupled && this.isCurrentlyCoupled) {\n      this.isCurrentlyCoupled = false\n      this.base._coupler.remove(this.core)\n    }\n  }\n\n  updateActivity() {\n    if (!this.core.opened) return\n\n    if (this.seenLength > this.core.length || this.length < this.core.length || this.isBootstrap) {\n      // if we have seen a later core, or if we are behind, or if bootstrap\n      this.isActive = true\n      this.core.setActive(true)\n    } else if (this.length === this.core.length) {\n      // things look steady\n      this.isActive = false\n      this.core.setActive(false)\n    }\n\n    this._updateCoupling()\n\n    if (this.core.writable) return\n\n    if (this.base.isFastForwarding() || !this.isActive) {\n      this._pause()\n    } else {\n      this._resume()\n    }\n  }\n\n  setBootstrap(bool) {\n    this.isBootstrap = bool\n    this.updateActivity()\n  }\n\n  seen(length) {\n    if (length > this.seenLength) this.seenLength = length\n    this.updateActivity()\n  }\n\n  waitForSynced() {\n    if (this.core.length === this.length) return Promise.resolve()\n    if (this.syncSignal === null) this.syncSignal = new SignalPromise()\n    return this.syncSignal.wait()\n  }\n\n  async _open() {\n    await this.core.ready()\n    await this.core.setUserData('referrer', this.base.key)\n\n    // base might be closing here\n    if (this.base.closing) return\n\n    // remove later\n    this.recover = autoRecover(this.core)\n\n    // add it again incase it wasn't readied before, only needed if this is the first time we set the referrer...\n    await this.base._wakeup.add(this.core.core)\n\n    this.updateActivity()\n\n    if (this.core.length > this.length) this.base._queueBump()\n\n    this.base.emit('writer', this)\n  }\n\n  _close() {\n    if (this.syncSignal !== null) this.syncSignal.notify()\n    return this.core.close()\n  }\n\n  get indexed() {\n    return this.nodes.offset\n  }\n\n  idle() {\n    return this.length === this.available && this.length === this.core.length && this.core.opened\n  }\n\n  flushed() {\n    // TODO: prop a cleaner way to express this...\n    return (\n      this.seenLength <= this.length &&\n      this.length === this.available &&\n      this.length === this.core.length &&\n      this.shiftable() === false &&\n      !this.core.core.upgrading &&\n      this.core.opened\n    )\n  }\n\n  compare(writer) {\n    return b4a.compare(this.core.key, writer.core.key)\n  }\n\n  head() {\n    return this.nodes.get(this.length - 1)\n  }\n\n  advance() {\n    if (this.syncSignal !== null && this.length + 1 === this.core.length) this.syncSignal.notify()\n    return this.length < this.available ? this.nodes.get(this.length++) : null\n  }\n\n  shiftable() {\n    return this.length > this.nodes.offset\n  }\n\n  shift() {\n    if (this.shiftable() === false) return false\n\n    let node = this._shiftAndClear()\n    while (node.batch > 1) node = this._shiftAndClear()\n\n    return true\n  }\n\n  get(seq) {\n    return seq < this.length ? this.nodes.get(seq) : null\n  }\n\n  append(value, heads, batch, dependencies, optimistic) {\n    const node = Linearizer.createNode(\n      this,\n      this.nodes.length + 1,\n      value,\n      heads,\n      batch,\n      dependencies,\n      optimistic\n    )\n\n    node.actualHeads = node.heads.slice(0)\n\n    this.nodes.push(node)\n    this.available++\n    this.length++\n\n    return node\n  }\n\n  async update(boot) {\n    if (this.opened === false) await this.ready()\n    if (this.frozen) return false\n\n    // if this is a boot node, DO NOT, preload as that will make it load\n    // and reject nodes based on the tmp state of the system.\n    // prop needs a better solution but this works for now\n    const preload = boot ? 1 : MAX_PRELOAD\n\n    while (this.available - this.length < preload) {\n      // quick sanity check\n      if (this.nodes.length === this.core.length || this.core.length === 0) break\n\n      // load next node\n      if (this.node === null && !(await this._loadNextNode())) break\n      if (!(await this._ensureNodeDependencies(boot))) break\n\n      if (this.recover) this.node.value = null\n\n      this.nodes.push(this.node)\n      if (this.node.batch === 1) this.available = this.nodes.length\n      this.node = null\n    }\n\n    this.updateActivity()\n\n    return this.length < this.available\n  }\n\n  _shiftAndClear() {\n    const node = this.nodes.shift()\n    node.clear()\n    return node\n  }\n\n  async _loadNextNode() {\n    const seq = this.nodes.length\n\n    if (!(await this.core.has(seq))) return false\n\n    try {\n      const { node, optimistic, trace } = await this.core.get(seq, { wait: false })\n\n      const value = node.value == null ? null : c.decode(this.base.valueEncoding, node.value)\n      this.node = Linearizer.createNode(\n        this,\n        seq + 1,\n        value,\n        node.heads,\n        node.batch,\n        new Set(),\n        optimistic,\n        trace\n      )\n      return true\n    } catch (err) {\n      this.frozen = true\n      throw err\n    }\n  }\n\n  async _ensureNodeDependencies(boot) {\n    while (this.node.dependencies.size < this.node.heads.length) {\n      const rawHead = this.node.heads[this.node.dependencies.size]\n\n      const headWriter = await this.base._getWriterByKey(\n        rawHead.key,\n        -1,\n        rawHead.length,\n        true,\n        false,\n        boot\n      )\n\n      if (headWriter !== this && (headWriter === null || headWriter.length < rawHead.length)) {\n        if (!boot) this.base._ensureWakeup(headWriter)\n        return false\n      }\n\n      let headNode = headWriter.nodes.get(rawHead.length - 1)\n\n      // could be a stub node\n      if (!headNode) {\n        for (const node of this.base.linearizer.heads) {\n          if (!compareHead(node, rawHead)) continue\n          headNode = node\n          break\n        }\n      }\n\n      // TODO: generalise DAG validation and freeze the writer\n      assert(!this.node.dependencies.has(headNode), 'Corrupted DAG')\n\n      // TODO: better way to solve the stub check is to never mutate heads below\n      if (headNode === null) {\n        // already yielded\n        this.node.heads.splice(this.node.dependencies.size, 1)\n        continue\n      }\n\n      this.node.dependencies.add(headNode)\n    }\n\n    // always link previous node if it's not indexed\n    const offset = this.node.length - 1\n    if (offset > this.indexed) {\n      this.node.dependencies.add(this.nodes.get(offset - 1))\n    }\n\n    return true\n  }\n}\n\nfunction compareHead(node, head) {\n  if (node.length !== head.length) return false\n  return b4a.equals(node.writer.core.key, head.key)\n}\n\n// this is a list of peers we bugged in the btc and planb room.\n// adding them here so migration can run, can be removed in a month or so from time of commit\n// note, no security implications of this, we just null them out.\n\nfunction autoRecover(core) {\n  assert(core.opened)\n\n  switch (core.id) {\n    case 'ghrpexaboutdm46ombqho7mroxknassnntrxx3cubfux4qi6w6hy':\n    case 'qoaanao71s4he1rcd197d336qepykk4467geo1uq8cwnzmpb786o':\n    case 'fomhdxgn4j4tzjqy6y7iskhffimzokt7kraddyd8orcht3r8q61o':\n    case 'd8f5taxxrit51apftoi38e5b86hb98cgfd7dfp3uo1uoh95qt49o':\n    case 'objyf75uggsqpjcut69xdgj46ks8r71jjrq7oxdfsz95sstchkno':\n      return true\n  }\n\n  return false\n}\n{\n  \"name\": \"autobase\",\n  \"version\": \"7.25.1\",\n  \"description\": \"A multiwriter data structure for Hypercore\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"format\": \"prettier . --write\",\n    \"test\": \"prettier . --check && brittle test/all.js\",\n    \"test:encrypted\": \"prettier . --check && brittle test/all.js --encrypt-all\",\n    \"test:fixtures\": \"prettier . --check && brittle test/fixtures/tests/*.js\",\n    \"test:bare\": \"bare test/all.js\",\n    \"fuzz:generated\": \"brittle test/reference/fuzz/generated/*.js\",\n    \"fuzz:main\": \"node test/fuzz/index.js\",\n    \"fuzz\": \"node test/reference/fuzz/fuzz.js\",\n    \"generate-fixtures\": \"node test/fixtures/generate/all.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"lib/**\",\n    \"encoding/**\"\n  ],\n  \"imports\": {\n    \"events\": {\n      \"bare\": \"bare-events\",\n      \"default\": \"events\"\n    }\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/autobase.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/autobase/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/autobase#readme\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.1\",\n    \"bare-events\": \"^2.2.0\",\n    \"compact-encoding\": \"^2.16.0\",\n    \"core-coupler\": \"^2.0.0\",\n    \"debounceify\": \"^1.0.0\",\n    \"encryption-encoding\": \"^1.0.3\",\n    \"hyperbee\": \"^2.22.0\",\n    \"hypercore\": \"^11.4.0\",\n    \"hypercore-crypto\": \"^3.4.0\",\n    \"hypercore-id-encoding\": \"^1.2.0\",\n    \"hyperschema\": \"^1.12.1\",\n    \"index-encoder\": \"^3.3.2\",\n    \"nanoassert\": \"^2.0.0\",\n    \"protomux-wakeup\": \"^2.0.0\",\n    \"ready-resource\": \"^1.0.0\",\n    \"resolve-reject-promise\": \"^1.1.0\",\n    \"safety-catch\": \"^1.0.2\",\n    \"scope-lock\": \"^1.2.4\",\n    \"signal-promise\": \"^1.0.3\",\n    \"sodium-universal\": \"^5.0.1\",\n    \"sub-encoder\": \"^2.1.1\",\n    \"tiny-buffer-map\": \"^1.1.1\"\n  },\n  \"devDependencies\": {\n    \"autobase-test-helpers\": \"^3.0.0\",\n    \"blind-encryption-sodium\": \"^2.0.0\",\n    \"brittle\": \"^3.1.1\",\n    \"corestore\": \"^7.0.15\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"rache\": \"^1.0.0\",\n    \"same-data\": \"^1.0.0\",\n    \"task-backoff\": \"^1.0.0\",\n    \"test-tmp\": \"^1.2.0\",\n    \"uncaughts\": \"^1.1.0\"\n  },\n  \"standard\": {\n    \"ignore\": [\n      \"**/test/fuzz/generated/**\",\n      \"**/test/reference/**\",\n      \"example.mjs\"\n    ]\n  }\n}\nfunction isBuffer(value) {\n  return Buffer.isBuffer(value) || value instanceof Uint8Array\n}\n\nfunction isEncoding(encoding) {\n  return Buffer.isEncoding(encoding)\n}\n\nfunction alloc(size, fill, encoding) {\n  return Buffer.alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe(size) {\n  return Buffer.allocUnsafe(size)\n}\n\nfunction allocUnsafeSlow(size) {\n  return Buffer.allocUnsafeSlow(size)\n}\n\nfunction byteLength(string, encoding) {\n  return Buffer.byteLength(string, encoding)\n}\n\nfunction compare(a, b) {\n  return Buffer.compare(a, b)\n}\n\nfunction concat(buffers, totalLength) {\n  return Buffer.concat(buffers, totalLength)\n}\n\nfunction copy(source, target, targetStart, start, end) {\n  return toBuffer(source).copy(target, targetStart, start, end)\n}\n\nfunction equals(a, b) {\n  return toBuffer(a).equals(b)\n}\n\nfunction fill(buffer, value, offset, end, encoding) {\n  return toBuffer(buffer).fill(value, offset, end, encoding)\n}\n\nfunction from(value, encodingOrOffset, length) {\n  return Buffer.from(value, encodingOrOffset, length)\n}\n\nfunction includes(buffer, value, byteOffset, encoding) {\n  return toBuffer(buffer).includes(value, byteOffset, encoding)\n}\n\nfunction indexOf(buffer, value, byfeOffset, encoding) {\n  return toBuffer(buffer).indexOf(value, byfeOffset, encoding)\n}\n\nfunction lastIndexOf(buffer, value, byteOffset, encoding) {\n  return toBuffer(buffer).lastIndexOf(value, byteOffset, encoding)\n}\n\nfunction swap16(buffer) {\n  return toBuffer(buffer).swap16()\n}\n\nfunction swap32(buffer) {\n  return toBuffer(buffer).swap32()\n}\n\nfunction swap64(buffer) {\n  return toBuffer(buffer).swap64()\n}\n\nfunction toBuffer(buffer) {\n  if (Buffer.isBuffer(buffer)) return buffer\n  return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nfunction toString(buffer, encoding, start, end) {\n  return toBuffer(buffer).toString(encoding, start, end)\n}\n\nfunction write(buffer, string, offset, length, encoding) {\n  return toBuffer(buffer).write(string, offset, length, encoding)\n}\n\nfunction readDoubleBE(buffer, offset) {\n  return toBuffer(buffer).readDoubleBE(offset)\n}\n\nfunction readDoubleLE(buffer, offset) {\n  return toBuffer(buffer).readDoubleLE(offset)\n}\n\nfunction readFloatBE(buffer, offset) {\n  return toBuffer(buffer).readFloatBE(offset)\n}\n\nfunction readFloatLE(buffer, offset) {\n  return toBuffer(buffer).readFloatLE(offset)\n}\n\nfunction readInt32BE(buffer, offset) {\n  return toBuffer(buffer).readInt32BE(offset)\n}\n\nfunction readInt32LE(buffer, offset) {\n  return toBuffer(buffer).readInt32LE(offset)\n}\n\nfunction readUInt32BE(buffer, offset) {\n  return toBuffer(buffer).readUInt32BE(offset)\n}\n\nfunction readUInt32LE(buffer, offset) {\n  return toBuffer(buffer).readUInt32LE(offset)\n}\n\nfunction writeDoubleBE(buffer, value, offset) {\n  return toBuffer(buffer).writeDoubleBE(value, offset)\n}\n\nfunction writeDoubleLE(buffer, value, offset) {\n  return toBuffer(buffer).writeDoubleLE(value, offset)\n}\n\nfunction writeFloatBE(buffer, value, offset) {\n  return toBuffer(buffer).writeFloatBE(value, offset)\n}\n\nfunction writeFloatLE(buffer, value, offset) {\n  return toBuffer(buffer).writeFloatLE(value, offset)\n}\n\nfunction writeInt32BE(buffer, value, offset) {\n  return toBuffer(buffer).writeInt32BE(value, offset)\n}\n\nfunction writeInt32LE(buffer, value, offset) {\n  return toBuffer(buffer).writeInt32LE(value, offset)\n}\n\nfunction writeUInt32BE(buffer, value, offset) {\n  return toBuffer(buffer).writeUInt32BE(value, offset)\n}\n\nfunction writeUInt32LE(buffer, value, offset) {\n  return toBuffer(buffer).writeUInt32LE(value, offset)\n}\n\nmodule.exports = {\n  isBuffer,\n  isEncoding,\n  alloc,\n  allocUnsafe,\n  allocUnsafeSlow,\n  byteLength,\n  compare,\n  concat,\n  copy,\n  equals,\n  fill,\n  from,\n  includes,\n  indexOf,\n  lastIndexOf,\n  swap16,\n  swap32,\n  swap64,\n  toBuffer,\n  toString,\n  write,\n  readDoubleBE,\n  readDoubleLE,\n  readFloatBE,\n  readFloatLE,\n  readInt32BE,\n  readInt32LE,\n  readUInt32BE,\n  readUInt32LE,\n  writeDoubleBE,\n  writeDoubleLE,\n  writeFloatBE,\n  writeFloatLE,\n  writeInt32BE,\n  writeInt32LE,\n  writeUInt32BE,\n  writeUInt32LE\n}\n{\n  \"name\": \"b4a\",\n  \"version\": \"1.7.3\",\n  \"description\": \"Bridging the gap between buffers and typed arrays\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"react-native\": \"./react-native.js\",\n      \"browser\": \"./browser.js\",\n      \"default\": \"./index.js\"\n    }\n  },\n  \"files\": [\n    \"browser.js\",\n    \"index.js\",\n    \"react-native.js\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"npm run lint && npm run test:bare && npm run test:node\",\n    \"test:bare\": \"bare test.mjs\",\n    \"test:node\": \"node test.mjs\",\n    \"lint\": \"prettier . --check\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/b4a.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/b4a/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/b4a#readme\",\n  \"devDependencies\": {\n    \"brittle\": \"^3.5.2\",\n    \"nanobench\": \"^3.0.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^1.0.0\"\n  },\n  \"peerDependencies\": {\n    \"react-native-b4a\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"react-native-b4a\": {\n      \"optional\": true\n    }\n  }\n}\nconst { AbortController, AbortSignal } = require('.')\n\nglobal.AbortController = AbortController\nglobal.AbortSignal = AbortSignal\nconst { Event, EventTarget } = require('bare-events/web')\n\n// https://webidl.spec.whatwg.org/#aborterror\nclass AbortError extends Error {\n  get name() {\n    return 'AbortError'\n  }\n}\n\n// https://webidl.spec.whatwg.org/#timeouterror\nclass TimeoutError extends Error {\n  get name() {\n    return 'TimeoutError'\n  }\n}\n\n// https://dom.spec.whatwg.org/#abortsignal\nclass AbortSignal extends EventTarget {\n  constructor() {\n    super()\n\n    this._reason = undefined\n  }\n\n  // https://dom.spec.whatwg.org/#dom-abortsignal-aborted\n  get aborted() {\n    return this._reason !== undefined\n  }\n\n  // https://dom.spec.whatwg.org/#dom-abortsignal-reason\n  get reason() {\n    return this._reason\n  }\n\n  // https://dom.spec.whatwg.org/#dom-abortsignal-throwifaborted\n  throwIfAborted() {\n    if (this._reason !== undefined) throw this._reason\n  }\n\n  toJSON() {\n    return {\n      aborted: this.aborted,\n      reason: this.reason\n    }\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: AbortSignal },\n\n      aborted: this.aborted,\n      reason: this.reason\n    }\n  }\n}\n\n// https://dom.spec.whatwg.org/#abortcontroller\nclass AbortController {\n  constructor() {\n    this._signal = new AbortSignal()\n  }\n\n  // https://dom.spec.whatwg.org/#dom-abortcontroller-signal\n  get signal() {\n    return this._signal\n  }\n\n  // https://dom.spec.whatwg.org/#dom-abortcontroller-abort\n  abort(reason = new AbortError('The operation was aborted')) {\n    const signal = this._signal\n\n    if (signal._reason !== undefined) return\n\n    signal._reason = reason\n\n    signal.dispatchEvent(new Event('abort'))\n  }\n\n  toJSON() {\n    return {\n      signal: this.signal\n    }\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: AbortController },\n\n      signal: this.signal\n    }\n  }\n\n  // https://dom.spec.whatwg.org/#dom-abortsignal-abort\n  static abort(reason) {\n    const signal = new AbortSignal()\n\n    signal.abort(reason)\n\n    return signal\n  }\n\n  // https://dom.spec.whatwg.org/#dom-abortsignal-timeout\n  static timeout(ms) {\n    const signal = new AbortSignal()\n\n    const timer = setTimeout(\n      () => signal.abort(new TimeoutError('The operation timed out')),\n      ms\n    )\n\n    timer.unref()\n\n    return signal\n  }\n}\n\nmodule.exports = exports = AbortController\n\nexports.AbortController = exports\n\nexports.AbortSignal = AbortSignal\n{\n  \"name\": \"bare-abort-controller\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Abort controller support for Bare\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./global\": {\n      \"types\": \"./global.d.ts\",\n      \"default\": \"./global.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"global.js\",\n    \"global.d.ts\"\n  ],\n  \"scripts\": {\n    \"test\": \"npm run lint && npm run test:bare && npm run test:node\",\n    \"test:bare\": \"bare test.js\",\n    \"test:node\": \"node test.js\",\n    \"lint\": \"prettier . --check\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-abort-controller.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-abort-controller/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-abort-controller#readme\",\n  \"dependencies\": {\n    \"bare-events\": \"^2.7.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nconst ESC = '\\x1b'\nconst CSI = ESC + '['\nconst SGR = (n) => CSI + n + 'm'\n\nexports.constants = {\n  ESC,\n  CSI,\n  SGR\n}\n\n// https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_(Control_Sequence_Introducer)_sequences\n\nexports.cursorHide = CSI + '?25l'\nexports.cursorShow = CSI + '?25h'\n\nexports.cursorUp = function cursorUp(n = 1) {\n  return CSI + n + 'A'\n}\n\nexports.cursorDown = function cursorDown(n = 1) {\n  return CSI + n + 'B'\n}\n\nexports.cursorForward = function cursorForward(n = 1) {\n  return CSI + n + 'C'\n}\n\nexports.cursorBack = function cursorBack(n = 1) {\n  return CSI + n + 'D'\n}\n\nexports.cursorNextLine = function cursorNextLine(n = 1) {\n  return CSI + n + 'E'\n}\n\nexports.cursorPreviousLine = function cursorPreviousLine(n = 1) {\n  return CSI + n + 'F'\n}\n\nexports.cursorPosition = function cursorPosition(column, row = 0) {\n  if (row === 0) return CSI + (column + 1) + 'G'\n\n  return CSI + (row + 1) + ';' + (column + 1) + 'H'\n}\n\nexports.eraseDisplayEnd = CSI + 'J'\nexports.eraseDisplayStart = CSI + '1J'\nexports.eraseDisplay = CSI + '2J'\nexports.eraseLineEnd = CSI + 'K'\nexports.eraseLineStart = CSI + '1K'\nexports.eraseLine = CSI + '2K'\n\nexports.scrollUp = function scrollUp(n = 1) {\n  return CSI + n + 'S'\n}\n\nexports.scrollDown = function scrollDown(n = 1) {\n  return CSI + n + 'T'\n}\n\n// https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters\n\nexports.modifierReset = SGR(0)\nexports.modifierBold = SGR(1)\nexports.modifierDim = SGR(2)\nexports.modifierItalic = SGR(3)\nexports.modifierUnderline = SGR(4)\nexports.modifierNormal = SGR(22)\nexports.modifierNotItalic = SGR(23)\nexports.modifierNotUnderline = SGR(24)\n\n// https://en.wikipedia.org/wiki/ANSI_escape_code#Colors\n\nexports.colorBlack = SGR(30)\nexports.colorRed = SGR(31)\nexports.colorGreen = SGR(32)\nexports.colorYellow = SGR(33)\nexports.colorBlue = SGR(34)\nexports.colorMagenta = SGR(35)\nexports.colorCyan = SGR(36)\nexports.colorWhite = SGR(37)\nexports.colorDefault = SGR(39)\nexports.colorBrightBlack = SGR(90)\nexports.colorBrightRed = SGR(91)\nexports.colorBrightGreen = SGR(92)\nexports.colorBrightYellow = SGR(93)\nexports.colorBrightBlue = SGR(94)\nexports.colorBrightMagenta = SGR(95)\nexports.colorBrightCyan = SGR(96)\nexports.colorBrightWhite = SGR(97)\n{\n  \"name\": \"bare-ansi-escapes\",\n  \"version\": \"2.2.3\",\n  \"description\": \"Parse and produce ANSI escape sequences\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./key-decoder\": {\n      \"types\": \"./key-decoder.d.ts\",\n      \"default\": \"./key-decoder.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"key-decoder.js\",\n    \"key-decoder.d.ts\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-ansi-escapes.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-ansi-escapes/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-ansi-escapes#readme\",\n  \"dependencies\": {\n    \"bare-stream\": \"^2.6.5\"\n  },\n  \"devDependencies\": {\n    \"bare-buffer\": \"^3.0.2\",\n    \"brittle\": \"^3.3.2\",\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  },\n  \"peerDependencies\": {\n    \"bare-buffer\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bare-buffer\": {\n      \"optional\": true\n    }\n  }\n}\nmodule.exports = require.addon()\nconst constants = require('./lib/constants')\nconst ascii = require('./lib/ascii')\nconst base64 = require('./lib/base64')\nconst base64url = require('./lib/base64url')\nconst hex = require('./lib/hex')\nconst utf8 = require('./lib/utf8')\nconst utf16le = require('./lib/utf16le')\nconst latin1 = require('./lib/latin1')\nconst binding = require('./binding')\n\nconst kind = Symbol.for('bare.buffer.kind')\n\nlet poolSize = 0\n\nmodule.exports = exports = class Buffer extends Uint8Array {\n  static get [kind]() {\n    return 0 // Compatibility version\n  }\n\n  static get poolSize() {\n    return poolSize\n  }\n\n  static set poolSize(value) {\n    poolSize = Math.max(0, value)\n  }\n\n  constructor(arrayBuffer, offset, length, opts = {}) {\n    if (typeof arrayBuffer === 'number') {\n      opts = offset || {}\n\n      const { uninitialized = false } = opts\n\n      offset = 0\n      length = arrayBuffer\n\n      if (length > constants.MAX_LENGTH) {\n        throw new RangeError(`Buffer length must be at most ${constants.MAX_LENGTH}`)\n      }\n\n      arrayBuffer = uninitialized ? binding.allocUnsafe(length) : binding.alloc(length)\n    } else {\n      if (length > constants.MAX_LENGTH) {\n        throw new RangeError(`Buffer length must be at most ${constants.MAX_LENGTH}`)\n      }\n\n      if (typeof offset === 'object' && offset !== null) {\n        opts = offset\n        offset = 0\n        length = arrayBuffer.byteLength\n      } else if (typeof length === 'length' && length !== null) {\n        opts = length\n        length = arrayBuffer.byteLength - offset\n      }\n    }\n\n    super(arrayBuffer, offset, length)\n  }\n\n  get [kind]() {\n    return Buffer[kind]\n  }\n\n  copy(target, targetStart = 0, sourceStart = 0, sourceEnd = this.byteLength) {\n    let source = this\n\n    if (targetStart < 0) targetStart = 0\n    if (targetStart >= target.byteLength) return 0\n\n    const targetLength = target.byteLength - targetStart\n\n    if (sourceStart < 0) sourceStart = 0\n    if (sourceStart >= source.byteLength) return 0\n\n    if (sourceEnd <= sourceStart) return 0\n    if (sourceEnd > source.byteLength) sourceEnd = source.byteLength\n\n    if (sourceEnd - sourceStart > targetLength) {\n      sourceEnd = sourceStart + targetLength\n    }\n\n    const sourceLength = sourceEnd - sourceStart\n\n    if (source === target) {\n      target.copyWithin(targetStart, sourceStart, sourceEnd)\n    } else {\n      if (sourceStart !== 0 || sourceEnd !== source.byteLength) {\n        source = source.subarray(sourceStart, sourceEnd)\n      }\n\n      target.set(source, targetStart)\n    }\n\n    return sourceLength\n  }\n\n  equals(target) {\n    const source = this\n\n    if (source === target) return true\n    if (source.byteLength !== target.byteLength) return false\n\n    return (\n      binding.compare(\n        source.buffer,\n        source.byteOffset,\n        source.byteLength,\n        target.buffer,\n        target.byteOffset,\n        target.byteLength\n      ) === 0\n    )\n  }\n\n  compare(\n    target,\n    targetStart = 0,\n    targetEnd = target.byteLength,\n    sourceStart = 0,\n    sourceEnd = this.byteLength\n  ) {\n    let source = this\n\n    if (source === target) return 0\n\n    if (arguments.length > 1) {\n      if (targetStart < 0) targetStart = 0\n      if (targetStart > target.byteLength) targetStart = target.byteLength\n\n      if (targetEnd < targetStart) targetEnd = targetStart\n      if (targetEnd > target.byteLength) targetEnd = target.byteLength\n\n      if (sourceStart < 0) sourceStart = 0\n      if (sourceStart > source.byteLength) sourceStart = source.byteLength\n\n      if (sourceEnd < sourceStart) sourceEnd = sourceStart\n      if (sourceEnd > source.byteLength) sourceEnd = source.byteLength\n\n      if (sourceStart !== 0 || sourceEnd !== source.byteLength) {\n        source = source.subarray(sourceStart, sourceEnd)\n      }\n\n      if (targetStart !== 0 || targetEnd !== target.byteLength) {\n        target = target.subarray(targetStart, targetEnd)\n      }\n    }\n\n    return binding.compare(\n      source.buffer,\n      source.byteOffset,\n      source.byteLength,\n      target.buffer,\n      target.byteOffset,\n      target.byteLength\n    )\n  }\n\n  fill(value, offset = 0, end = this.byteLength, encoding = 'utf8') {\n    if (typeof value === 'string') {\n      if (typeof offset === 'string') {\n        // fill(string, encoding)\n        encoding = offset\n        offset = 0\n        end = this.byteLength\n      } else if (typeof end === 'string') {\n        // fill(string, offset, encoding)\n        encoding = end\n        end = this.byteLength\n      }\n    } else if (typeof value === 'number') {\n      value = value & 0xff\n    } else if (typeof value === 'boolean') {\n      value = +value\n    }\n\n    if (offset < 0) offset = 0\n    if (offset >= this.byteLength) return this\n\n    if (end <= offset) return this\n    if (end > this.byteLength) end = this.byteLength\n\n    if (typeof value === 'number') return super.fill(value, offset, end)\n\n    if (typeof value === 'string') value = exports.from(value, encoding)\n\n    const length = value.byteLength\n\n    for (let i = 0, n = end - offset; i < n; ++i) {\n      this[i + offset] = value[i % length]\n    }\n\n    return this\n  }\n\n  includes(value, offset, encoding) {\n    return this.indexOf(value, offset, encoding) !== -1\n  }\n\n  indexOf(value, offset = 0, encoding) {\n    if (typeof value === 'boolean') value = +value\n\n    if (typeof value === 'number') {\n      return super.indexOf(value & 0xff, offset)\n    }\n\n    return bidirectionalIndexOf(this, value, offset, encoding, true /* first */)\n  }\n\n  lastIndexOf(value, offset = this.byteLength - 1, encoding) {\n    if (typeof value === 'boolean') value = +value\n\n    if (typeof value === 'number') {\n      return super.lastIndexOf(value & 0xff, offset)\n    }\n\n    return bidirectionalIndexOf(this, value, offset, encoding, false /* last */)\n  }\n\n  swap16() {\n    const length = this.byteLength\n\n    if (length % 2 !== 0) {\n      throw new RangeError('Buffer size must be a multiple of 16-bits')\n    }\n\n    for (let i = 0; i < length; i += 2) swap(this, i, i + 1)\n\n    return this\n  }\n\n  swap32() {\n    const length = this.byteLength\n\n    if (length % 4 !== 0) {\n      throw new RangeError('Buffer size must be a multiple of 32-bits')\n    }\n\n    for (let i = 0; i < length; i += 4) {\n      swap(this, i, i + 3)\n      swap(this, i + 1, i + 2)\n    }\n\n    return this\n  }\n\n  swap64() {\n    const length = this.byteLength\n\n    if (length % 8 !== 0) {\n      throw new RangeError('Buffer size must be a multiple of 64-bits')\n    }\n\n    for (let i = 0; i < length; i += 8) {\n      swap(this, i, i + 7)\n      swap(this, i + 1, i + 6)\n      swap(this, i + 2, i + 5)\n      swap(this, i + 3, i + 4)\n    }\n\n    return this\n  }\n\n  toString(encoding = 'utf8', start = 0, end = this.byteLength) {\n    // toString()\n    if (arguments.length === 0) return utf8.toString(this)\n\n    // toString(encoding)\n    if (arguments.length === 1) return codecFor(encoding).toString(this)\n\n    if (start < 0) start = 0\n    if (start >= this.byteLength) return ''\n\n    if (end <= start) return ''\n    if (end > this.byteLength) end = this.byteLength\n\n    let buffer = this\n\n    if (start !== 0 || end !== this.byteLength) {\n      buffer = buffer.subarray(start, end)\n    }\n\n    return codecFor(encoding).toString(buffer)\n  }\n\n  write(string, offset = 0, length = this.byteLength - offset, encoding = 'utf8') {\n    // write(string)\n    if (arguments.length === 1) return utf8.write(this, string)\n\n    if (typeof offset === 'string') {\n      // write(string, encoding)\n      encoding = offset\n      offset = 0\n      length = this.byteLength\n    } else if (typeof length === 'string') {\n      // write(string, offset, encoding)\n      encoding = length\n      length = this.byteLength - offset\n    }\n\n    length = Math.min(length, exports.byteLength(string, encoding))\n\n    let start = offset\n    if (start < 0) start = 0\n    if (start >= this.byteLength) return 0\n\n    let end = offset + length\n    if (end <= start) return 0\n    if (end > this.byteLength) end = this.byteLength\n\n    let buffer = this\n\n    if (start !== 0 || end !== this.byteLength) {\n      buffer = buffer.subarray(start, end)\n    }\n\n    return codecFor(encoding).write(buffer, string)\n  }\n\n  readBigInt64BE(offset = 0) {\n    return viewOf(this).getBigInt64(offset, false)\n  }\n  readBigInt64LE(offset = 0) {\n    return viewOf(this).getBigInt64(offset, true)\n  }\n\n  readBigUint64BE(offset = 0) {\n    return viewOf(this).getBigUint64(offset, false)\n  }\n  readBigUint64LE(offset = 0) {\n    return viewOf(this).getBigUint64(offset, true)\n  }\n\n  readDoubleBE(offset = 0) {\n    return viewOf(this).getFloat64(offset, false)\n  }\n  readDoubleLE(offset = 0) {\n    return viewOf(this).getFloat64(offset, true)\n  }\n\n  readFloatBE(offset = 0) {\n    return viewOf(this).getFloat32(offset, false)\n  }\n  readFloatLE(offset = 0) {\n    return viewOf(this).getFloat32(offset, true)\n  }\n\n  readInt8(offset = 0) {\n    return viewOf(this).getInt8(offset)\n  }\n\n  readInt16BE(offset = 0) {\n    return viewOf(this).getInt16(offset, false)\n  }\n  readInt16LE(offset = 0) {\n    return viewOf(this).getInt16(offset, true)\n  }\n\n  readInt32BE(offset = 0) {\n    return viewOf(this).getInt32(offset, false)\n  }\n  readInt32LE(offset = 0) {\n    return viewOf(this).getInt32(offset, true)\n  }\n\n  readIntBE(offset, byteLength) {\n    if (byteLength === 6) return readInt48BE(viewOf(this), offset)\n    if (byteLength === 5) return readInt40BE(viewOf(this), offset)\n    if (byteLength === 3) return readInt24BE(viewOf(this), offset)\n    if (byteLength === 4) return this.readInt32BE(offset)\n    if (byteLength === 2) return this.readInt16BE(offset)\n    if (byteLength === 1) return this.readInt8(offset)\n    throw new RangeError(`Byte length must be between 1 and 6`)\n  }\n\n  readIntLE(offset, byteLength) {\n    if (byteLength === 6) return readInt48LE(viewOf(this), offset)\n    if (byteLength === 5) return readInt40LE(viewOf(this), offset)\n    if (byteLength === 3) return readInt24LE(viewOf(this), offset)\n    if (byteLength === 4) return this.readInt32LE(offset)\n    if (byteLength === 2) return this.readInt16LE(offset)\n    if (byteLength === 1) return this.readInt8(offset)\n    throw new RangeError(`Byte length must be between 1 and 6`)\n  }\n\n  readUint8(offset = 0) {\n    return viewOf(this).getUint8(offset)\n  }\n\n  readUint16BE(offset = 0) {\n    return viewOf(this).getUint16(offset, false)\n  }\n  readUint16LE(offset = 0) {\n    return viewOf(this).getUint16(offset, true)\n  }\n\n  readUint32BE(offset = 0) {\n    return viewOf(this).getUint32(offset, false)\n  }\n  readUint32LE(offset = 0) {\n    return viewOf(this).getUint32(offset, true)\n  }\n\n  readUintBE(offset, byteLength) {\n    if (byteLength === 6) return readUint48BE(viewOf(this), offset)\n    if (byteLength === 5) return readUint40BE(viewOf(this), offset)\n    if (byteLength === 3) return readUint24BE(viewOf(this), offset)\n    if (byteLength === 4) return this.readUint32BE(offset)\n    if (byteLength === 2) return this.readUint16BE(offset)\n    if (byteLength === 1) return this.readUint8(offset)\n    throw new RangeError(`Byte length must be between 1 and 6`)\n  }\n\n  readUintLE(offset, byteLength) {\n    if (byteLength === 6) return readUint48LE(viewOf(this), offset)\n    if (byteLength === 5) return readUint40LE(viewOf(this), offset)\n    if (byteLength === 3) return readUint24LE(viewOf(this), offset)\n    if (byteLength === 4) return this.readUint32LE(offset)\n    if (byteLength === 2) return this.readUint16LE(offset)\n    if (byteLength === 1) return this.readUint8(offset)\n    throw new RangeError(`Byte length must be between 1 and 6`)\n  }\n\n  readBigUInt64BE(...args) {\n    return this.readBigUint64BE(...args)\n  }\n  readBigUInt64LE(...args) {\n    return this.readBigUint64LE(...args)\n  }\n\n  readUInt8(...args) {\n    return this.readUint8(...args)\n  }\n\n  readUInt16BE(...args) {\n    return this.readUint16BE(...args)\n  }\n  readUInt16LE(...args) {\n    return this.readUint16LE(...args)\n  }\n\n  readUInt32BE(...args) {\n    return this.readUint32BE(...args)\n  }\n  readUInt32LE(...args) {\n    return this.readUint32LE(...args)\n  }\n\n  readUIntBE(...args) {\n    return this.readUintBE(...args)\n  }\n  readUIntLE(...args) {\n    return this.readUintLE(...args)\n  }\n\n  writeBigInt64BE(value, offset = 0) {\n    viewOf(this).setBigInt64(offset, value, false)\n    return offset + 8\n  }\n  writeBigInt64LE(value, offset = 0) {\n    viewOf(this).setBigInt64(offset, value, true)\n    return offset + 8\n  }\n\n  writeBigUint64BE(value, offset = 0) {\n    viewOf(this).setBigUint64(offset, value, false)\n    return offset + 8\n  }\n  writeBigUint64LE(value, offset = 0) {\n    viewOf(this).setBigUint64(offset, value, true)\n    return offset + 8\n  }\n\n  writeDoubleBE(value, offset = 0) {\n    viewOf(this).setFloat64(offset, value, false)\n    return offset + 8\n  }\n  writeDoubleLE(value, offset = 0) {\n    viewOf(this).setFloat64(offset, value, true)\n    return offset + 8\n  }\n\n  writeFloatBE(value, offset = 0) {\n    viewOf(this).setFloat32(offset, value, false)\n    return offset + 4\n  }\n  writeFloatLE(value, offset = 0) {\n    viewOf(this).setFloat32(offset, value, true)\n    return offset + 4\n  }\n\n  writeInt8(value, offset = 0) {\n    viewOf(this).setInt8(offset, value)\n    return offset + 1\n  }\n\n  writeInt16BE(value, offset = 0) {\n    viewOf(this).setInt16(offset, value, false)\n    return offset + 2\n  }\n  writeInt16LE(value, offset = 0) {\n    viewOf(this).setInt16(offset, value, true)\n    return offset + 2\n  }\n\n  writeInt32BE(value, offset = 0) {\n    viewOf(this).setInt32(offset, value, false)\n    return offset + 4\n  }\n  writeInt32LE(value, offset = 0) {\n    viewOf(this).setInt32(offset, value, true)\n    return offset + 4\n  }\n\n  writeIntBE(value, offset, byteLength) {\n    if (byteLength === 6) return writeInt48BE(value, viewOf(this), offset)\n    if (byteLength === 5) return writeInt40BE(value, viewOf(this), offset)\n    if (byteLength === 3) return writeInt24BE(value, viewOf(this), offset)\n    if (byteLength === 4) return this.writeInt32BE(value, offset)\n    if (byteLength === 2) return this.writeInt16BE(value, offset)\n    if (byteLength === 1) return this.writeInt8(value, offset)\n    throw new RangeError(`Byte length must be between 1 and 6`)\n  }\n\n  writeIntLE(value, offset, byteLength) {\n    if (byteLength === 6) return writeInt48LE(value, viewOf(this), offset)\n    if (byteLength === 5) return writeInt40LE(value, viewOf(this), offset)\n    if (byteLength === 3) return writeInt24LE(value, viewOf(this), offset)\n    if (byteLength === 4) return this.writeInt32LE(value, offset)\n    if (byteLength === 2) return this.writeInt16LE(value, offset)\n    if (byteLength === 1) return this.writeInt8(value, offset)\n    throw new RangeError(`Byte length must be between 1 and 6`)\n  }\n\n  writeUint8(value, offset = 0) {\n    viewOf(this).setUint8(offset, value, true)\n    return offset + 1\n  }\n\n  writeUint16BE(value, offset = 0) {\n    viewOf(this).setUint16(offset, value, false)\n    return offset + 2\n  }\n  writeUint16LE(value, offset = 0) {\n    viewOf(this).setUint16(offset, value, true)\n    return offset + 2\n  }\n\n  writeUint32LE(value, offset = 0) {\n    viewOf(this).setUint32(offset, value, true)\n    return offset + 4\n  }\n  writeUint32BE(value, offset = 0) {\n    viewOf(this).setUint32(offset, value, false)\n    return offset + 4\n  }\n\n  writeUintBE(value, offset, byteLength) {\n    if (byteLength === 6) return writeUint48BE(value, viewOf(this), offset)\n    if (byteLength === 5) return writeUint40BE(value, viewOf(this), offset)\n    if (byteLength === 3) return writeUint24BE(value, viewOf(this), offset)\n    if (byteLength === 4) return this.writeUint32BE(value, offset)\n    if (byteLength === 2) return this.writeUint16BE(value, offset)\n    if (byteLength === 1) return this.writeUint8(value, offset)\n    throw new RangeError(`Byte length must be between 1 and 6`)\n  }\n\n  writeUintLE(value, offset, byteLength) {\n    if (byteLength === 6) return writeUint48LE(value, viewOf(this), offset)\n    if (byteLength === 5) return writeUint40LE(value, viewOf(this), offset)\n    if (byteLength === 3) return writeUint24LE(value, viewOf(this), offset)\n    if (byteLength === 4) return this.writeUint32LE(value, offset)\n    if (byteLength === 2) return this.writeUint16LE(value, offset)\n    if (byteLength === 1) return this.writeUint8(value, offset)\n    throw new RangeError(`Byte length must be between 1 and 6`)\n  }\n\n  writeBigUInt64BE(...args) {\n    return this.writeBigUint64BE(...args)\n  }\n  writeBigUInt64LE(...args) {\n    return this.writeBigUint64LE(...args)\n  }\n\n  writeUInt8(...args) {\n    return this.writeUint8(...args)\n  }\n\n  writeUInt16BE(...args) {\n    return this.writeUint16BE(...args)\n  }\n  writeUInt16LE(...args) {\n    return this.writeUint16LE(...args)\n  }\n\n  writeUInt32BE(...args) {\n    return this.writeUint32BE(...args)\n  }\n  writeUInt32LE(...args) {\n    return this.writeUint32LE(...args)\n  }\n\n  writeUIntBE(...args) {\n    return this.writeUintBE(...args)\n  }\n  writeUIntLE(...args) {\n    return this.writeUintLE(...args)\n  }\n}\n\nconst Buffer = exports\n\nexports.Buffer = Buffer // For Node.js compatibility\n\nexports.constants = constants\n\nconst codecs = Object.create(null)\n\ncodecs.ascii = ascii\ncodecs.base64 = base64\ncodecs.base64url = base64url\ncodecs.hex = hex\ncodecs.utf8 = codecs['utf-8'] = utf8\ncodecs.utf16le = codecs.ucs2 = codecs['utf-16le'] = codecs['ucs-2'] = utf16le\ncodecs.latin1 = codecs.binary = latin1\n\nfunction codecFor(encoding = 'utf8') {\n  if (encoding in codecs) return codecs[encoding]\n\n  encoding = encoding.toLowerCase()\n\n  if (encoding in codecs) return codecs[encoding]\n\n  throw new Error(`Unknown encoding '${encoding}'`)\n}\n\nconst views = new WeakMap()\n\nfunction viewOf(buffer) {\n  let view = views.get(buffer)\n  if (view === undefined) {\n    view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n    views.set(buffer, view)\n  }\n  return view\n}\n\nexports.isBuffer = function isBuffer(value) {\n  if (value instanceof Buffer) return true\n\n  return typeof value === 'object' && value !== null && value[kind] === Buffer[kind]\n}\n\nexports.isEncoding = function isEncoding(encoding) {\n  try {\n    codecFor(encoding)\n    return true\n  } catch {\n    return false\n  }\n}\n\nexports.alloc = function alloc(size, fill, encoding) {\n  const buffer = new Buffer(size)\n  if (fill !== undefined) buffer.fill(fill, 0, buffer.byteLength, encoding)\n  return buffer\n}\n\nexports.allocUnsafe = function allocUnsafe(size) {\n  return new Buffer(size, { uninitialized: true })\n}\n\nexports.allocUnsafeSlow = function allocUnsafeSlow(size) {\n  return exports.allocUnsafe(size)\n}\n\nexports.byteLength = function byteLength(string, encoding) {\n  if (typeof string === 'string') {\n    return codecFor(encoding).byteLength(string)\n  }\n\n  return string.byteLength\n}\n\nexports.compare = function compare(a, b) {\n  return binding.compare(a.buffer, a.byteOffset, a.byteLength, b.buffer, b.byteOffset, b.byteLength)\n}\n\nexports.concat = function concat(buffers, length) {\n  if (length === undefined) {\n    length = buffers.reduce((length, buffer) => length + buffer.byteLength, 0)\n  }\n\n  const result = new Buffer(length)\n\n  for (let i = 0, n = buffers.length, offset = 0; i < n; i++) {\n    const buffer = buffers[i]\n\n    if (offset + buffer.byteLength > result.byteLength) {\n      result.set(buffer.subarray(0, result.byteLength - offset), offset)\n      return result\n    }\n\n    result.set(buffer, offset)\n    offset += buffer.byteLength\n  }\n\n  return result\n}\n\nexports.coerce = function coerce(buffer) {\n  if (exports.isBuffer(buffer)) return buffer\n  return new Buffer(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nexports.from = function from(value, encodingOrOffset, length) {\n  // from(string, encoding)\n  if (typeof value === 'string') return fromString(value, encodingOrOffset)\n\n  // from(array)\n  if (Array.isArray(value)) return fromArray(value)\n\n  // from(buffer)\n  if (ArrayBuffer.isView(value)) return fromBuffer(value)\n\n  // from(arrayBuffer[, offset[, length]])\n  return fromArrayBuffer(value, encodingOrOffset, length)\n}\n\nfunction fromString(string, encoding) {\n  const codec = codecFor(encoding)\n  const buffer = new Buffer(codec.byteLength(string))\n  codec.write(buffer, string)\n  return buffer\n}\n\nfunction fromArray(array) {\n  const buffer = new Buffer(array.length)\n  buffer.set(array)\n  return buffer\n}\n\nfunction fromBuffer(buffer) {\n  const copy = new Buffer(buffer.byteLength)\n  copy.set(buffer)\n  return copy\n}\n\nfunction fromArrayBuffer(arrayBuffer, offset, length) {\n  return new Buffer(arrayBuffer, offset, length)\n}\n\nfunction bidirectionalIndexOf(buffer, value, offset, encoding, first) {\n  if (buffer.byteLength === 0) return -1\n\n  if (typeof offset === 'string') {\n    encoding = offset\n    offset = 0\n  } else if (offset === undefined) {\n    offset = first ? 0 : buffer.byteLength - 1\n  } else if (offset < 0) {\n    offset += buffer.byteLength\n  }\n\n  if (offset >= buffer.byteLength) {\n    if (first) return -1\n    else offset = buffer.byteLength - 1\n  } else if (offset < 0) {\n    if (first) offset = 0\n    else return -1\n  }\n\n  if (typeof value === 'string') value = exports.from(value, encoding)\n\n  if (value.byteLength === 0) return -1\n\n  if (first) {\n    let foundIndex = -1\n\n    for (let i = offset; i < buffer.byteLength; i++) {\n      if (buffer[i] === value[foundIndex === -1 ? 0 : i - foundIndex]) {\n        if (foundIndex === -1) foundIndex = i\n        if (i - foundIndex + 1 === value.byteLength) return foundIndex\n      } else {\n        if (foundIndex !== -1) i -= i - foundIndex\n        foundIndex = -1\n      }\n    }\n  } else {\n    if (offset + value.byteLength > buffer.byteLength) {\n      offset = buffer.byteLength - value.byteLength\n    }\n\n    for (let i = offset; i >= 0; i--) {\n      let found = true\n\n      for (let j = 0; j < value.byteLength; j++) {\n        if (buffer[i + j] !== value[j]) {\n          found = false\n          break\n        }\n      }\n\n      if (found) return i\n    }\n  }\n\n  return -1\n}\n\nfunction swap(buffer, n, m) {\n  const i = buffer[n]\n  buffer[n] = buffer[m]\n  buffer[m] = i\n}\n\nexports.atob = function atob(data) {\n  return Buffer.from(data, 'base64').toString('latin1')\n}\n\nexports.btoa = function btoa(data) {\n  if (typeof data !== 'string') data = String(data)\n\n  return Buffer.from(data, 'latin1').toString('base64')\n}\n\nfunction readInt48BE(view, offset) {\n  const hi = view.getUint16(offset, false)\n  const lo = view.getUint32(offset + 2, false)\n  let value = lo + hi * 0x100000000\n  if (hi & 0x8000) value -= 0x1000000000000\n  return value\n}\n\nfunction readInt48LE(view, offset) {\n  const lo = view.getUint32(offset, true)\n  const hi = view.getUint16(offset + 4, true)\n  let value = lo + hi * 0x100000000\n  if (hi & 0x8000) value -= 0x1000000000000\n  return value\n}\n\nfunction readInt40BE(view, offset) {\n  const hi = view.getUint8(offset)\n  const lo = view.getUint32(offset + 1, false)\n  let value = lo + hi * 0x100000000\n  if (hi & 0x80) value -= 0x10000000000\n  return value\n}\n\nfunction readInt40LE(view, offset) {\n  const lo = view.getUint32(offset, true)\n  const hi = view.getUint8(offset + 4)\n  let value = lo + hi * 0x100000000\n  if (hi & 0x80) value -= 0x10000000000\n  return value\n}\n\nfunction readInt24BE(view, offset) {\n  const value =\n    (view.getUint8(offset) << 16) | (view.getUint8(offset + 1) << 8) | view.getUint8(offset + 2)\n  return value & 0x800000 ? value - 0x1000000 : value\n}\n\nfunction readInt24LE(view, offset) {\n  const value =\n    view.getUint8(offset) | (view.getUint8(offset + 1) << 8) | (view.getUint8(offset + 2) << 16)\n  return value & 0x800000 ? value - 0x1000000 : value\n}\n\nfunction readUint48BE(view, offset) {\n  const hi = view.getUint16(offset, false)\n  const lo = view.getUint32(offset + 2, false)\n  return lo + hi * 0x100000000\n}\n\nfunction readUint48LE(view, offset) {\n  const lo = view.getUint32(offset, true)\n  const hi = view.getUint16(offset + 4, true)\n  return lo + hi * 0x100000000\n}\n\nfunction readUint40BE(view, offset) {\n  const hi = view.getUint8(offset)\n  const lo = view.getUint32(offset + 1, false)\n  return lo + hi * 0x100000000\n}\n\nfunction readUint40LE(view, offset) {\n  const lo = view.getUint32(offset, true)\n  const hi = view.getUint8(offset + 4)\n  return lo + hi * 0x100000000\n}\n\nfunction readUint24BE(view, offset) {\n  return (\n    (view.getUint8(offset) << 16) | (view.getUint8(offset + 1) << 8) | view.getUint8(offset + 2)\n  )\n}\n\nfunction readUint24LE(view, offset) {\n  return (\n    view.getUint8(offset) | (view.getUint8(offset + 1) << 8) | (view.getUint8(offset + 2) << 16)\n  )\n}\n\nfunction writeInt48BE(value, view, offset) {\n  if (value < 0) value += 0x1000000000000\n  const hi = Math.floor(value / 0x100000000)\n  const lo = value >>> 0\n  view.setUint16(offset, hi, false)\n  view.setUint32(offset + 2, lo, false)\n  return offset + 6\n}\n\nfunction writeInt48LE(value, view, offset) {\n  if (value < 0) value += 0x1000000000000\n  const hi = Math.floor(value / 0x100000000)\n  const lo = value >>> 0\n  view.setUint32(offset, lo, true)\n  view.setUint16(offset + 4, hi, true)\n  return offset + 6\n}\n\nfunction writeInt40BE(value, view, offset) {\n  if (value < 0) value += 0x10000000000\n  const hi = Math.floor(value / 0x100000000)\n  const lo = value >>> 0\n  view.setUint8(offset, hi)\n  view.setUint32(offset + 1, lo, false)\n  return offset + 5\n}\n\nfunction writeInt40LE(value, view, offset) {\n  if (value < 0) value += 0x10000000000\n  const hi = Math.floor(value / 0x100000000)\n  const lo = value >>> 0\n  view.setUint32(offset, lo, true)\n  view.setUint8(offset + 4, hi)\n  return offset + 5\n}\n\nfunction writeInt24BE(value, view, offset) {\n  if (value < 0) value += 0x1000000\n  view.setUint8(offset, (value >> 16) & 0xff)\n  view.setUint8(offset + 1, (value >> 8) & 0xff)\n  view.setUint8(offset + 2, value & 0xff)\n  return offset + 3\n}\n\nfunction writeInt24LE(value, view, offset) {\n  if (value < 0) value += 0x1000000\n  view.setUint8(offset, value & 0xff)\n  view.setUint8(offset + 1, (value >> 8) & 0xff)\n  view.setUint8(offset + 2, (value >> 16) & 0xff)\n  return offset + 3\n}\n\nfunction writeUint48BE(value, view, offset) {\n  const hi = Math.floor(value / 0x100000000)\n  const lo = value >>> 0\n  view.setUint16(offset, hi, false)\n  view.setUint32(offset + 2, lo, false)\n  return offset + 6\n}\n\nfunction writeUint48LE(value, view, offset) {\n  const hi = Math.floor(value / 0x100000000)\n  const lo = value >>> 0\n  view.setUint32(offset, lo, true)\n  view.setUint16(offset + 4, hi, true)\n  return offset + 6\n}\n\nfunction writeUint40BE(value, view, offset) {\n  const hi = Math.floor(value / 0x100000000)\n  const lo = value >>> 0\n  view.setUint8(offset, hi)\n  view.setUint32(offset + 1, lo, false)\n  return offset + 5\n}\n\nfunction writeUint40LE(value, view, offset) {\n  const hi = Math.floor(value / 0x100000000)\n  const lo = value >>> 0\n  view.setUint32(offset, lo, true)\n  view.setUint8(offset + 4, hi)\n  return offset + 5\n}\n\nfunction writeUint24BE(value, view, offset) {\n  view.setUint8(offset, (value >> 16) & 0xff)\n  view.setUint8(offset + 1, (value >> 8) & 0xff)\n  view.setUint8(offset + 2, value & 0xff)\n  return offset + 3\n}\n\nfunction writeUint24LE(value, view, offset) {\n  view.setUint8(offset, value & 0xff)\n  view.setUint8(offset + 1, (value >> 8) & 0xff)\n  view.setUint8(offset + 2, (value >> 16) & 0xff)\n  return offset + 3\n}\nexports.byteLength = function byteLength(string) {\n  return string.length\n}\n\nexports.toString = function toString(buffer) {\n  const len = buffer.byteLength\n\n  let result = ''\n\n  for (let i = 0; i < len; i++) {\n    result += String.fromCharCode(buffer[i])\n  }\n\n  return result\n}\n\nexports.write = function write(buffer, string) {\n  const len = buffer.byteLength\n\n  for (let i = 0; i < len; i++) {\n    buffer[i] = string.charCodeAt(i)\n  }\n\n  return len\n}\nconst binding = require('../binding')\n\nexports.byteLength = function byteLength(string) {\n  let len = string.length\n\n  if (string.charCodeAt(len - 1) === 0x3d) len--\n  if (len > 1 && string.charCodeAt(len - 1) === 0x3d) len--\n\n  return (len * 3) >>> 2\n}\n\nexports.toString = function toString(buffer) {\n  return binding.toStringBase64(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nexports.write = function write(buffer, string) {\n  return binding.writeBase64(buffer.buffer, buffer.byteOffset, buffer.byteLength, string)\n}\nconst binding = require('../binding')\n\nexports.byteLength = function byteLength(string) {\n  let len = string.length\n\n  if (string.charCodeAt(len - 1) === 0x3d) len--\n  if (len > 1 && string.charCodeAt(len - 1) === 0x3d) len--\n\n  return (len * 3) >>> 2\n}\n\nexports.toString = function toString(buffer) {\n  return binding.toStringBase64URL(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nexports.write = function write(buffer, string) {\n  return binding.writeBase64(buffer.buffer, buffer.byteOffset, buffer.byteLength, string)\n}\nconst binding = require('../binding')\n\nmodule.exports = binding.constants\nconst binding = require('../binding')\n\nexports.byteLength = function byteLength(string) {\n  return string.length >>> 1\n}\n\nexports.toString = function toString(buffer) {\n  return binding.toStringHex(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nexports.write = function write(buffer, string) {\n  return binding.writeHex(buffer.buffer, buffer.byteOffset, buffer.byteLength, string)\n}\nconst binding = require('../binding')\n\nexports.byteLength = function byteLength(string) {\n  return string.length\n}\n\nexports.toString = function toString(buffer) {\n  return binding.toStringLatin1(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nexports.write = function write(buffer, string) {\n  return binding.writeLatin1(buffer.buffer, buffer.byteOffset, buffer.byteLength, string)\n}\nconst binding = require('../binding')\n\nexports.byteLength = function byteLength(string) {\n  return string.length * 2\n}\n\nexports.toString = function toString(buffer) {\n  return binding.toStringUTF16LE(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nexports.write = function write(buffer, string) {\n  return binding.writeUTF16LE(buffer.buffer, buffer.byteOffset, buffer.byteLength, string)\n}\nconst binding = require('../binding')\n\nexports.byteLength = function byteLength(string) {\n  return binding.byteLengthUTF8(string)\n}\n\nexports.toString = function toString(buffer) {\n  return binding.toStringUTF8(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nexports.write = function write(buffer, string) {\n  return binding.writeUTF8(buffer.buffer, buffer.byteOffset, buffer.byteLength, string)\n}\n{\n  \"name\": \"bare-buffer\",\n  \"version\": \"3.4.2\",\n  \"description\": \"Native buffers for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./global\": {\n      \"types\": \"./global.d.ts\",\n      \"default\": \"./global.js\"\n    },\n    \"./constants\": {\n      \"types\": \"./lib/constants.d.ts\",\n      \"default\": \"./lib/constants.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"global.js\",\n    \"global.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-buffer.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-buffer/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-buffer#readme\",\n  \"engines\": {\n    \"bare\": \">=1.20.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.1\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"cmake-fetch\": \"^1.0.0\",\n    \"prettier\": \"^3.3.3\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst crypto = require('./web')\n\nglobal.crypto = crypto\nglobal.Crypto = crypto.Crypto\nglobal.CryptoKey = crypto.CryptoKey\nglobal.SubtleCrypto = crypto.SubtleCrypto\nconst constants = require('./lib/constants')\nconst Hash = require('./lib/hash')\nconst Hmac = require('./lib/hmac')\nconst { Cipheriv, Decipheriv } = require('./lib/cipher')\nconst { randomBytes, randomFill, randomUUID } = require('./lib/random')\nconst pbkdf2 = require('./lib/pbkdf2')\nconst { generateKeyPair } = require('./lib/key')\nconst { sign, verify } = require('./lib/signature')\n\nexports.constants = constants\n\nexports.Hash = Hash\n\nexports.createHash = function createHash(algorithm, opts) {\n  return new Hash(algorithm, opts)\n}\n\nexports.Hmac = Hmac\n\nexports.createHmac = function createHmac(algorithm, key, opts) {\n  return new Hmac(algorithm, key, opts)\n}\n\nexports.Cipheriv = Cipheriv\n\nexports.createCipheriv = function createCipheriv(algorithm, key, iv, opts) {\n  return new Cipheriv(algorithm, key, iv, opts)\n}\n\nexports.Decipheriv = Decipheriv\n\nexports.createDecipheriv = function createDecipheriv(algorithm, key, iv, opts) {\n  return new Decipheriv(algorithm, key, iv, opts)\n}\n\nexports.randomBytes = randomBytes\n\nexports.randomFill = randomFill\n\n// For Node.js compatibility\nexports.randomFillSync = function randomFillSync(buffer, offset, size) {\n  return exports.randomFill(buffer, offset, size)\n}\n\nexports.randomUUID = randomUUID\n\nexports.pbkdf2 = pbkdf2\n\n// For Node.js compatibility\nexports.pbkdf2Sync = function pbkdf2Sync(password, salt, iterations, keylen, digest) {\n  return exports.pbkdf2(password, salt, iterations, keylen, digest)\n}\n\nexports.generateKeyPair = generateKeyPair\n\nexports.sign = sign\n\nexports.verify = verify\n\n// For Node.js compatibility\nexports.webcrypto = require('./web')\nconst { Transform } = require('bare-stream')\nconst binding = require('../binding')\nconst constants = require('./constants')\n\nconst {\n  cipher: {\n    AES128ECB,\n    AES128CBC,\n    AES128CTR,\n    AES128OFB,\n    AES256ECB,\n    AES256CBC,\n    AES256CTR,\n    AES256OFB,\n    AES128GCM,\n    AES256GCM,\n    CHACHA20POLY1305,\n    XCHACHA20POLY1305\n  }\n} = constants\n\nclass CryptoCipher {\n  constructor(algorithm, key, iv, encrypt, opts = {}) {\n    const { encoding = 'utf8' } = opts\n\n    if (typeof key === 'string') key = Buffer.from(key, encoding)\n    if (typeof iv === 'string') iv = Buffer.from(iv, encoding)\n\n    if (key.byteLength !== binding.cipherKeyLength(algorithm)) {\n      throw new RangeError('Invalid key length')\n    }\n\n    if (iv.byteLength < binding.cipherIVLength(algorithm)) {\n      throw new RangeError('Invalid iv length')\n    }\n\n    this._handle = binding.cipherInit(\n      algorithm,\n      key.buffer,\n      key.byteOffset,\n      key.byteLength,\n      iv.buffer,\n      iv.byteOffset,\n      iv.byteLength,\n      encrypt\n    )\n  }\n\n  update(data, inputEncoding = 'utf8', outputEncoding) {\n    if (typeof data === 'string') data = Buffer.from(data, inputEncoding)\n\n    const out = new ArrayBuffer(binding.cipherBlockSize(this._handle))\n\n    const written = binding.cipherUpdate(\n      this._handle,\n      data.buffer,\n      data.byteOffset,\n      data.byteLength,\n      out\n    )\n\n    const result = Buffer.from(out, 0, written)\n\n    return outputEncoding ? result.toString(outputEncoding) : result\n  }\n\n  final(outputEncoding) {\n    const out = new ArrayBuffer(binding.cipherBlockSize(this._handle))\n\n    const written = binding.cipherFinal(this._handle, out)\n\n    const result = Buffer.from(out, 0, written)\n\n    return outputEncoding ? result.toString(outputEncoding) : result\n  }\n\n  setAutoPadding(pad) {\n    binding.cipherSetPadding(pad)\n  }\n}\n\nclass CryptoAuthenticatedCipher {\n  constructor(algorithm, key, nonce, opts = {}) {\n    const { encoding = 'utf8', authTagLength = 16 } = opts\n\n    if (typeof key === 'string') key = Buffer.from(key, encoding)\n    if (typeof nonce === 'string') nonce = Buffer.from(nonce, encoding)\n\n    if (key.byteLength !== binding.aeadKeyLength(algorithm)) {\n      throw new RangeError('Invalid key length')\n    }\n\n    if (nonce.byteLength < binding.aeadNonceLength(algorithm)) {\n      throw new RangeError('Invalid nonce length')\n    }\n\n    this._buffer = []\n    this._nonce = nonce\n    this._authTag = null\n    this._authTagLength = authTagLength\n    this._additionalData = null\n\n    this._handle = binding.aeadInit(\n      algorithm,\n      key.buffer,\n      key.byteOffset,\n      key.byteLength,\n      authTagLength\n    )\n  }\n\n  update(data, inputEncoding = 'utf8', outputEncoding) {\n    if (typeof data === 'string') data = Buffer.from(data, inputEncoding)\n\n    this._buffer.push(data)\n\n    return outputEncoding ? '' : Buffer.alloc(0)\n  }\n\n  setAAD(buffer, opts = {}) {\n    const { encoding = 'utf8' } = opts\n\n    if (typeof buffer === 'string') buffer = Buffer.from(buffer, encoding)\n\n    this._additionalData = buffer\n  }\n\n  getAuthTag() {\n    return this._authTag\n  }\n\n  setAuthTag(authTag, encoding) {\n    if (typeof authTag === 'string') authTag = Buffer.from(authTag, encoding)\n\n    this._authTag = authTag\n  }\n}\n\nclass CryptoAuthenticatedSeal extends CryptoAuthenticatedCipher {\n  final(outputEncoding) {\n    const data = this._buffer.length === 1 ? this._buffer[0] : Buffer.concat(this._buffer)\n\n    const nonce = this._nonce\n    const ad = this._additionalData || Buffer.alloc(0)\n\n    const out = new ArrayBuffer(data.byteLength + binding.aeadMaxOverhead(this._handle))\n\n    binding.aeadSeal(\n      this._handle,\n      data.buffer,\n      data.byteOffset,\n      data.byteLength,\n      nonce.buffer,\n      nonce.byteOffset,\n      nonce.byteLength,\n      ad.buffer,\n      ad.byteOffset,\n      ad.byteLength,\n      out\n    )\n\n    const written = out.byteLength - this._authTagLength\n\n    this._authTag = Buffer.from(out, written)\n\n    const result = Buffer.from(out, 0, written)\n\n    return outputEncoding ? result.toString(outputEncoding) : result\n  }\n}\n\nclass CryptoAuthenticatedOpen extends CryptoAuthenticatedCipher {\n  final(outputEncoding) {\n    this._buffer.push(this._authTag)\n\n    const data = Buffer.concat(this._buffer)\n\n    const nonce = this._nonce\n    const ad = this._additionalData || Buffer.alloc(0)\n\n    const out = new ArrayBuffer(data.byteLength)\n\n    binding.aeadOpen(\n      this._handle,\n      data.buffer,\n      data.byteOffset,\n      data.byteLength,\n      nonce.buffer,\n      nonce.byteOffset,\n      nonce.byteLength,\n      ad.buffer,\n      ad.byteOffset,\n      ad.byteLength,\n      out\n    )\n\n    const written = out.byteLength - this._authTagLength\n\n    const result = Buffer.from(out, 0, written)\n\n    return outputEncoding ? result.toString(outputEncoding) : result\n  }\n}\n\nexports.Cipheriv = class CryptoCipheriv extends Transform {\n  constructor(algorithm, key, iv, opts = {}) {\n    super(opts)\n\n    algorithm = constants.toCipher(algorithm)\n\n    switch (algorithm) {\n      case AES128ECB:\n      case AES128CBC:\n      case AES128CTR:\n      case AES128OFB:\n      case AES256ECB:\n      case AES256CBC:\n      case AES256CTR:\n      case AES256OFB:\n        this._cipher = new CryptoCipher(algorithm, key, iv, true, opts)\n        break\n\n      case AES128GCM:\n      case AES256GCM:\n      case CHACHA20POLY1305:\n      case XCHACHA20POLY1305:\n        this._cipher = new CryptoAuthenticatedSeal(algorithm, key, iv, opts)\n        break\n    }\n  }\n\n  update(data, inputEncoding, outputEncoding) {\n    return this._cipher.update(data, inputEncoding, outputEncoding)\n  }\n\n  final(outputEncoding) {\n    return this._cipher.final(outputEncoding)\n  }\n\n  setAutoPadding(pad) {\n    this._cipher.setAutoPadding(pad)\n\n    return this\n  }\n\n  setAAD(buffer, opts) {\n    this._cipher.setAAD(buffer, opts)\n\n    return this\n  }\n\n  getAuthTag() {\n    return this._cipher.getAuthTag()\n  }\n\n  _transform(data, encoding, cb) {\n    this.update(data)\n\n    cb(null)\n  }\n\n  _flush(cb) {\n    this.push(this.digest())\n\n    cb(null)\n  }\n}\n\nexports.Decipheriv = class CryptoDeipheriv extends Transform {\n  constructor(algorithm, key, iv, opts = {}) {\n    super(opts)\n\n    algorithm = constants.toCipher(algorithm)\n\n    switch (algorithm) {\n      case AES128ECB:\n      case AES128CBC:\n      case AES128CTR:\n      case AES128OFB:\n      case AES256ECB:\n      case AES256CBC:\n      case AES256CTR:\n      case AES256OFB:\n        this._cipher = new CryptoCipher(algorithm, key, iv, false, opts)\n        break\n\n      case AES128GCM:\n      case AES256GCM:\n      case CHACHA20POLY1305:\n      case XCHACHA20POLY1305:\n        this._cipher = new CryptoAuthenticatedOpen(algorithm, key, iv, opts)\n        break\n    }\n  }\n\n  update(data, inputEncoding, outputEncoding) {\n    return this._cipher.update(data, inputEncoding, outputEncoding)\n  }\n\n  final(outputEncoding) {\n    return this._cipher.final(outputEncoding)\n  }\n\n  setAutoPadding(pad) {\n    this._cipher.setAutoPadding(pad)\n\n    return this\n  }\n\n  setAAD(buffer, opts) {\n    this._cipher.setAAD(buffer, opts)\n\n    return this\n  }\n\n  setAuthTag(authTag, encoding) {\n    this._cipher.setAuthTag(authTag, encoding)\n\n    return this\n  }\n\n  _transform(data, encoding, cb) {\n    this.update(data)\n\n    cb(null)\n  }\n\n  _flush(cb) {\n    this.push(this.digest())\n\n    cb(null)\n  }\n}\nconst binding = require('../binding')\nconst errors = require('./errors')\n\nmodule.exports = exports = {\n  hash: {\n    MD5: binding.MD5,\n    SHA1: binding.SHA1,\n    SHA256: binding.SHA256,\n    SHA384: binding.SHA384,\n    SHA512: binding.SHA512,\n    BLAKE2B256: binding.BLAKE2B256,\n    RIPEMD160: binding.RIPEMD160\n  },\n  signature: {\n    ED25519: binding.ED25519\n  },\n  cipher: {\n    AES128ECB: binding.AES128ECB,\n    AES128CBC: binding.AES128CBC,\n    AES128CTR: binding.AES128CTR,\n    AES128OFB: binding.AES128OFB,\n    AES256ECB: binding.AES256ECB,\n    AES256CBC: binding.AES256CBC,\n    AES256CTR: binding.AES256CTR,\n    AES256OFB: binding.AES256OFB,\n    AES128GCM: binding.AES128GCM,\n    AES256GCM: binding.AES256GCM,\n    CHACHA20POLY1305: binding.CHACHA20POLY1305,\n    XCHACHA20POLY1305: binding.XCHACHA20POLY1305\n  },\n  keyType: {\n    ED25519: binding.ED25519\n  }\n}\n\nexports.toHash = function toHash(hash) {\n  if (typeof hash === 'number') return hash\n\n  if (typeof hash === 'string') {\n    hash = hash.replace(/-/g, '')\n\n    if (hash in exports.hash === false) {\n      hash = hash.toUpperCase()\n\n      if (hash in exports.hash === false) {\n        throw errors.UNKNOWN_HASH(`Unknown hash '${hash}'`)\n      }\n    }\n\n    return exports.hash[hash]\n  }\n\n  throw new TypeError(`Hash must be a number or string. Received ${typeof hash} (${hash})`)\n}\n\nexports.toCipher = function toCiper(cipher) {\n  if (typeof cipher === 'number') return cipher\n\n  if (typeof cipher === 'string') {\n    cipher = cipher.replace(/-/g, '')\n\n    if (cipher in exports.cipher === false) {\n      cipher = cipher.toUpperCase()\n\n      if (cipher in exports.cipher === false) {\n        throw errors.UNKNOWN_CIPHER(`Unknown cipher '${cipher}'`)\n      }\n    }\n\n    return exports.cipher[cipher]\n  }\n\n  throw new TypeError(`Cipher must be a number or string. Received ${typeof cipher} (${cipher})`)\n}\n\nexports.toKeyType = function toKeyType(type) {\n  if (typeof type === 'number') return type\n\n  if (typeof type === 'string') {\n    type = type.replace(/-/g, '')\n\n    if (type in exports.keyType === false) {\n      type = type.toUpperCase()\n\n      if (type in exports.keyType === false) {\n        throw errors.UNKNOWN_KEY_TYPE(`Unknown key type '${type}'`)\n      }\n    }\n\n    return exports.keyType[type]\n  }\n\n  throw new TypeError(`Key type must be a number or string. Received ${typeof type} (${type})`)\n}\nmodule.exports = class CryptoError extends Error {\n  constructor(msg, fn = CryptoError, code = fn.name) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'CryptoError'\n  }\n\n  static UNKNOWN_HASH(msg) {\n    return new CryptoError(msg, CryptoError.UNKNOWN_HASH)\n  }\n\n  static UNKNOWN_CIPHER(msg) {\n    return new CryptoError(msg, CryptoError.UNKNOWN_CIPHER)\n  }\n\n  static UNKNOWN_KEY_TYPE(msg) {\n    return new CryptoError(msg, CryptoError.UNKNOWN_KEY_TYPE)\n  }\n\n  static INVALID_ACCESS(msg) {\n    return new CryptoError(msg, CryptoError.INVALID_ACCESS)\n  }\n\n  static INVALID_DATA(msg) {\n    return new CryptoError(msg, CryptoError.INVALID_DATA)\n  }\n\n  static OPERATION_ERROR(msg) {\n    return new CryptoError(msg, CryptoError.OPERATION_ERROR)\n  }\n\n  static NOT_SUPPORTED(msg) {\n    return new CryptoError(msg, CryptoError.NOT_SUPPORTED)\n  }\n}\nconst { Transform } = require('bare-stream')\nconst binding = require('../binding')\nconst constants = require('./constants')\n\nconst {\n  hash: { RIPEMD160 }\n} = constants\n\nclass CryptoDigest {\n  constructor(algorithm) {\n    this._handle = binding.digestInit(algorithm)\n  }\n\n  update(data) {\n    binding.digestUpdate(this._handle, data.buffer, data.byteOffset, data.byteLength)\n  }\n\n  final() {\n    return Buffer.from(binding.digestFinal(this._handle))\n  }\n}\n\nclass CryptoRIPEMD160Digest {\n  constructor() {\n    this._handle = binding.ripemd160Init()\n  }\n\n  update(data) {\n    binding.ripemd160Update(this._handle, data.buffer, data.byteOffset, data.byteLength)\n  }\n\n  final() {\n    return Buffer.from(binding.ripemd160Final(this._handle))\n  }\n}\n\nmodule.exports = class CryptoHash extends Transform {\n  constructor(algorithm, opts = {}) {\n    super(opts)\n\n    algorithm = constants.toHash(algorithm)\n\n    switch (algorithm) {\n      case RIPEMD160:\n        this._digest = new CryptoRIPEMD160Digest()\n        break\n\n      default:\n        this._digest = new CryptoDigest(algorithm)\n        break\n    }\n  }\n\n  update(data, encoding = 'utf8') {\n    if (typeof data === 'string') data = Buffer.from(data, encoding)\n\n    this._digest.update(data)\n\n    return this\n  }\n\n  digest(encoding) {\n    const digest = this._digest.final()\n\n    return encoding && encoding !== 'buffer' ? digest.toString(encoding) : digest\n  }\n\n  _transform(data, encoding, cb) {\n    this.update(data)\n\n    cb(null)\n  }\n\n  _flush(cb) {\n    this.push(this.digest())\n\n    cb(null)\n  }\n}\nconst { Transform } = require('bare-stream')\nconst binding = require('../binding')\nconst constants = require('./constants')\n\nmodule.exports = class CryptoHmac extends Transform {\n  constructor(algorithm, key, opts = {}) {\n    super(opts)\n\n    const { encoding = 'utf8' } = opts\n\n    if (typeof key === 'string') key = Buffer.from(key, encoding)\n\n    this._handle = binding.hmacInit(\n      constants.toHash(algorithm),\n      key.buffer,\n      key.byteOffset,\n      key.byteLength\n    )\n  }\n\n  update(data, encoding = 'utf8') {\n    if (typeof data === 'string') data = Buffer.from(data, encoding)\n\n    binding.hmacUpdate(this._handle, data.buffer, data.byteOffset, data.byteLength)\n\n    return this\n  }\n\n  digest(encoding) {\n    const digest = Buffer.from(binding.hmacFinal(this._handle))\n\n    return encoding && encoding !== 'buffer' ? digest.toString(encoding) : digest\n  }\n\n  _transform(data, encoding, cb) {\n    this.update(data)\n\n    cb(null)\n  }\n\n  _flush(cb) {\n    this.push(this.digest())\n\n    cb(null)\n  }\n}\nconst binding = require('../binding')\nconst constants = require('./constants')\n\nconst {\n  keyType: { ED25519 }\n} = constants\n\nclass CryptoKey {\n  constructor(keyType) {\n    this._keyType = keyType\n  }\n}\n\nexports.Key = CryptoKey\n\nclass CryptoEd25519Key extends CryptoKey {\n  constructor(key) {\n    super(ED25519)\n\n    this._key = key\n  }\n\n  get asymmetricKeyType() {\n    return 'ed25519'\n  }\n}\n\nclass CryptoEd25519PublicKey extends CryptoEd25519Key {\n  get type() {\n    return 'public'\n  }\n}\n\nexports.Ed25519PublicKey = CryptoEd25519PublicKey\n\nclass CryptoEd25519PrivateKey extends CryptoEd25519Key {\n  get type() {\n    return 'private'\n  }\n}\n\nexports.Ed25519PrivateKey = CryptoEd25519PrivateKey\n\nexports.generateKeyPair = function generateKeyPair(type, opts = {}) {\n  type = constants.toKeyType(type)\n\n  switch (type) {\n    case ED25519: {\n      const { publicKey, privateKey } = binding.ed25519GenerateKeypair()\n\n      return {\n        publicKey: new CryptoEd25519PublicKey(publicKey),\n        privateKey: new CryptoEd25519PrivateKey(privateKey)\n      }\n    }\n  }\n}\nconst binding = require('../binding')\nconst constants = require('./constants')\n\nmodule.exports = function pbkdf2(password, salt, iterations, keylen, digest, cb) {\n  if (iterations <= 0) {\n    throw new RangeError('iterations is out of range')\n  }\n\n  if (typeof password === 'string') password = Buffer.from(password)\n  if (typeof salt === 'string') salt = Buffer.from(salt)\n\n  const buffer = Buffer.from(\n    binding.pbkdf2(\n      password.buffer,\n      password.byteOffset,\n      password.byteLength,\n      salt.buffer,\n      salt.byteOffset,\n      salt.byteLength,\n      iterations,\n      constants.toHash(digest),\n      keylen\n    )\n  )\n\n  if (cb) queueMicrotask(() => cb(null, buffer))\n  else return buffer\n}\nconst binding = require('../binding')\n\nexports.randomBytes = function randomBytes(size, cb) {\n  const buffer = Buffer.allocUnsafe(size)\n  exports.randomFill(buffer)\n  if (cb) queueMicrotask(() => cb(null, buffer))\n  else return buffer\n}\n\nexports.randomFill = function randomFill(buffer, offset, size, cb) {\n  if (typeof offset === 'function') {\n    cb = offset\n    offset = undefined\n  } else if (typeof size === 'function') {\n    cb = size\n    size = undefined\n  }\n\n  const elementSize = buffer.BYTES_PER_ELEMENT || 1\n\n  if (offset === undefined) offset = 0\n  else offset *= elementSize\n\n  if (size === undefined) size = buffer.byteLength - offset\n  else size *= elementSize\n\n  if (offset < 0 || offset > buffer.byteLength) {\n    throw new RangeError('offset is out of range')\n  }\n\n  if (size < 0 || size > buffer.byteLength) {\n    throw new RangeError('size is out of range')\n  }\n\n  if (offset + size > buffer.byteLength) {\n    throw new RangeError('offset + size is out of range')\n  }\n\n  let arraybuffer\n\n  if (ArrayBuffer.isView(buffer)) {\n    offset += buffer.byteOffset\n    arraybuffer = buffer.buffer\n  } else {\n    arraybuffer = buffer\n  }\n\n  binding.randomFill(arraybuffer, offset, size)\n\n  if (cb) queueMicrotask(() => cb(null, buffer))\n  else return buffer\n}\n\nexports.randomUUID = function randomUUID() {\n  const uuid = exports.randomBytes(16)\n\n  uuid[6] = (uuid[6] >>> 4) | 0b01000000\n  uuid[8] = (uuid[8] >>> 2) | 0b10000000\n\n  return (\n    uuid.subarray(0, 4).toString('hex') +\n    '-' +\n    uuid.subarray(4, 6).toString('hex') +\n    '-' +\n    uuid.subarray(6, 8).toString('hex') +\n    '-' +\n    uuid.subarray(8, 10).toString('hex') +\n    '-' +\n    uuid.subarray(10, 16).toString('hex')\n  )\n}\nconst binding = require('../binding')\nconst constants = require('./constants')\n\nconst {\n  keyType: { ED25519 }\n} = constants\n\nexports.sign = function sign(algorithm, data, key) {\n  if (ArrayBuffer.isView(data)) {\n    data = Buffer.coerce(data)\n  } else {\n    data = Buffer.from(data)\n  }\n\n  switch (key._keyType) {\n    case ED25519:\n      return Buffer.from(\n        binding.ed25519Sign(data.buffer, data.byteOffset, data.byteLength, key._key)\n      )\n  }\n}\n\nexports.verify = function verify(algorithm, data, key, signature) {\n  if (ArrayBuffer.isView(data)) {\n    data = Buffer.coerce(data)\n  } else {\n    data = Buffer.from(data)\n  }\n\n  if (ArrayBuffer.isView(signature)) {\n    signature = Buffer.coerce(signature)\n  } else {\n    signature = Buffer.from(signature)\n  }\n\n  switch (key._keyType) {\n    case ED25519:\n      return binding.ed25519Verify(\n        data.buffer,\n        data.byteOffset,\n        data.byteLength,\n        signature.buffer,\n        signature.byteOffset,\n        key._key\n      )\n  }\n}\nconst crypto = require('../../..')\nconst binding = require('../../../binding')\nconst errors = require('../../errors')\nconst { Ed25519PublicKey, Ed25519PrivateKey } = require('../../key')\nconst CryptoKey = require('../crypto-key')\n\n// https://w3c.github.io/webcrypto/#ed25519\n\n// https://w3c.github.io/webcrypto/#ed25519-operations-sign\nexports.sign = function sign(algorithm, key, data) {\n  if (key.type !== 'private') {\n    throw errors.INVALID_ACCESS('Must pass private key for Ed25519 signing')\n  }\n\n  const signature = crypto.sign(null, data, key._handle)\n\n  return signature.buffer.slice(0, signature.byteLength)\n}\n\n// https://w3c.github.io/webcrypto/#ed25519-operations-verify\nexports.verify = function verify(algorithm, key, signature, data) {\n  if (key.type !== 'public') {\n    throw errors.INVALID_ACCESS('Must pass public key for Ed25519 verification')\n  }\n\n  return crypto.verify(null, data, key._handle, signature)\n}\n\n// https://w3c.github.io/webcrypto/#ed25519-operations-generate-key\nexports.generateKey = function generateKey(algorithm, extractable, usages) {\n  for (const usage of usages) {\n    if (usage !== 'sign' && usage !== 'verify') {\n      throw new SyntaxError(\n        `Usage '${usage}' cannot be used for the Ed25519 generateKey() operation`\n      )\n    }\n  }\n\n  const keys = crypto.generateKeyPair('ed25519')\n\n  algorithm = { name: 'Ed25519' }\n\n  return {\n    publicKey: new CryptoKey('public', true, algorithm, ['verify'], keys.publicKey),\n    privateKey: new CryptoKey('private', extractable, algorithm, ['sign'], keys.privateKey)\n  }\n}\n\n// https://w3c.github.io/webcrypto/#ed25519-operations-import-key\nexports.importKey = function importKey(format, keyData, algorithm, extractable, usages) {\n  switch (format) {\n    case 'spki':\n      for (const usage of usages) {\n        if (usage !== 'verify') {\n          throw new SyntaxError(\n            `Usage '${usage}' cannot be used for the Ed25519 importKey() operation`\n          )\n        }\n      }\n\n      keyData = binding.ed25519FromSPKI(keyData.buffer, keyData.byteOffset, keyData.byteLength)\n\n      return new CryptoKey(\n        'public',\n        extractable,\n        {\n          name: 'Ed25519'\n        },\n        usages,\n        new Ed25519PublicKey(keyData)\n      )\n    case 'pkcs8':\n      for (const usage of usages) {\n        if (usage !== 'sign') {\n          throw new SyntaxError(\n            `Usage '${usage}' cannot be used for the Ed25519 importKey() operation`\n          )\n        }\n      }\n\n      keyData = binding.ed25519FromPKCS8(keyData.buffer, keyData.byteOffset, keyData.byteLength)\n\n      return new CryptoKey(\n        'private',\n        extractable,\n        {\n          name: 'Ed25519'\n        },\n        usages,\n        new Ed25519PrivateKey(keyData)\n      )\n    case 'raw':\n      for (const usage of usages) {\n        if (usage !== 'verify') {\n          throw new SyntaxError(\n            `Usage '${usage}' cannot be used for the Ed25519 importKey() operation`\n          )\n        }\n      }\n\n      if (keyData.byteLength * 8 !== 256) {\n        throw errors.INVALID_DATA('Key must be 256 bits')\n      }\n\n      return new CryptoKey(\n        'public',\n        extractable,\n        {\n          name: 'Ed25519'\n        },\n        usages,\n        new Ed25519PublicKey(keyData.buffer)\n      )\n    case 'jwk':\n      const jwk = keyData\n\n      if ('d' in jwk) {\n        if (usages.some((usage) => usage !== 'sign')) {\n          throw new SyntaxError('JWK must be valid for signing')\n        }\n      } else {\n        if (usages.some((usage) => usage !== 'verify')) {\n          throw new SyntaxError('JWK must be valid for verification')\n        }\n      }\n\n      if (jwk.kty !== 'OKP') {\n        throw errors.INVALID_DATA('JWK key must be an octet key-pair')\n      }\n\n      if (jwk.crv !== 'Ed25519') {\n        throw errors.INVALID_DATA('JWK must use the Ed25519 curve')\n      }\n\n      if ('alg' in jwk && jwk.alg !== 'Ed25519' && jwk.alg !== 'EdDSA') {\n        throw errors.INVALID_DATA('JWK must use the Ed25519 curve')\n      }\n\n      if (usages.length && 'use' in jwk && jwk.use !== 'sig') {\n        throw errors.INVALID_DATA('JWK cannot be used for signatures')\n      }\n\n      if ('ext' in jwk && jwk.ext !== extractable && extractable) {\n        throw errors.INVALID_DATA('JWK is not extractable')\n      }\n\n      if ('d' in jwk) {\n        const key = Buffer.concat([\n          Buffer.from(jwk.d, 'base64url'),\n          Buffer.from(jwk.x, 'base64url')\n        ])\n\n        if (key.byteLength * 8 !== 512) {\n          throw errors.INVALID_DATA('Key must be 512 bits')\n        }\n\n        return new CryptoKey(\n          'private',\n          extractable,\n          {\n            name: 'Ed25519'\n          },\n          usages,\n          new Ed25519PrivateKey(key.buffer)\n        )\n      }\n\n      const key = Buffer.from(jwk.x, 'base64url')\n\n      if (key.byteLength * 8 !== 256) {\n        throw errors.INVALID_DATA('Key must be 256 bits')\n      }\n\n      return new CryptoKey(\n        'public',\n        extractable,\n        {\n          name: 'Ed25519'\n        },\n        usages,\n        new Ed25519PublicKey(key.buffer)\n      )\n    default:\n      throw errors.NOT_SUPPORTED(\n        `Format '${format}' cannot be used for the Ed25519 importKey() operation`\n      )\n  }\n}\n\n// https://w3c.github.io/webcrypto/#ed25519-operations-export-key\nexports.exportKey = function exportKey(format, key) {\n  const data = key._handle\n\n  switch (format) {\n    case 'spki':\n      if (key.type !== 'public') {\n        throw errors.INVALID_ACCESS(\n          `Key of type '${key.type}' cannot be used for the Ed25519 exportKey() operation`\n        )\n      }\n\n      return binding.ed25519ToSPKI(data._key)\n    case 'pkcs8':\n      if (key.type !== 'private') {\n        throw errors.INVALID_ACCESS(\n          `Key of type '${key.type}' cannot be used for the Ed25519 exportKey() operation`\n        )\n      }\n\n      return binding.ed25519ToPKCS8(data._key)\n    case 'raw': {\n      if (key.type !== 'public') {\n        throw errors.INVALID_ACCESS(\n          `Key of type '${key.type}' cannot be used for the Ed25519 exportKey() operation`\n        )\n      }\n\n      return data._key.slice()\n    }\n    case 'jwk': {\n      const buffer = Buffer.from(data._key)\n\n      if (key.type === 'private') {\n        const d = buffer.subarray(0, 32).toString('base64url')\n        const x = buffer.subarray(32).toString('base64url')\n\n        return {\n          kty: 'OKP',\n          alg: 'Ed25519',\n          crv: 'Ed25519',\n          x,\n          d,\n          key_ops: key.usages,\n          ext: key.extractable\n        }\n      }\n\n      return {\n        kty: 'OKP',\n        alg: 'Ed25519',\n        crv: 'Ed25519',\n        x: buffer.toString('base64url'),\n        key_ops: key.usages,\n        ext: key.extractable\n      }\n    }\n    default:\n      throw errors.NOT_SUPPORTED(\n        `Format '${format}' cannot be used for the HMAC exportKey() operation`\n      )\n  }\n}\nconst crypto = require('../../..')\nconst errors = require('../../errors')\nconst CryptoKey = require('../crypto-key')\n\n// https://w3c.github.io/webcrypto/#hmac\n\n// https://w3c.github.io/webcrypto/#hmac-operations-sign\nexports.sign = function sign(algorithm, key, data) {\n  const digest = crypto.createHmac(key.algorithm.hash.name, key._handle).update(data).digest()\n\n  return digest.buffer.slice(0, digest.byteLength)\n}\n\n// https://w3c.github.io/webcrypto/#hmac-operations-verify\nexports.verify = function verify(algorithm, key, signature, data) {\n  const digest = crypto.createHmac(key.algorithm.hash.name, key._handle).update(data).digest()\n\n  if (ArrayBuffer.isView(signature)) {\n    signature = Buffer.coerce(signature)\n  } else {\n    signature = Buffer.from(signature)\n  }\n\n  return signature.equals(digest)\n}\n\n// https://w3c.github.io/webcrypto/#hmac-operations-generate-key\nexports.generateKey = function generateKey(algorithm, extractable, usages) {\n  for (const usage of usages) {\n    if (usage !== 'sign' && usage !== 'verify') {\n      throw new SyntaxError(`Usage '${usage}' cannot be used for the HMAC generateKey() operation`)\n    }\n  }\n\n  const { length = exports.getKeyLength(algorithm) } = algorithm.length\n\n  let hash = algorithm.hash\n\n  if (typeof hash === 'string') hash = { name: hash }\n\n  const key = crypto.createHmac(hash.name, crypto.randomBytes(length)).digest()\n\n  return new CryptoKey(\n    'secret',\n    extractable,\n    {\n      name: 'HMAC',\n      length,\n      hash: {\n        name: hash.name.toUpperCase()\n      }\n    },\n    usages,\n    key\n  )\n}\n\n// https://w3c.github.io/webcrypto/#hmac-operations-import-key\nexports.importKey = function importKey(format, keyData, algorithm, extractable, usages) {\n  for (const usage of usages) {\n    if (usage !== 'sign' && usage !== 'verify') {\n      throw new SyntaxError(`Invalid usage ${usage}`)\n    }\n  }\n\n  let hash = algorithm.hash\n\n  if (typeof hash === 'string') hash = { name: hash }\n\n  let data\n\n  switch (format) {\n    case 'raw':\n      data = keyData\n      break\n    case 'jwk':\n      const jwk = keyData\n\n      if (jwk.kty !== 'oct') {\n        throw errors.INVALID_DATA('JWK key must be an octet sequence')\n      }\n\n      data = Buffer.from(jwk.k, 'base64url')\n\n      switch (hash.name.toLowerCase()) {\n        case 'sha-1':\n          if (jwk.alg === 'HS1') break\n          else throw errors.INVALID_DATA('Invalid JWK key algorithm')\n        case 'sha-256':\n          if (jwk.alg === 'HS256') break\n          else throw errors.INVALID_DATA('Invalid JWK key algorithm')\n        case 'sha-384':\n          if (jwk.alg === 'HS384') break\n          else throw errors.INVALID_DATA('Invalid JWK key algorithm')\n        case 'sha-512':\n          if (jwk.alg === 'HS512') break\n          else throw errors.INVALID_DATA('Invalid JWK key algorithm')\n      }\n\n      if (usages.length && 'use' in jwk && jwk.use !== 'sign') {\n        throw errors.INVALID_DATA('JWK cannot be used for signing')\n      }\n\n      if ('ext' in jwk && jwk.ext !== extractable && extractable) {\n        throw errors.INVALID_DATA('JWK is not extractable')\n      }\n      break\n    default:\n      throw errors.NOT_SUPPORTED(\n        `Format '${format}' cannot be used for the HMAC importKey() operation`\n      )\n  }\n\n  const length = data.byteLength * 8\n\n  if (length === 0) {\n    throw errors.INVALID_DATA('Key cannot be empty')\n  }\n\n  return new CryptoKey(\n    'secret',\n    extractable,\n    {\n      name: 'HMAC',\n      length,\n      hash: {\n        name: hash.name.toUpperCase()\n      }\n    },\n    usages,\n    data\n  )\n}\n\n// https://w3c.github.io/webcrypto/#hmac-operations-export-key\nexports.exportKey = function exportKey(format, key) {\n  const data = key._handle\n\n  switch (format) {\n    case 'raw':\n      return data.buffer.slice(0, data.byteLength)\n    case 'jwk': {\n      const jwk = {\n        kty: 'oct',\n        k: data.toString('base64url'),\n        alg: null,\n        key_ops: key.usages,\n        ext: key.extractable\n      }\n\n      switch (key.algorithm.hash.name) {\n        case 'SHA-1':\n          jwk.alg = 'HS1'\n          break\n        case 'SHA-256':\n          jwk.alg = 'HS256'\n          break\n        case 'SHA-384':\n          jwk.alg = 'HS384'\n          break\n        case 'SHA-512':\n          jwk.alg = 'HS512'\n          break\n      }\n\n      return jwk\n    }\n    default:\n      throw errors.NOT_SUPPORTED(\n        `Format '${format}' cannot be used for the HMAC exportKey() operation`\n      )\n  }\n}\n\n// https://w3c.github.io/webcrypto/#hmac-operations-get-key-length\nexports.getKeyLength = function getKeyLength(algorithm) {\n  const { length, hash } = algorithm\n\n  if (length === undefined) {\n    if (hash === 'SHA-1' || hash === 'SHA-256') return 512\n    if (hash === 'SHA-512') return 1024\n\n    throw errors.OPERATION_ERROR(`Invalid hash '${hash}'`)\n  }\n\n  if (length === 0) {\n    throw errors.OPERATION_ERROR(`Invalid length ${length}`)\n  }\n\n  return length\n}\nconst crypto = require('../../..')\nconst errors = require('../../errors')\nconst CryptoKey = require('../crypto-key')\n\n// https://w3c.github.io/webcrypto/#pbkdf2\n\n// https://w3c.github.io/webcrypto/#pbkdf2-operations-derive-bits\nexports.deriveBits = function deriveBits(algorithm, key, length) {\n  if (length === undefined || length % 8) {\n    throw errors.OPERATION_ERROR('Length must be multiple of 8')\n  }\n\n  if (algorithm.iterations === 0) {\n    throw errors.OPERATION_ERROR('Iterations must be non-0')\n  }\n\n  if (length === 0) {\n    return new ArrayBuffer(0)\n  }\n\n  let hash = algorithm.hash\n\n  if (typeof hash === 'string') hash = { name: hash }\n\n  const result = crypto.pbkdf2(\n    key._handle,\n    algorithm.salt,\n    algorithm.iterations,\n    length / 8,\n    hash.name\n  )\n\n  return result.buffer\n}\n\n// https://w3c.github.io/webcrypto/#pbkdf2-operations-import-key\nexports.importKey = function importKey(format, keyData, algorithm, extractable, usages) {\n  if (format !== 'raw') {\n    throw errors.NOT_SUPPORTED(\n      `Format '${format}' cannot be used for the PBKDF2 importKey() operation`\n    )\n  }\n\n  for (const usage of usages) {\n    if (usage !== 'deriveKey' && usage !== 'deriveBits') {\n      throw new SyntaxError(`Invalid usage ${usage}`)\n    }\n  }\n\n  if (extractable) {\n    throw new SyntaxError('Extractable must be false')\n  }\n\n  return new CryptoKey(\n    'secret',\n    extractable,\n    {\n      name: 'PBKDF2'\n    },\n    usages,\n    keyData\n  )\n}\nconst crypto = require('../../..')\n\n// https://w3c.github.io/webcrypto/#sha\n\n// https://w3c.github.io/webcrypto/#sha-operations-digest\nexports.digest = function digest(name, data) {\n  const digest = crypto.createHash(name).update(data).digest()\n\n  return digest.buffer.slice(0, digest.byteLength)\n}\n// https://w3c.github.io/webcrypto/#cryptokey-interface\nmodule.exports = class CryptoKey {\n  constructor(type, extractable, algorithm, usages, handle = null) {\n    this._type = type\n    this._extractable = extractable\n    this._algorithm = algorithm\n    this._usages = usages\n    this._handle = handle\n  }\n\n  // https://w3c.github.io/webcrypto/#dom-cryptokey-type\n  get type() {\n    return this._type\n  }\n\n  // https://w3c.github.io/webcrypto/#dom-cryptokey-extractable\n  get extractable() {\n    return this._extractable\n  }\n\n  // https://w3c.github.io/webcrypto/#dom-cryptokey-algorithm\n  get algorithm() {\n    return this._algorithm\n  }\n\n  // https://w3c.github.io/webcrypto/#dom-cryptokey-usages\n  get usages() {\n    return this._usages\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: CryptoKey },\n\n      type: this.type,\n      extractable: this.extractable,\n      algorithm: this.algorithm,\n      usages: this.usages\n    }\n  }\n}\n{\n  \"name\": \"bare-crypto\",\n  \"version\": \"1.13.0\",\n  \"description\": \"Cryptographic primitives for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./web\": {\n      \"types\": \"./web.d.ts\",\n      \"default\": \"./web.js\"\n    },\n    \"./global\": {\n      \"types\": \"./global.d.ts\",\n      \"default\": \"./global.js\"\n    },\n    \"./constants\": \"./lib/constants.js\",\n    \"./errors\": \"./lib/errors.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"web.js\",\n    \"web.d.ts\",\n    \"global.js\",\n    \"global.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-crypto.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-crypto/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-crypto#readme\",\n  \"dependencies\": {\n    \"bare-stream\": \"^2.6.3\"\n  },\n  \"devDependencies\": {\n    \"bare-buffer\": \"^3.0.1\",\n    \"brittle\": \"^3.5.0\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"cmake-fetch\": \"^1.0.0\",\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  },\n  \"peerDependencies\": {\n    \"bare-buffer\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bare-buffer\": {\n      \"optional\": true\n    }\n  }\n}\nconst crypto = require('.')\nconst errors = require('./lib/errors')\nconst CryptoKey = require('./lib/web/crypto-key')\nconst hmac = require('./lib/web/algorithm/hmac')\nconst pbkdf2 = require('./lib/web/algorithm/pbkdf2')\nconst ed25519 = require('./lib/web/algorithm/ed25519')\nconst sha = require('./lib/web/algorithm/sha')\n\nexports.CryptoKey = CryptoKey\n\n// https://w3c.github.io/webcrypto/#Crypto-method-getRandomValues\nexports.getRandomValues = function getRandomValues(array) {\n  return crypto.randomFillSync(array)\n}\n\n// https://w3c.github.io/webcrypto/#dfn-Crypto-method-randomUUID\nexports.randomUUID = crypto.randomUUID\n\n// https://w3c.github.io/webcrypto/#subtlecrypto-interface\nexports.SubtleCrypto = class SubtleCrypto {\n  // https://w3c.github.io/webcrypto/#SubtleCrypto-method-generateKey\n  async generateKey(algorithm, extractable, usages) {\n    if (typeof algorithm === 'string') algorithm = { name: algorithm }\n\n    switch (algorithm.name.toLowerCase()) {\n      case 'hmac':\n        return hmac.generateKey(algorithm, extractable, usages)\n      case 'ed25519':\n        return ed25519.generateKey(algorithm, extractable, usages)\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${algorithm.name}' does not support the generateKey() operation`\n        )\n    }\n  }\n\n  // https://w3c.github.io/webcrypto/#SubtleCrypto-method-importKey\n  async importKey(format, keyData, algorithm, extractable, usages) {\n    if (typeof algorithm === 'string') algorithm = { name: algorithm }\n\n    switch (format) {\n      case 'raw':\n      case 'pkcs8':\n      case 'spki':\n        if (ArrayBuffer.isView(keyData)) {\n          keyData = Buffer.from(keyData)\n        } else {\n          keyData = Buffer.from(keyData.slice())\n        }\n        break\n    }\n\n    switch (algorithm.name.toLowerCase()) {\n      case 'hmac':\n        return hmac.importKey(format, keyData, algorithm, extractable, usages)\n      case 'ed25519':\n        return ed25519.importKey(format, keyData, algorithm, extractable, usages)\n      case 'pbkdf2':\n        return pbkdf2.importKey(format, keyData, algorithm, extractable, usages)\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${algorithm.name}' does not support the importKey() operation`\n        )\n    }\n  }\n\n  // https://w3c.github.io/webcrypto/#SubtleCrypto-method-exportKey\n  async exportKey(format, key) {\n    if (!key.extractable) {\n      throw errors.INVALID_ACCESS('Key is not extractable')\n    }\n\n    switch (key.algorithm.name.toLowerCase()) {\n      case 'hmac':\n        return hmac.exportKey(format, key)\n      case 'ed25519':\n        return ed25519.exportKey(format, key)\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${key.algorithm.name}' does not support the exportKey() operation`\n        )\n    }\n  }\n\n  // https://w3c.github.io/webcrypto/#SubtleCrypto-method-sign\n  async sign(algorithm, key, data) {\n    if (typeof algorithm === 'string') algorithm = { name: algorithm }\n\n    if (algorithm.name.toLowerCase() !== key.algorithm.name.toLowerCase()) {\n      throw errors.INVALID_ACCESS(`Algorithm '${algorithm.name}' does not match key'`)\n    }\n\n    if (!key.usages.includes('sign')) {\n      throw errors.INVALID_ACCESS('Key cannot be used for signing')\n    }\n\n    switch (algorithm.name.toLowerCase()) {\n      case 'hmac':\n        return hmac.sign(algorithm, key, data)\n      case 'ed25519':\n        return ed25519.sign(algorithm, key, data)\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${algorithm.name}' does not support the sign() operation`\n        )\n    }\n  }\n\n  // https://w3c.github.io/webcrypto/#SubtleCrypto-method-verify\n  async verify(algorithm, key, signature, data) {\n    if (typeof algorithm === 'string') algorithm = { name: algorithm }\n\n    if (algorithm.name.toLowerCase() !== key.algorithm.name.toLowerCase()) {\n      throw errors.INVALID_ACCESS(`Algorithm '${algorithm.name}' does not match key'`)\n    }\n\n    if (!key.usages.includes('verify')) {\n      throw errors.INVALID_ACCESS('Key cannot be used for verification')\n    }\n\n    switch (algorithm.name.toLowerCase()) {\n      case 'hmac':\n        return hmac.verify(algorithm, key, signature, data)\n      case 'ed25519':\n        return ed25519.verify(algorithm, key, signature, data)\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${algorithm.name}' does not support the verify() operation`\n        )\n    }\n  }\n\n  // https://w3c.github.io/webcrypto/#SubtleCrypto-method-deriveBits\n  async deriveBits(algorithm, key, length) {\n    if (typeof algorithm === 'string') algorithm = { name: algorithm }\n\n    if (algorithm.name.toLowerCase() !== key.algorithm.name.toLowerCase()) {\n      throw errors.INVALID_ACCESS(`Algorithm '${algorithm.name}' does not match key'`)\n    }\n\n    if (!key.usages.includes('deriveBits')) {\n      throw errors.INVALID_ACCESS('Key cannot be used to derive bits')\n    }\n\n    switch (algorithm.name.toLowerCase()) {\n      case 'pbkdf2':\n        return pbkdf2.deriveBits(algorithm, key, length)\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${algorithm.name}' does not support the deriveBits() operation`\n        )\n    }\n  }\n\n  // https://w3c.github.io/webcrypto/#SubtleCrypto-method-deriveKey\n  async deriveKey(algorithm, baseKey, derivedKeyType, extractable, usages) {\n    if (typeof algorithm === 'string') algorithm = { name: algorithm }\n\n    if (typeof derivedKeyType === 'string') {\n      derivedKeyType = { name: derivedKeyType }\n    }\n\n    if (algorithm.name.toLowerCase() !== baseKey.algorithm.name.toLowerCase()) {\n      throw errors.INVALID_ACCESS(`Algorithm '${algorithm.name}' does not match key'`)\n    }\n\n    if (!baseKey.usages.includes('deriveKey')) {\n      throw errors.INVALID_ACCESS('Key cannot be used to derive key')\n    }\n\n    let length\n\n    switch (derivedKeyType.name.toLowerCase()) {\n      case 'hmac':\n        length = hmac.getKeyLength(derivedKeyType)\n        break\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${derivedKeyType.name}' does not support the getKeyLength() operation`\n        )\n    }\n\n    let secret\n\n    switch (algorithm.name.toLowerCase()) {\n      case 'pbkdf2':\n        secret = pbkdf2.deriveBits(algorithm, baseKey, length)\n        break\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${algorithm.name}' does not support the deriveBits() operation`\n        )\n    }\n\n    return this.importKey('raw', secret, derivedKeyType, extractable, usages)\n  }\n\n  // https://w3c.github.io/webcrypto/#SubtleCrypto-method-digest\n  async digest(algorithm, data) {\n    if (typeof algorithm === 'string') algorithm = { name: algorithm }\n\n    switch (algorithm.name.toLowerCase()) {\n      case 'sha-1':\n        return sha.digest(crypto.constants.hash.SHA1, data)\n      case 'sha-256':\n        return sha.digest(crypto.constants.hash.SHA256, data)\n      case 'sha-384':\n        return sha.digest(crypto.constants.hash.SHA384, data)\n      case 'sha-512':\n        return sha.digest(crypto.constants.hash.SHA512, data)\n      default:\n        throw errors.NOT_SUPPORTED(\n          `Algorithm '${algorithm.name}' does not support the digest() operation`\n        )\n    }\n  }\n}\n\nexports.subtle = new exports.SubtleCrypto()\n\n// https://w3c.github.io/webcrypto/#crypto-interface\nexports.Crypto = class Crypto {\n  get subtle() {\n    return exports.subtle\n  }\n\n  getRandomValues(array) {\n    return exports.getRandomValues(array)\n  }\n\n  randomUUID() {\n    return exports.randomUUID()\n  }\n}\nconst os = require('bare-os')\n\nconst pid = os.pid()\nconst env = os.getEnv('BARE_DEBUG') || os.getEnv('NODE_DEBUG') || ''\n\nconst test = new RegExp(\n  `^${env.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&').replace(/\\*/g, '.*').replace(/,/g, '$|^')}$`,\n  'i'\n)\n\nmodule.exports = function debug (section) {\n  section = section.toUpperCase()\n\n  const enabled = test.test(section)\n\n  function debug (...args) {\n    if (enabled) console.error('%s %s:', section, pid, ...args)\n  }\n\n  debug.enabled = enabled\n\n  return debug\n}\n{\n  \"name\": \"bare-debug-log\",\n  \"version\": \"2.0.0\",\n  \"description\": \"Simple debug log for JavaScript\",\n  \"exports\": {\n    \".\": \"./index.js\",\n    \"./package\": \"./package.json\"\n  },\n  \"files\": [\n    \"index.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"standard\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-debug-log.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-debug-log/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-debug-log#readme\",\n  \"dependencies\": {\n    \"bare-os\": \"^3.0.1\"\n  },\n  \"devDependencies\": {\n    \"standard\": \"^17.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst binding = require('./binding')\n\nexports.Resolver = class DNSResolver {\n  constructor() {\n    this._handle = binding.initResolver()\n  }\n\n  resolveTxt(hostname, cb = noop) {\n    binding.resolveTxt(this._handle, hostname, cb, this)\n  }\n\n  destroy() {\n    binding.destroyResolver(this._handle)\n    this._handle = null\n  }\n\n  static global = new this()\n}\n\nfunction onlookup(err, addresses) {\n  const req = this\n\n  if (err) return req.cb(err, null, 0)\n\n  const { address, family } = addresses[0]\n\n  return req.cb(null, address, family)\n}\n\nfunction onlookupall(err, addresses) {\n  const req = this\n\n  if (err) return req.cb(err, null)\n\n  return req.cb(null, addresses)\n}\n\nexports.lookup = function lookup(hostname, opts = {}, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  let { family = 0, all = false } = opts\n\n  if (typeof family === 'string') {\n    switch (family) {\n      case 'IPv4':\n        family = 4\n        break\n      case 'IPv6':\n        family = 6\n        break\n      default:\n        family = 0\n    }\n  }\n\n  const req = {\n    cb,\n    handle: null\n  }\n\n  req.handle = binding.lookup(\n    hostname,\n    family || 0,\n    all,\n    req,\n    all ? onlookupall : onlookup\n  )\n}\n\nexports.resolveTxt = function resolveTxt(hostname, cb) {\n  exports.Resolver.global.resolveTxt(hostname, cb)\n}\n\nfunction noop() {}\n{\n  \"name\": \"bare-dns\",\n  \"version\": \"2.1.4\",\n  \"description\": \"Domain name resolution for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-dns.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-dns/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-dns\",\n  \"engines\": {\n    \"bare\": \">=1.7.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"cmake-fetch\": \"^1.3.0\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nconst encoding = require('.')\n\nglobal.TextDecoder = encoding.TextDecoder\nglobal.TextEncoder = encoding.TextEncoder\nconst UTF8Decoder = require('./lib/utf8-decoder')\nconst PassThroughDecoder = require('./lib/pass-through-decoder')\nconst errors = require('./lib/errors')\n\nexports.TextEncoder = class TextEncoder {\n  // https://encoding.spec.whatwg.org/#dom-textencoder-encoding\n  get encoding() {\n    return 'utf-8'\n  }\n\n  // https://encoding.spec.whatwg.org/#dom-textencoder-encode\n  encode(input) {\n    return Buffer.from(input)\n  }\n\n  // https://encoding.spec.whatwg.org/#dom-textencoder-encodeinto\n  encodeInto(input, destination) {\n    if (ArrayBuffer.isView(destination)) {\n      destination = Buffer.from(\n        destination.buffer,\n        destination.byteOffset,\n        destination.byteLength\n      )\n    } else {\n      destination = Buffer.from(destination)\n    }\n\n    return {\n      read: input.length,\n      written: destination.write(input)\n    }\n  }\n}\n\nexports.TextDecoder = class TextDecoder {\n  // https://encoding.spec.whatwg.org/#dom-textdecoder\n  constructor(label = 'utf-8') {\n    this.encoding = getEncoding(label)\n\n    switch (this.encoding) {\n      case 'utf-8':\n        this.decoder = new UTF8Decoder()\n        break\n      default:\n        this.decoder = new PassThroughDecoder(this.encoding)\n        break\n    }\n  }\n\n  // https://encoding.spec.whatwg.org/#dom-textdecoder-decode\n  decode(input, options = {}) {\n    const result = this.decoder.decode(input)\n\n    if (options.stream) return result\n\n    return result + this.decoder.flush()\n  }\n}\n\n// https://encoding.spec.whatwg.org/#concept-encoding-get\nfunction getEncoding(label) {\n  switch (label.trim().toLowerCase()) {\n    case 'unicode-1-1-utf-8':\n    case 'unicode11utf8':\n    case 'unicode11utf8':\n    case 'unicode20utf8':\n    case 'utf-8':\n    case 'utf8':\n    case 'x-unicode20utf8':\n      return 'utf-8'\n    default:\n      throw errors.INVALID_LABEL(`The label '${label}' is not a valid encoding`)\n  }\n}\nmodule.exports = class EncodingError extends Error {\n  constructor(msg, code, fn = EncodingError) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'EncodingError'\n  }\n\n  static INVALID_LABEL(msg) {\n    return new EncodingError(msg, 'INVALID_LABEL', EncodingError.INVALID_LABEL)\n  }\n}\nmodule.exports = class PassThroughDecoder {\n  constructor(encoding) {\n    this.encoding = encoding\n  }\n\n  get remaining() {\n    return 0\n  }\n\n  decode(tail) {\n    if (ArrayBuffer.isView(data)) {\n      data = Buffer.from(data.buffer, data.byteOffset, data.byteLength)\n    } else {\n      data = Buffer.from(data)\n    }\n\n    return tail.toString(this.encoding)\n  }\n\n  flush() {\n    return ''\n  }\n}\n// https://encoding.spec.whatwg.org/#utf-8-decoder\nmodule.exports = class UTF8Decoder {\n  constructor() {\n    this.codePoint = 0\n    this.bytesSeen = 0\n    this.bytesNeeded = 0\n    this.lowerBoundary = 0x80\n    this.upperBoundary = 0xbf\n  }\n\n  get remaining() {\n    return this.bytesSeen\n  }\n\n  decode(data) {\n    if (ArrayBuffer.isView(data)) {\n      data = Buffer.from(data.buffer, data.byteOffset, data.byteLength)\n    } else {\n      data = Buffer.from(data)\n    }\n\n    if (this.bytesNeeded === 0) {\n      let isBoundary = true\n\n      for (\n        let i = Math.max(0, data.byteLength - 4), n = data.byteLength;\n        i < n && isBoundary;\n        i++\n      ) {\n        isBoundary = data[i] <= 0x7f\n      }\n\n      if (isBoundary) return data.toString('utf8')\n    }\n\n    let result = ''\n\n    for (let i = 0, n = data.byteLength; i < n; i++) {\n      const byte = data[i]\n\n      if (this.bytesNeeded === 0) {\n        if (byte <= 0x7f) {\n          result += String.fromCharCode(byte)\n        } else {\n          this.bytesSeen = 1\n\n          if (byte >= 0xc2 && byte <= 0xdf) {\n            this.bytesNeeded = 2\n            this.codePoint = byte & 0x1f\n          } else if (byte >= 0xe0 && byte <= 0xef) {\n            if (byte === 0xe0) this.lowerBoundary = 0xa0\n            else if (byte === 0xed) this.upperBoundary = 0x9f\n            this.bytesNeeded = 3\n            this.codePoint = byte & 0xf\n          } else if (byte >= 0xf0 && byte <= 0xf4) {\n            if (byte === 0xf0) this.lowerBoundary = 0x90\n            if (byte === 0xf4) this.upperBoundary = 0x8f\n            this.bytesNeeded = 4\n            this.codePoint = byte & 0x7\n          } else {\n            result += '\\ufffd'\n          }\n        }\n\n        continue\n      }\n\n      if (byte < this.lowerBoundary || byte > this.upperBoundary) {\n        this.codePoint = 0\n        this.bytesNeeded = 0\n        this.bytesSeen = 0\n        this.lowerBoundary = 0x80\n        this.upperBoundary = 0xbf\n\n        result += '\\ufffd'\n\n        continue\n      }\n\n      this.lowerBoundary = 0x80\n      this.upperBoundary = 0xbf\n\n      this.codePoint = (this.codePoint << 6) | (byte & 0x3f)\n      this.bytesSeen++\n\n      if (this.bytesSeen !== this.bytesNeeded) continue\n\n      result += String.fromCodePoint(this.codePoint)\n\n      this.codePoint = 0\n      this.bytesNeeded = 0\n      this.bytesSeen = 0\n    }\n\n    return result\n  }\n\n  flush() {\n    const result = this.bytesNeeded > 0 ? '\\ufffd' : ''\n\n    this.codePoint = 0\n    this.bytesNeeded = 0\n    this.bytesSeen = 0\n    this.lowerBoundary = 0x80\n    this.upperBoundary = 0xbf\n\n    return result\n  }\n}\n{\n  \"name\": \"bare-encoding\",\n  \"version\": \"1.0.0\",\n  \"description\": \"WHATWG text encoding interfaces for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./global\": {\n      \"types\": \"./global.d.ts\",\n      \"default\": \"./global.js\"\n    },\n    \"./errors\": {\n      \"types\": \"./lib/errors.d.ts\",\n      \"default\": \"./lib/errors.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"global.js\",\n    \"global.d.ts\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-encoding.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-encoding/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-encoding#readme\",\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.1\",\n    \"prettier\": \"^3.3.3\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  },\n  \"peerDependencies\": {\n    \"bare-buffer\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bare-buffer\": {\n      \"optional\": true\n    }\n  }\n}\nconst os = require('bare-os')\n\nmodule.exports = new Proxy(Object.create(null), {\n  ownKeys (target) {\n    return os.getEnvKeys()\n  },\n\n  get (target, property) {\n    if (typeof property !== 'string') return\n\n    return os.getEnv(property)\n  },\n\n  has (target, property) {\n    if (typeof property !== 'string') return false\n\n    return os.hasEnv(property)\n  },\n\n  set (target, property, value) {\n    if (typeof property !== 'string') return\n\n    const type = typeof value\n\n    if (type !== 'string' && type !== 'number' && type !== 'boolean') {\n      throw new Error('Environment variable must be of type string, number, or boolean')\n    }\n\n    value = String(value)\n\n    os.setEnv(property, value)\n\n    return true\n  },\n\n  deleteProperty (target, property) {\n    if (typeof property !== 'string') return\n\n    os.unsetEnv(property)\n  },\n\n  getOwnPropertyDescriptor (target, property) {\n    return {\n      value: this.get(target, property),\n      enumerable: true,\n      configurable: true,\n      writable: true\n    }\n  }\n})\n{\n  \"name\": \"bare-env\",\n  \"version\": \"3.0.0\",\n  \"description\": \"Environment variable support for JavaScript\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"standard && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-env.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-env/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-env#readme\",\n  \"dependencies\": {\n    \"bare-os\": \"^3.0.1\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.2.1\",\n    \"standard\": \"^17.0.0\"\n  }\n}\nconst events = require('./web')\n\nglobal.Event = events.Event\nglobal.CustomEvent = events.CustomEvent\nglobal.EventTarget = events.EventTarget\nconst errors = require('./lib/errors')\n\nclass EventListener {\n  constructor() {\n    this.list = []\n    this.count = 0\n  }\n\n  append(ctx, name, fn, once) {\n    this.count++\n    ctx.emit('newListener', name, fn) // Emit BEFORE adding\n    this.list.push([fn, once])\n  }\n\n  prepend(ctx, name, fn, once) {\n    this.count++\n    ctx.emit('newListener', name, fn) // Emit BEFORE adding\n    this.list.unshift([fn, once])\n  }\n\n  remove(ctx, name, fn) {\n    for (let i = 0, n = this.list.length; i < n; i++) {\n      const l = this.list[i]\n\n      if (l[0] === fn) {\n        this.list.splice(i, 1)\n\n        if (this.count === 1) delete ctx._events[name]\n\n        ctx.emit('removeListener', name, fn) // Emit AFTER removing\n\n        this.count--\n        return\n      }\n    }\n  }\n\n  removeAll(ctx, name) {\n    const list = [...this.list]\n    this.list = []\n\n    if (this.count === list.length) delete ctx._events[name]\n\n    for (let i = list.length - 1; i >= 0; i--) {\n      ctx.emit('removeListener', name, list[i][0]) // Emit AFTER removing\n    }\n\n    this.count -= list.length\n  }\n\n  emit(ctx, name, ...args) {\n    const list = [...this.list]\n\n    for (let i = 0, n = list.length; i < n; i++) {\n      const l = list[i]\n\n      if (l[1] === true) this.remove(ctx, name, l[0])\n\n      Reflect.apply(l[0], ctx, args)\n    }\n\n    return list.length > 0\n  }\n}\n\nfunction appendListener(ctx, name, fn, once) {\n  if (ctx._events === undefined) ctx._events = Object.create(null)\n  const e = ctx._events[name] || (ctx._events[name] = new EventListener())\n  e.append(ctx, name, fn, once)\n  return ctx\n}\n\nfunction prependListener(ctx, name, fn, once) {\n  if (ctx._events === undefined) ctx._events = Object.create(null)\n  const e = ctx._events[name] || (ctx._events[name] = new EventListener())\n  e.prepend(ctx, name, fn, once)\n  return ctx\n}\n\nfunction removeListener(ctx, name, fn) {\n  if (ctx._events === undefined) return ctx\n  const e = ctx._events[name]\n  if (e !== undefined) e.remove(ctx, name, fn)\n  return ctx\n}\n\nfunction throwUnhandledError(...args) {\n  let err\n\n  if (args.length > 0) err = args[0]\n\n  if (err instanceof Error === false) err = errors.UNHANDLED_ERROR(err)\n\n  if (Error.captureStackTrace) {\n    Error.captureStackTrace(err, exports.prototype.emit)\n  }\n\n  queueMicrotask(() => {\n    throw err\n  })\n}\n\nmodule.exports = exports = class EventEmitter {\n  constructor() {\n    this._events = Object.create(null)\n  }\n\n  addListener(name, fn) {\n    return appendListener(this, name, fn, false)\n  }\n\n  addOnceListener(name, fn) {\n    return appendListener(this, name, fn, true)\n  }\n\n  prependListener(name, fn) {\n    return prependListener(this, name, fn, false)\n  }\n\n  prependOnceListener(name, fn) {\n    return prependListener(this, name, fn, true)\n  }\n\n  removeListener(name, fn) {\n    return removeListener(this, name, fn)\n  }\n\n  on(name, fn) {\n    return appendListener(this, name, fn, false)\n  }\n\n  once(name, fn) {\n    return appendListener(this, name, fn, true)\n  }\n\n  off(name, fn) {\n    return removeListener(this, name, fn)\n  }\n\n  emit(name, ...args) {\n    if (name === 'error' && this._events !== undefined && this._events.error === undefined) {\n      throwUnhandledError(...args)\n    }\n\n    if (this._events === undefined) return false\n    const e = this._events[name]\n    return e === undefined ? false : e.emit(this, name, ...args)\n  }\n\n  listeners(name) {\n    if (this._events === undefined) return []\n    const e = this._events[name]\n    return e === undefined ? [] : [...e.list]\n  }\n\n  listenerCount(name) {\n    if (this._events === undefined) return 0\n    const e = this._events[name]\n    return e === undefined ? 0 : e.list.length\n  }\n\n  getMaxListeners() {\n    return EventEmitter.defaultMaxListeners\n  }\n\n  setMaxListeners(n) {}\n\n  removeAllListeners(name) {\n    if (arguments.length === 0) {\n      for (const key of Reflect.ownKeys(this._events)) {\n        if (key === 'removeListener') continue\n        this.removeAllListeners(key)\n      }\n      this.removeAllListeners('removeListener')\n    } else {\n      const e = this._events[name]\n      if (e !== undefined) e.removeAll(this, name)\n    }\n    return this\n  }\n}\n\nexports.EventEmitter = exports\n\nexports.errors = errors\n\nexports.defaultMaxListeners = 10\n\nexports.on = function on(emitter, name, opts = {}) {\n  const { signal } = opts\n\n  if (signal && signal.aborted) {\n    throw errors.OPERATION_ABORTED(signal.reason)\n  }\n\n  let error = null\n  let done = false\n\n  const events = []\n  const promises = []\n\n  if (name !== 'error') emitter.on('error', onerror)\n\n  if (signal) signal.addEventListener('abort', onabort)\n\n  emitter.on(name, onevent)\n\n  return {\n    next() {\n      if (events.length) {\n        return Promise.resolve({ value: events.shift(), done: false })\n      }\n\n      if (error) {\n        const err = error\n\n        error = null\n\n        return Promise.reject(err)\n      }\n\n      if (done) return onclose()\n\n      return new Promise((resolve, reject) => promises.push({ resolve, reject }))\n    },\n\n    return() {\n      return onclose()\n    },\n\n    throw(err) {\n      return onerror(err)\n    },\n\n    [Symbol.asyncIterator]() {\n      return this\n    }\n  }\n\n  function onevent(...args) {\n    if (promises.length) {\n      promises.shift().resolve({ value: args, done: false })\n    } else {\n      events.push(args)\n    }\n  }\n\n  function onerror(err) {\n    emitter.off(name, onevent).off('error', onerror)\n\n    if (promises.length) {\n      promises.shift().reject(err)\n    } else {\n      error = err\n    }\n\n    return Promise.resolve({ done: true })\n  }\n\n  function onabort() {\n    signal.removeEventListener('abort', onabort)\n\n    onerror(errors.OPERATION_ABORTED(signal.reason))\n  }\n\n  function onclose() {\n    emitter.off(name, onevent)\n\n    if (name !== 'error') emitter.off('error', onerror)\n\n    if (signal) signal.removeEventListener('abort', onabort)\n\n    done = true\n\n    if (promises.length) promises.shift().resolve({ done: true })\n\n    return Promise.resolve({ done: true })\n  }\n}\n\nexports.once = function once(emitter, name, opts = {}) {\n  const { signal } = opts\n\n  if (signal && signal.aborted) {\n    return Promise.reject(errors.OPERATION_ABORTED(signal.reason))\n  }\n\n  return new Promise((resolve, reject) => {\n    if (name !== 'error') emitter.on('error', onerror)\n\n    if (signal) signal.addEventListener('abort', onabort)\n\n    emitter.once(name, onevent)\n\n    function onevent(...args) {\n      if (name !== 'error') emitter.off('error', onerror)\n\n      if (signal) signal.removeEventListener('abort', onabort)\n\n      resolve(args)\n    }\n\n    function onerror(err) {\n      emitter.off(name, onevent)\n\n      if (name !== 'error') emitter.off('error', onerror)\n\n      reject(err)\n    }\n\n    function onabort() {\n      signal.removeEventListener('abort', onabort)\n\n      onerror(errors.OPERATION_ABORTED(signal.reason))\n    }\n  })\n}\n\nexports.forward = function forward(from, to, names, opts = {}) {\n  if (typeof names === 'string') names = [names]\n\n  const { emit = to.emit.bind(to) } = opts\n\n  const listeners = names.map(\n    (name) =>\n      function onevent(...args) {\n        emit(name, ...args)\n      }\n  )\n\n  to.on('newListener', (name) => {\n    const i = names.indexOf(name)\n\n    if (i !== -1 && to.listenerCount(name) === 0) {\n      from.on(name, listeners[i])\n    }\n  }).on('removeListener', (name) => {\n    const i = names.indexOf(name)\n\n    if (i !== -1 && to.listenerCount(name) === 0) {\n      from.off(name, listeners[i])\n    }\n  })\n}\n\nexports.listenerCount = function listenerCount(emitter, name) {\n  return emitter.listenerCount(name)\n}\n\nexports.getMaxListeners = function getMaxListeners(emitter) {\n  if (typeof emitter.getMaxListeners === 'function') {\n    return emitter.getMaxListeners()\n  }\n\n  return exports.defaultMaxListeners\n}\n\nexports.setMaxListeners = function setMaxListeners(n, ...emitters) {\n  if (emitters.length === 0) exports.defaultMaxListeners = n\n  else {\n    for (const emitter of emitters) {\n      if (typeof emitter.setMaxListeners === 'function') {\n        emitter.setMaxListeners(n)\n      }\n    }\n  }\n}\nmodule.exports = class EventEmitterError extends Error {\n  constructor(msg, code, fn = EventEmitterError, opts) {\n    super(`${code}: ${msg}`, opts)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'EventEmitterError'\n  }\n\n  static OPERATION_ABORTED(cause, msg = 'Operation aborted') {\n    return new EventEmitterError(msg, 'OPERATION_ABORTED', EventEmitterError.OPERATION_ABORTED, {\n      cause\n    })\n  }\n\n  static UNHANDLED_ERROR(cause, msg = 'Unhandled error') {\n    return new EventEmitterError(msg, 'UNHANDLED_ERROR', EventEmitterError.UNHANDLED_ERROR, {\n      cause\n    })\n  }\n}\n{\n  \"name\": \"bare-events\",\n  \"version\": \"2.8.2\",\n  \"description\": \"Event emitters for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./global\": {\n      \"types\": \"./global.d.ts\",\n      \"default\": \"./global.js\"\n    },\n    \"./web\": {\n      \"types\": \"./web.d.ts\",\n      \"default\": \"./web.js\"\n    },\n    \"./errors\": \"./lib/errors.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"global.js\",\n    \"global.d.ts\",\n    \"web.js\",\n    \"web.d.ts\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"npm run lint && npm run test:bare && npm run test:node\",\n    \"test:bare\": \"bare test.js\",\n    \"test:node\": \"node test.js\",\n    \"lint\": \"prettier . --check\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-events.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-events/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-events#readme\",\n  \"devDependencies\": {\n    \"bare-abort-controller\": \"^1.0.0\",\n    \"brittle\": \"^3.3.2\",\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"uncaughts\": \"^1.1.1\"\n  },\n  \"peerDependencies\": {\n    \"bare-abort-controller\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bare-abort-controller\": {\n      \"optional\": true\n    }\n  }\n}\n// Event state\nconst BUBBLES = 0x1\nconst CANCELABLE = 0x2\nconst COMPOSED = 0x4\nconst CANCELED = 0x8\nconst DISPATCH = 0x10\nconst STOP = 0x20\n\n// EventTarget state\nconst CAPTURE = 0x1\nconst PASSIVE = 0x2\nconst ONCE = 0x4\n\n// https://dom.spec.whatwg.org/#event\nclass Event {\n  // https://dom.spec.whatwg.org/#dom-event-event\n  constructor(type, options = {}) {\n    const { bubbles = false, cancelable = false, composed = false } = options\n\n    this._type = type\n    this._target = null\n    this._state = 0\n\n    if (bubbles) this._state |= BUBBLES\n    if (cancelable) this._state |= CANCELABLE\n    if (composed) this._state |= COMPOSED\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-type\n  get type() {\n    return this._type\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-target\n  get target() {\n    return this._target\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-currenttarget\n  get currentTarget() {\n    return null\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-bubbles\n  get bubbles() {\n    return (this._state & BUBBLES) !== 0\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-cancelable\n  get cancelable() {\n    return (this._state & CANCELABLE) !== 0\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-composed\n  get composed() {\n    return (this._state & COMPOSED) !== 0\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-defaultprevented\n  get defaultPrevented() {\n    return (this._state & CANCELED) !== 0\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-istrusted\n  get isTrusted() {\n    return false\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-preventdefault\n  preventDefault() {\n    if (this._state & CANCELABLE) this._state |= CANCELED\n  }\n\n  // https://dom.spec.whatwg.org/#dom-event-stoppropagation\n  stopPropagation() {}\n\n  // https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation\n  stopImmediatePropagation() {\n    this._state |= STOP\n  }\n\n  toJSON() {\n    return {\n      type: this.type,\n      target: this.target,\n      bubbles: this.bubbles,\n      cancelable: this.cancelable,\n      composed: this.composed,\n      defaultPrevented: this.defaultPrevented,\n      isTrusted: this.isTrusted\n    }\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: Event },\n\n      type: this.type,\n      target: this.target,\n      bubbles: this.bubbles,\n      cancelable: this.cancelable,\n      composed: this.composed,\n      defaultPrevented: this.defaultPrevented,\n      isTrusted: this.isTrusted\n    }\n  }\n}\n\nexports.Event = Event\n\n// https://dom.spec.whatwg.org/#customevent\nexports.CustomEvent = class CustomEvent extends Event {\n  constructor(type, options = {}) {\n    super(type, options)\n\n    const { detail = null } = options\n\n    this._detail = detail\n  }\n\n  // https://dom.spec.whatwg.org/#dom-customevent-detail\n  get detail() {\n    return this._detail\n  }\n}\n\n// https://dom.spec.whatwg.org/#eventtarget\nexports.EventTarget = class EventTarget {\n  // https://dom.spec.whatwg.org/#dom-eventtarget-eventtarget\n  constructor() {\n    this._listeners = new Map()\n  }\n\n  // https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener\n  addEventListener(type, callback = null, options = {}) {\n    if (typeof options === 'boolean') options = { capture: options }\n\n    const { capture = false, passive = false, once = false, signal = null } = options\n\n    if (signal !== null && signal.aborted) return\n    if (callback === null) return\n\n    const listener = new EventListener(type, callback, capture, passive, once, signal)\n\n    const listeners = this._listeners.get(type)\n\n    if (listeners === undefined) this._listeners.set(type, listener)\n    else {\n      for (const existing of listeners) {\n        if (callback === existing.callback && capture === existing.capture) {\n          return // Duplicate listener\n        }\n      }\n\n      listener.link(listeners)\n\n      if (signal !== null) {\n        signal.addEventListener('abort', onabort)\n\n        function onabort() {\n          listener.unlink()\n        }\n      }\n    }\n  }\n\n  // https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener\n  removeEventListener(type, callback = null, options = {}) {\n    if (typeof options === 'boolean') options = { capture: options }\n\n    const { capture = false } = options\n\n    const listeners = this._listeners.get(type)\n\n    if (listeners === undefined) return\n\n    for (const existing of listeners) {\n      if (callback === existing.callback && capture === existing.capture) {\n        const next = existing.unlink()\n\n        if (listeners === existing) this._listeners.set(type, next)\n\n        return\n      }\n    }\n  }\n\n  // https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent\n  dispatchEvent(event) {\n    event._target = this\n    event._state |= DISPATCH\n\n    const listeners = this._listeners.get(event.type)\n\n    try {\n      if (listeners === undefined) return true\n\n      for (const listener of listeners) {\n        // https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke\n\n        if (listener.once) listener.unlink()\n\n        let callback = listener.callback\n        let context = this\n\n        if (typeof callback === 'object') {\n          context = callback\n          callback = callback.handleEvent\n        }\n\n        Reflect.apply(callback, context, [event])\n\n        if (event._state & STOP) break\n      }\n\n      return (event._state & CANCELED) === 0\n    } finally {\n      event._state &= ~DISPATCH\n      event._state &= ~STOP\n    }\n  }\n\n  toJSON() {\n    return {}\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: EventTarget }\n    }\n  }\n}\n\n// https://dom.spec.whatwg.org/#concept-event-listener\nclass EventListener {\n  constructor(type, callback, capture, passive, once, signal) {\n    this._type = type\n    this._callback = callback\n    this._signal = signal\n    this._state = 0\n\n    if (capture) this._state |= CAPTURE\n    if (passive) this._state |= PASSIVE\n    if (once) this._state |= ONCE\n\n    this._previous = this\n    this._next = this\n  }\n\n  get type() {\n    return this._type\n  }\n\n  get callback() {\n    return this._callback\n  }\n\n  get capture() {\n    return (this._state & CAPTURE) !== 0\n  }\n\n  get passive() {\n    return (this._state & PASSIVE) !== 0\n  }\n\n  get once() {\n    return (this._state & ONCE) !== 0\n  }\n\n  get removed() {\n    return this._previous === this && this._next === this\n  }\n\n  link(listener) {\n    const next = this._next\n    const previous = listener._previous\n\n    this._next = listener\n    listener._previous = this\n\n    previous._next = next\n    next._previous = previous\n\n    return listener\n  }\n\n  unlink() {\n    if (this.removed) return this\n\n    const next = this._next\n    const previous = this._previous\n\n    this._next = this\n    this._previous = this\n\n    previous._next = next\n    next._previous = previous\n\n    return next\n  }\n\n  *[Symbol.iterator]() {\n    let current = this\n\n    while (true) {\n      const next = current._next\n      yield current\n      if (next === this) break\n      current = next\n    }\n  }\n\n  toJSON() {\n    return {\n      type: this.type,\n      capture: this.capture,\n      passive: this.passive,\n      once: this.once,\n      removed: this.removed\n    }\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: EventListener },\n\n      type: this.type,\n      callback: this.callback,\n      capture: this.capture,\n      passive: this.passive,\n      once: this.once,\n      removed: this.removed\n    }\n  }\n}\nconst fetch = require('.')\n\nglobal.fetch = fetch\nglobal.Request = fetch.Request\nglobal.Response = fetch.Response\nglobal.Headers = fetch.Headers\nconst http = require('bare-http1')\nconst https = require('bare-https')\nconst { ReadableStream } = require('bare-stream/web')\nconst Request = require('./lib/request')\nconst Response = require('./lib/response')\nconst ResponseStream = require('./lib/response-stream')\nconst Headers = require('./lib/headers')\nconst errors = require('./lib/errors')\n\n// https://fetch.spec.whatwg.org/#dom-global-fetch\nmodule.exports = exports = function fetch(input, init = {}) {\n  let resolve\n  let reject\n\n  const promise = new Promise((res, rej) => {\n    resolve = res\n    reject = rej\n  })\n\n  const response = new Response()\n\n  process(input)\n\n  return promise\n\n  async function process(input, origin = null) {\n    let request\n    try {\n      request = new Request(input, init)\n    } catch (err) {\n      return reject(err)\n    }\n\n    if (response._urls.length > 20) {\n      return reject(errors.TOO_MANY_REDIRECTS('Redirect count exceeded'))\n    }\n\n    if (origin && !isSameOrigin(request._url, origin)) {\n      request.headers.delete('authorization')\n    }\n\n    let protocol\n\n    if (request._url.protocol === 'http:') {\n      protocol = http\n    } else if (request._url.protocol === 'https:') {\n      protocol = https\n    } else {\n      return reject(errors.UNKNOWN_PROTOCOL(`Unknown protocol '${request._url.protocol}'`))\n    }\n\n    response._urls.push(request._url)\n\n    if (!request._headers.has('user-agent')) {\n      request._headers.set('user-agent', `Bare/${Bare.version.substring(1)}`)\n    }\n\n    if (!request._headers.has('content-type') && request._type) {\n      request._headers.set('content-type', request._type)\n    }\n\n    const req = protocol.request(\n      request._url,\n      {\n        method: request._method,\n        headers: Object.fromEntries(request._headers)\n      },\n      (res) => {\n        if (res.headers.location && isRedirectStatus(res.statusCode)) {\n          let url\n          try {\n            url = new URL(res.headers.location, request._url)\n          } catch (err) {\n            return reject(errors.INVALID_URL('Invalid URL', err))\n          }\n\n          return process(url, request._url)\n        }\n\n        response._body = new ReadableStream(new ResponseStream(res))\n        response._status = res.statusCode\n        response._statusText = res.statusMessage\n\n        for (const [name, value] of Object.entries(res.headers)) {\n          response._headers.set(name, value)\n        }\n\n        resolve(response)\n      }\n    )\n\n    req.on('error', (err) => reject(errors.NETWORK_ERROR('Network error', err)))\n\n    try {\n      if (request._body) {\n        for await (const data of request._body) req.write(data)\n      }\n\n      req.end()\n    } catch (err) {\n      return reject(errors.NETWORK_ERROR('Network error', err))\n    }\n  }\n}\n\nexports.Request = Request\nexports.Response = Response\nexports.Headers = Headers\n\n// https://fetch.spec.whatwg.org/#redirect-status\nfunction isRedirectStatus(status) {\n  return status === 301 || status === 302 || status === 303 || status === 307 || status === 308\n}\n\n// https://html.spec.whatwg.org/multipage/browsers.html#same-origin\nfunction isSameOrigin(a, b) {\n  return a.protocol === b.protocol && a.host === b.host\n}\nconst { ReadableStream, isReadableStream, isReadableStreamDisturbed } = require('bare-stream/web')\nconst { FormData, Blob } = require('bare-form-data')\nconst errors = require('./errors')\n\nconst empty = Buffer.from(new ArrayBuffer(0))\n\n// https://fetch.spec.whatwg.org/#body-mixin\nmodule.exports = class Body {\n  constructor(body = null) {\n    this._type = null\n    this._body = null\n\n    if (isReadableStream(body)) this._body = body\n    else {\n      if (typeof body === 'string') body = Buffer.from(body)\n      else if (FormData.isFormData(body)) body = FormData.toBlob(body)\n\n      if (Blob.isBlob(body)) {\n        this._type = body.type || null\n        this._body = body.stream()\n      } else if (body !== null) {\n        if (ArrayBuffer.isView(body)) {\n          body = Buffer.from(body.buffer, body.byteOffset, body.byteLength)\n        } else {\n          body = Buffer.from(body)\n        }\n\n        this._body = new ReadableStream({\n          start(controller) {\n            controller.enqueue(body)\n            controller.close()\n          }\n        })\n      }\n    }\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-body\n  get body() {\n    return this._body\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bodyused\n  get bodyUsed() {\n    return this._body !== null && isReadableStreamDisturbed(this._body)\n  }\n\n  async buffer() {\n    if (this._body === null) return empty\n\n    if (isReadableStreamDisturbed(this._body)) {\n      throw errors.BODY_UNUSABLE('Body has already been consumed')\n    }\n\n    const chunks = []\n    let length = 0\n\n    for await (const chunk of this._body) {\n      chunks.push(chunk)\n      length += chunk.byteLength\n    }\n\n    const result = Buffer.from(new ArrayBuffer(length))\n    let offset = 0\n\n    for (const chunk of chunks) {\n      result.set(chunk, offset)\n      offset += chunk.byteLength\n    }\n\n    return result\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-bytes\n  async bytes() {\n    return this.buffer()\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n  async arrayBuffer() {\n    return (await this.buffer()).buffer\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-text\n  async text() {\n    return (await this.buffer()).toString()\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-body-json\n  async json() {\n    return JSON.parse(await this.text())\n  }\n}\nmodule.exports = class FetchError extends Error {\n  constructor(msg, fn = FetchError, code = fn.name, opts = {}) {\n    if (typeof code === 'object' && code !== null) {\n      opts = code\n      code = fn.name\n    }\n\n    super(`${code}: ${msg}`, opts)\n\n    this.code = code\n\n    if (Error.captureStackTrace) Error.captureStackTrace(this, fn)\n  }\n\n  get name() {\n    return 'FetchError'\n  }\n\n  static INVALID_URL(msg, cause) {\n    return new FetchError(msg, FetchError.INVALID_URL, { cause })\n  }\n\n  static NETWORK_ERROR(msg, cause) {\n    return new FetchError(msg, FetchError.NETWORK_ERROR, { cause })\n  }\n\n  static TOO_MANY_REDIRECTS(msg) {\n    return new FetchError(msg, FetchError.TOO_MANY_REDIRECTS)\n  }\n\n  static UNKNOWN_PROTOCOL(msg) {\n    return new FetchError(msg, FetchError.UNKNOWN_PROTOCOL)\n  }\n\n  static BODY_UNUSABLE(msg) {\n    return new FetchError(msg, FetchError.BODY_UNUSABLE)\n  }\n}\n// https://fetch.spec.whatwg.org/#headers-class\nmodule.exports = class Headers {\n  // https://fetch.spec.whatwg.org/#dom-headers\n  constructor(init) {\n    this._headers = new Map()\n\n    if (init) {\n      for (const [key, value] of typeof init[Symbol.iterator] === 'function'\n        ? init\n        : Object.entries(init)) {\n        this.append(key, value)\n      }\n    }\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-append\n  append(name, value) {\n    name = name.toLowerCase()\n    value = value.trim()\n\n    let list = this._headers.get(name)\n\n    if (list === undefined) {\n      list = []\n      this._headers.set(name, list)\n    }\n\n    list.push(value)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-delete\n  delete(name) {\n    name = name.toLowerCase()\n\n    this._headers.delete(name)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-get\n  get(name) {\n    name = name.toLowerCase()\n\n    const list = this._headers.get(name)\n\n    if (list === undefined) return null\n\n    return list.join(', ')\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-has\n  has(name) {\n    name = name.toLowerCase()\n\n    return this._headers.has(name)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-headers-set\n  set(name, value) {\n    name = name.toLowerCase()\n    value = value.trim()\n\n    this._headers.set(name, [value])\n  }\n\n  *[Symbol.iterator]() {\n    const names = [...this._headers.keys()].sort()\n\n    for (const name of names) {\n      yield [name, this.get(name)]\n    }\n  }\n}\nconst Body = require('./body')\nconst Headers = require('./headers')\nconst errors = require('./errors')\n\n// https://fetch.spec.whatwg.org/#request-class\nmodule.exports = class Request extends Body {\n  // https://fetch.spec.whatwg.org/#dom-request\n  constructor(input, init = {}) {\n    let url\n    try {\n      if (URL.isURL(input)) {\n        url = input\n        input = {}\n      } else if (typeof input === 'string') {\n        url = new URL(input)\n        input = {}\n      } else {\n        url = new URL(input.url)\n      }\n    } catch (err) {\n      throw errors.INVALID_URL('Invalid URL', err)\n    }\n\n    const {\n      body = input.body || null,\n      method = input.method || 'GET',\n      headers = input.headers\n    } = init\n\n    super(body)\n\n    this._url = url\n    this._method = method\n    this._headers = new Headers(headers)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-request-url\n  get url() {\n    return this._url.href\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-request-method\n  get method() {\n    return this._method\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-headers\n  get headers() {\n    return this._headers\n  }\n}\nconst { Readable } = require('bare-stream')\nconst { Gunzip, Deflate } = require('bare-zlib')\n\nmodule.exports = class ResponseStream extends Readable {\n  constructor(response) {\n    super()\n\n    this._response = response\n    this._response.socket.unref()\n\n    const encoding = response.headers['content-encoding']\n\n    switch (encoding) {\n      case 'gzip':\n        this._decoder = new Gunzip()\n        break\n      case 'deflate':\n        this._decoder = new Deflate()\n        break\n      default:\n        this._decoder = null\n    }\n  }\n\n  _open(cb) {\n    this._response.socket.ref()\n\n    const stream = this._decoder ? this._response.pipe(this._decoder) : this._response\n\n    stream\n      .on('data', this._ondata.bind(this))\n      .on('end', this._onend.bind(this))\n      .on('error', this._onerror.bind(this))\n\n    cb(null)\n  }\n\n  _read() {\n    this._response.resume()\n  }\n\n  _ondata(data) {\n    if (this.push(data) === false) {\n      this._response.pause()\n    }\n  }\n\n  _onend() {\n    this.push(null)\n  }\n\n  _onerror(err) {\n    this.destroy(err)\n  }\n}\nconst Body = require('./body')\nconst Headers = require('./headers')\n\n// https://fetch.spec.whatwg.org/#response-class\nmodule.exports = class Response extends Body {\n  // https://fetch.spec.whatwg.org/#dom-response\n  constructor(body = null, init = {}) {\n    const { status = 200, statusText = '', headers } = init\n\n    super(body)\n\n    this._urls = []\n    this._status = status\n    this._statusText = statusText\n    this._headers = new Headers(headers)\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-url\n  get url() {\n    return this._urls.length === 0 ? null : this._urls[this._urls.length - 1].href\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-redirected\n  get redirected() {\n    return this._urls.length > 1\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-status\n  get status() {\n    return this._status\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-ok\n  get ok() {\n    return this._status >= 200 && this._status <= 299\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-statustext\n  get statusText() {\n    return this._statusText\n  }\n\n  // https://fetch.spec.whatwg.org/#dom-response-headers\n  get headers() {\n    return this._headers\n  }\n}\n{\n  \"name\": \"bare-fetch\",\n  \"version\": \"2.5.1\",\n  \"description\": \"WHATWG Fetch implementation for Bare\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./global\": {\n      \"types\": \"./global.d.ts\",\n      \"default\": \"./global.js\"\n    },\n    \"./errors\": {\n      \"types\": \"./lib/errors.d.ts\",\n      \"default\": \"./lib/errors.js\"\n    },\n    \"./body\": {\n      \"types\": \"./lib/body.d.ts\",\n      \"default\": \"./lib/body.js\"\n    },\n    \"./request\": {\n      \"types\": \"./lib/request.d.ts\",\n      \"default\": \"./lib/request.js\"\n    },\n    \"./response\": {\n      \"types\": \"./lib/response.d.ts\",\n      \"default\": \"./lib/response.js\"\n    },\n    \"./headers\": {\n      \"types\": \"./lib/headers.d.ts\",\n      \"default\": \"./lib/headers.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"global.js\",\n    \"global.d.ts\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-fetch.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-fetch/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-fetch#readme\",\n  \"dependencies\": {\n    \"bare-form-data\": \"^1.1.3\",\n    \"bare-http1\": \"^4.0.2\",\n    \"bare-https\": \"^2.0.0\",\n    \"bare-stream\": \"^2.7.0\",\n    \"bare-zlib\": \"^1.3.0\"\n  },\n  \"devDependencies\": {\n    \"bare-buffer\": \"^3.0.2\",\n    \"brittle\": \"^3.3.0\",\n    \"listen-async\": \"^1.0.0\",\n    \"prettier\": \"^3.3.3\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  },\n  \"peerDependencies\": {\n    \"bare-buffer\": \"*\",\n    \"bare-url\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bare-buffer\": {\n      \"optional\": true\n    },\n    \"bare-url\": {\n      \"optional\": true\n    }\n  }\n}\nconst { ReadableStream } = require('bare-stream/web')\nconst errors = require('./lib/errors')\n\nclass FormData {\n  constructor() {\n    this._entries = []\n  }\n\n  append(name, value, filename) {\n    if (typeof value !== 'string') {\n      if (!isFile(value) || filename) {\n        value = new File([value], filename || 'blob', { type: value.type })\n      }\n    }\n\n    this._entries.push([name, value])\n  }\n\n  delete(name) {\n    this._entries = this._entries.filter((entry) => entry[0] !== name)\n  }\n\n  get(name) {\n    const entry = this._entries.find((entry) => entry[0] === name)\n\n    return entry ? entry[1] : null\n  }\n\n  getAll(name) {\n    const entries = []\n\n    for (const entry of this._entries) {\n      if (entry[0] === name) entries.push(entry[1])\n    }\n\n    return entries\n  }\n\n  has(name) {\n    return this._entries.findIndex((entry) => entry[0] === name) !== -1\n  }\n\n  set(name, value, filename) {\n    this.delete(name)\n    this.append(name, value, filename)\n  }\n\n  [Symbol.iterator]() {\n    return this._entries[Symbol.iterator]()\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: FormData },\n\n      entries: this._entries\n    }\n  }\n}\n\nmodule.exports = exports = FormData\n\nexports.FormData = FormData\n\nfunction isFormData(value) {\n  return value instanceof FormData\n}\n\nexports.isFormData = isFormData\n\nclass Blob {\n  // https://w3c.github.io/FileAPI/#dom-blob-blob\n  constructor(parts, options = {}) {\n    const { type = '' } = options\n\n    this._bytes = processBlobParts(parts)\n    this._type = type\n  }\n\n  // https://w3c.github.io/FileAPI/#dfn-size\n  get size() {\n    return this._bytes.byteLength\n  }\n\n  // https://w3c.github.io/FileAPI/#dfn-type\n  get type() {\n    return this._type\n  }\n\n  // https://w3c.github.io/FileAPI/#stream-method-algo\n  stream() {\n    const bytes = this._bytes\n\n    return new ReadableStream({\n      start(controller) {\n        controller.enqueue(bytes)\n        controller.close()\n      }\n    })\n  }\n\n  async buffer() {\n    return Buffer.from(this._bytes)\n  }\n\n  // https://w3c.github.io/FileAPI/#bytes-method-algo\n  async bytes() {\n    return this.buffer()\n  }\n\n  // https://w3c.github.io/FileAPI/#arraybuffer-method-algo\n  async arrayBuffer() {\n    const buffer = new ArrayBuffer(this._bytes.byteLength)\n    buffer.set(this._bytes)\n    return buffer\n  }\n\n  // https://w3c.github.io/FileAPI/#text-method-algo\n  async text() {\n    return this._bytes.toString()\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: Blob },\n\n      size: this.size,\n      type: this.type\n    }\n  }\n}\n\nexports.Blob = Blob\n\nfunction isBlob(value) {\n  return value instanceof Blob\n}\n\nBlob.isBlob = isBlob\n\nclass File extends Blob {\n  // https://w3c.github.io/FileAPI/#dom-file-file\n  constructor(parts, name, options = {}) {\n    const { lastModified = Date.now() } = options\n\n    super(parts, options)\n\n    this._name = name\n    this._lastModified = lastModified\n  }\n\n  // https://w3c.github.io/FileAPI/#dfn-name\n  get name() {\n    return this._name\n  }\n\n  // https://w3c.github.io/FileAPI/#dfn-lastModified\n  get lastModified() {\n    return this._lastModified\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: File },\n\n      size: this.size,\n      type: this.type,\n      name: this.name,\n      lastModified: this.lastModified\n    }\n  }\n}\n\nexports.File = File\n\nfunction isFile(value) {\n  return value instanceof File\n}\n\nFile.isFile = isFile\n\n// https://w3c.github.io/FileAPI/#process-blob-parts\nfunction processBlobParts(parts) {\n  const chunks = []\n\n  for (const part of parts) {\n    if (typeof part === 'string') {\n      const buffer = Buffer.from(part)\n      if (parts.length === 1) return buffer\n      chunks.push(buffer)\n    } else if (isBlob(part)) {\n      chunks.push(part._bytes)\n    } else if (Buffer.isBuffer(part)) {\n      chunks.push(part)\n    } else if (ArrayBuffer.isView(part)) {\n      chunks.push(Buffer.from(part.buffer, part.byteOffset, part.byteLength))\n    } else {\n      chunks.push(Buffer.from(part))\n    }\n  }\n\n  return Buffer.concat(chunks)\n}\n\nfunction toBlob(formData, mimeType = 'multipart/form-data') {\n  switch (mimeType) {\n    case 'multipart/form-data':\n      return toMultipartBlob(formData)\n    default:\n      throw errors.INVALID_MIME_TYPE(`Invalid MIME type '${mimeType}'`)\n  }\n}\n\nexports.toBlob = toBlob\n\nfunction escape(value) {\n  return value.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n}\n\nfunction normalizeLinefeeds(value) {\n  return value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n}\n\nconst linefeed = Buffer.from('\\r\\n')\n\n// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart/form-data-encoding-algorithm\nfunction toMultipartBlob(formData) {\n  const boundary = Math.random().toString(16).slice(2, 18).padStart(16, '0')\n\n  const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n  const parts = []\n\n  for (const [name, value] of formData) {\n    if (typeof value === 'string') {\n      const chunk = Buffer.from(\n        prefix +\n          `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`\n      )\n\n      parts.push(chunk)\n    } else {\n      const chunk = Buffer.from(\n        prefix +\n          `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n          `; filename=\"${escape(value.name)}\"` +\n          `\\r\\nContent-Type: ${value.type || 'application/octet-stream'}\\r\\n\\r\\n`\n      )\n\n      parts.push(chunk, value, linefeed)\n    }\n  }\n\n  parts.push(Buffer.from(`--${boundary}--\\r\\n`))\n\n  return new Blob(parts, {\n    type: 'multipart/form-data; boundary=' + boundary\n  })\n}\nmodule.exports = class FormDataError extends Error {\n  constructor(msg, code, fn = FormDataError) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'FormDataError'\n  }\n\n  static INVALID_MIME_TYPE(msg) {\n    return new FormDataError(\n      msg,\n      'INVALID_MIME_TYPE',\n      FormDataError.INVALID_MIME_TYPE\n    )\n  }\n}\n{\n  \"name\": \"bare-form-data\",\n  \"version\": \"1.1.6\",\n  \"description\": \"Form data support for Bare\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": \"./index.js\",\n    \"./errors\": \"./lib/errors.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-form-data.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-form-data/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-form-data#readme\",\n  \"dependencies\": {\n    \"bare-stream\": \"^2.6.5\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.0\",\n    \"prettier\": \"^3.3.3\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nconst inspect = require('bare-inspect')\n\nmodule.exports = exports = function format(...args) {\n  return exports.formatWithOptions({}, ...args)\n}\n\nexports.format = exports\n\nexports.formatWithOptions = function formatWithOptions(opts, ...args) {\n  const format = args[0]\n\n  let result = ''\n  let join = ''\n  let i = 0\n\n  if (typeof format === 'string') {\n    if (args.length === 1) return format\n\n    let tmp\n    let j = 0\n    let c\n\n    for (let k = 0, n = format.length; k < n; k++) {\n      c = format.charCodeAt(k)\n\n      if (c === 0x25 /* % */) {\n        c = format.charCodeAt(++k)\n\n        if (i < args.length) {\n          switch (c) {\n            case 0x73 /* s */: {\n              const value = args[++i]\n\n              switch (typeof value) {\n                case 'string':\n                  tmp = value\n                  break\n                case 'bigint':\n                  tmp = inspect(value, { ...opts, color: false })\n                  break\n                default:\n                  tmp = String(value)\n                  break\n              }\n\n              break\n            }\n\n            case 0x64 /* d */: {\n              const value = args[++i]\n\n              switch (typeof value) {\n                case 'symbol':\n                  tmp = NaN\n                  break\n                case 'bigint':\n                  tmp = inspect(value, { ...opts, color: false })\n                  break\n                default:\n                  tmp = inspect(Number(value), { ...opts, color: false })\n                  break\n              }\n\n              break\n            }\n\n            case 0x69 /* i */: {\n              const value = args[++i]\n\n              switch (typeof value) {\n                case 'symbol':\n                  tmp = NaN\n                  break\n                case 'bigint':\n                  tmp = inspect(value, { ...opts, color: false })\n                  break\n                default:\n                  tmp = inspect(parseInt(value, 10), { ...opts, color: false })\n                  break\n              }\n\n              break\n            }\n\n            case 0x66 /* f */: {\n              const value = args[++i]\n\n              switch (typeof value) {\n                case 'symbol':\n                  tmp = NaN\n                  break\n                default:\n                  tmp = inspect(parseFloat(value), { ...opts, color: false })\n                  break\n              }\n\n              break\n            }\n\n            case 0x4f /* O */:\n            case 0x6f /* o */:\n              tmp = inspect(args[++i], opts)\n              break\n\n            case 0x6a /* j */:\n              tmp = JSON.stringify(args[++i])\n              break\n\n            case 0x63 /* c */:\n              i++\n              tmp = ''\n              break\n\n            case 0x25 /* % */:\n              result += format.substring(j, k)\n              j = k + 1\n              continue\n\n            default:\n              continue\n          }\n\n          if (j !== k - 1) result += format.substring(j, k - 1)\n\n          result += tmp\n          j = k + 1\n        } else if (c === 0x25 /* % */) {\n          result += format.substring(j, k)\n          j = k + 1\n        }\n      }\n    }\n\n    if (j !== 0) {\n      i++\n      join = ' '\n\n      if (j < format.length) {\n        result += format.substring(j)\n      }\n    }\n  }\n\n  while (i < args.length) {\n    const value = args[i++]\n\n    result += join\n    result += typeof value === 'string' ? value : inspect(value, opts)\n\n    join = ' '\n  }\n\n  return result\n}\n{\n  \"name\": \"bare-format\",\n  \"version\": \"1.0.1\",\n  \"description\": \"String formatting for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-format.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-format/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-format#readme\",\n  \"dependencies\": {\n    \"bare-inspect\": \"^3.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.5.0\",\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst FIFO = require('fast-fifo')\nconst EventEmitter = require('bare-events')\nconst path = require('bare-path')\nconst { fileURLToPath } = require('bare-url')\nconst { Readable, Writable } = require('bare-stream')\nconst binding = require('./binding')\nconst constants = require('./lib/constants')\nconst FileError = require('./lib/errors')\n\nconst isWindows = Bare.platform === 'win32'\n\nexports.constants = constants\n\nclass FileRequest {\n  static _free = []\n\n  static borrow() {\n    if (this._free.length > 0) return this._free.pop()\n    return new FileRequest()\n  }\n\n  static return(req) {\n    if (this._free.length < 32) this._free.push(req.reset())\n    else req.destroy()\n  }\n\n  constructor() {\n    this._reset()\n    this._handle = binding.requestInit(this, this._onresult)\n  }\n\n  get handle() {\n    return this._handle\n  }\n\n  retain(value) {\n    this._retain = value // Tie the lifetime of `value` to the lifetime of `this`\n  }\n\n  reset() {\n    if (this._handle === null) return this\n\n    binding.requestReset(this._handle)\n\n    this._reset()\n\n    return this\n  }\n\n  destroy() {\n    if (this._handle === null) return this\n\n    binding.requestDestroy(this._handle)\n\n    this._reset()\n    this._handle = null\n\n    return this\n  }\n\n  then(resolve, reject) {\n    return this._promise.then(resolve, reject)\n  }\n\n  return() {\n    if (this._handle === null) return this\n\n    FileRequest.return(this)\n\n    return this\n  }\n\n  [Symbol.dispose]() {\n    this.return()\n  }\n\n  _reset() {\n    const { promise, resolve, reject } = Promise.withResolvers()\n\n    this._promise = promise\n    this._resolve = resolve\n    this._reject = reject\n    this._retain = null\n  }\n\n  _onresult(err, status) {\n    if (err) this._reject(err)\n    else this._resolve(status)\n  }\n}\n\nfunction ok(result, cb) {\n  if (typeof result === 'function') {\n    cb = result\n    result = undefined\n  }\n\n  if (cb) cb(null, result)\n  else return result\n}\n\nfunction fail(err, cb) {\n  if (cb) cb(err)\n  else throw err\n}\n\nfunction done(err, result, cb) {\n  if (typeof result === 'function') {\n    cb = result\n    result = undefined\n  }\n\n  if (err) fail(err, cb)\n  else return ok(result, cb)\n}\n\nasync function open(filepath, flags = 'r', mode = 0o666, cb) {\n  if (typeof flags === 'function') {\n    cb = flags\n    flags = 'r'\n    mode = 0o666\n  } else if (typeof mode === 'function') {\n    cb = mode\n    mode = 0o666\n  }\n\n  if (typeof flags === 'string') flags = toFlags(flags)\n  if (typeof mode === 'string') mode = toMode(mode)\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let fd\n  let err = null\n  try {\n    binding.open(req.handle, filepath, flags, mode)\n\n    fd = await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'open',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, fd, cb)\n}\n\nfunction openSync(filepath, flags = 'r', mode = 0o666) {\n  if (typeof flags === 'string') flags = toFlags(flags)\n  if (typeof mode === 'string') mode = toMode(mode)\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    return binding.openSync(req.handle, filepath, flags, mode)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'open',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function close(fd, cb) {\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.close(req.handle, fd)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, { operation: 'close', code: e.code, fd })\n  }\n\n  return done(err, cb)\n}\n\nfunction closeSync(fd) {\n  using req = FileRequest.borrow()\n\n  try {\n    binding.closeSync(req.handle, fd)\n  } catch (e) {\n    throw new FileError(e.message, { operation: 'close', code: e.code, fd })\n  }\n}\n\nasync function access(filepath, mode = constants.F_OK, cb) {\n  if (typeof mode === 'function') {\n    cb = mode\n    mode = constants.F_OK\n  }\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.access(req.handle, filepath, mode)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'access',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction accessSync(filepath, mode = constants.F_OK) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.accessSync(req.handle, filepath, mode)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'access',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function exists(filepath, cb) {\n  let ok = true\n  try {\n    await access(filepath)\n  } catch {\n    ok = false\n  }\n\n  return done(null, ok, cb)\n}\n\nfunction existsSync(filepath) {\n  try {\n    accessSync(filepath)\n  } catch {\n    return false\n  }\n\n  return true\n}\n\nasync function read(fd, buffer, offset = 0, len = buffer.byteLength - offset, pos = -1, cb) {\n  if (typeof offset === 'function') {\n    cb = offset\n    offset = 0\n    len = buffer.byteLength\n    pos = -1\n  } else if (typeof len === 'function') {\n    cb = len\n    len = buffer.byteLength - offset\n    pos = -1\n  } else if (typeof pos === 'function') {\n    cb = pos\n    pos = -1\n  }\n\n  if (typeof pos !== 'number') pos = -1\n\n  using req = FileRequest.borrow()\n\n  let bytes\n  let err = null\n  try {\n    binding.read(req.handle, fd, buffer, offset, len, pos)\n\n    bytes = await req\n  } catch (e) {\n    err = new FileError(e.message, { operation: 'read', code: e.code, fd })\n  }\n\n  return done(err, bytes, cb)\n}\n\nfunction readSync(fd, buffer, offset = 0, len = buffer.byteLength - offset, pos = -1) {\n  using req = FileRequest.borrow()\n\n  try {\n    return binding.readSync(req.handle, fd, buffer, offset, len, pos)\n  } catch (e) {\n    throw new FileError(e.message, { operation: 'read', code: e.code, fd })\n  }\n}\n\nasync function readv(fd, buffers, pos = -1, cb) {\n  if (typeof pos === 'function') {\n    cb = pos\n    pos = -1\n  }\n\n  if (typeof pos !== 'number') pos = -1\n\n  using req = FileRequest.borrow()\n\n  let bytes\n  let err = null\n  try {\n    binding.readv(req.handle, fd, buffers, pos)\n\n    bytes = await req\n  } catch (e) {\n    err = new FileError(e.message, { operation: 'readv', code: e.code, fd })\n  }\n\n  return done(err, bytes, cb)\n}\n\nfunction readvSync(fd, buffers, pos = -1) {\n  if (typeof pos !== 'number') pos = -1\n\n  using req = FileRequest.borrow()\n\n  try {\n    return binding.readvSync(req.handle, fd, buffers, pos)\n  } catch (e) {\n    throw new FileError(e.message, { operation: 'readv', code: e.code, fd })\n  }\n}\n\nasync function write(fd, data, offset = 0, len, pos = -1, cb) {\n  if (typeof data === 'string') {\n    let encoding = len\n    cb = pos\n    pos = offset\n\n    if (typeof pos === 'function') {\n      cb = pos\n      pos = -1\n      encoding = 'utf8'\n    } else if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n\n    if (typeof pos === 'string') {\n      encoding = pos\n      pos = -1\n    }\n\n    data = Buffer.from(data, encoding)\n    offset = 0\n    len = data.byteLength\n  } else if (typeof offset === 'function') {\n    cb = offset\n    offset = 0\n    len = data.byteLength\n    pos = -1\n  } else if (typeof len === 'function') {\n    cb = len\n    len = data.byteLength - offset\n    pos = -1\n  } else if (typeof pos === 'function') {\n    cb = pos\n    pos = -1\n  }\n\n  if (typeof len !== 'number') len = data.byteLength - offset\n  if (typeof pos !== 'number') pos = -1\n\n  using req = FileRequest.borrow()\n\n  let bytes\n  let err = null\n  try {\n    binding.write(req.handle, fd, data, offset, len, pos)\n\n    bytes = await req\n  } catch (e) {\n    err = new FileError(e.message, { operation: 'write', code: e.code, fd })\n  }\n\n  return done(err, bytes, cb)\n}\n\nfunction writeSync(fd, data, offset = 0, len, pos = -1) {\n  if (typeof data === 'string') {\n    let encoding = len\n    pos = offset\n\n    if (typeof pos === 'string') {\n      encoding = pos\n      pos = -1\n    }\n\n    data = Buffer.from(data, encoding)\n    offset = 0\n    len = data.byteLength\n  }\n\n  if (typeof len !== 'number') len = data.byteLength - offset\n  if (typeof pos !== 'number') pos = -1\n\n  using req = FileRequest.borrow()\n\n  try {\n    return binding.writeSync(req.handle, fd, data, offset, len, pos)\n  } catch (e) {\n    throw new FileError(e.message, { operation: 'write', code: e.code, fd })\n  }\n}\n\nasync function writev(fd, buffers, pos = -1, cb) {\n  if (typeof pos === 'function') {\n    cb = pos\n    pos = -1\n  }\n\n  if (typeof pos !== 'number') pos = -1\n\n  using req = FileRequest.borrow()\n\n  let bytes\n  let err = null\n  try {\n    binding.writev(req.handle, fd, buffers, pos)\n\n    bytes = await req\n  } catch (e) {\n    err = new FileError(e.message, { operation: 'writev', code: e.code, fd })\n  }\n\n  return done(err, bytes, cb)\n}\n\nfunction writevSync(fd, buffers, pos = -1) {\n  if (typeof pos !== 'number') pos = -1\n\n  using req = FileRequest.borrow()\n\n  try {\n    return binding.writevSync(req.handle, fd, buffers, pos)\n  } catch (e) {\n    throw new FileError(e.message, { operation: 'writev', code: e.code, fd })\n  }\n}\n\nasync function stat(filepath, cb) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let st\n  let err = null\n  try {\n    binding.stat(req.handle, filepath)\n\n    await req\n\n    st = new Stats(...binding.requestResultStat(req.handle))\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'stat',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, st, cb)\n}\n\nfunction statSync(filepath) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.statSync(req.handle, filepath)\n\n    return new Stats(...binding.requestResultStat(req.handle))\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'stat',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function lstat(filepath, cb) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let st\n  let err = null\n  try {\n    binding.lstat(req.handle, filepath)\n\n    await req\n\n    st = new Stats(...binding.requestResultStat(req.handle))\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'lstat',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, st, cb)\n}\n\nfunction lstatSync(filepath) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.lstatSync(req.handle, filepath)\n\n    return new Stats(...binding.requestResultStat(req.handle))\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'lstat',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function fstat(fd, cb) {\n  using req = FileRequest.borrow()\n\n  let st\n  let err = null\n  try {\n    binding.fstat(req.handle, fd)\n\n    await req\n\n    st = new Stats(...binding.requestResultStat(req.handle))\n  } catch (e) {\n    err = new FileError(e.message, { operation: 'fstat', code: e.code, fd })\n  }\n\n  return done(err, st, cb)\n}\n\nfunction fstatSync(fd) {\n  using req = FileRequest.borrow()\n\n  try {\n    binding.fstatSync(req.handle, fd)\n\n    return new Stats(...binding.requestResultStat(req.handle))\n  } catch (e) {\n    throw new FileError(e.message, { operation: 'fstat', code: e.code, fd })\n  }\n}\n\nasync function ftruncate(fd, len = 0, cb) {\n  if (typeof len === 'function') {\n    cb = len\n    len = 0\n  }\n\n  if (typeof len !== 'number') len = 0\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.ftruncate(req.handle, fd, len)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, { operation: 'ftruncate', code: e.code, fd })\n  }\n\n  return done(err, cb)\n}\n\nfunction ftruncateSync(fd, len = 0) {\n  if (typeof len !== 'number') len = 0\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.ftruncateSync(req.handle, fd, len)\n  } catch (e) {\n    throw new FileError(e.message, { operation: 'ftruncate', code: e.code, fd })\n  }\n}\n\nasync function chmod(filepath, mode, cb) {\n  if (typeof mode === 'string') mode = toMode(mode)\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.chmod(req.handle, filepath, mode)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'chmod',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction chmodSync(filepath, mode) {\n  if (typeof mode === 'string') mode = toMode(mode)\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.chmodSync(req.handle, filepath, mode)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'chmod',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function fchmod(fd, mode, cb) {\n  if (typeof mode === 'string') mode = toMode(mode)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.fchmod(req.handle, fd, mode)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, { operation: 'fchmod', code: e.code, fd })\n  }\n\n  return done(err, cb)\n}\n\nfunction fchmodSync(fd, mode) {\n  if (typeof mode === 'string') mode = toMode(mode)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.fchmodSync(req.handle, fd, mode)\n  } catch (e) {\n    throw new FileError(e.message, { operation: 'fchmod', code: e.code, fd })\n  }\n}\n\nasync function utimes(filepath, atime, mtime, cb) {\n  if (typeof atime !== 'number') atime = atime.getTime() / 1000\n  if (typeof mtime !== 'number') mtime = mtime.getTime() / 1000\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.utimes(req.handle, filepath, atime, mtime)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'utimes',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction utimesSync(filepath, atime, mtime) {\n  if (typeof atime !== 'number') atime = atime.getTime() / 1000\n  if (typeof mtime !== 'number') mtime = mtime.getTime() / 1000\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.utimesSync(req.handle, filepath, atime, mtime)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'utimes',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function mkdir(filepath, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = { mode: 0o777 }\n  }\n\n  if (typeof opts === 'number') opts = { mode: opts }\n  else if (!opts) opts = {}\n\n  const mode = typeof opts.mode === 'number' ? opts.mode : 0o777\n\n  filepath = toNamespacedPath(filepath)\n\n  if (opts.recursive) {\n    let err = null\n    try {\n      try {\n        await mkdir(filepath, { mode })\n      } catch (err) {\n        if (err.code !== 'ENOENT') {\n          if (!(await stat(filepath)).isDirectory()) throw err\n        } else {\n          while (filepath.endsWith(path.sep)) filepath = filepath.slice(0, -1)\n          const i = filepath.lastIndexOf(path.sep)\n          if (i <= 0) throw err\n\n          await mkdir(filepath.slice(0, i), { mode, recursive: true })\n\n          try {\n            await mkdir(filepath, { mode })\n          } catch (err) {\n            if (!(await stat(filepath)).isDirectory()) throw err\n          }\n        }\n      }\n    } catch (e) {\n      err = e\n    }\n\n    return done(err, cb)\n  }\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.mkdir(req.handle, filepath, mode)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'mkdir',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction mkdirSync(filepath, opts) {\n  if (typeof opts === 'number') opts = { mode: opts }\n  else if (!opts) opts = {}\n\n  const mode = typeof opts.mode === 'number' ? opts.mode : 0o777\n\n  filepath = toNamespacedPath(filepath)\n\n  if (opts.recursive) {\n    try {\n      mkdirSync(filepath, { mode })\n    } catch (err) {\n      if (err.code !== 'ENOENT') {\n        if (!statSync(filepath).isDirectory()) throw err\n      } else {\n        while (filepath.endsWith(path.sep)) filepath = filepath.slice(0, -1)\n        const i = filepath.lastIndexOf(path.sep)\n        if (i <= 0) throw err\n\n        mkdirSync(filepath.slice(0, i), { mode, recursive: true })\n\n        try {\n          mkdirSync(filepath, { mode })\n        } catch (err) {\n          if (!statSync(filepath).isDirectory()) throw err\n        }\n      }\n    }\n\n    return\n  }\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.mkdirSync(req.handle, filepath, mode)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'mkdir',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function rmdir(filepath, cb) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.rmdir(req.handle, filepath)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'rmdir',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction rmdirSync(filepath) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.rmdirSync(req.handle, filepath)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'rmdir',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function rm(filepath, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (!opts) opts = {}\n\n  filepath = toNamespacedPath(filepath)\n\n  let err = null\n  try {\n    const st = await lstat(filepath)\n\n    if (st.isDirectory()) {\n      if (opts.recursive) {\n        try {\n          await rmdir(filepath)\n        } catch (err) {\n          if (err.code !== 'ENOTEMPTY') throw err\n\n          const files = await readdir(filepath)\n\n          for (const file of files) {\n            await rm(filepath + path.sep + file, opts)\n          }\n\n          await rmdir(filepath)\n        }\n      } else {\n        throw new FileError('is a directory', {\n          operation: 'rm',\n          code: 'EISDIR',\n          path: filepath\n        })\n      }\n    } else {\n      await unlink(filepath)\n    }\n  } catch (e) {\n    if (e.code !== 'ENOENT' || !opts.force) err = e\n  }\n\n  return done(err, cb)\n}\n\nfunction rmSync(filepath, opts) {\n  if (!opts) opts = {}\n\n  filepath = toNamespacedPath(filepath)\n\n  try {\n    const st = lstatSync(filepath)\n\n    if (st.isDirectory()) {\n      if (opts.recursive) {\n        try {\n          rmdirSync(filepath)\n        } catch (err) {\n          if (err.code !== 'ENOTEMPTY') throw err\n\n          const files = readdirSync(filepath)\n\n          for (const file of files) {\n            rmSync(filepath + path.sep + file, opts)\n          }\n\n          rmdirSync(filepath)\n        }\n      } else {\n        throw new FileError('is a directory', {\n          operation: 'rm',\n          code: 'EISDIR',\n          path: filepath\n        })\n      }\n    } else {\n      unlinkSync(filepath)\n    }\n  } catch (err) {\n    if (err.code !== 'ENOENT' || !opts.force) throw err\n  }\n}\n\nasync function unlink(filepath, cb) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.unlink(req.handle, filepath)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'unlink',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction unlinkSync(filepath) {\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.unlinkSync(req.handle, filepath)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'unlink',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function rename(src, dst, cb) {\n  src = toNamespacedPath(src)\n  dst = toNamespacedPath(dst)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.rename(req.handle, src, dst)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'rename',\n      code: e.code,\n      path: src,\n      destination: dst\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction renameSync(src, dst) {\n  src = toNamespacedPath(src)\n  dst = toNamespacedPath(dst)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.renameSync(req.handle, src, dst)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'rename',\n      code: e.code,\n      path: src,\n      destination: dst\n    })\n  }\n}\n\nasync function copyFile(src, dst, mode = 0, cb) {\n  if (typeof mode === 'function') {\n    cb = mode\n    mode = 0\n  }\n\n  src = toNamespacedPath(src)\n  dst = toNamespacedPath(dst)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.copyfile(req.handle, src, dst, mode)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'copyfile',\n      code: e.code,\n      path: src,\n      destination: dst\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction copyFileSync(src, dst, mode = 0) {\n  src = toNamespacedPath(src)\n  dst = toNamespacedPath(dst)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.copyfileSync(req.handle, src, dst, mode)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'copyfile',\n      code: e.code,\n      path: src,\n      destination: dst\n    })\n  }\n}\n\nasync function cp(src, dst, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (!opts) opts = {}\n\n  src = toNamespacedPath(src)\n  dst = toNamespacedPath(dst)\n\n  let err = null\n  try {\n    const st = await lstat(src)\n\n    if (st.isDirectory()) {\n      if (opts.recursive !== true) {\n        throw new FileError('is a directory', {\n          operation: 'cp',\n          code: 'EISDIR',\n          path: src\n        })\n      }\n\n      try {\n        await lstat(dst)\n      } catch (e) {\n        if (e.code === 'ENOENT') {\n          await mkdir(dst, { mode: st.mode, recursive: true })\n        } else {\n          throw e\n        }\n      }\n\n      const dir = await opendir(src)\n      for await (const { name } of dir) {\n        await cp(path.join(src, name), path.join(dst, name), opts)\n      }\n    } else if (st.isFile()) {\n      await copyFile(src, dst)\n      await chmod(dst, st.mode)\n    }\n  } catch (e) {\n    err = e\n  }\n\n  return done(err, cb)\n}\n\nasync function realpath(filepath, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  const { encoding = 'utf8' } = opts\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let res\n  let err = null\n  try {\n    binding.realpath(req.handle, filepath)\n\n    await req\n\n    res = Buffer.from(binding.requestResultString(req.handle))\n\n    if (encoding !== 'buffer') res = res.toString(encoding)\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'realpath',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, res, cb)\n}\n\nfunction realpathSync(filepath, opts) {\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  const { encoding = 'utf8' } = opts\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.realpathSync(req.handle, filepath)\n\n    let res = Buffer.from(binding.requestResultString(req.handle))\n\n    if (encoding !== 'buffer') res = res.toString(encoding)\n\n    return res\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'realpath',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function readlink(filepath, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  const { encoding = 'utf8' } = opts\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let res\n  let err = null\n  try {\n    binding.readlink(req.handle, filepath)\n\n    await req\n\n    res = Buffer.from(binding.requestResultString(req.handle))\n\n    if (encoding !== 'buffer') res = res.toString(encoding)\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'readlink',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, res, cb)\n}\n\nfunction readlinkSync(filepath, opts) {\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  const { encoding = 'utf8' } = opts\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.readlinkSync(req.handle, filepath)\n\n    let res = Buffer.from(binding.requestResultString(req.handle))\n\n    if (encoding !== 'buffer') res = res.toString(encoding)\n\n    return res\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'readlink',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nfunction normalizeSymlinkTarget(target, type, filepath) {\n  if (isWindows) {\n    if (type === 'junction') target = path.resolve(filepath, '..', target)\n\n    if (path.isAbsolute(target)) return path.toNamespacedPath(target)\n\n    return target.replace(/\\//g, path.sep)\n  }\n\n  return target\n}\n\nasync function symlink(target, filepath, type, cb) {\n  if (typeof type === 'function') {\n    cb = type\n    type = null\n  }\n\n  filepath = toNamespacedPath(filepath)\n\n  if (typeof type === 'string') {\n    switch (type) {\n      case 'file':\n      default:\n        type = 0\n        break\n      case 'dir':\n        type = constants.UV_FS_SYMLINK_DIR\n        break\n      case 'junction':\n        type = constants.UV_FS_SYMLINK_JUNCTION\n        break\n    }\n  } else if (typeof type !== 'number') {\n    if (isWindows) {\n      target = path.resolve(filepath, '..', target)\n\n      try {\n        type = (await stat(target)).isDirectory()\n          ? constants.UV_FS_SYMLINK_DIR\n          : constants.UV_FS_SYMLINK_JUNCTION\n      } catch {\n        type = 0\n      }\n    } else {\n      type = 0\n    }\n  }\n\n  target = normalizeSymlinkTarget(target)\n\n  using req = FileRequest.borrow()\n\n  let err = null\n  try {\n    binding.symlink(req.handle, target, filepath, type)\n\n    await req\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'symlink',\n      code: e.code,\n      path: target,\n      destination: filepath\n    })\n  }\n\n  return done(err, cb)\n}\n\nfunction symlinkSync(target, filepath, type) {\n  filepath = toNamespacedPath(filepath)\n\n  if (typeof type === 'string') {\n    switch (type) {\n      case 'file':\n      default:\n        type = 0\n        break\n      case 'dir':\n        type = constants.UV_FS_SYMLINK_DIR\n        break\n      case 'junction':\n        type = constants.UV_FS_SYMLINK_JUNCTION\n        break\n    }\n  } else if (typeof type !== 'number') {\n    if (isWindows) {\n      target = path.resolve(filepath, '..', target)\n\n      try {\n        type = statSync(target).isDirectory()\n          ? constants.UV_FS_SYMLINK_DIR\n          : constants.UV_FS_SYMLINK_JUNCTION\n      } catch {\n        type = 0\n      }\n    } else {\n      type = 0\n    }\n  }\n\n  target = normalizeSymlinkTarget(target)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.symlinkSync(req.handle, target, filepath, type)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'symlink',\n      code: e.code,\n      path: target,\n      destination: filepath\n    })\n  }\n}\n\nasync function opendir(filepath, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  let dir\n  let err = null\n  try {\n    binding.opendir(req.handle, filepath)\n\n    await req\n\n    dir = new Dir(filepath, binding.requestResultDir(req.handle), opts)\n  } catch (e) {\n    err = new FileError(e.message, {\n      operation: 'opendir',\n      code: e.code,\n      path: filepath\n    })\n  }\n\n  return done(err, dir, cb)\n}\n\nfunction opendirSync(filepath, opts) {\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  filepath = toNamespacedPath(filepath)\n\n  using req = FileRequest.borrow()\n\n  try {\n    binding.opendirSync(req.handle, filepath)\n\n    return new Dir(filepath, binding.requestResultDir(req.handle), opts)\n  } catch (e) {\n    throw new FileError(e.message, {\n      operation: 'opendir',\n      code: e.code,\n      path: filepath\n    })\n  }\n}\n\nasync function readdir(filepath, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  const { withFileTypes = false } = opts\n\n  filepath = toNamespacedPath(filepath)\n\n  let result = []\n  let err = null\n  try {\n    const dir = await opendir(filepath)\n\n    for await (const entry of dir) {\n      result.push(withFileTypes ? entry : entry.name)\n    }\n  } catch (e) {\n    result = []\n    err = e\n  }\n\n  return done(err, result, cb)\n}\n\nfunction readdirSync(filepath, opts) {\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  const { withFileTypes = false } = opts\n\n  filepath = toNamespacedPath(filepath)\n\n  const dir = opendirSync(filepath, opts)\n  const result = []\n\n  for (const entry of dir) {\n    result.push(withFileTypes ? entry : entry.name)\n  }\n\n  return result\n}\n\nasync function readFile(filepath, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  const { encoding = 'buffer' } = opts\n\n  let fd = -1\n  let buffer = null\n  let err = null\n  try {\n    fd = await open(filepath, opts.flag || 'r')\n\n    const st = await fstat(fd)\n\n    let len = 0\n\n    if (st.size === 0) {\n      const buffers = []\n\n      while (true) {\n        buffer = Buffer.allocUnsafe(8192)\n        const r = await read(fd, buffer)\n        len += r\n        if (r === 0) break\n        buffers.push(buffer.subarray(0, r))\n      }\n\n      buffer = Buffer.concat(buffers)\n    } else {\n      buffer = Buffer.allocUnsafe(st.size)\n\n      while (true) {\n        const r = await read(fd, len ? buffer.subarray(len) : buffer)\n        len += r\n        if (r === 0 || len === buffer.byteLength) break\n      }\n\n      if (len !== buffer.byteLength) buffer = buffer.subarray(0, len)\n    }\n\n    if (encoding !== 'buffer') buffer = buffer.toString(encoding)\n  } catch (e) {\n    err = e\n  } finally {\n    if (fd !== -1) await close(fd)\n  }\n\n  return done(err, buffer, cb)\n}\n\nfunction readFileSync(filepath, opts) {\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  const { encoding = 'buffer' } = opts\n\n  let fd = -1\n  try {\n    fd = openSync(filepath, opts.flag || 'r')\n\n    const st = fstatSync(fd)\n\n    let buffer\n    let len = 0\n\n    if (st.size === 0) {\n      const buffers = []\n\n      while (true) {\n        buffer = Buffer.allocUnsafe(8192)\n        const r = readSync(fd, buffer)\n        len += r\n        if (r === 0) break\n        buffers.push(buffer.subarray(0, r))\n      }\n\n      buffer = Buffer.concat(buffers)\n    } else {\n      buffer = Buffer.allocUnsafe(st.size)\n\n      while (true) {\n        const r = readSync(fd, len ? buffer.subarray(len) : buffer)\n        len += r\n        if (r === 0 || len === buffer.byteLength) break\n      }\n\n      if (len !== buffer.byteLength) buffer = buffer.subarray(0, len)\n    }\n\n    if (encoding !== 'buffer') buffer = buffer.toString(encoding)\n\n    return buffer\n  } finally {\n    if (fd !== -1) closeSync(fd)\n  }\n}\n\nasync function writeFile(filepath, data, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  if (typeof data === 'string') data = Buffer.from(data, opts.encoding)\n\n  let fd = -1\n  let len = 0\n  let err = null\n  try {\n    fd = await open(filepath, opts.flag || 'w', opts.mode || 0o666)\n\n    while (true) {\n      len += await write(fd, len ? data.subarray(len) : data)\n      if (len === data.byteLength) break\n    }\n  } catch (e) {\n    err = e\n  } finally {\n    if (fd !== -1) await close(fd)\n  }\n\n  return done(err, len, cb)\n}\n\nfunction writeFileSync(filepath, data, opts) {\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  if (typeof data === 'string') data = Buffer.from(data, opts.encoding)\n\n  let fd = -1\n  try {\n    fd = openSync(filepath, opts.flag || 'w', opts.mode || 0o666)\n\n    let len = 0\n\n    while (true) {\n      len += writeSync(fd, len ? data.subarray(len) : data)\n      if (len === data.byteLength) break\n    }\n  } finally {\n    if (fd !== -1) closeSync(fd)\n  }\n}\n\nfunction appendFile(filepath, data, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  if (!opts.flag) opts = { ...opts, flag: 'a' }\n\n  return writeFile(filepath, data, opts, cb)\n}\n\nfunction appendFileSync(filepath, data, opts) {\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  if (!opts.flag) opts = { ...opts, flag: 'a' }\n\n  return writeFileSync(filepath, data, opts)\n}\n\nfunction watch(filepath, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (typeof opts === 'string') opts = { encoding: opts }\n  else if (!opts) opts = {}\n\n  filepath = toNamespacedPath(filepath)\n\n  return new Watcher(filepath, opts, cb)\n}\n\nclass Stats {\n  constructor(\n    dev,\n    mode,\n    nlink,\n    uid,\n    gid,\n    rdev,\n    blksize,\n    ino,\n    size,\n    blocks,\n    atimeMs,\n    mtimeMs,\n    ctimeMs,\n    birthtimeMs\n  ) {\n    this.dev = dev\n    this.mode = mode\n    this.nlink = nlink\n    this.uid = uid\n    this.gid = gid\n    this.rdev = rdev\n    this.blksize = blksize\n    this.ino = ino\n    this.size = size\n    this.blocks = blocks\n    this.atimeMs = atimeMs\n    this.mtimeMs = mtimeMs\n    this.ctimeMs = ctimeMs\n    this.birthtimeMs = birthtimeMs\n    this.atime = new Date(atimeMs)\n    this.mtime = new Date(mtimeMs)\n    this.ctime = new Date(ctimeMs)\n    this.birthtime = new Date(birthtimeMs)\n  }\n\n  isDirectory() {\n    return (this.mode & constants.S_IFMT) === constants.S_IFDIR\n  }\n\n  isFile() {\n    return (this.mode & constants.S_IFMT) === constants.S_IFREG\n  }\n\n  isBlockDevice() {\n    return (this.mode & constants.S_IFMT) === constants.S_IFBLK\n  }\n\n  isCharacterDevice() {\n    return (this.mode & constants.S_IFCHR) === constants.S_IFCHR\n  }\n\n  isFIFO() {\n    return (this.mode & constants.S_IFMT) === constants.S_IFIFO\n  }\n\n  isSymbolicLink() {\n    return (this.mode & constants.S_IFMT) === constants.S_IFLNK\n  }\n\n  isSocket() {\n    return (this.mode & constants.S_IFMT) === constants.S_IFSOCK\n  }\n}\n\nclass Dir {\n  constructor(path, handle, opts = {}) {\n    const { encoding = 'utf8', bufferSize = 32 } = opts\n\n    this.path = path\n\n    this._encoding = encoding\n    this._capacity = bufferSize\n    this._buffer = new FIFO()\n    this._ended = false\n    this._handle = handle\n  }\n\n  async read(cb) {\n    if (this._buffer.length) return ok(this._buffer.shift(), cb)\n    if (this._ended) return ok(null, cb)\n\n    using req = FileRequest.borrow()\n\n    let entries\n    let err = null\n    try {\n      req.retain(binding.readdir(req.handle, this._handle, this._capacity))\n\n      await req\n\n      entries = binding.requestResultDirents(req.handle)\n    } catch (e) {\n      err = new FileError(e.message, {\n        operation: 'readdir',\n        code: e.code,\n        path: this.path\n      })\n    }\n\n    if (err) return fail(err, cb)\n\n    if (entries.length === 0) {\n      this._ended = true\n\n      return ok(null, cb)\n    }\n\n    for (const entry of entries) {\n      let name = Buffer.from(entry.name)\n\n      if (this._encoding !== 'buffer') name = name.toString(this._encoding)\n\n      this._buffer.push(new Dirent(this.path, name, entry.type))\n    }\n\n    return ok(this._buffer.shift(), cb)\n  }\n\n  readSync() {\n    if (this._buffer.length) return this._buffer.shift()\n    if (this._ended) return null\n\n    using req = FileRequest.borrow()\n\n    let entries\n    try {\n      req.retain(binding.readdirSync(req.handle, this._handle, this._capacity))\n\n      entries = binding.requestResultDirents(req.handle)\n    } catch (e) {\n      throw new FileError(e.message, {\n        operation: 'readdir',\n        code: e.code,\n        path: this.path\n      })\n    }\n\n    if (entries.length === 0) {\n      this._ended = true\n\n      return null\n    }\n\n    for (const entry of entries) {\n      let name = Buffer.from(entry.name)\n\n      if (this._encoding !== 'buffer') name = name.toString(this._encoding)\n\n      this._buffer.push(new Dirent(this.path, name, entry.type))\n    }\n\n    return this._buffer.shift()\n  }\n\n  async close(cb) {\n    using req = FileRequest.borrow()\n\n    let err = null\n    try {\n      binding.closedir(req.handle, this._handle)\n\n      await req\n    } catch (e) {\n      err = new FileError(e.message, {\n        operation: 'closedir',\n        code: e.code,\n        path: this.path\n      })\n    }\n\n    this._handle = null\n\n    return done(err, cb)\n  }\n\n  closeSync() {\n    using req = FileRequest.borrow()\n\n    try {\n      binding.closedirSync(req.handle, this._handle)\n    } catch (e) {\n      throw new FileError(e.message, {\n        operation: 'closedir',\n        code: e.code,\n        path: this.path\n      })\n    }\n\n    this._handle = null\n  }\n\n  [Symbol.dispose]() {\n    this.closeSync()\n  }\n\n  async [Symbol.asyncDispose]() {\n    await this.close()\n  }\n\n  *[Symbol.iterator]() {\n    while (true) {\n      const entry = this.readSync()\n      if (entry === null) break\n      yield entry\n    }\n\n    this.closeSync()\n  }\n\n  async *[Symbol.asyncIterator]() {\n    while (true) {\n      const entry = await this.read()\n      if (entry === null) break\n      yield entry\n    }\n\n    await this.close()\n  }\n}\n\nclass Dirent {\n  constructor(parentPath, name, type) {\n    this.parentPath = parentPath\n    this.name = name\n    this.type = type\n  }\n\n  isFile() {\n    return this.type === constants.UV_DIRENT_FILE\n  }\n\n  isDirectory() {\n    return this.type === constants.UV_DIRENT_DIR\n  }\n\n  isSymbolicLink() {\n    return this.type === constants.UV_DIRENT_LINK\n  }\n\n  isFIFO() {\n    return this.type === constants.UV_DIRENT_FIFO\n  }\n\n  isSocket() {\n    return this.type === constants.UV_DIRENT_SOCKET\n  }\n\n  isCharacterDevice() {\n    return this.type === constants.UV_DIRENT_CHAR\n  }\n\n  isBlockDevice() {\n    return this.type === constants.UV_DIRENT_BLOCK\n  }\n}\n\nclass FileReadStream extends Readable {\n  constructor(path, opts = {}) {\n    const { eagerOpen = true } = opts\n\n    super({ eagerOpen, ...opts })\n\n    this.path = path\n    this.fd = typeof opts.fd === 'number' ? opts.fd : -1\n    this.flags = opts.flags || 'r'\n    this.mode = opts.mode || 0o666\n\n    this._offset = opts.start || 0\n    this._missing = 0\n\n    if (opts.length) {\n      this._missing = opts.length\n    } else if (typeof opts.end === 'number') {\n      this._missing = opts.end - this._offset + 1\n    } else {\n      this._missing = -1\n    }\n  }\n\n  async _open(cb) {\n    let err\n\n    if (this.fd === -1) {\n      err = null\n      try {\n        this.fd = await open(this.path, this.flags, this.mode)\n      } catch (e) {\n        err = e\n      }\n\n      if (err) return cb(err)\n    }\n\n    let st\n    err = null\n    try {\n      st = await fstat(this.fd)\n    } catch (e) {\n      err = e\n    }\n\n    if (err) return cb(err)\n\n    if (this._missing === -1) this._missing = st.size\n\n    if (st.size < this._offset) {\n      this._offset = st.size\n      this._missing = 0\n    } else if (st.size < this._offset + this._missing) {\n      this._missing = st.size - this._offset\n    }\n\n    cb(null)\n  }\n\n  async _read(size) {\n    if (this._missing <= 0) return this.push(null)\n\n    const data = Buffer.allocUnsafe(Math.min(this._missing, size))\n\n    let len\n    let err = null\n    try {\n      len = await read(this.fd, data, 0, data.byteLength, this._offset)\n    } catch (e) {\n      err = e\n    }\n\n    if (err) return this.destroy(err)\n\n    if (len === 0) return this.push(null)\n\n    if (this._missing < len) len = this._missing\n\n    this._missing -= len\n    this._offset += len\n\n    this.push(data.subarray(0, len))\n  }\n\n  async _destroy(err, cb) {\n    if (this.fd === -1) return cb(err)\n\n    err = null\n    try {\n      await close(this.fd)\n    } catch (e) {\n      err = e\n    }\n\n    cb(err)\n  }\n}\n\nclass FileWriteStream extends Writable {\n  constructor(path, opts = {}) {\n    const { eagerOpen = true } = opts\n\n    super({ eagerOpen, ...opts })\n\n    this.path = path\n    this.fd = typeof opts.fd === 'number' ? opts.fd : -1\n    this.flags = opts.flags || 'w'\n    this.mode = opts.mode || 0o666\n  }\n\n  async _open(cb) {\n    if (this.fd !== -1) return cb(null)\n\n    let err = null\n    try {\n      this.fd = await open(this.path, this.flags, this.mode)\n    } catch (e) {\n      err = e\n    }\n\n    cb(err)\n  }\n\n  async _writev(batch, cb) {\n    let err = null\n    try {\n      await writev(\n        this.fd,\n        batch.map(({ chunk }) => chunk)\n      )\n    } catch (e) {\n      err = e\n    }\n\n    cb(err)\n  }\n\n  async _destroy(err, cb) {\n    if (this.fd === -1) return cb(err)\n\n    err = null\n    try {\n      await close(this.fd)\n    } catch (e) {\n      err = e\n    }\n\n    cb(err)\n  }\n}\n\nclass Watcher extends EventEmitter {\n  constructor(path, opts, onchange) {\n    if (typeof opts === 'function') {\n      onchange = opts\n      opts = {}\n    }\n\n    if (!opts) opts = {}\n\n    const { persistent = true, recursive = false, encoding = 'utf8' } = opts\n\n    super()\n\n    this._closed = false\n    this._encoding = encoding\n    this._handle = binding.watcherInit(path, recursive, this, this._onevent, this._onclose)\n\n    if (!persistent) this.unref()\n\n    if (onchange) this.on('change', onchange)\n  }\n\n  close() {\n    if (this._closed) return\n    this._closed = true\n\n    binding.watcherClose(this._handle)\n  }\n\n  ref() {\n    if (this._handle) binding.watcherRef(this._handle)\n    return this\n  }\n\n  unref() {\n    if (this._handle) binding.watcherUnref(this._handle)\n    return this\n  }\n\n  [Symbol.asyncIterator]() {\n    const buffer = []\n    let done = false\n    let error = null\n    let next = null\n\n    this.on('change', (eventType, filename) => {\n      if (next) {\n        next.resolve({ done: false, value: { eventType, filename } })\n        next = null\n      } else {\n        buffer.push({ eventType, filename })\n      }\n    })\n      .on('error', (err) => {\n        done = true\n        error = err\n\n        if (next) {\n          next.reject(error)\n          next = null\n        }\n      })\n      .on('close', () => {\n        done = true\n\n        if (next) {\n          next.resolve({ done })\n          next = null\n        }\n      })\n\n    return {\n      next: () =>\n        new Promise((resolve, reject) => {\n          if (error) return reject(error)\n\n          if (buffer.length) return resolve({ done: false, value: buffer.shift() })\n\n          if (done) return resolve({ done })\n\n          next = { resolve, reject }\n        })\n    }\n  }\n\n  _onevent(err, events, filename) {\n    if (err) {\n      this.close()\n      this.emit('error', err)\n    } else {\n      const path =\n        this._encoding === 'buffer'\n          ? Buffer.from(filename)\n          : Buffer.from(filename).toString(this._encoding)\n\n      if (events & binding.UV_RENAME) {\n        this.emit('change', 'rename', path)\n      }\n\n      if (events & binding.UV_CHANGE) {\n        this.emit('change', 'change', path)\n      }\n    }\n  }\n\n  _onclose() {\n    this._handle = null\n\n    this.emit('close')\n  }\n}\n\nexports.access = access\nexports.appendFile = appendFile\nexports.chmod = chmod\n// exports.chown = chown TODO\nexports.close = close\nexports.copyFile = copyFile\nexports.cp = cp\nexports.exists = exists\nexports.fchmod = fchmod\n// exports.fchown = fchown TODO\n// exports.fdatasync = fdatasync TODO\nexports.fstat = fstat\n// exports.fsync = fsync TODO\nexports.ftruncate = ftruncate\n// exports.futimes = futimes TODO\n// exports.lchmod = lchmod TODO\n// exports.lchown = lchown TODO\n// exports.lutimes = lutimes TODO\n// exports.link = link TODO\nexports.lstat = lstat\nexports.mkdir = mkdir\n// exports.mkdtemp = mkdtemp TODO\nexports.open = open\nexports.opendir = opendir\nexports.read = read\nexports.readFile = readFile\nexports.readdir = readdir\nexports.readlink = readlink\nexports.readv = readv\nexports.realpath = realpath\nexports.rename = rename\nexports.rm = rm\nexports.rmdir = rmdir\nexports.stat = stat\n// exports.statfs = statfs TODO\nexports.symlink = symlink\n// exports.truncate = truncate TODO\nexports.unlink = unlink\nexports.utimes = utimes\nexports.watch = watch\nexports.write = write\nexports.writeFile = writeFile\nexports.writev = writev\n\nexports.accessSync = accessSync\nexports.appendFileSync = appendFileSync\nexports.chmodSync = chmodSync\n// exports.chownSync = chownSync TODO\nexports.closeSync = closeSync\nexports.copyFileSync = copyFileSync\nexports.existsSync = existsSync\nexports.fchmodSync = fchmodSync\n// exports.fchownSync = fchownSync TODO\n// exports.fdatasyncSync = fdatasyncSync TODO\nexports.fstatSync = fstatSync\n// exports.fsyncSync = fsyncSync TODO\nexports.ftruncateSync = ftruncateSync\n// exports.futimesSync = futimesSync TODO\n// exports.lchmodSync = lchmodSync TODO\n// exports.lchownSync = lchownSync TODO\n// exports.lutimesSync = lutimesSync TODO\n// exports.linkSync = linkSync TODO\nexports.lstatSync = lstatSync\nexports.mkdirSync = mkdirSync\n// exports.mkdtempSync = mkdtempSync TODO\nexports.openSync = openSync\nexports.opendirSync = opendirSync\nexports.readFileSync = readFileSync\nexports.readSync = readSync\nexports.readdirSync = readdirSync\nexports.readlinkSync = readlinkSync\nexports.readvSync = readvSync\nexports.realpathSync = realpathSync\nexports.renameSync = renameSync\nexports.rmSync = rmSync\nexports.rmdirSync = rmdirSync\nexports.statSync = statSync\n// exports.statfsSync = statfsSync TODO\nexports.symlinkSync = symlinkSync\n// exports.truncateSync = truncateSync TODO\nexports.unlinkSync = unlinkSync\nexports.utimesSync = utimesSync\nexports.writeFileSync = writeFileSync\nexports.writeSync = writeSync\nexports.writevSync = writevSync\n\nexports.promises = require('./promises')\n\nexports.Stats = Stats\nexports.Dir = Dir\nexports.Dirent = Dirent\nexports.Watcher = Watcher\n\nexports.ReadStream = FileReadStream\n\nexports.createReadStream = function createReadStream(path, opts) {\n  return new FileReadStream(path, opts)\n}\n\nexports.WriteStream = FileWriteStream\n\nexports.createWriteStream = function createWriteStream(path, opts) {\n  return new FileWriteStream(path, opts)\n}\n\nfunction toNamespacedPath(filepath) {\n  if (typeof filepath !== 'string') {\n    if (URL.isURL(filepath)) filepath = fileURLToPath(filepath)\n    else filepath = filepath.toString()\n  }\n\n  return path.toNamespacedPath(filepath)\n}\n\nfunction toFlags(flags) {\n  switch (flags) {\n    case 'r':\n      return constants.O_RDONLY\n    case 'rs': // Fall through.\n    case 'sr':\n      return constants.O_RDONLY | constants.O_SYNC\n    case 'r+':\n      return constants.O_RDWR\n    case 'rs+': // Fall through.\n    case 'sr+':\n      return constants.O_RDWR | constants.O_SYNC\n\n    case 'w':\n      return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY\n    case 'wx': // Fall through.\n    case 'xw':\n      return constants.O_TRUNC | constants.O_CREAT | constants.O_WRONLY | constants.O_EXCL\n\n    case 'w+':\n      return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR\n    case 'wx+': // Fall through.\n    case 'xw+':\n      return constants.O_TRUNC | constants.O_CREAT | constants.O_RDWR | constants.O_EXCL\n\n    case 'a':\n      return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY\n    case 'ax': // Fall through.\n    case 'xa':\n      return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY | constants.O_EXCL\n    case 'as': // Fall through.\n    case 'sa':\n      return constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY | constants.O_SYNC\n\n    case 'a+':\n      return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR\n    case 'ax+': // Fall through.\n    case 'xa+':\n      return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR | constants.O_EXCL\n    case 'as+': // Fall through.\n    case 'sa+':\n      return constants.O_APPEND | constants.O_CREAT | constants.O_RDWR | constants.O_SYNC\n    default:\n      return 0\n  }\n}\n\nfunction toMode(mode) {\n  return parseInt(mode, 8)\n}\nconst binding = require('../binding')\n\nmodule.exports = {\n  O_RDWR: binding.O_RDWR,\n  O_RDONLY: binding.O_RDONLY,\n  O_WRONLY: binding.O_WRONLY,\n  O_CREAT: binding.O_CREAT,\n  O_TRUNC: binding.O_TRUNC,\n  O_APPEND: binding.O_APPEND,\n\n  F_OK: binding.F_OK || 0,\n  R_OK: binding.R_OK || 0,\n  W_OK: binding.W_OK || 0,\n  X_OK: binding.X_OK || 0,\n\n  S_IFMT: binding.S_IFMT,\n  S_IFREG: binding.S_IFREG,\n  S_IFDIR: binding.S_IFDIR,\n  S_IFCHR: binding.S_IFCHR,\n  S_IFLNK: binding.S_IFLNK,\n  S_IFBLK: binding.S_IFBLK || 0,\n  S_IFIFO: binding.S_IFIFO || 0,\n  S_IFSOCK: binding.S_IFSOCK || 0,\n\n  S_IRUSR: binding.S_IRUSR || 0,\n  S_IWUSR: binding.S_IWUSR || 0,\n  S_IXUSR: binding.S_IXUSR || 0,\n  S_IRGRP: binding.S_IRGRP || 0,\n  S_IWGRP: binding.S_IWGRP || 0,\n  S_IXGRP: binding.S_IXGRP || 0,\n  S_IROTH: binding.S_IROTH || 0,\n  S_IWOTH: binding.S_IWOTH || 0,\n  S_IXOTH: binding.S_IXOTH || 0,\n\n  UV_DIRENT_UNKNOWN: binding.UV_DIRENT_UNKNOWN,\n  UV_DIRENT_FILE: binding.UV_DIRENT_FILE,\n  UV_DIRENT_DIR: binding.UV_DIRENT_DIR,\n  UV_DIRENT_LINK: binding.UV_DIRENT_LINK,\n  UV_DIRENT_FIFO: binding.UV_DIRENT_FIFO,\n  UV_DIRENT_SOCKET: binding.UV_DIRENT_SOCKET,\n  UV_DIRENT_CHAR: binding.UV_DIRENT_CHAR,\n  UV_DIRENT_BLOCK: binding.UV_DIRENT_BLOCK,\n\n  COPYFILE_EXCL: binding.UV_FS_COPYFILE_EXCL,\n  COPYFILE_FICLONE: binding.UV_FS_COPYFILE_FICLONE,\n  COPYFILE_FICLONE_FORCE: binding.UV_FS_COPYFILE_FICLONE_FORCE,\n  UV_FS_SYMLINK_DIR: binding.UV_FS_SYMLINK_DIR,\n  UV_FS_SYMLINK_JUNCTION: binding.UV_FS_SYMLINK_JUNCTION\n}\nconst os = require('bare-os')\n\nmodule.exports = class FileError extends Error {\n  constructor(msg, opts = {}) {\n    const { code, operation = null, path = null, destination = null, fd = -1 } = opts\n\n    if (operation !== null) msg += describe(operation, opts)\n\n    super(`${code}: ${msg}`)\n\n    this.code = code\n\n    if (operation !== null) this.operation = operation\n    if (path !== null) this.path = path\n    if (destination !== null) this.destination = destination\n    if (fd !== -1) this.fd = fd\n  }\n\n  get name() {\n    return 'FileError'\n  }\n\n  // For Node.js compatibility\n  get errno() {\n    return os.constants.errnos[this.code]\n  }\n\n  // For Node.js compatibility\n  get syscall() {\n    return this.operation\n  }\n\n  // For Node.js compatibility\n  get dest() {\n    return this.destination\n  }\n}\n\nfunction describe(operation, opts) {\n  const { path = null, destination = null, fd = -1 } = opts\n\n  let result = `, ${operation}`\n\n  if (path !== null) {\n    result += ` ${JSON.stringify(path)}`\n\n    if (destination !== null) {\n      result += ` -> ${JSON.stringify(destination)}`\n    }\n  } else if (fd !== -1) {\n    result += ` ${fd}`\n  }\n\n  return result\n}\n{\n  \"name\": \"bare-fs\",\n  \"version\": \"4.5.2\",\n  \"description\": \"Native file system operations for Javascript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./promises\": {\n      \"types\": \"./promises.d.ts\",\n      \"default\": \"./promises.js\"\n    },\n    \"./constants\": {\n      \"types\": \"./lib/constants.d.ts\",\n      \"default\": \"./lib/constants.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"promises.js\",\n    \"promises.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-fs.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-fs/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-fs#readme\",\n  \"engines\": {\n    \"bare\": \">=1.16.0\"\n  },\n  \"dependencies\": {\n    \"bare-events\": \"^2.5.4\",\n    \"bare-path\": \"^3.0.0\",\n    \"bare-stream\": \"^2.6.4\",\n    \"bare-url\": \"^2.2.2\",\n    \"fast-fifo\": \"^1.3.2\"\n  },\n  \"devDependencies\": {\n    \"bare-buffer\": \"^3.0.2\",\n    \"bare-crypto\": \"^1.11.2\",\n    \"brittle\": \"^3.1.1\",\n    \"cmake-bare\": \"^1.1.7\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  },\n  \"peerDependencies\": {\n    \"bare-buffer\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bare-buffer\": {\n      \"optional\": true\n    }\n  }\n}\nconst EventEmitter = require('bare-events')\nconst fs = require('.')\n\nclass FileHandle extends EventEmitter {\n  constructor(fd) {\n    this.fd = fd\n  }\n\n  async close() {\n    await fs.close(fd)\n\n    this.fd = -1\n    this.emit('close')\n  }\n\n  async read(buffer, ...args) {\n    return {\n      bytesRead: await fs.read(this.fd, buffer, ...args),\n      buffer\n    }\n  }\n\n  async readv(buffers, ...args) {\n    return {\n      bytesRead: await fs.readv(this.fd, buffers, ...args),\n      buffers\n    }\n  }\n\n  async write(buffer, ...args) {\n    return {\n      bytesWritten: await fs.write(this.fd, buffer, ...args),\n      buffer\n    }\n  }\n\n  async writev(buffers, ...args) {\n    return {\n      bytesWritten: await fs.writev(this.fd, buffers, ...args),\n      buffers\n    }\n  }\n\n  async stat() {\n    return fs.fstat(this.fd)\n  }\n\n  async chmod(mode) {\n    await fs.fchmod(this.fd, mode)\n  }\n\n  createReadStream(opts) {\n    return fs.createReadStream(null, { ...opts, fd: this.fd })\n  }\n\n  createWriteStream(opts) {\n    return fs.createWriteStream(null, { ...opts, fd: this.fd })\n  }\n\n  async [Symbol.asyncDispose]() {\n    await this.close()\n  }\n}\n\nexports.open = async function open(filepath, flags, mode) {\n  return new FileHandle(await fs.open(filepath, flags, mode))\n}\n\nexports.access = fs.access\nexports.appendFile = fs.appendFile\nexports.chmod = fs.chmod\nexports.constants = fs.constants\nexports.copyFile = fs.copyFile\nexports.cp = fs.cp\nexports.lstat = fs.lstat\nexports.mkdir = fs.mkdir\nexports.opendir = fs.opendir\nexports.readFile = fs.readFile\nexports.readdir = fs.readdir\nexports.readlink = fs.readlink\nexports.realpath = fs.realpath\nexports.rename = fs.rename\nexports.rm = fs.rm\nexports.rmdir = fs.rmdir\nexports.stat = fs.stat\nexports.symlink = fs.symlink\nexports.unlink = fs.unlink\nexports.utimes = fs.utimes\nexports.watch = fs.watch\nexports.writeFile = fs.writeFile\nmodule.exports = require.addon()\nconst binding = require('./binding')\n\nmodule.exports = exports = function hrtime(past) {\n  let now = binding.hrtime()\n\n  if (past) now -= BigInt(past[0]) * 1000000000n + BigInt(past[1])\n\n  return [Number(now / 1000000000n), Number(now % 1000000000n)]\n}\n\nexports.bigint = function hrtime() {\n  return binding.hrtime()\n}\n{\n  \"name\": \"bare-hrtime\",\n  \"version\": \"2.1.1\",\n  \"description\": \"High-resolution timers for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-hrtime.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-hrtime/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-hrtime#readme\",\n  \"devDependencies\": {\n    \"brittle\": \"^3.2.1\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nconst errors = require('./lib/errors')\n\nconst DELIMITER = Buffer.from('\\r\\n')\nconst TERMINATOR = Buffer.from('\\r\\n\\r\\n')\n\nconst BEFORE_HEAD = 1\nconst BODY = 2\nconst BEFORE_CHUNK = 3\nconst CHUNK = 4\nconst AFTER_LAST_CHUNK = 5\n\nconst constants = {\n  REQUEST: 1,\n  RESPONSE: 2,\n  DATA: 3,\n  END: 4\n}\n\nmodule.exports = exports = class HTTPParser {\n  constructor() {\n    this._state = BEFORE_HEAD\n    this._buffer = []\n    this._buffered = 0\n    this._remaining = -1\n  }\n\n  *push(data, encoding) {\n    if (typeof data === 'string') data = Buffer.from(data, encoding)\n\n    this._buffer.push(data)\n    this._buffered += data.byteLength\n\n    while (this._buffered > 0) {\n      switch (this._state) {\n        case BEFORE_HEAD:\n          if (yield* this._onbeforehead()) continue\n          else return\n\n        case BODY:\n          if (yield* this._onbody()) continue\n          else return\n\n        case BEFORE_CHUNK:\n          if (yield* this._onbeforechunk()) continue\n          else return\n\n        case CHUNK:\n          if (yield* this._onchunk()) continue\n          else return\n\n        case AFTER_LAST_CHUNK:\n          if (yield* this._onafterlastchunk()) continue\n          else return\n      }\n    }\n  }\n\n  end() {\n    return this._consume(this._buffered)\n  }\n\n  _consume(n) {\n    const buffer = this._buffer.length === 1 ? this._buffer[0] : Buffer.concat(this._buffer)\n\n    this._buffered -= n\n    this._buffer = this._buffered > 0 ? [buffer.subarray(n)] : []\n\n    return buffer.subarray(0, n)\n  }\n\n  *_onbeforehead() {\n    const i = findSequence(this._buffer, TERMINATOR)\n    if (i < 0) return false\n\n    const data = this._consume(i).subarray(0, i - TERMINATOR.byteLength)\n\n    const lines = data.toString('latin1').split('\\r\\n')\n\n    if (lines.length === 0) throw errors.INVALID_MESSAGE()\n\n    const headers = {}\n\n    for (let i = 1, n = lines.length; i < n; i++) {\n      const [name, value] = splitHeader(lines[i])\n\n      if (name === null) throw errors.INVALID_HEADER()\n\n      headers[name.toLowerCase()] = value\n    }\n\n    if (lines[0].startsWith('HTTP/')) {\n      const [version, code, ...reason] = lines[0].split(' ')\n\n      yield {\n        type: constants.RESPONSE,\n        version,\n        code: parseInt(code, 10),\n        reason: reason.join(' '),\n        headers\n      }\n    } else {\n      const [method, url, version] = lines[0].split(' ')\n\n      yield {\n        type: constants.REQUEST,\n        version,\n        method,\n        url,\n        headers\n      }\n    }\n\n    if (headers['transfer-encoding'] === 'chunked') {\n      this._state = BEFORE_CHUNK\n    } else if (headers['content-length']) {\n      const length = parseInt(headers['content-length'], 10)\n\n      if (Number.isNaN(length) || length < 0) {\n        throw errors.INVALID_CONTENT_LENGTH()\n      }\n\n      if (length === 0) {\n        yield { type: constants.END }\n      } else {\n        this._state = BODY\n        this._remaining = length\n      }\n    } else {\n      yield { type: constants.END }\n    }\n\n    return true\n  }\n\n  *_onbody() {\n    const available = Math.min(this._buffered, this._remaining)\n\n    this._remaining -= available\n\n    const ended = this._remaining === 0\n\n    const data = this._consume(available)\n\n    if (ended) {\n      this._state = BEFORE_HEAD\n      this._remaining = -1\n    }\n\n    yield {\n      type: constants.DATA,\n      data\n    }\n\n    if (ended) yield { type: constants.END }\n\n    return true\n  }\n\n  *_onbeforechunk() {\n    const i = findSequence(this._buffer, DELIMITER)\n    if (i < 0) return false\n\n    const data = this._consume(i).subarray(0, i - DELIMITER.length)\n\n    const length = parseInt(data.toString(), 16)\n\n    if (Number.isNaN(length) || length < 0) {\n      throw errors.INVALID_CHUNK_LENGTH()\n    }\n\n    if (length === 0) {\n      this._state = AFTER_LAST_CHUNK\n    } else {\n      this._state = CHUNK\n      this._remaining = length + DELIMITER.byteLength\n    }\n\n    return true\n  }\n\n  *_onchunk() {\n    if (this._buffered < this._remaining) return false\n\n    const data = this._consume(this._remaining).subarray(0, this._remaining - DELIMITER.byteLength)\n\n    this._state = BEFORE_CHUNK\n    this._remaining = -1\n\n    yield {\n      type: constants.DATA,\n      data\n    }\n\n    return true\n  }\n\n  *_onafterlastchunk() {\n    const i = findSequence(this._buffer, DELIMITER)\n    if (i < 0) return false\n\n    this._consume(i)\n\n    this._state = BEFORE_HEAD\n\n    yield { type: constants.END }\n\n    return true\n  }\n}\n\nexports.constants = constants\n\nfunction findSequence(buffers, sequence) {\n  let hits = 0\n  let offset = 0\n\n  for (const data of buffers) {\n    for (let i = 0, n = data.byteLength; i < n; i++, offset++) {\n      if (data[i] === sequence[hits]) {\n        hits++\n\n        if (hits === sequence.length) return offset + 1\n      } else {\n        hits = data[i] === sequence[0] ? 1 : 0\n      }\n    }\n  }\n\n  return -1\n}\n\nfunction splitHeader(header) {\n  const i = header.indexOf(': ')\n\n  if (i === -1) return [null, null]\n\n  return [header.slice(0, i), header.slice(i + 2)]\n}\nmodule.exports = class HTTPParserError extends Error {\n  constructor(msg, fn = HTTPParserError, code = fn.name) {\n    super(`${code}: ${msg}`)\n\n    this.code = code\n\n    if (Error.captureStackTrace) Error.captureStackTrace(this, fn)\n  }\n\n  get name() {\n    return 'HTTPParserError'\n  }\n\n  static INVALID_MESSAGE(msg = 'Invalid HTTP message') {\n    return new HTTPParserError(msg, HTTPParserError.INVALID_MESSAGE)\n  }\n\n  static INVALID_HEADER(msg = 'Invalid HTTP header') {\n    return new HTTPParserError(msg, HTTPParserError.INVALID_HEADER)\n  }\n\n  static INVALID_CONTENT_LENGTH(msg = 'Invalid HTTP Content-Length') {\n    return new HTTPParserError(msg, HTTPParserError.INVALID_CONTENT_LENGTH)\n  }\n\n  static INVALID_CHUNK_LENGTH(msg = 'Invalid HTTP chunk length') {\n    return new HTTPParserError(msg, HTTPParserError.INVALID_CHUNK_LENGTH)\n  }\n}\n{\n  \"name\": \"bare-http-parser\",\n  \"version\": \"1.0.1\",\n  \"description\": \"Streaming HTTP request and response parser for Bare\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": \"./index.js\",\n    \"./errors\": \"./lib/errors.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-http-parser.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-http-parser/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-http-parser#readme\",\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.0\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nexports.IncomingMessage = require('./lib/incoming-message')\nexports.OutgoingMessage = require('./lib/outgoing-message')\n\nexports.Agent = require('./lib/agent')\nexports.globalAgent = exports.Agent.global\n\nexports.Server = require('./lib/server')\nexports.ServerResponse = require('./lib/server-response')\nexports.ServerConnection = require('./lib/server-connection')\n\nexports.ClientRequest = require('./lib/client-request')\nexports.ClientConnection = require('./lib/client-connection')\n\nexports.constants = require('./lib/constants')\nexports.errors = require('./lib/errors')\n\nexports.METHODS = Object.values(exports.constants.method) // For Node.js compatibility\nexports.STATUS_CODES = exports.constants.status // For Node.js compatibility\n\nexports.createServer = function createServer(opts, onrequest) {\n  return new exports.Server(opts, onrequest)\n}\n\nexports.request = function request(url, opts, onresponse) {\n  if (typeof opts === 'function') {\n    onresponse = opts\n    opts = {}\n  }\n\n  if (typeof url === 'string') url = new URL(url)\n\n  if (isURL(url)) {\n    opts = opts ? { ...url, ...opts } : { ...url }\n\n    opts.host = url.hostname\n    opts.path = url.pathname + url.search\n    opts.port = url.port ? parseInt(url.port, 10) : defaultPort(url)\n  } else {\n    opts = url ? { ...url } : {}\n\n    // For Node.js compatibility\n    opts.host = opts.hostname || opts.host\n    opts.port = typeof opts.port === 'string' ? parseInt(opts.port, 10) : opts.port\n  }\n\n  return new exports.ClientRequest(opts, onresponse)\n}\n\nexports.get = function get(url, opts, onresponse) {\n  const req = exports.request(url, opts, onresponse)\n  req.end()\n  return req\n}\n\n// https://url.spec.whatwg.org/#default-port\nfunction defaultPort(url) {\n  switch (url.protocol) {\n    case 'ftp:':\n      return 21\n    case 'http:':\n    case 'ws:':\n      return 80\n    case 'https:':\n    case 'wss:':\n      return 443\n  }\n\n  return null\n}\n\n// https://url.spec.whatwg.org/#api\nfunction isURL(url) {\n  return (\n    url !== null &&\n    typeof url === 'object' &&\n    typeof url.protocol === 'string' &&\n    typeof url.hostname === 'string' &&\n    typeof url.pathname === 'string' &&\n    typeof url.search === 'string'\n  )\n}\nconst EventEmitter = require('bare-events')\nconst tcp = require('bare-tcp')\nconst HTTPClientConnection = require('./client-connection')\n\nmodule.exports = class HTTPAgent extends EventEmitter {\n  constructor(opts = {}) {\n    super()\n\n    const { keepAlive = false, keepAliveMsecs = 1000 } = opts\n\n    this._sockets = new Map()\n    this._freeSockets = new Map()\n\n    this._keepAlive = typeof keepAlive === 'number' ? keepAlive : keepAlive ? keepAliveMsecs : -1\n\n    this._opts = { ...opts }\n  }\n\n  createConnection(opts) {\n    return tcp.createConnection(opts)\n  }\n\n  reuseSocket(socket, req) {\n    socket.ref()\n  }\n\n  keepSocketAlive(socket) {\n    if (this._keepAlive === -1) return false\n\n    socket.setKeepAlive(true, this._keepAlive)\n    socket.unref()\n\n    return true\n  }\n\n  getName(opts) {\n    return `${opts.host}:${opts.port}`\n  }\n\n  addRequest(req, opts) {\n    opts = { ...opts, ...this._opts }\n\n    const name = this.getName(opts)\n\n    let socket\n\n    if (this._freeSockets.has(name)) {\n      const sockets = this._freeSockets.get(name)\n\n      socket = sockets.pop()\n\n      if (sockets.length === 0) this._freeSockets.delete(name)\n\n      this.reuseSocket(socket, req)\n    } else {\n      const agent = this\n\n      socket = this.createConnection(opts)\n\n      socket.on('free', onfree).on('end', onremove).on('finish', onremove).on('timeout', ontimeout)\n\n      function onfree() {\n        if (agent.keepSocketAlive(socket)) {\n          onremove(false)\n\n          const sockets = agent._freeSockets.get(name)\n\n          if (sockets === undefined) agent._freeSockets.set(name, [socket])\n          else sockets.push(socket)\n        } else {\n          socket.end()\n        }\n\n        agent.emit('free', socket)\n      }\n\n      function onremove(destroy = true) {\n        for (const set of destroy ? [agent._sockets, agent._freeSockets] : [agent._sockets]) {\n          const sockets = set.get(name)\n          if (sockets === undefined) continue\n\n          const i = sockets.indexOf(socket)\n          if (i === -1) continue\n\n          const last = sockets.pop()\n          if (last !== socket) sockets[i] = last\n\n          if (sockets.length === 0) set.delete(name)\n        }\n      }\n\n      function ontimeout() {\n        const sockets = agent._freeSockets.get(name)\n        if (sockets === undefined) return\n\n        const i = sockets.indexOf(socket)\n        if (i === -1) return\n\n        const last = sockets.pop()\n        if (last !== socket) sockets[i] = last\n\n        if (sockets.length === 0) agent._freeSockets.delete(name)\n      }\n    }\n\n    const sockets = this._sockets.get(name)\n\n    if (sockets === undefined) this._sockets.set(name, [socket])\n    else sockets.push(socket)\n\n    req.socket = socket\n\n    const connection = HTTPClientConnection.from(socket, opts)\n\n    connection.req = req\n  }\n\n  destroy() {\n    for (const set of [this._sockets, this._freeSockets]) {\n      for (const [, sockets] of set) {\n        for (const socket of sockets) socket.destroy()\n      }\n    }\n  }\n\n  static global = new this({ keepAlive: 1000, timeout: 5000 })\n}\nconst HTTPParser = require('bare-http-parser')\nconst HTTPIncomingMessage = require('./incoming-message')\nconst errors = require('./errors')\n\nconst {\n  constants: { RESPONSE, DATA, END }\n} = HTTPParser\n\nconst EMPTY = Buffer.alloc(0)\n\nmodule.exports = class HTTPClientConnection {\n  static _connections = new WeakMap()\n\n  static for(socket) {\n    return this._connections.get(socket) || null\n  }\n\n  static from(socket, opts) {\n    return this.for(socket) || new this(socket, opts)\n  }\n\n  constructor(socket, opts = {}) {\n    const { IncomingMessage = HTTPIncomingMessage } = opts\n\n    this.socket = socket\n\n    this.req = null\n    this.res = null\n\n    this._IncomingMessage = IncomingMessage\n\n    this._parser = new HTTPParser()\n    this._idle = true\n\n    this._onerror = this._onerror.bind(this)\n    this._onclose = this._onclose.bind(this)\n    this._onend = this._onend.bind(this)\n    this._ondata = this._ondata.bind(this)\n    this._ondrain = this._ondrain.bind(this)\n    this._ontimeout = this._ontimeout.bind(this)\n\n    socket\n      .on('error', this._onerror)\n      .on('close', this._onclose)\n      .on('end', this._onend)\n      .on('data', this._ondata)\n      .on('drain', this._ondrain)\n      .on('timeout', this._ontimeout)\n\n    HTTPClientConnection._connections.set(socket, this)\n  }\n\n  get idle() {\n    return this._idle\n  }\n\n  _onerror(err) {\n    if (this.req) this.req.destroy(err)\n  }\n\n  _onclose() {\n    if (this.req) this.req._continueFinal()\n  }\n\n  _onend() {\n    if (this.req) this.req.destroy(errors.CONNECTION_LOST())\n  }\n\n  _ondata(data) {\n    this._idle = false\n\n    try {\n      for (const op of this._parser.push(data)) {\n        switch (op.type) {\n          case RESPONSE:\n            this.req.on('close', () => {\n              this.req = null\n            })\n\n            this.res = new this._IncomingMessage(this.socket, op.headers, {\n              statusCode: op.code,\n              statusMessage: op.reason\n            })\n\n            this.res.on('close', () => {\n              this.res = null\n\n              this._idle = true\n\n              this.socket.emit('free')\n            })\n\n            if (op.headers.connection && op.headers.connection.toLowerCase() === 'upgrade') {\n              return this._onupgrade(this._parser.end())\n            }\n\n            this.req.emit('response', this.res)\n            break\n\n          case DATA:\n            this.res.push(op.data)\n            break\n\n          case END:\n            if (this.res) this.res.push(null)\n            if (this.req) this.req._continueFinal()\n            break\n        }\n      }\n    } catch (err) {\n      this.socket.destroy(err)\n    }\n  }\n\n  _onupgrade(data) {\n    this._ondetach()\n\n    const req = this.req\n\n    req.upgrade = true\n    req.destroy()\n\n    if (req.emit('upgrade', this.res, this.socket, data || EMPTY)) return\n\n    this.socket.destroy()\n  }\n\n  _ontimeout() {\n    if (this.req) this.req.emit('timeout')\n  }\n\n  _ondrain() {\n    if (this.req) this.req._continueWrite()\n  }\n\n  _ondetach() {\n    this.socket\n      .off('error', this._onerror)\n      .off('close', this._onclose)\n      .off('end', this._onend)\n      .off('data', this._ondata)\n      .off('drain', this._ondrain)\n      .off('timeout', this._ontimeout)\n\n    HTTPClientConnection._connections.delete(this.socket)\n  }\n}\nconst HTTPAgent = require('./agent')\nconst HTTPOutgoingMessage = require('./outgoing-message')\n\nconst CHUNK_DELIMITER = Buffer.from('\\r\\n')\nconst CHUNK_TERMINATOR = Buffer.from('0\\r\\n\\r\\n')\n\nmodule.exports = class HTTPClientRequest extends HTTPOutgoingMessage {\n  constructor(opts = {}, onresponse = null) {\n    if (typeof opts === 'function') {\n      onresponse = opts\n      opts = {}\n    }\n\n    opts = opts ? { ...opts } : {}\n\n    const agent = opts.agent === false ? new HTTPAgent() : opts.agent || HTTPAgent.global\n    const method = opts.method || 'GET'\n    const path = opts.path || '/'\n    const host = (opts.host = opts.host || 'localhost')\n    const port = (opts.port = opts.port || 80)\n    const headers = { host: host + (port === 80 ? '' : ':' + port), ...opts.headers }\n\n    super()\n\n    agent.addRequest(this, opts)\n\n    this.method = method\n    this.path = path\n    this.headers = headers\n\n    this._chunked = method !== 'GET' && method !== 'HEAD'\n\n    this._pendingFinal = null\n\n    if (onresponse) this.once('response', onresponse)\n  }\n\n  // For Node.js compatibility\n  abort() {\n    return this.destroy()\n  }\n\n  _header() {\n    let h = `${this.method} ${this.path} HTTP/1.1\\r\\n`\n\n    let upgrade = false\n\n    for (const name of Object.keys(this.headers)) {\n      const n = name.toLowerCase()\n      const v = this.headers[name]\n\n      if (n === 'content-length') this._chunked = false\n      if (n === 'connection' && v && v.toLowerCase() === 'upgrade') upgrade = true\n\n      h += `${httpCase(n)}: ${v}\\r\\n`\n    }\n\n    if (upgrade) this._chunked = false\n\n    if (this._chunked) h += 'Transfer-Encoding: chunked\\r\\n'\n\n    h += '\\r\\n'\n\n    return h\n  }\n\n  _write(data, encoding, cb) {\n    if (this.headersSent === false) this.flushHeaders()\n\n    if (this._chunked) {\n      this.socket.write(Buffer.from(data.byteLength.toString(16)))\n      this.socket.write(CHUNK_DELIMITER)\n    }\n\n    let flushed = this.socket.write(data)\n\n    if (this._chunked) flushed = this.socket.write(CHUNK_DELIMITER)\n\n    if (flushed) cb(null)\n    else this._pendingWrite = cb\n  }\n\n  _final(cb) {\n    if (this.headersSent === false) this.flushHeaders()\n\n    if (this._chunked) this.socket.write(CHUNK_TERMINATOR)\n\n    this._pendingFinal = cb\n  }\n\n  _predestroy() {\n    if (this.upgrade) return this._continueFinal()\n\n    this.socket.destroy()\n  }\n\n  _continueWrite() {\n    if (this._pendingWrite === null) return\n    const cb = this._pendingWrite\n    this._pendingWrite = null\n    cb(null)\n  }\n\n  _continueFinal() {\n    if (this._pendingFinal === null) return\n    const cb = this._pendingFinal\n    this._pendingFinal = null\n    cb(null)\n  }\n}\n\nfunction httpCase(n) {\n  let s = ''\n  for (const part of n.split('-')) {\n    s += (s ? '-' : '') + part.slice(0, 1).toUpperCase() + part.slice(1)\n  }\n  return s\n}\nmodule.exports = {\n  method: {\n    GET: 'GET',\n    HEAD: 'HEAD',\n    POST: 'POST',\n    PUT: 'PUT',\n    DELETE: 'DELETE',\n    CONNECT: 'CONNECT',\n    OPTIONS: 'OPTIONS',\n    TRACE: 'TRACE',\n    PATCH: 'PATCH'\n  },\n  status: {\n    100: 'Continue',\n    101: 'Switching Protocols',\n    102: 'Processing',\n    103: 'Early Hints',\n    200: 'OK',\n    201: 'Created',\n    202: 'Accepted',\n    203: 'Non-Authoritative Information',\n    204: 'No Content',\n    205: 'Reset Content',\n    206: 'Partial Content',\n    207: 'Multi-Status',\n    208: 'Already Reported',\n    226: 'IM Used',\n    300: 'Multiple Choices',\n    301: 'Moved Permanently',\n    302: 'Found',\n    303: 'See Other',\n    304: 'Not Modified',\n    305: 'Use Proxy',\n    307: 'Temporary Redirect',\n    308: 'Permanent Redirect',\n    400: 'Bad Request',\n    401: 'Unauthorized',\n    402: 'Payment Required',\n    403: 'Forbidden',\n    404: 'Not Found',\n    405: 'Method Not Allowed',\n    406: 'Not Acceptable',\n    407: 'Proxy Authentication Required',\n    408: 'Request Timeout',\n    409: 'Conflict',\n    410: 'Gone',\n    411: 'Length Required',\n    412: 'Precondition Failed',\n    413: 'Payload Too Large',\n    414: 'URI Too Long',\n    415: 'Unsupported Media Type',\n    416: 'Range Not Satisfiable',\n    417: 'Expectation Failed',\n    418: \"I'm a Teapot\",\n    421: 'Misdirected Request',\n    422: 'Unprocessable Entity',\n    423: 'Locked',\n    424: 'Failed Dependency',\n    425: 'Too Early',\n    426: 'Upgrade Required',\n    428: 'Precondition Required',\n    429: 'Too Many Requests',\n    431: 'Request Header Fields Too Large',\n    451: 'Unavailable For Legal Reasons',\n    500: 'Internal Server Error',\n    501: 'Not Implemented',\n    502: 'Bad Gateway',\n    503: 'Service Unavailable',\n    504: 'Gateway Timeout',\n    505: 'HTTP Version Not Supported',\n    506: 'Variant Also Negotiates',\n    507: 'Insufficient Storage',\n    508: 'Loop Detected',\n    509: 'Bandwidth Limit Exceeded',\n    510: 'Not Extended',\n    511: 'Network Authentication Required'\n  }\n}\nmodule.exports = class HTTPError extends Error {\n  constructor(msg, fn = HTTPError, code = fn.name) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'HTTPError'\n  }\n\n  static NOT_IMPLEMENTED(msg = 'Method not implemented') {\n    return new HTTPError(msg, HTTPError.NOT_IMPLEMENTED)\n  }\n\n  static CONNECTION_LOST(msg = 'Socket hung up') {\n    return new HTTPError(msg, HTTPError.CONNECTION_LOST)\n  }\n}\nconst { Readable } = require('bare-stream')\n\nmodule.exports = class HTTPIncomingMessage extends Readable {\n  constructor(socket = null, headers = {}, opts = {}) {\n    super()\n\n    this.socket = socket\n    this.headers = headers\n    this.upgrade = false\n\n    // Server options\n    this.method = opts.method || ''\n    this.url = opts.url || ''\n\n    // Client options\n    this.statusCode = opts.statusCode || 0\n    this.statusMessage = opts.statusMessage || ''\n  }\n\n  get httpVersion() {\n    return '1.1'\n  }\n\n  getHeader(name) {\n    return this.headers[name.toLowerCase()]\n  }\n\n  getHeaders() {\n    return { ...this.headers }\n  }\n\n  hasHeader(name) {\n    return name.toLowerCase() in this.headers\n  }\n\n  setTimeout(ms, ontimeout) {\n    if (ontimeout) this.once('timeout', ontimeout)\n\n    this.socket.setTimeout(ms)\n\n    return this\n  }\n\n  _predestroy() {\n    if (this.upgrade === false && this.socket !== null) this.socket.destroy()\n  }\n}\nconst { Writable } = require('bare-stream')\nconst errors = require('./errors')\n\nmodule.exports = class HTTPOutgoingMessage extends Writable {\n  constructor(socket = null) {\n    super()\n\n    this.socket = socket\n    this.headers = {}\n    this.headersSent = false\n    this.upgrade = false\n  }\n\n  getHeader(name) {\n    return this.headers[name.toLowerCase()]\n  }\n\n  getHeaders() {\n    return { ...this.headers }\n  }\n\n  hasHeader(name) {\n    return name.toLowerCase() in this.headers\n  }\n\n  setHeader(name, value) {\n    this.headers[name.toLowerCase()] = value\n  }\n\n  flushHeaders() {\n    if (this.headersSent === true || this.socket === null) return\n\n    this.socket.write(Buffer.from(this._header()))\n    this.headersSent = true\n  }\n\n  setTimeout(ms, ontimeout) {\n    if (ontimeout) this.once('timeout', ontimeout)\n\n    this.socket.setTimeout(ms)\n\n    return this\n  }\n\n  _header() {\n    throw errors.NOT_IMPLEMENTED()\n  }\n\n  _predestroy() {\n    if (this.upgrade === false && this.socket !== null) this.socket.destroy()\n  }\n}\nconst { isEnded, isFinished, getStreamError } = require('bare-stream')\nconst HTTPParser = require('bare-http-parser')\nconst HTTPIncomingMessage = require('./incoming-message')\nconst HTTPServerResponse = require('./server-response')\n\nconst {\n  constants: { REQUEST, DATA, END }\n} = HTTPParser\n\nconst EMPTY = Buffer.alloc(0)\n\nmodule.exports = class HTTPServerConnection {\n  static _connections = new WeakMap()\n\n  static for(socket) {\n    return this._connections.get(socket) || null\n  }\n\n  constructor(server, socket, opts = {}) {\n    const { IncomingMessage = HTTPIncomingMessage, ServerResponse = HTTPServerResponse } = opts\n\n    this.server = server\n    this.socket = socket\n\n    this.req = null\n    this.res = null\n\n    this._IncomingMessage = IncomingMessage\n    this._ServerResponse = ServerResponse\n\n    this._parser = new HTTPParser()\n    this._idle = true\n\n    this._onclose = this._onclose.bind(this)\n    this._ondata = this._ondata.bind(this)\n    this._ondrain = this._ondrain.bind(this)\n    this._ontimeout = this._ontimeout.bind(this)\n\n    socket\n      .on('error', noop)\n      .on('close', this._onclose)\n      .on('data', this._ondata)\n      .on('drain', this._ondrain)\n      .on('timeout', this._ontimeout)\n\n    HTTPServerConnection._connections.set(socket, this)\n\n    if (this.server.timeout) socket.setTimeout(this.server.timeout)\n  }\n\n  get idle() {\n    return this._idle\n  }\n\n  _onclose() {\n    if (this.req && !isEnded(this.req)) this.req.destroy()\n    if (this.res && !isFinished(this.res)) this.res.destroy()\n    const err = getStreamError(this.socket)\n    if (err) this.socket.destroy(err)\n  }\n\n  _ondata(data) {\n    this._idle = false\n\n    try {\n      for (const op of this._parser.push(data)) {\n        switch (op.type) {\n          case REQUEST:\n            this.req = new this._IncomingMessage(this.socket, op.headers, {\n              method: op.method,\n              url: op.url\n            })\n\n            this.req.on('close', () => {\n              this.req = null\n\n              this._idle = true\n\n              if (this.server.closing) this.socket.destroy()\n            })\n\n            // Eagerly open the request stream\n            this.req.resume()\n            this.req.pause()\n\n            if (op.headers.connection && op.headers.connection.toLowerCase() === 'upgrade') {\n              return this._onupgrade(this._parser.end())\n            }\n\n            this.res = new this._ServerResponse(\n              this.socket,\n              this.req,\n              op.headers.connection === 'close'\n            )\n\n            this.res.on('close', () => {\n              this.res = null\n            })\n\n            this.server.emit('request', this.req, this.res)\n            break\n\n          case DATA:\n            this.req.push(op.data)\n            break\n\n          case END:\n            if (this.req) this.req.push(null)\n            break\n        }\n      }\n    } catch (err) {\n      this.socket.destroy(err)\n    }\n  }\n\n  _onupgrade(data) {\n    this._ondetach()\n\n    const req = this.req\n\n    req.upgrade = true\n    req.destroy()\n\n    this.server.emit('upgrade', req, this.socket, data || EMPTY)\n  }\n\n  _ontimeout() {\n    const reqTimeout = this.req && this.req.emit('timeout')\n    const resTimeout = this.res && this.res.emit('timeout')\n    const serverTimeout = this.server.emit('timeout', this.socket)\n\n    if (!reqTimeout && !resTimeout && !serverTimeout) this.socket.destroy()\n  }\n\n  _ondrain() {\n    if (this.res) this.res._continueWrite()\n  }\n\n  _ondetach() {\n    this.socket\n      .off('error', noop)\n      .off('close', this._onclose)\n      .off('data', this._ondata)\n      .off('drain', this._ondrain)\n      .off('timeout', this._ontimeout)\n\n    HTTPServerConnection._connections.delete(this.socket)\n  }\n}\n\nfunction noop() {}\nconst HTTPOutgoingMessage = require('./outgoing-message')\nconst constants = require('./constants')\n\nconst CHUNK_DELIMITER = Buffer.from('\\r\\n')\nconst CHUNK_TERMINATOR = Buffer.from('0\\r\\n\\r\\n')\n\nmodule.exports = class HTTPServerResponse extends HTTPOutgoingMessage {\n  constructor(socket, req, close) {\n    super(socket)\n\n    this.req = req\n\n    this.statusCode = 200\n    this.statusMessage = null\n\n    this._chunked = true\n    this._close = close\n    this._finishing = false\n    this._onlyHeaders = req.method === 'HEAD'\n\n    this._pendingWrite = null\n  }\n\n  end(data) {\n    this._finishing = true\n    return super.end(data)\n  }\n\n  writeHead(statusCode, statusMessage = null, headers = {}) {\n    if (typeof statusMessage === 'object' && statusMessage !== null) {\n      headers = statusMessage\n      statusMessage = null\n    }\n\n    this.statusCode = statusCode\n    this.statusMessage = statusMessage || null\n    if (headers) this.headers = { ...this.headers, ...headers }\n  }\n\n  _header() {\n    let h =\n      'HTTP/1.1 ' +\n      this.statusCode +\n      ' ' +\n      (this.statusMessage === null ? constants.status[this.statusCode] : this.statusMessage) +\n      '\\r\\n'\n\n    for (const name of Object.keys(this.headers)) {\n      const n = name.toLowerCase()\n      const v = this.headers[name]\n\n      if (n === 'content-length') this._chunked = false\n      if (n === 'connection' && v && v.toLowerCase() === 'close') this._close = true\n\n      h += httpCase(n) + ': ' + v + '\\r\\n'\n    }\n\n    if (this._chunked) h += 'Transfer-Encoding: chunked\\r\\n'\n\n    h += '\\r\\n'\n\n    return h\n  }\n\n  _write(data, encoding, cb) {\n    if (this.headersSent === false) {\n      if (this._finishing) {\n        this.setHeader(\n          'Content-Length',\n          (data.byteLength + this._writableState.buffered).toString()\n        )\n      }\n\n      this.flushHeaders()\n    }\n\n    if (this._onlyHeaders === true) return cb(null)\n\n    if (this._chunked) {\n      this.socket.write(Buffer.from(data.byteLength.toString(16)))\n      this.socket.write(CHUNK_DELIMITER)\n    }\n\n    let flushed = this.socket.write(data)\n\n    if (this._chunked) flushed = this.socket.write(CHUNK_DELIMITER)\n\n    if (flushed) cb(null)\n    else this._pendingWrite = cb\n  }\n\n  _final(cb) {\n    if (this.headersSent === false) {\n      this.setHeader('Content-Length', '0')\n      this.flushHeaders()\n    }\n\n    if (this._chunked && this._onlyHeaders === false) {\n      this.socket.write(CHUNK_TERMINATOR)\n    }\n\n    if (this._close) this.socket.end()\n\n    cb(null)\n  }\n\n  _predestroy() {\n    super._predestroy()\n    this.req.destroy()\n    this._continueWrite()\n  }\n\n  _continueWrite() {\n    if (this._pendingWrite === null) return\n    const cb = this._pendingWrite\n    this._pendingWrite = null\n    cb(null)\n  }\n}\n\nfunction httpCase(n) {\n  let s = ''\n  for (const part of n.split('-')) {\n    s += (s ? '-' : '') + part.slice(0, 1).toUpperCase() + part.slice(1)\n  }\n  return s\n}\nconst TCPServer = require('bare-tcp').Server\nconst HTTPServerConnection = require('./server-connection')\n\nmodule.exports = class HTTPServer extends TCPServer {\n  constructor(opts = {}, onrequest) {\n    if (typeof opts === 'function') {\n      onrequest = opts\n      opts = {}\n    }\n\n    super({ allowHalfOpen: false })\n\n    this._timeout = 0\n\n    this.on('connection', (socket) => {\n      new HTTPServerConnection(this, socket, opts)\n    })\n\n    if (onrequest) this.on('request', onrequest)\n  }\n\n  get timeout() {\n    return this._timeout || undefined // For Node.js compatibility\n  }\n\n  setTimeout(ms = 0, ontimeout) {\n    if (ontimeout) this.on('timeout', ontimeout)\n\n    this._timeout = ms\n\n    return this\n  }\n\n  close(onclose) {\n    super.close(onclose)\n\n    for (const socket of this.connections) {\n      const connection = HTTPServerConnection.for(socket)\n\n      if (connection === null || connection.idle) {\n        socket.destroy()\n      }\n    }\n\n    return this\n  }\n}\n{\n  \"name\": \"bare-http1\",\n  \"version\": \"4.2.3\",\n  \"description\": \"Native HTTP/1 library for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./constants\": {\n      \"types\": \"./lib/constants.d.ts\",\n      \"default\": \"./lib/constants.js\"\n    },\n    \"./errors\": {\n      \"types\": \"./lib/errors.d.ts\",\n      \"default\": \"./lib/errors.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-http1.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-http1/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-http1#readme\",\n  \"dependencies\": {\n    \"bare-events\": \"^2.6.0\",\n    \"bare-http-parser\": \"^1.0.0\",\n    \"bare-stream\": \"^2.3.0\",\n    \"bare-tcp\": \"^2.2.0\"\n  },\n  \"devDependencies\": {\n    \"bare-buffer\": \"^3.0.2\",\n    \"bare-url\": \"^2.1.3\",\n    \"brittle\": \"^3.3.0\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  },\n  \"peerDependencies\": {\n    \"bare-buffer\": \"*\",\n    \"bare-url\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bare-buffer\": {\n      \"optional\": true\n    },\n    \"bare-url\": {\n      \"optional\": true\n    }\n  }\n}\nexports.Agent = require('./lib/agent')\nexports.globalAgent = exports.Agent.global\n\nexports.Server = require('./lib/server')\n\nexports.ClientRequest = require('./lib/client-request')\n\nexports.createServer = function createServer(opts, onrequest) {\n  return new exports.Server(opts, onrequest)\n}\n\nexports.request = function request(url, opts, onresponse) {\n  if (typeof opts === 'function') {\n    onresponse = opts\n    opts = {}\n  }\n\n  if (typeof url === 'string') url = new URL(url)\n\n  if (isURL(url)) {\n    opts = opts ? { ...url, ...opts } : { ...url }\n\n    opts.host = url.hostname\n    opts.path = url.pathname + url.search\n    opts.port = url.port ? parseInt(url.port, 10) : defaultPort(url)\n  } else {\n    opts = url ? { ...url } : {}\n\n    // For Node.js compatibility\n    opts.host = opts.hostname || opts.host\n    opts.port = typeof opts.port === 'string' ? parseInt(opts.port, 10) : opts.port\n  }\n\n  return new exports.ClientRequest(opts, onresponse)\n}\n\n// https://url.spec.whatwg.org/#default-port\nfunction defaultPort(url) {\n  switch (url.protocol) {\n    case 'ftp:':\n      return 21\n    case 'http:':\n    case 'ws:':\n      return 80\n    case 'https:':\n    case 'wss:':\n      return 443\n  }\n\n  return null\n}\n\n// https://url.spec.whatwg.org/#api\nfunction isURL(url) {\n  return (\n    url !== null &&\n    typeof url === 'object' &&\n    typeof url.protocol === 'string' &&\n    typeof url.hostname === 'string' &&\n    typeof url.pathname === 'string' &&\n    typeof url.search === 'string'\n  )\n}\nconst HTTPAgent = require('bare-http1').Agent\nconst HTTPSSocket = require('./socket')\n\nmodule.exports = class HTTPSAgent extends HTTPAgent {\n  createConnection(opts) {\n    return new HTTPSSocket(super.createConnection(opts), opts)\n  }\n\n  static global = new this({ keepAlive: 1000, timeout: 5000 })\n}\nconst HTTPClientRequest = require('bare-http1').ClientRequest\nconst HTTPSAgent = require('./agent')\n\nmodule.exports = class HTTPSClientRequest extends HTTPClientRequest {\n  constructor(opts = {}, onresponse = null) {\n    if (typeof opts === 'function') {\n      onresponse = opts\n      opts = {}\n    }\n\n    opts = opts ? { ...opts } : {}\n\n    opts.agent = opts.agent === false ? new HTTPSAgent() : opts.agent || HTTPSAgent.global\n    const host = (opts.host = opts.host || 'localhost')\n    const port = (opts.port = opts.port || 443)\n    opts.headers = { host: host + (port === 443 ? '' : ':' + port), ...opts.headers }\n\n    super(opts, onresponse)\n  }\n}\nconst TCPServer = require('bare-tcp').Server\nconst HTTPServerConnection = require('bare-http1').ServerConnection\nconst HTTPSSocket = require('./socket')\n\nmodule.exports = class HTTPSServer extends TCPServer {\n  constructor(opts = {}, onrequest) {\n    if (typeof opts === 'function') {\n      onrequest = opts\n      opts = {}\n    }\n\n    super({ allowHalfOpen: false })\n\n    this._timeout = 0\n\n    this.on('connection', (socket) => {\n      new HTTPServerConnection(this, new HTTPSSocket(socket, { ...opts, isServer: true }), opts)\n    })\n\n    if (onrequest) this.on('request', onrequest)\n  }\n\n  get timeout() {\n    return this._timeout || undefined // For Node.js compatibility\n  }\n\n  setTimeout(ms = 0, ontimeout) {\n    if (ontimeout) this.on('timeout', ontimeout)\n\n    this._timeout = ms\n\n    return this\n  }\n\n  close(onclose) {\n    super.close(onclose)\n\n    for (const socket of this.connections) {\n      const connection = HTTPServerConnection.for(socket)\n\n      if (connection === null || connection.idle) {\n        socket.destroy()\n      }\n    }\n\n    return this\n  }\n}\nconst TLSSocket = require('bare-tls').Socket\n\nmodule.exports = class HTTPSSocket extends TLSSocket {\n  setKeepAlive(...args) {\n    this.socket.setKeepAlive(...args)\n\n    return this\n  }\n\n  setNoDelay(...args) {\n    this.socket.setNoDelay(...args)\n\n    return this\n  }\n\n  setTimeout(...args) {\n    this.socket.setTimeout(...args)\n\n    return this\n  }\n\n  ref() {\n    this.socket.ref()\n\n    return this\n  }\n\n  unref() {\n    this.socket.unref()\n\n    return this\n  }\n}\n{\n  \"name\": \"bare-https\",\n  \"version\": \"2.1.2\",\n  \"description\": \"HTTPS library for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-https.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-https/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-https#readme\",\n  \"dependencies\": {\n    \"bare-http1\": \"^4.0.0\",\n    \"bare-tcp\": \"^2.2.0\",\n    \"bare-tls\": \"^2.0.0\"\n  },\n  \"devDependencies\": {\n    \"bare-fs\": \"^4.0.0\",\n    \"brittle\": \"^3.3.0\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst ansiEscapes = require('bare-ansi-escapes')\nconst getType = require('bare-type')\nconst binding = require('./binding')\n\nconst PLAIN_KEY = /^[a-zA-Z_][a-zA-Z_0-9]*$/\n\nconst defaultDepth = 2\nconst defaultBreakLength = 80\nconst defaultMaxArrayLength = 40\n\nmodule.exports = exports = function inspect(value, opts = {}) {\n  const {\n    colors = false,\n    depth = defaultDepth,\n    breakLength = defaultBreakLength,\n    stylize = defaultStylize(colors)\n  } = opts\n\n  const references = new InspectRefMap()\n\n  const tree = inspectValue(value, 0, {\n    colors,\n    depth,\n    breakLength,\n    stylize,\n    references\n  })\n\n  return tree.toString()\n}\n\nexports.styles = {\n  bigint: ansiEscapes.colorYellow,\n  boolean: ansiEscapes.colorYellow,\n  date: ansiEscapes.colorMagenta,\n  module: ansiEscapes.modifierUnderline,\n  name: ansiEscapes.modifierReset,\n  null: ansiEscapes.modifierBold,\n  number: ansiEscapes.colorYellow,\n  regexp: ansiEscapes.colorRed,\n  special: ansiEscapes.colorCyan,\n  string: ansiEscapes.colorGreen,\n  symbol: ansiEscapes.colorGreen,\n  undefined: ansiEscapes.colorBrightBlack\n}\n\nconst styles = exports.styles\n\nfunction defaultStylize(colors) {\n  return function stylize(value, style) {\n    const color = colors && styles[style]\n\n    if (color) return color + value + ansiEscapes.modifierReset\n\n    return value\n  }\n}\n\nclass InspectRefMap {\n  constructor() {\n    this.refs = new WeakMap()\n    this.ids = new WeakMap()\n    this.nextId = 1\n  }\n\n  has(object) {\n    return this.refs.has(object)\n  }\n\n  get(object) {\n    return this.refs.get(object) || null\n  }\n\n  set(object, ref) {\n    this.refs.set(object, ref)\n  }\n\n  id(object) {\n    let id = this.ids.get(object)\n    if (id) return id\n\n    id = this.nextId++\n    this.ids.set(object, id)\n\n    return id\n  }\n}\n\nclass InspectNode {\n  constructor(depth, length, opts) {\n    const { breakLength = defaultBreakLength, breakAlways = false } = opts\n\n    this.depth = depth\n    this.length = length\n    this.breakLength = breakLength\n    this.breakAlways = breakAlways\n  }\n\n  pad(n, string) {\n    return string.padStart(n, ' ')\n  }\n\n  indent(n, string) {\n    return '  '.repeat(n) + string\n  }\n}\n\nclass InspectRef extends InspectNode {\n  constructor(depth, opts) {\n    super(depth, '[circular *]'.length, opts)\n\n    this.refs = opts.references\n    this.count = 0\n    this.circular = false\n    this.color = opts.colors && styles.special\n  }\n\n  get id() {\n    return this.refs.id(this)\n  }\n\n  increment() {\n    return ++this.count\n  }\n\n  decrement() {\n    return --this.count\n  }\n\n  toString(opts = {}) {\n    const { offset = 0, pad = 0, indent = 0 } = opts\n\n    let value = this.pad(pad, '[circular *' + this.id + ']')\n\n    if (this.color) value = this.color + value + ansiEscapes.modifierReset\n\n    return offset ? value : this.indent(indent, value)\n  }\n}\n\nclass InspectLeaf extends InspectNode {\n  constructor(value, color, depth, opts) {\n    const length = value.length\n\n    if (value.includes('\\n')) {\n      value = value.replaceAll('\\n', '\\n' + '  '.repeat(depth))\n\n      opts = { ...opts, breakAlways: true }\n    }\n\n    super(depth, length, opts)\n\n    this.value = value\n    this.color = opts.colors && color\n  }\n\n  toString(opts = {}) {\n    const { offset = 0, pad = 0, indent = 0 } = opts\n\n    let value = this.pad(pad, this.value)\n\n    if (this.color) value = this.color + value + ansiEscapes.modifierReset\n\n    return offset ? value : this.indent(indent, value)\n  }\n}\n\nclass InspectPair extends InspectNode {\n  constructor(delim, left, right, depth, opts) {\n    const length = left.length + delim.length + right.length\n\n    if (left.breakAlways || right.breakAlways) {\n      opts = { ...opts, breakAlways: true }\n    }\n\n    super(depth, length, opts)\n\n    this.delim = delim\n    this.left = left\n    this.right = right\n  }\n\n  toString(opts = {}) {\n    const { indent = 0 } = opts\n\n    return this.indent(\n      indent,\n      this.left +\n        this.delim +\n        this.right.toString({\n          indent,\n          offset: this.left.length + this.delim.length\n        })\n    )\n  }\n}\n\nclass InspectSuspension extends InspectNode {\n  constructor(overflow, depth, opts) {\n    const label = `... ${overflow} more`\n\n    super(depth, label.length, opts)\n\n    this.label = label\n  }\n\n  toString(opts = {}) {\n    const { indent = 0 } = opts\n\n    return this.indent(indent, this.label)\n  }\n}\n\nclass InspectSequence extends InspectNode {\n  constructor(header, footer, delim, values, ref, depth, opts) {\n    const { tabulate = false } = opts\n\n    const length =\n      (ref.circular ? '<ref *>'.length + 1 : 0) +\n      header.length +\n      values.reduce(\n        (length, value, i) =>\n          length + value.length + (i === 0 ? 0 : delim.length),\n        0\n      ) +\n      footer.length\n\n    if (values.some((value) => value.breakAlways)) {\n      opts = { ...opts, breakAlways: true }\n    }\n\n    super(depth, length, opts)\n\n    this.header = header\n    this.footer = footer\n    this.delim = delim\n    this.values = values\n    this.ref = ref\n    this.tabulate = tabulate\n  }\n\n  toString(opts = {}) {\n    const { offset = 0, indent = 0 } = opts\n\n    const split =\n      this.breakAlways ||\n      (this.values.length &&\n        (offset + this.length > this.breakLength ||\n          indent * 2 + this.length > this.breakLength))\n\n    let header = this.header\n\n    if (this.ref.circular) {\n      header = '<ref *' + this.ref.id + '> ' + header\n    }\n\n    if (this.values.length === 0) {\n      header = header.trimEnd()\n    }\n\n    if (offset === 0) {\n      header = this.indent(indent, header)\n    }\n\n    if (split) {\n      header = header.trimEnd() + '\\n'\n    }\n\n    let string = header\n\n    let columns = 1\n    let pad = 0\n\n    if (this.tabulate) {\n      const widest = this.values.reduce(\n        (length, value) =>\n          value.breakAlways ? length : Math.max(length, value.length),\n        0\n      )\n\n      if (widest) {\n        columns = Math.max(\n          columns,\n          Math.floor(\n            (this.breakLength - indent * 2) / (widest + this.delim.length)\n          )\n        )\n\n        if (columns > 1) pad = widest\n      }\n    }\n\n    for (let i = 0, n = this.values.length, offset = 0; i < n; i++) {\n      const value = this.values[i]\n\n      if (split) {\n        let part\n\n        if (i % columns === 0 || value.breakAlways) {\n          part = value.toString({ indent: indent + 1, pad })\n        } else {\n          part = value.toString({ pad })\n        }\n\n        string += part\n\n        if (i < n - 1) {\n          if (i % columns === columns - 1 || this.values[i + 1].breakAlways) {\n            string += this.delim.trimEnd() + '\\n'\n          } else {\n            string += this.delim\n          }\n        }\n      } else {\n        if (i > 0) string += this.delim\n\n        string += value.toString({ offset })\n\n        offset += value.length\n      }\n    }\n\n    let footer = this.footer\n\n    if (this.values.length === 0) {\n      footer = footer.trimStart()\n    }\n\n    if (split) {\n      string += '\\n' + this.indent(indent, footer.trimStart())\n    } else {\n      string += footer\n    }\n\n    return string\n  }\n}\n\nfunction inspectValue(value, depth, opts) {\n  const type = getType(value)\n\n  if (type.isUndefined()) return inspectUndefined(depth, opts)\n  if (type.isNull()) return inspectNull(depth, opts)\n  if (type.isBoolean()) return inspectBoolean(value, depth, opts)\n  if (type.isNumber()) return inspectNumber(value, depth, opts)\n  if (type.isBigInt()) return inspectBigInt(value, depth, opts)\n  if (type.isString()) return inspectString(value, depth, opts)\n  if (type.isSymbol()) return inspectSymbol(value, depth, opts)\n  if (type.isObject()) return inspectObject(type, value, depth, opts)\n  if (type.isFunction()) return inspectFunction(type, value, depth, opts)\n  if (type.isExternal()) return inspectExternal(value, opts, opts)\n}\n\nfunction inspectUndefined(depth, opts) {\n  return new InspectLeaf('undefined', styles.undefined, depth, opts)\n}\n\nfunction inspectNull(depth, opts) {\n  return new InspectLeaf('null', styles.null, depth, opts)\n}\n\nfunction inspectBoolean(value, depth, opts) {\n  return new InspectLeaf(value.toString(), styles.boolean, depth, opts)\n}\n\nfunction inspectNumber(value, depth, opts) {\n  let string\n\n  if (Object.is(value, -0)) {\n    string = '-0'\n  } else {\n    string = value.toString(10)\n  }\n\n  return new InspectLeaf(string, styles.number, depth, opts)\n}\n\nfunction inspectBigInt(value, depth, opts) {\n  return new InspectLeaf(value.toString(10) + 'n', styles.bigint, depth, opts)\n}\n\nconst STRING_ESCAPES =\n  /[\\ud800-\\udbff][\\udc00-\\udfff]|[\\u0000-\\u001f'\\\\\\ud800-\\udfff]/g\n\nfunction inspectString(value, depth, opts) {\n  // https://tc39.es/ecma262/multipage/structured-data.html#sec-quotejsonstring\n  const string = value.replace(STRING_ESCAPES, (match) => {\n    if (match.length === 2) return match\n\n    switch (match) {\n      case \"'\":\n        return \"\\\\'\"\n      case '\\\\':\n        return '\\\\\\\\'\n      case '\\b':\n        return '\\\\b'\n      case '\\t':\n        return '\\\\t'\n      case '\\n':\n        return '\\\\n'\n      case '\\f':\n        return '\\\\f'\n      case '\\r':\n        return '\\\\r'\n      default:\n        return '\\\\u' + match.charCodeAt(0).toString(16).padStart(4, '0')\n    }\n  })\n\n  return new InspectLeaf(\"'\" + string + \"'\", styles.string, depth, opts)\n}\n\nfunction inspectSymbol(value, depth, opts) {\n  return new InspectLeaf(value.toString(), styles.symbol, depth, opts)\n}\n\nfunction inspectKey(value, depth, opts) {\n  if (PLAIN_KEY.test(value)) {\n    return new InspectLeaf(value, null, depth, opts)\n  } else {\n    return inspectValue(value, depth, opts)\n  }\n}\n\nfunction inspectObject(type, object, depth, opts) {\n  const refs = opts.references\n\n  let ref = refs.get(object)\n  if (ref === null) {\n    ref = new InspectRef(depth, opts)\n    refs.set(object, ref)\n  } else if (ref.count) {\n    ref.circular = true\n    return ref\n  }\n\n  const maxDepth = typeof opts.depth === 'number' ? opts.depth : Infinity\n\n  if (maxDepth < depth) {\n    const constructor = object.constructor\n\n    return new InspectLeaf(\n      '[' +\n        (constructor && constructor.name ? constructor.name : 'Object') +\n        ']',\n      styles.special,\n      depth,\n      opts\n    )\n  }\n\n  const inspect =\n    object[Symbol.for('bare.inspect')] ||\n    object[Symbol.for('nodejs.util.inspect.custom')]\n\n  if (typeof inspect === 'function') {\n    const value = inspect.call(\n      object,\n      typeof opts.depth === 'number' ? opts.depth - depth : null,\n      {\n        colors: opts.colors,\n        breakLength: opts.breakLength,\n        stylize: opts.stylize\n      },\n      exports\n    )\n\n    if (typeof value === 'object' && value !== null) {\n      refs.set(value, ref)\n    }\n\n    if (typeof value !== 'string') {\n      return inspectValue(value, depth, opts)\n    }\n\n    return new InspectLeaf(value, null, depth, opts)\n  }\n\n  if (type.isArray()) return inspectArray(object, ref, depth, opts)\n  if (type.isDate()) return inspectDate(object, ref, depth, opts)\n  if (type.isRegExp()) return inspectRegExp(object, ref, depth, opts)\n  if (type.isError()) return inspectError(object, ref, depth, opts)\n  if (type.isPromise()) return inspectPromise(object, ref, depth, opts)\n  if (type.isMap()) return inspectMap(object, ref, depth, opts)\n  if (type.isSet()) return inspectSet(object, ref, depth, opts)\n  if (type.isWeakMap()) return inspectWeakMap(object, ref, depth, opts)\n  if (type.isWeakSet()) return inspectWeakSet(object, ref, depth, opts)\n  if (type.isWeakRef()) return inspectWeakRef(object, ref, depth, opts)\n  if (type.isArrayBuffer()) return inspectArrayBuffer(object, ref, depth, opts)\n  if (type.isSharedArrayBuffer())\n    return inspectSharedArrayBuffer(object, ref, depth, opts)\n  if (type.isTypedArray()) return inspectTypedArray(object, ref, depth, opts)\n  if (type.isDataView()) return inspectDataView(object, ref, depth, opts)\n\n  ref.increment()\n\n  const values = []\n\n  for (const key in object) {\n    if (key === 'constructor') continue\n\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(object[key], depth + 1, opts),\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  ref.decrement()\n\n  let header = '{ '\n\n  const tag = object[Symbol.toStringTag]\n\n  if (tag) header = '[' + tag + '] ' + header\n\n  if (object.constructor) {\n    const name = object.constructor.name\n\n    if (name && name !== 'Object') {\n      header = object.constructor.name + ' ' + header\n    }\n  }\n\n  return new InspectSequence(header, ' }', ', ', values, ref, depth, opts)\n}\n\nfunction inspectArray(array, ref, depth, opts) {\n  const { maxArrayLength = defaultMaxArrayLength } = opts\n\n  ref.increment()\n\n  const values = []\n\n  let remaining = Math.max(maxArrayLength, 0)\n\n  for (let i = 0, n = array.length; i < n; i++) {\n    if (remaining-- === 0) {\n      values.push(\n        new InspectSuspension(array.length - values.length, depth + 1, {\n          ...opts,\n          breakAlways: true\n        })\n      )\n\n      break\n    }\n\n    values.push(inspectValue(array[i], depth + 1, opts))\n  }\n\n  for (const key of binding.getOwnNonIndexPropertyNames(array)) {\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(array[key], depth + 1, opts),\n        depth + 1,\n        { ...opts, breakAlways: remaining < 0 }\n      )\n    )\n  }\n\n  ref.decrement()\n\n  let header = '[ '\n\n  if (array.constructor.name !== 'Array') {\n    header = array.constructor.name + '(' + array.length + ') ' + header\n  }\n\n  return new InspectSequence(header, ' ]', ', ', values, ref, depth, {\n    ...opts,\n    tabulate: true\n  })\n}\n\nfunction inspectDate(date, ref, depth, opts) {\n  return new InspectLeaf(date.toISOString(), styles.date, depth, opts)\n}\n\nfunction inspectRegExp(regExp, ref, depth, opts) {\n  return new InspectLeaf(regExp.toString(), styles.regexp, depth, opts)\n}\n\nfunction inspectError(error, ref, depth, opts) {\n  let header\n\n  if ('stack' in error) {\n    header = error.stack\n\n    if (depth > 0) {\n      header = header.replaceAll('\\n', '\\n' + '  '.repeat(depth))\n    }\n  } else {\n    header = error.toString()\n  }\n\n  const builtins = ['cause']\n\n  if (error.name === 'AggregateError') {\n    builtins.push('errors')\n  } else if (error.name === 'SuppressedError') {\n    builtins.push('error', 'suppressed')\n  }\n\n  const values = []\n\n  for (const key of builtins) {\n    if (key in error === false) continue\n\n    values.push(\n      new InspectPair(\n        ': ',\n        new InspectLeaf('[' + key + ']', null, depth + 1, opts),\n        inspectValue(error[key], depth + 1, opts),\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  for (const key in error) {\n    if (key === 'constructor' || builtins.includes(key)) continue\n\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(error[key], depth + 1, opts),\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  if (values.length === 0) return new InspectLeaf(header, null, depth, opts)\n\n  return new InspectSequence(\n    header + ' {',\n    ' }',\n    ', ',\n    values,\n    ref,\n    depth,\n    opts\n  )\n}\n\nfunction inspectPromise(promise, ref, depth, opts) {\n  ref.increment()\n\n  const state = binding.getPromiseState(promise)\n\n  const values = []\n\n  switch (state) {\n    case 0: // Pending\n      values.push(new InspectLeaf('<pending>', styles.special, depth, opts))\n      break\n\n    case 1: // Fulfilled\n      values.push(inspectValue(binding.getPromiseResult(promise), depth, opts))\n      break\n\n    case 2: // Rejected\n      values.push(\n        new InspectLeaf('<rejected>', styles.special, depth, opts),\n        inspectValue(binding.getPromiseResult(promise), depth, opts)\n      )\n  }\n\n  ref.decrement()\n\n  const header = promise.constructor.name + ' { '\n\n  return new InspectSequence(header, ' }', ' ', values, ref, depth, opts)\n}\n\nfunction inspectMap(map, ref, depth, opts) {\n  const {\n    maxArrayLength = defaultMaxArrayLength,\n    maxMapLength = maxArrayLength\n  } = opts\n\n  ref.increment()\n\n  const values = []\n\n  let remaining = maxMapLength\n\n  for (const entry of map) {\n    if (remaining-- === 0) {\n      values.push(\n        new InspectSuspension(map.size - values.length, depth + 1, {\n          ...opts,\n          breakAlways: true\n        })\n      )\n      break\n    }\n\n    values.push(\n      new InspectPair(\n        ' => ',\n        inspectValue(entry[0], depth + 1, opts),\n        inspectValue(entry[1], depth + 1, opts),\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  for (const key in map) {\n    if (key === 'constructor') continue\n\n    const value = inspectValue(map[key], depth + 1, opts)\n\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        value,\n        depth + 1,\n        { ...opts, breakAlways: remaining < 0 }\n      )\n    )\n  }\n\n  ref.decrement()\n\n  const header = map.constructor.name + '(' + map.size + ') { '\n\n  return new InspectSequence(header, ' }', ', ', values, ref, depth, {\n    ...opts,\n    tabulate: true\n  })\n}\n\nfunction inspectSet(set, ref, depth, opts) {\n  const {\n    maxArrayLength = defaultMaxArrayLength,\n    maxSetLength = maxArrayLength\n  } = opts\n\n  ref.increment()\n\n  const values = []\n\n  let remaining = maxSetLength\n\n  for (const entry of set) {\n    if (remaining-- === 0) {\n      values.push(\n        new InspectSuspension(set.size - values.length, depth + 1, {\n          ...opts,\n          breakAlways: true\n        })\n      )\n      break\n    }\n\n    values.push(inspectValue(entry, depth + 1, opts))\n  }\n\n  for (const key in set) {\n    if (key === 'constructor') continue\n\n    const value = inspectValue(set[key], depth + 1, opts)\n\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        value,\n        depth + 1,\n        { ...opts, breakAlways: remaining < 0 }\n      )\n    )\n  }\n\n  ref.decrement()\n\n  const header = set.constructor.name + '(' + set.size + ') { '\n\n  return new InspectSequence(header, ' }', ', ', values, ref, depth, {\n    ...opts,\n    tabulate: true\n  })\n}\n\nfunction inspectWeakMap(weakMap, ref, depth, opts) {\n  const header = weakMap.constructor.name + ' { '\n\n  return new InspectSequence(\n    header,\n    ' }',\n    ' ',\n    [new InspectLeaf('<items unknown>', styles.special, depth + 1, opts)],\n    ref,\n    depth,\n    opts\n  )\n}\n\nfunction inspectWeakSet(weakSet, ref, depth, opts) {\n  const header = weakSet.constructor.name + ' { '\n\n  return new InspectSequence(\n    header,\n    ' }',\n    ' ',\n    [new InspectLeaf('<items unknown>', styles.special, depth + 1, opts)],\n    ref,\n    depth,\n    opts\n  )\n}\n\nfunction inspectWeakRef(weakRef, ref, depth, opts) {\n  const target = weakRef.deref()\n\n  let value\n\n  if (target === undefined) {\n    value = new InspectLeaf('<cleared>', styles.special, depth + 1, opts)\n  } else {\n    value = inspectValue(target, depth + 1, opts)\n  }\n\n  const header = weakRef.constructor.name + ' { '\n\n  return new InspectSequence(header, ' }', ' ', [value], ref, depth, opts)\n}\n\nfunction inspectArrayBuffer(arrayBuffer, ref, depth, opts) {\n  ref.increment()\n\n  const values = []\n\n  for (const key of ['byteLength']) {\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(arrayBuffer[key], depth + 1, opts),\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  ref.decrement()\n\n  const header = arrayBuffer.constructor.name + ' { '\n\n  return new InspectSequence(header, ' }', ', ', values, ref, depth, opts)\n}\n\nfunction inspectSharedArrayBuffer(sharedArrayBuffer, ref, depth, opts) {\n  ref.increment()\n\n  const values = []\n\n  for (const key of ['byteLength']) {\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(sharedArrayBuffer[key], depth + 1, opts),\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  ref.decrement()\n\n  const header = sharedArrayBuffer.constructor.name + ' { '\n\n  return new InspectSequence(header, ' }', ', ', values, ref, depth, opts)\n}\n\nfunction inspectTypedArray(typedArray, ref, depth, opts) {\n  if (Buffer.isBuffer(typedArray)) {\n    return inspectBuffer(typedArray, ref, depth, opts)\n  }\n\n  const {\n    maxArrayLength = defaultMaxArrayLength,\n    maxTypedArrayLength = maxArrayLength\n  } = opts\n\n  ref.increment()\n\n  const values = []\n\n  let remaining = Math.max(maxTypedArrayLength, 0)\n\n  for (let i = 0, n = typedArray.length; i < n; i++) {\n    if (remaining-- === 0) {\n      values.push(\n        new InspectSuspension(typedArray.length - values.length, depth + 1, {\n          ...opts,\n          breakAlways: true\n        })\n      )\n\n      break\n    }\n\n    values.push(inspectValue(typedArray[i], depth + 1, opts))\n  }\n\n  for (const key of binding.getOwnNonIndexPropertyNames(typedArray)) {\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(typedArray[key], depth + 1, opts),\n        depth + 1,\n        { ...opts, breakAlways: remaining < 0 }\n      )\n    )\n  }\n\n  ref.decrement()\n\n  const header = typedArray.constructor.name + '(' + typedArray.length + ') [ '\n\n  return new InspectSequence(header, ' ]', ', ', values, ref, depth, {\n    ...opts,\n    tabulate: true\n  })\n}\n\nfunction inspectBuffer(buffer, ref, depth, opts) {\n  const {\n    maxArrayLength = defaultMaxArrayLength,\n    maxBufferLength = maxArrayLength\n  } = opts\n\n  ref.increment()\n\n  const values = []\n\n  let remaining = Math.max(maxBufferLength, 0)\n\n  for (let i = 0, n = buffer.byteLength; i < n; i++) {\n    if (remaining-- === 0) {\n      values.push(\n        new InspectSuspension(buffer.length - values.length, depth + 1, {\n          ...opts,\n          breakAlways: true\n        })\n      )\n\n      break\n    }\n\n    values.push(\n      new InspectLeaf(\n        buffer[i].toString(16).padStart(2, '0'),\n        null,\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  for (const key of binding.getOwnNonIndexPropertyNames(buffer)) {\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(buffer[key], depth + 1, opts),\n        depth + 1,\n        { ...opts, breakAlways: remaining < 0 }\n      )\n    )\n  }\n\n  ref.decrement()\n\n  return new InspectSequence('<Buffer ', '>', ' ', values, ref, depth, {\n    ...opts,\n    tabulate: true\n  })\n}\n\nfunction inspectDataView(dataView, ref, depth, opts) {\n  ref.increment()\n\n  const values = []\n\n  for (const key of ['byteLength', 'byteOffset', 'buffer']) {\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(dataView[key], depth + 1, opts),\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  for (const key of binding.getOwnNonIndexPropertyNames(dataView)) {\n    values.push(\n      new InspectPair(\n        ': ',\n        inspectKey(key, depth + 1, opts),\n        inspectValue(dataView[key], depth + 1, opts),\n        depth + 1,\n        opts\n      )\n    )\n  }\n\n  ref.decrement()\n\n  const header = dataView.constructor.name + ' { '\n\n  return new InspectSequence(header, ' }', ', ', values, ref, depth, opts)\n}\n\nfunction inspectFunction(type, fn, depth, opts) {\n  if (fn.toString().startsWith('class')) return inspectClass(fn, depth, opts)\n\n  let tag = 'function'\n\n  if (type.isGeneratorFunction()) tag = 'generator ' + tag\n  if (type.isAsyncFunction()) tag = 'async ' + tag\n\n  return new InspectLeaf(\n    '[' + tag + ' ' + (fn.name ? fn.name : '(anonymous)') + ']',\n    styles.special,\n    depth,\n    opts\n  )\n}\n\nfunction inspectClass(ctor, depth, opts) {\n  return new InspectLeaf(\n    '[class ' + (ctor.name ? ctor.name : '(anonymous)') + ']',\n    styles.special,\n    depth,\n    opts\n  )\n}\n\nfunction inspectExternal(external, depth, opts) {\n  return new InspectLeaf(\n    '[external 0x' + binding.getExternal(external).toString(16) + ']',\n    styles.special,\n    depth,\n    opts\n  )\n}\n{\n  \"name\": \"bare-inspect\",\n  \"version\": \"3.1.4\",\n  \"description\": \"Inspect objects as strings for debugging\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-inspect.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-inspect/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-inspect#readme\",\n  \"engines\": {\n    \"bare\": \">=1.18.0\"\n  },\n  \"dependencies\": {\n    \"bare-ansi-escapes\": \"^2.1.0\",\n    \"bare-type\": \"^1.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nconst EventEmitter = require('bare-events')\nconst { Duplex } = require('bare-stream')\nconst tcp = require('bare-tcp')\nconst pipe = require('bare-pipe')\nconst constants = require('./lib/constants')\n\nconst defaultReadBufferSize = 65536\n\nexports.Socket = class NetSocket extends Duplex {\n  constructor(opts = {}) {\n    const {\n      readBufferSize = defaultReadBufferSize,\n      allowHalfOpen = true,\n      eagerOpen = false\n    } = opts\n\n    super({ eagerOpen })\n\n    this._type = 0\n    this._state = 0\n    this._socket = null\n\n    this._opts = { readBufferSize, allowHalfOpen, eagerOpen }\n\n    this._pendingWrite = null\n    this._pendingFinal = null\n  }\n\n  get connecting() {\n    return this._socket !== null && this._socket.connecting\n  }\n\n  get pending() {\n    return this._socket === null || this._socket.pending\n  }\n\n  get timeout() {\n    return this._socket === null ? undefined : this._socket.timeout\n  }\n\n  get readyState() {\n    return this._socket === null ? 'opening' : this._socket.readyState\n  }\n\n  connect(...args) {\n    let opts = {}\n    let onconnect\n\n    if (typeof args[0] === 'string') {\n      // connect(path[, onconnect])\n      opts.path = args[0]\n      onconnect = args[1]\n    } else if (typeof args[0] === 'number') {\n      // connect(port[, host][, onconnect])\n      opts.port = args[0]\n\n      if (typeof args[1] === 'function') {\n        onconnect = args[1]\n      } else {\n        opts.host = args[1]\n        onconnect = args[2]\n      }\n    } else {\n      // connect(opts[, onconnect])\n      opts = args[0] || {}\n      onconnect = args[1]\n    }\n\n    opts = { ...opts, ...this._opts }\n\n    if (opts.path) {\n      this._attach(constants.type.IPC, pipe.createConnection(opts))\n    } else {\n      this._attach(constants.type.TCP, tcp.createConnection(opts))\n    }\n\n    if (onconnect) this.once('connect', onconnect)\n\n    return this\n  }\n\n  setKeepAlive(...args) {\n    if (this._socket !== null) this._socket.setKeepAlive(...args)\n    return this\n  }\n\n  setNoDelay(...args) {\n    if (this._socket !== null) this._socket.setNoDelay(...args)\n    return this\n  }\n\n  setTimeout(...args) {\n    if (this._socket !== null) this._socket.setTimeout(...args)\n    return this\n  }\n\n  ref() {\n    this._state &= ~constants.state.UNREFED\n    if (this._socket !== null) this._socket.ref()\n    return this\n  }\n\n  unref() {\n    this._state |= constants.state.UNREFED\n    if (this._socket !== null) this._socket.unref()\n    return this\n  }\n\n  _attach(type, socket) {\n    this._type = type\n    this._socket = socket\n\n    this._socket\n      .on('connect', this._onconnect.bind(this))\n      .on('error', this._onerror.bind(this))\n      .on('close', this._onclose.bind(this))\n      .on('end', this._onend.bind(this))\n      .on('data', this._ondata.bind(this))\n      .on('drain', this._ondrain.bind(this))\n      .on('timeout', this._ontimeout.bind(this))\n\n    if (this._state & constants.state.UNREFED) this._socket.unref()\n\n    return this\n  }\n\n  _write(data, encoding, cb) {\n    if (this._socket !== null && this._socket.write(data)) cb(null)\n    else this._pendingWrite = cb\n  }\n\n  _final(cb) {\n    if (this._socket === null) return cb(null)\n    this._pendingFinal = cb\n    this._socket.end()\n  }\n\n  _predestroy() {\n    if (this._socket === null) return\n    this._socket.destroy()\n  }\n\n  _onconnect() {\n    this._ondrain() // Flush any pending writes\n\n    this.emit('connect')\n  }\n\n  _onerror(err) {\n    this.destroy(err)\n  }\n\n  _onend() {\n    this.end()\n    if (this._pendingFinal === null) return\n    const cb = this._pendingFinal\n    this._pendingFinal = null\n    cb(null)\n  }\n\n  _onclose() {\n    this.push(null)\n  }\n\n  _ondata(data) {\n    this.push(data)\n  }\n\n  _ondrain() {\n    if (this._pendingWrite === null) return\n    const cb = this._pendingWrite\n    this._pendingWrite = null\n    cb(null)\n  }\n\n  _ontimeout() {\n    this.emit('timeout')\n  }\n}\n\nexports.Server = class NetServer extends EventEmitter {\n  constructor(opts = {}, onconnection) {\n    if (typeof opts === 'function') {\n      onconnection = opts\n      opts = {}\n    }\n\n    super()\n\n    const {\n      readBufferSize = defaultReadBufferSize,\n      allowHalfOpen = true,\n      pauseOnConnect = false\n    } = opts\n\n    this._type = 0\n    this._state = 0\n    this._server = null\n\n    this._opts = { readBufferSize, allowHalfOpen, pauseOnConnect }\n\n    if (onconnection) this.on('connection', onconnection)\n  }\n\n  get listening() {\n    return this._server !== null && this._server.listening\n  }\n\n  address() {\n    return this._server === null ? null : this._server.address()\n  }\n\n  listen(...args) {\n    let opts = {}\n    let onlistening\n\n    if (typeof args[0] === 'string') {\n      // listen(path[, backlog][, onlistening])\n      opts.path = args[0]\n\n      if (typeof args[1] === 'function') {\n        onlistening = args[1]\n      } else {\n        opts.backlog = args[1]\n        onlistening = args[2]\n      }\n    } else {\n      // listen([port[, host[, backlog]]][, onlistening])\n      if (typeof args[0] === 'function') {\n        onlistening = args[0]\n      } else {\n        opts.port = args[0]\n\n        if (typeof args[1] === 'function') {\n          onlistening = args[1]\n        } else {\n          opts.host = args[1]\n\n          if (typeof args[2] === 'function') {\n            onlistening = args[2]\n          } else {\n            opts.backlog = args[2]\n            onlistening = args[3]\n          }\n        }\n      }\n    }\n\n    opts = { ...opts, ...this._opts }\n\n    if (opts.path) {\n      this._attach(constants.type.IPC, pipe.createServer(opts))\n    } else {\n      this._attach(constants.type.TCP, tcp.createServer(opts))\n    }\n\n    this._server.listen(opts)\n\n    if (onlistening) this.once('listening', onlistening)\n\n    return this\n  }\n\n  close(onclose) {\n    if (onclose) this.once('close', onclose)\n    this._server.close()\n    return this\n  }\n\n  ref() {\n    this._state &= ~constants.state.UNREFED\n    if (this._server !== null) this._server.ref()\n    return this\n  }\n\n  unref() {\n    this._state |= constants.state.UNREFED\n    if (this._server !== null) this._server.unref()\n    return this\n  }\n\n  _attach(type, server) {\n    this._type = type\n    this._server = server\n\n    this._server\n      .on('listening', this._onlistening.bind(this))\n      .on('connection', this._onconnection.bind(this))\n      .on('error', this._onerror.bind(this))\n      .on('close', this._onclose.bind(this))\n\n    if (this._state & constants.state.UNREFED) this._server.unref()\n\n    return this\n  }\n\n  _onlistening() {\n    this.emit('listening')\n  }\n\n  _onconnection(socket) {\n    this.emit(\n      'connection',\n      new exports.Socket(this._opts)._attach(this._type, socket)\n    )\n  }\n\n  _onerror(err) {\n    this.emit('error', err)\n  }\n\n  _onclose() {\n    this.emit('close')\n  }\n}\n\nexports.constants = constants\n\nexports.isIP = tcp.isIP\nexports.isIPv4 = tcp.isIPv4\nexports.isIPv6 = tcp.isIPv6\n\nexports.createConnection = function createConnection(...args) {\n  let opts = {}\n  let onconnect\n\n  if (typeof args[0] === 'string') {\n    // createConnection(path[, onconnect])\n    opts.path = args[0]\n    onconnect = args[1]\n  } else if (typeof args[0] === 'number') {\n    // createConnection(port[, host][, onconnect])\n    opts.port = args[0]\n\n    if (typeof args[1] === 'function') {\n      onconnect = args[1]\n    } else {\n      opts.host = args[1]\n      onconnect = args[2]\n    }\n  } else {\n    // createConnection(opts[, onconnect])\n    opts = args[0] || {}\n    onconnect = args[1]\n  }\n\n  return new exports.Socket(opts).connect(opts, onconnect)\n}\n\n// For Node.js compatibility\nexports.connect = exports.createConnection\n\nexports.createServer = function createServer(opts, onconnection) {\n  return new exports.Server(opts, onconnection)\n}\nmodule.exports = {\n  type: {\n    TCP: 1,\n    IPC: 2\n  },\n  state: {\n    UNREFED: 0x1\n  }\n}\n{\n  \"name\": \"bare-net\",\n  \"version\": \"2.2.0\",\n  \"description\": \"TCP and IPC servers and clients for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./constants\": {\n      \"types\": \"./lib/constants.d.ts\",\n      \"default\": \"./lib/constants.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-net.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-net/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-net#readme\",\n  \"dependencies\": {\n    \"bare-events\": \"^2.2.2\",\n    \"bare-pipe\": \"^4.0.0\",\n    \"bare-stream\": \"^2.0.0\",\n    \"bare-tcp\": \"^2.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.0\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nrequire('bare-abort-controller/global')\nrequire('bare-crypto/global')\nrequire('bare-encoding/global')\nrequire('bare-events/global')\nrequire('bare-fetch/global')\nrequire('bare-performance/global')\nrequire('bare-process/global')\nrequire('bare-stream/global')\n{\n  \"name\": \"bare-node-runtime\",\n  \"version\": \"1.1.4\",\n  \"description\": \"Compatibility layer for Node.js builtins and globals in Bare\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \"./imports\": \"./imports.json\",\n    \"./global\": \"./global.js\",\n    \"./unsupported\": \"./unsupported.js\"\n  },\n  \"files\": [\n    \"imports.json\",\n    \"global.js\",\n    \"unsupported.js\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-node-runtime.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-node-runtime/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-node-runtime#readme\",\n  \"dependencies\": {\n    \"bare-abort-controller\": \"^1.0.0\",\n    \"bare-assert\": \"^1.1.0\",\n    \"bare-async-hooks\": \"^0.0.0\",\n    \"bare-buffer\": \"^3.3.1\",\n    \"bare-console\": \"^6.0.1\",\n    \"bare-crypto\": \"^1.11.2\",\n    \"bare-dgram\": \"^1.0.1\",\n    \"bare-diagnostics-channel\": \"^1.1.0\",\n    \"bare-dns\": \"^2.1.4\",\n    \"bare-events\": \"^2.7.0\",\n    \"bare-fetch\": \"^2.5.0\",\n    \"bare-fs\": \"^4.2.3\",\n    \"bare-http1\": \"^4.0.4\",\n    \"bare-https\": \"^2.0.0\",\n    \"bare-inspector\": \"^5.0.0\",\n    \"bare-module\": \"^6.1.2\",\n    \"bare-net\": \"^2.0.2\",\n    \"bare-os\": \"^3.6.2\",\n    \"bare-path\": \"^3.0.0\",\n    \"bare-performance\": \"^1.1.0\",\n    \"bare-process\": \"^4.2.1\",\n    \"bare-punycode\": \"^0.0.0\",\n    \"bare-querystring\": \"^1.0.0\",\n    \"bare-readline\": \"^1.1.0\",\n    \"bare-repl\": \"^6.0.1\",\n    \"bare-stream\": \"^2.7.0\",\n    \"bare-string-decoder\": \"^1.0.0\",\n    \"bare-subprocess\": \"^5.1.1\",\n    \"bare-timers\": \"^3.0.3\",\n    \"bare-tls\": \"^2.1.3\",\n    \"bare-tty\": \"^5.0.3\",\n    \"bare-url\": \"^2.2.2\",\n    \"bare-utils\": \"^1.5.1\",\n    \"bare-v8\": \"^1.0.1\",\n    \"bare-vm\": \"^1.0.0\",\n    \"bare-worker\": \"^4.0.0\",\n    \"bare-zlib\": \"^1.3.1\"\n  },\n  \"devDependencies\": {\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst binding = require('./binding')\nconst errors = require('./lib/errors')\nconst constants = require('./lib/constants')\n\nexports.constants = constants\n\nexports.EOL = binding.platform === 'win32' ? '\\r\\n' : '\\n'\n\nexports.platform = function platform() {\n  return binding.platform\n}\n\nexports.arch = function arch() {\n  return binding.arch\n}\n\nexports.type = binding.type\nexports.version = binding.version\nexports.release = binding.release\nexports.machine = binding.machine\nexports.execPath = binding.execPath\nexports.pid = binding.pid\nexports.ppid = binding.ppid\nexports.cwd = binding.cwd\nexports.chdir = binding.chdir\nexports.tmpdir = binding.tmpdir\nexports.homedir = binding.homedir\nexports.hostname = binding.hostname\nexports.userInfo = binding.userInfo\n\nexports.kill = function kill(pid, signal = constants.signals.SIGTERM) {\n  if (typeof signal === 'string') {\n    if (signal in constants.signals === false) {\n      throw errors.UNKNOWN_SIGNAL('Unknown signal: ' + signal)\n    }\n\n    signal = constants.signals[signal]\n  }\n\n  binding.kill(pid, signal)\n}\n\nexports.endianness = function endianness() {\n  return binding.isLittleEndian ? 'LE' : 'BE'\n}\n\nexports.availableParallelism = binding.availableParallelism\n\nexports.cpuUsage = function cpuUsage(previous) {\n  const current = binding.cpuUsage()\n\n  if (previous) {\n    return {\n      user: current.user - previous.user,\n      system: current.system - previous.system\n    }\n  }\n\n  return current\n}\n\nexports.threadCpuUsage = function threadCpuUsage(previous) {\n  const current = binding.threadCpuUsage()\n\n  if (previous) {\n    return {\n      user: current.user - previous.user,\n      system: current.system - previous.system\n    }\n  }\n\n  return current\n}\n\nexports.resourceUsage = binding.resourceUsage\nexports.memoryUsage = binding.memoryUsage\nexports.freemem = binding.freemem\nexports.totalmem = binding.totalmem\nexports.uptime = binding.uptime\nexports.loadavg = binding.loadavg\nexports.cpus = binding.cpus\n\nexports.getProcessTitle = binding.getProcessTitle\n\nexports.setProcessTitle = function setProcessTitle(title) {\n  if (typeof title !== 'string') title = title.toString()\n\n  if (title.length >= 256) {\n    throw errors.TITLE_OVERFLOW('Process title is too long')\n  }\n\n  binding.setProcessTitle(title)\n}\n\nexports.getEnvKeys = binding.getEnvKeys\nexports.getEnv = binding.getEnv\nexports.hasEnv = binding.hasEnv\nexports.setEnv = binding.setEnv\nexports.unsetEnv = binding.unsetEnv\nconst binding = require('../binding')\n\nmodule.exports = {\n  signals: binding.signals,\n  errnos: binding.errnos\n}\nmodule.exports = class OSError extends Error {\n  constructor(msg, code, fn = OSError) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'OSError'\n  }\n\n  static UNKNOWN_SIGNAL(msg) {\n    return new OSError(msg, 'UNKNOWN_SIGNAL', OSError.UNKNOWN_SIGNAL)\n  }\n\n  static TITLE_OVERFLOW(msg) {\n    return new OSError(msg, 'TITLE_OVERFLOW', OSError.TITLE_OVERFLOW)\n  }\n}\n{\n  \"name\": \"bare-os\",\n  \"version\": \"3.6.2\",\n  \"description\": \"Operating system utilities for Javascript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\",\n    \"./constants\": \"./lib/constants.js\",\n    \"./errors\": \"./lib/errors.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-os.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-os/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-os#readme\",\n  \"engines\": {\n    \"bare\": \">=1.14.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.1\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\n/* global Bare */\n\n// This export SHOULD NOT be shortened in any way as having the full\n// `module.exports = require(...)` statement is crucial for synthesizing\n// ESM exports.\n\nif (Bare.platform === 'win32') {\n  module.exports = require('./lib/win32')\n} else {\n  module.exports = require('./lib/posix')\n}\nmodule.exports = {\n  CHAR_UPPERCASE_A: 0x41,\n  CHAR_LOWERCASE_A: 0x61,\n  CHAR_UPPERCASE_Z: 0x5a,\n  CHAR_LOWERCASE_Z: 0x7a,\n  CHAR_DOT: 0x2e,\n  CHAR_FORWARD_SLASH: 0x2f,\n  CHAR_BACKWARD_SLASH: 0x5c,\n  CHAR_COLON: 0x3a,\n  CHAR_QUESTION_MARK: 0x3f\n}\nconst os = require('bare-os')\n\nconst { normalizeString } = require('./shared')\nconst {\n  CHAR_DOT,\n  CHAR_FORWARD_SLASH\n} = require('./constants')\n\nfunction isPosixPathSeparator (code) {\n  return code === CHAR_FORWARD_SLASH\n}\n\nexports.win32 = require('./win32')\nexports.posix = exports\n\nexports.sep = '/'\nexports.delimiter = ':'\n\nexports.resolve = function resolve (...args) {\n  let resolvedPath = ''\n  let resolvedAbsolute = false\n\n  for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n    const path = i >= 0 ? args[i] : os.cwd()\n\n    if (path.length === 0) {\n      continue\n    }\n\n    resolvedPath = `${path}/${resolvedPath}`\n    resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH\n  }\n\n  resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator)\n\n  if (resolvedAbsolute) {\n    return `/${resolvedPath}`\n  }\n\n  return resolvedPath.length > 0 ? resolvedPath : '.'\n}\n\nexports.normalize = function normalize (path) {\n  if (path.length === 0) return '.'\n\n  const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH\n  const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH\n\n  path = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator)\n\n  if (path.length === 0) {\n    if (isAbsolute) return '/'\n    return trailingSeparator ? './' : '.'\n  }\n\n  if (trailingSeparator) path += '/'\n\n  return isAbsolute ? `/${path}` : path\n}\n\nexports.isAbsolute = function isAbsolute (path) {\n  return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH\n}\n\nexports.join = function join (...args) {\n  if (args.length === 0) return '.'\n  let joined\n  for (let i = 0; i < args.length; ++i) {\n    const arg = args[i]\n    if (arg.length > 0) {\n      if (joined === undefined) joined = arg\n      else joined += `/${arg}`\n    }\n  }\n  if (joined === undefined) return '.'\n  return exports.normalize(joined)\n}\n\nexports.relative = function relative (from, to) {\n  if (from === to) return ''\n\n  from = exports.resolve(from)\n  to = exports.resolve(to)\n\n  if (from === to) return ''\n\n  const fromStart = 1\n  const fromEnd = from.length\n  const fromLen = fromEnd - fromStart\n  const toStart = 1\n  const toLen = to.length - toStart\n\n  const length = (fromLen < toLen ? fromLen : toLen)\n  let lastCommonSep = -1\n  let i = 0\n  for (; i < length; i++) {\n    const fromCode = from.charCodeAt(fromStart + i)\n    if (fromCode !== to.charCodeAt(toStart + i)) {\n      break\n    } else if (fromCode === CHAR_FORWARD_SLASH) {\n      lastCommonSep = i\n    }\n  }\n  if (i === length) {\n    if (toLen > length) {\n      if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {\n        return to.substring(toStart + i + 1)\n      }\n      if (i === 0) {\n        return to.substring(toStart + i)\n      }\n    } else if (fromLen > length) {\n      if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {\n        lastCommonSep = i\n      } else if (i === 0) {\n        lastCommonSep = 0\n      }\n    }\n  }\n\n  let out = ''\n  for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n    if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n      out += out.length === 0 ? '..' : '/..'\n    }\n  }\n\n  return `${out}${to.substring(toStart + lastCommonSep)}`\n}\n\nexports.toNamespacedPath = function toNamespacedPath (path) {\n  return path\n}\n\nexports.dirname = function dirname (path) {\n  if (path.length === 0) return '.'\n  const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH\n  let end = -1\n  let matchedSlash = true\n  for (let i = path.length - 1; i >= 1; --i) {\n    if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n      if (!matchedSlash) {\n        end = i\n        break\n      }\n    } else {\n      matchedSlash = false\n    }\n  }\n\n  if (end === -1) return hasRoot ? '/' : '.'\n  if (hasRoot && end === 1) return '//'\n  return path.substring(0, end)\n}\n\nexports.basename = function basename (path, suffix) {\n  let start = 0\n  let end = -1\n  let matchedSlash = true\n\n  if (suffix !== undefined && suffix.length > 0 && suffix.length <= path.length) {\n    if (suffix === path) { return '' }\n    let extIdx = suffix.length - 1\n    let firstNonSlashEnd = -1\n    for (let i = path.length - 1; i >= 0; --i) {\n      const code = path.charCodeAt(i)\n      if (code === CHAR_FORWARD_SLASH) {\n        if (!matchedSlash) {\n          start = i + 1\n          break\n        }\n      } else {\n        if (firstNonSlashEnd === -1) {\n          matchedSlash = false\n          firstNonSlashEnd = i + 1\n        }\n        if (extIdx >= 0) {\n          if (code === suffix.charCodeAt(extIdx)) {\n            if (--extIdx === -1) {\n              end = i\n            }\n          } else {\n            extIdx = -1\n            end = firstNonSlashEnd\n          }\n        }\n      }\n    }\n\n    if (start === end) end = firstNonSlashEnd\n    else if (end === -1) end = path.length\n    return path.substring(start, end)\n  }\n\n  for (let i = path.length - 1; i >= 0; --i) {\n    if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {\n      if (!matchedSlash) {\n        start = i + 1\n        break\n      }\n    } else if (end === -1) {\n      matchedSlash = false\n      end = i + 1\n    }\n  }\n\n  if (end === -1) return ''\n  return path.substring(start, end)\n}\n\nexports.extname = function extname (path) {\n  let startDot = -1\n  let startPart = 0\n  let end = -1\n  let matchedSlash = true\n  let preDotState = 0\n  for (let i = path.length - 1; i >= 0; --i) {\n    const code = path.charCodeAt(i)\n    if (code === CHAR_FORWARD_SLASH) {\n      if (!matchedSlash) {\n        startPart = i + 1\n        break\n      }\n      continue\n    }\n    if (end === -1) {\n      matchedSlash = false\n      end = i + 1\n    }\n    if (code === CHAR_DOT) {\n      if (startDot === -1) startDot = i\n      else if (preDotState !== 1) preDotState = 1\n    } else if (startDot !== -1) {\n      preDotState = -1\n    }\n  }\n\n  if (startDot === -1 || end === -1 || preDotState === 0 || (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {\n    return ''\n  }\n  return path.substring(startDot, end)\n}\nconst {\n  CHAR_DOT,\n  CHAR_FORWARD_SLASH\n} = require('./constants')\n\nexports.normalizeString = function normalizeString (path, allowAboveRoot, separator, isPathSeparator) {\n  let res = ''\n  let lastSegmentLength = 0\n  let lastSlash = -1\n  let dots = 0\n  let code = 0\n  for (let i = 0; i <= path.length; ++i) {\n    if (i < path.length) {\n      code = path.charCodeAt(i)\n    } else if (isPathSeparator(code)) {\n      break\n    } else {\n      code = CHAR_FORWARD_SLASH\n    }\n\n    if (isPathSeparator(code)) {\n      if (lastSlash === i - 1 || dots === 1) ;\n      else if (dots === 2) {\n        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {\n          if (res.length > 2) {\n            const lastSlashIndex = res.lastIndexOf(separator)\n            if (lastSlashIndex === -1) {\n              res = ''\n              lastSegmentLength = 0\n            } else {\n              res = res.substring(0, lastSlashIndex)\n              lastSegmentLength =\n                res.length - 1 - res.lastIndexOf(separator)\n            }\n            lastSlash = i\n            dots = 0\n            continue\n          } else if (res.length !== 0) {\n            res = ''\n            lastSegmentLength = 0\n            lastSlash = i\n            dots = 0\n            continue\n          }\n        }\n        if (allowAboveRoot) {\n          res += res.length > 0 ? `${separator}..` : '..'\n          lastSegmentLength = 2\n        }\n      } else {\n        if (res.length > 0) {\n          res += `${separator}${path.substring(lastSlash + 1, i)}`\n        } else {\n          res = path.substring(lastSlash + 1, i)\n        }\n        lastSegmentLength = i - lastSlash - 1\n      }\n      lastSlash = i\n      dots = 0\n    } else if (code === CHAR_DOT && dots !== -1) {\n      ++dots\n    } else {\n      dots = -1\n    }\n  }\n  return res\n}\nconst os = require('bare-os')\n\nconst { normalizeString } = require('./shared')\nconst {\n  CHAR_UPPERCASE_A,\n  CHAR_LOWERCASE_A,\n  CHAR_UPPERCASE_Z,\n  CHAR_LOWERCASE_Z,\n  CHAR_DOT,\n  CHAR_FORWARD_SLASH,\n  CHAR_BACKWARD_SLASH,\n  CHAR_COLON,\n  CHAR_QUESTION_MARK\n} = require('./constants')\n\nfunction isWindowsPathSeparator (code) {\n  return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH\n}\n\nfunction isWindowsDeviceRoot (code) {\n  return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||\n         (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z)\n}\n\nexports.posix = require('./posix')\nexports.win32 = exports\n\nexports.sep = '\\\\'\nexports.delimiter = ';'\n\nexports.resolve = function resolve (...args) {\n  let resolvedDevice = ''\n  let resolvedTail = ''\n  let resolvedAbsolute = false\n\n  for (let i = args.length - 1; i >= -1; i--) {\n    let path\n    if (i >= 0) {\n      path = args[i]\n\n      if (path.length === 0) continue\n    } else if (resolvedDevice.length === 0) {\n      path = os.cwd()\n    } else {\n      path = os.getEnv(`=${resolvedDevice}`) || os.cwd()\n\n      if (path === undefined || (path.substring(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {\n        path = `${resolvedDevice}\\\\`\n      }\n    }\n\n    const len = path.length\n    let rootEnd = 0\n    let device = ''\n    let isAbsolute = false\n    const code = path.charCodeAt(0)\n\n    if (len === 1) {\n      if (isWindowsPathSeparator(code)) {\n        rootEnd = 1\n        isAbsolute = true\n      }\n    } else if (isWindowsPathSeparator(code)) {\n      isAbsolute = true\n\n      if (isWindowsPathSeparator(path.charCodeAt(1))) {\n        let j = 2\n        let last = j\n        while (j < len && !isWindowsPathSeparator(path.charCodeAt(j))) {\n          j++\n        }\n        if (j < len && j !== last) {\n          const firstPart = path.substring(last, j)\n          last = j\n          while (j < len && isWindowsPathSeparator(path.charCodeAt(j))) {\n            j++\n          }\n          if (j < len && j !== last) {\n            last = j\n            while (j < len && !isWindowsPathSeparator(path.charCodeAt(j))) {\n              j++\n            }\n            if (j === len || j !== last) {\n              device = `\\\\\\\\${firstPart}\\\\${path.substring(last, j)}`\n              rootEnd = j\n            }\n          }\n        }\n      } else {\n        rootEnd = 1\n      }\n    } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n      device = path.substring(0, 2)\n      rootEnd = 2\n      if (len > 2 && isWindowsPathSeparator(path.charCodeAt(2))) {\n        isAbsolute = true\n        rootEnd = 3\n      }\n    }\n\n    if (device.length > 0) {\n      if (resolvedDevice.length > 0) {\n        if (device.toLowerCase() !== resolvedDevice.toLowerCase()) { continue }\n      } else {\n        resolvedDevice = device\n      }\n    }\n\n    if (resolvedAbsolute) {\n      if (resolvedDevice.length > 0) { break }\n    } else {\n      resolvedTail = `${path.substring(rootEnd)}\\\\${resolvedTail}`\n      resolvedAbsolute = isAbsolute\n      if (isAbsolute && resolvedDevice.length > 0) {\n        break\n      }\n    }\n  }\n\n  resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\\\', isWindowsPathSeparator)\n\n  return resolvedAbsolute ? `${resolvedDevice}\\\\${resolvedTail}` : `${resolvedDevice}${resolvedTail}` || '.'\n}\n\nexports.normalize = function normalize (path) {\n  const len = path.length\n  if (len === 0) return '.'\n  let rootEnd = 0\n  let device\n  let isAbsolute = false\n  const code = path.charCodeAt(0)\n\n  if (len === 1) {\n    return code === CHAR_FORWARD_SLASH ? '\\\\' : path\n  }\n\n  if (isWindowsPathSeparator(code)) {\n    isAbsolute = true\n\n    if (isWindowsPathSeparator(path.charCodeAt(1))) {\n      let j = 2\n      let last = j\n      while (j < len && !isWindowsPathSeparator(path.charCodeAt(j))) {\n        j++\n      }\n      if (j < len && j !== last) {\n        const firstPart = path.substring(last, j)\n        last = j\n        while (j < len && isWindowsPathSeparator(path.charCodeAt(j))) {\n          j++\n        }\n        if (j < len && j !== last) {\n          last = j\n          while (j < len && !isWindowsPathSeparator(path.charCodeAt(j))) {\n            j++\n          }\n          if (j === len) {\n            return `\\\\\\\\${firstPart}\\\\${path.substring(last)}\\\\`\n          }\n          if (j !== last) {\n            device = `\\\\\\\\${firstPart}\\\\${path.substring(last, j)}`\n            rootEnd = j\n          }\n        }\n      }\n    } else {\n      rootEnd = 1\n    }\n  } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n    device = path.substring(0, 2)\n    rootEnd = 2\n    if (len > 2 && isWindowsPathSeparator(path.charCodeAt(2))) {\n      isAbsolute = true\n      rootEnd = 3\n    }\n  }\n\n  let tail = rootEnd < len ? normalizeString(path.substring(rootEnd), !isAbsolute, '\\\\', isWindowsPathSeparator) : ''\n  if (tail.length === 0 && !isAbsolute) {\n    tail = '.'\n  }\n  if (tail.length > 0 && isWindowsPathSeparator(path.charCodeAt(len - 1))) {\n    tail += '\\\\'\n  }\n  if (device === undefined) {\n    return isAbsolute ? `\\\\${tail}` : tail\n  }\n  return isAbsolute ? `${device}\\\\${tail}` : `${device}${tail}`\n}\n\nexports.isAbsolute = function isAbsolute (path) {\n  const len = path.length\n  if (len === 0) return false\n\n  const code = path.charCodeAt(0)\n\n  return isWindowsPathSeparator(code) || (len > 2 && isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON && isWindowsPathSeparator(path.charCodeAt(2)))\n}\n\nexports.join = function join (...args) {\n  if (args.length === 0) return '.'\n\n  let joined\n  let firstPart\n  for (let i = 0; i < args.length; ++i) {\n    const arg = args[i]\n    if (arg.length > 0) {\n      if (joined === undefined) joined = firstPart = arg\n      else joined += `\\\\${arg}`\n    }\n  }\n\n  if (joined === undefined) return '.'\n\n  let needsReplace = true\n  let slashCount = 0\n  if (isWindowsPathSeparator(firstPart.charCodeAt(0))) {\n    ++slashCount\n    const firstLen = firstPart.length\n    if (firstLen > 1 && isWindowsPathSeparator(firstPart.charCodeAt(1))) {\n      ++slashCount\n      if (firstLen > 2) {\n        if (isWindowsPathSeparator(firstPart.charCodeAt(2))) {\n          ++slashCount\n        } else {\n          needsReplace = false\n        }\n      }\n    }\n  }\n  if (needsReplace) {\n    while (slashCount < joined.length && isWindowsPathSeparator(joined.charCodeAt(slashCount))) {\n      slashCount++\n    }\n\n    if (slashCount >= 2) {\n      joined = `\\\\${joined.substring(slashCount)}`\n    }\n  }\n\n  return exports.normalize(joined)\n}\n\nexports.relative = function relative (from, to) {\n  if (from === to) return ''\n\n  const fromOrig = exports.resolve(from)\n  const toOrig = exports.resolve(to)\n\n  if (fromOrig === toOrig) return ''\n\n  from = fromOrig.toLowerCase()\n  to = toOrig.toLowerCase()\n\n  if (from === to) return ''\n\n  let fromStart = 0\n  while (fromStart < from.length && from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {\n    fromStart++\n  }\n  let fromEnd = from.length\n  while (fromEnd - 1 > fromStart && from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {\n    fromEnd--\n  }\n  const fromLen = fromEnd - fromStart\n\n  let toStart = 0\n  while (toStart < to.length && to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n    toStart++\n  }\n  let toEnd = to.length\n  while (toEnd - 1 > toStart && to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {\n    toEnd--\n  }\n  const toLen = toEnd - toStart\n\n  const length = fromLen < toLen ? fromLen : toLen\n  let lastCommonSep = -1\n  let i = 0\n  for (; i < length; i++) {\n    const fromCode = from.charCodeAt(fromStart + i)\n    if (fromCode !== to.charCodeAt(toStart + i)) {\n      break\n    } else if (fromCode === CHAR_BACKWARD_SLASH) {\n      lastCommonSep = i\n    }\n  }\n\n  if (i !== length) {\n    if (lastCommonSep === -1) return toOrig\n  } else {\n    if (toLen > length) {\n      if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {\n        return toOrig.substring(toStart + i + 1)\n      }\n      if (i === 2) {\n        return toOrig.substring(toStart + i)\n      }\n    }\n    if (fromLen > length) {\n      if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {\n        lastCommonSep = i\n      } else if (i === 2) {\n        lastCommonSep = 3\n      }\n    }\n    if (lastCommonSep === -1) lastCommonSep = 0\n  }\n\n  let out = ''\n  for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n    if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {\n      out += out.length === 0 ? '..' : '\\\\..'\n    }\n  }\n\n  toStart += lastCommonSep\n\n  if (out.length > 0) {\n    return `${out}${toOrig.substring(toStart, toEnd)}`\n  }\n  if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {\n    ++toStart\n  }\n  return toOrig.substring(toStart, toEnd)\n}\n\nexports.toNamespacedPath = function toNamespacedPath (path) {\n  if (path.length === 0) return path\n\n  const resolvedPath = exports.resolve(path)\n\n  if (resolvedPath.length <= 2) return path\n\n  if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {\n    if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {\n      const code = resolvedPath.charCodeAt(2)\n      if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {\n        return `\\\\\\\\?\\\\UNC\\\\${resolvedPath.substring(2)}`\n      }\n    }\n  } else if (\n    isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) &&\n      resolvedPath.charCodeAt(1) === CHAR_COLON &&\n      resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH\n  ) {\n    return `\\\\\\\\?\\\\${resolvedPath}`\n  }\n\n  return path\n}\n\nexports.dirname = function dirname (path) {\n  const len = path.length\n  if (len === 0) return '.'\n  let rootEnd = -1\n  let offset = 0\n  const code = path.charCodeAt(0)\n\n  if (len === 1) {\n    return isWindowsPathSeparator(code) ? path : '.'\n  }\n\n  if (isWindowsPathSeparator(code)) {\n    rootEnd = offset = 1\n\n    if (isWindowsPathSeparator(path.charCodeAt(1))) {\n      let j = 2\n      let last = j\n      while (j < len && !isWindowsPathSeparator(path.charCodeAt(j))) {\n        j++\n      }\n      if (j < len && j !== last) {\n        last = j\n        while (j < len && isWindowsPathSeparator(path.charCodeAt(j))) {\n          j++\n        }\n        if (j < len && j !== last) {\n          last = j\n          while (j < len && !isWindowsPathSeparator(path.charCodeAt(j))) {\n            j++\n          }\n          if (j === len) {\n            return path\n          }\n          if (j !== last) {\n            rootEnd = offset = j + 1\n          }\n        }\n      }\n    }\n  } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {\n    rootEnd = len > 2 && isWindowsPathSeparator(path.charCodeAt(2)) ? 3 : 2\n    offset = rootEnd\n  }\n\n  let end = -1\n  let matchedSlash = true\n  for (let i = len - 1; i >= offset; --i) {\n    if (isWindowsPathSeparator(path.charCodeAt(i))) {\n      if (!matchedSlash) {\n        end = i\n        break\n      }\n    } else {\n      matchedSlash = false\n    }\n  }\n\n  if (end === -1) {\n    if (rootEnd === -1) return '.'\n\n    end = rootEnd\n  }\n  return path.substring(0, end)\n}\n\nexports.basename = function basename (path, suffix) {\n  let start = 0\n  let end = -1\n  let matchedSlash = true\n\n  if (path.length >= 2 && isWindowsDeviceRoot(path.charCodeAt(0)) && path.charCodeAt(1) === CHAR_COLON) {\n    start = 2\n  }\n\n  if (suffix !== undefined && suffix.length > 0 && suffix.length <= path.length) {\n    if (suffix === path) return ''\n    let extIdx = suffix.length - 1\n    let firstNonSlashEnd = -1\n    for (let i = path.length - 1; i >= start; --i) {\n      const code = path.charCodeAt(i)\n      if (isWindowsPathSeparator(code)) {\n        if (!matchedSlash) {\n          start = i + 1\n          break\n        }\n      } else {\n        if (firstNonSlashEnd === -1) {\n          matchedSlash = false\n          firstNonSlashEnd = i + 1\n        }\n        if (extIdx >= 0) {\n          if (code === suffix.charCodeAt(extIdx)) {\n            if (--extIdx === -1) {\n              end = i\n            }\n          } else {\n            extIdx = -1\n            end = firstNonSlashEnd\n          }\n        }\n      }\n    }\n\n    if (start === end) end = firstNonSlashEnd\n    else if (end === -1) end = path.length\n    return path.substring(start, end)\n  }\n  for (let i = path.length - 1; i >= start; --i) {\n    if (isWindowsPathSeparator(path.charCodeAt(i))) {\n      if (!matchedSlash) {\n        start = i + 1\n        break\n      }\n    } else if (end === -1) {\n      matchedSlash = false\n      end = i + 1\n    }\n  }\n\n  if (end === -1) return ''\n  return path.substring(start, end)\n}\n\nexports.extname = function extname (path) {\n  let start = 0\n  let startDot = -1\n  let startPart = 0\n  let end = -1\n  let matchedSlash = true\n  let preDotState = 0\n\n  if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {\n    start = startPart = 2\n  }\n\n  for (let i = path.length - 1; i >= start; --i) {\n    const code = path.charCodeAt(i)\n    if (isWindowsPathSeparator(code)) {\n      if (!matchedSlash) {\n        startPart = i + 1\n        break\n      }\n      continue\n    }\n    if (end === -1) {\n      matchedSlash = false\n      end = i + 1\n    }\n    if (code === CHAR_DOT) {\n      if (startDot === -1) startDot = i\n      else if (preDotState !== 1) preDotState = 1\n    } else if (startDot !== -1) {\n      preDotState = -1\n    }\n  }\n\n  if (startDot === -1 || end === -1 || preDotState === 0 || (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) {\n    return ''\n  }\n  return path.substring(startDot, end)\n}\n{\n  \"name\": \"bare-path\",\n  \"version\": \"3.0.0\",\n  \"description\": \"Path manipulation library for JavaScript\",\n  \"exports\": {\n    \".\": \"./index.js\",\n    \"./package\": \"./package.json\",\n    \"./posix\": \"./lib/posix.js\",\n    \"./win32\": \"./lib/win32.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"lib\",\n    \"NOTICE\"\n  ],\n  \"scripts\": {\n    \"test\": \"standard && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-path.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-path/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-path#readme\",\n  \"dependencies\": {\n    \"bare-os\": \"^3.0.1\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"standard\": \"^17.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst performance = require('.')\n\nglobal.performance = performance\nglobal.PerformanceEntry = performance.PerformanceEntry\nglobal.PerformanceMark = performance.PerformanceMark\nglobal.PerformanceMeasure = performance.PerformanceMeasure\nglobal.PerformanceObserver = performance.PerformanceObserver\nglobal.PerformanceObserverEntryList = performance.PerformanceObserverEntryList\nconst { observerType } = require('./lib/constants')\nconst { InvalidModificationError } = require('./lib/errors')\nconst binding = require('./binding')\n\nconst { TIME_ORIGIN } = binding\n\nexports.now = function now() {\n  return binding.now() / 1e6 - TIME_ORIGIN\n}\n\nexports.eventLoopUtilization = function eventLoopUtilization(prevUtil, secUtil) {\n  if (secUtil) {\n    const idle = prevUtil.idle - secUtil.idle\n    const active = prevUtil.active - secUtil.active\n    return { idle, active, utilization: active / (idle + active) }\n  }\n\n  let idle = exports.idleTime()\n  if (idle === 0) return { idle: 0, active: 0, utilization: 0 }\n\n  let active = exports.now() - idle\n  if (!prevUtil) return { idle, active, utilization: active / (idle + active) }\n\n  idle = idle - prevUtil.idle\n  active = active - prevUtil.active\n\n  return { idle, active, utilization: active / (idle + active) }\n}\n\nexports.idleTime = function idleTime() {\n  return binding.idleTime()\n}\n\nexports.metricsInfo = function metricsInfo() {\n  return binding.metricsInfo()\n}\n\nexports.timeOrigin = TIME_ORIGIN\n\n// For Node.js compatibility\nexports.performance = exports\n\n// For Node.js compatibility\nclass PerformanceNodeTiming {\n  get idleTime() {\n    return exports.idleTime()\n  }\n\n  get uvMetricsInfo() {\n    return exports.metricsInfo()\n  }\n}\n\n// For Node.js compatibility\nexports.nodeTiming = new PerformanceNodeTiming()\n\n// Performance Timeline globals\nconst globalObservers = new Set()\nconst globalPendingObservers = new Set()\nlet globalBuffer = []\nlet pending = false\n\nclass PerformanceEntry {\n  constructor(name, type, start, duration) {\n    this._name = name\n    this._type = type\n    this._start = start\n    this._duration = duration\n  }\n\n  get name() {\n    return this._name\n  }\n\n  get entryType() {\n    return this._type\n  }\n\n  get startTime() {\n    return this._start\n  }\n\n  get duration() {\n    return this._duration\n  }\n}\n\nexports.PerformanceEntry = PerformanceEntry\n\nclass PerformanceMark extends PerformanceEntry {\n  constructor(name, opts = {}) {\n    const { startTime = exports.now(), detail = null } = opts\n\n    super(name, 'mark', startTime, 0)\n\n    this._detail = detail\n  }\n\n  get detail() {\n    return this._detail\n  }\n}\n\nexports.PerformanceMark = PerformanceMark\n\nclass PerformanceMeasure extends PerformanceEntry {\n  constructor(name, startTime, duration, opts = {}) {\n    const { detail = null } = opts\n\n    super(name, 'measure', startTime, duration)\n\n    this._detail = detail\n  }\n\n  get detail() {\n    return this._detail\n  }\n}\n\nexports.PerformanceMeasure = PerformanceMeasure\n\nclass PerformanceObserverEntryList {\n  constructor(entryList) {\n    this._list = entryList\n  }\n\n  getEntries() {\n    return this._list\n  }\n\n  getEntriesByType(type) {\n    return this._list.filter((entry) => entry.entryType === type)\n  }\n\n  getEntriesByName(name) {\n    return this._list.filter((entry) => entry.name === name)\n  }\n}\n\nexports.PerformanceObserverEntryList = PerformanceObserverEntryList\n\nclass PerformanceObserver {\n  constructor(cb) {\n    this._entryTypes = new Set()\n    this._type = observerType.UNDEFINED\n    this._buffer = []\n    this._cb = cb\n  }\n\n  static get supportedEntryTypes() {\n    return ['mark', 'measure']\n  }\n\n  observe(opts = {}) {\n    if ((!opts.entryTypes && !opts.type) || (opts.entryTypes && opts.type)) {\n      throw new TypeError('opts.entryTypes OR opts.type must be specified')\n    }\n\n    if (\n      (this._type === observerType.MULTIPLE && opts.type) ||\n      (this._type === observerType.SINGLE && opts.entryTypes)\n    ) {\n      throw new InvalidModificationError('Cannot change the PerformanceObserver type')\n    }\n\n    if (this._type === observerType.UNDEFINED) {\n      this._type = opts.entryTypes ? observerType.MULTIPLE : observerType.SINGLE\n    }\n\n    this._entryTypes.clear()\n\n    if (this._type === observerType.MULTIPLE) {\n      for (const entryType of opts.entryTypes) {\n        if (PerformanceObserver.supportedEntryTypes.includes(entryType)) {\n          this._entryTypes.add(entryType)\n        }\n      }\n    } else {\n      if (PerformanceObserver.supportedEntryTypes.includes(opts.type)) {\n        this._entryTypes.add(opts.type)\n\n        if (opts.buffered === true) {\n          const bufferedEntries = globalBuffer.filter((entry) => entry.entryType === opts.type)\n\n          if (bufferedEntries.length > 0) {\n            this._buffer.push(...bufferedEntries)\n\n            globalPendingObservers.add(this)\n            processPendingObservers()\n          }\n        }\n      }\n    }\n\n    if (this._entryTypes.size > 0) {\n      globalObservers.add(this)\n    } else {\n      this.disconnect()\n    }\n  }\n\n  takeRecords() {\n    const buf = this._buffer\n    this._buffer = []\n    return buf\n  }\n\n  disconnect() {\n    globalObservers.delete(this)\n    this._entryTypes.clear()\n    this._type = observerType.UNDEFINED\n  }\n}\n\nexports.PerformanceObserver = PerformanceObserver\n\nexports.mark = function mark(name, opts) {\n  const mark = new PerformanceMark(name, opts)\n\n  processEntry(mark)\n\n  globalBuffer.push(mark)\n\n  return mark\n}\n\nexports.clearMarks = function clearMarks(name) {\n  if (name) {\n    globalBuffer = globalBuffer.filter((entry) => entry.name !== name && entry.entryType !== 'mark')\n  } else {\n    globalBuffer = globalBuffer.filter((entry) => entry.entryType !== 'mark')\n  }\n}\n\nexports.measure = function measure(name, start, end) {\n  let opts = {}\n\n  if (typeof start === 'object' && start !== null && Object.keys(start).length > 0) {\n    opts = start\n\n    if (!opts.start && !opts.end) {\n      throw new TypeError('opts.start or opts.end must be specified')\n    }\n\n    if (opts.name && opts.end && opts.duration) {\n      throw new TypeError('One of opts.name, opts.end or opts.duration must not be specified')\n    }\n\n    start = opts.start\n    end = opts.end\n  }\n\n  let endTime\n\n  if (end) {\n    endTime = toTimestamp(end)\n  } else if (start && opts.duration) {\n    endTime = toTimestamp(start) + toTimestamp(duration)\n  } else {\n    endTime = exports.now()\n  }\n\n  let startTime\n\n  if (start) {\n    startTime = toTimestamp(start)\n  } else if (end && opts.duration) {\n    startTime = toTimestamp(end) - toTimestamp(duration)\n  } else {\n    startTime = 0\n  }\n\n  const duration = endTime - startTime\n\n  const measure = new PerformanceMeasure(name, startTime, duration, opts)\n\n  processEntry(measure)\n\n  globalBuffer.push(measure)\n\n  return measure\n}\n\nexports.clearMeasures = function clearMeasures(name) {\n  if (name) {\n    globalBuffer = globalBuffer.filter(\n      (entry) => entry.name !== name && entry.entryType !== 'measure'\n    )\n  } else {\n    globalBuffer = globalBuffer.filter((entry) => entry.entryType !== 'measure')\n  }\n}\n\nexports.getEntries = function getEntries() {\n  return new PerformanceObserverEntryList(globalBuffer).getEntries()\n}\n\nexports.getEntriesByName = function getEntriesByName(name) {\n  return new PerformanceObserverEntryList(globalBuffer).getEntriesByName(name)\n}\n\nexports.getEntriesByType = function getEntriesByType(type) {\n  return new PerformanceObserverEntryList(globalBuffer).getEntriesByType(type)\n}\n\n// https://w3c.github.io/performance-timeline/#queue-a-performanceentry\nfunction processEntry(entry) {\n  for (const observer of globalObservers) {\n    if (observer._entryTypes.has(entry.entryType)) {\n      observer._buffer.push(entry)\n\n      globalPendingObservers.add(observer)\n      processPendingObservers()\n    }\n  }\n}\n\n// https://w3c.github.io/performance-timeline/#queue-the-performanceobserver-task\nfunction processPendingObservers() {\n  if (pending) return\n\n  pending = true\n  setImmediate(() => {\n    pending = false\n\n    const observers = Array.from(globalPendingObservers.values())\n    globalPendingObservers.clear()\n\n    for (const observer of observers) {\n      observer._cb(new exports.PerformanceObserverEntryList(observer.takeRecords()), observer)\n    }\n  })\n}\n\n// https://w3c.github.io/user-timing/#convert-a-mark-to-a-timestamp\nfunction toTimestamp(mark) {\n  if (typeof mark === 'string') {\n    const performanceMark = globalBuffer.findLast(\n      (entry) => entry.name === mark && entry.entryType === 'mark'\n    )\n\n    if (performanceMark === undefined) {\n      throw new SyntaxError(`Mark ${mark} not found`)\n    }\n\n    return performanceMark.startTime\n  } else if (typeof mark === 'number') {\n    return mark\n  }\n}\n\nclass Histogram {\n  constructor(opts = {}) {\n    const { lowest = 1, highest = Number.MAX_SAFE_INTEGER, figures = 3 } = opts\n\n    this._handle = binding.histogramInit(this, lowest, highest, figures)\n\n    this._count = 0\n    this._exceeds = 0\n  }\n\n  get max() {\n    return binding.histogramMax(this._handle)\n  }\n\n  get min() {\n    return binding.histogramMin(this._handle)\n  }\n\n  get mean() {\n    return binding.histogramMean(this._handle)\n  }\n\n  get percentiles() {\n    return new Map(binding.histogramPercentiles(this._handle))\n  }\n\n  get stddev() {\n    return binding.histogramStddev(this._handle)\n  }\n\n  get count() {\n    return this._count\n  }\n\n  get exceeds() {\n    return this._exceeds\n  }\n\n  percentile(percentile) {\n    return binding.histogramPercentile(this._handle, percentile)\n  }\n\n  reset() {\n    this._count = 0\n    this._exceeds = 0\n\n    binding.histogramReset(this._handle)\n  }\n}\n\nclass RecordableHistogram extends Histogram {\n  add(other) {\n    this._count += other._count\n    this._exceeds += other._exceeds\n\n    binding.histogramAdd(this._handle, other._handle)\n  }\n\n  record(value) {\n    if (binding.histogramRecord(this._handle, value)) this._count++\n    else this._exceeds++\n  }\n}\n\nexports.createHistogram = function createHistogram(opts) {\n  return new RecordableHistogram(opts)\n}\n\nclass IntervalHistogram extends Histogram {\n  constructor(opts = {}) {\n    const { resolution = 10 } = opts\n\n    super({\n      lowest: 1,\n      highest: 3_600_000_000_000 // One hour in nanoseconds\n    })\n\n    this._resolution = resolution\n    this._enabled = false\n\n    this._timerId = -1\n    this._timerStartTime = -1\n  }\n\n  enable() {\n    if (this._enabled === true) return false\n\n    this._timerStartTime = binding.now()\n    this._timerId = setInterval(this._oninterval.bind(this), this._resolution)\n\n    this._enabled = true\n\n    return true\n  }\n\n  disable() {\n    if (this._enabled === false) return false\n\n    clearInterval(this._timerId)\n\n    this._enabled = false\n\n    return true\n  }\n\n  _oninterval() {\n    const now = binding.now()\n    const actual = now - this._timerStartTime\n    const expected = this._resolution * 1e6\n\n    const hasDelay = actual > expected\n\n    if (hasDelay) {\n      const delay = actual - expected\n\n      if (binding.histogramRecord(this._handle, delay)) this._count++\n      else this._exceeds++\n    }\n\n    this._timerStartTime = now\n  }\n\n  [Symbol.dispose]() {\n    this.disable()\n  }\n}\n\nexports.monitorEventLoopDelay = function monitorEventLoopDelay(opts) {\n  return new IntervalHistogram(opts)\n}\nmodule.exports = {\n  observerType: {\n    UNDEFINED: 1,\n    SINGLE: 2,\n    MULTIPLE: 3\n  }\n}\nclass InvalidModificationError extends Error {\n  get name() {\n    return 'InvalidModificationError'\n  }\n}\n\nexports.InvalidModificationError = InvalidModificationError\n{\n  \"name\": \"bare-performance\",\n  \"version\": \"1.3.0\",\n  \"description\": \"Performance monitoring for Bare\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": \"./index.js\",\n    \"./global\": \"./global.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"binding.c\",\n    \"binding.js\",\n    \"global.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-performance.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-performance/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-performance#readme\",\n  \"devDependencies\": {\n    \"brittle\": \"^3.13.1\",\n    \"cmake-bare\": \"^1.5.4\",\n    \"cmake-fetch\": \"^1.4.7\",\n    \"prettier\": \"^3.5.3\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst EventEmitter = require('bare-events')\nconst { Duplex } = require('bare-stream')\nconst binding = require('./binding')\nconst constants = require('./lib/constants')\nconst errors = require('./lib/errors')\n\nconst defaultReadBufferSize = 65536\nconst empty = Buffer.alloc(0)\n\nmodule.exports = exports = class Pipe extends Duplex {\n  constructor(path, opts = {}) {\n    if (typeof path === 'object' && path !== null) {\n      opts = path\n      path = null\n    }\n\n    const { readBufferSize = defaultReadBufferSize, allowHalfOpen = true, eagerOpen = true } = opts\n\n    super({ eagerOpen })\n\n    this._state = 0\n\n    this._allowHalfOpen = allowHalfOpen\n\n    this._fd = -1\n    this._path = null\n\n    this._pendingOpen = null\n    this._pendingWrite = null\n    this._pendingFinal = null\n    this._pendingDestroy = null\n\n    this._buffer = Buffer.alloc(readBufferSize)\n\n    this._handle = binding.init(\n      this._buffer,\n      this,\n      noop,\n      this._onconnect,\n      this._onwrite,\n      this._onfinal,\n      this._onread,\n      this._onclose\n    )\n\n    if (typeof path === 'number') {\n      this.open(path)\n    } else if (typeof path === 'string') {\n      this.connect(path)\n    }\n  }\n\n  get connecting() {\n    return (this._state & constants.state.CONNECTING) !== 0\n  }\n\n  get pending() {\n    return (this._state & constants.state.CONNECTED) === 0\n  }\n\n  get readyState() {\n    if (this._state & constants.state.READABLE && this._state & constants.state.WRITABLE) {\n      return 'open'\n    }\n\n    if (this._state & constants.state.READABLE) {\n      return 'readOnly'\n    }\n\n    if (this._state & constants.state.WRITABLE) {\n      return 'writeOnly'\n    }\n\n    return 'opening'\n  }\n\n  open(fd, opts = {}, onconnect) {\n    if (typeof opts === 'function') {\n      onconnect = opts\n      opts = {}\n    }\n\n    if (typeof fd === 'object' && fd !== null) {\n      opts = fd || {}\n      fd = opts.fd\n    }\n\n    try {\n      const status = binding.open(this._handle, fd)\n\n      this._state |= constants.state.CONNECTED\n      this._fd = fd\n\n      if (status & binding.READABLE) {\n        this._state |= constants.state.READABLE\n      } else {\n        this.push(null)\n      }\n\n      if (status & binding.WRITABLE) {\n        this._state |= constants.state.WRITABLE\n      } else {\n        this.end()\n      }\n\n      if (onconnect) this.once('connect', onconnect)\n\n      queueMicrotask(() => this.emit('connect'))\n    } catch (err) {\n      queueMicrotask(() => {\n        if (this._pendingOpen) this._pendingOpen(err)\n        else this.destroy(err)\n      })\n    }\n\n    return this\n  }\n\n  connect(path, opts = {}, onconnect) {\n    if (this._state & constants.state.CONNECTING || this._state & constants.state.CONNECTED) {\n      throw errors.PIPE_ALREADY_CONNECTED('Pipe is already connected')\n    }\n\n    this._state |= constants.state.CONNECTING\n\n    if (typeof opts === 'function') {\n      onconnect = opts\n      opts = {}\n    }\n\n    if (typeof path === 'object' && path !== null) {\n      opts = path || {}\n      path = opts.path\n    }\n\n    try {\n      binding.connect(this._handle, path)\n\n      this._path = path\n\n      if (onconnect) this.once('connect', onconnect)\n    } catch (err) {\n      queueMicrotask(() => {\n        if (this._pendingOpen) this._pendingOpen(err)\n        else this.destroy(err)\n      })\n    }\n\n    return this\n  }\n\n  ref() {\n    binding.ref(this._handle)\n\n    return this\n  }\n\n  unref() {\n    binding.unref(this._handle)\n\n    return this\n  }\n\n  _open(cb) {\n    if (this._state & constants.state.CONNECTED) return cb(null)\n\n    this._pendingOpen = cb\n  }\n\n  _read() {\n    if ((this._state & constants.state.READING) === 0) {\n      this._state |= constants.state.READING\n\n      binding.resume(this._handle)\n    }\n  }\n\n  _writev(batch, cb) {\n    this._pendingWrite = [cb, batch]\n\n    binding.writev(\n      this._handle,\n      batch.map(({ chunk }) => chunk)\n    )\n  }\n\n  _final(cb) {\n    if (this._state & constants.state.READABLE && this._state & constants.state.WRITABLE) {\n      this._pendingFinal = cb\n\n      binding.end(this._handle)\n    } else {\n      cb(null)\n    }\n  }\n\n  _predestroy() {\n    if (this._state & constants.state.CLOSING) return\n    this._state |= constants.state.CLOSING\n\n    binding.close(this._handle)\n  }\n\n  _destroy(err, cb) {\n    if (this._state & constants.state.CLOSING) return cb(err)\n    this._state |= constants.state.CLOSING\n\n    this._pendingDestroy = cb\n\n    binding.close(this._handle)\n  }\n\n  _continueOpen(err) {\n    if (this._pendingOpen === null) return\n    const cb = this._pendingOpen\n    this._pendingOpen = null\n    cb(err)\n  }\n\n  _continueWrite(err) {\n    if (this._pendingWrite === null) return\n    const cb = this._pendingWrite[0]\n    this._pendingWrite = null\n    cb(err)\n  }\n\n  _continueFinal(err) {\n    if (this._pendingFinal === null) return\n    const cb = this._pendingFinal\n    this._pendingFinal = null\n    cb(err)\n  }\n\n  _continueDestroy() {\n    if (this._pendingDestroy === null) return\n    const cb = this._pendingDestroy\n    this._pendingDestroy = null\n    cb(null)\n  }\n\n  _onconnect(err) {\n    if (err) {\n      if (this._pendingOpen) this._continueOpen(err)\n      else this.destroy(err)\n      return\n    }\n\n    this._state |= constants.state.CONNECTED | constants.state.READABLE | constants.state.WRITABLE\n    this._state &= ~constants.state.CONNECTING\n    this._continueOpen()\n\n    this.emit('connect')\n  }\n\n  _onread(err, read) {\n    if (err) {\n      this.destroy(err)\n      return\n    }\n\n    if (read === 0) {\n      this.push(null)\n      if (this._allowHalfOpen === false) this.end()\n      return\n    }\n\n    const copy = Buffer.allocUnsafe(read)\n    copy.set(this._buffer.subarray(0, read))\n\n    if (this.push(copy) === false && this.destroying === false) {\n      this._state &= ~constants.state.READING\n\n      binding.pause(this._handle)\n    }\n  }\n\n  _onwrite(err) {\n    this._continueWrite(err)\n  }\n\n  _onfinal(err) {\n    this._continueFinal(err)\n  }\n\n  _onclose() {\n    this._continueDestroy()\n  }\n\n  _onspawn(readable, writable) {\n    this._state |= constants.state.CONNECTED\n\n    if (readable) {\n      this._state |= constants.state.READABLE\n    } else {\n      this.push(null)\n    }\n\n    if (writable) {\n      this._state |= constants.state.WRITABLE\n    } else {\n      this.end()\n    }\n\n    this._continueOpen()\n  }\n}\n\nexports.Pipe = exports\n\nexports.pipe = function pipe() {\n  return binding.pipe()\n}\n\nexports.Server = class PipeServer extends EventEmitter {\n  constructor(opts = {}, onconnection) {\n    if (typeof opts === 'function') {\n      onconnection = opts\n      opts = {}\n    }\n\n    super()\n\n    const {\n      readBufferSize = defaultReadBufferSize,\n      allowHalfOpen = true,\n      pauseOnConnect = false\n    } = opts\n\n    this._state = 0\n\n    this._readBufferSize = readBufferSize\n    this._allowHalfOpen = allowHalfOpen\n    this._pauseOnConnect = pauseOnConnect\n\n    this._path = null\n    this._connections = new Set()\n\n    this._error = null\n    this._handle = null\n\n    if (onconnection) this.on('connection', onconnection)\n  }\n\n  get listening() {\n    return (this._state & constants.state.BOUND) !== 0\n  }\n\n  address() {\n    if ((this._state & constants.state.BOUND) === 0) {\n      return null\n    }\n\n    return this._path\n  }\n\n  listen(path, backlog = 511, opts = {}, onlistening) {\n    if (this._state & constants.state.BINDING || this._state & constants.state.BOUND) {\n      throw errors.SERVER_ALREADY_LISTENING('Server is already listening')\n    }\n\n    if (this._state & constants.state.CLOSING) {\n      throw errors.SERVER_IS_CLOSED('Server is closed')\n    }\n\n    this._state |= constants.state.BINDING\n\n    if (typeof backlog === 'function') {\n      onlistening = backlog\n      backlog = 511\n    } else if (typeof opts === 'function') {\n      onlistening = opts\n      opts = {}\n    }\n\n    if (typeof path === 'object' && path !== null) {\n      opts = path || {}\n      path = opts.path\n      backlog = opts.backlog || 511\n    }\n\n    this._handle = binding.init(\n      empty,\n      this,\n      this._onconnection,\n      noop,\n      noop,\n      noop,\n      noop,\n      this._onclose\n    )\n\n    if (this._state & constants.state.UNREFED) binding.unref(this._handle)\n\n    try {\n      binding.bind(this._handle, path, backlog)\n\n      this._path = path\n      this._state |= constants.state.BOUND\n      this._state &= ~constants.state.BINDING\n\n      if (onlistening) this.once('listening', onlistening)\n\n      queueMicrotask(() => this.emit('listening'))\n    } catch (err) {\n      this._error = err\n\n      binding.close(this._handle)\n    }\n\n    return this\n  }\n\n  close(onclose) {\n    if (onclose) this.once('close', onclose)\n\n    if (this._state & constants.state.CLOSING) return\n    this._state |= constants.state.CLOSING\n\n    this._closeMaybe()\n\n    return this\n  }\n\n  ref() {\n    this._state &= ~constants.state.UNREFED\n\n    if (this._handle !== null) binding.ref(this._handle)\n\n    return this\n  }\n\n  unref() {\n    this._state |= constants.state.UNREFED\n\n    if (this._handle !== null) binding.unref(this._handle)\n\n    return this\n  }\n\n  _closeMaybe() {\n    if (this._state & constants.state.CLOSING && this._connections.size === 0) {\n      if (this._handle !== null) binding.close(this._handle)\n      else queueMicrotask(() => this.emit('close'))\n    }\n  }\n\n  _onconnection(err) {\n    if (err) {\n      this.emit('error', err)\n      return\n    }\n\n    if (this._state & constants.state.CLOSING) return\n\n    const pipe = new exports.Pipe({\n      readBufferSize: this._readBufferSize,\n      allowHalfOpen: this._allowHalfOpen,\n      eagerOpen: !this._pauseOnConnect\n    })\n\n    try {\n      binding.accept(this._handle, pipe._handle)\n\n      pipe._path = this._path\n      pipe._state |= constants.state.CONNECTED | constants.state.READABLE | constants.state.WRITABLE\n\n      this._connections.add(pipe)\n\n      pipe.on('close', () => {\n        this._connections.delete(pipe)\n        this._closeMaybe()\n      })\n\n      this.emit('connection', pipe)\n    } catch (err) {\n      pipe.destroy()\n\n      throw err\n    }\n  }\n\n  _onclose() {\n    const err = this._error\n\n    this._state &= ~constants.state.BINDING\n    this._error = null\n    this._handle = null\n\n    if (err) this.emit('error', err)\n    else this.emit('close')\n  }\n}\n\nexports.constants = constants\nexports.errors = errors\n\nexports.createConnection = function createConnection(path, opts, onconnect) {\n  if (typeof opts === 'function') {\n    onconnect = opts\n    opts = {}\n  }\n\n  if (typeof path === 'object' && path !== null) {\n    opts = path || {}\n    path = opts.path\n  }\n\n  return new exports.Pipe(opts).connect(path, opts, onconnect)\n}\n\nexports.createServer = function createServer(opts, onconnection) {\n  return new exports.Server(opts, onconnection)\n}\n\nfunction noop() {}\nmodule.exports = {\n  state: {\n    CONNECTING: 0x1,\n    CONNECTED: 0x2,\n    BINDING: 0x4,\n    BOUND: 0x8,\n    READING: 0x10,\n    CLOSING: 0x20,\n    READABLE: 0x40,\n    WRITABLE: 0x80\n  }\n}\nmodule.exports = class PipeError extends Error {\n  constructor(msg, fn = PipeError, code = fn.name) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'PipeError'\n  }\n\n  static PIPE_ALREADY_CONNECTED(msg) {\n    return new PipeError(msg, PipeError.PIPE_ALREADY_CONNECTED)\n  }\n\n  static SERVER_ALREADY_LISTENING(msg) {\n    return new PipeError(msg, PipeError.SERVER_ALREADY_LISTENING)\n  }\n\n  static SERVER_IS_CLOSED(msg) {\n    return new PipeError(msg, PipeError.SERVER_IS_CLOSED)\n  }\n}\n{\n  \"name\": \"bare-pipe\",\n  \"version\": \"4.1.2\",\n  \"description\": \"Native I/O pipes for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./constants\": {\n      \"types\": \"./lib/constants.d.ts\",\n      \"default\": \"./lib/constants.js\"\n    },\n    \"./errors\": {\n      \"types\": \"./lib/errors.d.ts\",\n      \"default\": \"./lib/errors.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-pipe.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-pipe/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-pipe#readme\",\n  \"engines\": {\n    \"bare\": \">=1.16.0\"\n  },\n  \"dependencies\": {\n    \"bare-events\": \"^2.0.0\",\n    \"bare-stream\": \"^2.0.0\"\n  },\n  \"devDependencies\": {\n    \"bare-path\": \"^3.0.0\",\n    \"brittle\": \"^3.2.1\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nglobal.process = require('.')\nconst EventEmitter = require('bare-events')\nconst Pipe = require('bare-pipe')\nconst Signal = require('bare-signals')\nconst tty = require('bare-tty')\nconst os = require('bare-os')\nconst env = require('bare-env')\nconst hrtime = require('bare-hrtime')\n\nlet stdin = null\nlet stdout = null\nlet stderr = null\n\nclass Process extends EventEmitter {\n  constructor() {\n    super()\n\n    this._startTime = hrtime.bigint()\n\n    EventEmitter.forward(Bare, this, [\n      'uncaughtException',\n      'unhandledRejection',\n      'beforeExit',\n      'exit',\n      'suspend',\n      'wakeup',\n      'idle',\n      'resume'\n    ])\n\n    const signals = new Signal.Emitter()\n\n    signals.unref()\n\n    EventEmitter.forward(signals, this, Object.keys(os.constants.signals))\n  }\n\n  get stdin() {\n    if (stdin === null) {\n      stdin = tty.isTTY(0)\n        ? new tty.ReadStream(0)\n        : new Pipe(0, { eagerOpen: false })\n      stdin.fd = 0\n    }\n\n    return stdin\n  }\n\n  get stdout() {\n    if (stdout === null) {\n      stdout = tty.isTTY(1)\n        ? new tty.WriteStream(1)\n        : new Pipe(1, { eagerOpen: false })\n      stdout.fd = 1\n    }\n\n    return stdout\n  }\n\n  get stderr() {\n    if (stderr === null) {\n      stderr = tty.isTTY(2)\n        ? new tty.WriteStream(2)\n        : new Pipe(2, { eagerOpen: false })\n      stderr.fd = 2\n    }\n\n    return stderr\n  }\n\n  get platform() {\n    return os.platform()\n  }\n\n  get arch() {\n    return os.arch()\n  }\n\n  get title() {\n    return os.getProcessTitle()\n  }\n\n  set title(title) {\n    os.setProcessTitle(title)\n  }\n\n  get pid() {\n    return os.pid()\n  }\n\n  get ppid() {\n    return os.ppid()\n  }\n\n  get argv() {\n    return Bare.argv\n  }\n\n  get execPath() {\n    return os.execPath()\n  }\n\n  get exitCode() {\n    return Bare.exitCode\n  }\n\n  set exitCode(code) {\n    Bare.exitCode = code\n  }\n\n  get version() {\n    return Bare.version\n  }\n\n  get versions() {\n    return Bare.versions\n  }\n\n  get env() {\n    return env\n  }\n\n  get hrtime() {\n    return hrtime\n  }\n\n  exit(code) {\n    Bare.exit(code)\n  }\n\n  suspend() {\n    Bare.suspend()\n  }\n\n  resume() {\n    Bare.resume()\n  }\n\n  cwd() {\n    return os.cwd()\n  }\n\n  chdir(directory) {\n    os.chdir(directory)\n  }\n\n  kill(pid, signal) {\n    os.kill(pid, signal)\n  }\n\n  uptime() {\n    return Number(hrtime.bigint() - this._startTime) / 1e9\n  }\n\n  cpuUsage(previous) {\n    return os.cpuUsage(previous)\n  }\n\n  threadCpuUsage(previous) {\n    return os.threadCpuUsage(previous)\n  }\n\n  resourceUsage() {\n    return os.resourceUsage()\n  }\n\n  memoryUsage() {\n    return os.memoryUsage()\n  }\n\n  nextTick(cb, ...args) {\n    queueMicrotask(cb.bind(null, ...args))\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: Process },\n\n      platform: this.platform,\n      arch: this.arch,\n      title: this.title,\n      pid: this.pid,\n      ppid: this.ppid,\n      argv: this.argv,\n      execPath: this.execPath,\n      exitCode: this.exitCode,\n      version: this.version,\n      versions: this.versions,\n      env: this.env\n    }\n  }\n}\n\nmodule.exports = new Process()\n{\n  \"name\": \"bare-process\",\n  \"version\": \"4.2.2\",\n  \"description\": \"Node.js-compatible process control for Bare\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./global\": {\n      \"types\": \"./global.d.ts\",\n      \"default\": \"./global.js\"\n    },\n    \"./package\": \"./package.json\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"global.js\",\n    \"global.d.ts\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-process.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-process/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-process#readme\",\n  \"dependencies\": {\n    \"bare-env\": \"^3.0.0\",\n    \"bare-events\": \"^2.3.1\",\n    \"bare-hrtime\": \"^2.0.0\",\n    \"bare-os\": \"^3.5.0\",\n    \"bare-pipe\": \"^4.0.0\",\n    \"bare-signals\": \"^4.0.0\",\n    \"bare-tty\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.2.1\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst EventEmitter = require('bare-events')\nconst os = require('bare-os')\nconst binding = require('./binding')\nconst errors = require('./lib/errors')\n\nconst signals = os.constants.signals\n\nmodule.exports = exports = class Signal extends EventEmitter {\n  constructor(signum) {\n    super()\n\n    if (typeof signum === 'string') {\n      if (signum in signals === false) {\n        throw errors.UNKNOWN_SIGNAL(`Unknown signal '${signum}'`)\n      }\n\n      signum = signals[signum]\n    }\n\n    this._signum = signum\n    this._closing = null\n    this._handle = binding.init(this, this._onsignal, this._onclose)\n  }\n\n  start() {\n    if (this._closing) throw errors.SIGNAL_CLOSED('Signal is closed')\n    binding.start(this._handle, this._signum)\n    return this\n  }\n\n  stop() {\n    if (this._closing) return this\n    binding.stop(this._handle)\n    return this\n  }\n\n  ref() {\n    if (this._closing) return this\n    binding.ref(this._handle)\n    return this\n  }\n\n  unref() {\n    if (this._closing) return this\n    binding.unref(this._handle)\n    return this\n  }\n\n  close() {\n    if (this._closing) return this._closing\n    this._closing = EventEmitter.once(this, 'close')\n\n    binding.close(this._handle)\n\n    return this._closing\n  }\n\n  _onsignal() {\n    this.emit('signal', this._signum)\n  }\n\n  _onclose() {\n    this._handle = null\n\n    this.emit('close')\n  }\n\n  static send(signum, pid = os.pid()) {\n    os.kill(pid, signum)\n  }\n}\n\nexports.Emitter = require('./lib/emitter')\n\nexports.constants = signals\nexports.errors = errors\nconst EventEmitter = require('bare-events')\nconst Signal = require('..')\n\nmodule.exports = class SignalEmitter extends EventEmitter {\n  constructor() {\n    super()\n\n    this._signals = new Map()\n    this._unrefed = false\n\n    this.on('newListener', this._onnewlistener).on(\n      'removeListener',\n      this._onremovelistener\n    )\n  }\n\n  ref() {\n    this._unrefed = false\n    for (const signal of this._signals.values()) signal.ref()\n    return this\n  }\n\n  unref() {\n    this._unrefed = true\n    for (const signal of this._signals.values()) signal.unref()\n    return this\n  }\n\n  _onnewlistener(name) {\n    if (name === 'newListener' || name === 'removeListener') return\n\n    if (this.listenerCount(name) === 0) {\n      const signal = new Signal(name)\n\n      signal.on('signal', this._onsignal.bind(this, name)).start()\n\n      if (this._unrefed) signal.unref()\n\n      this._signals.set(name, signal)\n    }\n  }\n\n  _onremovelistener(name) {\n    if (name === 'newListener' || name === 'removeListener') return\n\n    if (this.listenerCount(name) === 0) {\n      const signal = this._signals.get(name)\n\n      if (this._unrefed) signal.ref()\n\n      signal.close()\n\n      this._signals.delete(name)\n    }\n  }\n\n  _onsignal(name) {\n    this.emit(name, name, Signal.constants[name])\n  }\n}\nmodule.exports = class SignalError extends Error {\n  constructor(msg, fn = SignalError, code = fn.name) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'SignalError'\n  }\n\n  static UNKNOWN_SIGNAL(msg) {\n    return new SignalError(msg, SignalError.UNKNOWN_SIGNAL)\n  }\n\n  static SIGNAL_CLOSED(msg) {\n    return new SignalError(msg, SignalError.SIGNAL_CLOSED)\n  }\n}\n{\n  \"name\": \"bare-signals\",\n  \"version\": \"4.2.0\",\n  \"description\": \"Native signal handling for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\",\n    \"./errors\": \"./lib/errors.js\",\n    \"./emitter\": \"./lib/emitter.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-signals.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-signals/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-signals#readme\",\n  \"engines\": {\n    \"bare\": \">=1.7.0\"\n  },\n  \"dependencies\": {\n    \"bare-events\": \"^2.5.3\",\n    \"bare-os\": \"^3.3.1\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.2.1\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nconst stream = require('./web')\n\nglobal.ReadableStream = stream.ReadableStream\nglobal.ReadableStreamDefaultController = stream.ReadableStreamDefaultController\nglobal.ReadableStreamDefaultReader = stream.ReadableStreamDefaultReader\n\nglobal.CountQueuingStrategy = stream.CountQueuingStrategy\nglobal.ByteLengthQueuingStrategy = stream.ByteLengthQueuingStrategy\nconst stream = require('streamx')\n\nconst defaultEncoding = 'utf8'\n\nmodule.exports = exports = stream.Stream\n\nexports.pipeline = stream.pipeline\n\nexports.isStream = stream.isStream\nexports.isEnded = stream.isEnded\nexports.isFinished = stream.isFinished\nexports.isDisturbed = stream.isDisturbed\n\nexports.getStreamError = stream.getStreamError\n\nexports.Stream = exports\n\nexports.Readable = class Readable extends stream.Readable {\n  constructor(opts = {}) {\n    super({\n      ...opts,\n      byteLength: null,\n      byteLengthReadable: null,\n      map: null,\n      mapReadable: null\n    })\n\n    if (this._construct) this._open = this._construct\n\n    if (this._read !== stream.Readable.prototype._read) {\n      this._read = read.bind(this, this._read)\n    }\n\n    if (this._destroy !== stream.Stream.prototype._destroy) {\n      this._destroy = destroy.bind(this, this._destroy)\n    }\n  }\n\n  push(chunk, encoding) {\n    if (typeof chunk === 'string') {\n      chunk = Buffer.from(chunk, encoding || defaultEncoding)\n    }\n\n    return super.push(chunk)\n  }\n\n  unshift(chunk, encoding) {\n    if (typeof chunk === 'string') {\n      chunk = Buffer.from(chunk, encoding || defaultEncoding)\n    }\n\n    super.unshift(chunk)\n  }\n}\n\nexports.Writable = class Writable extends stream.Writable {\n  constructor(opts = {}) {\n    super({\n      ...opts,\n      byteLength: null,\n      byteLengthWritable,\n      map: null,\n      mapWritable: null\n    })\n\n    if (this._construct) this._open = this._construct\n\n    if (this._write !== stream.Writable.prototype._write) {\n      this._write = write.bind(this, this._write)\n    }\n\n    if (this._destroy !== stream.Stream.prototype._destroy) {\n      this._destroy = destroy.bind(this, this._destroy)\n    }\n  }\n\n  write(chunk, encoding, cb) {\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = null\n    }\n\n    if (typeof chunk === 'string') {\n      encoding = encoding || defaultEncoding\n      chunk = Buffer.from(chunk, encoding)\n    } else {\n      encoding = 'buffer'\n    }\n\n    const result = super.write({ chunk, encoding })\n\n    if (cb) stream.Writable.drained(this).then(() => cb(null), cb)\n\n    return result\n  }\n\n  end(chunk, encoding, cb) {\n    if (typeof chunk === 'function') {\n      cb = chunk\n      chunk = null\n    } else if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = null\n    }\n\n    if (typeof chunk === 'string') {\n      encoding = encoding || defaultEncoding\n      chunk = Buffer.from(chunk, encoding || defaultEncoding)\n    } else {\n      encoding = 'buffer'\n    }\n\n    const result =\n      chunk !== undefined && chunk !== null\n        ? super.end({ chunk, encoding })\n        : super.end()\n\n    if (cb) this.once('finish', () => cb(null))\n\n    return result\n  }\n}\n\nexports.Duplex = class Duplex extends stream.Duplex {\n  constructor(opts = {}) {\n    super({\n      ...opts,\n      byteLength: null,\n      byteLengthReadable: null,\n      byteLengthWritable,\n      map: null,\n      mapReadable: null,\n      mapWritable: null\n    })\n\n    if (this._construct) this._open = this._construct\n\n    if (this._read !== stream.Readable.prototype._read) {\n      this._read = read.bind(this, this._read)\n    }\n\n    if (this._write !== stream.Duplex.prototype._write) {\n      this._write = write.bind(this, this._write)\n    }\n\n    if (this._destroy !== stream.Stream.prototype._destroy) {\n      this._destroy = destroy.bind(this, this._destroy)\n    }\n  }\n\n  push(chunk, encoding) {\n    if (typeof chunk === 'string') {\n      chunk = Buffer.from(chunk, encoding || defaultEncoding)\n    }\n\n    return super.push(chunk)\n  }\n\n  unshift(chunk, encoding) {\n    if (typeof chunk === 'string') {\n      chunk = Buffer.from(chunk, encoding || defaultEncoding)\n    }\n\n    super.unshift(chunk)\n  }\n\n  write(chunk, encoding, cb) {\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = null\n    }\n\n    if (typeof chunk === 'string') {\n      encoding = encoding || defaultEncoding\n      chunk = Buffer.from(chunk, encoding)\n    } else {\n      encoding = 'buffer'\n    }\n\n    const result = super.write({ chunk, encoding })\n\n    if (cb) stream.Writable.drained(this).then(() => cb(null), cb)\n\n    return result\n  }\n\n  end(chunk, encoding, cb) {\n    if (typeof chunk === 'function') {\n      cb = chunk\n      chunk = null\n    } else if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = null\n    }\n\n    if (typeof chunk === 'string') {\n      encoding = encoding || defaultEncoding\n      chunk = Buffer.from(chunk, encoding)\n    } else {\n      encoding = 'buffer'\n    }\n\n    const result =\n      chunk !== undefined && chunk !== null\n        ? super.end({ chunk, encoding })\n        : super.end()\n\n    if (cb) this.once('finish', () => cb(null))\n\n    return result\n  }\n}\n\nexports.Transform = class Transform extends stream.Transform {\n  constructor(opts = {}) {\n    super({\n      ...opts,\n      byteLength: null,\n      byteLengthReadable: null,\n      byteLengthWritable,\n      map: null,\n      mapReadable: null,\n      mapWritable: null\n    })\n\n    if (this._transform !== stream.Transform.prototype._transform) {\n      this._transform = transform.bind(this, this._transform)\n    } else {\n      this._transform = passthrough\n    }\n  }\n\n  push(chunk, encoding) {\n    if (typeof chunk === 'string') {\n      chunk = Buffer.from(chunk, encoding || defaultEncoding)\n    }\n\n    return super.push(chunk)\n  }\n\n  unshift(chunk, encoding) {\n    if (typeof chunk === 'string') {\n      chunk = Buffer.from(chunk, encoding || defaultEncoding)\n    }\n\n    super.unshift(chunk)\n  }\n\n  write(chunk, encoding, cb) {\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = null\n    }\n\n    if (typeof chunk === 'string') {\n      encoding = encoding || defaultEncoding\n      chunk = Buffer.from(chunk, encoding)\n    } else {\n      encoding = 'buffer'\n    }\n\n    const result = super.write({ chunk, encoding })\n\n    if (cb) stream.Writable.drained(this).then(() => cb(null), cb)\n\n    return result\n  }\n\n  end(chunk, encoding, cb) {\n    if (typeof chunk === 'function') {\n      cb = chunk\n      chunk = null\n    } else if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = null\n    }\n\n    if (typeof chunk === 'string') {\n      encoding = encoding || defaultEncoding\n      chunk = Buffer.from(chunk, encoding)\n    } else {\n      encoding = 'buffer'\n    }\n\n    const result =\n      chunk !== undefined && chunk !== null\n        ? super.end({ chunk, encoding })\n        : super.end()\n\n    if (cb) this.once('finish', () => cb(null))\n\n    return result\n  }\n}\n\nexports.PassThrough = class PassThrough extends exports.Transform {}\n\nexports.finished = function finished(stream, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  if (!opts) opts = {}\n\n  const { cleanup = false } = opts\n\n  const done = () => {\n    cb(exports.getStreamError(stream, { all: true }))\n\n    if (cleanup) detach()\n  }\n\n  const detach = () => {\n    stream.off('close', done)\n    stream.off('error', noop)\n  }\n\n  if (stream.destroyed) {\n    done()\n  } else {\n    stream.on('close', done)\n    stream.on('error', noop)\n  }\n\n  return detach\n}\n\nfunction read(read, cb) {\n  read.call(this, 65536)\n\n  cb(null)\n}\n\nfunction write(write, data, cb) {\n  write.call(this, data.chunk, data.encoding, cb)\n}\n\nfunction transform(transform, data, cb) {\n  transform.call(this, data.chunk, data.encoding, cb)\n}\n\nfunction destroy(destroy, cb) {\n  destroy.call(this, exports.getStreamError(this), cb)\n}\n\nfunction passthrough(data, cb) {\n  cb(null, data.chunk)\n}\n\nfunction byteLengthWritable(data) {\n  return data.chunk.byteLength\n}\n\nfunction noop() {}\n{\n  \"name\": \"bare-stream\",\n  \"version\": \"2.7.0\",\n  \"description\": \"Streaming data for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\",\n    \"./promises\": \"./promises.js\",\n    \"./web\": {\n      \"types\": \"./web.d.ts\",\n      \"default\": \"./web.js\"\n    },\n    \"./global\": \"./global.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"promises.js\",\n    \"web.js\",\n    \"web.d.ts\",\n    \"global.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-stream.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-stream/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-stream#readme\",\n  \"dependencies\": {\n    \"streamx\": \"^2.21.0\"\n  },\n  \"devDependencies\": {\n    \"bare-buffer\": \"^3.0.0\",\n    \"bare-events\": \"^2.5.4\",\n    \"brittle\": \"^3.5.2\",\n    \"prettier\": \"^3.3.3\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  },\n  \"peerDependencies\": {\n    \"bare-buffer\": \"*\",\n    \"bare-events\": \"*\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bare-buffer\": {\n      \"optional\": true\n    },\n    \"bare-events\": {\n      \"optional\": true\n    }\n  }\n}\nconst { Readable, getStreamError, isStreamx, isDisturbed } = require('streamx')\n\nconst readableKind = Symbol.for('bare.stream.readable.kind')\n\n// https://streams.spec.whatwg.org/#readablestreamdefaultreader\nexports.ReadableStreamDefaultReader = class ReadableStreamDefaultReader {\n  constructor(stream) {\n    this._stream = stream._stream\n  }\n\n  read() {\n    const stream = this._stream\n\n    return new Promise((resolve, reject) => {\n      const err = getStreamError(stream)\n\n      if (err) return reject(err)\n\n      if (stream.destroyed) {\n        return resolve({ value: undefined, done: true })\n      }\n\n      const value = stream.read()\n\n      if (value !== null) {\n        return resolve({ value, done: false })\n      }\n\n      stream\n        .once('readable', onreadable)\n        .once('close', onclose)\n        .once('error', onerror)\n\n      function onreadable() {\n        const value = stream.read()\n\n        ondone(\n          null,\n          value === null\n            ? { value: undefined, done: true }\n            : { value, done: false }\n        )\n      }\n\n      function onclose() {\n        ondone(null, { value: undefined, done: true })\n      }\n\n      function onerror(err) {\n        ondone(err, null)\n      }\n\n      function ondone(err, value) {\n        stream\n          .off('readable', onreadable)\n          .off('close', onclose)\n          .off('error', onerror)\n\n        if (err) reject(err)\n        else resolve(value)\n      }\n    })\n  }\n\n  cancel(reason) {\n    if (this._stream.destroyed) return Promise.resolve()\n\n    return new Promise((resolve) =>\n      this._stream.once('close', resolve).destroy(reason)\n    )\n  }\n}\n\n// https://streams.spec.whatwg.org/#readablestreamdefaultcontroller\nexports.ReadableStreamDefaultController = class ReadableStreamDefaultController {\n  constructor(stream) {\n    this._stream = stream._stream\n  }\n\n  get desiredSize() {\n    return (\n      this._stream._readableState.highWaterMark -\n      this._stream._readableState.buffered\n    )\n  }\n\n  enqueue(data) {\n    this._stream.push(data)\n  }\n\n  close() {\n    this._stream.push(null)\n  }\n\n  error(err) {\n    this._stream.destroy(err)\n  }\n}\n\n// https://streams.spec.whatwg.org/#readablestream\nclass ReadableStream {\n  static get [readableKind]() {\n    return 0 // Compatibility version\n  }\n\n  constructor(underlyingSource = {}, queuingStrategy) {\n    if (isStreamx(underlyingSource)) {\n      this._stream = underlyingSource\n    } else {\n      if (queuingStrategy === undefined) {\n        queuingStrategy = new exports.CountQueuingStrategy()\n      }\n\n      const { start, pull } = underlyingSource\n      const { highWaterMark = 1, size = defaultSize } = queuingStrategy\n\n      this._stream = new Readable({ highWaterMark, byteLength: size })\n\n      const controller = new exports.ReadableStreamDefaultController(this)\n\n      if (start) {\n        this._stream._open = open.bind(this, start.call(this, controller))\n      }\n\n      if (pull) {\n        this._stream._read = read.bind(this, pull.bind(this, controller))\n      }\n    }\n  }\n\n  get [readableKind]() {\n    return ReadableStream[readableKind]\n  }\n\n  getReader() {\n    return new exports.ReadableStreamDefaultReader(this)\n  }\n\n  cancel(reason) {\n    if (this._stream.destroyed) return Promise.resolve()\n\n    return new Promise((resolve) =>\n      this._stream.once('close', resolve).destroy(reason)\n    )\n  }\n\n  pipeTo(destination) {\n    return new Promise((resolve, reject) =>\n      this._stream.pipe(destination, (err) => {\n        err ? reject(err) : resolve()\n      })\n    )\n  }\n\n  [Symbol.asyncIterator]() {\n    return this._stream[Symbol.asyncIterator]()\n  }\n\n  static from(iterable) {\n    return new ReadableStream(Readable.from(iterable))\n  }\n}\n\nasync function open(starting, cb) {\n  try {\n    await starting\n\n    cb(null)\n  } catch (err) {\n    cb(err)\n  }\n}\n\nasync function read(pull, cb) {\n  try {\n    await pull()\n\n    cb(null)\n  } catch (err) {\n    cb(err)\n  }\n}\n\nfunction defaultSize() {\n  return 1\n}\n\nexports.ReadableStream = ReadableStream\n\n// https://streams.spec.whatwg.org/#countqueuingstrategy\nexports.CountQueuingStrategy = class CountQueuingStrategy {\n  constructor(opts = {}) {\n    const { highWaterMark = 1 } = opts\n\n    this.highWaterMark = highWaterMark\n  }\n\n  size(chunk) {\n    return 1\n  }\n}\n\n// https://streams.spec.whatwg.org/#bytelengthqueuingstrategy\nexports.ByteLengthQueuingStrategy = class ByteLengthQueuingStrategy {\n  constructor(opts = {}) {\n    const { highWaterMark = 16384 } = opts\n\n    this.highWaterMark = highWaterMark\n  }\n\n  size(chunk) {\n    return chunk.byteLength\n  }\n}\n\nexports.isReadableStream = function isReadableStream(value) {\n  if (value instanceof ReadableStream) return true\n\n  return (\n    typeof value === 'object' &&\n    value !== null &&\n    value[readableKind] === ReadableStream[readableKind]\n  )\n}\n\n// https://streams.spec.whatwg.org/#is-readable-stream-disturbed\nexports.isReadableStreamDisturbed = function isReadableStreamDisturbed(stream) {\n  return isDisturbed(stream._stream)\n}\nmodule.exports = require.addon()\nconst EventEmitter = require('bare-events')\nconst { Duplex } = require('bare-stream')\nconst dns = require('bare-dns')\nconst binding = require('./binding')\nconst constants = require('./lib/constants')\nconst errors = require('./lib/errors')\nconst ip = require('./lib/ip')\n\nconst defaultReadBufferSize = 65536\nconst empty = Buffer.alloc(0)\n\nexports.Socket = class TCPSocket extends Duplex {\n  constructor(opts = {}) {\n    const { readBufferSize = defaultReadBufferSize, allowHalfOpen = true, eagerOpen = true } = opts\n\n    super({ eagerOpen })\n\n    this._state = 0\n\n    this._allowHalfOpen = allowHalfOpen\n\n    this._remotePort = -1\n    this._remoteHost = null\n    this._remoteFamily = 0\n\n    this._pendingOpen = null\n    this._pendingWrite = null\n    this._pendingFinal = null\n    this._pendingDestroy = null\n\n    this._timer = null\n    this._timeout = 0\n\n    this._buffer = Buffer.alloc(readBufferSize)\n\n    this._addresses = null\n    this._errors = null\n\n    this._handle = binding.init(\n      this._buffer,\n      this,\n      noop,\n      this._onconnect,\n      this._onreset,\n      this._onread,\n      this._onwrite,\n      this._onfinal,\n      this._onclose\n    )\n  }\n\n  get connecting() {\n    return (this._state & constants.state.CONNECTING) !== 0\n  }\n\n  get pending() {\n    return (this._state & constants.state.CONNECTED) === 0\n  }\n\n  get timeout() {\n    return this._timeout || undefined // For Node.js compatibility\n  }\n\n  get readyState() {\n    if (this._state & constants.state.CONNECTED) {\n      return 'open'\n    }\n\n    return 'opening'\n  }\n\n  connect(port, host = 'localhost', opts = {}, onconnect) {\n    if (this._state & constants.state.CONNECTING || this._state & constants.state.CONNECTED) {\n      throw errors.SOCKET_ALREADY_CONNECTED('Socket is already connected')\n    }\n\n    this._state |= constants.state.CONNECTING\n\n    if (typeof host === 'function') {\n      onconnect = host\n      host = 'localhost'\n    } else if (typeof opts === 'function') {\n      onconnect = opts\n      opts = {}\n    }\n\n    let family = 0\n\n    if (typeof port === 'object' && port !== null) {\n      opts = port || {}\n      port = opts.port || 0\n      host = opts.host || 'localhost'\n      family = opts.family || 0\n    }\n\n    if (!host) host = 'localhost'\n\n    const {\n      lookup = dns.lookup,\n      hints,\n      keepAlive = false,\n      keepAliveInitialDelay = 0,\n      noDelay = false,\n      timeout\n    } = opts\n\n    const type = ip.isIP(host)\n\n    if (type === 0) {\n      lookup(host, { all: true, family, hints }, (err, addresses) => {\n        if (this._state & constants.state.CLOSING) return\n\n        this._state &= ~constants.state.CONNECTING\n\n        if (err) {\n          this.emit('lookup', err)\n\n          if (this._pendingOpen) this._continueOpen(err)\n          else this.destroy(err)\n          return\n        }\n\n        for (const { address, family } of addresses) {\n          this.emit('lookup', null, address, family, host)\n        }\n\n        const [{ address, family }, ...rest] = addresses\n\n        if (rest.length > 0) {\n          this._addresses = rest.map(({ address, family }) => [\n            port,\n            address,\n            { ...opts, family },\n            onconnect\n          ])\n\n          this._errors = []\n        }\n\n        this.connect(port, address, { ...opts, family }, onconnect)\n      })\n\n      return this\n    }\n\n    family = type\n\n    try {\n      binding.connect(this._handle, port, host, family)\n\n      if (keepAlive) this.setKeepAlive(keepAlive, keepAliveInitialDelay)\n      if (noDelay) this.setNoDelay()\n      if (timeout) this.setTimeout(timeout)\n\n      this._remotePort = port\n      this._remoteHost = host\n      this._remoteFamily = family\n\n      if (onconnect) this.once('connect', onconnect)\n    } catch (err) {\n      queueMicrotask(() => {\n        if (this._pendingOpen) this._pendingOpen(err)\n        else this.destroy(err)\n      })\n    }\n\n    return this\n  }\n\n  setKeepAlive(enable = false, delay = 0) {\n    if (typeof enable === 'number') {\n      delay = enable\n      enable = false\n    }\n\n    delay = Math.floor(delay / 1000)\n\n    if (delay === 0) enable = false\n\n    binding.keepalive(this._handle, enable, delay)\n\n    return this\n  }\n\n  setNoDelay(enable = true) {\n    binding.nodelay(this._handle, enable)\n\n    return this\n  }\n\n  setTimeout(ms, ontimeout) {\n    if (ms === 0) {\n      clearTimeout(this._timer)\n\n      this._timer = null\n    } else {\n      if (ontimeout) this.once('timeout', ontimeout)\n\n      this._timer = setTimeout(() => this.emit('timeout'), ms)\n      this._timer.unref()\n    }\n\n    this._timeout = ms\n\n    return this\n  }\n\n  ref() {\n    binding.ref(this._handle)\n\n    return this\n  }\n\n  unref() {\n    binding.unref(this._handle)\n\n    return this\n  }\n\n  _open(cb) {\n    if (this._state & constants.state.CONNECTED) return cb(null)\n\n    this._pendingOpen = cb\n  }\n\n  _read() {\n    if ((this._state & constants.state.READING) === 0) {\n      this._state |= constants.state.READING\n\n      binding.resume(this._handle)\n    }\n  }\n\n  _writev(batch, cb) {\n    this._pendingWrite = [cb, batch]\n\n    binding.writev(\n      this._handle,\n      batch.map(({ chunk }) => chunk)\n    )\n  }\n\n  _final(cb) {\n    this._pendingFinal = cb\n\n    binding.end(this._handle)\n  }\n\n  _predestroy() {\n    if (this._state & constants.state.CLOSING) return\n    this._state |= constants.state.CLOSING\n\n    binding.close(this._handle)\n  }\n\n  _destroy(err, cb) {\n    if (this._state & constants.state.CLOSING) return cb(err)\n    this._state |= constants.state.CLOSING\n\n    this._pendingDestroy = cb\n\n    binding.close(this._handle)\n  }\n\n  _continueOpen(err) {\n    if (this._pendingOpen === null) return\n    const cb = this._pendingOpen\n    this._pendingOpen = null\n    cb(err)\n  }\n\n  _continueWrite(err) {\n    if (this._pendingWrite === null) return\n    const cb = this._pendingWrite[0]\n    this._pendingWrite = null\n    cb(err)\n  }\n\n  _continueFinal(err) {\n    if (this._pendingFinal === null) return\n    const cb = this._pendingFinal\n    this._pendingFinal = null\n    cb(err)\n  }\n\n  _continueDestroy() {\n    if (this._pendingDestroy === null) return\n    const cb = this._pendingDestroy\n    this._pendingDestroy = null\n    cb(null)\n  }\n\n  _reset() {\n    this._state = 0\n\n    binding.reset(this._handle)\n  }\n\n  _onconnect(err) {\n    if (err) {\n      if (this._addresses !== null) {\n        this._errors.push(err)\n\n        if (this._addresses.length > 0) return this._reset()\n\n        err = this._errors.length === 1 ? this._errors[0] : new AggregateError(this._errors)\n      }\n\n      if (this._pendingOpen) this._continueOpen(err)\n      else this.destroy(err)\n      return\n    }\n\n    this._state |= constants.state.CONNECTED\n    this._state &= ~constants.state.CONNECTING\n    this._continueOpen()\n\n    this.emit('connect')\n  }\n\n  _onreset(err) {\n    if (err) {\n      this._errors.push(err)\n      this.destroy(this._errors.length === 1 ? this._errors[0] : new AggregateError(this._errors))\n      return\n    }\n\n    this.connect(...this._addresses.shift())\n  }\n\n  _onread(err, read) {\n    if (this._timer) this._timer.refresh()\n\n    if (err) {\n      this.destroy(err)\n      return\n    }\n\n    if (read === 0) {\n      this.push(null)\n      if (this._allowHalfOpen === false) this.end()\n      return\n    }\n\n    const copy = Buffer.allocUnsafe(read)\n    copy.set(this._buffer.subarray(0, read))\n\n    if (this.push(copy) === false && this.destroying === false) {\n      this._state &= ~constants.state.READING\n\n      binding.pause(this._handle)\n    }\n  }\n\n  _onwrite(err) {\n    if (this._timer) this._timer.refresh()\n\n    this._continueWrite(err)\n  }\n\n  _onfinal(err) {\n    this._continueFinal(err)\n  }\n\n  _onclose() {\n    clearTimeout(this._timer)\n\n    this._continueDestroy()\n  }\n}\n\nexports.Server = class TCPServer extends EventEmitter {\n  constructor(opts = {}, onconnection) {\n    if (typeof opts === 'function') {\n      onconnection = opts\n      opts = {}\n    }\n\n    super()\n\n    const {\n      readBufferSize = defaultReadBufferSize,\n      allowHalfOpen = true,\n      keepAlive = false,\n      keepAliveInitialDelay = 0,\n      noDelay = false,\n      pauseOnConnect = false\n    } = opts\n\n    this._state = 0\n\n    this._readBufferSize = readBufferSize\n    this._allowHalfOpen = allowHalfOpen\n    this._keepAlive = keepAlive\n    this._keepAliveInitialDelay = keepAliveInitialDelay\n    this._noDelay = noDelay\n    this._pauseOnConnect = pauseOnConnect\n\n    this._port = -1\n    this._host = null\n    this._family = 0\n    this._connections = new Set()\n\n    this._error = null\n    this._handle = null\n\n    if (onconnection) this.on('connection', onconnection)\n  }\n\n  get listening() {\n    return (this._state & constants.state.BOUND) !== 0\n  }\n\n  get closing() {\n    return (this._state & constants.state.CLOSING) !== 0\n  }\n\n  get connections() {\n    return this._connections\n  }\n\n  address() {\n    if ((this._state & constants.state.BOUND) === 0) {\n      return null\n    }\n\n    return {\n      address: this._host,\n      family: `IPv${this._family}`,\n      port: this._port\n    }\n  }\n\n  listen(port = 0, host = 'localhost', backlog = 511, opts = {}, onlistening) {\n    if (this._state & constants.state.BINDING || this._state & constants.state.BOUND) {\n      throw errors.SERVER_ALREADY_LISTENING('Server is already listening')\n    }\n\n    if (this._state & constants.state.CLOSING) {\n      throw errors.SERVER_IS_CLOSED('Server is closed')\n    }\n\n    this._state |= constants.state.BINDING\n\n    if (typeof port === 'function') {\n      onlistening = port\n      port = 0\n    } else if (typeof host === 'function') {\n      onlistening = host\n      host = 'localhost'\n    } else if (typeof backlog === 'function') {\n      onlistening = backlog\n      backlog = 511\n    } else if (typeof opts === 'function') {\n      onlistening = opts\n      opts = {}\n    }\n\n    let family = 0\n\n    if (typeof port === 'object' && port !== null) {\n      opts = port || {}\n      port = opts.port || 0\n      host = opts.host || 'localhost'\n      family = opts.family || 0\n      backlog = opts.backlog || 511\n    }\n\n    if (!host) host = 'localhost'\n    if (!backlog) backlog = 511\n\n    const { lookup = dns.lookup, hints } = opts\n\n    const type = ip.isIP(host)\n\n    if (type === 0) {\n      lookup(host, { family, hints }, (err, address, family) => {\n        if (this._state & constants.state.CLOSING) return\n\n        this.emit('lookup', err, address, family, host)\n\n        this._state &= ~constants.state.BINDING\n\n        if (err) return this.emit('error', err)\n\n        this.listen(port, address, backlog, { ...opts, family }, onlistening)\n      })\n\n      return this\n    }\n\n    family = type\n\n    this._handle = binding.init(\n      empty,\n      this,\n      this._onconnection,\n      noop,\n      noop,\n      noop,\n      noop,\n      noop,\n      this._onclose\n    )\n\n    if (this._state & constants.state.UNREFED) binding.unref(this._handle)\n\n    try {\n      this._port = binding.bind(this._handle, port, host, backlog, family)\n      this._host = host\n      this._family = family\n      this._state |= constants.state.BOUND\n      this._state &= ~constants.state.BINDING\n\n      if (onlistening) this.once('listening', onlistening)\n\n      queueMicrotask(() => this.emit('listening'))\n    } catch (err) {\n      this._error = err\n\n      binding.close(this._handle)\n    }\n\n    return this\n  }\n\n  close(onclose) {\n    if (onclose) this.once('close', onclose)\n\n    if (this._state & constants.state.CLOSING) return this\n    this._state |= constants.state.CLOSING\n\n    this._closeMaybe()\n\n    return this\n  }\n\n  ref() {\n    this._state &= ~constants.state.UNREFED\n\n    if (this._handle !== null) binding.ref(this._handle)\n\n    return this\n  }\n\n  unref() {\n    this._state |= constants.state.UNREFED\n\n    if (this._handle !== null) binding.unref(this._handle)\n\n    return this\n  }\n\n  _closeMaybe() {\n    if (this._state & constants.state.CLOSING && this._connections.size === 0) {\n      if (this._handle !== null) binding.close(this._handle)\n      else queueMicrotask(() => this.emit('close'))\n    }\n  }\n\n  _onconnection(err) {\n    if (err) {\n      this.emit('error', err)\n      return\n    }\n\n    if (this._state & constants.state.CLOSING) return\n\n    const socket = new exports.Socket({\n      readBufferSize: this._readBufferSize,\n      allowHalfOpen: this._allowHalfOpen,\n      eagerOpen: !this._pauseOnConnect\n    })\n\n    try {\n      binding.accept(this._handle, socket._handle)\n\n      socket._state |= constants.state.CONNECTED\n\n      this._connections.add(socket)\n\n      if (this._keepAlive) socket.setKeepAlive(this._keepAlive, this._keepAliveInitialDelay)\n      if (this._noDelay) socket.setNoDelay()\n\n      socket.on('close', () => {\n        this._connections.delete(socket)\n        this._closeMaybe()\n      })\n\n      this.emit('connection', socket)\n    } catch (err) {\n      socket.destroy()\n\n      throw err\n    }\n  }\n\n  _onclose() {\n    const err = this._error\n\n    this._state &= ~constants.state.BINDING\n    this._error = null\n    this._handle = null\n\n    if (err) this.emit('error', err)\n    else this.emit('close')\n  }\n}\n\nexports.constants = constants\nexports.errors = errors\n\nexports.isIP = ip.isIP\nexports.isIPv4 = ip.isIPv4\nexports.isIPv6 = ip.isIPv6\n\nexports.createConnection = function createConnection(port, host, opts, onconnect) {\n  if (typeof host === 'function') {\n    onconnect = host\n    host = 'localhost'\n  } else if (typeof opts === 'function') {\n    onconnect = opts\n    opts = {}\n  }\n\n  if (typeof port === 'object' && port !== null) {\n    opts = port || {}\n    port = opts.port || 0\n    host = opts.host || 'localhost'\n  }\n\n  return new exports.Socket(opts).connect(port, host, opts, onconnect)\n}\n\n// For Node.js compatibility\nexports.connect = exports.createConnection\n\nexports.createServer = function createServer(opts, onconnection) {\n  return new exports.Server(opts, onconnection)\n}\n\nfunction noop() {}\nmodule.exports = {\n  state: {\n    CONNECTING: 0x1,\n    CONNECTED: 0x2,\n    BINDING: 0x4,\n    BOUND: 0x8,\n    READING: 0x10,\n    CLOSING: 0x20,\n    UNREFED: 0x40\n  }\n}\nmodule.exports = class TCPError extends Error {\n  constructor(msg, fn = TCPError, code = fn.name) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'TCPError'\n  }\n\n  static SOCKET_ALREADY_CONNECTED(msg) {\n    return new TCPError(msg, TCPError.SOCKET_ALREADY_CONNECTED)\n  }\n\n  static SERVER_ALREADY_LISTENING(msg) {\n    return new TCPError(msg, TCPError.SERVER_ALREADY_LISTENING)\n  }\n\n  static SERVER_IS_CLOSED(msg) {\n    return new TCPError(msg, TCPError.SERVER_IS_CLOSED)\n  }\n\n  static INVALID_HOST(msg = 'Unrecognizable host format') {\n    return new TCPError(msg, TCPError.INVALID_HOST)\n  }\n}\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nconst v4Seg = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'\nconst v4Str = `(${v4Seg}[.]){3}${v4Seg}`\nconst IPv4Pattern = new RegExp(`^${v4Str}$`)\n\nconst v6Seg = '(?:[0-9a-fA-F]{1,4})'\nconst IPv6Pattern = new RegExp(\n  '^(' +\n    `(?:${v6Seg}:){7}(?:${v6Seg}|:)|` +\n    `(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` +\n    `(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` +\n    `(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` +\n    `(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` +\n    `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` +\n    `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` +\n    `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` +\n    ')(%[0-9a-zA-Z-.:]{1,})?$'\n)\n\nconst isIPv4 = (exports.isIPv4 = function isIPv4(host) {\n  return IPv4Pattern.test(host)\n})\n\nconst isIPv6 = (exports.isIPv6 = function isIPv6(host) {\n  return IPv6Pattern.test(host)\n})\n\nexports.isIP = function isIP(host) {\n  if (isIPv4(host)) return 4\n  if (isIPv6(host)) return 6\n  return 0\n}\n{\n  \"name\": \"bare-tcp\",\n  \"version\": \"2.2.2\",\n  \"description\": \"Native TCP sockets for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\",\n    \"./constants\": \"./lib/constants.js\",\n    \"./errors\": \"./lib/errors.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-tcp.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-tcp/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-tcp#readme\",\n  \"engines\": {\n    \"bare\": \">=1.16.0\"\n  },\n  \"dependencies\": {\n    \"bare-dns\": \"^2.0.4\",\n    \"bare-events\": \"^2.5.4\",\n    \"bare-stream\": \"^2.6.4\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.5.0\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst { Duplex } = require('bare-stream')\nconst binding = require('./binding')\nconst constants = require('./lib/constants')\nconst errors = require('./lib/errors')\n\nconst readBufferSize = 65536\n\nconst context = binding.context()\n\nexports.Socket = class TLSSocket extends Duplex {\n  static _buffer = Buffer.alloc(readBufferSize)\n\n  constructor(socket, opts = {}) {\n    const {\n      isServer = false,\n      cert = null,\n      key = null,\n      host = null,\n      eagerOpen = true,\n      allowHalfOpen = true\n    } = opts\n\n    super({ eagerOpen })\n\n    this._state = 0\n\n    this._socket = socket\n    this._key = key\n    this._cert = cert\n    this._allowHalfOpen = allowHalfOpen\n\n    this._pendingOpen = null\n    this._pendingWrite = null\n\n    this._buffer = []\n    this._buffered = 0\n\n    this._handle = binding.init(\n      context,\n      isServer,\n      cert,\n      key,\n      host,\n      this,\n      this._onread,\n      this._onwrite\n    )\n  }\n\n  get socket() {\n    return this._socket\n  }\n\n  get encrypted() {\n    return true\n  }\n\n  _onconnect() {\n    this._state |= constants.state.HANDSHAKE\n\n    this.emit('connect')\n\n    const cb = this._pendingOpen\n    this._pendingOpen = null\n    cb(null)\n  }\n\n  _ondata(data) {\n    this._buffer.push(data)\n    this._buffered += data.byteLength\n\n    while (this._buffered > 0) {\n      if (this._state & constants.state.HANDSHAKE) {\n        let read\n        try {\n          read = binding.read(this._handle, TLSSocket._buffer)\n        } catch (err) {\n          return this.destroy(errors.from(err))\n        }\n\n        if (read < 0) break\n\n        if (read === 0) {\n          this.push(null)\n          if (this._allowHalfOpen === false) this.end()\n          return\n        }\n\n        const copy = Buffer.allocUnsafe(read)\n        copy.set(TLSSocket._buffer.subarray(0, read))\n\n        this.push(copy)\n      } else {\n        try {\n          if (binding.handshake(this._handle)) this._onconnect()\n          else break\n        } catch (err) {\n          if (this._pendingOpen) this._pendingOpen(errors.from(err))\n          else this.destroy(errors.from(err))\n          return\n        }\n      }\n    }\n  }\n\n  _ondrain() {\n    const cb = this._pendingWrite\n    this._pendingWrite = null\n    if (cb) cb(null)\n  }\n\n  _onend() {\n    this.push(null)\n  }\n\n  _onerror(err) {\n    if (this._pendingOpen) {\n      const cb = this._pendingOpen\n      this._pendingOpen = null\n\n      cb(err)\n    } else {\n      this.destroy(err)\n    }\n  }\n\n  _onread(data) {\n    if (this._buffered < data.byteLength) return 0\n\n    const buffer =\n      this._buffer.length === 1 ? this._buffer[0] : Buffer.concat(this._buffer)\n\n    data.set(buffer.subarray(0, data.byteLength))\n\n    this._buffered -= data.byteLength\n    this._buffer = this._buffered > 0 ? [buffer.subarray(data.byteLength)] : []\n\n    return data.byteLength\n  }\n\n  _onwrite(data) {\n    if (this._socket.write(Buffer.from(data.slice()))) this._pendingWrite = null\n\n    return data.byteLength\n  }\n\n  _attach() {\n    this._ondata = this._ondata.bind(this)\n    this._ondrain = this._ondrain.bind(this)\n    this._onend = this._onend.bind(this)\n    this._onerror = this._onerror.bind(this)\n\n    this._socket\n      .on('data', this._ondata)\n      .on('drain', this._ondrain)\n      .on('end', this._onend)\n      .on('error', this._onerror)\n  }\n\n  _detach() {\n    this._socket\n      .off('data', this._ondata)\n      .off('drain', this._ondrain)\n      .off('end', this._onend)\n      .off('error', this._onerror)\n  }\n\n  _open(cb) {\n    this._pendingOpen = cb\n    this._attach()\n\n    try {\n      if (binding.handshake(this._handle)) this._onconnect()\n    } catch (err) {\n      this._pendingOpen = null\n\n      cb(errors.from(err))\n    }\n  }\n\n  _write(data, encoding, cb) {\n    this._pendingWrite = cb\n\n    try {\n      binding.write(this._handle, data)\n\n      if (this._pendingWrite !== null) return\n\n      cb(null)\n    } catch (err) {\n      this._pendingWrite = null\n\n      cb(errors.from(err))\n    }\n  }\n\n  _final(cb) {\n    try {\n      binding.shutdown(this._handle)\n\n      cb(null)\n    } catch (err) {\n      cb(err)\n    }\n\n    this._socket.end()\n  }\n\n  _predestroy() {\n    this._detach()\n    binding.destroy(this._handle)\n    this._handle = null\n  }\n\n  _destroy(err, cb) {\n    this._detach()\n    if (this._handle) {\n      binding.destroy(this._handle)\n      this._handle = null\n    }\n    cb(err)\n  }\n}\n\nexports.TLSSocket = exports.Socket // For Node.js compatibility\n\nexports.constants = constants\nexports.errors = errors\n\nconst net = require('./net')\n\nexports.createConnection = net.createConnection\nexports.createServer = net.createServer\n\n// For Node.js compatibility\nexports.connect = exports.createConnection\nmodule.exports = {\n  state: {\n    HANDSHAKE: 0x1\n  }\n}\nmodule.exports = class TLSError extends Error {\n  constructor(msg, code, fn = TLSError) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'TLSError'\n  }\n\n  static from(err) {\n    return new TLSError(err.message, err.code, TLSError.from)\n  }\n}\nconst EventEmitter = require('bare-events')\nconst net = require('bare-net')\nconst tls = require('bare-tls')\n\nclass TLSNetSocket extends tls.Socket {\n  ref() {\n    this.socket.ref()\n  }\n\n  unref() {\n    this.socket.unref()\n  }\n}\n\nclass TLSNetServer extends EventEmitter {\n  constructor(opts = {}, onconnection) {\n    if (typeof opts === 'function') {\n      onconnection = opts\n      opts = {}\n    }\n\n    const {\n      cert = null,\n      key = null,\n      host = null,\n      eagerOpen = true,\n      allowHalfOpen = true\n    } = opts\n\n    super()\n\n    this._opts = {\n      cert,\n      key,\n      host,\n      eagerOpen,\n      allowHalfOpen\n    }\n\n    this._server = net.createServer(opts)\n    this._server\n      .on('listening', this._onlistening.bind(this))\n      .on('connection', this._onconnection.bind(this))\n      .on('error', this._onerror.bind(this))\n      .on('close', this._onclose.bind(this))\n\n    if (onconnection) this.on('connection', onconnection)\n  }\n\n  get listening() {\n    return this._server.listening\n  }\n\n  address() {\n    return this._server.address()\n  }\n\n  listen(...args) {\n    this._server.listen(...args)\n    return this\n  }\n\n  close(onclose) {\n    if (onclose) this.once('close', onclose)\n    this._server.close()\n  }\n\n  ref() {\n    this._server.ref()\n  }\n\n  unref() {\n    this._server.unref()\n  }\n\n  _onlistening() {\n    this.emit('listening')\n  }\n\n  _onconnection(socket) {\n    this.emit(\n      'connection',\n      new TLSNetSocket(socket, { ...this._opts, isServer: true })\n    )\n  }\n\n  _onerror(err) {\n    this.emit('error', err)\n  }\n\n  _onclose() {\n    this.emit('close')\n  }\n}\n\nexports.createConnection = function createConnection(...args) {\n  let opts = {}\n  let onconnect\n\n  if (typeof args[0] === 'string') {\n    // createConnection(path[, onconnect])\n    opts.path = args[0]\n    onconnect = args[1]\n  } else if (typeof args[0] === 'number') {\n    // createConnection(port[, host][, onconnect])\n    opts.port = args[0]\n\n    if (typeof args[1] === 'function') {\n      onconnect = args[1]\n    } else {\n      opts.host = args[1]\n      onconnect = args[2]\n    }\n  } else {\n    // createConnection(opts[, onconnect])\n    opts = args[0] || {}\n    onconnect = args[1]\n  }\n\n  return new TLSNetSocket(net.createConnection(opts, onconnect), opts)\n}\n\nexports.createServer = function createServer(opts, onconnection) {\n  return new TLSNetServer(opts, onconnection)\n}\n{\n  \"name\": \"bare-tls\",\n  \"version\": \"2.1.7\",\n  \"description\": \"Transport Layer Security (TLS) streams for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\",\n    \"./constants\": {\n      \"types\": \"./lib/constants.d.ts\",\n      \"default\": \"./lib/constants.js\"\n    },\n    \"./errors\": {\n      \"types\": \"./lib/errors.d.ts\",\n      \"default\": \"./lib/errors.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"net.js\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-tls.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-tls/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-tls#readme\",\n  \"engines\": {\n    \"bare\": \">=1.7.0\"\n  },\n  \"dependencies\": {\n    \"bare-net\": \"^2.0.1\",\n    \"bare-stream\": \"^2.6.4\"\n  },\n  \"devDependencies\": {\n    \"bare-events\": \"^2.6.0\",\n    \"bare-fs\": \"^4.0.2\",\n    \"brittle\": \"^3.1.1\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"cmake-fetch\": \"^1.0.0\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nmodule.exports = require.addon()\n/* global Bare */\nconst { Readable, Writable } = require('bare-stream')\nconst Signal = require('bare-signals')\nconst binding = require('./binding')\nconst constants = require('./lib/constants')\n\nconst defaultReadBufferSize = 65536\n\nexports.ReadStream = class TTYReadStream extends Readable {\n  constructor(fd, opts = {}) {\n    super()\n\n    const { readBufferSize = defaultReadBufferSize, allowHalfOpen = true } =\n      opts\n\n    this._state = 0\n\n    this._allowHalfOpen = allowHalfOpen\n\n    this._pendingDestroy = null\n\n    this._buffer = Buffer.alloc(readBufferSize)\n\n    this._handle = binding.init(\n      fd,\n      this._buffer,\n      this,\n      noop,\n      this._onread,\n      this._onclose\n    )\n  }\n\n  get isTTY() {\n    return true\n  }\n\n  setMode(mode) {\n    binding.setMode(this._handle, mode)\n    return this\n  }\n\n  setRawMode(enabled) {\n    return this.setMode(enabled ? constants.mode.RAW : constants.mode.NORMAL)\n  }\n\n  _read() {\n    if ((this._state & constants.state.READING) === 0) {\n      this._state |= constants.state.READING\n      binding.resume(this._handle)\n    }\n  }\n\n  _predestroy() {\n    if (this._state & constants.state.CLOSING) return\n    this._state |= constants.state.CLOSING\n    binding.close(this._handle)\n  }\n\n  _destroy(err, cb) {\n    if (this._state & constants.state.CLOSING) return cb(err)\n    this._state |= constants.state.CLOSING\n    this._pendingDestroy = cb\n    binding.close(this._handle)\n  }\n\n  _continueDestroy() {\n    if (this._pendingDestroy === null) return\n    const cb = this._pendingDestroy\n    this._pendingDestroy = null\n    cb(null)\n  }\n\n  _onread(err, read) {\n    if (err) {\n      this.destroy(err)\n      return\n    }\n\n    if (read === 0) {\n      this.push(null)\n      if (this._allowHalfOpen === false) this.end()\n      return\n    }\n\n    const copy = Buffer.allocUnsafe(read)\n    copy.set(this._buffer.subarray(0, read))\n\n    if (this.push(copy) === false && this.destroying === false) {\n      this._state &= ~constants.state.READING\n      binding.pause(this._handle)\n    }\n  }\n\n  _onclose() {\n    this._handle = null\n    this._continueDestroy()\n  }\n}\n\nexports.WriteStream = class TTYWriteStream extends Writable {\n  constructor(fd, opts = {}) {\n    super()\n\n    this._state = 0\n    this._size = null\n\n    this._pendingWrite = null\n    this._pendingDestroy = null\n\n    this._handle = binding.init(\n      fd,\n      empty,\n      this,\n      this._onwrite,\n      noop,\n      this._onclose\n    )\n\n    this._size = this.getWindowSize()\n\n    if (TTYWriteStream._streams.size === 0) TTYWriteStream._resize.start()\n    TTYWriteStream._streams.add(this)\n  }\n\n  get isTTY() {\n    return true\n  }\n\n  get columns() {\n    return this._size[0]\n  }\n\n  get rows() {\n    return this._size[1]\n  }\n\n  getWindowSize() {\n    return binding.getWindowSize(this._handle)\n  }\n\n  _writev(batch, cb) {\n    this._pendingWrite = [cb, batch]\n    binding.writev(\n      this._handle,\n      batch.map(({ chunk }) => chunk)\n    )\n  }\n\n  _predestroy() {\n    if (this._state & constants.state.CLOSING) return\n    this._state |= constants.state.CLOSING\n    binding.close(this._handle)\n    TTYWriteStream._streams.delete(this)\n    if (TTYWriteStream._streams.size === 0) TTYWriteStream._resize.stop()\n  }\n\n  _destroy(err, cb) {\n    if (this._state & constants.state.CLOSING) return cb(err)\n    this._state |= constants.state.CLOSING\n    this._pendingDestroy = cb\n    binding.close(this._handle)\n    TTYWriteStream._streams.delete(this)\n    if (TTYWriteStream._streams.size === 0) TTYWriteStream._resize.stop()\n  }\n\n  _continueWrite(err) {\n    if (this._pendingWrite === null) return\n    const cb = this._pendingWrite[0]\n    this._pendingWrite = null\n    cb(err)\n  }\n\n  _continueDestroy() {\n    if (this._pendingDestroy === null) return\n    const cb = this._pendingDestroy\n    this._pendingDestroy = null\n    cb(null)\n  }\n\n  _onwrite(err) {\n    this._continueWrite(err)\n  }\n\n  _onclose() {\n    this._handle = null\n    this._continueDestroy()\n  }\n\n  _onresize() {\n    this._size = this.getWindowSize()\n    this.emit('resize')\n  }\n\n  static _streams = new Set()\n\n  static _resize = new Signal('SIGWINCH')\n}\n\nexports.constants = constants\n\nexports.isTTY = binding.isTTY\n\nexports.isatty = exports.isTTY // For Node.js compatibility\n\nexports.WriteStream._resize\n  .on('signal', () => {\n    for (const stream of exports.WriteStream._streams) {\n      stream._onresize()\n    }\n  })\n  .unref()\n\nconst empty = Buffer.alloc(0)\n\nfunction noop() {}\nconst binding = require('../binding')\n\nmodule.exports = exports = {\n  mode: {\n    NORMAL: binding.MODE_NORMAL,\n    RAW: binding.MODE_RAW,\n    IO: binding.MODE_IO || 0\n  },\n\n  state: {\n    READING: 0x1,\n    CLOSING: 0x2\n  }\n}\n\n/** @deprecated Use `mode.NORMAL` */\nexports.MODE_NORMAL = exports.mode.NORMAL\n/** @deprecated Use `mode.RAW` */\nexports.MODE_RAW = exports.mode.RAW\n/** @deprecated Use `mode.IO` */\nexports.MODE_IO = exports.mode.IO\n{\n  \"name\": \"bare-tty\",\n  \"version\": \"5.0.3\",\n  \"description\": \"Native TTY streams for JavaScript\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\",\n    \"./constants\": \"./lib/constants.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-tty.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-tty/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-tty#readme\",\n  \"engines\": {\n    \"bare\": \">=1.16.0\"\n  },\n  \"dependencies\": {\n    \"bare-events\": \"^2.2.0\",\n    \"bare-signals\": \"^4.0.0\",\n    \"bare-stream\": \"^2.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.2.1\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst binding = require('./binding')\n\nconst t = binding.constants\n\nclass Type {\n  constructor(type) {\n    this._type = type\n  }\n\n  isUndefined() {\n    return this._type === t.UNDEFINED\n  }\n\n  isNull() {\n    return this._type === t.NULL\n  }\n\n  isBoolean() {\n    return this._type === t.BOOLEAN\n  }\n\n  isNumber() {\n    return (this._type & 0xff) === t.NUMBER\n  }\n\n  isInt32() {\n    return (this._type & (0xff | t.INT32)) === (t.NUMBER | t.INT32)\n  }\n\n  isUint32() {\n    return (this._type & (0xff | t.UINT32)) === (t.NUMBER | t.UINT32)\n  }\n\n  isString() {\n    return this._type === t.STRING\n  }\n\n  isSymbol() {\n    return this._type === t.SYMBOL\n  }\n\n  isObject() {\n    return (this._type & 0xff) === t.OBJECT\n  }\n\n  isArray() {\n    return this._type === (t.OBJECT | t.ARRAY)\n  }\n\n  isArguments() {\n    return this._type === (t.OBJECT | t.ARGUMENTS)\n  }\n\n  isDate() {\n    return this._type === (t.OBJECT | t.DATE)\n  }\n\n  isRegExp() {\n    return this._type === (t.OBJECT | t.REGEXP)\n  }\n\n  isError() {\n    return this._type === (t.OBJECT | t.ERROR)\n  }\n\n  isPromise() {\n    return this._type === (t.OBJECT | t.PROMISE)\n  }\n\n  isProxy() {\n    return this._type === (t.OBJECT | t.PROXY)\n  }\n\n  isGenerator() {\n    return this._type === (t.OBJECT | t.GENERATOR)\n  }\n\n  isMap() {\n    return this._type === (t.OBJECT | t.MAP)\n  }\n\n  isSet() {\n    return this._type === (t.OBJECT | t.SET)\n  }\n\n  isWeakMap() {\n    return this._type === (t.OBJECT | t.WEAK_MAP)\n  }\n\n  isWeakSet() {\n    return this._type === (t.OBJECT | t.WEAK_SET)\n  }\n\n  isWeakRef() {\n    return this._type === (t.OBJECT | t.WEAK_REF)\n  }\n\n  isArrayBuffer() {\n    return this._type === (t.OBJECT | t.ARRAYBUFFER)\n  }\n\n  isSharedArrayBuffer() {\n    return this._type === (t.OBJECT | t.SHAREDARRAYBUFFER)\n  }\n\n  isTypedArray() {\n    return (this._type & 0xffff) === (t.OBJECT | t.TYPEDARRAY)\n  }\n\n  isInt8Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.INT8ARRAY)\n  }\n\n  isUint8Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.UINT8ARRAY)\n  }\n\n  isUint8ClampedArray() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.UINT8CLAMPEDARRAY)\n  }\n\n  isInt16Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.INT16ARRAY)\n  }\n\n  isUint16Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.UINT16ARRAY)\n  }\n\n  isInt32Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.INT32ARRAY)\n  }\n\n  isUint32Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.UINT32ARRAY)\n  }\n\n  isFloat16Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.FLOAT16ARRAY)\n  }\n\n  isFloat32Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.FLOAT32ARRAY)\n  }\n\n  isFloat64Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.FLOAT64ARRAY)\n  }\n\n  isBigInt64Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.BIGINT64ARRAY)\n  }\n\n  isBigUint64Array() {\n    return this._type === (t.OBJECT | t.TYPEDARRAY | t.BIGUINT64ARRAY)\n  }\n\n  isDataView() {\n    return this._type === (t.OBJECT | t.DATAVIEW)\n  }\n\n  isModuleNamespace() {\n    return this._type === (t.OBJECT | t.MODULE_NAMESPACE)\n  }\n\n  isFunction() {\n    return (this._type & 0xff) === t.FUNCTION\n  }\n\n  isAsyncFunction() {\n    return (\n      (this._type & (0xff | t.ASYNC_FUNCTION)) ===\n      (t.FUNCTION | t.ASYNC_FUNCTION)\n    )\n  }\n\n  isGeneratorFunction() {\n    return (\n      (this._type & (0xff | t.GENERATOR_FUNCTION)) ===\n      (t.FUNCTION | t.GENERATOR_FUNCTION)\n    )\n  }\n\n  isExternal() {\n    return this._type === t.EXTERNAL\n  }\n\n  isBigInt() {\n    return this._type === t.BIGINT\n  }\n}\n\nmodule.exports = exports = function type(value) {\n  switch (typeof value) {\n    case 'undefined':\n      return new Type(t.UNDEFINED)\n    case 'boolean':\n      return new Type(t.BOOLEAN)\n    case 'number':\n      return new Type(\n        Number.isSafeInteger(value) ? binding.type(value) : t.NUMBER\n      )\n    case 'string':\n      return new Type(t.STRING)\n    case 'symbol':\n      return new Type(t.SYMBOL)\n    case 'object':\n      return new Type(value === null ? t.NULL : binding.type(value))\n    case 'function':\n      return new Type(binding.type(value))\n    case 'bigint':\n      return new Type(t.BIGINT)\n  }\n}\n\nexports.createTag = function createTag(...components) {\n  const tag = new Uint32Array(4)\n  for (let i = 0; i < 4; i++) tag[i] = components[i] || 0\n  return tag\n}\n\nexports.addTag = function addTag(object, tag) {\n  binding.addTag(object, tag)\n}\n\nexports.checkTag = function checkTag(object, tag) {\n  return binding.checkTag(object, tag)\n}\n{\n  \"name\": \"bare-type\",\n  \"version\": \"1.1.0\",\n  \"description\": \"Cross-realm type predicates for Bare\",\n  \"exports\": {\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./package\": \"./package.json\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-type.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-type/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-type#readme\",\n  \"engines\": {\n    \"bare\": \">=1.2.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.4.0\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"prettier\": \"^3.4.1\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst path = require('bare-path')\nconst binding = require('./binding')\nconst errors = require('./lib/errors')\nconst URLSearchParams = require('./lib/url-search-params')\n\nconst kind = Symbol.for('bare.url.kind')\n\nconst isWindows = Bare.platform === 'win32'\n\nmodule.exports = exports = class URL {\n  static get [kind]() {\n    return 0 // Compatibility version\n  }\n\n  constructor(input, base, opts = {}) {\n    if (arguments.length === 0) throw errors.INVALID_URL()\n\n    input = String(input)\n\n    if (base !== undefined) base = String(base)\n\n    this._components = new Uint32Array(8)\n\n    this._parse(input, base, opts.throw !== false)\n\n    if (this._href) this._params = new URLSearchParams(this.search, this)\n  }\n\n  get [kind]() {\n    return URL[kind]\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-href\n\n  get href() {\n    return this._href\n  }\n\n  set href(value) {\n    this._update(value)\n\n    this._params._parse(this.search)\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-protocol\n\n  get protocol() {\n    return this._slice(0, this._components[0]) + ':'\n  }\n\n  set protocol(value) {\n    this._update(this._replace(value.replace(/:+$/, ''), 0, this._components[0]))\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-username\n\n  get username() {\n    return this._slice(this._components[0] + 3 /* :// */, this._components[1])\n  }\n\n  set username(value) {\n    if (cannotHaveCredentialsOrPort(this)) {\n      return\n    }\n\n    if (this.username === '') value += '@'\n\n    this._update(this._replace(value, this._components[0] + 3 /* :// */, this._components[1]))\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-password\n\n  get password() {\n    return this._href.slice(this._components[1] + 1 /* : */, this._components[2] - 1 /* @ */)\n  }\n\n  set password(value) {\n    if (cannotHaveCredentialsOrPort(this)) {\n      return\n    }\n\n    let start = this._components[1] + 1 /* : */\n    let end = this._components[2] - 1 /* @ */\n\n    if (this.password === '') {\n      value = ':' + value\n      start--\n    }\n\n    if (this.username === '') {\n      value += '@'\n      end++\n    }\n\n    this._update(this._replace(value, start, end))\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-host\n\n  get host() {\n    return this._slice(this._components[2], this._components[5])\n  }\n\n  set host(value) {\n    if (hasOpaquePath(this)) {\n      return\n    }\n\n    this._update(\n      this._replace(value, this._components[2], this._components[value.includes(':') ? 5 : 3])\n    )\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-hostname\n\n  get hostname() {\n    return this._slice(this._components[2], this._components[3])\n  }\n\n  set hostname(value) {\n    if (hasOpaquePath(this)) {\n      return\n    }\n\n    this._update(this._replace(value, this._components[2], this._components[3]))\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-port\n\n  get port() {\n    return this._slice(this._components[3] + 1 /* : */, this._components[5])\n  }\n\n  set port(value) {\n    if (cannotHaveCredentialsOrPort(this)) {\n      return\n    }\n\n    let start = this._components[3] + 1 /* : */\n\n    if (this.port === '') {\n      value = ':' + value\n      start--\n    }\n\n    this._update(this._replace(value, start, this._components[5]))\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-pathname\n\n  get pathname() {\n    return this._slice(this._components[5], this._components[6] - 1 /* ? */)\n  }\n\n  set pathname(value) {\n    if (hasOpaquePath(this)) {\n      return\n    }\n\n    if (value[0] !== '/' && value[0] !== '\\\\') {\n      value = '/' + value\n    }\n\n    this._update(this._replace(value, this._components[5], this._components[6] - 1 /* ? */))\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-search\n\n  get search() {\n    return this._slice(this._components[6] - 1 /* ? */, this._components[7] - 1 /* # */)\n  }\n\n  set search(value) {\n    if (value && value[0] !== '?') value = '?' + value\n\n    this._update(\n      this._replace(value, this._components[6] - 1 /* ? */, this._components[7] - 1 /* # */)\n    )\n\n    this._params._parse(this.search)\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-searchparams\n\n  get searchParams() {\n    return this._params\n  }\n\n  // https://url.spec.whatwg.org/#dom-url-hash\n\n  get hash() {\n    return this._slice(this._components[7] - 1 /* # */)\n  }\n\n  set hash(value) {\n    if (value && value[0] !== '#') value = '#' + value\n\n    this._update(this._replace(value, this._components[7] - 1 /* # */))\n  }\n\n  toString() {\n    return this._href\n  }\n\n  toJSON() {\n    return this._href\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    return {\n      __proto__: { constructor: URL },\n\n      href: this.href,\n      protocol: this.protocol,\n      username: this.username,\n      password: this.password,\n      host: this.host,\n      hostname: this.hostname,\n      port: this.port,\n      pathname: this.pathname,\n      search: this.search,\n      searchParams: this.searchParams,\n      hash: this.hash\n    }\n  }\n\n  _slice(start, end = this._href.length) {\n    return this._href.slice(start, end)\n  }\n\n  _replace(replacement, start, end = this._href.length) {\n    return this._slice(0, start) + replacement + this._slice(end)\n  }\n\n  _parse(input, base, shouldThrow) {\n    try {\n      this._href = binding.parse(\n        String(input),\n        base ? String(base) : null,\n        this._components,\n        shouldThrow\n      )\n    } catch (err) {\n      if (err instanceof TypeError) throw err\n\n      throw errors.INVALID_URL(`Invalid URL '${input}'`, input)\n    }\n  }\n\n  _update(input) {\n    try {\n      this._parse(input, null, true)\n    } catch (err) {\n      if (err instanceof TypeError) throw err\n    }\n  }\n}\n\n// https://url.spec.whatwg.org/#url-opaque-path\nfunction hasOpaquePath(url) {\n  return url.pathname[0] !== '/'\n}\n\n// https://url.spec.whatwg.org/#cannot-have-a-username-password-port\nfunction cannotHaveCredentialsOrPort(url) {\n  return url.hostname === '' || url.protocol === 'file:'\n}\n\nconst URL = exports\n\nexports.URL = URL\nexports.URLSearchParams = URLSearchParams\n\nexports.errors = errors\n\nexports.isURL = function isURL(value) {\n  if (value instanceof URL) return true\n\n  return typeof value === 'object' && value !== null && value[kind] === URL[kind]\n}\n\n// https://url.spec.whatwg.org/#dom-url-parse\nexports.parse = function parse(input, base) {\n  const url = new URL(input, base, { throw: false })\n  return url._href ? url : null\n}\n\n// https://url.spec.whatwg.org/#dom-url-canparse\nexports.canParse = function canParse(input, base) {\n  return binding.canParse(String(input), base ? String(base) : null)\n}\n\nexports.fileURLToPath = function fileURLToPath(url) {\n  if (typeof url === 'string') {\n    url = new URL(url)\n  }\n\n  if (url.protocol !== 'file:') {\n    throw errors.INVALID_URL_SCHEME('The URL must use the file: protocol')\n  }\n\n  if (isWindows) {\n    if (/%2f|%5c/i.test(url.pathname)) {\n      throw errors.INVALID_FILE_URL_PATH(\n        'The file: URL path must not include encoded \\\\ or / characters'\n      )\n    }\n  } else {\n    if (url.hostname) {\n      throw errors.INVALID_FILE_URL_HOST(\"The file: URL host must be 'localhost' or empty\")\n    }\n\n    if (/%2f/i.test(url.pathname)) {\n      throw errors.INVALID_FILE_URL_PATH('The file: URL path must not include encoded / characters')\n    }\n  }\n\n  const pathname = path.normalize(decodeURIComponent(url.pathname))\n\n  if (isWindows) {\n    if (url.hostname) return '\\\\\\\\' + url.hostname + pathname\n\n    const letter = pathname.charCodeAt(1) | 0x20\n\n    if (letter < 0x61 /* a */ || letter > 0x7a /* z */ || pathname.charCodeAt(2) !== 0x3a /* : */) {\n      throw errors.INVALID_FILE_URL_PATH('The file: URL path must be absolute')\n    }\n\n    return pathname.slice(1)\n  }\n\n  return pathname\n}\n\nexports.pathToFileURL = function pathToFileURL(pathname) {\n  let resolved = path.resolve(pathname)\n\n  if (pathname[pathname.length - 1] === '/') {\n    resolved += '/'\n  } else if (isWindows && pathname[pathname.length - 1] === '\\\\') {\n    resolved += '\\\\'\n  }\n\n  resolved = resolved\n    .replaceAll('%', '%25') // Must be first\n    .replaceAll('#', '%23')\n    .replaceAll('?', '%3f')\n    .replaceAll('\\n', '%0a')\n    .replaceAll('\\r', '%0d')\n    .replaceAll('\\t', '%09')\n\n  if (!isWindows) {\n    resolved = resolved.replaceAll('\\\\', '%5c')\n  }\n\n  return new URL('file:' + resolved)\n}\n\nexports.format = function format(parts) {\n  const { protocol, auth, host, hostname, port, pathname, search, query, hash, slashes } = parts\n\n  let result = ''\n\n  if (typeof protocol === 'string') {\n    result += protocol\n\n    if (protocol[protocol.length - 1] !== ':') {\n      result += ':'\n    }\n\n    if (slashes === true || /https?|ftp|gopher|file/.test(protocol)) {\n      result += '//'\n    }\n  }\n\n  if (typeof auth === 'string') {\n    if (host || hostname) result += auth + '@'\n  }\n\n  if (typeof host === 'string') result += host\n  else {\n    result += hostname\n\n    if (port) result += ':' + port\n  }\n\n  if (typeof pathname === 'string' && pathname !== '') {\n    if (pathname[0] !== '/') result += '/'\n    result += pathname\n  }\n\n  if (typeof search === 'string') {\n    if (search[0] !== '?') result += '?'\n    result += search\n  } else if (typeof query === 'object' && query !== null) {\n    result += '?' + new URLSearchParams(query)\n  }\n\n  if (typeof hash === 'string') {\n    if (hash[0] !== '#') result += '#'\n    result += hash\n  }\n\n  return result\n}\nmodule.exports = class URLError extends Error {\n  constructor(msg, fn = URLError, code = fn.name) {\n    super(`${code}: ${msg}`)\n\n    this.code = code\n\n    if (Error.captureStackTrace) Error.captureStackTrace(this, fn)\n  }\n\n  get name() {\n    return 'URLError'\n  }\n\n  static INVALID_URL(msg, input) {\n    const err = new URLError(msg, URLError.INVALID_URL)\n\n    err.input = input\n\n    return err\n  }\n\n  static INVALID_URL_SCHEME(msg = 'Invalid URL') {\n    return new URLError(msg, URLError.INVALID_URL_SCHEME)\n  }\n\n  static INVALID_FILE_URL_HOST(msg = 'Invalid file: URL host') {\n    return new URLError(msg, URLError.INVALID_FILE_URL_HOST)\n  }\n\n  static INVALID_FILE_URL_PATH(msg = 'Invalid file: URL path') {\n    return new URLError(msg, URLError.INVALID_FILE_URL_PATH)\n  }\n}\nmodule.exports = class URLSearchParams {\n  static _urls = new WeakMap()\n\n  // https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams\n  constructor(init, url = null) {\n    this._params = new Map()\n\n    if (url) URLSearchParams._urls.set(this, url)\n\n    if (typeof init === 'string') {\n      this._parse(init)\n    } else if (init) {\n      for (const [name, value] of typeof init[Symbol.iterator] === 'function'\n        ? init\n        : Object.entries(init)) {\n        this.append(name, value)\n      }\n    }\n  }\n\n  // https://url.spec.whatwg.org/#dom-urlsearchparams-size\n  get size() {\n    return this._params.length\n  }\n\n  // https://url.spec.whatwg.org/#dom-urlsearchparams-append\n  append(name, value = null) {\n    if (value === null) return\n\n    let list = this._params.get(name)\n\n    if (list === undefined) {\n      list = []\n      this._params.set(name, list)\n    }\n\n    list.push(value)\n\n    this._update()\n  }\n\n  // https://url.spec.whatwg.org/#dom-urlsearchparams-delete\n  delete(name, value = null) {\n    if (value === null) this._params.delete(name)\n    else {\n      let list = this._params.get(name)\n\n      if (list === undefined) return\n\n      list = list.filter((found) => found !== value)\n\n      if (list.length === 0) this._params.delete(name)\n      else this._params.set(name, list)\n    }\n\n    this._update()\n  }\n\n  // https://url.spec.whatwg.org/#dom-urlsearchparams-get\n  get(name) {\n    const list = this._params.get(name)\n\n    if (list === undefined) return null\n\n    return list[0]\n  }\n\n  // https://url.spec.whatwg.org/#dom-urlsearchparams-getall\n  getAll(name) {\n    const list = this._params.get(name)\n\n    if (list === undefined) return []\n\n    return Array.from(list)\n  }\n\n  // https://url.spec.whatwg.org/#dom-urlsearchparams-has\n  has(name, value = null) {\n    const list = this._params.get(name)\n\n    if (list === undefined) return false\n\n    if (value === null) return true\n\n    return list.includes(value)\n  }\n\n  // https://url.spec.whatwg.org/#dom-urlsearchparams-set\n  set(name, value = null) {\n    if (value === null) this._params.delete(name)\n    else this._params.set(name, [value])\n\n    this._update()\n  }\n\n  toString() {\n    return this._serialize()\n  }\n\n  toJSON() {\n    return [...this]\n  }\n\n  *[Symbol.iterator]() {\n    for (const [name, values] of this._params) {\n      for (const value of values) yield [name, value]\n    }\n  }\n\n  [Symbol.for('bare.inspect')]() {\n    const object = {\n      __proto__: { constructor: URLSearchParams }\n    }\n\n    for (const [name, values] of this._params) {\n      if (values.length === 1) object[name] = values[0]\n      else object[name] = values\n    }\n\n    return object\n  }\n\n  // https://url.spec.whatwg.org/#concept-urlsearchparams-update\n  _update() {\n    const url = URLSearchParams._urls.get(this)\n\n    if (url === undefined) return\n\n    url.search = this._serialize()\n  }\n\n  // https://url.spec.whatwg.org/#concept-urlencoded-parser\n  _parse(input) {\n    if (input[0] === '?') input = input.substring(1)\n\n    this._params = new Map()\n\n    for (const sequence of input.split('&')) {\n      if (sequence.length === 0) continue\n\n      let i = sequence.indexOf('=')\n      if (i === -1) i = sequence.length\n\n      const name = decodeURIComponent(sequence.substring(0, i))\n      const value = decodeURIComponent(sequence.substring(i + 1, sequence.length))\n\n      let list = this._params.get(name)\n\n      if (list === undefined) {\n        list = []\n        this._params.set(name, list)\n      }\n\n      list.push(value)\n    }\n  }\n\n  // https://url.spec.whatwg.org/#concept-urlencoded-serializer\n  _serialize() {\n    let output = ''\n\n    for (let [name, values] of this._params) {\n      name = encodeURIComponent(name)\n\n      for (const value of values) {\n        if (output) output += '&'\n\n        output += name + '=' + encodeURIComponent(value)\n      }\n    }\n\n    return output\n  }\n}\n{\n  \"name\": \"bare-url\",\n  \"version\": \"2.3.2\",\n  \"description\": \"WHATWG URL implementation for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    },\n    \"./global\": {\n      \"types\": \"./global.d.ts\",\n      \"default\": \"./global.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"global.js\",\n    \"global.d.ts\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-url.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-url/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-url\",\n  \"dependencies\": {\n    \"bare-path\": \"^3.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"cmake-bare\": \"^1.1.6\",\n    \"cmake-fetch\": \"^1.0.0\",\n    \"prettier\": \"^3.3.3\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nconst { TextEncoder, TextDecoder } = require('bare-encoding')\n\nexports.TextEncoder = TextEncoder\nexports.TextDecoder = TextDecoder\n\nexports.debuglog = require('bare-debug-log')\nexports.format = require('bare-format')\nexports.formatWithOptions = exports.format.formatWithOptions\nexports.inspect = require('bare-inspect')\n\nexports.deprecate = require('./lib/deprecate')\nexports.inherits = require('./lib/inherits')\nexports.promisify = require('./lib/promisify')\nexports.types = require('./lib/types')\nmodule.exports = function deprecate(fn, msg, code) {\n  let warned = false\n\n  return function (...args) {\n    if (!warned) {\n      warned = true\n\n      if (code) {\n        console.warn(`[${code}]`, 'DeprecationWarning:', msg)\n      } else {\n        console.warn('DeprecationWarning:', msg)\n      }\n    }\n\n    if (new.target) return Reflect.construct(fn, args, new.target)\n\n    return Reflect.apply(fn, this, args)\n  }\n}\nmodule.exports = function inherits(ctor, superCtor) {\n  if (superCtor) Object.setPrototypeOf(ctor.prototype, superCtor.prototype)\n}\nmodule.exports = function promisify(fn) {\n  return function (...args) {\n    return new Promise((resolve, reject) => {\n      args.push((err, ...result) => {\n        if (err) reject(err)\n        else resolve(...result)\n      })\n\n      Reflect.apply(fn, this, args)\n    })\n  }\n}\nconst type = require('bare-type')\n\nexports.isAnyArrayBuffer = (value) => {\n  const t = type(value)\n  return t.isArrayBuffer() || t.isSharedArrayBuffer()\n}\n\nexports.isArrayBufferView = (value) => ArrayBuffer.isView(value)\n\nexports.isArgumentsObject = (value) => type(value).isArguments()\n\nexports.isArrayBuffer = (value) => type(value).isArrayBuffer()\n\nexports.isAsyncFunction = (value) => type(value).isAsyncFunction()\n\nexports.isBigInt64Array = (value) => type(value).isBigInt64Array()\n\nexports.isBigIntObject = (value) => value instanceof BigInt\n\nexports.isBigUint64Array = (value) => type(value).isBigUint64Array()\n\nexports.isBooleanObject = (value) => value instanceof Boolean\n\nexports.isBoxedPrimitive = (value) =>\n  exports.isBigIntObject(value) ||\n  exports.isBooleanObject(value) ||\n  exports.isNumberObject(value) ||\n  exports.isStringObject(value) ||\n  exports.isSymbolObject(value)\n\nexports.isCryptoKey = () => {\n  throw new Error('Not implemented')\n}\n\nexports.isDataView = (value) => type(value).isDataView()\n\nexports.isDate = (value) => type(value).isDate()\n\nexports.isExternal = (value) => type(value).isExternal()\n\nexports.isFloat16Array = () => {\n  throw new Error('Not implemented')\n}\n\nexports.isFloat32Array = (value) => type(value).isFloat32Array()\n\nexports.isFloat64Array = (value) => type(value).isFloat64Array()\n\nexports.isGeneratorFunction = (value) => type(value).isGeneratorFunction()\n\nexports.isGeneratorObject = (value) => type(value).isGenerator()\n\nexports.isInt8Array = (value) => type(value).isInt8Array()\n\nexports.isInt16Array = (value) => type(value).isInt16Array()\n\nexports.isInt32Array = (value) => type(value).isInt32Array()\n\nexports.isKeyObject = () => {\n  throw new Error('Not implemented')\n}\n\nexports.isMap = (value) => type(value).isMap()\n\nexports.isMapIterator = () => {\n  throw new Error('Not implemented')\n}\n\nexports.isModuleNamespaceObject = (value) => type(value).isModuleNamespace()\n\nexports.isNativeError = () => {\n  throw new Error('Not implemented')\n}\n\nexports.isNumberObject = (value) => value instanceof Number\n\nexports.isPromise = (value) => type(value).isPromise()\n\nexports.isProxy = (value) => type(value).isProxy()\n\nexports.isRegExp = (value) => type(value).isRegExp()\n\nexports.isSet = (value) => type(value).isSet()\n\nexports.isSetIterator = () => {\n  throw new Error('Not implemented')\n}\n\nexports.isSharedArrayBuffer = (value) => type(value).isSharedArrayBuffer()\n\nexports.isStringObject = (value) => value instanceof String\n\nexports.isSymbolObject = (value) => value instanceof Symbol\n\nexports.isTypedArray = (value) => type(value).isTypedArray()\n\nexports.isUint8Array = (value) => type(value).isUint8Array()\n\nexports.isUint8ClampedArray = (value) => type(value).isUint8ClampedArray()\n\nexports.isUint16Array = (value) => type(value).isUint16Array()\n\nexports.isUint32Array = (value) => type(value).isUint32Array()\n{\n  \"name\": \"bare-utils\",\n  \"version\": \"1.5.1\",\n  \"description\": \"Node.js-compatible utility functions for Bare\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": \"./index.js\",\n    \"./types\": \"./lib/types.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"types.js\",\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-utils.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-utils/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-utils#readme\",\n  \"dependencies\": {\n    \"bare-debug-log\": \"^2.0.0\",\n    \"bare-encoding\": \"^1.0.0\",\n    \"bare-format\": \"^1.0.0\",\n    \"bare-inspect\": \"^3.0.0\",\n    \"bare-type\": \"^1.0.6\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.5.0\",\n    \"prettier\": \"^3.5.3\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nmodule.exports = require.addon()\nconst { Transform, Writable } = require('bare-stream')\nconst binding = require('./binding')\nconst constants = require('./lib/constants')\nconst errors = require('./lib/errors')\n\nexports.constants = constants\nexports.errors = errors\n\nclass ZlibState {\n  constructor(mode, opts = {}) {\n    const {\n      flush = constants.Z_NO_FLUSH,\n      finishFlush = constants.Z_FINISH,\n      chunkSize = constants.Z_DEFAULT_CHUNK,\n      level = constants.Z_DEFAULT_LEVEL,\n      windowBits = constants.Z_DEFAULT_WINDOWBITS,\n      memLevel = constants.Z_DEFAULT_MEMLEVEL,\n      strategy = constants.Z_DEFAULT_STRATEGY\n    } = opts\n\n    this._mode = mode\n\n    this._flushMode = flush\n    this._finishFlushMode = finishFlush\n    this._allocations = []\n\n    this._buffer = Buffer.allocUnsafe(chunkSize)\n\n    this._handle = binding.init(\n      this._mode,\n      this._buffer,\n      level,\n      windowBits,\n      memLevel,\n      strategy,\n      this,\n      this._onalloc,\n      this._onfree\n    )\n  }\n\n  _onalloc(size) {\n    const buffer = Buffer.allocUnsafe(size)\n\n    const view = new Uint32Array(\n      buffer.buffer,\n      buffer.byteOffset,\n      buffer.byteLength / 4\n    )\n\n    view[0] = this._allocations.push(view) - 1\n\n    return buffer\n  }\n\n  _onfree(id) {\n    const last = this._allocations.pop()\n\n    if (last[0] !== id) {\n      this._allocations[(last[0] = id)] = last\n    }\n  }\n\n  reset() {\n    binding.reset(this._handle)\n  }\n\n  *transform(data) {\n    binding.load(this._handle, data)\n\n    let available\n    do {\n      try {\n        available = binding.transform(this._handle, this._flushMode)\n      } catch (err) {\n        throw errors[err.code](err.message)\n      }\n\n      const read = this._buffer.length - available\n\n      if (read) {\n        const copy = Buffer.allocUnsafe(read)\n        copy.set(this._buffer.subarray(0, read))\n\n        yield copy\n      }\n    } while (available === 0)\n  }\n\n  *flush() {\n    let available\n    try {\n      available = binding.transform(this._handle, this._finishFlushMode)\n    } catch (err) {\n      throw errors[err.code](err.message)\n    }\n\n    const read = this._buffer.length - available\n\n    if (read) yield this._buffer.subarray(0, read)\n\n    try {\n      binding.end(this._handle)\n    } catch (err) {\n      throw errors[err.code](err.message)\n    }\n\n    this._handle = null\n  }\n}\n\nclass ZlibStream extends Transform {\n  constructor(mode, opts = {}) {\n    super()\n\n    this._state = new ZlibState(mode, opts)\n  }\n\n  async flush(mode = constants.Z_FULL_FLUSH, cb) {\n    if (typeof mode === 'function') {\n      cb = mode\n      mode = constants.Z_FULL_FLUSH\n    }\n\n    const previousMode = this._state._flushMode\n\n    this._state._flushMode = mode\n\n    await Writable.drained(this)\n\n    this._state._flushMode = previousMode\n\n    if (cb) cb(null) // For Node.js compatibility\n  }\n\n  reset() {\n    if (this._state === null) {\n      throw errors.STREAM_CLOSED('Stream has already closed')\n    }\n\n    this._state.flush()\n  }\n\n  _transform(data, encoding, cb) {\n    let err = null\n\n    try {\n      for (const chunk of this._state.transform(data)) {\n        this.push(chunk)\n      }\n    } catch (e) {\n      err = e\n    }\n\n    cb(err)\n  }\n\n  _flush(cb) {\n    let err = null\n\n    try {\n      for (const chunk of this._state.flush()) {\n        this.push(chunk)\n      }\n    } catch (e) {\n      err = e\n    }\n\n    this._state = null\n\n    cb(err)\n  }\n}\n\nfunction readAsBuffer(stream, buffer, cb) {\n  const chunks = []\n\n  stream.on('data', ondata).on('end', onend).on('error', onerror).end(buffer)\n\n  function ondata(chunk) {\n    chunks.push(chunk)\n  }\n\n  function onend() {\n    cb(null, chunks.length === 1 ? chunks[0] : Buffer.concat(chunks))\n  }\n\n  function onerror(err) {\n    stream.off('end', onend)\n    cb(err)\n  }\n}\n\nfunction transformToBuffer(mode, buffer, opts) {\n  if (typeof buffer === 'string') buffer = Buffer.from(buffer)\n\n  const state = new ZlibState(mode, opts)\n  const chunks = []\n\n  for (const chunk of state.transform(buffer)) {\n    chunks.push(chunk)\n  }\n\n  for (const chunk of state.flush()) {\n    chunks.push(chunk)\n  }\n\n  return chunks.length === 1 ? chunks[0] : Buffer.concat(chunks)\n}\n\nexports.Deflate = class ZlibDeflateStream extends ZlibStream {\n  constructor(opts) {\n    super(binding.DEFLATE, opts)\n  }\n}\n\nexports.createDeflate = function createDeflate(opts) {\n  return new exports.Deflate(opts)\n}\n\nexports.deflate = function deflate(buffer, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  readAsBuffer(new exports.Deflate(opts), buffer, cb)\n}\n\nexports.deflateSync = function deflateSync(buffer, opts) {\n  return transformToBuffer(binding.DEFLATE, buffer, opts)\n}\n\nexports.Inflate = class ZlibInflateStream extends ZlibStream {\n  constructor(opts) {\n    super(binding.INFLATE, opts)\n  }\n}\n\nexports.createInflate = function createInflate(opts) {\n  return new exports.Inflate(opts)\n}\n\nexports.inflate = function inflate(buffer, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  readAsBuffer(new exports.Inflate(opts), buffer, cb)\n}\n\nexports.inflateSync = function inflateSync(buffer, opts) {\n  return transformToBuffer(binding.INFLATE, buffer, opts)\n}\n\nexports.DeflateRaw = class ZlibDeflateRawStream extends ZlibStream {\n  constructor(opts) {\n    super(binding.DEFLATE_RAW, opts)\n  }\n}\n\nexports.createDeflateRaw = function createDeflateRaw(opts) {\n  return new exports.DeflateRaw(opts)\n}\n\nexports.deflateRaw = function deflateRaw(buffer, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  readAsBuffer(new exports.DeflateRaw(opts), buffer, cb)\n}\n\nexports.deflateRawSync = function deflateRawSync(buffer, opts) {\n  return transformToBuffer(binding.DEFLATE_RAW, buffer, opts)\n}\n\nexports.InflateRaw = class ZlibInflateRawStream extends ZlibStream {\n  constructor(opts) {\n    super(binding.INFLATE_RAW, opts)\n  }\n}\n\nexports.createInflateRaw = function createInflateRaw(opts) {\n  return new exports.InflateRaw(opts)\n}\n\nexports.inflateRaw = function inflateRaw(buffer, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  readAsBuffer(new exports.InflateRaw(opts), buffer, cb)\n}\n\nexports.inflateRawSync = function inflateRawSync(buffer, opts) {\n  return transformToBuffer(binding.INFLATE_RAW, buffer, opts)\n}\n\nexports.Gzip = class ZlibGzipStream extends ZlibStream {\n  constructor(opts) {\n    super(binding.GZIP, opts)\n  }\n}\n\nexports.createGzip = function createGzip(opts) {\n  return new exports.Gzip(opts)\n}\n\nexports.gzip = function gzip(buffer, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  readAsBuffer(new exports.Gzip(opts), buffer, cb)\n}\n\nexports.gzipSync = function gzipSync(buffer, opts) {\n  return transformToBuffer(binding.GZIP, buffer, opts)\n}\n\nexports.Gunzip = class ZlibGunzipStream extends ZlibStream {\n  constructor(opts) {\n    super(binding.GUNZIP, opts)\n  }\n}\n\nexports.createGunzip = function createGunzip(opts) {\n  return new exports.Gunzip(opts)\n}\n\nexports.gunzip = function gunzip(buffer, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  readAsBuffer(new exports.Gunzip(opts), buffer, cb)\n}\n\nexports.gunzipSync = function gunzipSync(buffer, opts) {\n  return transformToBuffer(binding.GUNZIP, buffer, opts)\n}\nconst binding = require('../binding')\n\nmodule.exports = binding.constants\nmodule.exports = class ZlibError extends Error {\n  constructor(msg, code, fn = ZlibError) {\n    super(`${code}: ${msg}`)\n    this.code = code\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name() {\n    return 'ZlibError'\n  }\n\n  static STREAM_CLOSED(msg) {\n    return new ZlibError(msg, 'STREAM_CLOSED', ZlibError.STREAM_CLOSED)\n  }\n\n  static STREAM_ERROR(msg) {\n    return new ZlibError(msg, 'STREAM_ERROR', ZlibError.STREAM_ERROR)\n  }\n\n  static DATA_ERROR(msg) {\n    return new ZlibError(msg, 'DATA_ERROR', ZlibError.DATA_ERROR)\n  }\n\n  static MEM_ERROR(msg) {\n    return new ZlibError(msg, 'MEM_ERROR', ZlibError.MEM_ERROR)\n  }\n\n  static BUF_ERROR(msg) {\n    return new ZlibError(msg, 'BUF_ERROR', ZlibError.BUF_ERROR)\n  }\n\n  static VERSION_ERROR(msg) {\n    return new ZlibError(msg, 'VERSION_ERROR', ZlibError.VERSION_ERROR)\n  }\n\n  static UNKNOWN_ERROR(msg) {\n    return new ZlibError(msg, 'UNKNOWN_ERROR', ZlibError.UNKNOWN_ERROR)\n  }\n}\n{\n  \"name\": \"bare-zlib\",\n  \"version\": \"1.3.1\",\n  \"description\": \"Stream-based zlib bindings for JavaScript\",\n  \"exports\": {\n    \".\": \"./index.js\",\n    \"./package\": \"./package.json\",\n    \"./constants\": \"./constants.js\",\n    \"./errors\": \"./errors.js\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"prettier . --check && bare test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bare-zlib.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-zlib/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-zlib\",\n  \"dependencies\": {\n    \"bare-stream\": \"^2.0.0\"\n  },\n  \"devDependencies\": {\n    \"bare-fs\": \"^3.0.0\",\n    \"brittle\": \"^3.5.0\",\n    \"cmake-bare\": \"^1.1.7\",\n    \"cmake-fetch\": \"^1.0.0\",\n    \"prettier\": \"^3.5.3\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\n{\n  \"name\": \"base-x\",\n  \"version\": \"4.0.1\",\n  \"description\": \"Fast base encoding / decoding of any given alphabet\",\n  \"keywords\": [\n    \"base-x\",\n    \"base58\",\n    \"base62\",\n    \"base64\",\n    \"crypto\",\n    \"crytography\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\"\n  ],\n  \"homepage\": \"https://github.com/cryptocoinjs/base-x\",\n  \"bugs\": {\n    \"url\": \"https://github.com/cryptocoinjs/base-x/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Daniel Cousens\",\n  \"files\": [\n    \"src\"\n  ],\n  \"main\": \"src/index.js\",\n  \"types\": \"src/index.d.ts\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/cryptocoinjs/base-x.git\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc -p ./tsconfig.json ; standard --fix\",\n    \"gitdiff\": \"npm run build && git diff --exit-code\",\n    \"prepublish\": \"npm run gitdiff\",\n    \"standard\": \"standard\",\n    \"test\": \"npm run unit && npm run standard\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"12.0.10\",\n    \"standard\": \"^10.0.3\",\n    \"tape\": \"^4.5.1\",\n    \"typescript\": \"3.5.2\"\n  }\n}\n'use strict'\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfunction base (ALPHABET) {\n  if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n  var BASE_MAP = new Uint8Array(256)\n  for (var j = 0; j < BASE_MAP.length; j++) {\n    BASE_MAP[j] = 255\n  }\n  for (var i = 0; i < ALPHABET.length; i++) {\n    var x = ALPHABET.charAt(i)\n    var xc = x.charCodeAt(0)\n    if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n    BASE_MAP[xc] = i\n  }\n  var BASE = ALPHABET.length\n  var LEADER = ALPHABET.charAt(0)\n  var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n  var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n  function encode (source) {\n    if (source instanceof Uint8Array) {\n    } else if (ArrayBuffer.isView(source)) {\n      source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)\n    } else if (Array.isArray(source)) {\n      source = Uint8Array.from(source)\n    }\n    if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n    if (source.length === 0) { return '' }\n        // Skip & count leading zeroes.\n    var zeroes = 0\n    var length = 0\n    var pbegin = 0\n    var pend = source.length\n    while (pbegin !== pend && source[pbegin] === 0) {\n      pbegin++\n      zeroes++\n    }\n        // Allocate enough space in big-endian base58 representation.\n    var size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n    var b58 = new Uint8Array(size)\n        // Process the bytes.\n    while (pbegin !== pend) {\n      var carry = source[pbegin]\n            // Apply \"b58 = b58 * 256 + ch\".\n      var i = 0\n      for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n        carry += (256 * b58[it1]) >>> 0\n        b58[it1] = (carry % BASE) >>> 0\n        carry = (carry / BASE) >>> 0\n      }\n      if (carry !== 0) { throw new Error('Non-zero carry') }\n      length = i\n      pbegin++\n    }\n        // Skip leading zeroes in base58 result.\n    var it2 = size - length\n    while (it2 !== size && b58[it2] === 0) {\n      it2++\n    }\n        // Translate the result into a string.\n    var str = LEADER.repeat(zeroes)\n    for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }\n    return str\n  }\n  function decodeUnsafe (source) {\n    if (typeof source !== 'string') { throw new TypeError('Expected String') }\n    if (source.length === 0) { return new Uint8Array() }\n    var psz = 0\n        // Skip and count leading '1's.\n    var zeroes = 0\n    var length = 0\n    while (source[psz] === LEADER) {\n      zeroes++\n      psz++\n    }\n        // Allocate enough space in big-endian base256 representation.\n    var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n    var b256 = new Uint8Array(size)\n        // Process the characters.\n    while (source[psz]) {\n            // Find code of next character\n      var charCode = source.charCodeAt(psz)\n            // Base map can not be indexed using char code\n      if (charCode > 255) { return }\n            // Decode character\n      var carry = BASE_MAP[charCode]\n            // Invalid character\n      if (carry === 255) { return }\n      var i = 0\n      for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n        carry += (BASE * b256[it3]) >>> 0\n        b256[it3] = (carry % 256) >>> 0\n        carry = (carry / 256) >>> 0\n      }\n      if (carry !== 0) { throw new Error('Non-zero carry') }\n      length = i\n      psz++\n    }\n        // Skip leading zeroes in b256.\n    var it4 = size - length\n    while (it4 !== size && b256[it4] === 0) {\n      it4++\n    }\n    var vch = new Uint8Array(zeroes + (size - it4))\n    var j = zeroes\n    while (it4 !== size) {\n      vch[j++] = b256[it4++]\n    }\n    return vch\n  }\n  function decode (string) {\n    var buffer = decodeUnsafe(string)\n    if (buffer) { return buffer }\n    throw new Error('Non-base' + BASE + ' character')\n  }\n  return {\n    encode: encode,\n    decodeUnsafe: decodeUnsafe,\n    decode: decode\n  }\n}\nmodule.exports = base\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.bech32m = exports.bech32 = void 0;\nconst ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';\nconst ALPHABET_MAP = {};\nfor (let z = 0; z < ALPHABET.length; z++) {\n    const x = ALPHABET.charAt(z);\n    ALPHABET_MAP[x] = z;\n}\nfunction polymodStep(pre) {\n    const b = pre >> 25;\n    return (((pre & 0x1ffffff) << 5) ^\n        (-((b >> 0) & 1) & 0x3b6a57b2) ^\n        (-((b >> 1) & 1) & 0x26508e6d) ^\n        (-((b >> 2) & 1) & 0x1ea119fa) ^\n        (-((b >> 3) & 1) & 0x3d4233dd) ^\n        (-((b >> 4) & 1) & 0x2a1462b3));\n}\nfunction prefixChk(prefix) {\n    let chk = 1;\n    for (let i = 0; i < prefix.length; ++i) {\n        const c = prefix.charCodeAt(i);\n        if (c < 33 || c > 126)\n            return 'Invalid prefix (' + prefix + ')';\n        chk = polymodStep(chk) ^ (c >> 5);\n    }\n    chk = polymodStep(chk);\n    for (let i = 0; i < prefix.length; ++i) {\n        const v = prefix.charCodeAt(i);\n        chk = polymodStep(chk) ^ (v & 0x1f);\n    }\n    return chk;\n}\nfunction convert(data, inBits, outBits, pad) {\n    let value = 0;\n    let bits = 0;\n    const maxV = (1 << outBits) - 1;\n    const result = [];\n    for (let i = 0; i < data.length; ++i) {\n        value = (value << inBits) | data[i];\n        bits += inBits;\n        while (bits >= outBits) {\n            bits -= outBits;\n            result.push((value >> bits) & maxV);\n        }\n    }\n    if (pad) {\n        if (bits > 0) {\n            result.push((value << (outBits - bits)) & maxV);\n        }\n    }\n    else {\n        if (bits >= inBits)\n            return 'Excess padding';\n        if ((value << (outBits - bits)) & maxV)\n            return 'Non-zero padding';\n    }\n    return result;\n}\nfunction toWords(bytes) {\n    return convert(bytes, 8, 5, true);\n}\nfunction fromWordsUnsafe(words) {\n    const res = convert(words, 5, 8, false);\n    if (Array.isArray(res))\n        return res;\n}\nfunction fromWords(words) {\n    const res = convert(words, 5, 8, false);\n    if (Array.isArray(res))\n        return res;\n    throw new Error(res);\n}\nfunction getLibraryFromEncoding(encoding) {\n    let ENCODING_CONST;\n    if (encoding === 'bech32') {\n        ENCODING_CONST = 1;\n    }\n    else {\n        ENCODING_CONST = 0x2bc830a3;\n    }\n    function encode(prefix, words, LIMIT) {\n        LIMIT = LIMIT || 90;\n        if (prefix.length + 7 + words.length > LIMIT)\n            throw new TypeError('Exceeds length limit');\n        prefix = prefix.toLowerCase();\n        // determine chk mod\n        let chk = prefixChk(prefix);\n        if (typeof chk === 'string')\n            throw new Error(chk);\n        let result = prefix + '1';\n        for (let i = 0; i < words.length; ++i) {\n            const x = words[i];\n            if (x >> 5 !== 0)\n                throw new Error('Non 5-bit word');\n            chk = polymodStep(chk) ^ x;\n            result += ALPHABET.charAt(x);\n        }\n        for (let i = 0; i < 6; ++i) {\n            chk = polymodStep(chk);\n        }\n        chk ^= ENCODING_CONST;\n        for (let i = 0; i < 6; ++i) {\n            const v = (chk >> ((5 - i) * 5)) & 0x1f;\n            result += ALPHABET.charAt(v);\n        }\n        return result;\n    }\n    function __decode(str, LIMIT) {\n        LIMIT = LIMIT || 90;\n        if (str.length < 8)\n            return str + ' too short';\n        if (str.length > LIMIT)\n            return 'Exceeds length limit';\n        // don't allow mixed case\n        const lowered = str.toLowerCase();\n        const uppered = str.toUpperCase();\n        if (str !== lowered && str !== uppered)\n            return 'Mixed-case string ' + str;\n        str = lowered;\n        const split = str.lastIndexOf('1');\n        if (split === -1)\n            return 'No separator character for ' + str;\n        if (split === 0)\n            return 'Missing prefix for ' + str;\n        const prefix = str.slice(0, split);\n        const wordChars = str.slice(split + 1);\n        if (wordChars.length < 6)\n            return 'Data too short';\n        let chk = prefixChk(prefix);\n        if (typeof chk === 'string')\n            return chk;\n        const words = [];\n        for (let i = 0; i < wordChars.length; ++i) {\n            const c = wordChars.charAt(i);\n            const v = ALPHABET_MAP[c];\n            if (v === undefined)\n                return 'Unknown character ' + c;\n            chk = polymodStep(chk) ^ v;\n            // not in the checksum?\n            if (i + 6 >= wordChars.length)\n                continue;\n            words.push(v);\n        }\n        if (chk !== ENCODING_CONST)\n            return 'Invalid checksum for ' + str;\n        return { prefix, words };\n    }\n    function decodeUnsafe(str, LIMIT) {\n        const res = __decode(str, LIMIT);\n        if (typeof res === 'object')\n            return res;\n    }\n    function decode(str, LIMIT) {\n        const res = __decode(str, LIMIT);\n        if (typeof res === 'object')\n            return res;\n        throw new Error(res);\n    }\n    return {\n        decodeUnsafe,\n        decode,\n        encode,\n        toWords,\n        fromWordsUnsafe,\n        fromWords,\n    };\n}\nexports.bech32 = getLibraryFromEncoding('bech32');\nexports.bech32m = getLibraryFromEncoding('bech32m');\n{\n  \"name\": \"bech32\",\n  \"version\": \"2.0.0\",\n  \"description\": \"Bech32 encoding / decoding\",\n  \"keywords\": [\n    \"base32\",\n    \"bech32\",\n    \"bech32m\",\n    \"bitcoin\",\n    \"crypto\",\n    \"crytography\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\"\n  ],\n  \"main\": \"dist/index.js\",\n  \"types\": \"dist/index.d.ts\",\n  \"files\": [\n    \"dist/index.js\",\n    \"dist/index.d.ts\"\n  ],\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"@types/node\": \"^14.0.14\",\n    \"@types/tape\": \"^4.13.0\",\n    \"nyc\": \"^15.0.0\",\n    \"prettier\": \"^2.0.5\",\n    \"rimraf\": \"^3.0.2\",\n    \"tap-dot\": \"*\",\n    \"tape\": \"^4.13.2\",\n    \"tslint\": \"^6.1.3\",\n    \"typescript\": \"^3.9.5\"\n  },\n  \"repository\": {\n    \"url\": \"http://github.com/bitcoinjs/bech32\",\n    \"type\": \"git\"\n  },\n  \"scripts\": {\n    \"build\": \"npm run clean && tsc -d\",\n    \"clean\": \"rimraf dist\",\n    \"coverage\": \"nyc -x dist/test/*.js --check-coverage --branches 90 --functions 90 tape dist/test/*.js\",\n    \"format\": \"npm run prettier -- --write\",\n    \"format:ci\": \"npm run prettier -- --check\",\n    \"gitdiff:ci\": \"npm run build && git diff --exit-code\",\n    \"lint\": \"tslint -p tsconfig.json -c tslint.json\",\n    \"prettier\": \"prettier --print-width 100 --single-quote --trailing-comma=all \\\"**/!(*.d).ts\\\"\",\n    \"test\": \"tape dist/test/*.js | tap-dot\"\n  }\n}\nconst FACTOR = new Uint16Array(8)\n\nfunction factor4096 (i, n) {\n  while (n > 0) {\n    const f = i & 4095\n    FACTOR[--n] = f\n    i = (i - f) / 4096\n  }\n  return FACTOR\n}\n\nmodule.exports = class BigSparseArray {\n  constructor () {\n    this.tiny = new TinyArray()\n    this.maxLength = 4096\n    this.factor = 1\n  }\n\n  set (index, val) {\n    if (val !== undefined) {\n      while (index >= this.maxLength) {\n        this.maxLength *= 4096\n        this.factor++\n        if (!this.tiny.isEmptyish()) {\n          const t = new TinyArray()\n          t.set(0, this.tiny)\n          this.tiny = t\n        }\n      }\n    }\n\n    const f = factor4096(index, this.factor)\n    const last = this.factor - 1\n\n    let tiny = this.tiny\n    for (let i = 0; i < last; i++) {\n      const next = tiny.get(f[i])\n      if (next === undefined) {\n        if (val === undefined) return\n        tiny = tiny.set(f[i], new TinyArray())\n      } else {\n        tiny = next\n      }\n    }\n\n    return tiny.set(f[last], val)\n  }\n\n  get (index) {\n    if (index >= this.maxLength) return\n\n    const f = factor4096(index, this.factor)\n    const last = this.factor - 1\n\n    let tiny = this.tiny\n    for (let i = 0; i < last; i++) {\n      tiny = tiny.get(f[i])\n      if (tiny === undefined) return\n    }\n\n    return tiny.get(f[last])\n  }\n}\n\nclass TinyArray {\n  constructor () {\n    this.s = 0\n    this.b = new Array(1)\n    this.f = new Uint16Array(1)\n  }\n\n  isEmptyish () {\n    return this.b.length === 1 && this.b[0] === undefined\n  }\n\n  get (i) {\n    if (this.s === 12) return this.b[i]\n    const f = i >>> this.s\n    const r = i & (this.b.length - 1)\n    return this.f[r] === f ? this.b[r] : undefined\n  }\n\n  set (i, v) {\n    while (this.s !== 12) {\n      const f = i >>> this.s\n      const r = i & (this.b.length - 1)\n      const o = this.b[r]\n\n      if (o === undefined || f === this.f[r]) {\n        this.b[r] = v\n        this.f[r] = f\n        return v\n      }\n\n      this.grow()\n    }\n\n    this.b[i] = v\n    return v\n  }\n\n  grow () {\n    const os = this.s\n    const ob = this.b\n    const of = this.f\n\n    this.s += 4\n    this.b = new Array(this.b.length << 4)\n    this.f = this.s === 12 ? null : new Uint8Array(this.b.length)\n\n    const m = this.b.length - 1\n\n    for (let or = 0; or < ob.length; or++) {\n      if (ob[or] === undefined) continue\n\n      const i = of[or] << os | or\n      const f = i >>> this.s\n      const r = i & m\n\n      this.b[r] = ob[or]\n      if (this.s !== 12) this.f[r] = f\n    }\n  }\n}\n{\n  \"name\": \"big-sparse-array\",\n  \"version\": \"1.0.3\",\n  \"description\": \"A sparse array optimised for low memory whilst still being fast\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.1\",\n    \"standard\": \"^16.0.3\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/big-sparse-array.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/big-sparse-array/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/big-sparse-array\"\n}\n/**\n * Module dependencies.\n */\n\nvar fs = require('fs'),\n  path = require('path'),\n  fileURLToPath = require('file-uri-to-path'),\n  join = path.join,\n  dirname = path.dirname,\n  exists =\n    (fs.accessSync &&\n      function(path) {\n        try {\n          fs.accessSync(path);\n        } catch (e) {\n          return false;\n        }\n        return true;\n      }) ||\n    fs.existsSync ||\n    path.existsSync,\n  defaults = {\n    arrow: process.env.NODE_BINDINGS_ARROW || ' → ',\n    compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled',\n    platform: process.platform,\n    arch: process.arch,\n    nodePreGyp:\n      'node-v' +\n      process.versions.modules +\n      '-' +\n      process.platform +\n      '-' +\n      process.arch,\n    version: process.versions.node,\n    bindings: 'bindings.node',\n    try: [\n      // node-gyp's linked version in the \"build\" dir\n      ['module_root', 'build', 'bindings'],\n      // node-waf and gyp_addon (a.k.a node-gyp)\n      ['module_root', 'build', 'Debug', 'bindings'],\n      ['module_root', 'build', 'Release', 'bindings'],\n      // Debug files, for development (legacy behavior, remove for node v0.9)\n      ['module_root', 'out', 'Debug', 'bindings'],\n      ['module_root', 'Debug', 'bindings'],\n      // Release files, but manually compiled (legacy behavior, remove for node v0.9)\n      ['module_root', 'out', 'Release', 'bindings'],\n      ['module_root', 'Release', 'bindings'],\n      // Legacy from node-waf, node <= 0.4.x\n      ['module_root', 'build', 'default', 'bindings'],\n      // Production \"Release\" buildtype binary (meh...)\n      ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'],\n      // node-qbs builds\n      ['module_root', 'addon-build', 'release', 'install-root', 'bindings'],\n      ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'],\n      ['module_root', 'addon-build', 'default', 'install-root', 'bindings'],\n      // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}\n      ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings']\n    ]\n  };\n\n/**\n * The main `bindings()` function loads the compiled bindings for a given module.\n * It uses V8's Error API to determine the parent filename that this function is\n * being invoked from, which is then used to find the root directory.\n */\n\nfunction bindings(opts) {\n  // Argument surgery\n  if (typeof opts == 'string') {\n    opts = { bindings: opts };\n  } else if (!opts) {\n    opts = {};\n  }\n\n  // maps `defaults` onto `opts` object\n  Object.keys(defaults).map(function(i) {\n    if (!(i in opts)) opts[i] = defaults[i];\n  });\n\n  // Get the module root\n  if (!opts.module_root) {\n    opts.module_root = exports.getRoot(exports.getFileName());\n  }\n\n  // Ensure the given bindings name ends with .node\n  if (path.extname(opts.bindings) != '.node') {\n    opts.bindings += '.node';\n  }\n\n  // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035\n  var requireFunc =\n    typeof __webpack_require__ === 'function'\n      ? __non_webpack_require__\n      : require;\n\n  var tries = [],\n    i = 0,\n    l = opts.try.length,\n    n,\n    b,\n    err;\n\n  for (; i < l; i++) {\n    n = join.apply(\n      null,\n      opts.try[i].map(function(p) {\n        return opts[p] || p;\n      })\n    );\n    tries.push(n);\n    try {\n      b = opts.path ? requireFunc.resolve(n) : requireFunc(n);\n      if (!opts.path) {\n        b.path = n;\n      }\n      return b;\n    } catch (e) {\n      if (e.code !== 'MODULE_NOT_FOUND' &&\n          e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' &&\n          !/not find/i.test(e.message)) {\n        throw e;\n      }\n    }\n  }\n\n  err = new Error(\n    'Could not locate the bindings file. Tried:\\n' +\n      tries\n        .map(function(a) {\n          return opts.arrow + a;\n        })\n        .join('\\n')\n  );\n  err.tries = tries;\n  throw err;\n}\nmodule.exports = exports = bindings;\n\n/**\n * Gets the filename of the JavaScript file that invokes this function.\n * Used to help find the root directory of a module.\n * Optionally accepts an filename argument to skip when searching for the invoking filename\n */\n\nexports.getFileName = function getFileName(calling_file) {\n  var origPST = Error.prepareStackTrace,\n    origSTL = Error.stackTraceLimit,\n    dummy = {},\n    fileName;\n\n  Error.stackTraceLimit = 10;\n\n  Error.prepareStackTrace = function(e, st) {\n    for (var i = 0, l = st.length; i < l; i++) {\n      fileName = st[i].getFileName();\n      if (fileName !== __filename) {\n        if (calling_file) {\n          if (fileName !== calling_file) {\n            return;\n          }\n        } else {\n          return;\n        }\n      }\n    }\n  };\n\n  // run the 'prepareStackTrace' function above\n  Error.captureStackTrace(dummy);\n  dummy.stack;\n\n  // cleanup\n  Error.prepareStackTrace = origPST;\n  Error.stackTraceLimit = origSTL;\n\n  // handle filename that starts with \"file://\"\n  var fileSchema = 'file://';\n  if (fileName.indexOf(fileSchema) === 0) {\n    fileName = fileURLToPath(fileName);\n  }\n\n  return fileName;\n};\n\n/**\n * Gets the root directory of a module, given an arbitrary filename\n * somewhere in the module tree. The \"root directory\" is the directory\n * containing the `package.json` file.\n *\n *   In:  /home/nate/node-native-module/lib/index.js\n *   Out: /home/nate/node-native-module\n */\n\nexports.getRoot = function getRoot(file) {\n  var dir = dirname(file),\n    prev;\n  while (true) {\n    if (dir === '.') {\n      // Avoids an infinite loop in rare cases, like the REPL\n      dir = process.cwd();\n    }\n    if (\n      exists(join(dir, 'package.json')) ||\n      exists(join(dir, 'node_modules'))\n    ) {\n      // Found the 'package.json' file or 'node_modules' dir; we're done\n      return dir;\n    }\n    if (prev === dir) {\n      // Got to the top\n      throw new Error(\n        'Could not find module root given file: \"' +\n          file +\n          '\". Do you have a `package.json` file? '\n      );\n    }\n    // Try the parent dir next\n    prev = dir;\n    dir = join(dir, '..');\n  }\n};\n{\n  \"name\": \"bindings\",\n  \"description\": \"Helper module for loading your native module's .node file\",\n  \"keywords\": [\n    \"native\",\n    \"addon\",\n    \"bindings\",\n    \"gyp\",\n    \"waf\",\n    \"c\",\n    \"c++\"\n  ],\n  \"version\": \"1.5.0\",\n  \"author\": \"Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/TooTallNate/node-bindings.git\"\n  },\n  \"main\": \"./bindings.js\",\n  \"bugs\": {\n    \"url\": \"https://github.com/TooTallNate/node-bindings/issues\"\n  },\n  \"homepage\": \"https://github.com/TooTallNate/node-bindings\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"file-uri-to-path\": \"1.0.0\"\n  }\n}\n{\n  \"name\": \"bip174\",\n  \"version\": \"2.1.1\",\n  \"description\": \"\",\n  \"main\": \"src/lib/psbt.js\",\n  \"types\": \"src/lib/psbt.d.ts\",\n  \"files\": [\n    \"src/lib\"\n  ],\n  \"engines\": {\n    \"node\": \">=8.0.0\"\n  },\n  \"scripts\": {\n    \"build\": \"npm run clean && tsc -p ./tsconfig.json && rimraf 'src/tests/**/*.d.ts' && npm run formatjs\",\n    \"clean\": \"rimraf src types\",\n    \"coverage\": \"nyc --check-coverage --exclude='src/tests/**/*.js' --reporter=lcov --reporter=text --branches 90 --functions 90 --lines 90 npm run unit\",\n    \"flb\": \"npm run format && npm run lint && npm run build\",\n    \"format\": \"npm run prettier -- --write\",\n    \"formatjs\": \"npm run prettierjs -- --write > /dev/null 2>&1\",\n    \"format:ci\": \"npm run prettier -- --check && npm run prettierjs -- --check\",\n    \"gitdiff:ci\": \"npm run build && git diff --exit-code\",\n    \"lint\": \"tslint -p tsconfig.json -c tslint.json\",\n    \"prettier\": \"prettier 'ts_src/**/*.ts' --ignore-path ./.prettierignore\",\n    \"prettierjs\": \"prettier 'src/**/*.js' --ignore-path ./.prettierignore\",\n    \"test\": \"npm run format:ci && npm run lint && npm run build && npm run coverage\",\n    \"unit\": \"tape src/tests/*.js src/tests/fromBIP/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/bitcoinjs/bip174.git\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"12.0.8\",\n    \"@types/tape\": \"4.2.33\",\n    \"bitcoinjs-lib\": \"^5.0.5\",\n    \"nyc\": \"^14.1.1\",\n    \"prettier\": \"^1.18.2\",\n    \"rimraf\": \"^2.6.3\",\n    \"tape\": \"^4.10.2\",\n    \"tslint\": \"5.17.0\",\n    \"typescript\": \"3.5.2\"\n  },\n  \"author\": \"Jonathan Underwood\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/bip174/issues\"\n  },\n  \"homepage\": \"https://github.com/bitcoinjs/bip174#readme\"\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst parser_1 = require('../parser');\nfunction combine(psbts) {\n  const self = psbts[0];\n  const selfKeyVals = parser_1.psbtToKeyVals(self);\n  const others = psbts.slice(1);\n  if (others.length === 0) throw new Error('Combine: Nothing to combine');\n  const selfTx = getTx(self);\n  if (selfTx === undefined) {\n    throw new Error('Combine: Self missing transaction');\n  }\n  const selfGlobalSet = getKeySet(selfKeyVals.globalKeyVals);\n  const selfInputSets = selfKeyVals.inputKeyVals.map(getKeySet);\n  const selfOutputSets = selfKeyVals.outputKeyVals.map(getKeySet);\n  for (const other of others) {\n    const otherTx = getTx(other);\n    if (\n      otherTx === undefined ||\n      !otherTx.toBuffer().equals(selfTx.toBuffer())\n    ) {\n      throw new Error(\n        'Combine: One of the Psbts does not have the same transaction.',\n      );\n    }\n    const otherKeyVals = parser_1.psbtToKeyVals(other);\n    const otherGlobalSet = getKeySet(otherKeyVals.globalKeyVals);\n    otherGlobalSet.forEach(\n      keyPusher(\n        selfGlobalSet,\n        selfKeyVals.globalKeyVals,\n        otherKeyVals.globalKeyVals,\n      ),\n    );\n    const otherInputSets = otherKeyVals.inputKeyVals.map(getKeySet);\n    otherInputSets.forEach((inputSet, idx) =>\n      inputSet.forEach(\n        keyPusher(\n          selfInputSets[idx],\n          selfKeyVals.inputKeyVals[idx],\n          otherKeyVals.inputKeyVals[idx],\n        ),\n      ),\n    );\n    const otherOutputSets = otherKeyVals.outputKeyVals.map(getKeySet);\n    otherOutputSets.forEach((outputSet, idx) =>\n      outputSet.forEach(\n        keyPusher(\n          selfOutputSets[idx],\n          selfKeyVals.outputKeyVals[idx],\n          otherKeyVals.outputKeyVals[idx],\n        ),\n      ),\n    );\n  }\n  return parser_1.psbtFromKeyVals(selfTx, {\n    globalMapKeyVals: selfKeyVals.globalKeyVals,\n    inputKeyVals: selfKeyVals.inputKeyVals,\n    outputKeyVals: selfKeyVals.outputKeyVals,\n  });\n}\nexports.combine = combine;\nfunction keyPusher(selfSet, selfKeyVals, otherKeyVals) {\n  return key => {\n    if (selfSet.has(key)) return;\n    const newKv = otherKeyVals.filter(kv => kv.key.toString('hex') === key)[0];\n    selfKeyVals.push(newKv);\n    selfSet.add(key);\n  };\n}\nfunction getTx(psbt) {\n  return psbt.globalMap.unsignedTx;\n}\nfunction getKeySet(keyVals) {\n  const set = new Set();\n  keyVals.forEach(keyVal => {\n    const hex = keyVal.key.toString('hex');\n    if (set.has(hex))\n      throw new Error('Combine: KeyValue Map keys should be unique');\n    set.add(hex);\n  });\n  return set;\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nconst range = n => [...Array(n).keys()];\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.GlobalTypes.GLOBAL_XPUB) {\n    throw new Error(\n      'Decode Error: could not decode globalXpub with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  if (keyVal.key.length !== 79 || ![2, 3].includes(keyVal.key[46])) {\n    throw new Error(\n      'Decode Error: globalXpub has invalid extended pubkey in key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  if ((keyVal.value.length / 4) % 1 !== 0) {\n    throw new Error(\n      'Decode Error: Global GLOBAL_XPUB value length should be multiple of 4',\n    );\n  }\n  const extendedPubkey = keyVal.key.slice(1);\n  const data = {\n    masterFingerprint: keyVal.value.slice(0, 4),\n    extendedPubkey,\n    path: 'm',\n  };\n  for (const i of range(keyVal.value.length / 4 - 1)) {\n    const val = keyVal.value.readUInt32LE(i * 4 + 4);\n    const isHard = !!(val & 0x80000000);\n    const idx = val & 0x7fffffff;\n    data.path += '/' + idx.toString(10) + (isHard ? \"'\" : '');\n  }\n  return data;\n}\nexports.decode = decode;\nfunction encode(data) {\n  const head = Buffer.from([typeFields_1.GlobalTypes.GLOBAL_XPUB]);\n  const key = Buffer.concat([head, data.extendedPubkey]);\n  const splitPath = data.path.split('/');\n  const value = Buffer.allocUnsafe(splitPath.length * 4);\n  data.masterFingerprint.copy(value, 0);\n  let offset = 4;\n  splitPath.slice(1).forEach(level => {\n    const isHard = level.slice(-1) === \"'\";\n    let num = 0x7fffffff & parseInt(isHard ? level.slice(0, -1) : level, 10);\n    if (isHard) num += 0x80000000;\n    value.writeUInt32LE(num, offset);\n    offset += 4;\n  });\n  return {\n    key,\n    value,\n  };\n}\nexports.encode = encode;\nexports.expected =\n  '{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }';\nfunction check(data) {\n  const epk = data.extendedPubkey;\n  const mfp = data.masterFingerprint;\n  const p = data.path;\n  return (\n    Buffer.isBuffer(epk) &&\n    epk.length === 78 &&\n    [2, 3].indexOf(epk[45]) > -1 &&\n    Buffer.isBuffer(mfp) &&\n    mfp.length === 4 &&\n    typeof p === 'string' &&\n    !!p.match(/^m(\\/\\d+'?)*$/)\n  );\n}\nexports.check = check;\nfunction canAddToArray(array, item, dupeSet) {\n  const dupeString = item.extendedPubkey.toString('hex');\n  if (dupeSet.has(dupeString)) return false;\n  dupeSet.add(dupeString);\n  return (\n    array.filter(v => v.extendedPubkey.equals(item.extendedPubkey)).length === 0\n  );\n}\nexports.canAddToArray = canAddToArray;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction encode(data) {\n  return {\n    key: Buffer.from([typeFields_1.GlobalTypes.UNSIGNED_TX]),\n    value: data.toBuffer(),\n  };\n}\nexports.encode = encode;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../typeFields');\nconst globalXpub = require('./global/globalXpub');\nconst unsignedTx = require('./global/unsignedTx');\nconst finalScriptSig = require('./input/finalScriptSig');\nconst finalScriptWitness = require('./input/finalScriptWitness');\nconst nonWitnessUtxo = require('./input/nonWitnessUtxo');\nconst partialSig = require('./input/partialSig');\nconst porCommitment = require('./input/porCommitment');\nconst sighashType = require('./input/sighashType');\nconst tapKeySig = require('./input/tapKeySig');\nconst tapLeafScript = require('./input/tapLeafScript');\nconst tapMerkleRoot = require('./input/tapMerkleRoot');\nconst tapScriptSig = require('./input/tapScriptSig');\nconst witnessUtxo = require('./input/witnessUtxo');\nconst tapTree = require('./output/tapTree');\nconst bip32Derivation = require('./shared/bip32Derivation');\nconst checkPubkey = require('./shared/checkPubkey');\nconst redeemScript = require('./shared/redeemScript');\nconst tapBip32Derivation = require('./shared/tapBip32Derivation');\nconst tapInternalKey = require('./shared/tapInternalKey');\nconst witnessScript = require('./shared/witnessScript');\nconst globals = {\n  unsignedTx,\n  globalXpub,\n  // pass an Array of key bytes that require pubkey beside the key\n  checkPubkey: checkPubkey.makeChecker([]),\n};\nexports.globals = globals;\nconst inputs = {\n  nonWitnessUtxo,\n  partialSig,\n  sighashType,\n  finalScriptSig,\n  finalScriptWitness,\n  porCommitment,\n  witnessUtxo,\n  bip32Derivation: bip32Derivation.makeConverter(\n    typeFields_1.InputTypes.BIP32_DERIVATION,\n  ),\n  redeemScript: redeemScript.makeConverter(\n    typeFields_1.InputTypes.REDEEM_SCRIPT,\n  ),\n  witnessScript: witnessScript.makeConverter(\n    typeFields_1.InputTypes.WITNESS_SCRIPT,\n  ),\n  checkPubkey: checkPubkey.makeChecker([\n    typeFields_1.InputTypes.PARTIAL_SIG,\n    typeFields_1.InputTypes.BIP32_DERIVATION,\n  ]),\n  tapKeySig,\n  tapScriptSig,\n  tapLeafScript,\n  tapBip32Derivation: tapBip32Derivation.makeConverter(\n    typeFields_1.InputTypes.TAP_BIP32_DERIVATION,\n  ),\n  tapInternalKey: tapInternalKey.makeConverter(\n    typeFields_1.InputTypes.TAP_INTERNAL_KEY,\n  ),\n  tapMerkleRoot,\n};\nexports.inputs = inputs;\nconst outputs = {\n  bip32Derivation: bip32Derivation.makeConverter(\n    typeFields_1.OutputTypes.BIP32_DERIVATION,\n  ),\n  redeemScript: redeemScript.makeConverter(\n    typeFields_1.OutputTypes.REDEEM_SCRIPT,\n  ),\n  witnessScript: witnessScript.makeConverter(\n    typeFields_1.OutputTypes.WITNESS_SCRIPT,\n  ),\n  checkPubkey: checkPubkey.makeChecker([\n    typeFields_1.OutputTypes.BIP32_DERIVATION,\n  ]),\n  tapBip32Derivation: tapBip32Derivation.makeConverter(\n    typeFields_1.OutputTypes.TAP_BIP32_DERIVATION,\n  ),\n  tapTree,\n  tapInternalKey: tapInternalKey.makeConverter(\n    typeFields_1.OutputTypes.TAP_INTERNAL_KEY,\n  ),\n};\nexports.outputs = outputs;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.FINAL_SCRIPTSIG) {\n    throw new Error(\n      'Decode Error: could not decode finalScriptSig with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  return keyVal.value;\n}\nexports.decode = decode;\nfunction encode(data) {\n  const key = Buffer.from([typeFields_1.InputTypes.FINAL_SCRIPTSIG]);\n  return {\n    key,\n    value: data,\n  };\n}\nexports.encode = encode;\nexports.expected = 'Buffer';\nfunction check(data) {\n  return Buffer.isBuffer(data);\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return !!currentData && !!newData && currentData.finalScriptSig === undefined;\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.FINAL_SCRIPTWITNESS) {\n    throw new Error(\n      'Decode Error: could not decode finalScriptWitness with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  return keyVal.value;\n}\nexports.decode = decode;\nfunction encode(data) {\n  const key = Buffer.from([typeFields_1.InputTypes.FINAL_SCRIPTWITNESS]);\n  return {\n    key,\n    value: data,\n  };\n}\nexports.encode = encode;\nexports.expected = 'Buffer';\nfunction check(data) {\n  return Buffer.isBuffer(data);\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return (\n    !!currentData && !!newData && currentData.finalScriptWitness === undefined\n  );\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.NON_WITNESS_UTXO) {\n    throw new Error(\n      'Decode Error: could not decode nonWitnessUtxo with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  return keyVal.value;\n}\nexports.decode = decode;\nfunction encode(data) {\n  return {\n    key: Buffer.from([typeFields_1.InputTypes.NON_WITNESS_UTXO]),\n    value: data,\n  };\n}\nexports.encode = encode;\nexports.expected = 'Buffer';\nfunction check(data) {\n  return Buffer.isBuffer(data);\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return !!currentData && !!newData && currentData.nonWitnessUtxo === undefined;\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.PARTIAL_SIG) {\n    throw new Error(\n      'Decode Error: could not decode partialSig with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  if (\n    !(keyVal.key.length === 34 || keyVal.key.length === 66) ||\n    ![2, 3, 4].includes(keyVal.key[1])\n  ) {\n    throw new Error(\n      'Decode Error: partialSig has invalid pubkey in key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  const pubkey = keyVal.key.slice(1);\n  return {\n    pubkey,\n    signature: keyVal.value,\n  };\n}\nexports.decode = decode;\nfunction encode(pSig) {\n  const head = Buffer.from([typeFields_1.InputTypes.PARTIAL_SIG]);\n  return {\n    key: Buffer.concat([head, pSig.pubkey]),\n    value: pSig.signature,\n  };\n}\nexports.encode = encode;\nexports.expected = '{ pubkey: Buffer; signature: Buffer; }';\nfunction check(data) {\n  return (\n    Buffer.isBuffer(data.pubkey) &&\n    Buffer.isBuffer(data.signature) &&\n    [33, 65].includes(data.pubkey.length) &&\n    [2, 3, 4].includes(data.pubkey[0]) &&\n    isDerSigWithSighash(data.signature)\n  );\n}\nexports.check = check;\nfunction isDerSigWithSighash(buf) {\n  if (!Buffer.isBuffer(buf) || buf.length < 9) return false;\n  if (buf[0] !== 0x30) return false;\n  if (buf.length !== buf[1] + 3) return false;\n  if (buf[2] !== 0x02) return false;\n  const rLen = buf[3];\n  if (rLen > 33 || rLen < 1) return false;\n  if (buf[3 + rLen + 1] !== 0x02) return false;\n  const sLen = buf[3 + rLen + 2];\n  if (sLen > 33 || sLen < 1) return false;\n  if (buf.length !== 3 + rLen + 2 + sLen + 2) return false;\n  return true;\n}\nfunction canAddToArray(array, item, dupeSet) {\n  const dupeString = item.pubkey.toString('hex');\n  if (dupeSet.has(dupeString)) return false;\n  dupeSet.add(dupeString);\n  return array.filter(v => v.pubkey.equals(item.pubkey)).length === 0;\n}\nexports.canAddToArray = canAddToArray;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.POR_COMMITMENT) {\n    throw new Error(\n      'Decode Error: could not decode porCommitment with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  return keyVal.value.toString('utf8');\n}\nexports.decode = decode;\nfunction encode(data) {\n  const key = Buffer.from([typeFields_1.InputTypes.POR_COMMITMENT]);\n  return {\n    key,\n    value: Buffer.from(data, 'utf8'),\n  };\n}\nexports.encode = encode;\nexports.expected = 'string';\nfunction check(data) {\n  return typeof data === 'string';\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return !!currentData && !!newData && currentData.porCommitment === undefined;\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.SIGHASH_TYPE) {\n    throw new Error(\n      'Decode Error: could not decode sighashType with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  return keyVal.value.readUInt32LE(0);\n}\nexports.decode = decode;\nfunction encode(data) {\n  const key = Buffer.from([typeFields_1.InputTypes.SIGHASH_TYPE]);\n  const value = Buffer.allocUnsafe(4);\n  value.writeUInt32LE(data, 0);\n  return {\n    key,\n    value,\n  };\n}\nexports.encode = encode;\nexports.expected = 'number';\nfunction check(data) {\n  return typeof data === 'number';\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return !!currentData && !!newData && currentData.sighashType === undefined;\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (\n    keyVal.key[0] !== typeFields_1.InputTypes.TAP_KEY_SIG ||\n    keyVal.key.length !== 1\n  ) {\n    throw new Error(\n      'Decode Error: could not decode tapKeySig with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  if (!check(keyVal.value)) {\n    throw new Error(\n      'Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature',\n    );\n  }\n  return keyVal.value;\n}\nexports.decode = decode;\nfunction encode(value) {\n  const key = Buffer.from([typeFields_1.InputTypes.TAP_KEY_SIG]);\n  return { key, value };\n}\nexports.encode = encode;\nexports.expected = 'Buffer';\nfunction check(data) {\n  return Buffer.isBuffer(data) && (data.length === 64 || data.length === 65);\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return !!currentData && !!newData && currentData.tapKeySig === undefined;\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.TAP_LEAF_SCRIPT) {\n    throw new Error(\n      'Decode Error: could not decode tapLeafScript with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  if ((keyVal.key.length - 2) % 32 !== 0) {\n    throw new Error(\n      'Decode Error: tapLeafScript has invalid control block in key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  const leafVersion = keyVal.value[keyVal.value.length - 1];\n  if ((keyVal.key[1] & 0xfe) !== leafVersion) {\n    throw new Error(\n      'Decode Error: tapLeafScript bad leaf version in key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  const script = keyVal.value.slice(0, -1);\n  const controlBlock = keyVal.key.slice(1);\n  return { controlBlock, script, leafVersion };\n}\nexports.decode = decode;\nfunction encode(tScript) {\n  const head = Buffer.from([typeFields_1.InputTypes.TAP_LEAF_SCRIPT]);\n  const verBuf = Buffer.from([tScript.leafVersion]);\n  return {\n    key: Buffer.concat([head, tScript.controlBlock]),\n    value: Buffer.concat([tScript.script, verBuf]),\n  };\n}\nexports.encode = encode;\nexports.expected =\n  '{ controlBlock: Buffer; leafVersion: number, script: Buffer; }';\nfunction check(data) {\n  return (\n    Buffer.isBuffer(data.controlBlock) &&\n    (data.controlBlock.length - 1) % 32 === 0 &&\n    (data.controlBlock[0] & 0xfe) === data.leafVersion &&\n    Buffer.isBuffer(data.script)\n  );\n}\nexports.check = check;\nfunction canAddToArray(array, item, dupeSet) {\n  const dupeString = item.controlBlock.toString('hex');\n  if (dupeSet.has(dupeString)) return false;\n  dupeSet.add(dupeString);\n  return (\n    array.filter(v => v.controlBlock.equals(item.controlBlock)).length === 0\n  );\n}\nexports.canAddToArray = canAddToArray;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (\n    keyVal.key[0] !== typeFields_1.InputTypes.TAP_MERKLE_ROOT ||\n    keyVal.key.length !== 1\n  ) {\n    throw new Error(\n      'Decode Error: could not decode tapMerkleRoot with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  if (!check(keyVal.value)) {\n    throw new Error('Decode Error: tapMerkleRoot not a 32-byte hash');\n  }\n  return keyVal.value;\n}\nexports.decode = decode;\nfunction encode(value) {\n  const key = Buffer.from([typeFields_1.InputTypes.TAP_MERKLE_ROOT]);\n  return { key, value };\n}\nexports.encode = encode;\nexports.expected = 'Buffer';\nfunction check(data) {\n  return Buffer.isBuffer(data) && data.length === 32;\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return !!currentData && !!newData && currentData.tapMerkleRoot === undefined;\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.TAP_SCRIPT_SIG) {\n    throw new Error(\n      'Decode Error: could not decode tapScriptSig with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  if (keyVal.key.length !== 65) {\n    throw new Error(\n      'Decode Error: tapScriptSig has invalid key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  if (keyVal.value.length !== 64 && keyVal.value.length !== 65) {\n    throw new Error(\n      'Decode Error: tapScriptSig has invalid signature in key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  const pubkey = keyVal.key.slice(1, 33);\n  const leafHash = keyVal.key.slice(33);\n  return {\n    pubkey,\n    leafHash,\n    signature: keyVal.value,\n  };\n}\nexports.decode = decode;\nfunction encode(tSig) {\n  const head = Buffer.from([typeFields_1.InputTypes.TAP_SCRIPT_SIG]);\n  return {\n    key: Buffer.concat([head, tSig.pubkey, tSig.leafHash]),\n    value: tSig.signature,\n  };\n}\nexports.encode = encode;\nexports.expected = '{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }';\nfunction check(data) {\n  return (\n    Buffer.isBuffer(data.pubkey) &&\n    Buffer.isBuffer(data.leafHash) &&\n    Buffer.isBuffer(data.signature) &&\n    data.pubkey.length === 32 &&\n    data.leafHash.length === 32 &&\n    (data.signature.length === 64 || data.signature.length === 65)\n  );\n}\nexports.check = check;\nfunction canAddToArray(array, item, dupeSet) {\n  const dupeString =\n    item.pubkey.toString('hex') + item.leafHash.toString('hex');\n  if (dupeSet.has(dupeString)) return false;\n  dupeSet.add(dupeString);\n  return (\n    array.filter(\n      v => v.pubkey.equals(item.pubkey) && v.leafHash.equals(item.leafHash),\n    ).length === 0\n  );\n}\nexports.canAddToArray = canAddToArray;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nconst tools_1 = require('../tools');\nconst varuint = require('../varint');\nfunction decode(keyVal) {\n  if (keyVal.key[0] !== typeFields_1.InputTypes.WITNESS_UTXO) {\n    throw new Error(\n      'Decode Error: could not decode witnessUtxo with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  const value = tools_1.readUInt64LE(keyVal.value, 0);\n  let _offset = 8;\n  const scriptLen = varuint.decode(keyVal.value, _offset);\n  _offset += varuint.encodingLength(scriptLen);\n  const script = keyVal.value.slice(_offset);\n  if (script.length !== scriptLen) {\n    throw new Error('Decode Error: WITNESS_UTXO script is not proper length');\n  }\n  return {\n    script,\n    value,\n  };\n}\nexports.decode = decode;\nfunction encode(data) {\n  const { script, value } = data;\n  const varintLen = varuint.encodingLength(script.length);\n  const result = Buffer.allocUnsafe(8 + varintLen + script.length);\n  tools_1.writeUInt64LE(result, value, 0);\n  varuint.encode(script.length, result, 8);\n  script.copy(result, 8 + varintLen);\n  return {\n    key: Buffer.from([typeFields_1.InputTypes.WITNESS_UTXO]),\n    value: result,\n  };\n}\nexports.encode = encode;\nexports.expected = '{ script: Buffer; value: number; }';\nfunction check(data) {\n  return Buffer.isBuffer(data.script) && typeof data.value === 'number';\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return !!currentData && !!newData && currentData.witnessUtxo === undefined;\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst typeFields_1 = require('../../typeFields');\nconst varuint = require('../varint');\nfunction decode(keyVal) {\n  if (\n    keyVal.key[0] !== typeFields_1.OutputTypes.TAP_TREE ||\n    keyVal.key.length !== 1\n  ) {\n    throw new Error(\n      'Decode Error: could not decode tapTree with key 0x' +\n        keyVal.key.toString('hex'),\n    );\n  }\n  let _offset = 0;\n  const data = [];\n  while (_offset < keyVal.value.length) {\n    const depth = keyVal.value[_offset++];\n    const leafVersion = keyVal.value[_offset++];\n    const scriptLen = varuint.decode(keyVal.value, _offset);\n    _offset += varuint.encodingLength(scriptLen);\n    data.push({\n      depth,\n      leafVersion,\n      script: keyVal.value.slice(_offset, _offset + scriptLen),\n    });\n    _offset += scriptLen;\n  }\n  return { leaves: data };\n}\nexports.decode = decode;\nfunction encode(tree) {\n  const key = Buffer.from([typeFields_1.OutputTypes.TAP_TREE]);\n  const bufs = [].concat(\n    ...tree.leaves.map(tapLeaf => [\n      Buffer.of(tapLeaf.depth, tapLeaf.leafVersion),\n      varuint.encode(tapLeaf.script.length),\n      tapLeaf.script,\n    ]),\n  );\n  return {\n    key,\n    value: Buffer.concat(bufs),\n  };\n}\nexports.encode = encode;\nexports.expected =\n  '{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }';\nfunction check(data) {\n  return (\n    Array.isArray(data.leaves) &&\n    data.leaves.every(\n      tapLeaf =>\n        tapLeaf.depth >= 0 &&\n        tapLeaf.depth <= 128 &&\n        (tapLeaf.leafVersion & 0xfe) === tapLeaf.leafVersion &&\n        Buffer.isBuffer(tapLeaf.script),\n    )\n  );\n}\nexports.check = check;\nfunction canAdd(currentData, newData) {\n  return !!currentData && !!newData && currentData.tapTree === undefined;\n}\nexports.canAdd = canAdd;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst range = n => [...Array(n).keys()];\nconst isValidDERKey = pubkey =>\n  (pubkey.length === 33 && [2, 3].includes(pubkey[0])) ||\n  (pubkey.length === 65 && 4 === pubkey[0]);\nfunction makeConverter(TYPE_BYTE, isValidPubkey = isValidDERKey) {\n  function decode(keyVal) {\n    if (keyVal.key[0] !== TYPE_BYTE) {\n      throw new Error(\n        'Decode Error: could not decode bip32Derivation with key 0x' +\n          keyVal.key.toString('hex'),\n      );\n    }\n    const pubkey = keyVal.key.slice(1);\n    if (!isValidPubkey(pubkey)) {\n      throw new Error(\n        'Decode Error: bip32Derivation has invalid pubkey in key 0x' +\n          keyVal.key.toString('hex'),\n      );\n    }\n    if ((keyVal.value.length / 4) % 1 !== 0) {\n      throw new Error(\n        'Decode Error: Input BIP32_DERIVATION value length should be multiple of 4',\n      );\n    }\n    const data = {\n      masterFingerprint: keyVal.value.slice(0, 4),\n      pubkey,\n      path: 'm',\n    };\n    for (const i of range(keyVal.value.length / 4 - 1)) {\n      const val = keyVal.value.readUInt32LE(i * 4 + 4);\n      const isHard = !!(val & 0x80000000);\n      const idx = val & 0x7fffffff;\n      data.path += '/' + idx.toString(10) + (isHard ? \"'\" : '');\n    }\n    return data;\n  }\n  function encode(data) {\n    const head = Buffer.from([TYPE_BYTE]);\n    const key = Buffer.concat([head, data.pubkey]);\n    const splitPath = data.path.split('/');\n    const value = Buffer.allocUnsafe(splitPath.length * 4);\n    data.masterFingerprint.copy(value, 0);\n    let offset = 4;\n    splitPath.slice(1).forEach(level => {\n      const isHard = level.slice(-1) === \"'\";\n      let num = 0x7fffffff & parseInt(isHard ? level.slice(0, -1) : level, 10);\n      if (isHard) num += 0x80000000;\n      value.writeUInt32LE(num, offset);\n      offset += 4;\n    });\n    return {\n      key,\n      value,\n    };\n  }\n  const expected =\n    '{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }';\n  function check(data) {\n    return (\n      Buffer.isBuffer(data.pubkey) &&\n      Buffer.isBuffer(data.masterFingerprint) &&\n      typeof data.path === 'string' &&\n      isValidPubkey(data.pubkey) &&\n      data.masterFingerprint.length === 4\n    );\n  }\n  function canAddToArray(array, item, dupeSet) {\n    const dupeString = item.pubkey.toString('hex');\n    if (dupeSet.has(dupeString)) return false;\n    dupeSet.add(dupeString);\n    return array.filter(v => v.pubkey.equals(item.pubkey)).length === 0;\n  }\n  return {\n    decode,\n    encode,\n    check,\n    expected,\n    canAddToArray,\n  };\n}\nexports.makeConverter = makeConverter;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nfunction makeChecker(pubkeyTypes) {\n  return checkPubkey;\n  function checkPubkey(keyVal) {\n    let pubkey;\n    if (pubkeyTypes.includes(keyVal.key[0])) {\n      pubkey = keyVal.key.slice(1);\n      if (\n        !(pubkey.length === 33 || pubkey.length === 65) ||\n        ![2, 3, 4].includes(pubkey[0])\n      ) {\n        throw new Error(\n          'Format Error: invalid pubkey in key 0x' + keyVal.key.toString('hex'),\n        );\n      }\n    }\n    return pubkey;\n  }\n}\nexports.makeChecker = makeChecker;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nfunction makeConverter(TYPE_BYTE) {\n  function decode(keyVal) {\n    if (keyVal.key[0] !== TYPE_BYTE) {\n      throw new Error(\n        'Decode Error: could not decode redeemScript with key 0x' +\n          keyVal.key.toString('hex'),\n      );\n    }\n    return keyVal.value;\n  }\n  function encode(data) {\n    const key = Buffer.from([TYPE_BYTE]);\n    return {\n      key,\n      value: data,\n    };\n  }\n  const expected = 'Buffer';\n  function check(data) {\n    return Buffer.isBuffer(data);\n  }\n  function canAdd(currentData, newData) {\n    return !!currentData && !!newData && currentData.redeemScript === undefined;\n  }\n  return {\n    decode,\n    encode,\n    check,\n    expected,\n    canAdd,\n  };\n}\nexports.makeConverter = makeConverter;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst varuint = require('../varint');\nconst bip32Derivation = require('./bip32Derivation');\nconst isValidBIP340Key = pubkey => pubkey.length === 32;\nfunction makeConverter(TYPE_BYTE) {\n  const parent = bip32Derivation.makeConverter(TYPE_BYTE, isValidBIP340Key);\n  function decode(keyVal) {\n    const nHashes = varuint.decode(keyVal.value);\n    const nHashesLen = varuint.encodingLength(nHashes);\n    const base = parent.decode({\n      key: keyVal.key,\n      value: keyVal.value.slice(nHashesLen + nHashes * 32),\n    });\n    const leafHashes = new Array(nHashes);\n    for (let i = 0, _offset = nHashesLen; i < nHashes; i++, _offset += 32) {\n      leafHashes[i] = keyVal.value.slice(_offset, _offset + 32);\n    }\n    return Object.assign({}, base, { leafHashes });\n  }\n  function encode(data) {\n    const base = parent.encode(data);\n    const nHashesLen = varuint.encodingLength(data.leafHashes.length);\n    const nHashesBuf = Buffer.allocUnsafe(nHashesLen);\n    varuint.encode(data.leafHashes.length, nHashesBuf);\n    const value = Buffer.concat([nHashesBuf, ...data.leafHashes, base.value]);\n    return Object.assign({}, base, { value });\n  }\n  const expected =\n    '{ ' +\n    'masterFingerprint: Buffer; ' +\n    'pubkey: Buffer; ' +\n    'path: string; ' +\n    'leafHashes: Buffer[]; ' +\n    '}';\n  function check(data) {\n    return (\n      Array.isArray(data.leafHashes) &&\n      data.leafHashes.every(\n        leafHash => Buffer.isBuffer(leafHash) && leafHash.length === 32,\n      ) &&\n      parent.check(data)\n    );\n  }\n  return {\n    decode,\n    encode,\n    check,\n    expected,\n    canAddToArray: parent.canAddToArray,\n  };\n}\nexports.makeConverter = makeConverter;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nfunction makeConverter(TYPE_BYTE) {\n  function decode(keyVal) {\n    if (keyVal.key[0] !== TYPE_BYTE || keyVal.key.length !== 1) {\n      throw new Error(\n        'Decode Error: could not decode tapInternalKey with key 0x' +\n          keyVal.key.toString('hex'),\n      );\n    }\n    if (keyVal.value.length !== 32) {\n      throw new Error(\n        'Decode Error: tapInternalKey not a 32-byte x-only pubkey',\n      );\n    }\n    return keyVal.value;\n  }\n  function encode(value) {\n    const key = Buffer.from([TYPE_BYTE]);\n    return { key, value };\n  }\n  const expected = 'Buffer';\n  function check(data) {\n    return Buffer.isBuffer(data) && data.length === 32;\n  }\n  function canAdd(currentData, newData) {\n    return (\n      !!currentData && !!newData && currentData.tapInternalKey === undefined\n    );\n  }\n  return {\n    decode,\n    encode,\n    check,\n    expected,\n    canAdd,\n  };\n}\nexports.makeConverter = makeConverter;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nfunction makeConverter(TYPE_BYTE) {\n  function decode(keyVal) {\n    if (keyVal.key[0] !== TYPE_BYTE) {\n      throw new Error(\n        'Decode Error: could not decode witnessScript with key 0x' +\n          keyVal.key.toString('hex'),\n      );\n    }\n    return keyVal.value;\n  }\n  function encode(data) {\n    const key = Buffer.from([TYPE_BYTE]);\n    return {\n      key,\n      value: data,\n    };\n  }\n  const expected = 'Buffer';\n  function check(data) {\n    return Buffer.isBuffer(data);\n  }\n  function canAdd(currentData, newData) {\n    return (\n      !!currentData && !!newData && currentData.witnessScript === undefined\n    );\n  }\n  return {\n    decode,\n    encode,\n    check,\n    expected,\n    canAdd,\n  };\n}\nexports.makeConverter = makeConverter;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst varuint = require('./varint');\nexports.range = n => [...Array(n).keys()];\nfunction reverseBuffer(buffer) {\n  if (buffer.length < 1) return buffer;\n  let j = buffer.length - 1;\n  let tmp = 0;\n  for (let i = 0; i < buffer.length / 2; i++) {\n    tmp = buffer[i];\n    buffer[i] = buffer[j];\n    buffer[j] = tmp;\n    j--;\n  }\n  return buffer;\n}\nexports.reverseBuffer = reverseBuffer;\nfunction keyValsToBuffer(keyVals) {\n  const buffers = keyVals.map(keyValToBuffer);\n  buffers.push(Buffer.from([0]));\n  return Buffer.concat(buffers);\n}\nexports.keyValsToBuffer = keyValsToBuffer;\nfunction keyValToBuffer(keyVal) {\n  const keyLen = keyVal.key.length;\n  const valLen = keyVal.value.length;\n  const keyVarIntLen = varuint.encodingLength(keyLen);\n  const valVarIntLen = varuint.encodingLength(valLen);\n  const buffer = Buffer.allocUnsafe(\n    keyVarIntLen + keyLen + valVarIntLen + valLen,\n  );\n  varuint.encode(keyLen, buffer, 0);\n  keyVal.key.copy(buffer, keyVarIntLen);\n  varuint.encode(valLen, buffer, keyVarIntLen + keyLen);\n  keyVal.value.copy(buffer, keyVarIntLen + keyLen + valVarIntLen);\n  return buffer;\n}\nexports.keyValToBuffer = keyValToBuffer;\n// https://github.com/feross/buffer/blob/master/index.js#L1127\nfunction verifuint(value, max) {\n  if (typeof value !== 'number')\n    throw new Error('cannot write a non-number as a number');\n  if (value < 0)\n    throw new Error('specified a negative value for writing an unsigned value');\n  if (value > max) throw new Error('RangeError: value out of range');\n  if (Math.floor(value) !== value)\n    throw new Error('value has a fractional component');\n}\nfunction readUInt64LE(buffer, offset) {\n  const a = buffer.readUInt32LE(offset);\n  let b = buffer.readUInt32LE(offset + 4);\n  b *= 0x100000000;\n  verifuint(b + a, 0x001fffffffffffff);\n  return b + a;\n}\nexports.readUInt64LE = readUInt64LE;\nfunction writeUInt64LE(buffer, value, offset) {\n  verifuint(value, 0x001fffffffffffff);\n  buffer.writeInt32LE(value & -1, offset);\n  buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4);\n  return offset + 8;\n}\nexports.writeUInt64LE = writeUInt64LE;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\n// Number.MAX_SAFE_INTEGER\nconst MAX_SAFE_INTEGER = 9007199254740991;\nfunction checkUInt53(n) {\n  if (n < 0 || n > MAX_SAFE_INTEGER || n % 1 !== 0)\n    throw new RangeError('value out of range');\n}\nfunction encode(_number, buffer, offset) {\n  checkUInt53(_number);\n  if (!buffer) buffer = Buffer.allocUnsafe(encodingLength(_number));\n  if (!Buffer.isBuffer(buffer))\n    throw new TypeError('buffer must be a Buffer instance');\n  if (!offset) offset = 0;\n  // 8 bit\n  if (_number < 0xfd) {\n    buffer.writeUInt8(_number, offset);\n    Object.assign(encode, { bytes: 1 });\n    // 16 bit\n  } else if (_number <= 0xffff) {\n    buffer.writeUInt8(0xfd, offset);\n    buffer.writeUInt16LE(_number, offset + 1);\n    Object.assign(encode, { bytes: 3 });\n    // 32 bit\n  } else if (_number <= 0xffffffff) {\n    buffer.writeUInt8(0xfe, offset);\n    buffer.writeUInt32LE(_number, offset + 1);\n    Object.assign(encode, { bytes: 5 });\n    // 64 bit\n  } else {\n    buffer.writeUInt8(0xff, offset);\n    buffer.writeUInt32LE(_number >>> 0, offset + 1);\n    buffer.writeUInt32LE((_number / 0x100000000) | 0, offset + 5);\n    Object.assign(encode, { bytes: 9 });\n  }\n  return buffer;\n}\nexports.encode = encode;\nfunction decode(buffer, offset) {\n  if (!Buffer.isBuffer(buffer))\n    throw new TypeError('buffer must be a Buffer instance');\n  if (!offset) offset = 0;\n  const first = buffer.readUInt8(offset);\n  // 8 bit\n  if (first < 0xfd) {\n    Object.assign(decode, { bytes: 1 });\n    return first;\n    // 16 bit\n  } else if (first === 0xfd) {\n    Object.assign(decode, { bytes: 3 });\n    return buffer.readUInt16LE(offset + 1);\n    // 32 bit\n  } else if (first === 0xfe) {\n    Object.assign(decode, { bytes: 5 });\n    return buffer.readUInt32LE(offset + 1);\n    // 64 bit\n  } else {\n    Object.assign(decode, { bytes: 9 });\n    const lo = buffer.readUInt32LE(offset + 1);\n    const hi = buffer.readUInt32LE(offset + 5);\n    const _number = hi * 0x0100000000 + lo;\n    checkUInt53(_number);\n    return _number;\n  }\n}\nexports.decode = decode;\nfunction encodingLength(_number) {\n  checkUInt53(_number);\n  return _number < 0xfd\n    ? 1\n    : _number <= 0xffff\n    ? 3\n    : _number <= 0xffffffff\n    ? 5\n    : 9;\n}\nexports.encodingLength = encodingLength;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst convert = require('../converter');\nconst tools_1 = require('../converter/tools');\nconst varuint = require('../converter/varint');\nconst typeFields_1 = require('../typeFields');\nfunction psbtFromBuffer(buffer, txGetter) {\n  let offset = 0;\n  function varSlice() {\n    const keyLen = varuint.decode(buffer, offset);\n    offset += varuint.encodingLength(keyLen);\n    const key = buffer.slice(offset, offset + keyLen);\n    offset += keyLen;\n    return key;\n  }\n  function readUInt32BE() {\n    const num = buffer.readUInt32BE(offset);\n    offset += 4;\n    return num;\n  }\n  function readUInt8() {\n    const num = buffer.readUInt8(offset);\n    offset += 1;\n    return num;\n  }\n  function getKeyValue() {\n    const key = varSlice();\n    const value = varSlice();\n    return {\n      key,\n      value,\n    };\n  }\n  function checkEndOfKeyValPairs() {\n    if (offset >= buffer.length) {\n      throw new Error('Format Error: Unexpected End of PSBT');\n    }\n    const isEnd = buffer.readUInt8(offset) === 0;\n    if (isEnd) {\n      offset++;\n    }\n    return isEnd;\n  }\n  if (readUInt32BE() !== 0x70736274) {\n    throw new Error('Format Error: Invalid Magic Number');\n  }\n  if (readUInt8() !== 0xff) {\n    throw new Error(\n      'Format Error: Magic Number must be followed by 0xff separator',\n    );\n  }\n  const globalMapKeyVals = [];\n  const globalKeyIndex = {};\n  while (!checkEndOfKeyValPairs()) {\n    const keyVal = getKeyValue();\n    const hexKey = keyVal.key.toString('hex');\n    if (globalKeyIndex[hexKey]) {\n      throw new Error(\n        'Format Error: Keys must be unique for global keymap: key ' + hexKey,\n      );\n    }\n    globalKeyIndex[hexKey] = 1;\n    globalMapKeyVals.push(keyVal);\n  }\n  const unsignedTxMaps = globalMapKeyVals.filter(\n    keyVal => keyVal.key[0] === typeFields_1.GlobalTypes.UNSIGNED_TX,\n  );\n  if (unsignedTxMaps.length !== 1) {\n    throw new Error('Format Error: Only one UNSIGNED_TX allowed');\n  }\n  const unsignedTx = txGetter(unsignedTxMaps[0].value);\n  // Get input and output counts to loop the respective fields\n  const { inputCount, outputCount } = unsignedTx.getInputOutputCounts();\n  const inputKeyVals = [];\n  const outputKeyVals = [];\n  // Get input fields\n  for (const index of tools_1.range(inputCount)) {\n    const inputKeyIndex = {};\n    const input = [];\n    while (!checkEndOfKeyValPairs()) {\n      const keyVal = getKeyValue();\n      const hexKey = keyVal.key.toString('hex');\n      if (inputKeyIndex[hexKey]) {\n        throw new Error(\n          'Format Error: Keys must be unique for each input: ' +\n            'input index ' +\n            index +\n            ' key ' +\n            hexKey,\n        );\n      }\n      inputKeyIndex[hexKey] = 1;\n      input.push(keyVal);\n    }\n    inputKeyVals.push(input);\n  }\n  for (const index of tools_1.range(outputCount)) {\n    const outputKeyIndex = {};\n    const output = [];\n    while (!checkEndOfKeyValPairs()) {\n      const keyVal = getKeyValue();\n      const hexKey = keyVal.key.toString('hex');\n      if (outputKeyIndex[hexKey]) {\n        throw new Error(\n          'Format Error: Keys must be unique for each output: ' +\n            'output index ' +\n            index +\n            ' key ' +\n            hexKey,\n        );\n      }\n      outputKeyIndex[hexKey] = 1;\n      output.push(keyVal);\n    }\n    outputKeyVals.push(output);\n  }\n  return psbtFromKeyVals(unsignedTx, {\n    globalMapKeyVals,\n    inputKeyVals,\n    outputKeyVals,\n  });\n}\nexports.psbtFromBuffer = psbtFromBuffer;\nfunction checkKeyBuffer(type, keyBuf, keyNum) {\n  if (!keyBuf.equals(Buffer.from([keyNum]))) {\n    throw new Error(\n      `Format Error: Invalid ${type} key: ${keyBuf.toString('hex')}`,\n    );\n  }\n}\nexports.checkKeyBuffer = checkKeyBuffer;\nfunction psbtFromKeyVals(\n  unsignedTx,\n  { globalMapKeyVals, inputKeyVals, outputKeyVals },\n) {\n  // That was easy :-)\n  const globalMap = {\n    unsignedTx,\n  };\n  let txCount = 0;\n  for (const keyVal of globalMapKeyVals) {\n    // If a globalMap item needs pubkey, uncomment\n    // const pubkey = convert.globals.checkPubkey(keyVal);\n    switch (keyVal.key[0]) {\n      case typeFields_1.GlobalTypes.UNSIGNED_TX:\n        checkKeyBuffer(\n          'global',\n          keyVal.key,\n          typeFields_1.GlobalTypes.UNSIGNED_TX,\n        );\n        if (txCount > 0) {\n          throw new Error('Format Error: GlobalMap has multiple UNSIGNED_TX');\n        }\n        txCount++;\n        break;\n      case typeFields_1.GlobalTypes.GLOBAL_XPUB:\n        if (globalMap.globalXpub === undefined) {\n          globalMap.globalXpub = [];\n        }\n        globalMap.globalXpub.push(convert.globals.globalXpub.decode(keyVal));\n        break;\n      default:\n        // This will allow inclusion during serialization.\n        if (!globalMap.unknownKeyVals) globalMap.unknownKeyVals = [];\n        globalMap.unknownKeyVals.push(keyVal);\n    }\n  }\n  // Get input and output counts to loop the respective fields\n  const inputCount = inputKeyVals.length;\n  const outputCount = outputKeyVals.length;\n  const inputs = [];\n  const outputs = [];\n  // Get input fields\n  for (const index of tools_1.range(inputCount)) {\n    const input = {};\n    for (const keyVal of inputKeyVals[index]) {\n      convert.inputs.checkPubkey(keyVal);\n      switch (keyVal.key[0]) {\n        case typeFields_1.InputTypes.NON_WITNESS_UTXO:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.NON_WITNESS_UTXO,\n          );\n          if (input.nonWitnessUtxo !== undefined) {\n            throw new Error(\n              'Format Error: Input has multiple NON_WITNESS_UTXO',\n            );\n          }\n          input.nonWitnessUtxo = convert.inputs.nonWitnessUtxo.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.WITNESS_UTXO:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.WITNESS_UTXO,\n          );\n          if (input.witnessUtxo !== undefined) {\n            throw new Error('Format Error: Input has multiple WITNESS_UTXO');\n          }\n          input.witnessUtxo = convert.inputs.witnessUtxo.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.PARTIAL_SIG:\n          if (input.partialSig === undefined) {\n            input.partialSig = [];\n          }\n          input.partialSig.push(convert.inputs.partialSig.decode(keyVal));\n          break;\n        case typeFields_1.InputTypes.SIGHASH_TYPE:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.SIGHASH_TYPE,\n          );\n          if (input.sighashType !== undefined) {\n            throw new Error('Format Error: Input has multiple SIGHASH_TYPE');\n          }\n          input.sighashType = convert.inputs.sighashType.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.REDEEM_SCRIPT:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.REDEEM_SCRIPT,\n          );\n          if (input.redeemScript !== undefined) {\n            throw new Error('Format Error: Input has multiple REDEEM_SCRIPT');\n          }\n          input.redeemScript = convert.inputs.redeemScript.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.WITNESS_SCRIPT:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.WITNESS_SCRIPT,\n          );\n          if (input.witnessScript !== undefined) {\n            throw new Error('Format Error: Input has multiple WITNESS_SCRIPT');\n          }\n          input.witnessScript = convert.inputs.witnessScript.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.BIP32_DERIVATION:\n          if (input.bip32Derivation === undefined) {\n            input.bip32Derivation = [];\n          }\n          input.bip32Derivation.push(\n            convert.inputs.bip32Derivation.decode(keyVal),\n          );\n          break;\n        case typeFields_1.InputTypes.FINAL_SCRIPTSIG:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.FINAL_SCRIPTSIG,\n          );\n          input.finalScriptSig = convert.inputs.finalScriptSig.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.FINAL_SCRIPTWITNESS:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.FINAL_SCRIPTWITNESS,\n          );\n          input.finalScriptWitness = convert.inputs.finalScriptWitness.decode(\n            keyVal,\n          );\n          break;\n        case typeFields_1.InputTypes.POR_COMMITMENT:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.POR_COMMITMENT,\n          );\n          input.porCommitment = convert.inputs.porCommitment.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.TAP_KEY_SIG:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.TAP_KEY_SIG,\n          );\n          input.tapKeySig = convert.inputs.tapKeySig.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.TAP_SCRIPT_SIG:\n          if (input.tapScriptSig === undefined) {\n            input.tapScriptSig = [];\n          }\n          input.tapScriptSig.push(convert.inputs.tapScriptSig.decode(keyVal));\n          break;\n        case typeFields_1.InputTypes.TAP_LEAF_SCRIPT:\n          if (input.tapLeafScript === undefined) {\n            input.tapLeafScript = [];\n          }\n          input.tapLeafScript.push(convert.inputs.tapLeafScript.decode(keyVal));\n          break;\n        case typeFields_1.InputTypes.TAP_BIP32_DERIVATION:\n          if (input.tapBip32Derivation === undefined) {\n            input.tapBip32Derivation = [];\n          }\n          input.tapBip32Derivation.push(\n            convert.inputs.tapBip32Derivation.decode(keyVal),\n          );\n          break;\n        case typeFields_1.InputTypes.TAP_INTERNAL_KEY:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.TAP_INTERNAL_KEY,\n          );\n          input.tapInternalKey = convert.inputs.tapInternalKey.decode(keyVal);\n          break;\n        case typeFields_1.InputTypes.TAP_MERKLE_ROOT:\n          checkKeyBuffer(\n            'input',\n            keyVal.key,\n            typeFields_1.InputTypes.TAP_MERKLE_ROOT,\n          );\n          input.tapMerkleRoot = convert.inputs.tapMerkleRoot.decode(keyVal);\n          break;\n        default:\n          // This will allow inclusion during serialization.\n          if (!input.unknownKeyVals) input.unknownKeyVals = [];\n          input.unknownKeyVals.push(keyVal);\n      }\n    }\n    inputs.push(input);\n  }\n  for (const index of tools_1.range(outputCount)) {\n    const output = {};\n    for (const keyVal of outputKeyVals[index]) {\n      convert.outputs.checkPubkey(keyVal);\n      switch (keyVal.key[0]) {\n        case typeFields_1.OutputTypes.REDEEM_SCRIPT:\n          checkKeyBuffer(\n            'output',\n            keyVal.key,\n            typeFields_1.OutputTypes.REDEEM_SCRIPT,\n          );\n          if (output.redeemScript !== undefined) {\n            throw new Error('Format Error: Output has multiple REDEEM_SCRIPT');\n          }\n          output.redeemScript = convert.outputs.redeemScript.decode(keyVal);\n          break;\n        case typeFields_1.OutputTypes.WITNESS_SCRIPT:\n          checkKeyBuffer(\n            'output',\n            keyVal.key,\n            typeFields_1.OutputTypes.WITNESS_SCRIPT,\n          );\n          if (output.witnessScript !== undefined) {\n            throw new Error('Format Error: Output has multiple WITNESS_SCRIPT');\n          }\n          output.witnessScript = convert.outputs.witnessScript.decode(keyVal);\n          break;\n        case typeFields_1.OutputTypes.BIP32_DERIVATION:\n          if (output.bip32Derivation === undefined) {\n            output.bip32Derivation = [];\n          }\n          output.bip32Derivation.push(\n            convert.outputs.bip32Derivation.decode(keyVal),\n          );\n          break;\n        case typeFields_1.OutputTypes.TAP_INTERNAL_KEY:\n          checkKeyBuffer(\n            'output',\n            keyVal.key,\n            typeFields_1.OutputTypes.TAP_INTERNAL_KEY,\n          );\n          output.tapInternalKey = convert.outputs.tapInternalKey.decode(keyVal);\n          break;\n        case typeFields_1.OutputTypes.TAP_TREE:\n          checkKeyBuffer(\n            'output',\n            keyVal.key,\n            typeFields_1.OutputTypes.TAP_TREE,\n          );\n          output.tapTree = convert.outputs.tapTree.decode(keyVal);\n          break;\n        case typeFields_1.OutputTypes.TAP_BIP32_DERIVATION:\n          if (output.tapBip32Derivation === undefined) {\n            output.tapBip32Derivation = [];\n          }\n          output.tapBip32Derivation.push(\n            convert.outputs.tapBip32Derivation.decode(keyVal),\n          );\n          break;\n        default:\n          if (!output.unknownKeyVals) output.unknownKeyVals = [];\n          output.unknownKeyVals.push(keyVal);\n      }\n    }\n    outputs.push(output);\n  }\n  return { globalMap, inputs, outputs };\n}\nexports.psbtFromKeyVals = psbtFromKeyVals;\n'use strict';\nfunction __export(m) {\n  for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, '__esModule', { value: true });\n__export(require('./fromBuffer'));\n__export(require('./toBuffer'));\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst convert = require('../converter');\nconst tools_1 = require('../converter/tools');\nfunction psbtToBuffer({ globalMap, inputs, outputs }) {\n  const { globalKeyVals, inputKeyVals, outputKeyVals } = psbtToKeyVals({\n    globalMap,\n    inputs,\n    outputs,\n  });\n  const globalBuffer = tools_1.keyValsToBuffer(globalKeyVals);\n  const keyValsOrEmptyToBuffer = keyVals =>\n    keyVals.length === 0\n      ? [Buffer.from([0])]\n      : keyVals.map(tools_1.keyValsToBuffer);\n  const inputBuffers = keyValsOrEmptyToBuffer(inputKeyVals);\n  const outputBuffers = keyValsOrEmptyToBuffer(outputKeyVals);\n  const header = Buffer.allocUnsafe(5);\n  header.writeUIntBE(0x70736274ff, 0, 5);\n  return Buffer.concat(\n    [header, globalBuffer].concat(inputBuffers, outputBuffers),\n  );\n}\nexports.psbtToBuffer = psbtToBuffer;\nconst sortKeyVals = (a, b) => {\n  return a.key.compare(b.key);\n};\nfunction keyValsFromMap(keyValMap, converterFactory) {\n  const keyHexSet = new Set();\n  const keyVals = Object.entries(keyValMap).reduce((result, [key, value]) => {\n    if (key === 'unknownKeyVals') return result;\n    // We are checking for undefined anyways. So ignore TS error\n    // @ts-ignore\n    const converter = converterFactory[key];\n    if (converter === undefined) return result;\n    const encodedKeyVals = (Array.isArray(value) ? value : [value]).map(\n      converter.encode,\n    );\n    const keyHexes = encodedKeyVals.map(kv => kv.key.toString('hex'));\n    keyHexes.forEach(hex => {\n      if (keyHexSet.has(hex))\n        throw new Error('Serialize Error: Duplicate key: ' + hex);\n      keyHexSet.add(hex);\n    });\n    return result.concat(encodedKeyVals);\n  }, []);\n  // Get other keyVals that have not yet been gotten\n  const otherKeyVals = keyValMap.unknownKeyVals\n    ? keyValMap.unknownKeyVals.filter(keyVal => {\n        return !keyHexSet.has(keyVal.key.toString('hex'));\n      })\n    : [];\n  return keyVals.concat(otherKeyVals).sort(sortKeyVals);\n}\nfunction psbtToKeyVals({ globalMap, inputs, outputs }) {\n  // First parse the global keyVals\n  // Get any extra keyvals to pass along\n  return {\n    globalKeyVals: keyValsFromMap(globalMap, convert.globals),\n    inputKeyVals: inputs.map(i => keyValsFromMap(i, convert.inputs)),\n    outputKeyVals: outputs.map(o => keyValsFromMap(o, convert.outputs)),\n  };\n}\nexports.psbtToKeyVals = psbtToKeyVals;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst combiner_1 = require('./combiner');\nconst parser_1 = require('./parser');\nconst typeFields_1 = require('./typeFields');\nconst utils_1 = require('./utils');\nclass Psbt {\n  constructor(tx) {\n    this.inputs = [];\n    this.outputs = [];\n    this.globalMap = {\n      unsignedTx: tx,\n    };\n  }\n  static fromBase64(data, txFromBuffer) {\n    const buffer = Buffer.from(data, 'base64');\n    return this.fromBuffer(buffer, txFromBuffer);\n  }\n  static fromHex(data, txFromBuffer) {\n    const buffer = Buffer.from(data, 'hex');\n    return this.fromBuffer(buffer, txFromBuffer);\n  }\n  static fromBuffer(buffer, txFromBuffer) {\n    const results = parser_1.psbtFromBuffer(buffer, txFromBuffer);\n    const psbt = new this(results.globalMap.unsignedTx);\n    Object.assign(psbt, results);\n    return psbt;\n  }\n  toBase64() {\n    const buffer = this.toBuffer();\n    return buffer.toString('base64');\n  }\n  toHex() {\n    const buffer = this.toBuffer();\n    return buffer.toString('hex');\n  }\n  toBuffer() {\n    return parser_1.psbtToBuffer(this);\n  }\n  updateGlobal(updateData) {\n    utils_1.updateGlobal(updateData, this.globalMap);\n    return this;\n  }\n  updateInput(inputIndex, updateData) {\n    const input = utils_1.checkForInput(this.inputs, inputIndex);\n    utils_1.updateInput(updateData, input);\n    return this;\n  }\n  updateOutput(outputIndex, updateData) {\n    const output = utils_1.checkForOutput(this.outputs, outputIndex);\n    utils_1.updateOutput(updateData, output);\n    return this;\n  }\n  addUnknownKeyValToGlobal(keyVal) {\n    utils_1.checkHasKey(\n      keyVal,\n      this.globalMap.unknownKeyVals,\n      utils_1.getEnumLength(typeFields_1.GlobalTypes),\n    );\n    if (!this.globalMap.unknownKeyVals) this.globalMap.unknownKeyVals = [];\n    this.globalMap.unknownKeyVals.push(keyVal);\n    return this;\n  }\n  addUnknownKeyValToInput(inputIndex, keyVal) {\n    const input = utils_1.checkForInput(this.inputs, inputIndex);\n    utils_1.checkHasKey(\n      keyVal,\n      input.unknownKeyVals,\n      utils_1.getEnumLength(typeFields_1.InputTypes),\n    );\n    if (!input.unknownKeyVals) input.unknownKeyVals = [];\n    input.unknownKeyVals.push(keyVal);\n    return this;\n  }\n  addUnknownKeyValToOutput(outputIndex, keyVal) {\n    const output = utils_1.checkForOutput(this.outputs, outputIndex);\n    utils_1.checkHasKey(\n      keyVal,\n      output.unknownKeyVals,\n      utils_1.getEnumLength(typeFields_1.OutputTypes),\n    );\n    if (!output.unknownKeyVals) output.unknownKeyVals = [];\n    output.unknownKeyVals.push(keyVal);\n    return this;\n  }\n  addInput(inputData) {\n    this.globalMap.unsignedTx.addInput(inputData);\n    this.inputs.push({\n      unknownKeyVals: [],\n    });\n    const addKeyVals = inputData.unknownKeyVals || [];\n    const inputIndex = this.inputs.length - 1;\n    if (!Array.isArray(addKeyVals)) {\n      throw new Error('unknownKeyVals must be an Array');\n    }\n    addKeyVals.forEach(keyVal =>\n      this.addUnknownKeyValToInput(inputIndex, keyVal),\n    );\n    utils_1.addInputAttributes(this.inputs, inputData);\n    return this;\n  }\n  addOutput(outputData) {\n    this.globalMap.unsignedTx.addOutput(outputData);\n    this.outputs.push({\n      unknownKeyVals: [],\n    });\n    const addKeyVals = outputData.unknownKeyVals || [];\n    const outputIndex = this.outputs.length - 1;\n    if (!Array.isArray(addKeyVals)) {\n      throw new Error('unknownKeyVals must be an Array');\n    }\n    addKeyVals.forEach(keyVal =>\n      this.addUnknownKeyValToOutput(outputIndex, keyVal),\n    );\n    utils_1.addOutputAttributes(this.outputs, outputData);\n    return this;\n  }\n  clearFinalizedInput(inputIndex) {\n    const input = utils_1.checkForInput(this.inputs, inputIndex);\n    utils_1.inputCheckUncleanFinalized(inputIndex, input);\n    for (const key of Object.keys(input)) {\n      if (\n        ![\n          'witnessUtxo',\n          'nonWitnessUtxo',\n          'finalScriptSig',\n          'finalScriptWitness',\n          'unknownKeyVals',\n        ].includes(key)\n      ) {\n        // @ts-ignore\n        delete input[key];\n      }\n    }\n    return this;\n  }\n  combine(...those) {\n    // Combine this with those.\n    // Return self for chaining.\n    const result = combiner_1.combine([this].concat(those));\n    Object.assign(this, result);\n    return this;\n  }\n  getTransaction() {\n    return this.globalMap.unsignedTx.toBuffer();\n  }\n}\nexports.Psbt = Psbt;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar GlobalTypes;\n(function(GlobalTypes) {\n  GlobalTypes[(GlobalTypes['UNSIGNED_TX'] = 0)] = 'UNSIGNED_TX';\n  GlobalTypes[(GlobalTypes['GLOBAL_XPUB'] = 1)] = 'GLOBAL_XPUB';\n})((GlobalTypes = exports.GlobalTypes || (exports.GlobalTypes = {})));\nexports.GLOBAL_TYPE_NAMES = ['unsignedTx', 'globalXpub'];\nvar InputTypes;\n(function(InputTypes) {\n  InputTypes[(InputTypes['NON_WITNESS_UTXO'] = 0)] = 'NON_WITNESS_UTXO';\n  InputTypes[(InputTypes['WITNESS_UTXO'] = 1)] = 'WITNESS_UTXO';\n  InputTypes[(InputTypes['PARTIAL_SIG'] = 2)] = 'PARTIAL_SIG';\n  InputTypes[(InputTypes['SIGHASH_TYPE'] = 3)] = 'SIGHASH_TYPE';\n  InputTypes[(InputTypes['REDEEM_SCRIPT'] = 4)] = 'REDEEM_SCRIPT';\n  InputTypes[(InputTypes['WITNESS_SCRIPT'] = 5)] = 'WITNESS_SCRIPT';\n  InputTypes[(InputTypes['BIP32_DERIVATION'] = 6)] = 'BIP32_DERIVATION';\n  InputTypes[(InputTypes['FINAL_SCRIPTSIG'] = 7)] = 'FINAL_SCRIPTSIG';\n  InputTypes[(InputTypes['FINAL_SCRIPTWITNESS'] = 8)] = 'FINAL_SCRIPTWITNESS';\n  InputTypes[(InputTypes['POR_COMMITMENT'] = 9)] = 'POR_COMMITMENT';\n  InputTypes[(InputTypes['TAP_KEY_SIG'] = 19)] = 'TAP_KEY_SIG';\n  InputTypes[(InputTypes['TAP_SCRIPT_SIG'] = 20)] = 'TAP_SCRIPT_SIG';\n  InputTypes[(InputTypes['TAP_LEAF_SCRIPT'] = 21)] = 'TAP_LEAF_SCRIPT';\n  InputTypes[(InputTypes['TAP_BIP32_DERIVATION'] = 22)] =\n    'TAP_BIP32_DERIVATION';\n  InputTypes[(InputTypes['TAP_INTERNAL_KEY'] = 23)] = 'TAP_INTERNAL_KEY';\n  InputTypes[(InputTypes['TAP_MERKLE_ROOT'] = 24)] = 'TAP_MERKLE_ROOT';\n})((InputTypes = exports.InputTypes || (exports.InputTypes = {})));\nexports.INPUT_TYPE_NAMES = [\n  'nonWitnessUtxo',\n  'witnessUtxo',\n  'partialSig',\n  'sighashType',\n  'redeemScript',\n  'witnessScript',\n  'bip32Derivation',\n  'finalScriptSig',\n  'finalScriptWitness',\n  'porCommitment',\n  'tapKeySig',\n  'tapScriptSig',\n  'tapLeafScript',\n  'tapBip32Derivation',\n  'tapInternalKey',\n  'tapMerkleRoot',\n];\nvar OutputTypes;\n(function(OutputTypes) {\n  OutputTypes[(OutputTypes['REDEEM_SCRIPT'] = 0)] = 'REDEEM_SCRIPT';\n  OutputTypes[(OutputTypes['WITNESS_SCRIPT'] = 1)] = 'WITNESS_SCRIPT';\n  OutputTypes[(OutputTypes['BIP32_DERIVATION'] = 2)] = 'BIP32_DERIVATION';\n  OutputTypes[(OutputTypes['TAP_INTERNAL_KEY'] = 5)] = 'TAP_INTERNAL_KEY';\n  OutputTypes[(OutputTypes['TAP_TREE'] = 6)] = 'TAP_TREE';\n  OutputTypes[(OutputTypes['TAP_BIP32_DERIVATION'] = 7)] =\n    'TAP_BIP32_DERIVATION';\n})((OutputTypes = exports.OutputTypes || (exports.OutputTypes = {})));\nexports.OUTPUT_TYPE_NAMES = [\n  'redeemScript',\n  'witnessScript',\n  'bip32Derivation',\n  'tapInternalKey',\n  'tapTree',\n  'tapBip32Derivation',\n];\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nconst converter = require('./converter');\nfunction checkForInput(inputs, inputIndex) {\n  const input = inputs[inputIndex];\n  if (input === undefined) throw new Error(`No input #${inputIndex}`);\n  return input;\n}\nexports.checkForInput = checkForInput;\nfunction checkForOutput(outputs, outputIndex) {\n  const output = outputs[outputIndex];\n  if (output === undefined) throw new Error(`No output #${outputIndex}`);\n  return output;\n}\nexports.checkForOutput = checkForOutput;\nfunction checkHasKey(checkKeyVal, keyVals, enumLength) {\n  if (checkKeyVal.key[0] < enumLength) {\n    throw new Error(\n      `Use the method for your specific key instead of addUnknownKeyVal*`,\n    );\n  }\n  if (\n    keyVals &&\n    keyVals.filter(kv => kv.key.equals(checkKeyVal.key)).length !== 0\n  ) {\n    throw new Error(`Duplicate Key: ${checkKeyVal.key.toString('hex')}`);\n  }\n}\nexports.checkHasKey = checkHasKey;\nfunction getEnumLength(myenum) {\n  let count = 0;\n  Object.keys(myenum).forEach(val => {\n    if (Number(isNaN(Number(val)))) {\n      count++;\n    }\n  });\n  return count;\n}\nexports.getEnumLength = getEnumLength;\nfunction inputCheckUncleanFinalized(inputIndex, input) {\n  let result = false;\n  if (input.nonWitnessUtxo || input.witnessUtxo) {\n    const needScriptSig = !!input.redeemScript;\n    const needWitnessScript = !!input.witnessScript;\n    const scriptSigOK = !needScriptSig || !!input.finalScriptSig;\n    const witnessScriptOK = !needWitnessScript || !!input.finalScriptWitness;\n    const hasOneFinal = !!input.finalScriptSig || !!input.finalScriptWitness;\n    result = scriptSigOK && witnessScriptOK && hasOneFinal;\n  }\n  if (result === false) {\n    throw new Error(\n      `Input #${inputIndex} has too much or too little data to clean`,\n    );\n  }\n}\nexports.inputCheckUncleanFinalized = inputCheckUncleanFinalized;\nfunction throwForUpdateMaker(typeName, name, expected, data) {\n  throw new Error(\n    `Data for ${typeName} key ${name} is incorrect: Expected ` +\n      `${expected} and got ${JSON.stringify(data)}`,\n  );\n}\nfunction updateMaker(typeName) {\n  return (updateData, mainData) => {\n    for (const name of Object.keys(updateData)) {\n      // @ts-ignore\n      const data = updateData[name];\n      // @ts-ignore\n      const { canAdd, canAddToArray, check, expected } =\n        // @ts-ignore\n        converter[typeName + 's'][name] || {};\n      const isArray = !!canAddToArray;\n      // If unknown data. ignore and do not add\n      if (check) {\n        if (isArray) {\n          if (\n            !Array.isArray(data) ||\n            // @ts-ignore\n            (mainData[name] && !Array.isArray(mainData[name]))\n          ) {\n            throw new Error(`Key type ${name} must be an array`);\n          }\n          if (!data.every(check)) {\n            throwForUpdateMaker(typeName, name, expected, data);\n          }\n          // @ts-ignore\n          const arr = mainData[name] || [];\n          const dupeCheckSet = new Set();\n          if (!data.every(v => canAddToArray(arr, v, dupeCheckSet))) {\n            throw new Error('Can not add duplicate data to array');\n          }\n          // @ts-ignore\n          mainData[name] = arr.concat(data);\n        } else {\n          if (!check(data)) {\n            throwForUpdateMaker(typeName, name, expected, data);\n          }\n          if (!canAdd(mainData, data)) {\n            throw new Error(`Can not add duplicate data to ${typeName}`);\n          }\n          // @ts-ignore\n          mainData[name] = data;\n        }\n      }\n    }\n  };\n}\nexports.updateGlobal = updateMaker('global');\nexports.updateInput = updateMaker('input');\nexports.updateOutput = updateMaker('output');\nfunction addInputAttributes(inputs, data) {\n  const index = inputs.length - 1;\n  const input = checkForInput(inputs, index);\n  exports.updateInput(data, input);\n}\nexports.addInputAttributes = addInputAttributes;\nfunction addOutputAttributes(outputs, data) {\n  const index = outputs.length - 1;\n  const output = checkForOutput(outputs, index);\n  exports.updateOutput(data, output);\n}\nexports.addOutputAttributes = addOutputAttributes;\nfunction defaultVersionSetter(version, txBuf) {\n  if (!Buffer.isBuffer(txBuf) || txBuf.length < 4) {\n    throw new Error('Set Version: Invalid Transaction');\n  }\n  txBuf.writeUInt32LE(version, 0);\n  return txBuf;\n}\nexports.defaultVersionSetter = defaultVersionSetter;\nfunction defaultLocktimeSetter(locktime, txBuf) {\n  if (!Buffer.isBuffer(txBuf) || txBuf.length < 4) {\n    throw new Error('Set Locktime: Invalid Transaction');\n  }\n  txBuf.writeUInt32LE(locktime, txBuf.length - 4);\n  return txBuf;\n}\nexports.defaultLocktimeSetter = defaultLocktimeSetter;\n/*\n * Bitcoin BIP32 path helpers\n * (C) 2016 Alex Beregszaszi\n */\n\nconst HARDENED = 0x80000000\n\nvar BIPPath = function (path) {\n  if (!Array.isArray(path)) {\n    throw new Error('Input must be an Array')\n  }\n  if (path.length === 0) {\n    throw new Error('Path must contain at least one level')\n  }\n  for (var i = 0; i < path.length; i++) {\n    if (typeof path[i] !== 'number') {\n      throw new Error('Path element is not a number')\n    }\n  }\n  this.path = path\n}\n\nBIPPath.validatePathArray = function (path) {\n  try {\n    BIPPath.fromPathArray(path)\n    return true\n  } catch (e) {\n    return false\n  }\n}\n\nBIPPath.validateString = function (text, reqRoot) {\n  try {\n    BIPPath.fromString(text, reqRoot)\n    return true\n  } catch (e) {\n    return false\n  }\n}\n\nBIPPath.fromPathArray = function (path) {\n  return new BIPPath(path)\n}\n\nBIPPath.fromString = function (text, reqRoot) {\n  // skip the root\n  if (/^m\\//i.test(text)) {\n    text = text.slice(2)\n  } else if (reqRoot) {\n    throw new Error('Root element is required')\n  }\n\n  var path = text.split('/')\n  var ret = new Array(path.length)\n  for (var i = 0; i < path.length; i++) {\n    var tmp = /(\\d+)([hH\\']?)/.exec(path[i])\n    if (tmp === null) {\n      throw new Error('Invalid input')\n    }\n    ret[i] = parseInt(tmp[1], 10)\n\n    if (ret[i] >= HARDENED) {\n      throw new Error('Invalid child index')\n    }\n\n    if (tmp[2] === 'h' || tmp[2] === 'H' || tmp[2] === '\\'') {\n      ret[i] += HARDENED\n    } else if (tmp[2].length != 0) {\n      throw new Error('Invalid modifier')\n    }\n  }\n  return new BIPPath(ret)\n}\n\nBIPPath.prototype.toPathArray = function () {\n  return this.path\n}\n\nBIPPath.prototype.toString = function (noRoot, oldStyle) {\n  var ret = new Array(this.path.length)\n  for (var i = 0; i < this.path.length; i++) {\n    var tmp = this.path[i]\n    if (tmp & HARDENED) {\n      ret[i] = (tmp & ~HARDENED) + (oldStyle ? 'h' : '\\'')\n    } else {\n      ret[i] = tmp\n    }\n  }\n  return (noRoot ? '' : 'm/') + ret.join('/')\n}\n\nBIPPath.prototype.inspect = function () {\n  return 'BIPPath <' + this.toString() + '>'\n}\n\nmodule.exports = BIPPath\n{\n  \"name\": \"bip32-path\",\n  \"version\": \"0.4.2\",\n  \"description\": \"Bitcoin BIP32 ('HD Wallet') path helpers.\",\n  \"main\": \"index.js\",\n  \"author\": \"Alex Beregszaszi <alex@rtfs.hu>\",\n  \"license\": \"MIT\",\n  \"keywords\": [\n    \"bitcoin\",\n    \"bip32\",\n    \"hdwallet\",\n    \"trezor\"\n  ],\n  \"repository\": \"https://github.com/axic/bip32-path\",\n  \"bugs\": {\n    \"url\": \"https://github.com/axic/bip32-path/issues\"\n  },\n  \"homepage\": \"https://github.com/axic/bip32-path\",\n  \"scripts\": {\n    \"test\": \"mocha ./test/\"\n  },\n  \"devDependencies\": {\n    \"mocha\": \"^2.1.0\"\n  }\n}\n{\n  \"name\": \"bip32\",\n  \"version\": \"4.0.0\",\n  \"description\": \"A BIP32 compatible library\",\n  \"keywords\": [\n    \"bip32\",\n    \"bitcoinjs\",\n    \"bitcoin\",\n    \"secp256k1\"\n  ],\n  \"main\": \"./src/index.js\",\n  \"types\": \"./types/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=6.0.0\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc -p ./tsconfig.json\",\n    \"coverage-report\": \"npm run build && npm run nobuild:coverage-report\",\n    \"coverage\": \"npm run build && npm run nobuild:coverage\",\n    \"format\": \"npm run prettier -- --write\",\n    \"format:ci\": \"npm run prettier -- --check\",\n    \"gitdiff:ci\": \"npm run build && git diff --exit-code\",\n    \"lint\": \"tslint -p tsconfig.json -c tslint.json\",\n    \"nobuild:coverage-report\": \"nyc report --reporter=lcov\",\n    \"nobuild:coverage\": \"nyc --check-coverage --branches 90 --functions 90 npm run nobuild:unit\",\n    \"nobuild:unit\": \"tape test/*.js\",\n    \"prettier\": \"prettier 'ts-src/**/*.ts' --ignore-path ./.prettierignore\",\n    \"test\": \"npm run build && npm run format:ci && npm run lint && npm run nobuild:coverage\",\n    \"unit\": \"npm run build && npm run nobuild:unit\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/bitcoinjs/bip32.git\"\n  },\n  \"files\": [\n    \"src\",\n    \"types\"\n  ],\n  \"dependencies\": {\n    \"@noble/hashes\": \"^1.2.0\",\n    \"@scure/base\": \"^1.1.1\",\n    \"typeforce\": \"^1.11.5\",\n    \"wif\": \"^2.0.6\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"18.x\",\n    \"nyc\": \"^15.0.0\",\n    \"prettier\": \"1.16.4\",\n    \"tape\": \"^4.13.2\",\n    \"tiny-secp256k1\": \"^2.2.1\",\n    \"tslint\": \"^6.1.0\",\n    \"typescript\": \"4.7\"\n  },\n  \"author\": \"Daniel Cousens\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/bip32/issues\"\n  }\n}\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BIP32Factory = void 0;\nconst crypto = require(\"./crypto\");\nconst testecc_1 = require(\"./testecc\");\nconst base_1 = require(\"@scure/base\");\nconst sha256_1 = require(\"@noble/hashes/sha256\");\nconst typeforce = require('typeforce');\nconst wif = require('wif');\nconst _bs58check = (0, base_1.base58check)(sha256_1.sha256);\nconst bs58check = {\n    encode: (data) => _bs58check.encode(Uint8Array.from(data)),\n    decode: (str) => Buffer.from(_bs58check.decode(str)),\n};\nfunction BIP32Factory(ecc) {\n    (0, testecc_1.testEcc)(ecc);\n    const UINT256_TYPE = typeforce.BufferN(32);\n    const NETWORK_TYPE = typeforce.compile({\n        wif: typeforce.UInt8,\n        bip32: {\n            public: typeforce.UInt32,\n            private: typeforce.UInt32,\n        },\n    });\n    const BITCOIN = {\n        messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n        bech32: 'bc',\n        bip32: {\n            public: 0x0488b21e,\n            private: 0x0488ade4,\n        },\n        pubKeyHash: 0x00,\n        scriptHash: 0x05,\n        wif: 0x80,\n    };\n    const HIGHEST_BIT = 0x80000000;\n    const UINT31_MAX = Math.pow(2, 31) - 1;\n    function BIP32Path(value) {\n        return (typeforce.String(value) && value.match(/^(m\\/)?(\\d+'?\\/)*\\d+'?$/) !== null);\n    }\n    function UInt31(value) {\n        return typeforce.UInt32(value) && value <= UINT31_MAX;\n    }\n    function toXOnly(pubKey) {\n        return pubKey.length === 32 ? pubKey : pubKey.slice(1, 33);\n    }\n    class Bip32Signer {\n        constructor(__D, __Q) {\n            this.__D = __D;\n            this.__Q = __Q;\n            this.lowR = false;\n        }\n        get publicKey() {\n            if (this.__Q === undefined)\n                this.__Q = Buffer.from(ecc.pointFromScalar(this.__D, true));\n            return this.__Q;\n        }\n        get privateKey() {\n            return this.__D;\n        }\n        sign(hash, lowR) {\n            if (!this.privateKey)\n                throw new Error('Missing private key');\n            if (lowR === undefined)\n                lowR = this.lowR;\n            if (lowR === false) {\n                return Buffer.from(ecc.sign(hash, this.privateKey));\n            }\n            else {\n                let sig = Buffer.from(ecc.sign(hash, this.privateKey));\n                const extraData = Buffer.alloc(32, 0);\n                let counter = 0;\n                // if first try is lowR, skip the loop\n                // for second try and on, add extra entropy counting up\n                while (sig[0] > 0x7f) {\n                    counter++;\n                    extraData.writeUIntLE(counter, 0, 6);\n                    sig = Buffer.from(ecc.sign(hash, this.privateKey, extraData));\n                }\n                return sig;\n            }\n        }\n        signSchnorr(hash) {\n            if (!this.privateKey)\n                throw new Error('Missing private key');\n            if (!ecc.signSchnorr)\n                throw new Error('signSchnorr not supported by ecc library');\n            return Buffer.from(ecc.signSchnorr(hash, this.privateKey));\n        }\n        verify(hash, signature) {\n            return ecc.verify(hash, this.publicKey, signature);\n        }\n        verifySchnorr(hash, signature) {\n            if (!ecc.verifySchnorr)\n                throw new Error('verifySchnorr not supported by ecc library');\n            return ecc.verifySchnorr(hash, this.publicKey.subarray(1, 33), signature);\n        }\n    }\n    class BIP32 extends Bip32Signer {\n        constructor(__D, __Q, chainCode, network, __DEPTH = 0, __INDEX = 0, __PARENT_FINGERPRINT = 0x00000000) {\n            super(__D, __Q);\n            this.chainCode = chainCode;\n            this.network = network;\n            this.__DEPTH = __DEPTH;\n            this.__INDEX = __INDEX;\n            this.__PARENT_FINGERPRINT = __PARENT_FINGERPRINT;\n            typeforce(NETWORK_TYPE, network);\n        }\n        get depth() {\n            return this.__DEPTH;\n        }\n        get index() {\n            return this.__INDEX;\n        }\n        get parentFingerprint() {\n            return this.__PARENT_FINGERPRINT;\n        }\n        get identifier() {\n            return crypto.hash160(this.publicKey);\n        }\n        get fingerprint() {\n            return this.identifier.slice(0, 4);\n        }\n        get compressed() {\n            return true;\n        }\n        // Private === not neutered\n        // Public === neutered\n        isNeutered() {\n            return this.__D === undefined;\n        }\n        neutered() {\n            return fromPublicKeyLocal(this.publicKey, this.chainCode, this.network, this.depth, this.index, this.parentFingerprint);\n        }\n        toBase58() {\n            const network = this.network;\n            const version = !this.isNeutered()\n                ? network.bip32.private\n                : network.bip32.public;\n            const buffer = Buffer.allocUnsafe(78);\n            // 4 bytes: version bytes\n            buffer.writeUInt32BE(version, 0);\n            // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....\n            buffer.writeUInt8(this.depth, 4);\n            // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)\n            buffer.writeUInt32BE(this.parentFingerprint, 5);\n            // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.\n            // This is encoded in big endian. (0x00000000 if master key)\n            buffer.writeUInt32BE(this.index, 9);\n            // 32 bytes: the chain code\n            this.chainCode.copy(buffer, 13);\n            // 33 bytes: the public key or private key data\n            if (!this.isNeutered()) {\n                // 0x00 + k for private keys\n                buffer.writeUInt8(0, 45);\n                this.privateKey.copy(buffer, 46);\n                // 33 bytes: the public key\n            }\n            else {\n                // X9.62 encoding for public keys\n                this.publicKey.copy(buffer, 45);\n            }\n            return bs58check.encode(buffer);\n        }\n        toWIF() {\n            if (!this.privateKey)\n                throw new TypeError('Missing private key');\n            return wif.encode(this.network.wif, this.privateKey, true);\n        }\n        // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions\n        derive(index) {\n            typeforce(typeforce.UInt32, index);\n            const isHardened = index >= HIGHEST_BIT;\n            const data = Buffer.allocUnsafe(37);\n            // Hardened child\n            if (isHardened) {\n                if (this.isNeutered())\n                    throw new TypeError('Missing private key for hardened child key');\n                // data = 0x00 || ser256(kpar) || ser32(index)\n                data[0] = 0x00;\n                this.privateKey.copy(data, 1);\n                data.writeUInt32BE(index, 33);\n                // Normal child\n            }\n            else {\n                // data = serP(point(kpar)) || ser32(index)\n                //      = serP(Kpar) || ser32(index)\n                this.publicKey.copy(data, 0);\n                data.writeUInt32BE(index, 33);\n            }\n            const I = crypto.hmacSHA512(this.chainCode, data);\n            const IL = I.slice(0, 32);\n            const IR = I.slice(32);\n            // if parse256(IL) >= n, proceed with the next value for i\n            if (!ecc.isPrivate(IL))\n                return this.derive(index + 1);\n            // Private parent key -> private child key\n            let hd;\n            if (!this.isNeutered()) {\n                // ki = parse256(IL) + kpar (mod n)\n                const ki = Buffer.from(ecc.privateAdd(this.privateKey, IL));\n                // In case ki == 0, proceed with the next value for i\n                if (ki == null)\n                    return this.derive(index + 1);\n                hd = fromPrivateKeyLocal(ki, IR, this.network, this.depth + 1, index, this.fingerprint.readUInt32BE(0));\n                // Public parent key -> public child key\n            }\n            else {\n                // Ki = point(parse256(IL)) + Kpar\n                //    = G*IL + Kpar\n                const Ki = Buffer.from(ecc.pointAddScalar(this.publicKey, IL, true));\n                // In case Ki is the point at infinity, proceed with the next value for i\n                if (Ki === null)\n                    return this.derive(index + 1);\n                hd = fromPublicKeyLocal(Ki, IR, this.network, this.depth + 1, index, this.fingerprint.readUInt32BE(0));\n            }\n            return hd;\n        }\n        deriveHardened(index) {\n            typeforce(UInt31, index);\n            // Only derives hardened private keys by default\n            return this.derive(index + HIGHEST_BIT);\n        }\n        derivePath(path) {\n            typeforce(BIP32Path, path);\n            let splitPath = path.split('/');\n            if (splitPath[0] === 'm') {\n                if (this.parentFingerprint)\n                    throw new TypeError('Expected master, got child');\n                splitPath = splitPath.slice(1);\n            }\n            return splitPath.reduce((prevHd, indexStr) => {\n                let index;\n                if (indexStr.slice(-1) === `'`) {\n                    index = parseInt(indexStr.slice(0, -1), 10);\n                    return prevHd.deriveHardened(index);\n                }\n                else {\n                    index = parseInt(indexStr, 10);\n                    return prevHd.derive(index);\n                }\n            }, this);\n        }\n        tweak(t) {\n            if (this.privateKey)\n                return this.tweakFromPrivateKey(t);\n            return this.tweakFromPublicKey(t);\n        }\n        tweakFromPublicKey(t) {\n            const xOnlyPubKey = toXOnly(this.publicKey);\n            if (!ecc.xOnlyPointAddTweak)\n                throw new Error('xOnlyPointAddTweak not supported by ecc library');\n            const tweakedPublicKey = ecc.xOnlyPointAddTweak(xOnlyPubKey, t);\n            if (!tweakedPublicKey || tweakedPublicKey.xOnlyPubkey === null)\n                throw new Error('Cannot tweak public key!');\n            const parityByte = Buffer.from([\n                tweakedPublicKey.parity === 0 ? 0x02 : 0x03,\n            ]);\n            const tweakedPublicKeyCompresed = Buffer.concat([\n                parityByte,\n                tweakedPublicKey.xOnlyPubkey,\n            ]);\n            return new Bip32Signer(undefined, tweakedPublicKeyCompresed);\n        }\n        tweakFromPrivateKey(t) {\n            const hasOddY = this.publicKey[0] === 3 ||\n                (this.publicKey[0] === 4 && (this.publicKey[64] & 1) === 1);\n            const privateKey = (() => {\n                if (!hasOddY)\n                    return this.privateKey;\n                else if (!ecc.privateNegate)\n                    throw new Error('privateNegate not supported by ecc library');\n                else\n                    return ecc.privateNegate(this.privateKey);\n            })();\n            const tweakedPrivateKey = ecc.privateAdd(privateKey, t);\n            if (!tweakedPrivateKey)\n                throw new Error('Invalid tweaked private key!');\n            return new Bip32Signer(Buffer.from(tweakedPrivateKey), undefined);\n        }\n    }\n    function fromBase58(inString, network) {\n        const buffer = bs58check.decode(inString);\n        if (buffer.length !== 78)\n            throw new TypeError('Invalid buffer length');\n        network = network || BITCOIN;\n        // 4 bytes: version bytes\n        const version = buffer.readUInt32BE(0);\n        if (version !== network.bip32.private && version !== network.bip32.public)\n            throw new TypeError('Invalid network version');\n        // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...\n        const depth = buffer[4];\n        // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)\n        const parentFingerprint = buffer.readUInt32BE(5);\n        if (depth === 0) {\n            if (parentFingerprint !== 0x00000000)\n                throw new TypeError('Invalid parent fingerprint');\n        }\n        // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.\n        // This is encoded in MSB order. (0x00000000 if master key)\n        const index = buffer.readUInt32BE(9);\n        if (depth === 0 && index !== 0)\n            throw new TypeError('Invalid index');\n        // 32 bytes: the chain code\n        const chainCode = buffer.slice(13, 45);\n        let hd;\n        // 33 bytes: private key data (0x00 + k)\n        if (version === network.bip32.private) {\n            if (buffer.readUInt8(45) !== 0x00)\n                throw new TypeError('Invalid private key');\n            const k = buffer.slice(46, 78);\n            hd = fromPrivateKeyLocal(k, chainCode, network, depth, index, parentFingerprint);\n            // 33 bytes: public key data (0x02 + X or 0x03 + X)\n        }\n        else {\n            const X = buffer.slice(45, 78);\n            hd = fromPublicKeyLocal(X, chainCode, network, depth, index, parentFingerprint);\n        }\n        return hd;\n    }\n    function fromPrivateKey(privateKey, chainCode, network) {\n        return fromPrivateKeyLocal(privateKey, chainCode, network);\n    }\n    function fromPrivateKeyLocal(privateKey, chainCode, network, depth, index, parentFingerprint) {\n        typeforce({\n            privateKey: UINT256_TYPE,\n            chainCode: UINT256_TYPE,\n        }, { privateKey, chainCode });\n        network = network || BITCOIN;\n        if (!ecc.isPrivate(privateKey))\n            throw new TypeError('Private key not in range [1, n)');\n        return new BIP32(privateKey, undefined, chainCode, network, depth, index, parentFingerprint);\n    }\n    function fromPublicKey(publicKey, chainCode, network) {\n        return fromPublicKeyLocal(publicKey, chainCode, network);\n    }\n    function fromPublicKeyLocal(publicKey, chainCode, network, depth, index, parentFingerprint) {\n        typeforce({\n            publicKey: typeforce.BufferN(33),\n            chainCode: UINT256_TYPE,\n        }, { publicKey, chainCode });\n        network = network || BITCOIN;\n        // verify the X coordinate is a point on the curve\n        if (!ecc.isPoint(publicKey))\n            throw new TypeError('Point is not on the curve');\n        return new BIP32(undefined, publicKey, chainCode, network, depth, index, parentFingerprint);\n    }\n    function fromSeed(seed, network) {\n        typeforce(typeforce.Buffer, seed);\n        if (seed.length < 16)\n            throw new TypeError('Seed should be at least 128 bits');\n        if (seed.length > 64)\n            throw new TypeError('Seed should be at most 512 bits');\n        network = network || BITCOIN;\n        const I = crypto.hmacSHA512(Buffer.from('Bitcoin seed', 'utf8'), seed);\n        const IL = I.slice(0, 32);\n        const IR = I.slice(32);\n        return fromPrivateKey(IL, IR, network);\n    }\n    return {\n        fromSeed,\n        fromBase58,\n        fromPublicKey,\n        fromPrivateKey,\n    };\n}\nexports.BIP32Factory = BIP32Factory;\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hmacSHA512 = exports.hash160 = void 0;\nconst hmac_1 = require(\"@noble/hashes/hmac\");\nconst ripemd160_1 = require(\"@noble/hashes/ripemd160\");\nconst sha256_1 = require(\"@noble/hashes/sha256\");\nconst sha512_1 = require(\"@noble/hashes/sha512\");\nfunction hash160(buffer) {\n    const sha256Hash = (0, sha256_1.sha256)(Uint8Array.from(buffer));\n    return Buffer.from((0, ripemd160_1.ripemd160)(sha256Hash));\n}\nexports.hash160 = hash160;\nfunction hmacSHA512(key, data) {\n    return Buffer.from((0, hmac_1.hmac)(sha512_1.sha512, key, data));\n}\nexports.hmacSHA512 = hmacSHA512;\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BIP32Factory = exports.default = void 0;\nvar bip32_1 = require(\"./bip32\");\nObject.defineProperty(exports, \"default\", { enumerable: true, get: function () { return bip32_1.BIP32Factory; } });\nObject.defineProperty(exports, \"BIP32Factory\", { enumerable: true, get: function () { return bip32_1.BIP32Factory; } });\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.testEcc = void 0;\nconst h = (hex) => Buffer.from(hex, 'hex');\nfunction testEcc(ecc) {\n    assert(ecc.isPoint(h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798')));\n    assert(!ecc.isPoint(h('030000000000000000000000000000000000000000000000000000000000000005')));\n    assert(ecc.isPrivate(h('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798')));\n    // order - 1\n    assert(ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140')));\n    // 0\n    assert(!ecc.isPrivate(h('0000000000000000000000000000000000000000000000000000000000000000')));\n    // order\n    assert(!ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141')));\n    // order + 1\n    assert(!ecc.isPrivate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142')));\n    assert(Buffer.from(ecc.pointFromScalar(h('b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af'))).equals(h('02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99')));\n    if (ecc.xOnlyPointAddTweak) {\n        assert(ecc.xOnlyPointAddTweak(h('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140')) === null);\n        let xOnlyRes = ecc.xOnlyPointAddTweak(h('1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b'), h('a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac'));\n        assert(Buffer.from(xOnlyRes.xOnlyPubkey).equals(h('e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf')) && xOnlyRes.parity === 1);\n        xOnlyRes = ecc.xOnlyPointAddTweak(h('2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991'), h('823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47'));\n    }\n    assert(Buffer.from(ecc.pointAddScalar(h('0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), h('0000000000000000000000000000000000000000000000000000000000000003'))).equals(h('02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5')));\n    assert(Buffer.from(ecc.privateAdd(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e'), h('0000000000000000000000000000000000000000000000000000000000000002'))).equals(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140')));\n    if (ecc.privateNegate) {\n        assert(Buffer.from(ecc.privateNegate(h('0000000000000000000000000000000000000000000000000000000000000001'))).equals(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140')));\n        assert(Buffer.from(ecc.privateNegate(h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e'))).equals(h('0000000000000000000000000000000000000000000000000000000000000003')));\n        assert(Buffer.from(ecc.privateNegate(h('b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af'))).equals(h('4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792')));\n    }\n    assert(Buffer.from(ecc.sign(h('5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed'), h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'))).equals(h('54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5')));\n    assert(ecc.verify(h('5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed'), h('0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'), h('54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5')));\n    if (ecc.signSchnorr) {\n        assert(Buffer.from(ecc.signSchnorr(h('7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c'), h('c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9'), h('c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906'))).equals(h('5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7')));\n    }\n    if (ecc.verifySchnorr) {\n        assert(ecc.verifySchnorr(h('7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c'), h('dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8'), h('5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7')));\n    }\n}\nexports.testEcc = testEcc;\nfunction assert(bool) {\n    if (!bool)\n        throw new Error('ecc library invalid');\n}\nconst sodium = require('sodium-universal')\nconst b4a = require('b4a')\nconst assert = require('nanoassert')\nconst { detectLanguage, loadWordlist } = require('./wordlist')\n\nmodule.exports = {\n  generateEntropy,\n  generateMnemonic,\n  normalizeMnemonic,\n  validateMnemonic,\n  mnemonicToEntropy,\n  mnemonicToSeed,\n  entropyToMnemonic\n}\n\nfunction generateMnemonic ({ entropy = generateEntropy(), language = 'english' } = {}) {\n  const wordlist = loadWordlist(language)\n  const extended = computeCheckSum(entropy)\n\n  const words = []\n\n  for (const index of uint11Reader(extended)) {\n    words.push(wordlist[index])\n  }\n\n  const delimiter = language === 'japanese' ? '\\u3000' : ' '\n\n  return words.join(delimiter).trim()\n}\n\nfunction entropyToMnemonic (entropy, { language = 'english' } = {}) {\n  return generateMnemonic({ entropy, language })\n}\n\nfunction mnemonicToEntropy (mnemonic) {\n  const words = mnemonic.replace(/\\u3000/g, ' ').trim().split(' ')\n  const language = detectLanguage(words)\n\n  if (!language) {\n    throw new Error('Language not recognised')\n  }\n\n  if (words.length % 3 !== 0) {\n    throw new Error('Invalid length')\n  }\n\n  const wordlist = loadWordlist(language)\n\n  const indexes = []\n  for (const word of words) {\n    const index = wordlist.indexOf(word)\n    if (index === -1) {\n      throw new Error('Bad word')\n    }\n\n    indexes.push(index)\n  }\n\n  const bits = words.length * 11\n  const len = (bits * 32 / 33) >> 3\n\n  const extended = b4a.alloc(Math.ceil(bits / 8))\n  const entropy = extended.subarray(0, len)\n\n  uint11Writer(extended, indexes)\n\n  if (!b4a.equals(extended, computeCheckSum(entropy))) {\n    throw new Error('Invalid checksum')\n  }\n\n  return entropy\n}\n\nfunction normalizeMnemonic (mnemonic) {\n  return mnemonic.trim().replace(/\\u3000/, ' ').split(/\\s+/).map(c => c.toLowerCase()).join(' ')\n}\n\nasync function mnemonicToSeed (mnemonic, passphrase = '') {\n  mnemonic = normalizeMnemonic(mnemonic)\n\n  if (!validateMnemonic(mnemonic)) {\n    throw new Error('Invalid mnemonic')\n  }\n\n  const input = b4a.from(mnemonic)\n  const salt = b4a.from('mnemonic' + passphrase)\n\n  const output = b4a.alloc(64)\n\n  await sodium.extension_pbkdf2_sha512_async(\n    output,\n    input,\n    salt,\n    2048,\n    64\n  )\n\n  return output\n}\n\nfunction validateMnemonic (mnemonic) {\n  try {\n    mnemonicToEntropy(mnemonic)\n  } catch (e) {\n    return false\n  }\n  return true\n}\n\nfunction sha256 (data, output = b4a.alloc(32)) {\n  sodium.crypto_hash_sha256(output, data)\n  return output\n}\n\nfunction computeCheckSum (seed) {\n  assert((seed.byteLength & 4) === 0, 'seed must be a multiple of 4 bytes')\n\n  const len = seed.byteLength\n  const cklen = len >> 2 // cksum bits\n  const total = len + Math.ceil(cklen / 8)\n\n  const output = b4a.alloc(len + 32)\n  output.set(seed)\n\n  const entropy = output.subarray(0, len)\n  const cksum = output.subarray(len)\n\n  sha256(entropy, cksum)\n\n  // only append cklen bits\n  output[total - 1] &= (0xff ^ (0xff >> cklen))\n\n  return output.subarray(0, total)\n}\n\nfunction generateEntropy (length = 32) {\n  const seed = b4a.alloc(length)\n  sodium.randombytes_buf(seed)\n\n  return seed\n}\n\nfunction * uint11Reader (state) {\n  yield * uintReader(state, 11)\n}\n\nfunction uint11Writer (buf, uints) {\n  return uintWriter(buf, uints, 11)\n}\n\nfunction * uintReader (buffer, width) {\n  const MASK = (2 << (width - 1)) - 1\n\n  let pos = 0\n  let value = 0\n\n  while (true) {\n    const offset = pos >> 3 // byte offset\n\n    if (offset >= buffer.byteLength) {\n      return value & MASK\n    }\n\n    const height = width - (pos % width)\n    const leftover = (offset + 1) * 8 - pos\n\n    value += shift(buffer[offset], height - leftover)\n\n    pos += Math.min(height, leftover)\n    if (pos % width) continue\n\n    yield value & MASK\n\n    value = 0\n  }\n}\n\nfunction uintWriter (buffer, uints, width) {\n  let pos = 0\n\n  while (true) {\n    const offset = pos >> 3 // byte offset\n\n    const i = Math.floor(pos / width)\n    if (i >= uints.length) break\n\n    if (offset >= buffer.length) {\n      throw new Error('Failed to encode uints')\n    }\n\n    const rem = 8 - pos % 8\n    const height = (i + 1) * width - pos\n\n    const value = shift(uints[i], rem - height)\n\n    buffer[offset] += mask(value, rem)\n\n    pos += Math.min(rem, height)\n  }\n\n  return buffer\n}\n\n// when n is positive, shift left n bits\n// when n is negative, shift right -n bits\nfunction shift (val, n) {\n  if (n === 0) return val\n  if (n > 0) return val << n\n\n  return val >> (-1 * n)\n}\n\nfunction mask (val, bits) {\n  if (bits < 32) return val & ((1 << bits) - 1)\n  return val % (2 ** bits)\n}\n{\n  \"name\": \"bip39-mnemonic\",\n  \"version\": \"2.5.0\",\n  \"description\": \"BIP39 mnemonic for key derivation schemes\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"generate-wordlist\": \"node scripts/generate-wordlist.js\",\n    \"test\": \"standard && brittle test/*.js\"\n  },\n  \"author\": \"Holepunch Inc\",\n  \"license\": \"Apache-2.0\",\n  \"devDependencies\": {\n    \"brittle\": \"^3.4.0\",\n    \"standard\": \"^17.1.0\"\n  },\n  \"dependencies\": {\n    \"b4a\": \"^1.6.6\",\n    \"nanoassert\": \"^2.0.0\",\n    \"sodium-universal\": \"^5.0.1\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"wordlist\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/bip39.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bip39/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bip39#readme\"\n}\n[\"的\",\"一\",\"是\",\"在\",\"不\",\"了\",\"有\",\"和\",\"人\",\"这\",\"中\",\"大\",\"为\",\"上\",\"个\",\"国\",\"我\",\"以\",\"要\",\"他\",\"时\",\"来\",\"用\",\"们\",\"生\",\"到\",\"作\",\"地\",\"于\",\"出\",\"就\",\"分\",\"对\",\"成\",\"会\",\"可\",\"主\",\"发\",\"年\",\"动\",\"同\",\"工\",\"也\",\"能\",\"下\",\"过\",\"子\",\"说\",\"产\",\"种\",\"面\",\"而\",\"方\",\"后\",\"多\",\"定\",\"行\",\"学\",\"法\",\"所\",\"民\",\"得\",\"经\",\"十\",\"三\",\"之\",\"进\",\"着\",\"等\",\"部\",\"度\",\"家\",\"电\",\"力\",\"里\",\"如\",\"水\",\"化\",\"高\",\"自\",\"二\",\"理\",\"起\",\"小\",\"物\",\"现\",\"实\",\"加\",\"量\",\"都\",\"两\",\"体\",\"制\",\"机\",\"当\",\"使\",\"点\",\"从\",\"业\",\"本\",\"去\",\"把\",\"性\",\"好\",\"应\",\"开\",\"它\",\"合\",\"还\",\"因\",\"由\",\"其\",\"些\",\"然\",\"前\",\"外\",\"天\",\"政\",\"四\",\"日\",\"那\",\"社\",\"义\",\"事\",\"平\",\"形\",\"相\",\"全\",\"表\",\"间\",\"样\",\"与\",\"关\",\"各\",\"重\",\"新\",\"线\",\"内\",\"数\",\"正\",\"心\",\"反\",\"你\",\"明\",\"看\",\"原\",\"又\",\"么\",\"利\",\"比\",\"或\",\"但\",\"质\",\"气\",\"第\",\"向\",\"道\",\"命\",\"此\",\"变\",\"条\",\"只\",\"没\",\"结\",\"解\",\"问\",\"意\",\"建\",\"月\",\"公\",\"无\",\"系\",\"军\",\"很\",\"情\",\"者\",\"最\",\"立\",\"代\",\"想\",\"已\",\"通\",\"并\",\"提\",\"直\",\"题\",\"党\",\"程\",\"展\",\"五\",\"果\",\"料\",\"象\",\"员\",\"革\",\"位\",\"入\",\"常\",\"文\",\"总\",\"次\",\"品\",\"式\",\"活\",\"设\",\"及\",\"管\",\"特\",\"件\",\"长\",\"求\",\"老\",\"头\",\"基\",\"资\",\"边\",\"流\",\"路\",\"级\",\"少\",\"图\",\"山\",\"统\",\"接\",\"知\",\"较\",\"将\",\"组\",\"见\",\"计\",\"别\",\"她\",\"手\",\"角\",\"期\",\"根\",\"论\",\"运\",\"农\",\"指\",\"几\",\"九\",\"区\",\"强\",\"放\",\"决\",\"西\",\"被\",\"干\",\"做\",\"必\",\"战\",\"先\",\"回\",\"则\",\"任\",\"取\",\"据\",\"处\",\"队\",\"南\",\"给\",\"色\",\"光\",\"门\",\"即\",\"保\",\"治\",\"北\",\"造\",\"百\",\"规\",\"热\",\"领\",\"七\",\"海\",\"口\",\"东\",\"导\",\"器\",\"压\",\"志\",\"世\",\"金\",\"增\",\"争\",\"济\",\"阶\",\"油\",\"思\",\"术\",\"极\",\"交\",\"受\",\"联\",\"什\",\"认\",\"六\",\"共\",\"权\",\"收\",\"证\",\"改\",\"清\",\"美\",\"再\",\"采\",\"转\",\"更\",\"单\",\"风\",\"切\",\"打\",\"白\",\"教\",\"速\",\"花\",\"带\",\"安\",\"场\",\"身\",\"车\",\"例\",\"真\",\"务\",\"具\",\"万\",\"每\",\"目\",\"至\",\"达\",\"走\",\"积\",\"示\",\"议\",\"声\",\"报\",\"斗\",\"完\",\"类\",\"八\",\"离\",\"华\",\"名\",\"确\",\"才\",\"科\",\"张\",\"信\",\"马\",\"节\",\"话\",\"米\",\"整\",\"空\",\"元\",\"况\",\"今\",\"集\",\"温\",\"传\",\"土\",\"许\",\"步\",\"群\",\"广\",\"石\",\"记\",\"需\",\"段\",\"研\",\"界\",\"拉\",\"林\",\"律\",\"叫\",\"且\",\"究\",\"观\",\"越\",\"织\",\"装\",\"影\",\"算\",\"低\",\"持\",\"音\",\"众\",\"书\",\"布\",\"复\",\"容\",\"儿\",\"须\",\"际\",\"商\",\"非\",\"验\",\"连\",\"断\",\"深\",\"难\",\"近\",\"矿\",\"千\",\"周\",\"委\",\"素\",\"技\",\"备\",\"半\",\"办\",\"青\",\"省\",\"列\",\"习\",\"响\",\"约\",\"支\",\"般\",\"史\",\"感\",\"劳\",\"便\",\"团\",\"往\",\"酸\",\"历\",\"市\",\"克\",\"何\",\"除\",\"消\",\"构\",\"府\",\"称\",\"太\",\"准\",\"精\",\"值\",\"号\",\"率\",\"族\",\"维\",\"划\",\"选\",\"标\",\"写\",\"存\",\"候\",\"毛\",\"亲\",\"快\",\"效\",\"斯\",\"院\",\"查\",\"江\",\"型\",\"眼\",\"王\",\"按\",\"格\",\"养\",\"易\",\"置\",\"派\",\"层\",\"片\",\"始\",\"却\",\"专\",\"状\",\"育\",\"厂\",\"京\",\"识\",\"适\",\"属\",\"圆\",\"包\",\"火\",\"住\",\"调\",\"满\",\"县\",\"局\",\"照\",\"参\",\"红\",\"细\",\"引\",\"听\",\"该\",\"铁\",\"价\",\"严\",\"首\",\"底\",\"液\",\"官\",\"德\",\"随\",\"病\",\"苏\",\"失\",\"尔\",\"死\",\"讲\",\"配\",\"女\",\"黄\",\"推\",\"显\",\"谈\",\"罪\",\"神\",\"艺\",\"呢\",\"席\",\"含\",\"企\",\"望\",\"密\",\"批\",\"营\",\"项\",\"防\",\"举\",\"球\",\"英\",\"氧\",\"势\",\"告\",\"李\",\"台\",\"落\",\"木\",\"帮\",\"轮\",\"破\",\"亚\",\"师\",\"围\",\"注\",\"远\",\"字\",\"材\",\"排\",\"供\",\"河\",\"态\",\"封\",\"另\",\"施\",\"减\",\"树\",\"溶\",\"怎\",\"止\",\"案\",\"言\",\"士\",\"均\",\"武\",\"固\",\"叶\",\"鱼\",\"波\",\"视\",\"仅\",\"费\",\"紧\",\"爱\",\"左\",\"章\",\"早\",\"朝\",\"害\",\"续\",\"轻\",\"服\",\"试\",\"食\",\"充\",\"兵\",\"源\",\"判\",\"护\",\"司\",\"足\",\"某\",\"练\",\"差\",\"致\",\"板\",\"田\",\"降\",\"黑\",\"犯\",\"负\",\"击\",\"范\",\"继\",\"兴\",\"似\",\"余\",\"坚\",\"曲\",\"输\",\"修\",\"故\",\"城\",\"夫\",\"够\",\"送\",\"笔\",\"船\",\"占\",\"右\",\"财\",\"吃\",\"富\",\"春\",\"职\",\"觉\",\"汉\",\"画\",\"功\",\"巴\",\"跟\",\"虽\",\"杂\",\"飞\",\"检\",\"吸\",\"助\",\"升\",\"阳\",\"互\",\"初\",\"创\",\"抗\",\"考\",\"投\",\"坏\",\"策\",\"古\",\"径\",\"换\",\"未\",\"跑\",\"留\",\"钢\",\"曾\",\"端\",\"责\",\"站\",\"简\",\"述\",\"钱\",\"副\",\"尽\",\"帝\",\"射\",\"草\",\"冲\",\"承\",\"独\",\"令\",\"限\",\"阿\",\"宣\",\"环\",\"双\",\"请\",\"超\",\"微\",\"让\",\"控\",\"州\",\"良\",\"轴\",\"找\",\"否\",\"纪\",\"益\",\"依\",\"优\",\"顶\",\"础\",\"载\",\"倒\",\"房\",\"突\",\"坐\",\"粉\",\"敌\",\"略\",\"客\",\"袁\",\"冷\",\"胜\",\"绝\",\"析\",\"块\",\"剂\",\"测\",\"丝\",\"协\",\"诉\",\"念\",\"陈\",\"仍\",\"罗\",\"盐\",\"友\",\"洋\",\"错\",\"苦\",\"夜\",\"刑\",\"移\",\"频\",\"逐\",\"靠\",\"混\",\"母\",\"短\",\"皮\",\"终\",\"聚\",\"汽\",\"村\",\"云\",\"哪\",\"既\",\"距\",\"卫\",\"停\",\"烈\",\"央\",\"察\",\"烧\",\"迅\",\"境\",\"若\",\"印\",\"洲\",\"刻\",\"括\",\"激\",\"孔\",\"搞\",\"甚\",\"室\",\"待\",\"核\",\"校\",\"散\",\"侵\",\"吧\",\"甲\",\"游\",\"久\",\"菜\",\"味\",\"旧\",\"模\",\"湖\",\"货\",\"损\",\"预\",\"阻\",\"毫\",\"普\",\"稳\",\"乙\",\"妈\",\"植\",\"息\",\"扩\",\"银\",\"语\",\"挥\",\"酒\",\"守\",\"拿\",\"序\",\"纸\",\"医\",\"缺\",\"雨\",\"吗\",\"针\",\"刘\",\"啊\",\"急\",\"唱\",\"误\",\"训\",\"愿\",\"审\",\"附\",\"获\",\"茶\",\"鲜\",\"粮\",\"斤\",\"孩\",\"脱\",\"硫\",\"肥\",\"善\",\"龙\",\"演\",\"父\",\"渐\",\"血\",\"欢\",\"械\",\"掌\",\"歌\",\"沙\",\"刚\",\"攻\",\"谓\",\"盾\",\"讨\",\"晚\",\"粒\",\"乱\",\"燃\",\"矛\",\"乎\",\"杀\",\"药\",\"宁\",\"鲁\",\"贵\",\"钟\",\"煤\",\"读\",\"班\",\"伯\",\"香\",\"介\",\"迫\",\"句\",\"丰\",\"培\",\"握\",\"兰\",\"担\",\"弦\",\"蛋\",\"沉\",\"假\",\"穿\",\"执\",\"答\",\"乐\",\"谁\",\"顺\",\"烟\",\"缩\",\"征\",\"脸\",\"喜\",\"松\",\"脚\",\"困\",\"异\",\"免\",\"背\",\"星\",\"福\",\"买\",\"染\",\"井\",\"概\",\"慢\",\"怕\",\"磁\",\"倍\",\"祖\",\"皇\",\"促\",\"静\",\"补\",\"评\",\"翻\",\"肉\",\"践\",\"尼\",\"衣\",\"宽\",\"扬\",\"棉\",\"希\",\"伤\",\"操\",\"垂\",\"秋\",\"宜\",\"氢\",\"套\",\"督\",\"振\",\"架\",\"亮\",\"末\",\"宪\",\"庆\",\"编\",\"牛\",\"触\",\"映\",\"雷\",\"销\",\"诗\",\"座\",\"居\",\"抓\",\"裂\",\"胞\",\"呼\",\"娘\",\"景\",\"威\",\"绿\",\"晶\",\"厚\",\"盟\",\"衡\",\"鸡\",\"孙\",\"延\",\"危\",\"胶\",\"屋\",\"乡\",\"临\",\"陆\",\"顾\",\"掉\",\"呀\",\"灯\",\"岁\",\"措\",\"束\",\"耐\",\"剧\",\"玉\",\"赵\",\"跳\",\"哥\",\"季\",\"课\",\"凯\",\"胡\",\"额\",\"款\",\"绍\",\"卷\",\"齐\",\"伟\",\"蒸\",\"殖\",\"永\",\"宗\",\"苗\",\"川\",\"炉\",\"岩\",\"弱\",\"零\",\"杨\",\"奏\",\"沿\",\"露\",\"杆\",\"探\",\"滑\",\"镇\",\"饭\",\"浓\",\"航\",\"怀\",\"赶\",\"库\",\"夺\",\"伊\",\"灵\",\"税\",\"途\",\"灭\",\"赛\",\"归\",\"召\",\"鼓\",\"播\",\"盘\",\"裁\",\"险\",\"康\",\"唯\",\"录\",\"菌\",\"纯\",\"借\",\"糖\",\"盖\",\"横\",\"符\",\"私\",\"努\",\"堂\",\"域\",\"枪\",\"润\",\"幅\",\"哈\",\"竟\",\"熟\",\"虫\",\"泽\",\"脑\",\"壤\",\"碳\",\"欧\",\"遍\",\"侧\",\"寨\",\"敢\",\"彻\",\"虑\",\"斜\",\"薄\",\"庭\",\"纳\",\"弹\",\"饲\",\"伸\",\"折\",\"麦\",\"湿\",\"暗\",\"荷\",\"瓦\",\"塞\",\"床\",\"筑\",\"恶\",\"户\",\"访\",\"塔\",\"奇\",\"透\",\"梁\",\"刀\",\"旋\",\"迹\",\"卡\",\"氯\",\"遇\",\"份\",\"毒\",\"泥\",\"退\",\"洗\",\"摆\",\"灰\",\"彩\",\"卖\",\"耗\",\"夏\",\"择\",\"忙\",\"铜\",\"献\",\"硬\",\"予\",\"繁\",\"圈\",\"雪\",\"函\",\"亦\",\"抽\",\"篇\",\"阵\",\"阴\",\"丁\",\"尺\",\"追\",\"堆\",\"雄\",\"迎\",\"泛\",\"爸\",\"楼\",\"避\",\"谋\",\"吨\",\"野\",\"猪\",\"旗\",\"累\",\"偏\",\"典\",\"馆\",\"索\",\"秦\",\"脂\",\"潮\",\"爷\",\"豆\",\"忽\",\"托\",\"惊\",\"塑\",\"遗\",\"愈\",\"朱\",\"替\",\"纤\",\"粗\",\"倾\",\"尚\",\"痛\",\"楚\",\"谢\",\"奋\",\"购\",\"磨\",\"君\",\"池\",\"旁\",\"碎\",\"骨\",\"监\",\"捕\",\"弟\",\"暴\",\"割\",\"贯\",\"殊\",\"释\",\"词\",\"亡\",\"壁\",\"顿\",\"宝\",\"午\",\"尘\",\"闻\",\"揭\",\"炮\",\"残\",\"冬\",\"桥\",\"妇\",\"警\",\"综\",\"招\",\"吴\",\"付\",\"浮\",\"遭\",\"徐\",\"您\",\"摇\",\"谷\",\"赞\",\"箱\",\"隔\",\"订\",\"男\",\"吹\",\"园\",\"纷\",\"唐\",\"败\",\"宋\",\"玻\",\"巨\",\"耕\",\"坦\",\"荣\",\"闭\",\"湾\",\"键\",\"凡\",\"驻\",\"锅\",\"救\",\"恩\",\"剥\",\"凝\",\"碱\",\"齿\",\"截\",\"炼\",\"麻\",\"纺\",\"禁\",\"废\",\"盛\",\"版\",\"缓\",\"净\",\"睛\",\"昌\",\"婚\",\"涉\",\"筒\",\"嘴\",\"插\",\"岸\",\"朗\",\"庄\",\"街\",\"藏\",\"姑\",\"贸\",\"腐\",\"奴\",\"啦\",\"惯\",\"乘\",\"伙\",\"恢\",\"匀\",\"纱\",\"扎\",\"辩\",\"耳\",\"彪\",\"臣\",\"亿\",\"璃\",\"抵\",\"脉\",\"秀\",\"萨\",\"俄\",\"网\",\"舞\",\"店\",\"喷\",\"纵\",\"寸\",\"汗\",\"挂\",\"洪\",\"贺\",\"闪\",\"柬\",\"爆\",\"烯\",\"津\",\"稻\",\"墙\",\"软\",\"勇\",\"像\",\"滚\",\"厘\",\"蒙\",\"芳\",\"肯\",\"坡\",\"柱\",\"荡\",\"腿\",\"仪\",\"旅\",\"尾\",\"轧\",\"冰\",\"贡\",\"登\",\"黎\",\"削\",\"钻\",\"勒\",\"逃\",\"障\",\"氨\",\"郭\",\"峰\",\"币\",\"港\",\"伏\",\"轨\",\"亩\",\"毕\",\"擦\",\"莫\",\"刺\",\"浪\",\"秘\",\"援\",\"株\",\"健\",\"售\",\"股\",\"岛\",\"甘\",\"泡\",\"睡\",\"童\",\"铸\",\"汤\",\"阀\",\"休\",\"汇\",\"舍\",\"牧\",\"绕\",\"炸\",\"哲\",\"磷\",\"绩\",\"朋\",\"淡\",\"尖\",\"启\",\"陷\",\"柴\",\"呈\",\"徒\",\"颜\",\"泪\",\"稍\",\"忘\",\"泵\",\"蓝\",\"拖\",\"洞\",\"授\",\"镜\",\"辛\",\"壮\",\"锋\",\"贫\",\"虚\",\"弯\",\"摩\",\"泰\",\"幼\",\"廷\",\"尊\",\"窗\",\"纲\",\"弄\",\"隶\",\"疑\",\"氏\",\"宫\",\"姐\",\"震\",\"瑞\",\"怪\",\"尤\",\"琴\",\"循\",\"描\",\"膜\",\"违\",\"夹\",\"腰\",\"缘\",\"珠\",\"穷\",\"森\",\"枝\",\"竹\",\"沟\",\"催\",\"绳\",\"忆\",\"邦\",\"剩\",\"幸\",\"浆\",\"栏\",\"拥\",\"牙\",\"贮\",\"礼\",\"滤\",\"钠\",\"纹\",\"罢\",\"拍\",\"咱\",\"喊\",\"袖\",\"埃\",\"勤\",\"罚\",\"焦\",\"潜\",\"伍\",\"墨\",\"欲\",\"缝\",\"姓\",\"刊\",\"饱\",\"仿\",\"奖\",\"铝\",\"鬼\",\"丽\",\"跨\",\"默\",\"挖\",\"链\",\"扫\",\"喝\",\"袋\",\"炭\",\"污\",\"幕\",\"诸\",\"弧\",\"励\",\"梅\",\"奶\",\"洁\",\"灾\",\"舟\",\"鉴\",\"苯\",\"讼\",\"抱\",\"毁\",\"懂\",\"寒\",\"智\",\"埔\",\"寄\",\"届\",\"跃\",\"渡\",\"挑\",\"丹\",\"艰\",\"贝\",\"碰\",\"拔\",\"爹\",\"戴\",\"码\",\"梦\",\"芽\",\"熔\",\"赤\",\"渔\",\"哭\",\"敬\",\"颗\",\"奔\",\"铅\",\"仲\",\"虎\",\"稀\",\"妹\",\"乏\",\"珍\",\"申\",\"桌\",\"遵\",\"允\",\"隆\",\"螺\",\"仓\",\"魏\",\"锐\",\"晓\",\"氮\",\"兼\",\"隐\",\"碍\",\"赫\",\"拨\",\"忠\",\"肃\",\"缸\",\"牵\",\"抢\",\"博\",\"巧\",\"壳\",\"兄\",\"杜\",\"讯\",\"诚\",\"碧\",\"祥\",\"柯\",\"页\",\"巡\",\"矩\",\"悲\",\"灌\",\"龄\",\"伦\",\"票\",\"寻\",\"桂\",\"铺\",\"圣\",\"恐\",\"恰\",\"郑\",\"趣\",\"抬\",\"荒\",\"腾\",\"贴\",\"柔\",\"滴\",\"猛\",\"阔\",\"辆\",\"妻\",\"填\",\"撤\",\"储\",\"签\",\"闹\",\"扰\",\"紫\",\"砂\",\"递\",\"戏\",\"吊\",\"陶\",\"伐\",\"喂\",\"疗\",\"瓶\",\"婆\",\"抚\",\"臂\",\"摸\",\"忍\",\"虾\",\"蜡\",\"邻\",\"胸\",\"巩\",\"挤\",\"偶\",\"弃\",\"槽\",\"劲\",\"乳\",\"邓\",\"吉\",\"仁\",\"烂\",\"砖\",\"租\",\"乌\",\"舰\",\"伴\",\"瓜\",\"浅\",\"丙\",\"暂\",\"燥\",\"橡\",\"柳\",\"迷\",\"暖\",\"牌\",\"秧\",\"胆\",\"详\",\"簧\",\"踏\",\"瓷\",\"谱\",\"呆\",\"宾\",\"糊\",\"洛\",\"辉\",\"愤\",\"竞\",\"隙\",\"怒\",\"粘\",\"乃\",\"绪\",\"肩\",\"籍\",\"敏\",\"涂\",\"熙\",\"皆\",\"侦\",\"悬\",\"掘\",\"享\",\"纠\",\"醒\",\"狂\",\"锁\",\"淀\",\"恨\",\"牲\",\"霸\",\"爬\",\"赏\",\"逆\",\"玩\",\"陵\",\"祝\",\"秒\",\"浙\",\"貌\",\"役\",\"彼\",\"悉\",\"鸭\",\"趋\",\"凤\",\"晨\",\"畜\",\"辈\",\"秩\",\"卵\",\"署\",\"梯\",\"炎\",\"滩\",\"棋\",\"驱\",\"筛\",\"峡\",\"冒\",\"啥\",\"寿\",\"译\",\"浸\",\"泉\",\"帽\",\"迟\",\"硅\",\"疆\",\"贷\",\"漏\",\"稿\",\"冠\",\"嫩\",\"胁\",\"芯\",\"牢\",\"叛\",\"蚀\",\"奥\",\"鸣\",\"岭\",\"羊\",\"凭\",\"串\",\"塘\",\"绘\",\"酵\",\"融\",\"盆\",\"锡\",\"庙\",\"筹\",\"冻\",\"辅\",\"摄\",\"袭\",\"筋\",\"拒\",\"僚\",\"旱\",\"钾\",\"鸟\",\"漆\",\"沈\",\"眉\",\"疏\",\"添\",\"棒\",\"穗\",\"硝\",\"韩\",\"逼\",\"扭\",\"侨\",\"凉\",\"挺\",\"碗\",\"栽\",\"炒\",\"杯\",\"患\",\"馏\",\"劝\",\"豪\",\"辽\",\"勃\",\"鸿\",\"旦\",\"吏\",\"拜\",\"狗\",\"埋\",\"辊\",\"掩\",\"饮\",\"搬\",\"骂\",\"辞\",\"勾\",\"扣\",\"估\",\"蒋\",\"绒\",\"雾\",\"丈\",\"朵\",\"姆\",\"拟\",\"宇\",\"辑\",\"陕\",\"雕\",\"偿\",\"蓄\",\"崇\",\"剪\",\"倡\",\"厅\",\"咬\",\"驶\",\"薯\",\"刷\",\"斥\",\"番\",\"赋\",\"奉\",\"佛\",\"浇\",\"漫\",\"曼\",\"扇\",\"钙\",\"桃\",\"扶\",\"仔\",\"返\",\"俗\",\"亏\",\"腔\",\"鞋\",\"棱\",\"覆\",\"框\",\"悄\",\"叔\",\"撞\",\"骗\",\"勘\",\"旺\",\"沸\",\"孤\",\"吐\",\"孟\",\"渠\",\"屈\",\"疾\",\"妙\",\"惜\",\"仰\",\"狠\",\"胀\",\"谐\",\"抛\",\"霉\",\"桑\",\"岗\",\"嘛\",\"衰\",\"盗\",\"渗\",\"脏\",\"赖\",\"涌\",\"甜\",\"曹\",\"阅\",\"肌\",\"哩\",\"厉\",\"烃\",\"纬\",\"毅\",\"昨\",\"伪\",\"症\",\"煮\",\"叹\",\"钉\",\"搭\",\"茎\",\"笼\",\"酷\",\"偷\",\"弓\",\"锥\",\"恒\",\"杰\",\"坑\",\"鼻\",\"翼\",\"纶\",\"叙\",\"狱\",\"逮\",\"罐\",\"络\",\"棚\",\"抑\",\"膨\",\"蔬\",\"寺\",\"骤\",\"穆\",\"冶\",\"枯\",\"册\",\"尸\",\"凸\",\"绅\",\"坯\",\"牺\",\"焰\",\"轰\",\"欣\",\"晋\",\"瘦\",\"御\",\"锭\",\"锦\",\"丧\",\"旬\",\"锻\",\"垄\",\"搜\",\"扑\",\"邀\",\"亭\",\"酯\",\"迈\",\"舒\",\"脆\",\"酶\",\"闲\",\"忧\",\"酚\",\"顽\",\"羽\",\"涨\",\"卸\",\"仗\",\"陪\",\"辟\",\"惩\",\"杭\",\"姚\",\"肚\",\"捉\",\"飘\",\"漂\",\"昆\",\"欺\",\"吾\",\"郎\",\"烷\",\"汁\",\"呵\",\"饰\",\"萧\",\"雅\",\"邮\",\"迁\",\"燕\",\"撒\",\"姻\",\"赴\",\"宴\",\"烦\",\"债\",\"帐\",\"斑\",\"铃\",\"旨\",\"醇\",\"董\",\"饼\",\"雏\",\"姿\",\"拌\",\"傅\",\"腹\",\"妥\",\"揉\",\"贤\",\"拆\",\"歪\",\"葡\",\"胺\",\"丢\",\"浩\",\"徽\",\"昂\",\"垫\",\"挡\",\"览\",\"贪\",\"慰\",\"缴\",\"汪\",\"慌\",\"冯\",\"诺\",\"姜\",\"谊\",\"凶\",\"劣\",\"诬\",\"耀\",\"昏\",\"躺\",\"盈\",\"骑\",\"乔\",\"溪\",\"丛\",\"卢\",\"抹\",\"闷\",\"咨\",\"刮\",\"驾\",\"缆\",\"悟\",\"摘\",\"铒\",\"掷\",\"颇\",\"幻\",\"柄\",\"惠\",\"惨\",\"佳\",\"仇\",\"腊\",\"窝\",\"涤\",\"剑\",\"瞧\",\"堡\",\"泼\",\"葱\",\"罩\",\"霍\",\"捞\",\"胎\",\"苍\",\"滨\",\"俩\",\"捅\",\"湘\",\"砍\",\"霞\",\"邵\",\"萄\",\"疯\",\"淮\",\"遂\",\"熊\",\"粪\",\"烘\",\"宿\",\"档\",\"戈\",\"驳\",\"嫂\",\"裕\",\"徙\",\"箭\",\"捐\",\"肠\",\"撑\",\"晒\",\"辨\",\"殿\",\"莲\",\"摊\",\"搅\",\"酱\",\"屏\",\"疫\",\"哀\",\"蔡\",\"堵\",\"沫\",\"皱\",\"畅\",\"叠\",\"阁\",\"莱\",\"敲\",\"辖\",\"钩\",\"痕\",\"坝\",\"巷\",\"饿\",\"祸\",\"丘\",\"玄\",\"溜\",\"曰\",\"逻\",\"彭\",\"尝\",\"卿\",\"妨\",\"艇\",\"吞\",\"韦\",\"怨\",\"矮\",\"歇\"][\"的\",\"一\",\"是\",\"在\",\"不\",\"了\",\"有\",\"和\",\"人\",\"這\",\"中\",\"大\",\"為\",\"上\",\"個\",\"國\",\"我\",\"以\",\"要\",\"他\",\"時\",\"來\",\"用\",\"們\",\"生\",\"到\",\"作\",\"地\",\"於\",\"出\",\"就\",\"分\",\"對\",\"成\",\"會\",\"可\",\"主\",\"發\",\"年\",\"動\",\"同\",\"工\",\"也\",\"能\",\"下\",\"過\",\"子\",\"說\",\"產\",\"種\",\"面\",\"而\",\"方\",\"後\",\"多\",\"定\",\"行\",\"學\",\"法\",\"所\",\"民\",\"得\",\"經\",\"十\",\"三\",\"之\",\"進\",\"著\",\"等\",\"部\",\"度\",\"家\",\"電\",\"力\",\"裡\",\"如\",\"水\",\"化\",\"高\",\"自\",\"二\",\"理\",\"起\",\"小\",\"物\",\"現\",\"實\",\"加\",\"量\",\"都\",\"兩\",\"體\",\"制\",\"機\",\"當\",\"使\",\"點\",\"從\",\"業\",\"本\",\"去\",\"把\",\"性\",\"好\",\"應\",\"開\",\"它\",\"合\",\"還\",\"因\",\"由\",\"其\",\"些\",\"然\",\"前\",\"外\",\"天\",\"政\",\"四\",\"日\",\"那\",\"社\",\"義\",\"事\",\"平\",\"形\",\"相\",\"全\",\"表\",\"間\",\"樣\",\"與\",\"關\",\"各\",\"重\",\"新\",\"線\",\"內\",\"數\",\"正\",\"心\",\"反\",\"你\",\"明\",\"看\",\"原\",\"又\",\"麼\",\"利\",\"比\",\"或\",\"但\",\"質\",\"氣\",\"第\",\"向\",\"道\",\"命\",\"此\",\"變\",\"條\",\"只\",\"沒\",\"結\",\"解\",\"問\",\"意\",\"建\",\"月\",\"公\",\"無\",\"系\",\"軍\",\"很\",\"情\",\"者\",\"最\",\"立\",\"代\",\"想\",\"已\",\"通\",\"並\",\"提\",\"直\",\"題\",\"黨\",\"程\",\"展\",\"五\",\"果\",\"料\",\"象\",\"員\",\"革\",\"位\",\"入\",\"常\",\"文\",\"總\",\"次\",\"品\",\"式\",\"活\",\"設\",\"及\",\"管\",\"特\",\"件\",\"長\",\"求\",\"老\",\"頭\",\"基\",\"資\",\"邊\",\"流\",\"路\",\"級\",\"少\",\"圖\",\"山\",\"統\",\"接\",\"知\",\"較\",\"將\",\"組\",\"見\",\"計\",\"別\",\"她\",\"手\",\"角\",\"期\",\"根\",\"論\",\"運\",\"農\",\"指\",\"幾\",\"九\",\"區\",\"強\",\"放\",\"決\",\"西\",\"被\",\"幹\",\"做\",\"必\",\"戰\",\"先\",\"回\",\"則\",\"任\",\"取\",\"據\",\"處\",\"隊\",\"南\",\"給\",\"色\",\"光\",\"門\",\"即\",\"保\",\"治\",\"北\",\"造\",\"百\",\"規\",\"熱\",\"領\",\"七\",\"海\",\"口\",\"東\",\"導\",\"器\",\"壓\",\"志\",\"世\",\"金\",\"增\",\"爭\",\"濟\",\"階\",\"油\",\"思\",\"術\",\"極\",\"交\",\"受\",\"聯\",\"什\",\"認\",\"六\",\"共\",\"權\",\"收\",\"證\",\"改\",\"清\",\"美\",\"再\",\"採\",\"轉\",\"更\",\"單\",\"風\",\"切\",\"打\",\"白\",\"教\",\"速\",\"花\",\"帶\",\"安\",\"場\",\"身\",\"車\",\"例\",\"真\",\"務\",\"具\",\"萬\",\"每\",\"目\",\"至\",\"達\",\"走\",\"積\",\"示\",\"議\",\"聲\",\"報\",\"鬥\",\"完\",\"類\",\"八\",\"離\",\"華\",\"名\",\"確\",\"才\",\"科\",\"張\",\"信\",\"馬\",\"節\",\"話\",\"米\",\"整\",\"空\",\"元\",\"況\",\"今\",\"集\",\"溫\",\"傳\",\"土\",\"許\",\"步\",\"群\",\"廣\",\"石\",\"記\",\"需\",\"段\",\"研\",\"界\",\"拉\",\"林\",\"律\",\"叫\",\"且\",\"究\",\"觀\",\"越\",\"織\",\"裝\",\"影\",\"算\",\"低\",\"持\",\"音\",\"眾\",\"書\",\"布\",\"复\",\"容\",\"兒\",\"須\",\"際\",\"商\",\"非\",\"驗\",\"連\",\"斷\",\"深\",\"難\",\"近\",\"礦\",\"千\",\"週\",\"委\",\"素\",\"技\",\"備\",\"半\",\"辦\",\"青\",\"省\",\"列\",\"習\",\"響\",\"約\",\"支\",\"般\",\"史\",\"感\",\"勞\",\"便\",\"團\",\"往\",\"酸\",\"歷\",\"市\",\"克\",\"何\",\"除\",\"消\",\"構\",\"府\",\"稱\",\"太\",\"準\",\"精\",\"值\",\"號\",\"率\",\"族\",\"維\",\"劃\",\"選\",\"標\",\"寫\",\"存\",\"候\",\"毛\",\"親\",\"快\",\"效\",\"斯\",\"院\",\"查\",\"江\",\"型\",\"眼\",\"王\",\"按\",\"格\",\"養\",\"易\",\"置\",\"派\",\"層\",\"片\",\"始\",\"卻\",\"專\",\"狀\",\"育\",\"廠\",\"京\",\"識\",\"適\",\"屬\",\"圓\",\"包\",\"火\",\"住\",\"調\",\"滿\",\"縣\",\"局\",\"照\",\"參\",\"紅\",\"細\",\"引\",\"聽\",\"該\",\"鐵\",\"價\",\"嚴\",\"首\",\"底\",\"液\",\"官\",\"德\",\"隨\",\"病\",\"蘇\",\"失\",\"爾\",\"死\",\"講\",\"配\",\"女\",\"黃\",\"推\",\"顯\",\"談\",\"罪\",\"神\",\"藝\",\"呢\",\"席\",\"含\",\"企\",\"望\",\"密\",\"批\",\"營\",\"項\",\"防\",\"舉\",\"球\",\"英\",\"氧\",\"勢\",\"告\",\"李\",\"台\",\"落\",\"木\",\"幫\",\"輪\",\"破\",\"亞\",\"師\",\"圍\",\"注\",\"遠\",\"字\",\"材\",\"排\",\"供\",\"河\",\"態\",\"封\",\"另\",\"施\",\"減\",\"樹\",\"溶\",\"怎\",\"止\",\"案\",\"言\",\"士\",\"均\",\"武\",\"固\",\"葉\",\"魚\",\"波\",\"視\",\"僅\",\"費\",\"緊\",\"愛\",\"左\",\"章\",\"早\",\"朝\",\"害\",\"續\",\"輕\",\"服\",\"試\",\"食\",\"充\",\"兵\",\"源\",\"判\",\"護\",\"司\",\"足\",\"某\",\"練\",\"差\",\"致\",\"板\",\"田\",\"降\",\"黑\",\"犯\",\"負\",\"擊\",\"范\",\"繼\",\"興\",\"似\",\"餘\",\"堅\",\"曲\",\"輸\",\"修\",\"故\",\"城\",\"夫\",\"夠\",\"送\",\"筆\",\"船\",\"佔\",\"右\",\"財\",\"吃\",\"富\",\"春\",\"職\",\"覺\",\"漢\",\"畫\",\"功\",\"巴\",\"跟\",\"雖\",\"雜\",\"飛\",\"檢\",\"吸\",\"助\",\"昇\",\"陽\",\"互\",\"初\",\"創\",\"抗\",\"考\",\"投\",\"壞\",\"策\",\"古\",\"徑\",\"換\",\"未\",\"跑\",\"留\",\"鋼\",\"曾\",\"端\",\"責\",\"站\",\"簡\",\"述\",\"錢\",\"副\",\"盡\",\"帝\",\"射\",\"草\",\"衝\",\"承\",\"獨\",\"令\",\"限\",\"阿\",\"宣\",\"環\",\"雙\",\"請\",\"超\",\"微\",\"讓\",\"控\",\"州\",\"良\",\"軸\",\"找\",\"否\",\"紀\",\"益\",\"依\",\"優\",\"頂\",\"礎\",\"載\",\"倒\",\"房\",\"突\",\"坐\",\"粉\",\"敵\",\"略\",\"客\",\"袁\",\"冷\",\"勝\",\"絕\",\"析\",\"塊\",\"劑\",\"測\",\"絲\",\"協\",\"訴\",\"念\",\"陳\",\"仍\",\"羅\",\"鹽\",\"友\",\"洋\",\"錯\",\"苦\",\"夜\",\"刑\",\"移\",\"頻\",\"逐\",\"靠\",\"混\",\"母\",\"短\",\"皮\",\"終\",\"聚\",\"汽\",\"村\",\"雲\",\"哪\",\"既\",\"距\",\"衛\",\"停\",\"烈\",\"央\",\"察\",\"燒\",\"迅\",\"境\",\"若\",\"印\",\"洲\",\"刻\",\"括\",\"激\",\"孔\",\"搞\",\"甚\",\"室\",\"待\",\"核\",\"校\",\"散\",\"侵\",\"吧\",\"甲\",\"遊\",\"久\",\"菜\",\"味\",\"舊\",\"模\",\"湖\",\"貨\",\"損\",\"預\",\"阻\",\"毫\",\"普\",\"穩\",\"乙\",\"媽\",\"植\",\"息\",\"擴\",\"銀\",\"語\",\"揮\",\"酒\",\"守\",\"拿\",\"序\",\"紙\",\"醫\",\"缺\",\"雨\",\"嗎\",\"針\",\"劉\",\"啊\",\"急\",\"唱\",\"誤\",\"訓\",\"願\",\"審\",\"附\",\"獲\",\"茶\",\"鮮\",\"糧\",\"斤\",\"孩\",\"脫\",\"硫\",\"肥\",\"善\",\"龍\",\"演\",\"父\",\"漸\",\"血\",\"歡\",\"械\",\"掌\",\"歌\",\"沙\",\"剛\",\"攻\",\"謂\",\"盾\",\"討\",\"晚\",\"粒\",\"亂\",\"燃\",\"矛\",\"乎\",\"殺\",\"藥\",\"寧\",\"魯\",\"貴\",\"鐘\",\"煤\",\"讀\",\"班\",\"伯\",\"香\",\"介\",\"迫\",\"句\",\"豐\",\"培\",\"握\",\"蘭\",\"擔\",\"弦\",\"蛋\",\"沉\",\"假\",\"穿\",\"執\",\"答\",\"樂\",\"誰\",\"順\",\"煙\",\"縮\",\"徵\",\"臉\",\"喜\",\"松\",\"腳\",\"困\",\"異\",\"免\",\"背\",\"星\",\"福\",\"買\",\"染\",\"井\",\"概\",\"慢\",\"怕\",\"磁\",\"倍\",\"祖\",\"皇\",\"促\",\"靜\",\"補\",\"評\",\"翻\",\"肉\",\"踐\",\"尼\",\"衣\",\"寬\",\"揚\",\"棉\",\"希\",\"傷\",\"操\",\"垂\",\"秋\",\"宜\",\"氫\",\"套\",\"督\",\"振\",\"架\",\"亮\",\"末\",\"憲\",\"慶\",\"編\",\"牛\",\"觸\",\"映\",\"雷\",\"銷\",\"詩\",\"座\",\"居\",\"抓\",\"裂\",\"胞\",\"呼\",\"娘\",\"景\",\"威\",\"綠\",\"晶\",\"厚\",\"盟\",\"衡\",\"雞\",\"孫\",\"延\",\"危\",\"膠\",\"屋\",\"鄉\",\"臨\",\"陸\",\"顧\",\"掉\",\"呀\",\"燈\",\"歲\",\"措\",\"束\",\"耐\",\"劇\",\"玉\",\"趙\",\"跳\",\"哥\",\"季\",\"課\",\"凱\",\"胡\",\"額\",\"款\",\"紹\",\"卷\",\"齊\",\"偉\",\"蒸\",\"殖\",\"永\",\"宗\",\"苗\",\"川\",\"爐\",\"岩\",\"弱\",\"零\",\"楊\",\"奏\",\"沿\",\"露\",\"桿\",\"探\",\"滑\",\"鎮\",\"飯\",\"濃\",\"航\",\"懷\",\"趕\",\"庫\",\"奪\",\"伊\",\"靈\",\"稅\",\"途\",\"滅\",\"賽\",\"歸\",\"召\",\"鼓\",\"播\",\"盤\",\"裁\",\"險\",\"康\",\"唯\",\"錄\",\"菌\",\"純\",\"借\",\"糖\",\"蓋\",\"橫\",\"符\",\"私\",\"努\",\"堂\",\"域\",\"槍\",\"潤\",\"幅\",\"哈\",\"竟\",\"熟\",\"蟲\",\"澤\",\"腦\",\"壤\",\"碳\",\"歐\",\"遍\",\"側\",\"寨\",\"敢\",\"徹\",\"慮\",\"斜\",\"薄\",\"庭\",\"納\",\"彈\",\"飼\",\"伸\",\"折\",\"麥\",\"濕\",\"暗\",\"荷\",\"瓦\",\"塞\",\"床\",\"築\",\"惡\",\"戶\",\"訪\",\"塔\",\"奇\",\"透\",\"梁\",\"刀\",\"旋\",\"跡\",\"卡\",\"氯\",\"遇\",\"份\",\"毒\",\"泥\",\"退\",\"洗\",\"擺\",\"灰\",\"彩\",\"賣\",\"耗\",\"夏\",\"擇\",\"忙\",\"銅\",\"獻\",\"硬\",\"予\",\"繁\",\"圈\",\"雪\",\"函\",\"亦\",\"抽\",\"篇\",\"陣\",\"陰\",\"丁\",\"尺\",\"追\",\"堆\",\"雄\",\"迎\",\"泛\",\"爸\",\"樓\",\"避\",\"謀\",\"噸\",\"野\",\"豬\",\"旗\",\"累\",\"偏\",\"典\",\"館\",\"索\",\"秦\",\"脂\",\"潮\",\"爺\",\"豆\",\"忽\",\"托\",\"驚\",\"塑\",\"遺\",\"愈\",\"朱\",\"替\",\"纖\",\"粗\",\"傾\",\"尚\",\"痛\",\"楚\",\"謝\",\"奮\",\"購\",\"磨\",\"君\",\"池\",\"旁\",\"碎\",\"骨\",\"監\",\"捕\",\"弟\",\"暴\",\"割\",\"貫\",\"殊\",\"釋\",\"詞\",\"亡\",\"壁\",\"頓\",\"寶\",\"午\",\"塵\",\"聞\",\"揭\",\"炮\",\"殘\",\"冬\",\"橋\",\"婦\",\"警\",\"綜\",\"招\",\"吳\",\"付\",\"浮\",\"遭\",\"徐\",\"您\",\"搖\",\"谷\",\"贊\",\"箱\",\"隔\",\"訂\",\"男\",\"吹\",\"園\",\"紛\",\"唐\",\"敗\",\"宋\",\"玻\",\"巨\",\"耕\",\"坦\",\"榮\",\"閉\",\"灣\",\"鍵\",\"凡\",\"駐\",\"鍋\",\"救\",\"恩\",\"剝\",\"凝\",\"鹼\",\"齒\",\"截\",\"煉\",\"麻\",\"紡\",\"禁\",\"廢\",\"盛\",\"版\",\"緩\",\"淨\",\"睛\",\"昌\",\"婚\",\"涉\",\"筒\",\"嘴\",\"插\",\"岸\",\"朗\",\"莊\",\"街\",\"藏\",\"姑\",\"貿\",\"腐\",\"奴\",\"啦\",\"慣\",\"乘\",\"夥\",\"恢\",\"勻\",\"紗\",\"扎\",\"辯\",\"耳\",\"彪\",\"臣\",\"億\",\"璃\",\"抵\",\"脈\",\"秀\",\"薩\",\"俄\",\"網\",\"舞\",\"店\",\"噴\",\"縱\",\"寸\",\"汗\",\"掛\",\"洪\",\"賀\",\"閃\",\"柬\",\"爆\",\"烯\",\"津\",\"稻\",\"牆\",\"軟\",\"勇\",\"像\",\"滾\",\"厘\",\"蒙\",\"芳\",\"肯\",\"坡\",\"柱\",\"盪\",\"腿\",\"儀\",\"旅\",\"尾\",\"軋\",\"冰\",\"貢\",\"登\",\"黎\",\"削\",\"鑽\",\"勒\",\"逃\",\"障\",\"氨\",\"郭\",\"峰\",\"幣\",\"港\",\"伏\",\"軌\",\"畝\",\"畢\",\"擦\",\"莫\",\"刺\",\"浪\",\"秘\",\"援\",\"株\",\"健\",\"售\",\"股\",\"島\",\"甘\",\"泡\",\"睡\",\"童\",\"鑄\",\"湯\",\"閥\",\"休\",\"匯\",\"舍\",\"牧\",\"繞\",\"炸\",\"哲\",\"磷\",\"績\",\"朋\",\"淡\",\"尖\",\"啟\",\"陷\",\"柴\",\"呈\",\"徒\",\"顏\",\"淚\",\"稍\",\"忘\",\"泵\",\"藍\",\"拖\",\"洞\",\"授\",\"鏡\",\"辛\",\"壯\",\"鋒\",\"貧\",\"虛\",\"彎\",\"摩\",\"泰\",\"幼\",\"廷\",\"尊\",\"窗\",\"綱\",\"弄\",\"隸\",\"疑\",\"氏\",\"宮\",\"姐\",\"震\",\"瑞\",\"怪\",\"尤\",\"琴\",\"循\",\"描\",\"膜\",\"違\",\"夾\",\"腰\",\"緣\",\"珠\",\"窮\",\"森\",\"枝\",\"竹\",\"溝\",\"催\",\"繩\",\"憶\",\"邦\",\"剩\",\"幸\",\"漿\",\"欄\",\"擁\",\"牙\",\"貯\",\"禮\",\"濾\",\"鈉\",\"紋\",\"罷\",\"拍\",\"咱\",\"喊\",\"袖\",\"埃\",\"勤\",\"罰\",\"焦\",\"潛\",\"伍\",\"墨\",\"欲\",\"縫\",\"姓\",\"刊\",\"飽\",\"仿\",\"獎\",\"鋁\",\"鬼\",\"麗\",\"跨\",\"默\",\"挖\",\"鏈\",\"掃\",\"喝\",\"袋\",\"炭\",\"污\",\"幕\",\"諸\",\"弧\",\"勵\",\"梅\",\"奶\",\"潔\",\"災\",\"舟\",\"鑑\",\"苯\",\"訟\",\"抱\",\"毀\",\"懂\",\"寒\",\"智\",\"埔\",\"寄\",\"屆\",\"躍\",\"渡\",\"挑\",\"丹\",\"艱\",\"貝\",\"碰\",\"拔\",\"爹\",\"戴\",\"碼\",\"夢\",\"芽\",\"熔\",\"赤\",\"漁\",\"哭\",\"敬\",\"顆\",\"奔\",\"鉛\",\"仲\",\"虎\",\"稀\",\"妹\",\"乏\",\"珍\",\"申\",\"桌\",\"遵\",\"允\",\"隆\",\"螺\",\"倉\",\"魏\",\"銳\",\"曉\",\"氮\",\"兼\",\"隱\",\"礙\",\"赫\",\"撥\",\"忠\",\"肅\",\"缸\",\"牽\",\"搶\",\"博\",\"巧\",\"殼\",\"兄\",\"杜\",\"訊\",\"誠\",\"碧\",\"祥\",\"柯\",\"頁\",\"巡\",\"矩\",\"悲\",\"灌\",\"齡\",\"倫\",\"票\",\"尋\",\"桂\",\"鋪\",\"聖\",\"恐\",\"恰\",\"鄭\",\"趣\",\"抬\",\"荒\",\"騰\",\"貼\",\"柔\",\"滴\",\"猛\",\"闊\",\"輛\",\"妻\",\"填\",\"撤\",\"儲\",\"簽\",\"鬧\",\"擾\",\"紫\",\"砂\",\"遞\",\"戲\",\"吊\",\"陶\",\"伐\",\"餵\",\"療\",\"瓶\",\"婆\",\"撫\",\"臂\",\"摸\",\"忍\",\"蝦\",\"蠟\",\"鄰\",\"胸\",\"鞏\",\"擠\",\"偶\",\"棄\",\"槽\",\"勁\",\"乳\",\"鄧\",\"吉\",\"仁\",\"爛\",\"磚\",\"租\",\"烏\",\"艦\",\"伴\",\"瓜\",\"淺\",\"丙\",\"暫\",\"燥\",\"橡\",\"柳\",\"迷\",\"暖\",\"牌\",\"秧\",\"膽\",\"詳\",\"簧\",\"踏\",\"瓷\",\"譜\",\"呆\",\"賓\",\"糊\",\"洛\",\"輝\",\"憤\",\"競\",\"隙\",\"怒\",\"粘\",\"乃\",\"緒\",\"肩\",\"籍\",\"敏\",\"塗\",\"熙\",\"皆\",\"偵\",\"懸\",\"掘\",\"享\",\"糾\",\"醒\",\"狂\",\"鎖\",\"淀\",\"恨\",\"牲\",\"霸\",\"爬\",\"賞\",\"逆\",\"玩\",\"陵\",\"祝\",\"秒\",\"浙\",\"貌\",\"役\",\"彼\",\"悉\",\"鴨\",\"趨\",\"鳳\",\"晨\",\"畜\",\"輩\",\"秩\",\"卵\",\"署\",\"梯\",\"炎\",\"灘\",\"棋\",\"驅\",\"篩\",\"峽\",\"冒\",\"啥\",\"壽\",\"譯\",\"浸\",\"泉\",\"帽\",\"遲\",\"矽\",\"疆\",\"貸\",\"漏\",\"稿\",\"冠\",\"嫩\",\"脅\",\"芯\",\"牢\",\"叛\",\"蝕\",\"奧\",\"鳴\",\"嶺\",\"羊\",\"憑\",\"串\",\"塘\",\"繪\",\"酵\",\"融\",\"盆\",\"錫\",\"廟\",\"籌\",\"凍\",\"輔\",\"攝\",\"襲\",\"筋\",\"拒\",\"僚\",\"旱\",\"鉀\",\"鳥\",\"漆\",\"沈\",\"眉\",\"疏\",\"添\",\"棒\",\"穗\",\"硝\",\"韓\",\"逼\",\"扭\",\"僑\",\"涼\",\"挺\",\"碗\",\"栽\",\"炒\",\"杯\",\"患\",\"餾\",\"勸\",\"豪\",\"遼\",\"勃\",\"鴻\",\"旦\",\"吏\",\"拜\",\"狗\",\"埋\",\"輥\",\"掩\",\"飲\",\"搬\",\"罵\",\"辭\",\"勾\",\"扣\",\"估\",\"蔣\",\"絨\",\"霧\",\"丈\",\"朵\",\"姆\",\"擬\",\"宇\",\"輯\",\"陝\",\"雕\",\"償\",\"蓄\",\"崇\",\"剪\",\"倡\",\"廳\",\"咬\",\"駛\",\"薯\",\"刷\",\"斥\",\"番\",\"賦\",\"奉\",\"佛\",\"澆\",\"漫\",\"曼\",\"扇\",\"鈣\",\"桃\",\"扶\",\"仔\",\"返\",\"俗\",\"虧\",\"腔\",\"鞋\",\"棱\",\"覆\",\"框\",\"悄\",\"叔\",\"撞\",\"騙\",\"勘\",\"旺\",\"沸\",\"孤\",\"吐\",\"孟\",\"渠\",\"屈\",\"疾\",\"妙\",\"惜\",\"仰\",\"狠\",\"脹\",\"諧\",\"拋\",\"黴\",\"桑\",\"崗\",\"嘛\",\"衰\",\"盜\",\"滲\",\"臟\",\"賴\",\"湧\",\"甜\",\"曹\",\"閱\",\"肌\",\"哩\",\"厲\",\"烴\",\"緯\",\"毅\",\"昨\",\"偽\",\"症\",\"煮\",\"嘆\",\"釘\",\"搭\",\"莖\",\"籠\",\"酷\",\"偷\",\"弓\",\"錐\",\"恆\",\"傑\",\"坑\",\"鼻\",\"翼\",\"綸\",\"敘\",\"獄\",\"逮\",\"罐\",\"絡\",\"棚\",\"抑\",\"膨\",\"蔬\",\"寺\",\"驟\",\"穆\",\"冶\",\"枯\",\"冊\",\"屍\",\"凸\",\"紳\",\"坯\",\"犧\",\"焰\",\"轟\",\"欣\",\"晉\",\"瘦\",\"禦\",\"錠\",\"錦\",\"喪\",\"旬\",\"鍛\",\"壟\",\"搜\",\"撲\",\"邀\",\"亭\",\"酯\",\"邁\",\"舒\",\"脆\",\"酶\",\"閒\",\"憂\",\"酚\",\"頑\",\"羽\",\"漲\",\"卸\",\"仗\",\"陪\",\"闢\",\"懲\",\"杭\",\"姚\",\"肚\",\"捉\",\"飄\",\"漂\",\"昆\",\"欺\",\"吾\",\"郎\",\"烷\",\"汁\",\"呵\",\"飾\",\"蕭\",\"雅\",\"郵\",\"遷\",\"燕\",\"撒\",\"姻\",\"赴\",\"宴\",\"煩\",\"債\",\"帳\",\"斑\",\"鈴\",\"旨\",\"醇\",\"董\",\"餅\",\"雛\",\"姿\",\"拌\",\"傅\",\"腹\",\"妥\",\"揉\",\"賢\",\"拆\",\"歪\",\"葡\",\"胺\",\"丟\",\"浩\",\"徽\",\"昂\",\"墊\",\"擋\",\"覽\",\"貪\",\"慰\",\"繳\",\"汪\",\"慌\",\"馮\",\"諾\",\"姜\",\"誼\",\"兇\",\"劣\",\"誣\",\"耀\",\"昏\",\"躺\",\"盈\",\"騎\",\"喬\",\"溪\",\"叢\",\"盧\",\"抹\",\"悶\",\"諮\",\"刮\",\"駕\",\"纜\",\"悟\",\"摘\",\"鉺\",\"擲\",\"頗\",\"幻\",\"柄\",\"惠\",\"慘\",\"佳\",\"仇\",\"臘\",\"窩\",\"滌\",\"劍\",\"瞧\",\"堡\",\"潑\",\"蔥\",\"罩\",\"霍\",\"撈\",\"胎\",\"蒼\",\"濱\",\"倆\",\"捅\",\"湘\",\"砍\",\"霞\",\"邵\",\"萄\",\"瘋\",\"淮\",\"遂\",\"熊\",\"糞\",\"烘\",\"宿\",\"檔\",\"戈\",\"駁\",\"嫂\",\"裕\",\"徙\",\"箭\",\"捐\",\"腸\",\"撐\",\"曬\",\"辨\",\"殿\",\"蓮\",\"攤\",\"攪\",\"醬\",\"屏\",\"疫\",\"哀\",\"蔡\",\"堵\",\"沫\",\"皺\",\"暢\",\"疊\",\"閣\",\"萊\",\"敲\",\"轄\",\"鉤\",\"痕\",\"壩\",\"巷\",\"餓\",\"禍\",\"丘\",\"玄\",\"溜\",\"曰\",\"邏\",\"彭\",\"嘗\",\"卿\",\"妨\",\"艇\",\"吞\",\"韋\",\"怨\",\"矮\",\"歇\"][\"abdikace\",\"abeceda\",\"adresa\",\"agrese\",\"akce\",\"aktovka\",\"alej\",\"alkohol\",\"amputace\",\"ananas\",\"andulka\",\"anekdota\",\"anketa\",\"antika\",\"anulovat\",\"archa\",\"arogance\",\"asfalt\",\"asistent\",\"aspirace\",\"astma\",\"astronom\",\"atlas\",\"atletika\",\"atol\",\"autobus\",\"azyl\",\"babka\",\"bachor\",\"bacil\",\"baculka\",\"badatel\",\"bageta\",\"bagr\",\"bahno\",\"bakterie\",\"balada\",\"baletka\",\"balkon\",\"balonek\",\"balvan\",\"balza\",\"bambus\",\"bankomat\",\"barbar\",\"baret\",\"barman\",\"baroko\",\"barva\",\"baterka\",\"batoh\",\"bavlna\",\"bazalka\",\"bazilika\",\"bazuka\",\"bedna\",\"beran\",\"beseda\",\"bestie\",\"beton\",\"bezinka\",\"bezmoc\",\"beztak\",\"bicykl\",\"bidlo\",\"biftek\",\"bikiny\",\"bilance\",\"biograf\",\"biolog\",\"bitva\",\"bizon\",\"blahobyt\",\"blatouch\",\"blecha\",\"bledule\",\"blesk\",\"blikat\",\"blizna\",\"blokovat\",\"bloudit\",\"blud\",\"bobek\",\"bobr\",\"bodlina\",\"bodnout\",\"bohatost\",\"bojkot\",\"bojovat\",\"bokorys\",\"bolest\",\"borec\",\"borovice\",\"bota\",\"boubel\",\"bouchat\",\"bouda\",\"boule\",\"bourat\",\"boxer\",\"bradavka\",\"brambora\",\"branka\",\"bratr\",\"brepta\",\"briketa\",\"brko\",\"brloh\",\"bronz\",\"broskev\",\"brunetka\",\"brusinka\",\"brzda\",\"brzy\",\"bublina\",\"bubnovat\",\"buchta\",\"buditel\",\"budka\",\"budova\",\"bufet\",\"bujarost\",\"bukvice\",\"buldok\",\"bulva\",\"bunda\",\"bunkr\",\"burza\",\"butik\",\"buvol\",\"buzola\",\"bydlet\",\"bylina\",\"bytovka\",\"bzukot\",\"capart\",\"carevna\",\"cedr\",\"cedule\",\"cejch\",\"cejn\",\"cela\",\"celer\",\"celkem\",\"celnice\",\"cenina\",\"cennost\",\"cenovka\",\"centrum\",\"cenzor\",\"cestopis\",\"cetka\",\"chalupa\",\"chapadlo\",\"charita\",\"chata\",\"chechtat\",\"chemie\",\"chichot\",\"chirurg\",\"chlad\",\"chleba\",\"chlubit\",\"chmel\",\"chmura\",\"chobot\",\"chochol\",\"chodba\",\"cholera\",\"chomout\",\"chopit\",\"choroba\",\"chov\",\"chrapot\",\"chrlit\",\"chrt\",\"chrup\",\"chtivost\",\"chudina\",\"chutnat\",\"chvat\",\"chvilka\",\"chvost\",\"chyba\",\"chystat\",\"chytit\",\"cibule\",\"cigareta\",\"cihelna\",\"cihla\",\"cinkot\",\"cirkus\",\"cisterna\",\"citace\",\"citrus\",\"cizinec\",\"cizost\",\"clona\",\"cokoliv\",\"couvat\",\"ctitel\",\"ctnost\",\"cudnost\",\"cuketa\",\"cukr\",\"cupot\",\"cvaknout\",\"cval\",\"cvik\",\"cvrkot\",\"cyklista\",\"daleko\",\"dareba\",\"datel\",\"datum\",\"dcera\",\"debata\",\"dechovka\",\"decibel\",\"deficit\",\"deflace\",\"dekl\",\"dekret\",\"demokrat\",\"deprese\",\"derby\",\"deska\",\"detektiv\",\"dikobraz\",\"diktovat\",\"dioda\",\"diplom\",\"disk\",\"displej\",\"divadlo\",\"divoch\",\"dlaha\",\"dlouho\",\"dluhopis\",\"dnes\",\"dobro\",\"dobytek\",\"docent\",\"dochutit\",\"dodnes\",\"dohled\",\"dohoda\",\"dohra\",\"dojem\",\"dojnice\",\"doklad\",\"dokola\",\"doktor\",\"dokument\",\"dolar\",\"doleva\",\"dolina\",\"doma\",\"dominant\",\"domluvit\",\"domov\",\"donutit\",\"dopad\",\"dopis\",\"doplnit\",\"doposud\",\"doprovod\",\"dopustit\",\"dorazit\",\"dorost\",\"dort\",\"dosah\",\"doslov\",\"dostatek\",\"dosud\",\"dosyta\",\"dotaz\",\"dotek\",\"dotknout\",\"doufat\",\"doutnat\",\"dovozce\",\"dozadu\",\"doznat\",\"dozorce\",\"drahota\",\"drak\",\"dramatik\",\"dravec\",\"draze\",\"drdol\",\"drobnost\",\"drogerie\",\"drozd\",\"drsnost\",\"drtit\",\"drzost\",\"duben\",\"duchovno\",\"dudek\",\"duha\",\"duhovka\",\"dusit\",\"dusno\",\"dutost\",\"dvojice\",\"dvorec\",\"dynamit\",\"ekolog\",\"ekonomie\",\"elektron\",\"elipsa\",\"email\",\"emise\",\"emoce\",\"empatie\",\"epizoda\",\"epocha\",\"epopej\",\"epos\",\"esej\",\"esence\",\"eskorta\",\"eskymo\",\"etiketa\",\"euforie\",\"evoluce\",\"exekuce\",\"exkurze\",\"expedice\",\"exploze\",\"export\",\"extrakt\",\"facka\",\"fajfka\",\"fakulta\",\"fanatik\",\"fantazie\",\"farmacie\",\"favorit\",\"fazole\",\"federace\",\"fejeton\",\"fenka\",\"fialka\",\"figurant\",\"filozof\",\"filtr\",\"finance\",\"finta\",\"fixace\",\"fjord\",\"flanel\",\"flirt\",\"flotila\",\"fond\",\"fosfor\",\"fotbal\",\"fotka\",\"foton\",\"frakce\",\"freska\",\"fronta\",\"fukar\",\"funkce\",\"fyzika\",\"galeje\",\"garant\",\"genetika\",\"geolog\",\"gilotina\",\"glazura\",\"glejt\",\"golem\",\"golfista\",\"gotika\",\"graf\",\"gramofon\",\"granule\",\"grep\",\"gril\",\"grog\",\"groteska\",\"guma\",\"hadice\",\"hadr\",\"hala\",\"halenka\",\"hanba\",\"hanopis\",\"harfa\",\"harpuna\",\"havran\",\"hebkost\",\"hejkal\",\"hejno\",\"hejtman\",\"hektar\",\"helma\",\"hematom\",\"herec\",\"herna\",\"heslo\",\"hezky\",\"historik\",\"hladovka\",\"hlasivky\",\"hlava\",\"hledat\",\"hlen\",\"hlodavec\",\"hloh\",\"hloupost\",\"hltat\",\"hlubina\",\"hluchota\",\"hmat\",\"hmota\",\"hmyz\",\"hnis\",\"hnojivo\",\"hnout\",\"hoblina\",\"hoboj\",\"hoch\",\"hodiny\",\"hodlat\",\"hodnota\",\"hodovat\",\"hojnost\",\"hokej\",\"holinka\",\"holka\",\"holub\",\"homole\",\"honitba\",\"honorace\",\"horal\",\"horda\",\"horizont\",\"horko\",\"horlivec\",\"hormon\",\"hornina\",\"horoskop\",\"horstvo\",\"hospoda\",\"hostina\",\"hotovost\",\"houba\",\"houf\",\"houpat\",\"houska\",\"hovor\",\"hradba\",\"hranice\",\"hravost\",\"hrazda\",\"hrbolek\",\"hrdina\",\"hrdlo\",\"hrdost\",\"hrnek\",\"hrobka\",\"hromada\",\"hrot\",\"hrouda\",\"hrozen\",\"hrstka\",\"hrubost\",\"hryzat\",\"hubenost\",\"hubnout\",\"hudba\",\"hukot\",\"humr\",\"husita\",\"hustota\",\"hvozd\",\"hybnost\",\"hydrant\",\"hygiena\",\"hymna\",\"hysterik\",\"idylka\",\"ihned\",\"ikona\",\"iluze\",\"imunita\",\"infekce\",\"inflace\",\"inkaso\",\"inovace\",\"inspekce\",\"internet\",\"invalida\",\"investor\",\"inzerce\",\"ironie\",\"jablko\",\"jachta\",\"jahoda\",\"jakmile\",\"jakost\",\"jalovec\",\"jantar\",\"jarmark\",\"jaro\",\"jasan\",\"jasno\",\"jatka\",\"javor\",\"jazyk\",\"jedinec\",\"jedle\",\"jednatel\",\"jehlan\",\"jekot\",\"jelen\",\"jelito\",\"jemnost\",\"jenom\",\"jepice\",\"jeseter\",\"jevit\",\"jezdec\",\"jezero\",\"jinak\",\"jindy\",\"jinoch\",\"jiskra\",\"jistota\",\"jitrnice\",\"jizva\",\"jmenovat\",\"jogurt\",\"jurta\",\"kabaret\",\"kabel\",\"kabinet\",\"kachna\",\"kadet\",\"kadidlo\",\"kahan\",\"kajak\",\"kajuta\",\"kakao\",\"kaktus\",\"kalamita\",\"kalhoty\",\"kalibr\",\"kalnost\",\"kamera\",\"kamkoliv\",\"kamna\",\"kanibal\",\"kanoe\",\"kantor\",\"kapalina\",\"kapela\",\"kapitola\",\"kapka\",\"kaple\",\"kapota\",\"kapr\",\"kapusta\",\"kapybara\",\"karamel\",\"karotka\",\"karton\",\"kasa\",\"katalog\",\"katedra\",\"kauce\",\"kauza\",\"kavalec\",\"kazajka\",\"kazeta\",\"kazivost\",\"kdekoliv\",\"kdesi\",\"kedluben\",\"kemp\",\"keramika\",\"kino\",\"klacek\",\"kladivo\",\"klam\",\"klapot\",\"klasika\",\"klaun\",\"klec\",\"klenba\",\"klepat\",\"klesnout\",\"klid\",\"klima\",\"klisna\",\"klobouk\",\"klokan\",\"klopa\",\"kloub\",\"klubovna\",\"klusat\",\"kluzkost\",\"kmen\",\"kmitat\",\"kmotr\",\"kniha\",\"knot\",\"koalice\",\"koberec\",\"kobka\",\"kobliha\",\"kobyla\",\"kocour\",\"kohout\",\"kojenec\",\"kokos\",\"koktejl\",\"kolaps\",\"koleda\",\"kolize\",\"kolo\",\"komando\",\"kometa\",\"komik\",\"komnata\",\"komora\",\"kompas\",\"komunita\",\"konat\",\"koncept\",\"kondice\",\"konec\",\"konfese\",\"kongres\",\"konina\",\"konkurs\",\"kontakt\",\"konzerva\",\"kopanec\",\"kopie\",\"kopnout\",\"koprovka\",\"korbel\",\"korektor\",\"kormidlo\",\"koroptev\",\"korpus\",\"koruna\",\"koryto\",\"korzet\",\"kosatec\",\"kostka\",\"kotel\",\"kotleta\",\"kotoul\",\"koukat\",\"koupelna\",\"kousek\",\"kouzlo\",\"kovboj\",\"koza\",\"kozoroh\",\"krabice\",\"krach\",\"krajina\",\"kralovat\",\"krasopis\",\"kravata\",\"kredit\",\"krejcar\",\"kresba\",\"kreveta\",\"kriket\",\"kritik\",\"krize\",\"krkavec\",\"krmelec\",\"krmivo\",\"krocan\",\"krok\",\"kronika\",\"kropit\",\"kroupa\",\"krovka\",\"krtek\",\"kruhadlo\",\"krupice\",\"krutost\",\"krvinka\",\"krychle\",\"krypta\",\"krystal\",\"kryt\",\"kudlanka\",\"kufr\",\"kujnost\",\"kukla\",\"kulajda\",\"kulich\",\"kulka\",\"kulomet\",\"kultura\",\"kuna\",\"kupodivu\",\"kurt\",\"kurzor\",\"kutil\",\"kvalita\",\"kvasinka\",\"kvestor\",\"kynolog\",\"kyselina\",\"kytara\",\"kytice\",\"kytka\",\"kytovec\",\"kyvadlo\",\"labrador\",\"lachtan\",\"ladnost\",\"laik\",\"lakomec\",\"lamela\",\"lampa\",\"lanovka\",\"lasice\",\"laso\",\"lastura\",\"latinka\",\"lavina\",\"lebka\",\"leckdy\",\"leden\",\"lednice\",\"ledovka\",\"ledvina\",\"legenda\",\"legie\",\"legrace\",\"lehce\",\"lehkost\",\"lehnout\",\"lektvar\",\"lenochod\",\"lentilka\",\"lepenka\",\"lepidlo\",\"letadlo\",\"letec\",\"letmo\",\"letokruh\",\"levhart\",\"levitace\",\"levobok\",\"libra\",\"lichotka\",\"lidojed\",\"lidskost\",\"lihovina\",\"lijavec\",\"lilek\",\"limetka\",\"linie\",\"linka\",\"linoleum\",\"listopad\",\"litina\",\"litovat\",\"lobista\",\"lodivod\",\"logika\",\"logoped\",\"lokalita\",\"loket\",\"lomcovat\",\"lopata\",\"lopuch\",\"lord\",\"losos\",\"lotr\",\"loudal\",\"louh\",\"louka\",\"louskat\",\"lovec\",\"lstivost\",\"lucerna\",\"lucifer\",\"lump\",\"lusk\",\"lustrace\",\"lvice\",\"lyra\",\"lyrika\",\"lysina\",\"madam\",\"madlo\",\"magistr\",\"mahagon\",\"majetek\",\"majitel\",\"majorita\",\"makak\",\"makovice\",\"makrela\",\"malba\",\"malina\",\"malovat\",\"malvice\",\"maminka\",\"mandle\",\"manko\",\"marnost\",\"masakr\",\"maskot\",\"masopust\",\"matice\",\"matrika\",\"maturita\",\"mazanec\",\"mazivo\",\"mazlit\",\"mazurka\",\"mdloba\",\"mechanik\",\"meditace\",\"medovina\",\"melasa\",\"meloun\",\"mentolka\",\"metla\",\"metoda\",\"metr\",\"mezera\",\"migrace\",\"mihnout\",\"mihule\",\"mikina\",\"mikrofon\",\"milenec\",\"milimetr\",\"milost\",\"mimika\",\"mincovna\",\"minibar\",\"minomet\",\"minulost\",\"miska\",\"mistr\",\"mixovat\",\"mladost\",\"mlha\",\"mlhovina\",\"mlok\",\"mlsat\",\"mluvit\",\"mnich\",\"mnohem\",\"mobil\",\"mocnost\",\"modelka\",\"modlitba\",\"mohyla\",\"mokro\",\"molekula\",\"momentka\",\"monarcha\",\"monokl\",\"monstrum\",\"montovat\",\"monzun\",\"mosaz\",\"moskyt\",\"most\",\"motivace\",\"motorka\",\"motyka\",\"moucha\",\"moudrost\",\"mozaika\",\"mozek\",\"mozol\",\"mramor\",\"mravenec\",\"mrkev\",\"mrtvola\",\"mrzet\",\"mrzutost\",\"mstitel\",\"mudrc\",\"muflon\",\"mulat\",\"mumie\",\"munice\",\"muset\",\"mutace\",\"muzeum\",\"muzikant\",\"myslivec\",\"mzda\",\"nabourat\",\"nachytat\",\"nadace\",\"nadbytek\",\"nadhoz\",\"nadobro\",\"nadpis\",\"nahlas\",\"nahnat\",\"nahodile\",\"nahradit\",\"naivita\",\"najednou\",\"najisto\",\"najmout\",\"naklonit\",\"nakonec\",\"nakrmit\",\"nalevo\",\"namazat\",\"namluvit\",\"nanometr\",\"naoko\",\"naopak\",\"naostro\",\"napadat\",\"napevno\",\"naplnit\",\"napnout\",\"naposled\",\"naprosto\",\"narodit\",\"naruby\",\"narychlo\",\"nasadit\",\"nasekat\",\"naslepo\",\"nastat\",\"natolik\",\"navenek\",\"navrch\",\"navzdory\",\"nazvat\",\"nebe\",\"nechat\",\"necky\",\"nedaleko\",\"nedbat\",\"neduh\",\"negace\",\"nehet\",\"nehoda\",\"nejen\",\"nejprve\",\"neklid\",\"nelibost\",\"nemilost\",\"nemoc\",\"neochota\",\"neonka\",\"nepokoj\",\"nerost\",\"nerv\",\"nesmysl\",\"nesoulad\",\"netvor\",\"neuron\",\"nevina\",\"nezvykle\",\"nicota\",\"nijak\",\"nikam\",\"nikdy\",\"nikl\",\"nikterak\",\"nitro\",\"nocleh\",\"nohavice\",\"nominace\",\"nora\",\"norek\",\"nositel\",\"nosnost\",\"nouze\",\"noviny\",\"novota\",\"nozdra\",\"nuda\",\"nudle\",\"nuget\",\"nutit\",\"nutnost\",\"nutrie\",\"nymfa\",\"obal\",\"obarvit\",\"obava\",\"obdiv\",\"obec\",\"obehnat\",\"obejmout\",\"obezita\",\"obhajoba\",\"obilnice\",\"objasnit\",\"objekt\",\"obklopit\",\"oblast\",\"oblek\",\"obliba\",\"obloha\",\"obluda\",\"obnos\",\"obohatit\",\"obojek\",\"obout\",\"obrazec\",\"obrna\",\"obruba\",\"obrys\",\"obsah\",\"obsluha\",\"obstarat\",\"obuv\",\"obvaz\",\"obvinit\",\"obvod\",\"obvykle\",\"obyvatel\",\"obzor\",\"ocas\",\"ocel\",\"ocenit\",\"ochladit\",\"ochota\",\"ochrana\",\"ocitnout\",\"odboj\",\"odbyt\",\"odchod\",\"odcizit\",\"odebrat\",\"odeslat\",\"odevzdat\",\"odezva\",\"odhadce\",\"odhodit\",\"odjet\",\"odjinud\",\"odkaz\",\"odkoupit\",\"odliv\",\"odluka\",\"odmlka\",\"odolnost\",\"odpad\",\"odpis\",\"odplout\",\"odpor\",\"odpustit\",\"odpykat\",\"odrazka\",\"odsoudit\",\"odstup\",\"odsun\",\"odtok\",\"odtud\",\"odvaha\",\"odveta\",\"odvolat\",\"odvracet\",\"odznak\",\"ofina\",\"ofsajd\",\"ohlas\",\"ohnisko\",\"ohrada\",\"ohrozit\",\"ohryzek\",\"okap\",\"okenice\",\"oklika\",\"okno\",\"okouzlit\",\"okovy\",\"okrasa\",\"okres\",\"okrsek\",\"okruh\",\"okupant\",\"okurka\",\"okusit\",\"olejnina\",\"olizovat\",\"omak\",\"omeleta\",\"omezit\",\"omladina\",\"omlouvat\",\"omluva\",\"omyl\",\"onehdy\",\"opakovat\",\"opasek\",\"operace\",\"opice\",\"opilost\",\"opisovat\",\"opora\",\"opozice\",\"opravdu\",\"oproti\",\"orbital\",\"orchestr\",\"orgie\",\"orlice\",\"orloj\",\"ortel\",\"osada\",\"oschnout\",\"osika\",\"osivo\",\"oslava\",\"oslepit\",\"oslnit\",\"oslovit\",\"osnova\",\"osoba\",\"osolit\",\"ospalec\",\"osten\",\"ostraha\",\"ostuda\",\"ostych\",\"osvojit\",\"oteplit\",\"otisk\",\"otop\",\"otrhat\",\"otrlost\",\"otrok\",\"otruby\",\"otvor\",\"ovanout\",\"ovar\",\"oves\",\"ovlivnit\",\"ovoce\",\"oxid\",\"ozdoba\",\"pachatel\",\"pacient\",\"padouch\",\"pahorek\",\"pakt\",\"palanda\",\"palec\",\"palivo\",\"paluba\",\"pamflet\",\"pamlsek\",\"panenka\",\"panika\",\"panna\",\"panovat\",\"panstvo\",\"pantofle\",\"paprika\",\"parketa\",\"parodie\",\"parta\",\"paruka\",\"paryba\",\"paseka\",\"pasivita\",\"pastelka\",\"patent\",\"patrona\",\"pavouk\",\"pazneht\",\"pazourek\",\"pecka\",\"pedagog\",\"pejsek\",\"peklo\",\"peloton\",\"penalta\",\"pendrek\",\"penze\",\"periskop\",\"pero\",\"pestrost\",\"petarda\",\"petice\",\"petrolej\",\"pevnina\",\"pexeso\",\"pianista\",\"piha\",\"pijavice\",\"pikle\",\"piknik\",\"pilina\",\"pilnost\",\"pilulka\",\"pinzeta\",\"pipeta\",\"pisatel\",\"pistole\",\"pitevna\",\"pivnice\",\"pivovar\",\"placenta\",\"plakat\",\"plamen\",\"planeta\",\"plastika\",\"platit\",\"plavidlo\",\"plaz\",\"plech\",\"plemeno\",\"plenta\",\"ples\",\"pletivo\",\"plevel\",\"plivat\",\"plnit\",\"plno\",\"plocha\",\"plodina\",\"plomba\",\"plout\",\"pluk\",\"plyn\",\"pobavit\",\"pobyt\",\"pochod\",\"pocit\",\"poctivec\",\"podat\",\"podcenit\",\"podepsat\",\"podhled\",\"podivit\",\"podklad\",\"podmanit\",\"podnik\",\"podoba\",\"podpora\",\"podraz\",\"podstata\",\"podvod\",\"podzim\",\"poezie\",\"pohanka\",\"pohnutka\",\"pohovor\",\"pohroma\",\"pohyb\",\"pointa\",\"pojistka\",\"pojmout\",\"pokazit\",\"pokles\",\"pokoj\",\"pokrok\",\"pokuta\",\"pokyn\",\"poledne\",\"polibek\",\"polknout\",\"poloha\",\"polynom\",\"pomalu\",\"pominout\",\"pomlka\",\"pomoc\",\"pomsta\",\"pomyslet\",\"ponechat\",\"ponorka\",\"ponurost\",\"popadat\",\"popel\",\"popisek\",\"poplach\",\"poprosit\",\"popsat\",\"popud\",\"poradce\",\"porce\",\"porod\",\"porucha\",\"poryv\",\"posadit\",\"posed\",\"posila\",\"poskok\",\"poslanec\",\"posoudit\",\"pospolu\",\"postava\",\"posudek\",\"posyp\",\"potah\",\"potkan\",\"potlesk\",\"potomek\",\"potrava\",\"potupa\",\"potvora\",\"poukaz\",\"pouto\",\"pouzdro\",\"povaha\",\"povidla\",\"povlak\",\"povoz\",\"povrch\",\"povstat\",\"povyk\",\"povzdech\",\"pozdrav\",\"pozemek\",\"poznatek\",\"pozor\",\"pozvat\",\"pracovat\",\"prahory\",\"praktika\",\"prales\",\"praotec\",\"praporek\",\"prase\",\"pravda\",\"princip\",\"prkno\",\"probudit\",\"procento\",\"prodej\",\"profese\",\"prohra\",\"projekt\",\"prolomit\",\"promile\",\"pronikat\",\"propad\",\"prorok\",\"prosba\",\"proton\",\"proutek\",\"provaz\",\"prskavka\",\"prsten\",\"prudkost\",\"prut\",\"prvek\",\"prvohory\",\"psanec\",\"psovod\",\"pstruh\",\"ptactvo\",\"puberta\",\"puch\",\"pudl\",\"pukavec\",\"puklina\",\"pukrle\",\"pult\",\"pumpa\",\"punc\",\"pupen\",\"pusa\",\"pusinka\",\"pustina\",\"putovat\",\"putyka\",\"pyramida\",\"pysk\",\"pytel\",\"racek\",\"rachot\",\"radiace\",\"radnice\",\"radon\",\"raft\",\"ragby\",\"raketa\",\"rakovina\",\"rameno\",\"rampouch\",\"rande\",\"rarach\",\"rarita\",\"rasovna\",\"rastr\",\"ratolest\",\"razance\",\"razidlo\",\"reagovat\",\"reakce\",\"recept\",\"redaktor\",\"referent\",\"reflex\",\"rejnok\",\"reklama\",\"rekord\",\"rekrut\",\"rektor\",\"reputace\",\"revize\",\"revma\",\"revolver\",\"rezerva\",\"riskovat\",\"riziko\",\"robotika\",\"rodokmen\",\"rohovka\",\"rokle\",\"rokoko\",\"romaneto\",\"ropovod\",\"ropucha\",\"rorejs\",\"rosol\",\"rostlina\",\"rotmistr\",\"rotoped\",\"rotunda\",\"roubenka\",\"roucho\",\"roup\",\"roura\",\"rovina\",\"rovnice\",\"rozbor\",\"rozchod\",\"rozdat\",\"rozeznat\",\"rozhodce\",\"rozinka\",\"rozjezd\",\"rozkaz\",\"rozloha\",\"rozmar\",\"rozpad\",\"rozruch\",\"rozsah\",\"roztok\",\"rozum\",\"rozvod\",\"rubrika\",\"ruchadlo\",\"rukavice\",\"rukopis\",\"ryba\",\"rybolov\",\"rychlost\",\"rydlo\",\"rypadlo\",\"rytina\",\"ryzost\",\"sadista\",\"sahat\",\"sako\",\"samec\",\"samizdat\",\"samota\",\"sanitka\",\"sardinka\",\"sasanka\",\"satelit\",\"sazba\",\"sazenice\",\"sbor\",\"schovat\",\"sebranka\",\"secese\",\"sedadlo\",\"sediment\",\"sedlo\",\"sehnat\",\"sejmout\",\"sekera\",\"sekta\",\"sekunda\",\"sekvoje\",\"semeno\",\"seno\",\"servis\",\"sesadit\",\"seshora\",\"seskok\",\"seslat\",\"sestra\",\"sesuv\",\"sesypat\",\"setba\",\"setina\",\"setkat\",\"setnout\",\"setrvat\",\"sever\",\"seznam\",\"shoda\",\"shrnout\",\"sifon\",\"silnice\",\"sirka\",\"sirotek\",\"sirup\",\"situace\",\"skafandr\",\"skalisko\",\"skanzen\",\"skaut\",\"skeptik\",\"skica\",\"skladba\",\"sklenice\",\"sklo\",\"skluz\",\"skoba\",\"skokan\",\"skoro\",\"skripta\",\"skrz\",\"skupina\",\"skvost\",\"skvrna\",\"slabika\",\"sladidlo\",\"slanina\",\"slast\",\"slavnost\",\"sledovat\",\"slepec\",\"sleva\",\"slezina\",\"slib\",\"slina\",\"sliznice\",\"slon\",\"sloupek\",\"slovo\",\"sluch\",\"sluha\",\"slunce\",\"slupka\",\"slza\",\"smaragd\",\"smetana\",\"smilstvo\",\"smlouva\",\"smog\",\"smrad\",\"smrk\",\"smrtka\",\"smutek\",\"smysl\",\"snad\",\"snaha\",\"snob\",\"sobota\",\"socha\",\"sodovka\",\"sokol\",\"sopka\",\"sotva\",\"souboj\",\"soucit\",\"soudce\",\"souhlas\",\"soulad\",\"soumrak\",\"souprava\",\"soused\",\"soutok\",\"souviset\",\"spalovna\",\"spasitel\",\"spis\",\"splav\",\"spodek\",\"spojenec\",\"spolu\",\"sponzor\",\"spornost\",\"spousta\",\"sprcha\",\"spustit\",\"sranda\",\"sraz\",\"srdce\",\"srna\",\"srnec\",\"srovnat\",\"srpen\",\"srst\",\"srub\",\"stanice\",\"starosta\",\"statika\",\"stavba\",\"stehno\",\"stezka\",\"stodola\",\"stolek\",\"stopa\",\"storno\",\"stoupat\",\"strach\",\"stres\",\"strhnout\",\"strom\",\"struna\",\"studna\",\"stupnice\",\"stvol\",\"styk\",\"subjekt\",\"subtropy\",\"suchar\",\"sudost\",\"sukno\",\"sundat\",\"sunout\",\"surikata\",\"surovina\",\"svah\",\"svalstvo\",\"svetr\",\"svatba\",\"svazek\",\"svisle\",\"svitek\",\"svoboda\",\"svodidlo\",\"svorka\",\"svrab\",\"sykavka\",\"sykot\",\"synek\",\"synovec\",\"sypat\",\"sypkost\",\"syrovost\",\"sysel\",\"sytost\",\"tabletka\",\"tabule\",\"tahoun\",\"tajemno\",\"tajfun\",\"tajga\",\"tajit\",\"tajnost\",\"taktika\",\"tamhle\",\"tampon\",\"tancovat\",\"tanec\",\"tanker\",\"tapeta\",\"tavenina\",\"tazatel\",\"technika\",\"tehdy\",\"tekutina\",\"telefon\",\"temnota\",\"tendence\",\"tenista\",\"tenor\",\"teplota\",\"tepna\",\"teprve\",\"terapie\",\"termoska\",\"textil\",\"ticho\",\"tiskopis\",\"titulek\",\"tkadlec\",\"tkanina\",\"tlapka\",\"tleskat\",\"tlukot\",\"tlupa\",\"tmel\",\"toaleta\",\"topinka\",\"topol\",\"torzo\",\"touha\",\"toulec\",\"tradice\",\"traktor\",\"tramp\",\"trasa\",\"traverza\",\"trefit\",\"trest\",\"trezor\",\"trhavina\",\"trhlina\",\"trochu\",\"trojice\",\"troska\",\"trouba\",\"trpce\",\"trpitel\",\"trpkost\",\"trubec\",\"truchlit\",\"truhlice\",\"trus\",\"trvat\",\"tudy\",\"tuhnout\",\"tuhost\",\"tundra\",\"turista\",\"turnaj\",\"tuzemsko\",\"tvaroh\",\"tvorba\",\"tvrdost\",\"tvrz\",\"tygr\",\"tykev\",\"ubohost\",\"uboze\",\"ubrat\",\"ubrousek\",\"ubrus\",\"ubytovna\",\"ucho\",\"uctivost\",\"udivit\",\"uhradit\",\"ujednat\",\"ujistit\",\"ujmout\",\"ukazatel\",\"uklidnit\",\"uklonit\",\"ukotvit\",\"ukrojit\",\"ulice\",\"ulita\",\"ulovit\",\"umyvadlo\",\"unavit\",\"uniforma\",\"uniknout\",\"upadnout\",\"uplatnit\",\"uplynout\",\"upoutat\",\"upravit\",\"uran\",\"urazit\",\"usednout\",\"usilovat\",\"usmrtit\",\"usnadnit\",\"usnout\",\"usoudit\",\"ustlat\",\"ustrnout\",\"utahovat\",\"utkat\",\"utlumit\",\"utonout\",\"utopenec\",\"utrousit\",\"uvalit\",\"uvolnit\",\"uvozovka\",\"uzdravit\",\"uzel\",\"uzenina\",\"uzlina\",\"uznat\",\"vagon\",\"valcha\",\"valoun\",\"vana\",\"vandal\",\"vanilka\",\"varan\",\"varhany\",\"varovat\",\"vcelku\",\"vchod\",\"vdova\",\"vedro\",\"vegetace\",\"vejce\",\"velbloud\",\"veletrh\",\"velitel\",\"velmoc\",\"velryba\",\"venkov\",\"veranda\",\"verze\",\"veselka\",\"veskrze\",\"vesnice\",\"vespodu\",\"vesta\",\"veterina\",\"veverka\",\"vibrace\",\"vichr\",\"videohra\",\"vidina\",\"vidle\",\"vila\",\"vinice\",\"viset\",\"vitalita\",\"vize\",\"vizitka\",\"vjezd\",\"vklad\",\"vkus\",\"vlajka\",\"vlak\",\"vlasec\",\"vlevo\",\"vlhkost\",\"vliv\",\"vlnovka\",\"vloupat\",\"vnucovat\",\"vnuk\",\"voda\",\"vodivost\",\"vodoznak\",\"vodstvo\",\"vojensky\",\"vojna\",\"vojsko\",\"volant\",\"volba\",\"volit\",\"volno\",\"voskovka\",\"vozidlo\",\"vozovna\",\"vpravo\",\"vrabec\",\"vracet\",\"vrah\",\"vrata\",\"vrba\",\"vrcholek\",\"vrhat\",\"vrstva\",\"vrtule\",\"vsadit\",\"vstoupit\",\"vstup\",\"vtip\",\"vybavit\",\"vybrat\",\"vychovat\",\"vydat\",\"vydra\",\"vyfotit\",\"vyhledat\",\"vyhnout\",\"vyhodit\",\"vyhradit\",\"vyhubit\",\"vyjasnit\",\"vyjet\",\"vyjmout\",\"vyklopit\",\"vykonat\",\"vylekat\",\"vymazat\",\"vymezit\",\"vymizet\",\"vymyslet\",\"vynechat\",\"vynikat\",\"vynutit\",\"vypadat\",\"vyplatit\",\"vypravit\",\"vypustit\",\"vyrazit\",\"vyrovnat\",\"vyrvat\",\"vyslovit\",\"vysoko\",\"vystavit\",\"vysunout\",\"vysypat\",\"vytasit\",\"vytesat\",\"vytratit\",\"vyvinout\",\"vyvolat\",\"vyvrhel\",\"vyzdobit\",\"vyznat\",\"vzadu\",\"vzbudit\",\"vzchopit\",\"vzdor\",\"vzduch\",\"vzdychat\",\"vzestup\",\"vzhledem\",\"vzkaz\",\"vzlykat\",\"vznik\",\"vzorek\",\"vzpoura\",\"vztah\",\"vztek\",\"xylofon\",\"zabrat\",\"zabydlet\",\"zachovat\",\"zadarmo\",\"zadusit\",\"zafoukat\",\"zahltit\",\"zahodit\",\"zahrada\",\"zahynout\",\"zajatec\",\"zajet\",\"zajistit\",\"zaklepat\",\"zakoupit\",\"zalepit\",\"zamezit\",\"zamotat\",\"zamyslet\",\"zanechat\",\"zanikat\",\"zaplatit\",\"zapojit\",\"zapsat\",\"zarazit\",\"zastavit\",\"zasunout\",\"zatajit\",\"zatemnit\",\"zatknout\",\"zaujmout\",\"zavalit\",\"zavelet\",\"zavinit\",\"zavolat\",\"zavrtat\",\"zazvonit\",\"zbavit\",\"zbrusu\",\"zbudovat\",\"zbytek\",\"zdaleka\",\"zdarma\",\"zdatnost\",\"zdivo\",\"zdobit\",\"zdroj\",\"zdvih\",\"zdymadlo\",\"zelenina\",\"zeman\",\"zemina\",\"zeptat\",\"zezadu\",\"zezdola\",\"zhatit\",\"zhltnout\",\"zhluboka\",\"zhotovit\",\"zhruba\",\"zima\",\"zimnice\",\"zjemnit\",\"zklamat\",\"zkoumat\",\"zkratka\",\"zkumavka\",\"zlato\",\"zlehka\",\"zloba\",\"zlom\",\"zlost\",\"zlozvyk\",\"zmapovat\",\"zmar\",\"zmatek\",\"zmije\",\"zmizet\",\"zmocnit\",\"zmodrat\",\"zmrzlina\",\"zmutovat\",\"znak\",\"znalost\",\"znamenat\",\"znovu\",\"zobrazit\",\"zotavit\",\"zoubek\",\"zoufale\",\"zplodit\",\"zpomalit\",\"zprava\",\"zprostit\",\"zprudka\",\"zprvu\",\"zrada\",\"zranit\",\"zrcadlo\",\"zrnitost\",\"zrno\",\"zrovna\",\"zrychlit\",\"zrzavost\",\"zticha\",\"ztratit\",\"zubovina\",\"zubr\",\"zvednout\",\"zvenku\",\"zvesela\",\"zvon\",\"zvrat\",\"zvukovod\",\"zvyk\"][\"abandon\",\"ability\",\"able\",\"about\",\"above\",\"absent\",\"absorb\",\"abstract\",\"absurd\",\"abuse\",\"access\",\"accident\",\"account\",\"accuse\",\"achieve\",\"acid\",\"acoustic\",\"acquire\",\"across\",\"act\",\"action\",\"actor\",\"actress\",\"actual\",\"adapt\",\"add\",\"addict\",\"address\",\"adjust\",\"admit\",\"adult\",\"advance\",\"advice\",\"aerobic\",\"affair\",\"afford\",\"afraid\",\"again\",\"age\",\"agent\",\"agree\",\"ahead\",\"aim\",\"air\",\"airport\",\"aisle\",\"alarm\",\"album\",\"alcohol\",\"alert\",\"alien\",\"all\",\"alley\",\"allow\",\"almost\",\"alone\",\"alpha\",\"already\",\"also\",\"alter\",\"always\",\"amateur\",\"amazing\",\"among\",\"amount\",\"amused\",\"analyst\",\"anchor\",\"ancient\",\"anger\",\"angle\",\"angry\",\"animal\",\"ankle\",\"announce\",\"annual\",\"another\",\"answer\",\"antenna\",\"antique\",\"anxiety\",\"any\",\"apart\",\"apology\",\"appear\",\"apple\",\"approve\",\"april\",\"arch\",\"arctic\",\"area\",\"arena\",\"argue\",\"arm\",\"armed\",\"armor\",\"army\",\"around\",\"arrange\",\"arrest\",\"arrive\",\"arrow\",\"art\",\"artefact\",\"artist\",\"artwork\",\"ask\",\"aspect\",\"assault\",\"asset\",\"assist\",\"assume\",\"asthma\",\"athlete\",\"atom\",\"attack\",\"attend\",\"attitude\",\"attract\",\"auction\",\"audit\",\"august\",\"aunt\",\"author\",\"auto\",\"autumn\",\"average\",\"avocado\",\"avoid\",\"awake\",\"aware\",\"away\",\"awesome\",\"awful\",\"awkward\",\"axis\",\"baby\",\"bachelor\",\"bacon\",\"badge\",\"bag\",\"balance\",\"balcony\",\"ball\",\"bamboo\",\"banana\",\"banner\",\"bar\",\"barely\",\"bargain\",\"barrel\",\"base\",\"basic\",\"basket\",\"battle\",\"beach\",\"bean\",\"beauty\",\"because\",\"become\",\"beef\",\"before\",\"begin\",\"behave\",\"behind\",\"believe\",\"below\",\"belt\",\"bench\",\"benefit\",\"best\",\"betray\",\"better\",\"between\",\"beyond\",\"bicycle\",\"bid\",\"bike\",\"bind\",\"biology\",\"bird\",\"birth\",\"bitter\",\"black\",\"blade\",\"blame\",\"blanket\",\"blast\",\"bleak\",\"bless\",\"blind\",\"blood\",\"blossom\",\"blouse\",\"blue\",\"blur\",\"blush\",\"board\",\"boat\",\"body\",\"boil\",\"bomb\",\"bone\",\"bonus\",\"book\",\"boost\",\"border\",\"boring\",\"borrow\",\"boss\",\"bottom\",\"bounce\",\"box\",\"boy\",\"bracket\",\"brain\",\"brand\",\"brass\",\"brave\",\"bread\",\"breeze\",\"brick\",\"bridge\",\"brief\",\"bright\",\"bring\",\"brisk\",\"broccoli\",\"broken\",\"bronze\",\"broom\",\"brother\",\"brown\",\"brush\",\"bubble\",\"buddy\",\"budget\",\"buffalo\",\"build\",\"bulb\",\"bulk\",\"bullet\",\"bundle\",\"bunker\",\"burden\",\"burger\",\"burst\",\"bus\",\"business\",\"busy\",\"butter\",\"buyer\",\"buzz\",\"cabbage\",\"cabin\",\"cable\",\"cactus\",\"cage\",\"cake\",\"call\",\"calm\",\"camera\",\"camp\",\"can\",\"canal\",\"cancel\",\"candy\",\"cannon\",\"canoe\",\"canvas\",\"canyon\",\"capable\",\"capital\",\"captain\",\"car\",\"carbon\",\"card\",\"cargo\",\"carpet\",\"carry\",\"cart\",\"case\",\"cash\",\"casino\",\"castle\",\"casual\",\"cat\",\"catalog\",\"catch\",\"category\",\"cattle\",\"caught\",\"cause\",\"caution\",\"cave\",\"ceiling\",\"celery\",\"cement\",\"census\",\"century\",\"cereal\",\"certain\",\"chair\",\"chalk\",\"champion\",\"change\",\"chaos\",\"chapter\",\"charge\",\"chase\",\"chat\",\"cheap\",\"check\",\"cheese\",\"chef\",\"cherry\",\"chest\",\"chicken\",\"chief\",\"child\",\"chimney\",\"choice\",\"choose\",\"chronic\",\"chuckle\",\"chunk\",\"churn\",\"cigar\",\"cinnamon\",\"circle\",\"citizen\",\"city\",\"civil\",\"claim\",\"clap\",\"clarify\",\"claw\",\"clay\",\"clean\",\"clerk\",\"clever\",\"click\",\"client\",\"cliff\",\"climb\",\"clinic\",\"clip\",\"clock\",\"clog\",\"close\",\"cloth\",\"cloud\",\"clown\",\"club\",\"clump\",\"cluster\",\"clutch\",\"coach\",\"coast\",\"coconut\",\"code\",\"coffee\",\"coil\",\"coin\",\"collect\",\"color\",\"column\",\"combine\",\"come\",\"comfort\",\"comic\",\"common\",\"company\",\"concert\",\"conduct\",\"confirm\",\"congress\",\"connect\",\"consider\",\"control\",\"convince\",\"cook\",\"cool\",\"copper\",\"copy\",\"coral\",\"core\",\"corn\",\"correct\",\"cost\",\"cotton\",\"couch\",\"country\",\"couple\",\"course\",\"cousin\",\"cover\",\"coyote\",\"crack\",\"cradle\",\"craft\",\"cram\",\"crane\",\"crash\",\"crater\",\"crawl\",\"crazy\",\"cream\",\"credit\",\"creek\",\"crew\",\"cricket\",\"crime\",\"crisp\",\"critic\",\"crop\",\"cross\",\"crouch\",\"crowd\",\"crucial\",\"cruel\",\"cruise\",\"crumble\",\"crunch\",\"crush\",\"cry\",\"crystal\",\"cube\",\"culture\",\"cup\",\"cupboard\",\"curious\",\"current\",\"curtain\",\"curve\",\"cushion\",\"custom\",\"cute\",\"cycle\",\"dad\",\"damage\",\"damp\",\"dance\",\"danger\",\"daring\",\"dash\",\"daughter\",\"dawn\",\"day\",\"deal\",\"debate\",\"debris\",\"decade\",\"december\",\"decide\",\"decline\",\"decorate\",\"decrease\",\"deer\",\"defense\",\"define\",\"defy\",\"degree\",\"delay\",\"deliver\",\"demand\",\"demise\",\"denial\",\"dentist\",\"deny\",\"depart\",\"depend\",\"deposit\",\"depth\",\"deputy\",\"derive\",\"describe\",\"desert\",\"design\",\"desk\",\"despair\",\"destroy\",\"detail\",\"detect\",\"develop\",\"device\",\"devote\",\"diagram\",\"dial\",\"diamond\",\"diary\",\"dice\",\"diesel\",\"diet\",\"differ\",\"digital\",\"dignity\",\"dilemma\",\"dinner\",\"dinosaur\",\"direct\",\"dirt\",\"disagree\",\"discover\",\"disease\",\"dish\",\"dismiss\",\"disorder\",\"display\",\"distance\",\"divert\",\"divide\",\"divorce\",\"dizzy\",\"doctor\",\"document\",\"dog\",\"doll\",\"dolphin\",\"domain\",\"donate\",\"donkey\",\"donor\",\"door\",\"dose\",\"double\",\"dove\",\"draft\",\"dragon\",\"drama\",\"drastic\",\"draw\",\"dream\",\"dress\",\"drift\",\"drill\",\"drink\",\"drip\",\"drive\",\"drop\",\"drum\",\"dry\",\"duck\",\"dumb\",\"dune\",\"during\",\"dust\",\"dutch\",\"duty\",\"dwarf\",\"dynamic\",\"eager\",\"eagle\",\"early\",\"earn\",\"earth\",\"easily\",\"east\",\"easy\",\"echo\",\"ecology\",\"economy\",\"edge\",\"edit\",\"educate\",\"effort\",\"egg\",\"eight\",\"either\",\"elbow\",\"elder\",\"electric\",\"elegant\",\"element\",\"elephant\",\"elevator\",\"elite\",\"else\",\"embark\",\"embody\",\"embrace\",\"emerge\",\"emotion\",\"employ\",\"empower\",\"empty\",\"enable\",\"enact\",\"end\",\"endless\",\"endorse\",\"enemy\",\"energy\",\"enforce\",\"engage\",\"engine\",\"enhance\",\"enjoy\",\"enlist\",\"enough\",\"enrich\",\"enroll\",\"ensure\",\"enter\",\"entire\",\"entry\",\"envelope\",\"episode\",\"equal\",\"equip\",\"era\",\"erase\",\"erode\",\"erosion\",\"error\",\"erupt\",\"escape\",\"essay\",\"essence\",\"estate\",\"eternal\",\"ethics\",\"evidence\",\"evil\",\"evoke\",\"evolve\",\"exact\",\"example\",\"excess\",\"exchange\",\"excite\",\"exclude\",\"excuse\",\"execute\",\"exercise\",\"exhaust\",\"exhibit\",\"exile\",\"exist\",\"exit\",\"exotic\",\"expand\",\"expect\",\"expire\",\"explain\",\"expose\",\"express\",\"extend\",\"extra\",\"eye\",\"eyebrow\",\"fabric\",\"face\",\"faculty\",\"fade\",\"faint\",\"faith\",\"fall\",\"false\",\"fame\",\"family\",\"famous\",\"fan\",\"fancy\",\"fantasy\",\"farm\",\"fashion\",\"fat\",\"fatal\",\"father\",\"fatigue\",\"fault\",\"favorite\",\"feature\",\"february\",\"federal\",\"fee\",\"feed\",\"feel\",\"female\",\"fence\",\"festival\",\"fetch\",\"fever\",\"few\",\"fiber\",\"fiction\",\"field\",\"figure\",\"file\",\"film\",\"filter\",\"final\",\"find\",\"fine\",\"finger\",\"finish\",\"fire\",\"firm\",\"first\",\"fiscal\",\"fish\",\"fit\",\"fitness\",\"fix\",\"flag\",\"flame\",\"flash\",\"flat\",\"flavor\",\"flee\",\"flight\",\"flip\",\"float\",\"flock\",\"floor\",\"flower\",\"fluid\",\"flush\",\"fly\",\"foam\",\"focus\",\"fog\",\"foil\",\"fold\",\"follow\",\"food\",\"foot\",\"force\",\"forest\",\"forget\",\"fork\",\"fortune\",\"forum\",\"forward\",\"fossil\",\"foster\",\"found\",\"fox\",\"fragile\",\"frame\",\"frequent\",\"fresh\",\"friend\",\"fringe\",\"frog\",\"front\",\"frost\",\"frown\",\"frozen\",\"fruit\",\"fuel\",\"fun\",\"funny\",\"furnace\",\"fury\",\"future\",\"gadget\",\"gain\",\"galaxy\",\"gallery\",\"game\",\"gap\",\"garage\",\"garbage\",\"garden\",\"garlic\",\"garment\",\"gas\",\"gasp\",\"gate\",\"gather\",\"gauge\",\"gaze\",\"general\",\"genius\",\"genre\",\"gentle\",\"genuine\",\"gesture\",\"ghost\",\"giant\",\"gift\",\"giggle\",\"ginger\",\"giraffe\",\"girl\",\"give\",\"glad\",\"glance\",\"glare\",\"glass\",\"glide\",\"glimpse\",\"globe\",\"gloom\",\"glory\",\"glove\",\"glow\",\"glue\",\"goat\",\"goddess\",\"gold\",\"good\",\"goose\",\"gorilla\",\"gospel\",\"gossip\",\"govern\",\"gown\",\"grab\",\"grace\",\"grain\",\"grant\",\"grape\",\"grass\",\"gravity\",\"great\",\"green\",\"grid\",\"grief\",\"grit\",\"grocery\",\"group\",\"grow\",\"grunt\",\"guard\",\"guess\",\"guide\",\"guilt\",\"guitar\",\"gun\",\"gym\",\"habit\",\"hair\",\"half\",\"hammer\",\"hamster\",\"hand\",\"happy\",\"harbor\",\"hard\",\"harsh\",\"harvest\",\"hat\",\"have\",\"hawk\",\"hazard\",\"head\",\"health\",\"heart\",\"heavy\",\"hedgehog\",\"height\",\"hello\",\"helmet\",\"help\",\"hen\",\"hero\",\"hidden\",\"high\",\"hill\",\"hint\",\"hip\",\"hire\",\"history\",\"hobby\",\"hockey\",\"hold\",\"hole\",\"holiday\",\"hollow\",\"home\",\"honey\",\"hood\",\"hope\",\"horn\",\"horror\",\"horse\",\"hospital\",\"host\",\"hotel\",\"hour\",\"hover\",\"hub\",\"huge\",\"human\",\"humble\",\"humor\",\"hundred\",\"hungry\",\"hunt\",\"hurdle\",\"hurry\",\"hurt\",\"husband\",\"hybrid\",\"ice\",\"icon\",\"idea\",\"identify\",\"idle\",\"ignore\",\"ill\",\"illegal\",\"illness\",\"image\",\"imitate\",\"immense\",\"immune\",\"impact\",\"impose\",\"improve\",\"impulse\",\"inch\",\"include\",\"income\",\"increase\",\"index\",\"indicate\",\"indoor\",\"industry\",\"infant\",\"inflict\",\"inform\",\"inhale\",\"inherit\",\"initial\",\"inject\",\"injury\",\"inmate\",\"inner\",\"innocent\",\"input\",\"inquiry\",\"insane\",\"insect\",\"inside\",\"inspire\",\"install\",\"intact\",\"interest\",\"into\",\"invest\",\"invite\",\"involve\",\"iron\",\"island\",\"isolate\",\"issue\",\"item\",\"ivory\",\"jacket\",\"jaguar\",\"jar\",\"jazz\",\"jealous\",\"jeans\",\"jelly\",\"jewel\",\"job\",\"join\",\"joke\",\"journey\",\"joy\",\"judge\",\"juice\",\"jump\",\"jungle\",\"junior\",\"junk\",\"just\",\"kangaroo\",\"keen\",\"keep\",\"ketchup\",\"key\",\"kick\",\"kid\",\"kidney\",\"kind\",\"kingdom\",\"kiss\",\"kit\",\"kitchen\",\"kite\",\"kitten\",\"kiwi\",\"knee\",\"knife\",\"knock\",\"know\",\"lab\",\"label\",\"labor\",\"ladder\",\"lady\",\"lake\",\"lamp\",\"language\",\"laptop\",\"large\",\"later\",\"latin\",\"laugh\",\"laundry\",\"lava\",\"law\",\"lawn\",\"lawsuit\",\"layer\",\"lazy\",\"leader\",\"leaf\",\"learn\",\"leave\",\"lecture\",\"left\",\"leg\",\"legal\",\"legend\",\"leisure\",\"lemon\",\"lend\",\"length\",\"lens\",\"leopard\",\"lesson\",\"letter\",\"level\",\"liar\",\"liberty\",\"library\",\"license\",\"life\",\"lift\",\"light\",\"like\",\"limb\",\"limit\",\"link\",\"lion\",\"liquid\",\"list\",\"little\",\"live\",\"lizard\",\"load\",\"loan\",\"lobster\",\"local\",\"lock\",\"logic\",\"lonely\",\"long\",\"loop\",\"lottery\",\"loud\",\"lounge\",\"love\",\"loyal\",\"lucky\",\"luggage\",\"lumber\",\"lunar\",\"lunch\",\"luxury\",\"lyrics\",\"machine\",\"mad\",\"magic\",\"magnet\",\"maid\",\"mail\",\"main\",\"major\",\"make\",\"mammal\",\"man\",\"manage\",\"mandate\",\"mango\",\"mansion\",\"manual\",\"maple\",\"marble\",\"march\",\"margin\",\"marine\",\"market\",\"marriage\",\"mask\",\"mass\",\"master\",\"match\",\"material\",\"math\",\"matrix\",\"matter\",\"maximum\",\"maze\",\"meadow\",\"mean\",\"measure\",\"meat\",\"mechanic\",\"medal\",\"media\",\"melody\",\"melt\",\"member\",\"memory\",\"mention\",\"menu\",\"mercy\",\"merge\",\"merit\",\"merry\",\"mesh\",\"message\",\"metal\",\"method\",\"middle\",\"midnight\",\"milk\",\"million\",\"mimic\",\"mind\",\"minimum\",\"minor\",\"minute\",\"miracle\",\"mirror\",\"misery\",\"miss\",\"mistake\",\"mix\",\"mixed\",\"mixture\",\"mobile\",\"model\",\"modify\",\"mom\",\"moment\",\"monitor\",\"monkey\",\"monster\",\"month\",\"moon\",\"moral\",\"more\",\"morning\",\"mosquito\",\"mother\",\"motion\",\"motor\",\"mountain\",\"mouse\",\"move\",\"movie\",\"much\",\"muffin\",\"mule\",\"multiply\",\"muscle\",\"museum\",\"mushroom\",\"music\",\"must\",\"mutual\",\"myself\",\"mystery\",\"myth\",\"naive\",\"name\",\"napkin\",\"narrow\",\"nasty\",\"nation\",\"nature\",\"near\",\"neck\",\"need\",\"negative\",\"neglect\",\"neither\",\"nephew\",\"nerve\",\"nest\",\"net\",\"network\",\"neutral\",\"never\",\"news\",\"next\",\"nice\",\"night\",\"noble\",\"noise\",\"nominee\",\"noodle\",\"normal\",\"north\",\"nose\",\"notable\",\"note\",\"nothing\",\"notice\",\"novel\",\"now\",\"nuclear\",\"number\",\"nurse\",\"nut\",\"oak\",\"obey\",\"object\",\"oblige\",\"obscure\",\"observe\",\"obtain\",\"obvious\",\"occur\",\"ocean\",\"october\",\"odor\",\"off\",\"offer\",\"office\",\"often\",\"oil\",\"okay\",\"old\",\"olive\",\"olympic\",\"omit\",\"once\",\"one\",\"onion\",\"online\",\"only\",\"open\",\"opera\",\"opinion\",\"oppose\",\"option\",\"orange\",\"orbit\",\"orchard\",\"order\",\"ordinary\",\"organ\",\"orient\",\"original\",\"orphan\",\"ostrich\",\"other\",\"outdoor\",\"outer\",\"output\",\"outside\",\"oval\",\"oven\",\"over\",\"own\",\"owner\",\"oxygen\",\"oyster\",\"ozone\",\"pact\",\"paddle\",\"page\",\"pair\",\"palace\",\"palm\",\"panda\",\"panel\",\"panic\",\"panther\",\"paper\",\"parade\",\"parent\",\"park\",\"parrot\",\"party\",\"pass\",\"patch\",\"path\",\"patient\",\"patrol\",\"pattern\",\"pause\",\"pave\",\"payment\",\"peace\",\"peanut\",\"pear\",\"peasant\",\"pelican\",\"pen\",\"penalty\",\"pencil\",\"people\",\"pepper\",\"perfect\",\"permit\",\"person\",\"pet\",\"phone\",\"photo\",\"phrase\",\"physical\",\"piano\",\"picnic\",\"picture\",\"piece\",\"pig\",\"pigeon\",\"pill\",\"pilot\",\"pink\",\"pioneer\",\"pipe\",\"pistol\",\"pitch\",\"pizza\",\"place\",\"planet\",\"plastic\",\"plate\",\"play\",\"please\",\"pledge\",\"pluck\",\"plug\",\"plunge\",\"poem\",\"poet\",\"point\",\"polar\",\"pole\",\"police\",\"pond\",\"pony\",\"pool\",\"popular\",\"portion\",\"position\",\"possible\",\"post\",\"potato\",\"pottery\",\"poverty\",\"powder\",\"power\",\"practice\",\"praise\",\"predict\",\"prefer\",\"prepare\",\"present\",\"pretty\",\"prevent\",\"price\",\"pride\",\"primary\",\"print\",\"priority\",\"prison\",\"private\",\"prize\",\"problem\",\"process\",\"produce\",\"profit\",\"program\",\"project\",\"promote\",\"proof\",\"property\",\"prosper\",\"protect\",\"proud\",\"provide\",\"public\",\"pudding\",\"pull\",\"pulp\",\"pulse\",\"pumpkin\",\"punch\",\"pupil\",\"puppy\",\"purchase\",\"purity\",\"purpose\",\"purse\",\"push\",\"put\",\"puzzle\",\"pyramid\",\"quality\",\"quantum\",\"quarter\",\"question\",\"quick\",\"quit\",\"quiz\",\"quote\",\"rabbit\",\"raccoon\",\"race\",\"rack\",\"radar\",\"radio\",\"rail\",\"rain\",\"raise\",\"rally\",\"ramp\",\"ranch\",\"random\",\"range\",\"rapid\",\"rare\",\"rate\",\"rather\",\"raven\",\"raw\",\"razor\",\"ready\",\"real\",\"reason\",\"rebel\",\"rebuild\",\"recall\",\"receive\",\"recipe\",\"record\",\"recycle\",\"reduce\",\"reflect\",\"reform\",\"refuse\",\"region\",\"regret\",\"regular\",\"reject\",\"relax\",\"release\",\"relief\",\"rely\",\"remain\",\"remember\",\"remind\",\"remove\",\"render\",\"renew\",\"rent\",\"reopen\",\"repair\",\"repeat\",\"replace\",\"report\",\"require\",\"rescue\",\"resemble\",\"resist\",\"resource\",\"response\",\"result\",\"retire\",\"retreat\",\"return\",\"reunion\",\"reveal\",\"review\",\"reward\",\"rhythm\",\"rib\",\"ribbon\",\"rice\",\"rich\",\"ride\",\"ridge\",\"rifle\",\"right\",\"rigid\",\"ring\",\"riot\",\"ripple\",\"risk\",\"ritual\",\"rival\",\"river\",\"road\",\"roast\",\"robot\",\"robust\",\"rocket\",\"romance\",\"roof\",\"rookie\",\"room\",\"rose\",\"rotate\",\"rough\",\"round\",\"route\",\"royal\",\"rubber\",\"rude\",\"rug\",\"rule\",\"run\",\"runway\",\"rural\",\"sad\",\"saddle\",\"sadness\",\"safe\",\"sail\",\"salad\",\"salmon\",\"salon\",\"salt\",\"salute\",\"same\",\"sample\",\"sand\",\"satisfy\",\"satoshi\",\"sauce\",\"sausage\",\"save\",\"say\",\"scale\",\"scan\",\"scare\",\"scatter\",\"scene\",\"scheme\",\"school\",\"science\",\"scissors\",\"scorpion\",\"scout\",\"scrap\",\"screen\",\"script\",\"scrub\",\"sea\",\"search\",\"season\",\"seat\",\"second\",\"secret\",\"section\",\"security\",\"seed\",\"seek\",\"segment\",\"select\",\"sell\",\"seminar\",\"senior\",\"sense\",\"sentence\",\"series\",\"service\",\"session\",\"settle\",\"setup\",\"seven\",\"shadow\",\"shaft\",\"shallow\",\"share\",\"shed\",\"shell\",\"sheriff\",\"shield\",\"shift\",\"shine\",\"ship\",\"shiver\",\"shock\",\"shoe\",\"shoot\",\"shop\",\"short\",\"shoulder\",\"shove\",\"shrimp\",\"shrug\",\"shuffle\",\"shy\",\"sibling\",\"sick\",\"side\",\"siege\",\"sight\",\"sign\",\"silent\",\"silk\",\"silly\",\"silver\",\"similar\",\"simple\",\"since\",\"sing\",\"siren\",\"sister\",\"situate\",\"six\",\"size\",\"skate\",\"sketch\",\"ski\",\"skill\",\"skin\",\"skirt\",\"skull\",\"slab\",\"slam\",\"sleep\",\"slender\",\"slice\",\"slide\",\"slight\",\"slim\",\"slogan\",\"slot\",\"slow\",\"slush\",\"small\",\"smart\",\"smile\",\"smoke\",\"smooth\",\"snack\",\"snake\",\"snap\",\"sniff\",\"snow\",\"soap\",\"soccer\",\"social\",\"sock\",\"soda\",\"soft\",\"solar\",\"soldier\",\"solid\",\"solution\",\"solve\",\"someone\",\"song\",\"soon\",\"sorry\",\"sort\",\"soul\",\"sound\",\"soup\",\"source\",\"south\",\"space\",\"spare\",\"spatial\",\"spawn\",\"speak\",\"special\",\"speed\",\"spell\",\"spend\",\"sphere\",\"spice\",\"spider\",\"spike\",\"spin\",\"spirit\",\"split\",\"spoil\",\"sponsor\",\"spoon\",\"sport\",\"spot\",\"spray\",\"spread\",\"spring\",\"spy\",\"square\",\"squeeze\",\"squirrel\",\"stable\",\"stadium\",\"staff\",\"stage\",\"stairs\",\"stamp\",\"stand\",\"start\",\"state\",\"stay\",\"steak\",\"steel\",\"stem\",\"step\",\"stereo\",\"stick\",\"still\",\"sting\",\"stock\",\"stomach\",\"stone\",\"stool\",\"story\",\"stove\",\"strategy\",\"street\",\"strike\",\"strong\",\"struggle\",\"student\",\"stuff\",\"stumble\",\"style\",\"subject\",\"submit\",\"subway\",\"success\",\"such\",\"sudden\",\"suffer\",\"sugar\",\"suggest\",\"suit\",\"summer\",\"sun\",\"sunny\",\"sunset\",\"super\",\"supply\",\"supreme\",\"sure\",\"surface\",\"surge\",\"surprise\",\"surround\",\"survey\",\"suspect\",\"sustain\",\"swallow\",\"swamp\",\"swap\",\"swarm\",\"swear\",\"sweet\",\"swift\",\"swim\",\"swing\",\"switch\",\"sword\",\"symbol\",\"symptom\",\"syrup\",\"system\",\"table\",\"tackle\",\"tag\",\"tail\",\"talent\",\"talk\",\"tank\",\"tape\",\"target\",\"task\",\"taste\",\"tattoo\",\"taxi\",\"teach\",\"team\",\"tell\",\"ten\",\"tenant\",\"tennis\",\"tent\",\"term\",\"test\",\"text\",\"thank\",\"that\",\"theme\",\"then\",\"theory\",\"there\",\"they\",\"thing\",\"this\",\"thought\",\"three\",\"thrive\",\"throw\",\"thumb\",\"thunder\",\"ticket\",\"tide\",\"tiger\",\"tilt\",\"timber\",\"time\",\"tiny\",\"tip\",\"tired\",\"tissue\",\"title\",\"toast\",\"tobacco\",\"today\",\"toddler\",\"toe\",\"together\",\"toilet\",\"token\",\"tomato\",\"tomorrow\",\"tone\",\"tongue\",\"tonight\",\"tool\",\"tooth\",\"top\",\"topic\",\"topple\",\"torch\",\"tornado\",\"tortoise\",\"toss\",\"total\",\"tourist\",\"toward\",\"tower\",\"town\",\"toy\",\"track\",\"trade\",\"traffic\",\"tragic\",\"train\",\"transfer\",\"trap\",\"trash\",\"travel\",\"tray\",\"treat\",\"tree\",\"trend\",\"trial\",\"tribe\",\"trick\",\"trigger\",\"trim\",\"trip\",\"trophy\",\"trouble\",\"truck\",\"true\",\"truly\",\"trumpet\",\"trust\",\"truth\",\"try\",\"tube\",\"tuition\",\"tumble\",\"tuna\",\"tunnel\",\"turkey\",\"turn\",\"turtle\",\"twelve\",\"twenty\",\"twice\",\"twin\",\"twist\",\"two\",\"type\",\"typical\",\"ugly\",\"umbrella\",\"unable\",\"unaware\",\"uncle\",\"uncover\",\"under\",\"undo\",\"unfair\",\"unfold\",\"unhappy\",\"uniform\",\"unique\",\"unit\",\"universe\",\"unknown\",\"unlock\",\"until\",\"unusual\",\"unveil\",\"update\",\"upgrade\",\"uphold\",\"upon\",\"upper\",\"upset\",\"urban\",\"urge\",\"usage\",\"use\",\"used\",\"useful\",\"useless\",\"usual\",\"utility\",\"vacant\",\"vacuum\",\"vague\",\"valid\",\"valley\",\"valve\",\"van\",\"vanish\",\"vapor\",\"various\",\"vast\",\"vault\",\"vehicle\",\"velvet\",\"vendor\",\"venture\",\"venue\",\"verb\",\"verify\",\"version\",\"very\",\"vessel\",\"veteran\",\"viable\",\"vibrant\",\"vicious\",\"victory\",\"video\",\"view\",\"village\",\"vintage\",\"violin\",\"virtual\",\"virus\",\"visa\",\"visit\",\"visual\",\"vital\",\"vivid\",\"vocal\",\"voice\",\"void\",\"volcano\",\"volume\",\"vote\",\"voyage\",\"wage\",\"wagon\",\"wait\",\"walk\",\"wall\",\"walnut\",\"want\",\"warfare\",\"warm\",\"warrior\",\"wash\",\"wasp\",\"waste\",\"water\",\"wave\",\"way\",\"wealth\",\"weapon\",\"wear\",\"weasel\",\"weather\",\"web\",\"wedding\",\"weekend\",\"weird\",\"welcome\",\"west\",\"wet\",\"whale\",\"what\",\"wheat\",\"wheel\",\"when\",\"where\",\"whip\",\"whisper\",\"wide\",\"width\",\"wife\",\"wild\",\"will\",\"win\",\"window\",\"wine\",\"wing\",\"wink\",\"winner\",\"winter\",\"wire\",\"wisdom\",\"wise\",\"wish\",\"witness\",\"wolf\",\"woman\",\"wonder\",\"wood\",\"wool\",\"word\",\"work\",\"world\",\"worry\",\"worth\",\"wrap\",\"wreck\",\"wrestle\",\"wrist\",\"write\",\"wrong\",\"yard\",\"year\",\"yellow\",\"you\",\"young\",\"youth\",\"zebra\",\"zero\",\"zone\",\"zoo\"][\"abaisser\",\"abandon\",\"abdiquer\",\"abeille\",\"abolir\",\"aborder\",\"aboutir\",\"aboyer\",\"abrasif\",\"abreuver\",\"abriter\",\"abroger\",\"abrupt\",\"absence\",\"absolu\",\"absurde\",\"abusif\",\"abyssal\",\"académie\",\"acajou\",\"acarien\",\"accabler\",\"accepter\",\"acclamer\",\"accolade\",\"accroche\",\"accuser\",\"acerbe\",\"achat\",\"acheter\",\"aciduler\",\"acier\",\"acompte\",\"acquérir\",\"acronyme\",\"acteur\",\"actif\",\"actuel\",\"adepte\",\"adéquat\",\"adhésif\",\"adjectif\",\"adjuger\",\"admettre\",\"admirer\",\"adopter\",\"adorer\",\"adoucir\",\"adresse\",\"adroit\",\"adulte\",\"adverbe\",\"aérer\",\"aéronef\",\"affaire\",\"affecter\",\"affiche\",\"affreux\",\"affubler\",\"agacer\",\"agencer\",\"agile\",\"agiter\",\"agrafer\",\"agréable\",\"agrume\",\"aider\",\"aiguille\",\"ailier\",\"aimable\",\"aisance\",\"ajouter\",\"ajuster\",\"alarmer\",\"alchimie\",\"alerte\",\"algèbre\",\"algue\",\"aliéner\",\"aliment\",\"alléger\",\"alliage\",\"allouer\",\"allumer\",\"alourdir\",\"alpaga\",\"altesse\",\"alvéole\",\"amateur\",\"ambigu\",\"ambre\",\"aménager\",\"amertume\",\"amidon\",\"amiral\",\"amorcer\",\"amour\",\"amovible\",\"amphibie\",\"ampleur\",\"amusant\",\"analyse\",\"anaphore\",\"anarchie\",\"anatomie\",\"ancien\",\"anéantir\",\"angle\",\"angoisse\",\"anguleux\",\"animal\",\"annexer\",\"annonce\",\"annuel\",\"anodin\",\"anomalie\",\"anonyme\",\"anormal\",\"antenne\",\"antidote\",\"anxieux\",\"apaiser\",\"apéritif\",\"aplanir\",\"apologie\",\"appareil\",\"appeler\",\"apporter\",\"appuyer\",\"aquarium\",\"aqueduc\",\"arbitre\",\"arbuste\",\"ardeur\",\"ardoise\",\"argent\",\"arlequin\",\"armature\",\"armement\",\"armoire\",\"armure\",\"arpenter\",\"arracher\",\"arriver\",\"arroser\",\"arsenic\",\"artériel\",\"article\",\"aspect\",\"asphalte\",\"aspirer\",\"assaut\",\"asservir\",\"assiette\",\"associer\",\"assurer\",\"asticot\",\"astre\",\"astuce\",\"atelier\",\"atome\",\"atrium\",\"atroce\",\"attaque\",\"attentif\",\"attirer\",\"attraper\",\"aubaine\",\"auberge\",\"audace\",\"audible\",\"augurer\",\"aurore\",\"automne\",\"autruche\",\"avaler\",\"avancer\",\"avarice\",\"avenir\",\"averse\",\"aveugle\",\"aviateur\",\"avide\",\"avion\",\"aviser\",\"avoine\",\"avouer\",\"avril\",\"axial\",\"axiome\",\"badge\",\"bafouer\",\"bagage\",\"baguette\",\"baignade\",\"balancer\",\"balcon\",\"baleine\",\"balisage\",\"bambin\",\"bancaire\",\"bandage\",\"banlieue\",\"bannière\",\"banquier\",\"barbier\",\"baril\",\"baron\",\"barque\",\"barrage\",\"bassin\",\"bastion\",\"bataille\",\"bateau\",\"batterie\",\"baudrier\",\"bavarder\",\"belette\",\"bélier\",\"belote\",\"bénéfice\",\"berceau\",\"berger\",\"berline\",\"bermuda\",\"besace\",\"besogne\",\"bétail\",\"beurre\",\"biberon\",\"bicycle\",\"bidule\",\"bijou\",\"bilan\",\"bilingue\",\"billard\",\"binaire\",\"biologie\",\"biopsie\",\"biotype\",\"biscuit\",\"bison\",\"bistouri\",\"bitume\",\"bizarre\",\"blafard\",\"blague\",\"blanchir\",\"blessant\",\"blinder\",\"blond\",\"bloquer\",\"blouson\",\"bobard\",\"bobine\",\"boire\",\"boiser\",\"bolide\",\"bonbon\",\"bondir\",\"bonheur\",\"bonifier\",\"bonus\",\"bordure\",\"borne\",\"botte\",\"boucle\",\"boueux\",\"bougie\",\"boulon\",\"bouquin\",\"bourse\",\"boussole\",\"boutique\",\"boxeur\",\"branche\",\"brasier\",\"brave\",\"brebis\",\"brèche\",\"breuvage\",\"bricoler\",\"brigade\",\"brillant\",\"brioche\",\"brique\",\"brochure\",\"broder\",\"bronzer\",\"brousse\",\"broyeur\",\"brume\",\"brusque\",\"brutal\",\"bruyant\",\"buffle\",\"buisson\",\"bulletin\",\"bureau\",\"burin\",\"bustier\",\"butiner\",\"butoir\",\"buvable\",\"buvette\",\"cabanon\",\"cabine\",\"cachette\",\"cadeau\",\"cadre\",\"caféine\",\"caillou\",\"caisson\",\"calculer\",\"calepin\",\"calibre\",\"calmer\",\"calomnie\",\"calvaire\",\"camarade\",\"caméra\",\"camion\",\"campagne\",\"canal\",\"caneton\",\"canon\",\"cantine\",\"canular\",\"capable\",\"caporal\",\"caprice\",\"capsule\",\"capter\",\"capuche\",\"carabine\",\"carbone\",\"caresser\",\"caribou\",\"carnage\",\"carotte\",\"carreau\",\"carton\",\"cascade\",\"casier\",\"casque\",\"cassure\",\"causer\",\"caution\",\"cavalier\",\"caverne\",\"caviar\",\"cédille\",\"ceinture\",\"céleste\",\"cellule\",\"cendrier\",\"censurer\",\"central\",\"cercle\",\"cérébral\",\"cerise\",\"cerner\",\"cerveau\",\"cesser\",\"chagrin\",\"chaise\",\"chaleur\",\"chambre\",\"chance\",\"chapitre\",\"charbon\",\"chasseur\",\"chaton\",\"chausson\",\"chavirer\",\"chemise\",\"chenille\",\"chéquier\",\"chercher\",\"cheval\",\"chien\",\"chiffre\",\"chignon\",\"chimère\",\"chiot\",\"chlorure\",\"chocolat\",\"choisir\",\"chose\",\"chouette\",\"chrome\",\"chute\",\"cigare\",\"cigogne\",\"cimenter\",\"cinéma\",\"cintrer\",\"circuler\",\"cirer\",\"cirque\",\"citerne\",\"citoyen\",\"citron\",\"civil\",\"clairon\",\"clameur\",\"claquer\",\"classe\",\"clavier\",\"client\",\"cligner\",\"climat\",\"clivage\",\"cloche\",\"clonage\",\"cloporte\",\"cobalt\",\"cobra\",\"cocasse\",\"cocotier\",\"coder\",\"codifier\",\"coffre\",\"cogner\",\"cohésion\",\"coiffer\",\"coincer\",\"colère\",\"colibri\",\"colline\",\"colmater\",\"colonel\",\"combat\",\"comédie\",\"commande\",\"compact\",\"concert\",\"conduire\",\"confier\",\"congeler\",\"connoter\",\"consonne\",\"contact\",\"convexe\",\"copain\",\"copie\",\"corail\",\"corbeau\",\"cordage\",\"corniche\",\"corpus\",\"correct\",\"cortège\",\"cosmique\",\"costume\",\"coton\",\"coude\",\"coupure\",\"courage\",\"couteau\",\"couvrir\",\"coyote\",\"crabe\",\"crainte\",\"cravate\",\"crayon\",\"créature\",\"créditer\",\"crémeux\",\"creuser\",\"crevette\",\"cribler\",\"crier\",\"cristal\",\"critère\",\"croire\",\"croquer\",\"crotale\",\"crucial\",\"cruel\",\"crypter\",\"cubique\",\"cueillir\",\"cuillère\",\"cuisine\",\"cuivre\",\"culminer\",\"cultiver\",\"cumuler\",\"cupide\",\"curatif\",\"curseur\",\"cyanure\",\"cycle\",\"cylindre\",\"cynique\",\"daigner\",\"damier\",\"danger\",\"danseur\",\"dauphin\",\"débattre\",\"débiter\",\"déborder\",\"débrider\",\"débutant\",\"décaler\",\"décembre\",\"déchirer\",\"décider\",\"déclarer\",\"décorer\",\"décrire\",\"décupler\",\"dédale\",\"déductif\",\"déesse\",\"défensif\",\"défiler\",\"défrayer\",\"dégager\",\"dégivrer\",\"déglutir\",\"dégrafer\",\"déjeuner\",\"délice\",\"déloger\",\"demander\",\"demeurer\",\"démolir\",\"dénicher\",\"dénouer\",\"dentelle\",\"dénuder\",\"départ\",\"dépenser\",\"déphaser\",\"déplacer\",\"déposer\",\"déranger\",\"dérober\",\"désastre\",\"descente\",\"désert\",\"désigner\",\"désobéir\",\"dessiner\",\"destrier\",\"détacher\",\"détester\",\"détourer\",\"détresse\",\"devancer\",\"devenir\",\"deviner\",\"devoir\",\"diable\",\"dialogue\",\"diamant\",\"dicter\",\"différer\",\"digérer\",\"digital\",\"digne\",\"diluer\",\"dimanche\",\"diminuer\",\"dioxyde\",\"directif\",\"diriger\",\"discuter\",\"disposer\",\"dissiper\",\"distance\",\"divertir\",\"diviser\",\"docile\",\"docteur\",\"dogme\",\"doigt\",\"domaine\",\"domicile\",\"dompter\",\"donateur\",\"donjon\",\"donner\",\"dopamine\",\"dortoir\",\"dorure\",\"dosage\",\"doseur\",\"dossier\",\"dotation\",\"douanier\",\"double\",\"douceur\",\"douter\",\"doyen\",\"dragon\",\"draper\",\"dresser\",\"dribbler\",\"droiture\",\"duperie\",\"duplexe\",\"durable\",\"durcir\",\"dynastie\",\"éblouir\",\"écarter\",\"écharpe\",\"échelle\",\"éclairer\",\"éclipse\",\"éclore\",\"écluse\",\"école\",\"économie\",\"écorce\",\"écouter\",\"écraser\",\"écrémer\",\"écrivain\",\"écrou\",\"écume\",\"écureuil\",\"édifier\",\"éduquer\",\"effacer\",\"effectif\",\"effigie\",\"effort\",\"effrayer\",\"effusion\",\"égaliser\",\"égarer\",\"éjecter\",\"élaborer\",\"élargir\",\"électron\",\"élégant\",\"éléphant\",\"élève\",\"éligible\",\"élitisme\",\"éloge\",\"élucider\",\"éluder\",\"emballer\",\"embellir\",\"embryon\",\"émeraude\",\"émission\",\"emmener\",\"émotion\",\"émouvoir\",\"empereur\",\"employer\",\"emporter\",\"emprise\",\"émulsion\",\"encadrer\",\"enchère\",\"enclave\",\"encoche\",\"endiguer\",\"endosser\",\"endroit\",\"enduire\",\"énergie\",\"enfance\",\"enfermer\",\"enfouir\",\"engager\",\"engin\",\"englober\",\"énigme\",\"enjamber\",\"enjeu\",\"enlever\",\"ennemi\",\"ennuyeux\",\"enrichir\",\"enrobage\",\"enseigne\",\"entasser\",\"entendre\",\"entier\",\"entourer\",\"entraver\",\"énumérer\",\"envahir\",\"enviable\",\"envoyer\",\"enzyme\",\"éolien\",\"épaissir\",\"épargne\",\"épatant\",\"épaule\",\"épicerie\",\"épidémie\",\"épier\",\"épilogue\",\"épine\",\"épisode\",\"épitaphe\",\"époque\",\"épreuve\",\"éprouver\",\"épuisant\",\"équerre\",\"équipe\",\"ériger\",\"érosion\",\"erreur\",\"éruption\",\"escalier\",\"espadon\",\"espèce\",\"espiègle\",\"espoir\",\"esprit\",\"esquiver\",\"essayer\",\"essence\",\"essieu\",\"essorer\",\"estime\",\"estomac\",\"estrade\",\"étagère\",\"étaler\",\"étanche\",\"étatique\",\"éteindre\",\"étendoir\",\"éternel\",\"éthanol\",\"éthique\",\"ethnie\",\"étirer\",\"étoffer\",\"étoile\",\"étonnant\",\"étourdir\",\"étrange\",\"étroit\",\"étude\",\"euphorie\",\"évaluer\",\"évasion\",\"éventail\",\"évidence\",\"éviter\",\"évolutif\",\"évoquer\",\"exact\",\"exagérer\",\"exaucer\",\"exceller\",\"excitant\",\"exclusif\",\"excuse\",\"exécuter\",\"exemple\",\"exercer\",\"exhaler\",\"exhorter\",\"exigence\",\"exiler\",\"exister\",\"exotique\",\"expédier\",\"explorer\",\"exposer\",\"exprimer\",\"exquis\",\"extensif\",\"extraire\",\"exulter\",\"fable\",\"fabuleux\",\"facette\",\"facile\",\"facture\",\"faiblir\",\"falaise\",\"fameux\",\"famille\",\"farceur\",\"farfelu\",\"farine\",\"farouche\",\"fasciner\",\"fatal\",\"fatigue\",\"faucon\",\"fautif\",\"faveur\",\"favori\",\"fébrile\",\"féconder\",\"fédérer\",\"félin\",\"femme\",\"fémur\",\"fendoir\",\"féodal\",\"fermer\",\"féroce\",\"ferveur\",\"festival\",\"feuille\",\"feutre\",\"février\",\"fiasco\",\"ficeler\",\"fictif\",\"fidèle\",\"figure\",\"filature\",\"filetage\",\"filière\",\"filleul\",\"filmer\",\"filou\",\"filtrer\",\"financer\",\"finir\",\"fiole\",\"firme\",\"fissure\",\"fixer\",\"flairer\",\"flamme\",\"flasque\",\"flatteur\",\"fléau\",\"flèche\",\"fleur\",\"flexion\",\"flocon\",\"flore\",\"fluctuer\",\"fluide\",\"fluvial\",\"folie\",\"fonderie\",\"fongible\",\"fontaine\",\"forcer\",\"forgeron\",\"formuler\",\"fortune\",\"fossile\",\"foudre\",\"fougère\",\"fouiller\",\"foulure\",\"fourmi\",\"fragile\",\"fraise\",\"franchir\",\"frapper\",\"frayeur\",\"frégate\",\"freiner\",\"frelon\",\"frémir\",\"frénésie\",\"frère\",\"friable\",\"friction\",\"frisson\",\"frivole\",\"froid\",\"fromage\",\"frontal\",\"frotter\",\"fruit\",\"fugitif\",\"fuite\",\"fureur\",\"furieux\",\"furtif\",\"fusion\",\"futur\",\"gagner\",\"galaxie\",\"galerie\",\"gambader\",\"garantir\",\"gardien\",\"garnir\",\"garrigue\",\"gazelle\",\"gazon\",\"géant\",\"gélatine\",\"gélule\",\"gendarme\",\"général\",\"génie\",\"genou\",\"gentil\",\"géologie\",\"géomètre\",\"géranium\",\"germe\",\"gestuel\",\"geyser\",\"gibier\",\"gicler\",\"girafe\",\"givre\",\"glace\",\"glaive\",\"glisser\",\"globe\",\"gloire\",\"glorieux\",\"golfeur\",\"gomme\",\"gonfler\",\"gorge\",\"gorille\",\"goudron\",\"gouffre\",\"goulot\",\"goupille\",\"gourmand\",\"goutte\",\"graduel\",\"graffiti\",\"graine\",\"grand\",\"grappin\",\"gratuit\",\"gravir\",\"grenat\",\"griffure\",\"griller\",\"grimper\",\"grogner\",\"gronder\",\"grotte\",\"groupe\",\"gruger\",\"grutier\",\"gruyère\",\"guépard\",\"guerrier\",\"guide\",\"guimauve\",\"guitare\",\"gustatif\",\"gymnaste\",\"gyrostat\",\"habitude\",\"hachoir\",\"halte\",\"hameau\",\"hangar\",\"hanneton\",\"haricot\",\"harmonie\",\"harpon\",\"hasard\",\"hélium\",\"hématome\",\"herbe\",\"hérisson\",\"hermine\",\"héron\",\"hésiter\",\"heureux\",\"hiberner\",\"hibou\",\"hilarant\",\"histoire\",\"hiver\",\"homard\",\"hommage\",\"homogène\",\"honneur\",\"honorer\",\"honteux\",\"horde\",\"horizon\",\"horloge\",\"hormone\",\"horrible\",\"houleux\",\"housse\",\"hublot\",\"huileux\",\"humain\",\"humble\",\"humide\",\"humour\",\"hurler\",\"hydromel\",\"hygiène\",\"hymne\",\"hypnose\",\"idylle\",\"ignorer\",\"iguane\",\"illicite\",\"illusion\",\"image\",\"imbiber\",\"imiter\",\"immense\",\"immobile\",\"immuable\",\"impact\",\"impérial\",\"implorer\",\"imposer\",\"imprimer\",\"imputer\",\"incarner\",\"incendie\",\"incident\",\"incliner\",\"incolore\",\"indexer\",\"indice\",\"inductif\",\"inédit\",\"ineptie\",\"inexact\",\"infini\",\"infliger\",\"informer\",\"infusion\",\"ingérer\",\"inhaler\",\"inhiber\",\"injecter\",\"injure\",\"innocent\",\"inoculer\",\"inonder\",\"inscrire\",\"insecte\",\"insigne\",\"insolite\",\"inspirer\",\"instinct\",\"insulter\",\"intact\",\"intense\",\"intime\",\"intrigue\",\"intuitif\",\"inutile\",\"invasion\",\"inventer\",\"inviter\",\"invoquer\",\"ironique\",\"irradier\",\"irréel\",\"irriter\",\"isoler\",\"ivoire\",\"ivresse\",\"jaguar\",\"jaillir\",\"jambe\",\"janvier\",\"jardin\",\"jauger\",\"jaune\",\"javelot\",\"jetable\",\"jeton\",\"jeudi\",\"jeunesse\",\"joindre\",\"joncher\",\"jongler\",\"joueur\",\"jouissif\",\"journal\",\"jovial\",\"joyau\",\"joyeux\",\"jubiler\",\"jugement\",\"junior\",\"jupon\",\"juriste\",\"justice\",\"juteux\",\"juvénile\",\"kayak\",\"kimono\",\"kiosque\",\"label\",\"labial\",\"labourer\",\"lacérer\",\"lactose\",\"lagune\",\"laine\",\"laisser\",\"laitier\",\"lambeau\",\"lamelle\",\"lampe\",\"lanceur\",\"langage\",\"lanterne\",\"lapin\",\"largeur\",\"larme\",\"laurier\",\"lavabo\",\"lavoir\",\"lecture\",\"légal\",\"léger\",\"légume\",\"lessive\",\"lettre\",\"levier\",\"lexique\",\"lézard\",\"liasse\",\"libérer\",\"libre\",\"licence\",\"licorne\",\"liège\",\"lièvre\",\"ligature\",\"ligoter\",\"ligue\",\"limer\",\"limite\",\"limonade\",\"limpide\",\"linéaire\",\"lingot\",\"lionceau\",\"liquide\",\"lisière\",\"lister\",\"lithium\",\"litige\",\"littoral\",\"livreur\",\"logique\",\"lointain\",\"loisir\",\"lombric\",\"loterie\",\"louer\",\"lourd\",\"loutre\",\"louve\",\"loyal\",\"lubie\",\"lucide\",\"lucratif\",\"lueur\",\"lugubre\",\"luisant\",\"lumière\",\"lunaire\",\"lundi\",\"luron\",\"lutter\",\"luxueux\",\"machine\",\"magasin\",\"magenta\",\"magique\",\"maigre\",\"maillon\",\"maintien\",\"mairie\",\"maison\",\"majorer\",\"malaxer\",\"maléfice\",\"malheur\",\"malice\",\"mallette\",\"mammouth\",\"mandater\",\"maniable\",\"manquant\",\"manteau\",\"manuel\",\"marathon\",\"marbre\",\"marchand\",\"mardi\",\"maritime\",\"marqueur\",\"marron\",\"marteler\",\"mascotte\",\"massif\",\"matériel\",\"matière\",\"matraque\",\"maudire\",\"maussade\",\"mauve\",\"maximal\",\"méchant\",\"méconnu\",\"médaille\",\"médecin\",\"méditer\",\"méduse\",\"meilleur\",\"mélange\",\"mélodie\",\"membre\",\"mémoire\",\"menacer\",\"mener\",\"menhir\",\"mensonge\",\"mentor\",\"mercredi\",\"mérite\",\"merle\",\"messager\",\"mesure\",\"métal\",\"météore\",\"méthode\",\"métier\",\"meuble\",\"miauler\",\"microbe\",\"miette\",\"mignon\",\"migrer\",\"milieu\",\"million\",\"mimique\",\"mince\",\"minéral\",\"minimal\",\"minorer\",\"minute\",\"miracle\",\"miroiter\",\"missile\",\"mixte\",\"mobile\",\"moderne\",\"moelleux\",\"mondial\",\"moniteur\",\"monnaie\",\"monotone\",\"monstre\",\"montagne\",\"monument\",\"moqueur\",\"morceau\",\"morsure\",\"mortier\",\"moteur\",\"motif\",\"mouche\",\"moufle\",\"moulin\",\"mousson\",\"mouton\",\"mouvant\",\"multiple\",\"munition\",\"muraille\",\"murène\",\"murmure\",\"muscle\",\"muséum\",\"musicien\",\"mutation\",\"muter\",\"mutuel\",\"myriade\",\"myrtille\",\"mystère\",\"mythique\",\"nageur\",\"nappe\",\"narquois\",\"narrer\",\"natation\",\"nation\",\"nature\",\"naufrage\",\"nautique\",\"navire\",\"nébuleux\",\"nectar\",\"néfaste\",\"négation\",\"négliger\",\"négocier\",\"neige\",\"nerveux\",\"nettoyer\",\"neurone\",\"neutron\",\"neveu\",\"niche\",\"nickel\",\"nitrate\",\"niveau\",\"noble\",\"nocif\",\"nocturne\",\"noirceur\",\"noisette\",\"nomade\",\"nombreux\",\"nommer\",\"normatif\",\"notable\",\"notifier\",\"notoire\",\"nourrir\",\"nouveau\",\"novateur\",\"novembre\",\"novice\",\"nuage\",\"nuancer\",\"nuire\",\"nuisible\",\"numéro\",\"nuptial\",\"nuque\",\"nutritif\",\"obéir\",\"objectif\",\"obliger\",\"obscur\",\"observer\",\"obstacle\",\"obtenir\",\"obturer\",\"occasion\",\"occuper\",\"océan\",\"octobre\",\"octroyer\",\"octupler\",\"oculaire\",\"odeur\",\"odorant\",\"offenser\",\"officier\",\"offrir\",\"ogive\",\"oiseau\",\"oisillon\",\"olfactif\",\"olivier\",\"ombrage\",\"omettre\",\"onctueux\",\"onduler\",\"onéreux\",\"onirique\",\"opale\",\"opaque\",\"opérer\",\"opinion\",\"opportun\",\"opprimer\",\"opter\",\"optique\",\"orageux\",\"orange\",\"orbite\",\"ordonner\",\"oreille\",\"organe\",\"orgueil\",\"orifice\",\"ornement\",\"orque\",\"ortie\",\"osciller\",\"osmose\",\"ossature\",\"otarie\",\"ouragan\",\"ourson\",\"outil\",\"outrager\",\"ouvrage\",\"ovation\",\"oxyde\",\"oxygène\",\"ozone\",\"paisible\",\"palace\",\"palmarès\",\"palourde\",\"palper\",\"panache\",\"panda\",\"pangolin\",\"paniquer\",\"panneau\",\"panorama\",\"pantalon\",\"papaye\",\"papier\",\"papoter\",\"papyrus\",\"paradoxe\",\"parcelle\",\"paresse\",\"parfumer\",\"parler\",\"parole\",\"parrain\",\"parsemer\",\"partager\",\"parure\",\"parvenir\",\"passion\",\"pastèque\",\"paternel\",\"patience\",\"patron\",\"pavillon\",\"pavoiser\",\"payer\",\"paysage\",\"peigne\",\"peintre\",\"pelage\",\"pélican\",\"pelle\",\"pelouse\",\"peluche\",\"pendule\",\"pénétrer\",\"pénible\",\"pensif\",\"pénurie\",\"pépite\",\"péplum\",\"perdrix\",\"perforer\",\"période\",\"permuter\",\"perplexe\",\"persil\",\"perte\",\"peser\",\"pétale\",\"petit\",\"pétrir\",\"peuple\",\"pharaon\",\"phobie\",\"phoque\",\"photon\",\"phrase\",\"physique\",\"piano\",\"pictural\",\"pièce\",\"pierre\",\"pieuvre\",\"pilote\",\"pinceau\",\"pipette\",\"piquer\",\"pirogue\",\"piscine\",\"piston\",\"pivoter\",\"pixel\",\"pizza\",\"placard\",\"plafond\",\"plaisir\",\"planer\",\"plaque\",\"plastron\",\"plateau\",\"pleurer\",\"plexus\",\"pliage\",\"plomb\",\"plonger\",\"pluie\",\"plumage\",\"pochette\",\"poésie\",\"poète\",\"pointe\",\"poirier\",\"poisson\",\"poivre\",\"polaire\",\"policier\",\"pollen\",\"polygone\",\"pommade\",\"pompier\",\"ponctuel\",\"pondérer\",\"poney\",\"portique\",\"position\",\"posséder\",\"posture\",\"potager\",\"poteau\",\"potion\",\"pouce\",\"poulain\",\"poumon\",\"pourpre\",\"poussin\",\"pouvoir\",\"prairie\",\"pratique\",\"précieux\",\"prédire\",\"préfixe\",\"prélude\",\"prénom\",\"présence\",\"prétexte\",\"prévoir\",\"primitif\",\"prince\",\"prison\",\"priver\",\"problème\",\"procéder\",\"prodige\",\"profond\",\"progrès\",\"proie\",\"projeter\",\"prologue\",\"promener\",\"propre\",\"prospère\",\"protéger\",\"prouesse\",\"proverbe\",\"prudence\",\"pruneau\",\"psychose\",\"public\",\"puceron\",\"puiser\",\"pulpe\",\"pulsar\",\"punaise\",\"punitif\",\"pupitre\",\"purifier\",\"puzzle\",\"pyramide\",\"quasar\",\"querelle\",\"question\",\"quiétude\",\"quitter\",\"quotient\",\"racine\",\"raconter\",\"radieux\",\"ragondin\",\"raideur\",\"raisin\",\"ralentir\",\"rallonge\",\"ramasser\",\"rapide\",\"rasage\",\"ratisser\",\"ravager\",\"ravin\",\"rayonner\",\"réactif\",\"réagir\",\"réaliser\",\"réanimer\",\"recevoir\",\"réciter\",\"réclamer\",\"récolter\",\"recruter\",\"reculer\",\"recycler\",\"rédiger\",\"redouter\",\"refaire\",\"réflexe\",\"réformer\",\"refrain\",\"refuge\",\"régalien\",\"région\",\"réglage\",\"régulier\",\"réitérer\",\"rejeter\",\"rejouer\",\"relatif\",\"relever\",\"relief\",\"remarque\",\"remède\",\"remise\",\"remonter\",\"remplir\",\"remuer\",\"renard\",\"renfort\",\"renifler\",\"renoncer\",\"rentrer\",\"renvoi\",\"replier\",\"reporter\",\"reprise\",\"reptile\",\"requin\",\"réserve\",\"résineux\",\"résoudre\",\"respect\",\"rester\",\"résultat\",\"rétablir\",\"retenir\",\"réticule\",\"retomber\",\"retracer\",\"réunion\",\"réussir\",\"revanche\",\"revivre\",\"révolte\",\"révulsif\",\"richesse\",\"rideau\",\"rieur\",\"rigide\",\"rigoler\",\"rincer\",\"riposter\",\"risible\",\"risque\",\"rituel\",\"rival\",\"rivière\",\"rocheux\",\"romance\",\"rompre\",\"ronce\",\"rondin\",\"roseau\",\"rosier\",\"rotatif\",\"rotor\",\"rotule\",\"rouge\",\"rouille\",\"rouleau\",\"routine\",\"royaume\",\"ruban\",\"rubis\",\"ruche\",\"ruelle\",\"rugueux\",\"ruiner\",\"ruisseau\",\"ruser\",\"rustique\",\"rythme\",\"sabler\",\"saboter\",\"sabre\",\"sacoche\",\"safari\",\"sagesse\",\"saisir\",\"salade\",\"salive\",\"salon\",\"saluer\",\"samedi\",\"sanction\",\"sanglier\",\"sarcasme\",\"sardine\",\"saturer\",\"saugrenu\",\"saumon\",\"sauter\",\"sauvage\",\"savant\",\"savonner\",\"scalpel\",\"scandale\",\"scélérat\",\"scénario\",\"sceptre\",\"schéma\",\"science\",\"scinder\",\"score\",\"scrutin\",\"sculpter\",\"séance\",\"sécable\",\"sécher\",\"secouer\",\"sécréter\",\"sédatif\",\"séduire\",\"seigneur\",\"séjour\",\"sélectif\",\"semaine\",\"sembler\",\"semence\",\"séminal\",\"sénateur\",\"sensible\",\"sentence\",\"séparer\",\"séquence\",\"serein\",\"sergent\",\"sérieux\",\"serrure\",\"sérum\",\"service\",\"sésame\",\"sévir\",\"sevrage\",\"sextuple\",\"sidéral\",\"siècle\",\"siéger\",\"siffler\",\"sigle\",\"signal\",\"silence\",\"silicium\",\"simple\",\"sincère\",\"sinistre\",\"siphon\",\"sirop\",\"sismique\",\"situer\",\"skier\",\"social\",\"socle\",\"sodium\",\"soigneux\",\"soldat\",\"soleil\",\"solitude\",\"soluble\",\"sombre\",\"sommeil\",\"somnoler\",\"sonde\",\"songeur\",\"sonnette\",\"sonore\",\"sorcier\",\"sortir\",\"sosie\",\"sottise\",\"soucieux\",\"soudure\",\"souffle\",\"soulever\",\"soupape\",\"source\",\"soutirer\",\"souvenir\",\"spacieux\",\"spatial\",\"spécial\",\"sphère\",\"spiral\",\"stable\",\"station\",\"sternum\",\"stimulus\",\"stipuler\",\"strict\",\"studieux\",\"stupeur\",\"styliste\",\"sublime\",\"substrat\",\"subtil\",\"subvenir\",\"succès\",\"sucre\",\"suffixe\",\"suggérer\",\"suiveur\",\"sulfate\",\"superbe\",\"supplier\",\"surface\",\"suricate\",\"surmener\",\"surprise\",\"sursaut\",\"survie\",\"suspect\",\"syllabe\",\"symbole\",\"symétrie\",\"synapse\",\"syntaxe\",\"système\",\"tabac\",\"tablier\",\"tactile\",\"tailler\",\"talent\",\"talisman\",\"talonner\",\"tambour\",\"tamiser\",\"tangible\",\"tapis\",\"taquiner\",\"tarder\",\"tarif\",\"tartine\",\"tasse\",\"tatami\",\"tatouage\",\"taupe\",\"taureau\",\"taxer\",\"témoin\",\"temporel\",\"tenaille\",\"tendre\",\"teneur\",\"tenir\",\"tension\",\"terminer\",\"terne\",\"terrible\",\"tétine\",\"texte\",\"thème\",\"théorie\",\"thérapie\",\"thorax\",\"tibia\",\"tiède\",\"timide\",\"tirelire\",\"tiroir\",\"tissu\",\"titane\",\"titre\",\"tituber\",\"toboggan\",\"tolérant\",\"tomate\",\"tonique\",\"tonneau\",\"toponyme\",\"torche\",\"tordre\",\"tornade\",\"torpille\",\"torrent\",\"torse\",\"tortue\",\"totem\",\"toucher\",\"tournage\",\"tousser\",\"toxine\",\"traction\",\"trafic\",\"tragique\",\"trahir\",\"train\",\"trancher\",\"travail\",\"trèfle\",\"tremper\",\"trésor\",\"treuil\",\"triage\",\"tribunal\",\"tricoter\",\"trilogie\",\"triomphe\",\"tripler\",\"triturer\",\"trivial\",\"trombone\",\"tronc\",\"tropical\",\"troupeau\",\"tuile\",\"tulipe\",\"tumulte\",\"tunnel\",\"turbine\",\"tuteur\",\"tutoyer\",\"tuyau\",\"tympan\",\"typhon\",\"typique\",\"tyran\",\"ubuesque\",\"ultime\",\"ultrason\",\"unanime\",\"unifier\",\"union\",\"unique\",\"unitaire\",\"univers\",\"uranium\",\"urbain\",\"urticant\",\"usage\",\"usine\",\"usuel\",\"usure\",\"utile\",\"utopie\",\"vacarme\",\"vaccin\",\"vagabond\",\"vague\",\"vaillant\",\"vaincre\",\"vaisseau\",\"valable\",\"valise\",\"vallon\",\"valve\",\"vampire\",\"vanille\",\"vapeur\",\"varier\",\"vaseux\",\"vassal\",\"vaste\",\"vecteur\",\"vedette\",\"végétal\",\"véhicule\",\"veinard\",\"véloce\",\"vendredi\",\"vénérer\",\"venger\",\"venimeux\",\"ventouse\",\"verdure\",\"vérin\",\"vernir\",\"verrou\",\"verser\",\"vertu\",\"veston\",\"vétéran\",\"vétuste\",\"vexant\",\"vexer\",\"viaduc\",\"viande\",\"victoire\",\"vidange\",\"vidéo\",\"vignette\",\"vigueur\",\"vilain\",\"village\",\"vinaigre\",\"violon\",\"vipère\",\"virement\",\"virtuose\",\"virus\",\"visage\",\"viseur\",\"vision\",\"visqueux\",\"visuel\",\"vital\",\"vitesse\",\"viticole\",\"vitrine\",\"vivace\",\"vivipare\",\"vocation\",\"voguer\",\"voile\",\"voisin\",\"voiture\",\"volaille\",\"volcan\",\"voltiger\",\"volume\",\"vorace\",\"vortex\",\"voter\",\"vouloir\",\"voyage\",\"voyelle\",\"wagon\",\"xénon\",\"yacht\",\"zèbre\",\"zénith\",\"zeste\",\"zoologie\"]// note all JSON files in this folder are generated with npm run generate-wordlist\nconst lookup = require('./lookup.json')\n\nmodule.exports = {\n  loadWordlist,\n  detectLanguage\n}\n\nfunction loadWordlist (language) {\n  switch (language) {\n    case 'chinese_simplified': return require('./chinese_simplified.json')\n    case 'chinese_traditional': return require('./chinese_traditional.json')\n    case 'czech': return require('./czech.json')\n    case 'english': return require('./english.json')\n    case 'french': return require('./french.json')\n    case 'italian': return require('./italian.json')\n    case 'japanese': return require('./japanese.json')\n    case 'korean': return require('./korean.json')\n    case 'portuguese': return require('./portuguese.json')\n    case 'russian': return require('./russian.json')\n    case 'spanish': return require('./spanish.json')\n    case 'turkish': return require('./turkish.json')\n  }\n\n  throw new Error('Unknown language: ' + language)\n}\n\nfunction detectLanguage (words) {\n  let candidate = null\n\n  for (const word of words) {\n    const languages = lookup[word]\n    if (!languages) return null\n\n    if (languages.length === 1) return languages[0]\n\n    if (!candidate) {\n      candidate = languages\n      continue\n    }\n\n    const intersect = candidate.filter(l => languages.includes(l))\n    if (intersect.length === 1) return intersect[0]\n  }\n\n  return candidate[0]\n}\n[\"abaco\",\"abbaglio\",\"abbinato\",\"abete\",\"abisso\",\"abolire\",\"abrasivo\",\"abrogato\",\"accadere\",\"accenno\",\"accusato\",\"acetone\",\"achille\",\"acido\",\"acqua\",\"acre\",\"acrilico\",\"acrobata\",\"acuto\",\"adagio\",\"addebito\",\"addome\",\"adeguato\",\"aderire\",\"adipe\",\"adottare\",\"adulare\",\"affabile\",\"affetto\",\"affisso\",\"affranto\",\"aforisma\",\"afoso\",\"africano\",\"agave\",\"agente\",\"agevole\",\"aggancio\",\"agire\",\"agitare\",\"agonismo\",\"agricolo\",\"agrumeto\",\"aguzzo\",\"alabarda\",\"alato\",\"albatro\",\"alberato\",\"albo\",\"albume\",\"alce\",\"alcolico\",\"alettone\",\"alfa\",\"algebra\",\"aliante\",\"alibi\",\"alimento\",\"allagato\",\"allegro\",\"allievo\",\"allodola\",\"allusivo\",\"almeno\",\"alogeno\",\"alpaca\",\"alpestre\",\"altalena\",\"alterno\",\"alticcio\",\"altrove\",\"alunno\",\"alveolo\",\"alzare\",\"amalgama\",\"amanita\",\"amarena\",\"ambito\",\"ambrato\",\"ameba\",\"america\",\"ametista\",\"amico\",\"ammasso\",\"ammenda\",\"ammirare\",\"ammonito\",\"amore\",\"ampio\",\"ampliare\",\"amuleto\",\"anacardo\",\"anagrafe\",\"analista\",\"anarchia\",\"anatra\",\"anca\",\"ancella\",\"ancora\",\"andare\",\"andrea\",\"anello\",\"angelo\",\"angolare\",\"angusto\",\"anima\",\"annegare\",\"annidato\",\"anno\",\"annuncio\",\"anonimo\",\"anticipo\",\"anzi\",\"apatico\",\"apertura\",\"apode\",\"apparire\",\"appetito\",\"appoggio\",\"approdo\",\"appunto\",\"aprile\",\"arabica\",\"arachide\",\"aragosta\",\"araldica\",\"arancio\",\"aratura\",\"arazzo\",\"arbitro\",\"archivio\",\"ardito\",\"arenile\",\"argento\",\"argine\",\"arguto\",\"aria\",\"armonia\",\"arnese\",\"arredato\",\"arringa\",\"arrosto\",\"arsenico\",\"arso\",\"artefice\",\"arzillo\",\"asciutto\",\"ascolto\",\"asepsi\",\"asettico\",\"asfalto\",\"asino\",\"asola\",\"aspirato\",\"aspro\",\"assaggio\",\"asse\",\"assoluto\",\"assurdo\",\"asta\",\"astenuto\",\"astice\",\"astratto\",\"atavico\",\"ateismo\",\"atomico\",\"atono\",\"attesa\",\"attivare\",\"attorno\",\"attrito\",\"attuale\",\"ausilio\",\"austria\",\"autista\",\"autonomo\",\"autunno\",\"avanzato\",\"avere\",\"avvenire\",\"avviso\",\"avvolgere\",\"azione\",\"azoto\",\"azzimo\",\"azzurro\",\"babele\",\"baccano\",\"bacino\",\"baco\",\"badessa\",\"badilata\",\"bagnato\",\"baita\",\"balcone\",\"baldo\",\"balena\",\"ballata\",\"balzano\",\"bambino\",\"bandire\",\"baraonda\",\"barbaro\",\"barca\",\"baritono\",\"barlume\",\"barocco\",\"basilico\",\"basso\",\"batosta\",\"battuto\",\"baule\",\"bava\",\"bavosa\",\"becco\",\"beffa\",\"belgio\",\"belva\",\"benda\",\"benevole\",\"benigno\",\"benzina\",\"bere\",\"berlina\",\"beta\",\"bibita\",\"bici\",\"bidone\",\"bifido\",\"biga\",\"bilancia\",\"bimbo\",\"binocolo\",\"biologo\",\"bipede\",\"bipolare\",\"birbante\",\"birra\",\"biscotto\",\"bisesto\",\"bisnonno\",\"bisonte\",\"bisturi\",\"bizzarro\",\"blando\",\"blatta\",\"bollito\",\"bonifico\",\"bordo\",\"bosco\",\"botanico\",\"bottino\",\"bozzolo\",\"braccio\",\"bradipo\",\"brama\",\"branca\",\"bravura\",\"bretella\",\"brevetto\",\"brezza\",\"briglia\",\"brillante\",\"brindare\",\"broccolo\",\"brodo\",\"bronzina\",\"brullo\",\"bruno\",\"bubbone\",\"buca\",\"budino\",\"buffone\",\"buio\",\"bulbo\",\"buono\",\"burlone\",\"burrasca\",\"bussola\",\"busta\",\"cadetto\",\"caduco\",\"calamaro\",\"calcolo\",\"calesse\",\"calibro\",\"calmo\",\"caloria\",\"cambusa\",\"camerata\",\"camicia\",\"cammino\",\"camola\",\"campale\",\"canapa\",\"candela\",\"cane\",\"canino\",\"canotto\",\"cantina\",\"capace\",\"capello\",\"capitolo\",\"capogiro\",\"cappero\",\"capra\",\"capsula\",\"carapace\",\"carcassa\",\"cardo\",\"carisma\",\"carovana\",\"carretto\",\"cartolina\",\"casaccio\",\"cascata\",\"caserma\",\"caso\",\"cassone\",\"castello\",\"casuale\",\"catasta\",\"catena\",\"catrame\",\"cauto\",\"cavillo\",\"cedibile\",\"cedrata\",\"cefalo\",\"celebre\",\"cellulare\",\"cena\",\"cenone\",\"centesimo\",\"ceramica\",\"cercare\",\"certo\",\"cerume\",\"cervello\",\"cesoia\",\"cespo\",\"ceto\",\"chela\",\"chiaro\",\"chicca\",\"chiedere\",\"chimera\",\"china\",\"chirurgo\",\"chitarra\",\"ciao\",\"ciclismo\",\"cifrare\",\"cigno\",\"cilindro\",\"ciottolo\",\"circa\",\"cirrosi\",\"citrico\",\"cittadino\",\"ciuffo\",\"civetta\",\"civile\",\"classico\",\"clinica\",\"cloro\",\"cocco\",\"codardo\",\"codice\",\"coerente\",\"cognome\",\"collare\",\"colmato\",\"colore\",\"colposo\",\"coltivato\",\"colza\",\"coma\",\"cometa\",\"commando\",\"comodo\",\"computer\",\"comune\",\"conciso\",\"condurre\",\"conferma\",\"congelare\",\"coniuge\",\"connesso\",\"conoscere\",\"consumo\",\"continuo\",\"convegno\",\"coperto\",\"copione\",\"coppia\",\"copricapo\",\"corazza\",\"cordata\",\"coricato\",\"cornice\",\"corolla\",\"corpo\",\"corredo\",\"corsia\",\"cortese\",\"cosmico\",\"costante\",\"cottura\",\"covato\",\"cratere\",\"cravatta\",\"creato\",\"credere\",\"cremoso\",\"crescita\",\"creta\",\"criceto\",\"crinale\",\"crisi\",\"critico\",\"croce\",\"cronaca\",\"crostata\",\"cruciale\",\"crusca\",\"cucire\",\"cuculo\",\"cugino\",\"cullato\",\"cupola\",\"curatore\",\"cursore\",\"curvo\",\"cuscino\",\"custode\",\"dado\",\"daino\",\"dalmata\",\"damerino\",\"daniela\",\"dannoso\",\"danzare\",\"datato\",\"davanti\",\"davvero\",\"debutto\",\"decennio\",\"deciso\",\"declino\",\"decollo\",\"decreto\",\"dedicato\",\"definito\",\"deforme\",\"degno\",\"delegare\",\"delfino\",\"delirio\",\"delta\",\"demenza\",\"denotato\",\"dentro\",\"deposito\",\"derapata\",\"derivare\",\"deroga\",\"descritto\",\"deserto\",\"desiderio\",\"desumere\",\"detersivo\",\"devoto\",\"diametro\",\"dicembre\",\"diedro\",\"difeso\",\"diffuso\",\"digerire\",\"digitale\",\"diluvio\",\"dinamico\",\"dinnanzi\",\"dipinto\",\"diploma\",\"dipolo\",\"diradare\",\"dire\",\"dirotto\",\"dirupo\",\"disagio\",\"discreto\",\"disfare\",\"disgelo\",\"disposto\",\"distanza\",\"disumano\",\"dito\",\"divano\",\"divelto\",\"dividere\",\"divorato\",\"doblone\",\"docente\",\"doganale\",\"dogma\",\"dolce\",\"domato\",\"domenica\",\"dominare\",\"dondolo\",\"dono\",\"dormire\",\"dote\",\"dottore\",\"dovuto\",\"dozzina\",\"drago\",\"druido\",\"dubbio\",\"dubitare\",\"ducale\",\"duna\",\"duomo\",\"duplice\",\"duraturo\",\"ebano\",\"eccesso\",\"ecco\",\"eclissi\",\"economia\",\"edera\",\"edicola\",\"edile\",\"editoria\",\"educare\",\"egemonia\",\"egli\",\"egoismo\",\"egregio\",\"elaborato\",\"elargire\",\"elegante\",\"elencato\",\"eletto\",\"elevare\",\"elfico\",\"elica\",\"elmo\",\"elsa\",\"eluso\",\"emanato\",\"emblema\",\"emesso\",\"emiro\",\"emotivo\",\"emozione\",\"empirico\",\"emulo\",\"endemico\",\"enduro\",\"energia\",\"enfasi\",\"enoteca\",\"entrare\",\"enzima\",\"epatite\",\"epilogo\",\"episodio\",\"epocale\",\"eppure\",\"equatore\",\"erario\",\"erba\",\"erboso\",\"erede\",\"eremita\",\"erigere\",\"ermetico\",\"eroe\",\"erosivo\",\"errante\",\"esagono\",\"esame\",\"esanime\",\"esaudire\",\"esca\",\"esempio\",\"esercito\",\"esibito\",\"esigente\",\"esistere\",\"esito\",\"esofago\",\"esortato\",\"esoso\",\"espanso\",\"espresso\",\"essenza\",\"esso\",\"esteso\",\"estimare\",\"estonia\",\"estroso\",\"esultare\",\"etilico\",\"etnico\",\"etrusco\",\"etto\",\"euclideo\",\"europa\",\"evaso\",\"evidenza\",\"evitato\",\"evoluto\",\"evviva\",\"fabbrica\",\"faccenda\",\"fachiro\",\"falco\",\"famiglia\",\"fanale\",\"fanfara\",\"fango\",\"fantasma\",\"fare\",\"farfalla\",\"farinoso\",\"farmaco\",\"fascia\",\"fastoso\",\"fasullo\",\"faticare\",\"fato\",\"favoloso\",\"febbre\",\"fecola\",\"fede\",\"fegato\",\"felpa\",\"feltro\",\"femmina\",\"fendere\",\"fenomeno\",\"fermento\",\"ferro\",\"fertile\",\"fessura\",\"festivo\",\"fetta\",\"feudo\",\"fiaba\",\"fiducia\",\"fifa\",\"figurato\",\"filo\",\"finanza\",\"finestra\",\"finire\",\"fiore\",\"fiscale\",\"fisico\",\"fiume\",\"flacone\",\"flamenco\",\"flebo\",\"flemma\",\"florido\",\"fluente\",\"fluoro\",\"fobico\",\"focaccia\",\"focoso\",\"foderato\",\"foglio\",\"folata\",\"folclore\",\"folgore\",\"fondente\",\"fonetico\",\"fonia\",\"fontana\",\"forbito\",\"forchetta\",\"foresta\",\"formica\",\"fornaio\",\"foro\",\"fortezza\",\"forzare\",\"fosfato\",\"fosso\",\"fracasso\",\"frana\",\"frassino\",\"fratello\",\"freccetta\",\"frenata\",\"fresco\",\"frigo\",\"frollino\",\"fronde\",\"frugale\",\"frutta\",\"fucilata\",\"fucsia\",\"fuggente\",\"fulmine\",\"fulvo\",\"fumante\",\"fumetto\",\"fumoso\",\"fune\",\"funzione\",\"fuoco\",\"furbo\",\"furgone\",\"furore\",\"fuso\",\"futile\",\"gabbiano\",\"gaffe\",\"galateo\",\"gallina\",\"galoppo\",\"gambero\",\"gamma\",\"garanzia\",\"garbo\",\"garofano\",\"garzone\",\"gasdotto\",\"gasolio\",\"gastrico\",\"gatto\",\"gaudio\",\"gazebo\",\"gazzella\",\"geco\",\"gelatina\",\"gelso\",\"gemello\",\"gemmato\",\"gene\",\"genitore\",\"gennaio\",\"genotipo\",\"gergo\",\"ghepardo\",\"ghiaccio\",\"ghisa\",\"giallo\",\"gilda\",\"ginepro\",\"giocare\",\"gioiello\",\"giorno\",\"giove\",\"girato\",\"girone\",\"gittata\",\"giudizio\",\"giurato\",\"giusto\",\"globulo\",\"glutine\",\"gnomo\",\"gobba\",\"golf\",\"gomito\",\"gommone\",\"gonfio\",\"gonna\",\"governo\",\"gracile\",\"grado\",\"grafico\",\"grammo\",\"grande\",\"grattare\",\"gravoso\",\"grazia\",\"greca\",\"gregge\",\"grifone\",\"grigio\",\"grinza\",\"grotta\",\"gruppo\",\"guadagno\",\"guaio\",\"guanto\",\"guardare\",\"gufo\",\"guidare\",\"ibernato\",\"icona\",\"identico\",\"idillio\",\"idolo\",\"idra\",\"idrico\",\"idrogeno\",\"igiene\",\"ignaro\",\"ignorato\",\"ilare\",\"illeso\",\"illogico\",\"illudere\",\"imballo\",\"imbevuto\",\"imbocco\",\"imbuto\",\"immane\",\"immerso\",\"immolato\",\"impacco\",\"impeto\",\"impiego\",\"importo\",\"impronta\",\"inalare\",\"inarcare\",\"inattivo\",\"incanto\",\"incendio\",\"inchino\",\"incisivo\",\"incluso\",\"incontro\",\"incrocio\",\"incubo\",\"indagine\",\"india\",\"indole\",\"inedito\",\"infatti\",\"infilare\",\"inflitto\",\"ingaggio\",\"ingegno\",\"inglese\",\"ingordo\",\"ingrosso\",\"innesco\",\"inodore\",\"inoltrare\",\"inondato\",\"insano\",\"insetto\",\"insieme\",\"insonnia\",\"insulina\",\"intasato\",\"intero\",\"intonaco\",\"intuito\",\"inumidire\",\"invalido\",\"invece\",\"invito\",\"iperbole\",\"ipnotico\",\"ipotesi\",\"ippica\",\"iride\",\"irlanda\",\"ironico\",\"irrigato\",\"irrorare\",\"isolato\",\"isotopo\",\"isterico\",\"istituto\",\"istrice\",\"italia\",\"iterare\",\"labbro\",\"labirinto\",\"lacca\",\"lacerato\",\"lacrima\",\"lacuna\",\"laddove\",\"lago\",\"lampo\",\"lancetta\",\"lanterna\",\"lardoso\",\"larga\",\"laringe\",\"lastra\",\"latenza\",\"latino\",\"lattuga\",\"lavagna\",\"lavoro\",\"legale\",\"leggero\",\"lembo\",\"lentezza\",\"lenza\",\"leone\",\"lepre\",\"lesivo\",\"lessato\",\"lesto\",\"letterale\",\"leva\",\"levigato\",\"libero\",\"lido\",\"lievito\",\"lilla\",\"limatura\",\"limitare\",\"limpido\",\"lineare\",\"lingua\",\"liquido\",\"lira\",\"lirica\",\"lisca\",\"lite\",\"litigio\",\"livrea\",\"locanda\",\"lode\",\"logica\",\"lombare\",\"londra\",\"longevo\",\"loquace\",\"lorenzo\",\"loto\",\"lotteria\",\"luce\",\"lucidato\",\"lumaca\",\"luminoso\",\"lungo\",\"lupo\",\"luppolo\",\"lusinga\",\"lusso\",\"lutto\",\"macabro\",\"macchina\",\"macero\",\"macinato\",\"madama\",\"magico\",\"maglia\",\"magnete\",\"magro\",\"maiolica\",\"malafede\",\"malgrado\",\"malinteso\",\"malsano\",\"malto\",\"malumore\",\"mana\",\"mancia\",\"mandorla\",\"mangiare\",\"manifesto\",\"mannaro\",\"manovra\",\"mansarda\",\"mantide\",\"manubrio\",\"mappa\",\"maratona\",\"marcire\",\"maretta\",\"marmo\",\"marsupio\",\"maschera\",\"massaia\",\"mastino\",\"materasso\",\"matricola\",\"mattone\",\"maturo\",\"mazurca\",\"meandro\",\"meccanico\",\"mecenate\",\"medesimo\",\"meditare\",\"mega\",\"melassa\",\"melis\",\"melodia\",\"meninge\",\"meno\",\"mensola\",\"mercurio\",\"merenda\",\"merlo\",\"meschino\",\"mese\",\"messere\",\"mestolo\",\"metallo\",\"metodo\",\"mettere\",\"miagolare\",\"mica\",\"micelio\",\"michele\",\"microbo\",\"midollo\",\"miele\",\"migliore\",\"milano\",\"milite\",\"mimosa\",\"minerale\",\"mini\",\"minore\",\"mirino\",\"mirtillo\",\"miscela\",\"missiva\",\"misto\",\"misurare\",\"mitezza\",\"mitigare\",\"mitra\",\"mittente\",\"mnemonico\",\"modello\",\"modifica\",\"modulo\",\"mogano\",\"mogio\",\"mole\",\"molosso\",\"monastero\",\"monco\",\"mondina\",\"monetario\",\"monile\",\"monotono\",\"monsone\",\"montato\",\"monviso\",\"mora\",\"mordere\",\"morsicato\",\"mostro\",\"motivato\",\"motosega\",\"motto\",\"movenza\",\"movimento\",\"mozzo\",\"mucca\",\"mucosa\",\"muffa\",\"mughetto\",\"mugnaio\",\"mulatto\",\"mulinello\",\"multiplo\",\"mummia\",\"munto\",\"muovere\",\"murale\",\"musa\",\"muscolo\",\"musica\",\"mutevole\",\"muto\",\"nababbo\",\"nafta\",\"nanometro\",\"narciso\",\"narice\",\"narrato\",\"nascere\",\"nastrare\",\"naturale\",\"nautica\",\"naviglio\",\"nebulosa\",\"necrosi\",\"negativo\",\"negozio\",\"nemmeno\",\"neofita\",\"neretto\",\"nervo\",\"nessuno\",\"nettuno\",\"neutrale\",\"neve\",\"nevrotico\",\"nicchia\",\"ninfa\",\"nitido\",\"nobile\",\"nocivo\",\"nodo\",\"nome\",\"nomina\",\"nordico\",\"normale\",\"norvegese\",\"nostrano\",\"notare\",\"notizia\",\"notturno\",\"novella\",\"nucleo\",\"nulla\",\"numero\",\"nuovo\",\"nutrire\",\"nuvola\",\"nuziale\",\"oasi\",\"obbedire\",\"obbligo\",\"obelisco\",\"oblio\",\"obolo\",\"obsoleto\",\"occasione\",\"occhio\",\"occidente\",\"occorrere\",\"occultare\",\"ocra\",\"oculato\",\"odierno\",\"odorare\",\"offerta\",\"offrire\",\"offuscato\",\"oggetto\",\"oggi\",\"ognuno\",\"olandese\",\"olfatto\",\"oliato\",\"oliva\",\"ologramma\",\"oltre\",\"omaggio\",\"ombelico\",\"ombra\",\"omega\",\"omissione\",\"ondoso\",\"onere\",\"onice\",\"onnivoro\",\"onorevole\",\"onta\",\"operato\",\"opinione\",\"opposto\",\"oracolo\",\"orafo\",\"ordine\",\"orecchino\",\"orefice\",\"orfano\",\"organico\",\"origine\",\"orizzonte\",\"orma\",\"ormeggio\",\"ornativo\",\"orologio\",\"orrendo\",\"orribile\",\"ortensia\",\"ortica\",\"orzata\",\"orzo\",\"osare\",\"oscurare\",\"osmosi\",\"ospedale\",\"ospite\",\"ossa\",\"ossidare\",\"ostacolo\",\"oste\",\"otite\",\"otre\",\"ottagono\",\"ottimo\",\"ottobre\",\"ovale\",\"ovest\",\"ovino\",\"oviparo\",\"ovocito\",\"ovunque\",\"ovviare\",\"ozio\",\"pacchetto\",\"pace\",\"pacifico\",\"padella\",\"padrone\",\"paese\",\"paga\",\"pagina\",\"palazzina\",\"palesare\",\"pallido\",\"palo\",\"palude\",\"pandoro\",\"pannello\",\"paolo\",\"paonazzo\",\"paprica\",\"parabola\",\"parcella\",\"parere\",\"pargolo\",\"pari\",\"parlato\",\"parola\",\"partire\",\"parvenza\",\"parziale\",\"passivo\",\"pasticca\",\"patacca\",\"patologia\",\"pattume\",\"pavone\",\"peccato\",\"pedalare\",\"pedonale\",\"peggio\",\"peloso\",\"penare\",\"pendice\",\"penisola\",\"pennuto\",\"penombra\",\"pensare\",\"pentola\",\"pepe\",\"pepita\",\"perbene\",\"percorso\",\"perdonato\",\"perforare\",\"pergamena\",\"periodo\",\"permesso\",\"perno\",\"perplesso\",\"persuaso\",\"pertugio\",\"pervaso\",\"pesatore\",\"pesista\",\"peso\",\"pestifero\",\"petalo\",\"pettine\",\"petulante\",\"pezzo\",\"piacere\",\"pianta\",\"piattino\",\"piccino\",\"picozza\",\"piega\",\"pietra\",\"piffero\",\"pigiama\",\"pigolio\",\"pigro\",\"pila\",\"pilifero\",\"pillola\",\"pilota\",\"pimpante\",\"pineta\",\"pinna\",\"pinolo\",\"pioggia\",\"piombo\",\"piramide\",\"piretico\",\"pirite\",\"pirolisi\",\"pitone\",\"pizzico\",\"placebo\",\"planare\",\"plasma\",\"platano\",\"plenario\",\"pochezza\",\"poderoso\",\"podismo\",\"poesia\",\"poggiare\",\"polenta\",\"poligono\",\"pollice\",\"polmonite\",\"polpetta\",\"polso\",\"poltrona\",\"polvere\",\"pomice\",\"pomodoro\",\"ponte\",\"popoloso\",\"porfido\",\"poroso\",\"porpora\",\"porre\",\"portata\",\"posa\",\"positivo\",\"possesso\",\"postulato\",\"potassio\",\"potere\",\"pranzo\",\"prassi\",\"pratica\",\"precluso\",\"predica\",\"prefisso\",\"pregiato\",\"prelievo\",\"premere\",\"prenotare\",\"preparato\",\"presenza\",\"pretesto\",\"prevalso\",\"prima\",\"principe\",\"privato\",\"problema\",\"procura\",\"produrre\",\"profumo\",\"progetto\",\"prolunga\",\"promessa\",\"pronome\",\"proposta\",\"proroga\",\"proteso\",\"prova\",\"prudente\",\"prugna\",\"prurito\",\"psiche\",\"pubblico\",\"pudica\",\"pugilato\",\"pugno\",\"pulce\",\"pulito\",\"pulsante\",\"puntare\",\"pupazzo\",\"pupilla\",\"puro\",\"quadro\",\"qualcosa\",\"quasi\",\"querela\",\"quota\",\"raccolto\",\"raddoppio\",\"radicale\",\"radunato\",\"raffica\",\"ragazzo\",\"ragione\",\"ragno\",\"ramarro\",\"ramingo\",\"ramo\",\"randagio\",\"rantolare\",\"rapato\",\"rapina\",\"rappreso\",\"rasatura\",\"raschiato\",\"rasente\",\"rassegna\",\"rastrello\",\"rata\",\"ravveduto\",\"reale\",\"recepire\",\"recinto\",\"recluta\",\"recondito\",\"recupero\",\"reddito\",\"redimere\",\"regalato\",\"registro\",\"regola\",\"regresso\",\"relazione\",\"remare\",\"remoto\",\"renna\",\"replica\",\"reprimere\",\"reputare\",\"resa\",\"residente\",\"responso\",\"restauro\",\"rete\",\"retina\",\"retorica\",\"rettifica\",\"revocato\",\"riassunto\",\"ribadire\",\"ribelle\",\"ribrezzo\",\"ricarica\",\"ricco\",\"ricevere\",\"riciclato\",\"ricordo\",\"ricreduto\",\"ridicolo\",\"ridurre\",\"rifasare\",\"riflesso\",\"riforma\",\"rifugio\",\"rigare\",\"rigettato\",\"righello\",\"rilassato\",\"rilevato\",\"rimanere\",\"rimbalzo\",\"rimedio\",\"rimorchio\",\"rinascita\",\"rincaro\",\"rinforzo\",\"rinnovo\",\"rinomato\",\"rinsavito\",\"rintocco\",\"rinuncia\",\"rinvenire\",\"riparato\",\"ripetuto\",\"ripieno\",\"riportare\",\"ripresa\",\"ripulire\",\"risata\",\"rischio\",\"riserva\",\"risibile\",\"riso\",\"rispetto\",\"ristoro\",\"risultato\",\"risvolto\",\"ritardo\",\"ritegno\",\"ritmico\",\"ritrovo\",\"riunione\",\"riva\",\"riverso\",\"rivincita\",\"rivolto\",\"rizoma\",\"roba\",\"robotico\",\"robusto\",\"roccia\",\"roco\",\"rodaggio\",\"rodere\",\"roditore\",\"rogito\",\"rollio\",\"romantico\",\"rompere\",\"ronzio\",\"rosolare\",\"rospo\",\"rotante\",\"rotondo\",\"rotula\",\"rovescio\",\"rubizzo\",\"rubrica\",\"ruga\",\"rullino\",\"rumine\",\"rumoroso\",\"ruolo\",\"rupe\",\"russare\",\"rustico\",\"sabato\",\"sabbiare\",\"sabotato\",\"sagoma\",\"salasso\",\"saldatura\",\"salgemma\",\"salivare\",\"salmone\",\"salone\",\"saltare\",\"saluto\",\"salvo\",\"sapere\",\"sapido\",\"saporito\",\"saraceno\",\"sarcasmo\",\"sarto\",\"sassoso\",\"satellite\",\"satira\",\"satollo\",\"saturno\",\"savana\",\"savio\",\"saziato\",\"sbadiglio\",\"sbalzo\",\"sbancato\",\"sbarra\",\"sbattere\",\"sbavare\",\"sbendare\",\"sbirciare\",\"sbloccato\",\"sbocciato\",\"sbrinare\",\"sbruffone\",\"sbuffare\",\"scabroso\",\"scadenza\",\"scala\",\"scambiare\",\"scandalo\",\"scapola\",\"scarso\",\"scatenare\",\"scavato\",\"scelto\",\"scenico\",\"scettro\",\"scheda\",\"schiena\",\"sciarpa\",\"scienza\",\"scindere\",\"scippo\",\"sciroppo\",\"scivolo\",\"sclerare\",\"scodella\",\"scolpito\",\"scomparto\",\"sconforto\",\"scoprire\",\"scorta\",\"scossone\",\"scozzese\",\"scriba\",\"scrollare\",\"scrutinio\",\"scuderia\",\"scultore\",\"scuola\",\"scuro\",\"scusare\",\"sdebitare\",\"sdoganare\",\"seccatura\",\"secondo\",\"sedano\",\"seggiola\",\"segnalato\",\"segregato\",\"seguito\",\"selciato\",\"selettivo\",\"sella\",\"selvaggio\",\"semaforo\",\"sembrare\",\"seme\",\"seminato\",\"sempre\",\"senso\",\"sentire\",\"sepolto\",\"sequenza\",\"serata\",\"serbato\",\"sereno\",\"serio\",\"serpente\",\"serraglio\",\"servire\",\"sestina\",\"setola\",\"settimana\",\"sfacelo\",\"sfaldare\",\"sfamato\",\"sfarzoso\",\"sfaticato\",\"sfera\",\"sfida\",\"sfilato\",\"sfinge\",\"sfocato\",\"sfoderare\",\"sfogo\",\"sfoltire\",\"sforzato\",\"sfratto\",\"sfruttato\",\"sfuggito\",\"sfumare\",\"sfuso\",\"sgabello\",\"sgarbato\",\"sgonfiare\",\"sgorbio\",\"sgrassato\",\"sguardo\",\"sibilo\",\"siccome\",\"sierra\",\"sigla\",\"signore\",\"silenzio\",\"sillaba\",\"simbolo\",\"simpatico\",\"simulato\",\"sinfonia\",\"singolo\",\"sinistro\",\"sino\",\"sintesi\",\"sinusoide\",\"sipario\",\"sisma\",\"sistole\",\"situato\",\"slitta\",\"slogatura\",\"sloveno\",\"smarrito\",\"smemorato\",\"smentito\",\"smeraldo\",\"smilzo\",\"smontare\",\"smottato\",\"smussato\",\"snellire\",\"snervato\",\"snodo\",\"sobbalzo\",\"sobrio\",\"soccorso\",\"sociale\",\"sodale\",\"soffitto\",\"sogno\",\"soldato\",\"solenne\",\"solido\",\"sollazzo\",\"solo\",\"solubile\",\"solvente\",\"somatico\",\"somma\",\"sonda\",\"sonetto\",\"sonnifero\",\"sopire\",\"soppeso\",\"sopra\",\"sorgere\",\"sorpasso\",\"sorriso\",\"sorso\",\"sorteggio\",\"sorvolato\",\"sospiro\",\"sosta\",\"sottile\",\"spada\",\"spalla\",\"spargere\",\"spatola\",\"spavento\",\"spazzola\",\"specie\",\"spedire\",\"spegnere\",\"spelatura\",\"speranza\",\"spessore\",\"spettrale\",\"spezzato\",\"spia\",\"spigoloso\",\"spillato\",\"spinoso\",\"spirale\",\"splendido\",\"sportivo\",\"sposo\",\"spranga\",\"sprecare\",\"spronato\",\"spruzzo\",\"spuntino\",\"squillo\",\"sradicare\",\"srotolato\",\"stabile\",\"stacco\",\"staffa\",\"stagnare\",\"stampato\",\"stantio\",\"starnuto\",\"stasera\",\"statuto\",\"stelo\",\"steppa\",\"sterzo\",\"stiletto\",\"stima\",\"stirpe\",\"stivale\",\"stizzoso\",\"stonato\",\"storico\",\"strappo\",\"stregato\",\"stridulo\",\"strozzare\",\"strutto\",\"stuccare\",\"stufo\",\"stupendo\",\"subentro\",\"succoso\",\"sudore\",\"suggerito\",\"sugo\",\"sultano\",\"suonare\",\"superbo\",\"supporto\",\"surgelato\",\"surrogato\",\"sussurro\",\"sutura\",\"svagare\",\"svedese\",\"sveglio\",\"svelare\",\"svenuto\",\"svezia\",\"sviluppo\",\"svista\",\"svizzera\",\"svolta\",\"svuotare\",\"tabacco\",\"tabulato\",\"tacciare\",\"taciturno\",\"tale\",\"talismano\",\"tampone\",\"tannino\",\"tara\",\"tardivo\",\"targato\",\"tariffa\",\"tarpare\",\"tartaruga\",\"tasto\",\"tattico\",\"taverna\",\"tavolata\",\"tazza\",\"teca\",\"tecnico\",\"telefono\",\"temerario\",\"tempo\",\"temuto\",\"tendone\",\"tenero\",\"tensione\",\"tentacolo\",\"teorema\",\"terme\",\"terrazzo\",\"terzetto\",\"tesi\",\"tesserato\",\"testato\",\"tetro\",\"tettoia\",\"tifare\",\"tigella\",\"timbro\",\"tinto\",\"tipico\",\"tipografo\",\"tiraggio\",\"tiro\",\"titanio\",\"titolo\",\"titubante\",\"tizio\",\"tizzone\",\"toccare\",\"tollerare\",\"tolto\",\"tombola\",\"tomo\",\"tonfo\",\"tonsilla\",\"topazio\",\"topologia\",\"toppa\",\"torba\",\"tornare\",\"torrone\",\"tortora\",\"toscano\",\"tossire\",\"tostatura\",\"totano\",\"trabocco\",\"trachea\",\"trafila\",\"tragedia\",\"tralcio\",\"tramonto\",\"transito\",\"trapano\",\"trarre\",\"trasloco\",\"trattato\",\"trave\",\"treccia\",\"tremolio\",\"trespolo\",\"tributo\",\"tricheco\",\"trifoglio\",\"trillo\",\"trincea\",\"trio\",\"tristezza\",\"triturato\",\"trivella\",\"tromba\",\"trono\",\"troppo\",\"trottola\",\"trovare\",\"truccato\",\"tubatura\",\"tuffato\",\"tulipano\",\"tumulto\",\"tunisia\",\"turbare\",\"turchino\",\"tuta\",\"tutela\",\"ubicato\",\"uccello\",\"uccisore\",\"udire\",\"uditivo\",\"uffa\",\"ufficio\",\"uguale\",\"ulisse\",\"ultimato\",\"umano\",\"umile\",\"umorismo\",\"uncinetto\",\"ungere\",\"ungherese\",\"unicorno\",\"unificato\",\"unisono\",\"unitario\",\"unte\",\"uovo\",\"upupa\",\"uragano\",\"urgenza\",\"urlo\",\"usanza\",\"usato\",\"uscito\",\"usignolo\",\"usuraio\",\"utensile\",\"utilizzo\",\"utopia\",\"vacante\",\"vaccinato\",\"vagabondo\",\"vagliato\",\"valanga\",\"valgo\",\"valico\",\"valletta\",\"valoroso\",\"valutare\",\"valvola\",\"vampata\",\"vangare\",\"vanitoso\",\"vano\",\"vantaggio\",\"vanvera\",\"vapore\",\"varano\",\"varcato\",\"variante\",\"vasca\",\"vedetta\",\"vedova\",\"veduto\",\"vegetale\",\"veicolo\",\"velcro\",\"velina\",\"velluto\",\"veloce\",\"venato\",\"vendemmia\",\"vento\",\"verace\",\"verbale\",\"vergogna\",\"verifica\",\"vero\",\"verruca\",\"verticale\",\"vescica\",\"vessillo\",\"vestale\",\"veterano\",\"vetrina\",\"vetusto\",\"viandante\",\"vibrante\",\"vicenda\",\"vichingo\",\"vicinanza\",\"vidimare\",\"vigilia\",\"vigneto\",\"vigore\",\"vile\",\"villano\",\"vimini\",\"vincitore\",\"viola\",\"vipera\",\"virgola\",\"virologo\",\"virulento\",\"viscoso\",\"visione\",\"vispo\",\"vissuto\",\"visura\",\"vita\",\"vitello\",\"vittima\",\"vivanda\",\"vivido\",\"viziare\",\"voce\",\"voga\",\"volatile\",\"volere\",\"volpe\",\"voragine\",\"vulcano\",\"zampogna\",\"zanna\",\"zappato\",\"zattera\",\"zavorra\",\"zefiro\",\"zelante\",\"zelo\",\"zenzero\",\"zerbino\",\"zibetto\",\"zinco\",\"zircone\",\"zitto\",\"zolla\",\"zotico\",\"zucchero\",\"zufolo\",\"zulu\",\"zuppa\"][\"あいこくしん\",\"あいさつ\",\"あいだ\",\"あおぞら\",\"あかちゃん\",\"あきる\",\"あけがた\",\"あける\",\"あこがれる\",\"あさい\",\"あさひ\",\"あしあと\",\"あじわう\",\"あずかる\",\"あずき\",\"あそぶ\",\"あたえる\",\"あたためる\",\"あたりまえ\",\"あたる\",\"あつい\",\"あつかう\",\"あっしゅく\",\"あつまり\",\"あつめる\",\"あてな\",\"あてはまる\",\"あひる\",\"あぶら\",\"あぶる\",\"あふれる\",\"あまい\",\"あまど\",\"あまやかす\",\"あまり\",\"あみもの\",\"あめりか\",\"あやまる\",\"あゆむ\",\"あらいぐま\",\"あらし\",\"あらすじ\",\"あらためる\",\"あらゆる\",\"あらわす\",\"ありがとう\",\"あわせる\",\"あわてる\",\"あんい\",\"あんがい\",\"あんこ\",\"あんぜん\",\"あんてい\",\"あんない\",\"あんまり\",\"いいだす\",\"いおん\",\"いがい\",\"いがく\",\"いきおい\",\"いきなり\",\"いきもの\",\"いきる\",\"いくじ\",\"いくぶん\",\"いけばな\",\"いけん\",\"いこう\",\"いこく\",\"いこつ\",\"いさましい\",\"いさん\",\"いしき\",\"いじゅう\",\"いじょう\",\"いじわる\",\"いずみ\",\"いずれ\",\"いせい\",\"いせえび\",\"いせかい\",\"いせき\",\"いぜん\",\"いそうろう\",\"いそがしい\",\"いだい\",\"いだく\",\"いたずら\",\"いたみ\",\"いたりあ\",\"いちおう\",\"いちじ\",\"いちど\",\"いちば\",\"いちぶ\",\"いちりゅう\",\"いつか\",\"いっしゅん\",\"いっせい\",\"いっそう\",\"いったん\",\"いっち\",\"いってい\",\"いっぽう\",\"いてざ\",\"いてん\",\"いどう\",\"いとこ\",\"いない\",\"いなか\",\"いねむり\",\"いのち\",\"いのる\",\"いはつ\",\"いばる\",\"いはん\",\"いびき\",\"いひん\",\"いふく\",\"いへん\",\"いほう\",\"いみん\",\"いもうと\",\"いもたれ\",\"いもり\",\"いやがる\",\"いやす\",\"いよかん\",\"いよく\",\"いらい\",\"いらすと\",\"いりぐち\",\"いりょう\",\"いれい\",\"いれもの\",\"いれる\",\"いろえんぴつ\",\"いわい\",\"いわう\",\"いわかん\",\"いわば\",\"いわゆる\",\"いんげんまめ\",\"いんさつ\",\"いんしょう\",\"いんよう\",\"うえき\",\"うえる\",\"うおざ\",\"うがい\",\"うかぶ\",\"うかべる\",\"うきわ\",\"うくらいな\",\"うくれれ\",\"うけたまわる\",\"うけつけ\",\"うけとる\",\"うけもつ\",\"うける\",\"うごかす\",\"うごく\",\"うこん\",\"うさぎ\",\"うしなう\",\"うしろがみ\",\"うすい\",\"うすぎ\",\"うすぐらい\",\"うすめる\",\"うせつ\",\"うちあわせ\",\"うちがわ\",\"うちき\",\"うちゅう\",\"うっかり\",\"うつくしい\",\"うったえる\",\"うつる\",\"うどん\",\"うなぎ\",\"うなじ\",\"うなずく\",\"うなる\",\"うねる\",\"うのう\",\"うぶげ\",\"うぶごえ\",\"うまれる\",\"うめる\",\"うもう\",\"うやまう\",\"うよく\",\"うらがえす\",\"うらぐち\",\"うらない\",\"うりあげ\",\"うりきれ\",\"うるさい\",\"うれしい\",\"うれゆき\",\"うれる\",\"うろこ\",\"うわき\",\"うわさ\",\"うんこう\",\"うんちん\",\"うんてん\",\"うんどう\",\"えいえん\",\"えいが\",\"えいきょう\",\"えいご\",\"えいせい\",\"えいぶん\",\"えいよう\",\"えいわ\",\"えおり\",\"えがお\",\"えがく\",\"えきたい\",\"えくせる\",\"えしゃく\",\"えすて\",\"えつらん\",\"えのぐ\",\"えほうまき\",\"えほん\",\"えまき\",\"えもじ\",\"えもの\",\"えらい\",\"えらぶ\",\"えりあ\",\"えんえん\",\"えんかい\",\"えんぎ\",\"えんげき\",\"えんしゅう\",\"えんぜつ\",\"えんそく\",\"えんちょう\",\"えんとつ\",\"おいかける\",\"おいこす\",\"おいしい\",\"おいつく\",\"おうえん\",\"おうさま\",\"おうじ\",\"おうせつ\",\"おうたい\",\"おうふく\",\"おうべい\",\"おうよう\",\"おえる\",\"おおい\",\"おおう\",\"おおどおり\",\"おおや\",\"おおよそ\",\"おかえり\",\"おかず\",\"おがむ\",\"おかわり\",\"おぎなう\",\"おきる\",\"おくさま\",\"おくじょう\",\"おくりがな\",\"おくる\",\"おくれる\",\"おこす\",\"おこなう\",\"おこる\",\"おさえる\",\"おさない\",\"おさめる\",\"おしいれ\",\"おしえる\",\"おじぎ\",\"おじさん\",\"おしゃれ\",\"おそらく\",\"おそわる\",\"おたがい\",\"おたく\",\"おだやか\",\"おちつく\",\"おっと\",\"おつり\",\"おでかけ\",\"おとしもの\",\"おとなしい\",\"おどり\",\"おどろかす\",\"おばさん\",\"おまいり\",\"おめでとう\",\"おもいで\",\"おもう\",\"おもたい\",\"おもちゃ\",\"おやつ\",\"おやゆび\",\"およぼす\",\"おらんだ\",\"おろす\",\"おんがく\",\"おんけい\",\"おんしゃ\",\"おんせん\",\"おんだん\",\"おんちゅう\",\"おんどけい\",\"かあつ\",\"かいが\",\"がいき\",\"がいけん\",\"がいこう\",\"かいさつ\",\"かいしゃ\",\"かいすいよく\",\"かいぜん\",\"かいぞうど\",\"かいつう\",\"かいてん\",\"かいとう\",\"かいふく\",\"がいへき\",\"かいほう\",\"かいよう\",\"がいらい\",\"かいわ\",\"かえる\",\"かおり\",\"かかえる\",\"かがく\",\"かがし\",\"かがみ\",\"かくご\",\"かくとく\",\"かざる\",\"がぞう\",\"かたい\",\"かたち\",\"がちょう\",\"がっきゅう\",\"がっこう\",\"がっさん\",\"がっしょう\",\"かなざわし\",\"かのう\",\"がはく\",\"かぶか\",\"かほう\",\"かほご\",\"かまう\",\"かまぼこ\",\"かめれおん\",\"かゆい\",\"かようび\",\"からい\",\"かるい\",\"かろう\",\"かわく\",\"かわら\",\"がんか\",\"かんけい\",\"かんこう\",\"かんしゃ\",\"かんそう\",\"かんたん\",\"かんち\",\"がんばる\",\"きあい\",\"きあつ\",\"きいろ\",\"ぎいん\",\"きうい\",\"きうん\",\"きえる\",\"きおう\",\"きおく\",\"きおち\",\"きおん\",\"きかい\",\"きかく\",\"きかんしゃ\",\"ききて\",\"きくばり\",\"きくらげ\",\"きけんせい\",\"きこう\",\"きこえる\",\"きこく\",\"きさい\",\"きさく\",\"きさま\",\"きさらぎ\",\"ぎじかがく\",\"ぎしき\",\"ぎじたいけん\",\"ぎじにってい\",\"ぎじゅつしゃ\",\"きすう\",\"きせい\",\"きせき\",\"きせつ\",\"きそう\",\"きぞく\",\"きぞん\",\"きたえる\",\"きちょう\",\"きつえん\",\"ぎっちり\",\"きつつき\",\"きつね\",\"きてい\",\"きどう\",\"きどく\",\"きない\",\"きなが\",\"きなこ\",\"きぬごし\",\"きねん\",\"きのう\",\"きのした\",\"きはく\",\"きびしい\",\"きひん\",\"きふく\",\"きぶん\",\"きぼう\",\"きほん\",\"きまる\",\"きみつ\",\"きむずかしい\",\"きめる\",\"きもだめし\",\"きもち\",\"きもの\",\"きゃく\",\"きやく\",\"ぎゅうにく\",\"きよう\",\"きょうりゅう\",\"きらい\",\"きらく\",\"きりん\",\"きれい\",\"きれつ\",\"きろく\",\"ぎろん\",\"きわめる\",\"ぎんいろ\",\"きんかくじ\",\"きんじょ\",\"きんようび\",\"ぐあい\",\"くいず\",\"くうかん\",\"くうき\",\"くうぐん\",\"くうこう\",\"ぐうせい\",\"くうそう\",\"ぐうたら\",\"くうふく\",\"くうぼ\",\"くかん\",\"くきょう\",\"くげん\",\"ぐこう\",\"くさい\",\"くさき\",\"くさばな\",\"くさる\",\"くしゃみ\",\"くしょう\",\"くすのき\",\"くすりゆび\",\"くせげ\",\"くせん\",\"ぐたいてき\",\"くださる\",\"くたびれる\",\"くちこみ\",\"くちさき\",\"くつした\",\"ぐっすり\",\"くつろぐ\",\"くとうてん\",\"くどく\",\"くなん\",\"くねくね\",\"くのう\",\"くふう\",\"くみあわせ\",\"くみたてる\",\"くめる\",\"くやくしょ\",\"くらす\",\"くらべる\",\"くるま\",\"くれる\",\"くろう\",\"くわしい\",\"ぐんかん\",\"ぐんしょく\",\"ぐんたい\",\"ぐんて\",\"けあな\",\"けいかく\",\"けいけん\",\"けいこ\",\"けいさつ\",\"げいじゅつ\",\"けいたい\",\"げいのうじん\",\"けいれき\",\"けいろ\",\"けおとす\",\"けおりもの\",\"げきか\",\"げきげん\",\"げきだん\",\"げきちん\",\"げきとつ\",\"げきは\",\"げきやく\",\"げこう\",\"げこくじょう\",\"げざい\",\"けさき\",\"げざん\",\"けしき\",\"けしごむ\",\"けしょう\",\"げすと\",\"けたば\",\"けちゃっぷ\",\"けちらす\",\"けつあつ\",\"けつい\",\"けつえき\",\"けっこん\",\"けつじょ\",\"けっせき\",\"けってい\",\"けつまつ\",\"げつようび\",\"げつれい\",\"けつろん\",\"げどく\",\"けとばす\",\"けとる\",\"けなげ\",\"けなす\",\"けなみ\",\"けぬき\",\"げねつ\",\"けねん\",\"けはい\",\"げひん\",\"けぶかい\",\"げぼく\",\"けまり\",\"けみかる\",\"けむし\",\"けむり\",\"けもの\",\"けらい\",\"けろけろ\",\"けわしい\",\"けんい\",\"けんえつ\",\"けんお\",\"けんか\",\"げんき\",\"けんげん\",\"けんこう\",\"けんさく\",\"けんしゅう\",\"けんすう\",\"げんそう\",\"けんちく\",\"けんてい\",\"けんとう\",\"けんない\",\"けんにん\",\"げんぶつ\",\"けんま\",\"けんみん\",\"けんめい\",\"けんらん\",\"けんり\",\"こあくま\",\"こいぬ\",\"こいびと\",\"ごうい\",\"こうえん\",\"こうおん\",\"こうかん\",\"ごうきゅう\",\"ごうけい\",\"こうこう\",\"こうさい\",\"こうじ\",\"こうすい\",\"ごうせい\",\"こうそく\",\"こうたい\",\"こうちゃ\",\"こうつう\",\"こうてい\",\"こうどう\",\"こうない\",\"こうはい\",\"ごうほう\",\"ごうまん\",\"こうもく\",\"こうりつ\",\"こえる\",\"こおり\",\"ごかい\",\"ごがつ\",\"ごかん\",\"こくご\",\"こくさい\",\"こくとう\",\"こくない\",\"こくはく\",\"こぐま\",\"こけい\",\"こける\",\"ここのか\",\"こころ\",\"こさめ\",\"こしつ\",\"こすう\",\"こせい\",\"こせき\",\"こぜん\",\"こそだて\",\"こたい\",\"こたえる\",\"こたつ\",\"こちょう\",\"こっか\",\"こつこつ\",\"こつばん\",\"こつぶ\",\"こてい\",\"こてん\",\"ことがら\",\"ことし\",\"ことば\",\"ことり\",\"こなごな\",\"こねこね\",\"このまま\",\"このみ\",\"このよ\",\"ごはん\",\"こひつじ\",\"こふう\",\"こふん\",\"こぼれる\",\"ごまあぶら\",\"こまかい\",\"ごますり\",\"こまつな\",\"こまる\",\"こむぎこ\",\"こもじ\",\"こもち\",\"こもの\",\"こもん\",\"こやく\",\"こやま\",\"こゆう\",\"こゆび\",\"こよい\",\"こよう\",\"こりる\",\"これくしょん\",\"ころっけ\",\"こわもて\",\"こわれる\",\"こんいん\",\"こんかい\",\"こんき\",\"こんしゅう\",\"こんすい\",\"こんだて\",\"こんとん\",\"こんなん\",\"こんびに\",\"こんぽん\",\"こんまけ\",\"こんや\",\"こんれい\",\"こんわく\",\"ざいえき\",\"さいかい\",\"さいきん\",\"ざいげん\",\"ざいこ\",\"さいしょ\",\"さいせい\",\"ざいたく\",\"ざいちゅう\",\"さいてき\",\"ざいりょう\",\"さうな\",\"さかいし\",\"さがす\",\"さかな\",\"さかみち\",\"さがる\",\"さぎょう\",\"さくし\",\"さくひん\",\"さくら\",\"さこく\",\"さこつ\",\"さずかる\",\"ざせき\",\"さたん\",\"さつえい\",\"ざつおん\",\"ざっか\",\"ざつがく\",\"さっきょく\",\"ざっし\",\"さつじん\",\"ざっそう\",\"さつたば\",\"さつまいも\",\"さてい\",\"さといも\",\"さとう\",\"さとおや\",\"さとし\",\"さとる\",\"さのう\",\"さばく\",\"さびしい\",\"さべつ\",\"さほう\",\"さほど\",\"さます\",\"さみしい\",\"さみだれ\",\"さむけ\",\"さめる\",\"さやえんどう\",\"さゆう\",\"さよう\",\"さよく\",\"さらだ\",\"ざるそば\",\"さわやか\",\"さわる\",\"さんいん\",\"さんか\",\"さんきゃく\",\"さんこう\",\"さんさい\",\"ざんしょ\",\"さんすう\",\"さんせい\",\"さんそ\",\"さんち\",\"さんま\",\"さんみ\",\"さんらん\",\"しあい\",\"しあげ\",\"しあさって\",\"しあわせ\",\"しいく\",\"しいん\",\"しうち\",\"しえい\",\"しおけ\",\"しかい\",\"しかく\",\"じかん\",\"しごと\",\"しすう\",\"じだい\",\"したうけ\",\"したぎ\",\"したて\",\"したみ\",\"しちょう\",\"しちりん\",\"しっかり\",\"しつじ\",\"しつもん\",\"してい\",\"してき\",\"してつ\",\"じてん\",\"じどう\",\"しなぎれ\",\"しなもの\",\"しなん\",\"しねま\",\"しねん\",\"しのぐ\",\"しのぶ\",\"しはい\",\"しばかり\",\"しはつ\",\"しはらい\",\"しはん\",\"しひょう\",\"しふく\",\"じぶん\",\"しへい\",\"しほう\",\"しほん\",\"しまう\",\"しまる\",\"しみん\",\"しむける\",\"じむしょ\",\"しめい\",\"しめる\",\"しもん\",\"しゃいん\",\"しゃうん\",\"しゃおん\",\"じゃがいも\",\"しやくしょ\",\"しゃくほう\",\"しゃけん\",\"しゃこ\",\"しゃざい\",\"しゃしん\",\"しゃせん\",\"しゃそう\",\"しゃたい\",\"しゃちょう\",\"しゃっきん\",\"じゃま\",\"しゃりん\",\"しゃれい\",\"じゆう\",\"じゅうしょ\",\"しゅくはく\",\"じゅしん\",\"しゅっせき\",\"しゅみ\",\"しゅらば\",\"じゅんばん\",\"しょうかい\",\"しょくたく\",\"しょっけん\",\"しょどう\",\"しょもつ\",\"しらせる\",\"しらべる\",\"しんか\",\"しんこう\",\"じんじゃ\",\"しんせいじ\",\"しんちく\",\"しんりん\",\"すあげ\",\"すあし\",\"すあな\",\"ずあん\",\"すいえい\",\"すいか\",\"すいとう\",\"ずいぶん\",\"すいようび\",\"すうがく\",\"すうじつ\",\"すうせん\",\"すおどり\",\"すきま\",\"すくう\",\"すくない\",\"すける\",\"すごい\",\"すこし\",\"ずさん\",\"すずしい\",\"すすむ\",\"すすめる\",\"すっかり\",\"ずっしり\",\"ずっと\",\"すてき\",\"すてる\",\"すねる\",\"すのこ\",\"すはだ\",\"すばらしい\",\"ずひょう\",\"ずぶぬれ\",\"すぶり\",\"すふれ\",\"すべて\",\"すべる\",\"ずほう\",\"すぼん\",\"すまい\",\"すめし\",\"すもう\",\"すやき\",\"すらすら\",\"するめ\",\"すれちがう\",\"すろっと\",\"すわる\",\"すんぜん\",\"すんぽう\",\"せあぶら\",\"せいかつ\",\"せいげん\",\"せいじ\",\"せいよう\",\"せおう\",\"せかいかん\",\"せきにん\",\"せきむ\",\"せきゆ\",\"せきらんうん\",\"せけん\",\"せこう\",\"せすじ\",\"せたい\",\"せたけ\",\"せっかく\",\"せっきゃく\",\"ぜっく\",\"せっけん\",\"せっこつ\",\"せっさたくま\",\"せつぞく\",\"せつだん\",\"せつでん\",\"せっぱん\",\"せつび\",\"せつぶん\",\"せつめい\",\"せつりつ\",\"せなか\",\"せのび\",\"せはば\",\"せびろ\",\"せぼね\",\"せまい\",\"せまる\",\"せめる\",\"せもたれ\",\"せりふ\",\"ぜんあく\",\"せんい\",\"せんえい\",\"せんか\",\"せんきょ\",\"せんく\",\"せんげん\",\"ぜんご\",\"せんさい\",\"せんしゅ\",\"せんすい\",\"せんせい\",\"せんぞ\",\"せんたく\",\"せんちょう\",\"せんてい\",\"せんとう\",\"せんぬき\",\"せんねん\",\"せんぱい\",\"ぜんぶ\",\"ぜんぽう\",\"せんむ\",\"せんめんじょ\",\"せんもん\",\"せんやく\",\"せんゆう\",\"せんよう\",\"ぜんら\",\"ぜんりゃく\",\"せんれい\",\"せんろ\",\"そあく\",\"そいとげる\",\"そいね\",\"そうがんきょう\",\"そうき\",\"そうご\",\"そうしん\",\"そうだん\",\"そうなん\",\"そうび\",\"そうめん\",\"そうり\",\"そえもの\",\"そえん\",\"そがい\",\"そげき\",\"そこう\",\"そこそこ\",\"そざい\",\"そしな\",\"そせい\",\"そせん\",\"そそぐ\",\"そだてる\",\"そつう\",\"そつえん\",\"そっかん\",\"そつぎょう\",\"そっけつ\",\"そっこう\",\"そっせん\",\"そっと\",\"そとがわ\",\"そとづら\",\"そなえる\",\"そなた\",\"そふぼ\",\"そぼく\",\"そぼろ\",\"そまつ\",\"そまる\",\"そむく\",\"そむりえ\",\"そめる\",\"そもそも\",\"そよかぜ\",\"そらまめ\",\"そろう\",\"そんかい\",\"そんけい\",\"そんざい\",\"そんしつ\",\"そんぞく\",\"そんちょう\",\"ぞんび\",\"ぞんぶん\",\"そんみん\",\"たあい\",\"たいいん\",\"たいうん\",\"たいえき\",\"たいおう\",\"だいがく\",\"たいき\",\"たいぐう\",\"たいけん\",\"たいこ\",\"たいざい\",\"だいじょうぶ\",\"だいすき\",\"たいせつ\",\"たいそう\",\"だいたい\",\"たいちょう\",\"たいてい\",\"だいどころ\",\"たいない\",\"たいねつ\",\"たいのう\",\"たいはん\",\"だいひょう\",\"たいふう\",\"たいへん\",\"たいほ\",\"たいまつばな\",\"たいみんぐ\",\"たいむ\",\"たいめん\",\"たいやき\",\"たいよう\",\"たいら\",\"たいりょく\",\"たいる\",\"たいわん\",\"たうえ\",\"たえる\",\"たおす\",\"たおる\",\"たおれる\",\"たかい\",\"たかね\",\"たきび\",\"たくさん\",\"たこく\",\"たこやき\",\"たさい\",\"たしざん\",\"だじゃれ\",\"たすける\",\"たずさわる\",\"たそがれ\",\"たたかう\",\"たたく\",\"ただしい\",\"たたみ\",\"たちばな\",\"だっかい\",\"だっきゃく\",\"だっこ\",\"だっしゅつ\",\"だったい\",\"たてる\",\"たとえる\",\"たなばた\",\"たにん\",\"たぬき\",\"たのしみ\",\"たはつ\",\"たぶん\",\"たべる\",\"たぼう\",\"たまご\",\"たまる\",\"だむる\",\"ためいき\",\"ためす\",\"ためる\",\"たもつ\",\"たやすい\",\"たよる\",\"たらす\",\"たりきほんがん\",\"たりょう\",\"たりる\",\"たると\",\"たれる\",\"たれんと\",\"たろっと\",\"たわむれる\",\"だんあつ\",\"たんい\",\"たんおん\",\"たんか\",\"たんき\",\"たんけん\",\"たんご\",\"たんさん\",\"たんじょうび\",\"だんせい\",\"たんそく\",\"たんたい\",\"だんち\",\"たんてい\",\"たんとう\",\"だんな\",\"たんにん\",\"だんねつ\",\"たんのう\",\"たんぴん\",\"だんぼう\",\"たんまつ\",\"たんめい\",\"だんれつ\",\"だんろ\",\"だんわ\",\"ちあい\",\"ちあん\",\"ちいき\",\"ちいさい\",\"ちえん\",\"ちかい\",\"ちから\",\"ちきゅう\",\"ちきん\",\"ちけいず\",\"ちけん\",\"ちこく\",\"ちさい\",\"ちしき\",\"ちしりょう\",\"ちせい\",\"ちそう\",\"ちたい\",\"ちたん\",\"ちちおや\",\"ちつじょ\",\"ちてき\",\"ちてん\",\"ちぬき\",\"ちぬり\",\"ちのう\",\"ちひょう\",\"ちへいせん\",\"ちほう\",\"ちまた\",\"ちみつ\",\"ちみどろ\",\"ちめいど\",\"ちゃんこなべ\",\"ちゅうい\",\"ちゆりょく\",\"ちょうし\",\"ちょさくけん\",\"ちらし\",\"ちらみ\",\"ちりがみ\",\"ちりょう\",\"ちるど\",\"ちわわ\",\"ちんたい\",\"ちんもく\",\"ついか\",\"ついたち\",\"つうか\",\"つうじょう\",\"つうはん\",\"つうわ\",\"つかう\",\"つかれる\",\"つくね\",\"つくる\",\"つけね\",\"つける\",\"つごう\",\"つたえる\",\"つづく\",\"つつじ\",\"つつむ\",\"つとめる\",\"つながる\",\"つなみ\",\"つねづね\",\"つのる\",\"つぶす\",\"つまらない\",\"つまる\",\"つみき\",\"つめたい\",\"つもり\",\"つもる\",\"つよい\",\"つるぼ\",\"つるみく\",\"つわもの\",\"つわり\",\"てあし\",\"てあて\",\"てあみ\",\"ていおん\",\"ていか\",\"ていき\",\"ていけい\",\"ていこく\",\"ていさつ\",\"ていし\",\"ていせい\",\"ていたい\",\"ていど\",\"ていねい\",\"ていひょう\",\"ていへん\",\"ていぼう\",\"てうち\",\"ておくれ\",\"てきとう\",\"てくび\",\"でこぼこ\",\"てさぎょう\",\"てさげ\",\"てすり\",\"てそう\",\"てちがい\",\"てちょう\",\"てつがく\",\"てつづき\",\"でっぱ\",\"てつぼう\",\"てつや\",\"でぬかえ\",\"てぬき\",\"てぬぐい\",\"てのひら\",\"てはい\",\"てぶくろ\",\"てふだ\",\"てほどき\",\"てほん\",\"てまえ\",\"てまきずし\",\"てみじか\",\"てみやげ\",\"てらす\",\"てれび\",\"てわけ\",\"てわたし\",\"でんあつ\",\"てんいん\",\"てんかい\",\"てんき\",\"てんぐ\",\"てんけん\",\"てんごく\",\"てんさい\",\"てんし\",\"てんすう\",\"でんち\",\"てんてき\",\"てんとう\",\"てんない\",\"てんぷら\",\"てんぼうだい\",\"てんめつ\",\"てんらんかい\",\"でんりょく\",\"でんわ\",\"どあい\",\"といれ\",\"どうかん\",\"とうきゅう\",\"どうぐ\",\"とうし\",\"とうむぎ\",\"とおい\",\"とおか\",\"とおく\",\"とおす\",\"とおる\",\"とかい\",\"とかす\",\"ときおり\",\"ときどき\",\"とくい\",\"とくしゅう\",\"とくてん\",\"とくに\",\"とくべつ\",\"とけい\",\"とける\",\"とこや\",\"とさか\",\"としょかん\",\"とそう\",\"とたん\",\"とちゅう\",\"とっきゅう\",\"とっくん\",\"とつぜん\",\"とつにゅう\",\"とどける\",\"ととのえる\",\"とない\",\"となえる\",\"となり\",\"とのさま\",\"とばす\",\"どぶがわ\",\"とほう\",\"とまる\",\"とめる\",\"ともだち\",\"ともる\",\"どようび\",\"とらえる\",\"とんかつ\",\"どんぶり\",\"ないかく\",\"ないこう\",\"ないしょ\",\"ないす\",\"ないせん\",\"ないそう\",\"なおす\",\"ながい\",\"なくす\",\"なげる\",\"なこうど\",\"なさけ\",\"なたでここ\",\"なっとう\",\"なつやすみ\",\"ななおし\",\"なにごと\",\"なにもの\",\"なにわ\",\"なのか\",\"なふだ\",\"なまいき\",\"なまえ\",\"なまみ\",\"なみだ\",\"なめらか\",\"なめる\",\"なやむ\",\"ならう\",\"ならび\",\"ならぶ\",\"なれる\",\"なわとび\",\"なわばり\",\"にあう\",\"にいがた\",\"にうけ\",\"におい\",\"にかい\",\"にがて\",\"にきび\",\"にくしみ\",\"にくまん\",\"にげる\",\"にさんかたんそ\",\"にしき\",\"にせもの\",\"にちじょう\",\"にちようび\",\"にっか\",\"にっき\",\"にっけい\",\"にっこう\",\"にっさん\",\"にっしょく\",\"にっすう\",\"にっせき\",\"にってい\",\"になう\",\"にほん\",\"にまめ\",\"にもつ\",\"にやり\",\"にゅういん\",\"にりんしゃ\",\"にわとり\",\"にんい\",\"にんか\",\"にんき\",\"にんげん\",\"にんしき\",\"にんずう\",\"にんそう\",\"にんたい\",\"にんち\",\"にんてい\",\"にんにく\",\"にんぷ\",\"にんまり\",\"にんむ\",\"にんめい\",\"にんよう\",\"ぬいくぎ\",\"ぬかす\",\"ぬぐいとる\",\"ぬぐう\",\"ぬくもり\",\"ぬすむ\",\"ぬまえび\",\"ぬめり\",\"ぬらす\",\"ぬんちゃく\",\"ねあげ\",\"ねいき\",\"ねいる\",\"ねいろ\",\"ねぐせ\",\"ねくたい\",\"ねくら\",\"ねこぜ\",\"ねこむ\",\"ねさげ\",\"ねすごす\",\"ねそべる\",\"ねだん\",\"ねつい\",\"ねっしん\",\"ねつぞう\",\"ねったいぎょ\",\"ねぶそく\",\"ねふだ\",\"ねぼう\",\"ねほりはほり\",\"ねまき\",\"ねまわし\",\"ねみみ\",\"ねむい\",\"ねむたい\",\"ねもと\",\"ねらう\",\"ねわざ\",\"ねんいり\",\"ねんおし\",\"ねんかん\",\"ねんきん\",\"ねんぐ\",\"ねんざ\",\"ねんし\",\"ねんちゃく\",\"ねんど\",\"ねんぴ\",\"ねんぶつ\",\"ねんまつ\",\"ねんりょう\",\"ねんれい\",\"のいず\",\"のおづま\",\"のがす\",\"のきなみ\",\"のこぎり\",\"のこす\",\"のこる\",\"のせる\",\"のぞく\",\"のぞむ\",\"のたまう\",\"のちほど\",\"のっく\",\"のばす\",\"のはら\",\"のべる\",\"のぼる\",\"のみもの\",\"のやま\",\"のらいぬ\",\"のらねこ\",\"のりもの\",\"のりゆき\",\"のれん\",\"のんき\",\"ばあい\",\"はあく\",\"ばあさん\",\"ばいか\",\"ばいく\",\"はいけん\",\"はいご\",\"はいしん\",\"はいすい\",\"はいせん\",\"はいそう\",\"はいち\",\"ばいばい\",\"はいれつ\",\"はえる\",\"はおる\",\"はかい\",\"ばかり\",\"はかる\",\"はくしゅ\",\"はけん\",\"はこぶ\",\"はさみ\",\"はさん\",\"はしご\",\"ばしょ\",\"はしる\",\"はせる\",\"ぱそこん\",\"はそん\",\"はたん\",\"はちみつ\",\"はつおん\",\"はっかく\",\"はづき\",\"はっきり\",\"はっくつ\",\"はっけん\",\"はっこう\",\"はっさん\",\"はっしん\",\"はったつ\",\"はっちゅう\",\"はってん\",\"はっぴょう\",\"はっぽう\",\"はなす\",\"はなび\",\"はにかむ\",\"はぶらし\",\"はみがき\",\"はむかう\",\"はめつ\",\"はやい\",\"はやし\",\"はらう\",\"はろうぃん\",\"はわい\",\"はんい\",\"はんえい\",\"はんおん\",\"はんかく\",\"はんきょう\",\"ばんぐみ\",\"はんこ\",\"はんしゃ\",\"はんすう\",\"はんだん\",\"ぱんち\",\"ぱんつ\",\"はんてい\",\"はんとし\",\"はんのう\",\"はんぱ\",\"はんぶん\",\"はんぺん\",\"はんぼうき\",\"はんめい\",\"はんらん\",\"はんろん\",\"ひいき\",\"ひうん\",\"ひえる\",\"ひかく\",\"ひかり\",\"ひかる\",\"ひかん\",\"ひくい\",\"ひけつ\",\"ひこうき\",\"ひこく\",\"ひさい\",\"ひさしぶり\",\"ひさん\",\"びじゅつかん\",\"ひしょ\",\"ひそか\",\"ひそむ\",\"ひたむき\",\"ひだり\",\"ひたる\",\"ひつぎ\",\"ひっこし\",\"ひっし\",\"ひつじゅひん\",\"ひっす\",\"ひつぜん\",\"ぴったり\",\"ぴっちり\",\"ひつよう\",\"ひてい\",\"ひとごみ\",\"ひなまつり\",\"ひなん\",\"ひねる\",\"ひはん\",\"ひびく\",\"ひひょう\",\"ひほう\",\"ひまわり\",\"ひまん\",\"ひみつ\",\"ひめい\",\"ひめじし\",\"ひやけ\",\"ひやす\",\"ひよう\",\"びょうき\",\"ひらがな\",\"ひらく\",\"ひりつ\",\"ひりょう\",\"ひるま\",\"ひるやすみ\",\"ひれい\",\"ひろい\",\"ひろう\",\"ひろき\",\"ひろゆき\",\"ひんかく\",\"ひんけつ\",\"ひんこん\",\"ひんしゅ\",\"ひんそう\",\"ぴんち\",\"ひんぱん\",\"びんぼう\",\"ふあん\",\"ふいうち\",\"ふうけい\",\"ふうせん\",\"ぷうたろう\",\"ふうとう\",\"ふうふ\",\"ふえる\",\"ふおん\",\"ふかい\",\"ふきん\",\"ふくざつ\",\"ふくぶくろ\",\"ふこう\",\"ふさい\",\"ふしぎ\",\"ふじみ\",\"ふすま\",\"ふせい\",\"ふせぐ\",\"ふそく\",\"ぶたにく\",\"ふたん\",\"ふちょう\",\"ふつう\",\"ふつか\",\"ふっかつ\",\"ふっき\",\"ふっこく\",\"ぶどう\",\"ふとる\",\"ふとん\",\"ふのう\",\"ふはい\",\"ふひょう\",\"ふへん\",\"ふまん\",\"ふみん\",\"ふめつ\",\"ふめん\",\"ふよう\",\"ふりこ\",\"ふりる\",\"ふるい\",\"ふんいき\",\"ぶんがく\",\"ぶんぐ\",\"ふんしつ\",\"ぶんせき\",\"ふんそう\",\"ぶんぽう\",\"へいあん\",\"へいおん\",\"へいがい\",\"へいき\",\"へいげん\",\"へいこう\",\"へいさ\",\"へいしゃ\",\"へいせつ\",\"へいそ\",\"へいたく\",\"へいてん\",\"へいねつ\",\"へいわ\",\"へきが\",\"へこむ\",\"べにいろ\",\"べにしょうが\",\"へらす\",\"へんかん\",\"べんきょう\",\"べんごし\",\"へんさい\",\"へんたい\",\"べんり\",\"ほあん\",\"ほいく\",\"ぼうぎょ\",\"ほうこく\",\"ほうそう\",\"ほうほう\",\"ほうもん\",\"ほうりつ\",\"ほえる\",\"ほおん\",\"ほかん\",\"ほきょう\",\"ぼきん\",\"ほくろ\",\"ほけつ\",\"ほけん\",\"ほこう\",\"ほこる\",\"ほしい\",\"ほしつ\",\"ほしゅ\",\"ほしょう\",\"ほせい\",\"ほそい\",\"ほそく\",\"ほたて\",\"ほたる\",\"ぽちぶくろ\",\"ほっきょく\",\"ほっさ\",\"ほったん\",\"ほとんど\",\"ほめる\",\"ほんい\",\"ほんき\",\"ほんけ\",\"ほんしつ\",\"ほんやく\",\"まいにち\",\"まかい\",\"まかせる\",\"まがる\",\"まける\",\"まこと\",\"まさつ\",\"まじめ\",\"ますく\",\"まぜる\",\"まつり\",\"まとめ\",\"まなぶ\",\"まぬけ\",\"まねく\",\"まほう\",\"まもる\",\"まゆげ\",\"まよう\",\"まろやか\",\"まわす\",\"まわり\",\"まわる\",\"まんが\",\"まんきつ\",\"まんぞく\",\"まんなか\",\"みいら\",\"みうち\",\"みえる\",\"みがく\",\"みかた\",\"みかん\",\"みけん\",\"みこん\",\"みじかい\",\"みすい\",\"みすえる\",\"みせる\",\"みっか\",\"みつかる\",\"みつける\",\"みてい\",\"みとめる\",\"みなと\",\"みなみかさい\",\"みねらる\",\"みのう\",\"みのがす\",\"みほん\",\"みもと\",\"みやげ\",\"みらい\",\"みりょく\",\"みわく\",\"みんか\",\"みんぞく\",\"むいか\",\"むえき\",\"むえん\",\"むかい\",\"むかう\",\"むかえ\",\"むかし\",\"むぎちゃ\",\"むける\",\"むげん\",\"むさぼる\",\"むしあつい\",\"むしば\",\"むじゅん\",\"むしろ\",\"むすう\",\"むすこ\",\"むすぶ\",\"むすめ\",\"むせる\",\"むせん\",\"むちゅう\",\"むなしい\",\"むのう\",\"むやみ\",\"むよう\",\"むらさき\",\"むりょう\",\"むろん\",\"めいあん\",\"めいうん\",\"めいえん\",\"めいかく\",\"めいきょく\",\"めいさい\",\"めいし\",\"めいそう\",\"めいぶつ\",\"めいれい\",\"めいわく\",\"めぐまれる\",\"めざす\",\"めした\",\"めずらしい\",\"めだつ\",\"めまい\",\"めやす\",\"めんきょ\",\"めんせき\",\"めんどう\",\"もうしあげる\",\"もうどうけん\",\"もえる\",\"もくし\",\"もくてき\",\"もくようび\",\"もちろん\",\"もどる\",\"もらう\",\"もんく\",\"もんだい\",\"やおや\",\"やける\",\"やさい\",\"やさしい\",\"やすい\",\"やすたろう\",\"やすみ\",\"やせる\",\"やそう\",\"やたい\",\"やちん\",\"やっと\",\"やっぱり\",\"やぶる\",\"やめる\",\"ややこしい\",\"やよい\",\"やわらかい\",\"ゆうき\",\"ゆうびんきょく\",\"ゆうべ\",\"ゆうめい\",\"ゆけつ\",\"ゆしゅつ\",\"ゆせん\",\"ゆそう\",\"ゆたか\",\"ゆちゃく\",\"ゆでる\",\"ゆにゅう\",\"ゆびわ\",\"ゆらい\",\"ゆれる\",\"ようい\",\"ようか\",\"ようきゅう\",\"ようじ\",\"ようす\",\"ようちえん\",\"よかぜ\",\"よかん\",\"よきん\",\"よくせい\",\"よくぼう\",\"よけい\",\"よごれる\",\"よさん\",\"よしゅう\",\"よそう\",\"よそく\",\"よっか\",\"よてい\",\"よどがわく\",\"よねつ\",\"よやく\",\"よゆう\",\"よろこぶ\",\"よろしい\",\"らいう\",\"らくがき\",\"らくご\",\"らくさつ\",\"らくだ\",\"らしんばん\",\"らせん\",\"らぞく\",\"らたい\",\"らっか\",\"られつ\",\"りえき\",\"りかい\",\"りきさく\",\"りきせつ\",\"りくぐん\",\"りくつ\",\"りけん\",\"りこう\",\"りせい\",\"りそう\",\"りそく\",\"りてん\",\"りねん\",\"りゆう\",\"りゅうがく\",\"りよう\",\"りょうり\",\"りょかん\",\"りょくちゃ\",\"りょこう\",\"りりく\",\"りれき\",\"りろん\",\"りんご\",\"るいけい\",\"るいさい\",\"るいじ\",\"るいせき\",\"るすばん\",\"るりがわら\",\"れいかん\",\"れいぎ\",\"れいせい\",\"れいぞうこ\",\"れいとう\",\"れいぼう\",\"れきし\",\"れきだい\",\"れんあい\",\"れんけい\",\"れんこん\",\"れんさい\",\"れんしゅう\",\"れんぞく\",\"れんらく\",\"ろうか\",\"ろうご\",\"ろうじん\",\"ろうそく\",\"ろくが\",\"ろこつ\",\"ろじうら\",\"ろしゅつ\",\"ろせん\",\"ろてん\",\"ろめん\",\"ろれつ\",\"ろんぎ\",\"ろんぱ\",\"ろんぶん\",\"ろんり\",\"わかす\",\"わかめ\",\"わかやま\",\"わかれる\",\"わしつ\",\"わじまし\",\"わすれもの\",\"わらう\",\"われる\"][\"가격\",\"가끔\",\"가난\",\"가능\",\"가득\",\"가르침\",\"가뭄\",\"가방\",\"가상\",\"가슴\",\"가운데\",\"가을\",\"가이드\",\"가입\",\"가장\",\"가정\",\"가족\",\"가죽\",\"각오\",\"각자\",\"간격\",\"간부\",\"간섭\",\"간장\",\"간접\",\"간판\",\"갈등\",\"갈비\",\"갈색\",\"갈증\",\"감각\",\"감기\",\"감소\",\"감수성\",\"감자\",\"감정\",\"갑자기\",\"강남\",\"강당\",\"강도\",\"강력히\",\"강변\",\"강북\",\"강사\",\"강수량\",\"강아지\",\"강원도\",\"강의\",\"강제\",\"강조\",\"같이\",\"개구리\",\"개나리\",\"개방\",\"개별\",\"개선\",\"개성\",\"개인\",\"객관적\",\"거실\",\"거액\",\"거울\",\"거짓\",\"거품\",\"걱정\",\"건강\",\"건물\",\"건설\",\"건조\",\"건축\",\"걸음\",\"검사\",\"검토\",\"게시판\",\"게임\",\"겨울\",\"견해\",\"결과\",\"결국\",\"결론\",\"결석\",\"결승\",\"결심\",\"결정\",\"결혼\",\"경계\",\"경고\",\"경기\",\"경력\",\"경복궁\",\"경비\",\"경상도\",\"경영\",\"경우\",\"경쟁\",\"경제\",\"경주\",\"경찰\",\"경치\",\"경향\",\"경험\",\"계곡\",\"계단\",\"계란\",\"계산\",\"계속\",\"계약\",\"계절\",\"계층\",\"계획\",\"고객\",\"고구려\",\"고궁\",\"고급\",\"고등학생\",\"고무신\",\"고민\",\"고양이\",\"고장\",\"고전\",\"고집\",\"고춧가루\",\"고통\",\"고향\",\"곡식\",\"골목\",\"골짜기\",\"골프\",\"공간\",\"공개\",\"공격\",\"공군\",\"공급\",\"공기\",\"공동\",\"공무원\",\"공부\",\"공사\",\"공식\",\"공업\",\"공연\",\"공원\",\"공장\",\"공짜\",\"공책\",\"공통\",\"공포\",\"공항\",\"공휴일\",\"과목\",\"과일\",\"과장\",\"과정\",\"과학\",\"관객\",\"관계\",\"관광\",\"관념\",\"관람\",\"관련\",\"관리\",\"관습\",\"관심\",\"관점\",\"관찰\",\"광경\",\"광고\",\"광장\",\"광주\",\"괴로움\",\"굉장히\",\"교과서\",\"교문\",\"교복\",\"교실\",\"교양\",\"교육\",\"교장\",\"교직\",\"교통\",\"교환\",\"교훈\",\"구경\",\"구름\",\"구멍\",\"구별\",\"구분\",\"구석\",\"구성\",\"구속\",\"구역\",\"구입\",\"구청\",\"구체적\",\"국가\",\"국기\",\"국내\",\"국립\",\"국물\",\"국민\",\"국수\",\"국어\",\"국왕\",\"국적\",\"국제\",\"국회\",\"군대\",\"군사\",\"군인\",\"궁극적\",\"권리\",\"권위\",\"권투\",\"귀국\",\"귀신\",\"규정\",\"규칙\",\"균형\",\"그날\",\"그냥\",\"그늘\",\"그러나\",\"그룹\",\"그릇\",\"그림\",\"그제서야\",\"그토록\",\"극복\",\"극히\",\"근거\",\"근교\",\"근래\",\"근로\",\"근무\",\"근본\",\"근원\",\"근육\",\"근처\",\"글씨\",\"글자\",\"금강산\",\"금고\",\"금년\",\"금메달\",\"금액\",\"금연\",\"금요일\",\"금지\",\"긍정적\",\"기간\",\"기관\",\"기념\",\"기능\",\"기독교\",\"기둥\",\"기록\",\"기름\",\"기법\",\"기본\",\"기분\",\"기쁨\",\"기숙사\",\"기술\",\"기억\",\"기업\",\"기온\",\"기운\",\"기원\",\"기적\",\"기준\",\"기침\",\"기혼\",\"기획\",\"긴급\",\"긴장\",\"길이\",\"김밥\",\"김치\",\"김포공항\",\"깍두기\",\"깜빡\",\"깨달음\",\"깨소금\",\"껍질\",\"꼭대기\",\"꽃잎\",\"나들이\",\"나란히\",\"나머지\",\"나물\",\"나침반\",\"나흘\",\"낙엽\",\"난방\",\"날개\",\"날씨\",\"날짜\",\"남녀\",\"남대문\",\"남매\",\"남산\",\"남자\",\"남편\",\"남학생\",\"낭비\",\"낱말\",\"내년\",\"내용\",\"내일\",\"냄비\",\"냄새\",\"냇물\",\"냉동\",\"냉면\",\"냉방\",\"냉장고\",\"넥타이\",\"넷째\",\"노동\",\"노란색\",\"노력\",\"노인\",\"녹음\",\"녹차\",\"녹화\",\"논리\",\"논문\",\"논쟁\",\"놀이\",\"농구\",\"농담\",\"농민\",\"농부\",\"농업\",\"농장\",\"농촌\",\"높이\",\"눈동자\",\"눈물\",\"눈썹\",\"뉴욕\",\"느낌\",\"늑대\",\"능동적\",\"능력\",\"다방\",\"다양성\",\"다음\",\"다이어트\",\"다행\",\"단계\",\"단골\",\"단독\",\"단맛\",\"단순\",\"단어\",\"단위\",\"단점\",\"단체\",\"단추\",\"단편\",\"단풍\",\"달걀\",\"달러\",\"달력\",\"달리\",\"닭고기\",\"담당\",\"담배\",\"담요\",\"담임\",\"답변\",\"답장\",\"당근\",\"당분간\",\"당연히\",\"당장\",\"대규모\",\"대낮\",\"대단히\",\"대답\",\"대도시\",\"대략\",\"대량\",\"대륙\",\"대문\",\"대부분\",\"대신\",\"대응\",\"대장\",\"대전\",\"대접\",\"대중\",\"대책\",\"대출\",\"대충\",\"대통령\",\"대학\",\"대한민국\",\"대합실\",\"대형\",\"덩어리\",\"데이트\",\"도대체\",\"도덕\",\"도둑\",\"도망\",\"도서관\",\"도심\",\"도움\",\"도입\",\"도자기\",\"도저히\",\"도전\",\"도중\",\"도착\",\"독감\",\"독립\",\"독서\",\"독일\",\"독창적\",\"동화책\",\"뒷모습\",\"뒷산\",\"딸아이\",\"마누라\",\"마늘\",\"마당\",\"마라톤\",\"마련\",\"마무리\",\"마사지\",\"마약\",\"마요네즈\",\"마을\",\"마음\",\"마이크\",\"마중\",\"마지막\",\"마찬가지\",\"마찰\",\"마흔\",\"막걸리\",\"막내\",\"막상\",\"만남\",\"만두\",\"만세\",\"만약\",\"만일\",\"만점\",\"만족\",\"만화\",\"많이\",\"말기\",\"말씀\",\"말투\",\"맘대로\",\"망원경\",\"매년\",\"매달\",\"매력\",\"매번\",\"매스컴\",\"매일\",\"매장\",\"맥주\",\"먹이\",\"먼저\",\"먼지\",\"멀리\",\"메일\",\"며느리\",\"며칠\",\"면담\",\"멸치\",\"명단\",\"명령\",\"명예\",\"명의\",\"명절\",\"명칭\",\"명함\",\"모금\",\"모니터\",\"모델\",\"모든\",\"모범\",\"모습\",\"모양\",\"모임\",\"모조리\",\"모집\",\"모퉁이\",\"목걸이\",\"목록\",\"목사\",\"목소리\",\"목숨\",\"목적\",\"목표\",\"몰래\",\"몸매\",\"몸무게\",\"몸살\",\"몸속\",\"몸짓\",\"몸통\",\"몹시\",\"무관심\",\"무궁화\",\"무더위\",\"무덤\",\"무릎\",\"무슨\",\"무엇\",\"무역\",\"무용\",\"무조건\",\"무지개\",\"무척\",\"문구\",\"문득\",\"문법\",\"문서\",\"문제\",\"문학\",\"문화\",\"물가\",\"물건\",\"물결\",\"물고기\",\"물론\",\"물리학\",\"물음\",\"물질\",\"물체\",\"미국\",\"미디어\",\"미사일\",\"미술\",\"미역\",\"미용실\",\"미움\",\"미인\",\"미팅\",\"미혼\",\"민간\",\"민족\",\"민주\",\"믿음\",\"밀가루\",\"밀리미터\",\"밑바닥\",\"바가지\",\"바구니\",\"바나나\",\"바늘\",\"바닥\",\"바닷가\",\"바람\",\"바이러스\",\"바탕\",\"박물관\",\"박사\",\"박수\",\"반대\",\"반드시\",\"반말\",\"반발\",\"반성\",\"반응\",\"반장\",\"반죽\",\"반지\",\"반찬\",\"받침\",\"발가락\",\"발걸음\",\"발견\",\"발달\",\"발레\",\"발목\",\"발바닥\",\"발생\",\"발음\",\"발자국\",\"발전\",\"발톱\",\"발표\",\"밤하늘\",\"밥그릇\",\"밥맛\",\"밥상\",\"밥솥\",\"방금\",\"방면\",\"방문\",\"방바닥\",\"방법\",\"방송\",\"방식\",\"방안\",\"방울\",\"방지\",\"방학\",\"방해\",\"방향\",\"배경\",\"배꼽\",\"배달\",\"배드민턴\",\"백두산\",\"백색\",\"백성\",\"백인\",\"백제\",\"백화점\",\"버릇\",\"버섯\",\"버튼\",\"번개\",\"번역\",\"번지\",\"번호\",\"벌금\",\"벌레\",\"벌써\",\"범위\",\"범인\",\"범죄\",\"법률\",\"법원\",\"법적\",\"법칙\",\"베이징\",\"벨트\",\"변경\",\"변동\",\"변명\",\"변신\",\"변호사\",\"변화\",\"별도\",\"별명\",\"별일\",\"병실\",\"병아리\",\"병원\",\"보관\",\"보너스\",\"보라색\",\"보람\",\"보름\",\"보상\",\"보안\",\"보자기\",\"보장\",\"보전\",\"보존\",\"보통\",\"보편적\",\"보험\",\"복도\",\"복사\",\"복숭아\",\"복습\",\"볶음\",\"본격적\",\"본래\",\"본부\",\"본사\",\"본성\",\"본인\",\"본질\",\"볼펜\",\"봉사\",\"봉지\",\"봉투\",\"부근\",\"부끄러움\",\"부담\",\"부동산\",\"부문\",\"부분\",\"부산\",\"부상\",\"부엌\",\"부인\",\"부작용\",\"부장\",\"부정\",\"부족\",\"부지런히\",\"부친\",\"부탁\",\"부품\",\"부회장\",\"북부\",\"북한\",\"분노\",\"분량\",\"분리\",\"분명\",\"분석\",\"분야\",\"분위기\",\"분필\",\"분홍색\",\"불고기\",\"불과\",\"불교\",\"불꽃\",\"불만\",\"불법\",\"불빛\",\"불안\",\"불이익\",\"불행\",\"브랜드\",\"비극\",\"비난\",\"비닐\",\"비둘기\",\"비디오\",\"비로소\",\"비만\",\"비명\",\"비밀\",\"비바람\",\"비빔밥\",\"비상\",\"비용\",\"비율\",\"비중\",\"비타민\",\"비판\",\"빌딩\",\"빗물\",\"빗방울\",\"빗줄기\",\"빛깔\",\"빨간색\",\"빨래\",\"빨리\",\"사건\",\"사계절\",\"사나이\",\"사냥\",\"사람\",\"사랑\",\"사립\",\"사모님\",\"사물\",\"사방\",\"사상\",\"사생활\",\"사설\",\"사슴\",\"사실\",\"사업\",\"사용\",\"사월\",\"사장\",\"사전\",\"사진\",\"사촌\",\"사춘기\",\"사탕\",\"사투리\",\"사흘\",\"산길\",\"산부인과\",\"산업\",\"산책\",\"살림\",\"살인\",\"살짝\",\"삼계탕\",\"삼국\",\"삼십\",\"삼월\",\"삼촌\",\"상관\",\"상금\",\"상대\",\"상류\",\"상반기\",\"상상\",\"상식\",\"상업\",\"상인\",\"상자\",\"상점\",\"상처\",\"상추\",\"상태\",\"상표\",\"상품\",\"상황\",\"새벽\",\"색깔\",\"색연필\",\"생각\",\"생명\",\"생물\",\"생방송\",\"생산\",\"생선\",\"생신\",\"생일\",\"생활\",\"서랍\",\"서른\",\"서명\",\"서민\",\"서비스\",\"서양\",\"서울\",\"서적\",\"서점\",\"서쪽\",\"서클\",\"석사\",\"석유\",\"선거\",\"선물\",\"선배\",\"선생\",\"선수\",\"선원\",\"선장\",\"선전\",\"선택\",\"선풍기\",\"설거지\",\"설날\",\"설렁탕\",\"설명\",\"설문\",\"설사\",\"설악산\",\"설치\",\"설탕\",\"섭씨\",\"성공\",\"성당\",\"성명\",\"성별\",\"성인\",\"성장\",\"성적\",\"성질\",\"성함\",\"세금\",\"세미나\",\"세상\",\"세월\",\"세종대왕\",\"세탁\",\"센터\",\"센티미터\",\"셋째\",\"소규모\",\"소극적\",\"소금\",\"소나기\",\"소년\",\"소득\",\"소망\",\"소문\",\"소설\",\"소속\",\"소아과\",\"소용\",\"소원\",\"소음\",\"소중히\",\"소지품\",\"소질\",\"소풍\",\"소형\",\"속담\",\"속도\",\"속옷\",\"손가락\",\"손길\",\"손녀\",\"손님\",\"손등\",\"손목\",\"손뼉\",\"손실\",\"손질\",\"손톱\",\"손해\",\"솔직히\",\"솜씨\",\"송아지\",\"송이\",\"송편\",\"쇠고기\",\"쇼핑\",\"수건\",\"수년\",\"수단\",\"수돗물\",\"수동적\",\"수면\",\"수명\",\"수박\",\"수상\",\"수석\",\"수술\",\"수시로\",\"수업\",\"수염\",\"수영\",\"수입\",\"수준\",\"수집\",\"수출\",\"수컷\",\"수필\",\"수학\",\"수험생\",\"수화기\",\"숙녀\",\"숙소\",\"숙제\",\"순간\",\"순서\",\"순수\",\"순식간\",\"순위\",\"숟가락\",\"술병\",\"술집\",\"숫자\",\"스님\",\"스물\",\"스스로\",\"스승\",\"스웨터\",\"스위치\",\"스케이트\",\"스튜디오\",\"스트레스\",\"스포츠\",\"슬쩍\",\"슬픔\",\"습관\",\"습기\",\"승객\",\"승리\",\"승부\",\"승용차\",\"승진\",\"시각\",\"시간\",\"시골\",\"시금치\",\"시나리오\",\"시댁\",\"시리즈\",\"시멘트\",\"시민\",\"시부모\",\"시선\",\"시설\",\"시스템\",\"시아버지\",\"시어머니\",\"시월\",\"시인\",\"시일\",\"시작\",\"시장\",\"시절\",\"시점\",\"시중\",\"시즌\",\"시집\",\"시청\",\"시합\",\"시험\",\"식구\",\"식기\",\"식당\",\"식량\",\"식료품\",\"식물\",\"식빵\",\"식사\",\"식생활\",\"식초\",\"식탁\",\"식품\",\"신고\",\"신규\",\"신념\",\"신문\",\"신발\",\"신비\",\"신사\",\"신세\",\"신용\",\"신제품\",\"신청\",\"신체\",\"신화\",\"실감\",\"실내\",\"실력\",\"실례\",\"실망\",\"실수\",\"실습\",\"실시\",\"실장\",\"실정\",\"실질적\",\"실천\",\"실체\",\"실컷\",\"실태\",\"실패\",\"실험\",\"실현\",\"심리\",\"심부름\",\"심사\",\"심장\",\"심정\",\"심판\",\"쌍둥이\",\"씨름\",\"씨앗\",\"아가씨\",\"아나운서\",\"아드님\",\"아들\",\"아쉬움\",\"아스팔트\",\"아시아\",\"아울러\",\"아저씨\",\"아줌마\",\"아직\",\"아침\",\"아파트\",\"아프리카\",\"아픔\",\"아홉\",\"아흔\",\"악기\",\"악몽\",\"악수\",\"안개\",\"안경\",\"안과\",\"안내\",\"안녕\",\"안동\",\"안방\",\"안부\",\"안주\",\"알루미늄\",\"알코올\",\"암시\",\"암컷\",\"압력\",\"앞날\",\"앞문\",\"애인\",\"애정\",\"액수\",\"앨범\",\"야간\",\"야단\",\"야옹\",\"약간\",\"약국\",\"약속\",\"약수\",\"약점\",\"약품\",\"약혼녀\",\"양념\",\"양력\",\"양말\",\"양배추\",\"양주\",\"양파\",\"어둠\",\"어려움\",\"어른\",\"어젯밤\",\"어쨌든\",\"어쩌다가\",\"어쩐지\",\"언니\",\"언덕\",\"언론\",\"언어\",\"얼굴\",\"얼른\",\"얼음\",\"얼핏\",\"엄마\",\"업무\",\"업종\",\"업체\",\"엉덩이\",\"엉망\",\"엉터리\",\"엊그제\",\"에너지\",\"에어컨\",\"엔진\",\"여건\",\"여고생\",\"여관\",\"여군\",\"여권\",\"여대생\",\"여덟\",\"여동생\",\"여든\",\"여론\",\"여름\",\"여섯\",\"여성\",\"여왕\",\"여인\",\"여전히\",\"여직원\",\"여학생\",\"여행\",\"역사\",\"역시\",\"역할\",\"연결\",\"연구\",\"연극\",\"연기\",\"연락\",\"연설\",\"연세\",\"연속\",\"연습\",\"연애\",\"연예인\",\"연인\",\"연장\",\"연주\",\"연출\",\"연필\",\"연합\",\"연휴\",\"열기\",\"열매\",\"열쇠\",\"열심히\",\"열정\",\"열차\",\"열흘\",\"염려\",\"엽서\",\"영국\",\"영남\",\"영상\",\"영양\",\"영역\",\"영웅\",\"영원히\",\"영하\",\"영향\",\"영혼\",\"영화\",\"옆구리\",\"옆방\",\"옆집\",\"예감\",\"예금\",\"예방\",\"예산\",\"예상\",\"예선\",\"예술\",\"예습\",\"예식장\",\"예약\",\"예전\",\"예절\",\"예정\",\"예컨대\",\"옛날\",\"오늘\",\"오락\",\"오랫동안\",\"오렌지\",\"오로지\",\"오른발\",\"오븐\",\"오십\",\"오염\",\"오월\",\"오전\",\"오직\",\"오징어\",\"오페라\",\"오피스텔\",\"오히려\",\"옥상\",\"옥수수\",\"온갖\",\"온라인\",\"온몸\",\"온종일\",\"온통\",\"올가을\",\"올림픽\",\"올해\",\"옷차림\",\"와이셔츠\",\"와인\",\"완성\",\"완전\",\"왕비\",\"왕자\",\"왜냐하면\",\"왠지\",\"외갓집\",\"외국\",\"외로움\",\"외삼촌\",\"외출\",\"외침\",\"외할머니\",\"왼발\",\"왼손\",\"왼쪽\",\"요금\",\"요일\",\"요즘\",\"요청\",\"용기\",\"용서\",\"용어\",\"우산\",\"우선\",\"우승\",\"우연히\",\"우정\",\"우체국\",\"우편\",\"운동\",\"운명\",\"운반\",\"운전\",\"운행\",\"울산\",\"울음\",\"움직임\",\"웃어른\",\"웃음\",\"워낙\",\"원고\",\"원래\",\"원서\",\"원숭이\",\"원인\",\"원장\",\"원피스\",\"월급\",\"월드컵\",\"월세\",\"월요일\",\"웨이터\",\"위반\",\"위법\",\"위성\",\"위원\",\"위험\",\"위협\",\"윗사람\",\"유난히\",\"유럽\",\"유명\",\"유물\",\"유산\",\"유적\",\"유치원\",\"유학\",\"유행\",\"유형\",\"육군\",\"육상\",\"육십\",\"육체\",\"은행\",\"음력\",\"음료\",\"음반\",\"음성\",\"음식\",\"음악\",\"음주\",\"의견\",\"의논\",\"의문\",\"의복\",\"의식\",\"의심\",\"의외로\",\"의욕\",\"의원\",\"의학\",\"이것\",\"이곳\",\"이념\",\"이놈\",\"이달\",\"이대로\",\"이동\",\"이렇게\",\"이력서\",\"이론적\",\"이름\",\"이민\",\"이발소\",\"이별\",\"이불\",\"이빨\",\"이상\",\"이성\",\"이슬\",\"이야기\",\"이용\",\"이웃\",\"이월\",\"이윽고\",\"이익\",\"이전\",\"이중\",\"이튿날\",\"이틀\",\"이혼\",\"인간\",\"인격\",\"인공\",\"인구\",\"인근\",\"인기\",\"인도\",\"인류\",\"인물\",\"인생\",\"인쇄\",\"인연\",\"인원\",\"인재\",\"인종\",\"인천\",\"인체\",\"인터넷\",\"인하\",\"인형\",\"일곱\",\"일기\",\"일단\",\"일대\",\"일등\",\"일반\",\"일본\",\"일부\",\"일상\",\"일생\",\"일손\",\"일요일\",\"일월\",\"일정\",\"일종\",\"일주일\",\"일찍\",\"일체\",\"일치\",\"일행\",\"일회용\",\"임금\",\"임무\",\"입대\",\"입력\",\"입맛\",\"입사\",\"입술\",\"입시\",\"입원\",\"입장\",\"입학\",\"자가용\",\"자격\",\"자극\",\"자동\",\"자랑\",\"자부심\",\"자식\",\"자신\",\"자연\",\"자원\",\"자율\",\"자전거\",\"자정\",\"자존심\",\"자판\",\"작가\",\"작년\",\"작성\",\"작업\",\"작용\",\"작은딸\",\"작품\",\"잔디\",\"잔뜩\",\"잔치\",\"잘못\",\"잠깐\",\"잠수함\",\"잠시\",\"잠옷\",\"잠자리\",\"잡지\",\"장관\",\"장군\",\"장기간\",\"장래\",\"장례\",\"장르\",\"장마\",\"장면\",\"장모\",\"장미\",\"장비\",\"장사\",\"장소\",\"장식\",\"장애인\",\"장인\",\"장점\",\"장차\",\"장학금\",\"재능\",\"재빨리\",\"재산\",\"재생\",\"재작년\",\"재정\",\"재채기\",\"재판\",\"재학\",\"재활용\",\"저것\",\"저고리\",\"저곳\",\"저녁\",\"저런\",\"저렇게\",\"저번\",\"저울\",\"저절로\",\"저축\",\"적극\",\"적당히\",\"적성\",\"적용\",\"적응\",\"전개\",\"전공\",\"전기\",\"전달\",\"전라도\",\"전망\",\"전문\",\"전반\",\"전부\",\"전세\",\"전시\",\"전용\",\"전자\",\"전쟁\",\"전주\",\"전철\",\"전체\",\"전통\",\"전혀\",\"전후\",\"절대\",\"절망\",\"절반\",\"절약\",\"절차\",\"점검\",\"점수\",\"점심\",\"점원\",\"점점\",\"점차\",\"접근\",\"접시\",\"접촉\",\"젓가락\",\"정거장\",\"정도\",\"정류장\",\"정리\",\"정말\",\"정면\",\"정문\",\"정반대\",\"정보\",\"정부\",\"정비\",\"정상\",\"정성\",\"정오\",\"정원\",\"정장\",\"정지\",\"정치\",\"정확히\",\"제공\",\"제과점\",\"제대로\",\"제목\",\"제발\",\"제법\",\"제삿날\",\"제안\",\"제일\",\"제작\",\"제주도\",\"제출\",\"제품\",\"제한\",\"조각\",\"조건\",\"조금\",\"조깅\",\"조명\",\"조미료\",\"조상\",\"조선\",\"조용히\",\"조절\",\"조정\",\"조직\",\"존댓말\",\"존재\",\"졸업\",\"졸음\",\"종교\",\"종로\",\"종류\",\"종소리\",\"종업원\",\"종종\",\"종합\",\"좌석\",\"죄인\",\"주관적\",\"주름\",\"주말\",\"주머니\",\"주먹\",\"주문\",\"주민\",\"주방\",\"주변\",\"주식\",\"주인\",\"주일\",\"주장\",\"주전자\",\"주택\",\"준비\",\"줄거리\",\"줄기\",\"줄무늬\",\"중간\",\"중계방송\",\"중국\",\"중년\",\"중단\",\"중독\",\"중반\",\"중부\",\"중세\",\"중소기업\",\"중순\",\"중앙\",\"중요\",\"중학교\",\"즉석\",\"즉시\",\"즐거움\",\"증가\",\"증거\",\"증권\",\"증상\",\"증세\",\"지각\",\"지갑\",\"지경\",\"지극히\",\"지금\",\"지급\",\"지능\",\"지름길\",\"지리산\",\"지방\",\"지붕\",\"지식\",\"지역\",\"지우개\",\"지원\",\"지적\",\"지점\",\"지진\",\"지출\",\"직선\",\"직업\",\"직원\",\"직장\",\"진급\",\"진동\",\"진로\",\"진료\",\"진리\",\"진짜\",\"진찰\",\"진출\",\"진통\",\"진행\",\"질문\",\"질병\",\"질서\",\"짐작\",\"집단\",\"집안\",\"집중\",\"짜증\",\"찌꺼기\",\"차남\",\"차라리\",\"차량\",\"차림\",\"차별\",\"차선\",\"차츰\",\"착각\",\"찬물\",\"찬성\",\"참가\",\"참기름\",\"참새\",\"참석\",\"참여\",\"참외\",\"참조\",\"찻잔\",\"창가\",\"창고\",\"창구\",\"창문\",\"창밖\",\"창작\",\"창조\",\"채널\",\"채점\",\"책가방\",\"책방\",\"책상\",\"책임\",\"챔피언\",\"처벌\",\"처음\",\"천국\",\"천둥\",\"천장\",\"천재\",\"천천히\",\"철도\",\"철저히\",\"철학\",\"첫날\",\"첫째\",\"청년\",\"청바지\",\"청소\",\"청춘\",\"체계\",\"체력\",\"체온\",\"체육\",\"체중\",\"체험\",\"초등학생\",\"초반\",\"초밥\",\"초상화\",\"초순\",\"초여름\",\"초원\",\"초저녁\",\"초점\",\"초청\",\"초콜릿\",\"촛불\",\"총각\",\"총리\",\"총장\",\"촬영\",\"최근\",\"최상\",\"최선\",\"최신\",\"최악\",\"최종\",\"추석\",\"추억\",\"추진\",\"추천\",\"추측\",\"축구\",\"축소\",\"축제\",\"축하\",\"출근\",\"출발\",\"출산\",\"출신\",\"출연\",\"출입\",\"출장\",\"출판\",\"충격\",\"충고\",\"충돌\",\"충분히\",\"충청도\",\"취업\",\"취직\",\"취향\",\"치약\",\"친구\",\"친척\",\"칠십\",\"칠월\",\"칠판\",\"침대\",\"침묵\",\"침실\",\"칫솔\",\"칭찬\",\"카메라\",\"카운터\",\"칼국수\",\"캐릭터\",\"캠퍼스\",\"캠페인\",\"커튼\",\"컨디션\",\"컬러\",\"컴퓨터\",\"코끼리\",\"코미디\",\"콘서트\",\"콜라\",\"콤플렉스\",\"콩나물\",\"쾌감\",\"쿠데타\",\"크림\",\"큰길\",\"큰딸\",\"큰소리\",\"큰아들\",\"큰어머니\",\"큰일\",\"큰절\",\"클래식\",\"클럽\",\"킬로\",\"타입\",\"타자기\",\"탁구\",\"탁자\",\"탄생\",\"태권도\",\"태양\",\"태풍\",\"택시\",\"탤런트\",\"터널\",\"터미널\",\"테니스\",\"테스트\",\"테이블\",\"텔레비전\",\"토론\",\"토마토\",\"토요일\",\"통계\",\"통과\",\"통로\",\"통신\",\"통역\",\"통일\",\"통장\",\"통제\",\"통증\",\"통합\",\"통화\",\"퇴근\",\"퇴원\",\"퇴직금\",\"튀김\",\"트럭\",\"특급\",\"특별\",\"특성\",\"특수\",\"특징\",\"특히\",\"튼튼히\",\"티셔츠\",\"파란색\",\"파일\",\"파출소\",\"판결\",\"판단\",\"판매\",\"판사\",\"팔십\",\"팔월\",\"팝송\",\"패션\",\"팩스\",\"팩시밀리\",\"팬티\",\"퍼센트\",\"페인트\",\"편견\",\"편의\",\"편지\",\"편히\",\"평가\",\"평균\",\"평생\",\"평소\",\"평양\",\"평일\",\"평화\",\"포스터\",\"포인트\",\"포장\",\"포함\",\"표면\",\"표정\",\"표준\",\"표현\",\"품목\",\"품질\",\"풍경\",\"풍속\",\"풍습\",\"프랑스\",\"프린터\",\"플라스틱\",\"피곤\",\"피망\",\"피아노\",\"필름\",\"필수\",\"필요\",\"필자\",\"필통\",\"핑계\",\"하느님\",\"하늘\",\"하드웨어\",\"하룻밤\",\"하반기\",\"하숙집\",\"하순\",\"하여튼\",\"하지만\",\"하천\",\"하품\",\"하필\",\"학과\",\"학교\",\"학급\",\"학기\",\"학년\",\"학력\",\"학번\",\"학부모\",\"학비\",\"학생\",\"학술\",\"학습\",\"학용품\",\"학원\",\"학위\",\"학자\",\"학점\",\"한계\",\"한글\",\"한꺼번에\",\"한낮\",\"한눈\",\"한동안\",\"한때\",\"한라산\",\"한마디\",\"한문\",\"한번\",\"한복\",\"한식\",\"한여름\",\"한쪽\",\"할머니\",\"할아버지\",\"할인\",\"함께\",\"함부로\",\"합격\",\"합리적\",\"항공\",\"항구\",\"항상\",\"항의\",\"해결\",\"해군\",\"해답\",\"해당\",\"해물\",\"해석\",\"해설\",\"해수욕장\",\"해안\",\"핵심\",\"핸드백\",\"햄버거\",\"햇볕\",\"햇살\",\"행동\",\"행복\",\"행사\",\"행운\",\"행위\",\"향기\",\"향상\",\"향수\",\"허락\",\"허용\",\"헬기\",\"현관\",\"현금\",\"현대\",\"현상\",\"현실\",\"현장\",\"현재\",\"현지\",\"혈액\",\"협력\",\"형부\",\"형사\",\"형수\",\"형식\",\"형제\",\"형태\",\"형편\",\"혜택\",\"호기심\",\"호남\",\"호랑이\",\"호박\",\"호텔\",\"호흡\",\"혹시\",\"홀로\",\"홈페이지\",\"홍보\",\"홍수\",\"홍차\",\"화면\",\"화분\",\"화살\",\"화요일\",\"화장\",\"화학\",\"확보\",\"확인\",\"확장\",\"확정\",\"환갑\",\"환경\",\"환영\",\"환율\",\"환자\",\"활기\",\"활동\",\"활발히\",\"활용\",\"활짝\",\"회견\",\"회관\",\"회복\",\"회색\",\"회원\",\"회장\",\"회전\",\"횟수\",\"횡단보도\",\"효율적\",\"후반\",\"후춧가루\",\"훈련\",\"훨씬\",\"휴식\",\"휴일\",\"흉내\",\"흐름\",\"흑백\",\"흑인\",\"흔적\",\"흔히\",\"흥미\",\"흥분\",\"희곡\",\"희망\",\"희생\",\"흰색\",\"힘껏\"]{\"的\":[\"chinese_simplified\",\"chinese_traditional\"],\"一\":[\"chinese_simplified\",\"chinese_traditional\"],\"是\":[\"chinese_simplified\",\"chinese_traditional\"],\"在\":[\"chinese_simplified\",\"chinese_traditional\"],\"不\":[\"chinese_simplified\",\"chinese_traditional\"],\"了\":[\"chinese_simplified\",\"chinese_traditional\"],\"有\":[\"chinese_simplified\",\"chinese_traditional\"],\"和\":[\"chinese_simplified\",\"chinese_traditional\"],\"人\":[\"chinese_simplified\",\"chinese_traditional\"],\"这\":[\"chinese_simplified\"],\"中\":[\"chinese_simplified\",\"chinese_traditional\"],\"大\":[\"chinese_simplified\",\"chinese_traditional\"],\"为\":[\"chinese_simplified\"],\"上\":[\"chinese_simplified\",\"chinese_traditional\"],\"个\":[\"chinese_simplified\"],\"国\":[\"chinese_simplified\"],\"我\":[\"chinese_simplified\",\"chinese_traditional\"],\"以\":[\"chinese_simplified\",\"chinese_traditional\"],\"要\":[\"chinese_simplified\",\"chinese_traditional\"],\"他\":[\"chinese_simplified\",\"chinese_traditional\"],\"时\":[\"chinese_simplified\"],\"来\":[\"chinese_simplified\"],\"用\":[\"chinese_simplified\",\"chinese_traditional\"],\"们\":[\"chinese_simplified\"],\"生\":[\"chinese_simplified\",\"chinese_traditional\"],\"到\":[\"chinese_simplified\",\"chinese_traditional\"],\"作\":[\"chinese_simplified\",\"chinese_traditional\"],\"地\":[\"chinese_simplified\",\"chinese_traditional\"],\"于\":[\"chinese_simplified\"],\"出\":[\"chinese_simplified\",\"chinese_traditional\"],\"就\":[\"chinese_simplified\",\"chinese_traditional\"],\"分\":[\"chinese_simplified\",\"chinese_traditional\"],\"对\":[\"chinese_simplified\"],\"成\":[\"chinese_simplified\",\"chinese_traditional\"],\"会\":[\"chinese_simplified\"],\"可\":[\"chinese_simplified\",\"chinese_traditional\"],\"主\":[\"chinese_simplified\",\"chinese_traditional\"],\"发\":[\"chinese_simplified\"],\"年\":[\"chinese_simplified\",\"chinese_traditional\"],\"动\":[\"chinese_simplified\"],\"同\":[\"chinese_simplified\",\"chinese_traditional\"],\"工\":[\"chinese_simplified\",\"chinese_traditional\"],\"也\":[\"chinese_simplified\",\"chinese_traditional\"],\"能\":[\"chinese_simplified\",\"chinese_traditional\"],\"下\":[\"chinese_simplified\",\"chinese_traditional\"],\"过\":[\"chinese_simplified\"],\"子\":[\"chinese_simplified\",\"chinese_traditional\"],\"说\":[\"chinese_simplified\"],\"产\":[\"chinese_simplified\"],\"种\":[\"chinese_simplified\"],\"面\":[\"chinese_simplified\",\"chinese_traditional\"],\"而\":[\"chinese_simplified\",\"chinese_traditional\"],\"方\":[\"chinese_simplified\",\"chinese_traditional\"],\"后\":[\"chinese_simplified\"],\"多\":[\"chinese_simplified\",\"chinese_traditional\"],\"定\":[\"chinese_simplified\",\"chinese_traditional\"],\"行\":[\"chinese_simplified\",\"chinese_traditional\"],\"学\":[\"chinese_simplified\"],\"法\":[\"chinese_simplified\",\"chinese_traditional\"],\"所\":[\"chinese_simplified\",\"chinese_traditional\"],\"民\":[\"chinese_simplified\",\"chinese_traditional\"],\"得\":[\"chinese_simplified\",\"chinese_traditional\"],\"经\":[\"chinese_simplified\"],\"十\":[\"chinese_simplified\",\"chinese_traditional\"],\"三\":[\"chinese_simplified\",\"chinese_traditional\"],\"之\":[\"chinese_simplified\",\"chinese_traditional\"],\"进\":[\"chinese_simplified\"],\"着\":[\"chinese_simplified\"],\"等\":[\"chinese_simplified\",\"chinese_traditional\"],\"部\":[\"chinese_simplified\",\"chinese_traditional\"],\"度\":[\"chinese_simplified\",\"chinese_traditional\"],\"家\":[\"chinese_simplified\",\"chinese_traditional\"],\"电\":[\"chinese_simplified\"],\"力\":[\"chinese_simplified\",\"chinese_traditional\"],\"里\":[\"chinese_simplified\"],\"如\":[\"chinese_simplified\",\"chinese_traditional\"],\"水\":[\"chinese_simplified\",\"chinese_traditional\"],\"化\":[\"chinese_simplified\",\"chinese_traditional\"],\"高\":[\"chinese_simplified\",\"chinese_traditional\"],\"自\":[\"chinese_simplified\",\"chinese_traditional\"],\"二\":[\"chinese_simplified\",\"chinese_traditional\"],\"理\":[\"chinese_simplified\",\"chinese_traditional\"],\"起\":[\"chinese_simplified\",\"chinese_traditional\"],\"小\":[\"chinese_simplified\",\"chinese_traditional\"],\"物\":[\"chinese_simplified\",\"chinese_traditional\"],\"现\":[\"chinese_simplified\"],\"实\":[\"chinese_simplified\"],\"加\":[\"chinese_simplified\",\"chinese_traditional\"],\"量\":[\"chinese_simplified\",\"chinese_traditional\"],\"都\":[\"chinese_simplified\",\"chinese_traditional\"],\"两\":[\"chinese_simplified\"],\"体\":[\"chinese_simplified\"],\"制\":[\"chinese_simplified\",\"chinese_traditional\"],\"机\":[\"chinese_simplified\"],\"当\":[\"chinese_simplified\"],\"使\":[\"chinese_simplified\",\"chinese_traditional\"],\"点\":[\"chinese_simplified\"],\"从\":[\"chinese_simplified\"],\"业\":[\"chinese_simplified\"],\"本\":[\"chinese_simplified\",\"chinese_traditional\"],\"去\":[\"chinese_simplified\",\"chinese_traditional\"],\"把\":[\"chinese_simplified\",\"chinese_traditional\"],\"性\":[\"chinese_simplified\",\"chinese_traditional\"],\"好\":[\"chinese_simplified\",\"chinese_traditional\"],\"应\":[\"chinese_simplified\"],\"开\":[\"chinese_simplified\"],\"它\":[\"chinese_simplified\",\"chinese_traditional\"],\"合\":[\"chinese_simplified\",\"chinese_traditional\"],\"还\":[\"chinese_simplified\"],\"因\":[\"chinese_simplified\",\"chinese_traditional\"],\"由\":[\"chinese_simplified\",\"chinese_traditional\"],\"其\":[\"chinese_simplified\",\"chinese_traditional\"],\"些\":[\"chinese_simplified\",\"chinese_traditional\"],\"然\":[\"chinese_simplified\",\"chinese_traditional\"],\"前\":[\"chinese_simplified\",\"chinese_traditional\"],\"外\":[\"chinese_simplified\",\"chinese_traditional\"],\"天\":[\"chinese_simplified\",\"chinese_traditional\"],\"政\":[\"chinese_simplified\",\"chinese_traditional\"],\"四\":[\"chinese_simplified\",\"chinese_traditional\"],\"日\":[\"chinese_simplified\",\"chinese_traditional\"],\"那\":[\"chinese_simplified\",\"chinese_traditional\"],\"社\":[\"chinese_simplified\",\"chinese_traditional\"],\"义\":[\"chinese_simplified\"],\"事\":[\"chinese_simplified\",\"chinese_traditional\"],\"平\":[\"chinese_simplified\",\"chinese_traditional\"],\"形\":[\"chinese_simplified\",\"chinese_traditional\"],\"相\":[\"chinese_simplified\",\"chinese_traditional\"],\"全\":[\"chinese_simplified\",\"chinese_traditional\"],\"表\":[\"chinese_simplified\",\"chinese_traditional\"],\"间\":[\"chinese_simplified\"],\"样\":[\"chinese_simplified\"],\"与\":[\"chinese_simplified\"],\"关\":[\"chinese_simplified\"],\"各\":[\"chinese_simplified\",\"chinese_traditional\"],\"重\":[\"chinese_simplified\",\"chinese_traditional\"],\"新\":[\"chinese_simplified\",\"chinese_traditional\"],\"线\":[\"chinese_simplified\"],\"内\":[\"chinese_simplified\"],\"数\":[\"chinese_simplified\"],\"正\":[\"chinese_simplified\",\"chinese_traditional\"],\"心\":[\"chinese_simplified\",\"chinese_traditional\"],\"反\":[\"chinese_simplified\",\"chinese_traditional\"],\"你\":[\"chinese_simplified\",\"chinese_traditional\"],\"明\":[\"chinese_simplified\",\"chinese_traditional\"],\"看\":[\"chinese_simplified\",\"chinese_traditional\"],\"原\":[\"chinese_simplified\",\"chinese_traditional\"],\"又\":[\"chinese_simplified\",\"chinese_traditional\"],\"么\":[\"chinese_simplified\"],\"利\":[\"chinese_simplified\",\"chinese_traditional\"],\"比\":[\"chinese_simplified\",\"chinese_traditional\"],\"或\":[\"chinese_simplified\",\"chinese_traditional\"],\"但\":[\"chinese_simplified\",\"chinese_traditional\"],\"质\":[\"chinese_simplified\"],\"气\":[\"chinese_simplified\"],\"第\":[\"chinese_simplified\",\"chinese_traditional\"],\"向\":[\"chinese_simplified\",\"chinese_traditional\"],\"道\":[\"chinese_simplified\",\"chinese_traditional\"],\"命\":[\"chinese_simplified\",\"chinese_traditional\"],\"此\":[\"chinese_simplified\",\"chinese_traditional\"],\"变\":[\"chinese_simplified\"],\"条\":[\"chinese_simplified\"],\"只\":[\"chinese_simplified\",\"chinese_traditional\"],\"没\":[\"chinese_simplified\"],\"结\":[\"chinese_simplified\"],\"解\":[\"chinese_simplified\",\"chinese_traditional\"],\"问\":[\"chinese_simplified\"],\"意\":[\"chinese_simplified\",\"chinese_traditional\"],\"建\":[\"chinese_simplified\",\"chinese_traditional\"],\"月\":[\"chinese_simplified\",\"chinese_traditional\"],\"公\":[\"chinese_simplified\",\"chinese_traditional\"],\"无\":[\"chinese_simplified\"],\"系\":[\"chinese_simplified\",\"chinese_traditional\"],\"军\":[\"chinese_simplified\"],\"很\":[\"chinese_simplified\",\"chinese_traditional\"],\"情\":[\"chinese_simplified\",\"chinese_traditional\"],\"者\":[\"chinese_simplified\",\"chinese_traditional\"],\"最\":[\"chinese_simplified\",\"chinese_traditional\"],\"立\":[\"chinese_simplified\",\"chinese_traditional\"],\"代\":[\"chinese_simplified\",\"chinese_traditional\"],\"想\":[\"chinese_simplified\",\"chinese_traditional\"],\"已\":[\"chinese_simplified\",\"chinese_traditional\"],\"通\":[\"chinese_simplified\",\"chinese_traditional\"],\"并\":[\"chinese_simplified\"],\"提\":[\"chinese_simplified\",\"chinese_traditional\"],\"直\":[\"chinese_simplified\",\"chinese_traditional\"],\"题\":[\"chinese_simplified\"],\"党\":[\"chinese_simplified\"],\"程\":[\"chinese_simplified\",\"chinese_traditional\"],\"展\":[\"chinese_simplified\",\"chinese_traditional\"],\"五\":[\"chinese_simplified\",\"chinese_traditional\"],\"果\":[\"chinese_simplified\",\"chinese_traditional\"],\"料\":[\"chinese_simplified\",\"chinese_traditional\"],\"象\":[\"chinese_simplified\",\"chinese_traditional\"],\"员\":[\"chinese_simplified\"],\"革\":[\"chinese_simplified\",\"chinese_traditional\"],\"位\":[\"chinese_simplified\",\"chinese_traditional\"],\"入\":[\"chinese_simplified\",\"chinese_traditional\"],\"常\":[\"chinese_simplified\",\"chinese_traditional\"],\"文\":[\"chinese_simplified\",\"chinese_traditional\"],\"总\":[\"chinese_simplified\"],\"次\":[\"chinese_simplified\",\"chinese_traditional\"],\"品\":[\"chinese_simplified\",\"chinese_traditional\"],\"式\":[\"chinese_simplified\",\"chinese_traditional\"],\"活\":[\"chinese_simplified\",\"chinese_traditional\"],\"设\":[\"chinese_simplified\"],\"及\":[\"chinese_simplified\",\"chinese_traditional\"],\"管\":[\"chinese_simplified\",\"chinese_traditional\"],\"特\":[\"chinese_simplified\",\"chinese_traditional\"],\"件\":[\"chinese_simplified\",\"chinese_traditional\"],\"长\":[\"chinese_simplified\"],\"求\":[\"chinese_simplified\",\"chinese_traditional\"],\"老\":[\"chinese_simplified\",\"chinese_traditional\"],\"头\":[\"chinese_simplified\"],\"基\":[\"chinese_simplified\",\"chinese_traditional\"],\"资\":[\"chinese_simplified\"],\"边\":[\"chinese_simplified\"],\"流\":[\"chinese_simplified\",\"chinese_traditional\"],\"路\":[\"chinese_simplified\",\"chinese_traditional\"],\"级\":[\"chinese_simplified\"],\"少\":[\"chinese_simplified\",\"chinese_traditional\"],\"图\":[\"chinese_simplified\"],\"山\":[\"chinese_simplified\",\"chinese_traditional\"],\"统\":[\"chinese_simplified\"],\"接\":[\"chinese_simplified\",\"chinese_traditional\"],\"知\":[\"chinese_simplified\",\"chinese_traditional\"],\"较\":[\"chinese_simplified\"],\"将\":[\"chinese_simplified\"],\"组\":[\"chinese_simplified\"],\"见\":[\"chinese_simplified\"],\"计\":[\"chinese_simplified\"],\"别\":[\"chinese_simplified\"],\"她\":[\"chinese_simplified\",\"chinese_traditional\"],\"手\":[\"chinese_simplified\",\"chinese_traditional\"],\"角\":[\"chinese_simplified\",\"chinese_traditional\"],\"期\":[\"chinese_simplified\",\"chinese_traditional\"],\"根\":[\"chinese_simplified\",\"chinese_traditional\"],\"论\":[\"chinese_simplified\"],\"运\":[\"chinese_simplified\"],\"农\":[\"chinese_simplified\"],\"指\":[\"chinese_simplified\",\"chinese_traditional\"],\"几\":[\"chinese_simplified\"],\"九\":[\"chinese_simplified\",\"chinese_traditional\"],\"区\":[\"chinese_simplified\"],\"强\":[\"chinese_simplified\"],\"放\":[\"chinese_simplified\",\"chinese_traditional\"],\"决\":[\"chinese_simplified\"],\"西\":[\"chinese_simplified\",\"chinese_traditional\"],\"被\":[\"chinese_simplified\",\"chinese_traditional\"],\"干\":[\"chinese_simplified\"],\"做\":[\"chinese_simplified\",\"chinese_traditional\"],\"必\":[\"chinese_simplified\",\"chinese_traditional\"],\"战\":[\"chinese_simplified\"],\"先\":[\"chinese_simplified\",\"chinese_traditional\"],\"回\":[\"chinese_simplified\",\"chinese_traditional\"],\"则\":[\"chinese_simplified\"],\"任\":[\"chinese_simplified\",\"chinese_traditional\"],\"取\":[\"chinese_simplified\",\"chinese_traditional\"],\"据\":[\"chinese_simplified\"],\"处\":[\"chinese_simplified\"],\"队\":[\"chinese_simplified\"],\"南\":[\"chinese_simplified\",\"chinese_traditional\"],\"给\":[\"chinese_simplified\"],\"色\":[\"chinese_simplified\",\"chinese_traditional\"],\"光\":[\"chinese_simplified\",\"chinese_traditional\"],\"门\":[\"chinese_simplified\"],\"即\":[\"chinese_simplified\",\"chinese_traditional\"],\"保\":[\"chinese_simplified\",\"chinese_traditional\"],\"治\":[\"chinese_simplified\",\"chinese_traditional\"],\"北\":[\"chinese_simplified\",\"chinese_traditional\"],\"造\":[\"chinese_simplified\",\"chinese_traditional\"],\"百\":[\"chinese_simplified\",\"chinese_traditional\"],\"规\":[\"chinese_simplified\"],\"热\":[\"chinese_simplified\"],\"领\":[\"chinese_simplified\"],\"七\":[\"chinese_simplified\",\"chinese_traditional\"],\"海\":[\"chinese_simplified\",\"chinese_traditional\"],\"口\":[\"chinese_simplified\",\"chinese_traditional\"],\"东\":[\"chinese_simplified\"],\"导\":[\"chinese_simplified\"],\"器\":[\"chinese_simplified\",\"chinese_traditional\"],\"压\":[\"chinese_simplified\"],\"志\":[\"chinese_simplified\",\"chinese_traditional\"],\"世\":[\"chinese_simplified\",\"chinese_traditional\"],\"金\":[\"chinese_simplified\",\"chinese_traditional\"],\"增\":[\"chinese_simplified\",\"chinese_traditional\"],\"争\":[\"chinese_simplified\"],\"济\":[\"chinese_simplified\"],\"阶\":[\"chinese_simplified\"],\"油\":[\"chinese_simplified\",\"chinese_traditional\"],\"思\":[\"chinese_simplified\",\"chinese_traditional\"],\"术\":[\"chinese_simplified\"],\"极\":[\"chinese_simplified\"],\"交\":[\"chinese_simplified\",\"chinese_traditional\"],\"受\":[\"chinese_simplified\",\"chinese_traditional\"],\"联\":[\"chinese_simplified\"],\"什\":[\"chinese_simplified\",\"chinese_traditional\"],\"认\":[\"chinese_simplified\"],\"六\":[\"chinese_simplified\",\"chinese_traditional\"],\"共\":[\"chinese_simplified\",\"chinese_traditional\"],\"权\":[\"chinese_simplified\"],\"收\":[\"chinese_simplified\",\"chinese_traditional\"],\"证\":[\"chinese_simplified\"],\"改\":[\"chinese_simplified\",\"chinese_traditional\"],\"清\":[\"chinese_simplified\",\"chinese_traditional\"],\"美\":[\"chinese_simplified\",\"chinese_traditional\"],\"再\":[\"chinese_simplified\",\"chinese_traditional\"],\"采\":[\"chinese_simplified\"],\"转\":[\"chinese_simplified\"],\"更\":[\"chinese_simplified\",\"chinese_traditional\"],\"单\":[\"chinese_simplified\"],\"风\":[\"chinese_simplified\"],\"切\":[\"chinese_simplified\",\"chinese_traditional\"],\"打\":[\"chinese_simplified\",\"chinese_traditional\"],\"白\":[\"chinese_simplified\",\"chinese_traditional\"],\"教\":[\"chinese_simplified\",\"chinese_traditional\"],\"速\":[\"chinese_simplified\",\"chinese_traditional\"],\"花\":[\"chinese_simplified\",\"chinese_traditional\"],\"带\":[\"chinese_simplified\"],\"安\":[\"chinese_simplified\",\"chinese_traditional\"],\"场\":[\"chinese_simplified\"],\"身\":[\"chinese_simplified\",\"chinese_traditional\"],\"车\":[\"chinese_simplified\"],\"例\":[\"chinese_simplified\",\"chinese_traditional\"],\"真\":[\"chinese_simplified\",\"chinese_traditional\"],\"务\":[\"chinese_simplified\"],\"具\":[\"chinese_simplified\",\"chinese_traditional\"],\"万\":[\"chinese_simplified\"],\"每\":[\"chinese_simplified\",\"chinese_traditional\"],\"目\":[\"chinese_simplified\",\"chinese_traditional\"],\"至\":[\"chinese_simplified\",\"chinese_traditional\"],\"达\":[\"chinese_simplified\"],\"走\":[\"chinese_simplified\",\"chinese_traditional\"],\"积\":[\"chinese_simplified\"],\"示\":[\"chinese_simplified\",\"chinese_traditional\"],\"议\":[\"chinese_simplified\"],\"声\":[\"chinese_simplified\"],\"报\":[\"chinese_simplified\"],\"斗\":[\"chinese_simplified\"],\"完\":[\"chinese_simplified\",\"chinese_traditional\"],\"类\":[\"chinese_simplified\"],\"八\":[\"chinese_simplified\",\"chinese_traditional\"],\"离\":[\"chinese_simplified\"],\"华\":[\"chinese_simplified\"],\"名\":[\"chinese_simplified\",\"chinese_traditional\"],\"确\":[\"chinese_simplified\"],\"才\":[\"chinese_simplified\",\"chinese_traditional\"],\"科\":[\"chinese_simplified\",\"chinese_traditional\"],\"张\":[\"chinese_simplified\"],\"信\":[\"chinese_simplified\",\"chinese_traditional\"],\"马\":[\"chinese_simplified\"],\"节\":[\"chinese_simplified\"],\"话\":[\"chinese_simplified\"],\"米\":[\"chinese_simplified\",\"chinese_traditional\"],\"整\":[\"chinese_simplified\",\"chinese_traditional\"],\"空\":[\"chinese_simplified\",\"chinese_traditional\"],\"元\":[\"chinese_simplified\",\"chinese_traditional\"],\"况\":[\"chinese_simplified\"],\"今\":[\"chinese_simplified\",\"chinese_traditional\"],\"集\":[\"chinese_simplified\",\"chinese_traditional\"],\"温\":[\"chinese_simplified\"],\"传\":[\"chinese_simplified\"],\"土\":[\"chinese_simplified\",\"chinese_traditional\"],\"许\":[\"chinese_simplified\"],\"步\":[\"chinese_simplified\",\"chinese_traditional\"],\"群\":[\"chinese_simplified\",\"chinese_traditional\"],\"广\":[\"chinese_simplified\"],\"石\":[\"chinese_simplified\",\"chinese_traditional\"],\"记\":[\"chinese_simplified\"],\"需\":[\"chinese_simplified\",\"chinese_traditional\"],\"段\":[\"chinese_simplified\",\"chinese_traditional\"],\"研\":[\"chinese_simplified\",\"chinese_traditional\"],\"界\":[\"chinese_simplified\",\"chinese_traditional\"],\"拉\":[\"chinese_simplified\",\"chinese_traditional\"],\"林\":[\"chinese_simplified\",\"chinese_traditional\"],\"律\":[\"chinese_simplified\",\"chinese_traditional\"],\"叫\":[\"chinese_simplified\",\"chinese_traditional\"],\"且\":[\"chinese_simplified\",\"chinese_traditional\"],\"究\":[\"chinese_simplified\",\"chinese_traditional\"],\"观\":[\"chinese_simplified\"],\"越\":[\"chinese_simplified\",\"chinese_traditional\"],\"织\":[\"chinese_simplified\"],\"装\":[\"chinese_simplified\"],\"影\":[\"chinese_simplified\",\"chinese_traditional\"],\"算\":[\"chinese_simplified\",\"chinese_traditional\"],\"低\":[\"chinese_simplified\",\"chinese_traditional\"],\"持\":[\"chinese_simplified\",\"chinese_traditional\"],\"音\":[\"chinese_simplified\",\"chinese_traditional\"],\"众\":[\"chinese_simplified\"],\"书\":[\"chinese_simplified\"],\"布\":[\"chinese_simplified\",\"chinese_traditional\"],\"复\":[\"chinese_simplified\",\"chinese_traditional\"],\"容\":[\"chinese_simplified\",\"chinese_traditional\"],\"儿\":[\"chinese_simplified\"],\"须\":[\"chinese_simplified\"],\"际\":[\"chinese_simplified\"],\"商\":[\"chinese_simplified\",\"chinese_traditional\"],\"非\":[\"chinese_simplified\",\"chinese_traditional\"],\"验\":[\"chinese_simplified\"],\"连\":[\"chinese_simplified\"],\"断\":[\"chinese_simplified\"],\"深\":[\"chinese_simplified\",\"chinese_traditional\"],\"难\":[\"chinese_simplified\"],\"近\":[\"chinese_simplified\",\"chinese_traditional\"],\"矿\":[\"chinese_simplified\"],\"千\":[\"chinese_simplified\",\"chinese_traditional\"],\"周\":[\"chinese_simplified\"],\"委\":[\"chinese_simplified\",\"chinese_traditional\"],\"素\":[\"chinese_simplified\",\"chinese_traditional\"],\"技\":[\"chinese_simplified\",\"chinese_traditional\"],\"备\":[\"chinese_simplified\"],\"半\":[\"chinese_simplified\",\"chinese_traditional\"],\"办\":[\"chinese_simplified\"],\"青\":[\"chinese_simplified\",\"chinese_traditional\"],\"省\":[\"chinese_simplified\",\"chinese_traditional\"],\"列\":[\"chinese_simplified\",\"chinese_traditional\"],\"习\":[\"chinese_simplified\"],\"响\":[\"chinese_simplified\"],\"约\":[\"chinese_simplified\"],\"支\":[\"chinese_simplified\",\"chinese_traditional\"],\"般\":[\"chinese_simplified\",\"chinese_traditional\"],\"史\":[\"chinese_simplified\",\"chinese_traditional\"],\"感\":[\"chinese_simplified\",\"chinese_traditional\"],\"劳\":[\"chinese_simplified\"],\"便\":[\"chinese_simplified\",\"chinese_traditional\"],\"团\":[\"chinese_simplified\"],\"往\":[\"chinese_simplified\",\"chinese_traditional\"],\"酸\":[\"chinese_simplified\",\"chinese_traditional\"],\"历\":[\"chinese_simplified\"],\"市\":[\"chinese_simplified\",\"chinese_traditional\"],\"克\":[\"chinese_simplified\",\"chinese_traditional\"],\"何\":[\"chinese_simplified\",\"chinese_traditional\"],\"除\":[\"chinese_simplified\",\"chinese_traditional\"],\"消\":[\"chinese_simplified\",\"chinese_traditional\"],\"构\":[\"chinese_simplified\"],\"府\":[\"chinese_simplified\",\"chinese_traditional\"],\"称\":[\"chinese_simplified\"],\"太\":[\"chinese_simplified\",\"chinese_traditional\"],\"准\":[\"chinese_simplified\"],\"精\":[\"chinese_simplified\",\"chinese_traditional\"],\"值\":[\"chinese_simplified\",\"chinese_traditional\"],\"号\":[\"chinese_simplified\"],\"率\":[\"chinese_simplified\",\"chinese_traditional\"],\"族\":[\"chinese_simplified\",\"chinese_traditional\"],\"维\":[\"chinese_simplified\"],\"划\":[\"chinese_simplified\"],\"选\":[\"chinese_simplified\"],\"标\":[\"chinese_simplified\"],\"写\":[\"chinese_simplified\"],\"存\":[\"chinese_simplified\",\"chinese_traditional\"],\"候\":[\"chinese_simplified\",\"chinese_traditional\"],\"毛\":[\"chinese_simplified\",\"chinese_traditional\"],\"亲\":[\"chinese_simplified\"],\"快\":[\"chinese_simplified\",\"chinese_traditional\"],\"效\":[\"chinese_simplified\",\"chinese_traditional\"],\"斯\":[\"chinese_simplified\",\"chinese_traditional\"],\"院\":[\"chinese_simplified\",\"chinese_traditional\"],\"查\":[\"chinese_simplified\",\"chinese_traditional\"],\"江\":[\"chinese_simplified\",\"chinese_traditional\"],\"型\":[\"chinese_simplified\",\"chinese_traditional\"],\"眼\":[\"chinese_simplified\",\"chinese_traditional\"],\"王\":[\"chinese_simplified\",\"chinese_traditional\"],\"按\":[\"chinese_simplified\",\"chinese_traditional\"],\"格\":[\"chinese_simplified\",\"chinese_traditional\"],\"养\":[\"chinese_simplified\"],\"易\":[\"chinese_simplified\",\"chinese_traditional\"],\"置\":[\"chinese_simplified\",\"chinese_traditional\"],\"派\":[\"chinese_simplified\",\"chinese_traditional\"],\"层\":[\"chinese_simplified\"],\"片\":[\"chinese_simplified\",\"chinese_traditional\"],\"始\":[\"chinese_simplified\",\"chinese_traditional\"],\"却\":[\"chinese_simplified\"],\"专\":[\"chinese_simplified\"],\"状\":[\"chinese_simplified\"],\"育\":[\"chinese_simplified\",\"chinese_traditional\"],\"厂\":[\"chinese_simplified\"],\"京\":[\"chinese_simplified\",\"chinese_traditional\"],\"识\":[\"chinese_simplified\"],\"适\":[\"chinese_simplified\"],\"属\":[\"chinese_simplified\"],\"圆\":[\"chinese_simplified\"],\"包\":[\"chinese_simplified\",\"chinese_traditional\"],\"火\":[\"chinese_simplified\",\"chinese_traditional\"],\"住\":[\"chinese_simplified\",\"chinese_traditional\"],\"调\":[\"chinese_simplified\"],\"满\":[\"chinese_simplified\"],\"县\":[\"chinese_simplified\"],\"局\":[\"chinese_simplified\",\"chinese_traditional\"],\"照\":[\"chinese_simplified\",\"chinese_traditional\"],\"参\":[\"chinese_simplified\"],\"红\":[\"chinese_simplified\"],\"细\":[\"chinese_simplified\"],\"引\":[\"chinese_simplified\",\"chinese_traditional\"],\"听\":[\"chinese_simplified\"],\"该\":[\"chinese_simplified\"],\"铁\":[\"chinese_simplified\"],\"价\":[\"chinese_simplified\"],\"严\":[\"chinese_simplified\"],\"首\":[\"chinese_simplified\",\"chinese_traditional\"],\"底\":[\"chinese_simplified\",\"chinese_traditional\"],\"液\":[\"chinese_simplified\",\"chinese_traditional\"],\"官\":[\"chinese_simplified\",\"chinese_traditional\"],\"德\":[\"chinese_simplified\",\"chinese_traditional\"],\"随\":[\"chinese_simplified\"],\"病\":[\"chinese_simplified\",\"chinese_traditional\"],\"苏\":[\"chinese_simplified\"],\"失\":[\"chinese_simplified\",\"chinese_traditional\"],\"尔\":[\"chinese_simplified\"],\"死\":[\"chinese_simplified\",\"chinese_traditional\"],\"讲\":[\"chinese_simplified\"],\"配\":[\"chinese_simplified\",\"chinese_traditional\"],\"女\":[\"chinese_simplified\",\"chinese_traditional\"],\"黄\":[\"chinese_simplified\"],\"推\":[\"chinese_simplified\",\"chinese_traditional\"],\"显\":[\"chinese_simplified\"],\"谈\":[\"chinese_simplified\"],\"罪\":[\"chinese_simplified\",\"chinese_traditional\"],\"神\":[\"chinese_simplified\",\"chinese_traditional\"],\"艺\":[\"chinese_simplified\"],\"呢\":[\"chinese_simplified\",\"chinese_traditional\"],\"席\":[\"chinese_simplified\",\"chinese_traditional\"],\"含\":[\"chinese_simplified\",\"chinese_traditional\"],\"企\":[\"chinese_simplified\",\"chinese_traditional\"],\"望\":[\"chinese_simplified\",\"chinese_traditional\"],\"密\":[\"chinese_simplified\",\"chinese_traditional\"],\"批\":[\"chinese_simplified\",\"chinese_traditional\"],\"营\":[\"chinese_simplified\"],\"项\":[\"chinese_simplified\"],\"防\":[\"chinese_simplified\",\"chinese_traditional\"],\"举\":[\"chinese_simplified\"],\"球\":[\"chinese_simplified\",\"chinese_traditional\"],\"英\":[\"chinese_simplified\",\"chinese_traditional\"],\"氧\":[\"chinese_simplified\",\"chinese_traditional\"],\"势\":[\"chinese_simplified\"],\"告\":[\"chinese_simplified\",\"chinese_traditional\"],\"李\":[\"chinese_simplified\",\"chinese_traditional\"],\"台\":[\"chinese_simplified\",\"chinese_traditional\"],\"落\":[\"chinese_simplified\",\"chinese_traditional\"],\"木\":[\"chinese_simplified\",\"chinese_traditional\"],\"帮\":[\"chinese_simplified\"],\"轮\":[\"chinese_simplified\"],\"破\":[\"chinese_simplified\",\"chinese_traditional\"],\"亚\":[\"chinese_simplified\"],\"师\":[\"chinese_simplified\"],\"围\":[\"chinese_simplified\"],\"注\":[\"chinese_simplified\",\"chinese_traditional\"],\"远\":[\"chinese_simplified\"],\"字\":[\"chinese_simplified\",\"chinese_traditional\"],\"材\":[\"chinese_simplified\",\"chinese_traditional\"],\"排\":[\"chinese_simplified\",\"chinese_traditional\"],\"供\":[\"chinese_simplified\",\"chinese_traditional\"],\"河\":[\"chinese_simplified\",\"chinese_traditional\"],\"态\":[\"chinese_simplified\"],\"封\":[\"chinese_simplified\",\"chinese_traditional\"],\"另\":[\"chinese_simplified\",\"chinese_traditional\"],\"施\":[\"chinese_simplified\",\"chinese_traditional\"],\"减\":[\"chinese_simplified\"],\"树\":[\"chinese_simplified\"],\"溶\":[\"chinese_simplified\",\"chinese_traditional\"],\"怎\":[\"chinese_simplified\",\"chinese_traditional\"],\"止\":[\"chinese_simplified\",\"chinese_traditional\"],\"案\":[\"chinese_simplified\",\"chinese_traditional\"],\"言\":[\"chinese_simplified\",\"chinese_traditional\"],\"士\":[\"chinese_simplified\",\"chinese_traditional\"],\"均\":[\"chinese_simplified\",\"chinese_traditional\"],\"武\":[\"chinese_simplified\",\"chinese_traditional\"],\"固\":[\"chinese_simplified\",\"chinese_traditional\"],\"叶\":[\"chinese_simplified\"],\"鱼\":[\"chinese_simplified\"],\"波\":[\"chinese_simplified\",\"chinese_traditional\"],\"视\":[\"chinese_simplified\"],\"仅\":[\"chinese_simplified\"],\"费\":[\"chinese_simplified\"],\"紧\":[\"chinese_simplified\"],\"爱\":[\"chinese_simplified\"],\"左\":[\"chinese_simplified\",\"chinese_traditional\"],\"章\":[\"chinese_simplified\",\"chinese_traditional\"],\"早\":[\"chinese_simplified\",\"chinese_traditional\"],\"朝\":[\"chinese_simplified\",\"chinese_traditional\"],\"害\":[\"chinese_simplified\",\"chinese_traditional\"],\"续\":[\"chinese_simplified\"],\"轻\":[\"chinese_simplified\"],\"服\":[\"chinese_simplified\",\"chinese_traditional\"],\"试\":[\"chinese_simplified\"],\"食\":[\"chinese_simplified\",\"chinese_traditional\"],\"充\":[\"chinese_simplified\",\"chinese_traditional\"],\"兵\":[\"chinese_simplified\",\"chinese_traditional\"],\"源\":[\"chinese_simplified\",\"chinese_traditional\"],\"判\":[\"chinese_simplified\",\"chinese_traditional\"],\"护\":[\"chinese_simplified\"],\"司\":[\"chinese_simplified\",\"chinese_traditional\"],\"足\":[\"chinese_simplified\",\"chinese_traditional\"],\"某\":[\"chinese_simplified\",\"chinese_traditional\"],\"练\":[\"chinese_simplified\"],\"差\":[\"chinese_simplified\",\"chinese_traditional\"],\"致\":[\"chinese_simplified\",\"chinese_traditional\"],\"板\":[\"chinese_simplified\",\"chinese_traditional\"],\"田\":[\"chinese_simplified\",\"chinese_traditional\"],\"降\":[\"chinese_simplified\",\"chinese_traditional\"],\"黑\":[\"chinese_simplified\",\"chinese_traditional\"],\"犯\":[\"chinese_simplified\",\"chinese_traditional\"],\"负\":[\"chinese_simplified\"],\"击\":[\"chinese_simplified\"],\"范\":[\"chinese_simplified\",\"chinese_traditional\"],\"继\":[\"chinese_simplified\"],\"兴\":[\"chinese_simplified\"],\"似\":[\"chinese_simplified\",\"chinese_traditional\"],\"余\":[\"chinese_simplified\"],\"坚\":[\"chinese_simplified\"],\"曲\":[\"chinese_simplified\",\"chinese_traditional\"],\"输\":[\"chinese_simplified\"],\"修\":[\"chinese_simplified\",\"chinese_traditional\"],\"故\":[\"chinese_simplified\",\"chinese_traditional\"],\"城\":[\"chinese_simplified\",\"chinese_traditional\"],\"夫\":[\"chinese_simplified\",\"chinese_traditional\"],\"够\":[\"chinese_simplified\"],\"送\":[\"chinese_simplified\",\"chinese_traditional\"],\"笔\":[\"chinese_simplified\"],\"船\":[\"chinese_simplified\",\"chinese_traditional\"],\"占\":[\"chinese_simplified\"],\"右\":[\"chinese_simplified\",\"chinese_traditional\"],\"财\":[\"chinese_simplified\"],\"吃\":[\"chinese_simplified\",\"chinese_traditional\"],\"富\":[\"chinese_simplified\",\"chinese_traditional\"],\"春\":[\"chinese_simplified\",\"chinese_traditional\"],\"职\":[\"chinese_simplified\"],\"觉\":[\"chinese_simplified\"],\"汉\":[\"chinese_simplified\"],\"画\":[\"chinese_simplified\"],\"功\":[\"chinese_simplified\",\"chinese_traditional\"],\"巴\":[\"chinese_simplified\",\"chinese_traditional\"],\"跟\":[\"chinese_simplified\",\"chinese_traditional\"],\"虽\":[\"chinese_simplified\"],\"杂\":[\"chinese_simplified\"],\"飞\":[\"chinese_simplified\"],\"检\":[\"chinese_simplified\"],\"吸\":[\"chinese_simplified\",\"chinese_traditional\"],\"助\":[\"chinese_simplified\",\"chinese_traditional\"],\"升\":[\"chinese_simplified\"],\"阳\":[\"chinese_simplified\"],\"互\":[\"chinese_simplified\",\"chinese_traditional\"],\"初\":[\"chinese_simplified\",\"chinese_traditional\"],\"创\":[\"chinese_simplified\"],\"抗\":[\"chinese_simplified\",\"chinese_traditional\"],\"考\":[\"chinese_simplified\",\"chinese_traditional\"],\"投\":[\"chinese_simplified\",\"chinese_traditional\"],\"坏\":[\"chinese_simplified\"],\"策\":[\"chinese_simplified\",\"chinese_traditional\"],\"古\":[\"chinese_simplified\",\"chinese_traditional\"],\"径\":[\"chinese_simplified\"],\"换\":[\"chinese_simplified\"],\"未\":[\"chinese_simplified\",\"chinese_traditional\"],\"跑\":[\"chinese_simplified\",\"chinese_traditional\"],\"留\":[\"chinese_simplified\",\"chinese_traditional\"],\"钢\":[\"chinese_simplified\"],\"曾\":[\"chinese_simplified\",\"chinese_traditional\"],\"端\":[\"chinese_simplified\",\"chinese_traditional\"],\"责\":[\"chinese_simplified\"],\"站\":[\"chinese_simplified\",\"chinese_traditional\"],\"简\":[\"chinese_simplified\"],\"述\":[\"chinese_simplified\",\"chinese_traditional\"],\"钱\":[\"chinese_simplified\"],\"副\":[\"chinese_simplified\",\"chinese_traditional\"],\"尽\":[\"chinese_simplified\"],\"帝\":[\"chinese_simplified\",\"chinese_traditional\"],\"射\":[\"chinese_simplified\",\"chinese_traditional\"],\"草\":[\"chinese_simplified\",\"chinese_traditional\"],\"冲\":[\"chinese_simplified\"],\"承\":[\"chinese_simplified\",\"chinese_traditional\"],\"独\":[\"chinese_simplified\"],\"令\":[\"chinese_simplified\",\"chinese_traditional\"],\"限\":[\"chinese_simplified\",\"chinese_traditional\"],\"阿\":[\"chinese_simplified\",\"chinese_traditional\"],\"宣\":[\"chinese_simplified\",\"chinese_traditional\"],\"环\":[\"chinese_simplified\"],\"双\":[\"chinese_simplified\"],\"请\":[\"chinese_simplified\"],\"超\":[\"chinese_simplified\",\"chinese_traditional\"],\"微\":[\"chinese_simplified\",\"chinese_traditional\"],\"让\":[\"chinese_simplified\"],\"控\":[\"chinese_simplified\",\"chinese_traditional\"],\"州\":[\"chinese_simplified\",\"chinese_traditional\"],\"良\":[\"chinese_simplified\",\"chinese_traditional\"],\"轴\":[\"chinese_simplified\"],\"找\":[\"chinese_simplified\",\"chinese_traditional\"],\"否\":[\"chinese_simplified\",\"chinese_traditional\"],\"纪\":[\"chinese_simplified\"],\"益\":[\"chinese_simplified\",\"chinese_traditional\"],\"依\":[\"chinese_simplified\",\"chinese_traditional\"],\"优\":[\"chinese_simplified\"],\"顶\":[\"chinese_simplified\"],\"础\":[\"chinese_simplified\"],\"载\":[\"chinese_simplified\"],\"倒\":[\"chinese_simplified\",\"chinese_traditional\"],\"房\":[\"chinese_simplified\",\"chinese_traditional\"],\"突\":[\"chinese_simplified\",\"chinese_traditional\"],\"坐\":[\"chinese_simplified\",\"chinese_traditional\"],\"粉\":[\"chinese_simplified\",\"chinese_traditional\"],\"敌\":[\"chinese_simplified\"],\"略\":[\"chinese_simplified\",\"chinese_traditional\"],\"客\":[\"chinese_simplified\",\"chinese_traditional\"],\"袁\":[\"chinese_simplified\",\"chinese_traditional\"],\"冷\":[\"chinese_simplified\",\"chinese_traditional\"],\"胜\":[\"chinese_simplified\"],\"绝\":[\"chinese_simplified\"],\"析\":[\"chinese_simplified\",\"chinese_traditional\"],\"块\":[\"chinese_simplified\"],\"剂\":[\"chinese_simplified\"],\"测\":[\"chinese_simplified\"],\"丝\":[\"chinese_simplified\"],\"协\":[\"chinese_simplified\"],\"诉\":[\"chinese_simplified\"],\"念\":[\"chinese_simplified\",\"chinese_traditional\"],\"陈\":[\"chinese_simplified\"],\"仍\":[\"chinese_simplified\",\"chinese_traditional\"],\"罗\":[\"chinese_simplified\"],\"盐\":[\"chinese_simplified\"],\"友\":[\"chinese_simplified\",\"chinese_traditional\"],\"洋\":[\"chinese_simplified\",\"chinese_traditional\"],\"错\":[\"chinese_simplified\"],\"苦\":[\"chinese_simplified\",\"chinese_traditional\"],\"夜\":[\"chinese_simplified\",\"chinese_traditional\"],\"刑\":[\"chinese_simplified\",\"chinese_traditional\"],\"移\":[\"chinese_simplified\",\"chinese_traditional\"],\"频\":[\"chinese_simplified\"],\"逐\":[\"chinese_simplified\",\"chinese_traditional\"],\"靠\":[\"chinese_simplified\",\"chinese_traditional\"],\"混\":[\"chinese_simplified\",\"chinese_traditional\"],\"母\":[\"chinese_simplified\",\"chinese_traditional\"],\"短\":[\"chinese_simplified\",\"chinese_traditional\"],\"皮\":[\"chinese_simplified\",\"chinese_traditional\"],\"终\":[\"chinese_simplified\"],\"聚\":[\"chinese_simplified\",\"chinese_traditional\"],\"汽\":[\"chinese_simplified\",\"chinese_traditional\"],\"村\":[\"chinese_simplified\",\"chinese_traditional\"],\"云\":[\"chinese_simplified\"],\"哪\":[\"chinese_simplified\",\"chinese_traditional\"],\"既\":[\"chinese_simplified\",\"chinese_traditional\"],\"距\":[\"chinese_simplified\",\"chinese_traditional\"],\"卫\":[\"chinese_simplified\"],\"停\":[\"chinese_simplified\",\"chinese_traditional\"],\"烈\":[\"chinese_simplified\",\"chinese_traditional\"],\"央\":[\"chinese_simplified\",\"chinese_traditional\"],\"察\":[\"chinese_simplified\",\"chinese_traditional\"],\"烧\":[\"chinese_simplified\"],\"迅\":[\"chinese_simplified\",\"chinese_traditional\"],\"境\":[\"chinese_simplified\",\"chinese_traditional\"],\"若\":[\"chinese_simplified\",\"chinese_traditional\"],\"印\":[\"chinese_simplified\",\"chinese_traditional\"],\"洲\":[\"chinese_simplified\",\"chinese_traditional\"],\"刻\":[\"chinese_simplified\",\"chinese_traditional\"],\"括\":[\"chinese_simplified\",\"chinese_traditional\"],\"激\":[\"chinese_simplified\",\"chinese_traditional\"],\"孔\":[\"chinese_simplified\",\"chinese_traditional\"],\"搞\":[\"chinese_simplified\",\"chinese_traditional\"],\"甚\":[\"chinese_simplified\",\"chinese_traditional\"],\"室\":[\"chinese_simplified\",\"chinese_traditional\"],\"待\":[\"chinese_simplified\",\"chinese_traditional\"],\"核\":[\"chinese_simplified\",\"chinese_traditional\"],\"校\":[\"chinese_simplified\",\"chinese_traditional\"],\"散\":[\"chinese_simplified\",\"chinese_traditional\"],\"侵\":[\"chinese_simplified\",\"chinese_traditional\"],\"吧\":[\"chinese_simplified\",\"chinese_traditional\"],\"甲\":[\"chinese_simplified\",\"chinese_traditional\"],\"游\":[\"chinese_simplified\"],\"久\":[\"chinese_simplified\",\"chinese_traditional\"],\"菜\":[\"chinese_simplified\",\"chinese_traditional\"],\"味\":[\"chinese_simplified\",\"chinese_traditional\"],\"旧\":[\"chinese_simplified\"],\"模\":[\"chinese_simplified\",\"chinese_traditional\"],\"湖\":[\"chinese_simplified\",\"chinese_traditional\"],\"货\":[\"chinese_simplified\"],\"损\":[\"chinese_simplified\"],\"预\":[\"chinese_simplified\"],\"阻\":[\"chinese_simplified\",\"chinese_traditional\"],\"毫\":[\"chinese_simplified\",\"chinese_traditional\"],\"普\":[\"chinese_simplified\",\"chinese_traditional\"],\"稳\":[\"chinese_simplified\"],\"乙\":[\"chinese_simplified\",\"chinese_traditional\"],\"妈\":[\"chinese_simplified\"],\"植\":[\"chinese_simplified\",\"chinese_traditional\"],\"息\":[\"chinese_simplified\",\"chinese_traditional\"],\"扩\":[\"chinese_simplified\"],\"银\":[\"chinese_simplified\"],\"语\":[\"chinese_simplified\"],\"挥\":[\"chinese_simplified\"],\"酒\":[\"chinese_simplified\",\"chinese_traditional\"],\"守\":[\"chinese_simplified\",\"chinese_traditional\"],\"拿\":[\"chinese_simplified\",\"chinese_traditional\"],\"序\":[\"chinese_simplified\",\"chinese_traditional\"],\"纸\":[\"chinese_simplified\"],\"医\":[\"chinese_simplified\"],\"缺\":[\"chinese_simplified\",\"chinese_traditional\"],\"雨\":[\"chinese_simplified\",\"chinese_traditional\"],\"吗\":[\"chinese_simplified\"],\"针\":[\"chinese_simplified\"],\"刘\":[\"chinese_simplified\"],\"啊\":[\"chinese_simplified\",\"chinese_traditional\"],\"急\":[\"chinese_simplified\",\"chinese_traditional\"],\"唱\":[\"chinese_simplified\",\"chinese_traditional\"],\"误\":[\"chinese_simplified\"],\"训\":[\"chinese_simplified\"],\"愿\":[\"chinese_simplified\"],\"审\":[\"chinese_simplified\"],\"附\":[\"chinese_simplified\",\"chinese_traditional\"],\"获\":[\"chinese_simplified\"],\"茶\":[\"chinese_simplified\",\"chinese_traditional\"],\"鲜\":[\"chinese_simplified\"],\"粮\":[\"chinese_simplified\"],\"斤\":[\"chinese_simplified\",\"chinese_traditional\"],\"孩\":[\"chinese_simplified\",\"chinese_traditional\"],\"脱\":[\"chinese_simplified\"],\"硫\":[\"chinese_simplified\",\"chinese_traditional\"],\"肥\":[\"chinese_simplified\",\"chinese_traditional\"],\"善\":[\"chinese_simplified\",\"chinese_traditional\"],\"龙\":[\"chinese_simplified\"],\"演\":[\"chinese_simplified\",\"chinese_traditional\"],\"父\":[\"chinese_simplified\",\"chinese_traditional\"],\"渐\":[\"chinese_simplified\"],\"血\":[\"chinese_simplified\",\"chinese_traditional\"],\"欢\":[\"chinese_simplified\"],\"械\":[\"chinese_simplified\",\"chinese_traditional\"],\"掌\":[\"chinese_simplified\",\"chinese_traditional\"],\"歌\":[\"chinese_simplified\",\"chinese_traditional\"],\"沙\":[\"chinese_simplified\",\"chinese_traditional\"],\"刚\":[\"chinese_simplified\"],\"攻\":[\"chinese_simplified\",\"chinese_traditional\"],\"谓\":[\"chinese_simplified\"],\"盾\":[\"chinese_simplified\",\"chinese_traditional\"],\"讨\":[\"chinese_simplified\"],\"晚\":[\"chinese_simplified\",\"chinese_traditional\"],\"粒\":[\"chinese_simplified\",\"chinese_traditional\"],\"乱\":[\"chinese_simplified\"],\"燃\":[\"chinese_simplified\",\"chinese_traditional\"],\"矛\":[\"chinese_simplified\",\"chinese_traditional\"],\"乎\":[\"chinese_simplified\",\"chinese_traditional\"],\"杀\":[\"chinese_simplified\"],\"药\":[\"chinese_simplified\"],\"宁\":[\"chinese_simplified\"],\"鲁\":[\"chinese_simplified\"],\"贵\":[\"chinese_simplified\"],\"钟\":[\"chinese_simplified\"],\"煤\":[\"chinese_simplified\",\"chinese_traditional\"],\"读\":[\"chinese_simplified\"],\"班\":[\"chinese_simplified\",\"chinese_traditional\"],\"伯\":[\"chinese_simplified\",\"chinese_traditional\"],\"香\":[\"chinese_simplified\",\"chinese_traditional\"],\"介\":[\"chinese_simplified\",\"chinese_traditional\"],\"迫\":[\"chinese_simplified\",\"chinese_traditional\"],\"句\":[\"chinese_simplified\",\"chinese_traditional\"],\"丰\":[\"chinese_simplified\"],\"培\":[\"chinese_simplified\",\"chinese_traditional\"],\"握\":[\"chinese_simplified\",\"chinese_traditional\"],\"兰\":[\"chinese_simplified\"],\"担\":[\"chinese_simplified\"],\"弦\":[\"chinese_simplified\",\"chinese_traditional\"],\"蛋\":[\"chinese_simplified\",\"chinese_traditional\"],\"沉\":[\"chinese_simplified\",\"chinese_traditional\"],\"假\":[\"chinese_simplified\",\"chinese_traditional\"],\"穿\":[\"chinese_simplified\",\"chinese_traditional\"],\"执\":[\"chinese_simplified\"],\"答\":[\"chinese_simplified\",\"chinese_traditional\"],\"乐\":[\"chinese_simplified\"],\"谁\":[\"chinese_simplified\"],\"顺\":[\"chinese_simplified\"],\"烟\":[\"chinese_simplified\"],\"缩\":[\"chinese_simplified\"],\"征\":[\"chinese_simplified\"],\"脸\":[\"chinese_simplified\"],\"喜\":[\"chinese_simplified\",\"chinese_traditional\"],\"松\":[\"chinese_simplified\",\"chinese_traditional\"],\"脚\":[\"chinese_simplified\"],\"困\":[\"chinese_simplified\",\"chinese_traditional\"],\"异\":[\"chinese_simplified\"],\"免\":[\"chinese_simplified\",\"chinese_traditional\"],\"背\":[\"chinese_simplified\",\"chinese_traditional\"],\"星\":[\"chinese_simplified\",\"chinese_traditional\"],\"福\":[\"chinese_simplified\",\"chinese_traditional\"],\"买\":[\"chinese_simplified\"],\"染\":[\"chinese_simplified\",\"chinese_traditional\"],\"井\":[\"chinese_simplified\",\"chinese_traditional\"],\"概\":[\"chinese_simplified\",\"chinese_traditional\"],\"慢\":[\"chinese_simplified\",\"chinese_traditional\"],\"怕\":[\"chinese_simplified\",\"chinese_traditional\"],\"磁\":[\"chinese_simplified\",\"chinese_traditional\"],\"倍\":[\"chinese_simplified\",\"chinese_traditional\"],\"祖\":[\"chinese_simplified\",\"chinese_traditional\"],\"皇\":[\"chinese_simplified\",\"chinese_traditional\"],\"促\":[\"chinese_simplified\",\"chinese_traditional\"],\"静\":[\"chinese_simplified\"],\"补\":[\"chinese_simplified\"],\"评\":[\"chinese_simplified\"],\"翻\":[\"chinese_simplified\",\"chinese_traditional\"],\"肉\":[\"chinese_simplified\",\"chinese_traditional\"],\"践\":[\"chinese_simplified\"],\"尼\":[\"chinese_simplified\",\"chinese_traditional\"],\"衣\":[\"chinese_simplified\",\"chinese_traditional\"],\"宽\":[\"chinese_simplified\"],\"扬\":[\"chinese_simplified\"],\"棉\":[\"chinese_simplified\",\"chinese_traditional\"],\"希\":[\"chinese_simplified\",\"chinese_traditional\"],\"伤\":[\"chinese_simplified\"],\"操\":[\"chinese_simplified\",\"chinese_traditional\"],\"垂\":[\"chinese_simplified\",\"chinese_traditional\"],\"秋\":[\"chinese_simplified\",\"chinese_traditional\"],\"宜\":[\"chinese_simplified\",\"chinese_traditional\"],\"氢\":[\"chinese_simplified\"],\"套\":[\"chinese_simplified\",\"chinese_traditional\"],\"督\":[\"chinese_simplified\",\"chinese_traditional\"],\"振\":[\"chinese_simplified\",\"chinese_traditional\"],\"架\":[\"chinese_simplified\",\"chinese_traditional\"],\"亮\":[\"chinese_simplified\",\"chinese_traditional\"],\"末\":[\"chinese_simplified\",\"chinese_traditional\"],\"宪\":[\"chinese_simplified\"],\"庆\":[\"chinese_simplified\"],\"编\":[\"chinese_simplified\"],\"牛\":[\"chinese_simplified\",\"chinese_traditional\"],\"触\":[\"chinese_simplified\"],\"映\":[\"chinese_simplified\",\"chinese_traditional\"],\"雷\":[\"chinese_simplified\",\"chinese_traditional\"],\"销\":[\"chinese_simplified\"],\"诗\":[\"chinese_simplified\"],\"座\":[\"chinese_simplified\",\"chinese_traditional\"],\"居\":[\"chinese_simplified\",\"chinese_traditional\"],\"抓\":[\"chinese_simplified\",\"chinese_traditional\"],\"裂\":[\"chinese_simplified\",\"chinese_traditional\"],\"胞\":[\"chinese_simplified\",\"chinese_traditional\"],\"呼\":[\"chinese_simplified\",\"chinese_traditional\"],\"娘\":[\"chinese_simplified\",\"chinese_traditional\"],\"景\":[\"chinese_simplified\",\"chinese_traditional\"],\"威\":[\"chinese_simplified\",\"chinese_traditional\"],\"绿\":[\"chinese_simplified\"],\"晶\":[\"chinese_simplified\",\"chinese_traditional\"],\"厚\":[\"chinese_simplified\",\"chinese_traditional\"],\"盟\":[\"chinese_simplified\",\"chinese_traditional\"],\"衡\":[\"chinese_simplified\",\"chinese_traditional\"],\"鸡\":[\"chinese_simplified\"],\"孙\":[\"chinese_simplified\"],\"延\":[\"chinese_simplified\",\"chinese_traditional\"],\"危\":[\"chinese_simplified\",\"chinese_traditional\"],\"胶\":[\"chinese_simplified\"],\"屋\":[\"chinese_simplified\",\"chinese_traditional\"],\"乡\":[\"chinese_simplified\"],\"临\":[\"chinese_simplified\"],\"陆\":[\"chinese_simplified\"],\"顾\":[\"chinese_simplified\"],\"掉\":[\"chinese_simplified\",\"chinese_traditional\"],\"呀\":[\"chinese_simplified\",\"chinese_traditional\"],\"灯\":[\"chinese_simplified\"],\"岁\":[\"chinese_simplified\"],\"措\":[\"chinese_simplified\",\"chinese_traditional\"],\"束\":[\"chinese_simplified\",\"chinese_traditional\"],\"耐\":[\"chinese_simplified\",\"chinese_traditional\"],\"剧\":[\"chinese_simplified\"],\"玉\":[\"chinese_simplified\",\"chinese_traditional\"],\"赵\":[\"chinese_simplified\"],\"跳\":[\"chinese_simplified\",\"chinese_traditional\"],\"哥\":[\"chinese_simplified\",\"chinese_traditional\"],\"季\":[\"chinese_simplified\",\"chinese_traditional\"],\"课\":[\"chinese_simplified\"],\"凯\":[\"chinese_simplified\"],\"胡\":[\"chinese_simplified\",\"chinese_traditional\"],\"额\":[\"chinese_simplified\"],\"款\":[\"chinese_simplified\",\"chinese_traditional\"],\"绍\":[\"chinese_simplified\"],\"卷\":[\"chinese_simplified\",\"chinese_traditional\"],\"齐\":[\"chinese_simplified\"],\"伟\":[\"chinese_simplified\"],\"蒸\":[\"chinese_simplified\",\"chinese_traditional\"],\"殖\":[\"chinese_simplified\",\"chinese_traditional\"],\"永\":[\"chinese_simplified\",\"chinese_traditional\"],\"宗\":[\"chinese_simplified\",\"chinese_traditional\"],\"苗\":[\"chinese_simplified\",\"chinese_traditional\"],\"川\":[\"chinese_simplified\",\"chinese_traditional\"],\"炉\":[\"chinese_simplified\"],\"岩\":[\"chinese_simplified\",\"chinese_traditional\"],\"弱\":[\"chinese_simplified\",\"chinese_traditional\"],\"零\":[\"chinese_simplified\",\"chinese_traditional\"],\"杨\":[\"chinese_simplified\"],\"奏\":[\"chinese_simplified\",\"chinese_traditional\"],\"沿\":[\"chinese_simplified\",\"chinese_traditional\"],\"露\":[\"chinese_simplified\",\"chinese_traditional\"],\"杆\":[\"chinese_simplified\"],\"探\":[\"chinese_simplified\",\"chinese_traditional\"],\"滑\":[\"chinese_simplified\",\"chinese_traditional\"],\"镇\":[\"chinese_simplified\"],\"饭\":[\"chinese_simplified\"],\"浓\":[\"chinese_simplified\"],\"航\":[\"chinese_simplified\",\"chinese_traditional\"],\"怀\":[\"chinese_simplified\"],\"赶\":[\"chinese_simplified\"],\"库\":[\"chinese_simplified\"],\"夺\":[\"chinese_simplified\"],\"伊\":[\"chinese_simplified\",\"chinese_traditional\"],\"灵\":[\"chinese_simplified\"],\"税\":[\"chinese_simplified\"],\"途\":[\"chinese_simplified\",\"chinese_traditional\"],\"灭\":[\"chinese_simplified\"],\"赛\":[\"chinese_simplified\"],\"归\":[\"chinese_simplified\"],\"召\":[\"chinese_simplified\",\"chinese_traditional\"],\"鼓\":[\"chinese_simplified\",\"chinese_traditional\"],\"播\":[\"chinese_simplified\",\"chinese_traditional\"],\"盘\":[\"chinese_simplified\"],\"裁\":[\"chinese_simplified\",\"chinese_traditional\"],\"险\":[\"chinese_simplified\"],\"康\":[\"chinese_simplified\",\"chinese_traditional\"],\"唯\":[\"chinese_simplified\",\"chinese_traditional\"],\"录\":[\"chinese_simplified\"],\"菌\":[\"chinese_simplified\",\"chinese_traditional\"],\"纯\":[\"chinese_simplified\"],\"借\":[\"chinese_simplified\",\"chinese_traditional\"],\"糖\":[\"chinese_simplified\",\"chinese_traditional\"],\"盖\":[\"chinese_simplified\"],\"横\":[\"chinese_simplified\"],\"符\":[\"chinese_simplified\",\"chinese_traditional\"],\"私\":[\"chinese_simplified\",\"chinese_traditional\"],\"努\":[\"chinese_simplified\",\"chinese_traditional\"],\"堂\":[\"chinese_simplified\",\"chinese_traditional\"],\"域\":[\"chinese_simplified\",\"chinese_traditional\"],\"枪\":[\"chinese_simplified\"],\"润\":[\"chinese_simplified\"],\"幅\":[\"chinese_simplified\",\"chinese_traditional\"],\"哈\":[\"chinese_simplified\",\"chinese_traditional\"],\"竟\":[\"chinese_simplified\",\"chinese_traditional\"],\"熟\":[\"chinese_simplified\",\"chinese_traditional\"],\"虫\":[\"chinese_simplified\"],\"泽\":[\"chinese_simplified\"],\"脑\":[\"chinese_simplified\"],\"壤\":[\"chinese_simplified\",\"chinese_traditional\"],\"碳\":[\"chinese_simplified\",\"chinese_traditional\"],\"欧\":[\"chinese_simplified\"],\"遍\":[\"chinese_simplified\",\"chinese_traditional\"],\"侧\":[\"chinese_simplified\"],\"寨\":[\"chinese_simplified\",\"chinese_traditional\"],\"敢\":[\"chinese_simplified\",\"chinese_traditional\"],\"彻\":[\"chinese_simplified\"],\"虑\":[\"chinese_simplified\"],\"斜\":[\"chinese_simplified\",\"chinese_traditional\"],\"薄\":[\"chinese_simplified\",\"chinese_traditional\"],\"庭\":[\"chinese_simplified\",\"chinese_traditional\"],\"纳\":[\"chinese_simplified\"],\"弹\":[\"chinese_simplified\"],\"饲\":[\"chinese_simplified\"],\"伸\":[\"chinese_simplified\",\"chinese_traditional\"],\"折\":[\"chinese_simplified\",\"chinese_traditional\"],\"麦\":[\"chinese_simplified\"],\"湿\":[\"chinese_simplified\"],\"暗\":[\"chinese_simplified\",\"chinese_traditional\"],\"荷\":[\"chinese_simplified\",\"chinese_traditional\"],\"瓦\":[\"chinese_simplified\",\"chinese_traditional\"],\"塞\":[\"chinese_simplified\",\"chinese_traditional\"],\"床\":[\"chinese_simplified\",\"chinese_traditional\"],\"筑\":[\"chinese_simplified\"],\"恶\":[\"chinese_simplified\"],\"户\":[\"chinese_simplified\"],\"访\":[\"chinese_simplified\"],\"塔\":[\"chinese_simplified\",\"chinese_traditional\"],\"奇\":[\"chinese_simplified\",\"chinese_traditional\"],\"透\":[\"chinese_simplified\",\"chinese_traditional\"],\"梁\":[\"chinese_simplified\",\"chinese_traditional\"],\"刀\":[\"chinese_simplified\",\"chinese_traditional\"],\"旋\":[\"chinese_simplified\",\"chinese_traditional\"],\"迹\":[\"chinese_simplified\"],\"卡\":[\"chinese_simplified\",\"chinese_traditional\"],\"氯\":[\"chinese_simplified\",\"chinese_traditional\"],\"遇\":[\"chinese_simplified\",\"chinese_traditional\"],\"份\":[\"chinese_simplified\",\"chinese_traditional\"],\"毒\":[\"chinese_simplified\",\"chinese_traditional\"],\"泥\":[\"chinese_simplified\",\"chinese_traditional\"],\"退\":[\"chinese_simplified\",\"chinese_traditional\"],\"洗\":[\"chinese_simplified\",\"chinese_traditional\"],\"摆\":[\"chinese_simplified\"],\"灰\":[\"chinese_simplified\",\"chinese_traditional\"],\"彩\":[\"chinese_simplified\",\"chinese_traditional\"],\"卖\":[\"chinese_simplified\"],\"耗\":[\"chinese_simplified\",\"chinese_traditional\"],\"夏\":[\"chinese_simplified\",\"chinese_traditional\"],\"择\":[\"chinese_simplified\"],\"忙\":[\"chinese_simplified\",\"chinese_traditional\"],\"铜\":[\"chinese_simplified\"],\"献\":[\"chinese_simplified\"],\"硬\":[\"chinese_simplified\",\"chinese_traditional\"],\"予\":[\"chinese_simplified\",\"chinese_traditional\"],\"繁\":[\"chinese_simplified\",\"chinese_traditional\"],\"圈\":[\"chinese_simplified\",\"chinese_traditional\"],\"雪\":[\"chinese_simplified\",\"chinese_traditional\"],\"函\":[\"chinese_simplified\",\"chinese_traditional\"],\"亦\":[\"chinese_simplified\",\"chinese_traditional\"],\"抽\":[\"chinese_simplified\",\"chinese_traditional\"],\"篇\":[\"chinese_simplified\",\"chinese_traditional\"],\"阵\":[\"chinese_simplified\"],\"阴\":[\"chinese_simplified\"],\"丁\":[\"chinese_simplified\",\"chinese_traditional\"],\"尺\":[\"chinese_simplified\",\"chinese_traditional\"],\"追\":[\"chinese_simplified\",\"chinese_traditional\"],\"堆\":[\"chinese_simplified\",\"chinese_traditional\"],\"雄\":[\"chinese_simplified\",\"chinese_traditional\"],\"迎\":[\"chinese_simplified\",\"chinese_traditional\"],\"泛\":[\"chinese_simplified\",\"chinese_traditional\"],\"爸\":[\"chinese_simplified\",\"chinese_traditional\"],\"楼\":[\"chinese_simplified\"],\"避\":[\"chinese_simplified\",\"chinese_traditional\"],\"谋\":[\"chinese_simplified\"],\"吨\":[\"chinese_simplified\"],\"野\":[\"chinese_simplified\",\"chinese_traditional\"],\"猪\":[\"chinese_simplified\"],\"旗\":[\"chinese_simplified\",\"chinese_traditional\"],\"累\":[\"chinese_simplified\",\"chinese_traditional\"],\"偏\":[\"chinese_simplified\",\"chinese_traditional\"],\"典\":[\"chinese_simplified\",\"chinese_traditional\"],\"馆\":[\"chinese_simplified\"],\"索\":[\"chinese_simplified\",\"chinese_traditional\"],\"秦\":[\"chinese_simplified\",\"chinese_traditional\"],\"脂\":[\"chinese_simplified\",\"chinese_traditional\"],\"潮\":[\"chinese_simplified\",\"chinese_traditional\"],\"爷\":[\"chinese_simplified\"],\"豆\":[\"chinese_simplified\",\"chinese_traditional\"],\"忽\":[\"chinese_simplified\",\"chinese_traditional\"],\"托\":[\"chinese_simplified\",\"chinese_traditional\"],\"惊\":[\"chinese_simplified\"],\"塑\":[\"chinese_simplified\",\"chinese_traditional\"],\"遗\":[\"chinese_simplified\"],\"愈\":[\"chinese_simplified\",\"chinese_traditional\"],\"朱\":[\"chinese_simplified\",\"chinese_traditional\"],\"替\":[\"chinese_simplified\",\"chinese_traditional\"],\"纤\":[\"chinese_simplified\"],\"粗\":[\"chinese_simplified\",\"chinese_traditional\"],\"倾\":[\"chinese_simplified\"],\"尚\":[\"chinese_simplified\",\"chinese_traditional\"],\"痛\":[\"chinese_simplified\",\"chinese_traditional\"],\"楚\":[\"chinese_simplified\",\"chinese_traditional\"],\"谢\":[\"chinese_simplified\"],\"奋\":[\"chinese_simplified\"],\"购\":[\"chinese_simplified\"],\"磨\":[\"chinese_simplified\",\"chinese_traditional\"],\"君\":[\"chinese_simplified\",\"chinese_traditional\"],\"池\":[\"chinese_simplified\",\"chinese_traditional\"],\"旁\":[\"chinese_simplified\",\"chinese_traditional\"],\"碎\":[\"chinese_simplified\",\"chinese_traditional\"],\"骨\":[\"chinese_simplified\",\"chinese_traditional\"],\"监\":[\"chinese_simplified\"],\"捕\":[\"chinese_simplified\",\"chinese_traditional\"],\"弟\":[\"chinese_simplified\",\"chinese_traditional\"],\"暴\":[\"chinese_simplified\",\"chinese_traditional\"],\"割\":[\"chinese_simplified\",\"chinese_traditional\"],\"贯\":[\"chinese_simplified\"],\"殊\":[\"chinese_simplified\",\"chinese_traditional\"],\"释\":[\"chinese_simplified\"],\"词\":[\"chinese_simplified\"],\"亡\":[\"chinese_simplified\",\"chinese_traditional\"],\"壁\":[\"chinese_simplified\",\"chinese_traditional\"],\"顿\":[\"chinese_simplified\"],\"宝\":[\"chinese_simplified\"],\"午\":[\"chinese_simplified\",\"chinese_traditional\"],\"尘\":[\"chinese_simplified\"],\"闻\":[\"chinese_simplified\"],\"揭\":[\"chinese_simplified\",\"chinese_traditional\"],\"炮\":[\"chinese_simplified\",\"chinese_traditional\"],\"残\":[\"chinese_simplified\"],\"冬\":[\"chinese_simplified\",\"chinese_traditional\"],\"桥\":[\"chinese_simplified\"],\"妇\":[\"chinese_simplified\"],\"警\":[\"chinese_simplified\",\"chinese_traditional\"],\"综\":[\"chinese_simplified\"],\"招\":[\"chinese_simplified\",\"chinese_traditional\"],\"吴\":[\"chinese_simplified\"],\"付\":[\"chinese_simplified\",\"chinese_traditional\"],\"浮\":[\"chinese_simplified\",\"chinese_traditional\"],\"遭\":[\"chinese_simplified\",\"chinese_traditional\"],\"徐\":[\"chinese_simplified\",\"chinese_traditional\"],\"您\":[\"chinese_simplified\",\"chinese_traditional\"],\"摇\":[\"chinese_simplified\"],\"谷\":[\"chinese_simplified\",\"chinese_traditional\"],\"赞\":[\"chinese_simplified\"],\"箱\":[\"chinese_simplified\",\"chinese_traditional\"],\"隔\":[\"chinese_simplified\",\"chinese_traditional\"],\"订\":[\"chinese_simplified\"],\"男\":[\"chinese_simplified\",\"chinese_traditional\"],\"吹\":[\"chinese_simplified\",\"chinese_traditional\"],\"园\":[\"chinese_simplified\"],\"纷\":[\"chinese_simplified\"],\"唐\":[\"chinese_simplified\",\"chinese_traditional\"],\"败\":[\"chinese_simplified\"],\"宋\":[\"chinese_simplified\",\"chinese_traditional\"],\"玻\":[\"chinese_simplified\",\"chinese_traditional\"],\"巨\":[\"chinese_simplified\",\"chinese_traditional\"],\"耕\":[\"chinese_simplified\",\"chinese_traditional\"],\"坦\":[\"chinese_simplified\",\"chinese_traditional\"],\"荣\":[\"chinese_simplified\"],\"闭\":[\"chinese_simplified\"],\"湾\":[\"chinese_simplified\"],\"键\":[\"chinese_simplified\"],\"凡\":[\"chinese_simplified\",\"chinese_traditional\"],\"驻\":[\"chinese_simplified\"],\"锅\":[\"chinese_simplified\"],\"救\":[\"chinese_simplified\",\"chinese_traditional\"],\"恩\":[\"chinese_simplified\",\"chinese_traditional\"],\"剥\":[\"chinese_simplified\"],\"凝\":[\"chinese_simplified\",\"chinese_traditional\"],\"碱\":[\"chinese_simplified\"],\"齿\":[\"chinese_simplified\"],\"截\":[\"chinese_simplified\",\"chinese_traditional\"],\"炼\":[\"chinese_simplified\"],\"麻\":[\"chinese_simplified\",\"chinese_traditional\"],\"纺\":[\"chinese_simplified\"],\"禁\":[\"chinese_simplified\",\"chinese_traditional\"],\"废\":[\"chinese_simplified\"],\"盛\":[\"chinese_simplified\",\"chinese_traditional\"],\"版\":[\"chinese_simplified\",\"chinese_traditional\"],\"缓\":[\"chinese_simplified\"],\"净\":[\"chinese_simplified\"],\"睛\":[\"chinese_simplified\",\"chinese_traditional\"],\"昌\":[\"chinese_simplified\",\"chinese_traditional\"],\"婚\":[\"chinese_simplified\",\"chinese_traditional\"],\"涉\":[\"chinese_simplified\",\"chinese_traditional\"],\"筒\":[\"chinese_simplified\",\"chinese_traditional\"],\"嘴\":[\"chinese_simplified\",\"chinese_traditional\"],\"插\":[\"chinese_simplified\",\"chinese_traditional\"],\"岸\":[\"chinese_simplified\",\"chinese_traditional\"],\"朗\":[\"chinese_simplified\",\"chinese_traditional\"],\"庄\":[\"chinese_simplified\"],\"街\":[\"chinese_simplified\",\"chinese_traditional\"],\"藏\":[\"chinese_simplified\",\"chinese_traditional\"],\"姑\":[\"chinese_simplified\",\"chinese_traditional\"],\"贸\":[\"chinese_simplified\"],\"腐\":[\"chinese_simplified\",\"chinese_traditional\"],\"奴\":[\"chinese_simplified\",\"chinese_traditional\"],\"啦\":[\"chinese_simplified\",\"chinese_traditional\"],\"惯\":[\"chinese_simplified\"],\"乘\":[\"chinese_simplified\",\"chinese_traditional\"],\"伙\":[\"chinese_simplified\"],\"恢\":[\"chinese_simplified\",\"chinese_traditional\"],\"匀\":[\"chinese_simplified\"],\"纱\":[\"chinese_simplified\"],\"扎\":[\"chinese_simplified\",\"chinese_traditional\"],\"辩\":[\"chinese_simplified\"],\"耳\":[\"chinese_simplified\",\"chinese_traditional\"],\"彪\":[\"chinese_simplified\",\"chinese_traditional\"],\"臣\":[\"chinese_simplified\",\"chinese_traditional\"],\"亿\":[\"chinese_simplified\"],\"璃\":[\"chinese_simplified\",\"chinese_traditional\"],\"抵\":[\"chinese_simplified\",\"chinese_traditional\"],\"脉\":[\"chinese_simplified\"],\"秀\":[\"chinese_simplified\",\"chinese_traditional\"],\"萨\":[\"chinese_simplified\"],\"俄\":[\"chinese_simplified\",\"chinese_traditional\"],\"网\":[\"chinese_simplified\"],\"舞\":[\"chinese_simplified\",\"chinese_traditional\"],\"店\":[\"chinese_simplified\",\"chinese_traditional\"],\"喷\":[\"chinese_simplified\"],\"纵\":[\"chinese_simplified\"],\"寸\":[\"chinese_simplified\",\"chinese_traditional\"],\"汗\":[\"chinese_simplified\",\"chinese_traditional\"],\"挂\":[\"chinese_simplified\"],\"洪\":[\"chinese_simplified\",\"chinese_traditional\"],\"贺\":[\"chinese_simplified\"],\"闪\":[\"chinese_simplified\"],\"柬\":[\"chinese_simplified\",\"chinese_traditional\"],\"爆\":[\"chinese_simplified\",\"chinese_traditional\"],\"烯\":[\"chinese_simplified\",\"chinese_traditional\"],\"津\":[\"chinese_simplified\",\"chinese_traditional\"],\"稻\":[\"chinese_simplified\",\"chinese_traditional\"],\"墙\":[\"chinese_simplified\"],\"软\":[\"chinese_simplified\"],\"勇\":[\"chinese_simplified\",\"chinese_traditional\"],\"像\":[\"chinese_simplified\",\"chinese_traditional\"],\"滚\":[\"chinese_simplified\"],\"厘\":[\"chinese_simplified\",\"chinese_traditional\"],\"蒙\":[\"chinese_simplified\",\"chinese_traditional\"],\"芳\":[\"chinese_simplified\",\"chinese_traditional\"],\"肯\":[\"chinese_simplified\",\"chinese_traditional\"],\"坡\":[\"chinese_simplified\",\"chinese_traditional\"],\"柱\":[\"chinese_simplified\",\"chinese_traditional\"],\"荡\":[\"chinese_simplified\"],\"腿\":[\"chinese_simplified\",\"chinese_traditional\"],\"仪\":[\"chinese_simplified\"],\"旅\":[\"chinese_simplified\",\"chinese_traditional\"],\"尾\":[\"chinese_simplified\",\"chinese_traditional\"],\"轧\":[\"chinese_simplified\"],\"冰\":[\"chinese_simplified\",\"chinese_traditional\"],\"贡\":[\"chinese_simplified\"],\"登\":[\"chinese_simplified\",\"chinese_traditional\"],\"黎\":[\"chinese_simplified\",\"chinese_traditional\"],\"削\":[\"chinese_simplified\",\"chinese_traditional\"],\"钻\":[\"chinese_simplified\"],\"勒\":[\"chinese_simplified\",\"chinese_traditional\"],\"逃\":[\"chinese_simplified\",\"chinese_traditional\"],\"障\":[\"chinese_simplified\",\"chinese_traditional\"],\"氨\":[\"chinese_simplified\",\"chinese_traditional\"],\"郭\":[\"chinese_simplified\",\"chinese_traditional\"],\"峰\":[\"chinese_simplified\",\"chinese_traditional\"],\"币\":[\"chinese_simplified\"],\"港\":[\"chinese_simplified\",\"chinese_traditional\"],\"伏\":[\"chinese_simplified\",\"chinese_traditional\"],\"轨\":[\"chinese_simplified\"],\"亩\":[\"chinese_simplified\"],\"毕\":[\"chinese_simplified\"],\"擦\":[\"chinese_simplified\",\"chinese_traditional\"],\"莫\":[\"chinese_simplified\",\"chinese_traditional\"],\"刺\":[\"chinese_simplified\",\"chinese_traditional\"],\"浪\":[\"chinese_simplified\",\"chinese_traditional\"],\"秘\":[\"chinese_simplified\",\"chinese_traditional\"],\"援\":[\"chinese_simplified\",\"chinese_traditional\"],\"株\":[\"chinese_simplified\",\"chinese_traditional\"],\"健\":[\"chinese_simplified\",\"chinese_traditional\"],\"售\":[\"chinese_simplified\",\"chinese_traditional\"],\"股\":[\"chinese_simplified\",\"chinese_traditional\"],\"岛\":[\"chinese_simplified\"],\"甘\":[\"chinese_simplified\",\"chinese_traditional\"],\"泡\":[\"chinese_simplified\",\"chinese_traditional\"],\"睡\":[\"chinese_simplified\",\"chinese_traditional\"],\"童\":[\"chinese_simplified\",\"chinese_traditional\"],\"铸\":[\"chinese_simplified\"],\"汤\":[\"chinese_simplified\"],\"阀\":[\"chinese_simplified\"],\"休\":[\"chinese_simplified\",\"chinese_traditional\"],\"汇\":[\"chinese_simplified\"],\"舍\":[\"chinese_simplified\",\"chinese_traditional\"],\"牧\":[\"chinese_simplified\",\"chinese_traditional\"],\"绕\":[\"chinese_simplified\"],\"炸\":[\"chinese_simplified\",\"chinese_traditional\"],\"哲\":[\"chinese_simplified\",\"chinese_traditional\"],\"磷\":[\"chinese_simplified\",\"chinese_traditional\"],\"绩\":[\"chinese_simplified\"],\"朋\":[\"chinese_simplified\",\"chinese_traditional\"],\"淡\":[\"chinese_simplified\",\"chinese_traditional\"],\"尖\":[\"chinese_simplified\",\"chinese_traditional\"],\"启\":[\"chinese_simplified\"],\"陷\":[\"chinese_simplified\",\"chinese_traditional\"],\"柴\":[\"chinese_simplified\",\"chinese_traditional\"],\"呈\":[\"chinese_simplified\",\"chinese_traditional\"],\"徒\":[\"chinese_simplified\",\"chinese_traditional\"],\"颜\":[\"chinese_simplified\"],\"泪\":[\"chinese_simplified\"],\"稍\":[\"chinese_simplified\",\"chinese_traditional\"],\"忘\":[\"chinese_simplified\",\"chinese_traditional\"],\"泵\":[\"chinese_simplified\",\"chinese_traditional\"],\"蓝\":[\"chinese_simplified\"],\"拖\":[\"chinese_simplified\",\"chinese_traditional\"],\"洞\":[\"chinese_simplified\",\"chinese_traditional\"],\"授\":[\"chinese_simplified\",\"chinese_traditional\"],\"镜\":[\"chinese_simplified\"],\"辛\":[\"chinese_simplified\",\"chinese_traditional\"],\"壮\":[\"chinese_simplified\"],\"锋\":[\"chinese_simplified\"],\"贫\":[\"chinese_simplified\"],\"虚\":[\"chinese_simplified\"],\"弯\":[\"chinese_simplified\"],\"摩\":[\"chinese_simplified\",\"chinese_traditional\"],\"泰\":[\"chinese_simplified\",\"chinese_traditional\"],\"幼\":[\"chinese_simplified\",\"chinese_traditional\"],\"廷\":[\"chinese_simplified\",\"chinese_traditional\"],\"尊\":[\"chinese_simplified\",\"chinese_traditional\"],\"窗\":[\"chinese_simplified\",\"chinese_traditional\"],\"纲\":[\"chinese_simplified\"],\"弄\":[\"chinese_simplified\",\"chinese_traditional\"],\"隶\":[\"chinese_simplified\"],\"疑\":[\"chinese_simplified\",\"chinese_traditional\"],\"氏\":[\"chinese_simplified\",\"chinese_traditional\"],\"宫\":[\"chinese_simplified\"],\"姐\":[\"chinese_simplified\",\"chinese_traditional\"],\"震\":[\"chinese_simplified\",\"chinese_traditional\"],\"瑞\":[\"chinese_simplified\",\"chinese_traditional\"],\"怪\":[\"chinese_simplified\",\"chinese_traditional\"],\"尤\":[\"chinese_simplified\",\"chinese_traditional\"],\"琴\":[\"chinese_simplified\",\"chinese_traditional\"],\"循\":[\"chinese_simplified\",\"chinese_traditional\"],\"描\":[\"chinese_simplified\",\"chinese_traditional\"],\"膜\":[\"chinese_simplified\",\"chinese_traditional\"],\"违\":[\"chinese_simplified\"],\"夹\":[\"chinese_simplified\"],\"腰\":[\"chinese_simplified\",\"chinese_traditional\"],\"缘\":[\"chinese_simplified\"],\"珠\":[\"chinese_simplified\",\"chinese_traditional\"],\"穷\":[\"chinese_simplified\"],\"森\":[\"chinese_simplified\",\"chinese_traditional\"],\"枝\":[\"chinese_simplified\",\"chinese_traditional\"],\"竹\":[\"chinese_simplified\",\"chinese_traditional\"],\"沟\":[\"chinese_simplified\"],\"催\":[\"chinese_simplified\",\"chinese_traditional\"],\"绳\":[\"chinese_simplified\"],\"忆\":[\"chinese_simplified\"],\"邦\":[\"chinese_simplified\",\"chinese_traditional\"],\"剩\":[\"chinese_simplified\",\"chinese_traditional\"],\"幸\":[\"chinese_simplified\",\"chinese_traditional\"],\"浆\":[\"chinese_simplified\"],\"栏\":[\"chinese_simplified\"],\"拥\":[\"chinese_simplified\"],\"牙\":[\"chinese_simplified\",\"chinese_traditional\"],\"贮\":[\"chinese_simplified\"],\"礼\":[\"chinese_simplified\"],\"滤\":[\"chinese_simplified\"],\"钠\":[\"chinese_simplified\"],\"纹\":[\"chinese_simplified\"],\"罢\":[\"chinese_simplified\"],\"拍\":[\"chinese_simplified\",\"chinese_traditional\"],\"咱\":[\"chinese_simplified\",\"chinese_traditional\"],\"喊\":[\"chinese_simplified\",\"chinese_traditional\"],\"袖\":[\"chinese_simplified\",\"chinese_traditional\"],\"埃\":[\"chinese_simplified\",\"chinese_traditional\"],\"勤\":[\"chinese_simplified\",\"chinese_traditional\"],\"罚\":[\"chinese_simplified\"],\"焦\":[\"chinese_simplified\",\"chinese_traditional\"],\"潜\":[\"chinese_simplified\"],\"伍\":[\"chinese_simplified\",\"chinese_traditional\"],\"墨\":[\"chinese_simplified\",\"chinese_traditional\"],\"欲\":[\"chinese_simplified\",\"chinese_traditional\"],\"缝\":[\"chinese_simplified\"],\"姓\":[\"chinese_simplified\",\"chinese_traditional\"],\"刊\":[\"chinese_simplified\",\"chinese_traditional\"],\"饱\":[\"chinese_simplified\"],\"仿\":[\"chinese_simplified\",\"chinese_traditional\"],\"奖\":[\"chinese_simplified\"],\"铝\":[\"chinese_simplified\"],\"鬼\":[\"chinese_simplified\",\"chinese_traditional\"],\"丽\":[\"chinese_simplified\"],\"跨\":[\"chinese_simplified\",\"chinese_traditional\"],\"默\":[\"chinese_simplified\",\"chinese_traditional\"],\"挖\":[\"chinese_simplified\",\"chinese_traditional\"],\"链\":[\"chinese_simplified\"],\"扫\":[\"chinese_simplified\"],\"喝\":[\"chinese_simplified\",\"chinese_traditional\"],\"袋\":[\"chinese_simplified\",\"chinese_traditional\"],\"炭\":[\"chinese_simplified\",\"chinese_traditional\"],\"污\":[\"chinese_simplified\",\"chinese_traditional\"],\"幕\":[\"chinese_simplified\",\"chinese_traditional\"],\"诸\":[\"chinese_simplified\"],\"弧\":[\"chinese_simplified\",\"chinese_traditional\"],\"励\":[\"chinese_simplified\"],\"梅\":[\"chinese_simplified\",\"chinese_traditional\"],\"奶\":[\"chinese_simplified\",\"chinese_traditional\"],\"洁\":[\"chinese_simplified\"],\"灾\":[\"chinese_simplified\"],\"舟\":[\"chinese_simplified\",\"chinese_traditional\"],\"鉴\":[\"chinese_simplified\"],\"苯\":[\"chinese_simplified\",\"chinese_traditional\"],\"讼\":[\"chinese_simplified\"],\"抱\":[\"chinese_simplified\",\"chinese_traditional\"],\"毁\":[\"chinese_simplified\"],\"懂\":[\"chinese_simplified\",\"chinese_traditional\"],\"寒\":[\"chinese_simplified\",\"chinese_traditional\"],\"智\":[\"chinese_simplified\",\"chinese_traditional\"],\"埔\":[\"chinese_simplified\",\"chinese_traditional\"],\"寄\":[\"chinese_simplified\",\"chinese_traditional\"],\"届\":[\"chinese_simplified\"],\"跃\":[\"chinese_simplified\"],\"渡\":[\"chinese_simplified\",\"chinese_traditional\"],\"挑\":[\"chinese_simplified\",\"chinese_traditional\"],\"丹\":[\"chinese_simplified\",\"chinese_traditional\"],\"艰\":[\"chinese_simplified\"],\"贝\":[\"chinese_simplified\"],\"碰\":[\"chinese_simplified\",\"chinese_traditional\"],\"拔\":[\"chinese_simplified\",\"chinese_traditional\"],\"爹\":[\"chinese_simplified\",\"chinese_traditional\"],\"戴\":[\"chinese_simplified\",\"chinese_traditional\"],\"码\":[\"chinese_simplified\"],\"梦\":[\"chinese_simplified\"],\"芽\":[\"chinese_simplified\",\"chinese_traditional\"],\"熔\":[\"chinese_simplified\",\"chinese_traditional\"],\"赤\":[\"chinese_simplified\",\"chinese_traditional\"],\"渔\":[\"chinese_simplified\"],\"哭\":[\"chinese_simplified\",\"chinese_traditional\"],\"敬\":[\"chinese_simplified\",\"chinese_traditional\"],\"颗\":[\"chinese_simplified\"],\"奔\":[\"chinese_simplified\",\"chinese_traditional\"],\"铅\":[\"chinese_simplified\"],\"仲\":[\"chinese_simplified\",\"chinese_traditional\"],\"虎\":[\"chinese_simplified\",\"chinese_traditional\"],\"稀\":[\"chinese_simplified\",\"chinese_traditional\"],\"妹\":[\"chinese_simplified\",\"chinese_traditional\"],\"乏\":[\"chinese_simplified\",\"chinese_traditional\"],\"珍\":[\"chinese_simplified\",\"chinese_traditional\"],\"申\":[\"chinese_simplified\",\"chinese_traditional\"],\"桌\":[\"chinese_simplified\",\"chinese_traditional\"],\"遵\":[\"chinese_simplified\",\"chinese_traditional\"],\"允\":[\"chinese_simplified\",\"chinese_traditional\"],\"隆\":[\"chinese_simplified\",\"chinese_traditional\"],\"螺\":[\"chinese_simplified\",\"chinese_traditional\"],\"仓\":[\"chinese_simplified\"],\"魏\":[\"chinese_simplified\",\"chinese_traditional\"],\"锐\":[\"chinese_simplified\"],\"晓\":[\"chinese_simplified\"],\"氮\":[\"chinese_simplified\",\"chinese_traditional\"],\"兼\":[\"chinese_simplified\",\"chinese_traditional\"],\"隐\":[\"chinese_simplified\"],\"碍\":[\"chinese_simplified\"],\"赫\":[\"chinese_simplified\",\"chinese_traditional\"],\"拨\":[\"chinese_simplified\"],\"忠\":[\"chinese_simplified\",\"chinese_traditional\"],\"肃\":[\"chinese_simplified\"],\"缸\":[\"chinese_simplified\",\"chinese_traditional\"],\"牵\":[\"chinese_simplified\"],\"抢\":[\"chinese_simplified\"],\"博\":[\"chinese_simplified\",\"chinese_traditional\"],\"巧\":[\"chinese_simplified\",\"chinese_traditional\"],\"壳\":[\"chinese_simplified\"],\"兄\":[\"chinese_simplified\",\"chinese_traditional\"],\"杜\":[\"chinese_simplified\",\"chinese_traditional\"],\"讯\":[\"chinese_simplified\"],\"诚\":[\"chinese_simplified\"],\"碧\":[\"chinese_simplified\",\"chinese_traditional\"],\"祥\":[\"chinese_simplified\",\"chinese_traditional\"],\"柯\":[\"chinese_simplified\",\"chinese_traditional\"],\"页\":[\"chinese_simplified\"],\"巡\":[\"chinese_simplified\",\"chinese_traditional\"],\"矩\":[\"chinese_simplified\",\"chinese_traditional\"],\"悲\":[\"chinese_simplified\",\"chinese_traditional\"],\"灌\":[\"chinese_simplified\",\"chinese_traditional\"],\"龄\":[\"chinese_simplified\"],\"伦\":[\"chinese_simplified\"],\"票\":[\"chinese_simplified\",\"chinese_traditional\"],\"寻\":[\"chinese_simplified\"],\"桂\":[\"chinese_simplified\",\"chinese_traditional\"],\"铺\":[\"chinese_simplified\"],\"圣\":[\"chinese_simplified\"],\"恐\":[\"chinese_simplified\",\"chinese_traditional\"],\"恰\":[\"chinese_simplified\",\"chinese_traditional\"],\"郑\":[\"chinese_simplified\"],\"趣\":[\"chinese_simplified\",\"chinese_traditional\"],\"抬\":[\"chinese_simplified\",\"chinese_traditional\"],\"荒\":[\"chinese_simplified\",\"chinese_traditional\"],\"腾\":[\"chinese_simplified\"],\"贴\":[\"chinese_simplified\"],\"柔\":[\"chinese_simplified\",\"chinese_traditional\"],\"滴\":[\"chinese_simplified\",\"chinese_traditional\"],\"猛\":[\"chinese_simplified\",\"chinese_traditional\"],\"阔\":[\"chinese_simplified\"],\"辆\":[\"chinese_simplified\"],\"妻\":[\"chinese_simplified\",\"chinese_traditional\"],\"填\":[\"chinese_simplified\",\"chinese_traditional\"],\"撤\":[\"chinese_simplified\",\"chinese_traditional\"],\"储\":[\"chinese_simplified\"],\"签\":[\"chinese_simplified\"],\"闹\":[\"chinese_simplified\"],\"扰\":[\"chinese_simplified\"],\"紫\":[\"chinese_simplified\",\"chinese_traditional\"],\"砂\":[\"chinese_simplified\",\"chinese_traditional\"],\"递\":[\"chinese_simplified\"],\"戏\":[\"chinese_simplified\"],\"吊\":[\"chinese_simplified\",\"chinese_traditional\"],\"陶\":[\"chinese_simplified\",\"chinese_traditional\"],\"伐\":[\"chinese_simplified\",\"chinese_traditional\"],\"喂\":[\"chinese_simplified\"],\"疗\":[\"chinese_simplified\"],\"瓶\":[\"chinese_simplified\",\"chinese_traditional\"],\"婆\":[\"chinese_simplified\",\"chinese_traditional\"],\"抚\":[\"chinese_simplified\"],\"臂\":[\"chinese_simplified\",\"chinese_traditional\"],\"摸\":[\"chinese_simplified\",\"chinese_traditional\"],\"忍\":[\"chinese_simplified\",\"chinese_traditional\"],\"虾\":[\"chinese_simplified\"],\"蜡\":[\"chinese_simplified\"],\"邻\":[\"chinese_simplified\"],\"胸\":[\"chinese_simplified\",\"chinese_traditional\"],\"巩\":[\"chinese_simplified\"],\"挤\":[\"chinese_simplified\"],\"偶\":[\"chinese_simplified\",\"chinese_traditional\"],\"弃\":[\"chinese_simplified\"],\"槽\":[\"chinese_simplified\",\"chinese_traditional\"],\"劲\":[\"chinese_simplified\"],\"乳\":[\"chinese_simplified\",\"chinese_traditional\"],\"邓\":[\"chinese_simplified\"],\"吉\":[\"chinese_simplified\",\"chinese_traditional\"],\"仁\":[\"chinese_simplified\",\"chinese_traditional\"],\"烂\":[\"chinese_simplified\"],\"砖\":[\"chinese_simplified\"],\"租\":[\"chinese_simplified\",\"chinese_traditional\"],\"乌\":[\"chinese_simplified\"],\"舰\":[\"chinese_simplified\"],\"伴\":[\"chinese_simplified\",\"chinese_traditional\"],\"瓜\":[\"chinese_simplified\",\"chinese_traditional\"],\"浅\":[\"chinese_simplified\"],\"丙\":[\"chinese_simplified\",\"chinese_traditional\"],\"暂\":[\"chinese_simplified\"],\"燥\":[\"chinese_simplified\",\"chinese_traditional\"],\"橡\":[\"chinese_simplified\",\"chinese_traditional\"],\"柳\":[\"chinese_simplified\",\"chinese_traditional\"],\"迷\":[\"chinese_simplified\",\"chinese_traditional\"],\"暖\":[\"chinese_simplified\",\"chinese_traditional\"],\"牌\":[\"chinese_simplified\",\"chinese_traditional\"],\"秧\":[\"chinese_simplified\",\"chinese_traditional\"],\"胆\":[\"chinese_simplified\"],\"详\":[\"chinese_simplified\"],\"簧\":[\"chinese_simplified\",\"chinese_traditional\"],\"踏\":[\"chinese_simplified\",\"chinese_traditional\"],\"瓷\":[\"chinese_simplified\",\"chinese_traditional\"],\"谱\":[\"chinese_simplified\"],\"呆\":[\"chinese_simplified\",\"chinese_traditional\"],\"宾\":[\"chinese_simplified\"],\"糊\":[\"chinese_simplified\",\"chinese_traditional\"],\"洛\":[\"chinese_simplified\",\"chinese_traditional\"],\"辉\":[\"chinese_simplified\"],\"愤\":[\"chinese_simplified\"],\"竞\":[\"chinese_simplified\"],\"隙\":[\"chinese_simplified\",\"chinese_traditional\"],\"怒\":[\"chinese_simplified\",\"chinese_traditional\"],\"粘\":[\"chinese_simplified\",\"chinese_traditional\"],\"乃\":[\"chinese_simplified\",\"chinese_traditional\"],\"绪\":[\"chinese_simplified\"],\"肩\":[\"chinese_simplified\",\"chinese_traditional\"],\"籍\":[\"chinese_simplified\",\"chinese_traditional\"],\"敏\":[\"chinese_simplified\",\"chinese_traditional\"],\"涂\":[\"chinese_simplified\"],\"熙\":[\"chinese_simplified\",\"chinese_traditional\"],\"皆\":[\"chinese_simplified\",\"chinese_traditional\"],\"侦\":[\"chinese_simplified\"],\"悬\":[\"chinese_simplified\"],\"掘\":[\"chinese_simplified\",\"chinese_traditional\"],\"享\":[\"chinese_simplified\",\"chinese_traditional\"],\"纠\":[\"chinese_simplified\"],\"醒\":[\"chinese_simplified\",\"chinese_traditional\"],\"狂\":[\"chinese_simplified\",\"chinese_traditional\"],\"锁\":[\"chinese_simplified\"],\"淀\":[\"chinese_simplified\",\"chinese_traditional\"],\"恨\":[\"chinese_simplified\",\"chinese_traditional\"],\"牲\":[\"chinese_simplified\",\"chinese_traditional\"],\"霸\":[\"chinese_simplified\",\"chinese_traditional\"],\"爬\":[\"chinese_simplified\",\"chinese_traditional\"],\"赏\":[\"chinese_simplified\"],\"逆\":[\"chinese_simplified\",\"chinese_traditional\"],\"玩\":[\"chinese_simplified\",\"chinese_traditional\"],\"陵\":[\"chinese_simplified\",\"chinese_traditional\"],\"祝\":[\"chinese_simplified\",\"chinese_traditional\"],\"秒\":[\"chinese_simplified\",\"chinese_traditional\"],\"浙\":[\"chinese_simplified\",\"chinese_traditional\"],\"貌\":[\"chinese_simplified\",\"chinese_traditional\"],\"役\":[\"chinese_simplified\",\"chinese_traditional\"],\"彼\":[\"chinese_simplified\",\"chinese_traditional\"],\"悉\":[\"chinese_simplified\",\"chinese_traditional\"],\"鸭\":[\"chinese_simplified\"],\"趋\":[\"chinese_simplified\"],\"凤\":[\"chinese_simplified\"],\"晨\":[\"chinese_simplified\",\"chinese_traditional\"],\"畜\":[\"chinese_simplified\",\"chinese_traditional\"],\"辈\":[\"chinese_simplified\"],\"秩\":[\"chinese_simplified\",\"chinese_traditional\"],\"卵\":[\"chinese_simplified\",\"chinese_traditional\"],\"署\":[\"chinese_simplified\",\"chinese_traditional\"],\"梯\":[\"chinese_simplified\",\"chinese_traditional\"],\"炎\":[\"chinese_simplified\",\"chinese_traditional\"],\"滩\":[\"chinese_simplified\"],\"棋\":[\"chinese_simplified\",\"chinese_traditional\"],\"驱\":[\"chinese_simplified\"],\"筛\":[\"chinese_simplified\"],\"峡\":[\"chinese_simplified\"],\"冒\":[\"chinese_simplified\",\"chinese_traditional\"],\"啥\":[\"chinese_simplified\",\"chinese_traditional\"],\"寿\":[\"chinese_simplified\"],\"译\":[\"chinese_simplified\"],\"浸\":[\"chinese_simplified\",\"chinese_traditional\"],\"泉\":[\"chinese_simplified\",\"chinese_traditional\"],\"帽\":[\"chinese_simplified\",\"chinese_traditional\"],\"迟\":[\"chinese_simplified\"],\"硅\":[\"chinese_simplified\"],\"疆\":[\"chinese_simplified\",\"chinese_traditional\"],\"贷\":[\"chinese_simplified\"],\"漏\":[\"chinese_simplified\",\"chinese_traditional\"],\"稿\":[\"chinese_simplified\",\"chinese_traditional\"],\"冠\":[\"chinese_simplified\",\"chinese_traditional\"],\"嫩\":[\"chinese_simplified\",\"chinese_traditional\"],\"胁\":[\"chinese_simplified\"],\"芯\":[\"chinese_simplified\",\"chinese_traditional\"],\"牢\":[\"chinese_simplified\",\"chinese_traditional\"],\"叛\":[\"chinese_simplified\",\"chinese_traditional\"],\"蚀\":[\"chinese_simplified\"],\"奥\":[\"chinese_simplified\"],\"鸣\":[\"chinese_simplified\"],\"岭\":[\"chinese_simplified\"],\"羊\":[\"chinese_simplified\",\"chinese_traditional\"],\"凭\":[\"chinese_simplified\"],\"串\":[\"chinese_simplified\",\"chinese_traditional\"],\"塘\":[\"chinese_simplified\",\"chinese_traditional\"],\"绘\":[\"chinese_simplified\"],\"酵\":[\"chinese_simplified\",\"chinese_traditional\"],\"融\":[\"chinese_simplified\",\"chinese_traditional\"],\"盆\":[\"chinese_simplified\",\"chinese_traditional\"],\"锡\":[\"chinese_simplified\"],\"庙\":[\"chinese_simplified\"],\"筹\":[\"chinese_simplified\"],\"冻\":[\"chinese_simplified\"],\"辅\":[\"chinese_simplified\"],\"摄\":[\"chinese_simplified\"],\"袭\":[\"chinese_simplified\"],\"筋\":[\"chinese_simplified\",\"chinese_traditional\"],\"拒\":[\"chinese_simplified\",\"chinese_traditional\"],\"僚\":[\"chinese_simplified\",\"chinese_traditional\"],\"旱\":[\"chinese_simplified\",\"chinese_traditional\"],\"钾\":[\"chinese_simplified\"],\"鸟\":[\"chinese_simplified\"],\"漆\":[\"chinese_simplified\",\"chinese_traditional\"],\"沈\":[\"chinese_simplified\",\"chinese_traditional\"],\"眉\":[\"chinese_simplified\",\"chinese_traditional\"],\"疏\":[\"chinese_simplified\",\"chinese_traditional\"],\"添\":[\"chinese_simplified\",\"chinese_traditional\"],\"棒\":[\"chinese_simplified\",\"chinese_traditional\"],\"穗\":[\"chinese_simplified\",\"chinese_traditional\"],\"硝\":[\"chinese_simplified\",\"chinese_traditional\"],\"韩\":[\"chinese_simplified\"],\"逼\":[\"chinese_simplified\",\"chinese_traditional\"],\"扭\":[\"chinese_simplified\",\"chinese_traditional\"],\"侨\":[\"chinese_simplified\"],\"凉\":[\"chinese_simplified\"],\"挺\":[\"chinese_simplified\",\"chinese_traditional\"],\"碗\":[\"chinese_simplified\",\"chinese_traditional\"],\"栽\":[\"chinese_simplified\",\"chinese_traditional\"],\"炒\":[\"chinese_simplified\",\"chinese_traditional\"],\"杯\":[\"chinese_simplified\",\"chinese_traditional\"],\"患\":[\"chinese_simplified\",\"chinese_traditional\"],\"馏\":[\"chinese_simplified\"],\"劝\":[\"chinese_simplified\"],\"豪\":[\"chinese_simplified\",\"chinese_traditional\"],\"辽\":[\"chinese_simplified\"],\"勃\":[\"chinese_simplified\",\"chinese_traditional\"],\"鸿\":[\"chinese_simplified\"],\"旦\":[\"chinese_simplified\",\"chinese_traditional\"],\"吏\":[\"chinese_simplified\",\"chinese_traditional\"],\"拜\":[\"chinese_simplified\",\"chinese_traditional\"],\"狗\":[\"chinese_simplified\",\"chinese_traditional\"],\"埋\":[\"chinese_simplified\",\"chinese_traditional\"],\"辊\":[\"chinese_simplified\"],\"掩\":[\"chinese_simplified\",\"chinese_traditional\"],\"饮\":[\"chinese_simplified\"],\"搬\":[\"chinese_simplified\",\"chinese_traditional\"],\"骂\":[\"chinese_simplified\"],\"辞\":[\"chinese_simplified\"],\"勾\":[\"chinese_simplified\",\"chinese_traditional\"],\"扣\":[\"chinese_simplified\",\"chinese_traditional\"],\"估\":[\"chinese_simplified\",\"chinese_traditional\"],\"蒋\":[\"chinese_simplified\"],\"绒\":[\"chinese_simplified\"],\"雾\":[\"chinese_simplified\"],\"丈\":[\"chinese_simplified\",\"chinese_traditional\"],\"朵\":[\"chinese_simplified\",\"chinese_traditional\"],\"姆\":[\"chinese_simplified\",\"chinese_traditional\"],\"拟\":[\"chinese_simplified\"],\"宇\":[\"chinese_simplified\",\"chinese_traditional\"],\"辑\":[\"chinese_simplified\"],\"陕\":[\"chinese_simplified\"],\"雕\":[\"chinese_simplified\",\"chinese_traditional\"],\"偿\":[\"chinese_simplified\"],\"蓄\":[\"chinese_simplified\",\"chinese_traditional\"],\"崇\":[\"chinese_simplified\",\"chinese_traditional\"],\"剪\":[\"chinese_simplified\",\"chinese_traditional\"],\"倡\":[\"chinese_simplified\",\"chinese_traditional\"],\"厅\":[\"chinese_simplified\"],\"咬\":[\"chinese_simplified\",\"chinese_traditional\"],\"驶\":[\"chinese_simplified\"],\"薯\":[\"chinese_simplified\",\"chinese_traditional\"],\"刷\":[\"chinese_simplified\",\"chinese_traditional\"],\"斥\":[\"chinese_simplified\",\"chinese_traditional\"],\"番\":[\"chinese_simplified\",\"chinese_traditional\"],\"赋\":[\"chinese_simplified\"],\"奉\":[\"chinese_simplified\",\"chinese_traditional\"],\"佛\":[\"chinese_simplified\",\"chinese_traditional\"],\"浇\":[\"chinese_simplified\"],\"漫\":[\"chinese_simplified\",\"chinese_traditional\"],\"曼\":[\"chinese_simplified\",\"chinese_traditional\"],\"扇\":[\"chinese_simplified\",\"chinese_traditional\"],\"钙\":[\"chinese_simplified\"],\"桃\":[\"chinese_simplified\",\"chinese_traditional\"],\"扶\":[\"chinese_simplified\",\"chinese_traditional\"],\"仔\":[\"chinese_simplified\",\"chinese_traditional\"],\"返\":[\"chinese_simplified\",\"chinese_traditional\"],\"俗\":[\"chinese_simplified\",\"chinese_traditional\"],\"亏\":[\"chinese_simplified\"],\"腔\":[\"chinese_simplified\",\"chinese_traditional\"],\"鞋\":[\"chinese_simplified\",\"chinese_traditional\"],\"棱\":[\"chinese_simplified\",\"chinese_traditional\"],\"覆\":[\"chinese_simplified\",\"chinese_traditional\"],\"框\":[\"chinese_simplified\",\"chinese_traditional\"],\"悄\":[\"chinese_simplified\",\"chinese_traditional\"],\"叔\":[\"chinese_simplified\",\"chinese_traditional\"],\"撞\":[\"chinese_simplified\",\"chinese_traditional\"],\"骗\":[\"chinese_simplified\"],\"勘\":[\"chinese_simplified\",\"chinese_traditional\"],\"旺\":[\"chinese_simplified\",\"chinese_traditional\"],\"沸\":[\"chinese_simplified\",\"chinese_traditional\"],\"孤\":[\"chinese_simplified\",\"chinese_traditional\"],\"吐\":[\"chinese_simplified\",\"chinese_traditional\"],\"孟\":[\"chinese_simplified\",\"chinese_traditional\"],\"渠\":[\"chinese_simplified\",\"chinese_traditional\"],\"屈\":[\"chinese_simplified\",\"chinese_traditional\"],\"疾\":[\"chinese_simplified\",\"chinese_traditional\"],\"妙\":[\"chinese_simplified\",\"chinese_traditional\"],\"惜\":[\"chinese_simplified\",\"chinese_traditional\"],\"仰\":[\"chinese_simplified\",\"chinese_traditional\"],\"狠\":[\"chinese_simplified\",\"chinese_traditional\"],\"胀\":[\"chinese_simplified\"],\"谐\":[\"chinese_simplified\"],\"抛\":[\"chinese_simplified\"],\"霉\":[\"chinese_simplified\"],\"桑\":[\"chinese_simplified\",\"chinese_traditional\"],\"岗\":[\"chinese_simplified\"],\"嘛\":[\"chinese_simplified\",\"chinese_traditional\"],\"衰\":[\"chinese_simplified\",\"chinese_traditional\"],\"盗\":[\"chinese_simplified\"],\"渗\":[\"chinese_simplified\"],\"脏\":[\"chinese_simplified\"],\"赖\":[\"chinese_simplified\"],\"涌\":[\"chinese_simplified\"],\"甜\":[\"chinese_simplified\",\"chinese_traditional\"],\"曹\":[\"chinese_simplified\",\"chinese_traditional\"],\"阅\":[\"chinese_simplified\"],\"肌\":[\"chinese_simplified\",\"chinese_traditional\"],\"哩\":[\"chinese_simplified\",\"chinese_traditional\"],\"厉\":[\"chinese_simplified\"],\"烃\":[\"chinese_simplified\"],\"纬\":[\"chinese_simplified\"],\"毅\":[\"chinese_simplified\",\"chinese_traditional\"],\"昨\":[\"chinese_simplified\",\"chinese_traditional\"],\"伪\":[\"chinese_simplified\"],\"症\":[\"chinese_simplified\",\"chinese_traditional\"],\"煮\":[\"chinese_simplified\",\"chinese_traditional\"],\"叹\":[\"chinese_simplified\"],\"钉\":[\"chinese_simplified\"],\"搭\":[\"chinese_simplified\",\"chinese_traditional\"],\"茎\":[\"chinese_simplified\"],\"笼\":[\"chinese_simplified\"],\"酷\":[\"chinese_simplified\",\"chinese_traditional\"],\"偷\":[\"chinese_simplified\",\"chinese_traditional\"],\"弓\":[\"chinese_simplified\",\"chinese_traditional\"],\"锥\":[\"chinese_simplified\"],\"恒\":[\"chinese_simplified\"],\"杰\":[\"chinese_simplified\"],\"坑\":[\"chinese_simplified\",\"chinese_traditional\"],\"鼻\":[\"chinese_simplified\",\"chinese_traditional\"],\"翼\":[\"chinese_simplified\",\"chinese_traditional\"],\"纶\":[\"chinese_simplified\"],\"叙\":[\"chinese_simplified\"],\"狱\":[\"chinese_simplified\"],\"逮\":[\"chinese_simplified\",\"chinese_traditional\"],\"罐\":[\"chinese_simplified\",\"chinese_traditional\"],\"络\":[\"chinese_simplified\"],\"棚\":[\"chinese_simplified\",\"chinese_traditional\"],\"抑\":[\"chinese_simplified\",\"chinese_traditional\"],\"膨\":[\"chinese_simplified\",\"chinese_traditional\"],\"蔬\":[\"chinese_simplified\",\"chinese_traditional\"],\"寺\":[\"chinese_simplified\",\"chinese_traditional\"],\"骤\":[\"chinese_simplified\"],\"穆\":[\"chinese_simplified\",\"chinese_traditional\"],\"冶\":[\"chinese_simplified\",\"chinese_traditional\"],\"枯\":[\"chinese_simplified\",\"chinese_traditional\"],\"册\":[\"chinese_simplified\"],\"尸\":[\"chinese_simplified\"],\"凸\":[\"chinese_simplified\",\"chinese_traditional\"],\"绅\":[\"chinese_simplified\"],\"坯\":[\"chinese_simplified\",\"chinese_traditional\"],\"牺\":[\"chinese_simplified\"],\"焰\":[\"chinese_simplified\",\"chinese_traditional\"],\"轰\":[\"chinese_simplified\"],\"欣\":[\"chinese_simplified\",\"chinese_traditional\"],\"晋\":[\"chinese_simplified\"],\"瘦\":[\"chinese_simplified\",\"chinese_traditional\"],\"御\":[\"chinese_simplified\"],\"锭\":[\"chinese_simplified\"],\"锦\":[\"chinese_simplified\"],\"丧\":[\"chinese_simplified\"],\"旬\":[\"chinese_simplified\",\"chinese_traditional\"],\"锻\":[\"chinese_simplified\"],\"垄\":[\"chinese_simplified\"],\"搜\":[\"chinese_simplified\",\"chinese_traditional\"],\"扑\":[\"chinese_simplified\"],\"邀\":[\"chinese_simplified\",\"chinese_traditional\"],\"亭\":[\"chinese_simplified\",\"chinese_traditional\"],\"酯\":[\"chinese_simplified\",\"chinese_traditional\"],\"迈\":[\"chinese_simplified\"],\"舒\":[\"chinese_simplified\",\"chinese_traditional\"],\"脆\":[\"chinese_simplified\",\"chinese_traditional\"],\"酶\":[\"chinese_simplified\",\"chinese_traditional\"],\"闲\":[\"chinese_simplified\"],\"忧\":[\"chinese_simplified\"],\"酚\":[\"chinese_simplified\",\"chinese_traditional\"],\"顽\":[\"chinese_simplified\"],\"羽\":[\"chinese_simplified\",\"chinese_traditional\"],\"涨\":[\"chinese_simplified\"],\"卸\":[\"chinese_simplified\",\"chinese_traditional\"],\"仗\":[\"chinese_simplified\",\"chinese_traditional\"],\"陪\":[\"chinese_simplified\",\"chinese_traditional\"],\"辟\":[\"chinese_simplified\"],\"惩\":[\"chinese_simplified\"],\"杭\":[\"chinese_simplified\",\"chinese_traditional\"],\"姚\":[\"chinese_simplified\",\"chinese_traditional\"],\"肚\":[\"chinese_simplified\",\"chinese_traditional\"],\"捉\":[\"chinese_simplified\",\"chinese_traditional\"],\"飘\":[\"chinese_simplified\"],\"漂\":[\"chinese_simplified\",\"chinese_traditional\"],\"昆\":[\"chinese_simplified\",\"chinese_traditional\"],\"欺\":[\"chinese_simplified\",\"chinese_traditional\"],\"吾\":[\"chinese_simplified\",\"chinese_traditional\"],\"郎\":[\"chinese_simplified\",\"chinese_traditional\"],\"烷\":[\"chinese_simplified\",\"chinese_traditional\"],\"汁\":[\"chinese_simplified\",\"chinese_traditional\"],\"呵\":[\"chinese_simplified\",\"chinese_traditional\"],\"饰\":[\"chinese_simplified\"],\"萧\":[\"chinese_simplified\"],\"雅\":[\"chinese_simplified\",\"chinese_traditional\"],\"邮\":[\"chinese_simplified\"],\"迁\":[\"chinese_simplified\"],\"燕\":[\"chinese_simplified\",\"chinese_traditional\"],\"撒\":[\"chinese_simplified\",\"chinese_traditional\"],\"姻\":[\"chinese_simplified\",\"chinese_traditional\"],\"赴\":[\"chinese_simplified\",\"chinese_traditional\"],\"宴\":[\"chinese_simplified\",\"chinese_traditional\"],\"烦\":[\"chinese_simplified\"],\"债\":[\"chinese_simplified\"],\"帐\":[\"chinese_simplified\"],\"斑\":[\"chinese_simplified\",\"chinese_traditional\"],\"铃\":[\"chinese_simplified\"],\"旨\":[\"chinese_simplified\",\"chinese_traditional\"],\"醇\":[\"chinese_simplified\",\"chinese_traditional\"],\"董\":[\"chinese_simplified\",\"chinese_traditional\"],\"饼\":[\"chinese_simplified\"],\"雏\":[\"chinese_simplified\"],\"姿\":[\"chinese_simplified\",\"chinese_traditional\"],\"拌\":[\"chinese_simplified\",\"chinese_traditional\"],\"傅\":[\"chinese_simplified\",\"chinese_traditional\"],\"腹\":[\"chinese_simplified\",\"chinese_traditional\"],\"妥\":[\"chinese_simplified\",\"chinese_traditional\"],\"揉\":[\"chinese_simplified\",\"chinese_traditional\"],\"贤\":[\"chinese_simplified\"],\"拆\":[\"chinese_simplified\",\"chinese_traditional\"],\"歪\":[\"chinese_simplified\",\"chinese_traditional\"],\"葡\":[\"chinese_simplified\",\"chinese_traditional\"],\"胺\":[\"chinese_simplified\",\"chinese_traditional\"],\"丢\":[\"chinese_simplified\"],\"浩\":[\"chinese_simplified\",\"chinese_traditional\"],\"徽\":[\"chinese_simplified\",\"chinese_traditional\"],\"昂\":[\"chinese_simplified\",\"chinese_traditional\"],\"垫\":[\"chinese_simplified\"],\"挡\":[\"chinese_simplified\"],\"览\":[\"chinese_simplified\"],\"贪\":[\"chinese_simplified\"],\"慰\":[\"chinese_simplified\",\"chinese_traditional\"],\"缴\":[\"chinese_simplified\"],\"汪\":[\"chinese_simplified\",\"chinese_traditional\"],\"慌\":[\"chinese_simplified\",\"chinese_traditional\"],\"冯\":[\"chinese_simplified\"],\"诺\":[\"chinese_simplified\"],\"姜\":[\"chinese_simplified\",\"chinese_traditional\"],\"谊\":[\"chinese_simplified\"],\"凶\":[\"chinese_simplified\"],\"劣\":[\"chinese_simplified\",\"chinese_traditional\"],\"诬\":[\"chinese_simplified\"],\"耀\":[\"chinese_simplified\",\"chinese_traditional\"],\"昏\":[\"chinese_simplified\",\"chinese_traditional\"],\"躺\":[\"chinese_simplified\",\"chinese_traditional\"],\"盈\":[\"chinese_simplified\",\"chinese_traditional\"],\"骑\":[\"chinese_simplified\"],\"乔\":[\"chinese_simplified\"],\"溪\":[\"chinese_simplified\",\"chinese_traditional\"],\"丛\":[\"chinese_simplified\"],\"卢\":[\"chinese_simplified\"],\"抹\":[\"chinese_simplified\",\"chinese_traditional\"],\"闷\":[\"chinese_simplified\"],\"咨\":[\"chinese_simplified\"],\"刮\":[\"chinese_simplified\",\"chinese_traditional\"],\"驾\":[\"chinese_simplified\"],\"缆\":[\"chinese_simplified\"],\"悟\":[\"chinese_simplified\",\"chinese_traditional\"],\"摘\":[\"chinese_simplified\",\"chinese_traditional\"],\"铒\":[\"chinese_simplified\"],\"掷\":[\"chinese_simplified\"],\"颇\":[\"chinese_simplified\"],\"幻\":[\"chinese_simplified\",\"chinese_traditional\"],\"柄\":[\"chinese_simplified\",\"chinese_traditional\"],\"惠\":[\"chinese_simplified\",\"chinese_traditional\"],\"惨\":[\"chinese_simplified\"],\"佳\":[\"chinese_simplified\",\"chinese_traditional\"],\"仇\":[\"chinese_simplified\",\"chinese_traditional\"],\"腊\":[\"chinese_simplified\"],\"窝\":[\"chinese_simplified\"],\"涤\":[\"chinese_simplified\"],\"剑\":[\"chinese_simplified\"],\"瞧\":[\"chinese_simplified\",\"chinese_traditional\"],\"堡\":[\"chinese_simplified\",\"chinese_traditional\"],\"泼\":[\"chinese_simplified\"],\"葱\":[\"chinese_simplified\"],\"罩\":[\"chinese_simplified\",\"chinese_traditional\"],\"霍\":[\"chinese_simplified\",\"chinese_traditional\"],\"捞\":[\"chinese_simplified\"],\"胎\":[\"chinese_simplified\",\"chinese_traditional\"],\"苍\":[\"chinese_simplified\"],\"滨\":[\"chinese_simplified\"],\"俩\":[\"chinese_simplified\"],\"捅\":[\"chinese_simplified\",\"chinese_traditional\"],\"湘\":[\"chinese_simplified\",\"chinese_traditional\"],\"砍\":[\"chinese_simplified\",\"chinese_traditional\"],\"霞\":[\"chinese_simplified\",\"chinese_traditional\"],\"邵\":[\"chinese_simplified\",\"chinese_traditional\"],\"萄\":[\"chinese_simplified\",\"chinese_traditional\"],\"疯\":[\"chinese_simplified\"],\"淮\":[\"chinese_simplified\",\"chinese_traditional\"],\"遂\":[\"chinese_simplified\",\"chinese_traditional\"],\"熊\":[\"chinese_simplified\",\"chinese_traditional\"],\"粪\":[\"chinese_simplified\"],\"烘\":[\"chinese_simplified\",\"chinese_traditional\"],\"宿\":[\"chinese_simplified\",\"chinese_traditional\"],\"档\":[\"chinese_simplified\"],\"戈\":[\"chinese_simplified\",\"chinese_traditional\"],\"驳\":[\"chinese_simplified\"],\"嫂\":[\"chinese_simplified\",\"chinese_traditional\"],\"裕\":[\"chinese_simplified\",\"chinese_traditional\"],\"徙\":[\"chinese_simplified\",\"chinese_traditional\"],\"箭\":[\"chinese_simplified\",\"chinese_traditional\"],\"捐\":[\"chinese_simplified\",\"chinese_traditional\"],\"肠\":[\"chinese_simplified\"],\"撑\":[\"chinese_simplified\"],\"晒\":[\"chinese_simplified\"],\"辨\":[\"chinese_simplified\",\"chinese_traditional\"],\"殿\":[\"chinese_simplified\",\"chinese_traditional\"],\"莲\":[\"chinese_simplified\"],\"摊\":[\"chinese_simplified\"],\"搅\":[\"chinese_simplified\"],\"酱\":[\"chinese_simplified\"],\"屏\":[\"chinese_simplified\",\"chinese_traditional\"],\"疫\":[\"chinese_simplified\",\"chinese_traditional\"],\"哀\":[\"chinese_simplified\",\"chinese_traditional\"],\"蔡\":[\"chinese_simplified\",\"chinese_traditional\"],\"堵\":[\"chinese_simplified\",\"chinese_traditional\"],\"沫\":[\"chinese_simplified\",\"chinese_traditional\"],\"皱\":[\"chinese_simplified\"],\"畅\":[\"chinese_simplified\"],\"叠\":[\"chinese_simplified\"],\"阁\":[\"chinese_simplified\"],\"莱\":[\"chinese_simplified\"],\"敲\":[\"chinese_simplified\",\"chinese_traditional\"],\"辖\":[\"chinese_simplified\"],\"钩\":[\"chinese_simplified\"],\"痕\":[\"chinese_simplified\",\"chinese_traditional\"],\"坝\":[\"chinese_simplified\"],\"巷\":[\"chinese_simplified\",\"chinese_traditional\"],\"饿\":[\"chinese_simplified\"],\"祸\":[\"chinese_simplified\"],\"丘\":[\"chinese_simplified\",\"chinese_traditional\"],\"玄\":[\"chinese_simplified\",\"chinese_traditional\"],\"溜\":[\"chinese_simplified\",\"chinese_traditional\"],\"曰\":[\"chinese_simplified\",\"chinese_traditional\"],\"逻\":[\"chinese_simplified\"],\"彭\":[\"chinese_simplified\",\"chinese_traditional\"],\"尝\":[\"chinese_simplified\"],\"卿\":[\"chinese_simplified\",\"chinese_traditional\"],\"妨\":[\"chinese_simplified\",\"chinese_traditional\"],\"艇\":[\"chinese_simplified\",\"chinese_traditional\"],\"吞\":[\"chinese_simplified\",\"chinese_traditional\"],\"韦\":[\"chinese_simplified\"],\"怨\":[\"chinese_simplified\",\"chinese_traditional\"],\"矮\":[\"chinese_simplified\",\"chinese_traditional\"],\"歇\":[\"chinese_simplified\",\"chinese_traditional\"],\"這\":[\"chinese_traditional\"],\"為\":[\"chinese_traditional\"],\"個\":[\"chinese_traditional\"],\"國\":[\"chinese_traditional\"],\"時\":[\"chinese_traditional\"],\"來\":[\"chinese_traditional\"],\"們\":[\"chinese_traditional\"],\"於\":[\"chinese_traditional\"],\"對\":[\"chinese_traditional\"],\"會\":[\"chinese_traditional\"],\"發\":[\"chinese_traditional\"],\"動\":[\"chinese_traditional\"],\"過\":[\"chinese_traditional\"],\"說\":[\"chinese_traditional\"],\"產\":[\"chinese_traditional\"],\"種\":[\"chinese_traditional\"],\"後\":[\"chinese_traditional\"],\"學\":[\"chinese_traditional\"],\"經\":[\"chinese_traditional\"],\"進\":[\"chinese_traditional\"],\"著\":[\"chinese_traditional\"],\"電\":[\"chinese_traditional\"],\"裡\":[\"chinese_traditional\"],\"現\":[\"chinese_traditional\"],\"實\":[\"chinese_traditional\"],\"兩\":[\"chinese_traditional\"],\"體\":[\"chinese_traditional\"],\"機\":[\"chinese_traditional\"],\"當\":[\"chinese_traditional\"],\"點\":[\"chinese_traditional\"],\"從\":[\"chinese_traditional\"],\"業\":[\"chinese_traditional\"],\"應\":[\"chinese_traditional\"],\"開\":[\"chinese_traditional\"],\"還\":[\"chinese_traditional\"],\"義\":[\"chinese_traditional\"],\"間\":[\"chinese_traditional\"],\"樣\":[\"chinese_traditional\"],\"與\":[\"chinese_traditional\"],\"關\":[\"chinese_traditional\"],\"線\":[\"chinese_traditional\"],\"內\":[\"chinese_traditional\"],\"數\":[\"chinese_traditional\"],\"麼\":[\"chinese_traditional\"],\"質\":[\"chinese_traditional\"],\"氣\":[\"chinese_traditional\"],\"變\":[\"chinese_traditional\"],\"條\":[\"chinese_traditional\"],\"沒\":[\"chinese_traditional\"],\"結\":[\"chinese_traditional\"],\"問\":[\"chinese_traditional\"],\"無\":[\"chinese_traditional\"],\"軍\":[\"chinese_traditional\"],\"並\":[\"chinese_traditional\"],\"題\":[\"chinese_traditional\"],\"黨\":[\"chinese_traditional\"],\"員\":[\"chinese_traditional\"],\"總\":[\"chinese_traditional\"],\"設\":[\"chinese_traditional\"],\"長\":[\"chinese_traditional\"],\"頭\":[\"chinese_traditional\"],\"資\":[\"chinese_traditional\"],\"邊\":[\"chinese_traditional\"],\"級\":[\"chinese_traditional\"],\"圖\":[\"chinese_traditional\"],\"統\":[\"chinese_traditional\"],\"較\":[\"chinese_traditional\"],\"將\":[\"chinese_traditional\"],\"組\":[\"chinese_traditional\"],\"見\":[\"chinese_traditional\"],\"計\":[\"chinese_traditional\"],\"別\":[\"chinese_traditional\"],\"論\":[\"chinese_traditional\"],\"運\":[\"chinese_traditional\"],\"農\":[\"chinese_traditional\"],\"幾\":[\"chinese_traditional\"],\"區\":[\"chinese_traditional\"],\"強\":[\"chinese_traditional\"],\"決\":[\"chinese_traditional\"],\"幹\":[\"chinese_traditional\"],\"戰\":[\"chinese_traditional\"],\"則\":[\"chinese_traditional\"],\"據\":[\"chinese_traditional\"],\"處\":[\"chinese_traditional\"],\"隊\":[\"chinese_traditional\"],\"給\":[\"chinese_traditional\"],\"門\":[\"chinese_traditional\"],\"規\":[\"chinese_traditional\"],\"熱\":[\"chinese_traditional\"],\"領\":[\"chinese_traditional\"],\"東\":[\"chinese_traditional\"],\"導\":[\"chinese_traditional\"],\"壓\":[\"chinese_traditional\"],\"爭\":[\"chinese_traditional\"],\"濟\":[\"chinese_traditional\"],\"階\":[\"chinese_traditional\"],\"術\":[\"chinese_traditional\"],\"極\":[\"chinese_traditional\"],\"聯\":[\"chinese_traditional\"],\"認\":[\"chinese_traditional\"],\"權\":[\"chinese_traditional\"],\"證\":[\"chinese_traditional\"],\"採\":[\"chinese_traditional\"],\"轉\":[\"chinese_traditional\"],\"單\":[\"chinese_traditional\"],\"風\":[\"chinese_traditional\"],\"帶\":[\"chinese_traditional\"],\"場\":[\"chinese_traditional\"],\"車\":[\"chinese_traditional\"],\"務\":[\"chinese_traditional\"],\"萬\":[\"chinese_traditional\"],\"達\":[\"chinese_traditional\"],\"積\":[\"chinese_traditional\"],\"議\":[\"chinese_traditional\"],\"聲\":[\"chinese_traditional\"],\"報\":[\"chinese_traditional\"],\"鬥\":[\"chinese_traditional\"],\"類\":[\"chinese_traditional\"],\"離\":[\"chinese_traditional\"],\"華\":[\"chinese_traditional\"],\"確\":[\"chinese_traditional\"],\"張\":[\"chinese_traditional\"],\"馬\":[\"chinese_traditional\"],\"節\":[\"chinese_traditional\"],\"話\":[\"chinese_traditional\"],\"況\":[\"chinese_traditional\"],\"溫\":[\"chinese_traditional\"],\"傳\":[\"chinese_traditional\"],\"許\":[\"chinese_traditional\"],\"廣\":[\"chinese_traditional\"],\"記\":[\"chinese_traditional\"],\"觀\":[\"chinese_traditional\"],\"織\":[\"chinese_traditional\"],\"裝\":[\"chinese_traditional\"],\"眾\":[\"chinese_traditional\"],\"書\":[\"chinese_traditional\"],\"兒\":[\"chinese_traditional\"],\"須\":[\"chinese_traditional\"],\"際\":[\"chinese_traditional\"],\"驗\":[\"chinese_traditional\"],\"連\":[\"chinese_traditional\"],\"斷\":[\"chinese_traditional\"],\"難\":[\"chinese_traditional\"],\"礦\":[\"chinese_traditional\"],\"週\":[\"chinese_traditional\"],\"備\":[\"chinese_traditional\"],\"辦\":[\"chinese_traditional\"],\"習\":[\"chinese_traditional\"],\"響\":[\"chinese_traditional\"],\"約\":[\"chinese_traditional\"],\"勞\":[\"chinese_traditional\"],\"團\":[\"chinese_traditional\"],\"歷\":[\"chinese_traditional\"],\"構\":[\"chinese_traditional\"],\"稱\":[\"chinese_traditional\"],\"準\":[\"chinese_traditional\"],\"號\":[\"chinese_traditional\"],\"維\":[\"chinese_traditional\"],\"劃\":[\"chinese_traditional\"],\"選\":[\"chinese_traditional\"],\"標\":[\"chinese_traditional\"],\"寫\":[\"chinese_traditional\"],\"親\":[\"chinese_traditional\"],\"養\":[\"chinese_traditional\"],\"層\":[\"chinese_traditional\"],\"卻\":[\"chinese_traditional\"],\"專\":[\"chinese_traditional\"],\"狀\":[\"chinese_traditional\"],\"廠\":[\"chinese_traditional\"],\"識\":[\"chinese_traditional\"],\"適\":[\"chinese_traditional\"],\"屬\":[\"chinese_traditional\"],\"圓\":[\"chinese_traditional\"],\"調\":[\"chinese_traditional\"],\"滿\":[\"chinese_traditional\"],\"縣\":[\"chinese_traditional\"],\"參\":[\"chinese_traditional\"],\"紅\":[\"chinese_traditional\"],\"細\":[\"chinese_traditional\"],\"聽\":[\"chinese_traditional\"],\"該\":[\"chinese_traditional\"],\"鐵\":[\"chinese_traditional\"],\"價\":[\"chinese_traditional\"],\"嚴\":[\"chinese_traditional\"],\"隨\":[\"chinese_traditional\"],\"蘇\":[\"chinese_traditional\"],\"爾\":[\"chinese_traditional\"],\"講\":[\"chinese_traditional\"],\"黃\":[\"chinese_traditional\"],\"顯\":[\"chinese_traditional\"],\"談\":[\"chinese_traditional\"],\"藝\":[\"chinese_traditional\"],\"營\":[\"chinese_traditional\"],\"項\":[\"chinese_traditional\"],\"舉\":[\"chinese_traditional\"],\"勢\":[\"chinese_traditional\"],\"幫\":[\"chinese_traditional\"],\"輪\":[\"chinese_traditional\"],\"亞\":[\"chinese_traditional\"],\"師\":[\"chinese_traditional\"],\"圍\":[\"chinese_traditional\"],\"遠\":[\"chinese_traditional\"],\"態\":[\"chinese_traditional\"],\"減\":[\"chinese_traditional\"],\"樹\":[\"chinese_traditional\"],\"葉\":[\"chinese_traditional\"],\"魚\":[\"chinese_traditional\"],\"視\":[\"chinese_traditional\"],\"僅\":[\"chinese_traditional\"],\"費\":[\"chinese_traditional\"],\"緊\":[\"chinese_traditional\"],\"愛\":[\"chinese_traditional\"],\"續\":[\"chinese_traditional\"],\"輕\":[\"chinese_traditional\"],\"試\":[\"chinese_traditional\"],\"護\":[\"chinese_traditional\"],\"練\":[\"chinese_traditional\"],\"負\":[\"chinese_traditional\"],\"擊\":[\"chinese_traditional\"],\"繼\":[\"chinese_traditional\"],\"興\":[\"chinese_traditional\"],\"餘\":[\"chinese_traditional\"],\"堅\":[\"chinese_traditional\"],\"輸\":[\"chinese_traditional\"],\"夠\":[\"chinese_traditional\"],\"筆\":[\"chinese_traditional\"],\"佔\":[\"chinese_traditional\"],\"財\":[\"chinese_traditional\"],\"職\":[\"chinese_traditional\"],\"覺\":[\"chinese_traditional\"],\"漢\":[\"chinese_traditional\"],\"畫\":[\"chinese_traditional\"],\"雖\":[\"chinese_traditional\"],\"雜\":[\"chinese_traditional\"],\"飛\":[\"chinese_traditional\"],\"檢\":[\"chinese_traditional\"],\"昇\":[\"chinese_traditional\"],\"陽\":[\"chinese_traditional\"],\"創\":[\"chinese_traditional\"],\"壞\":[\"chinese_traditional\"],\"徑\":[\"chinese_traditional\"],\"換\":[\"chinese_traditional\"],\"鋼\":[\"chinese_traditional\"],\"責\":[\"chinese_traditional\"],\"簡\":[\"chinese_traditional\"],\"錢\":[\"chinese_traditional\"],\"盡\":[\"chinese_traditional\"],\"衝\":[\"chinese_traditional\"],\"獨\":[\"chinese_traditional\"],\"環\":[\"chinese_traditional\"],\"雙\":[\"chinese_traditional\"],\"請\":[\"chinese_traditional\"],\"讓\":[\"chinese_traditional\"],\"軸\":[\"chinese_traditional\"],\"紀\":[\"chinese_traditional\"],\"優\":[\"chinese_traditional\"],\"頂\":[\"chinese_traditional\"],\"礎\":[\"chinese_traditional\"],\"載\":[\"chinese_traditional\"],\"敵\":[\"chinese_traditional\"],\"勝\":[\"chinese_traditional\"],\"絕\":[\"chinese_traditional\"],\"塊\":[\"chinese_traditional\"],\"劑\":[\"chinese_traditional\"],\"測\":[\"chinese_traditional\"],\"絲\":[\"chinese_traditional\"],\"協\":[\"chinese_traditional\"],\"訴\":[\"chinese_traditional\"],\"陳\":[\"chinese_traditional\"],\"羅\":[\"chinese_traditional\"],\"鹽\":[\"chinese_traditional\"],\"錯\":[\"chinese_traditional\"],\"頻\":[\"chinese_traditional\"],\"終\":[\"chinese_traditional\"],\"雲\":[\"chinese_traditional\"],\"衛\":[\"chinese_traditional\"],\"燒\":[\"chinese_traditional\"],\"遊\":[\"chinese_traditional\"],\"舊\":[\"chinese_traditional\"],\"貨\":[\"chinese_traditional\"],\"損\":[\"chinese_traditional\"],\"預\":[\"chinese_traditional\"],\"穩\":[\"chinese_traditional\"],\"媽\":[\"chinese_traditional\"],\"擴\":[\"chinese_traditional\"],\"銀\":[\"chinese_traditional\"],\"語\":[\"chinese_traditional\"],\"揮\":[\"chinese_traditional\"],\"紙\":[\"chinese_traditional\"],\"醫\":[\"chinese_traditional\"],\"嗎\":[\"chinese_traditional\"],\"針\":[\"chinese_traditional\"],\"劉\":[\"chinese_traditional\"],\"誤\":[\"chinese_traditional\"],\"訓\":[\"chinese_traditional\"],\"願\":[\"chinese_traditional\"],\"審\":[\"chinese_traditional\"],\"獲\":[\"chinese_traditional\"],\"鮮\":[\"chinese_traditional\"],\"糧\":[\"chinese_traditional\"],\"脫\":[\"chinese_traditional\"],\"龍\":[\"chinese_traditional\"],\"漸\":[\"chinese_traditional\"],\"歡\":[\"chinese_traditional\"],\"剛\":[\"chinese_traditional\"],\"謂\":[\"chinese_traditional\"],\"討\":[\"chinese_traditional\"],\"亂\":[\"chinese_traditional\"],\"殺\":[\"chinese_traditional\"],\"藥\":[\"chinese_traditional\"],\"寧\":[\"chinese_traditional\"],\"魯\":[\"chinese_traditional\"],\"貴\":[\"chinese_traditional\"],\"鐘\":[\"chinese_traditional\"],\"讀\":[\"chinese_traditional\"],\"豐\":[\"chinese_traditional\"],\"蘭\":[\"chinese_traditional\"],\"擔\":[\"chinese_traditional\"],\"執\":[\"chinese_traditional\"],\"樂\":[\"chinese_traditional\"],\"誰\":[\"chinese_traditional\"],\"順\":[\"chinese_traditional\"],\"煙\":[\"chinese_traditional\"],\"縮\":[\"chinese_traditional\"],\"徵\":[\"chinese_traditional\"],\"臉\":[\"chinese_traditional\"],\"腳\":[\"chinese_traditional\"],\"異\":[\"chinese_traditional\"],\"買\":[\"chinese_traditional\"],\"靜\":[\"chinese_traditional\"],\"補\":[\"chinese_traditional\"],\"評\":[\"chinese_traditional\"],\"踐\":[\"chinese_traditional\"],\"寬\":[\"chinese_traditional\"],\"揚\":[\"chinese_traditional\"],\"傷\":[\"chinese_traditional\"],\"氫\":[\"chinese_traditional\"],\"憲\":[\"chinese_traditional\"],\"慶\":[\"chinese_traditional\"],\"編\":[\"chinese_traditional\"],\"觸\":[\"chinese_traditional\"],\"銷\":[\"chinese_traditional\"],\"詩\":[\"chinese_traditional\"],\"綠\":[\"chinese_traditional\"],\"雞\":[\"chinese_traditional\"],\"孫\":[\"chinese_traditional\"],\"膠\":[\"chinese_traditional\"],\"鄉\":[\"chinese_traditional\"],\"臨\":[\"chinese_traditional\"],\"陸\":[\"chinese_traditional\"],\"顧\":[\"chinese_traditional\"],\"燈\":[\"chinese_traditional\"],\"歲\":[\"chinese_traditional\"],\"劇\":[\"chinese_traditional\"],\"趙\":[\"chinese_traditional\"],\"課\":[\"chinese_traditional\"],\"凱\":[\"chinese_traditional\"],\"額\":[\"chinese_traditional\"],\"紹\":[\"chinese_traditional\"],\"齊\":[\"chinese_traditional\"],\"偉\":[\"chinese_traditional\"],\"爐\":[\"chinese_traditional\"],\"楊\":[\"chinese_traditional\"],\"桿\":[\"chinese_traditional\"],\"鎮\":[\"chinese_traditional\"],\"飯\":[\"chinese_traditional\"],\"濃\":[\"chinese_traditional\"],\"懷\":[\"chinese_traditional\"],\"趕\":[\"chinese_traditional\"],\"庫\":[\"chinese_traditional\"],\"奪\":[\"chinese_traditional\"],\"靈\":[\"chinese_traditional\"],\"稅\":[\"chinese_traditional\"],\"滅\":[\"chinese_traditional\"],\"賽\":[\"chinese_traditional\"],\"歸\":[\"chinese_traditional\"],\"盤\":[\"chinese_traditional\"],\"險\":[\"chinese_traditional\"],\"錄\":[\"chinese_traditional\"],\"純\":[\"chinese_traditional\"],\"蓋\":[\"chinese_traditional\"],\"橫\":[\"chinese_traditional\"],\"槍\":[\"chinese_traditional\"],\"潤\":[\"chinese_traditional\"],\"蟲\":[\"chinese_traditional\"],\"澤\":[\"chinese_traditional\"],\"腦\":[\"chinese_traditional\"],\"歐\":[\"chinese_traditional\"],\"側\":[\"chinese_traditional\"],\"徹\":[\"chinese_traditional\"],\"慮\":[\"chinese_traditional\"],\"納\":[\"chinese_traditional\"],\"彈\":[\"chinese_traditional\"],\"飼\":[\"chinese_traditional\"],\"麥\":[\"chinese_traditional\"],\"濕\":[\"chinese_traditional\"],\"築\":[\"chinese_traditional\"],\"惡\":[\"chinese_traditional\"],\"戶\":[\"chinese_traditional\"],\"訪\":[\"chinese_traditional\"],\"跡\":[\"chinese_traditional\"],\"擺\":[\"chinese_traditional\"],\"賣\":[\"chinese_traditional\"],\"擇\":[\"chinese_traditional\"],\"銅\":[\"chinese_traditional\"],\"獻\":[\"chinese_traditional\"],\"陣\":[\"chinese_traditional\"],\"陰\":[\"chinese_traditional\"],\"樓\":[\"chinese_traditional\"],\"謀\":[\"chinese_traditional\"],\"噸\":[\"chinese_traditional\"],\"豬\":[\"chinese_traditional\"],\"館\":[\"chinese_traditional\"],\"爺\":[\"chinese_traditional\"],\"驚\":[\"chinese_traditional\"],\"遺\":[\"chinese_traditional\"],\"纖\":[\"chinese_traditional\"],\"傾\":[\"chinese_traditional\"],\"謝\":[\"chinese_traditional\"],\"奮\":[\"chinese_traditional\"],\"購\":[\"chinese_traditional\"],\"監\":[\"chinese_traditional\"],\"貫\":[\"chinese_traditional\"],\"釋\":[\"chinese_traditional\"],\"詞\":[\"chinese_traditional\"],\"頓\":[\"chinese_traditional\"],\"寶\":[\"chinese_traditional\"],\"塵\":[\"chinese_traditional\"],\"聞\":[\"chinese_traditional\"],\"殘\":[\"chinese_traditional\"],\"橋\":[\"chinese_traditional\"],\"婦\":[\"chinese_traditional\"],\"綜\":[\"chinese_traditional\"],\"吳\":[\"chinese_traditional\"],\"搖\":[\"chinese_traditional\"],\"贊\":[\"chinese_traditional\"],\"訂\":[\"chinese_traditional\"],\"園\":[\"chinese_traditional\"],\"紛\":[\"chinese_traditional\"],\"敗\":[\"chinese_traditional\"],\"榮\":[\"chinese_traditional\"],\"閉\":[\"chinese_traditional\"],\"灣\":[\"chinese_traditional\"],\"鍵\":[\"chinese_traditional\"],\"駐\":[\"chinese_traditional\"],\"鍋\":[\"chinese_traditional\"],\"剝\":[\"chinese_traditional\"],\"鹼\":[\"chinese_traditional\"],\"齒\":[\"chinese_traditional\"],\"煉\":[\"chinese_traditional\"],\"紡\":[\"chinese_traditional\"],\"廢\":[\"chinese_traditional\"],\"緩\":[\"chinese_traditional\"],\"淨\":[\"chinese_traditional\"],\"莊\":[\"chinese_traditional\"],\"貿\":[\"chinese_traditional\"],\"慣\":[\"chinese_traditional\"],\"夥\":[\"chinese_traditional\"],\"勻\":[\"chinese_traditional\"],\"紗\":[\"chinese_traditional\"],\"辯\":[\"chinese_traditional\"],\"億\":[\"chinese_traditional\"],\"脈\":[\"chinese_traditional\"],\"薩\":[\"chinese_traditional\"],\"網\":[\"chinese_traditional\"],\"噴\":[\"chinese_traditional\"],\"縱\":[\"chinese_traditional\"],\"掛\":[\"chinese_traditional\"],\"賀\":[\"chinese_traditional\"],\"閃\":[\"chinese_traditional\"],\"牆\":[\"chinese_traditional\"],\"軟\":[\"chinese_traditional\"],\"滾\":[\"chinese_traditional\"],\"盪\":[\"chinese_traditional\"],\"儀\":[\"chinese_traditional\"],\"軋\":[\"chinese_traditional\"],\"貢\":[\"chinese_traditional\"],\"鑽\":[\"chinese_traditional\"],\"幣\":[\"chinese_traditional\"],\"軌\":[\"chinese_traditional\"],\"畝\":[\"chinese_traditional\"],\"畢\":[\"chinese_traditional\"],\"島\":[\"chinese_traditional\"],\"鑄\":[\"chinese_traditional\"],\"湯\":[\"chinese_traditional\"],\"閥\":[\"chinese_traditional\"],\"匯\":[\"chinese_traditional\"],\"繞\":[\"chinese_traditional\"],\"績\":[\"chinese_traditional\"],\"啟\":[\"chinese_traditional\"],\"顏\":[\"chinese_traditional\"],\"淚\":[\"chinese_traditional\"],\"藍\":[\"chinese_traditional\"],\"鏡\":[\"chinese_traditional\"],\"壯\":[\"chinese_traditional\"],\"鋒\":[\"chinese_traditional\"],\"貧\":[\"chinese_traditional\"],\"虛\":[\"chinese_traditional\"],\"彎\":[\"chinese_traditional\"],\"綱\":[\"chinese_traditional\"],\"隸\":[\"chinese_traditional\"],\"宮\":[\"chinese_traditional\"],\"違\":[\"chinese_traditional\"],\"夾\":[\"chinese_traditional\"],\"緣\":[\"chinese_traditional\"],\"窮\":[\"chinese_traditional\"],\"溝\":[\"chinese_traditional\"],\"繩\":[\"chinese_traditional\"],\"憶\":[\"chinese_traditional\"],\"漿\":[\"chinese_traditional\"],\"欄\":[\"chinese_traditional\"],\"擁\":[\"chinese_traditional\"],\"貯\":[\"chinese_traditional\"],\"禮\":[\"chinese_traditional\"],\"濾\":[\"chinese_traditional\"],\"鈉\":[\"chinese_traditional\"],\"紋\":[\"chinese_traditional\"],\"罷\":[\"chinese_traditional\"],\"罰\":[\"chinese_traditional\"],\"潛\":[\"chinese_traditional\"],\"縫\":[\"chinese_traditional\"],\"飽\":[\"chinese_traditional\"],\"獎\":[\"chinese_traditional\"],\"鋁\":[\"chinese_traditional\"],\"麗\":[\"chinese_traditional\"],\"鏈\":[\"chinese_traditional\"],\"掃\":[\"chinese_traditional\"],\"諸\":[\"chinese_traditional\"],\"勵\":[\"chinese_traditional\"],\"潔\":[\"chinese_traditional\"],\"災\":[\"chinese_traditional\"],\"鑑\":[\"chinese_traditional\"],\"訟\":[\"chinese_traditional\"],\"毀\":[\"chinese_traditional\"],\"屆\":[\"chinese_traditional\"],\"躍\":[\"chinese_traditional\"],\"艱\":[\"chinese_traditional\"],\"貝\":[\"chinese_traditional\"],\"碼\":[\"chinese_traditional\"],\"夢\":[\"chinese_traditional\"],\"漁\":[\"chinese_traditional\"],\"顆\":[\"chinese_traditional\"],\"鉛\":[\"chinese_traditional\"],\"倉\":[\"chinese_traditional\"],\"銳\":[\"chinese_traditional\"],\"曉\":[\"chinese_traditional\"],\"隱\":[\"chinese_traditional\"],\"礙\":[\"chinese_traditional\"],\"撥\":[\"chinese_traditional\"],\"肅\":[\"chinese_traditional\"],\"牽\":[\"chinese_traditional\"],\"搶\":[\"chinese_traditional\"],\"殼\":[\"chinese_traditional\"],\"訊\":[\"chinese_traditional\"],\"誠\":[\"chinese_traditional\"],\"頁\":[\"chinese_traditional\"],\"齡\":[\"chinese_traditional\"],\"倫\":[\"chinese_traditional\"],\"尋\":[\"chinese_traditional\"],\"鋪\":[\"chinese_traditional\"],\"聖\":[\"chinese_traditional\"],\"鄭\":[\"chinese_traditional\"],\"騰\":[\"chinese_traditional\"],\"貼\":[\"chinese_traditional\"],\"闊\":[\"chinese_traditional\"],\"輛\":[\"chinese_traditional\"],\"儲\":[\"chinese_traditional\"],\"簽\":[\"chinese_traditional\"],\"鬧\":[\"chinese_traditional\"],\"擾\":[\"chinese_traditional\"],\"遞\":[\"chinese_traditional\"],\"戲\":[\"chinese_traditional\"],\"餵\":[\"chinese_traditional\"],\"療\":[\"chinese_traditional\"],\"撫\":[\"chinese_traditional\"],\"蝦\":[\"chinese_traditional\"],\"蠟\":[\"chinese_traditional\"],\"鄰\":[\"chinese_traditional\"],\"鞏\":[\"chinese_traditional\"],\"擠\":[\"chinese_traditional\"],\"棄\":[\"chinese_traditional\"],\"勁\":[\"chinese_traditional\"],\"鄧\":[\"chinese_traditional\"],\"爛\":[\"chinese_traditional\"],\"磚\":[\"chinese_traditional\"],\"烏\":[\"chinese_traditional\"],\"艦\":[\"chinese_traditional\"],\"淺\":[\"chinese_traditional\"],\"暫\":[\"chinese_traditional\"],\"膽\":[\"chinese_traditional\"],\"詳\":[\"chinese_traditional\"],\"譜\":[\"chinese_traditional\"],\"賓\":[\"chinese_traditional\"],\"輝\":[\"chinese_traditional\"],\"憤\":[\"chinese_traditional\"],\"競\":[\"chinese_traditional\"],\"緒\":[\"chinese_traditional\"],\"塗\":[\"chinese_traditional\"],\"偵\":[\"chinese_traditional\"],\"懸\":[\"chinese_traditional\"],\"糾\":[\"chinese_traditional\"],\"鎖\":[\"chinese_traditional\"],\"賞\":[\"chinese_traditional\"],\"鴨\":[\"chinese_traditional\"],\"趨\":[\"chinese_traditional\"],\"鳳\":[\"chinese_traditional\"],\"輩\":[\"chinese_traditional\"],\"灘\":[\"chinese_traditional\"],\"驅\":[\"chinese_traditional\"],\"篩\":[\"chinese_traditional\"],\"峽\":[\"chinese_traditional\"],\"壽\":[\"chinese_traditional\"],\"譯\":[\"chinese_traditional\"],\"遲\":[\"chinese_traditional\"],\"矽\":[\"chinese_traditional\"],\"貸\":[\"chinese_traditional\"],\"脅\":[\"chinese_traditional\"],\"蝕\":[\"chinese_traditional\"],\"奧\":[\"chinese_traditional\"],\"鳴\":[\"chinese_traditional\"],\"嶺\":[\"chinese_traditional\"],\"憑\":[\"chinese_traditional\"],\"繪\":[\"chinese_traditional\"],\"錫\":[\"chinese_traditional\"],\"廟\":[\"chinese_traditional\"],\"籌\":[\"chinese_traditional\"],\"凍\":[\"chinese_traditional\"],\"輔\":[\"chinese_traditional\"],\"攝\":[\"chinese_traditional\"],\"襲\":[\"chinese_traditional\"],\"鉀\":[\"chinese_traditional\"],\"鳥\":[\"chinese_traditional\"],\"韓\":[\"chinese_traditional\"],\"僑\":[\"chinese_traditional\"],\"涼\":[\"chinese_traditional\"],\"餾\":[\"chinese_traditional\"],\"勸\":[\"chinese_traditional\"],\"遼\":[\"chinese_traditional\"],\"鴻\":[\"chinese_traditional\"],\"輥\":[\"chinese_traditional\"],\"飲\":[\"chinese_traditional\"],\"罵\":[\"chinese_traditional\"],\"辭\":[\"chinese_traditional\"],\"蔣\":[\"chinese_traditional\"],\"絨\":[\"chinese_traditional\"],\"霧\":[\"chinese_traditional\"],\"擬\":[\"chinese_traditional\"],\"輯\":[\"chinese_traditional\"],\"陝\":[\"chinese_traditional\"],\"償\":[\"chinese_traditional\"],\"廳\":[\"chinese_traditional\"],\"駛\":[\"chinese_traditional\"],\"賦\":[\"chinese_traditional\"],\"澆\":[\"chinese_traditional\"],\"鈣\":[\"chinese_traditional\"],\"虧\":[\"chinese_traditional\"],\"騙\":[\"chinese_traditional\"],\"脹\":[\"chinese_traditional\"],\"諧\":[\"chinese_traditional\"],\"拋\":[\"chinese_traditional\"],\"黴\":[\"chinese_traditional\"],\"崗\":[\"chinese_traditional\"],\"盜\":[\"chinese_traditional\"],\"滲\":[\"chinese_traditional\"],\"臟\":[\"chinese_traditional\"],\"賴\":[\"chinese_traditional\"],\"湧\":[\"chinese_traditional\"],\"閱\":[\"chinese_traditional\"],\"厲\":[\"chinese_traditional\"],\"烴\":[\"chinese_traditional\"],\"緯\":[\"chinese_traditional\"],\"偽\":[\"chinese_traditional\"],\"嘆\":[\"chinese_traditional\"],\"釘\":[\"chinese_traditional\"],\"莖\":[\"chinese_traditional\"],\"籠\":[\"chinese_traditional\"],\"錐\":[\"chinese_traditional\"],\"恆\":[\"chinese_traditional\"],\"傑\":[\"chinese_traditional\"],\"綸\":[\"chinese_traditional\"],\"敘\":[\"chinese_traditional\"],\"獄\":[\"chinese_traditional\"],\"絡\":[\"chinese_traditional\"],\"驟\":[\"chinese_traditional\"],\"冊\":[\"chinese_traditional\"],\"屍\":[\"chinese_traditional\"],\"紳\":[\"chinese_traditional\"],\"犧\":[\"chinese_traditional\"],\"轟\":[\"chinese_traditional\"],\"晉\":[\"chinese_traditional\"],\"禦\":[\"chinese_traditional\"],\"錠\":[\"chinese_traditional\"],\"錦\":[\"chinese_traditional\"],\"喪\":[\"chinese_traditional\"],\"鍛\":[\"chinese_traditional\"],\"壟\":[\"chinese_traditional\"],\"撲\":[\"chinese_traditional\"],\"邁\":[\"chinese_traditional\"],\"閒\":[\"chinese_traditional\"],\"憂\":[\"chinese_traditional\"],\"頑\":[\"chinese_traditional\"],\"漲\":[\"chinese_traditional\"],\"闢\":[\"chinese_traditional\"],\"懲\":[\"chinese_traditional\"],\"飄\":[\"chinese_traditional\"],\"飾\":[\"chinese_traditional\"],\"蕭\":[\"chinese_traditional\"],\"郵\":[\"chinese_traditional\"],\"遷\":[\"chinese_traditional\"],\"煩\":[\"chinese_traditional\"],\"債\":[\"chinese_traditional\"],\"帳\":[\"chinese_traditional\"],\"鈴\":[\"chinese_traditional\"],\"餅\":[\"chinese_traditional\"],\"雛\":[\"chinese_traditional\"],\"賢\":[\"chinese_traditional\"],\"丟\":[\"chinese_traditional\"],\"墊\":[\"chinese_traditional\"],\"擋\":[\"chinese_traditional\"],\"覽\":[\"chinese_traditional\"],\"貪\":[\"chinese_traditional\"],\"繳\":[\"chinese_traditional\"],\"馮\":[\"chinese_traditional\"],\"諾\":[\"chinese_traditional\"],\"誼\":[\"chinese_traditional\"],\"兇\":[\"chinese_traditional\"],\"誣\":[\"chinese_traditional\"],\"騎\":[\"chinese_traditional\"],\"喬\":[\"chinese_traditional\"],\"叢\":[\"chinese_traditional\"],\"盧\":[\"chinese_traditional\"],\"悶\":[\"chinese_traditional\"],\"諮\":[\"chinese_traditional\"],\"駕\":[\"chinese_traditional\"],\"纜\":[\"chinese_traditional\"],\"鉺\":[\"chinese_traditional\"],\"擲\":[\"chinese_traditional\"],\"頗\":[\"chinese_traditional\"],\"慘\":[\"chinese_traditional\"],\"臘\":[\"chinese_traditional\"],\"窩\":[\"chinese_traditional\"],\"滌\":[\"chinese_traditional\"],\"劍\":[\"chinese_traditional\"],\"潑\":[\"chinese_traditional\"],\"蔥\":[\"chinese_traditional\"],\"撈\":[\"chinese_traditional\"],\"蒼\":[\"chinese_traditional\"],\"濱\":[\"chinese_traditional\"],\"倆\":[\"chinese_traditional\"],\"瘋\":[\"chinese_traditional\"],\"糞\":[\"chinese_traditional\"],\"檔\":[\"chinese_traditional\"],\"駁\":[\"chinese_traditional\"],\"腸\":[\"chinese_traditional\"],\"撐\":[\"chinese_traditional\"],\"曬\":[\"chinese_traditional\"],\"蓮\":[\"chinese_traditional\"],\"攤\":[\"chinese_traditional\"],\"攪\":[\"chinese_traditional\"],\"醬\":[\"chinese_traditional\"],\"皺\":[\"chinese_traditional\"],\"暢\":[\"chinese_traditional\"],\"疊\":[\"chinese_traditional\"],\"閣\":[\"chinese_traditional\"],\"萊\":[\"chinese_traditional\"],\"轄\":[\"chinese_traditional\"],\"鉤\":[\"chinese_traditional\"],\"壩\":[\"chinese_traditional\"],\"餓\":[\"chinese_traditional\"],\"禍\":[\"chinese_traditional\"],\"邏\":[\"chinese_traditional\"],\"嘗\":[\"chinese_traditional\"],\"韋\":[\"chinese_traditional\"],\"abdikace\":[\"czech\"],\"abeceda\":[\"czech\"],\"adresa\":[\"czech\"],\"agrese\":[\"czech\"],\"akce\":[\"czech\"],\"aktovka\":[\"czech\"],\"alej\":[\"czech\"],\"alkohol\":[\"czech\"],\"amputace\":[\"czech\"],\"ananas\":[\"czech\"],\"andulka\":[\"czech\"],\"anekdota\":[\"czech\"],\"anketa\":[\"czech\"],\"antika\":[\"czech\"],\"anulovat\":[\"czech\"],\"archa\":[\"czech\"],\"arogance\":[\"czech\"],\"asfalt\":[\"czech\",\"turkish\"],\"asistent\":[\"czech\"],\"aspirace\":[\"czech\"],\"astma\":[\"czech\"],\"astronom\":[\"czech\"],\"atlas\":[\"czech\"],\"atletika\":[\"czech\"],\"atol\":[\"czech\"],\"autobus\":[\"czech\"],\"azyl\":[\"czech\"],\"babka\":[\"czech\"],\"bachor\":[\"czech\"],\"bacil\":[\"czech\"],\"baculka\":[\"czech\"],\"badatel\":[\"czech\"],\"bageta\":[\"czech\"],\"bagr\":[\"czech\"],\"bahno\":[\"czech\"],\"bakterie\":[\"czech\"],\"balada\":[\"czech\"],\"baletka\":[\"czech\"],\"balkon\":[\"czech\"],\"balonek\":[\"czech\"],\"balvan\":[\"czech\"],\"balza\":[\"czech\"],\"bambus\":[\"czech\"],\"bankomat\":[\"czech\"],\"barbar\":[\"czech\"],\"baret\":[\"czech\"],\"barman\":[\"czech\"],\"baroko\":[\"czech\"],\"barva\":[\"czech\"],\"baterka\":[\"czech\"],\"batoh\":[\"czech\"],\"bavlna\":[\"czech\"],\"bazalka\":[\"czech\"],\"bazilika\":[\"czech\"],\"bazuka\":[\"czech\"],\"bedna\":[\"czech\"],\"beran\":[\"czech\"],\"beseda\":[\"czech\"],\"bestie\":[\"czech\"],\"beton\":[\"czech\",\"turkish\"],\"bezinka\":[\"czech\"],\"bezmoc\":[\"czech\"],\"beztak\":[\"czech\"],\"bicykl\":[\"czech\"],\"bidlo\":[\"czech\"],\"biftek\":[\"czech\",\"turkish\"],\"bikiny\":[\"czech\"],\"bilance\":[\"czech\"],\"biograf\":[\"czech\"],\"biolog\":[\"czech\"],\"bitva\":[\"czech\"],\"bizon\":[\"czech\"],\"blahobyt\":[\"czech\"],\"blatouch\":[\"czech\"],\"blecha\":[\"czech\"],\"bledule\":[\"czech\"],\"blesk\":[\"czech\"],\"blikat\":[\"czech\"],\"blizna\":[\"czech\"],\"blokovat\":[\"czech\"],\"bloudit\":[\"czech\"],\"blud\":[\"czech\"],\"bobek\":[\"czech\"],\"bobr\":[\"czech\"],\"bodlina\":[\"czech\"],\"bodnout\":[\"czech\"],\"bohatost\":[\"czech\"],\"bojkot\":[\"czech\"],\"bojovat\":[\"czech\"],\"bokorys\":[\"czech\"],\"bolest\":[\"czech\"],\"borec\":[\"czech\"],\"borovice\":[\"czech\"],\"bota\":[\"czech\"],\"boubel\":[\"czech\"],\"bouchat\":[\"czech\"],\"bouda\":[\"czech\"],\"boule\":[\"czech\"],\"bourat\":[\"czech\"],\"boxer\":[\"czech\"],\"bradavka\":[\"czech\"],\"brambora\":[\"czech\"],\"branka\":[\"czech\"],\"bratr\":[\"czech\"],\"brepta\":[\"czech\"],\"briketa\":[\"czech\"],\"brko\":[\"czech\"],\"brloh\":[\"czech\"],\"bronz\":[\"czech\"],\"broskev\":[\"czech\"],\"brunetka\":[\"czech\"],\"brusinka\":[\"czech\"],\"brzda\":[\"czech\"],\"brzy\":[\"czech\"],\"bublina\":[\"czech\"],\"bubnovat\":[\"czech\"],\"buchta\":[\"czech\"],\"buditel\":[\"czech\"],\"budka\":[\"czech\"],\"budova\":[\"czech\"],\"bufet\":[\"czech\"],\"bujarost\":[\"czech\"],\"bukvice\":[\"czech\"],\"buldok\":[\"czech\"],\"bulva\":[\"czech\"],\"bunda\":[\"czech\"],\"bunkr\":[\"czech\"],\"burza\":[\"czech\"],\"butik\":[\"czech\",\"turkish\"],\"buvol\":[\"czech\"],\"buzola\":[\"czech\"],\"bydlet\":[\"czech\"],\"bylina\":[\"czech\"],\"bytovka\":[\"czech\"],\"bzukot\":[\"czech\"],\"capart\":[\"czech\"],\"carevna\":[\"czech\"],\"cedr\":[\"czech\"],\"cedule\":[\"czech\"],\"cejch\":[\"czech\"],\"cejn\":[\"czech\"],\"cela\":[\"czech\"],\"celer\":[\"czech\"],\"celkem\":[\"czech\"],\"celnice\":[\"czech\"],\"cenina\":[\"czech\"],\"cennost\":[\"czech\"],\"cenovka\":[\"czech\"],\"centrum\":[\"czech\"],\"cenzor\":[\"czech\"],\"cestopis\":[\"czech\"],\"cetka\":[\"czech\"],\"chalupa\":[\"czech\"],\"chapadlo\":[\"czech\"],\"charita\":[\"czech\"],\"chata\":[\"czech\"],\"chechtat\":[\"czech\"],\"chemie\":[\"czech\"],\"chichot\":[\"czech\"],\"chirurg\":[\"czech\"],\"chlad\":[\"czech\"],\"chleba\":[\"czech\"],\"chlubit\":[\"czech\"],\"chmel\":[\"czech\"],\"chmura\":[\"czech\"],\"chobot\":[\"czech\"],\"chochol\":[\"czech\"],\"chodba\":[\"czech\"],\"cholera\":[\"czech\"],\"chomout\":[\"czech\"],\"chopit\":[\"czech\"],\"choroba\":[\"czech\"],\"chov\":[\"czech\"],\"chrapot\":[\"czech\"],\"chrlit\":[\"czech\"],\"chrt\":[\"czech\"],\"chrup\":[\"czech\"],\"chtivost\":[\"czech\"],\"chudina\":[\"czech\"],\"chutnat\":[\"czech\"],\"chvat\":[\"czech\"],\"chvilka\":[\"czech\"],\"chvost\":[\"czech\"],\"chyba\":[\"czech\"],\"chystat\":[\"czech\"],\"chytit\":[\"czech\"],\"cibule\":[\"czech\"],\"cigareta\":[\"czech\"],\"cihelna\":[\"czech\"],\"cihla\":[\"czech\"],\"cinkot\":[\"czech\"],\"cirkus\":[\"czech\"],\"cisterna\":[\"czech\"],\"citace\":[\"czech\"],\"citrus\":[\"czech\"],\"cizinec\":[\"czech\"],\"cizost\":[\"czech\"],\"clona\":[\"czech\"],\"cokoliv\":[\"czech\"],\"couvat\":[\"czech\"],\"ctitel\":[\"czech\"],\"ctnost\":[\"czech\"],\"cudnost\":[\"czech\"],\"cuketa\":[\"czech\"],\"cukr\":[\"czech\"],\"cupot\":[\"czech\"],\"cvaknout\":[\"czech\"],\"cval\":[\"czech\"],\"cvik\":[\"czech\"],\"cvrkot\":[\"czech\"],\"cyklista\":[\"czech\"],\"daleko\":[\"czech\"],\"dareba\":[\"czech\"],\"datel\":[\"czech\"],\"datum\":[\"czech\"],\"dcera\":[\"czech\"],\"debata\":[\"czech\"],\"dechovka\":[\"czech\"],\"decibel\":[\"czech\"],\"deficit\":[\"czech\"],\"deflace\":[\"czech\"],\"dekl\":[\"czech\"],\"dekret\":[\"czech\"],\"demokrat\":[\"czech\"],\"deprese\":[\"czech\"],\"derby\":[\"czech\"],\"deska\":[\"czech\"],\"detektiv\":[\"czech\"],\"dikobraz\":[\"czech\"],\"diktovat\":[\"czech\"],\"dioda\":[\"czech\"],\"diplom\":[\"czech\"],\"disk\":[\"czech\",\"turkish\"],\"displej\":[\"czech\"],\"divadlo\":[\"czech\"],\"divoch\":[\"czech\"],\"dlaha\":[\"czech\"],\"dlouho\":[\"czech\"],\"dluhopis\":[\"czech\"],\"dnes\":[\"czech\"],\"dobro\":[\"czech\"],\"dobytek\":[\"czech\"],\"docent\":[\"czech\"],\"dochutit\":[\"czech\"],\"dodnes\":[\"czech\"],\"dohled\":[\"czech\"],\"dohoda\":[\"czech\"],\"dohra\":[\"czech\"],\"dojem\":[\"czech\"],\"dojnice\":[\"czech\"],\"doklad\":[\"czech\"],\"dokola\":[\"czech\"],\"doktor\":[\"czech\",\"turkish\"],\"dokument\":[\"czech\"],\"dolar\":[\"czech\"],\"doleva\":[\"czech\"],\"dolina\":[\"czech\"],\"doma\":[\"czech\"],\"dominant\":[\"czech\"],\"domluvit\":[\"czech\"],\"domov\":[\"czech\"],\"donutit\":[\"czech\"],\"dopad\":[\"czech\"],\"dopis\":[\"czech\"],\"doplnit\":[\"czech\"],\"doposud\":[\"czech\"],\"doprovod\":[\"czech\"],\"dopustit\":[\"czech\"],\"dorazit\":[\"czech\"],\"dorost\":[\"czech\"],\"dort\":[\"czech\"],\"dosah\":[\"czech\"],\"doslov\":[\"czech\"],\"dostatek\":[\"czech\"],\"dosud\":[\"czech\"],\"dosyta\":[\"czech\"],\"dotaz\":[\"czech\"],\"dotek\":[\"czech\"],\"dotknout\":[\"czech\"],\"doufat\":[\"czech\"],\"doutnat\":[\"czech\"],\"dovozce\":[\"czech\"],\"dozadu\":[\"czech\"],\"doznat\":[\"czech\"],\"dozorce\":[\"czech\"],\"drahota\":[\"czech\"],\"drak\":[\"czech\"],\"dramatik\":[\"czech\"],\"dravec\":[\"czech\"],\"draze\":[\"czech\"],\"drdol\":[\"czech\"],\"drobnost\":[\"czech\"],\"drogerie\":[\"czech\"],\"drozd\":[\"czech\"],\"drsnost\":[\"czech\"],\"drtit\":[\"czech\"],\"drzost\":[\"czech\"],\"duben\":[\"czech\"],\"duchovno\":[\"czech\"],\"dudek\":[\"czech\"],\"duha\":[\"czech\"],\"duhovka\":[\"czech\"],\"dusit\":[\"czech\"],\"dusno\":[\"czech\"],\"dutost\":[\"czech\"],\"dvojice\":[\"czech\"],\"dvorec\":[\"czech\"],\"dynamit\":[\"czech\"],\"ekolog\":[\"czech\"],\"ekonomie\":[\"czech\"],\"elektron\":[\"czech\"],\"elipsa\":[\"czech\"],\"email\":[\"czech\"],\"emise\":[\"czech\"],\"emoce\":[\"czech\"],\"empatie\":[\"czech\"],\"epizoda\":[\"czech\"],\"epocha\":[\"czech\"],\"epopej\":[\"czech\"],\"epos\":[\"czech\"],\"esej\":[\"czech\"],\"esence\":[\"czech\"],\"eskorta\":[\"czech\"],\"eskymo\":[\"czech\"],\"etiketa\":[\"czech\"],\"euforie\":[\"czech\"],\"evoluce\":[\"czech\"],\"exekuce\":[\"czech\"],\"exkurze\":[\"czech\"],\"expedice\":[\"czech\"],\"exploze\":[\"czech\"],\"export\":[\"czech\"],\"extrakt\":[\"czech\"],\"facka\":[\"czech\"],\"fajfka\":[\"czech\"],\"fakulta\":[\"czech\"],\"fanatik\":[\"czech\",\"turkish\"],\"fantazie\":[\"czech\"],\"farmacie\":[\"czech\"],\"favorit\":[\"czech\"],\"fazole\":[\"czech\"],\"federace\":[\"czech\"],\"fejeton\":[\"czech\"],\"fenka\":[\"czech\"],\"fialka\":[\"czech\"],\"figurant\":[\"czech\"],\"filozof\":[\"czech\"],\"filtr\":[\"czech\"],\"finance\":[\"czech\"],\"finta\":[\"czech\"],\"fixace\":[\"czech\"],\"fjord\":[\"czech\"],\"flanel\":[\"czech\"],\"flirt\":[\"czech\"],\"flotila\":[\"czech\"],\"fond\":[\"czech\"],\"fosfor\":[\"czech\"],\"fotbal\":[\"czech\"],\"fotka\":[\"czech\"],\"foton\":[\"czech\"],\"frakce\":[\"czech\"],\"freska\":[\"czech\"],\"fronta\":[\"czech\"],\"fukar\":[\"czech\"],\"funkce\":[\"czech\"],\"fyzika\":[\"czech\"],\"galeje\":[\"czech\"],\"garant\":[\"czech\"],\"genetika\":[\"czech\"],\"geolog\":[\"czech\"],\"gilotina\":[\"czech\"],\"glazura\":[\"czech\"],\"glejt\":[\"czech\"],\"golem\":[\"czech\"],\"golfista\":[\"czech\"],\"gotika\":[\"czech\"],\"graf\":[\"czech\"],\"gramofon\":[\"czech\"],\"granule\":[\"czech\"],\"grep\":[\"czech\"],\"gril\":[\"czech\"],\"grog\":[\"czech\"],\"groteska\":[\"czech\"],\"guma\":[\"czech\"],\"hadice\":[\"czech\"],\"hadr\":[\"czech\"],\"hala\":[\"czech\"],\"halenka\":[\"czech\"],\"hanba\":[\"czech\"],\"hanopis\":[\"czech\"],\"harfa\":[\"czech\"],\"harpuna\":[\"czech\"],\"havran\":[\"czech\"],\"hebkost\":[\"czech\"],\"hejkal\":[\"czech\"],\"hejno\":[\"czech\"],\"hejtman\":[\"czech\"],\"hektar\":[\"czech\",\"turkish\"],\"helma\":[\"czech\"],\"hematom\":[\"czech\"],\"herec\":[\"czech\"],\"herna\":[\"czech\"],\"heslo\":[\"czech\"],\"hezky\":[\"czech\"],\"historik\":[\"czech\"],\"hladovka\":[\"czech\"],\"hlasivky\":[\"czech\"],\"hlava\":[\"czech\"],\"hledat\":[\"czech\"],\"hlen\":[\"czech\"],\"hlodavec\":[\"czech\"],\"hloh\":[\"czech\"],\"hloupost\":[\"czech\"],\"hltat\":[\"czech\"],\"hlubina\":[\"czech\"],\"hluchota\":[\"czech\"],\"hmat\":[\"czech\"],\"hmota\":[\"czech\"],\"hmyz\":[\"czech\"],\"hnis\":[\"czech\"],\"hnojivo\":[\"czech\"],\"hnout\":[\"czech\"],\"hoblina\":[\"czech\"],\"hoboj\":[\"czech\"],\"hoch\":[\"czech\"],\"hodiny\":[\"czech\"],\"hodlat\":[\"czech\"],\"hodnota\":[\"czech\"],\"hodovat\":[\"czech\"],\"hojnost\":[\"czech\"],\"hokej\":[\"czech\"],\"holinka\":[\"czech\"],\"holka\":[\"czech\"],\"holub\":[\"czech\"],\"homole\":[\"czech\"],\"honitba\":[\"czech\"],\"honorace\":[\"czech\"],\"horal\":[\"czech\"],\"horda\":[\"czech\"],\"horizont\":[\"czech\"],\"horko\":[\"czech\"],\"horlivec\":[\"czech\"],\"hormon\":[\"czech\",\"turkish\"],\"hornina\":[\"czech\"],\"horoskop\":[\"czech\"],\"horstvo\":[\"czech\"],\"hospoda\":[\"czech\"],\"hostina\":[\"czech\"],\"hotovost\":[\"czech\"],\"houba\":[\"czech\"],\"houf\":[\"czech\"],\"houpat\":[\"czech\"],\"houska\":[\"czech\"],\"hovor\":[\"czech\"],\"hradba\":[\"czech\"],\"hranice\":[\"czech\"],\"hravost\":[\"czech\"],\"hrazda\":[\"czech\"],\"hrbolek\":[\"czech\"],\"hrdina\":[\"czech\"],\"hrdlo\":[\"czech\"],\"hrdost\":[\"czech\"],\"hrnek\":[\"czech\"],\"hrobka\":[\"czech\"],\"hromada\":[\"czech\"],\"hrot\":[\"czech\"],\"hrouda\":[\"czech\"],\"hrozen\":[\"czech\"],\"hrstka\":[\"czech\"],\"hrubost\":[\"czech\"],\"hryzat\":[\"czech\"],\"hubenost\":[\"czech\"],\"hubnout\":[\"czech\"],\"hudba\":[\"czech\"],\"hukot\":[\"czech\"],\"humr\":[\"czech\"],\"husita\":[\"czech\"],\"hustota\":[\"czech\"],\"hvozd\":[\"czech\"],\"hybnost\":[\"czech\"],\"hydrant\":[\"czech\"],\"hygiena\":[\"czech\"],\"hymna\":[\"czech\"],\"hysterik\":[\"czech\"],\"idylka\":[\"czech\"],\"ihned\":[\"czech\"],\"ikona\":[\"czech\"],\"iluze\":[\"czech\"],\"imunita\":[\"czech\"],\"infekce\":[\"czech\"],\"inflace\":[\"czech\"],\"inkaso\":[\"czech\"],\"inovace\":[\"czech\"],\"inspekce\":[\"czech\"],\"internet\":[\"czech\"],\"invalida\":[\"czech\"],\"investor\":[\"czech\"],\"inzerce\":[\"czech\"],\"ironie\":[\"czech\"],\"jablko\":[\"czech\"],\"jachta\":[\"czech\"],\"jahoda\":[\"czech\"],\"jakmile\":[\"czech\"],\"jakost\":[\"czech\"],\"jalovec\":[\"czech\"],\"jantar\":[\"czech\"],\"jarmark\":[\"czech\"],\"jaro\":[\"czech\"],\"jasan\":[\"czech\"],\"jasno\":[\"czech\"],\"jatka\":[\"czech\"],\"javor\":[\"czech\"],\"jazyk\":[\"czech\"],\"jedinec\":[\"czech\"],\"jedle\":[\"czech\"],\"jednatel\":[\"czech\"],\"jehlan\":[\"czech\"],\"jekot\":[\"czech\"],\"jelen\":[\"czech\"],\"jelito\":[\"czech\"],\"jemnost\":[\"czech\"],\"jenom\":[\"czech\"],\"jepice\":[\"czech\"],\"jeseter\":[\"czech\"],\"jevit\":[\"czech\"],\"jezdec\":[\"czech\"],\"jezero\":[\"czech\"],\"jinak\":[\"czech\"],\"jindy\":[\"czech\"],\"jinoch\":[\"czech\"],\"jiskra\":[\"czech\"],\"jistota\":[\"czech\"],\"jitrnice\":[\"czech\"],\"jizva\":[\"czech\"],\"jmenovat\":[\"czech\"],\"jogurt\":[\"czech\"],\"jurta\":[\"czech\"],\"kabaret\":[\"czech\"],\"kabel\":[\"czech\"],\"kabinet\":[\"czech\"],\"kachna\":[\"czech\"],\"kadet\":[\"czech\"],\"kadidlo\":[\"czech\"],\"kahan\":[\"czech\"],\"kajak\":[\"czech\"],\"kajuta\":[\"czech\"],\"kakao\":[\"czech\"],\"kaktus\":[\"czech\"],\"kalamita\":[\"czech\"],\"kalhoty\":[\"czech\"],\"kalibr\":[\"czech\"],\"kalnost\":[\"czech\"],\"kamera\":[\"czech\"],\"kamkoliv\":[\"czech\"],\"kamna\":[\"czech\"],\"kanibal\":[\"czech\"],\"kanoe\":[\"czech\"],\"kantor\":[\"czech\"],\"kapalina\":[\"czech\"],\"kapela\":[\"czech\"],\"kapitola\":[\"czech\"],\"kapka\":[\"czech\"],\"kaple\":[\"czech\"],\"kapota\":[\"czech\"],\"kapr\":[\"czech\"],\"kapusta\":[\"czech\"],\"kapybara\":[\"czech\"],\"karamel\":[\"czech\"],\"karotka\":[\"czech\"],\"karton\":[\"czech\"],\"kasa\":[\"czech\"],\"katalog\":[\"czech\"],\"katedra\":[\"czech\"],\"kauce\":[\"czech\"],\"kauza\":[\"czech\"],\"kavalec\":[\"czech\"],\"kazajka\":[\"czech\"],\"kazeta\":[\"czech\"],\"kazivost\":[\"czech\"],\"kdekoliv\":[\"czech\"],\"kdesi\":[\"czech\"],\"kedluben\":[\"czech\"],\"kemp\":[\"czech\"],\"keramika\":[\"czech\"],\"kino\":[\"czech\"],\"klacek\":[\"czech\"],\"kladivo\":[\"czech\"],\"klam\":[\"czech\"],\"klapot\":[\"czech\"],\"klasika\":[\"czech\"],\"klaun\":[\"czech\"],\"klec\":[\"czech\"],\"klenba\":[\"czech\"],\"klepat\":[\"czech\"],\"klesnout\":[\"czech\"],\"klid\":[\"czech\"],\"klima\":[\"czech\"],\"klisna\":[\"czech\"],\"klobouk\":[\"czech\"],\"klokan\":[\"czech\"],\"klopa\":[\"czech\"],\"kloub\":[\"czech\"],\"klubovna\":[\"czech\"],\"klusat\":[\"czech\"],\"kluzkost\":[\"czech\"],\"kmen\":[\"czech\"],\"kmitat\":[\"czech\"],\"kmotr\":[\"czech\"],\"kniha\":[\"czech\"],\"knot\":[\"czech\"],\"koalice\":[\"czech\"],\"koberec\":[\"czech\"],\"kobka\":[\"czech\"],\"kobliha\":[\"czech\"],\"kobyla\":[\"czech\"],\"kocour\":[\"czech\"],\"kohout\":[\"czech\"],\"kojenec\":[\"czech\"],\"kokos\":[\"czech\"],\"koktejl\":[\"czech\"],\"kolaps\":[\"czech\"],\"koleda\":[\"czech\"],\"kolize\":[\"czech\"],\"kolo\":[\"czech\"],\"komando\":[\"czech\"],\"kometa\":[\"czech\"],\"komik\":[\"czech\"],\"komnata\":[\"czech\"],\"komora\":[\"czech\"],\"kompas\":[\"czech\"],\"komunita\":[\"czech\"],\"konat\":[\"czech\"],\"koncept\":[\"czech\"],\"kondice\":[\"czech\"],\"konec\":[\"czech\"],\"konfese\":[\"czech\"],\"kongres\":[\"czech\"],\"konina\":[\"czech\"],\"konkurs\":[\"czech\"],\"kontakt\":[\"czech\"],\"konzerva\":[\"czech\"],\"kopanec\":[\"czech\"],\"kopie\":[\"czech\"],\"kopnout\":[\"czech\"],\"koprovka\":[\"czech\"],\"korbel\":[\"czech\"],\"korektor\":[\"czech\"],\"kormidlo\":[\"czech\"],\"koroptev\":[\"czech\"],\"korpus\":[\"czech\"],\"koruna\":[\"czech\"],\"koryto\":[\"czech\"],\"korzet\":[\"czech\"],\"kosatec\":[\"czech\"],\"kostka\":[\"czech\"],\"kotel\":[\"czech\"],\"kotleta\":[\"czech\"],\"kotoul\":[\"czech\"],\"koukat\":[\"czech\"],\"koupelna\":[\"czech\"],\"kousek\":[\"czech\"],\"kouzlo\":[\"czech\"],\"kovboj\":[\"czech\"],\"koza\":[\"czech\"],\"kozoroh\":[\"czech\"],\"krabice\":[\"czech\"],\"krach\":[\"czech\"],\"krajina\":[\"czech\"],\"kralovat\":[\"czech\"],\"krasopis\":[\"czech\"],\"kravata\":[\"czech\"],\"kredit\":[\"czech\"],\"krejcar\":[\"czech\"],\"kresba\":[\"czech\"],\"kreveta\":[\"czech\"],\"kriket\":[\"czech\"],\"kritik\":[\"czech\"],\"krize\":[\"czech\"],\"krkavec\":[\"czech\"],\"krmelec\":[\"czech\"],\"krmivo\":[\"czech\"],\"krocan\":[\"czech\"],\"krok\":[\"czech\"],\"kronika\":[\"czech\"],\"kropit\":[\"czech\"],\"kroupa\":[\"czech\"],\"krovka\":[\"czech\"],\"krtek\":[\"czech\"],\"kruhadlo\":[\"czech\"],\"krupice\":[\"czech\"],\"krutost\":[\"czech\"],\"krvinka\":[\"czech\"],\"krychle\":[\"czech\"],\"krypta\":[\"czech\"],\"krystal\":[\"czech\"],\"kryt\":[\"czech\"],\"kudlanka\":[\"czech\"],\"kufr\":[\"czech\"],\"kujnost\":[\"czech\"],\"kukla\":[\"czech\"],\"kulajda\":[\"czech\"],\"kulich\":[\"czech\"],\"kulka\":[\"czech\"],\"kulomet\":[\"czech\"],\"kultura\":[\"czech\"],\"kuna\":[\"czech\"],\"kupodivu\":[\"czech\"],\"kurt\":[\"czech\"],\"kurzor\":[\"czech\"],\"kutil\":[\"czech\"],\"kvalita\":[\"czech\"],\"kvasinka\":[\"czech\"],\"kvestor\":[\"czech\"],\"kynolog\":[\"czech\"],\"kyselina\":[\"czech\"],\"kytara\":[\"czech\"],\"kytice\":[\"czech\"],\"kytka\":[\"czech\"],\"kytovec\":[\"czech\"],\"kyvadlo\":[\"czech\"],\"labrador\":[\"czech\"],\"lachtan\":[\"czech\"],\"ladnost\":[\"czech\"],\"laik\":[\"czech\"],\"lakomec\":[\"czech\"],\"lamela\":[\"czech\"],\"lampa\":[\"czech\"],\"lanovka\":[\"czech\"],\"lasice\":[\"czech\"],\"laso\":[\"czech\"],\"lastura\":[\"czech\"],\"latinka\":[\"czech\"],\"lavina\":[\"czech\"],\"lebka\":[\"czech\"],\"leckdy\":[\"czech\"],\"leden\":[\"czech\"],\"lednice\":[\"czech\"],\"ledovka\":[\"czech\"],\"ledvina\":[\"czech\"],\"legenda\":[\"czech\"],\"legie\":[\"czech\"],\"legrace\":[\"czech\"],\"lehce\":[\"czech\"],\"lehkost\":[\"czech\"],\"lehnout\":[\"czech\"],\"lektvar\":[\"czech\"],\"lenochod\":[\"czech\"],\"lentilka\":[\"czech\"],\"lepenka\":[\"czech\"],\"lepidlo\":[\"czech\"],\"letadlo\":[\"czech\"],\"letec\":[\"czech\"],\"letmo\":[\"czech\"],\"letokruh\":[\"czech\"],\"levhart\":[\"czech\"],\"levitace\":[\"czech\"],\"levobok\":[\"czech\"],\"libra\":[\"czech\"],\"lichotka\":[\"czech\"],\"lidojed\":[\"czech\"],\"lidskost\":[\"czech\"],\"lihovina\":[\"czech\"],\"lijavec\":[\"czech\"],\"lilek\":[\"czech\"],\"limetka\":[\"czech\"],\"linie\":[\"czech\"],\"linka\":[\"czech\"],\"linoleum\":[\"czech\"],\"listopad\":[\"czech\"],\"litina\":[\"czech\"],\"litovat\":[\"czech\"],\"lobista\":[\"czech\"],\"lodivod\":[\"czech\"],\"logika\":[\"czech\"],\"logoped\":[\"czech\"],\"lokalita\":[\"czech\"],\"loket\":[\"czech\"],\"lomcovat\":[\"czech\"],\"lopata\":[\"czech\"],\"lopuch\":[\"czech\"],\"lord\":[\"czech\"],\"losos\":[\"czech\"],\"lotr\":[\"czech\"],\"loudal\":[\"czech\"],\"louh\":[\"czech\"],\"louka\":[\"czech\"],\"louskat\":[\"czech\"],\"lovec\":[\"czech\"],\"lstivost\":[\"czech\"],\"lucerna\":[\"czech\"],\"lucifer\":[\"czech\"],\"lump\":[\"czech\"],\"lusk\":[\"czech\"],\"lustrace\":[\"czech\"],\"lvice\":[\"czech\"],\"lyra\":[\"czech\"],\"lyrika\":[\"czech\"],\"lysina\":[\"czech\"],\"madam\":[\"czech\"],\"madlo\":[\"czech\"],\"magistr\":[\"czech\"],\"mahagon\":[\"czech\"],\"majetek\":[\"czech\"],\"majitel\":[\"czech\"],\"majorita\":[\"czech\"],\"makak\":[\"czech\"],\"makovice\":[\"czech\"],\"makrela\":[\"czech\"],\"malba\":[\"czech\"],\"malina\":[\"czech\"],\"malovat\":[\"czech\"],\"malvice\":[\"czech\"],\"maminka\":[\"czech\"],\"mandle\":[\"czech\"],\"manko\":[\"czech\"],\"marnost\":[\"czech\"],\"masakr\":[\"czech\"],\"maskot\":[\"czech\"],\"masopust\":[\"czech\"],\"matice\":[\"czech\"],\"matrika\":[\"czech\"],\"maturita\":[\"czech\"],\"mazanec\":[\"czech\"],\"mazivo\":[\"czech\"],\"mazlit\":[\"czech\"],\"mazurka\":[\"czech\"],\"mdloba\":[\"czech\"],\"mechanik\":[\"czech\"],\"meditace\":[\"czech\"],\"medovina\":[\"czech\"],\"melasa\":[\"czech\"],\"meloun\":[\"czech\"],\"mentolka\":[\"czech\"],\"metla\":[\"czech\"],\"metoda\":[\"czech\"],\"metr\":[\"czech\"],\"mezera\":[\"czech\"],\"migrace\":[\"czech\"],\"mihnout\":[\"czech\"],\"mihule\":[\"czech\"],\"mikina\":[\"czech\"],\"mikrofon\":[\"czech\",\"turkish\"],\"milenec\":[\"czech\"],\"milimetr\":[\"czech\"],\"milost\":[\"czech\"],\"mimika\":[\"czech\"],\"mincovna\":[\"czech\"],\"minibar\":[\"czech\"],\"minomet\":[\"czech\"],\"minulost\":[\"czech\"],\"miska\":[\"czech\"],\"mistr\":[\"czech\"],\"mixovat\":[\"czech\"],\"mladost\":[\"czech\"],\"mlha\":[\"czech\"],\"mlhovina\":[\"czech\"],\"mlok\":[\"czech\"],\"mlsat\":[\"czech\"],\"mluvit\":[\"czech\"],\"mnich\":[\"czech\"],\"mnohem\":[\"czech\"],\"mobil\":[\"czech\"],\"mocnost\":[\"czech\"],\"modelka\":[\"czech\"],\"modlitba\":[\"czech\"],\"mohyla\":[\"czech\"],\"mokro\":[\"czech\"],\"molekula\":[\"czech\"],\"momentka\":[\"czech\"],\"monarcha\":[\"czech\"],\"monokl\":[\"czech\"],\"monstrum\":[\"czech\"],\"montovat\":[\"czech\"],\"monzun\":[\"czech\"],\"mosaz\":[\"czech\"],\"moskyt\":[\"czech\"],\"most\":[\"czech\"],\"motivace\":[\"czech\"],\"motorka\":[\"czech\"],\"motyka\":[\"czech\"],\"moucha\":[\"czech\"],\"moudrost\":[\"czech\"],\"mozaika\":[\"czech\"],\"mozek\":[\"czech\"],\"mozol\":[\"czech\"],\"mramor\":[\"czech\"],\"mravenec\":[\"czech\"],\"mrkev\":[\"czech\"],\"mrtvola\":[\"czech\"],\"mrzet\":[\"czech\"],\"mrzutost\":[\"czech\"],\"mstitel\":[\"czech\"],\"mudrc\":[\"czech\"],\"muflon\":[\"czech\"],\"mulat\":[\"czech\"],\"mumie\":[\"czech\"],\"munice\":[\"czech\"],\"muset\":[\"czech\"],\"mutace\":[\"czech\"],\"muzeum\":[\"czech\"],\"muzikant\":[\"czech\"],\"myslivec\":[\"czech\"],\"mzda\":[\"czech\"],\"nabourat\":[\"czech\"],\"nachytat\":[\"czech\"],\"nadace\":[\"czech\"],\"nadbytek\":[\"czech\"],\"nadhoz\":[\"czech\"],\"nadobro\":[\"czech\"],\"nadpis\":[\"czech\"],\"nahlas\":[\"czech\"],\"nahnat\":[\"czech\"],\"nahodile\":[\"czech\"],\"nahradit\":[\"czech\"],\"naivita\":[\"czech\"],\"najednou\":[\"czech\"],\"najisto\":[\"czech\"],\"najmout\":[\"czech\"],\"naklonit\":[\"czech\"],\"nakonec\":[\"czech\"],\"nakrmit\":[\"czech\"],\"nalevo\":[\"czech\"],\"namazat\":[\"czech\"],\"namluvit\":[\"czech\"],\"nanometr\":[\"czech\"],\"naoko\":[\"czech\"],\"naopak\":[\"czech\"],\"naostro\":[\"czech\"],\"napadat\":[\"czech\"],\"napevno\":[\"czech\"],\"naplnit\":[\"czech\"],\"napnout\":[\"czech\"],\"naposled\":[\"czech\"],\"naprosto\":[\"czech\"],\"narodit\":[\"czech\"],\"naruby\":[\"czech\"],\"narychlo\":[\"czech\"],\"nasadit\":[\"czech\"],\"nasekat\":[\"czech\"],\"naslepo\":[\"czech\"],\"nastat\":[\"czech\"],\"natolik\":[\"czech\"],\"navenek\":[\"czech\"],\"navrch\":[\"czech\"],\"navzdory\":[\"czech\"],\"nazvat\":[\"czech\"],\"nebe\":[\"czech\"],\"nechat\":[\"czech\"],\"necky\":[\"czech\"],\"nedaleko\":[\"czech\"],\"nedbat\":[\"czech\"],\"neduh\":[\"czech\"],\"negace\":[\"czech\"],\"nehet\":[\"czech\"],\"nehoda\":[\"czech\"],\"nejen\":[\"czech\"],\"nejprve\":[\"czech\"],\"neklid\":[\"czech\"],\"nelibost\":[\"czech\"],\"nemilost\":[\"czech\"],\"nemoc\":[\"czech\"],\"neochota\":[\"czech\"],\"neonka\":[\"czech\"],\"nepokoj\":[\"czech\"],\"nerost\":[\"czech\"],\"nerv\":[\"czech\"],\"nesmysl\":[\"czech\"],\"nesoulad\":[\"czech\"],\"netvor\":[\"czech\"],\"neuron\":[\"czech\"],\"nevina\":[\"czech\"],\"nezvykle\":[\"czech\"],\"nicota\":[\"czech\"],\"nijak\":[\"czech\"],\"nikam\":[\"czech\"],\"nikdy\":[\"czech\"],\"nikl\":[\"czech\"],\"nikterak\":[\"czech\"],\"nitro\":[\"czech\"],\"nocleh\":[\"czech\"],\"nohavice\":[\"czech\"],\"nominace\":[\"czech\"],\"nora\":[\"czech\"],\"norek\":[\"czech\"],\"nositel\":[\"czech\"],\"nosnost\":[\"czech\"],\"nouze\":[\"czech\"],\"noviny\":[\"czech\"],\"novota\":[\"czech\"],\"nozdra\":[\"czech\"],\"nuda\":[\"czech\"],\"nudle\":[\"czech\"],\"nuget\":[\"czech\"],\"nutit\":[\"czech\"],\"nutnost\":[\"czech\"],\"nutrie\":[\"czech\"],\"nymfa\":[\"czech\"],\"obal\":[\"czech\"],\"obarvit\":[\"czech\"],\"obava\":[\"czech\"],\"obdiv\":[\"czech\"],\"obec\":[\"czech\"],\"obehnat\":[\"czech\"],\"obejmout\":[\"czech\"],\"obezita\":[\"czech\"],\"obhajoba\":[\"czech\"],\"obilnice\":[\"czech\"],\"objasnit\":[\"czech\"],\"objekt\":[\"czech\"],\"obklopit\":[\"czech\"],\"oblast\":[\"czech\"],\"oblek\":[\"czech\"],\"obliba\":[\"czech\"],\"obloha\":[\"czech\"],\"obluda\":[\"czech\"],\"obnos\":[\"czech\"],\"obohatit\":[\"czech\"],\"obojek\":[\"czech\"],\"obout\":[\"czech\"],\"obrazec\":[\"czech\"],\"obrna\":[\"czech\"],\"obruba\":[\"czech\"],\"obrys\":[\"czech\"],\"obsah\":[\"czech\"],\"obsluha\":[\"czech\"],\"obstarat\":[\"czech\"],\"obuv\":[\"czech\"],\"obvaz\":[\"czech\"],\"obvinit\":[\"czech\"],\"obvod\":[\"czech\"],\"obvykle\":[\"czech\"],\"obyvatel\":[\"czech\"],\"obzor\":[\"czech\"],\"ocas\":[\"czech\"],\"ocel\":[\"czech\"],\"ocenit\":[\"czech\"],\"ochladit\":[\"czech\"],\"ochota\":[\"czech\"],\"ochrana\":[\"czech\"],\"ocitnout\":[\"czech\"],\"odboj\":[\"czech\"],\"odbyt\":[\"czech\"],\"odchod\":[\"czech\"],\"odcizit\":[\"czech\"],\"odebrat\":[\"czech\"],\"odeslat\":[\"czech\"],\"odevzdat\":[\"czech\"],\"odezva\":[\"czech\"],\"odhadce\":[\"czech\"],\"odhodit\":[\"czech\"],\"odjet\":[\"czech\"],\"odjinud\":[\"czech\"],\"odkaz\":[\"czech\"],\"odkoupit\":[\"czech\"],\"odliv\":[\"czech\"],\"odluka\":[\"czech\"],\"odmlka\":[\"czech\"],\"odolnost\":[\"czech\"],\"odpad\":[\"czech\"],\"odpis\":[\"czech\"],\"odplout\":[\"czech\"],\"odpor\":[\"czech\"],\"odpustit\":[\"czech\"],\"odpykat\":[\"czech\"],\"odrazka\":[\"czech\"],\"odsoudit\":[\"czech\"],\"odstup\":[\"czech\"],\"odsun\":[\"czech\"],\"odtok\":[\"czech\"],\"odtud\":[\"czech\"],\"odvaha\":[\"czech\"],\"odveta\":[\"czech\"],\"odvolat\":[\"czech\"],\"odvracet\":[\"czech\"],\"odznak\":[\"czech\"],\"ofina\":[\"czech\"],\"ofsajd\":[\"czech\"],\"ohlas\":[\"czech\"],\"ohnisko\":[\"czech\"],\"ohrada\":[\"czech\"],\"ohrozit\":[\"czech\"],\"ohryzek\":[\"czech\"],\"okap\":[\"czech\"],\"okenice\":[\"czech\"],\"oklika\":[\"czech\"],\"okno\":[\"czech\"],\"okouzlit\":[\"czech\"],\"okovy\":[\"czech\"],\"okrasa\":[\"czech\"],\"okres\":[\"czech\"],\"okrsek\":[\"czech\"],\"okruh\":[\"czech\"],\"okupant\":[\"czech\"],\"okurka\":[\"czech\"],\"okusit\":[\"czech\"],\"olejnina\":[\"czech\"],\"olizovat\":[\"czech\"],\"omak\":[\"czech\"],\"omeleta\":[\"czech\"],\"omezit\":[\"czech\"],\"omladina\":[\"czech\"],\"omlouvat\":[\"czech\"],\"omluva\":[\"czech\"],\"omyl\":[\"czech\"],\"onehdy\":[\"czech\"],\"opakovat\":[\"czech\"],\"opasek\":[\"czech\"],\"operace\":[\"czech\"],\"opice\":[\"czech\"],\"opilost\":[\"czech\"],\"opisovat\":[\"czech\"],\"opora\":[\"czech\"],\"opozice\":[\"czech\"],\"opravdu\":[\"czech\"],\"oproti\":[\"czech\"],\"orbital\":[\"czech\"],\"orchestr\":[\"czech\"],\"orgie\":[\"czech\"],\"orlice\":[\"czech\"],\"orloj\":[\"czech\"],\"ortel\":[\"czech\"],\"osada\":[\"czech\"],\"oschnout\":[\"czech\"],\"osika\":[\"czech\"],\"osivo\":[\"czech\"],\"oslava\":[\"czech\"],\"oslepit\":[\"czech\"],\"oslnit\":[\"czech\"],\"oslovit\":[\"czech\"],\"osnova\":[\"czech\"],\"osoba\":[\"czech\"],\"osolit\":[\"czech\"],\"ospalec\":[\"czech\"],\"osten\":[\"czech\"],\"ostraha\":[\"czech\"],\"ostuda\":[\"czech\"],\"ostych\":[\"czech\"],\"osvojit\":[\"czech\"],\"oteplit\":[\"czech\"],\"otisk\":[\"czech\"],\"otop\":[\"czech\"],\"otrhat\":[\"czech\"],\"otrlost\":[\"czech\"],\"otrok\":[\"czech\"],\"otruby\":[\"czech\"],\"otvor\":[\"czech\"],\"ovanout\":[\"czech\"],\"ovar\":[\"czech\"],\"oves\":[\"czech\"],\"ovlivnit\":[\"czech\"],\"ovoce\":[\"czech\"],\"oxid\":[\"czech\"],\"ozdoba\":[\"czech\"],\"pachatel\":[\"czech\"],\"pacient\":[\"czech\"],\"padouch\":[\"czech\"],\"pahorek\":[\"czech\"],\"pakt\":[\"czech\"],\"palanda\":[\"czech\"],\"palec\":[\"czech\"],\"palivo\":[\"czech\"],\"paluba\":[\"czech\"],\"pamflet\":[\"czech\"],\"pamlsek\":[\"czech\"],\"panenka\":[\"czech\"],\"panika\":[\"czech\"],\"panna\":[\"czech\"],\"panovat\":[\"czech\"],\"panstvo\":[\"czech\"],\"pantofle\":[\"czech\"],\"paprika\":[\"czech\"],\"parketa\":[\"czech\"],\"parodie\":[\"czech\"],\"parta\":[\"czech\"],\"paruka\":[\"czech\"],\"paryba\":[\"czech\"],\"paseka\":[\"czech\"],\"pasivita\":[\"czech\"],\"pastelka\":[\"czech\"],\"patent\":[\"czech\"],\"patrona\":[\"czech\"],\"pavouk\":[\"czech\"],\"pazneht\":[\"czech\"],\"pazourek\":[\"czech\"],\"pecka\":[\"czech\"],\"pedagog\":[\"czech\"],\"pejsek\":[\"czech\"],\"peklo\":[\"czech\"],\"peloton\":[\"czech\"],\"penalta\":[\"czech\"],\"pendrek\":[\"czech\"],\"penze\":[\"czech\"],\"periskop\":[\"czech\"],\"pero\":[\"czech\"],\"pestrost\":[\"czech\"],\"petarda\":[\"czech\"],\"petice\":[\"czech\"],\"petrolej\":[\"czech\"],\"pevnina\":[\"czech\"],\"pexeso\":[\"czech\"],\"pianista\":[\"czech\"],\"piha\":[\"czech\"],\"pijavice\":[\"czech\"],\"pikle\":[\"czech\"],\"piknik\":[\"czech\",\"turkish\"],\"pilina\":[\"czech\"],\"pilnost\":[\"czech\"],\"pilulka\":[\"czech\"],\"pinzeta\":[\"czech\"],\"pipeta\":[\"czech\"],\"pisatel\":[\"czech\"],\"pistole\":[\"czech\"],\"pitevna\":[\"czech\"],\"pivnice\":[\"czech\"],\"pivovar\":[\"czech\"],\"placenta\":[\"czech\"],\"plakat\":[\"czech\"],\"plamen\":[\"czech\"],\"planeta\":[\"czech\"],\"plastika\":[\"czech\"],\"platit\":[\"czech\"],\"plavidlo\":[\"czech\"],\"plaz\":[\"czech\"],\"plech\":[\"czech\"],\"plemeno\":[\"czech\"],\"plenta\":[\"czech\"],\"ples\":[\"czech\"],\"pletivo\":[\"czech\"],\"plevel\":[\"czech\"],\"plivat\":[\"czech\"],\"plnit\":[\"czech\"],\"plno\":[\"czech\"],\"plocha\":[\"czech\"],\"plodina\":[\"czech\"],\"plomba\":[\"czech\"],\"plout\":[\"czech\"],\"pluk\":[\"czech\"],\"plyn\":[\"czech\"],\"pobavit\":[\"czech\"],\"pobyt\":[\"czech\"],\"pochod\":[\"czech\"],\"pocit\":[\"czech\"],\"poctivec\":[\"czech\"],\"podat\":[\"czech\"],\"podcenit\":[\"czech\"],\"podepsat\":[\"czech\"],\"podhled\":[\"czech\"],\"podivit\":[\"czech\"],\"podklad\":[\"czech\"],\"podmanit\":[\"czech\"],\"podnik\":[\"czech\"],\"podoba\":[\"czech\"],\"podpora\":[\"czech\"],\"podraz\":[\"czech\"],\"podstata\":[\"czech\"],\"podvod\":[\"czech\"],\"podzim\":[\"czech\"],\"poezie\":[\"czech\"],\"pohanka\":[\"czech\"],\"pohnutka\":[\"czech\"],\"pohovor\":[\"czech\"],\"pohroma\":[\"czech\"],\"pohyb\":[\"czech\"],\"pointa\":[\"czech\"],\"pojistka\":[\"czech\"],\"pojmout\":[\"czech\"],\"pokazit\":[\"czech\"],\"pokles\":[\"czech\"],\"pokoj\":[\"czech\"],\"pokrok\":[\"czech\"],\"pokuta\":[\"czech\"],\"pokyn\":[\"czech\"],\"poledne\":[\"czech\"],\"polibek\":[\"czech\"],\"polknout\":[\"czech\"],\"poloha\":[\"czech\"],\"polynom\":[\"czech\"],\"pomalu\":[\"czech\"],\"pominout\":[\"czech\"],\"pomlka\":[\"czech\"],\"pomoc\":[\"czech\"],\"pomsta\":[\"czech\"],\"pomyslet\":[\"czech\"],\"ponechat\":[\"czech\"],\"ponorka\":[\"czech\"],\"ponurost\":[\"czech\"],\"popadat\":[\"czech\"],\"popel\":[\"czech\"],\"popisek\":[\"czech\"],\"poplach\":[\"czech\"],\"poprosit\":[\"czech\"],\"popsat\":[\"czech\"],\"popud\":[\"czech\"],\"poradce\":[\"czech\"],\"porce\":[\"czech\"],\"porod\":[\"czech\"],\"porucha\":[\"czech\"],\"poryv\":[\"czech\"],\"posadit\":[\"czech\"],\"posed\":[\"czech\"],\"posila\":[\"czech\"],\"poskok\":[\"czech\"],\"poslanec\":[\"czech\"],\"posoudit\":[\"czech\"],\"pospolu\":[\"czech\"],\"postava\":[\"czech\"],\"posudek\":[\"czech\"],\"posyp\":[\"czech\"],\"potah\":[\"czech\"],\"potkan\":[\"czech\"],\"potlesk\":[\"czech\"],\"potomek\":[\"czech\"],\"potrava\":[\"czech\"],\"potupa\":[\"czech\"],\"potvora\":[\"czech\"],\"poukaz\":[\"czech\"],\"pouto\":[\"czech\"],\"pouzdro\":[\"czech\"],\"povaha\":[\"czech\"],\"povidla\":[\"czech\"],\"povlak\":[\"czech\"],\"povoz\":[\"czech\"],\"povrch\":[\"czech\"],\"povstat\":[\"czech\"],\"povyk\":[\"czech\"],\"povzdech\":[\"czech\"],\"pozdrav\":[\"czech\"],\"pozemek\":[\"czech\"],\"poznatek\":[\"czech\"],\"pozor\":[\"czech\"],\"pozvat\":[\"czech\"],\"pracovat\":[\"czech\"],\"prahory\":[\"czech\"],\"praktika\":[\"czech\"],\"prales\":[\"czech\"],\"praotec\":[\"czech\"],\"praporek\":[\"czech\"],\"prase\":[\"czech\"],\"pravda\":[\"czech\"],\"princip\":[\"czech\"],\"prkno\":[\"czech\"],\"probudit\":[\"czech\"],\"procento\":[\"czech\"],\"prodej\":[\"czech\"],\"profese\":[\"czech\"],\"prohra\":[\"czech\"],\"projekt\":[\"czech\"],\"prolomit\":[\"czech\"],\"promile\":[\"czech\"],\"pronikat\":[\"czech\"],\"propad\":[\"czech\"],\"prorok\":[\"czech\"],\"prosba\":[\"czech\"],\"proton\":[\"czech\"],\"proutek\":[\"czech\"],\"provaz\":[\"czech\"],\"prskavka\":[\"czech\"],\"prsten\":[\"czech\"],\"prudkost\":[\"czech\"],\"prut\":[\"czech\"],\"prvek\":[\"czech\"],\"prvohory\":[\"czech\"],\"psanec\":[\"czech\"],\"psovod\":[\"czech\"],\"pstruh\":[\"czech\"],\"ptactvo\":[\"czech\"],\"puberta\":[\"czech\"],\"puch\":[\"czech\"],\"pudl\":[\"czech\"],\"pukavec\":[\"czech\"],\"puklina\":[\"czech\"],\"pukrle\":[\"czech\"],\"pult\":[\"czech\"],\"pumpa\":[\"czech\"],\"punc\":[\"czech\"],\"pupen\":[\"czech\"],\"pusa\":[\"czech\"],\"pusinka\":[\"czech\"],\"pustina\":[\"czech\"],\"putovat\":[\"czech\"],\"putyka\":[\"czech\"],\"pyramida\":[\"czech\"],\"pysk\":[\"czech\"],\"pytel\":[\"czech\"],\"racek\":[\"czech\"],\"rachot\":[\"czech\"],\"radiace\":[\"czech\"],\"radnice\":[\"czech\"],\"radon\":[\"czech\"],\"raft\":[\"czech\"],\"ragby\":[\"czech\"],\"raketa\":[\"czech\"],\"rakovina\":[\"czech\"],\"rameno\":[\"czech\"],\"rampouch\":[\"czech\"],\"rande\":[\"czech\"],\"rarach\":[\"czech\"],\"rarita\":[\"czech\"],\"rasovna\":[\"czech\"],\"rastr\":[\"czech\"],\"ratolest\":[\"czech\"],\"razance\":[\"czech\"],\"razidlo\":[\"czech\"],\"reagovat\":[\"czech\"],\"reakce\":[\"czech\"],\"recept\":[\"czech\"],\"redaktor\":[\"czech\"],\"referent\":[\"czech\"],\"reflex\":[\"czech\"],\"rejnok\":[\"czech\"],\"reklama\":[\"czech\"],\"rekord\":[\"czech\"],\"rekrut\":[\"czech\"],\"rektor\":[\"czech\"],\"reputace\":[\"czech\"],\"revize\":[\"czech\",\"turkish\"],\"revma\":[\"czech\"],\"revolver\":[\"czech\"],\"rezerva\":[\"czech\"],\"riskovat\":[\"czech\"],\"riziko\":[\"czech\"],\"robotika\":[\"czech\"],\"rodokmen\":[\"czech\"],\"rohovka\":[\"czech\"],\"rokle\":[\"czech\"],\"rokoko\":[\"czech\"],\"romaneto\":[\"czech\"],\"ropovod\":[\"czech\"],\"ropucha\":[\"czech\"],\"rorejs\":[\"czech\"],\"rosol\":[\"czech\"],\"rostlina\":[\"czech\"],\"rotmistr\":[\"czech\"],\"rotoped\":[\"czech\"],\"rotunda\":[\"czech\"],\"roubenka\":[\"czech\"],\"roucho\":[\"czech\"],\"roup\":[\"czech\"],\"roura\":[\"czech\"],\"rovina\":[\"czech\"],\"rovnice\":[\"czech\"],\"rozbor\":[\"czech\"],\"rozchod\":[\"czech\"],\"rozdat\":[\"czech\"],\"rozeznat\":[\"czech\"],\"rozhodce\":[\"czech\"],\"rozinka\":[\"czech\"],\"rozjezd\":[\"czech\"],\"rozkaz\":[\"czech\"],\"rozloha\":[\"czech\"],\"rozmar\":[\"czech\"],\"rozpad\":[\"czech\"],\"rozruch\":[\"czech\"],\"rozsah\":[\"czech\"],\"roztok\":[\"czech\"],\"rozum\":[\"czech\"],\"rozvod\":[\"czech\"],\"rubrika\":[\"czech\"],\"ruchadlo\":[\"czech\"],\"rukavice\":[\"czech\"],\"rukopis\":[\"czech\"],\"ryba\":[\"czech\"],\"rybolov\":[\"czech\"],\"rychlost\":[\"czech\"],\"rydlo\":[\"czech\"],\"rypadlo\":[\"czech\"],\"rytina\":[\"czech\"],\"ryzost\":[\"czech\"],\"sadista\":[\"czech\"],\"sahat\":[\"czech\"],\"sako\":[\"czech\"],\"samec\":[\"czech\"],\"samizdat\":[\"czech\"],\"samota\":[\"czech\"],\"sanitka\":[\"czech\"],\"sardinka\":[\"czech\"],\"sasanka\":[\"czech\"],\"satelit\":[\"czech\"],\"sazba\":[\"czech\"],\"sazenice\":[\"czech\"],\"sbor\":[\"czech\"],\"schovat\":[\"czech\"],\"sebranka\":[\"czech\"],\"secese\":[\"czech\"],\"sedadlo\":[\"czech\"],\"sediment\":[\"czech\"],\"sedlo\":[\"czech\"],\"sehnat\":[\"czech\"],\"sejmout\":[\"czech\"],\"sekera\":[\"czech\"],\"sekta\":[\"czech\"],\"sekunda\":[\"czech\"],\"sekvoje\":[\"czech\"],\"semeno\":[\"czech\"],\"seno\":[\"czech\"],\"servis\":[\"czech\",\"turkish\"],\"sesadit\":[\"czech\"],\"seshora\":[\"czech\"],\"seskok\":[\"czech\"],\"seslat\":[\"czech\"],\"sestra\":[\"czech\"],\"sesuv\":[\"czech\"],\"sesypat\":[\"czech\"],\"setba\":[\"czech\"],\"setina\":[\"czech\"],\"setkat\":[\"czech\"],\"setnout\":[\"czech\"],\"setrvat\":[\"czech\"],\"sever\":[\"czech\"],\"seznam\":[\"czech\"],\"shoda\":[\"czech\"],\"shrnout\":[\"czech\"],\"sifon\":[\"czech\"],\"silnice\":[\"czech\"],\"sirka\":[\"czech\"],\"sirotek\":[\"czech\"],\"sirup\":[\"czech\"],\"situace\":[\"czech\"],\"skafandr\":[\"czech\"],\"skalisko\":[\"czech\"],\"skanzen\":[\"czech\"],\"skaut\":[\"czech\"],\"skeptik\":[\"czech\"],\"skica\":[\"czech\"],\"skladba\":[\"czech\"],\"sklenice\":[\"czech\"],\"sklo\":[\"czech\"],\"skluz\":[\"czech\"],\"skoba\":[\"czech\"],\"skokan\":[\"czech\"],\"skoro\":[\"czech\"],\"skripta\":[\"czech\"],\"skrz\":[\"czech\"],\"skupina\":[\"czech\"],\"skvost\":[\"czech\"],\"skvrna\":[\"czech\"],\"slabika\":[\"czech\"],\"sladidlo\":[\"czech\"],\"slanina\":[\"czech\"],\"slast\":[\"czech\"],\"slavnost\":[\"czech\"],\"sledovat\":[\"czech\"],\"slepec\":[\"czech\"],\"sleva\":[\"czech\"],\"slezina\":[\"czech\"],\"slib\":[\"czech\"],\"slina\":[\"czech\"],\"sliznice\":[\"czech\"],\"slon\":[\"czech\"],\"sloupek\":[\"czech\"],\"slovo\":[\"czech\"],\"sluch\":[\"czech\"],\"sluha\":[\"czech\"],\"slunce\":[\"czech\"],\"slupka\":[\"czech\"],\"slza\":[\"czech\"],\"smaragd\":[\"czech\"],\"smetana\":[\"czech\"],\"smilstvo\":[\"czech\"],\"smlouva\":[\"czech\"],\"smog\":[\"czech\"],\"smrad\":[\"czech\"],\"smrk\":[\"czech\"],\"smrtka\":[\"czech\"],\"smutek\":[\"czech\"],\"smysl\":[\"czech\"],\"snad\":[\"czech\"],\"snaha\":[\"czech\"],\"snob\":[\"czech\"],\"sobota\":[\"czech\"],\"socha\":[\"czech\"],\"sodovka\":[\"czech\"],\"sokol\":[\"czech\"],\"sopka\":[\"czech\"],\"sotva\":[\"czech\"],\"souboj\":[\"czech\"],\"soucit\":[\"czech\"],\"soudce\":[\"czech\"],\"souhlas\":[\"czech\"],\"soulad\":[\"czech\"],\"soumrak\":[\"czech\"],\"souprava\":[\"czech\"],\"soused\":[\"czech\"],\"soutok\":[\"czech\"],\"souviset\":[\"czech\"],\"spalovna\":[\"czech\"],\"spasitel\":[\"czech\"],\"spis\":[\"czech\"],\"splav\":[\"czech\"],\"spodek\":[\"czech\"],\"spojenec\":[\"czech\"],\"spolu\":[\"czech\"],\"sponzor\":[\"czech\"],\"spornost\":[\"czech\"],\"spousta\":[\"czech\"],\"sprcha\":[\"czech\"],\"spustit\":[\"czech\"],\"sranda\":[\"czech\"],\"sraz\":[\"czech\"],\"srdce\":[\"czech\"],\"srna\":[\"czech\"],\"srnec\":[\"czech\"],\"srovnat\":[\"czech\"],\"srpen\":[\"czech\"],\"srst\":[\"czech\"],\"srub\":[\"czech\"],\"stanice\":[\"czech\"],\"starosta\":[\"czech\"],\"statika\":[\"czech\"],\"stavba\":[\"czech\"],\"stehno\":[\"czech\"],\"stezka\":[\"czech\"],\"stodola\":[\"czech\"],\"stolek\":[\"czech\"],\"stopa\":[\"czech\"],\"storno\":[\"czech\"],\"stoupat\":[\"czech\"],\"strach\":[\"czech\"],\"stres\":[\"czech\"],\"strhnout\":[\"czech\"],\"strom\":[\"czech\"],\"struna\":[\"czech\"],\"studna\":[\"czech\"],\"stupnice\":[\"czech\"],\"stvol\":[\"czech\"],\"styk\":[\"czech\"],\"subjekt\":[\"czech\"],\"subtropy\":[\"czech\"],\"suchar\":[\"czech\"],\"sudost\":[\"czech\"],\"sukno\":[\"czech\"],\"sundat\":[\"czech\"],\"sunout\":[\"czech\"],\"surikata\":[\"czech\"],\"surovina\":[\"czech\"],\"svah\":[\"czech\"],\"svalstvo\":[\"czech\"],\"svetr\":[\"czech\"],\"svatba\":[\"czech\"],\"svazek\":[\"czech\"],\"svisle\":[\"czech\"],\"svitek\":[\"czech\"],\"svoboda\":[\"czech\"],\"svodidlo\":[\"czech\"],\"svorka\":[\"czech\"],\"svrab\":[\"czech\"],\"sykavka\":[\"czech\"],\"sykot\":[\"czech\"],\"synek\":[\"czech\"],\"synovec\":[\"czech\"],\"sypat\":[\"czech\"],\"sypkost\":[\"czech\"],\"syrovost\":[\"czech\"],\"sysel\":[\"czech\"],\"sytost\":[\"czech\"],\"tabletka\":[\"czech\"],\"tabule\":[\"czech\"],\"tahoun\":[\"czech\"],\"tajemno\":[\"czech\"],\"tajfun\":[\"czech\"],\"tajga\":[\"czech\"],\"tajit\":[\"czech\"],\"tajnost\":[\"czech\"],\"taktika\":[\"czech\"],\"tamhle\":[\"czech\"],\"tampon\":[\"czech\",\"turkish\"],\"tancovat\":[\"czech\"],\"tanec\":[\"czech\"],\"tanker\":[\"czech\"],\"tapeta\":[\"czech\"],\"tavenina\":[\"czech\"],\"tazatel\":[\"czech\"],\"technika\":[\"czech\"],\"tehdy\":[\"czech\"],\"tekutina\":[\"czech\"],\"telefon\":[\"czech\"],\"temnota\":[\"czech\"],\"tendence\":[\"czech\"],\"tenista\":[\"czech\"],\"tenor\":[\"czech\"],\"teplota\":[\"czech\"],\"tepna\":[\"czech\"],\"teprve\":[\"czech\"],\"terapie\":[\"czech\"],\"termoska\":[\"czech\"],\"textil\":[\"czech\"],\"ticho\":[\"czech\"],\"tiskopis\":[\"czech\"],\"titulek\":[\"czech\"],\"tkadlec\":[\"czech\"],\"tkanina\":[\"czech\"],\"tlapka\":[\"czech\"],\"tleskat\":[\"czech\"],\"tlukot\":[\"czech\"],\"tlupa\":[\"czech\"],\"tmel\":[\"czech\"],\"toaleta\":[\"czech\"],\"topinka\":[\"czech\"],\"topol\":[\"czech\"],\"torzo\":[\"czech\"],\"touha\":[\"czech\"],\"toulec\":[\"czech\"],\"tradice\":[\"czech\"],\"traktor\":[\"czech\"],\"tramp\":[\"czech\"],\"trasa\":[\"czech\"],\"traverza\":[\"czech\"],\"trefit\":[\"czech\"],\"trest\":[\"czech\"],\"trezor\":[\"czech\"],\"trhavina\":[\"czech\"],\"trhlina\":[\"czech\"],\"trochu\":[\"czech\"],\"trojice\":[\"czech\"],\"troska\":[\"czech\"],\"trouba\":[\"czech\"],\"trpce\":[\"czech\"],\"trpitel\":[\"czech\"],\"trpkost\":[\"czech\"],\"trubec\":[\"czech\"],\"truchlit\":[\"czech\"],\"truhlice\":[\"czech\"],\"trus\":[\"czech\"],\"trvat\":[\"czech\"],\"tudy\":[\"czech\"],\"tuhnout\":[\"czech\"],\"tuhost\":[\"czech\"],\"tundra\":[\"czech\"],\"turista\":[\"czech\"],\"turnaj\":[\"czech\"],\"tuzemsko\":[\"czech\"],\"tvaroh\":[\"czech\"],\"tvorba\":[\"czech\"],\"tvrdost\":[\"czech\"],\"tvrz\":[\"czech\"],\"tygr\":[\"czech\"],\"tykev\":[\"czech\"],\"ubohost\":[\"czech\"],\"uboze\":[\"czech\"],\"ubrat\":[\"czech\"],\"ubrousek\":[\"czech\"],\"ubrus\":[\"czech\"],\"ubytovna\":[\"czech\"],\"ucho\":[\"czech\"],\"uctivost\":[\"czech\"],\"udivit\":[\"czech\"],\"uhradit\":[\"czech\"],\"ujednat\":[\"czech\"],\"ujistit\":[\"czech\"],\"ujmout\":[\"czech\"],\"ukazatel\":[\"czech\"],\"uklidnit\":[\"czech\"],\"uklonit\":[\"czech\"],\"ukotvit\":[\"czech\"],\"ukrojit\":[\"czech\"],\"ulice\":[\"czech\"],\"ulita\":[\"czech\"],\"ulovit\":[\"czech\"],\"umyvadlo\":[\"czech\"],\"unavit\":[\"czech\"],\"uniforma\":[\"czech\"],\"uniknout\":[\"czech\"],\"upadnout\":[\"czech\"],\"uplatnit\":[\"czech\"],\"uplynout\":[\"czech\"],\"upoutat\":[\"czech\"],\"upravit\":[\"czech\"],\"uran\":[\"czech\"],\"urazit\":[\"czech\"],\"usednout\":[\"czech\"],\"usilovat\":[\"czech\"],\"usmrtit\":[\"czech\"],\"usnadnit\":[\"czech\"],\"usnout\":[\"czech\"],\"usoudit\":[\"czech\"],\"ustlat\":[\"czech\"],\"ustrnout\":[\"czech\"],\"utahovat\":[\"czech\"],\"utkat\":[\"czech\"],\"utlumit\":[\"czech\"],\"utonout\":[\"czech\"],\"utopenec\":[\"czech\"],\"utrousit\":[\"czech\"],\"uvalit\":[\"czech\"],\"uvolnit\":[\"czech\"],\"uvozovka\":[\"czech\"],\"uzdravit\":[\"czech\"],\"uzel\":[\"czech\"],\"uzenina\":[\"czech\"],\"uzlina\":[\"czech\"],\"uznat\":[\"czech\"],\"vagon\":[\"czech\",\"turkish\"],\"valcha\":[\"czech\"],\"valoun\":[\"czech\"],\"vana\":[\"czech\"],\"vandal\":[\"czech\"],\"vanilka\":[\"czech\"],\"varan\":[\"czech\"],\"varhany\":[\"czech\"],\"varovat\":[\"czech\"],\"vcelku\":[\"czech\"],\"vchod\":[\"czech\"],\"vdova\":[\"czech\"],\"vedro\":[\"czech\"],\"vegetace\":[\"czech\"],\"vejce\":[\"czech\"],\"velbloud\":[\"czech\"],\"veletrh\":[\"czech\"],\"velitel\":[\"czech\"],\"velmoc\":[\"czech\"],\"velryba\":[\"czech\"],\"venkov\":[\"czech\"],\"veranda\":[\"czech\"],\"verze\":[\"czech\"],\"veselka\":[\"czech\"],\"veskrze\":[\"czech\"],\"vesnice\":[\"czech\"],\"vespodu\":[\"czech\"],\"vesta\":[\"czech\"],\"veterina\":[\"czech\"],\"veverka\":[\"czech\"],\"vibrace\":[\"czech\"],\"vichr\":[\"czech\"],\"videohra\":[\"czech\"],\"vidina\":[\"czech\"],\"vidle\":[\"czech\"],\"vila\":[\"czech\"],\"vinice\":[\"czech\"],\"viset\":[\"czech\"],\"vitalita\":[\"czech\"],\"vize\":[\"czech\"],\"vizitka\":[\"czech\"],\"vjezd\":[\"czech\"],\"vklad\":[\"czech\"],\"vkus\":[\"czech\"],\"vlajka\":[\"czech\"],\"vlak\":[\"czech\"],\"vlasec\":[\"czech\"],\"vlevo\":[\"czech\"],\"vlhkost\":[\"czech\"],\"vliv\":[\"czech\"],\"vlnovka\":[\"czech\"],\"vloupat\":[\"czech\"],\"vnucovat\":[\"czech\"],\"vnuk\":[\"czech\"],\"voda\":[\"czech\"],\"vodivost\":[\"czech\"],\"vodoznak\":[\"czech\"],\"vodstvo\":[\"czech\"],\"vojensky\":[\"czech\"],\"vojna\":[\"czech\"],\"vojsko\":[\"czech\"],\"volant\":[\"czech\"],\"volba\":[\"czech\"],\"volit\":[\"czech\"],\"volno\":[\"czech\"],\"voskovka\":[\"czech\"],\"vozidlo\":[\"czech\"],\"vozovna\":[\"czech\"],\"vpravo\":[\"czech\"],\"vrabec\":[\"czech\"],\"vracet\":[\"czech\"],\"vrah\":[\"czech\"],\"vrata\":[\"czech\"],\"vrba\":[\"czech\"],\"vrcholek\":[\"czech\"],\"vrhat\":[\"czech\"],\"vrstva\":[\"czech\"],\"vrtule\":[\"czech\"],\"vsadit\":[\"czech\"],\"vstoupit\":[\"czech\"],\"vstup\":[\"czech\"],\"vtip\":[\"czech\"],\"vybavit\":[\"czech\"],\"vybrat\":[\"czech\"],\"vychovat\":[\"czech\"],\"vydat\":[\"czech\"],\"vydra\":[\"czech\"],\"vyfotit\":[\"czech\"],\"vyhledat\":[\"czech\"],\"vyhnout\":[\"czech\"],\"vyhodit\":[\"czech\"],\"vyhradit\":[\"czech\"],\"vyhubit\":[\"czech\"],\"vyjasnit\":[\"czech\"],\"vyjet\":[\"czech\"],\"vyjmout\":[\"czech\"],\"vyklopit\":[\"czech\"],\"vykonat\":[\"czech\"],\"vylekat\":[\"czech\"],\"vymazat\":[\"czech\"],\"vymezit\":[\"czech\"],\"vymizet\":[\"czech\"],\"vymyslet\":[\"czech\"],\"vynechat\":[\"czech\"],\"vynikat\":[\"czech\"],\"vynutit\":[\"czech\"],\"vypadat\":[\"czech\"],\"vyplatit\":[\"czech\"],\"vypravit\":[\"czech\"],\"vypustit\":[\"czech\"],\"vyrazit\":[\"czech\"],\"vyrovnat\":[\"czech\"],\"vyrvat\":[\"czech\"],\"vyslovit\":[\"czech\"],\"vysoko\":[\"czech\"],\"vystavit\":[\"czech\"],\"vysunout\":[\"czech\"],\"vysypat\":[\"czech\"],\"vytasit\":[\"czech\"],\"vytesat\":[\"czech\"],\"vytratit\":[\"czech\"],\"vyvinout\":[\"czech\"],\"vyvolat\":[\"czech\"],\"vyvrhel\":[\"czech\"],\"vyzdobit\":[\"czech\"],\"vyznat\":[\"czech\"],\"vzadu\":[\"czech\"],\"vzbudit\":[\"czech\"],\"vzchopit\":[\"czech\"],\"vzdor\":[\"czech\"],\"vzduch\":[\"czech\"],\"vzdychat\":[\"czech\"],\"vzestup\":[\"czech\"],\"vzhledem\":[\"czech\"],\"vzkaz\":[\"czech\"],\"vzlykat\":[\"czech\"],\"vznik\":[\"czech\"],\"vzorek\":[\"czech\"],\"vzpoura\":[\"czech\"],\"vztah\":[\"czech\"],\"vztek\":[\"czech\"],\"xylofon\":[\"czech\"],\"zabrat\":[\"czech\"],\"zabydlet\":[\"czech\"],\"zachovat\":[\"czech\"],\"zadarmo\":[\"czech\"],\"zadusit\":[\"czech\"],\"zafoukat\":[\"czech\"],\"zahltit\":[\"czech\"],\"zahodit\":[\"czech\"],\"zahrada\":[\"czech\"],\"zahynout\":[\"czech\"],\"zajatec\":[\"czech\"],\"zajet\":[\"czech\"],\"zajistit\":[\"czech\"],\"zaklepat\":[\"czech\"],\"zakoupit\":[\"czech\"],\"zalepit\":[\"czech\"],\"zamezit\":[\"czech\"],\"zamotat\":[\"czech\"],\"zamyslet\":[\"czech\"],\"zanechat\":[\"czech\"],\"zanikat\":[\"czech\"],\"zaplatit\":[\"czech\"],\"zapojit\":[\"czech\"],\"zapsat\":[\"czech\"],\"zarazit\":[\"czech\"],\"zastavit\":[\"czech\"],\"zasunout\":[\"czech\"],\"zatajit\":[\"czech\"],\"zatemnit\":[\"czech\"],\"zatknout\":[\"czech\"],\"zaujmout\":[\"czech\"],\"zavalit\":[\"czech\"],\"zavelet\":[\"czech\"],\"zavinit\":[\"czech\"],\"zavolat\":[\"czech\"],\"zavrtat\":[\"czech\"],\"zazvonit\":[\"czech\"],\"zbavit\":[\"czech\"],\"zbrusu\":[\"czech\"],\"zbudovat\":[\"czech\"],\"zbytek\":[\"czech\"],\"zdaleka\":[\"czech\"],\"zdarma\":[\"czech\"],\"zdatnost\":[\"czech\"],\"zdivo\":[\"czech\"],\"zdobit\":[\"czech\"],\"zdroj\":[\"czech\"],\"zdvih\":[\"czech\"],\"zdymadlo\":[\"czech\"],\"zelenina\":[\"czech\"],\"zeman\":[\"czech\"],\"zemina\":[\"czech\"],\"zeptat\":[\"czech\"],\"zezadu\":[\"czech\"],\"zezdola\":[\"czech\"],\"zhatit\":[\"czech\"],\"zhltnout\":[\"czech\"],\"zhluboka\":[\"czech\"],\"zhotovit\":[\"czech\"],\"zhruba\":[\"czech\"],\"zima\":[\"czech\"],\"zimnice\":[\"czech\"],\"zjemnit\":[\"czech\"],\"zklamat\":[\"czech\"],\"zkoumat\":[\"czech\"],\"zkratka\":[\"czech\"],\"zkumavka\":[\"czech\"],\"zlato\":[\"czech\"],\"zlehka\":[\"czech\"],\"zloba\":[\"czech\"],\"zlom\":[\"czech\"],\"zlost\":[\"czech\"],\"zlozvyk\":[\"czech\"],\"zmapovat\":[\"czech\"],\"zmar\":[\"czech\"],\"zmatek\":[\"czech\"],\"zmije\":[\"czech\"],\"zmizet\":[\"czech\"],\"zmocnit\":[\"czech\"],\"zmodrat\":[\"czech\"],\"zmrzlina\":[\"czech\"],\"zmutovat\":[\"czech\"],\"znak\":[\"czech\"],\"znalost\":[\"czech\"],\"znamenat\":[\"czech\"],\"znovu\":[\"czech\"],\"zobrazit\":[\"czech\"],\"zotavit\":[\"czech\"],\"zoubek\":[\"czech\"],\"zoufale\":[\"czech\"],\"zplodit\":[\"czech\"],\"zpomalit\":[\"czech\"],\"zprava\":[\"czech\"],\"zprostit\":[\"czech\"],\"zprudka\":[\"czech\"],\"zprvu\":[\"czech\"],\"zrada\":[\"czech\"],\"zranit\":[\"czech\"],\"zrcadlo\":[\"czech\"],\"zrnitost\":[\"czech\"],\"zrno\":[\"czech\"],\"zrovna\":[\"czech\"],\"zrychlit\":[\"czech\"],\"zrzavost\":[\"czech\"],\"zticha\":[\"czech\"],\"ztratit\":[\"czech\"],\"zubovina\":[\"czech\"],\"zubr\":[\"czech\"],\"zvednout\":[\"czech\"],\"zvenku\":[\"czech\"],\"zvesela\":[\"czech\"],\"zvon\":[\"czech\"],\"zvrat\":[\"czech\"],\"zvukovod\":[\"czech\"],\"zvyk\":[\"czech\"],\"abandon\":[\"english\",\"french\"],\"ability\":[\"english\"],\"able\":[\"english\"],\"about\":[\"english\"],\"above\":[\"english\"],\"absent\":[\"english\"],\"absorb\":[\"english\"],\"abstract\":[\"english\"],\"absurd\":[\"english\"],\"abuse\":[\"english\"],\"access\":[\"english\"],\"accident\":[\"english\"],\"account\":[\"english\"],\"accuse\":[\"english\"],\"achieve\":[\"english\"],\"acid\":[\"english\"],\"acoustic\":[\"english\"],\"acquire\":[\"english\"],\"across\":[\"english\"],\"act\":[\"english\"],\"action\":[\"english\"],\"actor\":[\"english\"],\"actress\":[\"english\"],\"actual\":[\"english\"],\"adapt\":[\"english\"],\"add\":[\"english\"],\"addict\":[\"english\"],\"address\":[\"english\"],\"adjust\":[\"english\"],\"admit\":[\"english\"],\"adult\":[\"english\"],\"advance\":[\"english\"],\"advice\":[\"english\"],\"aerobic\":[\"english\"],\"affair\":[\"english\"],\"afford\":[\"english\"],\"afraid\":[\"english\"],\"again\":[\"english\"],\"age\":[\"english\"],\"agent\":[\"english\"],\"agree\":[\"english\"],\"ahead\":[\"english\"],\"aim\":[\"english\"],\"air\":[\"english\"],\"airport\":[\"english\"],\"aisle\":[\"english\"],\"alarm\":[\"english\"],\"album\":[\"english\"],\"alcohol\":[\"english\"],\"alert\":[\"english\"],\"alien\":[\"english\"],\"all\":[\"english\"],\"alley\":[\"english\"],\"allow\":[\"english\"],\"almost\":[\"english\"],\"alone\":[\"english\"],\"alpha\":[\"english\"],\"already\":[\"english\"],\"also\":[\"english\"],\"alter\":[\"english\"],\"always\":[\"english\"],\"amateur\":[\"english\",\"french\"],\"amazing\":[\"english\"],\"among\":[\"english\"],\"amount\":[\"english\"],\"amused\":[\"english\"],\"analyst\":[\"english\"],\"anchor\":[\"english\"],\"ancient\":[\"english\"],\"anger\":[\"english\"],\"angle\":[\"english\",\"french\"],\"angry\":[\"english\"],\"animal\":[\"english\",\"french\"],\"ankle\":[\"english\"],\"announce\":[\"english\"],\"annual\":[\"english\"],\"another\":[\"english\"],\"answer\":[\"english\"],\"antenna\":[\"english\"],\"antique\":[\"english\"],\"anxiety\":[\"english\"],\"any\":[\"english\"],\"apart\":[\"english\"],\"apology\":[\"english\"],\"appear\":[\"english\"],\"apple\":[\"english\"],\"approve\":[\"english\"],\"april\":[\"english\"],\"arch\":[\"english\"],\"arctic\":[\"english\"],\"area\":[\"english\"],\"arena\":[\"english\",\"turkish\"],\"argue\":[\"english\"],\"arm\":[\"english\"],\"armed\":[\"english\"],\"armor\":[\"english\"],\"army\":[\"english\"],\"around\":[\"english\"],\"arrange\":[\"english\"],\"arrest\":[\"english\"],\"arrive\":[\"english\"],\"arrow\":[\"english\"],\"art\":[\"english\"],\"artefact\":[\"english\"],\"artist\":[\"english\",\"turkish\"],\"artwork\":[\"english\"],\"ask\":[\"english\"],\"aspect\":[\"english\",\"french\"],\"assault\":[\"english\"],\"asset\":[\"english\"],\"assist\":[\"english\"],\"assume\":[\"english\"],\"asthma\":[\"english\"],\"athlete\":[\"english\"],\"atom\":[\"english\",\"turkish\"],\"attack\":[\"english\"],\"attend\":[\"english\"],\"attitude\":[\"english\"],\"attract\":[\"english\"],\"auction\":[\"english\"],\"audit\":[\"english\"],\"august\":[\"english\"],\"aunt\":[\"english\"],\"author\":[\"english\"],\"auto\":[\"english\"],\"autumn\":[\"english\"],\"average\":[\"english\"],\"avocado\":[\"english\"],\"avoid\":[\"english\"],\"awake\":[\"english\"],\"aware\":[\"english\"],\"away\":[\"english\"],\"awesome\":[\"english\"],\"awful\":[\"english\"],\"awkward\":[\"english\"],\"axis\":[\"english\"],\"baby\":[\"english\"],\"bachelor\":[\"english\"],\"bacon\":[\"english\"],\"badge\":[\"english\",\"french\"],\"bag\":[\"english\"],\"balance\":[\"english\"],\"balcony\":[\"english\"],\"ball\":[\"english\"],\"bamboo\":[\"english\"],\"banana\":[\"english\"],\"banner\":[\"english\"],\"bar\":[\"english\"],\"barely\":[\"english\"],\"bargain\":[\"english\"],\"barrel\":[\"english\"],\"base\":[\"english\"],\"basic\":[\"english\"],\"basket\":[\"english\"],\"battle\":[\"english\"],\"beach\":[\"english\"],\"bean\":[\"english\"],\"beauty\":[\"english\"],\"because\":[\"english\"],\"become\":[\"english\"],\"beef\":[\"english\"],\"before\":[\"english\"],\"begin\":[\"english\"],\"behave\":[\"english\"],\"behind\":[\"english\"],\"believe\":[\"english\"],\"below\":[\"english\"],\"belt\":[\"english\"],\"bench\":[\"english\"],\"benefit\":[\"english\"],\"best\":[\"english\"],\"betray\":[\"english\"],\"better\":[\"english\"],\"between\":[\"english\"],\"beyond\":[\"english\"],\"bicycle\":[\"english\",\"french\"],\"bid\":[\"english\"],\"bike\":[\"english\"],\"bind\":[\"english\"],\"biology\":[\"english\"],\"bird\":[\"english\"],\"birth\":[\"english\"],\"bitter\":[\"english\"],\"black\":[\"english\"],\"blade\":[\"english\"],\"blame\":[\"english\"],\"blanket\":[\"english\"],\"blast\":[\"english\"],\"bleak\":[\"english\"],\"bless\":[\"english\"],\"blind\":[\"english\"],\"blood\":[\"english\"],\"blossom\":[\"english\"],\"blouse\":[\"english\"],\"blue\":[\"english\"],\"blur\":[\"english\"],\"blush\":[\"english\"],\"board\":[\"english\"],\"boat\":[\"english\"],\"body\":[\"english\"],\"boil\":[\"english\"],\"bomb\":[\"english\"],\"bone\":[\"english\"],\"bonus\":[\"english\",\"french\"],\"book\":[\"english\"],\"boost\":[\"english\"],\"border\":[\"english\"],\"boring\":[\"english\"],\"borrow\":[\"english\"],\"boss\":[\"english\"],\"bottom\":[\"english\"],\"bounce\":[\"english\"],\"box\":[\"english\"],\"boy\":[\"english\"],\"bracket\":[\"english\"],\"brain\":[\"english\"],\"brand\":[\"english\"],\"brass\":[\"english\"],\"brave\":[\"english\",\"french\"],\"bread\":[\"english\"],\"breeze\":[\"english\"],\"brick\":[\"english\"],\"bridge\":[\"english\"],\"brief\":[\"english\"],\"bright\":[\"english\"],\"bring\":[\"english\"],\"brisk\":[\"english\"],\"broccoli\":[\"english\"],\"broken\":[\"english\"],\"bronze\":[\"english\"],\"broom\":[\"english\"],\"brother\":[\"english\"],\"brown\":[\"english\"],\"brush\":[\"english\"],\"bubble\":[\"english\"],\"buddy\":[\"english\"],\"budget\":[\"english\"],\"buffalo\":[\"english\"],\"build\":[\"english\"],\"bulb\":[\"english\"],\"bulk\":[\"english\"],\"bullet\":[\"english\"],\"bundle\":[\"english\"],\"bunker\":[\"english\"],\"burden\":[\"english\"],\"burger\":[\"english\"],\"burst\":[\"english\"],\"bus\":[\"english\"],\"business\":[\"english\"],\"busy\":[\"english\"],\"butter\":[\"english\"],\"buyer\":[\"english\"],\"buzz\":[\"english\"],\"cabbage\":[\"english\"],\"cabin\":[\"english\"],\"cable\":[\"english\"],\"cactus\":[\"english\"],\"cage\":[\"english\"],\"cake\":[\"english\"],\"call\":[\"english\"],\"calm\":[\"english\"],\"camera\":[\"english\"],\"camp\":[\"english\"],\"can\":[\"english\"],\"canal\":[\"english\",\"french\"],\"cancel\":[\"english\"],\"candy\":[\"english\"],\"cannon\":[\"english\"],\"canoe\":[\"english\"],\"canvas\":[\"english\"],\"canyon\":[\"english\"],\"capable\":[\"english\",\"french\"],\"capital\":[\"english\"],\"captain\":[\"english\"],\"car\":[\"english\"],\"carbon\":[\"english\"],\"card\":[\"english\"],\"cargo\":[\"english\"],\"carpet\":[\"english\"],\"carry\":[\"english\"],\"cart\":[\"english\"],\"case\":[\"english\"],\"cash\":[\"english\"],\"casino\":[\"english\"],\"castle\":[\"english\"],\"casual\":[\"english\"],\"cat\":[\"english\"],\"catalog\":[\"english\"],\"catch\":[\"english\"],\"category\":[\"english\"],\"cattle\":[\"english\"],\"caught\":[\"english\"],\"cause\":[\"english\"],\"caution\":[\"english\",\"french\"],\"cave\":[\"english\"],\"ceiling\":[\"english\"],\"celery\":[\"english\"],\"cement\":[\"english\"],\"census\":[\"english\"],\"century\":[\"english\"],\"cereal\":[\"english\"],\"certain\":[\"english\"],\"chair\":[\"english\"],\"chalk\":[\"english\"],\"champion\":[\"english\"],\"change\":[\"english\"],\"chaos\":[\"english\"],\"chapter\":[\"english\"],\"charge\":[\"english\"],\"chase\":[\"english\"],\"chat\":[\"english\"],\"cheap\":[\"english\"],\"check\":[\"english\"],\"cheese\":[\"english\"],\"chef\":[\"english\"],\"cherry\":[\"english\"],\"chest\":[\"english\"],\"chicken\":[\"english\"],\"chief\":[\"english\"],\"child\":[\"english\"],\"chimney\":[\"english\"],\"choice\":[\"english\"],\"choose\":[\"english\"],\"chronic\":[\"english\"],\"chuckle\":[\"english\"],\"chunk\":[\"english\"],\"churn\":[\"english\"],\"cigar\":[\"english\"],\"cinnamon\":[\"english\"],\"circle\":[\"english\"],\"citizen\":[\"english\"],\"city\":[\"english\"],\"civil\":[\"english\",\"french\"],\"claim\":[\"english\"],\"clap\":[\"english\"],\"clarify\":[\"english\"],\"claw\":[\"english\"],\"clay\":[\"english\"],\"clean\":[\"english\"],\"clerk\":[\"english\"],\"clever\":[\"english\"],\"click\":[\"english\"],\"client\":[\"english\",\"french\"],\"cliff\":[\"english\"],\"climb\":[\"english\"],\"clinic\":[\"english\"],\"clip\":[\"english\"],\"clock\":[\"english\"],\"clog\":[\"english\"],\"close\":[\"english\"],\"cloth\":[\"english\"],\"cloud\":[\"english\"],\"clown\":[\"english\"],\"club\":[\"english\"],\"clump\":[\"english\"],\"cluster\":[\"english\"],\"clutch\":[\"english\"],\"coach\":[\"english\"],\"coast\":[\"english\"],\"coconut\":[\"english\"],\"code\":[\"english\"],\"coffee\":[\"english\"],\"coil\":[\"english\"],\"coin\":[\"english\"],\"collect\":[\"english\"],\"color\":[\"english\"],\"column\":[\"english\"],\"combine\":[\"english\"],\"come\":[\"english\"],\"comfort\":[\"english\"],\"comic\":[\"english\"],\"common\":[\"english\"],\"company\":[\"english\"],\"concert\":[\"english\",\"french\"],\"conduct\":[\"english\"],\"confirm\":[\"english\"],\"congress\":[\"english\"],\"connect\":[\"english\"],\"consider\":[\"english\"],\"control\":[\"english\"],\"convince\":[\"english\"],\"cook\":[\"english\"],\"cool\":[\"english\"],\"copper\":[\"english\"],\"copy\":[\"english\"],\"coral\":[\"english\"],\"core\":[\"english\"],\"corn\":[\"english\"],\"correct\":[\"english\",\"french\"],\"cost\":[\"english\"],\"cotton\":[\"english\"],\"couch\":[\"english\"],\"country\":[\"english\"],\"couple\":[\"english\"],\"course\":[\"english\"],\"cousin\":[\"english\"],\"cover\":[\"english\"],\"coyote\":[\"english\",\"french\"],\"crack\":[\"english\"],\"cradle\":[\"english\"],\"craft\":[\"english\"],\"cram\":[\"english\"],\"crane\":[\"english\"],\"crash\":[\"english\"],\"crater\":[\"english\"],\"crawl\":[\"english\"],\"crazy\":[\"english\"],\"cream\":[\"english\"],\"credit\":[\"english\"],\"creek\":[\"english\"],\"crew\":[\"english\"],\"cricket\":[\"english\"],\"crime\":[\"english\"],\"crisp\":[\"english\"],\"critic\":[\"english\"],\"crop\":[\"english\"],\"cross\":[\"english\"],\"crouch\":[\"english\"],\"crowd\":[\"english\"],\"crucial\":[\"english\",\"french\"],\"cruel\":[\"english\",\"french\"],\"cruise\":[\"english\"],\"crumble\":[\"english\"],\"crunch\":[\"english\"],\"crush\":[\"english\"],\"cry\":[\"english\"],\"crystal\":[\"english\"],\"cube\":[\"english\"],\"culture\":[\"english\"],\"cup\":[\"english\"],\"cupboard\":[\"english\"],\"curious\":[\"english\"],\"current\":[\"english\"],\"curtain\":[\"english\"],\"curve\":[\"english\"],\"cushion\":[\"english\"],\"custom\":[\"english\"],\"cute\":[\"english\"],\"cycle\":[\"english\",\"french\"],\"dad\":[\"english\"],\"damage\":[\"english\"],\"damp\":[\"english\"],\"dance\":[\"english\"],\"danger\":[\"english\",\"french\"],\"daring\":[\"english\"],\"dash\":[\"english\"],\"daughter\":[\"english\"],\"dawn\":[\"english\"],\"day\":[\"english\"],\"deal\":[\"english\"],\"debate\":[\"english\"],\"debris\":[\"english\"],\"decade\":[\"english\"],\"december\":[\"english\"],\"decide\":[\"english\"],\"decline\":[\"english\"],\"decorate\":[\"english\"],\"decrease\":[\"english\"],\"deer\":[\"english\"],\"defense\":[\"english\"],\"define\":[\"english\"],\"defy\":[\"english\"],\"degree\":[\"english\"],\"delay\":[\"english\"],\"deliver\":[\"english\"],\"demand\":[\"english\"],\"demise\":[\"english\"],\"denial\":[\"english\"],\"dentist\":[\"english\"],\"deny\":[\"english\"],\"depart\":[\"english\"],\"depend\":[\"english\"],\"deposit\":[\"english\"],\"depth\":[\"english\"],\"deputy\":[\"english\"],\"derive\":[\"english\"],\"describe\":[\"english\"],\"desert\":[\"english\"],\"design\":[\"english\"],\"desk\":[\"english\"],\"despair\":[\"english\"],\"destroy\":[\"english\"],\"detail\":[\"english\"],\"detect\":[\"english\"],\"develop\":[\"english\"],\"device\":[\"english\"],\"devote\":[\"english\"],\"diagram\":[\"english\"],\"dial\":[\"english\"],\"diamond\":[\"english\"],\"diary\":[\"english\"],\"dice\":[\"english\"],\"diesel\":[\"english\"],\"diet\":[\"english\"],\"differ\":[\"english\"],\"digital\":[\"english\",\"french\"],\"dignity\":[\"english\"],\"dilemma\":[\"english\"],\"dinner\":[\"english\"],\"dinosaur\":[\"english\"],\"direct\":[\"english\"],\"dirt\":[\"english\"],\"disagree\":[\"english\"],\"discover\":[\"english\"],\"disease\":[\"english\"],\"dish\":[\"english\"],\"dismiss\":[\"english\"],\"disorder\":[\"english\"],\"display\":[\"english\"],\"distance\":[\"english\",\"french\"],\"divert\":[\"english\"],\"divide\":[\"english\"],\"divorce\":[\"english\"],\"dizzy\":[\"english\"],\"doctor\":[\"english\"],\"document\":[\"english\"],\"dog\":[\"english\"],\"doll\":[\"english\"],\"dolphin\":[\"english\"],\"domain\":[\"english\"],\"donate\":[\"english\"],\"donkey\":[\"english\"],\"donor\":[\"english\"],\"door\":[\"english\"],\"dose\":[\"english\"],\"double\":[\"english\",\"french\"],\"dove\":[\"english\"],\"draft\":[\"english\"],\"dragon\":[\"english\",\"french\"],\"drama\":[\"english\"],\"drastic\":[\"english\"],\"draw\":[\"english\"],\"dream\":[\"english\"],\"dress\":[\"english\"],\"drift\":[\"english\"],\"drill\":[\"english\"],\"drink\":[\"english\"],\"drip\":[\"english\"],\"drive\":[\"english\"],\"drop\":[\"english\"],\"drum\":[\"english\"],\"dry\":[\"english\"],\"duck\":[\"english\"],\"dumb\":[\"english\"],\"dune\":[\"english\"],\"during\":[\"english\"],\"dust\":[\"english\"],\"dutch\":[\"english\"],\"duty\":[\"english\"],\"dwarf\":[\"english\"],\"dynamic\":[\"english\"],\"eager\":[\"english\"],\"eagle\":[\"english\"],\"early\":[\"english\"],\"earn\":[\"english\"],\"earth\":[\"english\"],\"easily\":[\"english\"],\"east\":[\"english\"],\"easy\":[\"english\"],\"echo\":[\"english\"],\"ecology\":[\"english\"],\"economy\":[\"english\"],\"edge\":[\"english\"],\"edit\":[\"english\"],\"educate\":[\"english\"],\"effort\":[\"english\",\"french\"],\"egg\":[\"english\"],\"eight\":[\"english\"],\"either\":[\"english\"],\"elbow\":[\"english\"],\"elder\":[\"english\"],\"electric\":[\"english\"],\"elegant\":[\"english\"],\"element\":[\"english\"],\"elephant\":[\"english\"],\"elevator\":[\"english\"],\"elite\":[\"english\"],\"else\":[\"english\"],\"embark\":[\"english\"],\"embody\":[\"english\"],\"embrace\":[\"english\"],\"emerge\":[\"english\"],\"emotion\":[\"english\"],\"employ\":[\"english\"],\"empower\":[\"english\"],\"empty\":[\"english\"],\"enable\":[\"english\"],\"enact\":[\"english\"],\"end\":[\"english\"],\"endless\":[\"english\"],\"endorse\":[\"english\"],\"enemy\":[\"english\"],\"energy\":[\"english\"],\"enforce\":[\"english\"],\"engage\":[\"english\"],\"engine\":[\"english\"],\"enhance\":[\"english\"],\"enjoy\":[\"english\"],\"enlist\":[\"english\"],\"enough\":[\"english\"],\"enrich\":[\"english\"],\"enroll\":[\"english\"],\"ensure\":[\"english\"],\"enter\":[\"english\"],\"entire\":[\"english\"],\"entry\":[\"english\"],\"envelope\":[\"english\"],\"episode\":[\"english\"],\"equal\":[\"english\"],\"equip\":[\"english\"],\"era\":[\"english\"],\"erase\":[\"english\"],\"erode\":[\"english\"],\"erosion\":[\"english\"],\"error\":[\"english\"],\"erupt\":[\"english\"],\"escape\":[\"english\"],\"essay\":[\"english\"],\"essence\":[\"english\",\"french\"],\"estate\":[\"english\"],\"eternal\":[\"english\"],\"ethics\":[\"english\"],\"evidence\":[\"english\"],\"evil\":[\"english\"],\"evoke\":[\"english\"],\"evolve\":[\"english\"],\"exact\":[\"english\",\"french\"],\"example\":[\"english\"],\"excess\":[\"english\"],\"exchange\":[\"english\"],\"excite\":[\"english\"],\"exclude\":[\"english\"],\"excuse\":[\"english\",\"french\"],\"execute\":[\"english\"],\"exercise\":[\"english\"],\"exhaust\":[\"english\"],\"exhibit\":[\"english\"],\"exile\":[\"english\"],\"exist\":[\"english\"],\"exit\":[\"english\"],\"exotic\":[\"english\"],\"expand\":[\"english\"],\"expect\":[\"english\"],\"expire\":[\"english\"],\"explain\":[\"english\"],\"expose\":[\"english\"],\"express\":[\"english\"],\"extend\":[\"english\"],\"extra\":[\"english\"],\"eye\":[\"english\"],\"eyebrow\":[\"english\"],\"fabric\":[\"english\"],\"face\":[\"english\"],\"faculty\":[\"english\"],\"fade\":[\"english\"],\"faint\":[\"english\"],\"faith\":[\"english\"],\"fall\":[\"english\"],\"false\":[\"english\"],\"fame\":[\"english\"],\"family\":[\"english\"],\"famous\":[\"english\"],\"fan\":[\"english\"],\"fancy\":[\"english\"],\"fantasy\":[\"english\"],\"farm\":[\"english\"],\"fashion\":[\"english\"],\"fat\":[\"english\"],\"fatal\":[\"english\",\"french\"],\"father\":[\"english\"],\"fatigue\":[\"english\",\"french\"],\"fault\":[\"english\"],\"favorite\":[\"english\"],\"feature\":[\"english\"],\"february\":[\"english\"],\"federal\":[\"english\",\"turkish\"],\"fee\":[\"english\"],\"feed\":[\"english\"],\"feel\":[\"english\"],\"female\":[\"english\"],\"fence\":[\"english\"],\"festival\":[\"english\",\"french\",\"turkish\"],\"fetch\":[\"english\"],\"fever\":[\"english\"],\"few\":[\"english\"],\"fiber\":[\"english\"],\"fiction\":[\"english\"],\"field\":[\"english\"],\"figure\":[\"english\",\"french\"],\"file\":[\"english\"],\"film\":[\"english\"],\"filter\":[\"english\"],\"final\":[\"english\"],\"find\":[\"english\"],\"fine\":[\"english\"],\"finger\":[\"english\"],\"finish\":[\"english\"],\"fire\":[\"english\"],\"firm\":[\"english\"],\"first\":[\"english\"],\"fiscal\":[\"english\"],\"fish\":[\"english\"],\"fit\":[\"english\"],\"fitness\":[\"english\"],\"fix\":[\"english\"],\"flag\":[\"english\"],\"flame\":[\"english\"],\"flash\":[\"english\"],\"flat\":[\"english\"],\"flavor\":[\"english\"],\"flee\":[\"english\"],\"flight\":[\"english\"],\"flip\":[\"english\"],\"float\":[\"english\"],\"flock\":[\"english\"],\"floor\":[\"english\"],\"flower\":[\"english\"],\"fluid\":[\"english\"],\"flush\":[\"english\"],\"fly\":[\"english\"],\"foam\":[\"english\"],\"focus\":[\"english\"],\"fog\":[\"english\"],\"foil\":[\"english\"],\"fold\":[\"english\"],\"follow\":[\"english\"],\"food\":[\"english\"],\"foot\":[\"english\"],\"force\":[\"english\"],\"forest\":[\"english\"],\"forget\":[\"english\"],\"fork\":[\"english\"],\"fortune\":[\"english\",\"french\"],\"forum\":[\"english\"],\"forward\":[\"english\"],\"fossil\":[\"english\"],\"foster\":[\"english\"],\"found\":[\"english\"],\"fox\":[\"english\"],\"fragile\":[\"english\",\"french\"],\"frame\":[\"english\"],\"frequent\":[\"english\"],\"fresh\":[\"english\"],\"friend\":[\"english\"],\"fringe\":[\"english\"],\"frog\":[\"english\"],\"front\":[\"english\"],\"frost\":[\"english\"],\"frown\":[\"english\"],\"frozen\":[\"english\"],\"fruit\":[\"english\",\"french\"],\"fuel\":[\"english\"],\"fun\":[\"english\"],\"funny\":[\"english\"],\"furnace\":[\"english\"],\"fury\":[\"english\"],\"future\":[\"english\"],\"gadget\":[\"english\"],\"gain\":[\"english\"],\"galaxy\":[\"english\"],\"gallery\":[\"english\"],\"game\":[\"english\"],\"gap\":[\"english\"],\"garage\":[\"english\"],\"garbage\":[\"english\"],\"garden\":[\"english\"],\"garlic\":[\"english\"],\"garment\":[\"english\"],\"gas\":[\"english\"],\"gasp\":[\"english\"],\"gate\":[\"english\"],\"gather\":[\"english\"],\"gauge\":[\"english\"],\"gaze\":[\"english\"],\"general\":[\"english\"],\"genius\":[\"english\"],\"genre\":[\"english\"],\"gentle\":[\"english\"],\"genuine\":[\"english\"],\"gesture\":[\"english\"],\"ghost\":[\"english\"],\"giant\":[\"english\"],\"gift\":[\"english\"],\"giggle\":[\"english\"],\"ginger\":[\"english\"],\"giraffe\":[\"english\"],\"girl\":[\"english\"],\"give\":[\"english\"],\"glad\":[\"english\"],\"glance\":[\"english\"],\"glare\":[\"english\"],\"glass\":[\"english\"],\"glide\":[\"english\"],\"glimpse\":[\"english\"],\"globe\":[\"english\",\"french\"],\"gloom\":[\"english\"],\"glory\":[\"english\"],\"glove\":[\"english\"],\"glow\":[\"english\"],\"glue\":[\"english\"],\"goat\":[\"english\"],\"goddess\":[\"english\"],\"gold\":[\"english\"],\"good\":[\"english\"],\"goose\":[\"english\"],\"gorilla\":[\"english\"],\"gospel\":[\"english\"],\"gossip\":[\"english\"],\"govern\":[\"english\"],\"gown\":[\"english\"],\"grab\":[\"english\"],\"grace\":[\"english\"],\"grain\":[\"english\"],\"grant\":[\"english\"],\"grape\":[\"english\"],\"grass\":[\"english\"],\"gravity\":[\"english\"],\"great\":[\"english\"],\"green\":[\"english\"],\"grid\":[\"english\"],\"grief\":[\"english\"],\"grit\":[\"english\"],\"grocery\":[\"english\"],\"group\":[\"english\"],\"grow\":[\"english\"],\"grunt\":[\"english\"],\"guard\":[\"english\"],\"guess\":[\"english\"],\"guide\":[\"english\",\"french\"],\"guilt\":[\"english\"],\"guitar\":[\"english\"],\"gun\":[\"english\"],\"gym\":[\"english\"],\"habit\":[\"english\"],\"hair\":[\"english\"],\"half\":[\"english\"],\"hammer\":[\"english\"],\"hamster\":[\"english\"],\"hand\":[\"english\"],\"happy\":[\"english\"],\"harbor\":[\"english\"],\"hard\":[\"english\"],\"harsh\":[\"english\"],\"harvest\":[\"english\"],\"hat\":[\"english\"],\"have\":[\"english\"],\"hawk\":[\"english\"],\"hazard\":[\"english\"],\"head\":[\"english\"],\"health\":[\"english\"],\"heart\":[\"english\"],\"heavy\":[\"english\"],\"hedgehog\":[\"english\"],\"height\":[\"english\"],\"hello\":[\"english\"],\"helmet\":[\"english\"],\"help\":[\"english\"],\"hen\":[\"english\"],\"hero\":[\"english\"],\"hidden\":[\"english\"],\"high\":[\"english\"],\"hill\":[\"english\"],\"hint\":[\"english\"],\"hip\":[\"english\"],\"hire\":[\"english\"],\"history\":[\"english\"],\"hobby\":[\"english\"],\"hockey\":[\"english\"],\"hold\":[\"english\"],\"hole\":[\"english\"],\"holiday\":[\"english\"],\"hollow\":[\"english\"],\"home\":[\"english\"],\"honey\":[\"english\"],\"hood\":[\"english\"],\"hope\":[\"english\"],\"horn\":[\"english\"],\"horror\":[\"english\"],\"horse\":[\"english\"],\"hospital\":[\"english\"],\"host\":[\"english\"],\"hotel\":[\"english\"],\"hour\":[\"english\"],\"hover\":[\"english\"],\"hub\":[\"english\"],\"huge\":[\"english\"],\"human\":[\"english\"],\"humble\":[\"english\",\"french\"],\"humor\":[\"english\"],\"hundred\":[\"english\"],\"hungry\":[\"english\"],\"hunt\":[\"english\"],\"hurdle\":[\"english\"],\"hurry\":[\"english\"],\"hurt\":[\"english\"],\"husband\":[\"english\"],\"hybrid\":[\"english\"],\"ice\":[\"english\"],\"icon\":[\"english\"],\"idea\":[\"english\"],\"identify\":[\"english\"],\"idle\":[\"english\"],\"ignore\":[\"english\"],\"ill\":[\"english\"],\"illegal\":[\"english\"],\"illness\":[\"english\"],\"image\":[\"english\",\"french\"],\"imitate\":[\"english\"],\"immense\":[\"english\",\"french\"],\"immune\":[\"english\"],\"impact\":[\"english\",\"french\"],\"impose\":[\"english\"],\"improve\":[\"english\"],\"impulse\":[\"english\"],\"inch\":[\"english\"],\"include\":[\"english\"],\"income\":[\"english\"],\"increase\":[\"english\"],\"index\":[\"english\"],\"indicate\":[\"english\"],\"indoor\":[\"english\"],\"industry\":[\"english\"],\"infant\":[\"english\"],\"inflict\":[\"english\"],\"inform\":[\"english\"],\"inhale\":[\"english\"],\"inherit\":[\"english\"],\"initial\":[\"english\"],\"inject\":[\"english\"],\"injury\":[\"english\"],\"inmate\":[\"english\"],\"inner\":[\"english\"],\"innocent\":[\"english\",\"french\"],\"input\":[\"english\"],\"inquiry\":[\"english\"],\"insane\":[\"english\"],\"insect\":[\"english\"],\"inside\":[\"english\"],\"inspire\":[\"english\"],\"install\":[\"english\"],\"intact\":[\"english\",\"french\"],\"interest\":[\"english\"],\"into\":[\"english\"],\"invest\":[\"english\"],\"invite\":[\"english\"],\"involve\":[\"english\"],\"iron\":[\"english\"],\"island\":[\"english\"],\"isolate\":[\"english\"],\"issue\":[\"english\"],\"item\":[\"english\"],\"ivory\":[\"english\"],\"jacket\":[\"english\"],\"jaguar\":[\"english\",\"french\"],\"jar\":[\"english\"],\"jazz\":[\"english\"],\"jealous\":[\"english\"],\"jeans\":[\"english\"],\"jelly\":[\"english\"],\"jewel\":[\"english\"],\"job\":[\"english\"],\"join\":[\"english\"],\"joke\":[\"english\"],\"journey\":[\"english\"],\"joy\":[\"english\"],\"judge\":[\"english\"],\"juice\":[\"english\"],\"jump\":[\"english\"],\"jungle\":[\"english\"],\"junior\":[\"english\",\"french\"],\"junk\":[\"english\"],\"just\":[\"english\"],\"kangaroo\":[\"english\"],\"keen\":[\"english\"],\"keep\":[\"english\"],\"ketchup\":[\"english\"],\"key\":[\"english\"],\"kick\":[\"english\"],\"kid\":[\"english\"],\"kidney\":[\"english\"],\"kind\":[\"english\"],\"kingdom\":[\"english\"],\"kiss\":[\"english\"],\"kit\":[\"english\"],\"kitchen\":[\"english\"],\"kite\":[\"english\"],\"kitten\":[\"english\"],\"kiwi\":[\"english\"],\"knee\":[\"english\"],\"knife\":[\"english\"],\"knock\":[\"english\"],\"know\":[\"english\"],\"lab\":[\"english\"],\"label\":[\"english\",\"french\"],\"labor\":[\"english\"],\"ladder\":[\"english\"],\"lady\":[\"english\"],\"lake\":[\"english\"],\"lamp\":[\"english\"],\"language\":[\"english\"],\"laptop\":[\"english\"],\"large\":[\"english\"],\"later\":[\"english\"],\"latin\":[\"english\"],\"laugh\":[\"english\"],\"laundry\":[\"english\"],\"lava\":[\"english\"],\"law\":[\"english\"],\"lawn\":[\"english\"],\"lawsuit\":[\"english\"],\"layer\":[\"english\"],\"lazy\":[\"english\"],\"leader\":[\"english\"],\"leaf\":[\"english\"],\"learn\":[\"english\"],\"leave\":[\"english\"],\"lecture\":[\"english\",\"french\"],\"left\":[\"english\"],\"leg\":[\"english\"],\"legal\":[\"english\"],\"legend\":[\"english\"],\"leisure\":[\"english\"],\"lemon\":[\"english\"],\"lend\":[\"english\"],\"length\":[\"english\"],\"lens\":[\"english\"],\"leopard\":[\"english\"],\"lesson\":[\"english\"],\"letter\":[\"english\"],\"level\":[\"english\"],\"liar\":[\"english\"],\"liberty\":[\"english\"],\"library\":[\"english\"],\"license\":[\"english\"],\"life\":[\"english\"],\"lift\":[\"english\"],\"light\":[\"english\"],\"like\":[\"english\"],\"limb\":[\"english\"],\"limit\":[\"english\"],\"link\":[\"english\"],\"lion\":[\"english\"],\"liquid\":[\"english\"],\"list\":[\"english\"],\"little\":[\"english\"],\"live\":[\"english\"],\"lizard\":[\"english\"],\"load\":[\"english\"],\"loan\":[\"english\"],\"lobster\":[\"english\"],\"local\":[\"english\"],\"lock\":[\"english\"],\"logic\":[\"english\"],\"lonely\":[\"english\"],\"long\":[\"english\"],\"loop\":[\"english\"],\"lottery\":[\"english\"],\"loud\":[\"english\"],\"lounge\":[\"english\"],\"love\":[\"english\"],\"loyal\":[\"english\",\"french\"],\"lucky\":[\"english\"],\"luggage\":[\"english\"],\"lumber\":[\"english\"],\"lunar\":[\"english\"],\"lunch\":[\"english\"],\"luxury\":[\"english\"],\"lyrics\":[\"english\"],\"machine\":[\"english\",\"french\"],\"mad\":[\"english\"],\"magic\":[\"english\"],\"magnet\":[\"english\"],\"maid\":[\"english\"],\"mail\":[\"english\"],\"main\":[\"english\"],\"major\":[\"english\"],\"make\":[\"english\"],\"mammal\":[\"english\"],\"man\":[\"english\"],\"manage\":[\"english\"],\"mandate\":[\"english\"],\"mango\":[\"english\"],\"mansion\":[\"english\"],\"manual\":[\"english\"],\"maple\":[\"english\"],\"marble\":[\"english\"],\"march\":[\"english\"],\"margin\":[\"english\"],\"marine\":[\"english\"],\"market\":[\"english\",\"turkish\"],\"marriage\":[\"english\"],\"mask\":[\"english\"],\"mass\":[\"english\"],\"master\":[\"english\"],\"match\":[\"english\"],\"material\":[\"english\"],\"math\":[\"english\"],\"matrix\":[\"english\"],\"matter\":[\"english\"],\"maximum\":[\"english\"],\"maze\":[\"english\"],\"meadow\":[\"english\"],\"mean\":[\"english\"],\"measure\":[\"english\"],\"meat\":[\"english\"],\"mechanic\":[\"english\"],\"medal\":[\"english\"],\"media\":[\"english\"],\"melody\":[\"english\"],\"melt\":[\"english\"],\"member\":[\"english\"],\"memory\":[\"english\"],\"mention\":[\"english\"],\"menu\":[\"english\"],\"mercy\":[\"english\"],\"merge\":[\"english\"],\"merit\":[\"english\"],\"merry\":[\"english\"],\"mesh\":[\"english\"],\"message\":[\"english\"],\"metal\":[\"english\"],\"method\":[\"english\"],\"middle\":[\"english\"],\"midnight\":[\"english\"],\"milk\":[\"english\"],\"million\":[\"english\",\"french\"],\"mimic\":[\"english\"],\"mind\":[\"english\"],\"minimum\":[\"english\"],\"minor\":[\"english\"],\"minute\":[\"english\",\"french\"],\"miracle\":[\"english\",\"french\"],\"mirror\":[\"english\"],\"misery\":[\"english\"],\"miss\":[\"english\"],\"mistake\":[\"english\"],\"mix\":[\"english\"],\"mixed\":[\"english\"],\"mixture\":[\"english\"],\"mobile\":[\"english\",\"french\"],\"model\":[\"english\",\"turkish\"],\"modify\":[\"english\"],\"mom\":[\"english\"],\"moment\":[\"english\"],\"monitor\":[\"english\"],\"monkey\":[\"english\"],\"monster\":[\"english\"],\"month\":[\"english\"],\"moon\":[\"english\"],\"moral\":[\"english\"],\"more\":[\"english\"],\"morning\":[\"english\"],\"mosquito\":[\"english\"],\"mother\":[\"english\"],\"motion\":[\"english\"],\"motor\":[\"english\",\"turkish\"],\"mountain\":[\"english\"],\"mouse\":[\"english\"],\"move\":[\"english\"],\"movie\":[\"english\"],\"much\":[\"english\"],\"muffin\":[\"english\"],\"mule\":[\"english\"],\"multiply\":[\"english\"],\"muscle\":[\"english\",\"french\"],\"museum\":[\"english\"],\"mushroom\":[\"english\"],\"music\":[\"english\"],\"must\":[\"english\"],\"mutual\":[\"english\"],\"myself\":[\"english\"],\"mystery\":[\"english\"],\"myth\":[\"english\"],\"naive\":[\"english\"],\"name\":[\"english\"],\"napkin\":[\"english\"],\"narrow\":[\"english\"],\"nasty\":[\"english\"],\"nation\":[\"english\",\"french\"],\"nature\":[\"english\",\"french\"],\"near\":[\"english\"],\"neck\":[\"english\"],\"need\":[\"english\"],\"negative\":[\"english\"],\"neglect\":[\"english\"],\"neither\":[\"english\"],\"nephew\":[\"english\"],\"nerve\":[\"english\"],\"nest\":[\"english\"],\"net\":[\"english\"],\"network\":[\"english\"],\"neutral\":[\"english\"],\"never\":[\"english\"],\"news\":[\"english\"],\"next\":[\"english\"],\"nice\":[\"english\"],\"night\":[\"english\"],\"noble\":[\"english\",\"french\"],\"noise\":[\"english\"],\"nominee\":[\"english\"],\"noodle\":[\"english\"],\"normal\":[\"english\",\"turkish\"],\"north\":[\"english\"],\"nose\":[\"english\"],\"notable\":[\"english\",\"french\"],\"note\":[\"english\"],\"nothing\":[\"english\"],\"notice\":[\"english\"],\"novel\":[\"english\"],\"now\":[\"english\"],\"nuclear\":[\"english\"],\"number\":[\"english\"],\"nurse\":[\"english\"],\"nut\":[\"english\"],\"oak\":[\"english\"],\"obey\":[\"english\"],\"object\":[\"english\"],\"oblige\":[\"english\"],\"obscure\":[\"english\"],\"observe\":[\"english\"],\"obtain\":[\"english\"],\"obvious\":[\"english\"],\"occur\":[\"english\"],\"ocean\":[\"english\"],\"october\":[\"english\"],\"odor\":[\"english\"],\"off\":[\"english\"],\"offer\":[\"english\"],\"office\":[\"english\"],\"often\":[\"english\"],\"oil\":[\"english\"],\"okay\":[\"english\"],\"old\":[\"english\"],\"olive\":[\"english\"],\"olympic\":[\"english\"],\"omit\":[\"english\"],\"once\":[\"english\"],\"one\":[\"english\"],\"onion\":[\"english\"],\"online\":[\"english\"],\"only\":[\"english\"],\"open\":[\"english\"],\"opera\":[\"english\",\"turkish\"],\"opinion\":[\"english\",\"french\"],\"oppose\":[\"english\"],\"option\":[\"english\"],\"orange\":[\"english\",\"french\"],\"orbit\":[\"english\"],\"orchard\":[\"english\"],\"order\":[\"english\"],\"ordinary\":[\"english\"],\"organ\":[\"english\"],\"orient\":[\"english\"],\"original\":[\"english\"],\"orphan\":[\"english\"],\"ostrich\":[\"english\"],\"other\":[\"english\"],\"outdoor\":[\"english\"],\"outer\":[\"english\"],\"output\":[\"english\"],\"outside\":[\"english\"],\"oval\":[\"english\"],\"oven\":[\"english\"],\"over\":[\"english\"],\"own\":[\"english\"],\"owner\":[\"english\"],\"oxygen\":[\"english\"],\"oyster\":[\"english\"],\"ozone\":[\"english\",\"french\"],\"pact\":[\"english\"],\"paddle\":[\"english\"],\"page\":[\"english\"],\"pair\":[\"english\"],\"palace\":[\"english\",\"french\"],\"palm\":[\"english\"],\"panda\":[\"english\",\"french\",\"turkish\"],\"panel\":[\"english\",\"turkish\"],\"panic\":[\"english\"],\"panther\":[\"english\"],\"paper\":[\"english\"],\"parade\":[\"english\"],\"parent\":[\"english\"],\"park\":[\"english\"],\"parrot\":[\"english\"],\"party\":[\"english\"],\"pass\":[\"english\"],\"patch\":[\"english\"],\"path\":[\"english\"],\"patient\":[\"english\"],\"patrol\":[\"english\"],\"pattern\":[\"english\"],\"pause\":[\"english\"],\"pave\":[\"english\"],\"payment\":[\"english\"],\"peace\":[\"english\"],\"peanut\":[\"english\"],\"pear\":[\"english\"],\"peasant\":[\"english\"],\"pelican\":[\"english\"],\"pen\":[\"english\"],\"penalty\":[\"english\"],\"pencil\":[\"english\"],\"people\":[\"english\"],\"pepper\":[\"english\"],\"perfect\":[\"english\"],\"permit\":[\"english\"],\"person\":[\"english\"],\"pet\":[\"english\"],\"phone\":[\"english\"],\"photo\":[\"english\"],\"phrase\":[\"english\",\"french\"],\"physical\":[\"english\"],\"piano\":[\"english\",\"french\"],\"picnic\":[\"english\"],\"picture\":[\"english\"],\"piece\":[\"english\"],\"pig\":[\"english\"],\"pigeon\":[\"english\"],\"pill\":[\"english\"],\"pilot\":[\"english\",\"turkish\"],\"pink\":[\"english\"],\"pioneer\":[\"english\"],\"pipe\":[\"english\"],\"pistol\":[\"english\"],\"pitch\":[\"english\"],\"pizza\":[\"english\",\"french\"],\"place\":[\"english\"],\"planet\":[\"english\"],\"plastic\":[\"english\"],\"plate\":[\"english\"],\"play\":[\"english\"],\"please\":[\"english\"],\"pledge\":[\"english\"],\"pluck\":[\"english\"],\"plug\":[\"english\"],\"plunge\":[\"english\"],\"poem\":[\"english\"],\"poet\":[\"english\"],\"point\":[\"english\"],\"polar\":[\"english\"],\"pole\":[\"english\"],\"police\":[\"english\"],\"pond\":[\"english\"],\"pony\":[\"english\"],\"pool\":[\"english\"],\"popular\":[\"english\"],\"portion\":[\"english\"],\"position\":[\"english\",\"french\"],\"possible\":[\"english\"],\"post\":[\"english\"],\"potato\":[\"english\"],\"pottery\":[\"english\"],\"poverty\":[\"english\"],\"powder\":[\"english\"],\"power\":[\"english\"],\"practice\":[\"english\"],\"praise\":[\"english\"],\"predict\":[\"english\"],\"prefer\":[\"english\"],\"prepare\":[\"english\"],\"present\":[\"english\"],\"pretty\":[\"english\"],\"prevent\":[\"english\"],\"price\":[\"english\"],\"pride\":[\"english\"],\"primary\":[\"english\"],\"print\":[\"english\"],\"priority\":[\"english\"],\"prison\":[\"english\",\"french\"],\"private\":[\"english\"],\"prize\":[\"english\"],\"problem\":[\"english\",\"turkish\"],\"process\":[\"english\"],\"produce\":[\"english\"],\"profit\":[\"english\"],\"program\":[\"english\",\"turkish\"],\"project\":[\"english\"],\"promote\":[\"english\"],\"proof\":[\"english\"],\"property\":[\"english\"],\"prosper\":[\"english\"],\"protect\":[\"english\"],\"proud\":[\"english\"],\"provide\":[\"english\"],\"public\":[\"english\",\"french\"],\"pudding\":[\"english\"],\"pull\":[\"english\"],\"pulp\":[\"english\"],\"pulse\":[\"english\"],\"pumpkin\":[\"english\"],\"punch\":[\"english\"],\"pupil\":[\"english\"],\"puppy\":[\"english\"],\"purchase\":[\"english\"],\"purity\":[\"english\"],\"purpose\":[\"english\"],\"purse\":[\"english\"],\"push\":[\"english\"],\"put\":[\"english\"],\"puzzle\":[\"english\",\"french\"],\"pyramid\":[\"english\"],\"quality\":[\"english\"],\"quantum\":[\"english\"],\"quarter\":[\"english\"],\"question\":[\"english\",\"french\"],\"quick\":[\"english\"],\"quit\":[\"english\"],\"quiz\":[\"english\"],\"quote\":[\"english\"],\"rabbit\":[\"english\"],\"raccoon\":[\"english\"],\"race\":[\"english\"],\"rack\":[\"english\"],\"radar\":[\"english\",\"turkish\"],\"radio\":[\"english\"],\"rail\":[\"english\"],\"rain\":[\"english\"],\"raise\":[\"english\"],\"rally\":[\"english\"],\"ramp\":[\"english\"],\"ranch\":[\"english\"],\"random\":[\"english\"],\"range\":[\"english\"],\"rapid\":[\"english\"],\"rare\":[\"english\"],\"rate\":[\"english\"],\"rather\":[\"english\"],\"raven\":[\"english\"],\"raw\":[\"english\"],\"razor\":[\"english\"],\"ready\":[\"english\"],\"real\":[\"english\"],\"reason\":[\"english\"],\"rebel\":[\"english\"],\"rebuild\":[\"english\"],\"recall\":[\"english\"],\"receive\":[\"english\"],\"recipe\":[\"english\"],\"record\":[\"english\"],\"recycle\":[\"english\"],\"reduce\":[\"english\"],\"reflect\":[\"english\"],\"reform\":[\"english\",\"turkish\"],\"refuse\":[\"english\"],\"region\":[\"english\"],\"regret\":[\"english\"],\"regular\":[\"english\"],\"reject\":[\"english\"],\"relax\":[\"english\"],\"release\":[\"english\"],\"relief\":[\"english\",\"french\"],\"rely\":[\"english\"],\"remain\":[\"english\"],\"remember\":[\"english\"],\"remind\":[\"english\"],\"remove\":[\"english\"],\"render\":[\"english\"],\"renew\":[\"english\"],\"rent\":[\"english\"],\"reopen\":[\"english\"],\"repair\":[\"english\"],\"repeat\":[\"english\"],\"replace\":[\"english\"],\"report\":[\"english\"],\"require\":[\"english\"],\"rescue\":[\"english\"],\"resemble\":[\"english\"],\"resist\":[\"english\"],\"resource\":[\"english\"],\"response\":[\"english\"],\"result\":[\"english\"],\"retire\":[\"english\"],\"retreat\":[\"english\"],\"return\":[\"english\"],\"reunion\":[\"english\"],\"reveal\":[\"english\"],\"review\":[\"english\"],\"reward\":[\"english\"],\"rhythm\":[\"english\"],\"rib\":[\"english\"],\"ribbon\":[\"english\"],\"rice\":[\"english\"],\"rich\":[\"english\"],\"ride\":[\"english\"],\"ridge\":[\"english\"],\"rifle\":[\"english\"],\"right\":[\"english\"],\"rigid\":[\"english\"],\"ring\":[\"english\"],\"riot\":[\"english\"],\"ripple\":[\"english\"],\"risk\":[\"english\"],\"ritual\":[\"english\"],\"rival\":[\"english\",\"french\"],\"river\":[\"english\"],\"road\":[\"english\"],\"roast\":[\"english\"],\"robot\":[\"english\",\"turkish\"],\"robust\":[\"english\"],\"rocket\":[\"english\"],\"romance\":[\"english\",\"french\"],\"roof\":[\"english\"],\"rookie\":[\"english\"],\"room\":[\"english\"],\"rose\":[\"english\"],\"rotate\":[\"english\"],\"rough\":[\"english\"],\"round\":[\"english\"],\"route\":[\"english\"],\"royal\":[\"english\"],\"rubber\":[\"english\"],\"rude\":[\"english\"],\"rug\":[\"english\"],\"rule\":[\"english\"],\"run\":[\"english\"],\"runway\":[\"english\"],\"rural\":[\"english\"],\"sad\":[\"english\"],\"saddle\":[\"english\"],\"sadness\":[\"english\"],\"safe\":[\"english\"],\"sail\":[\"english\"],\"salad\":[\"english\"],\"salmon\":[\"english\"],\"salon\":[\"english\",\"french\",\"turkish\"],\"salt\":[\"english\"],\"salute\":[\"english\"],\"same\":[\"english\"],\"sample\":[\"english\"],\"sand\":[\"english\"],\"satisfy\":[\"english\"],\"satoshi\":[\"english\"],\"sauce\":[\"english\"],\"sausage\":[\"english\"],\"save\":[\"english\"],\"say\":[\"english\"],\"scale\":[\"english\"],\"scan\":[\"english\"],\"scare\":[\"english\"],\"scatter\":[\"english\"],\"scene\":[\"english\"],\"scheme\":[\"english\"],\"school\":[\"english\"],\"science\":[\"english\",\"french\"],\"scissors\":[\"english\"],\"scorpion\":[\"english\"],\"scout\":[\"english\"],\"scrap\":[\"english\"],\"screen\":[\"english\"],\"script\":[\"english\"],\"scrub\":[\"english\"],\"sea\":[\"english\"],\"search\":[\"english\"],\"season\":[\"english\"],\"seat\":[\"english\"],\"second\":[\"english\"],\"secret\":[\"english\"],\"section\":[\"english\"],\"security\":[\"english\"],\"seed\":[\"english\"],\"seek\":[\"english\"],\"segment\":[\"english\"],\"select\":[\"english\"],\"sell\":[\"english\"],\"seminar\":[\"english\"],\"senior\":[\"english\"],\"sense\":[\"english\"],\"sentence\":[\"english\",\"french\"],\"series\":[\"english\"],\"service\":[\"english\",\"french\"],\"session\":[\"english\"],\"settle\":[\"english\"],\"setup\":[\"english\"],\"seven\":[\"english\"],\"shadow\":[\"english\"],\"shaft\":[\"english\"],\"shallow\":[\"english\"],\"share\":[\"english\"],\"shed\":[\"english\"],\"shell\":[\"english\"],\"sheriff\":[\"english\"],\"shield\":[\"english\"],\"shift\":[\"english\"],\"shine\":[\"english\"],\"ship\":[\"english\"],\"shiver\":[\"english\"],\"shock\":[\"english\"],\"shoe\":[\"english\"],\"shoot\":[\"english\"],\"shop\":[\"english\"],\"short\":[\"english\"],\"shoulder\":[\"english\"],\"shove\":[\"english\"],\"shrimp\":[\"english\"],\"shrug\":[\"english\"],\"shuffle\":[\"english\"],\"shy\":[\"english\"],\"sibling\":[\"english\"],\"sick\":[\"english\"],\"side\":[\"english\"],\"siege\":[\"english\"],\"sight\":[\"english\"],\"sign\":[\"english\"],\"silent\":[\"english\"],\"silk\":[\"english\"],\"silly\":[\"english\"],\"silver\":[\"english\"],\"similar\":[\"english\"],\"simple\":[\"english\",\"french\"],\"since\":[\"english\"],\"sing\":[\"english\"],\"siren\":[\"english\"],\"sister\":[\"english\"],\"situate\":[\"english\"],\"six\":[\"english\"],\"size\":[\"english\"],\"skate\":[\"english\"],\"sketch\":[\"english\"],\"ski\":[\"english\"],\"skill\":[\"english\"],\"skin\":[\"english\"],\"skirt\":[\"english\"],\"skull\":[\"english\"],\"slab\":[\"english\"],\"slam\":[\"english\"],\"sleep\":[\"english\"],\"slender\":[\"english\"],\"slice\":[\"english\"],\"slide\":[\"english\"],\"slight\":[\"english\"],\"slim\":[\"english\"],\"slogan\":[\"english\",\"turkish\"],\"slot\":[\"english\"],\"slow\":[\"english\"],\"slush\":[\"english\"],\"small\":[\"english\"],\"smart\":[\"english\"],\"smile\":[\"english\"],\"smoke\":[\"english\"],\"smooth\":[\"english\"],\"snack\":[\"english\"],\"snake\":[\"english\"],\"snap\":[\"english\"],\"sniff\":[\"english\"],\"snow\":[\"english\"],\"soap\":[\"english\"],\"soccer\":[\"english\"],\"social\":[\"english\",\"french\"],\"sock\":[\"english\"],\"soda\":[\"english\"],\"soft\":[\"english\"],\"solar\":[\"english\"],\"soldier\":[\"english\"],\"solid\":[\"english\"],\"solution\":[\"english\"],\"solve\":[\"english\"],\"someone\":[\"english\"],\"song\":[\"english\"],\"soon\":[\"english\"],\"sorry\":[\"english\"],\"sort\":[\"english\"],\"soul\":[\"english\"],\"sound\":[\"english\"],\"soup\":[\"english\"],\"source\":[\"english\",\"french\"],\"south\":[\"english\"],\"space\":[\"english\"],\"spare\":[\"english\"],\"spatial\":[\"english\",\"french\"],\"spawn\":[\"english\"],\"speak\":[\"english\"],\"special\":[\"english\"],\"speed\":[\"english\"],\"spell\":[\"english\"],\"spend\":[\"english\"],\"sphere\":[\"english\"],\"spice\":[\"english\"],\"spider\":[\"english\"],\"spike\":[\"english\"],\"spin\":[\"english\"],\"spirit\":[\"english\"],\"split\":[\"english\"],\"spoil\":[\"english\"],\"sponsor\":[\"english\",\"turkish\"],\"spoon\":[\"english\"],\"sport\":[\"english\"],\"spot\":[\"english\"],\"spray\":[\"english\"],\"spread\":[\"english\"],\"spring\":[\"english\"],\"spy\":[\"english\"],\"square\":[\"english\"],\"squeeze\":[\"english\"],\"squirrel\":[\"english\"],\"stable\":[\"english\",\"french\"],\"stadium\":[\"english\"],\"staff\":[\"english\"],\"stage\":[\"english\"],\"stairs\":[\"english\"],\"stamp\":[\"english\"],\"stand\":[\"english\"],\"start\":[\"english\"],\"state\":[\"english\"],\"stay\":[\"english\"],\"steak\":[\"english\"],\"steel\":[\"english\"],\"stem\":[\"english\"],\"step\":[\"english\"],\"stereo\":[\"english\"],\"stick\":[\"english\"],\"still\":[\"english\"],\"sting\":[\"english\"],\"stock\":[\"english\"],\"stomach\":[\"english\"],\"stone\":[\"english\"],\"stool\":[\"english\"],\"story\":[\"english\"],\"stove\":[\"english\"],\"strategy\":[\"english\"],\"street\":[\"english\"],\"strike\":[\"english\"],\"strong\":[\"english\"],\"struggle\":[\"english\"],\"student\":[\"english\"],\"stuff\":[\"english\"],\"stumble\":[\"english\"],\"style\":[\"english\"],\"subject\":[\"english\"],\"submit\":[\"english\"],\"subway\":[\"english\"],\"success\":[\"english\"],\"such\":[\"english\"],\"sudden\":[\"english\"],\"suffer\":[\"english\"],\"sugar\":[\"english\"],\"suggest\":[\"english\"],\"suit\":[\"english\"],\"summer\":[\"english\"],\"sun\":[\"english\"],\"sunny\":[\"english\"],\"sunset\":[\"english\"],\"super\":[\"english\"],\"supply\":[\"english\"],\"supreme\":[\"english\"],\"sure\":[\"english\"],\"surface\":[\"english\",\"french\"],\"surge\":[\"english\"],\"surprise\":[\"english\",\"french\"],\"surround\":[\"english\"],\"survey\":[\"english\"],\"suspect\":[\"english\",\"french\"],\"sustain\":[\"english\"],\"swallow\":[\"english\"],\"swamp\":[\"english\"],\"swap\":[\"english\"],\"swarm\":[\"english\"],\"swear\":[\"english\"],\"sweet\":[\"english\"],\"swift\":[\"english\"],\"swim\":[\"english\"],\"swing\":[\"english\"],\"switch\":[\"english\"],\"sword\":[\"english\"],\"symbol\":[\"english\"],\"symptom\":[\"english\"],\"syrup\":[\"english\"],\"system\":[\"english\"],\"table\":[\"english\"],\"tackle\":[\"english\"],\"tag\":[\"english\"],\"tail\":[\"english\"],\"talent\":[\"english\",\"french\"],\"talk\":[\"english\"],\"tank\":[\"english\"],\"tape\":[\"english\"],\"target\":[\"english\"],\"task\":[\"english\"],\"taste\":[\"english\"],\"tattoo\":[\"english\"],\"taxi\":[\"english\"],\"teach\":[\"english\"],\"team\":[\"english\"],\"tell\":[\"english\"],\"ten\":[\"english\"],\"tenant\":[\"english\"],\"tennis\":[\"english\"],\"tent\":[\"english\"],\"term\":[\"english\"],\"test\":[\"english\"],\"text\":[\"english\"],\"thank\":[\"english\"],\"that\":[\"english\"],\"theme\":[\"english\"],\"then\":[\"english\"],\"theory\":[\"english\"],\"there\":[\"english\"],\"they\":[\"english\"],\"thing\":[\"english\"],\"this\":[\"english\"],\"thought\":[\"english\"],\"three\":[\"english\"],\"thrive\":[\"english\"],\"throw\":[\"english\"],\"thumb\":[\"english\"],\"thunder\":[\"english\"],\"ticket\":[\"english\"],\"tide\":[\"english\"],\"tiger\":[\"english\"],\"tilt\":[\"english\"],\"timber\":[\"english\"],\"time\":[\"english\"],\"tiny\":[\"english\"],\"tip\":[\"english\"],\"tired\":[\"english\"],\"tissue\":[\"english\"],\"title\":[\"english\"],\"toast\":[\"english\"],\"tobacco\":[\"english\"],\"today\":[\"english\"],\"toddler\":[\"english\"],\"toe\":[\"english\"],\"together\":[\"english\"],\"toilet\":[\"english\"],\"token\":[\"english\"],\"tomato\":[\"english\"],\"tomorrow\":[\"english\"],\"tone\":[\"english\"],\"tongue\":[\"english\"],\"tonight\":[\"english\"],\"tool\":[\"english\"],\"tooth\":[\"english\"],\"top\":[\"english\"],\"topic\":[\"english\"],\"topple\":[\"english\"],\"torch\":[\"english\"],\"tornado\":[\"english\"],\"tortoise\":[\"english\"],\"toss\":[\"english\"],\"total\":[\"english\"],\"tourist\":[\"english\"],\"toward\":[\"english\"],\"tower\":[\"english\"],\"town\":[\"english\"],\"toy\":[\"english\"],\"track\":[\"english\"],\"trade\":[\"english\"],\"traffic\":[\"english\"],\"tragic\":[\"english\"],\"train\":[\"english\",\"french\"],\"transfer\":[\"english\",\"turkish\"],\"trap\":[\"english\"],\"trash\":[\"english\"],\"travel\":[\"english\"],\"tray\":[\"english\"],\"treat\":[\"english\"],\"tree\":[\"english\"],\"trend\":[\"english\"],\"trial\":[\"english\"],\"tribe\":[\"english\"],\"trick\":[\"english\"],\"trigger\":[\"english\"],\"trim\":[\"english\"],\"trip\":[\"english\"],\"trophy\":[\"english\"],\"trouble\":[\"english\"],\"truck\":[\"english\"],\"true\":[\"english\"],\"truly\":[\"english\"],\"trumpet\":[\"english\"],\"trust\":[\"english\"],\"truth\":[\"english\"],\"try\":[\"english\"],\"tube\":[\"english\"],\"tuition\":[\"english\"],\"tumble\":[\"english\"],\"tuna\":[\"english\"],\"tunnel\":[\"english\",\"french\"],\"turkey\":[\"english\"],\"turn\":[\"english\"],\"turtle\":[\"english\"],\"twelve\":[\"english\"],\"twenty\":[\"english\"],\"twice\":[\"english\"],\"twin\":[\"english\"],\"twist\":[\"english\"],\"two\":[\"english\"],\"type\":[\"english\"],\"typical\":[\"english\"],\"ugly\":[\"english\"],\"umbrella\":[\"english\"],\"unable\":[\"english\"],\"unaware\":[\"english\"],\"uncle\":[\"english\"],\"uncover\":[\"english\"],\"under\":[\"english\"],\"undo\":[\"english\"],\"unfair\":[\"english\"],\"unfold\":[\"english\"],\"unhappy\":[\"english\"],\"uniform\":[\"english\"],\"unique\":[\"english\",\"french\"],\"unit\":[\"english\"],\"universe\":[\"english\"],\"unknown\":[\"english\"],\"unlock\":[\"english\"],\"until\":[\"english\"],\"unusual\":[\"english\"],\"unveil\":[\"english\"],\"update\":[\"english\"],\"upgrade\":[\"english\"],\"uphold\":[\"english\"],\"upon\":[\"english\"],\"upper\":[\"english\"],\"upset\":[\"english\"],\"urban\":[\"english\"],\"urge\":[\"english\"],\"usage\":[\"english\",\"french\"],\"use\":[\"english\"],\"used\":[\"english\"],\"useful\":[\"english\"],\"useless\":[\"english\"],\"usual\":[\"english\"],\"utility\":[\"english\"],\"vacant\":[\"english\"],\"vacuum\":[\"english\"],\"vague\":[\"english\",\"french\"],\"valid\":[\"english\"],\"valley\":[\"english\"],\"valve\":[\"english\",\"french\"],\"van\":[\"english\"],\"vanish\":[\"english\"],\"vapor\":[\"english\"],\"various\":[\"english\"],\"vast\":[\"english\"],\"vault\":[\"english\"],\"vehicle\":[\"english\"],\"velvet\":[\"english\"],\"vendor\":[\"english\"],\"venture\":[\"english\"],\"venue\":[\"english\"],\"verb\":[\"english\"],\"verify\":[\"english\"],\"version\":[\"english\"],\"very\":[\"english\"],\"vessel\":[\"english\"],\"veteran\":[\"english\"],\"viable\":[\"english\"],\"vibrant\":[\"english\"],\"vicious\":[\"english\"],\"victory\":[\"english\"],\"video\":[\"english\"],\"view\":[\"english\"],\"village\":[\"english\",\"french\"],\"vintage\":[\"english\"],\"violin\":[\"english\"],\"virtual\":[\"english\"],\"virus\":[\"english\",\"french\"],\"visa\":[\"english\"],\"visit\":[\"english\"],\"visual\":[\"english\"],\"vital\":[\"english\",\"french\"],\"vivid\":[\"english\"],\"vocal\":[\"english\"],\"voice\":[\"english\"],\"void\":[\"english\"],\"volcano\":[\"english\"],\"volume\":[\"english\",\"french\"],\"vote\":[\"english\"],\"voyage\":[\"english\",\"french\"],\"wage\":[\"english\"],\"wagon\":[\"english\",\"french\"],\"wait\":[\"english\"],\"walk\":[\"english\"],\"wall\":[\"english\"],\"walnut\":[\"english\"],\"want\":[\"english\"],\"warfare\":[\"english\"],\"warm\":[\"english\"],\"warrior\":[\"english\"],\"wash\":[\"english\"],\"wasp\":[\"english\"],\"waste\":[\"english\"],\"water\":[\"english\"],\"wave\":[\"english\"],\"way\":[\"english\"],\"wealth\":[\"english\"],\"weapon\":[\"english\"],\"wear\":[\"english\"],\"weasel\":[\"english\"],\"weather\":[\"english\"],\"web\":[\"english\"],\"wedding\":[\"english\"],\"weekend\":[\"english\"],\"weird\":[\"english\"],\"welcome\":[\"english\"],\"west\":[\"english\"],\"wet\":[\"english\"],\"whale\":[\"english\"],\"what\":[\"english\"],\"wheat\":[\"english\"],\"wheel\":[\"english\"],\"when\":[\"english\"],\"where\":[\"english\"],\"whip\":[\"english\"],\"whisper\":[\"english\"],\"wide\":[\"english\"],\"width\":[\"english\"],\"wife\":[\"english\"],\"wild\":[\"english\"],\"will\":[\"english\"],\"win\":[\"english\"],\"window\":[\"english\"],\"wine\":[\"english\"],\"wing\":[\"english\"],\"wink\":[\"english\"],\"winner\":[\"english\"],\"winter\":[\"english\"],\"wire\":[\"english\"],\"wisdom\":[\"english\"],\"wise\":[\"english\"],\"wish\":[\"english\"],\"witness\":[\"english\"],\"wolf\":[\"english\"],\"woman\":[\"english\"],\"wonder\":[\"english\"],\"wood\":[\"english\"],\"wool\":[\"english\"],\"word\":[\"english\"],\"work\":[\"english\"],\"world\":[\"english\"],\"worry\":[\"english\"],\"worth\":[\"english\"],\"wrap\":[\"english\"],\"wreck\":[\"english\"],\"wrestle\":[\"english\"],\"wrist\":[\"english\"],\"write\":[\"english\"],\"wrong\":[\"english\"],\"yard\":[\"english\"],\"year\":[\"english\"],\"yellow\":[\"english\"],\"you\":[\"english\"],\"young\":[\"english\"],\"youth\":[\"english\"],\"zebra\":[\"english\"],\"zero\":[\"english\"],\"zone\":[\"english\"],\"zoo\":[\"english\"],\"abaisser\":[\"french\"],\"abdiquer\":[\"french\"],\"abeille\":[\"french\"],\"abolir\":[\"french\"],\"aborder\":[\"french\"],\"aboutir\":[\"french\"],\"aboyer\":[\"french\"],\"abrasif\":[\"french\"],\"abreuver\":[\"french\"],\"abriter\":[\"french\"],\"abroger\":[\"french\"],\"abrupt\":[\"french\"],\"absence\":[\"french\"],\"absolu\":[\"french\"],\"absurde\":[\"french\"],\"abusif\":[\"french\"],\"abyssal\":[\"french\"],\"académie\":[\"french\"],\"acajou\":[\"french\"],\"acarien\":[\"french\"],\"accabler\":[\"french\"],\"accepter\":[\"french\"],\"acclamer\":[\"french\"],\"accolade\":[\"french\"],\"accroche\":[\"french\"],\"accuser\":[\"french\"],\"acerbe\":[\"french\"],\"achat\":[\"french\"],\"acheter\":[\"french\"],\"aciduler\":[\"french\"],\"acier\":[\"french\"],\"acompte\":[\"french\"],\"acquérir\":[\"french\"],\"acronyme\":[\"french\"],\"acteur\":[\"french\"],\"actif\":[\"french\"],\"actuel\":[\"french\"],\"adepte\":[\"french\"],\"adéquat\":[\"french\"],\"adhésif\":[\"french\"],\"adjectif\":[\"french\"],\"adjuger\":[\"french\"],\"admettre\":[\"french\"],\"admirer\":[\"french\"],\"adopter\":[\"french\"],\"adorer\":[\"french\"],\"adoucir\":[\"french\"],\"adresse\":[\"french\"],\"adroit\":[\"french\"],\"adulte\":[\"french\"],\"adverbe\":[\"french\"],\"aérer\":[\"french\"],\"aéronef\":[\"french\"],\"affaire\":[\"french\"],\"affecter\":[\"french\"],\"affiche\":[\"french\"],\"affreux\":[\"french\"],\"affubler\":[\"french\"],\"agacer\":[\"french\"],\"agencer\":[\"french\"],\"agile\":[\"french\"],\"agiter\":[\"french\"],\"agrafer\":[\"french\"],\"agréable\":[\"french\"],\"agrume\":[\"french\"],\"aider\":[\"french\"],\"aiguille\":[\"french\"],\"ailier\":[\"french\"],\"aimable\":[\"french\"],\"aisance\":[\"french\"],\"ajouter\":[\"french\"],\"ajuster\":[\"french\"],\"alarmer\":[\"french\"],\"alchimie\":[\"french\"],\"alerte\":[\"french\"],\"algèbre\":[\"french\"],\"algue\":[\"french\"],\"aliéner\":[\"french\"],\"aliment\":[\"french\"],\"alléger\":[\"french\"],\"alliage\":[\"french\"],\"allouer\":[\"french\"],\"allumer\":[\"french\"],\"alourdir\":[\"french\"],\"alpaga\":[\"french\"],\"altesse\":[\"french\"],\"alvéole\":[\"french\"],\"ambigu\":[\"french\"],\"ambre\":[\"french\"],\"aménager\":[\"french\"],\"amertume\":[\"french\"],\"amidon\":[\"french\"],\"amiral\":[\"french\"],\"amorcer\":[\"french\"],\"amour\":[\"french\"],\"amovible\":[\"french\"],\"amphibie\":[\"french\"],\"ampleur\":[\"french\"],\"amusant\":[\"french\"],\"analyse\":[\"french\"],\"anaphore\":[\"french\"],\"anarchie\":[\"french\"],\"anatomie\":[\"french\"],\"ancien\":[\"french\"],\"anéantir\":[\"french\"],\"angoisse\":[\"french\"],\"anguleux\":[\"french\"],\"annexer\":[\"french\"],\"annonce\":[\"french\"],\"annuel\":[\"french\"],\"anodin\":[\"french\"],\"anomalie\":[\"french\"],\"anonyme\":[\"french\"],\"anormal\":[\"french\"],\"antenne\":[\"french\"],\"antidote\":[\"french\"],\"anxieux\":[\"french\"],\"apaiser\":[\"french\"],\"apéritif\":[\"french\"],\"aplanir\":[\"french\"],\"apologie\":[\"french\"],\"appareil\":[\"french\"],\"appeler\":[\"french\"],\"apporter\":[\"french\"],\"appuyer\":[\"french\"],\"aquarium\":[\"french\"],\"aqueduc\":[\"french\"],\"arbitre\":[\"french\"],\"arbuste\":[\"french\"],\"ardeur\":[\"french\"],\"ardoise\":[\"french\"],\"argent\":[\"french\"],\"arlequin\":[\"french\"],\"armature\":[\"french\"],\"armement\":[\"french\"],\"armoire\":[\"french\"],\"armure\":[\"french\"],\"arpenter\":[\"french\"],\"arracher\":[\"french\"],\"arriver\":[\"french\"],\"arroser\":[\"french\"],\"arsenic\":[\"french\"],\"artériel\":[\"french\"],\"article\":[\"french\"],\"asphalte\":[\"french\"],\"aspirer\":[\"french\"],\"assaut\":[\"french\"],\"asservir\":[\"french\"],\"assiette\":[\"french\"],\"associer\":[\"french\"],\"assurer\":[\"french\"],\"asticot\":[\"french\"],\"astre\":[\"french\"],\"astuce\":[\"french\"],\"atelier\":[\"french\"],\"atome\":[\"french\"],\"atrium\":[\"french\"],\"atroce\":[\"french\"],\"attaque\":[\"french\"],\"attentif\":[\"french\"],\"attirer\":[\"french\"],\"attraper\":[\"french\"],\"aubaine\":[\"french\"],\"auberge\":[\"french\"],\"audace\":[\"french\"],\"audible\":[\"french\"],\"augurer\":[\"french\"],\"aurore\":[\"french\"],\"automne\":[\"french\"],\"autruche\":[\"french\"],\"avaler\":[\"french\"],\"avancer\":[\"french\"],\"avarice\":[\"french\"],\"avenir\":[\"french\"],\"averse\":[\"french\"],\"aveugle\":[\"french\"],\"aviateur\":[\"french\"],\"avide\":[\"french\"],\"avion\":[\"french\"],\"aviser\":[\"french\"],\"avoine\":[\"french\"],\"avouer\":[\"french\"],\"avril\":[\"french\"],\"axial\":[\"french\"],\"axiome\":[\"french\"],\"bafouer\":[\"french\"],\"bagage\":[\"french\"],\"baguette\":[\"french\"],\"baignade\":[\"french\"],\"balancer\":[\"french\"],\"balcon\":[\"french\"],\"baleine\":[\"french\"],\"balisage\":[\"french\"],\"bambin\":[\"french\"],\"bancaire\":[\"french\"],\"bandage\":[\"french\"],\"banlieue\":[\"french\"],\"bannière\":[\"french\"],\"banquier\":[\"french\"],\"barbier\":[\"french\"],\"baril\":[\"french\"],\"baron\":[\"french\"],\"barque\":[\"french\"],\"barrage\":[\"french\"],\"bassin\":[\"french\"],\"bastion\":[\"french\"],\"bataille\":[\"french\"],\"bateau\":[\"french\"],\"batterie\":[\"french\"],\"baudrier\":[\"french\"],\"bavarder\":[\"french\"],\"belette\":[\"french\"],\"bélier\":[\"french\"],\"belote\":[\"french\"],\"bénéfice\":[\"french\"],\"berceau\":[\"french\"],\"berger\":[\"french\"],\"berline\":[\"french\"],\"bermuda\":[\"french\",\"turkish\"],\"besace\":[\"french\"],\"besogne\":[\"french\"],\"bétail\":[\"french\"],\"beurre\":[\"french\"],\"biberon\":[\"french\"],\"bidule\":[\"french\"],\"bijou\":[\"french\"],\"bilan\":[\"french\"],\"bilingue\":[\"french\"],\"billard\":[\"french\"],\"binaire\":[\"french\"],\"biologie\":[\"french\"],\"biopsie\":[\"french\"],\"biotype\":[\"french\"],\"biscuit\":[\"french\"],\"bison\":[\"french\"],\"bistouri\":[\"french\"],\"bitume\":[\"french\"],\"bizarre\":[\"french\"],\"blafard\":[\"french\"],\"blague\":[\"french\"],\"blanchir\":[\"french\"],\"blessant\":[\"french\"],\"blinder\":[\"french\"],\"blond\":[\"french\"],\"bloquer\":[\"french\"],\"blouson\":[\"french\"],\"bobard\":[\"french\"],\"bobine\":[\"french\"],\"boire\":[\"french\"],\"boiser\":[\"french\"],\"bolide\":[\"french\"],\"bonbon\":[\"french\"],\"bondir\":[\"french\"],\"bonheur\":[\"french\"],\"bonifier\":[\"french\"],\"bordure\":[\"french\"],\"borne\":[\"french\"],\"botte\":[\"french\"],\"boucle\":[\"french\"],\"boueux\":[\"french\"],\"bougie\":[\"french\"],\"boulon\":[\"french\"],\"bouquin\":[\"french\"],\"bourse\":[\"french\"],\"boussole\":[\"french\"],\"boutique\":[\"french\"],\"boxeur\":[\"french\"],\"branche\":[\"french\"],\"brasier\":[\"french\"],\"brebis\":[\"french\"],\"brèche\":[\"french\"],\"breuvage\":[\"french\"],\"bricoler\":[\"french\"],\"brigade\":[\"french\"],\"brillant\":[\"french\"],\"brioche\":[\"french\"],\"brique\":[\"french\"],\"brochure\":[\"french\"],\"broder\":[\"french\"],\"bronzer\":[\"french\"],\"brousse\":[\"french\"],\"broyeur\":[\"french\"],\"brume\":[\"french\"],\"brusque\":[\"french\"],\"brutal\":[\"french\"],\"bruyant\":[\"french\"],\"buffle\":[\"french\"],\"buisson\":[\"french\"],\"bulletin\":[\"french\"],\"bureau\":[\"french\"],\"burin\":[\"french\"],\"bustier\":[\"french\"],\"butiner\":[\"french\"],\"butoir\":[\"french\"],\"buvable\":[\"french\"],\"buvette\":[\"french\"],\"cabanon\":[\"french\"],\"cabine\":[\"french\"],\"cachette\":[\"french\"],\"cadeau\":[\"french\"],\"cadre\":[\"french\"],\"caféine\":[\"french\"],\"caillou\":[\"french\"],\"caisson\":[\"french\"],\"calculer\":[\"french\"],\"calepin\":[\"french\"],\"calibre\":[\"french\"],\"calmer\":[\"french\"],\"calomnie\":[\"french\"],\"calvaire\":[\"french\"],\"camarade\":[\"french\"],\"caméra\":[\"french\"],\"camion\":[\"french\"],\"campagne\":[\"french\"],\"caneton\":[\"french\"],\"canon\":[\"french\"],\"cantine\":[\"french\"],\"canular\":[\"french\"],\"caporal\":[\"french\"],\"caprice\":[\"french\"],\"capsule\":[\"french\"],\"capter\":[\"french\"],\"capuche\":[\"french\"],\"carabine\":[\"french\"],\"carbone\":[\"french\"],\"caresser\":[\"french\"],\"caribou\":[\"french\"],\"carnage\":[\"french\"],\"carotte\":[\"french\"],\"carreau\":[\"french\"],\"carton\":[\"french\"],\"cascade\":[\"french\"],\"casier\":[\"french\"],\"casque\":[\"french\"],\"cassure\":[\"french\"],\"causer\":[\"french\"],\"cavalier\":[\"french\"],\"caverne\":[\"french\"],\"caviar\":[\"french\"],\"cédille\":[\"french\"],\"ceinture\":[\"french\"],\"céleste\":[\"french\"],\"cellule\":[\"french\"],\"cendrier\":[\"french\"],\"censurer\":[\"french\"],\"central\":[\"french\"],\"cercle\":[\"french\"],\"cérébral\":[\"french\"],\"cerise\":[\"french\"],\"cerner\":[\"french\"],\"cerveau\":[\"french\"],\"cesser\":[\"french\"],\"chagrin\":[\"french\"],\"chaise\":[\"french\"],\"chaleur\":[\"french\"],\"chambre\":[\"french\"],\"chance\":[\"french\"],\"chapitre\":[\"french\"],\"charbon\":[\"french\"],\"chasseur\":[\"french\"],\"chaton\":[\"french\"],\"chausson\":[\"french\"],\"chavirer\":[\"french\"],\"chemise\":[\"french\"],\"chenille\":[\"french\"],\"chéquier\":[\"french\"],\"chercher\":[\"french\"],\"cheval\":[\"french\"],\"chien\":[\"french\"],\"chiffre\":[\"french\"],\"chignon\":[\"french\"],\"chimère\":[\"french\"],\"chiot\":[\"french\"],\"chlorure\":[\"french\"],\"chocolat\":[\"french\"],\"choisir\":[\"french\"],\"chose\":[\"french\"],\"chouette\":[\"french\"],\"chrome\":[\"french\"],\"chute\":[\"french\"],\"cigare\":[\"french\"],\"cigogne\":[\"french\"],\"cimenter\":[\"french\"],\"cinéma\":[\"french\"],\"cintrer\":[\"french\"],\"circuler\":[\"french\"],\"cirer\":[\"french\"],\"cirque\":[\"french\"],\"citerne\":[\"french\"],\"citoyen\":[\"french\"],\"citron\":[\"french\"],\"clairon\":[\"french\"],\"clameur\":[\"french\"],\"claquer\":[\"french\"],\"classe\":[\"french\"],\"clavier\":[\"french\"],\"cligner\":[\"french\"],\"climat\":[\"french\"],\"clivage\":[\"french\"],\"cloche\":[\"french\"],\"clonage\":[\"french\"],\"cloporte\":[\"french\"],\"cobalt\":[\"french\"],\"cobra\":[\"french\"],\"cocasse\":[\"french\"],\"cocotier\":[\"french\"],\"coder\":[\"french\"],\"codifier\":[\"french\"],\"coffre\":[\"french\"],\"cogner\":[\"french\"],\"cohésion\":[\"french\"],\"coiffer\":[\"french\"],\"coincer\":[\"french\"],\"colère\":[\"french\"],\"colibri\":[\"french\"],\"colline\":[\"french\"],\"colmater\":[\"french\"],\"colonel\":[\"french\"],\"combat\":[\"french\"],\"comédie\":[\"french\"],\"commande\":[\"french\"],\"compact\":[\"french\"],\"conduire\":[\"french\"],\"confier\":[\"french\"],\"congeler\":[\"french\"],\"connoter\":[\"french\"],\"consonne\":[\"french\"],\"contact\":[\"french\"],\"convexe\":[\"french\"],\"copain\":[\"french\"],\"copie\":[\"french\"],\"corail\":[\"french\"],\"corbeau\":[\"french\"],\"cordage\":[\"french\"],\"corniche\":[\"french\"],\"corpus\":[\"french\"],\"cortège\":[\"french\"],\"cosmique\":[\"french\"],\"costume\":[\"french\"],\"coton\":[\"french\"],\"coude\":[\"french\"],\"coupure\":[\"french\"],\"courage\":[\"french\"],\"couteau\":[\"french\"],\"couvrir\":[\"french\"],\"crabe\":[\"french\"],\"crainte\":[\"french\"],\"cravate\":[\"french\"],\"crayon\":[\"french\"],\"créature\":[\"french\"],\"créditer\":[\"french\"],\"crémeux\":[\"french\"],\"creuser\":[\"french\"],\"crevette\":[\"french\"],\"cribler\":[\"french\"],\"crier\":[\"french\"],\"cristal\":[\"french\"],\"critère\":[\"french\"],\"croire\":[\"french\"],\"croquer\":[\"french\"],\"crotale\":[\"french\"],\"crypter\":[\"french\"],\"cubique\":[\"french\"],\"cueillir\":[\"french\"],\"cuillère\":[\"french\"],\"cuisine\":[\"french\"],\"cuivre\":[\"french\"],\"culminer\":[\"french\"],\"cultiver\":[\"french\"],\"cumuler\":[\"french\"],\"cupide\":[\"french\"],\"curatif\":[\"french\"],\"curseur\":[\"french\"],\"cyanure\":[\"french\"],\"cylindre\":[\"french\"],\"cynique\":[\"french\"],\"daigner\":[\"french\"],\"damier\":[\"french\"],\"danseur\":[\"french\"],\"dauphin\":[\"french\"],\"débattre\":[\"french\"],\"débiter\":[\"french\"],\"déborder\":[\"french\"],\"débrider\":[\"french\"],\"débutant\":[\"french\"],\"décaler\":[\"french\"],\"décembre\":[\"french\"],\"déchirer\":[\"french\"],\"décider\":[\"french\"],\"déclarer\":[\"french\"],\"décorer\":[\"french\"],\"décrire\":[\"french\"],\"décupler\":[\"french\"],\"dédale\":[\"french\"],\"déductif\":[\"french\"],\"déesse\":[\"french\"],\"défensif\":[\"french\"],\"défiler\":[\"french\"],\"défrayer\":[\"french\"],\"dégager\":[\"french\"],\"dégivrer\":[\"french\"],\"déglutir\":[\"french\"],\"dégrafer\":[\"french\"],\"déjeuner\":[\"french\"],\"délice\":[\"french\"],\"déloger\":[\"french\"],\"demander\":[\"french\"],\"demeurer\":[\"french\"],\"démolir\":[\"french\"],\"dénicher\":[\"french\"],\"dénouer\":[\"french\"],\"dentelle\":[\"french\"],\"dénuder\":[\"french\"],\"départ\":[\"french\"],\"dépenser\":[\"french\"],\"déphaser\":[\"french\"],\"déplacer\":[\"french\"],\"déposer\":[\"french\"],\"déranger\":[\"french\"],\"dérober\":[\"french\"],\"désastre\":[\"french\"],\"descente\":[\"french\"],\"désert\":[\"french\"],\"désigner\":[\"french\"],\"désobéir\":[\"french\"],\"dessiner\":[\"french\"],\"destrier\":[\"french\"],\"détacher\":[\"french\"],\"détester\":[\"french\"],\"détourer\":[\"french\"],\"détresse\":[\"french\"],\"devancer\":[\"french\"],\"devenir\":[\"french\"],\"deviner\":[\"french\"],\"devoir\":[\"french\"],\"diable\":[\"french\"],\"dialogue\":[\"french\"],\"diamant\":[\"french\"],\"dicter\":[\"french\"],\"différer\":[\"french\"],\"digérer\":[\"french\"],\"digne\":[\"french\"],\"diluer\":[\"french\"],\"dimanche\":[\"french\"],\"diminuer\":[\"french\"],\"dioxyde\":[\"french\"],\"directif\":[\"french\"],\"diriger\":[\"french\"],\"discuter\":[\"french\"],\"disposer\":[\"french\"],\"dissiper\":[\"french\"],\"divertir\":[\"french\"],\"diviser\":[\"french\"],\"docile\":[\"french\"],\"docteur\":[\"french\"],\"dogme\":[\"french\"],\"doigt\":[\"french\"],\"domaine\":[\"french\"],\"domicile\":[\"french\"],\"dompter\":[\"french\"],\"donateur\":[\"french\"],\"donjon\":[\"french\"],\"donner\":[\"french\"],\"dopamine\":[\"french\"],\"dortoir\":[\"french\"],\"dorure\":[\"french\"],\"dosage\":[\"french\"],\"doseur\":[\"french\"],\"dossier\":[\"french\"],\"dotation\":[\"french\"],\"douanier\":[\"french\"],\"douceur\":[\"french\"],\"douter\":[\"french\"],\"doyen\":[\"french\"],\"draper\":[\"french\"],\"dresser\":[\"french\"],\"dribbler\":[\"french\"],\"droiture\":[\"french\"],\"duperie\":[\"french\"],\"duplexe\":[\"french\"],\"durable\":[\"french\"],\"durcir\":[\"french\"],\"dynastie\":[\"french\"],\"éblouir\":[\"french\"],\"écarter\":[\"french\"],\"écharpe\":[\"french\"],\"échelle\":[\"french\"],\"éclairer\":[\"french\"],\"éclipse\":[\"french\"],\"éclore\":[\"french\"],\"écluse\":[\"french\"],\"école\":[\"french\"],\"économie\":[\"french\"],\"écorce\":[\"french\"],\"écouter\":[\"french\"],\"écraser\":[\"french\"],\"écrémer\":[\"french\"],\"écrivain\":[\"french\"],\"écrou\":[\"french\"],\"écume\":[\"french\"],\"écureuil\":[\"french\"],\"édifier\":[\"french\"],\"éduquer\":[\"french\"],\"effacer\":[\"french\"],\"effectif\":[\"french\"],\"effigie\":[\"french\"],\"effrayer\":[\"french\"],\"effusion\":[\"french\"],\"égaliser\":[\"french\"],\"égarer\":[\"french\"],\"éjecter\":[\"french\"],\"élaborer\":[\"french\"],\"élargir\":[\"french\"],\"électron\":[\"french\"],\"élégant\":[\"french\"],\"éléphant\":[\"french\"],\"élève\":[\"french\"],\"éligible\":[\"french\"],\"élitisme\":[\"french\"],\"éloge\":[\"french\"],\"élucider\":[\"french\"],\"éluder\":[\"french\"],\"emballer\":[\"french\"],\"embellir\":[\"french\"],\"embryon\":[\"french\"],\"émeraude\":[\"french\"],\"émission\":[\"french\"],\"emmener\":[\"french\"],\"émotion\":[\"french\"],\"émouvoir\":[\"french\"],\"empereur\":[\"french\"],\"employer\":[\"french\"],\"emporter\":[\"french\"],\"emprise\":[\"french\"],\"émulsion\":[\"french\"],\"encadrer\":[\"french\"],\"enchère\":[\"french\"],\"enclave\":[\"french\"],\"encoche\":[\"french\"],\"endiguer\":[\"french\"],\"endosser\":[\"french\"],\"endroit\":[\"french\"],\"enduire\":[\"french\"],\"énergie\":[\"french\"],\"enfance\":[\"french\"],\"enfermer\":[\"french\"],\"enfouir\":[\"french\"],\"engager\":[\"french\"],\"engin\":[\"french\",\"turkish\"],\"englober\":[\"french\"],\"énigme\":[\"french\"],\"enjamber\":[\"french\"],\"enjeu\":[\"french\"],\"enlever\":[\"french\"],\"ennemi\":[\"french\"],\"ennuyeux\":[\"french\"],\"enrichir\":[\"french\"],\"enrobage\":[\"french\"],\"enseigne\":[\"french\"],\"entasser\":[\"french\"],\"entendre\":[\"french\"],\"entier\":[\"french\"],\"entourer\":[\"french\"],\"entraver\":[\"french\"],\"énumérer\":[\"french\"],\"envahir\":[\"french\"],\"enviable\":[\"french\"],\"envoyer\":[\"french\"],\"enzyme\":[\"french\"],\"éolien\":[\"french\"],\"épaissir\":[\"french\"],\"épargne\":[\"french\"],\"épatant\":[\"french\"],\"épaule\":[\"french\"],\"épicerie\":[\"french\"],\"épidémie\":[\"french\"],\"épier\":[\"french\"],\"épilogue\":[\"french\"],\"épine\":[\"french\"],\"épisode\":[\"french\"],\"épitaphe\":[\"french\"],\"époque\":[\"french\"],\"épreuve\":[\"french\"],\"éprouver\":[\"french\"],\"épuisant\":[\"french\"],\"équerre\":[\"french\"],\"équipe\":[\"french\"],\"ériger\":[\"french\"],\"érosion\":[\"french\"],\"erreur\":[\"french\"],\"éruption\":[\"french\"],\"escalier\":[\"french\"],\"espadon\":[\"french\"],\"espèce\":[\"french\"],\"espiègle\":[\"french\"],\"espoir\":[\"french\"],\"esprit\":[\"french\"],\"esquiver\":[\"french\"],\"essayer\":[\"french\"],\"essieu\":[\"french\"],\"essorer\":[\"french\"],\"estime\":[\"french\"],\"estomac\":[\"french\"],\"estrade\":[\"french\"],\"étagère\":[\"french\"],\"étaler\":[\"french\"],\"étanche\":[\"french\"],\"étatique\":[\"french\"],\"éteindre\":[\"french\"],\"étendoir\":[\"french\"],\"éternel\":[\"french\"],\"éthanol\":[\"french\"],\"éthique\":[\"french\"],\"ethnie\":[\"french\"],\"étirer\":[\"french\"],\"étoffer\":[\"french\"],\"étoile\":[\"french\"],\"étonnant\":[\"french\"],\"étourdir\":[\"french\"],\"étrange\":[\"french\"],\"étroit\":[\"french\"],\"étude\":[\"french\"],\"euphorie\":[\"french\"],\"évaluer\":[\"french\"],\"évasion\":[\"french\"],\"éventail\":[\"french\"],\"évidence\":[\"french\"],\"éviter\":[\"french\"],\"évolutif\":[\"french\"],\"évoquer\":[\"french\"],\"exagérer\":[\"french\"],\"exaucer\":[\"french\"],\"exceller\":[\"french\"],\"excitant\":[\"french\"],\"exclusif\":[\"french\"],\"exécuter\":[\"french\"],\"exemple\":[\"french\"],\"exercer\":[\"french\"],\"exhaler\":[\"french\"],\"exhorter\":[\"french\"],\"exigence\":[\"french\"],\"exiler\":[\"french\"],\"exister\":[\"french\"],\"exotique\":[\"french\"],\"expédier\":[\"french\"],\"explorer\":[\"french\"],\"exposer\":[\"french\"],\"exprimer\":[\"french\"],\"exquis\":[\"french\"],\"extensif\":[\"french\"],\"extraire\":[\"french\"],\"exulter\":[\"french\"],\"fable\":[\"french\"],\"fabuleux\":[\"french\"],\"facette\":[\"french\"],\"facile\":[\"french\"],\"facture\":[\"french\"],\"faiblir\":[\"french\"],\"falaise\":[\"french\"],\"fameux\":[\"french\"],\"famille\":[\"french\"],\"farceur\":[\"french\"],\"farfelu\":[\"french\"],\"farine\":[\"french\"],\"farouche\":[\"french\"],\"fasciner\":[\"french\"],\"faucon\":[\"french\"],\"fautif\":[\"french\"],\"faveur\":[\"french\"],\"favori\":[\"french\",\"turkish\"],\"fébrile\":[\"french\"],\"féconder\":[\"french\"],\"fédérer\":[\"french\"],\"félin\":[\"french\"],\"femme\":[\"french\"],\"fémur\":[\"french\"],\"fendoir\":[\"french\"],\"féodal\":[\"french\"],\"fermer\":[\"french\"],\"féroce\":[\"french\"],\"ferveur\":[\"french\"],\"feuille\":[\"french\"],\"feutre\":[\"french\"],\"février\":[\"french\"],\"fiasco\":[\"french\"],\"ficeler\":[\"french\"],\"fictif\":[\"french\"],\"fidèle\":[\"french\"],\"filature\":[\"french\"],\"filetage\":[\"french\"],\"filière\":[\"french\"],\"filleul\":[\"french\"],\"filmer\":[\"french\"],\"filou\":[\"french\"],\"filtrer\":[\"french\"],\"financer\":[\"french\"],\"finir\":[\"french\"],\"fiole\":[\"french\"],\"firme\":[\"french\"],\"fissure\":[\"french\"],\"fixer\":[\"french\"],\"flairer\":[\"french\"],\"flamme\":[\"french\"],\"flasque\":[\"french\"],\"flatteur\":[\"french\"],\"fléau\":[\"french\"],\"flèche\":[\"french\"],\"fleur\":[\"french\"],\"flexion\":[\"french\"],\"flocon\":[\"french\"],\"flore\":[\"french\"],\"fluctuer\":[\"french\"],\"fluide\":[\"french\"],\"fluvial\":[\"french\"],\"folie\":[\"french\"],\"fonderie\":[\"french\"],\"fongible\":[\"french\"],\"fontaine\":[\"french\"],\"forcer\":[\"french\"],\"forgeron\":[\"french\"],\"formuler\":[\"french\"],\"fossile\":[\"french\"],\"foudre\":[\"french\"],\"fougère\":[\"french\"],\"fouiller\":[\"french\"],\"foulure\":[\"french\"],\"fourmi\":[\"french\"],\"fraise\":[\"french\"],\"franchir\":[\"french\"],\"frapper\":[\"french\"],\"frayeur\":[\"french\"],\"frégate\":[\"french\"],\"freiner\":[\"french\"],\"frelon\":[\"french\"],\"frémir\":[\"french\"],\"frénésie\":[\"french\"],\"frère\":[\"french\"],\"friable\":[\"french\"],\"friction\":[\"french\"],\"frisson\":[\"french\"],\"frivole\":[\"french\"],\"froid\":[\"french\"],\"fromage\":[\"french\"],\"frontal\":[\"french\"],\"frotter\":[\"french\"],\"fugitif\":[\"french\"],\"fuite\":[\"french\"],\"fureur\":[\"french\"],\"furieux\":[\"french\"],\"furtif\":[\"french\"],\"fusion\":[\"french\"],\"futur\":[\"french\"],\"gagner\":[\"french\"],\"galaxie\":[\"french\"],\"galerie\":[\"french\"],\"gambader\":[\"french\"],\"garantir\":[\"french\"],\"gardien\":[\"french\"],\"garnir\":[\"french\"],\"garrigue\":[\"french\"],\"gazelle\":[\"french\"],\"gazon\":[\"french\"],\"géant\":[\"french\"],\"gélatine\":[\"french\"],\"gélule\":[\"french\"],\"gendarme\":[\"french\"],\"général\":[\"french\"],\"génie\":[\"french\"],\"genou\":[\"french\"],\"gentil\":[\"french\"],\"géologie\":[\"french\"],\"géomètre\":[\"french\"],\"géranium\":[\"french\"],\"germe\":[\"french\"],\"gestuel\":[\"french\"],\"geyser\":[\"french\"],\"gibier\":[\"french\"],\"gicler\":[\"french\"],\"girafe\":[\"french\"],\"givre\":[\"french\"],\"glace\":[\"french\"],\"glaive\":[\"french\"],\"glisser\":[\"french\"],\"gloire\":[\"french\"],\"glorieux\":[\"french\"],\"golfeur\":[\"french\"],\"gomme\":[\"french\"],\"gonfler\":[\"french\"],\"gorge\":[\"french\"],\"gorille\":[\"french\"],\"goudron\":[\"french\"],\"gouffre\":[\"french\"],\"goulot\":[\"french\"],\"goupille\":[\"french\"],\"gourmand\":[\"french\"],\"goutte\":[\"french\"],\"graduel\":[\"french\"],\"graffiti\":[\"french\"],\"graine\":[\"french\"],\"grand\":[\"french\"],\"grappin\":[\"french\"],\"gratuit\":[\"french\"],\"gravir\":[\"french\"],\"grenat\":[\"french\"],\"griffure\":[\"french\"],\"griller\":[\"french\"],\"grimper\":[\"french\"],\"grogner\":[\"french\"],\"gronder\":[\"french\"],\"grotte\":[\"french\"],\"groupe\":[\"french\"],\"gruger\":[\"french\"],\"grutier\":[\"french\"],\"gruyère\":[\"french\"],\"guépard\":[\"french\"],\"guerrier\":[\"french\"],\"guimauve\":[\"french\"],\"guitare\":[\"french\"],\"gustatif\":[\"french\"],\"gymnaste\":[\"french\"],\"gyrostat\":[\"french\"],\"habitude\":[\"french\"],\"hachoir\":[\"french\"],\"halte\":[\"french\"],\"hameau\":[\"french\"],\"hangar\":[\"french\",\"turkish\"],\"hanneton\":[\"french\"],\"haricot\":[\"french\"],\"harmonie\":[\"french\"],\"harpon\":[\"french\"],\"hasard\":[\"french\"],\"hélium\":[\"french\"],\"hématome\":[\"french\"],\"herbe\":[\"french\"],\"hérisson\":[\"french\"],\"hermine\":[\"french\"],\"héron\":[\"french\"],\"hésiter\":[\"french\"],\"heureux\":[\"french\"],\"hiberner\":[\"french\"],\"hibou\":[\"french\"],\"hilarant\":[\"french\"],\"histoire\":[\"french\"],\"hiver\":[\"french\"],\"homard\":[\"french\"],\"hommage\":[\"french\"],\"homogène\":[\"french\"],\"honneur\":[\"french\"],\"honorer\":[\"french\"],\"honteux\":[\"french\"],\"horde\":[\"french\"],\"horizon\":[\"french\"],\"horloge\":[\"french\"],\"hormone\":[\"french\"],\"horrible\":[\"french\"],\"houleux\":[\"french\"],\"housse\":[\"french\"],\"hublot\":[\"french\"],\"huileux\":[\"french\"],\"humain\":[\"french\"],\"humide\":[\"french\"],\"humour\":[\"french\"],\"hurler\":[\"french\"],\"hydromel\":[\"french\"],\"hygiène\":[\"french\"],\"hymne\":[\"french\"],\"hypnose\":[\"french\"],\"idylle\":[\"french\"],\"ignorer\":[\"french\"],\"iguane\":[\"french\"],\"illicite\":[\"french\"],\"illusion\":[\"french\"],\"imbiber\":[\"french\"],\"imiter\":[\"french\"],\"immobile\":[\"french\"],\"immuable\":[\"french\"],\"impérial\":[\"french\"],\"implorer\":[\"french\"],\"imposer\":[\"french\"],\"imprimer\":[\"french\"],\"imputer\":[\"french\"],\"incarner\":[\"french\"],\"incendie\":[\"french\"],\"incident\":[\"french\"],\"incliner\":[\"french\"],\"incolore\":[\"french\"],\"indexer\":[\"french\"],\"indice\":[\"french\"],\"inductif\":[\"french\"],\"inédit\":[\"french\"],\"ineptie\":[\"french\"],\"inexact\":[\"french\"],\"infini\":[\"french\"],\"infliger\":[\"french\"],\"informer\":[\"french\"],\"infusion\":[\"french\"],\"ingérer\":[\"french\"],\"inhaler\":[\"french\"],\"inhiber\":[\"french\"],\"injecter\":[\"french\"],\"injure\":[\"french\"],\"inoculer\":[\"french\"],\"inonder\":[\"french\"],\"inscrire\":[\"french\"],\"insecte\":[\"french\"],\"insigne\":[\"french\"],\"insolite\":[\"french\"],\"inspirer\":[\"french\"],\"instinct\":[\"french\"],\"insulter\":[\"french\"],\"intense\":[\"french\"],\"intime\":[\"french\"],\"intrigue\":[\"french\"],\"intuitif\":[\"french\"],\"inutile\":[\"french\"],\"invasion\":[\"french\"],\"inventer\":[\"french\"],\"inviter\":[\"french\"],\"invoquer\":[\"french\"],\"ironique\":[\"french\"],\"irradier\":[\"french\"],\"irréel\":[\"french\"],\"irriter\":[\"french\"],\"isoler\":[\"french\"],\"ivoire\":[\"french\"],\"ivresse\":[\"french\"],\"jaillir\":[\"french\"],\"jambe\":[\"french\"],\"janvier\":[\"french\"],\"jardin\":[\"french\"],\"jauger\":[\"french\"],\"jaune\":[\"french\"],\"javelot\":[\"french\"],\"jetable\":[\"french\"],\"jeton\":[\"french\"],\"jeudi\":[\"french\"],\"jeunesse\":[\"french\"],\"joindre\":[\"french\"],\"joncher\":[\"french\"],\"jongler\":[\"french\"],\"joueur\":[\"french\"],\"jouissif\":[\"french\"],\"journal\":[\"french\"],\"jovial\":[\"french\"],\"joyau\":[\"french\"],\"joyeux\":[\"french\"],\"jubiler\":[\"french\"],\"jugement\":[\"french\"],\"jupon\":[\"french\"],\"juriste\":[\"french\"],\"justice\":[\"french\"],\"juteux\":[\"french\"],\"juvénile\":[\"french\"],\"kayak\":[\"french\"],\"kimono\":[\"french\"],\"kiosque\":[\"french\"],\"labial\":[\"french\"],\"labourer\":[\"french\"],\"lacérer\":[\"french\"],\"lactose\":[\"french\"],\"lagune\":[\"french\"],\"laine\":[\"french\"],\"laisser\":[\"french\"],\"laitier\":[\"french\"],\"lambeau\":[\"french\"],\"lamelle\":[\"french\"],\"lampe\":[\"french\"],\"lanceur\":[\"french\"],\"langage\":[\"french\"],\"lanterne\":[\"french\"],\"lapin\":[\"french\"],\"largeur\":[\"french\"],\"larme\":[\"french\"],\"laurier\":[\"french\"],\"lavabo\":[\"french\"],\"lavoir\":[\"french\"],\"légal\":[\"french\"],\"léger\":[\"french\"],\"légume\":[\"french\"],\"lessive\":[\"french\"],\"lettre\":[\"french\"],\"levier\":[\"french\"],\"lexique\":[\"french\"],\"lézard\":[\"french\"],\"liasse\":[\"french\"],\"libérer\":[\"french\"],\"libre\":[\"french\"],\"licence\":[\"french\"],\"licorne\":[\"french\"],\"liège\":[\"french\"],\"lièvre\":[\"french\"],\"ligature\":[\"french\"],\"ligoter\":[\"french\"],\"ligue\":[\"french\"],\"limer\":[\"french\"],\"limite\":[\"french\"],\"limonade\":[\"french\"],\"limpide\":[\"french\"],\"linéaire\":[\"french\"],\"lingot\":[\"french\"],\"lionceau\":[\"french\"],\"liquide\":[\"french\"],\"lisière\":[\"french\"],\"lister\":[\"french\"],\"lithium\":[\"french\"],\"litige\":[\"french\"],\"littoral\":[\"french\"],\"livreur\":[\"french\"],\"logique\":[\"french\"],\"lointain\":[\"french\"],\"loisir\":[\"french\"],\"lombric\":[\"french\"],\"loterie\":[\"french\"],\"louer\":[\"french\"],\"lourd\":[\"french\"],\"loutre\":[\"french\"],\"louve\":[\"french\"],\"lubie\":[\"french\"],\"lucide\":[\"french\"],\"lucratif\":[\"french\"],\"lueur\":[\"french\"],\"lugubre\":[\"french\"],\"luisant\":[\"french\"],\"lumière\":[\"french\"],\"lunaire\":[\"french\"],\"lundi\":[\"french\"],\"luron\":[\"french\"],\"lutter\":[\"french\"],\"luxueux\":[\"french\"],\"magasin\":[\"french\"],\"magenta\":[\"french\"],\"magique\":[\"french\"],\"maigre\":[\"french\"],\"maillon\":[\"french\"],\"maintien\":[\"french\"],\"mairie\":[\"french\"],\"maison\":[\"french\"],\"majorer\":[\"french\"],\"malaxer\":[\"french\"],\"maléfice\":[\"french\"],\"malheur\":[\"french\"],\"malice\":[\"french\"],\"mallette\":[\"french\"],\"mammouth\":[\"french\"],\"mandater\":[\"french\"],\"maniable\":[\"french\"],\"manquant\":[\"french\"],\"manteau\":[\"french\"],\"manuel\":[\"french\"],\"marathon\":[\"french\"],\"marbre\":[\"french\"],\"marchand\":[\"french\"],\"mardi\":[\"french\"],\"maritime\":[\"french\"],\"marqueur\":[\"french\"],\"marron\":[\"french\"],\"marteler\":[\"french\"],\"mascotte\":[\"french\"],\"massif\":[\"french\"],\"matériel\":[\"french\"],\"matière\":[\"french\"],\"matraque\":[\"french\"],\"maudire\":[\"french\"],\"maussade\":[\"french\"],\"mauve\":[\"french\"],\"maximal\":[\"french\"],\"méchant\":[\"french\"],\"méconnu\":[\"french\"],\"médaille\":[\"french\"],\"médecin\":[\"french\"],\"méditer\":[\"french\"],\"méduse\":[\"french\"],\"meilleur\":[\"french\"],\"mélange\":[\"french\"],\"mélodie\":[\"french\"],\"membre\":[\"french\"],\"mémoire\":[\"french\"],\"menacer\":[\"french\"],\"mener\":[\"french\"],\"menhir\":[\"french\"],\"mensonge\":[\"french\"],\"mentor\":[\"french\"],\"mercredi\":[\"french\"],\"mérite\":[\"french\"],\"merle\":[\"french\"],\"messager\":[\"french\"],\"mesure\":[\"french\"],\"métal\":[\"french\"],\"météore\":[\"french\"],\"méthode\":[\"french\"],\"métier\":[\"french\"],\"meuble\":[\"french\"],\"miauler\":[\"french\"],\"microbe\":[\"french\"],\"miette\":[\"french\"],\"mignon\":[\"french\"],\"migrer\":[\"french\"],\"milieu\":[\"french\"],\"mimique\":[\"french\"],\"mince\":[\"french\"],\"minéral\":[\"french\"],\"minimal\":[\"french\"],\"minorer\":[\"french\"],\"miroiter\":[\"french\"],\"missile\":[\"french\"],\"mixte\":[\"french\"],\"moderne\":[\"french\"],\"moelleux\":[\"french\"],\"mondial\":[\"french\"],\"moniteur\":[\"french\"],\"monnaie\":[\"french\"],\"monotone\":[\"french\"],\"monstre\":[\"french\"],\"montagne\":[\"french\"],\"monument\":[\"french\"],\"moqueur\":[\"french\"],\"morceau\":[\"french\"],\"morsure\":[\"french\"],\"mortier\":[\"french\"],\"moteur\":[\"french\"],\"motif\":[\"french\"],\"mouche\":[\"french\"],\"moufle\":[\"french\"],\"moulin\":[\"french\"],\"mousson\":[\"french\"],\"mouton\":[\"french\"],\"mouvant\":[\"french\"],\"multiple\":[\"french\"],\"munition\":[\"french\"],\"muraille\":[\"french\"],\"murène\":[\"french\"],\"murmure\":[\"french\"],\"muséum\":[\"french\"],\"musicien\":[\"french\"],\"mutation\":[\"french\"],\"muter\":[\"french\"],\"mutuel\":[\"french\"],\"myriade\":[\"french\"],\"myrtille\":[\"french\"],\"mystère\":[\"french\"],\"mythique\":[\"french\"],\"nageur\":[\"french\"],\"nappe\":[\"french\"],\"narquois\":[\"french\"],\"narrer\":[\"french\"],\"natation\":[\"french\"],\"naufrage\":[\"french\"],\"nautique\":[\"french\"],\"navire\":[\"french\"],\"nébuleux\":[\"french\"],\"nectar\":[\"french\"],\"néfaste\":[\"french\"],\"négation\":[\"french\"],\"négliger\":[\"french\"],\"négocier\":[\"french\"],\"neige\":[\"french\"],\"nerveux\":[\"french\"],\"nettoyer\":[\"french\"],\"neurone\":[\"french\"],\"neutron\":[\"french\"],\"neveu\":[\"french\"],\"niche\":[\"french\"],\"nickel\":[\"french\"],\"nitrate\":[\"french\"],\"niveau\":[\"french\"],\"nocif\":[\"french\"],\"nocturne\":[\"french\"],\"noirceur\":[\"french\"],\"noisette\":[\"french\"],\"nomade\":[\"french\"],\"nombreux\":[\"french\"],\"nommer\":[\"french\"],\"normatif\":[\"french\"],\"notifier\":[\"french\"],\"notoire\":[\"french\"],\"nourrir\":[\"french\"],\"nouveau\":[\"french\"],\"novateur\":[\"french\"],\"novembre\":[\"french\"],\"novice\":[\"french\"],\"nuage\":[\"french\"],\"nuancer\":[\"french\"],\"nuire\":[\"french\"],\"nuisible\":[\"french\"],\"numéro\":[\"french\"],\"nuptial\":[\"french\"],\"nuque\":[\"french\"],\"nutritif\":[\"french\"],\"obéir\":[\"french\"],\"objectif\":[\"french\"],\"obliger\":[\"french\"],\"obscur\":[\"french\"],\"observer\":[\"french\"],\"obstacle\":[\"french\"],\"obtenir\":[\"french\"],\"obturer\":[\"french\"],\"occasion\":[\"french\"],\"occuper\":[\"french\"],\"océan\":[\"french\"],\"octobre\":[\"french\"],\"octroyer\":[\"french\"],\"octupler\":[\"french\"],\"oculaire\":[\"french\"],\"odeur\":[\"french\"],\"odorant\":[\"french\"],\"offenser\":[\"french\"],\"officier\":[\"french\"],\"offrir\":[\"french\"],\"ogive\":[\"french\"],\"oiseau\":[\"french\"],\"oisillon\":[\"french\"],\"olfactif\":[\"french\"],\"olivier\":[\"french\"],\"ombrage\":[\"french\"],\"omettre\":[\"french\"],\"onctueux\":[\"french\"],\"onduler\":[\"french\"],\"onéreux\":[\"french\"],\"onirique\":[\"french\"],\"opale\":[\"french\"],\"opaque\":[\"french\"],\"opérer\":[\"french\"],\"opportun\":[\"french\"],\"opprimer\":[\"french\"],\"opter\":[\"french\"],\"optique\":[\"french\"],\"orageux\":[\"french\"],\"orbite\":[\"french\"],\"ordonner\":[\"french\"],\"oreille\":[\"french\"],\"organe\":[\"french\"],\"orgueil\":[\"french\"],\"orifice\":[\"french\"],\"ornement\":[\"french\"],\"orque\":[\"french\"],\"ortie\":[\"french\"],\"osciller\":[\"french\"],\"osmose\":[\"french\"],\"ossature\":[\"french\"],\"otarie\":[\"french\"],\"ouragan\":[\"french\"],\"ourson\":[\"french\"],\"outil\":[\"french\"],\"outrager\":[\"french\"],\"ouvrage\":[\"french\"],\"ovation\":[\"french\"],\"oxyde\":[\"french\"],\"oxygène\":[\"french\"],\"paisible\":[\"french\"],\"palmarès\":[\"french\"],\"palourde\":[\"french\"],\"palper\":[\"french\"],\"panache\":[\"french\"],\"pangolin\":[\"french\"],\"paniquer\":[\"french\"],\"panneau\":[\"french\"],\"panorama\":[\"french\"],\"pantalon\":[\"french\"],\"papaye\":[\"french\"],\"papier\":[\"french\"],\"papoter\":[\"french\"],\"papyrus\":[\"french\"],\"paradoxe\":[\"french\"],\"parcelle\":[\"french\"],\"paresse\":[\"french\"],\"parfumer\":[\"french\"],\"parler\":[\"french\"],\"parole\":[\"french\"],\"parrain\":[\"french\"],\"parsemer\":[\"french\"],\"partager\":[\"french\"],\"parure\":[\"french\"],\"parvenir\":[\"french\"],\"passion\":[\"french\"],\"pastèque\":[\"french\"],\"paternel\":[\"french\"],\"patience\":[\"french\"],\"patron\":[\"french\",\"turkish\"],\"pavillon\":[\"french\"],\"pavoiser\":[\"french\"],\"payer\":[\"french\"],\"paysage\":[\"french\"],\"peigne\":[\"french\"],\"peintre\":[\"french\"],\"pelage\":[\"french\"],\"pélican\":[\"french\"],\"pelle\":[\"french\"],\"pelouse\":[\"french\"],\"peluche\":[\"french\"],\"pendule\":[\"french\"],\"pénétrer\":[\"french\"],\"pénible\":[\"french\"],\"pensif\":[\"french\"],\"pénurie\":[\"french\"],\"pépite\":[\"french\"],\"péplum\":[\"french\"],\"perdrix\":[\"french\"],\"perforer\":[\"french\"],\"période\":[\"french\"],\"permuter\":[\"french\"],\"perplexe\":[\"french\"],\"persil\":[\"french\"],\"perte\":[\"french\"],\"peser\":[\"french\"],\"pétale\":[\"french\"],\"petit\":[\"french\"],\"pétrir\":[\"french\"],\"peuple\":[\"french\"],\"pharaon\":[\"french\"],\"phobie\":[\"french\"],\"phoque\":[\"french\"],\"photon\":[\"french\"],\"physique\":[\"french\"],\"pictural\":[\"french\"],\"pièce\":[\"french\"],\"pierre\":[\"french\"],\"pieuvre\":[\"french\"],\"pilote\":[\"french\"],\"pinceau\":[\"french\"],\"pipette\":[\"french\"],\"piquer\":[\"french\"],\"pirogue\":[\"french\"],\"piscine\":[\"french\"],\"piston\":[\"french\"],\"pivoter\":[\"french\"],\"pixel\":[\"french\"],\"placard\":[\"french\"],\"plafond\":[\"french\"],\"plaisir\":[\"french\"],\"planer\":[\"french\"],\"plaque\":[\"french\"],\"plastron\":[\"french\"],\"plateau\":[\"french\"],\"pleurer\":[\"french\"],\"plexus\":[\"french\"],\"pliage\":[\"french\"],\"plomb\":[\"french\"],\"plonger\":[\"french\"],\"pluie\":[\"french\"],\"plumage\":[\"french\"],\"pochette\":[\"french\"],\"poésie\":[\"french\"],\"poète\":[\"french\"],\"pointe\":[\"french\"],\"poirier\":[\"french\"],\"poisson\":[\"french\"],\"poivre\":[\"french\"],\"polaire\":[\"french\"],\"policier\":[\"french\"],\"pollen\":[\"french\"],\"polygone\":[\"french\"],\"pommade\":[\"french\"],\"pompier\":[\"french\"],\"ponctuel\":[\"french\"],\"pondérer\":[\"french\"],\"poney\":[\"french\"],\"portique\":[\"french\"],\"posséder\":[\"french\"],\"posture\":[\"french\"],\"potager\":[\"french\"],\"poteau\":[\"french\"],\"potion\":[\"french\"],\"pouce\":[\"french\"],\"poulain\":[\"french\"],\"poumon\":[\"french\"],\"pourpre\":[\"french\"],\"poussin\":[\"french\"],\"pouvoir\":[\"french\"],\"prairie\":[\"french\"],\"pratique\":[\"french\"],\"précieux\":[\"french\"],\"prédire\":[\"french\"],\"préfixe\":[\"french\"],\"prélude\":[\"french\"],\"prénom\":[\"french\"],\"présence\":[\"french\"],\"prétexte\":[\"french\"],\"prévoir\":[\"french\"],\"primitif\":[\"french\"],\"prince\":[\"french\"],\"priver\":[\"french\"],\"problème\":[\"french\"],\"procéder\":[\"french\"],\"prodige\":[\"french\"],\"profond\":[\"french\"],\"progrès\":[\"french\"],\"proie\":[\"french\"],\"projeter\":[\"french\"],\"prologue\":[\"french\"],\"promener\":[\"french\"],\"propre\":[\"french\"],\"prospère\":[\"french\"],\"protéger\":[\"french\"],\"prouesse\":[\"french\"],\"proverbe\":[\"french\"],\"prudence\":[\"french\"],\"pruneau\":[\"french\"],\"psychose\":[\"french\"],\"puceron\":[\"french\"],\"puiser\":[\"french\"],\"pulpe\":[\"french\"],\"pulsar\":[\"french\"],\"punaise\":[\"french\"],\"punitif\":[\"french\"],\"pupitre\":[\"french\"],\"purifier\":[\"french\"],\"pyramide\":[\"french\"],\"quasar\":[\"french\"],\"querelle\":[\"french\"],\"quiétude\":[\"french\"],\"quitter\":[\"french\"],\"quotient\":[\"french\"],\"racine\":[\"french\"],\"raconter\":[\"french\"],\"radieux\":[\"french\"],\"ragondin\":[\"french\"],\"raideur\":[\"french\"],\"raisin\":[\"french\"],\"ralentir\":[\"french\"],\"rallonge\":[\"french\"],\"ramasser\":[\"french\"],\"rapide\":[\"french\"],\"rasage\":[\"french\"],\"ratisser\":[\"french\"],\"ravager\":[\"french\"],\"ravin\":[\"french\"],\"rayonner\":[\"french\"],\"réactif\":[\"french\"],\"réagir\":[\"french\"],\"réaliser\":[\"french\"],\"réanimer\":[\"french\"],\"recevoir\":[\"french\"],\"réciter\":[\"french\"],\"réclamer\":[\"french\"],\"récolter\":[\"french\"],\"recruter\":[\"french\"],\"reculer\":[\"french\"],\"recycler\":[\"french\"],\"rédiger\":[\"french\"],\"redouter\":[\"french\"],\"refaire\":[\"french\"],\"réflexe\":[\"french\"],\"réformer\":[\"french\"],\"refrain\":[\"french\"],\"refuge\":[\"french\"],\"régalien\":[\"french\"],\"région\":[\"french\"],\"réglage\":[\"french\"],\"régulier\":[\"french\"],\"réitérer\":[\"french\"],\"rejeter\":[\"french\"],\"rejouer\":[\"french\"],\"relatif\":[\"french\"],\"relever\":[\"french\"],\"remarque\":[\"french\"],\"remède\":[\"french\"],\"remise\":[\"french\"],\"remonter\":[\"french\"],\"remplir\":[\"french\"],\"remuer\":[\"french\"],\"renard\":[\"french\"],\"renfort\":[\"french\"],\"renifler\":[\"french\"],\"renoncer\":[\"french\"],\"rentrer\":[\"french\"],\"renvoi\":[\"french\"],\"replier\":[\"french\"],\"reporter\":[\"french\"],\"reprise\":[\"french\"],\"reptile\":[\"french\"],\"requin\":[\"french\"],\"réserve\":[\"french\"],\"résineux\":[\"french\"],\"résoudre\":[\"french\"],\"respect\":[\"french\"],\"rester\":[\"french\"],\"résultat\":[\"french\"],\"rétablir\":[\"french\"],\"retenir\":[\"french\"],\"réticule\":[\"french\"],\"retomber\":[\"french\"],\"retracer\":[\"french\"],\"réunion\":[\"french\"],\"réussir\":[\"french\"],\"revanche\":[\"french\"],\"revivre\":[\"french\"],\"révolte\":[\"french\"],\"révulsif\":[\"french\"],\"richesse\":[\"french\"],\"rideau\":[\"french\"],\"rieur\":[\"french\"],\"rigide\":[\"french\"],\"rigoler\":[\"french\"],\"rincer\":[\"french\"],\"riposter\":[\"french\"],\"risible\":[\"french\"],\"risque\":[\"french\"],\"rituel\":[\"french\"],\"rivière\":[\"french\"],\"rocheux\":[\"french\"],\"rompre\":[\"french\"],\"ronce\":[\"french\"],\"rondin\":[\"french\"],\"roseau\":[\"french\"],\"rosier\":[\"french\"],\"rotatif\":[\"french\"],\"rotor\":[\"french\"],\"rotule\":[\"french\"],\"rouge\":[\"french\"],\"rouille\":[\"french\"],\"rouleau\":[\"french\"],\"routine\":[\"french\"],\"royaume\":[\"french\"],\"ruban\":[\"french\"],\"rubis\":[\"french\"],\"ruche\":[\"french\"],\"ruelle\":[\"french\"],\"rugueux\":[\"french\"],\"ruiner\":[\"french\"],\"ruisseau\":[\"french\"],\"ruser\":[\"french\"],\"rustique\":[\"french\"],\"rythme\":[\"french\"],\"sabler\":[\"french\"],\"saboter\":[\"french\"],\"sabre\":[\"french\"],\"sacoche\":[\"french\"],\"safari\":[\"french\"],\"sagesse\":[\"french\"],\"saisir\":[\"french\"],\"salade\":[\"french\"],\"salive\":[\"french\"],\"saluer\":[\"french\"],\"samedi\":[\"french\"],\"sanction\":[\"french\"],\"sanglier\":[\"french\"],\"sarcasme\":[\"french\"],\"sardine\":[\"french\"],\"saturer\":[\"french\"],\"saugrenu\":[\"french\"],\"saumon\":[\"french\"],\"sauter\":[\"french\"],\"sauvage\":[\"french\"],\"savant\":[\"french\"],\"savonner\":[\"french\"],\"scalpel\":[\"french\"],\"scandale\":[\"french\"],\"scélérat\":[\"french\"],\"scénario\":[\"french\"],\"sceptre\":[\"french\"],\"schéma\":[\"french\"],\"scinder\":[\"french\"],\"score\":[\"french\"],\"scrutin\":[\"french\"],\"sculpter\":[\"french\"],\"séance\":[\"french\"],\"sécable\":[\"french\"],\"sécher\":[\"french\"],\"secouer\":[\"french\"],\"sécréter\":[\"french\"],\"sédatif\":[\"french\"],\"séduire\":[\"french\"],\"seigneur\":[\"french\"],\"séjour\":[\"french\"],\"sélectif\":[\"french\"],\"semaine\":[\"french\"],\"sembler\":[\"french\"],\"semence\":[\"french\"],\"séminal\":[\"french\"],\"sénateur\":[\"french\"],\"sensible\":[\"french\"],\"séparer\":[\"french\"],\"séquence\":[\"french\"],\"serein\":[\"french\"],\"sergent\":[\"french\"],\"sérieux\":[\"french\"],\"serrure\":[\"french\"],\"sérum\":[\"french\"],\"sésame\":[\"french\"],\"sévir\":[\"french\"],\"sevrage\":[\"french\"],\"sextuple\":[\"french\"],\"sidéral\":[\"french\"],\"siècle\":[\"french\"],\"siéger\":[\"french\"],\"siffler\":[\"french\"],\"sigle\":[\"french\"],\"signal\":[\"french\"],\"silence\":[\"french\"],\"silicium\":[\"french\"],\"sincère\":[\"french\"],\"sinistre\":[\"french\"],\"siphon\":[\"french\"],\"sirop\":[\"french\"],\"sismique\":[\"french\"],\"situer\":[\"french\"],\"skier\":[\"french\"],\"socle\":[\"french\"],\"sodium\":[\"french\"],\"soigneux\":[\"french\"],\"soldat\":[\"french\"],\"soleil\":[\"french\"],\"solitude\":[\"french\"],\"soluble\":[\"french\"],\"sombre\":[\"french\"],\"sommeil\":[\"french\"],\"somnoler\":[\"french\"],\"sonde\":[\"french\"],\"songeur\":[\"french\"],\"sonnette\":[\"french\"],\"sonore\":[\"french\"],\"sorcier\":[\"french\"],\"sortir\":[\"french\"],\"sosie\":[\"french\"],\"sottise\":[\"french\"],\"soucieux\":[\"french\"],\"soudure\":[\"french\"],\"souffle\":[\"french\"],\"soulever\":[\"french\"],\"soupape\":[\"french\"],\"soutirer\":[\"french\"],\"souvenir\":[\"french\"],\"spacieux\":[\"french\"],\"spécial\":[\"french\"],\"sphère\":[\"french\"],\"spiral\":[\"french\",\"turkish\"],\"station\":[\"french\"],\"sternum\":[\"french\"],\"stimulus\":[\"french\"],\"stipuler\":[\"french\"],\"strict\":[\"french\"],\"studieux\":[\"french\"],\"stupeur\":[\"french\"],\"styliste\":[\"french\"],\"sublime\":[\"french\"],\"substrat\":[\"french\"],\"subtil\":[\"french\"],\"subvenir\":[\"french\"],\"succès\":[\"french\"],\"sucre\":[\"french\"],\"suffixe\":[\"french\"],\"suggérer\":[\"french\"],\"suiveur\":[\"french\"],\"sulfate\":[\"french\"],\"superbe\":[\"french\"],\"supplier\":[\"french\"],\"suricate\":[\"french\"],\"surmener\":[\"french\"],\"sursaut\":[\"french\"],\"survie\":[\"french\"],\"syllabe\":[\"french\"],\"symbole\":[\"french\"],\"symétrie\":[\"french\"],\"synapse\":[\"french\"],\"syntaxe\":[\"french\"],\"système\":[\"french\"],\"tabac\":[\"french\"],\"tablier\":[\"french\"],\"tactile\":[\"french\"],\"tailler\":[\"french\"],\"talisman\":[\"french\"],\"talonner\":[\"french\"],\"tambour\":[\"french\"],\"tamiser\":[\"french\"],\"tangible\":[\"french\"],\"tapis\":[\"french\"],\"taquiner\":[\"french\"],\"tarder\":[\"french\"],\"tarif\":[\"french\"],\"tartine\":[\"french\"],\"tasse\":[\"french\"],\"tatami\":[\"french\"],\"tatouage\":[\"french\"],\"taupe\":[\"french\"],\"taureau\":[\"french\"],\"taxer\":[\"french\"],\"témoin\":[\"french\"],\"temporel\":[\"french\"],\"tenaille\":[\"french\"],\"tendre\":[\"french\"],\"teneur\":[\"french\"],\"tenir\":[\"french\"],\"tension\":[\"french\"],\"terminer\":[\"french\"],\"terne\":[\"french\"],\"terrible\":[\"french\"],\"tétine\":[\"french\"],\"texte\":[\"french\"],\"thème\":[\"french\"],\"théorie\":[\"french\"],\"thérapie\":[\"french\"],\"thorax\":[\"french\"],\"tibia\":[\"french\"],\"tiède\":[\"french\"],\"timide\":[\"french\"],\"tirelire\":[\"french\"],\"tiroir\":[\"french\"],\"tissu\":[\"french\"],\"titane\":[\"french\"],\"titre\":[\"french\"],\"tituber\":[\"french\"],\"toboggan\":[\"french\"],\"tolérant\":[\"french\"],\"tomate\":[\"french\"],\"tonique\":[\"french\"],\"tonneau\":[\"french\"],\"toponyme\":[\"french\"],\"torche\":[\"french\"],\"tordre\":[\"french\"],\"tornade\":[\"french\"],\"torpille\":[\"french\"],\"torrent\":[\"french\"],\"torse\":[\"french\"],\"tortue\":[\"french\"],\"totem\":[\"french\"],\"toucher\":[\"french\"],\"tournage\":[\"french\"],\"tousser\":[\"french\"],\"toxine\":[\"french\"],\"traction\":[\"french\"],\"trafic\":[\"french\"],\"tragique\":[\"french\"],\"trahir\":[\"french\"],\"trancher\":[\"french\"],\"travail\":[\"french\"],\"trèfle\":[\"french\"],\"tremper\":[\"french\"],\"trésor\":[\"french\"],\"treuil\":[\"french\"],\"triage\":[\"french\"],\"tribunal\":[\"french\"],\"tricoter\":[\"french\"],\"trilogie\":[\"french\"],\"triomphe\":[\"french\"],\"tripler\":[\"french\"],\"triturer\":[\"french\"],\"trivial\":[\"french\"],\"trombone\":[\"french\"],\"tronc\":[\"french\"],\"tropical\":[\"french\"],\"troupeau\":[\"french\"],\"tuile\":[\"french\"],\"tulipe\":[\"french\"],\"tumulte\":[\"french\"],\"turbine\":[\"french\"],\"tuteur\":[\"french\"],\"tutoyer\":[\"french\"],\"tuyau\":[\"french\"],\"tympan\":[\"french\"],\"typhon\":[\"french\"],\"typique\":[\"french\"],\"tyran\":[\"french\"],\"ubuesque\":[\"french\"],\"ultime\":[\"french\"],\"ultrason\":[\"french\"],\"unanime\":[\"french\"],\"unifier\":[\"french\"],\"union\":[\"french\"],\"unitaire\":[\"french\"],\"univers\":[\"french\"],\"uranium\":[\"french\"],\"urbain\":[\"french\"],\"urticant\":[\"french\"],\"usine\":[\"french\"],\"usuel\":[\"french\"],\"usure\":[\"french\"],\"utile\":[\"french\"],\"utopie\":[\"french\"],\"vacarme\":[\"french\"],\"vaccin\":[\"french\"],\"vagabond\":[\"french\"],\"vaillant\":[\"french\"],\"vaincre\":[\"french\"],\"vaisseau\":[\"french\"],\"valable\":[\"french\"],\"valise\":[\"french\"],\"vallon\":[\"french\"],\"vampire\":[\"french\"],\"vanille\":[\"french\"],\"vapeur\":[\"french\"],\"varier\":[\"french\"],\"vaseux\":[\"french\"],\"vassal\":[\"french\"],\"vaste\":[\"french\"],\"vecteur\":[\"french\"],\"vedette\":[\"french\"],\"végétal\":[\"french\"],\"véhicule\":[\"french\"],\"veinard\":[\"french\"],\"véloce\":[\"french\"],\"vendredi\":[\"french\"],\"vénérer\":[\"french\"],\"venger\":[\"french\"],\"venimeux\":[\"french\"],\"ventouse\":[\"french\"],\"verdure\":[\"french\"],\"vérin\":[\"french\"],\"vernir\":[\"french\"],\"verrou\":[\"french\"],\"verser\":[\"french\"],\"vertu\":[\"french\"],\"veston\":[\"french\"],\"vétéran\":[\"french\"],\"vétuste\":[\"french\"],\"vexant\":[\"french\"],\"vexer\":[\"french\"],\"viaduc\":[\"french\"],\"viande\":[\"french\"],\"victoire\":[\"french\"],\"vidange\":[\"french\"],\"vidéo\":[\"french\"],\"vignette\":[\"french\"],\"vigueur\":[\"french\"],\"vilain\":[\"french\"],\"vinaigre\":[\"french\"],\"violon\":[\"french\"],\"vipère\":[\"french\"],\"virement\":[\"french\"],\"virtuose\":[\"french\"],\"visage\":[\"french\"],\"viseur\":[\"french\"],\"vision\":[\"french\"],\"visqueux\":[\"french\"],\"visuel\":[\"french\"],\"vitesse\":[\"french\"],\"viticole\":[\"french\"],\"vitrine\":[\"french\"],\"vivace\":[\"french\"],\"vivipare\":[\"french\"],\"vocation\":[\"french\"],\"voguer\":[\"french\"],\"voile\":[\"french\"],\"voisin\":[\"french\"],\"voiture\":[\"french\"],\"volaille\":[\"french\"],\"volcan\":[\"french\"],\"voltiger\":[\"french\"],\"vorace\":[\"french\"],\"vortex\":[\"french\"],\"voter\":[\"french\"],\"vouloir\":[\"french\"],\"voyelle\":[\"french\"],\"xénon\":[\"french\"],\"yacht\":[\"french\"],\"zèbre\":[\"french\"],\"zénith\":[\"french\"],\"zeste\":[\"french\"],\"zoologie\":[\"french\"],\"abaco\":[\"italian\"],\"abbaglio\":[\"italian\"],\"abbinato\":[\"italian\"],\"abete\":[\"italian\"],\"abisso\":[\"italian\"],\"abolire\":[\"italian\"],\"abrasivo\":[\"italian\"],\"abrogato\":[\"italian\"],\"accadere\":[\"italian\"],\"accenno\":[\"italian\"],\"accusato\":[\"italian\"],\"acetone\":[\"italian\"],\"achille\":[\"italian\"],\"acido\":[\"italian\"],\"acqua\":[\"italian\"],\"acre\":[\"italian\"],\"acrilico\":[\"italian\"],\"acrobata\":[\"italian\"],\"acuto\":[\"italian\"],\"adagio\":[\"italian\"],\"addebito\":[\"italian\"],\"addome\":[\"italian\"],\"adeguato\":[\"italian\"],\"aderire\":[\"italian\"],\"adipe\":[\"italian\"],\"adottare\":[\"italian\"],\"adulare\":[\"italian\"],\"affabile\":[\"italian\"],\"affetto\":[\"italian\"],\"affisso\":[\"italian\"],\"affranto\":[\"italian\"],\"aforisma\":[\"italian\"],\"afoso\":[\"italian\"],\"africano\":[\"italian\"],\"agave\":[\"italian\"],\"agente\":[\"italian\"],\"agevole\":[\"italian\"],\"aggancio\":[\"italian\"],\"agire\":[\"italian\"],\"agitare\":[\"italian\"],\"agonismo\":[\"italian\"],\"agricolo\":[\"italian\"],\"agrumeto\":[\"italian\"],\"aguzzo\":[\"italian\"],\"alabarda\":[\"italian\"],\"alato\":[\"italian\"],\"albatro\":[\"italian\"],\"alberato\":[\"italian\"],\"albo\":[\"italian\"],\"albume\":[\"italian\"],\"alce\":[\"italian\"],\"alcolico\":[\"italian\"],\"alettone\":[\"italian\"],\"alfa\":[\"italian\"],\"algebra\":[\"italian\"],\"aliante\":[\"italian\"],\"alibi\":[\"italian\"],\"alimento\":[\"italian\"],\"allagato\":[\"italian\"],\"allegro\":[\"italian\"],\"allievo\":[\"italian\"],\"allodola\":[\"italian\"],\"allusivo\":[\"italian\"],\"almeno\":[\"italian\"],\"alogeno\":[\"italian\"],\"alpaca\":[\"italian\"],\"alpestre\":[\"italian\"],\"altalena\":[\"italian\"],\"alterno\":[\"italian\"],\"alticcio\":[\"italian\"],\"altrove\":[\"italian\"],\"alunno\":[\"italian\"],\"alveolo\":[\"italian\"],\"alzare\":[\"italian\"],\"amalgama\":[\"italian\"],\"amanita\":[\"italian\"],\"amarena\":[\"italian\"],\"ambito\":[\"italian\"],\"ambrato\":[\"italian\"],\"ameba\":[\"italian\"],\"america\":[\"italian\"],\"ametista\":[\"italian\"],\"amico\":[\"italian\"],\"ammasso\":[\"italian\"],\"ammenda\":[\"italian\"],\"ammirare\":[\"italian\"],\"ammonito\":[\"italian\"],\"amore\":[\"italian\"],\"ampio\":[\"italian\"],\"ampliare\":[\"italian\"],\"amuleto\":[\"italian\"],\"anacardo\":[\"italian\"],\"anagrafe\":[\"italian\"],\"analista\":[\"italian\"],\"anarchia\":[\"italian\"],\"anatra\":[\"italian\"],\"anca\":[\"italian\"],\"ancella\":[\"italian\"],\"ancora\":[\"italian\"],\"andare\":[\"italian\"],\"andrea\":[\"italian\"],\"anello\":[\"italian\"],\"angelo\":[\"italian\"],\"angolare\":[\"italian\"],\"angusto\":[\"italian\"],\"anima\":[\"italian\"],\"annegare\":[\"italian\"],\"annidato\":[\"italian\"],\"anno\":[\"italian\"],\"annuncio\":[\"italian\"],\"anonimo\":[\"italian\"],\"anticipo\":[\"italian\"],\"anzi\":[\"italian\"],\"apatico\":[\"italian\"],\"apertura\":[\"italian\"],\"apode\":[\"italian\"],\"apparire\":[\"italian\"],\"appetito\":[\"italian\"],\"appoggio\":[\"italian\"],\"approdo\":[\"italian\"],\"appunto\":[\"italian\"],\"aprile\":[\"italian\"],\"arabica\":[\"italian\"],\"arachide\":[\"italian\"],\"aragosta\":[\"italian\"],\"araldica\":[\"italian\"],\"arancio\":[\"italian\"],\"aratura\":[\"italian\"],\"arazzo\":[\"italian\"],\"arbitro\":[\"italian\"],\"archivio\":[\"italian\"],\"ardito\":[\"italian\"],\"arenile\":[\"italian\"],\"argento\":[\"italian\"],\"argine\":[\"italian\"],\"arguto\":[\"italian\"],\"aria\":[\"italian\"],\"armonia\":[\"italian\"],\"arnese\":[\"italian\"],\"arredato\":[\"italian\"],\"arringa\":[\"italian\"],\"arrosto\":[\"italian\"],\"arsenico\":[\"italian\"],\"arso\":[\"italian\"],\"artefice\":[\"italian\"],\"arzillo\":[\"italian\"],\"asciutto\":[\"italian\"],\"ascolto\":[\"italian\"],\"asepsi\":[\"italian\"],\"asettico\":[\"italian\"],\"asfalto\":[\"italian\"],\"asino\":[\"italian\"],\"asola\":[\"italian\"],\"aspirato\":[\"italian\"],\"aspro\":[\"italian\"],\"assaggio\":[\"italian\"],\"asse\":[\"italian\"],\"assoluto\":[\"italian\"],\"assurdo\":[\"italian\"],\"asta\":[\"italian\"],\"astenuto\":[\"italian\"],\"astice\":[\"italian\"],\"astratto\":[\"italian\"],\"atavico\":[\"italian\"],\"ateismo\":[\"italian\"],\"atomico\":[\"italian\"],\"atono\":[\"italian\"],\"attesa\":[\"italian\"],\"attivare\":[\"italian\"],\"attorno\":[\"italian\"],\"attrito\":[\"italian\"],\"attuale\":[\"italian\"],\"ausilio\":[\"italian\"],\"austria\":[\"italian\"],\"autista\":[\"italian\"],\"autonomo\":[\"italian\"],\"autunno\":[\"italian\"],\"avanzato\":[\"italian\"],\"avere\":[\"italian\"],\"avvenire\":[\"italian\"],\"avviso\":[\"italian\"],\"avvolgere\":[\"italian\"],\"azione\":[\"italian\"],\"azoto\":[\"italian\"],\"azzimo\":[\"italian\"],\"azzurro\":[\"italian\"],\"babele\":[\"italian\"],\"baccano\":[\"italian\"],\"bacino\":[\"italian\"],\"baco\":[\"italian\"],\"badessa\":[\"italian\"],\"badilata\":[\"italian\"],\"bagnato\":[\"italian\"],\"baita\":[\"italian\"],\"balcone\":[\"italian\"],\"baldo\":[\"italian\"],\"balena\":[\"italian\"],\"ballata\":[\"italian\"],\"balzano\":[\"italian\"],\"bambino\":[\"italian\"],\"bandire\":[\"italian\"],\"baraonda\":[\"italian\"],\"barbaro\":[\"italian\"],\"barca\":[\"italian\"],\"baritono\":[\"italian\"],\"barlume\":[\"italian\"],\"barocco\":[\"italian\"],\"basilico\":[\"italian\"],\"basso\":[\"italian\"],\"batosta\":[\"italian\"],\"battuto\":[\"italian\"],\"baule\":[\"italian\"],\"bava\":[\"italian\"],\"bavosa\":[\"italian\"],\"becco\":[\"italian\"],\"beffa\":[\"italian\"],\"belgio\":[\"italian\"],\"belva\":[\"italian\"],\"benda\":[\"italian\"],\"benevole\":[\"italian\"],\"benigno\":[\"italian\"],\"benzina\":[\"italian\"],\"bere\":[\"italian\"],\"berlina\":[\"italian\"],\"beta\":[\"italian\"],\"bibita\":[\"italian\"],\"bici\":[\"italian\"],\"bidone\":[\"italian\"],\"bifido\":[\"italian\"],\"biga\":[\"italian\"],\"bilancia\":[\"italian\"],\"bimbo\":[\"italian\"],\"binocolo\":[\"italian\"],\"biologo\":[\"italian\"],\"bipede\":[\"italian\"],\"bipolare\":[\"italian\"],\"birbante\":[\"italian\"],\"birra\":[\"italian\"],\"biscotto\":[\"italian\"],\"bisesto\":[\"italian\"],\"bisnonno\":[\"italian\"],\"bisonte\":[\"italian\"],\"bisturi\":[\"italian\"],\"bizzarro\":[\"italian\"],\"blando\":[\"italian\"],\"blatta\":[\"italian\"],\"bollito\":[\"italian\"],\"bonifico\":[\"italian\"],\"bordo\":[\"italian\"],\"bosco\":[\"italian\"],\"botanico\":[\"italian\"],\"bottino\":[\"italian\"],\"bozzolo\":[\"italian\"],\"braccio\":[\"italian\"],\"bradipo\":[\"italian\"],\"brama\":[\"italian\"],\"branca\":[\"italian\"],\"bravura\":[\"italian\"],\"bretella\":[\"italian\"],\"brevetto\":[\"italian\"],\"brezza\":[\"italian\"],\"briglia\":[\"italian\"],\"brillante\":[\"italian\"],\"brindare\":[\"italian\"],\"broccolo\":[\"italian\"],\"brodo\":[\"italian\"],\"bronzina\":[\"italian\"],\"brullo\":[\"italian\"],\"bruno\":[\"italian\"],\"bubbone\":[\"italian\"],\"buca\":[\"italian\"],\"budino\":[\"italian\"],\"buffone\":[\"italian\"],\"buio\":[\"italian\"],\"bulbo\":[\"italian\"],\"buono\":[\"italian\"],\"burlone\":[\"italian\"],\"burrasca\":[\"italian\"],\"bussola\":[\"italian\"],\"busta\":[\"italian\"],\"cadetto\":[\"italian\"],\"caduco\":[\"italian\"],\"calamaro\":[\"italian\"],\"calcolo\":[\"italian\"],\"calesse\":[\"italian\"],\"calibro\":[\"italian\"],\"calmo\":[\"italian\"],\"caloria\":[\"italian\"],\"cambusa\":[\"italian\"],\"camerata\":[\"italian\"],\"camicia\":[\"italian\"],\"cammino\":[\"italian\"],\"camola\":[\"italian\"],\"campale\":[\"italian\"],\"canapa\":[\"italian\"],\"candela\":[\"italian\"],\"cane\":[\"italian\"],\"canino\":[\"italian\"],\"canotto\":[\"italian\"],\"cantina\":[\"italian\"],\"capace\":[\"italian\"],\"capello\":[\"italian\"],\"capitolo\":[\"italian\"],\"capogiro\":[\"italian\"],\"cappero\":[\"italian\"],\"capra\":[\"italian\"],\"capsula\":[\"italian\"],\"carapace\":[\"italian\"],\"carcassa\":[\"italian\"],\"cardo\":[\"italian\"],\"carisma\":[\"italian\"],\"carovana\":[\"italian\"],\"carretto\":[\"italian\"],\"cartolina\":[\"italian\"],\"casaccio\":[\"italian\"],\"cascata\":[\"italian\"],\"caserma\":[\"italian\"],\"caso\":[\"italian\"],\"cassone\":[\"italian\"],\"castello\":[\"italian\"],\"casuale\":[\"italian\"],\"catasta\":[\"italian\"],\"catena\":[\"italian\"],\"catrame\":[\"italian\"],\"cauto\":[\"italian\"],\"cavillo\":[\"italian\"],\"cedibile\":[\"italian\"],\"cedrata\":[\"italian\"],\"cefalo\":[\"italian\"],\"celebre\":[\"italian\"],\"cellulare\":[\"italian\"],\"cena\":[\"italian\"],\"cenone\":[\"italian\"],\"centesimo\":[\"italian\"],\"ceramica\":[\"italian\"],\"cercare\":[\"italian\"],\"certo\":[\"italian\"],\"cerume\":[\"italian\"],\"cervello\":[\"italian\"],\"cesoia\":[\"italian\"],\"cespo\":[\"italian\"],\"ceto\":[\"italian\"],\"chela\":[\"italian\"],\"chiaro\":[\"italian\"],\"chicca\":[\"italian\"],\"chiedere\":[\"italian\"],\"chimera\":[\"italian\"],\"china\":[\"italian\"],\"chirurgo\":[\"italian\"],\"chitarra\":[\"italian\"],\"ciao\":[\"italian\"],\"ciclismo\":[\"italian\"],\"cifrare\":[\"italian\"],\"cigno\":[\"italian\"],\"cilindro\":[\"italian\"],\"ciottolo\":[\"italian\"],\"circa\":[\"italian\"],\"cirrosi\":[\"italian\"],\"citrico\":[\"italian\"],\"cittadino\":[\"italian\"],\"ciuffo\":[\"italian\"],\"civetta\":[\"italian\"],\"civile\":[\"italian\"],\"classico\":[\"italian\"],\"clinica\":[\"italian\"],\"cloro\":[\"italian\"],\"cocco\":[\"italian\"],\"codardo\":[\"italian\"],\"codice\":[\"italian\"],\"coerente\":[\"italian\"],\"cognome\":[\"italian\"],\"collare\":[\"italian\"],\"colmato\":[\"italian\"],\"colore\":[\"italian\"],\"colposo\":[\"italian\"],\"coltivato\":[\"italian\"],\"colza\":[\"italian\"],\"coma\":[\"italian\"],\"cometa\":[\"italian\"],\"commando\":[\"italian\"],\"comodo\":[\"italian\"],\"computer\":[\"italian\"],\"comune\":[\"italian\"],\"conciso\":[\"italian\"],\"condurre\":[\"italian\"],\"conferma\":[\"italian\"],\"congelare\":[\"italian\"],\"coniuge\":[\"italian\"],\"connesso\":[\"italian\"],\"conoscere\":[\"italian\"],\"consumo\":[\"italian\"],\"continuo\":[\"italian\"],\"convegno\":[\"italian\"],\"coperto\":[\"italian\"],\"copione\":[\"italian\"],\"coppia\":[\"italian\"],\"copricapo\":[\"italian\"],\"corazza\":[\"italian\"],\"cordata\":[\"italian\"],\"coricato\":[\"italian\"],\"cornice\":[\"italian\"],\"corolla\":[\"italian\"],\"corpo\":[\"italian\"],\"corredo\":[\"italian\"],\"corsia\":[\"italian\"],\"cortese\":[\"italian\"],\"cosmico\":[\"italian\"],\"costante\":[\"italian\"],\"cottura\":[\"italian\"],\"covato\":[\"italian\"],\"cratere\":[\"italian\"],\"cravatta\":[\"italian\"],\"creato\":[\"italian\"],\"credere\":[\"italian\"],\"cremoso\":[\"italian\"],\"crescita\":[\"italian\"],\"creta\":[\"italian\"],\"criceto\":[\"italian\"],\"crinale\":[\"italian\"],\"crisi\":[\"italian\"],\"critico\":[\"italian\"],\"croce\":[\"italian\"],\"cronaca\":[\"italian\"],\"crostata\":[\"italian\"],\"cruciale\":[\"italian\"],\"crusca\":[\"italian\"],\"cucire\":[\"italian\"],\"cuculo\":[\"italian\"],\"cugino\":[\"italian\"],\"cullato\":[\"italian\"],\"cupola\":[\"italian\"],\"curatore\":[\"italian\"],\"cursore\":[\"italian\"],\"curvo\":[\"italian\"],\"cuscino\":[\"italian\"],\"custode\":[\"italian\"],\"dado\":[\"italian\"],\"daino\":[\"italian\"],\"dalmata\":[\"italian\"],\"damerino\":[\"italian\"],\"daniela\":[\"italian\"],\"dannoso\":[\"italian\"],\"danzare\":[\"italian\"],\"datato\":[\"italian\"],\"davanti\":[\"italian\"],\"davvero\":[\"italian\"],\"debutto\":[\"italian\"],\"decennio\":[\"italian\"],\"deciso\":[\"italian\"],\"declino\":[\"italian\"],\"decollo\":[\"italian\"],\"decreto\":[\"italian\"],\"dedicato\":[\"italian\"],\"definito\":[\"italian\"],\"deforme\":[\"italian\"],\"degno\":[\"italian\"],\"delegare\":[\"italian\"],\"delfino\":[\"italian\"],\"delirio\":[\"italian\"],\"delta\":[\"italian\"],\"demenza\":[\"italian\"],\"denotato\":[\"italian\"],\"dentro\":[\"italian\"],\"deposito\":[\"italian\"],\"derapata\":[\"italian\"],\"derivare\":[\"italian\"],\"deroga\":[\"italian\"],\"descritto\":[\"italian\"],\"deserto\":[\"italian\"],\"desiderio\":[\"italian\"],\"desumere\":[\"italian\"],\"detersivo\":[\"italian\"],\"devoto\":[\"italian\"],\"diametro\":[\"italian\"],\"dicembre\":[\"italian\"],\"diedro\":[\"italian\"],\"difeso\":[\"italian\"],\"diffuso\":[\"italian\"],\"digerire\":[\"italian\"],\"digitale\":[\"italian\"],\"diluvio\":[\"italian\"],\"dinamico\":[\"italian\"],\"dinnanzi\":[\"italian\"],\"dipinto\":[\"italian\"],\"diploma\":[\"italian\"],\"dipolo\":[\"italian\"],\"diradare\":[\"italian\"],\"dire\":[\"italian\"],\"dirotto\":[\"italian\"],\"dirupo\":[\"italian\"],\"disagio\":[\"italian\"],\"discreto\":[\"italian\"],\"disfare\":[\"italian\"],\"disgelo\":[\"italian\"],\"disposto\":[\"italian\"],\"distanza\":[\"italian\"],\"disumano\":[\"italian\"],\"dito\":[\"italian\"],\"divano\":[\"italian\"],\"divelto\":[\"italian\"],\"dividere\":[\"italian\"],\"divorato\":[\"italian\"],\"doblone\":[\"italian\"],\"docente\":[\"italian\"],\"doganale\":[\"italian\"],\"dogma\":[\"italian\"],\"dolce\":[\"italian\"],\"domato\":[\"italian\"],\"domenica\":[\"italian\"],\"dominare\":[\"italian\"],\"dondolo\":[\"italian\"],\"dono\":[\"italian\"],\"dormire\":[\"italian\"],\"dote\":[\"italian\"],\"dottore\":[\"italian\"],\"dovuto\":[\"italian\"],\"dozzina\":[\"italian\"],\"drago\":[\"italian\"],\"druido\":[\"italian\"],\"dubbio\":[\"italian\"],\"dubitare\":[\"italian\"],\"ducale\":[\"italian\"],\"duna\":[\"italian\"],\"duomo\":[\"italian\"],\"duplice\":[\"italian\"],\"duraturo\":[\"italian\"],\"ebano\":[\"italian\"],\"eccesso\":[\"italian\"],\"ecco\":[\"italian\"],\"eclissi\":[\"italian\"],\"economia\":[\"italian\"],\"edera\":[\"italian\"],\"edicola\":[\"italian\"],\"edile\":[\"italian\"],\"editoria\":[\"italian\"],\"educare\":[\"italian\"],\"egemonia\":[\"italian\"],\"egli\":[\"italian\"],\"egoismo\":[\"italian\"],\"egregio\":[\"italian\"],\"elaborato\":[\"italian\"],\"elargire\":[\"italian\"],\"elegante\":[\"italian\"],\"elencato\":[\"italian\"],\"eletto\":[\"italian\"],\"elevare\":[\"italian\"],\"elfico\":[\"italian\"],\"elica\":[\"italian\"],\"elmo\":[\"italian\"],\"elsa\":[\"italian\"],\"eluso\":[\"italian\"],\"emanato\":[\"italian\"],\"emblema\":[\"italian\"],\"emesso\":[\"italian\"],\"emiro\":[\"italian\"],\"emotivo\":[\"italian\"],\"emozione\":[\"italian\"],\"empirico\":[\"italian\"],\"emulo\":[\"italian\"],\"endemico\":[\"italian\"],\"enduro\":[\"italian\"],\"energia\":[\"italian\"],\"enfasi\":[\"italian\"],\"enoteca\":[\"italian\"],\"entrare\":[\"italian\"],\"enzima\":[\"italian\"],\"epatite\":[\"italian\"],\"epilogo\":[\"italian\"],\"episodio\":[\"italian\"],\"epocale\":[\"italian\"],\"eppure\":[\"italian\"],\"equatore\":[\"italian\"],\"erario\":[\"italian\"],\"erba\":[\"italian\"],\"erboso\":[\"italian\"],\"erede\":[\"italian\"],\"eremita\":[\"italian\"],\"erigere\":[\"italian\"],\"ermetico\":[\"italian\"],\"eroe\":[\"italian\"],\"erosivo\":[\"italian\"],\"errante\":[\"italian\"],\"esagono\":[\"italian\"],\"esame\":[\"italian\"],\"esanime\":[\"italian\"],\"esaudire\":[\"italian\"],\"esca\":[\"italian\"],\"esempio\":[\"italian\"],\"esercito\":[\"italian\"],\"esibito\":[\"italian\"],\"esigente\":[\"italian\"],\"esistere\":[\"italian\"],\"esito\":[\"italian\"],\"esofago\":[\"italian\"],\"esortato\":[\"italian\"],\"esoso\":[\"italian\"],\"espanso\":[\"italian\"],\"espresso\":[\"italian\"],\"essenza\":[\"italian\"],\"esso\":[\"italian\"],\"esteso\":[\"italian\"],\"estimare\":[\"italian\"],\"estonia\":[\"italian\"],\"estroso\":[\"italian\"],\"esultare\":[\"italian\"],\"etilico\":[\"italian\"],\"etnico\":[\"italian\"],\"etrusco\":[\"italian\"],\"etto\":[\"italian\"],\"euclideo\":[\"italian\"],\"europa\":[\"italian\"],\"evaso\":[\"italian\"],\"evidenza\":[\"italian\"],\"evitato\":[\"italian\"],\"evoluto\":[\"italian\"],\"evviva\":[\"italian\"],\"fabbrica\":[\"italian\"],\"faccenda\":[\"italian\"],\"fachiro\":[\"italian\"],\"falco\":[\"italian\"],\"famiglia\":[\"italian\"],\"fanale\":[\"italian\"],\"fanfara\":[\"italian\"],\"fango\":[\"italian\"],\"fantasma\":[\"italian\"],\"fare\":[\"italian\"],\"farfalla\":[\"italian\"],\"farinoso\":[\"italian\"],\"farmaco\":[\"italian\"],\"fascia\":[\"italian\"],\"fastoso\":[\"italian\"],\"fasullo\":[\"italian\"],\"faticare\":[\"italian\"],\"fato\":[\"italian\"],\"favoloso\":[\"italian\"],\"febbre\":[\"italian\"],\"fecola\":[\"italian\"],\"fede\":[\"italian\"],\"fegato\":[\"italian\"],\"felpa\":[\"italian\"],\"feltro\":[\"italian\"],\"femmina\":[\"italian\"],\"fendere\":[\"italian\"],\"fenomeno\":[\"italian\"],\"fermento\":[\"italian\"],\"ferro\":[\"italian\"],\"fertile\":[\"italian\"],\"fessura\":[\"italian\"],\"festivo\":[\"italian\"],\"fetta\":[\"italian\"],\"feudo\":[\"italian\"],\"fiaba\":[\"italian\"],\"fiducia\":[\"italian\"],\"fifa\":[\"italian\"],\"figurato\":[\"italian\"],\"filo\":[\"italian\",\"turkish\"],\"finanza\":[\"italian\"],\"finestra\":[\"italian\"],\"finire\":[\"italian\"],\"fiore\":[\"italian\"],\"fiscale\":[\"italian\"],\"fisico\":[\"italian\"],\"fiume\":[\"italian\"],\"flacone\":[\"italian\"],\"flamenco\":[\"italian\"],\"flebo\":[\"italian\"],\"flemma\":[\"italian\"],\"florido\":[\"italian\"],\"fluente\":[\"italian\"],\"fluoro\":[\"italian\"],\"fobico\":[\"italian\"],\"focaccia\":[\"italian\"],\"focoso\":[\"italian\"],\"foderato\":[\"italian\"],\"foglio\":[\"italian\"],\"folata\":[\"italian\"],\"folclore\":[\"italian\"],\"folgore\":[\"italian\"],\"fondente\":[\"italian\"],\"fonetico\":[\"italian\"],\"fonia\":[\"italian\"],\"fontana\":[\"italian\"],\"forbito\":[\"italian\"],\"forchetta\":[\"italian\"],\"foresta\":[\"italian\"],\"formica\":[\"italian\"],\"fornaio\":[\"italian\"],\"foro\":[\"italian\"],\"fortezza\":[\"italian\"],\"forzare\":[\"italian\"],\"fosfato\":[\"italian\"],\"fosso\":[\"italian\"],\"fracasso\":[\"italian\"],\"frana\":[\"italian\"],\"frassino\":[\"italian\"],\"fratello\":[\"italian\"],\"freccetta\":[\"italian\"],\"frenata\":[\"italian\"],\"fresco\":[\"italian\"],\"frigo\":[\"italian\"],\"frollino\":[\"italian\"],\"fronde\":[\"italian\"],\"frugale\":[\"italian\"],\"frutta\":[\"italian\"],\"fucilata\":[\"italian\"],\"fucsia\":[\"italian\"],\"fuggente\":[\"italian\"],\"fulmine\":[\"italian\"],\"fulvo\":[\"italian\"],\"fumante\":[\"italian\"],\"fumetto\":[\"italian\"],\"fumoso\":[\"italian\"],\"fune\":[\"italian\"],\"funzione\":[\"italian\"],\"fuoco\":[\"italian\"],\"furbo\":[\"italian\"],\"furgone\":[\"italian\"],\"furore\":[\"italian\"],\"fuso\":[\"italian\"],\"futile\":[\"italian\"],\"gabbiano\":[\"italian\"],\"gaffe\":[\"italian\"],\"galateo\":[\"italian\"],\"gallina\":[\"italian\"],\"galoppo\":[\"italian\"],\"gambero\":[\"italian\"],\"gamma\":[\"italian\"],\"garanzia\":[\"italian\"],\"garbo\":[\"italian\"],\"garofano\":[\"italian\"],\"garzone\":[\"italian\"],\"gasdotto\":[\"italian\"],\"gasolio\":[\"italian\"],\"gastrico\":[\"italian\"],\"gatto\":[\"italian\"],\"gaudio\":[\"italian\"],\"gazebo\":[\"italian\"],\"gazzella\":[\"italian\"],\"geco\":[\"italian\"],\"gelatina\":[\"italian\"],\"gelso\":[\"italian\"],\"gemello\":[\"italian\"],\"gemmato\":[\"italian\"],\"gene\":[\"italian\"],\"genitore\":[\"italian\"],\"gennaio\":[\"italian\"],\"genotipo\":[\"italian\"],\"gergo\":[\"italian\"],\"ghepardo\":[\"italian\"],\"ghiaccio\":[\"italian\"],\"ghisa\":[\"italian\"],\"giallo\":[\"italian\"],\"gilda\":[\"italian\"],\"ginepro\":[\"italian\"],\"giocare\":[\"italian\"],\"gioiello\":[\"italian\"],\"giorno\":[\"italian\"],\"giove\":[\"italian\"],\"girato\":[\"italian\"],\"girone\":[\"italian\"],\"gittata\":[\"italian\"],\"giudizio\":[\"italian\"],\"giurato\":[\"italian\"],\"giusto\":[\"italian\"],\"globulo\":[\"italian\"],\"glutine\":[\"italian\"],\"gnomo\":[\"italian\"],\"gobba\":[\"italian\"],\"golf\":[\"italian\"],\"gomito\":[\"italian\"],\"gommone\":[\"italian\"],\"gonfio\":[\"italian\"],\"gonna\":[\"italian\"],\"governo\":[\"italian\"],\"gracile\":[\"italian\"],\"grado\":[\"italian\"],\"grafico\":[\"italian\"],\"grammo\":[\"italian\"],\"grande\":[\"italian\"],\"grattare\":[\"italian\"],\"gravoso\":[\"italian\"],\"grazia\":[\"italian\"],\"greca\":[\"italian\"],\"gregge\":[\"italian\"],\"grifone\":[\"italian\"],\"grigio\":[\"italian\"],\"grinza\":[\"italian\"],\"grotta\":[\"italian\"],\"gruppo\":[\"italian\"],\"guadagno\":[\"italian\"],\"guaio\":[\"italian\"],\"guanto\":[\"italian\"],\"guardare\":[\"italian\"],\"gufo\":[\"italian\"],\"guidare\":[\"italian\"],\"ibernato\":[\"italian\"],\"icona\":[\"italian\"],\"identico\":[\"italian\"],\"idillio\":[\"italian\"],\"idolo\":[\"italian\"],\"idra\":[\"italian\"],\"idrico\":[\"italian\"],\"idrogeno\":[\"italian\"],\"igiene\":[\"italian\"],\"ignaro\":[\"italian\"],\"ignorato\":[\"italian\"],\"ilare\":[\"italian\"],\"illeso\":[\"italian\"],\"illogico\":[\"italian\"],\"illudere\":[\"italian\"],\"imballo\":[\"italian\"],\"imbevuto\":[\"italian\"],\"imbocco\":[\"italian\"],\"imbuto\":[\"italian\"],\"immane\":[\"italian\"],\"immerso\":[\"italian\"],\"immolato\":[\"italian\"],\"impacco\":[\"italian\"],\"impeto\":[\"italian\"],\"impiego\":[\"italian\"],\"importo\":[\"italian\"],\"impronta\":[\"italian\"],\"inalare\":[\"italian\"],\"inarcare\":[\"italian\"],\"inattivo\":[\"italian\"],\"incanto\":[\"italian\"],\"incendio\":[\"italian\"],\"inchino\":[\"italian\"],\"incisivo\":[\"italian\"],\"incluso\":[\"italian\"],\"incontro\":[\"italian\"],\"incrocio\":[\"italian\"],\"incubo\":[\"italian\"],\"indagine\":[\"italian\"],\"india\":[\"italian\"],\"indole\":[\"italian\"],\"inedito\":[\"italian\"],\"infatti\":[\"italian\"],\"infilare\":[\"italian\"],\"inflitto\":[\"italian\"],\"ingaggio\":[\"italian\"],\"ingegno\":[\"italian\"],\"inglese\":[\"italian\"],\"ingordo\":[\"italian\"],\"ingrosso\":[\"italian\"],\"innesco\":[\"italian\"],\"inodore\":[\"italian\"],\"inoltrare\":[\"italian\"],\"inondato\":[\"italian\"],\"insano\":[\"italian\"],\"insetto\":[\"italian\"],\"insieme\":[\"italian\"],\"insonnia\":[\"italian\"],\"insulina\":[\"italian\"],\"intasato\":[\"italian\"],\"intero\":[\"italian\"],\"intonaco\":[\"italian\"],\"intuito\":[\"italian\"],\"inumidire\":[\"italian\"],\"invalido\":[\"italian\"],\"invece\":[\"italian\"],\"invito\":[\"italian\"],\"iperbole\":[\"italian\"],\"ipnotico\":[\"italian\"],\"ipotesi\":[\"italian\"],\"ippica\":[\"italian\"],\"iride\":[\"italian\"],\"irlanda\":[\"italian\"],\"ironico\":[\"italian\"],\"irrigato\":[\"italian\"],\"irrorare\":[\"italian\"],\"isolato\":[\"italian\"],\"isotopo\":[\"italian\"],\"isterico\":[\"italian\"],\"istituto\":[\"italian\"],\"istrice\":[\"italian\"],\"italia\":[\"italian\"],\"iterare\":[\"italian\"],\"labbro\":[\"italian\"],\"labirinto\":[\"italian\"],\"lacca\":[\"italian\"],\"lacerato\":[\"italian\"],\"lacrima\":[\"italian\"],\"lacuna\":[\"italian\"],\"laddove\":[\"italian\"],\"lago\":[\"italian\"],\"lampo\":[\"italian\"],\"lancetta\":[\"italian\"],\"lanterna\":[\"italian\"],\"lardoso\":[\"italian\"],\"larga\":[\"italian\"],\"laringe\":[\"italian\"],\"lastra\":[\"italian\"],\"latenza\":[\"italian\"],\"latino\":[\"italian\"],\"lattuga\":[\"italian\"],\"lavagna\":[\"italian\"],\"lavoro\":[\"italian\"],\"legale\":[\"italian\"],\"leggero\":[\"italian\"],\"lembo\":[\"italian\"],\"lentezza\":[\"italian\"],\"lenza\":[\"italian\"],\"leone\":[\"italian\"],\"lepre\":[\"italian\"],\"lesivo\":[\"italian\"],\"lessato\":[\"italian\"],\"lesto\":[\"italian\"],\"letterale\":[\"italian\"],\"leva\":[\"italian\"],\"levigato\":[\"italian\"],\"libero\":[\"italian\"],\"lido\":[\"italian\"],\"lievito\":[\"italian\"],\"lilla\":[\"italian\"],\"limatura\":[\"italian\"],\"limitare\":[\"italian\"],\"limpido\":[\"italian\"],\"lineare\":[\"italian\"],\"lingua\":[\"italian\"],\"liquido\":[\"italian\"],\"lira\":[\"italian\"],\"lirica\":[\"italian\"],\"lisca\":[\"italian\"],\"lite\":[\"italian\"],\"litigio\":[\"italian\"],\"livrea\":[\"italian\"],\"locanda\":[\"italian\"],\"lode\":[\"italian\"],\"logica\":[\"italian\"],\"lombare\":[\"italian\"],\"londra\":[\"italian\"],\"longevo\":[\"italian\"],\"loquace\":[\"italian\"],\"lorenzo\":[\"italian\"],\"loto\":[\"italian\"],\"lotteria\":[\"italian\"],\"luce\":[\"italian\"],\"lucidato\":[\"italian\"],\"lumaca\":[\"italian\"],\"luminoso\":[\"italian\"],\"lungo\":[\"italian\"],\"lupo\":[\"italian\"],\"luppolo\":[\"italian\"],\"lusinga\":[\"italian\"],\"lusso\":[\"italian\"],\"lutto\":[\"italian\"],\"macabro\":[\"italian\"],\"macchina\":[\"italian\"],\"macero\":[\"italian\"],\"macinato\":[\"italian\"],\"madama\":[\"italian\"],\"magico\":[\"italian\"],\"maglia\":[\"italian\"],\"magnete\":[\"italian\"],\"magro\":[\"italian\"],\"maiolica\":[\"italian\"],\"malafede\":[\"italian\"],\"malgrado\":[\"italian\"],\"malinteso\":[\"italian\"],\"malsano\":[\"italian\"],\"malto\":[\"italian\"],\"malumore\":[\"italian\"],\"mana\":[\"italian\"],\"mancia\":[\"italian\"],\"mandorla\":[\"italian\"],\"mangiare\":[\"italian\"],\"manifesto\":[\"italian\"],\"mannaro\":[\"italian\"],\"manovra\":[\"italian\"],\"mansarda\":[\"italian\"],\"mantide\":[\"italian\"],\"manubrio\":[\"italian\"],\"mappa\":[\"italian\"],\"maratona\":[\"italian\"],\"marcire\":[\"italian\"],\"maretta\":[\"italian\"],\"marmo\":[\"italian\"],\"marsupio\":[\"italian\"],\"maschera\":[\"italian\"],\"massaia\":[\"italian\"],\"mastino\":[\"italian\"],\"materasso\":[\"italian\"],\"matricola\":[\"italian\"],\"mattone\":[\"italian\"],\"maturo\":[\"italian\"],\"mazurca\":[\"italian\"],\"meandro\":[\"italian\"],\"meccanico\":[\"italian\"],\"mecenate\":[\"italian\"],\"medesimo\":[\"italian\"],\"meditare\":[\"italian\"],\"mega\":[\"italian\"],\"melassa\":[\"italian\"],\"melis\":[\"italian\"],\"melodia\":[\"italian\"],\"meninge\":[\"italian\"],\"meno\":[\"italian\"],\"mensola\":[\"italian\"],\"mercurio\":[\"italian\"],\"merenda\":[\"italian\"],\"merlo\":[\"italian\"],\"meschino\":[\"italian\"],\"mese\":[\"italian\"],\"messere\":[\"italian\"],\"mestolo\":[\"italian\"],\"metallo\":[\"italian\"],\"metodo\":[\"italian\"],\"mettere\":[\"italian\"],\"miagolare\":[\"italian\"],\"mica\":[\"italian\"],\"micelio\":[\"italian\"],\"michele\":[\"italian\"],\"microbo\":[\"italian\"],\"midollo\":[\"italian\"],\"miele\":[\"italian\"],\"migliore\":[\"italian\"],\"milano\":[\"italian\"],\"milite\":[\"italian\"],\"mimosa\":[\"italian\"],\"minerale\":[\"italian\"],\"mini\":[\"italian\"],\"minore\":[\"italian\"],\"mirino\":[\"italian\"],\"mirtillo\":[\"italian\"],\"miscela\":[\"italian\"],\"missiva\":[\"italian\"],\"misto\":[\"italian\"],\"misurare\":[\"italian\"],\"mitezza\":[\"italian\"],\"mitigare\":[\"italian\"],\"mitra\":[\"italian\"],\"mittente\":[\"italian\"],\"mnemonico\":[\"italian\"],\"modello\":[\"italian\"],\"modifica\":[\"italian\"],\"modulo\":[\"italian\"],\"mogano\":[\"italian\"],\"mogio\":[\"italian\"],\"mole\":[\"italian\"],\"molosso\":[\"italian\"],\"monastero\":[\"italian\"],\"monco\":[\"italian\"],\"mondina\":[\"italian\"],\"monetario\":[\"italian\"],\"monile\":[\"italian\"],\"monotono\":[\"italian\"],\"monsone\":[\"italian\"],\"montato\":[\"italian\"],\"monviso\":[\"italian\"],\"mora\":[\"italian\"],\"mordere\":[\"italian\"],\"morsicato\":[\"italian\"],\"mostro\":[\"italian\"],\"motivato\":[\"italian\"],\"motosega\":[\"italian\"],\"motto\":[\"italian\"],\"movenza\":[\"italian\"],\"movimento\":[\"italian\"],\"mozzo\":[\"italian\"],\"mucca\":[\"italian\"],\"mucosa\":[\"italian\"],\"muffa\":[\"italian\"],\"mughetto\":[\"italian\"],\"mugnaio\":[\"italian\"],\"mulatto\":[\"italian\"],\"mulinello\":[\"italian\"],\"multiplo\":[\"italian\"],\"mummia\":[\"italian\"],\"munto\":[\"italian\"],\"muovere\":[\"italian\"],\"murale\":[\"italian\"],\"musa\":[\"italian\"],\"muscolo\":[\"italian\"],\"musica\":[\"italian\"],\"mutevole\":[\"italian\"],\"muto\":[\"italian\"],\"nababbo\":[\"italian\"],\"nafta\":[\"italian\"],\"nanometro\":[\"italian\"],\"narciso\":[\"italian\"],\"narice\":[\"italian\"],\"narrato\":[\"italian\"],\"nascere\":[\"italian\"],\"nastrare\":[\"italian\"],\"naturale\":[\"italian\"],\"nautica\":[\"italian\"],\"naviglio\":[\"italian\"],\"nebulosa\":[\"italian\"],\"necrosi\":[\"italian\"],\"negativo\":[\"italian\"],\"negozio\":[\"italian\"],\"nemmeno\":[\"italian\"],\"neofita\":[\"italian\"],\"neretto\":[\"italian\"],\"nervo\":[\"italian\"],\"nessuno\":[\"italian\"],\"nettuno\":[\"italian\"],\"neutrale\":[\"italian\"],\"neve\":[\"italian\"],\"nevrotico\":[\"italian\"],\"nicchia\":[\"italian\"],\"ninfa\":[\"italian\"],\"nitido\":[\"italian\"],\"nobile\":[\"italian\"],\"nocivo\":[\"italian\"],\"nodo\":[\"italian\"],\"nome\":[\"italian\"],\"nomina\":[\"italian\"],\"nordico\":[\"italian\"],\"normale\":[\"italian\"],\"norvegese\":[\"italian\"],\"nostrano\":[\"italian\"],\"notare\":[\"italian\"],\"notizia\":[\"italian\"],\"notturno\":[\"italian\"],\"novella\":[\"italian\"],\"nucleo\":[\"italian\"],\"nulla\":[\"italian\"],\"numero\":[\"italian\"],\"nuovo\":[\"italian\"],\"nutrire\":[\"italian\"],\"nuvola\":[\"italian\"],\"nuziale\":[\"italian\"],\"oasi\":[\"italian\"],\"obbedire\":[\"italian\"],\"obbligo\":[\"italian\"],\"obelisco\":[\"italian\"],\"oblio\":[\"italian\"],\"obolo\":[\"italian\"],\"obsoleto\":[\"italian\"],\"occasione\":[\"italian\"],\"occhio\":[\"italian\"],\"occidente\":[\"italian\"],\"occorrere\":[\"italian\"],\"occultare\":[\"italian\"],\"ocra\":[\"italian\"],\"oculato\":[\"italian\"],\"odierno\":[\"italian\"],\"odorare\":[\"italian\"],\"offerta\":[\"italian\"],\"offrire\":[\"italian\"],\"offuscato\":[\"italian\"],\"oggetto\":[\"italian\"],\"oggi\":[\"italian\"],\"ognuno\":[\"italian\"],\"olandese\":[\"italian\"],\"olfatto\":[\"italian\"],\"oliato\":[\"italian\"],\"oliva\":[\"italian\"],\"ologramma\":[\"italian\"],\"oltre\":[\"italian\"],\"omaggio\":[\"italian\"],\"ombelico\":[\"italian\"],\"ombra\":[\"italian\"],\"omega\":[\"italian\"],\"omissione\":[\"italian\"],\"ondoso\":[\"italian\"],\"onere\":[\"italian\"],\"onice\":[\"italian\"],\"onnivoro\":[\"italian\"],\"onorevole\":[\"italian\"],\"onta\":[\"italian\"],\"operato\":[\"italian\"],\"opinione\":[\"italian\"],\"opposto\":[\"italian\"],\"oracolo\":[\"italian\"],\"orafo\":[\"italian\"],\"ordine\":[\"italian\"],\"orecchino\":[\"italian\"],\"orefice\":[\"italian\"],\"orfano\":[\"italian\"],\"organico\":[\"italian\"],\"origine\":[\"italian\"],\"orizzonte\":[\"italian\"],\"orma\":[\"italian\"],\"ormeggio\":[\"italian\"],\"ornativo\":[\"italian\"],\"orologio\":[\"italian\"],\"orrendo\":[\"italian\"],\"orribile\":[\"italian\"],\"ortensia\":[\"italian\"],\"ortica\":[\"italian\"],\"orzata\":[\"italian\"],\"orzo\":[\"italian\"],\"osare\":[\"italian\"],\"oscurare\":[\"italian\"],\"osmosi\":[\"italian\"],\"ospedale\":[\"italian\"],\"ospite\":[\"italian\"],\"ossa\":[\"italian\"],\"ossidare\":[\"italian\"],\"ostacolo\":[\"italian\"],\"oste\":[\"italian\"],\"otite\":[\"italian\"],\"otre\":[\"italian\"],\"ottagono\":[\"italian\"],\"ottimo\":[\"italian\"],\"ottobre\":[\"italian\"],\"ovale\":[\"italian\"],\"ovest\":[\"italian\"],\"ovino\":[\"italian\"],\"oviparo\":[\"italian\"],\"ovocito\":[\"italian\"],\"ovunque\":[\"italian\"],\"ovviare\":[\"italian\"],\"ozio\":[\"italian\"],\"pacchetto\":[\"italian\"],\"pace\":[\"italian\"],\"pacifico\":[\"italian\"],\"padella\":[\"italian\"],\"padrone\":[\"italian\"],\"paese\":[\"italian\"],\"paga\":[\"italian\"],\"pagina\":[\"italian\"],\"palazzina\":[\"italian\"],\"palesare\":[\"italian\"],\"pallido\":[\"italian\"],\"palo\":[\"italian\"],\"palude\":[\"italian\"],\"pandoro\":[\"italian\"],\"pannello\":[\"italian\"],\"paolo\":[\"italian\"],\"paonazzo\":[\"italian\"],\"paprica\":[\"italian\"],\"parabola\":[\"italian\"],\"parcella\":[\"italian\"],\"parere\":[\"italian\"],\"pargolo\":[\"italian\"],\"pari\":[\"italian\"],\"parlato\":[\"italian\"],\"parola\":[\"italian\"],\"partire\":[\"italian\"],\"parvenza\":[\"italian\"],\"parziale\":[\"italian\"],\"passivo\":[\"italian\"],\"pasticca\":[\"italian\"],\"patacca\":[\"italian\"],\"patologia\":[\"italian\"],\"pattume\":[\"italian\"],\"pavone\":[\"italian\"],\"peccato\":[\"italian\"],\"pedalare\":[\"italian\"],\"pedonale\":[\"italian\"],\"peggio\":[\"italian\"],\"peloso\":[\"italian\"],\"penare\":[\"italian\"],\"pendice\":[\"italian\"],\"penisola\":[\"italian\"],\"pennuto\":[\"italian\"],\"penombra\":[\"italian\"],\"pensare\":[\"italian\"],\"pentola\":[\"italian\"],\"pepe\":[\"italian\"],\"pepita\":[\"italian\"],\"perbene\":[\"italian\"],\"percorso\":[\"italian\"],\"perdonato\":[\"italian\"],\"perforare\":[\"italian\"],\"pergamena\":[\"italian\"],\"periodo\":[\"italian\"],\"permesso\":[\"italian\"],\"perno\":[\"italian\"],\"perplesso\":[\"italian\"],\"persuaso\":[\"italian\"],\"pertugio\":[\"italian\"],\"pervaso\":[\"italian\"],\"pesatore\":[\"italian\"],\"pesista\":[\"italian\"],\"peso\":[\"italian\"],\"pestifero\":[\"italian\"],\"petalo\":[\"italian\"],\"pettine\":[\"italian\"],\"petulante\":[\"italian\"],\"pezzo\":[\"italian\"],\"piacere\":[\"italian\"],\"pianta\":[\"italian\"],\"piattino\":[\"italian\"],\"piccino\":[\"italian\"],\"picozza\":[\"italian\"],\"piega\":[\"italian\"],\"pietra\":[\"italian\"],\"piffero\":[\"italian\"],\"pigiama\":[\"italian\"],\"pigolio\":[\"italian\"],\"pigro\":[\"italian\"],\"pila\":[\"italian\"],\"pilifero\":[\"italian\"],\"pillola\":[\"italian\"],\"pilota\":[\"italian\"],\"pimpante\":[\"italian\"],\"pineta\":[\"italian\"],\"pinna\":[\"italian\"],\"pinolo\":[\"italian\"],\"pioggia\":[\"italian\"],\"piombo\":[\"italian\"],\"piramide\":[\"italian\"],\"piretico\":[\"italian\"],\"pirite\":[\"italian\"],\"pirolisi\":[\"italian\"],\"pitone\":[\"italian\"],\"pizzico\":[\"italian\"],\"placebo\":[\"italian\"],\"planare\":[\"italian\"],\"plasma\":[\"italian\"],\"platano\":[\"italian\"],\"plenario\":[\"italian\"],\"pochezza\":[\"italian\"],\"poderoso\":[\"italian\"],\"podismo\":[\"italian\"],\"poesia\":[\"italian\"],\"poggiare\":[\"italian\"],\"polenta\":[\"italian\"],\"poligono\":[\"italian\"],\"pollice\":[\"italian\"],\"polmonite\":[\"italian\"],\"polpetta\":[\"italian\"],\"polso\":[\"italian\"],\"poltrona\":[\"italian\"],\"polvere\":[\"italian\"],\"pomice\":[\"italian\"],\"pomodoro\":[\"italian\"],\"ponte\":[\"italian\"],\"popoloso\":[\"italian\"],\"porfido\":[\"italian\"],\"poroso\":[\"italian\"],\"porpora\":[\"italian\"],\"porre\":[\"italian\"],\"portata\":[\"italian\"],\"posa\":[\"italian\",\"turkish\"],\"positivo\":[\"italian\"],\"possesso\":[\"italian\"],\"postulato\":[\"italian\"],\"potassio\":[\"italian\"],\"potere\":[\"italian\"],\"pranzo\":[\"italian\"],\"prassi\":[\"italian\"],\"pratica\":[\"italian\"],\"precluso\":[\"italian\"],\"predica\":[\"italian\"],\"prefisso\":[\"italian\"],\"pregiato\":[\"italian\"],\"prelievo\":[\"italian\"],\"premere\":[\"italian\"],\"prenotare\":[\"italian\"],\"preparato\":[\"italian\"],\"presenza\":[\"italian\"],\"pretesto\":[\"italian\"],\"prevalso\":[\"italian\"],\"prima\":[\"italian\"],\"principe\":[\"italian\"],\"privato\":[\"italian\"],\"problema\":[\"italian\"],\"procura\":[\"italian\"],\"produrre\":[\"italian\"],\"profumo\":[\"italian\"],\"progetto\":[\"italian\"],\"prolunga\":[\"italian\"],\"promessa\":[\"italian\"],\"pronome\":[\"italian\"],\"proposta\":[\"italian\"],\"proroga\":[\"italian\"],\"proteso\":[\"italian\"],\"prova\":[\"italian\",\"turkish\"],\"prudente\":[\"italian\"],\"prugna\":[\"italian\"],\"prurito\":[\"italian\"],\"psiche\":[\"italian\"],\"pubblico\":[\"italian\"],\"pudica\":[\"italian\"],\"pugilato\":[\"italian\"],\"pugno\":[\"italian\"],\"pulce\":[\"italian\"],\"pulito\":[\"italian\"],\"pulsante\":[\"italian\"],\"puntare\":[\"italian\"],\"pupazzo\":[\"italian\"],\"pupilla\":[\"italian\"],\"puro\":[\"italian\"],\"quadro\":[\"italian\"],\"qualcosa\":[\"italian\"],\"quasi\":[\"italian\"],\"querela\":[\"italian\"],\"quota\":[\"italian\"],\"raccolto\":[\"italian\"],\"raddoppio\":[\"italian\"],\"radicale\":[\"italian\"],\"radunato\":[\"italian\"],\"raffica\":[\"italian\"],\"ragazzo\":[\"italian\"],\"ragione\":[\"italian\"],\"ragno\":[\"italian\"],\"ramarro\":[\"italian\"],\"ramingo\":[\"italian\"],\"ramo\":[\"italian\"],\"randagio\":[\"italian\"],\"rantolare\":[\"italian\"],\"rapato\":[\"italian\"],\"rapina\":[\"italian\"],\"rappreso\":[\"italian\"],\"rasatura\":[\"italian\"],\"raschiato\":[\"italian\"],\"rasente\":[\"italian\"],\"rassegna\":[\"italian\"],\"rastrello\":[\"italian\"],\"rata\":[\"italian\"],\"ravveduto\":[\"italian\"],\"reale\":[\"italian\"],\"recepire\":[\"italian\"],\"recinto\":[\"italian\"],\"recluta\":[\"italian\"],\"recondito\":[\"italian\"],\"recupero\":[\"italian\"],\"reddito\":[\"italian\"],\"redimere\":[\"italian\"],\"regalato\":[\"italian\"],\"registro\":[\"italian\"],\"regola\":[\"italian\"],\"regresso\":[\"italian\"],\"relazione\":[\"italian\"],\"remare\":[\"italian\"],\"remoto\":[\"italian\"],\"renna\":[\"italian\"],\"replica\":[\"italian\"],\"reprimere\":[\"italian\"],\"reputare\":[\"italian\"],\"resa\":[\"italian\"],\"residente\":[\"italian\"],\"responso\":[\"italian\"],\"restauro\":[\"italian\"],\"rete\":[\"italian\"],\"retina\":[\"italian\"],\"retorica\":[\"italian\"],\"rettifica\":[\"italian\"],\"revocato\":[\"italian\"],\"riassunto\":[\"italian\"],\"ribadire\":[\"italian\"],\"ribelle\":[\"italian\"],\"ribrezzo\":[\"italian\"],\"ricarica\":[\"italian\"],\"ricco\":[\"italian\"],\"ricevere\":[\"italian\"],\"riciclato\":[\"italian\"],\"ricordo\":[\"italian\"],\"ricreduto\":[\"italian\"],\"ridicolo\":[\"italian\"],\"ridurre\":[\"italian\"],\"rifasare\":[\"italian\"],\"riflesso\":[\"italian\"],\"riforma\":[\"italian\"],\"rifugio\":[\"italian\"],\"rigare\":[\"italian\"],\"rigettato\":[\"italian\"],\"righello\":[\"italian\"],\"rilassato\":[\"italian\"],\"rilevato\":[\"italian\"],\"rimanere\":[\"italian\"],\"rimbalzo\":[\"italian\"],\"rimedio\":[\"italian\"],\"rimorchio\":[\"italian\"],\"rinascita\":[\"italian\"],\"rincaro\":[\"italian\"],\"rinforzo\":[\"italian\"],\"rinnovo\":[\"italian\"],\"rinomato\":[\"italian\"],\"rinsavito\":[\"italian\"],\"rintocco\":[\"italian\"],\"rinuncia\":[\"italian\"],\"rinvenire\":[\"italian\"],\"riparato\":[\"italian\"],\"ripetuto\":[\"italian\"],\"ripieno\":[\"italian\"],\"riportare\":[\"italian\"],\"ripresa\":[\"italian\"],\"ripulire\":[\"italian\"],\"risata\":[\"italian\"],\"rischio\":[\"italian\"],\"riserva\":[\"italian\"],\"risibile\":[\"italian\"],\"riso\":[\"italian\"],\"rispetto\":[\"italian\"],\"ristoro\":[\"italian\"],\"risultato\":[\"italian\"],\"risvolto\":[\"italian\"],\"ritardo\":[\"italian\"],\"ritegno\":[\"italian\"],\"ritmico\":[\"italian\"],\"ritrovo\":[\"italian\"],\"riunione\":[\"italian\"],\"riva\":[\"italian\"],\"riverso\":[\"italian\"],\"rivincita\":[\"italian\"],\"rivolto\":[\"italian\"],\"rizoma\":[\"italian\"],\"roba\":[\"italian\"],\"robotico\":[\"italian\"],\"robusto\":[\"italian\"],\"roccia\":[\"italian\"],\"roco\":[\"italian\"],\"rodaggio\":[\"italian\"],\"rodere\":[\"italian\"],\"roditore\":[\"italian\"],\"rogito\":[\"italian\"],\"rollio\":[\"italian\"],\"romantico\":[\"italian\"],\"rompere\":[\"italian\"],\"ronzio\":[\"italian\"],\"rosolare\":[\"italian\"],\"rospo\":[\"italian\"],\"rotante\":[\"italian\"],\"rotondo\":[\"italian\"],\"rotula\":[\"italian\"],\"rovescio\":[\"italian\"],\"rubizzo\":[\"italian\"],\"rubrica\":[\"italian\"],\"ruga\":[\"italian\"],\"rullino\":[\"italian\"],\"rumine\":[\"italian\"],\"rumoroso\":[\"italian\"],\"ruolo\":[\"italian\"],\"rupe\":[\"italian\"],\"russare\":[\"italian\"],\"rustico\":[\"italian\"],\"sabato\":[\"italian\"],\"sabbiare\":[\"italian\"],\"sabotato\":[\"italian\"],\"sagoma\":[\"italian\"],\"salasso\":[\"italian\"],\"saldatura\":[\"italian\"],\"salgemma\":[\"italian\"],\"salivare\":[\"italian\"],\"salmone\":[\"italian\"],\"salone\":[\"italian\"],\"saltare\":[\"italian\"],\"saluto\":[\"italian\"],\"salvo\":[\"italian\"],\"sapere\":[\"italian\"],\"sapido\":[\"italian\"],\"saporito\":[\"italian\"],\"saraceno\":[\"italian\"],\"sarcasmo\":[\"italian\"],\"sarto\":[\"italian\"],\"sassoso\":[\"italian\"],\"satellite\":[\"italian\"],\"satira\":[\"italian\"],\"satollo\":[\"italian\"],\"saturno\":[\"italian\"],\"savana\":[\"italian\"],\"savio\":[\"italian\"],\"saziato\":[\"italian\"],\"sbadiglio\":[\"italian\"],\"sbalzo\":[\"italian\"],\"sbancato\":[\"italian\"],\"sbarra\":[\"italian\"],\"sbattere\":[\"italian\"],\"sbavare\":[\"italian\"],\"sbendare\":[\"italian\"],\"sbirciare\":[\"italian\"],\"sbloccato\":[\"italian\"],\"sbocciato\":[\"italian\"],\"sbrinare\":[\"italian\"],\"sbruffone\":[\"italian\"],\"sbuffare\":[\"italian\"],\"scabroso\":[\"italian\"],\"scadenza\":[\"italian\"],\"scala\":[\"italian\"],\"scambiare\":[\"italian\"],\"scandalo\":[\"italian\"],\"scapola\":[\"italian\"],\"scarso\":[\"italian\"],\"scatenare\":[\"italian\"],\"scavato\":[\"italian\"],\"scelto\":[\"italian\"],\"scenico\":[\"italian\"],\"scettro\":[\"italian\"],\"scheda\":[\"italian\"],\"schiena\":[\"italian\"],\"sciarpa\":[\"italian\"],\"scienza\":[\"italian\"],\"scindere\":[\"italian\"],\"scippo\":[\"italian\"],\"sciroppo\":[\"italian\"],\"scivolo\":[\"italian\"],\"sclerare\":[\"italian\"],\"scodella\":[\"italian\"],\"scolpito\":[\"italian\"],\"scomparto\":[\"italian\"],\"sconforto\":[\"italian\"],\"scoprire\":[\"italian\"],\"scorta\":[\"italian\"],\"scossone\":[\"italian\"],\"scozzese\":[\"italian\"],\"scriba\":[\"italian\"],\"scrollare\":[\"italian\"],\"scrutinio\":[\"italian\"],\"scuderia\":[\"italian\"],\"scultore\":[\"italian\"],\"scuola\":[\"italian\"],\"scuro\":[\"italian\"],\"scusare\":[\"italian\"],\"sdebitare\":[\"italian\"],\"sdoganare\":[\"italian\"],\"seccatura\":[\"italian\"],\"secondo\":[\"italian\"],\"sedano\":[\"italian\"],\"seggiola\":[\"italian\"],\"segnalato\":[\"italian\"],\"segregato\":[\"italian\"],\"seguito\":[\"italian\"],\"selciato\":[\"italian\"],\"selettivo\":[\"italian\"],\"sella\":[\"italian\"],\"selvaggio\":[\"italian\"],\"semaforo\":[\"italian\"],\"sembrare\":[\"italian\"],\"seme\":[\"italian\"],\"seminato\":[\"italian\"],\"sempre\":[\"italian\"],\"senso\":[\"italian\"],\"sentire\":[\"italian\"],\"sepolto\":[\"italian\"],\"sequenza\":[\"italian\"],\"serata\":[\"italian\"],\"serbato\":[\"italian\"],\"sereno\":[\"italian\"],\"serio\":[\"italian\"],\"serpente\":[\"italian\"],\"serraglio\":[\"italian\"],\"servire\":[\"italian\"],\"sestina\":[\"italian\"],\"setola\":[\"italian\"],\"settimana\":[\"italian\"],\"sfacelo\":[\"italian\"],\"sfaldare\":[\"italian\"],\"sfamato\":[\"italian\"],\"sfarzoso\":[\"italian\"],\"sfaticato\":[\"italian\"],\"sfera\":[\"italian\"],\"sfida\":[\"italian\"],\"sfilato\":[\"italian\"],\"sfinge\":[\"italian\"],\"sfocato\":[\"italian\"],\"sfoderare\":[\"italian\"],\"sfogo\":[\"italian\"],\"sfoltire\":[\"italian\"],\"sforzato\":[\"italian\"],\"sfratto\":[\"italian\"],\"sfruttato\":[\"italian\"],\"sfuggito\":[\"italian\"],\"sfumare\":[\"italian\"],\"sfuso\":[\"italian\"],\"sgabello\":[\"italian\"],\"sgarbato\":[\"italian\"],\"sgonfiare\":[\"italian\"],\"sgorbio\":[\"italian\"],\"sgrassato\":[\"italian\"],\"sguardo\":[\"italian\"],\"sibilo\":[\"italian\"],\"siccome\":[\"italian\"],\"sierra\":[\"italian\"],\"sigla\":[\"italian\"],\"signore\":[\"italian\"],\"silenzio\":[\"italian\"],\"sillaba\":[\"italian\"],\"simbolo\":[\"italian\"],\"simpatico\":[\"italian\"],\"simulato\":[\"italian\"],\"sinfonia\":[\"italian\"],\"singolo\":[\"italian\"],\"sinistro\":[\"italian\"],\"sino\":[\"italian\"],\"sintesi\":[\"italian\"],\"sinusoide\":[\"italian\"],\"sipario\":[\"italian\"],\"sisma\":[\"italian\"],\"sistole\":[\"italian\"],\"situato\":[\"italian\"],\"slitta\":[\"italian\"],\"slogatura\":[\"italian\"],\"sloveno\":[\"italian\"],\"smarrito\":[\"italian\"],\"smemorato\":[\"italian\"],\"smentito\":[\"italian\"],\"smeraldo\":[\"italian\"],\"smilzo\":[\"italian\"],\"smontare\":[\"italian\"],\"smottato\":[\"italian\"],\"smussato\":[\"italian\"],\"snellire\":[\"italian\"],\"snervato\":[\"italian\"],\"snodo\":[\"italian\"],\"sobbalzo\":[\"italian\"],\"sobrio\":[\"italian\"],\"soccorso\":[\"italian\"],\"sociale\":[\"italian\"],\"sodale\":[\"italian\"],\"soffitto\":[\"italian\"],\"sogno\":[\"italian\"],\"soldato\":[\"italian\"],\"solenne\":[\"italian\"],\"solido\":[\"italian\"],\"sollazzo\":[\"italian\"],\"solo\":[\"italian\"],\"solubile\":[\"italian\"],\"solvente\":[\"italian\"],\"somatico\":[\"italian\"],\"somma\":[\"italian\"],\"sonda\":[\"italian\"],\"sonetto\":[\"italian\"],\"sonnifero\":[\"italian\"],\"sopire\":[\"italian\"],\"soppeso\":[\"italian\"],\"sopra\":[\"italian\"],\"sorgere\":[\"italian\"],\"sorpasso\":[\"italian\"],\"sorriso\":[\"italian\"],\"sorso\":[\"italian\"],\"sorteggio\":[\"italian\"],\"sorvolato\":[\"italian\"],\"sospiro\":[\"italian\"],\"sosta\":[\"italian\"],\"sottile\":[\"italian\"],\"spada\":[\"italian\"],\"spalla\":[\"italian\"],\"spargere\":[\"italian\"],\"spatola\":[\"italian\"],\"spavento\":[\"italian\"],\"spazzola\":[\"italian\"],\"specie\":[\"italian\"],\"spedire\":[\"italian\"],\"spegnere\":[\"italian\"],\"spelatura\":[\"italian\"],\"speranza\":[\"italian\"],\"spessore\":[\"italian\"],\"spettrale\":[\"italian\"],\"spezzato\":[\"italian\"],\"spia\":[\"italian\"],\"spigoloso\":[\"italian\"],\"spillato\":[\"italian\"],\"spinoso\":[\"italian\"],\"spirale\":[\"italian\"],\"splendido\":[\"italian\"],\"sportivo\":[\"italian\"],\"sposo\":[\"italian\"],\"spranga\":[\"italian\"],\"sprecare\":[\"italian\"],\"spronato\":[\"italian\"],\"spruzzo\":[\"italian\"],\"spuntino\":[\"italian\"],\"squillo\":[\"italian\"],\"sradicare\":[\"italian\"],\"srotolato\":[\"italian\"],\"stabile\":[\"italian\"],\"stacco\":[\"italian\"],\"staffa\":[\"italian\"],\"stagnare\":[\"italian\"],\"stampato\":[\"italian\"],\"stantio\":[\"italian\"],\"starnuto\":[\"italian\"],\"stasera\":[\"italian\"],\"statuto\":[\"italian\"],\"stelo\":[\"italian\"],\"steppa\":[\"italian\"],\"sterzo\":[\"italian\"],\"stiletto\":[\"italian\"],\"stima\":[\"italian\"],\"stirpe\":[\"italian\"],\"stivale\":[\"italian\"],\"stizzoso\":[\"italian\"],\"stonato\":[\"italian\"],\"storico\":[\"italian\"],\"strappo\":[\"italian\"],\"stregato\":[\"italian\"],\"stridulo\":[\"italian\"],\"strozzare\":[\"italian\"],\"strutto\":[\"italian\"],\"stuccare\":[\"italian\"],\"stufo\":[\"italian\"],\"stupendo\":[\"italian\"],\"subentro\":[\"italian\"],\"succoso\":[\"italian\"],\"sudore\":[\"italian\"],\"suggerito\":[\"italian\"],\"sugo\":[\"italian\"],\"sultano\":[\"italian\"],\"suonare\":[\"italian\"],\"superbo\":[\"italian\"],\"supporto\":[\"italian\"],\"surgelato\":[\"italian\"],\"surrogato\":[\"italian\"],\"sussurro\":[\"italian\"],\"sutura\":[\"italian\"],\"svagare\":[\"italian\"],\"svedese\":[\"italian\"],\"sveglio\":[\"italian\"],\"svelare\":[\"italian\"],\"svenuto\":[\"italian\"],\"svezia\":[\"italian\"],\"sviluppo\":[\"italian\"],\"svista\":[\"italian\"],\"svizzera\":[\"italian\"],\"svolta\":[\"italian\"],\"svuotare\":[\"italian\"],\"tabacco\":[\"italian\"],\"tabulato\":[\"italian\"],\"tacciare\":[\"italian\"],\"taciturno\":[\"italian\"],\"tale\":[\"italian\"],\"talismano\":[\"italian\"],\"tampone\":[\"italian\"],\"tannino\":[\"italian\"],\"tara\":[\"italian\"],\"tardivo\":[\"italian\"],\"targato\":[\"italian\"],\"tariffa\":[\"italian\"],\"tarpare\":[\"italian\"],\"tartaruga\":[\"italian\"],\"tasto\":[\"italian\"],\"tattico\":[\"italian\"],\"taverna\":[\"italian\"],\"tavolata\":[\"italian\"],\"tazza\":[\"italian\"],\"teca\":[\"italian\"],\"tecnico\":[\"italian\"],\"telefono\":[\"italian\"],\"temerario\":[\"italian\"],\"tempo\":[\"italian\",\"turkish\"],\"temuto\":[\"italian\"],\"tendone\":[\"italian\"],\"tenero\":[\"italian\"],\"tensione\":[\"italian\"],\"tentacolo\":[\"italian\"],\"teorema\":[\"italian\"],\"terme\":[\"italian\"],\"terrazzo\":[\"italian\"],\"terzetto\":[\"italian\"],\"tesi\":[\"italian\"],\"tesserato\":[\"italian\"],\"testato\":[\"italian\"],\"tetro\":[\"italian\"],\"tettoia\":[\"italian\"],\"tifare\":[\"italian\"],\"tigella\":[\"italian\"],\"timbro\":[\"italian\"],\"tinto\":[\"italian\"],\"tipico\":[\"italian\"],\"tipografo\":[\"italian\"],\"tiraggio\":[\"italian\"],\"tiro\":[\"italian\"],\"titanio\":[\"italian\"],\"titolo\":[\"italian\"],\"titubante\":[\"italian\"],\"tizio\":[\"italian\"],\"tizzone\":[\"italian\"],\"toccare\":[\"italian\"],\"tollerare\":[\"italian\"],\"tolto\":[\"italian\"],\"tombola\":[\"italian\"],\"tomo\":[\"italian\"],\"tonfo\":[\"italian\"],\"tonsilla\":[\"italian\"],\"topazio\":[\"italian\"],\"topologia\":[\"italian\"],\"toppa\":[\"italian\"],\"torba\":[\"italian\"],\"tornare\":[\"italian\"],\"torrone\":[\"italian\"],\"tortora\":[\"italian\"],\"toscano\":[\"italian\"],\"tossire\":[\"italian\"],\"tostatura\":[\"italian\"],\"totano\":[\"italian\"],\"trabocco\":[\"italian\"],\"trachea\":[\"italian\"],\"trafila\":[\"italian\"],\"tragedia\":[\"italian\"],\"tralcio\":[\"italian\"],\"tramonto\":[\"italian\"],\"transito\":[\"italian\"],\"trapano\":[\"italian\"],\"trarre\":[\"italian\"],\"trasloco\":[\"italian\"],\"trattato\":[\"italian\"],\"trave\":[\"italian\"],\"treccia\":[\"italian\"],\"tremolio\":[\"italian\"],\"trespolo\":[\"italian\"],\"tributo\":[\"italian\"],\"tricheco\":[\"italian\"],\"trifoglio\":[\"italian\"],\"trillo\":[\"italian\"],\"trincea\":[\"italian\"],\"trio\":[\"italian\"],\"tristezza\":[\"italian\"],\"triturato\":[\"italian\"],\"trivella\":[\"italian\"],\"tromba\":[\"italian\"],\"trono\":[\"italian\"],\"troppo\":[\"italian\"],\"trottola\":[\"italian\"],\"trovare\":[\"italian\"],\"truccato\":[\"italian\"],\"tubatura\":[\"italian\"],\"tuffato\":[\"italian\"],\"tulipano\":[\"italian\"],\"tumulto\":[\"italian\"],\"tunisia\":[\"italian\"],\"turbare\":[\"italian\"],\"turchino\":[\"italian\"],\"tuta\":[\"italian\"],\"tutela\":[\"italian\"],\"ubicato\":[\"italian\"],\"uccello\":[\"italian\"],\"uccisore\":[\"italian\"],\"udire\":[\"italian\"],\"uditivo\":[\"italian\"],\"uffa\":[\"italian\"],\"ufficio\":[\"italian\"],\"uguale\":[\"italian\"],\"ulisse\":[\"italian\"],\"ultimato\":[\"italian\"],\"umano\":[\"italian\"],\"umile\":[\"italian\"],\"umorismo\":[\"italian\"],\"uncinetto\":[\"italian\"],\"ungere\":[\"italian\"],\"ungherese\":[\"italian\"],\"unicorno\":[\"italian\"],\"unificato\":[\"italian\"],\"unisono\":[\"italian\"],\"unitario\":[\"italian\"],\"unte\":[\"italian\"],\"uovo\":[\"italian\"],\"upupa\":[\"italian\"],\"uragano\":[\"italian\"],\"urgenza\":[\"italian\"],\"urlo\":[\"italian\"],\"usanza\":[\"italian\"],\"usato\":[\"italian\"],\"uscito\":[\"italian\"],\"usignolo\":[\"italian\"],\"usuraio\":[\"italian\"],\"utensile\":[\"italian\"],\"utilizzo\":[\"italian\"],\"utopia\":[\"italian\"],\"vacante\":[\"italian\"],\"vaccinato\":[\"italian\"],\"vagabondo\":[\"italian\"],\"vagliato\":[\"italian\"],\"valanga\":[\"italian\"],\"valgo\":[\"italian\"],\"valico\":[\"italian\"],\"valletta\":[\"italian\"],\"valoroso\":[\"italian\"],\"valutare\":[\"italian\"],\"valvola\":[\"italian\"],\"vampata\":[\"italian\"],\"vangare\":[\"italian\"],\"vanitoso\":[\"italian\"],\"vano\":[\"italian\"],\"vantaggio\":[\"italian\"],\"vanvera\":[\"italian\"],\"vapore\":[\"italian\"],\"varano\":[\"italian\"],\"varcato\":[\"italian\"],\"variante\":[\"italian\"],\"vasca\":[\"italian\"],\"vedetta\":[\"italian\"],\"vedova\":[\"italian\"],\"veduto\":[\"italian\"],\"vegetale\":[\"italian\"],\"veicolo\":[\"italian\"],\"velcro\":[\"italian\"],\"velina\":[\"italian\"],\"velluto\":[\"italian\"],\"veloce\":[\"italian\"],\"venato\":[\"italian\"],\"vendemmia\":[\"italian\"],\"vento\":[\"italian\"],\"verace\":[\"italian\"],\"verbale\":[\"italian\"],\"vergogna\":[\"italian\"],\"verifica\":[\"italian\"],\"vero\":[\"italian\"],\"verruca\":[\"italian\"],\"verticale\":[\"italian\"],\"vescica\":[\"italian\"],\"vessillo\":[\"italian\"],\"vestale\":[\"italian\"],\"veterano\":[\"italian\"],\"vetrina\":[\"italian\"],\"vetusto\":[\"italian\"],\"viandante\":[\"italian\"],\"vibrante\":[\"italian\"],\"vicenda\":[\"italian\"],\"vichingo\":[\"italian\"],\"vicinanza\":[\"italian\"],\"vidimare\":[\"italian\"],\"vigilia\":[\"italian\"],\"vigneto\":[\"italian\"],\"vigore\":[\"italian\"],\"vile\":[\"italian\"],\"villano\":[\"italian\"],\"vimini\":[\"italian\"],\"vincitore\":[\"italian\"],\"viola\":[\"italian\"],\"vipera\":[\"italian\"],\"virgola\":[\"italian\"],\"virologo\":[\"italian\"],\"virulento\":[\"italian\"],\"viscoso\":[\"italian\"],\"visione\":[\"italian\"],\"vispo\":[\"italian\"],\"vissuto\":[\"italian\"],\"visura\":[\"italian\"],\"vita\":[\"italian\"],\"vitello\":[\"italian\"],\"vittima\":[\"italian\"],\"vivanda\":[\"italian\"],\"vivido\":[\"italian\"],\"viziare\":[\"italian\"],\"voce\":[\"italian\"],\"voga\":[\"italian\"],\"volatile\":[\"italian\"],\"volere\":[\"italian\"],\"volpe\":[\"italian\"],\"voragine\":[\"italian\"],\"vulcano\":[\"italian\"],\"zampogna\":[\"italian\"],\"zanna\":[\"italian\"],\"zappato\":[\"italian\"],\"zattera\":[\"italian\"],\"zavorra\":[\"italian\"],\"zefiro\":[\"italian\"],\"zelante\":[\"italian\"],\"zelo\":[\"italian\"],\"zenzero\":[\"italian\"],\"zerbino\":[\"italian\"],\"zibetto\":[\"italian\"],\"zinco\":[\"italian\"],\"zircone\":[\"italian\"],\"zitto\":[\"italian\"],\"zolla\":[\"italian\"],\"zotico\":[\"italian\"],\"zucchero\":[\"italian\"],\"zufolo\":[\"italian\"],\"zulu\":[\"italian\"],\"zuppa\":[\"italian\"],\"あいこくしん\":[\"japanese\"],\"あいさつ\":[\"japanese\"],\"あいだ\":[\"japanese\"],\"あおぞら\":[\"japanese\"],\"あかちゃん\":[\"japanese\"],\"あきる\":[\"japanese\"],\"あけがた\":[\"japanese\"],\"あける\":[\"japanese\"],\"あこがれる\":[\"japanese\"],\"あさい\":[\"japanese\"],\"あさひ\":[\"japanese\"],\"あしあと\":[\"japanese\"],\"あじわう\":[\"japanese\"],\"あずかる\":[\"japanese\"],\"あずき\":[\"japanese\"],\"あそぶ\":[\"japanese\"],\"あたえる\":[\"japanese\"],\"あたためる\":[\"japanese\"],\"あたりまえ\":[\"japanese\"],\"あたる\":[\"japanese\"],\"あつい\":[\"japanese\"],\"あつかう\":[\"japanese\"],\"あっしゅく\":[\"japanese\"],\"あつまり\":[\"japanese\"],\"あつめる\":[\"japanese\"],\"あてな\":[\"japanese\"],\"あてはまる\":[\"japanese\"],\"あひる\":[\"japanese\"],\"あぶら\":[\"japanese\"],\"あぶる\":[\"japanese\"],\"あふれる\":[\"japanese\"],\"あまい\":[\"japanese\"],\"あまど\":[\"japanese\"],\"あまやかす\":[\"japanese\"],\"あまり\":[\"japanese\"],\"あみもの\":[\"japanese\"],\"あめりか\":[\"japanese\"],\"あやまる\":[\"japanese\"],\"あゆむ\":[\"japanese\"],\"あらいぐま\":[\"japanese\"],\"あらし\":[\"japanese\"],\"あらすじ\":[\"japanese\"],\"あらためる\":[\"japanese\"],\"あらゆる\":[\"japanese\"],\"あらわす\":[\"japanese\"],\"ありがとう\":[\"japanese\"],\"あわせる\":[\"japanese\"],\"あわてる\":[\"japanese\"],\"あんい\":[\"japanese\"],\"あんがい\":[\"japanese\"],\"あんこ\":[\"japanese\"],\"あんぜん\":[\"japanese\"],\"あんてい\":[\"japanese\"],\"あんない\":[\"japanese\"],\"あんまり\":[\"japanese\"],\"いいだす\":[\"japanese\"],\"いおん\":[\"japanese\"],\"いがい\":[\"japanese\"],\"いがく\":[\"japanese\"],\"いきおい\":[\"japanese\"],\"いきなり\":[\"japanese\"],\"いきもの\":[\"japanese\"],\"いきる\":[\"japanese\"],\"いくじ\":[\"japanese\"],\"いくぶん\":[\"japanese\"],\"いけばな\":[\"japanese\"],\"いけん\":[\"japanese\"],\"いこう\":[\"japanese\"],\"いこく\":[\"japanese\"],\"いこつ\":[\"japanese\"],\"いさましい\":[\"japanese\"],\"いさん\":[\"japanese\"],\"いしき\":[\"japanese\"],\"いじゅう\":[\"japanese\"],\"いじょう\":[\"japanese\"],\"いじわる\":[\"japanese\"],\"いずみ\":[\"japanese\"],\"いずれ\":[\"japanese\"],\"いせい\":[\"japanese\"],\"いせえび\":[\"japanese\"],\"いせかい\":[\"japanese\"],\"いせき\":[\"japanese\"],\"いぜん\":[\"japanese\"],\"いそうろう\":[\"japanese\"],\"いそがしい\":[\"japanese\"],\"いだい\":[\"japanese\"],\"いだく\":[\"japanese\"],\"いたずら\":[\"japanese\"],\"いたみ\":[\"japanese\"],\"いたりあ\":[\"japanese\"],\"いちおう\":[\"japanese\"],\"いちじ\":[\"japanese\"],\"いちど\":[\"japanese\"],\"いちば\":[\"japanese\"],\"いちぶ\":[\"japanese\"],\"いちりゅう\":[\"japanese\"],\"いつか\":[\"japanese\"],\"いっしゅん\":[\"japanese\"],\"いっせい\":[\"japanese\"],\"いっそう\":[\"japanese\"],\"いったん\":[\"japanese\"],\"いっち\":[\"japanese\"],\"いってい\":[\"japanese\"],\"いっぽう\":[\"japanese\"],\"いてざ\":[\"japanese\"],\"いてん\":[\"japanese\"],\"いどう\":[\"japanese\"],\"いとこ\":[\"japanese\"],\"いない\":[\"japanese\"],\"いなか\":[\"japanese\"],\"いねむり\":[\"japanese\"],\"いのち\":[\"japanese\"],\"いのる\":[\"japanese\"],\"いはつ\":[\"japanese\"],\"いばる\":[\"japanese\"],\"いはん\":[\"japanese\"],\"いびき\":[\"japanese\"],\"いひん\":[\"japanese\"],\"いふく\":[\"japanese\"],\"いへん\":[\"japanese\"],\"いほう\":[\"japanese\"],\"いみん\":[\"japanese\"],\"いもうと\":[\"japanese\"],\"いもたれ\":[\"japanese\"],\"いもり\":[\"japanese\"],\"いやがる\":[\"japanese\"],\"いやす\":[\"japanese\"],\"いよかん\":[\"japanese\"],\"いよく\":[\"japanese\"],\"いらい\":[\"japanese\"],\"いらすと\":[\"japanese\"],\"いりぐち\":[\"japanese\"],\"いりょう\":[\"japanese\"],\"いれい\":[\"japanese\"],\"いれもの\":[\"japanese\"],\"いれる\":[\"japanese\"],\"いろえんぴつ\":[\"japanese\"],\"いわい\":[\"japanese\"],\"いわう\":[\"japanese\"],\"いわかん\":[\"japanese\"],\"いわば\":[\"japanese\"],\"いわゆる\":[\"japanese\"],\"いんげんまめ\":[\"japanese\"],\"いんさつ\":[\"japanese\"],\"いんしょう\":[\"japanese\"],\"いんよう\":[\"japanese\"],\"うえき\":[\"japanese\"],\"うえる\":[\"japanese\"],\"うおざ\":[\"japanese\"],\"うがい\":[\"japanese\"],\"うかぶ\":[\"japanese\"],\"うかべる\":[\"japanese\"],\"うきわ\":[\"japanese\"],\"うくらいな\":[\"japanese\"],\"うくれれ\":[\"japanese\"],\"うけたまわる\":[\"japanese\"],\"うけつけ\":[\"japanese\"],\"うけとる\":[\"japanese\"],\"うけもつ\":[\"japanese\"],\"うける\":[\"japanese\"],\"うごかす\":[\"japanese\"],\"うごく\":[\"japanese\"],\"うこん\":[\"japanese\"],\"うさぎ\":[\"japanese\"],\"うしなう\":[\"japanese\"],\"うしろがみ\":[\"japanese\"],\"うすい\":[\"japanese\"],\"うすぎ\":[\"japanese\"],\"うすぐらい\":[\"japanese\"],\"うすめる\":[\"japanese\"],\"うせつ\":[\"japanese\"],\"うちあわせ\":[\"japanese\"],\"うちがわ\":[\"japanese\"],\"うちき\":[\"japanese\"],\"うちゅう\":[\"japanese\"],\"うっかり\":[\"japanese\"],\"うつくしい\":[\"japanese\"],\"うったえる\":[\"japanese\"],\"うつる\":[\"japanese\"],\"うどん\":[\"japanese\"],\"うなぎ\":[\"japanese\"],\"うなじ\":[\"japanese\"],\"うなずく\":[\"japanese\"],\"うなる\":[\"japanese\"],\"うねる\":[\"japanese\"],\"うのう\":[\"japanese\"],\"うぶげ\":[\"japanese\"],\"うぶごえ\":[\"japanese\"],\"うまれる\":[\"japanese\"],\"うめる\":[\"japanese\"],\"うもう\":[\"japanese\"],\"うやまう\":[\"japanese\"],\"うよく\":[\"japanese\"],\"うらがえす\":[\"japanese\"],\"うらぐち\":[\"japanese\"],\"うらない\":[\"japanese\"],\"うりあげ\":[\"japanese\"],\"うりきれ\":[\"japanese\"],\"うるさい\":[\"japanese\"],\"うれしい\":[\"japanese\"],\"うれゆき\":[\"japanese\"],\"うれる\":[\"japanese\"],\"うろこ\":[\"japanese\"],\"うわき\":[\"japanese\"],\"うわさ\":[\"japanese\"],\"うんこう\":[\"japanese\"],\"うんちん\":[\"japanese\"],\"うんてん\":[\"japanese\"],\"うんどう\":[\"japanese\"],\"えいえん\":[\"japanese\"],\"えいが\":[\"japanese\"],\"えいきょう\":[\"japanese\"],\"えいご\":[\"japanese\"],\"えいせい\":[\"japanese\"],\"えいぶん\":[\"japanese\"],\"えいよう\":[\"japanese\"],\"えいわ\":[\"japanese\"],\"えおり\":[\"japanese\"],\"えがお\":[\"japanese\"],\"えがく\":[\"japanese\"],\"えきたい\":[\"japanese\"],\"えくせる\":[\"japanese\"],\"えしゃく\":[\"japanese\"],\"えすて\":[\"japanese\"],\"えつらん\":[\"japanese\"],\"えのぐ\":[\"japanese\"],\"えほうまき\":[\"japanese\"],\"えほん\":[\"japanese\"],\"えまき\":[\"japanese\"],\"えもじ\":[\"japanese\"],\"えもの\":[\"japanese\"],\"えらい\":[\"japanese\"],\"えらぶ\":[\"japanese\"],\"えりあ\":[\"japanese\"],\"えんえん\":[\"japanese\"],\"えんかい\":[\"japanese\"],\"えんぎ\":[\"japanese\"],\"えんげき\":[\"japanese\"],\"えんしゅう\":[\"japanese\"],\"えんぜつ\":[\"japanese\"],\"えんそく\":[\"japanese\"],\"えんちょう\":[\"japanese\"],\"えんとつ\":[\"japanese\"],\"おいかける\":[\"japanese\"],\"おいこす\":[\"japanese\"],\"おいしい\":[\"japanese\"],\"おいつく\":[\"japanese\"],\"おうえん\":[\"japanese\"],\"おうさま\":[\"japanese\"],\"おうじ\":[\"japanese\"],\"おうせつ\":[\"japanese\"],\"おうたい\":[\"japanese\"],\"おうふく\":[\"japanese\"],\"おうべい\":[\"japanese\"],\"おうよう\":[\"japanese\"],\"おえる\":[\"japanese\"],\"おおい\":[\"japanese\"],\"おおう\":[\"japanese\"],\"おおどおり\":[\"japanese\"],\"おおや\":[\"japanese\"],\"おおよそ\":[\"japanese\"],\"おかえり\":[\"japanese\"],\"おかず\":[\"japanese\"],\"おがむ\":[\"japanese\"],\"おかわり\":[\"japanese\"],\"おぎなう\":[\"japanese\"],\"おきる\":[\"japanese\"],\"おくさま\":[\"japanese\"],\"おくじょう\":[\"japanese\"],\"おくりがな\":[\"japanese\"],\"おくる\":[\"japanese\"],\"おくれる\":[\"japanese\"],\"おこす\":[\"japanese\"],\"おこなう\":[\"japanese\"],\"おこる\":[\"japanese\"],\"おさえる\":[\"japanese\"],\"おさない\":[\"japanese\"],\"おさめる\":[\"japanese\"],\"おしいれ\":[\"japanese\"],\"おしえる\":[\"japanese\"],\"おじぎ\":[\"japanese\"],\"おじさん\":[\"japanese\"],\"おしゃれ\":[\"japanese\"],\"おそらく\":[\"japanese\"],\"おそわる\":[\"japanese\"],\"おたがい\":[\"japanese\"],\"おたく\":[\"japanese\"],\"おだやか\":[\"japanese\"],\"おちつく\":[\"japanese\"],\"おっと\":[\"japanese\"],\"おつり\":[\"japanese\"],\"おでかけ\":[\"japanese\"],\"おとしもの\":[\"japanese\"],\"おとなしい\":[\"japanese\"],\"おどり\":[\"japanese\"],\"おどろかす\":[\"japanese\"],\"おばさん\":[\"japanese\"],\"おまいり\":[\"japanese\"],\"おめでとう\":[\"japanese\"],\"おもいで\":[\"japanese\"],\"おもう\":[\"japanese\"],\"おもたい\":[\"japanese\"],\"おもちゃ\":[\"japanese\"],\"おやつ\":[\"japanese\"],\"おやゆび\":[\"japanese\"],\"およぼす\":[\"japanese\"],\"おらんだ\":[\"japanese\"],\"おろす\":[\"japanese\"],\"おんがく\":[\"japanese\"],\"おんけい\":[\"japanese\"],\"おんしゃ\":[\"japanese\"],\"おんせん\":[\"japanese\"],\"おんだん\":[\"japanese\"],\"おんちゅう\":[\"japanese\"],\"おんどけい\":[\"japanese\"],\"かあつ\":[\"japanese\"],\"かいが\":[\"japanese\"],\"がいき\":[\"japanese\"],\"がいけん\":[\"japanese\"],\"がいこう\":[\"japanese\"],\"かいさつ\":[\"japanese\"],\"かいしゃ\":[\"japanese\"],\"かいすいよく\":[\"japanese\"],\"かいぜん\":[\"japanese\"],\"かいぞうど\":[\"japanese\"],\"かいつう\":[\"japanese\"],\"かいてん\":[\"japanese\"],\"かいとう\":[\"japanese\"],\"かいふく\":[\"japanese\"],\"がいへき\":[\"japanese\"],\"かいほう\":[\"japanese\"],\"かいよう\":[\"japanese\"],\"がいらい\":[\"japanese\"],\"かいわ\":[\"japanese\"],\"かえる\":[\"japanese\"],\"かおり\":[\"japanese\"],\"かかえる\":[\"japanese\"],\"かがく\":[\"japanese\"],\"かがし\":[\"japanese\"],\"かがみ\":[\"japanese\"],\"かくご\":[\"japanese\"],\"かくとく\":[\"japanese\"],\"かざる\":[\"japanese\"],\"がぞう\":[\"japanese\"],\"かたい\":[\"japanese\"],\"かたち\":[\"japanese\"],\"がちょう\":[\"japanese\"],\"がっきゅう\":[\"japanese\"],\"がっこう\":[\"japanese\"],\"がっさん\":[\"japanese\"],\"がっしょう\":[\"japanese\"],\"かなざわし\":[\"japanese\"],\"かのう\":[\"japanese\"],\"がはく\":[\"japanese\"],\"かぶか\":[\"japanese\"],\"かほう\":[\"japanese\"],\"かほご\":[\"japanese\"],\"かまう\":[\"japanese\"],\"かまぼこ\":[\"japanese\"],\"かめれおん\":[\"japanese\"],\"かゆい\":[\"japanese\"],\"かようび\":[\"japanese\"],\"からい\":[\"japanese\"],\"かるい\":[\"japanese\"],\"かろう\":[\"japanese\"],\"かわく\":[\"japanese\"],\"かわら\":[\"japanese\"],\"がんか\":[\"japanese\"],\"かんけい\":[\"japanese\"],\"かんこう\":[\"japanese\"],\"かんしゃ\":[\"japanese\"],\"かんそう\":[\"japanese\"],\"かんたん\":[\"japanese\"],\"かんち\":[\"japanese\"],\"がんばる\":[\"japanese\"],\"きあい\":[\"japanese\"],\"きあつ\":[\"japanese\"],\"きいろ\":[\"japanese\"],\"ぎいん\":[\"japanese\"],\"きうい\":[\"japanese\"],\"きうん\":[\"japanese\"],\"きえる\":[\"japanese\"],\"きおう\":[\"japanese\"],\"きおく\":[\"japanese\"],\"きおち\":[\"japanese\"],\"きおん\":[\"japanese\"],\"きかい\":[\"japanese\"],\"きかく\":[\"japanese\"],\"きかんしゃ\":[\"japanese\"],\"ききて\":[\"japanese\"],\"きくばり\":[\"japanese\"],\"きくらげ\":[\"japanese\"],\"きけんせい\":[\"japanese\"],\"きこう\":[\"japanese\"],\"きこえる\":[\"japanese\"],\"きこく\":[\"japanese\"],\"きさい\":[\"japanese\"],\"きさく\":[\"japanese\"],\"きさま\":[\"japanese\"],\"きさらぎ\":[\"japanese\"],\"ぎじかがく\":[\"japanese\"],\"ぎしき\":[\"japanese\"],\"ぎじたいけん\":[\"japanese\"],\"ぎじにってい\":[\"japanese\"],\"ぎじゅつしゃ\":[\"japanese\"],\"きすう\":[\"japanese\"],\"きせい\":[\"japanese\"],\"きせき\":[\"japanese\"],\"きせつ\":[\"japanese\"],\"きそう\":[\"japanese\"],\"きぞく\":[\"japanese\"],\"きぞん\":[\"japanese\"],\"きたえる\":[\"japanese\"],\"きちょう\":[\"japanese\"],\"きつえん\":[\"japanese\"],\"ぎっちり\":[\"japanese\"],\"きつつき\":[\"japanese\"],\"きつね\":[\"japanese\"],\"きてい\":[\"japanese\"],\"きどう\":[\"japanese\"],\"きどく\":[\"japanese\"],\"きない\":[\"japanese\"],\"きなが\":[\"japanese\"],\"きなこ\":[\"japanese\"],\"きぬごし\":[\"japanese\"],\"きねん\":[\"japanese\"],\"きのう\":[\"japanese\"],\"きのした\":[\"japanese\"],\"きはく\":[\"japanese\"],\"きびしい\":[\"japanese\"],\"きひん\":[\"japanese\"],\"きふく\":[\"japanese\"],\"きぶん\":[\"japanese\"],\"きぼう\":[\"japanese\"],\"きほん\":[\"japanese\"],\"きまる\":[\"japanese\"],\"きみつ\":[\"japanese\"],\"きむずかしい\":[\"japanese\"],\"きめる\":[\"japanese\"],\"きもだめし\":[\"japanese\"],\"きもち\":[\"japanese\"],\"きもの\":[\"japanese\"],\"きゃく\":[\"japanese\"],\"きやく\":[\"japanese\"],\"ぎゅうにく\":[\"japanese\"],\"きよう\":[\"japanese\"],\"きょうりゅう\":[\"japanese\"],\"きらい\":[\"japanese\"],\"きらく\":[\"japanese\"],\"きりん\":[\"japanese\"],\"きれい\":[\"japanese\"],\"きれつ\":[\"japanese\"],\"きろく\":[\"japanese\"],\"ぎろん\":[\"japanese\"],\"きわめる\":[\"japanese\"],\"ぎんいろ\":[\"japanese\"],\"きんかくじ\":[\"japanese\"],\"きんじょ\":[\"japanese\"],\"きんようび\":[\"japanese\"],\"ぐあい\":[\"japanese\"],\"くいず\":[\"japanese\"],\"くうかん\":[\"japanese\"],\"くうき\":[\"japanese\"],\"くうぐん\":[\"japanese\"],\"くうこう\":[\"japanese\"],\"ぐうせい\":[\"japanese\"],\"くうそう\":[\"japanese\"],\"ぐうたら\":[\"japanese\"],\"くうふく\":[\"japanese\"],\"くうぼ\":[\"japanese\"],\"くかん\":[\"japanese\"],\"くきょう\":[\"japanese\"],\"くげん\":[\"japanese\"],\"ぐこう\":[\"japanese\"],\"くさい\":[\"japanese\"],\"くさき\":[\"japanese\"],\"くさばな\":[\"japanese\"],\"くさる\":[\"japanese\"],\"くしゃみ\":[\"japanese\"],\"くしょう\":[\"japanese\"],\"くすのき\":[\"japanese\"],\"くすりゆび\":[\"japanese\"],\"くせげ\":[\"japanese\"],\"くせん\":[\"japanese\"],\"ぐたいてき\":[\"japanese\"],\"くださる\":[\"japanese\"],\"くたびれる\":[\"japanese\"],\"くちこみ\":[\"japanese\"],\"くちさき\":[\"japanese\"],\"くつした\":[\"japanese\"],\"ぐっすり\":[\"japanese\"],\"くつろぐ\":[\"japanese\"],\"くとうてん\":[\"japanese\"],\"くどく\":[\"japanese\"],\"くなん\":[\"japanese\"],\"くねくね\":[\"japanese\"],\"くのう\":[\"japanese\"],\"くふう\":[\"japanese\"],\"くみあわせ\":[\"japanese\"],\"くみたてる\":[\"japanese\"],\"くめる\":[\"japanese\"],\"くやくしょ\":[\"japanese\"],\"くらす\":[\"japanese\"],\"くらべる\":[\"japanese\"],\"くるま\":[\"japanese\"],\"くれる\":[\"japanese\"],\"くろう\":[\"japanese\"],\"くわしい\":[\"japanese\"],\"ぐんかん\":[\"japanese\"],\"ぐんしょく\":[\"japanese\"],\"ぐんたい\":[\"japanese\"],\"ぐんて\":[\"japanese\"],\"けあな\":[\"japanese\"],\"けいかく\":[\"japanese\"],\"けいけん\":[\"japanese\"],\"けいこ\":[\"japanese\"],\"けいさつ\":[\"japanese\"],\"げいじゅつ\":[\"japanese\"],\"けいたい\":[\"japanese\"],\"げいのうじん\":[\"japanese\"],\"けいれき\":[\"japanese\"],\"けいろ\":[\"japanese\"],\"けおとす\":[\"japanese\"],\"けおりもの\":[\"japanese\"],\"げきか\":[\"japanese\"],\"げきげん\":[\"japanese\"],\"げきだん\":[\"japanese\"],\"げきちん\":[\"japanese\"],\"げきとつ\":[\"japanese\"],\"げきは\":[\"japanese\"],\"げきやく\":[\"japanese\"],\"げこう\":[\"japanese\"],\"げこくじょう\":[\"japanese\"],\"げざい\":[\"japanese\"],\"けさき\":[\"japanese\"],\"げざん\":[\"japanese\"],\"けしき\":[\"japanese\"],\"けしごむ\":[\"japanese\"],\"けしょう\":[\"japanese\"],\"げすと\":[\"japanese\"],\"けたば\":[\"japanese\"],\"けちゃっぷ\":[\"japanese\"],\"けちらす\":[\"japanese\"],\"けつあつ\":[\"japanese\"],\"けつい\":[\"japanese\"],\"けつえき\":[\"japanese\"],\"けっこん\":[\"japanese\"],\"けつじょ\":[\"japanese\"],\"けっせき\":[\"japanese\"],\"けってい\":[\"japanese\"],\"けつまつ\":[\"japanese\"],\"げつようび\":[\"japanese\"],\"げつれい\":[\"japanese\"],\"けつろん\":[\"japanese\"],\"げどく\":[\"japanese\"],\"けとばす\":[\"japanese\"],\"けとる\":[\"japanese\"],\"けなげ\":[\"japanese\"],\"けなす\":[\"japanese\"],\"けなみ\":[\"japanese\"],\"けぬき\":[\"japanese\"],\"げねつ\":[\"japanese\"],\"けねん\":[\"japanese\"],\"けはい\":[\"japanese\"],\"げひん\":[\"japanese\"],\"けぶかい\":[\"japanese\"],\"げぼく\":[\"japanese\"],\"けまり\":[\"japanese\"],\"けみかる\":[\"japanese\"],\"けむし\":[\"japanese\"],\"けむり\":[\"japanese\"],\"けもの\":[\"japanese\"],\"けらい\":[\"japanese\"],\"けろけろ\":[\"japanese\"],\"けわしい\":[\"japanese\"],\"けんい\":[\"japanese\"],\"けんえつ\":[\"japanese\"],\"けんお\":[\"japanese\"],\"けんか\":[\"japanese\"],\"げんき\":[\"japanese\"],\"けんげん\":[\"japanese\"],\"けんこう\":[\"japanese\"],\"けんさく\":[\"japanese\"],\"けんしゅう\":[\"japanese\"],\"けんすう\":[\"japanese\"],\"げんそう\":[\"japanese\"],\"けんちく\":[\"japanese\"],\"けんてい\":[\"japanese\"],\"けんとう\":[\"japanese\"],\"けんない\":[\"japanese\"],\"けんにん\":[\"japanese\"],\"げんぶつ\":[\"japanese\"],\"けんま\":[\"japanese\"],\"けんみん\":[\"japanese\"],\"けんめい\":[\"japanese\"],\"けんらん\":[\"japanese\"],\"けんり\":[\"japanese\"],\"こあくま\":[\"japanese\"],\"こいぬ\":[\"japanese\"],\"こいびと\":[\"japanese\"],\"ごうい\":[\"japanese\"],\"こうえん\":[\"japanese\"],\"こうおん\":[\"japanese\"],\"こうかん\":[\"japanese\"],\"ごうきゅう\":[\"japanese\"],\"ごうけい\":[\"japanese\"],\"こうこう\":[\"japanese\"],\"こうさい\":[\"japanese\"],\"こうじ\":[\"japanese\"],\"こうすい\":[\"japanese\"],\"ごうせい\":[\"japanese\"],\"こうそく\":[\"japanese\"],\"こうたい\":[\"japanese\"],\"こうちゃ\":[\"japanese\"],\"こうつう\":[\"japanese\"],\"こうてい\":[\"japanese\"],\"こうどう\":[\"japanese\"],\"こうない\":[\"japanese\"],\"こうはい\":[\"japanese\"],\"ごうほう\":[\"japanese\"],\"ごうまん\":[\"japanese\"],\"こうもく\":[\"japanese\"],\"こうりつ\":[\"japanese\"],\"こえる\":[\"japanese\"],\"こおり\":[\"japanese\"],\"ごかい\":[\"japanese\"],\"ごがつ\":[\"japanese\"],\"ごかん\":[\"japanese\"],\"こくご\":[\"japanese\"],\"こくさい\":[\"japanese\"],\"こくとう\":[\"japanese\"],\"こくない\":[\"japanese\"],\"こくはく\":[\"japanese\"],\"こぐま\":[\"japanese\"],\"こけい\":[\"japanese\"],\"こける\":[\"japanese\"],\"ここのか\":[\"japanese\"],\"こころ\":[\"japanese\"],\"こさめ\":[\"japanese\"],\"こしつ\":[\"japanese\"],\"こすう\":[\"japanese\"],\"こせい\":[\"japanese\"],\"こせき\":[\"japanese\"],\"こぜん\":[\"japanese\"],\"こそだて\":[\"japanese\"],\"こたい\":[\"japanese\"],\"こたえる\":[\"japanese\"],\"こたつ\":[\"japanese\"],\"こちょう\":[\"japanese\"],\"こっか\":[\"japanese\"],\"こつこつ\":[\"japanese\"],\"こつばん\":[\"japanese\"],\"こつぶ\":[\"japanese\"],\"こてい\":[\"japanese\"],\"こてん\":[\"japanese\"],\"ことがら\":[\"japanese\"],\"ことし\":[\"japanese\"],\"ことば\":[\"japanese\"],\"ことり\":[\"japanese\"],\"こなごな\":[\"japanese\"],\"こねこね\":[\"japanese\"],\"このまま\":[\"japanese\"],\"このみ\":[\"japanese\"],\"このよ\":[\"japanese\"],\"ごはん\":[\"japanese\"],\"こひつじ\":[\"japanese\"],\"こふう\":[\"japanese\"],\"こふん\":[\"japanese\"],\"こぼれる\":[\"japanese\"],\"ごまあぶら\":[\"japanese\"],\"こまかい\":[\"japanese\"],\"ごますり\":[\"japanese\"],\"こまつな\":[\"japanese\"],\"こまる\":[\"japanese\"],\"こむぎこ\":[\"japanese\"],\"こもじ\":[\"japanese\"],\"こもち\":[\"japanese\"],\"こもの\":[\"japanese\"],\"こもん\":[\"japanese\"],\"こやく\":[\"japanese\"],\"こやま\":[\"japanese\"],\"こゆう\":[\"japanese\"],\"こゆび\":[\"japanese\"],\"こよい\":[\"japanese\"],\"こよう\":[\"japanese\"],\"こりる\":[\"japanese\"],\"これくしょん\":[\"japanese\"],\"ころっけ\":[\"japanese\"],\"こわもて\":[\"japanese\"],\"こわれる\":[\"japanese\"],\"こんいん\":[\"japanese\"],\"こんかい\":[\"japanese\"],\"こんき\":[\"japanese\"],\"こんしゅう\":[\"japanese\"],\"こんすい\":[\"japanese\"],\"こんだて\":[\"japanese\"],\"こんとん\":[\"japanese\"],\"こんなん\":[\"japanese\"],\"こんびに\":[\"japanese\"],\"こんぽん\":[\"japanese\"],\"こんまけ\":[\"japanese\"],\"こんや\":[\"japanese\"],\"こんれい\":[\"japanese\"],\"こんわく\":[\"japanese\"],\"ざいえき\":[\"japanese\"],\"さいかい\":[\"japanese\"],\"さいきん\":[\"japanese\"],\"ざいげん\":[\"japanese\"],\"ざいこ\":[\"japanese\"],\"さいしょ\":[\"japanese\"],\"さいせい\":[\"japanese\"],\"ざいたく\":[\"japanese\"],\"ざいちゅう\":[\"japanese\"],\"さいてき\":[\"japanese\"],\"ざいりょう\":[\"japanese\"],\"さうな\":[\"japanese\"],\"さかいし\":[\"japanese\"],\"さがす\":[\"japanese\"],\"さかな\":[\"japanese\"],\"さかみち\":[\"japanese\"],\"さがる\":[\"japanese\"],\"さぎょう\":[\"japanese\"],\"さくし\":[\"japanese\"],\"さくひん\":[\"japanese\"],\"さくら\":[\"japanese\"],\"さこく\":[\"japanese\"],\"さこつ\":[\"japanese\"],\"さずかる\":[\"japanese\"],\"ざせき\":[\"japanese\"],\"さたん\":[\"japanese\"],\"さつえい\":[\"japanese\"],\"ざつおん\":[\"japanese\"],\"ざっか\":[\"japanese\"],\"ざつがく\":[\"japanese\"],\"さっきょく\":[\"japanese\"],\"ざっし\":[\"japanese\"],\"さつじん\":[\"japanese\"],\"ざっそう\":[\"japanese\"],\"さつたば\":[\"japanese\"],\"さつまいも\":[\"japanese\"],\"さてい\":[\"japanese\"],\"さといも\":[\"japanese\"],\"さとう\":[\"japanese\"],\"さとおや\":[\"japanese\"],\"さとし\":[\"japanese\"],\"さとる\":[\"japanese\"],\"さのう\":[\"japanese\"],\"さばく\":[\"japanese\"],\"さびしい\":[\"japanese\"],\"さべつ\":[\"japanese\"],\"さほう\":[\"japanese\"],\"さほど\":[\"japanese\"],\"さます\":[\"japanese\"],\"さみしい\":[\"japanese\"],\"さみだれ\":[\"japanese\"],\"さむけ\":[\"japanese\"],\"さめる\":[\"japanese\"],\"さやえんどう\":[\"japanese\"],\"さゆう\":[\"japanese\"],\"さよう\":[\"japanese\"],\"さよく\":[\"japanese\"],\"さらだ\":[\"japanese\"],\"ざるそば\":[\"japanese\"],\"さわやか\":[\"japanese\"],\"さわる\":[\"japanese\"],\"さんいん\":[\"japanese\"],\"さんか\":[\"japanese\"],\"さんきゃく\":[\"japanese\"],\"さんこう\":[\"japanese\"],\"さんさい\":[\"japanese\"],\"ざんしょ\":[\"japanese\"],\"さんすう\":[\"japanese\"],\"さんせい\":[\"japanese\"],\"さんそ\":[\"japanese\"],\"さんち\":[\"japanese\"],\"さんま\":[\"japanese\"],\"さんみ\":[\"japanese\"],\"さんらん\":[\"japanese\"],\"しあい\":[\"japanese\"],\"しあげ\":[\"japanese\"],\"しあさって\":[\"japanese\"],\"しあわせ\":[\"japanese\"],\"しいく\":[\"japanese\"],\"しいん\":[\"japanese\"],\"しうち\":[\"japanese\"],\"しえい\":[\"japanese\"],\"しおけ\":[\"japanese\"],\"しかい\":[\"japanese\"],\"しかく\":[\"japanese\"],\"じかん\":[\"japanese\"],\"しごと\":[\"japanese\"],\"しすう\":[\"japanese\"],\"じだい\":[\"japanese\"],\"したうけ\":[\"japanese\"],\"したぎ\":[\"japanese\"],\"したて\":[\"japanese\"],\"したみ\":[\"japanese\"],\"しちょう\":[\"japanese\"],\"しちりん\":[\"japanese\"],\"しっかり\":[\"japanese\"],\"しつじ\":[\"japanese\"],\"しつもん\":[\"japanese\"],\"してい\":[\"japanese\"],\"してき\":[\"japanese\"],\"してつ\":[\"japanese\"],\"じてん\":[\"japanese\"],\"じどう\":[\"japanese\"],\"しなぎれ\":[\"japanese\"],\"しなもの\":[\"japanese\"],\"しなん\":[\"japanese\"],\"しねま\":[\"japanese\"],\"しねん\":[\"japanese\"],\"しのぐ\":[\"japanese\"],\"しのぶ\":[\"japanese\"],\"しはい\":[\"japanese\"],\"しばかり\":[\"japanese\"],\"しはつ\":[\"japanese\"],\"しはらい\":[\"japanese\"],\"しはん\":[\"japanese\"],\"しひょう\":[\"japanese\"],\"しふく\":[\"japanese\"],\"じぶん\":[\"japanese\"],\"しへい\":[\"japanese\"],\"しほう\":[\"japanese\"],\"しほん\":[\"japanese\"],\"しまう\":[\"japanese\"],\"しまる\":[\"japanese\"],\"しみん\":[\"japanese\"],\"しむける\":[\"japanese\"],\"じむしょ\":[\"japanese\"],\"しめい\":[\"japanese\"],\"しめる\":[\"japanese\"],\"しもん\":[\"japanese\"],\"しゃいん\":[\"japanese\"],\"しゃうん\":[\"japanese\"],\"しゃおん\":[\"japanese\"],\"じゃがいも\":[\"japanese\"],\"しやくしょ\":[\"japanese\"],\"しゃくほう\":[\"japanese\"],\"しゃけん\":[\"japanese\"],\"しゃこ\":[\"japanese\"],\"しゃざい\":[\"japanese\"],\"しゃしん\":[\"japanese\"],\"しゃせん\":[\"japanese\"],\"しゃそう\":[\"japanese\"],\"しゃたい\":[\"japanese\"],\"しゃちょう\":[\"japanese\"],\"しゃっきん\":[\"japanese\"],\"じゃま\":[\"japanese\"],\"しゃりん\":[\"japanese\"],\"しゃれい\":[\"japanese\"],\"じゆう\":[\"japanese\"],\"じゅうしょ\":[\"japanese\"],\"しゅくはく\":[\"japanese\"],\"じゅしん\":[\"japanese\"],\"しゅっせき\":[\"japanese\"],\"しゅみ\":[\"japanese\"],\"しゅらば\":[\"japanese\"],\"じゅんばん\":[\"japanese\"],\"しょうかい\":[\"japanese\"],\"しょくたく\":[\"japanese\"],\"しょっけん\":[\"japanese\"],\"しょどう\":[\"japanese\"],\"しょもつ\":[\"japanese\"],\"しらせる\":[\"japanese\"],\"しらべる\":[\"japanese\"],\"しんか\":[\"japanese\"],\"しんこう\":[\"japanese\"],\"じんじゃ\":[\"japanese\"],\"しんせいじ\":[\"japanese\"],\"しんちく\":[\"japanese\"],\"しんりん\":[\"japanese\"],\"すあげ\":[\"japanese\"],\"すあし\":[\"japanese\"],\"すあな\":[\"japanese\"],\"ずあん\":[\"japanese\"],\"すいえい\":[\"japanese\"],\"すいか\":[\"japanese\"],\"すいとう\":[\"japanese\"],\"ずいぶん\":[\"japanese\"],\"すいようび\":[\"japanese\"],\"すうがく\":[\"japanese\"],\"すうじつ\":[\"japanese\"],\"すうせん\":[\"japanese\"],\"すおどり\":[\"japanese\"],\"すきま\":[\"japanese\"],\"すくう\":[\"japanese\"],\"すくない\":[\"japanese\"],\"すける\":[\"japanese\"],\"すごい\":[\"japanese\"],\"すこし\":[\"japanese\"],\"ずさん\":[\"japanese\"],\"すずしい\":[\"japanese\"],\"すすむ\":[\"japanese\"],\"すすめる\":[\"japanese\"],\"すっかり\":[\"japanese\"],\"ずっしり\":[\"japanese\"],\"ずっと\":[\"japanese\"],\"すてき\":[\"japanese\"],\"すてる\":[\"japanese\"],\"すねる\":[\"japanese\"],\"すのこ\":[\"japanese\"],\"すはだ\":[\"japanese\"],\"すばらしい\":[\"japanese\"],\"ずひょう\":[\"japanese\"],\"ずぶぬれ\":[\"japanese\"],\"すぶり\":[\"japanese\"],\"すふれ\":[\"japanese\"],\"すべて\":[\"japanese\"],\"すべる\":[\"japanese\"],\"ずほう\":[\"japanese\"],\"すぼん\":[\"japanese\"],\"すまい\":[\"japanese\"],\"すめし\":[\"japanese\"],\"すもう\":[\"japanese\"],\"すやき\":[\"japanese\"],\"すらすら\":[\"japanese\"],\"するめ\":[\"japanese\"],\"すれちがう\":[\"japanese\"],\"すろっと\":[\"japanese\"],\"すわる\":[\"japanese\"],\"すんぜん\":[\"japanese\"],\"すんぽう\":[\"japanese\"],\"せあぶら\":[\"japanese\"],\"せいかつ\":[\"japanese\"],\"せいげん\":[\"japanese\"],\"せいじ\":[\"japanese\"],\"せいよう\":[\"japanese\"],\"せおう\":[\"japanese\"],\"せかいかん\":[\"japanese\"],\"せきにん\":[\"japanese\"],\"せきむ\":[\"japanese\"],\"せきゆ\":[\"japanese\"],\"せきらんうん\":[\"japanese\"],\"せけん\":[\"japanese\"],\"せこう\":[\"japanese\"],\"せすじ\":[\"japanese\"],\"せたい\":[\"japanese\"],\"せたけ\":[\"japanese\"],\"せっかく\":[\"japanese\"],\"せっきゃく\":[\"japanese\"],\"ぜっく\":[\"japanese\"],\"せっけん\":[\"japanese\"],\"せっこつ\":[\"japanese\"],\"せっさたくま\":[\"japanese\"],\"せつぞく\":[\"japanese\"],\"せつだん\":[\"japanese\"],\"せつでん\":[\"japanese\"],\"せっぱん\":[\"japanese\"],\"せつび\":[\"japanese\"],\"せつぶん\":[\"japanese\"],\"せつめい\":[\"japanese\"],\"せつりつ\":[\"japanese\"],\"せなか\":[\"japanese\"],\"せのび\":[\"japanese\"],\"せはば\":[\"japanese\"],\"せびろ\":[\"japanese\"],\"せぼね\":[\"japanese\"],\"せまい\":[\"japanese\"],\"せまる\":[\"japanese\"],\"せめる\":[\"japanese\"],\"せもたれ\":[\"japanese\"],\"せりふ\":[\"japanese\"],\"ぜんあく\":[\"japanese\"],\"せんい\":[\"japanese\"],\"せんえい\":[\"japanese\"],\"せんか\":[\"japanese\"],\"せんきょ\":[\"japanese\"],\"せんく\":[\"japanese\"],\"せんげん\":[\"japanese\"],\"ぜんご\":[\"japanese\"],\"せんさい\":[\"japanese\"],\"せんしゅ\":[\"japanese\"],\"せんすい\":[\"japanese\"],\"せんせい\":[\"japanese\"],\"せんぞ\":[\"japanese\"],\"せんたく\":[\"japanese\"],\"せんちょう\":[\"japanese\"],\"せんてい\":[\"japanese\"],\"せんとう\":[\"japanese\"],\"せんぬき\":[\"japanese\"],\"せんねん\":[\"japanese\"],\"せんぱい\":[\"japanese\"],\"ぜんぶ\":[\"japanese\"],\"ぜんぽう\":[\"japanese\"],\"せんむ\":[\"japanese\"],\"せんめんじょ\":[\"japanese\"],\"せんもん\":[\"japanese\"],\"せんやく\":[\"japanese\"],\"せんゆう\":[\"japanese\"],\"せんよう\":[\"japanese\"],\"ぜんら\":[\"japanese\"],\"ぜんりゃく\":[\"japanese\"],\"せんれい\":[\"japanese\"],\"せんろ\":[\"japanese\"],\"そあく\":[\"japanese\"],\"そいとげる\":[\"japanese\"],\"そいね\":[\"japanese\"],\"そうがんきょう\":[\"japanese\"],\"そうき\":[\"japanese\"],\"そうご\":[\"japanese\"],\"そうしん\":[\"japanese\"],\"そうだん\":[\"japanese\"],\"そうなん\":[\"japanese\"],\"そうび\":[\"japanese\"],\"そうめん\":[\"japanese\"],\"そうり\":[\"japanese\"],\"そえもの\":[\"japanese\"],\"そえん\":[\"japanese\"],\"そがい\":[\"japanese\"],\"そげき\":[\"japanese\"],\"そこう\":[\"japanese\"],\"そこそこ\":[\"japanese\"],\"そざい\":[\"japanese\"],\"そしな\":[\"japanese\"],\"そせい\":[\"japanese\"],\"そせん\":[\"japanese\"],\"そそぐ\":[\"japanese\"],\"そだてる\":[\"japanese\"],\"そつう\":[\"japanese\"],\"そつえん\":[\"japanese\"],\"そっかん\":[\"japanese\"],\"そつぎょう\":[\"japanese\"],\"そっけつ\":[\"japanese\"],\"そっこう\":[\"japanese\"],\"そっせん\":[\"japanese\"],\"そっと\":[\"japanese\"],\"そとがわ\":[\"japanese\"],\"そとづら\":[\"japanese\"],\"そなえる\":[\"japanese\"],\"そなた\":[\"japanese\"],\"そふぼ\":[\"japanese\"],\"そぼく\":[\"japanese\"],\"そぼろ\":[\"japanese\"],\"そまつ\":[\"japanese\"],\"そまる\":[\"japanese\"],\"そむく\":[\"japanese\"],\"そむりえ\":[\"japanese\"],\"そめる\":[\"japanese\"],\"そもそも\":[\"japanese\"],\"そよかぜ\":[\"japanese\"],\"そらまめ\":[\"japanese\"],\"そろう\":[\"japanese\"],\"そんかい\":[\"japanese\"],\"そんけい\":[\"japanese\"],\"そんざい\":[\"japanese\"],\"そんしつ\":[\"japanese\"],\"そんぞく\":[\"japanese\"],\"そんちょう\":[\"japanese\"],\"ぞんび\":[\"japanese\"],\"ぞんぶん\":[\"japanese\"],\"そんみん\":[\"japanese\"],\"たあい\":[\"japanese\"],\"たいいん\":[\"japanese\"],\"たいうん\":[\"japanese\"],\"たいえき\":[\"japanese\"],\"たいおう\":[\"japanese\"],\"だいがく\":[\"japanese\"],\"たいき\":[\"japanese\"],\"たいぐう\":[\"japanese\"],\"たいけん\":[\"japanese\"],\"たいこ\":[\"japanese\"],\"たいざい\":[\"japanese\"],\"だいじょうぶ\":[\"japanese\"],\"だいすき\":[\"japanese\"],\"たいせつ\":[\"japanese\"],\"たいそう\":[\"japanese\"],\"だいたい\":[\"japanese\"],\"たいちょう\":[\"japanese\"],\"たいてい\":[\"japanese\"],\"だいどころ\":[\"japanese\"],\"たいない\":[\"japanese\"],\"たいねつ\":[\"japanese\"],\"たいのう\":[\"japanese\"],\"たいはん\":[\"japanese\"],\"だいひょう\":[\"japanese\"],\"たいふう\":[\"japanese\"],\"たいへん\":[\"japanese\"],\"たいほ\":[\"japanese\"],\"たいまつばな\":[\"japanese\"],\"たいみんぐ\":[\"japanese\"],\"たいむ\":[\"japanese\"],\"たいめん\":[\"japanese\"],\"たいやき\":[\"japanese\"],\"たいよう\":[\"japanese\"],\"たいら\":[\"japanese\"],\"たいりょく\":[\"japanese\"],\"たいる\":[\"japanese\"],\"たいわん\":[\"japanese\"],\"たうえ\":[\"japanese\"],\"たえる\":[\"japanese\"],\"たおす\":[\"japanese\"],\"たおる\":[\"japanese\"],\"たおれる\":[\"japanese\"],\"たかい\":[\"japanese\"],\"たかね\":[\"japanese\"],\"たきび\":[\"japanese\"],\"たくさん\":[\"japanese\"],\"たこく\":[\"japanese\"],\"たこやき\":[\"japanese\"],\"たさい\":[\"japanese\"],\"たしざん\":[\"japanese\"],\"だじゃれ\":[\"japanese\"],\"たすける\":[\"japanese\"],\"たずさわる\":[\"japanese\"],\"たそがれ\":[\"japanese\"],\"たたかう\":[\"japanese\"],\"たたく\":[\"japanese\"],\"ただしい\":[\"japanese\"],\"たたみ\":[\"japanese\"],\"たちばな\":[\"japanese\"],\"だっかい\":[\"japanese\"],\"だっきゃく\":[\"japanese\"],\"だっこ\":[\"japanese\"],\"だっしゅつ\":[\"japanese\"],\"だったい\":[\"japanese\"],\"たてる\":[\"japanese\"],\"たとえる\":[\"japanese\"],\"たなばた\":[\"japanese\"],\"たにん\":[\"japanese\"],\"たぬき\":[\"japanese\"],\"たのしみ\":[\"japanese\"],\"たはつ\":[\"japanese\"],\"たぶん\":[\"japanese\"],\"たべる\":[\"japanese\"],\"たぼう\":[\"japanese\"],\"たまご\":[\"japanese\"],\"たまる\":[\"japanese\"],\"だむる\":[\"japanese\"],\"ためいき\":[\"japanese\"],\"ためす\":[\"japanese\"],\"ためる\":[\"japanese\"],\"たもつ\":[\"japanese\"],\"たやすい\":[\"japanese\"],\"たよる\":[\"japanese\"],\"たらす\":[\"japanese\"],\"たりきほんがん\":[\"japanese\"],\"たりょう\":[\"japanese\"],\"たりる\":[\"japanese\"],\"たると\":[\"japanese\"],\"たれる\":[\"japanese\"],\"たれんと\":[\"japanese\"],\"たろっと\":[\"japanese\"],\"たわむれる\":[\"japanese\"],\"だんあつ\":[\"japanese\"],\"たんい\":[\"japanese\"],\"たんおん\":[\"japanese\"],\"たんか\":[\"japanese\"],\"たんき\":[\"japanese\"],\"たんけん\":[\"japanese\"],\"たんご\":[\"japanese\"],\"たんさん\":[\"japanese\"],\"たんじょうび\":[\"japanese\"],\"だんせい\":[\"japanese\"],\"たんそく\":[\"japanese\"],\"たんたい\":[\"japanese\"],\"だんち\":[\"japanese\"],\"たんてい\":[\"japanese\"],\"たんとう\":[\"japanese\"],\"だんな\":[\"japanese\"],\"たんにん\":[\"japanese\"],\"だんねつ\":[\"japanese\"],\"たんのう\":[\"japanese\"],\"たんぴん\":[\"japanese\"],\"だんぼう\":[\"japanese\"],\"たんまつ\":[\"japanese\"],\"たんめい\":[\"japanese\"],\"だんれつ\":[\"japanese\"],\"だんろ\":[\"japanese\"],\"だんわ\":[\"japanese\"],\"ちあい\":[\"japanese\"],\"ちあん\":[\"japanese\"],\"ちいき\":[\"japanese\"],\"ちいさい\":[\"japanese\"],\"ちえん\":[\"japanese\"],\"ちかい\":[\"japanese\"],\"ちから\":[\"japanese\"],\"ちきゅう\":[\"japanese\"],\"ちきん\":[\"japanese\"],\"ちけいず\":[\"japanese\"],\"ちけん\":[\"japanese\"],\"ちこく\":[\"japanese\"],\"ちさい\":[\"japanese\"],\"ちしき\":[\"japanese\"],\"ちしりょう\":[\"japanese\"],\"ちせい\":[\"japanese\"],\"ちそう\":[\"japanese\"],\"ちたい\":[\"japanese\"],\"ちたん\":[\"japanese\"],\"ちちおや\":[\"japanese\"],\"ちつじょ\":[\"japanese\"],\"ちてき\":[\"japanese\"],\"ちてん\":[\"japanese\"],\"ちぬき\":[\"japanese\"],\"ちぬり\":[\"japanese\"],\"ちのう\":[\"japanese\"],\"ちひょう\":[\"japanese\"],\"ちへいせん\":[\"japanese\"],\"ちほう\":[\"japanese\"],\"ちまた\":[\"japanese\"],\"ちみつ\":[\"japanese\"],\"ちみどろ\":[\"japanese\"],\"ちめいど\":[\"japanese\"],\"ちゃんこなべ\":[\"japanese\"],\"ちゅうい\":[\"japanese\"],\"ちゆりょく\":[\"japanese\"],\"ちょうし\":[\"japanese\"],\"ちょさくけん\":[\"japanese\"],\"ちらし\":[\"japanese\"],\"ちらみ\":[\"japanese\"],\"ちりがみ\":[\"japanese\"],\"ちりょう\":[\"japanese\"],\"ちるど\":[\"japanese\"],\"ちわわ\":[\"japanese\"],\"ちんたい\":[\"japanese\"],\"ちんもく\":[\"japanese\"],\"ついか\":[\"japanese\"],\"ついたち\":[\"japanese\"],\"つうか\":[\"japanese\"],\"つうじょう\":[\"japanese\"],\"つうはん\":[\"japanese\"],\"つうわ\":[\"japanese\"],\"つかう\":[\"japanese\"],\"つかれる\":[\"japanese\"],\"つくね\":[\"japanese\"],\"つくる\":[\"japanese\"],\"つけね\":[\"japanese\"],\"つける\":[\"japanese\"],\"つごう\":[\"japanese\"],\"つたえる\":[\"japanese\"],\"つづく\":[\"japanese\"],\"つつじ\":[\"japanese\"],\"つつむ\":[\"japanese\"],\"つとめる\":[\"japanese\"],\"つながる\":[\"japanese\"],\"つなみ\":[\"japanese\"],\"つねづね\":[\"japanese\"],\"つのる\":[\"japanese\"],\"つぶす\":[\"japanese\"],\"つまらない\":[\"japanese\"],\"つまる\":[\"japanese\"],\"つみき\":[\"japanese\"],\"つめたい\":[\"japanese\"],\"つもり\":[\"japanese\"],\"つもる\":[\"japanese\"],\"つよい\":[\"japanese\"],\"つるぼ\":[\"japanese\"],\"つるみく\":[\"japanese\"],\"つわもの\":[\"japanese\"],\"つわり\":[\"japanese\"],\"てあし\":[\"japanese\"],\"てあて\":[\"japanese\"],\"てあみ\":[\"japanese\"],\"ていおん\":[\"japanese\"],\"ていか\":[\"japanese\"],\"ていき\":[\"japanese\"],\"ていけい\":[\"japanese\"],\"ていこく\":[\"japanese\"],\"ていさつ\":[\"japanese\"],\"ていし\":[\"japanese\"],\"ていせい\":[\"japanese\"],\"ていたい\":[\"japanese\"],\"ていど\":[\"japanese\"],\"ていねい\":[\"japanese\"],\"ていひょう\":[\"japanese\"],\"ていへん\":[\"japanese\"],\"ていぼう\":[\"japanese\"],\"てうち\":[\"japanese\"],\"ておくれ\":[\"japanese\"],\"てきとう\":[\"japanese\"],\"てくび\":[\"japanese\"],\"でこぼこ\":[\"japanese\"],\"てさぎょう\":[\"japanese\"],\"てさげ\":[\"japanese\"],\"てすり\":[\"japanese\"],\"てそう\":[\"japanese\"],\"てちがい\":[\"japanese\"],\"てちょう\":[\"japanese\"],\"てつがく\":[\"japanese\"],\"てつづき\":[\"japanese\"],\"でっぱ\":[\"japanese\"],\"てつぼう\":[\"japanese\"],\"てつや\":[\"japanese\"],\"でぬかえ\":[\"japanese\"],\"てぬき\":[\"japanese\"],\"てぬぐい\":[\"japanese\"],\"てのひら\":[\"japanese\"],\"てはい\":[\"japanese\"],\"てぶくろ\":[\"japanese\"],\"てふだ\":[\"japanese\"],\"てほどき\":[\"japanese\"],\"てほん\":[\"japanese\"],\"てまえ\":[\"japanese\"],\"てまきずし\":[\"japanese\"],\"てみじか\":[\"japanese\"],\"てみやげ\":[\"japanese\"],\"てらす\":[\"japanese\"],\"てれび\":[\"japanese\"],\"てわけ\":[\"japanese\"],\"てわたし\":[\"japanese\"],\"でんあつ\":[\"japanese\"],\"てんいん\":[\"japanese\"],\"てんかい\":[\"japanese\"],\"てんき\":[\"japanese\"],\"てんぐ\":[\"japanese\"],\"てんけん\":[\"japanese\"],\"てんごく\":[\"japanese\"],\"てんさい\":[\"japanese\"],\"てんし\":[\"japanese\"],\"てんすう\":[\"japanese\"],\"でんち\":[\"japanese\"],\"てんてき\":[\"japanese\"],\"てんとう\":[\"japanese\"],\"てんない\":[\"japanese\"],\"てんぷら\":[\"japanese\"],\"てんぼうだい\":[\"japanese\"],\"てんめつ\":[\"japanese\"],\"てんらんかい\":[\"japanese\"],\"でんりょく\":[\"japanese\"],\"でんわ\":[\"japanese\"],\"どあい\":[\"japanese\"],\"といれ\":[\"japanese\"],\"どうかん\":[\"japanese\"],\"とうきゅう\":[\"japanese\"],\"どうぐ\":[\"japanese\"],\"とうし\":[\"japanese\"],\"とうむぎ\":[\"japanese\"],\"とおい\":[\"japanese\"],\"とおか\":[\"japanese\"],\"とおく\":[\"japanese\"],\"とおす\":[\"japanese\"],\"とおる\":[\"japanese\"],\"とかい\":[\"japanese\"],\"とかす\":[\"japanese\"],\"ときおり\":[\"japanese\"],\"ときどき\":[\"japanese\"],\"とくい\":[\"japanese\"],\"とくしゅう\":[\"japanese\"],\"とくてん\":[\"japanese\"],\"とくに\":[\"japanese\"],\"とくべつ\":[\"japanese\"],\"とけい\":[\"japanese\"],\"とける\":[\"japanese\"],\"とこや\":[\"japanese\"],\"とさか\":[\"japanese\"],\"としょかん\":[\"japanese\"],\"とそう\":[\"japanese\"],\"とたん\":[\"japanese\"],\"とちゅう\":[\"japanese\"],\"とっきゅう\":[\"japanese\"],\"とっくん\":[\"japanese\"],\"とつぜん\":[\"japanese\"],\"とつにゅう\":[\"japanese\"],\"とどける\":[\"japanese\"],\"ととのえる\":[\"japanese\"],\"とない\":[\"japanese\"],\"となえる\":[\"japanese\"],\"となり\":[\"japanese\"],\"とのさま\":[\"japanese\"],\"とばす\":[\"japanese\"],\"どぶがわ\":[\"japanese\"],\"とほう\":[\"japanese\"],\"とまる\":[\"japanese\"],\"とめる\":[\"japanese\"],\"ともだち\":[\"japanese\"],\"ともる\":[\"japanese\"],\"どようび\":[\"japanese\"],\"とらえる\":[\"japanese\"],\"とんかつ\":[\"japanese\"],\"どんぶり\":[\"japanese\"],\"ないかく\":[\"japanese\"],\"ないこう\":[\"japanese\"],\"ないしょ\":[\"japanese\"],\"ないす\":[\"japanese\"],\"ないせん\":[\"japanese\"],\"ないそう\":[\"japanese\"],\"なおす\":[\"japanese\"],\"ながい\":[\"japanese\"],\"なくす\":[\"japanese\"],\"なげる\":[\"japanese\"],\"なこうど\":[\"japanese\"],\"なさけ\":[\"japanese\"],\"なたでここ\":[\"japanese\"],\"なっとう\":[\"japanese\"],\"なつやすみ\":[\"japanese\"],\"ななおし\":[\"japanese\"],\"なにごと\":[\"japanese\"],\"なにもの\":[\"japanese\"],\"なにわ\":[\"japanese\"],\"なのか\":[\"japanese\"],\"なふだ\":[\"japanese\"],\"なまいき\":[\"japanese\"],\"なまえ\":[\"japanese\"],\"なまみ\":[\"japanese\"],\"なみだ\":[\"japanese\"],\"なめらか\":[\"japanese\"],\"なめる\":[\"japanese\"],\"なやむ\":[\"japanese\"],\"ならう\":[\"japanese\"],\"ならび\":[\"japanese\"],\"ならぶ\":[\"japanese\"],\"なれる\":[\"japanese\"],\"なわとび\":[\"japanese\"],\"なわばり\":[\"japanese\"],\"にあう\":[\"japanese\"],\"にいがた\":[\"japanese\"],\"にうけ\":[\"japanese\"],\"におい\":[\"japanese\"],\"にかい\":[\"japanese\"],\"にがて\":[\"japanese\"],\"にきび\":[\"japanese\"],\"にくしみ\":[\"japanese\"],\"にくまん\":[\"japanese\"],\"にげる\":[\"japanese\"],\"にさんかたんそ\":[\"japanese\"],\"にしき\":[\"japanese\"],\"にせもの\":[\"japanese\"],\"にちじょう\":[\"japanese\"],\"にちようび\":[\"japanese\"],\"にっか\":[\"japanese\"],\"にっき\":[\"japanese\"],\"にっけい\":[\"japanese\"],\"にっこう\":[\"japanese\"],\"にっさん\":[\"japanese\"],\"にっしょく\":[\"japanese\"],\"にっすう\":[\"japanese\"],\"にっせき\":[\"japanese\"],\"にってい\":[\"japanese\"],\"になう\":[\"japanese\"],\"にほん\":[\"japanese\"],\"にまめ\":[\"japanese\"],\"にもつ\":[\"japanese\"],\"にやり\":[\"japanese\"],\"にゅういん\":[\"japanese\"],\"にりんしゃ\":[\"japanese\"],\"にわとり\":[\"japanese\"],\"にんい\":[\"japanese\"],\"にんか\":[\"japanese\"],\"にんき\":[\"japanese\"],\"にんげん\":[\"japanese\"],\"にんしき\":[\"japanese\"],\"にんずう\":[\"japanese\"],\"にんそう\":[\"japanese\"],\"にんたい\":[\"japanese\"],\"にんち\":[\"japanese\"],\"にんてい\":[\"japanese\"],\"にんにく\":[\"japanese\"],\"にんぷ\":[\"japanese\"],\"にんまり\":[\"japanese\"],\"にんむ\":[\"japanese\"],\"にんめい\":[\"japanese\"],\"にんよう\":[\"japanese\"],\"ぬいくぎ\":[\"japanese\"],\"ぬかす\":[\"japanese\"],\"ぬぐいとる\":[\"japanese\"],\"ぬぐう\":[\"japanese\"],\"ぬくもり\":[\"japanese\"],\"ぬすむ\":[\"japanese\"],\"ぬまえび\":[\"japanese\"],\"ぬめり\":[\"japanese\"],\"ぬらす\":[\"japanese\"],\"ぬんちゃく\":[\"japanese\"],\"ねあげ\":[\"japanese\"],\"ねいき\":[\"japanese\"],\"ねいる\":[\"japanese\"],\"ねいろ\":[\"japanese\"],\"ねぐせ\":[\"japanese\"],\"ねくたい\":[\"japanese\"],\"ねくら\":[\"japanese\"],\"ねこぜ\":[\"japanese\"],\"ねこむ\":[\"japanese\"],\"ねさげ\":[\"japanese\"],\"ねすごす\":[\"japanese\"],\"ねそべる\":[\"japanese\"],\"ねだん\":[\"japanese\"],\"ねつい\":[\"japanese\"],\"ねっしん\":[\"japanese\"],\"ねつぞう\":[\"japanese\"],\"ねったいぎょ\":[\"japanese\"],\"ねぶそく\":[\"japanese\"],\"ねふだ\":[\"japanese\"],\"ねぼう\":[\"japanese\"],\"ねほりはほり\":[\"japanese\"],\"ねまき\":[\"japanese\"],\"ねまわし\":[\"japanese\"],\"ねみみ\":[\"japanese\"],\"ねむい\":[\"japanese\"],\"ねむたい\":[\"japanese\"],\"ねもと\":[\"japanese\"],\"ねらう\":[\"japanese\"],\"ねわざ\":[\"japanese\"],\"ねんいり\":[\"japanese\"],\"ねんおし\":[\"japanese\"],\"ねんかん\":[\"japanese\"],\"ねんきん\":[\"japanese\"],\"ねんぐ\":[\"japanese\"],\"ねんざ\":[\"japanese\"],\"ねんし\":[\"japanese\"],\"ねんちゃく\":[\"japanese\"],\"ねんど\":[\"japanese\"],\"ねんぴ\":[\"japanese\"],\"ねんぶつ\":[\"japanese\"],\"ねんまつ\":[\"japanese\"],\"ねんりょう\":[\"japanese\"],\"ねんれい\":[\"japanese\"],\"のいず\":[\"japanese\"],\"のおづま\":[\"japanese\"],\"のがす\":[\"japanese\"],\"のきなみ\":[\"japanese\"],\"のこぎり\":[\"japanese\"],\"のこす\":[\"japanese\"],\"のこる\":[\"japanese\"],\"のせる\":[\"japanese\"],\"のぞく\":[\"japanese\"],\"のぞむ\":[\"japanese\"],\"のたまう\":[\"japanese\"],\"のちほど\":[\"japanese\"],\"のっく\":[\"japanese\"],\"のばす\":[\"japanese\"],\"のはら\":[\"japanese\"],\"のべる\":[\"japanese\"],\"のぼる\":[\"japanese\"],\"のみもの\":[\"japanese\"],\"のやま\":[\"japanese\"],\"のらいぬ\":[\"japanese\"],\"のらねこ\":[\"japanese\"],\"のりもの\":[\"japanese\"],\"のりゆき\":[\"japanese\"],\"のれん\":[\"japanese\"],\"のんき\":[\"japanese\"],\"ばあい\":[\"japanese\"],\"はあく\":[\"japanese\"],\"ばあさん\":[\"japanese\"],\"ばいか\":[\"japanese\"],\"ばいく\":[\"japanese\"],\"はいけん\":[\"japanese\"],\"はいご\":[\"japanese\"],\"はいしん\":[\"japanese\"],\"はいすい\":[\"japanese\"],\"はいせん\":[\"japanese\"],\"はいそう\":[\"japanese\"],\"はいち\":[\"japanese\"],\"ばいばい\":[\"japanese\"],\"はいれつ\":[\"japanese\"],\"はえる\":[\"japanese\"],\"はおる\":[\"japanese\"],\"はかい\":[\"japanese\"],\"ばかり\":[\"japanese\"],\"はかる\":[\"japanese\"],\"はくしゅ\":[\"japanese\"],\"はけん\":[\"japanese\"],\"はこぶ\":[\"japanese\"],\"はさみ\":[\"japanese\"],\"はさん\":[\"japanese\"],\"はしご\":[\"japanese\"],\"ばしょ\":[\"japanese\"],\"はしる\":[\"japanese\"],\"はせる\":[\"japanese\"],\"ぱそこん\":[\"japanese\"],\"はそん\":[\"japanese\"],\"はたん\":[\"japanese\"],\"はちみつ\":[\"japanese\"],\"はつおん\":[\"japanese\"],\"はっかく\":[\"japanese\"],\"はづき\":[\"japanese\"],\"はっきり\":[\"japanese\"],\"はっくつ\":[\"japanese\"],\"はっけん\":[\"japanese\"],\"はっこう\":[\"japanese\"],\"はっさん\":[\"japanese\"],\"はっしん\":[\"japanese\"],\"はったつ\":[\"japanese\"],\"はっちゅう\":[\"japanese\"],\"はってん\":[\"japanese\"],\"はっぴょう\":[\"japanese\"],\"はっぽう\":[\"japanese\"],\"はなす\":[\"japanese\"],\"はなび\":[\"japanese\"],\"はにかむ\":[\"japanese\"],\"はぶらし\":[\"japanese\"],\"はみがき\":[\"japanese\"],\"はむかう\":[\"japanese\"],\"はめつ\":[\"japanese\"],\"はやい\":[\"japanese\"],\"はやし\":[\"japanese\"],\"はらう\":[\"japanese\"],\"はろうぃん\":[\"japanese\"],\"はわい\":[\"japanese\"],\"はんい\":[\"japanese\"],\"はんえい\":[\"japanese\"],\"はんおん\":[\"japanese\"],\"はんかく\":[\"japanese\"],\"はんきょう\":[\"japanese\"],\"ばんぐみ\":[\"japanese\"],\"はんこ\":[\"japanese\"],\"はんしゃ\":[\"japanese\"],\"はんすう\":[\"japanese\"],\"はんだん\":[\"japanese\"],\"ぱんち\":[\"japanese\"],\"ぱんつ\":[\"japanese\"],\"はんてい\":[\"japanese\"],\"はんとし\":[\"japanese\"],\"はんのう\":[\"japanese\"],\"はんぱ\":[\"japanese\"],\"はんぶん\":[\"japanese\"],\"はんぺん\":[\"japanese\"],\"はんぼうき\":[\"japanese\"],\"はんめい\":[\"japanese\"],\"はんらん\":[\"japanese\"],\"はんろん\":[\"japanese\"],\"ひいき\":[\"japanese\"],\"ひうん\":[\"japanese\"],\"ひえる\":[\"japanese\"],\"ひかく\":[\"japanese\"],\"ひかり\":[\"japanese\"],\"ひかる\":[\"japanese\"],\"ひかん\":[\"japanese\"],\"ひくい\":[\"japanese\"],\"ひけつ\":[\"japanese\"],\"ひこうき\":[\"japanese\"],\"ひこく\":[\"japanese\"],\"ひさい\":[\"japanese\"],\"ひさしぶり\":[\"japanese\"],\"ひさん\":[\"japanese\"],\"びじゅつかん\":[\"japanese\"],\"ひしょ\":[\"japanese\"],\"ひそか\":[\"japanese\"],\"ひそむ\":[\"japanese\"],\"ひたむき\":[\"japanese\"],\"ひだり\":[\"japanese\"],\"ひたる\":[\"japanese\"],\"ひつぎ\":[\"japanese\"],\"ひっこし\":[\"japanese\"],\"ひっし\":[\"japanese\"],\"ひつじゅひん\":[\"japanese\"],\"ひっす\":[\"japanese\"],\"ひつぜん\":[\"japanese\"],\"ぴったり\":[\"japanese\"],\"ぴっちり\":[\"japanese\"],\"ひつよう\":[\"japanese\"],\"ひてい\":[\"japanese\"],\"ひとごみ\":[\"japanese\"],\"ひなまつり\":[\"japanese\"],\"ひなん\":[\"japanese\"],\"ひねる\":[\"japanese\"],\"ひはん\":[\"japanese\"],\"ひびく\":[\"japanese\"],\"ひひょう\":[\"japanese\"],\"ひほう\":[\"japanese\"],\"ひまわり\":[\"japanese\"],\"ひまん\":[\"japanese\"],\"ひみつ\":[\"japanese\"],\"ひめい\":[\"japanese\"],\"ひめじし\":[\"japanese\"],\"ひやけ\":[\"japanese\"],\"ひやす\":[\"japanese\"],\"ひよう\":[\"japanese\"],\"びょうき\":[\"japanese\"],\"ひらがな\":[\"japanese\"],\"ひらく\":[\"japanese\"],\"ひりつ\":[\"japanese\"],\"ひりょう\":[\"japanese\"],\"ひるま\":[\"japanese\"],\"ひるやすみ\":[\"japanese\"],\"ひれい\":[\"japanese\"],\"ひろい\":[\"japanese\"],\"ひろう\":[\"japanese\"],\"ひろき\":[\"japanese\"],\"ひろゆき\":[\"japanese\"],\"ひんかく\":[\"japanese\"],\"ひんけつ\":[\"japanese\"],\"ひんこん\":[\"japanese\"],\"ひんしゅ\":[\"japanese\"],\"ひんそう\":[\"japanese\"],\"ぴんち\":[\"japanese\"],\"ひんぱん\":[\"japanese\"],\"びんぼう\":[\"japanese\"],\"ふあん\":[\"japanese\"],\"ふいうち\":[\"japanese\"],\"ふうけい\":[\"japanese\"],\"ふうせん\":[\"japanese\"],\"ぷうたろう\":[\"japanese\"],\"ふうとう\":[\"japanese\"],\"ふうふ\":[\"japanese\"],\"ふえる\":[\"japanese\"],\"ふおん\":[\"japanese\"],\"ふかい\":[\"japanese\"],\"ふきん\":[\"japanese\"],\"ふくざつ\":[\"japanese\"],\"ふくぶくろ\":[\"japanese\"],\"ふこう\":[\"japanese\"],\"ふさい\":[\"japanese\"],\"ふしぎ\":[\"japanese\"],\"ふじみ\":[\"japanese\"],\"ふすま\":[\"japanese\"],\"ふせい\":[\"japanese\"],\"ふせぐ\":[\"japanese\"],\"ふそく\":[\"japanese\"],\"ぶたにく\":[\"japanese\"],\"ふたん\":[\"japanese\"],\"ふちょう\":[\"japanese\"],\"ふつう\":[\"japanese\"],\"ふつか\":[\"japanese\"],\"ふっかつ\":[\"japanese\"],\"ふっき\":[\"japanese\"],\"ふっこく\":[\"japanese\"],\"ぶどう\":[\"japanese\"],\"ふとる\":[\"japanese\"],\"ふとん\":[\"japanese\"],\"ふのう\":[\"japanese\"],\"ふはい\":[\"japanese\"],\"ふひょう\":[\"japanese\"],\"ふへん\":[\"japanese\"],\"ふまん\":[\"japanese\"],\"ふみん\":[\"japanese\"],\"ふめつ\":[\"japanese\"],\"ふめん\":[\"japanese\"],\"ふよう\":[\"japanese\"],\"ふりこ\":[\"japanese\"],\"ふりる\":[\"japanese\"],\"ふるい\":[\"japanese\"],\"ふんいき\":[\"japanese\"],\"ぶんがく\":[\"japanese\"],\"ぶんぐ\":[\"japanese\"],\"ふんしつ\":[\"japanese\"],\"ぶんせき\":[\"japanese\"],\"ふんそう\":[\"japanese\"],\"ぶんぽう\":[\"japanese\"],\"へいあん\":[\"japanese\"],\"へいおん\":[\"japanese\"],\"へいがい\":[\"japanese\"],\"へいき\":[\"japanese\"],\"へいげん\":[\"japanese\"],\"へいこう\":[\"japanese\"],\"へいさ\":[\"japanese\"],\"へいしゃ\":[\"japanese\"],\"へいせつ\":[\"japanese\"],\"へいそ\":[\"japanese\"],\"へいたく\":[\"japanese\"],\"へいてん\":[\"japanese\"],\"へいねつ\":[\"japanese\"],\"へいわ\":[\"japanese\"],\"へきが\":[\"japanese\"],\"へこむ\":[\"japanese\"],\"べにいろ\":[\"japanese\"],\"べにしょうが\":[\"japanese\"],\"へらす\":[\"japanese\"],\"へんかん\":[\"japanese\"],\"べんきょう\":[\"japanese\"],\"べんごし\":[\"japanese\"],\"へんさい\":[\"japanese\"],\"へんたい\":[\"japanese\"],\"べんり\":[\"japanese\"],\"ほあん\":[\"japanese\"],\"ほいく\":[\"japanese\"],\"ぼうぎょ\":[\"japanese\"],\"ほうこく\":[\"japanese\"],\"ほうそう\":[\"japanese\"],\"ほうほう\":[\"japanese\"],\"ほうもん\":[\"japanese\"],\"ほうりつ\":[\"japanese\"],\"ほえる\":[\"japanese\"],\"ほおん\":[\"japanese\"],\"ほかん\":[\"japanese\"],\"ほきょう\":[\"japanese\"],\"ぼきん\":[\"japanese\"],\"ほくろ\":[\"japanese\"],\"ほけつ\":[\"japanese\"],\"ほけん\":[\"japanese\"],\"ほこう\":[\"japanese\"],\"ほこる\":[\"japanese\"],\"ほしい\":[\"japanese\"],\"ほしつ\":[\"japanese\"],\"ほしゅ\":[\"japanese\"],\"ほしょう\":[\"japanese\"],\"ほせい\":[\"japanese\"],\"ほそい\":[\"japanese\"],\"ほそく\":[\"japanese\"],\"ほたて\":[\"japanese\"],\"ほたる\":[\"japanese\"],\"ぽちぶくろ\":[\"japanese\"],\"ほっきょく\":[\"japanese\"],\"ほっさ\":[\"japanese\"],\"ほったん\":[\"japanese\"],\"ほとんど\":[\"japanese\"],\"ほめる\":[\"japanese\"],\"ほんい\":[\"japanese\"],\"ほんき\":[\"japanese\"],\"ほんけ\":[\"japanese\"],\"ほんしつ\":[\"japanese\"],\"ほんやく\":[\"japanese\"],\"まいにち\":[\"japanese\"],\"まかい\":[\"japanese\"],\"まかせる\":[\"japanese\"],\"まがる\":[\"japanese\"],\"まける\":[\"japanese\"],\"まこと\":[\"japanese\"],\"まさつ\":[\"japanese\"],\"まじめ\":[\"japanese\"],\"ますく\":[\"japanese\"],\"まぜる\":[\"japanese\"],\"まつり\":[\"japanese\"],\"まとめ\":[\"japanese\"],\"まなぶ\":[\"japanese\"],\"まぬけ\":[\"japanese\"],\"まねく\":[\"japanese\"],\"まほう\":[\"japanese\"],\"まもる\":[\"japanese\"],\"まゆげ\":[\"japanese\"],\"まよう\":[\"japanese\"],\"まろやか\":[\"japanese\"],\"まわす\":[\"japanese\"],\"まわり\":[\"japanese\"],\"まわる\":[\"japanese\"],\"まんが\":[\"japanese\"],\"まんきつ\":[\"japanese\"],\"まんぞく\":[\"japanese\"],\"まんなか\":[\"japanese\"],\"みいら\":[\"japanese\"],\"みうち\":[\"japanese\"],\"みえる\":[\"japanese\"],\"みがく\":[\"japanese\"],\"みかた\":[\"japanese\"],\"みかん\":[\"japanese\"],\"みけん\":[\"japanese\"],\"みこん\":[\"japanese\"],\"みじかい\":[\"japanese\"],\"みすい\":[\"japanese\"],\"みすえる\":[\"japanese\"],\"みせる\":[\"japanese\"],\"みっか\":[\"japanese\"],\"みつかる\":[\"japanese\"],\"みつける\":[\"japanese\"],\"みてい\":[\"japanese\"],\"みとめる\":[\"japanese\"],\"みなと\":[\"japanese\"],\"みなみかさい\":[\"japanese\"],\"みねらる\":[\"japanese\"],\"みのう\":[\"japanese\"],\"みのがす\":[\"japanese\"],\"みほん\":[\"japanese\"],\"みもと\":[\"japanese\"],\"みやげ\":[\"japanese\"],\"みらい\":[\"japanese\"],\"みりょく\":[\"japanese\"],\"みわく\":[\"japanese\"],\"みんか\":[\"japanese\"],\"みんぞく\":[\"japanese\"],\"むいか\":[\"japanese\"],\"むえき\":[\"japanese\"],\"むえん\":[\"japanese\"],\"むかい\":[\"japanese\"],\"むかう\":[\"japanese\"],\"むかえ\":[\"japanese\"],\"むかし\":[\"japanese\"],\"むぎちゃ\":[\"japanese\"],\"むける\":[\"japanese\"],\"むげん\":[\"japanese\"],\"むさぼる\":[\"japanese\"],\"むしあつい\":[\"japanese\"],\"むしば\":[\"japanese\"],\"むじゅん\":[\"japanese\"],\"むしろ\":[\"japanese\"],\"むすう\":[\"japanese\"],\"むすこ\":[\"japanese\"],\"むすぶ\":[\"japanese\"],\"むすめ\":[\"japanese\"],\"むせる\":[\"japanese\"],\"むせん\":[\"japanese\"],\"むちゅう\":[\"japanese\"],\"むなしい\":[\"japanese\"],\"むのう\":[\"japanese\"],\"むやみ\":[\"japanese\"],\"むよう\":[\"japanese\"],\"むらさき\":[\"japanese\"],\"むりょう\":[\"japanese\"],\"むろん\":[\"japanese\"],\"めいあん\":[\"japanese\"],\"めいうん\":[\"japanese\"],\"めいえん\":[\"japanese\"],\"めいかく\":[\"japanese\"],\"めいきょく\":[\"japanese\"],\"めいさい\":[\"japanese\"],\"めいし\":[\"japanese\"],\"めいそう\":[\"japanese\"],\"めいぶつ\":[\"japanese\"],\"めいれい\":[\"japanese\"],\"めいわく\":[\"japanese\"],\"めぐまれる\":[\"japanese\"],\"めざす\":[\"japanese\"],\"めした\":[\"japanese\"],\"めずらしい\":[\"japanese\"],\"めだつ\":[\"japanese\"],\"めまい\":[\"japanese\"],\"めやす\":[\"japanese\"],\"めんきょ\":[\"japanese\"],\"めんせき\":[\"japanese\"],\"めんどう\":[\"japanese\"],\"もうしあげる\":[\"japanese\"],\"もうどうけん\":[\"japanese\"],\"もえる\":[\"japanese\"],\"もくし\":[\"japanese\"],\"もくてき\":[\"japanese\"],\"もくようび\":[\"japanese\"],\"もちろん\":[\"japanese\"],\"もどる\":[\"japanese\"],\"もらう\":[\"japanese\"],\"もんく\":[\"japanese\"],\"もんだい\":[\"japanese\"],\"やおや\":[\"japanese\"],\"やける\":[\"japanese\"],\"やさい\":[\"japanese\"],\"やさしい\":[\"japanese\"],\"やすい\":[\"japanese\"],\"やすたろう\":[\"japanese\"],\"やすみ\":[\"japanese\"],\"やせる\":[\"japanese\"],\"やそう\":[\"japanese\"],\"やたい\":[\"japanese\"],\"やちん\":[\"japanese\"],\"やっと\":[\"japanese\"],\"やっぱり\":[\"japanese\"],\"やぶる\":[\"japanese\"],\"やめる\":[\"japanese\"],\"ややこしい\":[\"japanese\"],\"やよい\":[\"japanese\"],\"やわらかい\":[\"japanese\"],\"ゆうき\":[\"japanese\"],\"ゆうびんきょく\":[\"japanese\"],\"ゆうべ\":[\"japanese\"],\"ゆうめい\":[\"japanese\"],\"ゆけつ\":[\"japanese\"],\"ゆしゅつ\":[\"japanese\"],\"ゆせん\":[\"japanese\"],\"ゆそう\":[\"japanese\"],\"ゆたか\":[\"japanese\"],\"ゆちゃく\":[\"japanese\"],\"ゆでる\":[\"japanese\"],\"ゆにゅう\":[\"japanese\"],\"ゆびわ\":[\"japanese\"],\"ゆらい\":[\"japanese\"],\"ゆれる\":[\"japanese\"],\"ようい\":[\"japanese\"],\"ようか\":[\"japanese\"],\"ようきゅう\":[\"japanese\"],\"ようじ\":[\"japanese\"],\"ようす\":[\"japanese\"],\"ようちえん\":[\"japanese\"],\"よかぜ\":[\"japanese\"],\"よかん\":[\"japanese\"],\"よきん\":[\"japanese\"],\"よくせい\":[\"japanese\"],\"よくぼう\":[\"japanese\"],\"よけい\":[\"japanese\"],\"よごれる\":[\"japanese\"],\"よさん\":[\"japanese\"],\"よしゅう\":[\"japanese\"],\"よそう\":[\"japanese\"],\"よそく\":[\"japanese\"],\"よっか\":[\"japanese\"],\"よてい\":[\"japanese\"],\"よどがわく\":[\"japanese\"],\"よねつ\":[\"japanese\"],\"よやく\":[\"japanese\"],\"よゆう\":[\"japanese\"],\"よろこぶ\":[\"japanese\"],\"よろしい\":[\"japanese\"],\"らいう\":[\"japanese\"],\"らくがき\":[\"japanese\"],\"らくご\":[\"japanese\"],\"らくさつ\":[\"japanese\"],\"らくだ\":[\"japanese\"],\"らしんばん\":[\"japanese\"],\"らせん\":[\"japanese\"],\"らぞく\":[\"japanese\"],\"らたい\":[\"japanese\"],\"らっか\":[\"japanese\"],\"られつ\":[\"japanese\"],\"りえき\":[\"japanese\"],\"りかい\":[\"japanese\"],\"りきさく\":[\"japanese\"],\"りきせつ\":[\"japanese\"],\"りくぐん\":[\"japanese\"],\"りくつ\":[\"japanese\"],\"りけん\":[\"japanese\"],\"りこう\":[\"japanese\"],\"りせい\":[\"japanese\"],\"りそう\":[\"japanese\"],\"りそく\":[\"japanese\"],\"りてん\":[\"japanese\"],\"りねん\":[\"japanese\"],\"りゆう\":[\"japanese\"],\"りゅうがく\":[\"japanese\"],\"りよう\":[\"japanese\"],\"りょうり\":[\"japanese\"],\"りょかん\":[\"japanese\"],\"りょくちゃ\":[\"japanese\"],\"りょこう\":[\"japanese\"],\"りりく\":[\"japanese\"],\"りれき\":[\"japanese\"],\"りろん\":[\"japanese\"],\"りんご\":[\"japanese\"],\"るいけい\":[\"japanese\"],\"るいさい\":[\"japanese\"],\"るいじ\":[\"japanese\"],\"るいせき\":[\"japanese\"],\"るすばん\":[\"japanese\"],\"るりがわら\":[\"japanese\"],\"れいかん\":[\"japanese\"],\"れいぎ\":[\"japanese\"],\"れいせい\":[\"japanese\"],\"れいぞうこ\":[\"japanese\"],\"れいとう\":[\"japanese\"],\"れいぼう\":[\"japanese\"],\"れきし\":[\"japanese\"],\"れきだい\":[\"japanese\"],\"れんあい\":[\"japanese\"],\"れんけい\":[\"japanese\"],\"れんこん\":[\"japanese\"],\"れんさい\":[\"japanese\"],\"れんしゅう\":[\"japanese\"],\"れんぞく\":[\"japanese\"],\"れんらく\":[\"japanese\"],\"ろうか\":[\"japanese\"],\"ろうご\":[\"japanese\"],\"ろうじん\":[\"japanese\"],\"ろうそく\":[\"japanese\"],\"ろくが\":[\"japanese\"],\"ろこつ\":[\"japanese\"],\"ろじうら\":[\"japanese\"],\"ろしゅつ\":[\"japanese\"],\"ろせん\":[\"japanese\"],\"ろてん\":[\"japanese\"],\"ろめん\":[\"japanese\"],\"ろれつ\":[\"japanese\"],\"ろんぎ\":[\"japanese\"],\"ろんぱ\":[\"japanese\"],\"ろんぶん\":[\"japanese\"],\"ろんり\":[\"japanese\"],\"わかす\":[\"japanese\"],\"わかめ\":[\"japanese\"],\"わかやま\":[\"japanese\"],\"わかれる\":[\"japanese\"],\"わしつ\":[\"japanese\"],\"わじまし\":[\"japanese\"],\"わすれもの\":[\"japanese\"],\"わらう\":[\"japanese\"],\"われる\":[\"japanese\"],\"가격\":[\"korean\"],\"가끔\":[\"korean\"],\"가난\":[\"korean\"],\"가능\":[\"korean\"],\"가득\":[\"korean\"],\"가르침\":[\"korean\"],\"가뭄\":[\"korean\"],\"가방\":[\"korean\"],\"가상\":[\"korean\"],\"가슴\":[\"korean\"],\"가운데\":[\"korean\"],\"가을\":[\"korean\"],\"가이드\":[\"korean\"],\"가입\":[\"korean\"],\"가장\":[\"korean\"],\"가정\":[\"korean\"],\"가족\":[\"korean\"],\"가죽\":[\"korean\"],\"각오\":[\"korean\"],\"각자\":[\"korean\"],\"간격\":[\"korean\"],\"간부\":[\"korean\"],\"간섭\":[\"korean\"],\"간장\":[\"korean\"],\"간접\":[\"korean\"],\"간판\":[\"korean\"],\"갈등\":[\"korean\"],\"갈비\":[\"korean\"],\"갈색\":[\"korean\"],\"갈증\":[\"korean\"],\"감각\":[\"korean\"],\"감기\":[\"korean\"],\"감소\":[\"korean\"],\"감수성\":[\"korean\"],\"감자\":[\"korean\"],\"감정\":[\"korean\"],\"갑자기\":[\"korean\"],\"강남\":[\"korean\"],\"강당\":[\"korean\"],\"강도\":[\"korean\"],\"강력히\":[\"korean\"],\"강변\":[\"korean\"],\"강북\":[\"korean\"],\"강사\":[\"korean\"],\"강수량\":[\"korean\"],\"강아지\":[\"korean\"],\"강원도\":[\"korean\"],\"강의\":[\"korean\"],\"강제\":[\"korean\"],\"강조\":[\"korean\"],\"같이\":[\"korean\"],\"개구리\":[\"korean\"],\"개나리\":[\"korean\"],\"개방\":[\"korean\"],\"개별\":[\"korean\"],\"개선\":[\"korean\"],\"개성\":[\"korean\"],\"개인\":[\"korean\"],\"객관적\":[\"korean\"],\"거실\":[\"korean\"],\"거액\":[\"korean\"],\"거울\":[\"korean\"],\"거짓\":[\"korean\"],\"거품\":[\"korean\"],\"걱정\":[\"korean\"],\"건강\":[\"korean\"],\"건물\":[\"korean\"],\"건설\":[\"korean\"],\"건조\":[\"korean\"],\"건축\":[\"korean\"],\"걸음\":[\"korean\"],\"검사\":[\"korean\"],\"검토\":[\"korean\"],\"게시판\":[\"korean\"],\"게임\":[\"korean\"],\"겨울\":[\"korean\"],\"견해\":[\"korean\"],\"결과\":[\"korean\"],\"결국\":[\"korean\"],\"결론\":[\"korean\"],\"결석\":[\"korean\"],\"결승\":[\"korean\"],\"결심\":[\"korean\"],\"결정\":[\"korean\"],\"결혼\":[\"korean\"],\"경계\":[\"korean\"],\"경고\":[\"korean\"],\"경기\":[\"korean\"],\"경력\":[\"korean\"],\"경복궁\":[\"korean\"],\"경비\":[\"korean\"],\"경상도\":[\"korean\"],\"경영\":[\"korean\"],\"경우\":[\"korean\"],\"경쟁\":[\"korean\"],\"경제\":[\"korean\"],\"경주\":[\"korean\"],\"경찰\":[\"korean\"],\"경치\":[\"korean\"],\"경향\":[\"korean\"],\"경험\":[\"korean\"],\"계곡\":[\"korean\"],\"계단\":[\"korean\"],\"계란\":[\"korean\"],\"계산\":[\"korean\"],\"계속\":[\"korean\"],\"계약\":[\"korean\"],\"계절\":[\"korean\"],\"계층\":[\"korean\"],\"계획\":[\"korean\"],\"고객\":[\"korean\"],\"고구려\":[\"korean\"],\"고궁\":[\"korean\"],\"고급\":[\"korean\"],\"고등학생\":[\"korean\"],\"고무신\":[\"korean\"],\"고민\":[\"korean\"],\"고양이\":[\"korean\"],\"고장\":[\"korean\"],\"고전\":[\"korean\"],\"고집\":[\"korean\"],\"고춧가루\":[\"korean\"],\"고통\":[\"korean\"],\"고향\":[\"korean\"],\"곡식\":[\"korean\"],\"골목\":[\"korean\"],\"골짜기\":[\"korean\"],\"골프\":[\"korean\"],\"공간\":[\"korean\"],\"공개\":[\"korean\"],\"공격\":[\"korean\"],\"공군\":[\"korean\"],\"공급\":[\"korean\"],\"공기\":[\"korean\"],\"공동\":[\"korean\"],\"공무원\":[\"korean\"],\"공부\":[\"korean\"],\"공사\":[\"korean\"],\"공식\":[\"korean\"],\"공업\":[\"korean\"],\"공연\":[\"korean\"],\"공원\":[\"korean\"],\"공장\":[\"korean\"],\"공짜\":[\"korean\"],\"공책\":[\"korean\"],\"공통\":[\"korean\"],\"공포\":[\"korean\"],\"공항\":[\"korean\"],\"공휴일\":[\"korean\"],\"과목\":[\"korean\"],\"과일\":[\"korean\"],\"과장\":[\"korean\"],\"과정\":[\"korean\"],\"과학\":[\"korean\"],\"관객\":[\"korean\"],\"관계\":[\"korean\"],\"관광\":[\"korean\"],\"관념\":[\"korean\"],\"관람\":[\"korean\"],\"관련\":[\"korean\"],\"관리\":[\"korean\"],\"관습\":[\"korean\"],\"관심\":[\"korean\"],\"관점\":[\"korean\"],\"관찰\":[\"korean\"],\"광경\":[\"korean\"],\"광고\":[\"korean\"],\"광장\":[\"korean\"],\"광주\":[\"korean\"],\"괴로움\":[\"korean\"],\"굉장히\":[\"korean\"],\"교과서\":[\"korean\"],\"교문\":[\"korean\"],\"교복\":[\"korean\"],\"교실\":[\"korean\"],\"교양\":[\"korean\"],\"교육\":[\"korean\"],\"교장\":[\"korean\"],\"교직\":[\"korean\"],\"교통\":[\"korean\"],\"교환\":[\"korean\"],\"교훈\":[\"korean\"],\"구경\":[\"korean\"],\"구름\":[\"korean\"],\"구멍\":[\"korean\"],\"구별\":[\"korean\"],\"구분\":[\"korean\"],\"구석\":[\"korean\"],\"구성\":[\"korean\"],\"구속\":[\"korean\"],\"구역\":[\"korean\"],\"구입\":[\"korean\"],\"구청\":[\"korean\"],\"구체적\":[\"korean\"],\"국가\":[\"korean\"],\"국기\":[\"korean\"],\"국내\":[\"korean\"],\"국립\":[\"korean\"],\"국물\":[\"korean\"],\"국민\":[\"korean\"],\"국수\":[\"korean\"],\"국어\":[\"korean\"],\"국왕\":[\"korean\"],\"국적\":[\"korean\"],\"국제\":[\"korean\"],\"국회\":[\"korean\"],\"군대\":[\"korean\"],\"군사\":[\"korean\"],\"군인\":[\"korean\"],\"궁극적\":[\"korean\"],\"권리\":[\"korean\"],\"권위\":[\"korean\"],\"권투\":[\"korean\"],\"귀국\":[\"korean\"],\"귀신\":[\"korean\"],\"규정\":[\"korean\"],\"규칙\":[\"korean\"],\"균형\":[\"korean\"],\"그날\":[\"korean\"],\"그냥\":[\"korean\"],\"그늘\":[\"korean\"],\"그러나\":[\"korean\"],\"그룹\":[\"korean\"],\"그릇\":[\"korean\"],\"그림\":[\"korean\"],\"그제서야\":[\"korean\"],\"그토록\":[\"korean\"],\"극복\":[\"korean\"],\"극히\":[\"korean\"],\"근거\":[\"korean\"],\"근교\":[\"korean\"],\"근래\":[\"korean\"],\"근로\":[\"korean\"],\"근무\":[\"korean\"],\"근본\":[\"korean\"],\"근원\":[\"korean\"],\"근육\":[\"korean\"],\"근처\":[\"korean\"],\"글씨\":[\"korean\"],\"글자\":[\"korean\"],\"금강산\":[\"korean\"],\"금고\":[\"korean\"],\"금년\":[\"korean\"],\"금메달\":[\"korean\"],\"금액\":[\"korean\"],\"금연\":[\"korean\"],\"금요일\":[\"korean\"],\"금지\":[\"korean\"],\"긍정적\":[\"korean\"],\"기간\":[\"korean\"],\"기관\":[\"korean\"],\"기념\":[\"korean\"],\"기능\":[\"korean\"],\"기독교\":[\"korean\"],\"기둥\":[\"korean\"],\"기록\":[\"korean\"],\"기름\":[\"korean\"],\"기법\":[\"korean\"],\"기본\":[\"korean\"],\"기분\":[\"korean\"],\"기쁨\":[\"korean\"],\"기숙사\":[\"korean\"],\"기술\":[\"korean\"],\"기억\":[\"korean\"],\"기업\":[\"korean\"],\"기온\":[\"korean\"],\"기운\":[\"korean\"],\"기원\":[\"korean\"],\"기적\":[\"korean\"],\"기준\":[\"korean\"],\"기침\":[\"korean\"],\"기혼\":[\"korean\"],\"기획\":[\"korean\"],\"긴급\":[\"korean\"],\"긴장\":[\"korean\"],\"길이\":[\"korean\"],\"김밥\":[\"korean\"],\"김치\":[\"korean\"],\"김포공항\":[\"korean\"],\"깍두기\":[\"korean\"],\"깜빡\":[\"korean\"],\"깨달음\":[\"korean\"],\"깨소금\":[\"korean\"],\"껍질\":[\"korean\"],\"꼭대기\":[\"korean\"],\"꽃잎\":[\"korean\"],\"나들이\":[\"korean\"],\"나란히\":[\"korean\"],\"나머지\":[\"korean\"],\"나물\":[\"korean\"],\"나침반\":[\"korean\"],\"나흘\":[\"korean\"],\"낙엽\":[\"korean\"],\"난방\":[\"korean\"],\"날개\":[\"korean\"],\"날씨\":[\"korean\"],\"날짜\":[\"korean\"],\"남녀\":[\"korean\"],\"남대문\":[\"korean\"],\"남매\":[\"korean\"],\"남산\":[\"korean\"],\"남자\":[\"korean\"],\"남편\":[\"korean\"],\"남학생\":[\"korean\"],\"낭비\":[\"korean\"],\"낱말\":[\"korean\"],\"내년\":[\"korean\"],\"내용\":[\"korean\"],\"내일\":[\"korean\"],\"냄비\":[\"korean\"],\"냄새\":[\"korean\"],\"냇물\":[\"korean\"],\"냉동\":[\"korean\"],\"냉면\":[\"korean\"],\"냉방\":[\"korean\"],\"냉장고\":[\"korean\"],\"넥타이\":[\"korean\"],\"넷째\":[\"korean\"],\"노동\":[\"korean\"],\"노란색\":[\"korean\"],\"노력\":[\"korean\"],\"노인\":[\"korean\"],\"녹음\":[\"korean\"],\"녹차\":[\"korean\"],\"녹화\":[\"korean\"],\"논리\":[\"korean\"],\"논문\":[\"korean\"],\"논쟁\":[\"korean\"],\"놀이\":[\"korean\"],\"농구\":[\"korean\"],\"농담\":[\"korean\"],\"농민\":[\"korean\"],\"농부\":[\"korean\"],\"농업\":[\"korean\"],\"농장\":[\"korean\"],\"농촌\":[\"korean\"],\"높이\":[\"korean\"],\"눈동자\":[\"korean\"],\"눈물\":[\"korean\"],\"눈썹\":[\"korean\"],\"뉴욕\":[\"korean\"],\"느낌\":[\"korean\"],\"늑대\":[\"korean\"],\"능동적\":[\"korean\"],\"능력\":[\"korean\"],\"다방\":[\"korean\"],\"다양성\":[\"korean\"],\"다음\":[\"korean\"],\"다이어트\":[\"korean\"],\"다행\":[\"korean\"],\"단계\":[\"korean\"],\"단골\":[\"korean\"],\"단독\":[\"korean\"],\"단맛\":[\"korean\"],\"단순\":[\"korean\"],\"단어\":[\"korean\"],\"단위\":[\"korean\"],\"단점\":[\"korean\"],\"단체\":[\"korean\"],\"단추\":[\"korean\"],\"단편\":[\"korean\"],\"단풍\":[\"korean\"],\"달걀\":[\"korean\"],\"달러\":[\"korean\"],\"달력\":[\"korean\"],\"달리\":[\"korean\"],\"닭고기\":[\"korean\"],\"담당\":[\"korean\"],\"담배\":[\"korean\"],\"담요\":[\"korean\"],\"담임\":[\"korean\"],\"답변\":[\"korean\"],\"답장\":[\"korean\"],\"당근\":[\"korean\"],\"당분간\":[\"korean\"],\"당연히\":[\"korean\"],\"당장\":[\"korean\"],\"대규모\":[\"korean\"],\"대낮\":[\"korean\"],\"대단히\":[\"korean\"],\"대답\":[\"korean\"],\"대도시\":[\"korean\"],\"대략\":[\"korean\"],\"대량\":[\"korean\"],\"대륙\":[\"korean\"],\"대문\":[\"korean\"],\"대부분\":[\"korean\"],\"대신\":[\"korean\"],\"대응\":[\"korean\"],\"대장\":[\"korean\"],\"대전\":[\"korean\"],\"대접\":[\"korean\"],\"대중\":[\"korean\"],\"대책\":[\"korean\"],\"대출\":[\"korean\"],\"대충\":[\"korean\"],\"대통령\":[\"korean\"],\"대학\":[\"korean\"],\"대한민국\":[\"korean\"],\"대합실\":[\"korean\"],\"대형\":[\"korean\"],\"덩어리\":[\"korean\"],\"데이트\":[\"korean\"],\"도대체\":[\"korean\"],\"도덕\":[\"korean\"],\"도둑\":[\"korean\"],\"도망\":[\"korean\"],\"도서관\":[\"korean\"],\"도심\":[\"korean\"],\"도움\":[\"korean\"],\"도입\":[\"korean\"],\"도자기\":[\"korean\"],\"도저히\":[\"korean\"],\"도전\":[\"korean\"],\"도중\":[\"korean\"],\"도착\":[\"korean\"],\"독감\":[\"korean\"],\"독립\":[\"korean\"],\"독서\":[\"korean\"],\"독일\":[\"korean\"],\"독창적\":[\"korean\"],\"동화책\":[\"korean\"],\"뒷모습\":[\"korean\"],\"뒷산\":[\"korean\"],\"딸아이\":[\"korean\"],\"마누라\":[\"korean\"],\"마늘\":[\"korean\"],\"마당\":[\"korean\"],\"마라톤\":[\"korean\"],\"마련\":[\"korean\"],\"마무리\":[\"korean\"],\"마사지\":[\"korean\"],\"마약\":[\"korean\"],\"마요네즈\":[\"korean\"],\"마을\":[\"korean\"],\"마음\":[\"korean\"],\"마이크\":[\"korean\"],\"마중\":[\"korean\"],\"마지막\":[\"korean\"],\"마찬가지\":[\"korean\"],\"마찰\":[\"korean\"],\"마흔\":[\"korean\"],\"막걸리\":[\"korean\"],\"막내\":[\"korean\"],\"막상\":[\"korean\"],\"만남\":[\"korean\"],\"만두\":[\"korean\"],\"만세\":[\"korean\"],\"만약\":[\"korean\"],\"만일\":[\"korean\"],\"만점\":[\"korean\"],\"만족\":[\"korean\"],\"만화\":[\"korean\"],\"많이\":[\"korean\"],\"말기\":[\"korean\"],\"말씀\":[\"korean\"],\"말투\":[\"korean\"],\"맘대로\":[\"korean\"],\"망원경\":[\"korean\"],\"매년\":[\"korean\"],\"매달\":[\"korean\"],\"매력\":[\"korean\"],\"매번\":[\"korean\"],\"매스컴\":[\"korean\"],\"매일\":[\"korean\"],\"매장\":[\"korean\"],\"맥주\":[\"korean\"],\"먹이\":[\"korean\"],\"먼저\":[\"korean\"],\"먼지\":[\"korean\"],\"멀리\":[\"korean\"],\"메일\":[\"korean\"],\"며느리\":[\"korean\"],\"며칠\":[\"korean\"],\"면담\":[\"korean\"],\"멸치\":[\"korean\"],\"명단\":[\"korean\"],\"명령\":[\"korean\"],\"명예\":[\"korean\"],\"명의\":[\"korean\"],\"명절\":[\"korean\"],\"명칭\":[\"korean\"],\"명함\":[\"korean\"],\"모금\":[\"korean\"],\"모니터\":[\"korean\"],\"모델\":[\"korean\"],\"모든\":[\"korean\"],\"모범\":[\"korean\"],\"모습\":[\"korean\"],\"모양\":[\"korean\"],\"모임\":[\"korean\"],\"모조리\":[\"korean\"],\"모집\":[\"korean\"],\"모퉁이\":[\"korean\"],\"목걸이\":[\"korean\"],\"목록\":[\"korean\"],\"목사\":[\"korean\"],\"목소리\":[\"korean\"],\"목숨\":[\"korean\"],\"목적\":[\"korean\"],\"목표\":[\"korean\"],\"몰래\":[\"korean\"],\"몸매\":[\"korean\"],\"몸무게\":[\"korean\"],\"몸살\":[\"korean\"],\"몸속\":[\"korean\"],\"몸짓\":[\"korean\"],\"몸통\":[\"korean\"],\"몹시\":[\"korean\"],\"무관심\":[\"korean\"],\"무궁화\":[\"korean\"],\"무더위\":[\"korean\"],\"무덤\":[\"korean\"],\"무릎\":[\"korean\"],\"무슨\":[\"korean\"],\"무엇\":[\"korean\"],\"무역\":[\"korean\"],\"무용\":[\"korean\"],\"무조건\":[\"korean\"],\"무지개\":[\"korean\"],\"무척\":[\"korean\"],\"문구\":[\"korean\"],\"문득\":[\"korean\"],\"문법\":[\"korean\"],\"문서\":[\"korean\"],\"문제\":[\"korean\"],\"문학\":[\"korean\"],\"문화\":[\"korean\"],\"물가\":[\"korean\"],\"물건\":[\"korean\"],\"물결\":[\"korean\"],\"물고기\":[\"korean\"],\"물론\":[\"korean\"],\"물리학\":[\"korean\"],\"물음\":[\"korean\"],\"물질\":[\"korean\"],\"물체\":[\"korean\"],\"미국\":[\"korean\"],\"미디어\":[\"korean\"],\"미사일\":[\"korean\"],\"미술\":[\"korean\"],\"미역\":[\"korean\"],\"미용실\":[\"korean\"],\"미움\":[\"korean\"],\"미인\":[\"korean\"],\"미팅\":[\"korean\"],\"미혼\":[\"korean\"],\"민간\":[\"korean\"],\"민족\":[\"korean\"],\"민주\":[\"korean\"],\"믿음\":[\"korean\"],\"밀가루\":[\"korean\"],\"밀리미터\":[\"korean\"],\"밑바닥\":[\"korean\"],\"바가지\":[\"korean\"],\"바구니\":[\"korean\"],\"바나나\":[\"korean\"],\"바늘\":[\"korean\"],\"바닥\":[\"korean\"],\"바닷가\":[\"korean\"],\"바람\":[\"korean\"],\"바이러스\":[\"korean\"],\"바탕\":[\"korean\"],\"박물관\":[\"korean\"],\"박사\":[\"korean\"],\"박수\":[\"korean\"],\"반대\":[\"korean\"],\"반드시\":[\"korean\"],\"반말\":[\"korean\"],\"반발\":[\"korean\"],\"반성\":[\"korean\"],\"반응\":[\"korean\"],\"반장\":[\"korean\"],\"반죽\":[\"korean\"],\"반지\":[\"korean\"],\"반찬\":[\"korean\"],\"받침\":[\"korean\"],\"발가락\":[\"korean\"],\"발걸음\":[\"korean\"],\"발견\":[\"korean\"],\"발달\":[\"korean\"],\"발레\":[\"korean\"],\"발목\":[\"korean\"],\"발바닥\":[\"korean\"],\"발생\":[\"korean\"],\"발음\":[\"korean\"],\"발자국\":[\"korean\"],\"발전\":[\"korean\"],\"발톱\":[\"korean\"],\"발표\":[\"korean\"],\"밤하늘\":[\"korean\"],\"밥그릇\":[\"korean\"],\"밥맛\":[\"korean\"],\"밥상\":[\"korean\"],\"밥솥\":[\"korean\"],\"방금\":[\"korean\"],\"방면\":[\"korean\"],\"방문\":[\"korean\"],\"방바닥\":[\"korean\"],\"방법\":[\"korean\"],\"방송\":[\"korean\"],\"방식\":[\"korean\"],\"방안\":[\"korean\"],\"방울\":[\"korean\"],\"방지\":[\"korean\"],\"방학\":[\"korean\"],\"방해\":[\"korean\"],\"방향\":[\"korean\"],\"배경\":[\"korean\"],\"배꼽\":[\"korean\"],\"배달\":[\"korean\"],\"배드민턴\":[\"korean\"],\"백두산\":[\"korean\"],\"백색\":[\"korean\"],\"백성\":[\"korean\"],\"백인\":[\"korean\"],\"백제\":[\"korean\"],\"백화점\":[\"korean\"],\"버릇\":[\"korean\"],\"버섯\":[\"korean\"],\"버튼\":[\"korean\"],\"번개\":[\"korean\"],\"번역\":[\"korean\"],\"번지\":[\"korean\"],\"번호\":[\"korean\"],\"벌금\":[\"korean\"],\"벌레\":[\"korean\"],\"벌써\":[\"korean\"],\"범위\":[\"korean\"],\"범인\":[\"korean\"],\"범죄\":[\"korean\"],\"법률\":[\"korean\"],\"법원\":[\"korean\"],\"법적\":[\"korean\"],\"법칙\":[\"korean\"],\"베이징\":[\"korean\"],\"벨트\":[\"korean\"],\"변경\":[\"korean\"],\"변동\":[\"korean\"],\"변명\":[\"korean\"],\"변신\":[\"korean\"],\"변호사\":[\"korean\"],\"변화\":[\"korean\"],\"별도\":[\"korean\"],\"별명\":[\"korean\"],\"별일\":[\"korean\"],\"병실\":[\"korean\"],\"병아리\":[\"korean\"],\"병원\":[\"korean\"],\"보관\":[\"korean\"],\"보너스\":[\"korean\"],\"보라색\":[\"korean\"],\"보람\":[\"korean\"],\"보름\":[\"korean\"],\"보상\":[\"korean\"],\"보안\":[\"korean\"],\"보자기\":[\"korean\"],\"보장\":[\"korean\"],\"보전\":[\"korean\"],\"보존\":[\"korean\"],\"보통\":[\"korean\"],\"보편적\":[\"korean\"],\"보험\":[\"korean\"],\"복도\":[\"korean\"],\"복사\":[\"korean\"],\"복숭아\":[\"korean\"],\"복습\":[\"korean\"],\"볶음\":[\"korean\"],\"본격적\":[\"korean\"],\"본래\":[\"korean\"],\"본부\":[\"korean\"],\"본사\":[\"korean\"],\"본성\":[\"korean\"],\"본인\":[\"korean\"],\"본질\":[\"korean\"],\"볼펜\":[\"korean\"],\"봉사\":[\"korean\"],\"봉지\":[\"korean\"],\"봉투\":[\"korean\"],\"부근\":[\"korean\"],\"부끄러움\":[\"korean\"],\"부담\":[\"korean\"],\"부동산\":[\"korean\"],\"부문\":[\"korean\"],\"부분\":[\"korean\"],\"부산\":[\"korean\"],\"부상\":[\"korean\"],\"부엌\":[\"korean\"],\"부인\":[\"korean\"],\"부작용\":[\"korean\"],\"부장\":[\"korean\"],\"부정\":[\"korean\"],\"부족\":[\"korean\"],\"부지런히\":[\"korean\"],\"부친\":[\"korean\"],\"부탁\":[\"korean\"],\"부품\":[\"korean\"],\"부회장\":[\"korean\"],\"북부\":[\"korean\"],\"북한\":[\"korean\"],\"분노\":[\"korean\"],\"분량\":[\"korean\"],\"분리\":[\"korean\"],\"분명\":[\"korean\"],\"분석\":[\"korean\"],\"분야\":[\"korean\"],\"분위기\":[\"korean\"],\"분필\":[\"korean\"],\"분홍색\":[\"korean\"],\"불고기\":[\"korean\"],\"불과\":[\"korean\"],\"불교\":[\"korean\"],\"불꽃\":[\"korean\"],\"불만\":[\"korean\"],\"불법\":[\"korean\"],\"불빛\":[\"korean\"],\"불안\":[\"korean\"],\"불이익\":[\"korean\"],\"불행\":[\"korean\"],\"브랜드\":[\"korean\"],\"비극\":[\"korean\"],\"비난\":[\"korean\"],\"비닐\":[\"korean\"],\"비둘기\":[\"korean\"],\"비디오\":[\"korean\"],\"비로소\":[\"korean\"],\"비만\":[\"korean\"],\"비명\":[\"korean\"],\"비밀\":[\"korean\"],\"비바람\":[\"korean\"],\"비빔밥\":[\"korean\"],\"비상\":[\"korean\"],\"비용\":[\"korean\"],\"비율\":[\"korean\"],\"비중\":[\"korean\"],\"비타민\":[\"korean\"],\"비판\":[\"korean\"],\"빌딩\":[\"korean\"],\"빗물\":[\"korean\"],\"빗방울\":[\"korean\"],\"빗줄기\":[\"korean\"],\"빛깔\":[\"korean\"],\"빨간색\":[\"korean\"],\"빨래\":[\"korean\"],\"빨리\":[\"korean\"],\"사건\":[\"korean\"],\"사계절\":[\"korean\"],\"사나이\":[\"korean\"],\"사냥\":[\"korean\"],\"사람\":[\"korean\"],\"사랑\":[\"korean\"],\"사립\":[\"korean\"],\"사모님\":[\"korean\"],\"사물\":[\"korean\"],\"사방\":[\"korean\"],\"사상\":[\"korean\"],\"사생활\":[\"korean\"],\"사설\":[\"korean\"],\"사슴\":[\"korean\"],\"사실\":[\"korean\"],\"사업\":[\"korean\"],\"사용\":[\"korean\"],\"사월\":[\"korean\"],\"사장\":[\"korean\"],\"사전\":[\"korean\"],\"사진\":[\"korean\"],\"사촌\":[\"korean\"],\"사춘기\":[\"korean\"],\"사탕\":[\"korean\"],\"사투리\":[\"korean\"],\"사흘\":[\"korean\"],\"산길\":[\"korean\"],\"산부인과\":[\"korean\"],\"산업\":[\"korean\"],\"산책\":[\"korean\"],\"살림\":[\"korean\"],\"살인\":[\"korean\"],\"살짝\":[\"korean\"],\"삼계탕\":[\"korean\"],\"삼국\":[\"korean\"],\"삼십\":[\"korean\"],\"삼월\":[\"korean\"],\"삼촌\":[\"korean\"],\"상관\":[\"korean\"],\"상금\":[\"korean\"],\"상대\":[\"korean\"],\"상류\":[\"korean\"],\"상반기\":[\"korean\"],\"상상\":[\"korean\"],\"상식\":[\"korean\"],\"상업\":[\"korean\"],\"상인\":[\"korean\"],\"상자\":[\"korean\"],\"상점\":[\"korean\"],\"상처\":[\"korean\"],\"상추\":[\"korean\"],\"상태\":[\"korean\"],\"상표\":[\"korean\"],\"상품\":[\"korean\"],\"상황\":[\"korean\"],\"새벽\":[\"korean\"],\"색깔\":[\"korean\"],\"색연필\":[\"korean\"],\"생각\":[\"korean\"],\"생명\":[\"korean\"],\"생물\":[\"korean\"],\"생방송\":[\"korean\"],\"생산\":[\"korean\"],\"생선\":[\"korean\"],\"생신\":[\"korean\"],\"생일\":[\"korean\"],\"생활\":[\"korean\"],\"서랍\":[\"korean\"],\"서른\":[\"korean\"],\"서명\":[\"korean\"],\"서민\":[\"korean\"],\"서비스\":[\"korean\"],\"서양\":[\"korean\"],\"서울\":[\"korean\"],\"서적\":[\"korean\"],\"서점\":[\"korean\"],\"서쪽\":[\"korean\"],\"서클\":[\"korean\"],\"석사\":[\"korean\"],\"석유\":[\"korean\"],\"선거\":[\"korean\"],\"선물\":[\"korean\"],\"선배\":[\"korean\"],\"선생\":[\"korean\"],\"선수\":[\"korean\"],\"선원\":[\"korean\"],\"선장\":[\"korean\"],\"선전\":[\"korean\"],\"선택\":[\"korean\"],\"선풍기\":[\"korean\"],\"설거지\":[\"korean\"],\"설날\":[\"korean\"],\"설렁탕\":[\"korean\"],\"설명\":[\"korean\"],\"설문\":[\"korean\"],\"설사\":[\"korean\"],\"설악산\":[\"korean\"],\"설치\":[\"korean\"],\"설탕\":[\"korean\"],\"섭씨\":[\"korean\"],\"성공\":[\"korean\"],\"성당\":[\"korean\"],\"성명\":[\"korean\"],\"성별\":[\"korean\"],\"성인\":[\"korean\"],\"성장\":[\"korean\"],\"성적\":[\"korean\"],\"성질\":[\"korean\"],\"성함\":[\"korean\"],\"세금\":[\"korean\"],\"세미나\":[\"korean\"],\"세상\":[\"korean\"],\"세월\":[\"korean\"],\"세종대왕\":[\"korean\"],\"세탁\":[\"korean\"],\"센터\":[\"korean\"],\"센티미터\":[\"korean\"],\"셋째\":[\"korean\"],\"소규모\":[\"korean\"],\"소극적\":[\"korean\"],\"소금\":[\"korean\"],\"소나기\":[\"korean\"],\"소년\":[\"korean\"],\"소득\":[\"korean\"],\"소망\":[\"korean\"],\"소문\":[\"korean\"],\"소설\":[\"korean\"],\"소속\":[\"korean\"],\"소아과\":[\"korean\"],\"소용\":[\"korean\"],\"소원\":[\"korean\"],\"소음\":[\"korean\"],\"소중히\":[\"korean\"],\"소지품\":[\"korean\"],\"소질\":[\"korean\"],\"소풍\":[\"korean\"],\"소형\":[\"korean\"],\"속담\":[\"korean\"],\"속도\":[\"korean\"],\"속옷\":[\"korean\"],\"손가락\":[\"korean\"],\"손길\":[\"korean\"],\"손녀\":[\"korean\"],\"손님\":[\"korean\"],\"손등\":[\"korean\"],\"손목\":[\"korean\"],\"손뼉\":[\"korean\"],\"손실\":[\"korean\"],\"손질\":[\"korean\"],\"손톱\":[\"korean\"],\"손해\":[\"korean\"],\"솔직히\":[\"korean\"],\"솜씨\":[\"korean\"],\"송아지\":[\"korean\"],\"송이\":[\"korean\"],\"송편\":[\"korean\"],\"쇠고기\":[\"korean\"],\"쇼핑\":[\"korean\"],\"수건\":[\"korean\"],\"수년\":[\"korean\"],\"수단\":[\"korean\"],\"수돗물\":[\"korean\"],\"수동적\":[\"korean\"],\"수면\":[\"korean\"],\"수명\":[\"korean\"],\"수박\":[\"korean\"],\"수상\":[\"korean\"],\"수석\":[\"korean\"],\"수술\":[\"korean\"],\"수시로\":[\"korean\"],\"수업\":[\"korean\"],\"수염\":[\"korean\"],\"수영\":[\"korean\"],\"수입\":[\"korean\"],\"수준\":[\"korean\"],\"수집\":[\"korean\"],\"수출\":[\"korean\"],\"수컷\":[\"korean\"],\"수필\":[\"korean\"],\"수학\":[\"korean\"],\"수험생\":[\"korean\"],\"수화기\":[\"korean\"],\"숙녀\":[\"korean\"],\"숙소\":[\"korean\"],\"숙제\":[\"korean\"],\"순간\":[\"korean\"],\"순서\":[\"korean\"],\"순수\":[\"korean\"],\"순식간\":[\"korean\"],\"순위\":[\"korean\"],\"숟가락\":[\"korean\"],\"술병\":[\"korean\"],\"술집\":[\"korean\"],\"숫자\":[\"korean\"],\"스님\":[\"korean\"],\"스물\":[\"korean\"],\"스스로\":[\"korean\"],\"스승\":[\"korean\"],\"스웨터\":[\"korean\"],\"스위치\":[\"korean\"],\"스케이트\":[\"korean\"],\"스튜디오\":[\"korean\"],\"스트레스\":[\"korean\"],\"스포츠\":[\"korean\"],\"슬쩍\":[\"korean\"],\"슬픔\":[\"korean\"],\"습관\":[\"korean\"],\"습기\":[\"korean\"],\"승객\":[\"korean\"],\"승리\":[\"korean\"],\"승부\":[\"korean\"],\"승용차\":[\"korean\"],\"승진\":[\"korean\"],\"시각\":[\"korean\"],\"시간\":[\"korean\"],\"시골\":[\"korean\"],\"시금치\":[\"korean\"],\"시나리오\":[\"korean\"],\"시댁\":[\"korean\"],\"시리즈\":[\"korean\"],\"시멘트\":[\"korean\"],\"시민\":[\"korean\"],\"시부모\":[\"korean\"],\"시선\":[\"korean\"],\"시설\":[\"korean\"],\"시스템\":[\"korean\"],\"시아버지\":[\"korean\"],\"시어머니\":[\"korean\"],\"시월\":[\"korean\"],\"시인\":[\"korean\"],\"시일\":[\"korean\"],\"시작\":[\"korean\"],\"시장\":[\"korean\"],\"시절\":[\"korean\"],\"시점\":[\"korean\"],\"시중\":[\"korean\"],\"시즌\":[\"korean\"],\"시집\":[\"korean\"],\"시청\":[\"korean\"],\"시합\":[\"korean\"],\"시험\":[\"korean\"],\"식구\":[\"korean\"],\"식기\":[\"korean\"],\"식당\":[\"korean\"],\"식량\":[\"korean\"],\"식료품\":[\"korean\"],\"식물\":[\"korean\"],\"식빵\":[\"korean\"],\"식사\":[\"korean\"],\"식생활\":[\"korean\"],\"식초\":[\"korean\"],\"식탁\":[\"korean\"],\"식품\":[\"korean\"],\"신고\":[\"korean\"],\"신규\":[\"korean\"],\"신념\":[\"korean\"],\"신문\":[\"korean\"],\"신발\":[\"korean\"],\"신비\":[\"korean\"],\"신사\":[\"korean\"],\"신세\":[\"korean\"],\"신용\":[\"korean\"],\"신제품\":[\"korean\"],\"신청\":[\"korean\"],\"신체\":[\"korean\"],\"신화\":[\"korean\"],\"실감\":[\"korean\"],\"실내\":[\"korean\"],\"실력\":[\"korean\"],\"실례\":[\"korean\"],\"실망\":[\"korean\"],\"실수\":[\"korean\"],\"실습\":[\"korean\"],\"실시\":[\"korean\"],\"실장\":[\"korean\"],\"실정\":[\"korean\"],\"실질적\":[\"korean\"],\"실천\":[\"korean\"],\"실체\":[\"korean\"],\"실컷\":[\"korean\"],\"실태\":[\"korean\"],\"실패\":[\"korean\"],\"실험\":[\"korean\"],\"실현\":[\"korean\"],\"심리\":[\"korean\"],\"심부름\":[\"korean\"],\"심사\":[\"korean\"],\"심장\":[\"korean\"],\"심정\":[\"korean\"],\"심판\":[\"korean\"],\"쌍둥이\":[\"korean\"],\"씨름\":[\"korean\"],\"씨앗\":[\"korean\"],\"아가씨\":[\"korean\"],\"아나운서\":[\"korean\"],\"아드님\":[\"korean\"],\"아들\":[\"korean\"],\"아쉬움\":[\"korean\"],\"아스팔트\":[\"korean\"],\"아시아\":[\"korean\"],\"아울러\":[\"korean\"],\"아저씨\":[\"korean\"],\"아줌마\":[\"korean\"],\"아직\":[\"korean\"],\"아침\":[\"korean\"],\"아파트\":[\"korean\"],\"아프리카\":[\"korean\"],\"아픔\":[\"korean\"],\"아홉\":[\"korean\"],\"아흔\":[\"korean\"],\"악기\":[\"korean\"],\"악몽\":[\"korean\"],\"악수\":[\"korean\"],\"안개\":[\"korean\"],\"안경\":[\"korean\"],\"안과\":[\"korean\"],\"안내\":[\"korean\"],\"안녕\":[\"korean\"],\"안동\":[\"korean\"],\"안방\":[\"korean\"],\"안부\":[\"korean\"],\"안주\":[\"korean\"],\"알루미늄\":[\"korean\"],\"알코올\":[\"korean\"],\"암시\":[\"korean\"],\"암컷\":[\"korean\"],\"압력\":[\"korean\"],\"앞날\":[\"korean\"],\"앞문\":[\"korean\"],\"애인\":[\"korean\"],\"애정\":[\"korean\"],\"액수\":[\"korean\"],\"앨범\":[\"korean\"],\"야간\":[\"korean\"],\"야단\":[\"korean\"],\"야옹\":[\"korean\"],\"약간\":[\"korean\"],\"약국\":[\"korean\"],\"약속\":[\"korean\"],\"약수\":[\"korean\"],\"약점\":[\"korean\"],\"약품\":[\"korean\"],\"약혼녀\":[\"korean\"],\"양념\":[\"korean\"],\"양력\":[\"korean\"],\"양말\":[\"korean\"],\"양배추\":[\"korean\"],\"양주\":[\"korean\"],\"양파\":[\"korean\"],\"어둠\":[\"korean\"],\"어려움\":[\"korean\"],\"어른\":[\"korean\"],\"어젯밤\":[\"korean\"],\"어쨌든\":[\"korean\"],\"어쩌다가\":[\"korean\"],\"어쩐지\":[\"korean\"],\"언니\":[\"korean\"],\"언덕\":[\"korean\"],\"언론\":[\"korean\"],\"언어\":[\"korean\"],\"얼굴\":[\"korean\"],\"얼른\":[\"korean\"],\"얼음\":[\"korean\"],\"얼핏\":[\"korean\"],\"엄마\":[\"korean\"],\"업무\":[\"korean\"],\"업종\":[\"korean\"],\"업체\":[\"korean\"],\"엉덩이\":[\"korean\"],\"엉망\":[\"korean\"],\"엉터리\":[\"korean\"],\"엊그제\":[\"korean\"],\"에너지\":[\"korean\"],\"에어컨\":[\"korean\"],\"엔진\":[\"korean\"],\"여건\":[\"korean\"],\"여고생\":[\"korean\"],\"여관\":[\"korean\"],\"여군\":[\"korean\"],\"여권\":[\"korean\"],\"여대생\":[\"korean\"],\"여덟\":[\"korean\"],\"여동생\":[\"korean\"],\"여든\":[\"korean\"],\"여론\":[\"korean\"],\"여름\":[\"korean\"],\"여섯\":[\"korean\"],\"여성\":[\"korean\"],\"여왕\":[\"korean\"],\"여인\":[\"korean\"],\"여전히\":[\"korean\"],\"여직원\":[\"korean\"],\"여학생\":[\"korean\"],\"여행\":[\"korean\"],\"역사\":[\"korean\"],\"역시\":[\"korean\"],\"역할\":[\"korean\"],\"연결\":[\"korean\"],\"연구\":[\"korean\"],\"연극\":[\"korean\"],\"연기\":[\"korean\"],\"연락\":[\"korean\"],\"연설\":[\"korean\"],\"연세\":[\"korean\"],\"연속\":[\"korean\"],\"연습\":[\"korean\"],\"연애\":[\"korean\"],\"연예인\":[\"korean\"],\"연인\":[\"korean\"],\"연장\":[\"korean\"],\"연주\":[\"korean\"],\"연출\":[\"korean\"],\"연필\":[\"korean\"],\"연합\":[\"korean\"],\"연휴\":[\"korean\"],\"열기\":[\"korean\"],\"열매\":[\"korean\"],\"열쇠\":[\"korean\"],\"열심히\":[\"korean\"],\"열정\":[\"korean\"],\"열차\":[\"korean\"],\"열흘\":[\"korean\"],\"염려\":[\"korean\"],\"엽서\":[\"korean\"],\"영국\":[\"korean\"],\"영남\":[\"korean\"],\"영상\":[\"korean\"],\"영양\":[\"korean\"],\"영역\":[\"korean\"],\"영웅\":[\"korean\"],\"영원히\":[\"korean\"],\"영하\":[\"korean\"],\"영향\":[\"korean\"],\"영혼\":[\"korean\"],\"영화\":[\"korean\"],\"옆구리\":[\"korean\"],\"옆방\":[\"korean\"],\"옆집\":[\"korean\"],\"예감\":[\"korean\"],\"예금\":[\"korean\"],\"예방\":[\"korean\"],\"예산\":[\"korean\"],\"예상\":[\"korean\"],\"예선\":[\"korean\"],\"예술\":[\"korean\"],\"예습\":[\"korean\"],\"예식장\":[\"korean\"],\"예약\":[\"korean\"],\"예전\":[\"korean\"],\"예절\":[\"korean\"],\"예정\":[\"korean\"],\"예컨대\":[\"korean\"],\"옛날\":[\"korean\"],\"오늘\":[\"korean\"],\"오락\":[\"korean\"],\"오랫동안\":[\"korean\"],\"오렌지\":[\"korean\"],\"오로지\":[\"korean\"],\"오른발\":[\"korean\"],\"오븐\":[\"korean\"],\"오십\":[\"korean\"],\"오염\":[\"korean\"],\"오월\":[\"korean\"],\"오전\":[\"korean\"],\"오직\":[\"korean\"],\"오징어\":[\"korean\"],\"오페라\":[\"korean\"],\"오피스텔\":[\"korean\"],\"오히려\":[\"korean\"],\"옥상\":[\"korean\"],\"옥수수\":[\"korean\"],\"온갖\":[\"korean\"],\"온라인\":[\"korean\"],\"온몸\":[\"korean\"],\"온종일\":[\"korean\"],\"온통\":[\"korean\"],\"올가을\":[\"korean\"],\"올림픽\":[\"korean\"],\"올해\":[\"korean\"],\"옷차림\":[\"korean\"],\"와이셔츠\":[\"korean\"],\"와인\":[\"korean\"],\"완성\":[\"korean\"],\"완전\":[\"korean\"],\"왕비\":[\"korean\"],\"왕자\":[\"korean\"],\"왜냐하면\":[\"korean\"],\"왠지\":[\"korean\"],\"외갓집\":[\"korean\"],\"외국\":[\"korean\"],\"외로움\":[\"korean\"],\"외삼촌\":[\"korean\"],\"외출\":[\"korean\"],\"외침\":[\"korean\"],\"외할머니\":[\"korean\"],\"왼발\":[\"korean\"],\"왼손\":[\"korean\"],\"왼쪽\":[\"korean\"],\"요금\":[\"korean\"],\"요일\":[\"korean\"],\"요즘\":[\"korean\"],\"요청\":[\"korean\"],\"용기\":[\"korean\"],\"용서\":[\"korean\"],\"용어\":[\"korean\"],\"우산\":[\"korean\"],\"우선\":[\"korean\"],\"우승\":[\"korean\"],\"우연히\":[\"korean\"],\"우정\":[\"korean\"],\"우체국\":[\"korean\"],\"우편\":[\"korean\"],\"운동\":[\"korean\"],\"운명\":[\"korean\"],\"운반\":[\"korean\"],\"운전\":[\"korean\"],\"운행\":[\"korean\"],\"울산\":[\"korean\"],\"울음\":[\"korean\"],\"움직임\":[\"korean\"],\"웃어른\":[\"korean\"],\"웃음\":[\"korean\"],\"워낙\":[\"korean\"],\"원고\":[\"korean\"],\"원래\":[\"korean\"],\"원서\":[\"korean\"],\"원숭이\":[\"korean\"],\"원인\":[\"korean\"],\"원장\":[\"korean\"],\"원피스\":[\"korean\"],\"월급\":[\"korean\"],\"월드컵\":[\"korean\"],\"월세\":[\"korean\"],\"월요일\":[\"korean\"],\"웨이터\":[\"korean\"],\"위반\":[\"korean\"],\"위법\":[\"korean\"],\"위성\":[\"korean\"],\"위원\":[\"korean\"],\"위험\":[\"korean\"],\"위협\":[\"korean\"],\"윗사람\":[\"korean\"],\"유난히\":[\"korean\"],\"유럽\":[\"korean\"],\"유명\":[\"korean\"],\"유물\":[\"korean\"],\"유산\":[\"korean\"],\"유적\":[\"korean\"],\"유치원\":[\"korean\"],\"유학\":[\"korean\"],\"유행\":[\"korean\"],\"유형\":[\"korean\"],\"육군\":[\"korean\"],\"육상\":[\"korean\"],\"육십\":[\"korean\"],\"육체\":[\"korean\"],\"은행\":[\"korean\"],\"음력\":[\"korean\"],\"음료\":[\"korean\"],\"음반\":[\"korean\"],\"음성\":[\"korean\"],\"음식\":[\"korean\"],\"음악\":[\"korean\"],\"음주\":[\"korean\"],\"의견\":[\"korean\"],\"의논\":[\"korean\"],\"의문\":[\"korean\"],\"의복\":[\"korean\"],\"의식\":[\"korean\"],\"의심\":[\"korean\"],\"의외로\":[\"korean\"],\"의욕\":[\"korean\"],\"의원\":[\"korean\"],\"의학\":[\"korean\"],\"이것\":[\"korean\"],\"이곳\":[\"korean\"],\"이념\":[\"korean\"],\"이놈\":[\"korean\"],\"이달\":[\"korean\"],\"이대로\":[\"korean\"],\"이동\":[\"korean\"],\"이렇게\":[\"korean\"],\"이력서\":[\"korean\"],\"이론적\":[\"korean\"],\"이름\":[\"korean\"],\"이민\":[\"korean\"],\"이발소\":[\"korean\"],\"이별\":[\"korean\"],\"이불\":[\"korean\"],\"이빨\":[\"korean\"],\"이상\":[\"korean\"],\"이성\":[\"korean\"],\"이슬\":[\"korean\"],\"이야기\":[\"korean\"],\"이용\":[\"korean\"],\"이웃\":[\"korean\"],\"이월\":[\"korean\"],\"이윽고\":[\"korean\"],\"이익\":[\"korean\"],\"이전\":[\"korean\"],\"이중\":[\"korean\"],\"이튿날\":[\"korean\"],\"이틀\":[\"korean\"],\"이혼\":[\"korean\"],\"인간\":[\"korean\"],\"인격\":[\"korean\"],\"인공\":[\"korean\"],\"인구\":[\"korean\"],\"인근\":[\"korean\"],\"인기\":[\"korean\"],\"인도\":[\"korean\"],\"인류\":[\"korean\"],\"인물\":[\"korean\"],\"인생\":[\"korean\"],\"인쇄\":[\"korean\"],\"인연\":[\"korean\"],\"인원\":[\"korean\"],\"인재\":[\"korean\"],\"인종\":[\"korean\"],\"인천\":[\"korean\"],\"인체\":[\"korean\"],\"인터넷\":[\"korean\"],\"인하\":[\"korean\"],\"인형\":[\"korean\"],\"일곱\":[\"korean\"],\"일기\":[\"korean\"],\"일단\":[\"korean\"],\"일대\":[\"korean\"],\"일등\":[\"korean\"],\"일반\":[\"korean\"],\"일본\":[\"korean\"],\"일부\":[\"korean\"],\"일상\":[\"korean\"],\"일생\":[\"korean\"],\"일손\":[\"korean\"],\"일요일\":[\"korean\"],\"일월\":[\"korean\"],\"일정\":[\"korean\"],\"일종\":[\"korean\"],\"일주일\":[\"korean\"],\"일찍\":[\"korean\"],\"일체\":[\"korean\"],\"일치\":[\"korean\"],\"일행\":[\"korean\"],\"일회용\":[\"korean\"],\"임금\":[\"korean\"],\"임무\":[\"korean\"],\"입대\":[\"korean\"],\"입력\":[\"korean\"],\"입맛\":[\"korean\"],\"입사\":[\"korean\"],\"입술\":[\"korean\"],\"입시\":[\"korean\"],\"입원\":[\"korean\"],\"입장\":[\"korean\"],\"입학\":[\"korean\"],\"자가용\":[\"korean\"],\"자격\":[\"korean\"],\"자극\":[\"korean\"],\"자동\":[\"korean\"],\"자랑\":[\"korean\"],\"자부심\":[\"korean\"],\"자식\":[\"korean\"],\"자신\":[\"korean\"],\"자연\":[\"korean\"],\"자원\":[\"korean\"],\"자율\":[\"korean\"],\"자전거\":[\"korean\"],\"자정\":[\"korean\"],\"자존심\":[\"korean\"],\"자판\":[\"korean\"],\"작가\":[\"korean\"],\"작년\":[\"korean\"],\"작성\":[\"korean\"],\"작업\":[\"korean\"],\"작용\":[\"korean\"],\"작은딸\":[\"korean\"],\"작품\":[\"korean\"],\"잔디\":[\"korean\"],\"잔뜩\":[\"korean\"],\"잔치\":[\"korean\"],\"잘못\":[\"korean\"],\"잠깐\":[\"korean\"],\"잠수함\":[\"korean\"],\"잠시\":[\"korean\"],\"잠옷\":[\"korean\"],\"잠자리\":[\"korean\"],\"잡지\":[\"korean\"],\"장관\":[\"korean\"],\"장군\":[\"korean\"],\"장기간\":[\"korean\"],\"장래\":[\"korean\"],\"장례\":[\"korean\"],\"장르\":[\"korean\"],\"장마\":[\"korean\"],\"장면\":[\"korean\"],\"장모\":[\"korean\"],\"장미\":[\"korean\"],\"장비\":[\"korean\"],\"장사\":[\"korean\"],\"장소\":[\"korean\"],\"장식\":[\"korean\"],\"장애인\":[\"korean\"],\"장인\":[\"korean\"],\"장점\":[\"korean\"],\"장차\":[\"korean\"],\"장학금\":[\"korean\"],\"재능\":[\"korean\"],\"재빨리\":[\"korean\"],\"재산\":[\"korean\"],\"재생\":[\"korean\"],\"재작년\":[\"korean\"],\"재정\":[\"korean\"],\"재채기\":[\"korean\"],\"재판\":[\"korean\"],\"재학\":[\"korean\"],\"재활용\":[\"korean\"],\"저것\":[\"korean\"],\"저고리\":[\"korean\"],\"저곳\":[\"korean\"],\"저녁\":[\"korean\"],\"저런\":[\"korean\"],\"저렇게\":[\"korean\"],\"저번\":[\"korean\"],\"저울\":[\"korean\"],\"저절로\":[\"korean\"],\"저축\":[\"korean\"],\"적극\":[\"korean\"],\"적당히\":[\"korean\"],\"적성\":[\"korean\"],\"적용\":[\"korean\"],\"적응\":[\"korean\"],\"전개\":[\"korean\"],\"전공\":[\"korean\"],\"전기\":[\"korean\"],\"전달\":[\"korean\"],\"전라도\":[\"korean\"],\"전망\":[\"korean\"],\"전문\":[\"korean\"],\"전반\":[\"korean\"],\"전부\":[\"korean\"],\"전세\":[\"korean\"],\"전시\":[\"korean\"],\"전용\":[\"korean\"],\"전자\":[\"korean\"],\"전쟁\":[\"korean\"],\"전주\":[\"korean\"],\"전철\":[\"korean\"],\"전체\":[\"korean\"],\"전통\":[\"korean\"],\"전혀\":[\"korean\"],\"전후\":[\"korean\"],\"절대\":[\"korean\"],\"절망\":[\"korean\"],\"절반\":[\"korean\"],\"절약\":[\"korean\"],\"절차\":[\"korean\"],\"점검\":[\"korean\"],\"점수\":[\"korean\"],\"점심\":[\"korean\"],\"점원\":[\"korean\"],\"점점\":[\"korean\"],\"점차\":[\"korean\"],\"접근\":[\"korean\"],\"접시\":[\"korean\"],\"접촉\":[\"korean\"],\"젓가락\":[\"korean\"],\"정거장\":[\"korean\"],\"정도\":[\"korean\"],\"정류장\":[\"korean\"],\"정리\":[\"korean\"],\"정말\":[\"korean\"],\"정면\":[\"korean\"],\"정문\":[\"korean\"],\"정반대\":[\"korean\"],\"정보\":[\"korean\"],\"정부\":[\"korean\"],\"정비\":[\"korean\"],\"정상\":[\"korean\"],\"정성\":[\"korean\"],\"정오\":[\"korean\"],\"정원\":[\"korean\"],\"정장\":[\"korean\"],\"정지\":[\"korean\"],\"정치\":[\"korean\"],\"정확히\":[\"korean\"],\"제공\":[\"korean\"],\"제과점\":[\"korean\"],\"제대로\":[\"korean\"],\"제목\":[\"korean\"],\"제발\":[\"korean\"],\"제법\":[\"korean\"],\"제삿날\":[\"korean\"],\"제안\":[\"korean\"],\"제일\":[\"korean\"],\"제작\":[\"korean\"],\"제주도\":[\"korean\"],\"제출\":[\"korean\"],\"제품\":[\"korean\"],\"제한\":[\"korean\"],\"조각\":[\"korean\"],\"조건\":[\"korean\"],\"조금\":[\"korean\"],\"조깅\":[\"korean\"],\"조명\":[\"korean\"],\"조미료\":[\"korean\"],\"조상\":[\"korean\"],\"조선\":[\"korean\"],\"조용히\":[\"korean\"],\"조절\":[\"korean\"],\"조정\":[\"korean\"],\"조직\":[\"korean\"],\"존댓말\":[\"korean\"],\"존재\":[\"korean\"],\"졸업\":[\"korean\"],\"졸음\":[\"korean\"],\"종교\":[\"korean\"],\"종로\":[\"korean\"],\"종류\":[\"korean\"],\"종소리\":[\"korean\"],\"종업원\":[\"korean\"],\"종종\":[\"korean\"],\"종합\":[\"korean\"],\"좌석\":[\"korean\"],\"죄인\":[\"korean\"],\"주관적\":[\"korean\"],\"주름\":[\"korean\"],\"주말\":[\"korean\"],\"주머니\":[\"korean\"],\"주먹\":[\"korean\"],\"주문\":[\"korean\"],\"주민\":[\"korean\"],\"주방\":[\"korean\"],\"주변\":[\"korean\"],\"주식\":[\"korean\"],\"주인\":[\"korean\"],\"주일\":[\"korean\"],\"주장\":[\"korean\"],\"주전자\":[\"korean\"],\"주택\":[\"korean\"],\"준비\":[\"korean\"],\"줄거리\":[\"korean\"],\"줄기\":[\"korean\"],\"줄무늬\":[\"korean\"],\"중간\":[\"korean\"],\"중계방송\":[\"korean\"],\"중국\":[\"korean\"],\"중년\":[\"korean\"],\"중단\":[\"korean\"],\"중독\":[\"korean\"],\"중반\":[\"korean\"],\"중부\":[\"korean\"],\"중세\":[\"korean\"],\"중소기업\":[\"korean\"],\"중순\":[\"korean\"],\"중앙\":[\"korean\"],\"중요\":[\"korean\"],\"중학교\":[\"korean\"],\"즉석\":[\"korean\"],\"즉시\":[\"korean\"],\"즐거움\":[\"korean\"],\"증가\":[\"korean\"],\"증거\":[\"korean\"],\"증권\":[\"korean\"],\"증상\":[\"korean\"],\"증세\":[\"korean\"],\"지각\":[\"korean\"],\"지갑\":[\"korean\"],\"지경\":[\"korean\"],\"지극히\":[\"korean\"],\"지금\":[\"korean\"],\"지급\":[\"korean\"],\"지능\":[\"korean\"],\"지름길\":[\"korean\"],\"지리산\":[\"korean\"],\"지방\":[\"korean\"],\"지붕\":[\"korean\"],\"지식\":[\"korean\"],\"지역\":[\"korean\"],\"지우개\":[\"korean\"],\"지원\":[\"korean\"],\"지적\":[\"korean\"],\"지점\":[\"korean\"],\"지진\":[\"korean\"],\"지출\":[\"korean\"],\"직선\":[\"korean\"],\"직업\":[\"korean\"],\"직원\":[\"korean\"],\"직장\":[\"korean\"],\"진급\":[\"korean\"],\"진동\":[\"korean\"],\"진로\":[\"korean\"],\"진료\":[\"korean\"],\"진리\":[\"korean\"],\"진짜\":[\"korean\"],\"진찰\":[\"korean\"],\"진출\":[\"korean\"],\"진통\":[\"korean\"],\"진행\":[\"korean\"],\"질문\":[\"korean\"],\"질병\":[\"korean\"],\"질서\":[\"korean\"],\"짐작\":[\"korean\"],\"집단\":[\"korean\"],\"집안\":[\"korean\"],\"집중\":[\"korean\"],\"짜증\":[\"korean\"],\"찌꺼기\":[\"korean\"],\"차남\":[\"korean\"],\"차라리\":[\"korean\"],\"차량\":[\"korean\"],\"차림\":[\"korean\"],\"차별\":[\"korean\"],\"차선\":[\"korean\"],\"차츰\":[\"korean\"],\"착각\":[\"korean\"],\"찬물\":[\"korean\"],\"찬성\":[\"korean\"],\"참가\":[\"korean\"],\"참기름\":[\"korean\"],\"참새\":[\"korean\"],\"참석\":[\"korean\"],\"참여\":[\"korean\"],\"참외\":[\"korean\"],\"참조\":[\"korean\"],\"찻잔\":[\"korean\"],\"창가\":[\"korean\"],\"창고\":[\"korean\"],\"창구\":[\"korean\"],\"창문\":[\"korean\"],\"창밖\":[\"korean\"],\"창작\":[\"korean\"],\"창조\":[\"korean\"],\"채널\":[\"korean\"],\"채점\":[\"korean\"],\"책가방\":[\"korean\"],\"책방\":[\"korean\"],\"책상\":[\"korean\"],\"책임\":[\"korean\"],\"챔피언\":[\"korean\"],\"처벌\":[\"korean\"],\"처음\":[\"korean\"],\"천국\":[\"korean\"],\"천둥\":[\"korean\"],\"천장\":[\"korean\"],\"천재\":[\"korean\"],\"천천히\":[\"korean\"],\"철도\":[\"korean\"],\"철저히\":[\"korean\"],\"철학\":[\"korean\"],\"첫날\":[\"korean\"],\"첫째\":[\"korean\"],\"청년\":[\"korean\"],\"청바지\":[\"korean\"],\"청소\":[\"korean\"],\"청춘\":[\"korean\"],\"체계\":[\"korean\"],\"체력\":[\"korean\"],\"체온\":[\"korean\"],\"체육\":[\"korean\"],\"체중\":[\"korean\"],\"체험\":[\"korean\"],\"초등학생\":[\"korean\"],\"초반\":[\"korean\"],\"초밥\":[\"korean\"],\"초상화\":[\"korean\"],\"초순\":[\"korean\"],\"초여름\":[\"korean\"],\"초원\":[\"korean\"],\"초저녁\":[\"korean\"],\"초점\":[\"korean\"],\"초청\":[\"korean\"],\"초콜릿\":[\"korean\"],\"촛불\":[\"korean\"],\"총각\":[\"korean\"],\"총리\":[\"korean\"],\"총장\":[\"korean\"],\"촬영\":[\"korean\"],\"최근\":[\"korean\"],\"최상\":[\"korean\"],\"최선\":[\"korean\"],\"최신\":[\"korean\"],\"최악\":[\"korean\"],\"최종\":[\"korean\"],\"추석\":[\"korean\"],\"추억\":[\"korean\"],\"추진\":[\"korean\"],\"추천\":[\"korean\"],\"추측\":[\"korean\"],\"축구\":[\"korean\"],\"축소\":[\"korean\"],\"축제\":[\"korean\"],\"축하\":[\"korean\"],\"출근\":[\"korean\"],\"출발\":[\"korean\"],\"출산\":[\"korean\"],\"출신\":[\"korean\"],\"출연\":[\"korean\"],\"출입\":[\"korean\"],\"출장\":[\"korean\"],\"출판\":[\"korean\"],\"충격\":[\"korean\"],\"충고\":[\"korean\"],\"충돌\":[\"korean\"],\"충분히\":[\"korean\"],\"충청도\":[\"korean\"],\"취업\":[\"korean\"],\"취직\":[\"korean\"],\"취향\":[\"korean\"],\"치약\":[\"korean\"],\"친구\":[\"korean\"],\"친척\":[\"korean\"],\"칠십\":[\"korean\"],\"칠월\":[\"korean\"],\"칠판\":[\"korean\"],\"침대\":[\"korean\"],\"침묵\":[\"korean\"],\"침실\":[\"korean\"],\"칫솔\":[\"korean\"],\"칭찬\":[\"korean\"],\"카메라\":[\"korean\"],\"카운터\":[\"korean\"],\"칼국수\":[\"korean\"],\"캐릭터\":[\"korean\"],\"캠퍼스\":[\"korean\"],\"캠페인\":[\"korean\"],\"커튼\":[\"korean\"],\"컨디션\":[\"korean\"],\"컬러\":[\"korean\"],\"컴퓨터\":[\"korean\"],\"코끼리\":[\"korean\"],\"코미디\":[\"korean\"],\"콘서트\":[\"korean\"],\"콜라\":[\"korean\"],\"콤플렉스\":[\"korean\"],\"콩나물\":[\"korean\"],\"쾌감\":[\"korean\"],\"쿠데타\":[\"korean\"],\"크림\":[\"korean\"],\"큰길\":[\"korean\"],\"큰딸\":[\"korean\"],\"큰소리\":[\"korean\"],\"큰아들\":[\"korean\"],\"큰어머니\":[\"korean\"],\"큰일\":[\"korean\"],\"큰절\":[\"korean\"],\"클래식\":[\"korean\"],\"클럽\":[\"korean\"],\"킬로\":[\"korean\"],\"타입\":[\"korean\"],\"타자기\":[\"korean\"],\"탁구\":[\"korean\"],\"탁자\":[\"korean\"],\"탄생\":[\"korean\"],\"태권도\":[\"korean\"],\"태양\":[\"korean\"],\"태풍\":[\"korean\"],\"택시\":[\"korean\"],\"탤런트\":[\"korean\"],\"터널\":[\"korean\"],\"터미널\":[\"korean\"],\"테니스\":[\"korean\"],\"테스트\":[\"korean\"],\"테이블\":[\"korean\"],\"텔레비전\":[\"korean\"],\"토론\":[\"korean\"],\"토마토\":[\"korean\"],\"토요일\":[\"korean\"],\"통계\":[\"korean\"],\"통과\":[\"korean\"],\"통로\":[\"korean\"],\"통신\":[\"korean\"],\"통역\":[\"korean\"],\"통일\":[\"korean\"],\"통장\":[\"korean\"],\"통제\":[\"korean\"],\"통증\":[\"korean\"],\"통합\":[\"korean\"],\"통화\":[\"korean\"],\"퇴근\":[\"korean\"],\"퇴원\":[\"korean\"],\"퇴직금\":[\"korean\"],\"튀김\":[\"korean\"],\"트럭\":[\"korean\"],\"특급\":[\"korean\"],\"특별\":[\"korean\"],\"특성\":[\"korean\"],\"특수\":[\"korean\"],\"특징\":[\"korean\"],\"특히\":[\"korean\"],\"튼튼히\":[\"korean\"],\"티셔츠\":[\"korean\"],\"파란색\":[\"korean\"],\"파일\":[\"korean\"],\"파출소\":[\"korean\"],\"판결\":[\"korean\"],\"판단\":[\"korean\"],\"판매\":[\"korean\"],\"판사\":[\"korean\"],\"팔십\":[\"korean\"],\"팔월\":[\"korean\"],\"팝송\":[\"korean\"],\"패션\":[\"korean\"],\"팩스\":[\"korean\"],\"팩시밀리\":[\"korean\"],\"팬티\":[\"korean\"],\"퍼센트\":[\"korean\"],\"페인트\":[\"korean\"],\"편견\":[\"korean\"],\"편의\":[\"korean\"],\"편지\":[\"korean\"],\"편히\":[\"korean\"],\"평가\":[\"korean\"],\"평균\":[\"korean\"],\"평생\":[\"korean\"],\"평소\":[\"korean\"],\"평양\":[\"korean\"],\"평일\":[\"korean\"],\"평화\":[\"korean\"],\"포스터\":[\"korean\"],\"포인트\":[\"korean\"],\"포장\":[\"korean\"],\"포함\":[\"korean\"],\"표면\":[\"korean\"],\"표정\":[\"korean\"],\"표준\":[\"korean\"],\"표현\":[\"korean\"],\"품목\":[\"korean\"],\"품질\":[\"korean\"],\"풍경\":[\"korean\"],\"풍속\":[\"korean\"],\"풍습\":[\"korean\"],\"프랑스\":[\"korean\"],\"프린터\":[\"korean\"],\"플라스틱\":[\"korean\"],\"피곤\":[\"korean\"],\"피망\":[\"korean\"],\"피아노\":[\"korean\"],\"필름\":[\"korean\"],\"필수\":[\"korean\"],\"필요\":[\"korean\"],\"필자\":[\"korean\"],\"필통\":[\"korean\"],\"핑계\":[\"korean\"],\"하느님\":[\"korean\"],\"하늘\":[\"korean\"],\"하드웨어\":[\"korean\"],\"하룻밤\":[\"korean\"],\"하반기\":[\"korean\"],\"하숙집\":[\"korean\"],\"하순\":[\"korean\"],\"하여튼\":[\"korean\"],\"하지만\":[\"korean\"],\"하천\":[\"korean\"],\"하품\":[\"korean\"],\"하필\":[\"korean\"],\"학과\":[\"korean\"],\"학교\":[\"korean\"],\"학급\":[\"korean\"],\"학기\":[\"korean\"],\"학년\":[\"korean\"],\"학력\":[\"korean\"],\"학번\":[\"korean\"],\"학부모\":[\"korean\"],\"학비\":[\"korean\"],\"학생\":[\"korean\"],\"학술\":[\"korean\"],\"학습\":[\"korean\"],\"학용품\":[\"korean\"],\"학원\":[\"korean\"],\"학위\":[\"korean\"],\"학자\":[\"korean\"],\"학점\":[\"korean\"],\"한계\":[\"korean\"],\"한글\":[\"korean\"],\"한꺼번에\":[\"korean\"],\"한낮\":[\"korean\"],\"한눈\":[\"korean\"],\"한동안\":[\"korean\"],\"한때\":[\"korean\"],\"한라산\":[\"korean\"],\"한마디\":[\"korean\"],\"한문\":[\"korean\"],\"한번\":[\"korean\"],\"한복\":[\"korean\"],\"한식\":[\"korean\"],\"한여름\":[\"korean\"],\"한쪽\":[\"korean\"],\"할머니\":[\"korean\"],\"할아버지\":[\"korean\"],\"할인\":[\"korean\"],\"함께\":[\"korean\"],\"함부로\":[\"korean\"],\"합격\":[\"korean\"],\"합리적\":[\"korean\"],\"항공\":[\"korean\"],\"항구\":[\"korean\"],\"항상\":[\"korean\"],\"항의\":[\"korean\"],\"해결\":[\"korean\"],\"해군\":[\"korean\"],\"해답\":[\"korean\"],\"해당\":[\"korean\"],\"해물\":[\"korean\"],\"해석\":[\"korean\"],\"해설\":[\"korean\"],\"해수욕장\":[\"korean\"],\"해안\":[\"korean\"],\"핵심\":[\"korean\"],\"핸드백\":[\"korean\"],\"햄버거\":[\"korean\"],\"햇볕\":[\"korean\"],\"햇살\":[\"korean\"],\"행동\":[\"korean\"],\"행복\":[\"korean\"],\"행사\":[\"korean\"],\"행운\":[\"korean\"],\"행위\":[\"korean\"],\"향기\":[\"korean\"],\"향상\":[\"korean\"],\"향수\":[\"korean\"],\"허락\":[\"korean\"],\"허용\":[\"korean\"],\"헬기\":[\"korean\"],\"현관\":[\"korean\"],\"현금\":[\"korean\"],\"현대\":[\"korean\"],\"현상\":[\"korean\"],\"현실\":[\"korean\"],\"현장\":[\"korean\"],\"현재\":[\"korean\"],\"현지\":[\"korean\"],\"혈액\":[\"korean\"],\"협력\":[\"korean\"],\"형부\":[\"korean\"],\"형사\":[\"korean\"],\"형수\":[\"korean\"],\"형식\":[\"korean\"],\"형제\":[\"korean\"],\"형태\":[\"korean\"],\"형편\":[\"korean\"],\"혜택\":[\"korean\"],\"호기심\":[\"korean\"],\"호남\":[\"korean\"],\"호랑이\":[\"korean\"],\"호박\":[\"korean\"],\"호텔\":[\"korean\"],\"호흡\":[\"korean\"],\"혹시\":[\"korean\"],\"홀로\":[\"korean\"],\"홈페이지\":[\"korean\"],\"홍보\":[\"korean\"],\"홍수\":[\"korean\"],\"홍차\":[\"korean\"],\"화면\":[\"korean\"],\"화분\":[\"korean\"],\"화살\":[\"korean\"],\"화요일\":[\"korean\"],\"화장\":[\"korean\"],\"화학\":[\"korean\"],\"확보\":[\"korean\"],\"확인\":[\"korean\"],\"확장\":[\"korean\"],\"확정\":[\"korean\"],\"환갑\":[\"korean\"],\"환경\":[\"korean\"],\"환영\":[\"korean\"],\"환율\":[\"korean\"],\"환자\":[\"korean\"],\"활기\":[\"korean\"],\"활동\":[\"korean\"],\"활발히\":[\"korean\"],\"활용\":[\"korean\"],\"활짝\":[\"korean\"],\"회견\":[\"korean\"],\"회관\":[\"korean\"],\"회복\":[\"korean\"],\"회색\":[\"korean\"],\"회원\":[\"korean\"],\"회장\":[\"korean\"],\"회전\":[\"korean\"],\"횟수\":[\"korean\"],\"횡단보도\":[\"korean\"],\"효율적\":[\"korean\"],\"후반\":[\"korean\"],\"후춧가루\":[\"korean\"],\"훈련\":[\"korean\"],\"훨씬\":[\"korean\"],\"휴식\":[\"korean\"],\"휴일\":[\"korean\"],\"흉내\":[\"korean\"],\"흐름\":[\"korean\"],\"흑백\":[\"korean\"],\"흑인\":[\"korean\"],\"흔적\":[\"korean\"],\"흔히\":[\"korean\"],\"흥미\":[\"korean\"],\"흥분\":[\"korean\"],\"희곡\":[\"korean\"],\"희망\":[\"korean\"],\"희생\":[\"korean\"],\"흰색\":[\"korean\"],\"힘껏\":[\"korean\"],\"abacate\":[\"portuguese\"],\"abaixo\":[\"portuguese\"],\"abalar\":[\"portuguese\"],\"abater\":[\"portuguese\"],\"abduzir\":[\"portuguese\"],\"abelha\":[\"portuguese\"],\"aberto\":[\"portuguese\"],\"abismo\":[\"portuguese\"],\"abotoar\":[\"portuguese\"],\"abranger\":[\"portuguese\"],\"abreviar\":[\"portuguese\"],\"abrigar\":[\"portuguese\"],\"abrupto\":[\"portuguese\"],\"absinto\":[\"portuguese\"],\"absoluto\":[\"portuguese\"],\"absurdo\":[\"portuguese\"],\"abutre\":[\"portuguese\"],\"acabado\":[\"portuguese\"],\"acalmar\":[\"portuguese\"],\"acampar\":[\"portuguese\"],\"acanhar\":[\"portuguese\"],\"acaso\":[\"portuguese\"],\"aceitar\":[\"portuguese\"],\"acelerar\":[\"portuguese\"],\"acenar\":[\"portuguese\"],\"acervo\":[\"portuguese\"],\"acessar\":[\"portuguese\"],\"acetona\":[\"portuguese\"],\"achatar\":[\"portuguese\"],\"acidez\":[\"portuguese\"],\"acima\":[\"portuguese\"],\"acionado\":[\"portuguese\"],\"acirrar\":[\"portuguese\"],\"aclamar\":[\"portuguese\"],\"aclive\":[\"portuguese\"],\"acolhida\":[\"portuguese\"],\"acomodar\":[\"portuguese\"],\"acoplar\":[\"portuguese\"],\"acordar\":[\"portuguese\"],\"acumular\":[\"portuguese\"],\"acusador\":[\"portuguese\"],\"adaptar\":[\"portuguese\"],\"adega\":[\"portuguese\"],\"adentro\":[\"portuguese\"],\"adepto\":[\"portuguese\"],\"adequar\":[\"portuguese\"],\"aderente\":[\"portuguese\"],\"adesivo\":[\"portuguese\"],\"adeus\":[\"portuguese\"],\"adiante\":[\"portuguese\"],\"aditivo\":[\"portuguese\"],\"adjetivo\":[\"portuguese\"],\"adjunto\":[\"portuguese\"],\"admirar\":[\"portuguese\"],\"adorar\":[\"portuguese\"],\"adquirir\":[\"portuguese\"],\"adubo\":[\"portuguese\"],\"adverso\":[\"portuguese\"],\"advogado\":[\"portuguese\"],\"aeronave\":[\"portuguese\"],\"afastar\":[\"portuguese\"],\"aferir\":[\"portuguese\"],\"afetivo\":[\"portuguese\"],\"afinador\":[\"portuguese\"],\"afivelar\":[\"portuguese\"],\"aflito\":[\"portuguese\"],\"afluente\":[\"portuguese\"],\"afrontar\":[\"portuguese\"],\"agachar\":[\"portuguese\"],\"agarrar\":[\"portuguese\"],\"agasalho\":[\"portuguese\"],\"agenciar\":[\"portuguese\"],\"agilizar\":[\"portuguese\"],\"agiota\":[\"portuguese\"],\"agitado\":[\"portuguese\"],\"agora\":[\"portuguese\"],\"agradar\":[\"portuguese\"],\"agreste\":[\"portuguese\"],\"agrupar\":[\"portuguese\"],\"aguardar\":[\"portuguese\"],\"agulha\":[\"portuguese\"],\"ajoelhar\":[\"portuguese\"],\"ajudar\":[\"portuguese\"],\"ajustar\":[\"portuguese\"],\"alameda\":[\"portuguese\"],\"alarme\":[\"portuguese\"],\"alastrar\":[\"portuguese\"],\"alavanca\":[\"portuguese\"],\"albergue\":[\"portuguese\"],\"albino\":[\"portuguese\"],\"alcatra\":[\"portuguese\"],\"aldeia\":[\"portuguese\"],\"alecrim\":[\"portuguese\"],\"alegria\":[\"portuguese\"],\"alertar\":[\"portuguese\"],\"alface\":[\"portuguese\"],\"alfinete\":[\"portuguese\"],\"algum\":[\"portuguese\"],\"alheio\":[\"portuguese\"],\"aliar\":[\"portuguese\"],\"alicate\":[\"portuguese\"],\"alienar\":[\"portuguese\"],\"alinhar\":[\"portuguese\"],\"aliviar\":[\"portuguese\"],\"almofada\":[\"portuguese\"],\"alocar\":[\"portuguese\"],\"alpiste\":[\"portuguese\"],\"alterar\":[\"portuguese\"],\"altitude\":[\"portuguese\"],\"alucinar\":[\"portuguese\"],\"alugar\":[\"portuguese\"],\"aluno\":[\"portuguese\"],\"alusivo\":[\"portuguese\"],\"alvo\":[\"portuguese\"],\"amaciar\":[\"portuguese\"],\"amador\":[\"portuguese\"],\"amarelo\":[\"portuguese\"],\"amassar\":[\"portuguese\"],\"ambas\":[\"portuguese\"],\"ambiente\":[\"portuguese\"],\"ameixa\":[\"portuguese\"],\"amenizar\":[\"portuguese\"],\"amido\":[\"portuguese\"],\"amistoso\":[\"portuguese\"],\"amizade\":[\"portuguese\"],\"amolador\":[\"portuguese\"],\"amontoar\":[\"portuguese\"],\"amoroso\":[\"portuguese\"],\"amostra\":[\"portuguese\"],\"amparar\":[\"portuguese\"],\"ampliar\":[\"portuguese\"],\"ampola\":[\"portuguese\"],\"anagrama\":[\"portuguese\"],\"analisar\":[\"portuguese\"],\"anarquia\":[\"portuguese\"],\"anatomia\":[\"portuguese\"],\"andaime\":[\"portuguese\"],\"anel\":[\"portuguese\"],\"anexo\":[\"portuguese\"],\"angular\":[\"portuguese\"],\"animar\":[\"portuguese\"],\"anjo\":[\"portuguese\"],\"anomalia\":[\"portuguese\"],\"anotado\":[\"portuguese\"],\"ansioso\":[\"portuguese\"],\"anterior\":[\"portuguese\"],\"anuidade\":[\"portuguese\"],\"anunciar\":[\"portuguese\"],\"anzol\":[\"portuguese\"],\"apagador\":[\"portuguese\"],\"apalpar\":[\"portuguese\"],\"apanhado\":[\"portuguese\"],\"apego\":[\"portuguese\"],\"apelido\":[\"portuguese\"],\"apertada\":[\"portuguese\"],\"apesar\":[\"portuguese\"],\"apetite\":[\"portuguese\"],\"apito\":[\"portuguese\"],\"aplauso\":[\"portuguese\"],\"aplicada\":[\"portuguese\"],\"apoio\":[\"portuguese\"],\"apontar\":[\"portuguese\"],\"aposta\":[\"portuguese\"],\"aprendiz\":[\"portuguese\"],\"aprovar\":[\"portuguese\"],\"aquecer\":[\"portuguese\"],\"arame\":[\"portuguese\"],\"aranha\":[\"portuguese\"],\"arara\":[\"portuguese\"],\"arcada\":[\"portuguese\"],\"ardente\":[\"portuguese\"],\"areia\":[\"portuguese\"],\"arejar\":[\"portuguese\"],\"arenito\":[\"portuguese\"],\"aresta\":[\"portuguese\"],\"argiloso\":[\"portuguese\"],\"argola\":[\"portuguese\"],\"arma\":[\"portuguese\"],\"arquivo\":[\"portuguese\"],\"arraial\":[\"portuguese\"],\"arrebate\":[\"portuguese\"],\"arriscar\":[\"portuguese\"],\"arroba\":[\"portuguese\"],\"arrumar\":[\"portuguese\"],\"arsenal\":[\"portuguese\"],\"arterial\":[\"portuguese\"],\"artigo\":[\"portuguese\"],\"arvoredo\":[\"portuguese\"],\"asfaltar\":[\"portuguese\"],\"asilado\":[\"portuguese\"],\"aspirar\":[\"portuguese\"],\"assador\":[\"portuguese\"],\"assinar\":[\"portuguese\"],\"assoalho\":[\"portuguese\"],\"assunto\":[\"portuguese\"],\"astral\":[\"portuguese\"],\"atacado\":[\"portuguese\"],\"atadura\":[\"portuguese\"],\"atalho\":[\"portuguese\"],\"atarefar\":[\"portuguese\"],\"atear\":[\"portuguese\"],\"atender\":[\"portuguese\"],\"aterro\":[\"portuguese\"],\"ateu\":[\"portuguese\"],\"atingir\":[\"portuguese\"],\"atirador\":[\"portuguese\"],\"ativo\":[\"portuguese\"],\"atoleiro\":[\"portuguese\"],\"atracar\":[\"portuguese\"],\"atrevido\":[\"portuguese\"],\"atriz\":[\"portuguese\"],\"atual\":[\"portuguese\"],\"atum\":[\"portuguese\"],\"auditor\":[\"portuguese\"],\"aumentar\":[\"portuguese\"],\"aura\":[\"portuguese\"],\"aurora\":[\"portuguese\"],\"autismo\":[\"portuguese\"],\"autoria\":[\"portuguese\"],\"autuar\":[\"portuguese\"],\"avaliar\":[\"portuguese\"],\"avante\":[\"portuguese\"],\"avaria\":[\"portuguese\"],\"avental\":[\"portuguese\"],\"avesso\":[\"portuguese\"],\"aviador\":[\"portuguese\"],\"avisar\":[\"portuguese\"],\"avulso\":[\"portuguese\"],\"axila\":[\"portuguese\"],\"azarar\":[\"portuguese\"],\"azedo\":[\"portuguese\"],\"azeite\":[\"portuguese\"],\"azulejo\":[\"portuguese\"],\"babar\":[\"portuguese\"],\"babosa\":[\"portuguese\"],\"bacalhau\":[\"portuguese\"],\"bacharel\":[\"portuguese\"],\"bacia\":[\"portuguese\"],\"bagagem\":[\"portuguese\"],\"baiano\":[\"portuguese\"],\"bailar\":[\"portuguese\"],\"baioneta\":[\"portuguese\"],\"bairro\":[\"portuguese\"],\"baixista\":[\"portuguese\"],\"bajular\":[\"portuguese\"],\"baleia\":[\"portuguese\"],\"baliza\":[\"portuguese\"],\"balsa\":[\"portuguese\"],\"banal\":[\"portuguese\"],\"bandeira\":[\"portuguese\"],\"banho\":[\"portuguese\"],\"banir\":[\"portuguese\"],\"banquete\":[\"portuguese\"],\"barato\":[\"portuguese\"],\"barbado\":[\"portuguese\"],\"baronesa\":[\"portuguese\"],\"barraca\":[\"portuguese\"],\"barulho\":[\"portuguese\"],\"baseado\":[\"portuguese\"],\"bastante\":[\"portuguese\"],\"batata\":[\"portuguese\"],\"batedor\":[\"portuguese\"],\"batida\":[\"portuguese\"],\"batom\":[\"portuguese\"],\"batucar\":[\"portuguese\"],\"baunilha\":[\"portuguese\"],\"beber\":[\"portuguese\"],\"beijo\":[\"portuguese\"],\"beirada\":[\"portuguese\"],\"beisebol\":[\"portuguese\"],\"beldade\":[\"portuguese\"],\"beleza\":[\"portuguese\"],\"belga\":[\"portuguese\"],\"beliscar\":[\"portuguese\"],\"bendito\":[\"portuguese\"],\"bengala\":[\"portuguese\"],\"benzer\":[\"portuguese\",\"turkish\"],\"berimbau\":[\"portuguese\"],\"berlinda\":[\"portuguese\"],\"berro\":[\"portuguese\"],\"besouro\":[\"portuguese\"],\"bexiga\":[\"portuguese\"],\"bezerro\":[\"portuguese\"],\"bico\":[\"portuguese\"],\"bicudo\":[\"portuguese\"],\"bienal\":[\"portuguese\"],\"bifocal\":[\"portuguese\"],\"bifurcar\":[\"portuguese\"],\"bigorna\":[\"portuguese\"],\"bilhete\":[\"portuguese\"],\"bimestre\":[\"portuguese\"],\"bimotor\":[\"portuguese\"],\"biologia\":[\"portuguese\"],\"biombo\":[\"portuguese\"],\"biosfera\":[\"portuguese\"],\"bipolar\":[\"portuguese\"],\"birrento\":[\"portuguese\"],\"biscoito\":[\"portuguese\"],\"bisneto\":[\"portuguese\"],\"bispo\":[\"portuguese\"],\"bissexto\":[\"portuguese\"],\"bitola\":[\"portuguese\"],\"bizarro\":[\"portuguese\"],\"blindado\":[\"portuguese\"],\"bloco\":[\"portuguese\"],\"bloquear\":[\"portuguese\"],\"boato\":[\"portuguese\"],\"bobagem\":[\"portuguese\"],\"bocado\":[\"portuguese\"],\"bocejo\":[\"portuguese\"],\"bochecha\":[\"portuguese\"],\"boicotar\":[\"portuguese\"],\"bolada\":[\"portuguese\"],\"boletim\":[\"portuguese\"],\"bolha\":[\"portuguese\"],\"bolo\":[\"portuguese\"],\"bombeiro\":[\"portuguese\"],\"bonde\":[\"portuguese\"],\"boneco\":[\"portuguese\"],\"bonita\":[\"portuguese\"],\"borbulha\":[\"portuguese\"],\"borda\":[\"portuguese\"],\"boreal\":[\"portuguese\"],\"borracha\":[\"portuguese\"],\"bovino\":[\"portuguese\"],\"boxeador\":[\"portuguese\"],\"branco\":[\"portuguese\"],\"brasa\":[\"portuguese\"],\"braveza\":[\"portuguese\"],\"breu\":[\"portuguese\"],\"briga\":[\"portuguese\"],\"brilho\":[\"portuguese\"],\"brincar\":[\"portuguese\"],\"broa\":[\"portuguese\"],\"brochura\":[\"portuguese\"],\"bronzear\":[\"portuguese\"],\"broto\":[\"portuguese\"],\"bruxo\":[\"portuguese\"],\"bucha\":[\"portuguese\"],\"budismo\":[\"portuguese\"],\"bufar\":[\"portuguese\"],\"bule\":[\"portuguese\"],\"buraco\":[\"portuguese\"],\"busca\":[\"portuguese\"],\"busto\":[\"portuguese\"],\"buzina\":[\"portuguese\"],\"cabana\":[\"portuguese\"],\"cabelo\":[\"portuguese\"],\"cabide\":[\"portuguese\"],\"cabo\":[\"portuguese\"],\"cabrito\":[\"portuguese\"],\"cacau\":[\"portuguese\"],\"cacetada\":[\"portuguese\"],\"cachorro\":[\"portuguese\"],\"cacique\":[\"portuguese\"],\"cadastro\":[\"portuguese\"],\"cadeado\":[\"portuguese\"],\"cafezal\":[\"portuguese\"],\"caiaque\":[\"portuguese\"],\"caipira\":[\"portuguese\"],\"caixote\":[\"portuguese\"],\"cajado\":[\"portuguese\"],\"caju\":[\"portuguese\"],\"calafrio\":[\"portuguese\"],\"calcular\":[\"portuguese\"],\"caldeira\":[\"portuguese\"],\"calibrar\":[\"portuguese\"],\"calmante\":[\"portuguese\"],\"calota\":[\"portuguese\"],\"camada\":[\"portuguese\"],\"cambista\":[\"portuguese\"],\"camisa\":[\"portuguese\"],\"camomila\":[\"portuguese\"],\"campanha\":[\"portuguese\"],\"camuflar\":[\"portuguese\"],\"canavial\":[\"portuguese\"],\"cancelar\":[\"portuguese\"],\"caneta\":[\"portuguese\"],\"canguru\":[\"portuguese\"],\"canhoto\":[\"portuguese\"],\"canivete\":[\"portuguese\"],\"canoa\":[\"portuguese\"],\"cansado\":[\"portuguese\"],\"cantar\":[\"portuguese\"],\"canudo\":[\"portuguese\"],\"capacho\":[\"portuguese\"],\"capela\":[\"portuguese\"],\"capinar\":[\"portuguese\"],\"capotar\":[\"portuguese\"],\"capricho\":[\"portuguese\"],\"captador\":[\"portuguese\"],\"capuz\":[\"portuguese\"],\"caracol\":[\"portuguese\"],\"carbono\":[\"portuguese\"],\"cardeal\":[\"portuguese\"],\"careca\":[\"portuguese\"],\"carimbar\":[\"portuguese\"],\"carneiro\":[\"portuguese\"],\"carpete\":[\"portuguese\"],\"carreira\":[\"portuguese\"],\"cartaz\":[\"portuguese\"],\"carvalho\":[\"portuguese\"],\"casaco\":[\"portuguese\"],\"casca\":[\"portuguese\"],\"casebre\":[\"portuguese\"],\"castelo\":[\"portuguese\"],\"casulo\":[\"portuguese\"],\"catarata\":[\"portuguese\"],\"cativar\":[\"portuguese\"],\"caule\":[\"portuguese\"],\"causador\":[\"portuguese\"],\"cautelar\":[\"portuguese\"],\"cavalo\":[\"portuguese\"],\"caverna\":[\"portuguese\"],\"cebola\":[\"portuguese\"],\"cedilha\":[\"portuguese\"],\"cegonha\":[\"portuguese\"],\"celebrar\":[\"portuguese\"],\"celular\":[\"portuguese\"],\"cenoura\":[\"portuguese\"],\"censo\":[\"portuguese\"],\"centeio\":[\"portuguese\"],\"cercar\":[\"portuguese\"],\"cerrado\":[\"portuguese\"],\"certeiro\":[\"portuguese\"],\"cerveja\":[\"portuguese\"],\"cetim\":[\"portuguese\"],\"cevada\":[\"portuguese\"],\"chacota\":[\"portuguese\"],\"chaleira\":[\"portuguese\"],\"chamado\":[\"portuguese\"],\"chapada\":[\"portuguese\"],\"charme\":[\"portuguese\"],\"chatice\":[\"portuguese\"],\"chave\":[\"portuguese\"],\"chefe\":[\"portuguese\"],\"chegada\":[\"portuguese\"],\"cheiro\":[\"portuguese\"],\"cheque\":[\"portuguese\"],\"chicote\":[\"portuguese\"],\"chifre\":[\"portuguese\"],\"chinelo\":[\"portuguese\"],\"chocalho\":[\"portuguese\"],\"chover\":[\"portuguese\"],\"chumbo\":[\"portuguese\"],\"chutar\":[\"portuguese\"],\"chuva\":[\"portuguese\"],\"cicatriz\":[\"portuguese\"],\"ciclone\":[\"portuguese\"],\"cidade\":[\"portuguese\"],\"cidreira\":[\"portuguese\"],\"ciente\":[\"portuguese\"],\"cigana\":[\"portuguese\"],\"cimento\":[\"portuguese\"],\"cinto\":[\"portuguese\"],\"cinza\":[\"portuguese\"],\"ciranda\":[\"portuguese\"],\"circuito\":[\"portuguese\"],\"cirurgia\":[\"portuguese\"],\"citar\":[\"portuguese\"],\"clareza\":[\"portuguese\"],\"clero\":[\"portuguese\"],\"clicar\":[\"portuguese\"],\"clone\":[\"portuguese\"],\"clube\":[\"portuguese\"],\"coado\":[\"portuguese\"],\"coagir\":[\"portuguese\"],\"cobaia\":[\"portuguese\"],\"cobertor\":[\"portuguese\"],\"cobrar\":[\"portuguese\"],\"cocada\":[\"portuguese\"],\"coelho\":[\"portuguese\"],\"coentro\":[\"portuguese\"],\"coeso\":[\"portuguese\"],\"cogumelo\":[\"portuguese\"],\"coibir\":[\"portuguese\"],\"coifa\":[\"portuguese\"],\"coiote\":[\"portuguese\"],\"colar\":[\"portuguese\"],\"coleira\":[\"portuguese\"],\"colher\":[\"portuguese\"],\"colidir\":[\"portuguese\"],\"colmeia\":[\"portuguese\"],\"colono\":[\"portuguese\"],\"coluna\":[\"portuguese\"],\"comando\":[\"portuguese\"],\"combinar\":[\"portuguese\"],\"comentar\":[\"portuguese\"],\"comitiva\":[\"portuguese\"],\"comover\":[\"portuguese\"],\"complexo\":[\"portuguese\"],\"comum\":[\"portuguese\"],\"concha\":[\"portuguese\"],\"condor\":[\"portuguese\"],\"conectar\":[\"portuguese\"],\"confuso\":[\"portuguese\"],\"congelar\":[\"portuguese\"],\"conhecer\":[\"portuguese\"],\"conjugar\":[\"portuguese\"],\"consumir\":[\"portuguese\"],\"contrato\":[\"portuguese\"],\"convite\":[\"portuguese\"],\"cooperar\":[\"portuguese\"],\"copeiro\":[\"portuguese\"],\"copiador\":[\"portuguese\"],\"copo\":[\"portuguese\"],\"coquetel\":[\"portuguese\"],\"coragem\":[\"portuguese\"],\"cordial\":[\"portuguese\"],\"corneta\":[\"portuguese\"],\"coronha\":[\"portuguese\"],\"corporal\":[\"portuguese\"],\"correio\":[\"portuguese\"],\"cortejo\":[\"portuguese\"],\"coruja\":[\"portuguese\"],\"corvo\":[\"portuguese\"],\"cosseno\":[\"portuguese\"],\"costela\":[\"portuguese\"],\"cotonete\":[\"portuguese\"],\"couro\":[\"portuguese\"],\"couve\":[\"portuguese\"],\"covil\":[\"portuguese\"],\"cozinha\":[\"portuguese\"],\"cratera\":[\"portuguese\"],\"cravo\":[\"portuguese\"],\"creche\":[\"portuguese\"],\"credor\":[\"portuguese\"],\"creme\":[\"portuguese\"],\"crer\":[\"portuguese\"],\"crespo\":[\"portuguese\"],\"criada\":[\"portuguese\"],\"criminal\":[\"portuguese\"],\"crioulo\":[\"portuguese\"],\"crise\":[\"portuguese\"],\"criticar\":[\"portuguese\"],\"crosta\":[\"portuguese\"],\"crua\":[\"portuguese\"],\"cruzeiro\":[\"portuguese\"],\"cubano\":[\"portuguese\"],\"cueca\":[\"portuguese\"],\"cuidado\":[\"portuguese\"],\"cujo\":[\"portuguese\"],\"culatra\":[\"portuguese\"],\"culminar\":[\"portuguese\"],\"culpar\":[\"portuguese\"],\"cultura\":[\"portuguese\"],\"cumprir\":[\"portuguese\"],\"cunhado\":[\"portuguese\"],\"cupido\":[\"portuguese\"],\"curativo\":[\"portuguese\"],\"curral\":[\"portuguese\"],\"cursar\":[\"portuguese\"],\"curto\":[\"portuguese\"],\"cuspir\":[\"portuguese\"],\"custear\":[\"portuguese\"],\"cutelo\":[\"portuguese\"],\"damasco\":[\"portuguese\"],\"datar\":[\"portuguese\"],\"debater\":[\"portuguese\"],\"debitar\":[\"portuguese\"],\"deboche\":[\"portuguese\"],\"debulhar\":[\"portuguese\"],\"decalque\":[\"portuguese\"],\"decimal\":[\"portuguese\"],\"declive\":[\"portuguese\"],\"decote\":[\"portuguese\"],\"decretar\":[\"portuguese\"],\"dedal\":[\"portuguese\"],\"dedicado\":[\"portuguese\"],\"deduzir\":[\"portuguese\"],\"defesa\":[\"portuguese\"],\"defumar\":[\"portuguese\"],\"degelo\":[\"portuguese\"],\"degrau\":[\"portuguese\"],\"degustar\":[\"portuguese\"],\"deitado\":[\"portuguese\"],\"deixar\":[\"portuguese\"],\"delator\":[\"portuguese\"],\"delegado\":[\"portuguese\"],\"delinear\":[\"portuguese\"],\"delonga\":[\"portuguese\"],\"demanda\":[\"portuguese\"],\"demitir\":[\"portuguese\"],\"demolido\":[\"portuguese\"],\"dentista\":[\"portuguese\"],\"depenado\":[\"portuguese\"],\"depilar\":[\"portuguese\"],\"depois\":[\"portuguese\"],\"depressa\":[\"portuguese\"],\"depurar\":[\"portuguese\"],\"deriva\":[\"portuguese\"],\"derramar\":[\"portuguese\"],\"desafio\":[\"portuguese\"],\"desbotar\":[\"portuguese\"],\"descanso\":[\"portuguese\"],\"desenho\":[\"portuguese\"],\"desfiado\":[\"portuguese\"],\"desgaste\":[\"portuguese\"],\"desigual\":[\"portuguese\"],\"deslize\":[\"portuguese\"],\"desmamar\":[\"portuguese\"],\"desova\":[\"portuguese\"],\"despesa\":[\"portuguese\"],\"destaque\":[\"portuguese\"],\"desviar\":[\"portuguese\"],\"detalhar\":[\"portuguese\"],\"detentor\":[\"portuguese\"],\"detonar\":[\"portuguese\"],\"detrito\":[\"portuguese\"],\"deusa\":[\"portuguese\"],\"dever\":[\"portuguese\"],\"devido\":[\"portuguese\"],\"devotado\":[\"portuguese\"],\"dezena\":[\"portuguese\"],\"diagrama\":[\"portuguese\"],\"dialeto\":[\"portuguese\"],\"didata\":[\"portuguese\"],\"difuso\":[\"portuguese\"],\"digitar\":[\"portuguese\"],\"dilatado\":[\"portuguese\"],\"diluente\":[\"portuguese\"],\"diminuir\":[\"portuguese\"],\"dinastia\":[\"portuguese\"],\"dinheiro\":[\"portuguese\"],\"diocese\":[\"portuguese\"],\"direto\":[\"portuguese\"],\"discreta\":[\"portuguese\"],\"disfarce\":[\"portuguese\"],\"disparo\":[\"portuguese\"],\"disquete\":[\"portuguese\"],\"dissipar\":[\"portuguese\"],\"distante\":[\"portuguese\"],\"ditador\":[\"portuguese\"],\"diurno\":[\"portuguese\"],\"diverso\":[\"portuguese\"],\"divisor\":[\"portuguese\"],\"divulgar\":[\"portuguese\"],\"dizer\":[\"portuguese\"],\"dobrador\":[\"portuguese\"],\"dolorido\":[\"portuguese\"],\"domador\":[\"portuguese\"],\"dominado\":[\"portuguese\"],\"donativo\":[\"portuguese\"],\"donzela\":[\"portuguese\"],\"dormente\":[\"portuguese\"],\"dorsal\":[\"portuguese\"],\"dosagem\":[\"portuguese\"],\"dourado\":[\"portuguese\"],\"doutor\":[\"portuguese\"],\"drenagem\":[\"portuguese\"],\"drible\":[\"portuguese\"],\"drogaria\":[\"portuguese\"],\"duelar\":[\"portuguese\"],\"duende\":[\"portuguese\"],\"dueto\":[\"portuguese\"],\"duplo\":[\"portuguese\"],\"duquesa\":[\"portuguese\"],\"durante\":[\"portuguese\"],\"duvidoso\":[\"portuguese\"],\"eclodir\":[\"portuguese\"],\"ecoar\":[\"portuguese\"],\"ecologia\":[\"portuguese\"],\"edificar\":[\"portuguese\"],\"edital\":[\"portuguese\"],\"educado\":[\"portuguese\"],\"efeito\":[\"portuguese\"],\"efetivar\":[\"portuguese\"],\"ejetar\":[\"portuguese\"],\"elaborar\":[\"portuguese\"],\"eleger\":[\"portuguese\"],\"eleitor\":[\"portuguese\"],\"elenco\":[\"portuguese\"],\"elevador\":[\"portuguese\"],\"eliminar\":[\"portuguese\"],\"elogiar\":[\"portuguese\"],\"embargo\":[\"portuguese\"],\"embolado\":[\"portuguese\"],\"embrulho\":[\"portuguese\"],\"embutido\":[\"portuguese\"],\"emenda\":[\"portuguese\"],\"emergir\":[\"portuguese\"],\"emissor\":[\"portuguese\"],\"empatia\":[\"portuguese\"],\"empenho\":[\"portuguese\"],\"empinado\":[\"portuguese\"],\"empolgar\":[\"portuguese\"],\"emprego\":[\"portuguese\"],\"empurrar\":[\"portuguese\"],\"emulador\":[\"portuguese\"],\"encaixe\":[\"portuguese\"],\"encenado\":[\"portuguese\"],\"enchente\":[\"portuguese\"],\"encontro\":[\"portuguese\"],\"endeusar\":[\"portuguese\"],\"endossar\":[\"portuguese\"],\"enfaixar\":[\"portuguese\"],\"enfeite\":[\"portuguese\"],\"enfim\":[\"portuguese\"],\"engajado\":[\"portuguese\"],\"engenho\":[\"portuguese\"],\"englobar\":[\"portuguese\"],\"engomado\":[\"portuguese\"],\"engraxar\":[\"portuguese\"],\"enguia\":[\"portuguese\"],\"enjoar\":[\"portuguese\"],\"enlatar\":[\"portuguese\"],\"enquanto\":[\"portuguese\"],\"enraizar\":[\"portuguese\"],\"enrolado\":[\"portuguese\"],\"enrugar\":[\"portuguese\"],\"ensaio\":[\"portuguese\"],\"enseada\":[\"portuguese\"],\"ensino\":[\"portuguese\"],\"ensopado\":[\"portuguese\"],\"entanto\":[\"portuguese\"],\"enteado\":[\"portuguese\"],\"entidade\":[\"portuguese\"],\"entortar\":[\"portuguese\"],\"entrada\":[\"portuguese\"],\"entulho\":[\"portuguese\"],\"envergar\":[\"portuguese\"],\"enviado\":[\"portuguese\"],\"envolver\":[\"portuguese\"],\"enxame\":[\"portuguese\"],\"enxerto\":[\"portuguese\"],\"enxofre\":[\"portuguese\"],\"enxuto\":[\"portuguese\"],\"epiderme\":[\"portuguese\"],\"equipar\":[\"portuguese\"],\"ereto\":[\"portuguese\"],\"erguido\":[\"portuguese\"],\"errata\":[\"portuguese\"],\"erva\":[\"portuguese\"],\"ervilha\":[\"portuguese\"],\"esbanjar\":[\"portuguese\"],\"esbelto\":[\"portuguese\"],\"escama\":[\"portuguese\"],\"escola\":[\"portuguese\"],\"escrita\":[\"portuguese\"],\"escuta\":[\"portuguese\"],\"esfinge\":[\"portuguese\"],\"esfolar\":[\"portuguese\"],\"esfregar\":[\"portuguese\"],\"esfumado\":[\"portuguese\"],\"esgrima\":[\"portuguese\"],\"esmalte\":[\"portuguese\"],\"espanto\":[\"portuguese\"],\"espelho\":[\"portuguese\"],\"espiga\":[\"portuguese\"],\"esponja\":[\"portuguese\"],\"espreita\":[\"portuguese\"],\"espumar\":[\"portuguese\"],\"esquerda\":[\"portuguese\"],\"estaca\":[\"portuguese\"],\"esteira\":[\"portuguese\"],\"esticar\":[\"portuguese\"],\"estofado\":[\"portuguese\"],\"estrela\":[\"portuguese\"],\"estudo\":[\"portuguese\"],\"esvaziar\":[\"portuguese\"],\"etanol\":[\"portuguese\"],\"etiqueta\":[\"portuguese\"],\"euforia\":[\"portuguese\"],\"europeu\":[\"portuguese\"],\"evacuar\":[\"portuguese\"],\"evaporar\":[\"portuguese\"],\"evasivo\":[\"portuguese\"],\"eventual\":[\"portuguese\"],\"evidente\":[\"portuguese\"],\"evoluir\":[\"portuguese\"],\"exagero\":[\"portuguese\"],\"exalar\":[\"portuguese\"],\"examinar\":[\"portuguese\"],\"exato\":[\"portuguese\"],\"exausto\":[\"portuguese\"],\"excesso\":[\"portuguese\"],\"excitar\":[\"portuguese\"],\"exclamar\":[\"portuguese\"],\"executar\":[\"portuguese\"],\"exemplo\":[\"portuguese\"],\"exibir\":[\"portuguese\"],\"exigente\":[\"portuguese\"],\"exonerar\":[\"portuguese\"],\"expandir\":[\"portuguese\"],\"expelir\":[\"portuguese\"],\"expirar\":[\"portuguese\"],\"explanar\":[\"portuguese\"],\"exposto\":[\"portuguese\"],\"expresso\":[\"portuguese\"],\"expulsar\":[\"portuguese\"],\"externo\":[\"portuguese\"],\"extinto\":[\"portuguese\"],\"extrato\":[\"portuguese\"],\"fabricar\":[\"portuguese\"],\"fabuloso\":[\"portuguese\"],\"faceta\":[\"portuguese\"],\"facial\":[\"portuguese\"],\"fada\":[\"portuguese\"],\"fadiga\":[\"portuguese\"],\"faixa\":[\"portuguese\"],\"falar\":[\"portuguese\"],\"falta\":[\"portuguese\"],\"familiar\":[\"portuguese\"],\"fandango\":[\"portuguese\"],\"fanfarra\":[\"portuguese\"],\"fantoche\":[\"portuguese\"],\"fardado\":[\"portuguese\"],\"farelo\":[\"portuguese\"],\"farinha\":[\"portuguese\"],\"farofa\":[\"portuguese\"],\"farpa\":[\"portuguese\"],\"fartura\":[\"portuguese\"],\"fatia\":[\"portuguese\"],\"fator\":[\"portuguese\"],\"favorita\":[\"portuguese\"],\"faxina\":[\"portuguese\"],\"fazenda\":[\"portuguese\"],\"fechado\":[\"portuguese\"],\"feijoada\":[\"portuguese\"],\"feirante\":[\"portuguese\"],\"felino\":[\"portuguese\"],\"feminino\":[\"portuguese\"],\"fenda\":[\"portuguese\"],\"feno\":[\"portuguese\"],\"fera\":[\"portuguese\"],\"feriado\":[\"portuguese\"],\"ferrugem\":[\"portuguese\"],\"ferver\":[\"portuguese\"],\"festejar\":[\"portuguese\"],\"fetal\":[\"portuguese\"],\"feudal\":[\"portuguese\"],\"fiapo\":[\"portuguese\"],\"fibrose\":[\"portuguese\"],\"ficar\":[\"portuguese\"],\"ficheiro\":[\"portuguese\"],\"figurado\":[\"portuguese\"],\"fileira\":[\"portuguese\"],\"filho\":[\"portuguese\"],\"filme\":[\"portuguese\"],\"filtrar\":[\"portuguese\"],\"firmeza\":[\"portuguese\"],\"fisgada\":[\"portuguese\"],\"fissura\":[\"portuguese\"],\"fita\":[\"portuguese\"],\"fivela\":[\"portuguese\"],\"fixador\":[\"portuguese\"],\"fixo\":[\"portuguese\"],\"flacidez\":[\"portuguese\"],\"flamingo\":[\"portuguese\"],\"flanela\":[\"portuguese\"],\"flechada\":[\"portuguese\"],\"flora\":[\"portuguese\"],\"flutuar\":[\"portuguese\"],\"fluxo\":[\"portuguese\"],\"focal\":[\"portuguese\"],\"focinho\":[\"portuguese\"],\"fofocar\":[\"portuguese\"],\"fogo\":[\"portuguese\"],\"foguete\":[\"portuguese\"],\"foice\":[\"portuguese\"],\"folgado\":[\"portuguese\"],\"folheto\":[\"portuguese\"],\"forjar\":[\"portuguese\"],\"formiga\":[\"portuguese\"],\"forno\":[\"portuguese\"],\"forte\":[\"portuguese\"],\"fosco\":[\"portuguese\"],\"fossa\":[\"portuguese\"],\"fragata\":[\"portuguese\"],\"fralda\":[\"portuguese\"],\"frango\":[\"portuguese\"],\"frasco\":[\"portuguese\"],\"fraterno\":[\"portuguese\"],\"freira\":[\"portuguese\"],\"frente\":[\"portuguese\"],\"fretar\":[\"portuguese\"],\"frieza\":[\"portuguese\"],\"friso\":[\"portuguese\"],\"fritura\":[\"portuguese\"],\"fronha\":[\"portuguese\"],\"frustrar\":[\"portuguese\"],\"fruteira\":[\"portuguese\"],\"fugir\":[\"portuguese\"],\"fulano\":[\"portuguese\"],\"fuligem\":[\"portuguese\"],\"fundar\":[\"portuguese\"],\"fungo\":[\"portuguese\"],\"funil\":[\"portuguese\"],\"furador\":[\"portuguese\"],\"furioso\":[\"portuguese\"],\"futebol\":[\"portuguese\"],\"gabarito\":[\"portuguese\"],\"gabinete\":[\"portuguese\"],\"gado\":[\"portuguese\"],\"gaiato\":[\"portuguese\"],\"gaiola\":[\"portuguese\"],\"gaivota\":[\"portuguese\"],\"galega\":[\"portuguese\"],\"galho\":[\"portuguese\"],\"galinha\":[\"portuguese\"],\"galocha\":[\"portuguese\"],\"ganhar\":[\"portuguese\"],\"garagem\":[\"portuguese\"],\"garfo\":[\"portuguese\"],\"gargalo\":[\"portuguese\"],\"garimpo\":[\"portuguese\"],\"garoupa\":[\"portuguese\"],\"garrafa\":[\"portuguese\"],\"gasoduto\":[\"portuguese\"],\"gasto\":[\"portuguese\"],\"gata\":[\"portuguese\"],\"gatilho\":[\"portuguese\"],\"gaveta\":[\"portuguese\"],\"gazela\":[\"portuguese\"],\"gelado\":[\"portuguese\"],\"geleia\":[\"portuguese\"],\"gelo\":[\"portuguese\"],\"gemada\":[\"portuguese\"],\"gemer\":[\"portuguese\"],\"gemido\":[\"portuguese\"],\"generoso\":[\"portuguese\"],\"gengiva\":[\"portuguese\"],\"genial\":[\"portuguese\"],\"genoma\":[\"portuguese\"],\"genro\":[\"portuguese\"],\"geologia\":[\"portuguese\"],\"gerador\":[\"portuguese\"],\"germinar\":[\"portuguese\"],\"gesso\":[\"portuguese\"],\"gestor\":[\"portuguese\"],\"ginasta\":[\"portuguese\"],\"gincana\":[\"portuguese\"],\"gingado\":[\"portuguese\"],\"girafa\":[\"portuguese\"],\"girino\":[\"portuguese\"],\"glacial\":[\"portuguese\"],\"glicose\":[\"portuguese\"],\"global\":[\"portuguese\"],\"glorioso\":[\"portuguese\"],\"goela\":[\"portuguese\"],\"goiaba\":[\"portuguese\"],\"golfe\":[\"portuguese\"],\"golpear\":[\"portuguese\"],\"gordura\":[\"portuguese\"],\"gorjeta\":[\"portuguese\"],\"gorro\":[\"portuguese\"],\"gostoso\":[\"portuguese\"],\"goteira\":[\"portuguese\"],\"governar\":[\"portuguese\"],\"gracejo\":[\"portuguese\"],\"gradual\":[\"portuguese\"],\"grafite\":[\"portuguese\"],\"gralha\":[\"portuguese\"],\"grampo\":[\"portuguese\"],\"granada\":[\"portuguese\"],\"gratuito\":[\"portuguese\"],\"graveto\":[\"portuguese\"],\"graxa\":[\"portuguese\"],\"grego\":[\"portuguese\"],\"grelhar\":[\"portuguese\"],\"greve\":[\"portuguese\"],\"grilo\":[\"portuguese\"],\"grisalho\":[\"portuguese\"],\"gritaria\":[\"portuguese\"],\"grosso\":[\"portuguese\"],\"grotesco\":[\"portuguese\"],\"grudado\":[\"portuguese\"],\"grunhido\":[\"portuguese\"],\"gruta\":[\"portuguese\"],\"guache\":[\"portuguese\"],\"guarani\":[\"portuguese\"],\"guaxinim\":[\"portuguese\"],\"guerrear\":[\"portuguese\"],\"guiar\":[\"portuguese\"],\"guincho\":[\"portuguese\"],\"guisado\":[\"portuguese\"],\"gula\":[\"portuguese\"],\"guloso\":[\"portuguese\"],\"guru\":[\"portuguese\"],\"habitar\":[\"portuguese\"],\"harmonia\":[\"portuguese\"],\"haste\":[\"portuguese\"],\"haver\":[\"portuguese\"],\"hectare\":[\"portuguese\"],\"herdar\":[\"portuguese\"],\"heresia\":[\"portuguese\"],\"hesitar\":[\"portuguese\"],\"hiato\":[\"portuguese\"],\"hibernar\":[\"portuguese\"],\"hidratar\":[\"portuguese\"],\"hiena\":[\"portuguese\"],\"hino\":[\"portuguese\"],\"hipismo\":[\"portuguese\"],\"hipnose\":[\"portuguese\"],\"hipoteca\":[\"portuguese\"],\"hoje\":[\"portuguese\"],\"holofote\":[\"portuguese\"],\"homem\":[\"portuguese\"],\"honesto\":[\"portuguese\"],\"honrado\":[\"portuguese\"],\"hormonal\":[\"portuguese\"],\"hospedar\":[\"portuguese\"],\"humorado\":[\"portuguese\"],\"iate\":[\"portuguese\"],\"ideia\":[\"portuguese\"],\"idoso\":[\"portuguese\"],\"ignorado\":[\"portuguese\"],\"igreja\":[\"portuguese\"],\"iguana\":[\"portuguese\"],\"ileso\":[\"portuguese\"],\"ilha\":[\"portuguese\"],\"iludido\":[\"portuguese\"],\"iluminar\":[\"portuguese\"],\"ilustrar\":[\"portuguese\"],\"imagem\":[\"portuguese\"],\"imediato\":[\"portuguese\"],\"imenso\":[\"portuguese\"],\"imersivo\":[\"portuguese\"],\"iminente\":[\"portuguese\"],\"imitador\":[\"portuguese\"],\"imortal\":[\"portuguese\"],\"impacto\":[\"portuguese\"],\"impedir\":[\"portuguese\"],\"implante\":[\"portuguese\"],\"impor\":[\"portuguese\"],\"imprensa\":[\"portuguese\"],\"impune\":[\"portuguese\"],\"imunizar\":[\"portuguese\"],\"inalador\":[\"portuguese\"],\"inapto\":[\"portuguese\"],\"inativo\":[\"portuguese\"],\"incenso\":[\"portuguese\"],\"inchar\":[\"portuguese\"],\"incidir\":[\"portuguese\"],\"incluir\":[\"portuguese\"],\"incolor\":[\"portuguese\"],\"indeciso\":[\"portuguese\"],\"indireto\":[\"portuguese\"],\"indutor\":[\"portuguese\"],\"ineficaz\":[\"portuguese\"],\"inerente\":[\"portuguese\"],\"infantil\":[\"portuguese\"],\"infestar\":[\"portuguese\"],\"infinito\":[\"portuguese\"],\"inflamar\":[\"portuguese\"],\"informal\":[\"portuguese\"],\"infrator\":[\"portuguese\"],\"ingerir\":[\"portuguese\"],\"inibido\":[\"portuguese\"],\"inicial\":[\"portuguese\"],\"inimigo\":[\"portuguese\"],\"injetar\":[\"portuguese\"],\"inocente\":[\"portuguese\"],\"inodoro\":[\"portuguese\"],\"inovador\":[\"portuguese\"],\"inox\":[\"portuguese\"],\"inquieto\":[\"portuguese\"],\"inscrito\":[\"portuguese\"],\"inseto\":[\"portuguese\"],\"insistir\":[\"portuguese\"],\"inspetor\":[\"portuguese\"],\"instalar\":[\"portuguese\"],\"insulto\":[\"portuguese\"],\"intacto\":[\"portuguese\"],\"integral\":[\"portuguese\"],\"intimar\":[\"portuguese\"],\"intocado\":[\"portuguese\"],\"intriga\":[\"portuguese\"],\"invasor\":[\"portuguese\"],\"inverno\":[\"portuguese\"],\"invicto\":[\"portuguese\"],\"invocar\":[\"portuguese\"],\"iogurte\":[\"portuguese\"],\"iraniano\":[\"portuguese\"],\"ironizar\":[\"portuguese\"],\"irreal\":[\"portuguese\"],\"irritado\":[\"portuguese\"],\"isca\":[\"portuguese\"],\"isento\":[\"portuguese\"],\"isolado\":[\"portuguese\"],\"isqueiro\":[\"portuguese\"],\"italiano\":[\"portuguese\"],\"janeiro\":[\"portuguese\"],\"jangada\":[\"portuguese\"],\"janta\":[\"portuguese\"],\"jararaca\":[\"portuguese\"],\"jardim\":[\"portuguese\"],\"jarro\":[\"portuguese\"],\"jasmim\":[\"portuguese\"],\"jato\":[\"portuguese\"],\"javali\":[\"portuguese\"],\"jazida\":[\"portuguese\"],\"jejum\":[\"portuguese\"],\"joaninha\":[\"portuguese\"],\"joelhada\":[\"portuguese\"],\"jogador\":[\"portuguese\"],\"joia\":[\"portuguese\"],\"jornal\":[\"portuguese\"],\"jorrar\":[\"portuguese\"],\"jovem\":[\"portuguese\"],\"juba\":[\"portuguese\"],\"judeu\":[\"portuguese\"],\"judoca\":[\"portuguese\"],\"juiz\":[\"portuguese\"],\"julgador\":[\"portuguese\"],\"julho\":[\"portuguese\"],\"jurado\":[\"portuguese\"],\"jurista\":[\"portuguese\"],\"juro\":[\"portuguese\"],\"justa\":[\"portuguese\"],\"labareda\":[\"portuguese\"],\"laboral\":[\"portuguese\"],\"lacre\":[\"portuguese\"],\"lactante\":[\"portuguese\"],\"ladrilho\":[\"portuguese\"],\"lagarta\":[\"portuguese\"],\"lagoa\":[\"portuguese\"],\"laje\":[\"portuguese\"],\"lamber\":[\"portuguese\"],\"lamentar\":[\"portuguese\"],\"laminar\":[\"portuguese\"],\"lampejo\":[\"portuguese\"],\"lanche\":[\"portuguese\"],\"lapidar\":[\"portuguese\"],\"lapso\":[\"portuguese\"],\"laranja\":[\"portuguese\"],\"lareira\":[\"portuguese\"],\"largura\":[\"portuguese\"],\"lasanha\":[\"portuguese\"],\"lastro\":[\"portuguese\"],\"lateral\":[\"portuguese\"],\"latido\":[\"portuguese\"],\"lavanda\":[\"portuguese\"],\"lavoura\":[\"portuguese\"],\"lavrador\":[\"portuguese\"],\"laxante\":[\"portuguese\"],\"lazer\":[\"portuguese\"],\"lealdade\":[\"portuguese\"],\"lebre\":[\"portuguese\"],\"legado\":[\"portuguese\"],\"legendar\":[\"portuguese\"],\"legista\":[\"portuguese\"],\"leigo\":[\"portuguese\"],\"leiloar\":[\"portuguese\"],\"leitura\":[\"portuguese\"],\"lembrete\":[\"portuguese\"],\"leme\":[\"portuguese\"],\"lenhador\":[\"portuguese\"],\"lentilha\":[\"portuguese\"],\"leoa\":[\"portuguese\"],\"lesma\":[\"portuguese\"],\"leste\":[\"portuguese\"],\"letivo\":[\"portuguese\"],\"letreiro\":[\"portuguese\"],\"levar\":[\"portuguese\"],\"leveza\":[\"portuguese\"],\"levitar\":[\"portuguese\"],\"liberal\":[\"portuguese\"],\"libido\":[\"portuguese\"],\"liderar\":[\"portuguese\"],\"ligar\":[\"portuguese\"],\"ligeiro\":[\"portuguese\"],\"limitar\":[\"portuguese\"],\"limoeiro\":[\"portuguese\"],\"limpador\":[\"portuguese\"],\"linda\":[\"portuguese\"],\"linear\":[\"portuguese\"],\"linhagem\":[\"portuguese\"],\"liquidez\":[\"portuguese\"],\"listagem\":[\"portuguese\"],\"lisura\":[\"portuguese\"],\"litoral\":[\"portuguese\"],\"livro\":[\"portuguese\"],\"lixa\":[\"portuguese\"],\"lixeira\":[\"portuguese\"],\"locador\":[\"portuguese\"],\"locutor\":[\"portuguese\"],\"lojista\":[\"portuguese\"],\"lombo\":[\"portuguese\"],\"lona\":[\"portuguese\"],\"longe\":[\"portuguese\"],\"lontra\":[\"portuguese\"],\"lorde\":[\"portuguese\"],\"lotado\":[\"portuguese\"],\"loteria\":[\"portuguese\"],\"loucura\":[\"portuguese\"],\"lousa\":[\"portuguese\"],\"louvar\":[\"portuguese\"],\"luar\":[\"portuguese\"],\"lucidez\":[\"portuguese\"],\"lucro\":[\"portuguese\"],\"luneta\":[\"portuguese\"],\"lustre\":[\"portuguese\"],\"lutador\":[\"portuguese\"],\"luva\":[\"portuguese\"],\"macaco\":[\"portuguese\"],\"macete\":[\"portuguese\"],\"machado\":[\"portuguese\"],\"macio\":[\"portuguese\"],\"madeira\":[\"portuguese\"],\"madrinha\":[\"portuguese\"],\"magnata\":[\"portuguese\"],\"magreza\":[\"portuguese\"],\"maior\":[\"portuguese\"],\"mais\":[\"portuguese\"],\"malandro\":[\"portuguese\"],\"malha\":[\"portuguese\"],\"malote\":[\"portuguese\"],\"maluco\":[\"portuguese\"],\"mamilo\":[\"portuguese\"],\"mamoeiro\":[\"portuguese\"],\"mamute\":[\"portuguese\"],\"manada\":[\"portuguese\"],\"mancha\":[\"portuguese\"],\"mandato\":[\"portuguese\"],\"manequim\":[\"portuguese\"],\"manhoso\":[\"portuguese\"],\"manivela\":[\"portuguese\"],\"manobrar\":[\"portuguese\"],\"mansa\":[\"portuguese\"],\"manter\":[\"portuguese\"],\"manusear\":[\"portuguese\"],\"mapeado\":[\"portuguese\"],\"maquinar\":[\"portuguese\"],\"marcador\":[\"portuguese\"],\"maresia\":[\"portuguese\"],\"marfim\":[\"portuguese\"],\"margem\":[\"portuguese\"],\"marinho\":[\"portuguese\"],\"marmita\":[\"portuguese\"],\"maroto\":[\"portuguese\"],\"marquise\":[\"portuguese\"],\"marreco\":[\"portuguese\"],\"martelo\":[\"portuguese\"],\"marujo\":[\"portuguese\"],\"mascote\":[\"portuguese\"],\"masmorra\":[\"portuguese\"],\"massagem\":[\"portuguese\"],\"mastigar\":[\"portuguese\"],\"matagal\":[\"portuguese\"],\"materno\":[\"portuguese\"],\"matinal\":[\"portuguese\"],\"matutar\":[\"portuguese\"],\"maxilar\":[\"portuguese\"],\"medalha\":[\"portuguese\"],\"medida\":[\"portuguese\"],\"medusa\":[\"portuguese\"],\"megafone\":[\"portuguese\"],\"meiga\":[\"portuguese\"],\"melancia\":[\"portuguese\"],\"melhor\":[\"portuguese\"],\"membro\":[\"portuguese\"],\"memorial\":[\"portuguese\"],\"menino\":[\"portuguese\"],\"menos\":[\"portuguese\"],\"mensagem\":[\"portuguese\"],\"mental\":[\"portuguese\"],\"merecer\":[\"portuguese\"],\"mergulho\":[\"portuguese\"],\"mesada\":[\"portuguese\"],\"mesclar\":[\"portuguese\"],\"mesmo\":[\"portuguese\"],\"mesquita\":[\"portuguese\"],\"mestre\":[\"portuguese\"],\"metade\":[\"portuguese\"],\"meteoro\":[\"portuguese\"],\"metragem\":[\"portuguese\"],\"mexer\":[\"portuguese\"],\"mexicano\":[\"portuguese\"],\"micro\":[\"portuguese\"],\"migalha\":[\"portuguese\"],\"migrar\":[\"portuguese\"],\"milagre\":[\"portuguese\"],\"milenar\":[\"portuguese\"],\"milhar\":[\"portuguese\"],\"mimado\":[\"portuguese\"],\"minerar\":[\"portuguese\"],\"minhoca\":[\"portuguese\"],\"ministro\":[\"portuguese\"],\"minoria\":[\"portuguese\"],\"miolo\":[\"portuguese\"],\"mirante\":[\"portuguese\"],\"mirtilo\":[\"portuguese\"],\"misturar\":[\"portuguese\"],\"mocidade\":[\"portuguese\"],\"moderno\":[\"portuguese\"],\"modular\":[\"portuguese\"],\"moeda\":[\"portuguese\"],\"moer\":[\"portuguese\"],\"moinho\":[\"portuguese\"],\"moita\":[\"portuguese\"],\"moldura\":[\"portuguese\"],\"moleza\":[\"portuguese\"],\"molho\":[\"portuguese\"],\"molinete\":[\"portuguese\"],\"molusco\":[\"portuguese\"],\"montanha\":[\"portuguese\"],\"moqueca\":[\"portuguese\"],\"morango\":[\"portuguese\"],\"morcego\":[\"portuguese\"],\"mordomo\":[\"portuguese\"],\"morena\":[\"portuguese\"],\"mosaico\":[\"portuguese\"],\"mosquete\":[\"portuguese\"],\"mostarda\":[\"portuguese\"],\"motel\":[\"portuguese\"],\"motim\":[\"portuguese\"],\"moto\":[\"portuguese\"],\"motriz\":[\"portuguese\"],\"muda\":[\"portuguese\"],\"muito\":[\"portuguese\"],\"mulata\":[\"portuguese\"],\"mulher\":[\"portuguese\"],\"multar\":[\"portuguese\"],\"mundial\":[\"portuguese\"],\"munido\":[\"portuguese\"],\"muralha\":[\"portuguese\"],\"murcho\":[\"portuguese\"],\"muscular\":[\"portuguese\"],\"museu\":[\"portuguese\"],\"musical\":[\"portuguese\"],\"nacional\":[\"portuguese\"],\"nadador\":[\"portuguese\"],\"naja\":[\"portuguese\"],\"namoro\":[\"portuguese\"],\"narina\":[\"portuguese\"],\"narrado\":[\"portuguese\"],\"nascer\":[\"portuguese\"],\"nativa\":[\"portuguese\"],\"natureza\":[\"portuguese\"],\"navalha\":[\"portuguese\"],\"navegar\":[\"portuguese\"],\"navio\":[\"portuguese\"],\"neblina\":[\"portuguese\"],\"nebuloso\":[\"portuguese\"],\"negativa\":[\"portuguese\"],\"negociar\":[\"portuguese\"],\"negrito\":[\"portuguese\"],\"nervoso\":[\"portuguese\"],\"neta\":[\"portuguese\"],\"neural\":[\"portuguese\"],\"nevasca\":[\"portuguese\"],\"nevoeiro\":[\"portuguese\"],\"ninar\":[\"portuguese\"],\"ninho\":[\"portuguese\"],\"nitidez\":[\"portuguese\"],\"nivelar\":[\"portuguese\"],\"nobreza\":[\"portuguese\"],\"noite\":[\"portuguese\"],\"noiva\":[\"portuguese\"],\"nomear\":[\"portuguese\"],\"nominal\":[\"portuguese\"],\"nordeste\":[\"portuguese\"],\"nortear\":[\"portuguese\"],\"notar\":[\"portuguese\"],\"noticiar\":[\"portuguese\"],\"noturno\":[\"portuguese\"],\"novelo\":[\"portuguese\"],\"novilho\":[\"portuguese\"],\"novo\":[\"portuguese\"],\"nublado\":[\"portuguese\"],\"nudez\":[\"portuguese\"],\"numeral\":[\"portuguese\"],\"nupcial\":[\"portuguese\"],\"nutrir\":[\"portuguese\"],\"nuvem\":[\"portuguese\"],\"obcecado\":[\"portuguese\"],\"obedecer\":[\"portuguese\"],\"objetivo\":[\"portuguese\"],\"obrigado\":[\"portuguese\"],\"obscuro\":[\"portuguese\"],\"obstetra\":[\"portuguese\"],\"obter\":[\"portuguese\"],\"obturar\":[\"portuguese\"],\"ocidente\":[\"portuguese\"],\"ocioso\":[\"portuguese\"],\"ocorrer\":[\"portuguese\"],\"oculista\":[\"portuguese\"],\"ocupado\":[\"portuguese\"],\"ofegante\":[\"portuguese\"],\"ofensiva\":[\"portuguese\"],\"oferenda\":[\"portuguese\"],\"oficina\":[\"portuguese\"],\"ofuscado\":[\"portuguese\"],\"ogiva\":[\"portuguese\"],\"olaria\":[\"portuguese\"],\"oleoso\":[\"portuguese\"],\"olhar\":[\"portuguese\"],\"oliveira\":[\"portuguese\"],\"ombro\":[\"portuguese\"],\"omelete\":[\"portuguese\"],\"omisso\":[\"portuguese\"],\"omitir\":[\"portuguese\"],\"ondulado\":[\"portuguese\"],\"oneroso\":[\"portuguese\"],\"ontem\":[\"portuguese\"],\"opcional\":[\"portuguese\"],\"operador\":[\"portuguese\"],\"oponente\":[\"portuguese\"],\"oportuno\":[\"portuguese\"],\"oposto\":[\"portuguese\"],\"orar\":[\"portuguese\"],\"orbitar\":[\"portuguese\"],\"ordem\":[\"portuguese\"],\"ordinal\":[\"portuguese\"],\"orfanato\":[\"portuguese\"],\"orgasmo\":[\"portuguese\"],\"orgulho\":[\"portuguese\"],\"oriental\":[\"portuguese\"],\"origem\":[\"portuguese\"],\"oriundo\":[\"portuguese\"],\"orla\":[\"portuguese\"],\"ortodoxo\":[\"portuguese\"],\"orvalho\":[\"portuguese\"],\"oscilar\":[\"portuguese\"],\"ossada\":[\"portuguese\"],\"osso\":[\"portuguese\"],\"ostentar\":[\"portuguese\"],\"otimismo\":[\"portuguese\"],\"ousadia\":[\"portuguese\"],\"outono\":[\"portuguese\"],\"outubro\":[\"portuguese\"],\"ouvido\":[\"portuguese\"],\"ovelha\":[\"portuguese\"],\"ovular\":[\"portuguese\"],\"oxidar\":[\"portuguese\"],\"oxigenar\":[\"portuguese\"],\"pacato\":[\"portuguese\"],\"paciente\":[\"portuguese\"],\"pacote\":[\"portuguese\"],\"pactuar\":[\"portuguese\"],\"padaria\":[\"portuguese\"],\"padrinho\":[\"portuguese\"],\"pagar\":[\"portuguese\"],\"pagode\":[\"portuguese\"],\"painel\":[\"portuguese\"],\"pairar\":[\"portuguese\"],\"paisagem\":[\"portuguese\"],\"palavra\":[\"portuguese\"],\"palestra\":[\"portuguese\"],\"palheta\":[\"portuguese\"],\"palito\":[\"portuguese\"],\"palmada\":[\"portuguese\"],\"palpitar\":[\"portuguese\"],\"pancada\":[\"portuguese\"],\"panela\":[\"portuguese\"],\"panfleto\":[\"portuguese\"],\"panqueca\":[\"portuguese\"],\"pantanal\":[\"portuguese\"],\"papagaio\":[\"portuguese\"],\"papelada\":[\"portuguese\"],\"papiro\":[\"portuguese\"],\"parafina\":[\"portuguese\"],\"parcial\":[\"portuguese\"],\"pardal\":[\"portuguese\"],\"parede\":[\"portuguese\"],\"partida\":[\"portuguese\"],\"pasmo\":[\"portuguese\"],\"passado\":[\"portuguese\"],\"pastel\":[\"portuguese\"],\"patamar\":[\"portuguese\"],\"patente\":[\"portuguese\"],\"patinar\":[\"portuguese\"],\"patrono\":[\"portuguese\"],\"paulada\":[\"portuguese\"],\"pausar\":[\"portuguese\"],\"peculiar\":[\"portuguese\"],\"pedalar\":[\"portuguese\"],\"pedestre\":[\"portuguese\"],\"pediatra\":[\"portuguese\"],\"pedra\":[\"portuguese\"],\"pegada\":[\"portuguese\"],\"peitoral\":[\"portuguese\"],\"peixe\":[\"portuguese\"],\"pele\":[\"portuguese\"],\"pelicano\":[\"portuguese\"],\"penca\":[\"portuguese\"],\"pendurar\":[\"portuguese\"],\"peneira\":[\"portuguese\"],\"penhasco\":[\"portuguese\"],\"pensador\":[\"portuguese\"],\"pente\":[\"portuguese\"],\"perceber\":[\"portuguese\"],\"perfeito\":[\"portuguese\"],\"pergunta\":[\"portuguese\"],\"perito\":[\"portuguese\"],\"permitir\":[\"portuguese\"],\"perna\":[\"portuguese\"],\"perplexo\":[\"portuguese\"],\"persiana\":[\"portuguese\"],\"pertence\":[\"portuguese\"],\"peruca\":[\"portuguese\"],\"pescado\":[\"portuguese\"],\"pesquisa\":[\"portuguese\"],\"pessoa\":[\"portuguese\"],\"petiscar\":[\"portuguese\"],\"piada\":[\"portuguese\"],\"picado\":[\"portuguese\"],\"piedade\":[\"portuguese\"],\"pigmento\":[\"portuguese\"],\"pilastra\":[\"portuguese\"],\"pilhado\":[\"portuguese\"],\"pilotar\":[\"portuguese\"],\"pimenta\":[\"portuguese\"],\"pincel\":[\"portuguese\"],\"pinguim\":[\"portuguese\"],\"pinha\":[\"portuguese\"],\"pinote\":[\"portuguese\"],\"pintar\":[\"portuguese\"],\"pioneiro\":[\"portuguese\"],\"pipoca\":[\"portuguese\"],\"piquete\":[\"portuguese\"],\"piranha\":[\"portuguese\"],\"pires\":[\"portuguese\"],\"pirueta\":[\"portuguese\"],\"piscar\":[\"portuguese\"],\"pistola\":[\"portuguese\"],\"pitanga\":[\"portuguese\"],\"pivete\":[\"portuguese\"],\"planta\":[\"portuguese\"],\"plaqueta\":[\"portuguese\"],\"platina\":[\"portuguese\"],\"plebeu\":[\"portuguese\"],\"plumagem\":[\"portuguese\"],\"pluvial\":[\"portuguese\"],\"pneu\":[\"portuguese\"],\"poda\":[\"portuguese\"],\"poeira\":[\"portuguese\"],\"poetisa\":[\"portuguese\"],\"polegada\":[\"portuguese\"],\"policiar\":[\"portuguese\"],\"poluente\":[\"portuguese\"],\"polvilho\":[\"portuguese\"],\"pomar\":[\"portuguese\"],\"pomba\":[\"portuguese\"],\"ponderar\":[\"portuguese\"],\"pontaria\":[\"portuguese\"],\"populoso\":[\"portuguese\"],\"porta\":[\"portuguese\"],\"possuir\":[\"portuguese\"],\"postal\":[\"portuguese\"],\"pote\":[\"portuguese\"],\"poupar\":[\"portuguese\"],\"pouso\":[\"portuguese\"],\"povoar\":[\"portuguese\"],\"praia\":[\"portuguese\"],\"prancha\":[\"portuguese\"],\"prato\":[\"portuguese\"],\"praxe\":[\"portuguese\"],\"prece\":[\"portuguese\"],\"predador\":[\"portuguese\"],\"prefeito\":[\"portuguese\"],\"premiar\":[\"portuguese\"],\"prensar\":[\"portuguese\"],\"preparar\":[\"portuguese\"],\"presilha\":[\"portuguese\"],\"pretexto\":[\"portuguese\"],\"prevenir\":[\"portuguese\"],\"prezar\":[\"portuguese\"],\"primata\":[\"portuguese\"],\"princesa\":[\"portuguese\"],\"prisma\":[\"portuguese\"],\"privado\":[\"portuguese\"],\"processo\":[\"portuguese\"],\"produto\":[\"portuguese\"],\"profeta\":[\"portuguese\"],\"proibido\":[\"portuguese\"],\"projeto\":[\"portuguese\"],\"prometer\":[\"portuguese\"],\"propagar\":[\"portuguese\"],\"prosa\":[\"portuguese\"],\"protetor\":[\"portuguese\"],\"provador\":[\"portuguese\"],\"publicar\":[\"portuguese\"],\"pudim\":[\"portuguese\"],\"pular\":[\"portuguese\"],\"pulmonar\":[\"portuguese\"],\"pulseira\":[\"portuguese\"],\"punhal\":[\"portuguese\"],\"punir\":[\"portuguese\"],\"pupilo\":[\"portuguese\"],\"pureza\":[\"portuguese\"],\"puxador\":[\"portuguese\"],\"quadra\":[\"portuguese\"],\"quantia\":[\"portuguese\"],\"quarto\":[\"portuguese\"],\"quase\":[\"portuguese\"],\"quebrar\":[\"portuguese\"],\"queda\":[\"portuguese\"],\"queijo\":[\"portuguese\"],\"quente\":[\"portuguese\"],\"querido\":[\"portuguese\"],\"quimono\":[\"portuguese\"],\"quina\":[\"portuguese\"],\"quiosque\":[\"portuguese\"],\"rabanada\":[\"portuguese\"],\"rabisco\":[\"portuguese\"],\"rachar\":[\"portuguese\"],\"racionar\":[\"portuguese\"],\"radial\":[\"portuguese\"],\"raiar\":[\"portuguese\"],\"rainha\":[\"portuguese\"],\"raio\":[\"portuguese\"],\"raiva\":[\"portuguese\"],\"rajada\":[\"portuguese\"],\"ralado\":[\"portuguese\"],\"ramal\":[\"portuguese\"],\"ranger\":[\"portuguese\"],\"ranhura\":[\"portuguese\"],\"rapadura\":[\"portuguese\"],\"rapel\":[\"portuguese\"],\"rapidez\":[\"portuguese\"],\"raposa\":[\"portuguese\"],\"raquete\":[\"portuguese\"],\"raridade\":[\"portuguese\"],\"rasante\":[\"portuguese\"],\"rascunho\":[\"portuguese\"],\"rasgar\":[\"portuguese\"],\"raspador\":[\"portuguese\"],\"rasteira\":[\"portuguese\"],\"rasurar\":[\"portuguese\"],\"ratazana\":[\"portuguese\"],\"ratoeira\":[\"portuguese\"],\"realeza\":[\"portuguese\"],\"reanimar\":[\"portuguese\"],\"reaver\":[\"portuguese\"],\"rebaixar\":[\"portuguese\"],\"rebelde\":[\"portuguese\"],\"rebolar\":[\"portuguese\"],\"recado\":[\"portuguese\"],\"recente\":[\"portuguese\"],\"recheio\":[\"portuguese\"],\"recibo\":[\"portuguese\"],\"recordar\":[\"portuguese\"],\"recrutar\":[\"portuguese\"],\"recuar\":[\"portuguese\"],\"rede\":[\"portuguese\"],\"redimir\":[\"portuguese\"],\"redonda\":[\"portuguese\"],\"reduzida\":[\"portuguese\"],\"reenvio\":[\"portuguese\"],\"refinar\":[\"portuguese\"],\"refletir\":[\"portuguese\"],\"refogar\":[\"portuguese\"],\"refresco\":[\"portuguese\"],\"refugiar\":[\"portuguese\"],\"regalia\":[\"portuguese\"],\"regime\":[\"portuguese\"],\"regra\":[\"portuguese\"],\"reinado\":[\"portuguese\"],\"reitor\":[\"portuguese\"],\"rejeitar\":[\"portuguese\"],\"relativo\":[\"portuguese\"],\"remador\":[\"portuguese\"],\"remendo\":[\"portuguese\"],\"remorso\":[\"portuguese\"],\"renovado\":[\"portuguese\"],\"reparo\":[\"portuguese\"],\"repelir\":[\"portuguese\"],\"repleto\":[\"portuguese\"],\"repolho\":[\"portuguese\"],\"represa\":[\"portuguese\"],\"repudiar\":[\"portuguese\"],\"requerer\":[\"portuguese\"],\"resenha\":[\"portuguese\"],\"resfriar\":[\"portuguese\"],\"resgatar\":[\"portuguese\"],\"residir\":[\"portuguese\"],\"resolver\":[\"portuguese\"],\"respeito\":[\"portuguese\"],\"ressaca\":[\"portuguese\"],\"restante\":[\"portuguese\"],\"resumir\":[\"portuguese\"],\"retalho\":[\"portuguese\"],\"reter\":[\"portuguese\"],\"retirar\":[\"portuguese\"],\"retomada\":[\"portuguese\"],\"retratar\":[\"portuguese\"],\"revelar\":[\"portuguese\"],\"revisor\":[\"portuguese\"],\"revolta\":[\"portuguese\"],\"riacho\":[\"portuguese\"],\"rica\":[\"portuguese\"],\"rigidez\":[\"portuguese\"],\"rigoroso\":[\"portuguese\"],\"rimar\":[\"portuguese\"],\"ringue\":[\"portuguese\"],\"risada\":[\"portuguese\"],\"risco\":[\"portuguese\"],\"risonho\":[\"portuguese\"],\"robalo\":[\"portuguese\"],\"rochedo\":[\"portuguese\"],\"rodada\":[\"portuguese\"],\"rodeio\":[\"portuguese\"],\"rodovia\":[\"portuguese\"],\"roedor\":[\"portuguese\"],\"roleta\":[\"portuguese\"],\"romano\":[\"portuguese\"],\"roncar\":[\"portuguese\"],\"rosado\":[\"portuguese\"],\"roseira\":[\"portuguese\"],\"rosto\":[\"portuguese\"],\"rota\":[\"portuguese\",\"turkish\"],\"roteiro\":[\"portuguese\"],\"rotina\":[\"portuguese\"],\"rotular\":[\"portuguese\"],\"rouco\":[\"portuguese\"],\"roupa\":[\"portuguese\"],\"roxo\":[\"portuguese\"],\"rubro\":[\"portuguese\"],\"rugido\":[\"portuguese\"],\"rugoso\":[\"portuguese\"],\"ruivo\":[\"portuguese\"],\"rumo\":[\"portuguese\"],\"rupestre\":[\"portuguese\"],\"russo\":[\"portuguese\"],\"sabor\":[\"portuguese\"],\"saciar\":[\"portuguese\"],\"sacola\":[\"portuguese\"],\"sacudir\":[\"portuguese\"],\"sadio\":[\"portuguese\"],\"safira\":[\"portuguese\"],\"saga\":[\"portuguese\"],\"sagrada\":[\"portuguese\"],\"saibro\":[\"portuguese\"],\"salada\":[\"portuguese\"],\"saleiro\":[\"portuguese\"],\"salgado\":[\"portuguese\"],\"saliva\":[\"portuguese\"],\"salpicar\":[\"portuguese\"],\"salsicha\":[\"portuguese\"],\"saltar\":[\"portuguese\"],\"salvador\":[\"portuguese\"],\"sambar\":[\"portuguese\"],\"samurai\":[\"portuguese\"],\"sanar\":[\"portuguese\"],\"sanfona\":[\"portuguese\"],\"sangue\":[\"portuguese\"],\"sanidade\":[\"portuguese\"],\"sapato\":[\"portuguese\"],\"sarda\":[\"portuguese\"],\"sargento\":[\"portuguese\"],\"sarjeta\":[\"portuguese\"],\"saturar\":[\"portuguese\"],\"saudade\":[\"portuguese\"],\"saxofone\":[\"portuguese\"],\"sazonal\":[\"portuguese\"],\"secar\":[\"portuguese\"],\"secular\":[\"portuguese\"],\"seda\":[\"portuguese\",\"turkish\"],\"sedento\":[\"portuguese\"],\"sediado\":[\"portuguese\"],\"sedoso\":[\"portuguese\"],\"sedutor\":[\"portuguese\"],\"segmento\":[\"portuguese\"],\"segredo\":[\"portuguese\"],\"segundo\":[\"portuguese\"],\"seiva\":[\"portuguese\"],\"seleto\":[\"portuguese\"],\"selvagem\":[\"portuguese\"],\"semanal\":[\"portuguese\"],\"semente\":[\"portuguese\"],\"senador\":[\"portuguese\"],\"senhor\":[\"portuguese\"],\"sensual\":[\"portuguese\"],\"sentado\":[\"portuguese\"],\"separado\":[\"portuguese\"],\"sereia\":[\"portuguese\"],\"seringa\":[\"portuguese\"],\"serra\":[\"portuguese\"],\"servo\":[\"portuguese\"],\"setembro\":[\"portuguese\"],\"setor\":[\"portuguese\"],\"sigilo\":[\"portuguese\"],\"silhueta\":[\"portuguese\"],\"silicone\":[\"portuguese\"],\"simetria\":[\"portuguese\"],\"simpatia\":[\"portuguese\"],\"simular\":[\"portuguese\"],\"sinal\":[\"portuguese\"],\"sincero\":[\"portuguese\"],\"singular\":[\"portuguese\"],\"sinopse\":[\"portuguese\"],\"sintonia\":[\"portuguese\"],\"sirene\":[\"portuguese\"],\"siri\":[\"portuguese\"],\"situado\":[\"portuguese\"],\"soberano\":[\"portuguese\"],\"sobra\":[\"portuguese\"],\"socorro\":[\"portuguese\"],\"sogro\":[\"portuguese\"],\"soja\":[\"portuguese\"],\"solda\":[\"portuguese\"],\"soletrar\":[\"portuguese\"],\"solteiro\":[\"portuguese\"],\"sombrio\":[\"portuguese\"],\"sonata\":[\"portuguese\"],\"sondar\":[\"portuguese\"],\"sonegar\":[\"portuguese\"],\"sonhador\":[\"portuguese\"],\"sono\":[\"portuguese\"],\"soprano\":[\"portuguese\"],\"soquete\":[\"portuguese\"],\"sorrir\":[\"portuguese\"],\"sorteio\":[\"portuguese\"],\"sossego\":[\"portuguese\"],\"sotaque\":[\"portuguese\"],\"soterrar\":[\"portuguese\"],\"sovado\":[\"portuguese\"],\"sozinho\":[\"portuguese\"],\"suavizar\":[\"portuguese\"],\"subida\":[\"portuguese\"],\"submerso\":[\"portuguese\"],\"subsolo\":[\"portuguese\"],\"subtrair\":[\"portuguese\"],\"sucata\":[\"portuguese\"],\"sucesso\":[\"portuguese\"],\"suco\":[\"portuguese\"],\"sudeste\":[\"portuguese\"],\"sufixo\":[\"portuguese\"],\"sugador\":[\"portuguese\"],\"sugerir\":[\"portuguese\"],\"sujeito\":[\"portuguese\"],\"sulfato\":[\"portuguese\"],\"sumir\":[\"portuguese\"],\"suor\":[\"portuguese\"],\"superior\":[\"portuguese\"],\"suplicar\":[\"portuguese\"],\"suposto\":[\"portuguese\"],\"suprimir\":[\"portuguese\"],\"surdina\":[\"portuguese\"],\"surfista\":[\"portuguese\"],\"surpresa\":[\"portuguese\"],\"surreal\":[\"portuguese\"],\"surtir\":[\"portuguese\"],\"suspiro\":[\"portuguese\"],\"sustento\":[\"portuguese\"],\"tabela\":[\"portuguese\",\"turkish\"],\"tablete\":[\"portuguese\"],\"tabuada\":[\"portuguese\"],\"tacho\":[\"portuguese\"],\"tagarela\":[\"portuguese\"],\"talher\":[\"portuguese\"],\"talo\":[\"portuguese\"],\"talvez\":[\"portuguese\"],\"tamanho\":[\"portuguese\"],\"tamborim\":[\"portuguese\"],\"tampa\":[\"portuguese\"],\"tangente\":[\"portuguese\"],\"tanto\":[\"portuguese\"],\"tapar\":[\"portuguese\"],\"tapioca\":[\"portuguese\"],\"tardio\":[\"portuguese\"],\"tarefa\":[\"portuguese\"],\"tarja\":[\"portuguese\"],\"tarraxa\":[\"portuguese\"],\"tatuagem\":[\"portuguese\"],\"taurino\":[\"portuguese\"],\"taxativo\":[\"portuguese\"],\"taxista\":[\"portuguese\"],\"teatral\":[\"portuguese\"],\"tecer\":[\"portuguese\"],\"tecido\":[\"portuguese\"],\"teclado\":[\"portuguese\"],\"tedioso\":[\"portuguese\"],\"teia\":[\"portuguese\"],\"teimar\":[\"portuguese\"],\"telefone\":[\"portuguese\"],\"telhado\":[\"portuguese\"],\"tempero\":[\"portuguese\"],\"tenente\":[\"portuguese\"],\"tensor\":[\"portuguese\"],\"tentar\":[\"portuguese\"],\"termal\":[\"portuguese\"],\"terno\":[\"portuguese\"],\"terreno\":[\"portuguese\"],\"tese\":[\"portuguese\"],\"tesoura\":[\"portuguese\"],\"testado\":[\"portuguese\"],\"teto\":[\"portuguese\"],\"textura\":[\"portuguese\"],\"texugo\":[\"portuguese\"],\"tiara\":[\"portuguese\"],\"tigela\":[\"portuguese\"],\"tijolo\":[\"portuguese\"],\"timbrar\":[\"portuguese\"],\"timidez\":[\"portuguese\"],\"tingido\":[\"portuguese\"],\"tinteiro\":[\"portuguese\"],\"tiragem\":[\"portuguese\"],\"titular\":[\"portuguese\"],\"toalha\":[\"portuguese\"],\"tocha\":[\"portuguese\"],\"tolerar\":[\"portuguese\"],\"tolice\":[\"portuguese\"],\"tomada\":[\"portuguese\"],\"tomilho\":[\"portuguese\"],\"tonel\":[\"portuguese\"],\"tontura\":[\"portuguese\"],\"topete\":[\"portuguese\"],\"tora\":[\"portuguese\"],\"torcido\":[\"portuguese\"],\"torneio\":[\"portuguese\"],\"torque\":[\"portuguese\"],\"torrada\":[\"portuguese\"],\"torto\":[\"portuguese\"],\"tostar\":[\"portuguese\"],\"touca\":[\"portuguese\"],\"toupeira\":[\"portuguese\"],\"toxina\":[\"portuguese\"],\"trabalho\":[\"portuguese\"],\"tracejar\":[\"portuguese\"],\"tradutor\":[\"portuguese\"],\"trafegar\":[\"portuguese\"],\"trajeto\":[\"portuguese\"],\"trama\":[\"portuguese\"],\"trancar\":[\"portuguese\"],\"trapo\":[\"portuguese\"],\"traseiro\":[\"portuguese\"],\"tratador\":[\"portuguese\"],\"travar\":[\"portuguese\"],\"treino\":[\"portuguese\"],\"tremer\":[\"portuguese\"],\"trepidar\":[\"portuguese\"],\"trevo\":[\"portuguese\"],\"triagem\":[\"portuguese\"],\"tribo\":[\"portuguese\"],\"triciclo\":[\"portuguese\"],\"tridente\":[\"portuguese\"],\"trilogia\":[\"portuguese\"],\"trindade\":[\"portuguese\"],\"triplo\":[\"portuguese\"],\"triturar\":[\"portuguese\"],\"triunfal\":[\"portuguese\"],\"trocar\":[\"portuguese\"],\"trombeta\":[\"portuguese\"],\"trova\":[\"portuguese\"],\"trunfo\":[\"portuguese\"],\"truque\":[\"portuguese\"],\"tubular\":[\"portuguese\"],\"tucano\":[\"portuguese\"],\"tudo\":[\"portuguese\"],\"tulipa\":[\"portuguese\"],\"tupi\":[\"portuguese\"],\"turbo\":[\"portuguese\"],\"turma\":[\"portuguese\"],\"turquesa\":[\"portuguese\"],\"tutelar\":[\"portuguese\"],\"tutorial\":[\"portuguese\"],\"uivar\":[\"portuguese\"],\"umbigo\":[\"portuguese\"],\"unha\":[\"portuguese\"],\"unidade\":[\"portuguese\"],\"uniforme\":[\"portuguese\"],\"urologia\":[\"portuguese\"],\"urso\":[\"portuguese\"],\"urtiga\":[\"portuguese\"],\"urubu\":[\"portuguese\"],\"usado\":[\"portuguese\"],\"usina\":[\"portuguese\"],\"usufruir\":[\"portuguese\"],\"vacina\":[\"portuguese\"],\"vadiar\":[\"portuguese\"],\"vagaroso\":[\"portuguese\"],\"vaidoso\":[\"portuguese\"],\"vala\":[\"portuguese\"],\"valente\":[\"portuguese\"],\"validade\":[\"portuguese\"],\"valores\":[\"portuguese\"],\"vantagem\":[\"portuguese\"],\"vaqueiro\":[\"portuguese\"],\"varanda\":[\"portuguese\"],\"vareta\":[\"portuguese\"],\"varrer\":[\"portuguese\"],\"vascular\":[\"portuguese\"],\"vasilha\":[\"portuguese\"],\"vassoura\":[\"portuguese\"],\"vazar\":[\"portuguese\"],\"vazio\":[\"portuguese\"],\"veado\":[\"portuguese\"],\"vedar\":[\"portuguese\"],\"vegetar\":[\"portuguese\"],\"veicular\":[\"portuguese\"],\"veleiro\":[\"portuguese\"],\"velhice\":[\"portuguese\"],\"veludo\":[\"portuguese\"],\"vencedor\":[\"portuguese\"],\"vendaval\":[\"portuguese\"],\"venerar\":[\"portuguese\"],\"ventre\":[\"portuguese\"],\"verbal\":[\"portuguese\"],\"verdade\":[\"portuguese\"],\"vereador\":[\"portuguese\"],\"vergonha\":[\"portuguese\"],\"vermelho\":[\"portuguese\"],\"verniz\":[\"portuguese\"],\"versar\":[\"portuguese\"],\"vertente\":[\"portuguese\"],\"vespa\":[\"portuguese\"],\"vestido\":[\"portuguese\"],\"vetorial\":[\"portuguese\"],\"viaduto\":[\"portuguese\"],\"viagem\":[\"portuguese\"],\"viajar\":[\"portuguese\"],\"viatura\":[\"portuguese\"],\"vibrador\":[\"portuguese\"],\"videira\":[\"portuguese\"],\"vidraria\":[\"portuguese\"],\"viela\":[\"portuguese\"],\"viga\":[\"portuguese\"],\"vigente\":[\"portuguese\"],\"vigiar\":[\"portuguese\"],\"vigorar\":[\"portuguese\"],\"vilarejo\":[\"portuguese\"],\"vinco\":[\"portuguese\"],\"vinheta\":[\"portuguese\"],\"vinil\":[\"portuguese\"],\"violeta\":[\"portuguese\"],\"virada\":[\"portuguese\"],\"virtude\":[\"portuguese\"],\"visitar\":[\"portuguese\"],\"visto\":[\"portuguese\"],\"vitral\":[\"portuguese\"],\"viveiro\":[\"portuguese\"],\"vizinho\":[\"portuguese\"],\"voador\":[\"portuguese\"],\"voar\":[\"portuguese\"],\"vogal\":[\"portuguese\"],\"volante\":[\"portuguese\"],\"voleibol\":[\"portuguese\"],\"voltagem\":[\"portuguese\"],\"volumoso\":[\"portuguese\"],\"vontade\":[\"portuguese\"],\"vulto\":[\"portuguese\"],\"vuvuzela\":[\"portuguese\"],\"xadrez\":[\"portuguese\"],\"xarope\":[\"portuguese\"],\"xeque\":[\"portuguese\"],\"xeretar\":[\"portuguese\"],\"xerife\":[\"portuguese\"],\"xingar\":[\"portuguese\"],\"zangado\":[\"portuguese\"],\"zarpar\":[\"portuguese\"],\"zebu\":[\"portuguese\"],\"zelador\":[\"portuguese\"],\"zombar\":[\"portuguese\"],\"zoologia\":[\"portuguese\"],\"zumbido\":[\"portuguese\"],\"абзац\":[\"russian\"],\"абонент\":[\"russian\"],\"абсурд\":[\"russian\"],\"авангард\":[\"russian\"],\"авария\":[\"russian\"],\"август\":[\"russian\"],\"авиация\":[\"russian\"],\"автор\":[\"russian\"],\"агент\":[\"russian\"],\"агитация\":[\"russian\"],\"агрегат\":[\"russian\"],\"адвокат\":[\"russian\"],\"адмирал\":[\"russian\"],\"адрес\":[\"russian\"],\"азарт\":[\"russian\"],\"азот\":[\"russian\"],\"академия\":[\"russian\"],\"аквариум\":[\"russian\"],\"аксиома\":[\"russian\"],\"акула\":[\"russian\"],\"акцент\":[\"russian\"],\"акция\":[\"russian\"],\"аллея\":[\"russian\"],\"алмаз\":[\"russian\"],\"алтарь\":[\"russian\"],\"альбом\":[\"russian\"],\"альянс\":[\"russian\"],\"амбиция\":[\"russian\"],\"анализ\":[\"russian\"],\"анекдот\":[\"russian\"],\"анкета\":[\"russian\"],\"ансамбль\":[\"russian\"],\"антенна\":[\"russian\"],\"апельсин\":[\"russian\"],\"аппарат\":[\"russian\"],\"аппетит\":[\"russian\"],\"апрель\":[\"russian\"],\"аптека\":[\"russian\"],\"арбуз\":[\"russian\"],\"аргумент\":[\"russian\"],\"аренда\":[\"russian\"],\"арест\":[\"russian\"],\"армия\":[\"russian\"],\"аромат\":[\"russian\"],\"арсенал\":[\"russian\"],\"артерия\":[\"russian\"],\"артист\":[\"russian\"],\"архив\":[\"russian\"],\"аспирант\":[\"russian\"],\"асфальт\":[\"russian\"],\"атака\":[\"russian\"],\"атомный\":[\"russian\"],\"атрибут\":[\"russian\"],\"аукцион\":[\"russian\"],\"афиша\":[\"russian\"],\"аэропорт\":[\"russian\"],\"бабочка\":[\"russian\"],\"бабушка\":[\"russian\"],\"багаж\":[\"russian\"],\"база\":[\"russian\"],\"бактерия\":[\"russian\"],\"баланс\":[\"russian\"],\"балерина\":[\"russian\"],\"балкон\":[\"russian\"],\"бандит\":[\"russian\"],\"банк\":[\"russian\"],\"барабан\":[\"russian\"],\"барон\":[\"russian\"],\"барышня\":[\"russian\"],\"барьер\":[\"russian\"],\"бассейн\":[\"russian\"],\"батарея\":[\"russian\"],\"башмак\":[\"russian\"],\"башня\":[\"russian\"],\"бедный\":[\"russian\"],\"беженец\":[\"russian\"],\"бездна\":[\"russian\"],\"белка\":[\"russian\"],\"белый\":[\"russian\"],\"бензин\":[\"russian\"],\"берег\":[\"russian\"],\"беседа\":[\"russian\"],\"бешеный\":[\"russian\"],\"билет\":[\"russian\"],\"бинокль\":[\"russian\"],\"биржа\":[\"russian\"],\"битва\":[\"russian\"],\"благо\":[\"russian\"],\"блеск\":[\"russian\"],\"близкий\":[\"russian\"],\"блин\":[\"russian\"],\"блок\":[\"russian\"],\"блюдо\":[\"russian\"],\"богатый\":[\"russian\"],\"бодрый\":[\"russian\"],\"боец\":[\"russian\"],\"бокал\":[\"russian\"],\"боковой\":[\"russian\"],\"бокс\":[\"russian\"],\"более\":[\"russian\"],\"болото\":[\"russian\"],\"болтать\":[\"russian\"],\"большой\":[\"russian\"],\"бомба\":[\"russian\"],\"борт\":[\"russian\"],\"борьба\":[\"russian\"],\"босой\":[\"russian\"],\"ботинок\":[\"russian\"],\"бояться\":[\"russian\"],\"брак\":[\"russian\"],\"брать\":[\"russian\"],\"бревно\":[\"russian\"],\"бред\":[\"russian\"],\"бригада\":[\"russian\"],\"бродяга\":[\"russian\"],\"броня\":[\"russian\"],\"бросить\":[\"russian\"],\"брызги\":[\"russian\"],\"брюки\":[\"russian\"],\"брюхо\":[\"russian\"],\"бугор\":[\"russian\"],\"будка\":[\"russian\"],\"будни\":[\"russian\"],\"будущее\":[\"russian\"],\"буква\":[\"russian\"],\"букет\":[\"russian\"],\"бульвар\":[\"russian\"],\"бумага\":[\"russian\"],\"бунт\":[\"russian\"],\"бурный\":[\"russian\"],\"буря\":[\"russian\"],\"бутылка\":[\"russian\"],\"бухта\":[\"russian\"],\"бывший\":[\"russian\"],\"быстро\":[\"russian\"],\"бытовой\":[\"russian\"],\"быть\":[\"russian\"],\"бюджет\":[\"russian\"],\"бюро\":[\"russian\"],\"бюст\":[\"russian\"],\"вагон\":[\"russian\"],\"важный\":[\"russian\"],\"вакцина\":[\"russian\"],\"валенок\":[\"russian\"],\"вальс\":[\"russian\"],\"валюта\":[\"russian\"],\"ванная\":[\"russian\"],\"варенье\":[\"russian\"],\"вариант\":[\"russian\"],\"вблизи\":[\"russian\"],\"вверх\":[\"russian\"],\"вводить\":[\"russian\"],\"вдали\":[\"russian\"],\"вдвое\":[\"russian\"],\"вдова\":[\"russian\"],\"вдоль\":[\"russian\"],\"вдруг\":[\"russian\"],\"ведро\":[\"russian\"],\"ведущий\":[\"russian\"],\"ведьма\":[\"russian\"],\"вежливо\":[\"russian\"],\"везде\":[\"russian\"],\"веко\":[\"russian\"],\"вексель\":[\"russian\"],\"велеть\":[\"russian\"],\"великий\":[\"russian\"],\"венец\":[\"russian\"],\"веник\":[\"russian\"],\"веранда\":[\"russian\"],\"верблюд\":[\"russian\"],\"верить\":[\"russian\"],\"верный\":[\"russian\"],\"версия\":[\"russian\"],\"вертеть\":[\"russian\"],\"верхний\":[\"russian\"],\"вершина\":[\"russian\"],\"весело\":[\"russian\"],\"весна\":[\"russian\"],\"весомый\":[\"russian\"],\"вести\":[\"russian\"],\"весь\":[\"russian\"],\"ветеран\":[\"russian\"],\"ветхий\":[\"russian\"],\"вечер\":[\"russian\"],\"вечно\":[\"russian\"],\"вешалка\":[\"russian\"],\"вещество\":[\"russian\"],\"взамен\":[\"russian\"],\"взгляд\":[\"russian\"],\"вздох\":[\"russian\"],\"взнос\":[\"russian\"],\"взойти\":[\"russian\"],\"взор\":[\"russian\"],\"взрыв\":[\"russian\"],\"взять\":[\"russian\"],\"видеть\":[\"russian\"],\"видимо\":[\"russian\"],\"визг\":[\"russian\"],\"визит\":[\"russian\"],\"вилка\":[\"russian\"],\"вина\":[\"russian\"],\"вирус\":[\"russian\"],\"висок\":[\"russian\"],\"витамин\":[\"russian\"],\"витрина\":[\"russian\"],\"вихрь\":[\"russian\"],\"вишня\":[\"russian\"],\"вкус\":[\"russian\"],\"влага\":[\"russian\"],\"владелец\":[\"russian\"],\"власть\":[\"russian\"],\"влево\":[\"russian\"],\"влияние\":[\"russian\"],\"вложить\":[\"russian\"],\"вместе\":[\"russian\"],\"внешний\":[\"russian\"],\"вникать\":[\"russian\"],\"внимание\":[\"russian\"],\"вновь\":[\"russian\"],\"внук\":[\"russian\"],\"внутри\":[\"russian\"],\"внучка\":[\"russian\"],\"внушать\":[\"russian\"],\"вовлечь\":[\"russian\"],\"вовремя\":[\"russian\"],\"вовсю\":[\"russian\"],\"вода\":[\"russian\"],\"водород\":[\"russian\"],\"водяной\":[\"russian\"],\"воевать\":[\"russian\"],\"возврат\":[\"russian\"],\"возглас\":[\"russian\"],\"воздух\":[\"russian\"],\"возить\":[\"russian\"],\"возле\":[\"russian\"],\"возня\":[\"russian\"],\"возраст\":[\"russian\"],\"война\":[\"russian\"],\"войско\":[\"russian\"],\"вокзал\":[\"russian\"],\"волос\":[\"russian\"],\"волчий\":[\"russian\"],\"вольный\":[\"russian\"],\"воля\":[\"russian\"],\"вообще\":[\"russian\"],\"вопль\":[\"russian\"],\"вопрос\":[\"russian\"],\"ворота\":[\"russian\"],\"восемь\":[\"russian\"],\"восток\":[\"russian\"],\"вплоть\":[\"russian\"],\"вполне\":[\"russian\"],\"вправе\":[\"russian\"],\"впредь\":[\"russian\"],\"впрочем\":[\"russian\"],\"врач\":[\"russian\"],\"вредный\":[\"russian\"],\"время\":[\"russian\"],\"вручить\":[\"russian\"],\"всадник\":[\"russian\"],\"всегда\":[\"russian\"],\"вскоре\":[\"russian\"],\"вскрыть\":[\"russian\"],\"всплеск\":[\"russian\"],\"вспышка\":[\"russian\"],\"встреча\":[\"russian\"],\"всюду\":[\"russian\"],\"всякий\":[\"russian\"],\"второй\":[\"russian\"],\"вход\":[\"russian\"],\"вчера\":[\"russian\"],\"выбор\":[\"russian\"],\"вывод\":[\"russian\"],\"выгнать\":[\"russian\"],\"выдать\":[\"russian\"],\"выехать\":[\"russian\"],\"вызов\":[\"russian\"],\"выйти\":[\"russian\"],\"выкуп\":[\"russian\"],\"вылезти\":[\"russian\"],\"вымыть\":[\"russian\"],\"выпасть\":[\"russian\"],\"выпить\":[\"russian\"],\"выплата\":[\"russian\"],\"выпуск\":[\"russian\"],\"вырасти\":[\"russian\"],\"выручка\":[\"russian\"],\"выслать\":[\"russian\"],\"высокий\":[\"russian\"],\"выставка\":[\"russian\"],\"вышка\":[\"russian\"],\"вязать\":[\"russian\"],\"вялый\":[\"russian\"],\"газета\":[\"russian\"],\"газовый\":[\"russian\"],\"галерея\":[\"russian\"],\"галстук\":[\"russian\"],\"гамма\":[\"russian\"],\"гарантия\":[\"russian\"],\"гармония\":[\"russian\"],\"гарнизон\":[\"russian\"],\"гастроли\":[\"russian\"],\"гвардия\":[\"russian\"],\"гвоздь\":[\"russian\"],\"гектар\":[\"russian\"],\"генерал\":[\"russian\"],\"гений\":[\"russian\"],\"геном\":[\"russian\"],\"геолог\":[\"russian\"],\"герб\":[\"russian\"],\"герой\":[\"russian\"],\"гибкий\":[\"russian\"],\"гигант\":[\"russian\"],\"гимн\":[\"russian\"],\"гипотеза\":[\"russian\"],\"гитара\":[\"russian\"],\"главный\":[\"russian\"],\"глагол\":[\"russian\"],\"гладить\":[\"russian\"],\"глаз\":[\"russian\"],\"глина\":[\"russian\"],\"глоток\":[\"russian\"],\"глубокий\":[\"russian\"],\"глупый\":[\"russian\"],\"глухой\":[\"russian\"],\"глыба\":[\"russian\"],\"глядеть\":[\"russian\"],\"гнев\":[\"russian\"],\"гнездо\":[\"russian\"],\"гнилой\":[\"russian\"],\"годовой\":[\"russian\"],\"голова\":[\"russian\"],\"голубой\":[\"russian\"],\"голый\":[\"russian\"],\"гонорар\":[\"russian\"],\"гордость\":[\"russian\"],\"горизонт\":[\"russian\"],\"горло\":[\"russian\"],\"горный\":[\"russian\"],\"город\":[\"russian\"],\"горшок\":[\"russian\"],\"горький\":[\"russian\"],\"горючее\":[\"russian\"],\"горячий\":[\"russian\"],\"готовый\":[\"russian\"],\"градус\":[\"russian\"],\"грамм\":[\"russian\"],\"граница\":[\"russian\"],\"граф\":[\"russian\"],\"гребень\":[\"russian\"],\"гриб\":[\"russian\"],\"гримаса\":[\"russian\"],\"грозить\":[\"russian\"],\"грохот\":[\"russian\"],\"грош\":[\"russian\"],\"грубый\":[\"russian\"],\"грудь\":[\"russian\"],\"груз\":[\"russian\"],\"грунт\":[\"russian\"],\"группа\":[\"russian\"],\"груша\":[\"russian\"],\"грязный\":[\"russian\"],\"губа\":[\"russian\"],\"гудок\":[\"russian\"],\"гулкий\":[\"russian\"],\"гулять\":[\"russian\"],\"гусеница\":[\"russian\"],\"густо\":[\"russian\"],\"гусь\":[\"russian\"],\"давление\":[\"russian\"],\"давно\":[\"russian\"],\"даже\":[\"russian\"],\"дальний\":[\"russian\"],\"данный\":[\"russian\"],\"дарить\":[\"russian\"],\"датчик\":[\"russian\"],\"дать\":[\"russian\"],\"дача\":[\"russian\"],\"двадцать\":[\"russian\"],\"дважды\":[\"russian\"],\"дверь\":[\"russian\"],\"двигать\":[\"russian\"],\"движение\":[\"russian\"],\"двойной\":[\"russian\"],\"двор\":[\"russian\"],\"дебют\":[\"russian\"],\"девятый\":[\"russian\"],\"дежурный\":[\"russian\"],\"действие\":[\"russian\"],\"декабрь\":[\"russian\"],\"деление\":[\"russian\"],\"дело\":[\"russian\"],\"дельфин\":[\"russian\"],\"день\":[\"russian\"],\"дерево\":[\"russian\"],\"держать\":[\"russian\"],\"дерзкий\":[\"russian\"],\"десять\":[\"russian\"],\"деталь\":[\"russian\"],\"детский\":[\"russian\"],\"дефект\":[\"russian\"],\"дефицит\":[\"russian\"],\"деятель\":[\"russian\"],\"джаз\":[\"russian\"],\"джинсы\":[\"russian\"],\"джунгли\":[\"russian\"],\"диагноз\":[\"russian\"],\"диалог\":[\"russian\"],\"диапазон\":[\"russian\"],\"диван\":[\"russian\"],\"дивизия\":[\"russian\"],\"дивный\":[\"russian\"],\"диета\":[\"russian\"],\"дизайн\":[\"russian\"],\"дикарь\":[\"russian\"],\"дилер\":[\"russian\"],\"динамика\":[\"russian\"],\"диплом\":[\"russian\"],\"директор\":[\"russian\"],\"дитя\":[\"russian\"],\"длинный\":[\"russian\"],\"дневник\":[\"russian\"],\"добрый\":[\"russian\"],\"добыча\":[\"russian\"],\"доверие\":[\"russian\"],\"догадка\":[\"russian\"],\"догнать\":[\"russian\"],\"дождь\":[\"russian\"],\"доклад\":[\"russian\"],\"доктор\":[\"russian\"],\"документ\":[\"russian\"],\"долго\":[\"russian\"],\"должен\":[\"russian\"],\"долина\":[\"russian\"],\"донос\":[\"russian\"],\"дорога\":[\"russian\"],\"досада\":[\"russian\"],\"доска\":[\"russian\"],\"достать\":[\"russian\"],\"досуг\":[\"russian\"],\"доход\":[\"russian\"],\"доцент\":[\"russian\"],\"дощатый\":[\"russian\"],\"драка\":[\"russian\"],\"древний\":[\"russian\"],\"дремать\":[\"russian\"],\"дробный\":[\"russian\"],\"дрова\":[\"russian\"],\"дрожать\":[\"russian\"],\"другой\":[\"russian\"],\"дружба\":[\"russian\"],\"дубовый\":[\"russian\"],\"дуга\":[\"russian\"],\"думать\":[\"russian\"],\"дурной\":[\"russian\"],\"духи\":[\"russian\"],\"душный\":[\"russian\"],\"дуэль\":[\"russian\"],\"дуэт\":[\"russian\"],\"дыра\":[\"russian\"],\"дыхание\":[\"russian\"],\"дюжина\":[\"russian\"],\"дядя\":[\"russian\"],\"едва\":[\"russian\"],\"единый\":[\"russian\"],\"ерунда\":[\"russian\"],\"если\":[\"russian\"],\"ехать\":[\"russian\"],\"жадный\":[\"russian\"],\"жажда\":[\"russian\"],\"жалеть\":[\"russian\"],\"жалоба\":[\"russian\"],\"жанр\":[\"russian\"],\"жареный\":[\"russian\"],\"жаркий\":[\"russian\"],\"жгучий\":[\"russian\"],\"жевать\":[\"russian\"],\"желание\":[\"russian\"],\"желудок\":[\"russian\"],\"жена\":[\"russian\"],\"женщина\":[\"russian\"],\"жертва\":[\"russian\"],\"жест\":[\"russian\"],\"жидкость\":[\"russian\"],\"житель\":[\"russian\"],\"жить\":[\"russian\"],\"жрец\":[\"russian\"],\"жулик\":[\"russian\"],\"журнал\":[\"russian\"],\"жуткий\":[\"russian\"],\"забрать\":[\"russian\"],\"забыть\":[\"russian\"],\"завести\":[\"russian\"],\"завод\":[\"russian\"],\"завтра\":[\"russian\"],\"загадка\":[\"russian\"],\"загнать\":[\"russian\"],\"заговор\":[\"russian\"],\"задача\":[\"russian\"],\"задеть\":[\"russian\"],\"задний\":[\"russian\"],\"задолго\":[\"russian\"],\"заехать\":[\"russian\"],\"заказ\":[\"russian\"],\"закон\":[\"russian\"],\"закрыть\":[\"russian\"],\"закуска\":[\"russian\"],\"залезть\":[\"russian\"],\"залить\":[\"russian\"],\"залп\":[\"russian\"],\"замок\":[\"russian\"],\"замуж\":[\"russian\"],\"замысел\":[\"russian\"],\"занавес\":[\"russian\"],\"заново\":[\"russian\"],\"занять\":[\"russian\"],\"заодно\":[\"russian\"],\"запись\":[\"russian\"],\"запрос\":[\"russian\"],\"запуск\":[\"russian\"],\"запястье\":[\"russian\"],\"заранее\":[\"russian\"],\"заросль\":[\"russian\"],\"зарплата\":[\"russian\"],\"заря\":[\"russian\"],\"засада\":[\"russian\"],\"заслуга\":[\"russian\"],\"заснуть\":[\"russian\"],\"застать\":[\"russian\"],\"затвор\":[\"russian\"],\"затеять\":[\"russian\"],\"затрата\":[\"russian\"],\"затылок\":[\"russian\"],\"захват\":[\"russian\"],\"зачем\":[\"russian\"],\"защита\":[\"russian\"],\"заявить\":[\"russian\"],\"заяц\":[\"russian\"],\"звезда\":[\"russian\"],\"звено\":[\"russian\"],\"звонить\":[\"russian\"],\"здесь\":[\"russian\"],\"зелень\":[\"russian\"],\"земля\":[\"russian\"],\"зеркало\":[\"russian\"],\"зерно\":[\"russian\"],\"зима\":[\"russian\"],\"злой\":[\"russian\"],\"змея\":[\"russian\"],\"знамя\":[\"russian\"],\"знание\":[\"russian\"],\"значит\":[\"russian\"],\"золотой\":[\"russian\"],\"зона\":[\"russian\"],\"зонтик\":[\"russian\"],\"зоопарк\":[\"russian\"],\"зрачок\":[\"russian\"],\"зрение\":[\"russian\"],\"зритель\":[\"russian\"],\"зубной\":[\"russian\"],\"зубр\":[\"russian\"],\"игла\":[\"russian\"],\"идеал\":[\"russian\"],\"идеолог\":[\"russian\"],\"идея\":[\"russian\"],\"идол\":[\"russian\"],\"идти\":[\"russian\"],\"изба\":[\"russian\"],\"избить\":[\"russian\"],\"избрать\":[\"russian\"],\"избыток\":[\"russian\"],\"извлечь\":[\"russian\"],\"извне\":[\"russian\"],\"изгиб\":[\"russian\"],\"изгнать\":[\"russian\"],\"издание\":[\"russian\"],\"изделие\":[\"russian\"],\"изнутри\":[\"russian\"],\"изобилие\":[\"russian\"],\"изоляция\":[\"russian\"],\"изредка\":[\"russian\"],\"изрядно\":[\"russian\"],\"изучение\":[\"russian\"],\"изъять\":[\"russian\"],\"изящный\":[\"russian\"],\"икона\":[\"russian\"],\"икра\":[\"russian\"],\"иллюзия\":[\"russian\"],\"именно\":[\"russian\"],\"иметь\":[\"russian\"],\"имидж\":[\"russian\"],\"империя\":[\"russian\"],\"импульс\":[\"russian\"],\"иначе\":[\"russian\"],\"инвалид\":[\"russian\"],\"индекс\":[\"russian\"],\"индивид\":[\"russian\"],\"инерция\":[\"russian\"],\"инженер\":[\"russian\"],\"иногда\":[\"russian\"],\"иной\":[\"russian\"],\"институт\":[\"russian\"],\"интерес\":[\"russian\"],\"интрига\":[\"russian\"],\"интуиция\":[\"russian\"],\"инфаркт\":[\"russian\"],\"инцидент\":[\"russian\"],\"ирония\":[\"russian\"],\"искать\":[\"russian\"],\"испуг\":[\"russian\"],\"история\":[\"russian\"],\"итог\":[\"russian\"],\"июнь\":[\"russian\"],\"кабель\":[\"russian\"],\"кабинет\":[\"russian\"],\"каблук\":[\"russian\"],\"кавалер\":[\"russian\"],\"кадр\":[\"russian\"],\"каждый\":[\"russian\"],\"кажется\":[\"russian\"],\"казино\":[\"russian\"],\"калитка\":[\"russian\"],\"камень\":[\"russian\"],\"камин\":[\"russian\"],\"канал\":[\"russian\"],\"кандидат\":[\"russian\"],\"каникулы\":[\"russian\"],\"канон\":[\"russian\"],\"капитан\":[\"russian\"],\"капля\":[\"russian\"],\"капот\":[\"russian\"],\"капуста\":[\"russian\"],\"карандаш\":[\"russian\"],\"карета\":[\"russian\"],\"каркас\":[\"russian\"],\"карман\":[\"russian\"],\"картина\":[\"russian\"],\"карьера\":[\"russian\"],\"каска\":[\"russian\"],\"кассета\":[\"russian\"],\"кастрюля\":[\"russian\"],\"каталог\":[\"russian\"],\"катер\":[\"russian\"],\"каток\":[\"russian\"],\"катушка\":[\"russian\"],\"кафедра\":[\"russian\"],\"качество\":[\"russian\"],\"каша\":[\"russian\"],\"кашлять\":[\"russian\"],\"каюта\":[\"russian\"],\"квадрат\":[\"russian\"],\"квартира\":[\"russian\"],\"квота\":[\"russian\"],\"кепка\":[\"russian\"],\"кивнуть\":[\"russian\"],\"километр\":[\"russian\"],\"кино\":[\"russian\"],\"киоск\":[\"russian\"],\"кипяток\":[\"russian\"],\"кирпич\":[\"russian\"],\"кислота\":[\"russian\"],\"кисть\":[\"russian\"],\"клавиша\":[\"russian\"],\"клапан\":[\"russian\"],\"класс\":[\"russian\"],\"клей\":[\"russian\"],\"клетка\":[\"russian\"],\"клиент\":[\"russian\"],\"климат\":[\"russian\"],\"клиника\":[\"russian\"],\"кличка\":[\"russian\"],\"клоун\":[\"russian\"],\"клочок\":[\"russian\"],\"клуб\":[\"russian\"],\"клумба\":[\"russian\"],\"ключ\":[\"russian\"],\"книга\":[\"russian\"],\"кнопка\":[\"russian\"],\"кнут\":[\"russian\"],\"княгиня\":[\"russian\"],\"князь\":[\"russian\"],\"кобура\":[\"russian\"],\"когда\":[\"russian\"],\"кодекс\":[\"russian\"],\"кожа\":[\"russian\"],\"коктейль\":[\"russian\"],\"колено\":[\"russian\"],\"коллега\":[\"russian\"],\"колонна\":[\"russian\"],\"колпак\":[\"russian\"],\"кольцо\":[\"russian\"],\"колючий\":[\"russian\"],\"коляска\":[\"russian\"],\"команда\":[\"russian\"],\"комедия\":[\"russian\"],\"комиссия\":[\"russian\"],\"коммуна\":[\"russian\"],\"комната\":[\"russian\"],\"комок\":[\"russian\"],\"компания\":[\"russian\"],\"комфорт\":[\"russian\"],\"конвейер\":[\"russian\"],\"конгресс\":[\"russian\"],\"конечно\":[\"russian\"],\"конкурс\":[\"russian\"],\"контроль\":[\"russian\"],\"концерт\":[\"russian\"],\"конь\":[\"russian\"],\"конюшня\":[\"russian\"],\"копать\":[\"russian\"],\"копейка\":[\"russian\"],\"копыто\":[\"russian\"],\"корабль\":[\"russian\"],\"корень\":[\"russian\"],\"корзина\":[\"russian\"],\"коридор\":[\"russian\"],\"кормить\":[\"russian\"],\"корпус\":[\"russian\"],\"космос\":[\"russian\"],\"костюм\":[\"russian\"],\"косяк\":[\"russian\"],\"котел\":[\"russian\"],\"котлета\":[\"russian\"],\"который\":[\"russian\"],\"коттедж\":[\"russian\"],\"кофе\":[\"russian\"],\"кофта\":[\"russian\"],\"кошка\":[\"russian\"],\"кража\":[\"russian\"],\"край\":[\"russian\"],\"красный\":[\"russian\"],\"краткий\":[\"russian\"],\"кредит\":[\"russian\"],\"крем\":[\"russian\"],\"крепкий\":[\"russian\"],\"кресло\":[\"russian\"],\"кривой\":[\"russian\"],\"кризис\":[\"russian\"],\"кристалл\":[\"russian\"],\"критерий\":[\"russian\"],\"кричать\":[\"russian\"],\"кровь\":[\"russian\"],\"крокодил\":[\"russian\"],\"кролик\":[\"russian\"],\"кроме\":[\"russian\"],\"крона\":[\"russian\"],\"круг\":[\"russian\"],\"кружка\":[\"russian\"],\"крупный\":[\"russian\"],\"крутой\":[\"russian\"],\"крушение\":[\"russian\"],\"крыло\":[\"russian\"],\"крыша\":[\"russian\"],\"крючок\":[\"russian\"],\"кстати\":[\"russian\"],\"кубик\":[\"russian\"],\"куда\":[\"russian\"],\"кузов\":[\"russian\"],\"кукла\":[\"russian\"],\"кулак\":[\"russian\"],\"кулиса\":[\"russian\"],\"культура\":[\"russian\"],\"кумир\":[\"russian\"],\"купе\":[\"russian\"],\"купить\":[\"russian\"],\"купол\":[\"russian\"],\"купюра\":[\"russian\"],\"курица\":[\"russian\"],\"курорт\":[\"russian\"],\"курс\":[\"russian\"],\"куртка\":[\"russian\"],\"кусок\":[\"russian\"],\"куст\":[\"russian\"],\"кухня\":[\"russian\"],\"кушать\":[\"russian\"],\"лабиринт\":[\"russian\"],\"лавка\":[\"russian\"],\"лагерь\":[\"russian\"],\"ладно\":[\"russian\"],\"ладонь\":[\"russian\"],\"лапа\":[\"russian\"],\"лауреат\":[\"russian\"],\"лгать\":[\"russian\"],\"лебедь\":[\"russian\"],\"левый\":[\"russian\"],\"легенда\":[\"russian\"],\"легкий\":[\"russian\"],\"ледяной\":[\"russian\"],\"лежать\":[\"russian\"],\"лезвие\":[\"russian\"],\"лезть\":[\"russian\"],\"лекция\":[\"russian\"],\"ленивый\":[\"russian\"],\"лента\":[\"russian\"],\"лепесток\":[\"russian\"],\"лесной\":[\"russian\"],\"лестница\":[\"russian\"],\"лететь\":[\"russian\"],\"лето\":[\"russian\"],\"лечить\":[\"russian\"],\"лига\":[\"russian\"],\"лидер\":[\"russian\"],\"лиловый\":[\"russian\"],\"лимон\":[\"russian\"],\"линия\":[\"russian\"],\"липкий\":[\"russian\"],\"лист\":[\"russian\"],\"литр\":[\"russian\"],\"лихой\":[\"russian\"],\"лицо\":[\"russian\"],\"лишить\":[\"russian\"],\"лишний\":[\"russian\"],\"ловить\":[\"russian\"],\"логика\":[\"russian\"],\"лодка\":[\"russian\"],\"ложь\":[\"russian\"],\"лозунг\":[\"russian\"],\"локоть\":[\"russian\"],\"лопата\":[\"russian\"],\"лошадь\":[\"russian\"],\"лукавый\":[\"russian\"],\"луна\":[\"russian\"],\"лучший\":[\"russian\"],\"лысый\":[\"russian\"],\"льгота\":[\"russian\"],\"любить\":[\"russian\"],\"любой\":[\"russian\"],\"людской\":[\"russian\"],\"люстра\":[\"russian\"],\"лютый\":[\"russian\"],\"лягушка\":[\"russian\"],\"магазин\":[\"russian\"],\"магия\":[\"russian\"],\"майор\":[\"russian\"],\"майский\":[\"russian\"],\"максимум\":[\"russian\"],\"макушка\":[\"russian\"],\"мало\":[\"russian\"],\"мальчик\":[\"russian\"],\"мама\":[\"russian\"],\"манера\":[\"russian\"],\"марка\":[\"russian\"],\"март\":[\"russian\"],\"маршрут\":[\"russian\"],\"масса\":[\"russian\"],\"мастер\":[\"russian\"],\"масштаб\":[\"russian\"],\"материал\":[\"russian\"],\"матч\":[\"russian\"],\"махать\":[\"russian\"],\"машина\":[\"russian\"],\"маяк\":[\"russian\"],\"мебель\":[\"russian\"],\"медаль\":[\"russian\"],\"медведь\":[\"russian\"],\"медицина\":[\"russian\"],\"медь\":[\"russian\"],\"между\":[\"russian\"],\"мелкий\":[\"russian\"],\"мелочь\":[\"russian\"],\"мемуары\":[\"russian\"],\"меньше\":[\"russian\"],\"меню\":[\"russian\"],\"менять\":[\"russian\"],\"мера\":[\"russian\"],\"мерцать\":[\"russian\"],\"место\":[\"russian\"],\"месяц\":[\"russian\"],\"металл\":[\"russian\"],\"метод\":[\"russian\"],\"метр\":[\"russian\"],\"механизм\":[\"russian\"],\"меховой\":[\"russian\"],\"мечтать\":[\"russian\"],\"мешать\":[\"russian\"],\"мешок\":[\"russian\"],\"миграция\":[\"russian\"],\"микрофон\":[\"russian\"],\"милиция\":[\"russian\"],\"миллион\":[\"russian\"],\"милость\":[\"russian\"],\"миля\":[\"russian\"],\"мимо\":[\"russian\"],\"минерал\":[\"russian\"],\"министр\":[\"russian\"],\"минута\":[\"russian\"],\"мирный\":[\"russian\"],\"миска\":[\"russian\"],\"миссия\":[\"russian\"],\"митинг\":[\"russian\"],\"мишень\":[\"russian\"],\"младший\":[\"russian\"],\"мнение\":[\"russian\"],\"мнимый\":[\"russian\"],\"много\":[\"russian\"],\"могучий\":[\"russian\"],\"модель\":[\"russian\"],\"может\":[\"russian\"],\"мозг\":[\"russian\"],\"мокрый\":[\"russian\"],\"молекула\":[\"russian\"],\"молния\":[\"russian\"],\"молодой\":[\"russian\"],\"молчать\":[\"russian\"],\"момент\":[\"russian\"],\"монета\":[\"russian\"],\"монитор\":[\"russian\"],\"монолог\":[\"russian\"],\"монстр\":[\"russian\"],\"монтаж\":[\"russian\"],\"мораль\":[\"russian\"],\"море\":[\"russian\"],\"морковь\":[\"russian\"],\"мороз\":[\"russian\"],\"морщина\":[\"russian\"],\"мостовая\":[\"russian\"],\"мотать\":[\"russian\"],\"мотив\":[\"russian\"],\"мотор\":[\"russian\"],\"мохнатый\":[\"russian\"],\"мрамор\":[\"russian\"],\"мрачный\":[\"russian\"],\"мстить\":[\"russian\"],\"мудрый\":[\"russian\"],\"мужество\":[\"russian\"],\"мужчина\":[\"russian\"],\"музей\":[\"russian\"],\"музыка\":[\"russian\"],\"мундир\":[\"russian\"],\"муравей\":[\"russian\"],\"мусор\":[\"russian\"],\"муха\":[\"russian\"],\"мчаться\":[\"russian\"],\"мысль\":[\"russian\"],\"мыться\":[\"russian\"],\"мышца\":[\"russian\"],\"мышь\":[\"russian\"],\"мюзикл\":[\"russian\"],\"мягкий\":[\"russian\"],\"мясо\":[\"russian\"],\"набор\":[\"russian\"],\"навык\":[\"russian\"],\"наглый\":[\"russian\"],\"нагрузка\":[\"russian\"],\"надежда\":[\"russian\"],\"надзор\":[\"russian\"],\"надо\":[\"russian\"],\"наедине\":[\"russian\"],\"назад\":[\"russian\"],\"название\":[\"russian\"],\"назло\":[\"russian\"],\"наивный\":[\"russian\"],\"найти\":[\"russian\"],\"наконец\":[\"russian\"],\"налево\":[\"russian\"],\"наличие\":[\"russian\"],\"налог\":[\"russian\"],\"намерен\":[\"russian\"],\"нанести\":[\"russian\"],\"напасть\":[\"russian\"],\"например\":[\"russian\"],\"народ\":[\"russian\"],\"наследие\":[\"russian\"],\"натура\":[\"russian\"],\"наука\":[\"russian\"],\"наутро\":[\"russian\"],\"начать\":[\"russian\"],\"небо\":[\"russian\"],\"неважно\":[\"russian\"],\"невеста\":[\"russian\"],\"негодяй\":[\"russian\"],\"недавно\":[\"russian\"],\"неделя\":[\"russian\"],\"недолго\":[\"russian\"],\"недра\":[\"russian\"],\"недуг\":[\"russian\"],\"нежный\":[\"russian\"],\"незачем\":[\"russian\"],\"некто\":[\"russian\"],\"нелепый\":[\"russian\"],\"неловко\":[\"russian\"],\"нельзя\":[\"russian\"],\"немало\":[\"russian\"],\"немой\":[\"russian\"],\"неплохо\":[\"russian\"],\"нервный\":[\"russian\"],\"нередко\":[\"russian\"],\"нестись\":[\"russian\"],\"неудача\":[\"russian\"],\"неужели\":[\"russian\"],\"нефть\":[\"russian\"],\"неясный\":[\"russian\"],\"нигде\":[\"russian\"],\"низкий\":[\"russian\"],\"никакой\":[\"russian\"],\"никогда\":[\"russian\"],\"никуда\":[\"russian\"],\"ничто\":[\"russian\"],\"ничуть\":[\"russian\"],\"ниша\":[\"russian\"],\"нищий\":[\"russian\"],\"новость\":[\"russian\"],\"новый\":[\"russian\"],\"нога\":[\"russian\"],\"ноготь\":[\"russian\"],\"ножницы\":[\"russian\"],\"ноздря\":[\"russian\"],\"номер\":[\"russian\"],\"носить\":[\"russian\"],\"носок\":[\"russian\"],\"ночь\":[\"russian\"],\"ноябрь\":[\"russian\"],\"нрав\":[\"russian\"],\"нуль\":[\"russian\"],\"нынче\":[\"russian\"],\"нырять\":[\"russian\"],\"нюанс\":[\"russian\"],\"няня\":[\"russian\"],\"обаяние\":[\"russian\"],\"обед\":[\"russian\"],\"обезьяна\":[\"russian\"],\"обещать\":[\"russian\"],\"обжечь\":[\"russian\"],\"обзор\":[\"russian\"],\"обилие\":[\"russian\"],\"обитать\":[\"russian\"],\"область\":[\"russian\"],\"облик\":[\"russian\"],\"обложка\":[\"russian\"],\"обмен\":[\"russian\"],\"обморок\":[\"russian\"],\"обожать\":[\"russian\"],\"обои\":[\"russian\"],\"оболочка\":[\"russian\"],\"оборона\":[\"russian\"],\"обочина\":[\"russian\"],\"образ\":[\"russian\"],\"обрести\":[\"russian\"],\"обрыв\":[\"russian\"],\"обувь\":[\"russian\"],\"обучение\":[\"russian\"],\"обход\":[\"russian\"],\"общество\":[\"russian\"],\"общий\":[\"russian\"],\"объект\":[\"russian\"],\"обыск\":[\"russian\"],\"обычно\":[\"russian\"],\"обязать\":[\"russian\"],\"овощи\":[\"russian\"],\"овраг\":[\"russian\"],\"овца\":[\"russian\"],\"оговорка\":[\"russian\"],\"ограда\":[\"russian\"],\"огурец\":[\"russian\"],\"одежда\":[\"russian\"],\"одеяло\":[\"russian\"],\"один\":[\"russian\"],\"однако\":[\"russian\"],\"одолеть\":[\"russian\"],\"ожидать\":[\"russian\"],\"озеро\":[\"russian\"],\"океан\":[\"russian\"],\"окно\":[\"russian\"],\"около\":[\"russian\"],\"окоп\":[\"russian\"],\"окраина\":[\"russian\"],\"октябрь\":[\"russian\"],\"опасный\":[\"russian\"],\"опека\":[\"russian\"],\"операция\":[\"russian\"],\"описание\":[\"russian\"],\"оплата\":[\"russian\"],\"опора\":[\"russian\"],\"оппонент\":[\"russian\"],\"оптимизм\":[\"russian\"],\"оптовый\":[\"russian\"],\"опухоль\":[\"russian\"],\"опыт\":[\"russian\"],\"оратор\":[\"russian\"],\"орбита\":[\"russian\"],\"орган\":[\"russian\"],\"орден\":[\"russian\"],\"орел\":[\"russian\"],\"оригинал\":[\"russian\"],\"ориентир\":[\"russian\"],\"оркестр\":[\"russian\"],\"оружие\":[\"russian\"],\"осенний\":[\"russian\"],\"осколок\":[\"russian\"],\"осмотр\":[\"russian\"],\"остров\":[\"russian\"],\"отбор\":[\"russian\"],\"отбыть\":[\"russian\"],\"отвлечь\":[\"russian\"],\"отдать\":[\"russian\"],\"отдел\":[\"russian\"],\"отдых\":[\"russian\"],\"отель\":[\"russian\"],\"отец\":[\"russian\"],\"отзыв\":[\"russian\"],\"отказ\":[\"russian\"],\"отклик\":[\"russian\"],\"открыть\":[\"russian\"],\"откуда\":[\"russian\"],\"отличие\":[\"russian\"],\"отныне\":[\"russian\"],\"отойти\":[\"russian\"],\"отпуск\":[\"russian\"],\"отрасль\":[\"russian\"],\"отросток\":[\"russian\"],\"отрывок\":[\"russian\"],\"отряд\":[\"russian\"],\"отсек\":[\"russian\"],\"отставка\":[\"russian\"],\"отсюда\":[\"russian\"],\"оттенок\":[\"russian\"],\"оттого\":[\"russian\"],\"отчего\":[\"russian\"],\"отъезд\":[\"russian\"],\"офис\":[\"russian\"],\"офицер\":[\"russian\"],\"охота\":[\"russian\"],\"охрана\":[\"russian\"],\"оценка\":[\"russian\"],\"очаг\":[\"russian\"],\"очень\":[\"russian\"],\"очередь\":[\"russian\"],\"очищать\":[\"russian\"],\"ошибка\":[\"russian\"],\"ощущение\":[\"russian\"],\"павильон\":[\"russian\"],\"падать\":[\"russian\"],\"пазуха\":[\"russian\"],\"пакет\":[\"russian\"],\"палата\":[\"russian\"],\"палец\":[\"russian\"],\"палуба\":[\"russian\"],\"пальто\":[\"russian\"],\"память\":[\"russian\"],\"панель\":[\"russian\"],\"паника\":[\"russian\"],\"пара\":[\"russian\"],\"парень\":[\"russian\"],\"пароход\":[\"russian\"],\"партия\":[\"russian\"],\"парус\":[\"russian\"],\"паспорт\":[\"russian\"],\"пассажир\":[\"russian\"],\"пастух\":[\"russian\"],\"патент\":[\"russian\"],\"патрон\":[\"russian\"],\"пауза\":[\"russian\"],\"паук\":[\"russian\"],\"паутина\":[\"russian\"],\"пафос\":[\"russian\"],\"пахнуть\":[\"russian\"],\"пациент\":[\"russian\"],\"пачка\":[\"russian\"],\"певец\":[\"russian\"],\"педагог\":[\"russian\"],\"пейзаж\":[\"russian\"],\"пенсия\":[\"russian\"],\"пепел\":[\"russian\"],\"первый\":[\"russian\"],\"перед\":[\"russian\"],\"период\":[\"russian\"],\"перо\":[\"russian\"],\"перрон\":[\"russian\"],\"персонаж\":[\"russian\"],\"перчатка\":[\"russian\"],\"песня\":[\"russian\"],\"песок\":[\"russian\"],\"петля\":[\"russian\"],\"петрушка\":[\"russian\"],\"петух\":[\"russian\"],\"пехота\":[\"russian\"],\"печать\":[\"russian\"],\"печень\":[\"russian\"],\"пешком\":[\"russian\"],\"пещера\":[\"russian\"],\"пианист\":[\"russian\"],\"пиджак\":[\"russian\"],\"пилот\":[\"russian\"],\"пионер\":[\"russian\"],\"пирамида\":[\"russian\"],\"пирожок\":[\"russian\"],\"письмо\":[\"russian\"],\"пища\":[\"russian\"],\"плавание\":[\"russian\"],\"плакать\":[\"russian\"],\"пламя\":[\"russian\"],\"план\":[\"russian\"],\"пласт\":[\"russian\"],\"платить\":[\"russian\"],\"пленный\":[\"russian\"],\"плечо\":[\"russian\"],\"плита\":[\"russian\"],\"плод\":[\"russian\"],\"плоский\":[\"russian\"],\"плотный\":[\"russian\"],\"плохой\":[\"russian\"],\"площадь\":[\"russian\"],\"плыть\":[\"russian\"],\"плюс\":[\"russian\"],\"пляж\":[\"russian\"],\"плясать\":[\"russian\"],\"победа\":[\"russian\"],\"повар\":[\"russian\"],\"повод\":[\"russian\"],\"повсюду\":[\"russian\"],\"повязка\":[\"russian\"],\"погода\":[\"russian\"],\"погреб\":[\"russian\"],\"подбор\":[\"russian\"],\"подвиг\":[\"russian\"],\"подделка\":[\"russian\"],\"поджать\":[\"russian\"],\"поднос\":[\"russian\"],\"подпись\":[\"russian\"],\"подруга\":[\"russian\"],\"подход\":[\"russian\"],\"подчас\":[\"russian\"],\"подъезд\":[\"russian\"],\"поединок\":[\"russian\"],\"поезд\":[\"russian\"],\"поесть\":[\"russian\"],\"поехать\":[\"russian\"],\"пожалуй\":[\"russian\"],\"пожилой\":[\"russian\"],\"позади\":[\"russian\"],\"позвать\":[\"russian\"],\"поздний\":[\"russian\"],\"позиция\":[\"russian\"],\"позор\":[\"russian\"],\"поиск\":[\"russian\"],\"поймать\":[\"russian\"],\"пойти\":[\"russian\"],\"поклон\":[\"russian\"],\"покой\":[\"russian\"],\"покрыть\":[\"russian\"],\"полдень\":[\"russian\"],\"полезный\":[\"russian\"],\"ползти\":[\"russian\"],\"полк\":[\"russian\"],\"полный\":[\"russian\"],\"половина\":[\"russian\"],\"полтора\":[\"russian\"],\"польза\":[\"russian\"],\"поляна\":[\"russian\"],\"помидор\":[\"russian\"],\"помнить\":[\"russian\"],\"помощь\":[\"russian\"],\"попасть\":[\"russian\"],\"поперек\":[\"russian\"],\"поплыть\":[\"russian\"],\"пополам\":[\"russian\"],\"поправка\":[\"russian\"],\"попугай\":[\"russian\"],\"попытка\":[\"russian\"],\"порог\":[\"russian\"],\"портрет\":[\"russian\"],\"порция\":[\"russian\"],\"порыв\":[\"russian\"],\"порядок\":[\"russian\"],\"после\":[\"russian\"],\"посол\":[\"russian\"],\"посреди\":[\"russian\"],\"постель\":[\"russian\"],\"посуда\":[\"russian\"],\"потом\":[\"russian\"],\"похвала\":[\"russian\"],\"похожий\":[\"russian\"],\"поцелуй\":[\"russian\"],\"почва\":[\"russian\"],\"почему\":[\"russian\"],\"пошлина\":[\"russian\"],\"поэма\":[\"russian\"],\"поэтому\":[\"russian\"],\"право\":[\"russian\"],\"праздник\":[\"russian\"],\"практика\":[\"russian\"],\"прах\":[\"russian\"],\"преграда\":[\"russian\"],\"предмет\":[\"russian\"],\"прежде\":[\"russian\"],\"прелесть\":[\"russian\"],\"премия\":[\"russian\"],\"препарат\":[\"russian\"],\"пресса\":[\"russian\"],\"прибыть\":[\"russian\"],\"прижать\":[\"russian\"],\"прийти\":[\"russian\"],\"приказ\":[\"russian\"],\"прилавок\":[\"russian\"],\"пример\":[\"russian\"],\"принять\":[\"russian\"],\"природа\":[\"russian\"],\"притом\":[\"russian\"],\"прихожая\":[\"russian\"],\"прицел\":[\"russian\"],\"причина\":[\"russian\"],\"приют\":[\"russian\"],\"прогноз\":[\"russian\"],\"продукт\":[\"russian\"],\"проект\":[\"russian\"],\"прожить\":[\"russian\"],\"прокат\":[\"russian\"],\"промысел\":[\"russian\"],\"пропуск\":[\"russian\"],\"просто\":[\"russian\"],\"против\":[\"russian\"],\"профиль\":[\"russian\"],\"процесс\":[\"russian\"],\"прочий\":[\"russian\"],\"прошлый\":[\"russian\"],\"прощать\":[\"russian\"],\"пружина\":[\"russian\"],\"прут\":[\"russian\"],\"прыжок\":[\"russian\"],\"прямой\":[\"russian\"],\"птица\":[\"russian\"],\"публика\":[\"russian\"],\"пугать\":[\"russian\"],\"пуговица\":[\"russian\"],\"пузырь\":[\"russian\"],\"пульт\":[\"russian\"],\"пуля\":[\"russian\"],\"пункт\":[\"russian\"],\"пускать\":[\"russian\"],\"пустой\":[\"russian\"],\"путь\":[\"russian\"],\"пухлый\":[\"russian\"],\"пучок\":[\"russian\"],\"пушистый\":[\"russian\"],\"пушка\":[\"russian\"],\"пчела\":[\"russian\"],\"пшеница\":[\"russian\"],\"пылать\":[\"russian\"],\"пыль\":[\"russian\"],\"пышный\":[\"russian\"],\"пьеса\":[\"russian\"],\"пятка\":[\"russian\"],\"пятно\":[\"russian\"],\"пятый\":[\"russian\"],\"пятьсот\":[\"russian\"],\"работа\":[\"russian\"],\"равнина\":[\"russian\"],\"ради\":[\"russian\"],\"радость\":[\"russian\"],\"радуга\":[\"russian\"],\"разбить\":[\"russian\"],\"развитие\":[\"russian\"],\"разговор\":[\"russian\"],\"раздел\":[\"russian\"],\"различие\":[\"russian\"],\"размер\":[\"russian\"],\"разный\":[\"russian\"],\"разрыв\":[\"russian\"],\"разум\":[\"russian\"],\"район\":[\"russian\"],\"ракета\":[\"russian\"],\"раковина\":[\"russian\"],\"рамка\":[\"russian\"],\"рано\":[\"russian\"],\"рапорт\":[\"russian\"],\"распад\":[\"russian\"],\"рассказ\":[\"russian\"],\"расти\":[\"russian\"],\"расход\":[\"russian\"],\"расцвет\":[\"russian\"],\"рация\":[\"russian\"],\"рвануть\":[\"russian\"],\"рваться\":[\"russian\"],\"реакция\":[\"russian\"],\"ребро\":[\"russian\"],\"реветь\":[\"russian\"],\"редактор\":[\"russian\"],\"редкий\":[\"russian\"],\"реестр\":[\"russian\"],\"режим\":[\"russian\"],\"резать\":[\"russian\"],\"резерв\":[\"russian\"],\"резина\":[\"russian\"],\"резко\":[\"russian\"],\"резной\":[\"russian\"],\"рейс\":[\"russian\"],\"реклама\":[\"russian\"],\"рекорд\":[\"russian\"],\"религия\":[\"russian\"],\"рельс\":[\"russian\"],\"ремень\":[\"russian\"],\"ремонт\":[\"russian\"],\"реплика\":[\"russian\"],\"репортаж\":[\"russian\"],\"ресница\":[\"russian\"],\"ресторан\":[\"russian\"],\"реформа\":[\"russian\"],\"рецепт\":[\"russian\"],\"речь\":[\"russian\"],\"решение\":[\"russian\"],\"ржавый\":[\"russian\"],\"риск\":[\"russian\"],\"рисунок\":[\"russian\"],\"ритуал\":[\"russian\"],\"рифма\":[\"russian\"],\"робко\":[\"russian\"],\"робот\":[\"russian\"],\"ровесник\":[\"russian\"],\"ровно\":[\"russian\"],\"родной\":[\"russian\"],\"рождение\":[\"russian\"],\"роза\":[\"russian\"],\"розовый\":[\"russian\"],\"розыск\":[\"russian\"],\"роль\":[\"russian\"],\"роман\":[\"russian\"],\"роскошь\":[\"russian\"],\"роспись\":[\"russian\"],\"рост\":[\"russian\"],\"рубашка\":[\"russian\"],\"рубеж\":[\"russian\"],\"рубить\":[\"russian\"],\"рубрика\":[\"russian\"],\"рудник\":[\"russian\"],\"рука\":[\"russian\"],\"рукопись\":[\"russian\"],\"румяный\":[\"russian\"],\"русло\":[\"russian\"],\"рухнуть\":[\"russian\"],\"ручей\":[\"russian\"],\"ручной\":[\"russian\"],\"рыба\":[\"russian\"],\"рыжий\":[\"russian\"],\"рынок\":[\"russian\"],\"рыхлый\":[\"russian\"],\"рыцарь\":[\"russian\"],\"рычаг\":[\"russian\"],\"рюкзак\":[\"russian\"],\"рядом\":[\"russian\"],\"садовый\":[\"russian\"],\"сажать\":[\"russian\"],\"салон\":[\"russian\"],\"салфетка\":[\"russian\"],\"салют\":[\"russian\"],\"самец\":[\"russian\"],\"самовар\":[\"russian\"],\"самый\":[\"russian\"],\"сани\":[\"russian\"],\"санкция\":[\"russian\"],\"сапог\":[\"russian\"],\"сарай\":[\"russian\"],\"сатира\":[\"russian\"],\"сахар\":[\"russian\"],\"сбить\":[\"russian\"],\"сбоку\":[\"russian\"],\"сборная\":[\"russian\"],\"сбыт\":[\"russian\"],\"свадьба\":[\"russian\"],\"свалка\":[\"russian\"],\"сварить\":[\"russian\"],\"свежий\":[\"russian\"],\"сверху\":[\"russian\"],\"свет\":[\"russian\"],\"свеча\":[\"russian\"],\"свинья\":[\"russian\"],\"свист\":[\"russian\"],\"свитер\":[\"russian\"],\"свобода\":[\"russian\"],\"сводка\":[\"russian\"],\"свой\":[\"russian\"],\"свыше\":[\"russian\"],\"связь\":[\"russian\"],\"сдаться\":[\"russian\"],\"сделать\":[\"russian\"],\"сегмент\":[\"russian\"],\"сегодня\":[\"russian\"],\"седло\":[\"russian\"],\"седой\":[\"russian\"],\"седьмой\":[\"russian\"],\"сезон\":[\"russian\"],\"сейф\":[\"russian\"],\"сейчас\":[\"russian\"],\"секрет\":[\"russian\"],\"сектор\":[\"russian\"],\"секунда\":[\"russian\"],\"семинар\":[\"russian\"],\"семья\":[\"russian\"],\"сенатор\":[\"russian\"],\"сено\":[\"russian\"],\"сенсация\":[\"russian\"],\"сентябрь\":[\"russian\"],\"сервис\":[\"russian\"],\"сердце\":[\"russian\"],\"середина\":[\"russian\"],\"сержант\":[\"russian\"],\"серия\":[\"russian\"],\"серый\":[\"russian\"],\"сессия\":[\"russian\"],\"сесть\":[\"russian\"],\"сетевой\":[\"russian\"],\"сжатый\":[\"russian\"],\"сжечь\":[\"russian\"],\"сзади\":[\"russian\"],\"сигнал\":[\"russian\"],\"сиденье\":[\"russian\"],\"сила\":[\"russian\"],\"силуэт\":[\"russian\"],\"сильный\":[\"russian\"],\"символ\":[\"russian\"],\"симпатия\":[\"russian\"],\"симфония\":[\"russian\"],\"синий\":[\"russian\"],\"синтез\":[\"russian\"],\"синяк\":[\"russian\"],\"сирень\":[\"russian\"],\"система\":[\"russian\"],\"ситуация\":[\"russian\"],\"сияние\":[\"russian\"],\"сказать\":[\"russian\"],\"скала\":[\"russian\"],\"скамейка\":[\"russian\"],\"скандал\":[\"russian\"],\"скатерть\":[\"russian\"],\"скачок\":[\"russian\"],\"скважина\":[\"russian\"],\"сквер\":[\"russian\"],\"сквозь\":[\"russian\"],\"скелет\":[\"russian\"],\"скидка\":[\"russian\"],\"склад\":[\"russian\"],\"сколько\":[\"russian\"],\"скорый\":[\"russian\"],\"скосить\":[\"russian\"],\"скот\":[\"russian\"],\"скрипка\":[\"russian\"],\"скудный\":[\"russian\"],\"скука\":[\"russian\"],\"слабый\":[\"russian\"],\"слава\":[\"russian\"],\"сладкий\":[\"russian\"],\"слегка\":[\"russian\"],\"след\":[\"russian\"],\"слеза\":[\"russian\"],\"слепой\":[\"russian\"],\"слесарь\":[\"russian\"],\"слишком\":[\"russian\"],\"слово\":[\"russian\"],\"слог\":[\"russian\"],\"сложный\":[\"russian\"],\"сломать\":[\"russian\"],\"служба\":[\"russian\"],\"слух\":[\"russian\"],\"случай\":[\"russian\"],\"слышать\":[\"russian\"],\"слюна\":[\"russian\"],\"смежный\":[\"russian\"],\"смелый\":[\"russian\"],\"сменить\":[\"russian\"],\"смесь\":[\"russian\"],\"сметана\":[\"russian\"],\"смех\":[\"russian\"],\"смола\":[\"russian\"],\"смуглый\":[\"russian\"],\"смутный\":[\"russian\"],\"смущать\":[\"russian\"],\"смысл\":[\"russian\"],\"снайпер\":[\"russian\"],\"снаряд\":[\"russian\"],\"сначала\":[\"russian\"],\"снег\":[\"russian\"],\"снизу\":[\"russian\"],\"сниться\":[\"russian\"],\"сно��а\":[\"russian\"],\"снять\":[\"russian\"],\"собака\":[\"russian\"],\"соблазн\":[\"russian\"],\"собрание\":[\"russian\"],\"событие\":[\"russian\"],\"совесть\":[\"russian\"],\"совсем\":[\"russian\"],\"согласие\":[\"russian\"],\"создать\":[\"russian\"],\"сознание\":[\"russian\"],\"созреть\":[\"russian\"],\"сойтись\":[\"russian\"],\"сокол\":[\"russian\"],\"солдат\":[\"russian\"],\"соленый\":[\"russian\"],\"солнце\":[\"russian\"],\"солома\":[\"russian\"],\"сомнение\":[\"russian\"],\"сонный\":[\"russian\"],\"соперник\":[\"russian\"],\"соратник\":[\"russian\"],\"сорвать\":[\"russian\"],\"сосед\":[\"russian\"],\"сосиска\":[\"russian\"],\"состав\":[\"russian\"],\"сотня\":[\"russian\"],\"соус\":[\"russian\"],\"союз\":[\"russian\"],\"спад\":[\"russian\"],\"спальня\":[\"russian\"],\"спасти\":[\"russian\"],\"спектр\":[\"russian\"],\"сперва\":[\"russian\"],\"спешить\":[\"russian\"],\"спина\":[\"russian\"],\"спирт\":[\"russian\"],\"список\":[\"russian\"],\"спичка\":[\"russian\"],\"сплав\":[\"russian\"],\"спонсор\":[\"russian\"],\"спор\":[\"russian\"],\"способ\":[\"russian\"],\"справка\":[\"russian\"],\"спустя\":[\"russian\"],\"спутник\":[\"russian\"],\"сразу\":[\"russian\"],\"средство\":[\"russian\"],\"срок\":[\"russian\"],\"срыв\":[\"russian\"],\"ссора\":[\"russian\"],\"ссылка\":[\"russian\"],\"ставить\":[\"russian\"],\"стадия\":[\"russian\"],\"стакан\":[\"russian\"],\"станция\":[\"russian\"],\"старый\":[\"russian\"],\"стая\":[\"russian\"],\"стебель\":[\"russian\"],\"стекло\":[\"russian\"],\"стена\":[\"russian\"],\"степень\":[\"russian\"],\"стереть\":[\"russian\"],\"стиль\":[\"russian\"],\"стимул\":[\"russian\"],\"стирать\":[\"russian\"],\"стихи\":[\"russian\"],\"стоить\":[\"russian\"],\"стойка\":[\"russian\"],\"стол\":[\"russian\"],\"стонать\":[\"russian\"],\"стопа\":[\"russian\"],\"сторона\":[\"russian\"],\"стоянка\":[\"russian\"],\"страна\":[\"russian\"],\"стричь\":[\"russian\"],\"строгий\":[\"russian\"],\"струя\":[\"russian\"],\"студент\":[\"russian\"],\"стук\":[\"russian\"],\"ступня\":[\"russian\"],\"стыдно\":[\"russian\"],\"суббота\":[\"russian\"],\"субъект\":[\"russian\"],\"сувенир\":[\"russian\"],\"сугроб\":[\"russian\"],\"сугубо\":[\"russian\"],\"судить\":[\"russian\"],\"судно\":[\"russian\"],\"судьба\":[\"russian\"],\"суета\":[\"russian\"],\"суметь\":[\"russian\"],\"сумма\":[\"russian\"],\"сумрак\":[\"russian\"],\"сундук\":[\"russian\"],\"супруг\":[\"russian\"],\"суровый\":[\"russian\"],\"сутки\":[\"russian\"],\"сухой\":[\"russian\"],\"суша\":[\"russian\"],\"существо\":[\"russian\"],\"сфера\":[\"russian\"],\"схема\":[\"russian\"],\"схожий\":[\"russian\"],\"сценарий\":[\"russian\"],\"счастье\":[\"russian\"],\"считать\":[\"russian\"],\"съезд\":[\"russian\"],\"сыграть\":[\"russian\"],\"сырой\":[\"russian\"],\"сытый\":[\"russian\"],\"сыщик\":[\"russian\"],\"сюда\":[\"russian\"],\"сюжет\":[\"russian\"],\"сюрприз\":[\"russian\"],\"тайна\":[\"russian\"],\"также\":[\"russian\"],\"такой\":[\"russian\"],\"такси\":[\"russian\"],\"тактика\":[\"russian\"],\"талия\":[\"russian\"],\"таможня\":[\"russian\"],\"танец\":[\"russian\"],\"таракан\":[\"russian\"],\"тарелка\":[\"russian\"],\"тариф\":[\"russian\"],\"тащить\":[\"russian\"],\"таять\":[\"russian\"],\"тварь\":[\"russian\"],\"театр\":[\"russian\"],\"тезис\":[\"russian\"],\"текст\":[\"russian\"],\"текущий\":[\"russian\"],\"телефон\":[\"russian\"],\"тема\":[\"russian\"],\"темнота\":[\"russian\"],\"теневой\":[\"russian\"],\"теннис\":[\"russian\"],\"теория\":[\"russian\"],\"теперь\":[\"russian\"],\"тепло\":[\"russian\"],\"терапия\":[\"russian\"],\"терзать\":[\"russian\"],\"термин\":[\"russian\"],\"терпеть\":[\"russian\"],\"терраса\":[\"russian\"],\"терять\":[\"russian\"],\"тесный\":[\"russian\"],\"тетрадь\":[\"russian\"],\"техника\":[\"russian\"],\"течение\":[\"russian\"],\"тигр\":[\"russian\"],\"типовой\":[\"russian\"],\"тираж\":[\"russian\"],\"титул\":[\"russian\"],\"тихий\":[\"russian\"],\"ткань\":[\"russian\"],\"товарищ\":[\"russian\"],\"тоже\":[\"russian\"],\"толпа\":[\"russian\"],\"толстый\":[\"russian\"],\"толчок\":[\"russian\"],\"толщина\":[\"russian\"],\"только\":[\"russian\"],\"тонкий\":[\"russian\"],\"тонна\":[\"russian\"],\"топить\":[\"russian\"],\"топор\":[\"russian\"],\"торговля\":[\"russian\"],\"тормоз\":[\"russian\"],\"торчать\":[\"russian\"],\"тотчас\":[\"russian\"],\"точка\":[\"russian\"],\"точно\":[\"russian\"],\"тощий\":[\"russian\"],\"трава\":[\"russian\"],\"традиция\":[\"russian\"],\"трактор\":[\"russian\"],\"трамвай\":[\"russian\"],\"траншея\":[\"russian\"],\"трасса\":[\"russian\"],\"тревога\":[\"russian\"],\"трезвый\":[\"russian\"],\"тренер\":[\"russian\"],\"трепет\":[\"russian\"],\"треск\":[\"russian\"],\"третий\":[\"russian\"],\"трещина\":[\"russian\"],\"трибуна\":[\"russian\"],\"тридцать\":[\"russian\"],\"триста\":[\"russian\"],\"триумф\":[\"russian\"],\"трогать\":[\"russian\"],\"тройка\":[\"russian\"],\"тронуть\":[\"russian\"],\"тропа\":[\"russian\"],\"тротуар\":[\"russian\"],\"трубка\":[\"russian\"],\"труд\":[\"russian\"],\"трюк\":[\"russian\"],\"тряпка\":[\"russian\"],\"туго\":[\"russian\"],\"туловище\":[\"russian\"],\"туман\":[\"russian\"],\"тумбочка\":[\"russian\"],\"тундра\":[\"russian\"],\"тупик\":[\"russian\"],\"турист\":[\"russian\"],\"турнир\":[\"russian\"],\"тусклый\":[\"russian\"],\"туфля\":[\"russian\"],\"туча\":[\"russian\"],\"тысяча\":[\"russian\"],\"тяга\":[\"russian\"],\"тяжело\":[\"russian\"],\"убежать\":[\"russian\"],\"убогий\":[\"russian\"],\"уборка\":[\"russian\"],\"уважение\":[\"russian\"],\"увезти\":[\"russian\"],\"уволить\":[\"russian\"],\"угадать\":[\"russian\"],\"угол\":[\"russian\"],\"угощать\":[\"russian\"],\"угроза\":[\"russian\"],\"угрюмый\":[\"russian\"],\"удар\":[\"russian\"],\"удачный\":[\"russian\"],\"уделять\":[\"russian\"],\"удивить\":[\"russian\"],\"удобный\":[\"russian\"],\"удочка\":[\"russian\"],\"уезжать\":[\"russian\"],\"ужин\":[\"russian\"],\"узел\":[\"russian\"],\"узкий\":[\"russian\"],\"уйти\":[\"russian\"],\"указание\":[\"russian\"],\"уклон\":[\"russian\"],\"украсть\":[\"russian\"],\"укусить\":[\"russian\"],\"улетать\":[\"russian\"],\"улица\":[\"russian\"],\"улыбка\":[\"russian\"],\"умело\":[\"russian\"],\"умение\":[\"russian\"],\"умный\":[\"russian\"],\"умолять\":[\"russian\"],\"унести\":[\"russian\"],\"унижать\":[\"russian\"],\"унылый\":[\"russian\"],\"упаковка\":[\"russian\"],\"упасть\":[\"russian\"],\"упорно\":[\"russian\"],\"упрек\":[\"russian\"],\"урна\":[\"russian\"],\"уровень\":[\"russian\"],\"урожай\":[\"russian\"],\"уронить\":[\"russian\"],\"усадьба\":[\"russian\"],\"усатый\":[\"russian\"],\"усвоить\":[\"russian\"],\"усилие\":[\"russian\"],\"условие\":[\"russian\"],\"услуга\":[\"russian\"],\"усмешка\":[\"russian\"],\"успеть\":[\"russian\"],\"устав\":[\"russian\"],\"устоять\":[\"russian\"],\"утечка\":[\"russian\"],\"утешать\":[\"russian\"],\"утро\":[\"russian\"],\"уцелеть\":[\"russian\"],\"участие\":[\"russian\"],\"ученик\":[\"russian\"],\"учесть\":[\"russian\"],\"ущелье\":[\"russian\"],\"ущерб\":[\"russian\"],\"уютный\":[\"russian\"],\"фабрика\":[\"russian\"],\"фаворит\":[\"russian\"],\"факел\":[\"russian\"],\"факт\":[\"russian\"],\"фамилия\":[\"russian\"],\"фантазия\":[\"russian\"],\"фасад\":[\"russian\"],\"февраль\":[\"russian\"],\"феномен\":[\"russian\"],\"фермер\":[\"russian\"],\"фигура\":[\"russian\"],\"физика\":[\"russian\"],\"филиал\":[\"russian\"],\"философ\":[\"russian\"],\"фильм\":[\"russian\"],\"финал\":[\"russian\"],\"флаг\":[\"russian\"],\"флот\":[\"russian\"],\"фойе\":[\"russian\"],\"фокус\":[\"russian\"],\"фонарь\":[\"russian\"],\"фонд\":[\"russian\"],\"фонтан\":[\"russian\"],\"форма\":[\"russian\"],\"форум\":[\"russian\"],\"фото\":[\"russian\"],\"фрагмент\":[\"russian\"],\"фраза\":[\"russian\"],\"фракция\":[\"russian\"],\"фронт\":[\"russian\"],\"фрукт\":[\"russian\"],\"функция\":[\"russian\"],\"фуражка\":[\"russian\"],\"футбол\":[\"russian\"],\"футляр\":[\"russian\"],\"халат\":[\"russian\"],\"хаос\":[\"russian\"],\"характер\":[\"russian\"],\"хата\":[\"russian\"],\"хвалить\":[\"russian\"],\"хватать\":[\"russian\"],\"хвойный\":[\"russian\"],\"хвост\":[\"russian\"],\"химия\":[\"russian\"],\"хирург\":[\"russian\"],\"хитрый\":[\"russian\"],\"хищник\":[\"russian\"],\"хлеб\":[\"russian\"],\"хлынуть\":[\"russian\"],\"хмурый\":[\"russian\"],\"ходить\":[\"russian\"],\"хозяин\":[\"russian\"],\"хоккей\":[\"russian\"],\"холм\":[\"russian\"],\"холст\":[\"russian\"],\"хорошо\":[\"russian\"],\"хотеть\":[\"russian\"],\"храбрый\":[\"russian\"],\"храм\":[\"russian\"],\"хранить\":[\"russian\"],\"хребет\":[\"russian\"],\"хрен\":[\"russian\"],\"хрипло\":[\"russian\"],\"хроника\":[\"russian\"],\"хрупкий\":[\"russian\"],\"художник\":[\"russian\"],\"худший\":[\"russian\"],\"хулиган\":[\"russian\"],\"хутор\":[\"russian\"],\"царь\":[\"russian\"],\"цветок\":[\"russian\"],\"целевой\":[\"russian\"],\"целиком\":[\"russian\"],\"целое\":[\"russian\"],\"цель\":[\"russian\"],\"цензура\":[\"russian\"],\"ценить\":[\"russian\"],\"центр\":[\"russian\"],\"цепной\":[\"russian\"],\"цикл\":[\"russian\"],\"цилиндр\":[\"russian\"],\"цирк\":[\"russian\"],\"цитата\":[\"russian\"],\"цифра\":[\"russian\"],\"чайник\":[\"russian\"],\"часы\":[\"russian\"],\"чашка\":[\"russian\"],\"человек\":[\"russian\"],\"челюсть\":[\"russian\"],\"чемодан\":[\"russian\"],\"чемпион\":[\"russian\"],\"чепуха\":[\"russian\"],\"червь\":[\"russian\"],\"чердак\":[\"russian\"],\"через\":[\"russian\"],\"чернила\":[\"russian\"],\"черта\":[\"russian\"],\"чеснок\":[\"russian\"],\"честно\":[\"russian\"],\"четверть\":[\"russian\"],\"четыре\":[\"russian\"],\"число\":[\"russian\"],\"чистый\":[\"russian\"],\"читатель\":[\"russian\"],\"чтение\":[\"russian\"],\"чтобы\":[\"russian\"],\"чувство\":[\"russian\"],\"чудак\":[\"russian\"],\"чудный\":[\"russian\"],\"чудо\":[\"russian\"],\"чужой\":[\"russian\"],\"чулок\":[\"russian\"],\"чума\":[\"russian\"],\"чушь\":[\"russian\"],\"чуять\":[\"russian\"],\"шагать\":[\"russian\"],\"шанс\":[\"russian\"],\"шапка\":[\"russian\"],\"шарик\":[\"russian\"],\"шарф\":[\"russian\"],\"шахматы\":[\"russian\"],\"шашлык\":[\"russian\"],\"шедевр\":[\"russian\"],\"шептать\":[\"russian\"],\"шерсть\":[\"russian\"],\"шестой\":[\"russian\"],\"шинель\":[\"russian\"],\"ширина\":[\"russian\"],\"шишка\":[\"russian\"],\"шкаф\":[\"russian\"],\"школа\":[\"russian\"],\"шкура\":[\"russian\"],\"шланг\":[\"russian\"],\"шлем\":[\"russian\"],\"шнур\":[\"russian\"],\"шоколад\":[\"russian\"],\"шорох\":[\"russian\"],\"шоссе\":[\"russian\"],\"шпион\":[\"russian\"],\"шприц\":[\"russian\"],\"штаб\":[\"russian\"],\"штамм\":[\"russian\"],\"штаны\":[\"russian\"],\"штатный\":[\"russian\"],\"штора\":[\"russian\"],\"штраф\":[\"russian\"],\"штурм\":[\"russian\"],\"штык\":[\"russian\"],\"шумно\":[\"russian\"],\"шуршать\":[\"russian\"],\"шутить\":[\"russian\"],\"шутка\":[\"russian\"],\"щедрый\":[\"russian\"],\"щека\":[\"russian\"],\"щенок\":[\"russian\"],\"экзамен\":[\"russian\"],\"экипаж\":[\"russian\"],\"экономия\":[\"russian\"],\"экран\":[\"russian\"],\"эксперт\":[\"russian\"],\"элемент\":[\"russian\"],\"элитный\":[\"russian\"],\"эмоция\":[\"russian\"],\"энергия\":[\"russian\"],\"эпизод\":[\"russian\"],\"эпоха\":[\"russian\"],\"эскиз\":[\"russian\"],\"эстрада\":[\"russian\"],\"этап\":[\"russian\"],\"этика\":[\"russian\"],\"этот\":[\"russian\"],\"эфир\":[\"russian\"],\"эффект\":[\"russian\"],\"эшелон\":[\"russian\"],\"юбилей\":[\"russian\"],\"юбка\":[\"russian\"],\"южный\":[\"russian\"],\"юмор\":[\"russian\"],\"юность\":[\"russian\"],\"юрист\":[\"russian\"],\"юстиция\":[\"russian\"],\"яблоко\":[\"russian\"],\"явление\":[\"russian\"],\"ягода\":[\"russian\"],\"ядро\":[\"russian\"],\"язык\":[\"russian\"],\"яйцо\":[\"russian\"],\"якобы\":[\"russian\"],\"якорь\":[\"russian\"],\"январь\":[\"russian\"],\"яркий\":[\"russian\"],\"ярмарка\":[\"russian\"],\"ярость\":[\"russian\"],\"ясный\":[\"russian\"],\"яхта\":[\"russian\"],\"ячейка\":[\"russian\"],\"ящик\":[\"russian\"],\"ábaco\":[\"spanish\"],\"abdomen\":[\"spanish\"],\"abeja\":[\"spanish\"],\"abierto\":[\"spanish\"],\"abogado\":[\"spanish\"],\"abono\":[\"spanish\"],\"aborto\":[\"spanish\"],\"abrazo\":[\"spanish\"],\"abrir\":[\"spanish\"],\"abuelo\":[\"spanish\"],\"abuso\":[\"spanish\"],\"acabar\":[\"spanish\"],\"academia\":[\"spanish\"],\"acceso\":[\"spanish\"],\"acción\":[\"spanish\"],\"aceite\":[\"spanish\"],\"acelga\":[\"spanish\"],\"acento\":[\"spanish\"],\"aceptar\":[\"spanish\"],\"ácido\":[\"spanish\"],\"aclarar\":[\"spanish\"],\"acné\":[\"spanish\"],\"acoger\":[\"spanish\"],\"acoso\":[\"spanish\"],\"activo\":[\"spanish\"],\"acto\":[\"spanish\"],\"actriz\":[\"spanish\"],\"actuar\":[\"spanish\"],\"acudir\":[\"spanish\"],\"acuerdo\":[\"spanish\"],\"acusar\":[\"spanish\"],\"adicto\":[\"spanish\"],\"admitir\":[\"spanish\"],\"adoptar\":[\"spanish\"],\"adorno\":[\"spanish\"],\"aduana\":[\"spanish\"],\"adulto\":[\"spanish\"],\"aéreo\":[\"spanish\"],\"afectar\":[\"spanish\"],\"afición\":[\"spanish\"],\"afinar\":[\"spanish\"],\"afirmar\":[\"spanish\"],\"ágil\":[\"spanish\"],\"agitar\":[\"spanish\"],\"agonía\":[\"spanish\"],\"agosto\":[\"spanish\"],\"agotar\":[\"spanish\"],\"agregar\":[\"spanish\"],\"agrio\":[\"spanish\"],\"agua\":[\"spanish\"],\"agudo\":[\"spanish\"],\"águila\":[\"spanish\"],\"aguja\":[\"spanish\"],\"ahogo\":[\"spanish\"],\"ahorro\":[\"spanish\"],\"aire\":[\"spanish\"],\"aislar\":[\"spanish\"],\"ajedrez\":[\"spanish\"],\"ajeno\":[\"spanish\"],\"ajuste\":[\"spanish\"],\"alacrán\":[\"spanish\"],\"alambre\":[\"spanish\"],\"alarma\":[\"spanish\"],\"alba\":[\"spanish\"],\"álbum\":[\"spanish\"],\"alcalde\":[\"spanish\"],\"aldea\":[\"spanish\"],\"alegre\":[\"spanish\"],\"alejar\":[\"spanish\"],\"alerta\":[\"spanish\"],\"aleta\":[\"spanish\"],\"alfiler\":[\"spanish\"],\"alga\":[\"spanish\"],\"algodón\":[\"spanish\"],\"aliado\":[\"spanish\"],\"aliento\":[\"spanish\"],\"alivio\":[\"spanish\"],\"alma\":[\"spanish\"],\"almeja\":[\"spanish\"],\"almíbar\":[\"spanish\"],\"altar\":[\"spanish\"],\"alteza\":[\"spanish\"],\"altivo\":[\"spanish\"],\"alto\":[\"spanish\"],\"altura\":[\"spanish\"],\"alumno\":[\"spanish\"],\"alzar\":[\"spanish\"],\"amable\":[\"spanish\"],\"amante\":[\"spanish\"],\"amapola\":[\"spanish\"],\"amargo\":[\"spanish\"],\"amasar\":[\"spanish\"],\"ámbar\":[\"spanish\"],\"ámbito\":[\"spanish\"],\"ameno\":[\"spanish\"],\"amigo\":[\"spanish\",\"turkish\"],\"amistad\":[\"spanish\"],\"amor\":[\"spanish\"],\"amparo\":[\"spanish\"],\"amplio\":[\"spanish\"],\"ancho\":[\"spanish\"],\"anciano\":[\"spanish\"],\"ancla\":[\"spanish\"],\"andar\":[\"spanish\"],\"andén\":[\"spanish\"],\"anemia\":[\"spanish\"],\"ángulo\":[\"spanish\"],\"anillo\":[\"spanish\"],\"ánimo\":[\"spanish\"],\"anís\":[\"spanish\"],\"anotar\":[\"spanish\"],\"antena\":[\"spanish\"],\"antiguo\":[\"spanish\"],\"antojo\":[\"spanish\"],\"anual\":[\"spanish\"],\"anular\":[\"spanish\"],\"anuncio\":[\"spanish\"],\"añadir\":[\"spanish\"],\"añejo\":[\"spanish\"],\"año\":[\"spanish\"],\"apagar\":[\"spanish\"],\"aparato\":[\"spanish\"],\"apetito\":[\"spanish\"],\"apio\":[\"spanish\"],\"aplicar\":[\"spanish\"],\"apodo\":[\"spanish\"],\"aporte\":[\"spanish\"],\"apoyo\":[\"spanish\"],\"aprender\":[\"spanish\"],\"aprobar\":[\"spanish\"],\"apuesta\":[\"spanish\"],\"apuro\":[\"spanish\"],\"arado\":[\"spanish\"],\"araña\":[\"spanish\"],\"arar\":[\"spanish\"],\"árbitro\":[\"spanish\"],\"árbol\":[\"spanish\"],\"arbusto\":[\"spanish\"],\"archivo\":[\"spanish\"],\"arco\":[\"spanish\"],\"arder\":[\"spanish\"],\"ardilla\":[\"spanish\"],\"arduo\":[\"spanish\"],\"área\":[\"spanish\"],\"árido\":[\"spanish\"],\"aries\":[\"spanish\"],\"armonía\":[\"spanish\"],\"arnés\":[\"spanish\"],\"aroma\":[\"spanish\",\"turkish\"],\"arpa\":[\"spanish\"],\"arpón\":[\"spanish\"],\"arreglo\":[\"spanish\"],\"arroz\":[\"spanish\"],\"arruga\":[\"spanish\"],\"arte\":[\"spanish\"],\"artista\":[\"spanish\"],\"asa\":[\"spanish\"],\"asado\":[\"spanish\"],\"asalto\":[\"spanish\"],\"ascenso\":[\"spanish\"],\"asegurar\":[\"spanish\"],\"aseo\":[\"spanish\"],\"asesor\":[\"spanish\"],\"asiento\":[\"spanish\"],\"asilo\":[\"spanish\"],\"asistir\":[\"spanish\"],\"asno\":[\"spanish\"],\"asombro\":[\"spanish\"],\"áspero\":[\"spanish\"],\"astilla\":[\"spanish\"],\"astro\":[\"spanish\"],\"astuto\":[\"spanish\"],\"asumir\":[\"spanish\"],\"asunto\":[\"spanish\"],\"atajo\":[\"spanish\"],\"ataque\":[\"spanish\"],\"atar\":[\"spanish\"],\"atento\":[\"spanish\"],\"ateo\":[\"spanish\"],\"ático\":[\"spanish\"],\"atleta\":[\"spanish\"],\"átomo\":[\"spanish\"],\"atraer\":[\"spanish\"],\"atroz\":[\"spanish\"],\"atún\":[\"spanish\"],\"audaz\":[\"spanish\"],\"audio\":[\"spanish\"],\"auge\":[\"spanish\"],\"aula\":[\"spanish\"],\"aumento\":[\"spanish\"],\"ausente\":[\"spanish\"],\"autor\":[\"spanish\"],\"aval\":[\"spanish\"],\"avance\":[\"spanish\"],\"avaro\":[\"spanish\"],\"ave\":[\"spanish\"],\"avellana\":[\"spanish\"],\"avena\":[\"spanish\"],\"avestruz\":[\"spanish\"],\"avión\":[\"spanish\"],\"aviso\":[\"spanish\"],\"ayer\":[\"spanish\"],\"ayuda\":[\"spanish\"],\"ayuno\":[\"spanish\"],\"azafrán\":[\"spanish\"],\"azar\":[\"spanish\"],\"azote\":[\"spanish\"],\"azúcar\":[\"spanish\"],\"azufre\":[\"spanish\"],\"azul\":[\"spanish\"],\"baba\":[\"spanish\"],\"babor\":[\"spanish\"],\"bache\":[\"spanish\"],\"bahía\":[\"spanish\"],\"baile\":[\"spanish\"],\"bajar\":[\"spanish\"],\"balanza\":[\"spanish\"],\"balcón\":[\"spanish\"],\"balde\":[\"spanish\"],\"bambú\":[\"spanish\"],\"banco\":[\"spanish\"],\"banda\":[\"spanish\"],\"baño\":[\"spanish\"],\"barba\":[\"spanish\"],\"barco\":[\"spanish\"],\"barniz\":[\"spanish\"],\"barro\":[\"spanish\"],\"báscula\":[\"spanish\"],\"bastón\":[\"spanish\"],\"basura\":[\"spanish\"],\"batalla\":[\"spanish\"],\"batería\":[\"spanish\"],\"batir\":[\"spanish\"],\"batuta\":[\"spanish\"],\"baúl\":[\"spanish\"],\"bazar\":[\"spanish\"],\"bebé\":[\"spanish\"],\"bebida\":[\"spanish\"],\"bello\":[\"spanish\"],\"besar\":[\"spanish\"],\"beso\":[\"spanish\"],\"bestia\":[\"spanish\"],\"bicho\":[\"spanish\"],\"bien\":[\"spanish\"],\"bingo\":[\"spanish\"],\"blanco\":[\"spanish\"],\"bloque\":[\"spanish\"],\"blusa\":[\"spanish\"],\"boa\":[\"spanish\"],\"bobina\":[\"spanish\"],\"bobo\":[\"spanish\"],\"boca\":[\"spanish\"],\"bocina\":[\"spanish\"],\"boda\":[\"spanish\"],\"bodega\":[\"spanish\"],\"boina\":[\"spanish\"],\"bola\":[\"spanish\"],\"bolero\":[\"spanish\",\"turkish\"],\"bolsa\":[\"spanish\"],\"bomba\":[\"spanish\"],\"bondad\":[\"spanish\"],\"bonito\":[\"spanish\"],\"bono\":[\"spanish\"],\"bonsái\":[\"spanish\"],\"borde\":[\"spanish\"],\"borrar\":[\"spanish\"],\"bosque\":[\"spanish\"],\"bote\":[\"spanish\"],\"botín\":[\"spanish\"],\"bóveda\":[\"spanish\"],\"bozal\":[\"spanish\"],\"bravo\":[\"spanish\"],\"brazo\":[\"spanish\"],\"brecha\":[\"spanish\"],\"breve\":[\"spanish\"],\"brillo\":[\"spanish\"],\"brinco\":[\"spanish\"],\"brisa\":[\"spanish\"],\"broca\":[\"spanish\"],\"broma\":[\"spanish\"],\"bronce\":[\"spanish\"],\"brote\":[\"spanish\"],\"bruja\":[\"spanish\"],\"brusco\":[\"spanish\"],\"bruto\":[\"spanish\"],\"buceo\":[\"spanish\"],\"bucle\":[\"spanish\"],\"bueno\":[\"spanish\"],\"buey\":[\"spanish\"],\"bufanda\":[\"spanish\"],\"bufón\":[\"spanish\"],\"búho\":[\"spanish\"],\"buitre\":[\"spanish\"],\"bulto\":[\"spanish\"],\"burbuja\":[\"spanish\"],\"burla\":[\"spanish\"],\"burro\":[\"spanish\"],\"buscar\":[\"spanish\"],\"butaca\":[\"spanish\"],\"buzón\":[\"spanish\"],\"caballo\":[\"spanish\"],\"cabeza\":[\"spanish\"],\"cabina\":[\"spanish\"],\"cabra\":[\"spanish\"],\"cacao\":[\"spanish\"],\"cadáver\":[\"spanish\"],\"cadena\":[\"spanish\"],\"caer\":[\"spanish\"],\"café\":[\"spanish\"],\"caída\":[\"spanish\"],\"caimán\":[\"spanish\"],\"caja\":[\"spanish\"],\"cajón\":[\"spanish\"],\"cal\":[\"spanish\"],\"calamar\":[\"spanish\"],\"calcio\":[\"spanish\"],\"caldo\":[\"spanish\"],\"calidad\":[\"spanish\"],\"calle\":[\"spanish\"],\"calma\":[\"spanish\"],\"calor\":[\"spanish\"],\"calvo\":[\"spanish\"],\"cama\":[\"spanish\"],\"cambio\":[\"spanish\"],\"camello\":[\"spanish\"],\"camino\":[\"spanish\"],\"campo\":[\"spanish\"],\"cáncer\":[\"spanish\"],\"candil\":[\"spanish\"],\"canela\":[\"spanish\"],\"canguro\":[\"spanish\"],\"canica\":[\"spanish\"],\"canto\":[\"spanish\"],\"caña\":[\"spanish\"],\"cañón\":[\"spanish\"],\"caoba\":[\"spanish\"],\"caos\":[\"spanish\"],\"capaz\":[\"spanish\"],\"capitán\":[\"spanish\"],\"capote\":[\"spanish\"],\"captar\":[\"spanish\"],\"capucha\":[\"spanish\"],\"cara\":[\"spanish\"],\"carbón\":[\"spanish\"],\"cárcel\":[\"spanish\"],\"careta\":[\"spanish\"],\"carga\":[\"spanish\"],\"cariño\":[\"spanish\"],\"carne\":[\"spanish\"],\"carpeta\":[\"spanish\"],\"carro\":[\"spanish\"],\"carta\":[\"spanish\"],\"casa\":[\"spanish\"],\"casco\":[\"spanish\"],\"casero\":[\"spanish\"],\"caspa\":[\"spanish\"],\"castor\":[\"spanish\"],\"catorce\":[\"spanish\"],\"catre\":[\"spanish\"],\"caudal\":[\"spanish\"],\"causa\":[\"spanish\"],\"cazo\":[\"spanish\"],\"cebolla\":[\"spanish\"],\"ceder\":[\"spanish\"],\"cedro\":[\"spanish\"],\"celda\":[\"spanish\"],\"célebre\":[\"spanish\"],\"celoso\":[\"spanish\"],\"célula\":[\"spanish\"],\"cemento\":[\"spanish\"],\"ceniza\":[\"spanish\"],\"centro\":[\"spanish\"],\"cerca\":[\"spanish\"],\"cerdo\":[\"spanish\"],\"cereza\":[\"spanish\"],\"cero\":[\"spanish\"],\"cerrar\":[\"spanish\"],\"certeza\":[\"spanish\"],\"césped\":[\"spanish\"],\"cetro\":[\"spanish\"],\"chacal\":[\"spanish\"],\"chaleco\":[\"spanish\"],\"champú\":[\"spanish\"],\"chancla\":[\"spanish\"],\"chapa\":[\"spanish\"],\"charla\":[\"spanish\"],\"chico\":[\"spanish\"],\"chiste\":[\"spanish\"],\"chivo\":[\"spanish\"],\"choque\":[\"spanish\"],\"choza\":[\"spanish\"],\"chuleta\":[\"spanish\"],\"chupar\":[\"spanish\"],\"ciclón\":[\"spanish\"],\"ciego\":[\"spanish\"],\"cielo\":[\"spanish\"],\"cien\":[\"spanish\"],\"cierto\":[\"spanish\"],\"cifra\":[\"spanish\"],\"cigarro\":[\"spanish\"],\"cima\":[\"spanish\"],\"cinco\":[\"spanish\"],\"cine\":[\"spanish\"],\"cinta\":[\"spanish\"],\"ciprés\":[\"spanish\"],\"circo\":[\"spanish\"],\"ciruela\":[\"spanish\"],\"cisne\":[\"spanish\"],\"cita\":[\"spanish\"],\"ciudad\":[\"spanish\"],\"clamor\":[\"spanish\"],\"clan\":[\"spanish\"],\"claro\":[\"spanish\"],\"clase\":[\"spanish\"],\"clave\":[\"spanish\"],\"cliente\":[\"spanish\"],\"clima\":[\"spanish\"],\"clínica\":[\"spanish\"],\"cobre\":[\"spanish\"],\"cocción\":[\"spanish\"],\"cochino\":[\"spanish\"],\"cocina\":[\"spanish\"],\"coco\":[\"spanish\"],\"código\":[\"spanish\"],\"codo\":[\"spanish\"],\"cofre\":[\"spanish\"],\"coger\":[\"spanish\"],\"cohete\":[\"spanish\"],\"cojín\":[\"spanish\"],\"cojo\":[\"spanish\"],\"cola\":[\"spanish\"],\"colcha\":[\"spanish\"],\"colegio\":[\"spanish\"],\"colgar\":[\"spanish\"],\"colina\":[\"spanish\"],\"collar\":[\"spanish\"],\"colmo\":[\"spanish\"],\"columna\":[\"spanish\"],\"combate\":[\"spanish\"],\"comer\":[\"spanish\"],\"comida\":[\"spanish\"],\"cómodo\":[\"spanish\"],\"compra\":[\"spanish\"],\"conde\":[\"spanish\"],\"conejo\":[\"spanish\"],\"conga\":[\"spanish\"],\"conocer\":[\"spanish\"],\"consejo\":[\"spanish\"],\"contar\":[\"spanish\"],\"copa\":[\"spanish\"],\"copia\":[\"spanish\"],\"corazón\":[\"spanish\"],\"corbata\":[\"spanish\"],\"corcho\":[\"spanish\"],\"cordón\":[\"spanish\"],\"corona\":[\"spanish\"],\"correr\":[\"spanish\"],\"coser\":[\"spanish\"],\"cosmos\":[\"spanish\"],\"costa\":[\"spanish\"],\"cráneo\":[\"spanish\"],\"cráter\":[\"spanish\"],\"crear\":[\"spanish\"],\"crecer\":[\"spanish\"],\"creído\":[\"spanish\"],\"crema\":[\"spanish\"],\"cría\":[\"spanish\"],\"crimen\":[\"spanish\"],\"cripta\":[\"spanish\"],\"crisis\":[\"spanish\"],\"cromo\":[\"spanish\"],\"crónica\":[\"spanish\"],\"croqueta\":[\"spanish\"],\"crudo\":[\"spanish\"],\"cruz\":[\"spanish\"],\"cuadro\":[\"spanish\"],\"cuarto\":[\"spanish\"],\"cuatro\":[\"spanish\"],\"cubo\":[\"spanish\"],\"cubrir\":[\"spanish\"],\"cuchara\":[\"spanish\"],\"cuello\":[\"spanish\"],\"cuento\":[\"spanish\"],\"cuerda\":[\"spanish\"],\"cuesta\":[\"spanish\"],\"cueva\":[\"spanish\"],\"cuidar\":[\"spanish\"],\"culebra\":[\"spanish\"],\"culpa\":[\"spanish\"],\"culto\":[\"spanish\"],\"cumbre\":[\"spanish\"],\"cumplir\":[\"spanish\"],\"cuna\":[\"spanish\"],\"cuneta\":[\"spanish\"],\"cuota\":[\"spanish\"],\"cupón\":[\"spanish\"],\"cúpula\":[\"spanish\"],\"curar\":[\"spanish\"],\"curioso\":[\"spanish\"],\"curso\":[\"spanish\"],\"curva\":[\"spanish\"],\"cutis\":[\"spanish\"],\"dama\":[\"spanish\"],\"danza\":[\"spanish\"],\"dar\":[\"spanish\"],\"dardo\":[\"spanish\"],\"dátil\":[\"spanish\"],\"deber\":[\"spanish\"],\"débil\":[\"spanish\"],\"década\":[\"spanish\"],\"decir\":[\"spanish\"],\"dedo\":[\"spanish\"],\"defensa\":[\"spanish\"],\"definir\":[\"spanish\"],\"dejar\":[\"spanish\"],\"delfín\":[\"spanish\"],\"delgado\":[\"spanish\"],\"delito\":[\"spanish\"],\"demora\":[\"spanish\"],\"denso\":[\"spanish\"],\"dental\":[\"spanish\"],\"deporte\":[\"spanish\"],\"derecho\":[\"spanish\"],\"derrota\":[\"spanish\"],\"desayuno\":[\"spanish\"],\"deseo\":[\"spanish\"],\"desfile\":[\"spanish\"],\"desnudo\":[\"spanish\"],\"destino\":[\"spanish\"],\"desvío\":[\"spanish\"],\"detalle\":[\"spanish\"],\"detener\":[\"spanish\"],\"deuda\":[\"spanish\"],\"día\":[\"spanish\"],\"diablo\":[\"spanish\"],\"diadema\":[\"spanish\"],\"diamante\":[\"spanish\"],\"diana\":[\"spanish\"],\"diario\":[\"spanish\"],\"dibujo\":[\"spanish\"],\"dictar\":[\"spanish\"],\"diente\":[\"spanish\"],\"dieta\":[\"spanish\"],\"diez\":[\"spanish\"],\"difícil\":[\"spanish\"],\"digno\":[\"spanish\"],\"dilema\":[\"spanish\"],\"diluir\":[\"spanish\"],\"dinero\":[\"spanish\"],\"directo\":[\"spanish\"],\"dirigir\":[\"spanish\"],\"disco\":[\"spanish\"],\"diseño\":[\"spanish\"],\"disfraz\":[\"spanish\"],\"diva\":[\"spanish\"],\"divino\":[\"spanish\"],\"doble\":[\"spanish\"],\"doce\":[\"spanish\"],\"dolor\":[\"spanish\"],\"domingo\":[\"spanish\"],\"don\":[\"spanish\"],\"donar\":[\"spanish\"],\"dorado\":[\"spanish\"],\"dormir\":[\"spanish\"],\"dorso\":[\"spanish\"],\"dos\":[\"spanish\"],\"dosis\":[\"spanish\"],\"dragón\":[\"spanish\"],\"droga\":[\"spanish\"],\"ducha\":[\"spanish\"],\"duda\":[\"spanish\"],\"duelo\":[\"spanish\"],\"dueño\":[\"spanish\"],\"dulce\":[\"spanish\"],\"dúo\":[\"spanish\"],\"duque\":[\"spanish\"],\"durar\":[\"spanish\"],\"dureza\":[\"spanish\"],\"duro\":[\"spanish\"],\"ébano\":[\"spanish\"],\"ebrio\":[\"spanish\"],\"echar\":[\"spanish\"],\"eco\":[\"spanish\"],\"ecuador\":[\"spanish\"],\"edad\":[\"spanish\"],\"edición\":[\"spanish\"],\"edificio\":[\"spanish\"],\"editor\":[\"spanish\"],\"educar\":[\"spanish\"],\"efecto\":[\"spanish\"],\"eficaz\":[\"spanish\"],\"eje\":[\"spanish\"],\"ejemplo\":[\"spanish\"],\"elefante\":[\"spanish\"],\"elegir\":[\"spanish\"],\"elemento\":[\"spanish\"],\"elevar\":[\"spanish\"],\"elipse\":[\"spanish\"],\"élite\":[\"spanish\"],\"elixir\":[\"spanish\"],\"elogio\":[\"spanish\"],\"eludir\":[\"spanish\"],\"embudo\":[\"spanish\"],\"emitir\":[\"spanish\"],\"emoción\":[\"spanish\"],\"empate\":[\"spanish\"],\"empeño\":[\"spanish\"],\"empleo\":[\"spanish\"],\"empresa\":[\"spanish\"],\"enano\":[\"spanish\"],\"encargo\":[\"spanish\"],\"enchufe\":[\"spanish\"],\"encía\":[\"spanish\"],\"enemigo\":[\"spanish\"],\"enero\":[\"spanish\"],\"enfado\":[\"spanish\"],\"enfermo\":[\"spanish\"],\"engaño\":[\"spanish\"],\"enigma\":[\"spanish\"],\"enlace\":[\"spanish\"],\"enorme\":[\"spanish\"],\"enredo\":[\"spanish\"],\"ensayo\":[\"spanish\"],\"enseñar\":[\"spanish\"],\"entero\":[\"spanish\"],\"entrar\":[\"spanish\"],\"envase\":[\"spanish\"],\"envío\":[\"spanish\"],\"época\":[\"spanish\"],\"equipo\":[\"spanish\"],\"erizo\":[\"spanish\"],\"escala\":[\"spanish\"],\"escena\":[\"spanish\"],\"escolar\":[\"spanish\"],\"escribir\":[\"spanish\"],\"escudo\":[\"spanish\"],\"esencia\":[\"spanish\"],\"esfera\":[\"spanish\"],\"esfuerzo\":[\"spanish\"],\"espada\":[\"spanish\"],\"espejo\":[\"spanish\"],\"espía\":[\"spanish\"],\"esposa\":[\"spanish\"],\"espuma\":[\"spanish\"],\"esquí\":[\"spanish\"],\"estar\":[\"spanish\"],\"este\":[\"spanish\"],\"estilo\":[\"spanish\"],\"estufa\":[\"spanish\"],\"etapa\":[\"spanish\"],\"eterno\":[\"spanish\"],\"ética\":[\"spanish\"],\"etnia\":[\"spanish\"],\"evadir\":[\"spanish\"],\"evaluar\":[\"spanish\"],\"evento\":[\"spanish\"],\"evitar\":[\"spanish\"],\"exacto\":[\"spanish\"],\"examen\":[\"spanish\"],\"exceso\":[\"spanish\"],\"excusa\":[\"spanish\"],\"exento\":[\"spanish\"],\"exigir\":[\"spanish\"],\"exilio\":[\"spanish\"],\"existir\":[\"spanish\"],\"éxito\":[\"spanish\"],\"experto\":[\"spanish\"],\"explicar\":[\"spanish\"],\"exponer\":[\"spanish\"],\"extremo\":[\"spanish\"],\"fábrica\":[\"spanish\"],\"fábula\":[\"spanish\"],\"fachada\":[\"spanish\"],\"fácil\":[\"spanish\"],\"factor\":[\"spanish\"],\"faena\":[\"spanish\"],\"faja\":[\"spanish\"],\"falda\":[\"spanish\"],\"fallo\":[\"spanish\"],\"falso\":[\"spanish\"],\"faltar\":[\"spanish\"],\"fama\":[\"spanish\"],\"familia\":[\"spanish\"],\"famoso\":[\"spanish\"],\"faraón\":[\"spanish\"],\"farmacia\":[\"spanish\"],\"farol\":[\"spanish\"],\"farsa\":[\"spanish\"],\"fase\":[\"spanish\"],\"fatiga\":[\"spanish\"],\"fauna\":[\"spanish\",\"turkish\"],\"favor\":[\"spanish\"],\"fax\":[\"spanish\"],\"febrero\":[\"spanish\"],\"fecha\":[\"spanish\"],\"feliz\":[\"spanish\"],\"feo\":[\"spanish\"],\"feria\":[\"spanish\"],\"feroz\":[\"spanish\"],\"fértil\":[\"spanish\"],\"fervor\":[\"spanish\"],\"festín\":[\"spanish\"],\"fiable\":[\"spanish\"],\"fianza\":[\"spanish\"],\"fiar\":[\"spanish\"],\"fibra\":[\"spanish\"],\"ficción\":[\"spanish\"],\"ficha\":[\"spanish\"],\"fideo\":[\"spanish\"],\"fiebre\":[\"spanish\"],\"fiel\":[\"spanish\"],\"fiera\":[\"spanish\"],\"fiesta\":[\"spanish\"],\"figura\":[\"spanish\"],\"fijar\":[\"spanish\"],\"fijo\":[\"spanish\"],\"fila\":[\"spanish\"],\"filete\":[\"spanish\"],\"filial\":[\"spanish\"],\"filtro\":[\"spanish\"],\"fin\":[\"spanish\"],\"finca\":[\"spanish\"],\"fingir\":[\"spanish\"],\"finito\":[\"spanish\"],\"firma\":[\"spanish\"],\"flaco\":[\"spanish\"],\"flauta\":[\"spanish\"],\"flecha\":[\"spanish\"],\"flor\":[\"spanish\"],\"flota\":[\"spanish\"],\"fluir\":[\"spanish\"],\"flujo\":[\"spanish\"],\"flúor\":[\"spanish\"],\"fobia\":[\"spanish\"],\"foca\":[\"spanish\"],\"fogata\":[\"spanish\"],\"fogón\":[\"spanish\"],\"folio\":[\"spanish\"],\"folleto\":[\"spanish\"],\"fondo\":[\"spanish\"],\"forma\":[\"spanish\"],\"forro\":[\"spanish\"],\"fortuna\":[\"spanish\"],\"forzar\":[\"spanish\"],\"fosa\":[\"spanish\"],\"foto\":[\"spanish\"],\"fracaso\":[\"spanish\"],\"frágil\":[\"spanish\"],\"franja\":[\"spanish\"],\"frase\":[\"spanish\"],\"fraude\":[\"spanish\"],\"freír\":[\"spanish\"],\"freno\":[\"spanish\"],\"fresa\":[\"spanish\"],\"frío\":[\"spanish\"],\"frito\":[\"spanish\"],\"fruta\":[\"spanish\"],\"fuego\":[\"spanish\"],\"fuente\":[\"spanish\"],\"fuerza\":[\"spanish\"],\"fuga\":[\"spanish\"],\"fumar\":[\"spanish\"],\"función\":[\"spanish\"],\"funda\":[\"spanish\"],\"furgón\":[\"spanish\"],\"furia\":[\"spanish\"],\"fusil\":[\"spanish\"],\"fútbol\":[\"spanish\"],\"futuro\":[\"spanish\"],\"gacela\":[\"spanish\"],\"gafas\":[\"spanish\"],\"gaita\":[\"spanish\"],\"gajo\":[\"spanish\"],\"gala\":[\"spanish\"],\"galería\":[\"spanish\"],\"gallo\":[\"spanish\"],\"gamba\":[\"spanish\"],\"ganar\":[\"spanish\"],\"gancho\":[\"spanish\"],\"ganga\":[\"spanish\"],\"ganso\":[\"spanish\"],\"garaje\":[\"spanish\"],\"garza\":[\"spanish\"],\"gasolina\":[\"spanish\"],\"gastar\":[\"spanish\"],\"gato\":[\"spanish\"],\"gavilán\":[\"spanish\"],\"gemelo\":[\"spanish\"],\"gemir\":[\"spanish\"],\"gen\":[\"spanish\"],\"género\":[\"spanish\"],\"genio\":[\"spanish\"],\"gente\":[\"spanish\"],\"geranio\":[\"spanish\"],\"gerente\":[\"spanish\"],\"germen\":[\"spanish\"],\"gesto\":[\"spanish\"],\"gigante\":[\"spanish\"],\"gimnasio\":[\"spanish\"],\"girar\":[\"spanish\"],\"giro\":[\"spanish\"],\"glaciar\":[\"spanish\"],\"globo\":[\"spanish\"],\"gloria\":[\"spanish\"],\"gol\":[\"spanish\"],\"golfo\":[\"spanish\"],\"goloso\":[\"spanish\"],\"golpe\":[\"spanish\"],\"goma\":[\"spanish\"],\"gordo\":[\"spanish\"],\"gorila\":[\"spanish\"],\"gorra\":[\"spanish\"],\"gota\":[\"spanish\"],\"goteo\":[\"spanish\"],\"gozar\":[\"spanish\"],\"grada\":[\"spanish\"],\"gráfico\":[\"spanish\"],\"grano\":[\"spanish\"],\"grasa\":[\"spanish\"],\"gratis\":[\"spanish\"],\"grave\":[\"spanish\"],\"grieta\":[\"spanish\"],\"grillo\":[\"spanish\"],\"gripe\":[\"spanish\"],\"gris\":[\"spanish\"],\"grito\":[\"spanish\"],\"grosor\":[\"spanish\"],\"grúa\":[\"spanish\"],\"grueso\":[\"spanish\"],\"grumo\":[\"spanish\"],\"grupo\":[\"spanish\"],\"guante\":[\"spanish\"],\"guapo\":[\"spanish\"],\"guardia\":[\"spanish\"],\"guerra\":[\"spanish\"],\"guía\":[\"spanish\"],\"guiño\":[\"spanish\"],\"guion\":[\"spanish\"],\"guiso\":[\"spanish\"],\"guitarra\":[\"spanish\"],\"gusano\":[\"spanish\"],\"gustar\":[\"spanish\"],\"haber\":[\"spanish\",\"turkish\"],\"hábil\":[\"spanish\"],\"hablar\":[\"spanish\"],\"hacer\":[\"spanish\"],\"hacha\":[\"spanish\"],\"hada\":[\"spanish\"],\"hallar\":[\"spanish\"],\"hamaca\":[\"spanish\"],\"harina\":[\"spanish\"],\"haz\":[\"spanish\"],\"hazaña\":[\"spanish\"],\"hebilla\":[\"spanish\"],\"hebra\":[\"spanish\"],\"hecho\":[\"spanish\"],\"helado\":[\"spanish\"],\"helio\":[\"spanish\"],\"hembra\":[\"spanish\"],\"herir\":[\"spanish\"],\"hermano\":[\"spanish\"],\"héroe\":[\"spanish\"],\"hervir\":[\"spanish\"],\"hielo\":[\"spanish\"],\"hierro\":[\"spanish\"],\"hígado\":[\"spanish\"],\"higiene\":[\"spanish\"],\"hijo\":[\"spanish\"],\"himno\":[\"spanish\"],\"historia\":[\"spanish\"],\"hocico\":[\"spanish\"],\"hogar\":[\"spanish\"],\"hoguera\":[\"spanish\"],\"hoja\":[\"spanish\"],\"hombre\":[\"spanish\"],\"hongo\":[\"spanish\"],\"honor\":[\"spanish\"],\"honra\":[\"spanish\"],\"hora\":[\"spanish\"],\"hormiga\":[\"spanish\"],\"horno\":[\"spanish\"],\"hostil\":[\"spanish\"],\"hoyo\":[\"spanish\"],\"hueco\":[\"spanish\"],\"huelga\":[\"spanish\"],\"huerta\":[\"spanish\"],\"hueso\":[\"spanish\"],\"huevo\":[\"spanish\"],\"huida\":[\"spanish\"],\"huir\":[\"spanish\"],\"humano\":[\"spanish\"],\"húmedo\":[\"spanish\"],\"humilde\":[\"spanish\"],\"humo\":[\"spanish\"],\"hundir\":[\"spanish\"],\"huracán\":[\"spanish\"],\"hurto\":[\"spanish\"],\"icono\":[\"spanish\"],\"ideal\":[\"spanish\"],\"idioma\":[\"spanish\"],\"ídolo\":[\"spanish\"],\"iglesia\":[\"spanish\"],\"iglú\":[\"spanish\"],\"igual\":[\"spanish\"],\"ilegal\":[\"spanish\"],\"ilusión\":[\"spanish\"],\"imagen\":[\"spanish\"],\"imán\":[\"spanish\"],\"imitar\":[\"spanish\"],\"impar\":[\"spanish\"],\"imperio\":[\"spanish\"],\"imponer\":[\"spanish\"],\"impulso\":[\"spanish\"],\"incapaz\":[\"spanish\"],\"índice\":[\"spanish\"],\"inerte\":[\"spanish\"],\"infiel\":[\"spanish\"],\"informe\":[\"spanish\"],\"ingenio\":[\"spanish\"],\"inicio\":[\"spanish\"],\"inmenso\":[\"spanish\"],\"inmune\":[\"spanish\"],\"innato\":[\"spanish\"],\"insecto\":[\"spanish\"],\"instante\":[\"spanish\"],\"interés\":[\"spanish\"],\"íntimo\":[\"spanish\"],\"intuir\":[\"spanish\"],\"inútil\":[\"spanish\"],\"invierno\":[\"spanish\"],\"ira\":[\"spanish\"],\"iris\":[\"spanish\"],\"ironía\":[\"spanish\"],\"isla\":[\"spanish\"],\"islote\":[\"spanish\"],\"jabalí\":[\"spanish\"],\"jabón\":[\"spanish\"],\"jamón\":[\"spanish\"],\"jarabe\":[\"spanish\"],\"jardín\":[\"spanish\"],\"jarra\":[\"spanish\"],\"jaula\":[\"spanish\"],\"jazmín\":[\"spanish\"],\"jefe\":[\"spanish\"],\"jeringa\":[\"spanish\"],\"jinete\":[\"spanish\"],\"jornada\":[\"spanish\"],\"joroba\":[\"spanish\"],\"joven\":[\"spanish\"],\"joya\":[\"spanish\"],\"juerga\":[\"spanish\"],\"jueves\":[\"spanish\"],\"juez\":[\"spanish\"],\"jugador\":[\"spanish\"],\"jugo\":[\"spanish\"],\"juguete\":[\"spanish\"],\"juicio\":[\"spanish\"],\"junco\":[\"spanish\"],\"jungla\":[\"spanish\"],\"junio\":[\"spanish\"],\"juntar\":[\"spanish\"],\"júpiter\":[\"spanish\"],\"jurar\":[\"spanish\"],\"justo\":[\"spanish\"],\"juvenil\":[\"spanish\"],\"juzgar\":[\"spanish\"],\"kilo\":[\"spanish\"],\"koala\":[\"spanish\"],\"labio\":[\"spanish\"],\"lacio\":[\"spanish\"],\"lacra\":[\"spanish\"],\"lado\":[\"spanish\"],\"ladrón\":[\"spanish\"],\"lagarto\":[\"spanish\"],\"lágrima\":[\"spanish\"],\"laguna\":[\"spanish\"],\"laico\":[\"spanish\"],\"lamer\":[\"spanish\"],\"lámina\":[\"spanish\"],\"lámpara\":[\"spanish\"],\"lana\":[\"spanish\"],\"lancha\":[\"spanish\"],\"langosta\":[\"spanish\"],\"lanza\":[\"spanish\"],\"lápiz\":[\"spanish\"],\"largo\":[\"spanish\"],\"larva\":[\"spanish\"],\"lástima\":[\"spanish\"],\"lata\":[\"spanish\"],\"látex\":[\"spanish\"],\"latir\":[\"spanish\"],\"laurel\":[\"spanish\"],\"lavar\":[\"spanish\"],\"lazo\":[\"spanish\"],\"leal\":[\"spanish\"],\"lección\":[\"spanish\"],\"leche\":[\"spanish\"],\"lector\":[\"spanish\"],\"leer\":[\"spanish\"],\"legión\":[\"spanish\"],\"legumbre\":[\"spanish\"],\"lejano\":[\"spanish\"],\"lengua\":[\"spanish\"],\"lento\":[\"spanish\"],\"leña\":[\"spanish\"],\"león\":[\"spanish\"],\"leopardo\":[\"spanish\"],\"lesión\":[\"spanish\"],\"letal\":[\"spanish\"],\"letra\":[\"spanish\"],\"leve\":[\"spanish\"],\"leyenda\":[\"spanish\"],\"libertad\":[\"spanish\"],\"libro\":[\"spanish\"],\"licor\":[\"spanish\"],\"líder\":[\"spanish\"],\"lidiar\":[\"spanish\"],\"lienzo\":[\"spanish\"],\"liga\":[\"spanish\"],\"ligero\":[\"spanish\"],\"lima\":[\"spanish\"],\"límite\":[\"spanish\"],\"limón\":[\"spanish\"],\"limpio\":[\"spanish\"],\"lince\":[\"spanish\"],\"lindo\":[\"spanish\"],\"línea\":[\"spanish\"],\"lingote\":[\"spanish\"],\"lino\":[\"spanish\"],\"linterna\":[\"spanish\"],\"líquido\":[\"spanish\"],\"liso\":[\"spanish\"],\"lista\":[\"spanish\"],\"litera\":[\"spanish\"],\"litio\":[\"spanish\"],\"litro\":[\"spanish\"],\"llaga\":[\"spanish\"],\"llama\":[\"spanish\"],\"llanto\":[\"spanish\"],\"llave\":[\"spanish\"],\"llegar\":[\"spanish\"],\"llenar\":[\"spanish\"],\"llevar\":[\"spanish\"],\"llorar\":[\"spanish\"],\"llover\":[\"spanish\"],\"lluvia\":[\"spanish\"],\"lobo\":[\"spanish\"],\"loción\":[\"spanish\"],\"loco\":[\"spanish\"],\"locura\":[\"spanish\"],\"lógica\":[\"spanish\"],\"logro\":[\"spanish\"],\"lombriz\":[\"spanish\"],\"lomo\":[\"spanish\"],\"lonja\":[\"spanish\"],\"lote\":[\"spanish\"],\"lucha\":[\"spanish\"],\"lucir\":[\"spanish\"],\"lugar\":[\"spanish\"],\"lujo\":[\"spanish\"],\"luna\":[\"spanish\"],\"lunes\":[\"spanish\"],\"lupa\":[\"spanish\"],\"lustro\":[\"spanish\"],\"luto\":[\"spanish\"],\"luz\":[\"spanish\"],\"maceta\":[\"spanish\"],\"macho\":[\"spanish\"],\"madera\":[\"spanish\"],\"madre\":[\"spanish\"],\"maduro\":[\"spanish\"],\"maestro\":[\"spanish\"],\"mafia\":[\"spanish\"],\"magia\":[\"spanish\"],\"mago\":[\"spanish\"],\"maíz\":[\"spanish\"],\"maldad\":[\"spanish\"],\"maleta\":[\"spanish\"],\"malla\":[\"spanish\"],\"malo\":[\"spanish\"],\"mamá\":[\"spanish\"],\"mambo\":[\"spanish\"],\"mamut\":[\"spanish\"],\"manco\":[\"spanish\"],\"mando\":[\"spanish\"],\"manejar\":[\"spanish\"],\"manga\":[\"spanish\"],\"maniquí\":[\"spanish\"],\"manjar\":[\"spanish\"],\"mano\":[\"spanish\"],\"manso\":[\"spanish\"],\"manta\":[\"spanish\"],\"mañana\":[\"spanish\"],\"mapa\":[\"spanish\"],\"máquina\":[\"spanish\"],\"mar\":[\"spanish\"],\"marco\":[\"spanish\"],\"marea\":[\"spanish\"],\"marfil\":[\"spanish\"],\"margen\":[\"spanish\"],\"marido\":[\"spanish\"],\"mármol\":[\"spanish\"],\"marrón\":[\"spanish\"],\"martes\":[\"spanish\"],\"marzo\":[\"spanish\"],\"masa\":[\"spanish\"],\"máscara\":[\"spanish\"],\"masivo\":[\"spanish\"],\"matar\":[\"spanish\"],\"materia\":[\"spanish\"],\"matiz\":[\"spanish\"],\"matriz\":[\"spanish\"],\"máximo\":[\"spanish\"],\"mayor\":[\"spanish\"],\"mazorca\":[\"spanish\"],\"mecha\":[\"spanish\"],\"medalla\":[\"spanish\"],\"medio\":[\"spanish\"],\"médula\":[\"spanish\"],\"mejilla\":[\"spanish\"],\"mejor\":[\"spanish\"],\"melena\":[\"spanish\"],\"melón\":[\"spanish\"],\"memoria\":[\"spanish\"],\"menor\":[\"spanish\"],\"mensaje\":[\"spanish\"],\"mente\":[\"spanish\"],\"menú\":[\"spanish\"],\"mercado\":[\"spanish\"],\"merengue\":[\"spanish\"],\"mérito\":[\"spanish\"],\"mes\":[\"spanish\"],\"mesón\":[\"spanish\"],\"meta\":[\"spanish\"],\"meter\":[\"spanish\"],\"método\":[\"spanish\"],\"metro\":[\"spanish\"],\"mezcla\":[\"spanish\"],\"miedo\":[\"spanish\"],\"miel\":[\"spanish\"],\"miembro\":[\"spanish\"],\"miga\":[\"spanish\"],\"mil\":[\"spanish\"],\"milagro\":[\"spanish\"],\"militar\":[\"spanish\"],\"millón\":[\"spanish\"],\"mimo\":[\"spanish\"],\"mina\":[\"spanish\"],\"minero\":[\"spanish\"],\"mínimo\":[\"spanish\"],\"minuto\":[\"spanish\"],\"miope\":[\"spanish\"],\"mirar\":[\"spanish\"],\"misa\":[\"spanish\"],\"miseria\":[\"spanish\"],\"misil\":[\"spanish\"],\"mismo\":[\"spanish\"],\"mitad\":[\"spanish\"],\"mito\":[\"spanish\"],\"mochila\":[\"spanish\"],\"moción\":[\"spanish\"],\"moda\":[\"spanish\"],\"modelo\":[\"spanish\"],\"moho\":[\"spanish\"],\"mojar\":[\"spanish\"],\"molde\":[\"spanish\"],\"moler\":[\"spanish\"],\"molino\":[\"spanish\"],\"momento\":[\"spanish\"],\"momia\":[\"spanish\"],\"monarca\":[\"spanish\"],\"moneda\":[\"spanish\"],\"monja\":[\"spanish\"],\"monto\":[\"spanish\"],\"moño\":[\"spanish\"],\"morada\":[\"spanish\"],\"morder\":[\"spanish\"],\"moreno\":[\"spanish\"],\"morir\":[\"spanish\"],\"morro\":[\"spanish\"],\"morsa\":[\"spanish\"],\"mortal\":[\"spanish\"],\"mosca\":[\"spanish\"],\"mostrar\":[\"spanish\"],\"motivo\":[\"spanish\"],\"mover\":[\"spanish\"],\"móvil\":[\"spanish\"],\"mozo\":[\"spanish\"],\"mucho\":[\"spanish\"],\"mudar\":[\"spanish\"],\"mueble\":[\"spanish\"],\"muela\":[\"spanish\"],\"muerte\":[\"spanish\"],\"muestra\":[\"spanish\"],\"mugre\":[\"spanish\"],\"mujer\":[\"spanish\"],\"mula\":[\"spanish\"],\"muleta\":[\"spanish\"],\"multa\":[\"spanish\"],\"mundo\":[\"spanish\"],\"muñeca\":[\"spanish\"],\"mural\":[\"spanish\"],\"muro\":[\"spanish\"],\"músculo\":[\"spanish\"],\"museo\":[\"spanish\"],\"musgo\":[\"spanish\"],\"música\":[\"spanish\"],\"muslo\":[\"spanish\"],\"nácar\":[\"spanish\"],\"nación\":[\"spanish\"],\"nadar\":[\"spanish\"],\"naipe\":[\"spanish\"],\"naranja\":[\"spanish\"],\"nariz\":[\"spanish\"],\"narrar\":[\"spanish\"],\"nasal\":[\"spanish\"],\"natal\":[\"spanish\"],\"nativo\":[\"spanish\"],\"natural\":[\"spanish\"],\"náusea\":[\"spanish\"],\"naval\":[\"spanish\"],\"nave\":[\"spanish\"],\"navidad\":[\"spanish\"],\"necio\":[\"spanish\"],\"néctar\":[\"spanish\"],\"negar\":[\"spanish\"],\"negocio\":[\"spanish\"],\"negro\":[\"spanish\"],\"neón\":[\"spanish\"],\"nervio\":[\"spanish\"],\"neto\":[\"spanish\"],\"neutro\":[\"spanish\"],\"nevar\":[\"spanish\"],\"nevera\":[\"spanish\"],\"nicho\":[\"spanish\"],\"nido\":[\"spanish\"],\"niebla\":[\"spanish\"],\"nieto\":[\"spanish\"],\"niñez\":[\"spanish\"],\"niño\":[\"spanish\"],\"nítido\":[\"spanish\"],\"nivel\":[\"spanish\"],\"nobleza\":[\"spanish\"],\"noche\":[\"spanish\"],\"nómina\":[\"spanish\"],\"noria\":[\"spanish\"],\"norma\":[\"spanish\"],\"norte\":[\"spanish\"],\"nota\":[\"spanish\"],\"noticia\":[\"spanish\"],\"novato\":[\"spanish\"],\"novela\":[\"spanish\"],\"novio\":[\"spanish\"],\"nube\":[\"spanish\"],\"nuca\":[\"spanish\"],\"núcleo\":[\"spanish\"],\"nudillo\":[\"spanish\"],\"nudo\":[\"spanish\"],\"nuera\":[\"spanish\"],\"nueve\":[\"spanish\"],\"nuez\":[\"spanish\"],\"nulo\":[\"spanish\"],\"número\":[\"spanish\"],\"nutria\":[\"spanish\"],\"oasis\":[\"spanish\"],\"obeso\":[\"spanish\"],\"obispo\":[\"spanish\"],\"objeto\":[\"spanish\"],\"obra\":[\"spanish\"],\"obrero\":[\"spanish\"],\"observar\":[\"spanish\"],\"obtener\":[\"spanish\"],\"obvio\":[\"spanish\"],\"oca\":[\"spanish\"],\"ocaso\":[\"spanish\"],\"océano\":[\"spanish\"],\"ochenta\":[\"spanish\"],\"ocho\":[\"spanish\"],\"ocio\":[\"spanish\"],\"ocre\":[\"spanish\"],\"octavo\":[\"spanish\"],\"octubre\":[\"spanish\"],\"oculto\":[\"spanish\"],\"ocupar\":[\"spanish\"],\"ocurrir\":[\"spanish\"],\"odiar\":[\"spanish\"],\"odio\":[\"spanish\"],\"odisea\":[\"spanish\"],\"oeste\":[\"spanish\"],\"ofensa\":[\"spanish\"],\"oferta\":[\"spanish\"],\"oficio\":[\"spanish\"],\"ofrecer\":[\"spanish\"],\"ogro\":[\"spanish\"],\"oído\":[\"spanish\"],\"oír\":[\"spanish\"],\"ojo\":[\"spanish\"],\"ola\":[\"spanish\"],\"oleada\":[\"spanish\"],\"olfato\":[\"spanish\"],\"olivo\":[\"spanish\"],\"olla\":[\"spanish\"],\"olmo\":[\"spanish\"],\"olor\":[\"spanish\"],\"olvido\":[\"spanish\"],\"ombligo\":[\"spanish\"],\"onda\":[\"spanish\"],\"onza\":[\"spanish\"],\"opaco\":[\"spanish\"],\"opción\":[\"spanish\"],\"ópera\":[\"spanish\"],\"opinar\":[\"spanish\"],\"oponer\":[\"spanish\"],\"optar\":[\"spanish\"],\"óptica\":[\"spanish\"],\"opuesto\":[\"spanish\"],\"oración\":[\"spanish\"],\"orador\":[\"spanish\"],\"oral\":[\"spanish\",\"turkish\"],\"órbita\":[\"spanish\"],\"orca\":[\"spanish\"],\"orden\":[\"spanish\"],\"oreja\":[\"spanish\"],\"órgano\":[\"spanish\"],\"orgía\":[\"spanish\"],\"orgullo\":[\"spanish\"],\"oriente\":[\"spanish\"],\"origen\":[\"spanish\"],\"orilla\":[\"spanish\"],\"oro\":[\"spanish\"],\"orquesta\":[\"spanish\"],\"oruga\":[\"spanish\"],\"osadía\":[\"spanish\"],\"oscuro\":[\"spanish\"],\"osezno\":[\"spanish\"],\"oso\":[\"spanish\"],\"ostra\":[\"spanish\"],\"otoño\":[\"spanish\"],\"otro\":[\"spanish\"],\"oveja\":[\"spanish\"],\"óvulo\":[\"spanish\"],\"óxido\":[\"spanish\"],\"oxígeno\":[\"spanish\"],\"oyente\":[\"spanish\"],\"ozono\":[\"spanish\"],\"pacto\":[\"spanish\"],\"padre\":[\"spanish\"],\"paella\":[\"spanish\"],\"página\":[\"spanish\"],\"pago\":[\"spanish\"],\"país\":[\"spanish\"],\"pájaro\":[\"spanish\"],\"palabra\":[\"spanish\"],\"palco\":[\"spanish\"],\"paleta\":[\"spanish\"],\"pálido\":[\"spanish\"],\"palma\":[\"spanish\"],\"paloma\":[\"spanish\"],\"palpar\":[\"spanish\"],\"pan\":[\"spanish\"],\"panal\":[\"spanish\"],\"pánico\":[\"spanish\"],\"pantera\":[\"spanish\"],\"pañuelo\":[\"spanish\"],\"papá\":[\"spanish\"],\"papel\":[\"spanish\"],\"papilla\":[\"spanish\"],\"paquete\":[\"spanish\"],\"parar\":[\"spanish\"],\"parcela\":[\"spanish\"],\"pared\":[\"spanish\"],\"parir\":[\"spanish\"],\"paro\":[\"spanish\"],\"párpado\":[\"spanish\"],\"parque\":[\"spanish\"],\"párrafo\":[\"spanish\"],\"parte\":[\"spanish\"],\"pasar\":[\"spanish\"],\"paseo\":[\"spanish\"],\"pasión\":[\"spanish\"],\"paso\":[\"spanish\"],\"pasta\":[\"spanish\"],\"pata\":[\"spanish\"],\"patio\":[\"spanish\"],\"patria\":[\"spanish\"],\"pausa\":[\"spanish\"],\"pauta\":[\"spanish\"],\"pavo\":[\"spanish\"],\"payaso\":[\"spanish\"],\"peatón\":[\"spanish\"],\"pecado\":[\"spanish\"],\"pecera\":[\"spanish\"],\"pecho\":[\"spanish\"],\"pedal\":[\"spanish\",\"turkish\"],\"pedir\":[\"spanish\"],\"pegar\":[\"spanish\"],\"peine\":[\"spanish\"],\"pelar\":[\"spanish\"],\"peldaño\":[\"spanish\"],\"pelea\":[\"spanish\"],\"peligro\":[\"spanish\"],\"pellejo\":[\"spanish\"],\"pelo\":[\"spanish\"],\"peluca\":[\"spanish\"],\"pena\":[\"spanish\",\"turkish\"],\"pensar\":[\"spanish\"],\"peñón\":[\"spanish\"],\"peón\":[\"spanish\"],\"peor\":[\"spanish\"],\"pepino\":[\"spanish\"],\"pequeño\":[\"spanish\"],\"pera\":[\"spanish\"],\"percha\":[\"spanish\"],\"perder\":[\"spanish\"],\"pereza\":[\"spanish\"],\"perfil\":[\"spanish\"],\"perico\":[\"spanish\"],\"perla\":[\"spanish\"],\"permiso\":[\"spanish\"],\"perro\":[\"spanish\"],\"persona\":[\"spanish\"],\"pesa\":[\"spanish\"],\"pesca\":[\"spanish\"],\"pésimo\":[\"spanish\"],\"pestaña\":[\"spanish\"],\"pétalo\":[\"spanish\"],\"petróleo\":[\"spanish\"],\"pez\":[\"spanish\"],\"pezuña\":[\"spanish\"],\"picar\":[\"spanish\"],\"pichón\":[\"spanish\"],\"pie\":[\"spanish\"],\"piedra\":[\"spanish\"],\"pierna\":[\"spanish\"],\"pieza\":[\"spanish\"],\"pijama\":[\"spanish\"],\"pilar\":[\"spanish\"],\"piloto\":[\"spanish\"],\"pimienta\":[\"spanish\"],\"pino\":[\"spanish\"],\"pintor\":[\"spanish\"],\"pinza\":[\"spanish\"],\"piña\":[\"spanish\"],\"piojo\":[\"spanish\"],\"pipa\":[\"spanish\"],\"pirata\":[\"spanish\"],\"pisar\":[\"spanish\"],\"piscina\":[\"spanish\"],\"piso\":[\"spanish\"],\"pista\":[\"spanish\"],\"pitón\":[\"spanish\"],\"pizca\":[\"spanish\"],\"placa\":[\"spanish\"],\"plan\":[\"spanish\"],\"plata\":[\"spanish\"],\"playa\":[\"spanish\"],\"plaza\":[\"spanish\"],\"pleito\":[\"spanish\"],\"pleno\":[\"spanish\"],\"plomo\":[\"spanish\"],\"pluma\":[\"spanish\"],\"plural\":[\"spanish\"],\"pobre\":[\"spanish\"],\"poco\":[\"spanish\"],\"poder\":[\"spanish\"],\"podio\":[\"spanish\"],\"poema\":[\"spanish\"],\"poesía\":[\"spanish\"],\"poeta\":[\"spanish\"],\"polen\":[\"spanish\",\"turkish\"],\"policía\":[\"spanish\"],\"pollo\":[\"spanish\"],\"polvo\":[\"spanish\"],\"pomada\":[\"spanish\"],\"pomelo\":[\"spanish\"],\"pomo\":[\"spanish\"],\"pompa\":[\"spanish\",\"turkish\"],\"poner\":[\"spanish\"],\"porción\":[\"spanish\"],\"portal\":[\"spanish\"],\"posada\":[\"spanish\"],\"poseer\":[\"spanish\"],\"posible\":[\"spanish\"],\"poste\":[\"spanish\"],\"potencia\":[\"spanish\"],\"potro\":[\"spanish\"],\"pozo\":[\"spanish\"],\"prado\":[\"spanish\"],\"precoz\":[\"spanish\"],\"pregunta\":[\"spanish\"],\"premio\":[\"spanish\"],\"prensa\":[\"spanish\"],\"preso\":[\"spanish\"],\"previo\":[\"spanish\"],\"primo\":[\"spanish\"],\"príncipe\":[\"spanish\"],\"prisión\":[\"spanish\"],\"privar\":[\"spanish\"],\"proa\":[\"spanish\"],\"probar\":[\"spanish\"],\"proceso\":[\"spanish\"],\"producto\":[\"spanish\"],\"proeza\":[\"spanish\"],\"profesor\":[\"spanish\"],\"programa\":[\"spanish\"],\"prole\":[\"spanish\"],\"promesa\":[\"spanish\"],\"pronto\":[\"spanish\"],\"propio\":[\"spanish\"],\"próximo\":[\"spanish\"],\"prueba\":[\"spanish\"],\"público\":[\"spanish\"],\"puchero\":[\"spanish\"],\"pudor\":[\"spanish\"],\"pueblo\":[\"spanish\"],\"puerta\":[\"spanish\"],\"puesto\":[\"spanish\"],\"pulga\":[\"spanish\"],\"pulir\":[\"spanish\"],\"pulmón\":[\"spanish\"],\"pulpo\":[\"spanish\"],\"pulso\":[\"spanish\"],\"puma\":[\"spanish\"],\"punto\":[\"spanish\"],\"puñal\":[\"spanish\"],\"puño\":[\"spanish\"],\"pupa\":[\"spanish\"],\"pupila\":[\"spanish\"],\"puré\":[\"spanish\"],\"quedar\":[\"spanish\"],\"queja\":[\"spanish\"],\"quemar\":[\"spanish\"],\"querer\":[\"spanish\"],\"queso\":[\"spanish\"],\"quieto\":[\"spanish\"],\"química\":[\"spanish\"],\"quince\":[\"spanish\"],\"quitar\":[\"spanish\"],\"rábano\":[\"spanish\"],\"rabia\":[\"spanish\"],\"rabo\":[\"spanish\"],\"ración\":[\"spanish\"],\"radical\":[\"spanish\"],\"raíz\":[\"spanish\"],\"rama\":[\"spanish\"],\"rampa\":[\"spanish\",\"turkish\"],\"rancho\":[\"spanish\"],\"rango\":[\"spanish\"],\"rapaz\":[\"spanish\"],\"rápido\":[\"spanish\"],\"rapto\":[\"spanish\"],\"rasgo\":[\"spanish\"],\"raspa\":[\"spanish\"],\"rato\":[\"spanish\"],\"rayo\":[\"spanish\"],\"raza\":[\"spanish\"],\"razón\":[\"spanish\"],\"reacción\":[\"spanish\"],\"realidad\":[\"spanish\"],\"rebaño\":[\"spanish\"],\"rebote\":[\"spanish\"],\"recaer\":[\"spanish\"],\"receta\":[\"spanish\"],\"rechazo\":[\"spanish\"],\"recoger\":[\"spanish\"],\"recreo\":[\"spanish\"],\"recto\":[\"spanish\"],\"recurso\":[\"spanish\"],\"red\":[\"spanish\"],\"redondo\":[\"spanish\"],\"reducir\":[\"spanish\"],\"reflejo\":[\"spanish\"],\"reforma\":[\"spanish\"],\"refrán\":[\"spanish\"],\"refugio\":[\"spanish\"],\"regalo\":[\"spanish\"],\"regir\":[\"spanish\"],\"regla\":[\"spanish\"],\"regreso\":[\"spanish\"],\"rehén\":[\"spanish\"],\"reino\":[\"spanish\"],\"reír\":[\"spanish\"],\"reja\":[\"spanish\"],\"relato\":[\"spanish\"],\"relevo\":[\"spanish\"],\"relieve\":[\"spanish\"],\"relleno\":[\"spanish\"],\"reloj\":[\"spanish\"],\"remar\":[\"spanish\"],\"remedio\":[\"spanish\"],\"remo\":[\"spanish\"],\"rencor\":[\"spanish\"],\"rendir\":[\"spanish\"],\"renta\":[\"spanish\"],\"reparto\":[\"spanish\"],\"repetir\":[\"spanish\"],\"reposo\":[\"spanish\"],\"reptil\":[\"spanish\"],\"res\":[\"spanish\"],\"rescate\":[\"spanish\"],\"resina\":[\"spanish\"],\"respeto\":[\"spanish\"],\"resto\":[\"spanish\"],\"resumen\":[\"spanish\"],\"retiro\":[\"spanish\"],\"retorno\":[\"spanish\"],\"retrato\":[\"spanish\"],\"reunir\":[\"spanish\"],\"revés\":[\"spanish\"],\"revista\":[\"spanish\"],\"rey\":[\"spanish\"],\"rezar\":[\"spanish\"],\"rico\":[\"spanish\"],\"riego\":[\"spanish\"],\"rienda\":[\"spanish\"],\"riesgo\":[\"spanish\"],\"rifa\":[\"spanish\"],\"rígido\":[\"spanish\"],\"rigor\":[\"spanish\"],\"rincón\":[\"spanish\"],\"riñón\":[\"spanish\"],\"río\":[\"spanish\"],\"riqueza\":[\"spanish\"],\"risa\":[\"spanish\"],\"ritmo\":[\"spanish\"],\"rito\":[\"spanish\"],\"rizo\":[\"spanish\"],\"roble\":[\"spanish\"],\"roce\":[\"spanish\"],\"rociar\":[\"spanish\"],\"rodar\":[\"spanish\"],\"rodeo\":[\"spanish\"],\"rodilla\":[\"spanish\"],\"roer\":[\"spanish\"],\"rojizo\":[\"spanish\"],\"rojo\":[\"spanish\"],\"romero\":[\"spanish\"],\"romper\":[\"spanish\"],\"ron\":[\"spanish\"],\"ronco\":[\"spanish\"],\"ronda\":[\"spanish\"],\"ropa\":[\"spanish\"],\"ropero\":[\"spanish\"],\"rosa\":[\"spanish\"],\"rosca\":[\"spanish\"],\"rostro\":[\"spanish\"],\"rotar\":[\"spanish\"],\"rubí\":[\"spanish\"],\"rubor\":[\"spanish\"],\"rudo\":[\"spanish\"],\"rueda\":[\"spanish\"],\"rugir\":[\"spanish\"],\"ruido\":[\"spanish\"],\"ruina\":[\"spanish\"],\"ruleta\":[\"spanish\"],\"rulo\":[\"spanish\",\"turkish\"],\"rumbo\":[\"spanish\"],\"rumor\":[\"spanish\"],\"ruptura\":[\"spanish\"],\"ruta\":[\"spanish\"],\"rutina\":[\"spanish\"],\"sábado\":[\"spanish\"],\"saber\":[\"spanish\"],\"sabio\":[\"spanish\"],\"sable\":[\"spanish\"],\"sacar\":[\"spanish\"],\"sagaz\":[\"spanish\"],\"sagrado\":[\"spanish\"],\"sala\":[\"spanish\"],\"saldo\":[\"spanish\"],\"salero\":[\"spanish\"],\"salir\":[\"spanish\"],\"salmón\":[\"spanish\"],\"salón\":[\"spanish\"],\"salsa\":[\"spanish\"],\"salto\":[\"spanish\"],\"salud\":[\"spanish\"],\"salvar\":[\"spanish\"],\"samba\":[\"spanish\"],\"sanción\":[\"spanish\"],\"sandía\":[\"spanish\"],\"sanear\":[\"spanish\"],\"sangre\":[\"spanish\"],\"sanidad\":[\"spanish\"],\"sano\":[\"spanish\"],\"santo\":[\"spanish\"],\"sapo\":[\"spanish\"],\"saque\":[\"spanish\"],\"sardina\":[\"spanish\"],\"sartén\":[\"spanish\"],\"sastre\":[\"spanish\"],\"satán\":[\"spanish\"],\"sauna\":[\"spanish\"],\"saxofón\":[\"spanish\"],\"sección\":[\"spanish\"],\"seco\":[\"spanish\"],\"secreto\":[\"spanish\"],\"secta\":[\"spanish\"],\"sed\":[\"spanish\"],\"seguir\":[\"spanish\"],\"seis\":[\"spanish\"],\"sello\":[\"spanish\"],\"selva\":[\"spanish\"],\"semana\":[\"spanish\"],\"semilla\":[\"spanish\"],\"senda\":[\"spanish\"],\"sensor\":[\"spanish\"],\"señal\":[\"spanish\"],\"señor\":[\"spanish\"],\"separar\":[\"spanish\"],\"sepia\":[\"spanish\"],\"sequía\":[\"spanish\"],\"ser\":[\"spanish\"],\"serie\":[\"spanish\"],\"sermón\":[\"spanish\"],\"servir\":[\"spanish\"],\"sesenta\":[\"spanish\"],\"sesión\":[\"spanish\"],\"seta\":[\"spanish\"],\"setenta\":[\"spanish\"],\"severo\":[\"spanish\"],\"sexo\":[\"spanish\"],\"sexto\":[\"spanish\"],\"sidra\":[\"spanish\"],\"siesta\":[\"spanish\"],\"siete\":[\"spanish\"],\"siglo\":[\"spanish\"],\"signo\":[\"spanish\"],\"sílaba\":[\"spanish\"],\"silbar\":[\"spanish\"],\"silencio\":[\"spanish\"],\"silla\":[\"spanish\"],\"símbolo\":[\"spanish\"],\"simio\":[\"spanish\"],\"sirena\":[\"spanish\"],\"sistema\":[\"spanish\"],\"sitio\":[\"spanish\"],\"situar\":[\"spanish\"],\"sobre\":[\"spanish\"],\"socio\":[\"spanish\"],\"sodio\":[\"spanish\"],\"sol\":[\"spanish\"],\"solapa\":[\"spanish\"],\"soldado\":[\"spanish\"],\"soledad\":[\"spanish\"],\"sólido\":[\"spanish\"],\"soltar\":[\"spanish\"],\"solución\":[\"spanish\"],\"sombra\":[\"spanish\"],\"sondeo\":[\"spanish\"],\"sonido\":[\"spanish\"],\"sonoro\":[\"spanish\"],\"sonrisa\":[\"spanish\"],\"sopa\":[\"spanish\"],\"soplar\":[\"spanish\"],\"soporte\":[\"spanish\"],\"sordo\":[\"spanish\"],\"sorpresa\":[\"spanish\"],\"sorteo\":[\"spanish\"],\"sostén\":[\"spanish\"],\"sótano\":[\"spanish\"],\"suave\":[\"spanish\"],\"subir\":[\"spanish\"],\"suceso\":[\"spanish\"],\"sudor\":[\"spanish\"],\"suegra\":[\"spanish\"],\"suelo\":[\"spanish\"],\"sueño\":[\"spanish\"],\"suerte\":[\"spanish\"],\"sufrir\":[\"spanish\"],\"sujeto\":[\"spanish\"],\"sultán\":[\"spanish\"],\"sumar\":[\"spanish\"],\"superar\":[\"spanish\"],\"suplir\":[\"spanish\"],\"suponer\":[\"spanish\"],\"supremo\":[\"spanish\"],\"sur\":[\"spanish\"],\"surco\":[\"spanish\"],\"sureño\":[\"spanish\"],\"surgir\":[\"spanish\"],\"susto\":[\"spanish\"],\"sutil\":[\"spanish\"],\"tabaco\":[\"spanish\"],\"tabique\":[\"spanish\"],\"tabla\":[\"spanish\"],\"tabú\":[\"spanish\"],\"taco\":[\"spanish\"],\"tacto\":[\"spanish\"],\"tajo\":[\"spanish\"],\"talar\":[\"spanish\"],\"talco\":[\"spanish\"],\"talento\":[\"spanish\"],\"talla\":[\"spanish\"],\"talón\":[\"spanish\"],\"tamaño\":[\"spanish\"],\"tambor\":[\"spanish\"],\"tango\":[\"spanish\"],\"tanque\":[\"spanish\"],\"tapa\":[\"spanish\"],\"tapete\":[\"spanish\"],\"tapia\":[\"spanish\"],\"tapón\":[\"spanish\"],\"taquilla\":[\"spanish\"],\"tarde\":[\"spanish\"],\"tarea\":[\"spanish\"],\"tarifa\":[\"spanish\"],\"tarjeta\":[\"spanish\"],\"tarot\":[\"spanish\"],\"tarro\":[\"spanish\"],\"tarta\":[\"spanish\"],\"tatuaje\":[\"spanish\"],\"tauro\":[\"spanish\"],\"taza\":[\"spanish\"],\"tazón\":[\"spanish\"],\"teatro\":[\"spanish\"],\"techo\":[\"spanish\"],\"tecla\":[\"spanish\"],\"técnica\":[\"spanish\"],\"tejado\":[\"spanish\"],\"tejer\":[\"spanish\"],\"tejido\":[\"spanish\"],\"tela\":[\"spanish\"],\"teléfono\":[\"spanish\"],\"tema\":[\"spanish\"],\"temor\":[\"spanish\"],\"templo\":[\"spanish\"],\"tenaz\":[\"spanish\"],\"tender\":[\"spanish\"],\"tener\":[\"spanish\"],\"tenis\":[\"spanish\"],\"tenso\":[\"spanish\"],\"teoría\":[\"spanish\"],\"terapia\":[\"spanish\"],\"terco\":[\"spanish\"],\"término\":[\"spanish\"],\"ternura\":[\"spanish\"],\"terror\":[\"spanish\"],\"tesis\":[\"spanish\"],\"tesoro\":[\"spanish\"],\"testigo\":[\"spanish\"],\"tetera\":[\"spanish\"],\"texto\":[\"spanish\"],\"tez\":[\"spanish\"],\"tibio\":[\"spanish\"],\"tiburón\":[\"spanish\"],\"tiempo\":[\"spanish\"],\"tienda\":[\"spanish\"],\"tierra\":[\"spanish\"],\"tieso\":[\"spanish\"],\"tigre\":[\"spanish\"],\"tijera\":[\"spanish\"],\"tilde\":[\"spanish\"],\"timbre\":[\"spanish\"],\"tímido\":[\"spanish\"],\"timo\":[\"spanish\"],\"tinta\":[\"spanish\"],\"tío\":[\"spanish\"],\"típico\":[\"spanish\"],\"tipo\":[\"spanish\"],\"tira\":[\"spanish\"],\"tirón\":[\"spanish\"],\"titán\":[\"spanish\"],\"títere\":[\"spanish\"],\"título\":[\"spanish\"],\"tiza\":[\"spanish\"],\"toalla\":[\"spanish\"],\"tobillo\":[\"spanish\"],\"tocar\":[\"spanish\"],\"tocino\":[\"spanish\"],\"todo\":[\"spanish\"],\"toga\":[\"spanish\"],\"toldo\":[\"spanish\"],\"tomar\":[\"spanish\",\"turkish\"],\"tono\":[\"spanish\"],\"tonto\":[\"spanish\"],\"topar\":[\"spanish\"],\"tope\":[\"spanish\"],\"toque\":[\"spanish\"],\"tórax\":[\"spanish\"],\"torero\":[\"spanish\"],\"tormenta\":[\"spanish\"],\"torneo\":[\"spanish\"],\"toro\":[\"spanish\"],\"torpedo\":[\"spanish\"],\"torre\":[\"spanish\"],\"torso\":[\"spanish\"],\"tortuga\":[\"spanish\"],\"tos\":[\"spanish\"],\"tosco\":[\"spanish\"],\"toser\":[\"spanish\"],\"tóxico\":[\"spanish\"],\"trabajo\":[\"spanish\"],\"tractor\":[\"spanish\"],\"traer\":[\"spanish\"],\"tráfico\":[\"spanish\"],\"trago\":[\"spanish\"],\"traje\":[\"spanish\"],\"tramo\":[\"spanish\"],\"trance\":[\"spanish\"],\"trato\":[\"spanish\"],\"trauma\":[\"spanish\"],\"trazar\":[\"spanish\"],\"trébol\":[\"spanish\"],\"tregua\":[\"spanish\"],\"treinta\":[\"spanish\"],\"tren\":[\"spanish\"],\"trepar\":[\"spanish\"],\"tres\":[\"spanish\"],\"tribu\":[\"spanish\"],\"trigo\":[\"spanish\"],\"tripa\":[\"spanish\"],\"triste\":[\"spanish\"],\"triunfo\":[\"spanish\"],\"trofeo\":[\"spanish\"],\"trompa\":[\"spanish\"],\"tronco\":[\"spanish\"],\"tropa\":[\"spanish\"],\"trote\":[\"spanish\"],\"trozo\":[\"spanish\"],\"truco\":[\"spanish\"],\"trueno\":[\"spanish\"],\"trufa\":[\"spanish\"],\"tubería\":[\"spanish\"],\"tubo\":[\"spanish\"],\"tuerto\":[\"spanish\"],\"tumba\":[\"spanish\"],\"tumor\":[\"spanish\"],\"túnel\":[\"spanish\"],\"túnica\":[\"spanish\"],\"turbina\":[\"spanish\"],\"turismo\":[\"spanish\"],\"turno\":[\"spanish\"],\"tutor\":[\"spanish\"],\"ubicar\":[\"spanish\"],\"úlcera\":[\"spanish\"],\"umbral\":[\"spanish\"],\"unidad\":[\"spanish\"],\"unir\":[\"spanish\"],\"universo\":[\"spanish\"],\"uno\":[\"spanish\"],\"untar\":[\"spanish\"],\"uña\":[\"spanish\"],\"urbano\":[\"spanish\"],\"urbe\":[\"spanish\"],\"urgente\":[\"spanish\"],\"urna\":[\"spanish\"],\"usar\":[\"spanish\"],\"usuario\":[\"spanish\"],\"útil\":[\"spanish\"],\"utopía\":[\"spanish\"],\"uva\":[\"spanish\"],\"vaca\":[\"spanish\"],\"vacío\":[\"spanish\"],\"vacuna\":[\"spanish\"],\"vagar\":[\"spanish\"],\"vago\":[\"spanish\"],\"vaina\":[\"spanish\"],\"vajilla\":[\"spanish\"],\"vale\":[\"spanish\"],\"válido\":[\"spanish\"],\"valle\":[\"spanish\"],\"valor\":[\"spanish\"],\"válvula\":[\"spanish\"],\"vampiro\":[\"spanish\"],\"vara\":[\"spanish\"],\"variar\":[\"spanish\"],\"varón\":[\"spanish\"],\"vaso\":[\"spanish\"],\"vecino\":[\"spanish\"],\"vector\":[\"spanish\"],\"vehículo\":[\"spanish\"],\"veinte\":[\"spanish\"],\"vejez\":[\"spanish\"],\"vela\":[\"spanish\"],\"velero\":[\"spanish\"],\"veloz\":[\"spanish\"],\"vena\":[\"spanish\"],\"vencer\":[\"spanish\"],\"venda\":[\"spanish\"],\"veneno\":[\"spanish\"],\"vengar\":[\"spanish\"],\"venir\":[\"spanish\"],\"venta\":[\"spanish\"],\"venus\":[\"spanish\"],\"ver\":[\"spanish\"],\"verano\":[\"spanish\"],\"verbo\":[\"spanish\"],\"verde\":[\"spanish\"],\"vereda\":[\"spanish\"],\"verja\":[\"spanish\"],\"verso\":[\"spanish\"],\"verter\":[\"spanish\"],\"vía\":[\"spanish\"],\"viaje\":[\"spanish\"],\"vibrar\":[\"spanish\"],\"vicio\":[\"spanish\"],\"víctima\":[\"spanish\"],\"vida\":[\"spanish\"],\"vídeo\":[\"spanish\"],\"vidrio\":[\"spanish\"],\"viejo\":[\"spanish\"],\"viernes\":[\"spanish\"],\"vigor\":[\"spanish\"],\"vil\":[\"spanish\"],\"villa\":[\"spanish\"],\"vinagre\":[\"spanish\"],\"vino\":[\"spanish\"],\"viñedo\":[\"spanish\"],\"violín\":[\"spanish\"],\"viral\":[\"spanish\"],\"virgo\":[\"spanish\"],\"virtud\":[\"spanish\"],\"visor\":[\"spanish\"],\"víspera\":[\"spanish\"],\"vista\":[\"spanish\"],\"vitamina\":[\"spanish\"],\"viudo\":[\"spanish\"],\"vivaz\":[\"spanish\"],\"vivero\":[\"spanish\"],\"vivir\":[\"spanish\"],\"vivo\":[\"spanish\"],\"volcán\":[\"spanish\"],\"volumen\":[\"spanish\"],\"volver\":[\"spanish\"],\"voraz\":[\"spanish\"],\"votar\":[\"spanish\"],\"voto\":[\"spanish\"],\"voz\":[\"spanish\"],\"vuelo\":[\"spanish\"],\"vulgar\":[\"spanish\"],\"yacer\":[\"spanish\"],\"yate\":[\"spanish\"],\"yegua\":[\"spanish\"],\"yema\":[\"spanish\"],\"yerno\":[\"spanish\"],\"yeso\":[\"spanish\"],\"yodo\":[\"spanish\"],\"yoga\":[\"spanish\"],\"yogur\":[\"spanish\"],\"zafiro\":[\"spanish\"],\"zanja\":[\"spanish\"],\"zapato\":[\"spanish\"],\"zarza\":[\"spanish\"],\"zona\":[\"spanish\"],\"zorro\":[\"spanish\"],\"zumo\":[\"spanish\"],\"zurdo\":[\"spanish\"],\"abajur\":[\"turkish\"],\"abaküs\":[\"turkish\"],\"abartı\":[\"turkish\"],\"abdal\":[\"turkish\"],\"abdest\":[\"turkish\"],\"abiye\":[\"turkish\"],\"abluka\":[\"turkish\"],\"abone\":[\"turkish\"],\"absorbe\":[\"turkish\"],\"absürt\":[\"turkish\"],\"acayip\":[\"turkish\"],\"acele\":[\"turkish\"],\"acemi\":[\"turkish\"],\"açıkgöz\":[\"turkish\"],\"adalet\":[\"turkish\"],\"adam\":[\"turkish\"],\"adezyon\":[\"turkish\"],\"adisyon\":[\"turkish\"],\"adliye\":[\"turkish\"],\"adres\":[\"turkish\"],\"afacan\":[\"turkish\"],\"afili\":[\"turkish\"],\"afiş\":[\"turkish\"],\"afiyet\":[\"turkish\"],\"aforizm\":[\"turkish\"],\"afra\":[\"turkish\"],\"ağaç\":[\"turkish\"],\"ağır\":[\"turkish\"],\"ahbap\":[\"turkish\"],\"ahkam\":[\"turkish\"],\"ahlak\":[\"turkish\"],\"ahtapot\":[\"turkish\"],\"aidat\":[\"turkish\"],\"aile\":[\"turkish\"],\"ajan\":[\"turkish\"],\"akademi\":[\"turkish\"],\"akarsu\":[\"turkish\"],\"akbaş\":[\"turkish\"],\"akciğer\":[\"turkish\"],\"akdeniz\":[\"turkish\"],\"akıbet\":[\"turkish\"],\"akıl\":[\"turkish\"],\"akıntı\":[\"turkish\"],\"akide\":[\"turkish\"],\"akrep\":[\"turkish\"],\"akrobasi\":[\"turkish\"],\"aksiyon\":[\"turkish\"],\"akşam\":[\"turkish\"],\"aktif\":[\"turkish\"],\"aktör\":[\"turkish\"],\"aktris\":[\"turkish\"],\"akustik\":[\"turkish\"],\"alaca\":[\"turkish\"],\"albüm\":[\"turkish\"],\"alçak\":[\"turkish\"],\"aldanma\":[\"turkish\"],\"aleni\":[\"turkish\"],\"alet\":[\"turkish\"],\"alfabe\":[\"turkish\"],\"algılama\":[\"turkish\"],\"alıngan\":[\"turkish\"],\"alkış\":[\"turkish\"],\"alkol\":[\"turkish\"],\"alpay\":[\"turkish\"],\"alperen\":[\"turkish\"],\"altın\":[\"turkish\"],\"altüst\":[\"turkish\"],\"altyapı\":[\"turkish\"],\"alyuvar\":[\"turkish\"],\"amade\":[\"turkish\"],\"amatör\":[\"turkish\"],\"amazon\":[\"turkish\"],\"ambalaj\":[\"turkish\"],\"amblem\":[\"turkish\"],\"ambulans\":[\"turkish\"],\"amca\":[\"turkish\"],\"amel\":[\"turkish\"],\"amir\":[\"turkish\"],\"amiyane\":[\"turkish\"],\"amorti\":[\"turkish\"],\"ampul\":[\"turkish\"],\"anadolu\":[\"turkish\"],\"anahtar\":[\"turkish\"],\"anakonda\":[\"turkish\"],\"anaokul\":[\"turkish\"],\"anapara\":[\"turkish\"],\"anarşi\":[\"turkish\"],\"anatomi\":[\"turkish\"],\"anayasa\":[\"turkish\"],\"anekdot\":[\"turkish\"],\"anestezi\":[\"turkish\"],\"angaje\":[\"turkish\"],\"anka\":[\"turkish\"],\"anket\":[\"turkish\"],\"anlamlı\":[\"turkish\"],\"anne\":[\"turkish\"],\"anomali\":[\"turkish\"],\"anonim\":[\"turkish\"],\"anten\":[\"turkish\"],\"antlaşma\":[\"turkish\"],\"apse\":[\"turkish\"],\"araba\":[\"turkish\"],\"aracı\":[\"turkish\"],\"araf\":[\"turkish\"],\"arbede\":[\"turkish\"],\"arda\":[\"turkish\"],\"arefe\":[\"turkish\"],\"argo\":[\"turkish\"],\"argüman\":[\"turkish\"],\"arkadaş\":[\"turkish\"],\"armoni\":[\"turkish\"],\"arsa\":[\"turkish\"],\"arsız\":[\"turkish\"],\"artı\":[\"turkish\"],\"aruz\":[\"turkish\"],\"asansör\":[\"turkish\"],\"asayiş\":[\"turkish\"],\"asgari\":[\"turkish\"],\"asil\":[\"turkish\"],\"asker\":[\"turkish\"],\"askı\":[\"turkish\"],\"aslan\":[\"turkish\"],\"asosyal\":[\"turkish\"],\"astsubay\":[\"turkish\"],\"asya\":[\"turkish\"],\"aşçı\":[\"turkish\"],\"aşırı\":[\"turkish\"],\"aşure\":[\"turkish\"],\"atabey\":[\"turkish\"],\"ataman\":[\"turkish\"],\"ateş\":[\"turkish\"],\"atmaca\":[\"turkish\"],\"atmosfer\":[\"turkish\"],\"atölye\":[\"turkish\"],\"avcı\":[\"turkish\"],\"avdet\":[\"turkish\"],\"avize\":[\"turkish\"],\"avlu\":[\"turkish\"],\"avokado\":[\"turkish\"],\"avrupa\":[\"turkish\"],\"avukat\":[\"turkish\"],\"ayaz\":[\"turkish\"],\"ayçiçeği\":[\"turkish\"],\"aydın\":[\"turkish\"],\"aygıt\":[\"turkish\"],\"ayna\":[\"turkish\"],\"ayran\":[\"turkish\"],\"ayrıntı\":[\"turkish\"],\"azim\":[\"turkish\"],\"baca\":[\"turkish\"],\"bagaj\":[\"turkish\"],\"bağlantı\":[\"turkish\"],\"bahadır\":[\"turkish\"],\"bahçe\":[\"turkish\"],\"baki\":[\"turkish\"],\"bakkal\":[\"turkish\"],\"baklava\":[\"turkish\"],\"bakteri\":[\"turkish\"],\"balçık\":[\"turkish\"],\"balina\":[\"turkish\"],\"balo\":[\"turkish\"],\"balta\":[\"turkish\"],\"bant\":[\"turkish\"],\"banyo\":[\"turkish\"],\"bardak\":[\"turkish\"],\"barış\":[\"turkish\"],\"başbuğ\":[\"turkish\"],\"başıboş\":[\"turkish\"],\"başkan\":[\"turkish\"],\"başlık\":[\"turkish\"],\"bavul\":[\"turkish\"],\"bayındır\":[\"turkish\"],\"baykuş\":[\"turkish\"],\"bazlama\":[\"turkish\"],\"bedel\":[\"turkish\"],\"begüm\":[\"turkish\"],\"bekçi\":[\"turkish\"],\"bekle\":[\"turkish\"],\"belge\":[\"turkish\"],\"belki\":[\"turkish\"],\"bencil\":[\"turkish\"],\"benek\":[\"turkish\"],\"bengi\":[\"turkish\"],\"berjer\":[\"turkish\"],\"berk\":[\"turkish\"],\"berrak\":[\"turkish\"],\"beşik\":[\"turkish\"],\"beyin\":[\"turkish\"],\"beyoğlu\":[\"turkish\"],\"bıçak\":[\"turkish\"],\"biberiye\":[\"turkish\"],\"bidon\":[\"turkish\"],\"bihaber\":[\"turkish\"],\"bikini\":[\"turkish\"],\"bilezik\":[\"turkish\"],\"bilinç\":[\"turkish\"],\"bilye\":[\"turkish\"],\"bina\":[\"turkish\"],\"binbaşı\":[\"turkish\"],\"binyıl\":[\"turkish\"],\"bisiklet\":[\"turkish\"],\"bisküvi\":[\"turkish\"],\"bitki\":[\"turkish\"],\"bizzat\":[\"turkish\"],\"bodrum\":[\"turkish\"],\"boğaz\":[\"turkish\"],\"bohça\":[\"turkish\"],\"boncuk\":[\"turkish\"],\"bonfile\":[\"turkish\"],\"borsa\":[\"turkish\"],\"boru\":[\"turkish\"],\"bostan\":[\"turkish\"],\"boşboğaz\":[\"turkish\"],\"botanik\":[\"turkish\"],\"boya\":[\"turkish\"],\"boykot\":[\"turkish\"],\"boynuz\":[\"turkish\"],\"bozgun\":[\"turkish\"],\"bozkır\":[\"turkish\"],\"bölüm\":[\"turkish\"],\"börek\":[\"turkish\"],\"buçuk\":[\"turkish\"],\"bugün\":[\"turkish\"],\"buğday\":[\"turkish\"],\"buhar\":[\"turkish\"],\"buhran\":[\"turkish\"],\"bulvar\":[\"turkish\"],\"buram\":[\"turkish\"],\"burçak\":[\"turkish\"],\"burs\":[\"turkish\"],\"burun\":[\"turkish\"],\"buzdağı\":[\"turkish\"],\"buzkıran\":[\"turkish\"],\"bücür\":[\"turkish\"],\"büfe\":[\"turkish\"],\"bülten\":[\"turkish\"],\"bütçe\":[\"turkish\"],\"bütün\":[\"turkish\"],\"büyük\":[\"turkish\"],\"cacık\":[\"turkish\"],\"cadı\":[\"turkish\"],\"cahil\":[\"turkish\"],\"cambaz\":[\"turkish\"],\"canhıraş\":[\"turkish\"],\"casus\":[\"turkish\"],\"cazibe\":[\"turkish\"],\"cehalet\":[\"turkish\"],\"cehennem\":[\"turkish\"],\"ceket\":[\"turkish\"],\"cemre\":[\"turkish\"],\"cenin\":[\"turkish\"],\"cennet\":[\"turkish\"],\"cepken\":[\"turkish\"],\"cerrah\":[\"turkish\"],\"cesur\":[\"turkish\"],\"cetvel\":[\"turkish\"],\"cevher\":[\"turkish\"],\"ceylan\":[\"turkish\"],\"cılız\":[\"turkish\"],\"cıva\":[\"turkish\"],\"cilt\":[\"turkish\"],\"cisim\":[\"turkish\"],\"ciyak\":[\"turkish\"],\"coğrafya\":[\"turkish\"],\"cömert\":[\"turkish\"],\"cumba\":[\"turkish\"],\"cüzdan\":[\"turkish\"],\"çabucak\":[\"turkish\"],\"çadır\":[\"turkish\"],\"çağdaş\":[\"turkish\"],\"çağlayan\":[\"turkish\"],\"çağrı\":[\"turkish\"],\"çakmak\":[\"turkish\"],\"çalışkan\":[\"turkish\"],\"çamaşır\":[\"turkish\"],\"çapa\":[\"turkish\"],\"çaput\":[\"turkish\"],\"çarık\":[\"turkish\"],\"çarpan\":[\"turkish\"],\"çarşaf\":[\"turkish\"],\"çayhane\":[\"turkish\"],\"çekirdek\":[\"turkish\"],\"çelebi\":[\"turkish\"],\"çember\":[\"turkish\"],\"çenet\":[\"turkish\"],\"çengel\":[\"turkish\"],\"çerçeve\":[\"turkish\"],\"çerez\":[\"turkish\"],\"çeşit\":[\"turkish\"],\"çeşme\":[\"turkish\"],\"çete\":[\"turkish\"],\"çevre\":[\"turkish\"],\"çeyiz\":[\"turkish\"],\"çeyrek\":[\"turkish\"],\"çığır\":[\"turkish\"],\"çılgın\":[\"turkish\"],\"çıngırak\":[\"turkish\"],\"çift\":[\"turkish\"],\"çiğdem\":[\"turkish\"],\"çikolata\":[\"turkish\"],\"çilek\":[\"turkish\"],\"çimen\":[\"turkish\"],\"çivi\":[\"turkish\"],\"çoban\":[\"turkish\"],\"çocuk\":[\"turkish\"],\"çokgen\":[\"turkish\"],\"çomak\":[\"turkish\"],\"çorba\":[\"turkish\"],\"çözelti\":[\"turkish\"],\"çubuk\":[\"turkish\"],\"çukur\":[\"turkish\"],\"çuval\":[\"turkish\"],\"çürük\":[\"turkish\"],\"dağbaşı\":[\"turkish\"],\"dağılım\":[\"turkish\"],\"daktilo\":[\"turkish\"],\"daldırış\":[\"turkish\"],\"dalga\":[\"turkish\"],\"dalkavuk\":[\"turkish\"],\"damak\":[\"turkish\"],\"damıtma\":[\"turkish\"],\"damla\":[\"turkish\"],\"dana\":[\"turkish\"],\"dandik\":[\"turkish\"],\"danışman\":[\"turkish\"],\"daniska\":[\"turkish\"],\"dantel\":[\"turkish\"],\"dargeçit\":[\"turkish\"],\"darphane\":[\"turkish\"],\"davet\":[\"turkish\"],\"dayı\":[\"turkish\"],\"defter\":[\"turkish\"],\"değer\":[\"turkish\"],\"değirmen\":[\"turkish\"],\"dehşet\":[\"turkish\"],\"delgeç\":[\"turkish\"],\"demir\":[\"turkish\"],\"deneyim\":[\"turkish\"],\"denge\":[\"turkish\"],\"depo\":[\"turkish\"],\"deprem\":[\"turkish\"],\"derdest\":[\"turkish\"],\"dere\":[\"turkish\"],\"derhal\":[\"turkish\"],\"derman\":[\"turkish\"],\"dernek\":[\"turkish\"],\"derviş\":[\"turkish\"],\"desen\":[\"turkish\"],\"destan\":[\"turkish\"],\"dışarı\":[\"turkish\"],\"dışbükey\":[\"turkish\"],\"dijital\":[\"turkish\"],\"dikbaşlı\":[\"turkish\"],\"dilekçe\":[\"turkish\"],\"dimağ\":[\"turkish\"],\"dinamik\":[\"turkish\"],\"dindar\":[\"turkish\"],\"dinleme\":[\"turkish\"],\"dinozor\":[\"turkish\"],\"dipçik\":[\"turkish\"],\"dipnot\":[\"turkish\"],\"direniş\":[\"turkish\"],\"dirsek\":[\"turkish\"],\"disiplin\":[\"turkish\"],\"divriği\":[\"turkish\"],\"dizüstü\":[\"turkish\"],\"dobra\":[\"turkish\"],\"dodurga\":[\"turkish\"],\"doğalgaz\":[\"turkish\"],\"doküman\":[\"turkish\"],\"dolap\":[\"turkish\"],\"donanım\":[\"turkish\"],\"dondurma\":[\"turkish\"],\"donör\":[\"turkish\"],\"doruk\":[\"turkish\"],\"dosdoğru\":[\"turkish\"],\"dost\":[\"turkish\"],\"dosya\":[\"turkish\"],\"dozer\":[\"turkish\"],\"döküm\":[\"turkish\"],\"dönence\":[\"turkish\"],\"dörtyol\":[\"turkish\"],\"dövme\":[\"turkish\"],\"dram\":[\"turkish\"],\"dublaj\":[\"turkish\"],\"durum\":[\"turkish\"],\"duvak\":[\"turkish\"],\"duyarga\":[\"turkish\"],\"duyma\":[\"turkish\"],\"duyuru\":[\"turkish\"],\"düğme\":[\"turkish\"],\"düğüm\":[\"turkish\"],\"dükkan\":[\"turkish\"],\"dünür\":[\"turkish\"],\"düpedüz\":[\"turkish\"],\"dürbün\":[\"turkish\"],\"düşünür\":[\"turkish\"],\"düzayak\":[\"turkish\"],\"düzeltme\":[\"turkish\"],\"ebeveyn\":[\"turkish\"],\"ebru\":[\"turkish\"],\"ecel\":[\"turkish\"],\"ecnebi\":[\"turkish\"],\"ecza\":[\"turkish\"],\"edat\":[\"turkish\"],\"edilgen\":[\"turkish\"],\"efendi\":[\"turkish\"],\"efor\":[\"turkish\"],\"efsane\":[\"turkish\"],\"egemen\":[\"turkish\"],\"egzersiz\":[\"turkish\"],\"eğrelti\":[\"turkish\"],\"ekarte\":[\"turkish\"],\"ekip\":[\"turkish\"],\"eklem\":[\"turkish\"],\"ekmek\":[\"turkish\"],\"ekol\":[\"turkish\"],\"ekonomi\":[\"turkish\"],\"ekose\":[\"turkish\"],\"ekran\":[\"turkish\"],\"ekvator\":[\"turkish\"],\"elaman\":[\"turkish\"],\"elastik\":[\"turkish\"],\"elbet\":[\"turkish\"],\"elbise\":[\"turkish\"],\"elçi\":[\"turkish\"],\"eldiven\":[\"turkish\"],\"elebaşı\":[\"turkish\"],\"eleştiri\":[\"turkish\"],\"elma\":[\"turkish\"],\"eloğlu\":[\"turkish\"],\"elveda\":[\"turkish\"],\"emare\":[\"turkish\"],\"emekçi\":[\"turkish\"],\"emisyon\":[\"turkish\"],\"emniyet\":[\"turkish\"],\"empati\":[\"turkish\"],\"emsal\":[\"turkish\"],\"emzik\":[\"turkish\"],\"endüstri\":[\"turkish\"],\"enerji\":[\"turkish\"],\"engebe\":[\"turkish\"],\"enişte\":[\"turkish\"],\"enkaz\":[\"turkish\"],\"entari\":[\"turkish\"],\"entegre\":[\"turkish\"],\"entrika\":[\"turkish\"],\"enzim\":[\"turkish\"],\"erdem\":[\"turkish\"],\"ergen\":[\"turkish\"],\"erguvan\":[\"turkish\"],\"erkek\":[\"turkish\"],\"erozyon\":[\"turkish\"],\"ertesi\":[\"turkish\"],\"erzak\":[\"turkish\"],\"esaret\":[\"turkish\"],\"esenlik\":[\"turkish\"],\"eser\":[\"turkish\"],\"eski\":[\"turkish\"],\"esnek\":[\"turkish\"],\"eşarp\":[\"turkish\"],\"eşofman\":[\"turkish\"],\"eşraf\":[\"turkish\"],\"eşya\":[\"turkish\"],\"eşzaman\":[\"turkish\"],\"etik\":[\"turkish\"],\"etken\":[\"turkish\"],\"etkinlik\":[\"turkish\"],\"etüt\":[\"turkish\"],\"evet\":[\"turkish\"],\"evire\":[\"turkish\"],\"evrak\":[\"turkish\"],\"evrim\":[\"turkish\"],\"eyalet\":[\"turkish\"],\"eyvah\":[\"turkish\"],\"ezber\":[\"turkish\"],\"fabrika\":[\"turkish\"],\"fanus\":[\"turkish\"],\"fason\":[\"turkish\"],\"fasulye\":[\"turkish\"],\"fatih\":[\"turkish\"],\"fatura\":[\"turkish\"],\"fayans\":[\"turkish\"],\"fayton\":[\"turkish\"],\"fazıl\":[\"turkish\"],\"fazilet\":[\"turkish\"],\"felsefe\":[\"turkish\"],\"fener\":[\"turkish\"],\"feribot\":[\"turkish\"],\"fersah\":[\"turkish\"],\"fesih\":[\"turkish\"],\"feveran\":[\"turkish\"],\"feza\":[\"turkish\"],\"fıçı\":[\"turkish\"],\"fıldır\":[\"turkish\"],\"fındık\":[\"turkish\"],\"fırça\":[\"turkish\"],\"fırsat\":[\"turkish\"],\"fırtına\":[\"turkish\"],\"fıtık\":[\"turkish\"],\"fidan\":[\"turkish\"],\"fidye\":[\"turkish\"],\"figür\":[\"turkish\"],\"fihrist\":[\"turkish\"],\"fikir\":[\"turkish\"],\"fildişi\":[\"turkish\"],\"filtre\":[\"turkish\"],\"fincan\":[\"turkish\"],\"firuze\":[\"turkish\"],\"fitil\":[\"turkish\"],\"fiyaka\":[\"turkish\"],\"fizik\":[\"turkish\"],\"flaş\":[\"turkish\"],\"flüt\":[\"turkish\"],\"fosil\":[\"turkish\"],\"fren\":[\"turkish\"],\"fukara\":[\"turkish\"],\"futbol\":[\"turkish\"],\"garabet\":[\"turkish\"],\"gariban\":[\"turkish\"],\"garnitür\":[\"turkish\"],\"gazi\":[\"turkish\"],\"gece\":[\"turkish\"],\"gedik\":[\"turkish\"],\"gelenek\":[\"turkish\"],\"gelin\":[\"turkish\"],\"gemi\":[\"turkish\"],\"genç\":[\"turkish\"],\"geniş\":[\"turkish\"],\"geometri\":[\"turkish\"],\"gerçek\":[\"turkish\"],\"gevrek\":[\"turkish\"],\"gezegen\":[\"turkish\"],\"gezgin\":[\"turkish\"],\"geziyolu\":[\"turkish\"],\"gıcık\":[\"turkish\"],\"gıda\":[\"turkish\"],\"gıybet\":[\"turkish\"],\"girdap\":[\"turkish\"],\"girişim\":[\"turkish\"],\"gitar\":[\"turkish\"],\"giyecek\":[\"turkish\"],\"giysi\":[\"turkish\"],\"gizem\":[\"turkish\"],\"gofret\":[\"turkish\"],\"goril\":[\"turkish\"],\"göbek\":[\"turkish\"],\"göçebe\":[\"turkish\"],\"göğüs\":[\"turkish\"],\"gökdelen\":[\"turkish\"],\"gökmen\":[\"turkish\"],\"gökyüzü\":[\"turkish\"],\"gölge\":[\"turkish\"],\"gömlek\":[\"turkish\"],\"gönül\":[\"turkish\"],\"görenek\":[\"turkish\"],\"görkemli\":[\"turkish\"],\"görsel\":[\"turkish\"],\"gösteri\":[\"turkish\"],\"gövde\":[\"turkish\"],\"gözaltı\":[\"turkish\"],\"gözcü\":[\"turkish\"],\"gözdağı\":[\"turkish\"],\"gözleme\":[\"turkish\"],\"gözyaşı\":[\"turkish\"],\"grup\":[\"turkish\"],\"gurbet\":[\"turkish\"],\"gusül\":[\"turkish\"],\"gübre\":[\"turkish\"],\"güfte\":[\"turkish\"],\"gümüş\":[\"turkish\"],\"günaydın\":[\"turkish\"],\"güncel\":[\"turkish\"],\"gündüz\":[\"turkish\"],\"güneş\":[\"turkish\"],\"günyüzü\":[\"turkish\"],\"gürbüz\":[\"turkish\"],\"güvercin\":[\"turkish\"],\"güzel\":[\"turkish\"],\"hacamat\":[\"turkish\"],\"hacim\":[\"turkish\"],\"hademe\":[\"turkish\"],\"hafız\":[\"turkish\"],\"hafriyat\":[\"turkish\"],\"hafta\":[\"turkish\"],\"hakan\":[\"turkish\"],\"hakem\":[\"turkish\"],\"hakikat\":[\"turkish\"],\"haksever\":[\"turkish\"],\"halı\":[\"turkish\"],\"hançer\":[\"turkish\"],\"hane\":[\"turkish\"],\"hapis\":[\"turkish\"],\"hapşırık\":[\"turkish\"],\"harf\":[\"turkish\"],\"haseki\":[\"turkish\"],\"hasret\":[\"turkish\"],\"hatun\":[\"turkish\"],\"havuç\":[\"turkish\"],\"haylaz\":[\"turkish\"],\"haysiyet\":[\"turkish\"],\"hayvan\":[\"turkish\"],\"hedef\":[\"turkish\"],\"hemen\":[\"turkish\"],\"hemfikir\":[\"turkish\"],\"hendek\":[\"turkish\"],\"hepsi\":[\"turkish\"],\"hergele\":[\"turkish\"],\"herhangi\":[\"turkish\"],\"hesap\":[\"turkish\"],\"heyecan\":[\"turkish\"],\"heykel\":[\"turkish\"],\"hezimet\":[\"turkish\"],\"hıçkırık\":[\"turkish\"],\"hızölçer\":[\"turkish\"],\"hicviye\":[\"turkish\"],\"hikaye\":[\"turkish\"],\"hikmet\":[\"turkish\"],\"hile\":[\"turkish\"],\"hisse\":[\"turkish\"],\"hobi\":[\"turkish\"],\"hoca\":[\"turkish\"],\"horlama\":[\"turkish\"],\"hoşbeş\":[\"turkish\"],\"hoşgörü\":[\"turkish\"],\"hoyrat\":[\"turkish\"],\"hörgüç\":[\"turkish\"],\"höyük\":[\"turkish\"],\"hudut\":[\"turkish\"],\"hukuk\":[\"turkish\"],\"hunhar\":[\"turkish\"],\"hurda\":[\"turkish\"],\"huysuz\":[\"turkish\"],\"huzur\":[\"turkish\"],\"hücum\":[\"turkish\"],\"hükümet\":[\"turkish\"],\"hünkar\":[\"turkish\"],\"hüviyet\":[\"turkish\"],\"ırmak\":[\"turkish\"],\"ısıölçer\":[\"turkish\"],\"ısıtıcı\":[\"turkish\"],\"ıspanak\":[\"turkish\"],\"ısrar\":[\"turkish\"],\"ışıldak\":[\"turkish\"],\"ızdırap\":[\"turkish\"],\"ızgara\":[\"turkish\"],\"ibadet\":[\"turkish\"],\"icat\":[\"turkish\"],\"içbükey\":[\"turkish\"],\"içecek\":[\"turkish\"],\"içgüdü\":[\"turkish\"],\"içsel\":[\"turkish\"],\"idman\":[\"turkish\"],\"iftihar\":[\"turkish\"],\"iğne\":[\"turkish\"],\"ihanet\":[\"turkish\"],\"ihbar\":[\"turkish\"],\"ihdas\":[\"turkish\"],\"ihmal\":[\"turkish\"],\"ihracat\":[\"turkish\"],\"ihsan\":[\"turkish\"],\"ikilem\":[\"turkish\"],\"ikindi\":[\"turkish\"],\"ikircik\":[\"turkish\"],\"iklim\":[\"turkish\"],\"iksir\":[\"turkish\"],\"iktibas\":[\"turkish\"],\"ilaç\":[\"turkish\"],\"ilçe\":[\"turkish\"],\"ileri\":[\"turkish\"],\"iletişim\":[\"turkish\"],\"ilgi\":[\"turkish\"],\"ilhak\":[\"turkish\"],\"ilkbahar\":[\"turkish\"],\"ilkokul\":[\"turkish\"],\"ilmek\":[\"turkish\"],\"imkan\":[\"turkish\"],\"imleç\":[\"turkish\"],\"imsak\":[\"turkish\"],\"imtihan\":[\"turkish\"],\"imza\":[\"turkish\"],\"ince\":[\"turkish\"],\"inkar\":[\"turkish\"],\"inşa\":[\"turkish\"],\"ipek\":[\"turkish\"],\"ipucu\":[\"turkish\"],\"irade\":[\"turkish\"],\"irfan\":[\"turkish\"],\"irmik\":[\"turkish\"],\"isabet\":[\"turkish\"],\"iskele\":[\"turkish\"],\"israf\":[\"turkish\"],\"isyan\":[\"turkish\"],\"işçi\":[\"turkish\"],\"işgal\":[\"turkish\"],\"işgüzar\":[\"turkish\"],\"işlem\":[\"turkish\"],\"itibar\":[\"turkish\"],\"itiraf\":[\"turkish\"],\"ivedi\":[\"turkish\"],\"ivme\":[\"turkish\"],\"iyileşme\":[\"turkish\"],\"iyimser\":[\"turkish\"],\"izbandut\":[\"turkish\"],\"izci\":[\"turkish\"],\"izdiham\":[\"turkish\"],\"izin\":[\"turkish\"],\"jakoben\":[\"turkish\"],\"jandarma\":[\"turkish\"],\"jargon\":[\"turkish\"],\"kabadayı\":[\"turkish\"],\"kablo\":[\"turkish\"],\"kabus\":[\"turkish\"],\"kaçamak\":[\"turkish\"],\"kadeh\":[\"turkish\"],\"kadın\":[\"turkish\"],\"kadraj\":[\"turkish\"],\"kafa\":[\"turkish\"],\"kafkas\":[\"turkish\"],\"kağıt\":[\"turkish\"],\"kağnı\":[\"turkish\"],\"kahkaha\":[\"turkish\"],\"kahraman\":[\"turkish\"],\"kahvaltı\":[\"turkish\"],\"kakül\":[\"turkish\"],\"kaldırım\":[\"turkish\"],\"kale\":[\"turkish\"],\"kalibre\":[\"turkish\"],\"kalkan\":[\"turkish\"],\"kalpak\":[\"turkish\"],\"kamış\":[\"turkish\"],\"kamyon\":[\"turkish\"],\"kanat\":[\"turkish\"],\"kandaş\":[\"turkish\"],\"kanepe\":[\"turkish\"],\"kanser\":[\"turkish\"],\"kanun\":[\"turkish\"],\"kaos\":[\"turkish\"],\"kapı\":[\"turkish\"],\"kaplıca\":[\"turkish\"],\"kaptan\":[\"turkish\"],\"karanlık\":[\"turkish\"],\"kardeş\":[\"turkish\"],\"karga\":[\"turkish\"],\"karınca\":[\"turkish\"],\"karmaşa\":[\"turkish\"],\"karşıt\":[\"turkish\"],\"kasırga\":[\"turkish\"],\"kask\":[\"turkish\"],\"kasvet\":[\"turkish\"],\"katkı\":[\"turkish\"],\"katman\":[\"turkish\"],\"kavram\":[\"turkish\"],\"kaygan\":[\"turkish\"],\"kaynakça\":[\"turkish\"],\"kayyum\":[\"turkish\"],\"kedi\":[\"turkish\"],\"kehanet\":[\"turkish\"],\"kekik\":[\"turkish\"],\"kelebek\":[\"turkish\"],\"kenar\":[\"turkish\"],\"kerkenez\":[\"turkish\"],\"kerpiç\":[\"turkish\"],\"kesirli\":[\"turkish\"],\"kesmece\":[\"turkish\"],\"kestane\":[\"turkish\"],\"keşkek\":[\"turkish\"],\"ketçap\":[\"turkish\"],\"keyfiyet\":[\"turkish\"],\"kıble\":[\"turkish\"],\"kıdemli\":[\"turkish\"],\"kılavuz\":[\"turkish\"],\"kılçık\":[\"turkish\"],\"kılıf\":[\"turkish\"],\"kıraç\":[\"turkish\"],\"kırmızı\":[\"turkish\"],\"kırsal\":[\"turkish\"],\"kısayol\":[\"turkish\"],\"kısım\":[\"turkish\"],\"kıskanç\":[\"turkish\"],\"kısmet\":[\"turkish\"],\"kışla\":[\"turkish\"],\"kıvanç\":[\"turkish\"],\"kıvılcım\":[\"turkish\"],\"kıvrık\":[\"turkish\"],\"kıyafet\":[\"turkish\"],\"kıymetli\":[\"turkish\"],\"kızak\":[\"turkish\"],\"kızılcık\":[\"turkish\"],\"kibar\":[\"turkish\"],\"kinaye\":[\"turkish\"],\"kira\":[\"turkish\"],\"kiremit\":[\"turkish\"],\"kirli\":[\"turkish\"],\"kirpik\":[\"turkish\"],\"kişisel\":[\"turkish\"],\"kitap\":[\"turkish\"],\"koçbaşı\":[\"turkish\"],\"kodaman\":[\"turkish\"],\"koğuş\":[\"turkish\"],\"kokteyl\":[\"turkish\"],\"kolaycı\":[\"turkish\"],\"kolbastı\":[\"turkish\"],\"kolonya\":[\"turkish\"],\"koltuk\":[\"turkish\"],\"kolye\":[\"turkish\"],\"kombine\":[\"turkish\"],\"komedyen\":[\"turkish\"],\"komiser\":[\"turkish\"],\"komposto\":[\"turkish\"],\"komşu\":[\"turkish\"],\"komuta\":[\"turkish\"],\"konak\":[\"turkish\"],\"konfor\":[\"turkish\"],\"koni\":[\"turkish\"],\"konsül\":[\"turkish\"],\"kopya\":[\"turkish\"],\"korkusuz\":[\"turkish\"],\"korna\":[\"turkish\"],\"korse\":[\"turkish\"],\"korunak\":[\"turkish\"],\"korvet\":[\"turkish\"],\"kostüm\":[\"turkish\"],\"koşul\":[\"turkish\"],\"koyu\":[\"turkish\"],\"kozmik\":[\"turkish\"],\"köfte\":[\"turkish\"],\"kökensel\":[\"turkish\"],\"köprücük\":[\"turkish\"],\"köpük\":[\"turkish\"],\"kördüğüm\":[\"turkish\"],\"körfez\":[\"turkish\"],\"köstebek\":[\"turkish\"],\"köşegen\":[\"turkish\"],\"kötü\":[\"turkish\"],\"kravat\":[\"turkish\"],\"kriter\":[\"turkish\"],\"kuantum\":[\"turkish\"],\"kudurma\":[\"turkish\"],\"kuluçka\":[\"turkish\"],\"kulübe\":[\"turkish\"],\"kumanya\":[\"turkish\"],\"kumbara\":[\"turkish\"],\"kumlu\":[\"turkish\"],\"kumpir\":[\"turkish\"],\"kumral\":[\"turkish\"],\"kundura\":[\"turkish\"],\"kupa\":[\"turkish\"],\"kupkuru\":[\"turkish\"],\"kuramsal\":[\"turkish\"],\"kurbağa\":[\"turkish\"],\"kurdele\":[\"turkish\"],\"kurgu\":[\"turkish\"],\"kurmay\":[\"turkish\"],\"kurşun\":[\"turkish\"],\"kurtuluş\":[\"turkish\"],\"kurultay\":[\"turkish\"],\"kurye\":[\"turkish\"],\"kusursuz\":[\"turkish\"],\"kuşak\":[\"turkish\"],\"kuşbaşı\":[\"turkish\"],\"kuşkulu\":[\"turkish\"],\"kutlama\":[\"turkish\"],\"kutsal\":[\"turkish\"],\"kutup\":[\"turkish\"],\"kuver\":[\"turkish\"],\"kuyruk\":[\"turkish\"],\"kuzey\":[\"turkish\"],\"kuzgun\":[\"turkish\"],\"küçük\":[\"turkish\"],\"külçe\":[\"turkish\"],\"külfet\":[\"turkish\"],\"külliye\":[\"turkish\"],\"kültürel\":[\"turkish\"],\"kümes\":[\"turkish\"],\"künefe\":[\"turkish\"],\"küresel\":[\"turkish\"],\"kütle\":[\"turkish\"],\"lahana\":[\"turkish\"],\"lahmacun\":[\"turkish\"],\"lamba\":[\"turkish\"],\"lansman\":[\"turkish\"],\"lavaş\":[\"turkish\"],\"layık\":[\"turkish\"],\"leğen\":[\"turkish\"],\"levent\":[\"turkish\"],\"leziz\":[\"turkish\"],\"lezzet\":[\"turkish\"],\"lider\":[\"turkish\"],\"likide\":[\"turkish\"],\"liman\":[\"turkish\"],\"liste\":[\"turkish\"],\"litre\":[\"turkish\"],\"liyakat\":[\"turkish\"],\"lodos\":[\"turkish\"],\"lokanta\":[\"turkish\"],\"lokman\":[\"turkish\"],\"lokum\":[\"turkish\"],\"lunapark\":[\"turkish\"],\"lütfen\":[\"turkish\"],\"lüzum\":[\"turkish\"],\"nokta\":[\"turkish\"],\"mabet\":[\"turkish\"],\"macera\":[\"turkish\"],\"macun\":[\"turkish\"],\"madalya\":[\"turkish\"],\"madde\":[\"turkish\"],\"madem\":[\"turkish\"],\"mağara\":[\"turkish\"],\"mağdur\":[\"turkish\"],\"mağfiret\":[\"turkish\"],\"mağlup\":[\"turkish\"],\"mahalle\":[\"turkish\"],\"mahcup\":[\"turkish\"],\"mahir\":[\"turkish\"],\"mahkeme\":[\"turkish\"],\"mahlas\":[\"turkish\"],\"mahrum\":[\"turkish\"],\"mahsul\":[\"turkish\"],\"makas\":[\"turkish\"],\"makbuz\":[\"turkish\"],\"makine\":[\"turkish\"],\"makro\":[\"turkish\"],\"maksat\":[\"turkish\"],\"makul\":[\"turkish\"],\"maliye\":[\"turkish\"],\"manav\":[\"turkish\"],\"mangal\":[\"turkish\"],\"manidar\":[\"turkish\"],\"manken\":[\"turkish\"],\"mantık\":[\"turkish\"],\"manzara\":[\"turkish\"],\"mareşal\":[\"turkish\"],\"margarin\":[\"turkish\"],\"marifet\":[\"turkish\"],\"marmelat\":[\"turkish\"],\"masaüstü\":[\"turkish\"],\"masmavi\":[\"turkish\"],\"masraf\":[\"turkish\"],\"masum\":[\"turkish\"],\"matah\":[\"turkish\"],\"materyal\":[\"turkish\"],\"matrak\":[\"turkish\"],\"maval\":[\"turkish\"],\"mavra\":[\"turkish\"],\"maydanoz\":[\"turkish\"],\"mayhoş\":[\"turkish\"],\"maytap\":[\"turkish\"],\"mazbata\":[\"turkish\"],\"mazeret\":[\"turkish\"],\"mazlum\":[\"turkish\"],\"mazot\":[\"turkish\"],\"mazur\":[\"turkish\"],\"meblağ\":[\"turkish\"],\"mebus\":[\"turkish\"],\"mecaz\":[\"turkish\"],\"mecbur\":[\"turkish\"],\"meclis\":[\"turkish\"],\"mecmua\":[\"turkish\"],\"mecnun\":[\"turkish\"],\"meçhul\":[\"turkish\"],\"medeni\":[\"turkish\"],\"mehtap\":[\"turkish\"],\"mekanik\":[\"turkish\"],\"melodi\":[\"turkish\"],\"meltem\":[\"turkish\"],\"memur\":[\"turkish\"],\"mendil\":[\"turkish\"],\"menekşe\":[\"turkish\"],\"menteşe\":[\"turkish\"],\"meraklı\":[\"turkish\"],\"mercek\":[\"turkish\"],\"merdiven\":[\"turkish\"],\"merhaba\":[\"turkish\"],\"merinos\":[\"turkish\"],\"merkez\":[\"turkish\"],\"mermi\":[\"turkish\"],\"mert\":[\"turkish\"],\"mesafe\":[\"turkish\"],\"mesele\":[\"turkish\"],\"mesken\":[\"turkish\"],\"meslek\":[\"turkish\"],\"meşale\":[\"turkish\"],\"meşgul\":[\"turkish\"],\"meşhur\":[\"turkish\"],\"metafor\":[\"turkish\"],\"metin\":[\"turkish\"],\"metre\":[\"turkish\"],\"mevcut\":[\"turkish\"],\"mevkidaş\":[\"turkish\"],\"meydan\":[\"turkish\"],\"meyil\":[\"turkish\"],\"meyve\":[\"turkish\"],\"meziyet\":[\"turkish\"],\"mezun\":[\"turkish\"],\"mıknatıs\":[\"turkish\"],\"mısra\":[\"turkish\"],\"mızıka\":[\"turkish\"],\"miğfer\":[\"turkish\"],\"mihrak\":[\"turkish\"],\"miktar\":[\"turkish\"],\"milat\":[\"turkish\"],\"milli\":[\"turkish\"],\"mimar\":[\"turkish\"],\"minare\":[\"turkish\"],\"mineral\":[\"turkish\"],\"minik\":[\"turkish\"],\"minyon\":[\"turkish\"],\"mirliva\":[\"turkish\"],\"misafir\":[\"turkish\"],\"miskin\":[\"turkish\"],\"miting\":[\"turkish\"],\"miyop\":[\"turkish\"],\"mizah\":[\"turkish\"],\"mobilya\":[\"turkish\"],\"monitör\":[\"turkish\"],\"morötesi\":[\"turkish\"],\"motive\":[\"turkish\"],\"mozaik\":[\"turkish\"],\"muavin\":[\"turkish\"],\"mucize\":[\"turkish\"],\"muhafız\":[\"turkish\"],\"muhteşem\":[\"turkish\"],\"mukayese\":[\"turkish\"],\"mumya\":[\"turkish\"],\"musluk\":[\"turkish\"],\"muşamba\":[\"turkish\"],\"mutabık\":[\"turkish\"],\"mutfak\":[\"turkish\"],\"mutlu\":[\"turkish\"],\"muzaffer\":[\"turkish\"],\"muzdarip\":[\"turkish\"],\"mübarek\":[\"turkish\"],\"mücadele\":[\"turkish\"],\"müdür\":[\"turkish\"],\"müfredat\":[\"turkish\"],\"müftü\":[\"turkish\"],\"mühendis\":[\"turkish\"],\"mühim\":[\"turkish\"],\"mühlet\":[\"turkish\"],\"mükemmel\":[\"turkish\"],\"mülk\":[\"turkish\"],\"mümkün\":[\"turkish\"],\"mümtaz\":[\"turkish\"],\"müsrif\":[\"turkish\"],\"müstesna\":[\"turkish\"],\"müşahit\":[\"turkish\"],\"müşteri\":[\"turkish\"],\"mütercim\":[\"turkish\"],\"müthiş\":[\"turkish\"],\"müze\":[\"turkish\"],\"müzik\":[\"turkish\"],\"nabız\":[\"turkish\"],\"nadas\":[\"turkish\"],\"nadir\":[\"turkish\"],\"nahoş\":[\"turkish\"],\"nakarat\":[\"turkish\"],\"nakış\":[\"turkish\"],\"nalbur\":[\"turkish\"],\"namlu\":[\"turkish\"],\"namus\":[\"turkish\"],\"nankör\":[\"turkish\"],\"nargile\":[\"turkish\"],\"narkoz\":[\"turkish\"],\"nasıl\":[\"turkish\"],\"nasip\":[\"turkish\"],\"naylon\":[\"turkish\"],\"nazar\":[\"turkish\"],\"nazım\":[\"turkish\"],\"nazik\":[\"turkish\"],\"neden\":[\"turkish\"],\"nefes\":[\"turkish\"],\"negatif\":[\"turkish\"],\"neon\":[\"turkish\"],\"neptün\":[\"turkish\"],\"nerede\":[\"turkish\"],\"nesil\":[\"turkish\"],\"nesnel\":[\"turkish\"],\"neşeli\":[\"turkish\"],\"netice\":[\"turkish\"],\"nevresim\":[\"turkish\"],\"neyse\":[\"turkish\"],\"neyzen\":[\"turkish\"],\"nezaket\":[\"turkish\"],\"nezih\":[\"turkish\"],\"nezle\":[\"turkish\"],\"nicel\":[\"turkish\"],\"nilüfer\":[\"turkish\"],\"nimet\":[\"turkish\"],\"nisan\":[\"turkish\"],\"nispet\":[\"turkish\"],\"nitekim\":[\"turkish\"],\"nizam\":[\"turkish\"],\"nohut\":[\"turkish\"],\"noksan\":[\"turkish\"],\"nostalji\":[\"turkish\"],\"noter\":[\"turkish\"],\"nöbet\":[\"turkish\"],\"numara\":[\"turkish\"],\"numune\":[\"turkish\"],\"nutuk\":[\"turkish\"],\"nüfus\":[\"turkish\"],\"obabaşı\":[\"turkish\"],\"obez\":[\"turkish\"],\"obje\":[\"turkish\"],\"ocak\":[\"turkish\"],\"odun\":[\"turkish\"],\"ofansif\":[\"turkish\"],\"ofis\":[\"turkish\"],\"oğlak\":[\"turkish\"],\"oğuz\":[\"turkish\"],\"okçu\":[\"turkish\"],\"oklava\":[\"turkish\"],\"oksijen\":[\"turkish\"],\"okul\":[\"turkish\"],\"okumuş\":[\"turkish\"],\"okutman\":[\"turkish\"],\"okuyucu\":[\"turkish\"],\"okyanus\":[\"turkish\"],\"olağan\":[\"turkish\"],\"olanak\":[\"turkish\"],\"olası\":[\"turkish\"],\"olay\":[\"turkish\"],\"olgun\":[\"turkish\"],\"olimpik\":[\"turkish\"],\"olumlu\":[\"turkish\"],\"omlet\":[\"turkish\"],\"omurga\":[\"turkish\"],\"onarım\":[\"turkish\"],\"onursal\":[\"turkish\"],\"optik\":[\"turkish\"],\"orantı\":[\"turkish\"],\"ordu\":[\"turkish\"],\"organik\":[\"turkish\"],\"orijin\":[\"turkish\"],\"orkide\":[\"turkish\"],\"orman\":[\"turkish\"],\"orta\":[\"turkish\"],\"oruç\":[\"turkish\"],\"otağ\":[\"turkish\"],\"otantik\":[\"turkish\"],\"otel\":[\"turkish\"],\"otoban\":[\"turkish\"],\"otogar\":[\"turkish\"],\"otomobil\":[\"turkish\"],\"otonom\":[\"turkish\"],\"otopark\":[\"turkish\"],\"otorite\":[\"turkish\"],\"otoyol\":[\"turkish\"],\"oturum\":[\"turkish\"],\"oyuk\":[\"turkish\"],\"oyuncak\":[\"turkish\"],\"ozan\":[\"turkish\"],\"ödeme\":[\"turkish\"],\"ödenek\":[\"turkish\"],\"ödev\":[\"turkish\"],\"ödül\":[\"turkish\"],\"ödünç\":[\"turkish\"],\"öfke\":[\"turkish\"],\"öğlen\":[\"turkish\"],\"öğrenci\":[\"turkish\"],\"öğün\":[\"turkish\"],\"öğütücü\":[\"turkish\"],\"öksürük\":[\"turkish\"],\"ölçme\":[\"turkish\"],\"ölçü\":[\"turkish\"],\"ölümsüz\":[\"turkish\"],\"ömür\":[\"turkish\"],\"önayak\":[\"turkish\"],\"öncü\":[\"turkish\"],\"önder\":[\"turkish\"],\"önem\":[\"turkish\"],\"önerge\":[\"turkish\"],\"öngörü\":[\"turkish\"],\"önlük\":[\"turkish\"],\"önsezi\":[\"turkish\"],\"öpücük\":[\"turkish\"],\"ördek\":[\"turkish\"],\"örgü\":[\"turkish\"],\"örtbas\":[\"turkish\"],\"örtme\":[\"turkish\"],\"örtü\":[\"turkish\"],\"örümcek\":[\"turkish\"],\"örüntü\":[\"turkish\"],\"öteberi\":[\"turkish\"],\"öteki\":[\"turkish\"],\"övünç\":[\"turkish\"],\"öykü\":[\"turkish\"],\"öyleyse\":[\"turkish\"],\"özçekim\":[\"turkish\"],\"özdeyiş\":[\"turkish\"],\"özel\":[\"turkish\"],\"özenti\":[\"turkish\"],\"özerk\":[\"turkish\"],\"özgürlük\":[\"turkish\"],\"özlem\":[\"turkish\"],\"özlü\":[\"turkish\"],\"özne\":[\"turkish\"],\"özsever\":[\"turkish\"],\"özümseme\":[\"turkish\"],\"özür\":[\"turkish\"],\"özveri\":[\"turkish\"],\"pabuç\":[\"turkish\"],\"padişah\":[\"turkish\"],\"palamut\":[\"turkish\"],\"palmiye\":[\"turkish\"],\"palto\":[\"turkish\"],\"palyaço\":[\"turkish\"],\"pamuk\":[\"turkish\"],\"panayır\":[\"turkish\"],\"pancar\":[\"turkish\"],\"panik\":[\"turkish\"],\"panjur\":[\"turkish\"],\"pankart\":[\"turkish\"],\"pano\":[\"turkish\"],\"pansuman\":[\"turkish\"],\"pantolon\":[\"turkish\"],\"panzehir\":[\"turkish\"],\"papatya\":[\"turkish\"],\"papyon\":[\"turkish\"],\"paraşüt\":[\"turkish\"],\"parça\":[\"turkish\"],\"pardösü\":[\"turkish\"],\"parfüm\":[\"turkish\"],\"parıltı\":[\"turkish\"],\"parkur\":[\"turkish\"],\"parmak\":[\"turkish\"],\"parodi\":[\"turkish\"],\"parsel\":[\"turkish\"],\"partner\":[\"turkish\"],\"pasaport\":[\"turkish\"],\"pasif\":[\"turkish\"],\"paskalya\":[\"turkish\"],\"pastırma\":[\"turkish\"],\"paşa\":[\"turkish\"],\"patates\":[\"turkish\"],\"paten\":[\"turkish\"],\"patika\":[\"turkish\"],\"patlıcan\":[\"turkish\"],\"patolog\":[\"turkish\"],\"payanda\":[\"turkish\"],\"paydaş\":[\"turkish\"],\"payidar\":[\"turkish\"],\"paylaşma\":[\"turkish\"],\"paytak\":[\"turkish\"],\"peçete\":[\"turkish\"],\"peder\":[\"turkish\"],\"pehlivan\":[\"turkish\"],\"pekala\":[\"turkish\"],\"pekmez\":[\"turkish\"],\"pelerin\":[\"turkish\"],\"pelikan\":[\"turkish\"],\"pelüş\":[\"turkish\"],\"pembe\":[\"turkish\"],\"pencere\":[\"turkish\"],\"pense\":[\"turkish\"],\"perçin\":[\"turkish\"],\"perde\":[\"turkish\"],\"pergel\":[\"turkish\"],\"perişan\":[\"turkish\"],\"peron\":[\"turkish\"],\"personel\":[\"turkish\"],\"perşembe\":[\"turkish\"],\"peruk\":[\"turkish\"],\"pervane\":[\"turkish\"],\"pespaye\":[\"turkish\"],\"pestil\":[\"turkish\"],\"peşin\":[\"turkish\"],\"petek\":[\"turkish\"],\"petrol\":[\"turkish\"],\"petunya\":[\"turkish\"],\"peynir\":[\"turkish\"],\"peyzaj\":[\"turkish\"],\"pınar\":[\"turkish\"],\"pırasa\":[\"turkish\"],\"pırlanta\":[\"turkish\"],\"pide\":[\"turkish\"],\"pikap\":[\"turkish\"],\"pilav\":[\"turkish\"],\"piliç\":[\"turkish\"],\"pipet\":[\"turkish\"],\"pipo\":[\"turkish\"],\"piramit\":[\"turkish\"],\"pirinç\":[\"turkish\"],\"pirzola\":[\"turkish\"],\"pist\":[\"turkish\"],\"pişik\":[\"turkish\"],\"pişman\":[\"turkish\"],\"piyasa\":[\"turkish\"],\"piyes\":[\"turkish\"],\"plaj\":[\"turkish\"],\"plaket\":[\"turkish\"],\"planlama\":[\"turkish\"],\"platform\":[\"turkish\"],\"plazma\":[\"turkish\"],\"podyum\":[\"turkish\"],\"poğaça\":[\"turkish\"],\"polat\":[\"turkish\"],\"politika\":[\"turkish\"],\"popüler\":[\"turkish\"],\"porselen\":[\"turkish\"],\"portakal\":[\"turkish\"],\"poster\":[\"turkish\"],\"poşet\":[\"turkish\"],\"poyraz\":[\"turkish\"],\"pozitif\":[\"turkish\"],\"pranga\":[\"turkish\"],\"pratik\":[\"turkish\"],\"prenses\":[\"turkish\"],\"prim\":[\"turkish\"],\"profil\":[\"turkish\"],\"proje\":[\"turkish\"],\"protokol\":[\"turkish\"],\"puan\":[\"turkish\"],\"pudra\":[\"turkish\"],\"pusula\":[\"turkish\"],\"püre\":[\"turkish\"],\"pürüz\":[\"turkish\"],\"püstül\":[\"turkish\"],\"püsür\":[\"turkish\"],\"racon\":[\"turkish\"],\"radikal\":[\"turkish\"],\"radyo\":[\"turkish\"],\"rafadan\":[\"turkish\"],\"rafine\":[\"turkish\"],\"rağbet\":[\"turkish\"],\"rahat\":[\"turkish\"],\"rahle\":[\"turkish\"],\"rakam\":[\"turkish\"],\"raket\":[\"turkish\"],\"rakip\":[\"turkish\"],\"rakun\":[\"turkish\"],\"ralli\":[\"turkish\"],\"randevu\":[\"turkish\"],\"ranza\":[\"turkish\"],\"rapor\":[\"turkish\"],\"rastgele\":[\"turkish\"],\"rasyonel\":[\"turkish\"],\"razı\":[\"turkish\"],\"realite\":[\"turkish\"],\"reçine\":[\"turkish\"],\"refah\":[\"turkish\"],\"referans\":[\"turkish\"],\"refik\":[\"turkish\"],\"rehber\":[\"turkish\"],\"rehin\":[\"turkish\"],\"reis\":[\"turkish\"],\"rekabet\":[\"turkish\"],\"reklam\":[\"turkish\"],\"rekor\":[\"turkish\"],\"rektör\":[\"turkish\"],\"renk\":[\"turkish\"],\"resim\":[\"turkish\"],\"resmen\":[\"turkish\"],\"restoran\":[\"turkish\"],\"retorik\":[\"turkish\"],\"revaç\":[\"turkish\"],\"reyon\":[\"turkish\"],\"rezalet\":[\"turkish\"],\"rezerv\":[\"turkish\"],\"rezil\":[\"turkish\"],\"rıhtım\":[\"turkish\"],\"rıza\":[\"turkish\"],\"ritim\":[\"turkish\"],\"ritüel\":[\"turkish\"],\"rivayet\":[\"turkish\"],\"roman\":[\"turkish\"],\"rozet\":[\"turkish\"],\"röportaj\":[\"turkish\"],\"rötar\":[\"turkish\"],\"ruble\":[\"turkish\"],\"ruhban\":[\"turkish\"],\"ruhsat\":[\"turkish\"],\"rulet\":[\"turkish\"],\"runik\":[\"turkish\"],\"rutin\":[\"turkish\"],\"rutubet\":[\"turkish\"],\"rüşvet\":[\"turkish\"],\"rütbe\":[\"turkish\"],\"rüya\":[\"turkish\"],\"rüzgar\":[\"turkish\"],\"sabah\":[\"turkish\"],\"sabıka\":[\"turkish\"],\"sabit\":[\"turkish\"],\"sabun\":[\"turkish\"],\"saçma\":[\"turkish\"],\"sade\":[\"turkish\"],\"sadık\":[\"turkish\"],\"safahat\":[\"turkish\"],\"safdil\":[\"turkish\"],\"safkan\":[\"turkish\"],\"sağanak\":[\"turkish\"],\"sağduyu\":[\"turkish\"],\"sağlam\":[\"turkish\"],\"saha\":[\"turkish\"],\"sahiden\":[\"turkish\"],\"sahne\":[\"turkish\"],\"sakal\":[\"turkish\"],\"sakız\":[\"turkish\"],\"sakin\":[\"turkish\"],\"saklama\":[\"turkish\"],\"saksağan\":[\"turkish\"],\"salamura\":[\"turkish\"],\"salça\":[\"turkish\"],\"salgı\":[\"turkish\"],\"salınım\":[\"turkish\"],\"salkım\":[\"turkish\"],\"saltanat\":[\"turkish\"],\"sanatçı\":[\"turkish\"],\"sancak\":[\"turkish\"],\"sandalye\":[\"turkish\"],\"saniye\":[\"turkish\"],\"saplantı\":[\"turkish\"],\"sapsız\":[\"turkish\"],\"saray\":[\"turkish\"],\"sarışın\":[\"turkish\"],\"sarkık\":[\"turkish\"],\"sarmaşık\":[\"turkish\"],\"satır\":[\"turkish\"],\"savaşım\":[\"turkish\"],\"savunma\":[\"turkish\"],\"saydam\":[\"turkish\"],\"sayfa\":[\"turkish\"],\"saygın\":[\"turkish\"],\"sayısal\":[\"turkish\"],\"sebep\":[\"turkish\"],\"seçenek\":[\"turkish\"],\"seçim\":[\"turkish\"],\"seçkin\":[\"turkish\"],\"seçmen\":[\"turkish\"],\"sedir\":[\"turkish\"],\"sedye\":[\"turkish\"],\"sefer\":[\"turkish\"],\"sehpa\":[\"turkish\"],\"sekizgen\":[\"turkish\"],\"selektör\":[\"turkish\"],\"selvi\":[\"turkish\"],\"semavi\":[\"turkish\"],\"sembol\":[\"turkish\"],\"seminer\":[\"turkish\"],\"senaryo\":[\"turkish\"],\"sendika\":[\"turkish\"],\"senkron\":[\"turkish\"],\"sensör\":[\"turkish\"],\"sentez\":[\"turkish\"],\"sepet\":[\"turkish\"],\"seramik\":[\"turkish\"],\"serbest\":[\"turkish\"],\"serdar\":[\"turkish\"],\"seremoni\":[\"turkish\"],\"sergi\":[\"turkish\"],\"serhat\":[\"turkish\"],\"serin\":[\"turkish\"],\"sermaye\":[\"turkish\"],\"serpuş\":[\"turkish\"],\"sersem\":[\"turkish\"],\"serüven\":[\"turkish\"],\"sesli\":[\"turkish\"],\"sesteş\":[\"turkish\"],\"sevap\":[\"turkish\"],\"seviye\":[\"turkish\"],\"seyahat\":[\"turkish\"],\"seyirci\":[\"turkish\"],\"sezon\":[\"turkish\"],\"sıcak\":[\"turkish\"],\"sıfat\":[\"turkish\"],\"sıhhi\":[\"turkish\"],\"sınanma\":[\"turkish\"],\"sınır\":[\"turkish\"],\"sıradan\":[\"turkish\"],\"sırdaş\":[\"turkish\"],\"sırma\":[\"turkish\"],\"sırtüstü\":[\"turkish\"],\"sızgıt\":[\"turkish\"],\"siftah\":[\"turkish\"],\"sigorta\":[\"turkish\"],\"sihirbaz\":[\"turkish\"],\"silah\":[\"turkish\"],\"silecek\":[\"turkish\"],\"silindir\":[\"turkish\"],\"simetri\":[\"turkish\"],\"simge\":[\"turkish\"],\"simit\":[\"turkish\"],\"sincap\":[\"turkish\"],\"sindirim\":[\"turkish\"],\"sinema\":[\"turkish\"],\"sinirli\":[\"turkish\"],\"sipariş\":[\"turkish\"],\"sirke\":[\"turkish\"],\"siroz\":[\"turkish\"],\"sistem\":[\"turkish\"],\"sivilce\":[\"turkish\"],\"siyasi\":[\"turkish\"],\"soba\":[\"turkish\"],\"sofra\":[\"turkish\"],\"soğuk\":[\"turkish\"],\"sohbet\":[\"turkish\"],\"sokak\":[\"turkish\"],\"solfej\":[\"turkish\"],\"solunum\":[\"turkish\"],\"somut\":[\"turkish\"],\"sonbahar\":[\"turkish\"],\"sonraki\":[\"turkish\"],\"sonsuz\":[\"turkish\"],\"sorunsuz\":[\"turkish\"],\"sosyete\":[\"turkish\"],\"soyağacı\":[\"turkish\"],\"soydaş\":[\"turkish\"],\"soygun\":[\"turkish\"],\"soytarı\":[\"turkish\"],\"söğüş\":[\"turkish\"],\"sömürge\":[\"turkish\"],\"sönük\":[\"turkish\"],\"söylem\":[\"turkish\"],\"sözcük\":[\"turkish\"],\"sözde\":[\"turkish\"],\"spatula\":[\"turkish\"],\"spektrum\":[\"turkish\"],\"spiker\":[\"turkish\"],\"sporcu\":[\"turkish\"],\"sprey\":[\"turkish\"],\"stabil\":[\"turkish\"],\"statü\":[\"turkish\"],\"stok\":[\"turkish\"],\"stopaj\":[\"turkish\"],\"strateji\":[\"turkish\"],\"subay\":[\"turkish\"],\"sucuk\":[\"turkish\"],\"suçüstü\":[\"turkish\"],\"suhulet\":[\"turkish\"],\"sulama\":[\"turkish\"],\"sungur\":[\"turkish\"],\"sunucu\":[\"turkish\"],\"surat\":[\"turkish\"],\"susam\":[\"turkish\"],\"suskun\":[\"turkish\"],\"sükse\":[\"turkish\"],\"sükut\":[\"turkish\"],\"sülale\":[\"turkish\"],\"sünger\":[\"turkish\"],\"süpürge\":[\"turkish\"],\"sürahi\":[\"turkish\"],\"süreç\":[\"turkish\"],\"sürgün\":[\"turkish\"],\"sürüm\":[\"turkish\"],\"süsleme\":[\"turkish\"],\"sütanne\":[\"turkish\"],\"sütlaç\":[\"turkish\"],\"sütun\":[\"turkish\"],\"süvari\":[\"turkish\"],\"şahane\":[\"turkish\"],\"şahbaz\":[\"turkish\"],\"şahit\":[\"turkish\"],\"şahsiyet\":[\"turkish\"],\"şakıma\":[\"turkish\"],\"şaklaban\":[\"turkish\"],\"şakrak\":[\"turkish\"],\"şamar\":[\"turkish\"],\"şampiyon\":[\"turkish\"],\"şanslı\":[\"turkish\"],\"şantiye\":[\"turkish\"],\"şapka\":[\"turkish\"],\"şarkıcı\":[\"turkish\"],\"şartname\":[\"turkish\"],\"şaşırma\":[\"turkish\"],\"şaşkın\":[\"turkish\"],\"şatafat\":[\"turkish\"],\"şayet\":[\"turkish\"],\"şebeke\":[\"turkish\"],\"şefkat\":[\"turkish\"],\"şeftali\":[\"turkish\"],\"şehir\":[\"turkish\"],\"şehvet\":[\"turkish\"],\"şeker\":[\"turkish\"],\"şekil\":[\"turkish\"],\"şelale\":[\"turkish\"],\"şema\":[\"turkish\"],\"şemsiye\":[\"turkish\"],\"şerbet\":[\"turkish\"],\"şeref\":[\"turkish\"],\"şerit\":[\"turkish\"],\"şımarık\":[\"turkish\"],\"şıpıdık\":[\"turkish\"],\"şifre\":[\"turkish\"],\"şimdi\":[\"turkish\"],\"şimşek\":[\"turkish\"],\"şipşak\":[\"turkish\"],\"şirin\":[\"turkish\"],\"şişe\":[\"turkish\"],\"şişirme\":[\"turkish\"],\"şofben\":[\"turkish\"],\"şöhret\":[\"turkish\"],\"şölen\":[\"turkish\"],\"şüphe\":[\"turkish\"],\"tabaka\":[\"turkish\"],\"tabure\":[\"turkish\"],\"tadilat\":[\"turkish\"],\"taharet\":[\"turkish\"],\"tahıl\":[\"turkish\"],\"tahkim\":[\"turkish\"],\"tahlil\":[\"turkish\"],\"tahmin\":[\"turkish\"],\"tahrifat\":[\"turkish\"],\"tahsilat\":[\"turkish\"],\"tahta\":[\"turkish\"],\"taklit\":[\"turkish\"],\"takoz\":[\"turkish\"],\"taksici\":[\"turkish\"],\"taktik\":[\"turkish\"],\"takvim\":[\"turkish\"],\"talebe\":[\"turkish\"],\"talip\":[\"turkish\"],\"tamamen\":[\"turkish\"],\"tamirci\":[\"turkish\"],\"tamtakır\":[\"turkish\"],\"tandır\":[\"turkish\"],\"tanecik\":[\"turkish\"],\"tanıtım\":[\"turkish\"],\"tanrı\":[\"turkish\"],\"tansiyon\":[\"turkish\"],\"tapan\":[\"turkish\"],\"tapınak\":[\"turkish\"],\"taptaze\":[\"turkish\"],\"tapu\":[\"turkish\"],\"tarafgir\":[\"turkish\"],\"tarhana\":[\"turkish\"],\"tarım\":[\"turkish\"],\"tarih\":[\"turkish\"],\"tarla\":[\"turkish\"],\"tartak\":[\"turkish\"],\"tarumar\":[\"turkish\"],\"tasarım\":[\"turkish\"],\"tasdik\":[\"turkish\"],\"taslak\":[\"turkish\"],\"tastamam\":[\"turkish\"],\"taşeron\":[\"turkish\"],\"taşınmaz\":[\"turkish\"],\"taşra\":[\"turkish\"],\"tatava\":[\"turkish\"],\"tatbikat\":[\"turkish\"],\"tatil\":[\"turkish\"],\"tatlı\":[\"turkish\"],\"tavsiye\":[\"turkish\"],\"tavşan\":[\"turkish\"],\"tavuk\":[\"turkish\"],\"taze\":[\"turkish\"],\"taziye\":[\"turkish\"],\"tazminat\":[\"turkish\"],\"tebeşir\":[\"turkish\"],\"tebrik\":[\"turkish\"],\"tecrübe\":[\"turkish\"],\"teçhizat\":[\"turkish\"],\"tedarik\":[\"turkish\"],\"tedbir\":[\"turkish\"],\"teftiş\":[\"turkish\"],\"teğet\":[\"turkish\"],\"teğmen\":[\"turkish\"],\"tehdit\":[\"turkish\"],\"tehlike\":[\"turkish\"],\"tekdüze\":[\"turkish\"],\"tekerlek\":[\"turkish\"],\"tekme\":[\"turkish\"],\"teknik\":[\"turkish\"],\"tekrar\":[\"turkish\"],\"telef\":[\"turkish\"],\"telsiz\":[\"turkish\"],\"telve\":[\"turkish\"],\"temas\":[\"turkish\"],\"tembel\":[\"turkish\"],\"temiz\":[\"turkish\"],\"temkin\":[\"turkish\"],\"temsilci\":[\"turkish\"],\"tendon\":[\"turkish\"],\"teneke\":[\"turkish\"],\"tenha\":[\"turkish\"],\"tenkit\":[\"turkish\"],\"tepegöz\":[\"turkish\"],\"tepki\":[\"turkish\"],\"terazi\":[\"turkish\"],\"terbiye\":[\"turkish\"],\"tercih\":[\"turkish\"],\"tereyağı\":[\"turkish\"],\"terfi\":[\"turkish\"],\"terim\":[\"turkish\"],\"terminal\":[\"turkish\"],\"tersane\":[\"turkish\"],\"tertip\":[\"turkish\"],\"tesadüf\":[\"turkish\"],\"tescil\":[\"turkish\"],\"tesir\":[\"turkish\"],\"teslimat\":[\"turkish\"],\"tespit\":[\"turkish\"],\"testere\":[\"turkish\"],\"teşekkür\":[\"turkish\"],\"teşhir\":[\"turkish\"],\"teşrif\":[\"turkish\"],\"teşvik\":[\"turkish\"],\"teyze\":[\"turkish\"],\"tezahür\":[\"turkish\"],\"tezgah\":[\"turkish\"],\"tıbbi\":[\"turkish\"],\"tıkaç\":[\"turkish\"],\"tıkışık\":[\"turkish\"],\"tıknaz\":[\"turkish\"],\"tılsım\":[\"turkish\"],\"tıpkı\":[\"turkish\"],\"tıraş\":[\"turkish\"],\"tırışka\":[\"turkish\"],\"tırmanış\":[\"turkish\"],\"tırnak\":[\"turkish\"],\"tırpan\":[\"turkish\"],\"tıslama\":[\"turkish\"],\"ticaret\":[\"turkish\"],\"tilki\":[\"turkish\"],\"tiryaki\":[\"turkish\"],\"titreşim\":[\"turkish\"],\"tohum\":[\"turkish\"],\"tokat\":[\"turkish\"],\"tolere\":[\"turkish\"],\"tombak\":[\"turkish\"],\"tomurcuk\":[\"turkish\"],\"topaç\":[\"turkish\"],\"toplum\":[\"turkish\"],\"toprak\":[\"turkish\"],\"toptan\":[\"turkish\"],\"toraman\":[\"turkish\"],\"torpido\":[\"turkish\"],\"tortu\":[\"turkish\"],\"tosbağa\":[\"turkish\"],\"toynak\":[\"turkish\"],\"tören\":[\"turkish\"],\"trafik\":[\"turkish\"],\"trajedi\":[\"turkish\"],\"tramvay\":[\"turkish\"],\"tribün\":[\"turkish\"],\"triko\":[\"turkish\"],\"tugay\":[\"turkish\"],\"tuğla\":[\"turkish\"],\"tuğrul\":[\"turkish\"],\"tuhaf\":[\"turkish\"],\"tulumba\":[\"turkish\"],\"tunç\":[\"turkish\"],\"turan\":[\"turkish\"],\"turkuaz\":[\"turkish\"],\"turnusol\":[\"turkish\"],\"turşu\":[\"turkish\"],\"turuncu\":[\"turkish\"],\"tutanak\":[\"turkish\"],\"tutkal\":[\"turkish\"],\"tutsak\":[\"turkish\"],\"tutum\":[\"turkish\"],\"tuyuğ\":[\"turkish\"],\"tuzlu\":[\"turkish\"],\"tüccar\":[\"turkish\"],\"tüfek\":[\"turkish\"],\"tükenmez\":[\"turkish\"],\"tülbent\":[\"turkish\"],\"tümleç\":[\"turkish\"],\"tünel\":[\"turkish\"],\"türbin\":[\"turkish\"],\"türev\":[\"turkish\"],\"türk\":[\"turkish\"],\"tüzük\":[\"turkish\"],\"ucube\":[\"turkish\"],\"ucuz\":[\"turkish\"],\"uçak\":[\"turkish\"],\"uçurtma\":[\"turkish\"],\"ufuk\":[\"turkish\"],\"uğrak\":[\"turkish\"],\"uğur\":[\"turkish\"],\"ukala\":[\"turkish\"],\"ulaşım\":[\"turkish\"],\"ulema\":[\"turkish\"],\"ulus\":[\"turkish\"],\"ulvi\":[\"turkish\"],\"umursama\":[\"turkish\"],\"umut\":[\"turkish\"],\"unutkan\":[\"turkish\"],\"uslu\":[\"turkish\"],\"ustabaşı\":[\"turkish\"],\"ustura\":[\"turkish\"],\"usul\":[\"turkish\"],\"utangaç\":[\"turkish\"],\"uyanık\":[\"turkish\"],\"uyarı\":[\"turkish\"],\"uydu\":[\"turkish\"],\"uygar\":[\"turkish\"],\"uygulama\":[\"turkish\"],\"uykusuz\":[\"turkish\"],\"uysal\":[\"turkish\"],\"uyuşma\":[\"turkish\"],\"uzantı\":[\"turkish\"],\"uzay\":[\"turkish\"],\"uzgören\":[\"turkish\"],\"uzlaşma\":[\"turkish\"],\"uzman\":[\"turkish\"],\"uzun\":[\"turkish\"],\"ücra\":[\"turkish\"],\"ücret\":[\"turkish\"],\"üçbudak\":[\"turkish\"],\"üçgen\":[\"turkish\"],\"üçkağıt\":[\"turkish\"],\"üçleme\":[\"turkish\"],\"üfürük\":[\"turkish\"],\"ülke\":[\"turkish\"],\"ümit\":[\"turkish\"],\"üniforma\":[\"turkish\"],\"ünite\":[\"turkish\"],\"ünlem\":[\"turkish\"],\"üretken\":[\"turkish\"],\"ürün\":[\"turkish\"],\"üslup\":[\"turkish\"],\"üstel\":[\"turkish\"],\"üstün\":[\"turkish\"],\"üşengeç\":[\"turkish\"],\"üşüme\":[\"turkish\"],\"ütopya\":[\"turkish\"],\"üvey\":[\"turkish\"],\"üzengi\":[\"turkish\"],\"üzgün\":[\"turkish\"],\"üzüm\":[\"turkish\"],\"vaka\":[\"turkish\"],\"vakfiye\":[\"turkish\"],\"vakıf\":[\"turkish\"],\"vakit\":[\"turkish\"],\"vakum\":[\"turkish\"],\"vapur\":[\"turkish\"],\"varil\":[\"turkish\"],\"varlık\":[\"turkish\"],\"varsayım\":[\"turkish\"],\"varyemez\":[\"turkish\"],\"vasıta\":[\"turkish\"],\"vasiyet\":[\"turkish\"],\"vatandaş\":[\"turkish\"],\"vazife\":[\"turkish\"],\"vazo\":[\"turkish\"],\"veciz\":[\"turkish\"],\"vefa\":[\"turkish\"],\"vehim\":[\"turkish\"],\"veliaht\":[\"turkish\"],\"veresiye\":[\"turkish\"],\"verimli\":[\"turkish\"],\"verkaç\":[\"turkish\"],\"vernik\":[\"turkish\"],\"vertigo\":[\"turkish\"],\"vesait\":[\"turkish\"],\"vesika\":[\"turkish\"],\"vestiyer\":[\"turkish\"],\"veznedar\":[\"turkish\"],\"vicdan\":[\"turkish\"],\"vilayet\":[\"turkish\"],\"virane\":[\"turkish\"],\"virgül\":[\"turkish\"],\"vişne\":[\"turkish\"],\"vites\":[\"turkish\"],\"vokal\":[\"turkish\"],\"volkan\":[\"turkish\"],\"vurma\":[\"turkish\"],\"vurucu\":[\"turkish\"],\"vücut\":[\"turkish\"],\"yabancı\":[\"turkish\"],\"yabgu\":[\"turkish\"],\"yağış\":[\"turkish\"],\"yağlı\":[\"turkish\"],\"yağmur\":[\"turkish\"],\"yakamoz\":[\"turkish\"],\"yakın\":[\"turkish\"],\"yaklaşık\":[\"turkish\"],\"yalçın\":[\"turkish\"],\"yalıtım\":[\"turkish\"],\"yaman\":[\"turkish\"],\"yanardağ\":[\"turkish\"],\"yangın\":[\"turkish\"],\"yanıt\":[\"turkish\"],\"yankı\":[\"turkish\"],\"yanlış\":[\"turkish\"],\"yansıma\":[\"turkish\"],\"yapay\":[\"turkish\"],\"yapboz\":[\"turkish\"],\"yapımcı\":[\"turkish\"],\"yaprak\":[\"turkish\"],\"yaratık\":[\"turkish\"],\"yarbay\":[\"turkish\"],\"yardım\":[\"turkish\"],\"yargıç\":[\"turkish\"],\"yarıçap\":[\"turkish\"],\"yasemin\":[\"turkish\"],\"yastık\":[\"turkish\"],\"yaşam\":[\"turkish\"],\"yatak\":[\"turkish\"],\"yatırım\":[\"turkish\"],\"yavru\":[\"turkish\"],\"yaygara\":[\"turkish\"],\"yayıncı\":[\"turkish\"],\"yayla\":[\"turkish\"],\"yazılım\":[\"turkish\"],\"yekpare\":[\"turkish\"],\"yekvücut\":[\"turkish\"],\"yelkovan\":[\"turkish\"],\"yelpaze\":[\"turkish\"],\"yemek\":[\"turkish\"],\"yemiş\":[\"turkish\"],\"yengeç\":[\"turkish\"],\"yeniçeri\":[\"turkish\"],\"yeraltı\":[\"turkish\"],\"yerküre\":[\"turkish\"],\"yerleşke\":[\"turkish\"],\"yeryüzü\":[\"turkish\"],\"yeşil\":[\"turkish\"],\"yetenek\":[\"turkish\"],\"yetkili\":[\"turkish\"],\"yığınak\":[\"turkish\"],\"yıkama\":[\"turkish\"],\"yılbaşı\":[\"turkish\"],\"yıldırım\":[\"turkish\"],\"yılkı\":[\"turkish\"],\"yılmaz\":[\"turkish\"],\"yırtıcı\":[\"turkish\"],\"yiğit\":[\"turkish\"],\"yoğurt\":[\"turkish\"],\"yokuş\":[\"turkish\"],\"yolcu\":[\"turkish\"],\"yoldaş\":[\"turkish\"],\"yolgeçen\":[\"turkish\"],\"yolkesen\":[\"turkish\"],\"yolüstü\":[\"turkish\"],\"yordam\":[\"turkish\"],\"yorgan\":[\"turkish\"],\"yorumcu\":[\"turkish\"],\"yosun\":[\"turkish\"],\"yöndeş\":[\"turkish\"],\"yönetim\":[\"turkish\"],\"yönlü\":[\"turkish\"],\"yöntem\":[\"turkish\"],\"yöresel\":[\"turkish\"],\"yörünge\":[\"turkish\"],\"yufka\":[\"turkish\"],\"yukarı\":[\"turkish\"],\"yumruk\":[\"turkish\"],\"yumurta\":[\"turkish\"],\"yuvarlak\":[\"turkish\"],\"yücelme\":[\"turkish\"],\"yükçeker\":[\"turkish\"],\"yüklem\":[\"turkish\"],\"yüksek\":[\"turkish\"],\"yürek\":[\"turkish\"],\"yürütme\":[\"turkish\"],\"yüzde\":[\"turkish\"],\"yüzeysel\":[\"turkish\"],\"yüzgeç\":[\"turkish\"],\"yüzüstü\":[\"turkish\"],\"yüzyıl\":[\"turkish\"],\"zabıta\":[\"turkish\"],\"zafer\":[\"turkish\"],\"zahmet\":[\"turkish\"],\"zambak\":[\"turkish\"],\"zaptiye\":[\"turkish\"],\"zarafet\":[\"turkish\"],\"zaruret\":[\"turkish\"],\"zeka\":[\"turkish\"],\"zekice\":[\"turkish\"],\"zemberek\":[\"turkish\"],\"zemin\":[\"turkish\"],\"zencefil\":[\"turkish\"],\"zeplin\":[\"turkish\"],\"zeytin\":[\"turkish\"],\"zıbın\":[\"turkish\"],\"zılgıt\":[\"turkish\"],\"zımbırtı\":[\"turkish\"],\"zımpara\":[\"turkish\"],\"zıpkın\":[\"turkish\"],\"zigon\":[\"turkish\"],\"zihinsel\":[\"turkish\"],\"zihniyet\":[\"turkish\"],\"zincir\":[\"turkish\"],\"zindan\":[\"turkish\"],\"zirzop\":[\"turkish\"],\"ziyaret\":[\"turkish\"],\"ziynet\":[\"turkish\"],\"zoraki\":[\"turkish\"],\"zorlu\":[\"turkish\"],\"zorunlu\":[\"turkish\"],\"züğürt\":[\"turkish\"],\"zümre\":[\"turkish\"]}[\"abacate\",\"abaixo\",\"abalar\",\"abater\",\"abduzir\",\"abelha\",\"aberto\",\"abismo\",\"abotoar\",\"abranger\",\"abreviar\",\"abrigar\",\"abrupto\",\"absinto\",\"absoluto\",\"absurdo\",\"abutre\",\"acabado\",\"acalmar\",\"acampar\",\"acanhar\",\"acaso\",\"aceitar\",\"acelerar\",\"acenar\",\"acervo\",\"acessar\",\"acetona\",\"achatar\",\"acidez\",\"acima\",\"acionado\",\"acirrar\",\"aclamar\",\"aclive\",\"acolhida\",\"acomodar\",\"acoplar\",\"acordar\",\"acumular\",\"acusador\",\"adaptar\",\"adega\",\"adentro\",\"adepto\",\"adequar\",\"aderente\",\"adesivo\",\"adeus\",\"adiante\",\"aditivo\",\"adjetivo\",\"adjunto\",\"admirar\",\"adorar\",\"adquirir\",\"adubo\",\"adverso\",\"advogado\",\"aeronave\",\"afastar\",\"aferir\",\"afetivo\",\"afinador\",\"afivelar\",\"aflito\",\"afluente\",\"afrontar\",\"agachar\",\"agarrar\",\"agasalho\",\"agenciar\",\"agilizar\",\"agiota\",\"agitado\",\"agora\",\"agradar\",\"agreste\",\"agrupar\",\"aguardar\",\"agulha\",\"ajoelhar\",\"ajudar\",\"ajustar\",\"alameda\",\"alarme\",\"alastrar\",\"alavanca\",\"albergue\",\"albino\",\"alcatra\",\"aldeia\",\"alecrim\",\"alegria\",\"alertar\",\"alface\",\"alfinete\",\"algum\",\"alheio\",\"aliar\",\"alicate\",\"alienar\",\"alinhar\",\"aliviar\",\"almofada\",\"alocar\",\"alpiste\",\"alterar\",\"altitude\",\"alucinar\",\"alugar\",\"aluno\",\"alusivo\",\"alvo\",\"amaciar\",\"amador\",\"amarelo\",\"amassar\",\"ambas\",\"ambiente\",\"ameixa\",\"amenizar\",\"amido\",\"amistoso\",\"amizade\",\"amolador\",\"amontoar\",\"amoroso\",\"amostra\",\"amparar\",\"ampliar\",\"ampola\",\"anagrama\",\"analisar\",\"anarquia\",\"anatomia\",\"andaime\",\"anel\",\"anexo\",\"angular\",\"animar\",\"anjo\",\"anomalia\",\"anotado\",\"ansioso\",\"anterior\",\"anuidade\",\"anunciar\",\"anzol\",\"apagador\",\"apalpar\",\"apanhado\",\"apego\",\"apelido\",\"apertada\",\"apesar\",\"apetite\",\"apito\",\"aplauso\",\"aplicada\",\"apoio\",\"apontar\",\"aposta\",\"aprendiz\",\"aprovar\",\"aquecer\",\"arame\",\"aranha\",\"arara\",\"arcada\",\"ardente\",\"areia\",\"arejar\",\"arenito\",\"aresta\",\"argiloso\",\"argola\",\"arma\",\"arquivo\",\"arraial\",\"arrebate\",\"arriscar\",\"arroba\",\"arrumar\",\"arsenal\",\"arterial\",\"artigo\",\"arvoredo\",\"asfaltar\",\"asilado\",\"aspirar\",\"assador\",\"assinar\",\"assoalho\",\"assunto\",\"astral\",\"atacado\",\"atadura\",\"atalho\",\"atarefar\",\"atear\",\"atender\",\"aterro\",\"ateu\",\"atingir\",\"atirador\",\"ativo\",\"atoleiro\",\"atracar\",\"atrevido\",\"atriz\",\"atual\",\"atum\",\"auditor\",\"aumentar\",\"aura\",\"aurora\",\"autismo\",\"autoria\",\"autuar\",\"avaliar\",\"avante\",\"avaria\",\"avental\",\"avesso\",\"aviador\",\"avisar\",\"avulso\",\"axila\",\"azarar\",\"azedo\",\"azeite\",\"azulejo\",\"babar\",\"babosa\",\"bacalhau\",\"bacharel\",\"bacia\",\"bagagem\",\"baiano\",\"bailar\",\"baioneta\",\"bairro\",\"baixista\",\"bajular\",\"baleia\",\"baliza\",\"balsa\",\"banal\",\"bandeira\",\"banho\",\"banir\",\"banquete\",\"barato\",\"barbado\",\"baronesa\",\"barraca\",\"barulho\",\"baseado\",\"bastante\",\"batata\",\"batedor\",\"batida\",\"batom\",\"batucar\",\"baunilha\",\"beber\",\"beijo\",\"beirada\",\"beisebol\",\"beldade\",\"beleza\",\"belga\",\"beliscar\",\"bendito\",\"bengala\",\"benzer\",\"berimbau\",\"berlinda\",\"berro\",\"besouro\",\"bexiga\",\"bezerro\",\"bico\",\"bicudo\",\"bienal\",\"bifocal\",\"bifurcar\",\"bigorna\",\"bilhete\",\"bimestre\",\"bimotor\",\"biologia\",\"biombo\",\"biosfera\",\"bipolar\",\"birrento\",\"biscoito\",\"bisneto\",\"bispo\",\"bissexto\",\"bitola\",\"bizarro\",\"blindado\",\"bloco\",\"bloquear\",\"boato\",\"bobagem\",\"bocado\",\"bocejo\",\"bochecha\",\"boicotar\",\"bolada\",\"boletim\",\"bolha\",\"bolo\",\"bombeiro\",\"bonde\",\"boneco\",\"bonita\",\"borbulha\",\"borda\",\"boreal\",\"borracha\",\"bovino\",\"boxeador\",\"branco\",\"brasa\",\"braveza\",\"breu\",\"briga\",\"brilho\",\"brincar\",\"broa\",\"brochura\",\"bronzear\",\"broto\",\"bruxo\",\"bucha\",\"budismo\",\"bufar\",\"bule\",\"buraco\",\"busca\",\"busto\",\"buzina\",\"cabana\",\"cabelo\",\"cabide\",\"cabo\",\"cabrito\",\"cacau\",\"cacetada\",\"cachorro\",\"cacique\",\"cadastro\",\"cadeado\",\"cafezal\",\"caiaque\",\"caipira\",\"caixote\",\"cajado\",\"caju\",\"calafrio\",\"calcular\",\"caldeira\",\"calibrar\",\"calmante\",\"calota\",\"camada\",\"cambista\",\"camisa\",\"camomila\",\"campanha\",\"camuflar\",\"canavial\",\"cancelar\",\"caneta\",\"canguru\",\"canhoto\",\"canivete\",\"canoa\",\"cansado\",\"cantar\",\"canudo\",\"capacho\",\"capela\",\"capinar\",\"capotar\",\"capricho\",\"captador\",\"capuz\",\"caracol\",\"carbono\",\"cardeal\",\"careca\",\"carimbar\",\"carneiro\",\"carpete\",\"carreira\",\"cartaz\",\"carvalho\",\"casaco\",\"casca\",\"casebre\",\"castelo\",\"casulo\",\"catarata\",\"cativar\",\"caule\",\"causador\",\"cautelar\",\"cavalo\",\"caverna\",\"cebola\",\"cedilha\",\"cegonha\",\"celebrar\",\"celular\",\"cenoura\",\"censo\",\"centeio\",\"cercar\",\"cerrado\",\"certeiro\",\"cerveja\",\"cetim\",\"cevada\",\"chacota\",\"chaleira\",\"chamado\",\"chapada\",\"charme\",\"chatice\",\"chave\",\"chefe\",\"chegada\",\"cheiro\",\"cheque\",\"chicote\",\"chifre\",\"chinelo\",\"chocalho\",\"chover\",\"chumbo\",\"chutar\",\"chuva\",\"cicatriz\",\"ciclone\",\"cidade\",\"cidreira\",\"ciente\",\"cigana\",\"cimento\",\"cinto\",\"cinza\",\"ciranda\",\"circuito\",\"cirurgia\",\"citar\",\"clareza\",\"clero\",\"clicar\",\"clone\",\"clube\",\"coado\",\"coagir\",\"cobaia\",\"cobertor\",\"cobrar\",\"cocada\",\"coelho\",\"coentro\",\"coeso\",\"cogumelo\",\"coibir\",\"coifa\",\"coiote\",\"colar\",\"coleira\",\"colher\",\"colidir\",\"colmeia\",\"colono\",\"coluna\",\"comando\",\"combinar\",\"comentar\",\"comitiva\",\"comover\",\"complexo\",\"comum\",\"concha\",\"condor\",\"conectar\",\"confuso\",\"congelar\",\"conhecer\",\"conjugar\",\"consumir\",\"contrato\",\"convite\",\"cooperar\",\"copeiro\",\"copiador\",\"copo\",\"coquetel\",\"coragem\",\"cordial\",\"corneta\",\"coronha\",\"corporal\",\"correio\",\"cortejo\",\"coruja\",\"corvo\",\"cosseno\",\"costela\",\"cotonete\",\"couro\",\"couve\",\"covil\",\"cozinha\",\"cratera\",\"cravo\",\"creche\",\"credor\",\"creme\",\"crer\",\"crespo\",\"criada\",\"criminal\",\"crioulo\",\"crise\",\"criticar\",\"crosta\",\"crua\",\"cruzeiro\",\"cubano\",\"cueca\",\"cuidado\",\"cujo\",\"culatra\",\"culminar\",\"culpar\",\"cultura\",\"cumprir\",\"cunhado\",\"cupido\",\"curativo\",\"curral\",\"cursar\",\"curto\",\"cuspir\",\"custear\",\"cutelo\",\"damasco\",\"datar\",\"debater\",\"debitar\",\"deboche\",\"debulhar\",\"decalque\",\"decimal\",\"declive\",\"decote\",\"decretar\",\"dedal\",\"dedicado\",\"deduzir\",\"defesa\",\"defumar\",\"degelo\",\"degrau\",\"degustar\",\"deitado\",\"deixar\",\"delator\",\"delegado\",\"delinear\",\"delonga\",\"demanda\",\"demitir\",\"demolido\",\"dentista\",\"depenado\",\"depilar\",\"depois\",\"depressa\",\"depurar\",\"deriva\",\"derramar\",\"desafio\",\"desbotar\",\"descanso\",\"desenho\",\"desfiado\",\"desgaste\",\"desigual\",\"deslize\",\"desmamar\",\"desova\",\"despesa\",\"destaque\",\"desviar\",\"detalhar\",\"detentor\",\"detonar\",\"detrito\",\"deusa\",\"dever\",\"devido\",\"devotado\",\"dezena\",\"diagrama\",\"dialeto\",\"didata\",\"difuso\",\"digitar\",\"dilatado\",\"diluente\",\"diminuir\",\"dinastia\",\"dinheiro\",\"diocese\",\"direto\",\"discreta\",\"disfarce\",\"disparo\",\"disquete\",\"dissipar\",\"distante\",\"ditador\",\"diurno\",\"diverso\",\"divisor\",\"divulgar\",\"dizer\",\"dobrador\",\"dolorido\",\"domador\",\"dominado\",\"donativo\",\"donzela\",\"dormente\",\"dorsal\",\"dosagem\",\"dourado\",\"doutor\",\"drenagem\",\"drible\",\"drogaria\",\"duelar\",\"duende\",\"dueto\",\"duplo\",\"duquesa\",\"durante\",\"duvidoso\",\"eclodir\",\"ecoar\",\"ecologia\",\"edificar\",\"edital\",\"educado\",\"efeito\",\"efetivar\",\"ejetar\",\"elaborar\",\"eleger\",\"eleitor\",\"elenco\",\"elevador\",\"eliminar\",\"elogiar\",\"embargo\",\"embolado\",\"embrulho\",\"embutido\",\"emenda\",\"emergir\",\"emissor\",\"empatia\",\"empenho\",\"empinado\",\"empolgar\",\"emprego\",\"empurrar\",\"emulador\",\"encaixe\",\"encenado\",\"enchente\",\"encontro\",\"endeusar\",\"endossar\",\"enfaixar\",\"enfeite\",\"enfim\",\"engajado\",\"engenho\",\"englobar\",\"engomado\",\"engraxar\",\"enguia\",\"enjoar\",\"enlatar\",\"enquanto\",\"enraizar\",\"enrolado\",\"enrugar\",\"ensaio\",\"enseada\",\"ensino\",\"ensopado\",\"entanto\",\"enteado\",\"entidade\",\"entortar\",\"entrada\",\"entulho\",\"envergar\",\"enviado\",\"envolver\",\"enxame\",\"enxerto\",\"enxofre\",\"enxuto\",\"epiderme\",\"equipar\",\"ereto\",\"erguido\",\"errata\",\"erva\",\"ervilha\",\"esbanjar\",\"esbelto\",\"escama\",\"escola\",\"escrita\",\"escuta\",\"esfinge\",\"esfolar\",\"esfregar\",\"esfumado\",\"esgrima\",\"esmalte\",\"espanto\",\"espelho\",\"espiga\",\"esponja\",\"espreita\",\"espumar\",\"esquerda\",\"estaca\",\"esteira\",\"esticar\",\"estofado\",\"estrela\",\"estudo\",\"esvaziar\",\"etanol\",\"etiqueta\",\"euforia\",\"europeu\",\"evacuar\",\"evaporar\",\"evasivo\",\"eventual\",\"evidente\",\"evoluir\",\"exagero\",\"exalar\",\"examinar\",\"exato\",\"exausto\",\"excesso\",\"excitar\",\"exclamar\",\"executar\",\"exemplo\",\"exibir\",\"exigente\",\"exonerar\",\"expandir\",\"expelir\",\"expirar\",\"explanar\",\"exposto\",\"expresso\",\"expulsar\",\"externo\",\"extinto\",\"extrato\",\"fabricar\",\"fabuloso\",\"faceta\",\"facial\",\"fada\",\"fadiga\",\"faixa\",\"falar\",\"falta\",\"familiar\",\"fandango\",\"fanfarra\",\"fantoche\",\"fardado\",\"farelo\",\"farinha\",\"farofa\",\"farpa\",\"fartura\",\"fatia\",\"fator\",\"favorita\",\"faxina\",\"fazenda\",\"fechado\",\"feijoada\",\"feirante\",\"felino\",\"feminino\",\"fenda\",\"feno\",\"fera\",\"feriado\",\"ferrugem\",\"ferver\",\"festejar\",\"fetal\",\"feudal\",\"fiapo\",\"fibrose\",\"ficar\",\"ficheiro\",\"figurado\",\"fileira\",\"filho\",\"filme\",\"filtrar\",\"firmeza\",\"fisgada\",\"fissura\",\"fita\",\"fivela\",\"fixador\",\"fixo\",\"flacidez\",\"flamingo\",\"flanela\",\"flechada\",\"flora\",\"flutuar\",\"fluxo\",\"focal\",\"focinho\",\"fofocar\",\"fogo\",\"foguete\",\"foice\",\"folgado\",\"folheto\",\"forjar\",\"formiga\",\"forno\",\"forte\",\"fosco\",\"fossa\",\"fragata\",\"fralda\",\"frango\",\"frasco\",\"fraterno\",\"freira\",\"frente\",\"fretar\",\"frieza\",\"friso\",\"fritura\",\"fronha\",\"frustrar\",\"fruteira\",\"fugir\",\"fulano\",\"fuligem\",\"fundar\",\"fungo\",\"funil\",\"furador\",\"furioso\",\"futebol\",\"gabarito\",\"gabinete\",\"gado\",\"gaiato\",\"gaiola\",\"gaivota\",\"galega\",\"galho\",\"galinha\",\"galocha\",\"ganhar\",\"garagem\",\"garfo\",\"gargalo\",\"garimpo\",\"garoupa\",\"garrafa\",\"gasoduto\",\"gasto\",\"gata\",\"gatilho\",\"gaveta\",\"gazela\",\"gelado\",\"geleia\",\"gelo\",\"gemada\",\"gemer\",\"gemido\",\"generoso\",\"gengiva\",\"genial\",\"genoma\",\"genro\",\"geologia\",\"gerador\",\"germinar\",\"gesso\",\"gestor\",\"ginasta\",\"gincana\",\"gingado\",\"girafa\",\"girino\",\"glacial\",\"glicose\",\"global\",\"glorioso\",\"goela\",\"goiaba\",\"golfe\",\"golpear\",\"gordura\",\"gorjeta\",\"gorro\",\"gostoso\",\"goteira\",\"governar\",\"gracejo\",\"gradual\",\"grafite\",\"gralha\",\"grampo\",\"granada\",\"gratuito\",\"graveto\",\"graxa\",\"grego\",\"grelhar\",\"greve\",\"grilo\",\"grisalho\",\"gritaria\",\"grosso\",\"grotesco\",\"grudado\",\"grunhido\",\"gruta\",\"guache\",\"guarani\",\"guaxinim\",\"guerrear\",\"guiar\",\"guincho\",\"guisado\",\"gula\",\"guloso\",\"guru\",\"habitar\",\"harmonia\",\"haste\",\"haver\",\"hectare\",\"herdar\",\"heresia\",\"hesitar\",\"hiato\",\"hibernar\",\"hidratar\",\"hiena\",\"hino\",\"hipismo\",\"hipnose\",\"hipoteca\",\"hoje\",\"holofote\",\"homem\",\"honesto\",\"honrado\",\"hormonal\",\"hospedar\",\"humorado\",\"iate\",\"ideia\",\"idoso\",\"ignorado\",\"igreja\",\"iguana\",\"ileso\",\"ilha\",\"iludido\",\"iluminar\",\"ilustrar\",\"imagem\",\"imediato\",\"imenso\",\"imersivo\",\"iminente\",\"imitador\",\"imortal\",\"impacto\",\"impedir\",\"implante\",\"impor\",\"imprensa\",\"impune\",\"imunizar\",\"inalador\",\"inapto\",\"inativo\",\"incenso\",\"inchar\",\"incidir\",\"incluir\",\"incolor\",\"indeciso\",\"indireto\",\"indutor\",\"ineficaz\",\"inerente\",\"infantil\",\"infestar\",\"infinito\",\"inflamar\",\"informal\",\"infrator\",\"ingerir\",\"inibido\",\"inicial\",\"inimigo\",\"injetar\",\"inocente\",\"inodoro\",\"inovador\",\"inox\",\"inquieto\",\"inscrito\",\"inseto\",\"insistir\",\"inspetor\",\"instalar\",\"insulto\",\"intacto\",\"integral\",\"intimar\",\"intocado\",\"intriga\",\"invasor\",\"inverno\",\"invicto\",\"invocar\",\"iogurte\",\"iraniano\",\"ironizar\",\"irreal\",\"irritado\",\"isca\",\"isento\",\"isolado\",\"isqueiro\",\"italiano\",\"janeiro\",\"jangada\",\"janta\",\"jararaca\",\"jardim\",\"jarro\",\"jasmim\",\"jato\",\"javali\",\"jazida\",\"jejum\",\"joaninha\",\"joelhada\",\"jogador\",\"joia\",\"jornal\",\"jorrar\",\"jovem\",\"juba\",\"judeu\",\"judoca\",\"juiz\",\"julgador\",\"julho\",\"jurado\",\"jurista\",\"juro\",\"justa\",\"labareda\",\"laboral\",\"lacre\",\"lactante\",\"ladrilho\",\"lagarta\",\"lagoa\",\"laje\",\"lamber\",\"lamentar\",\"laminar\",\"lampejo\",\"lanche\",\"lapidar\",\"lapso\",\"laranja\",\"lareira\",\"largura\",\"lasanha\",\"lastro\",\"lateral\",\"latido\",\"lavanda\",\"lavoura\",\"lavrador\",\"laxante\",\"lazer\",\"lealdade\",\"lebre\",\"legado\",\"legendar\",\"legista\",\"leigo\",\"leiloar\",\"leitura\",\"lembrete\",\"leme\",\"lenhador\",\"lentilha\",\"leoa\",\"lesma\",\"leste\",\"letivo\",\"letreiro\",\"levar\",\"leveza\",\"levitar\",\"liberal\",\"libido\",\"liderar\",\"ligar\",\"ligeiro\",\"limitar\",\"limoeiro\",\"limpador\",\"linda\",\"linear\",\"linhagem\",\"liquidez\",\"listagem\",\"lisura\",\"litoral\",\"livro\",\"lixa\",\"lixeira\",\"locador\",\"locutor\",\"lojista\",\"lombo\",\"lona\",\"longe\",\"lontra\",\"lorde\",\"lotado\",\"loteria\",\"loucura\",\"lousa\",\"louvar\",\"luar\",\"lucidez\",\"lucro\",\"luneta\",\"lustre\",\"lutador\",\"luva\",\"macaco\",\"macete\",\"machado\",\"macio\",\"madeira\",\"madrinha\",\"magnata\",\"magreza\",\"maior\",\"mais\",\"malandro\",\"malha\",\"malote\",\"maluco\",\"mamilo\",\"mamoeiro\",\"mamute\",\"manada\",\"mancha\",\"mandato\",\"manequim\",\"manhoso\",\"manivela\",\"manobrar\",\"mansa\",\"manter\",\"manusear\",\"mapeado\",\"maquinar\",\"marcador\",\"maresia\",\"marfim\",\"margem\",\"marinho\",\"marmita\",\"maroto\",\"marquise\",\"marreco\",\"martelo\",\"marujo\",\"mascote\",\"masmorra\",\"massagem\",\"mastigar\",\"matagal\",\"materno\",\"matinal\",\"matutar\",\"maxilar\",\"medalha\",\"medida\",\"medusa\",\"megafone\",\"meiga\",\"melancia\",\"melhor\",\"membro\",\"memorial\",\"menino\",\"menos\",\"mensagem\",\"mental\",\"merecer\",\"mergulho\",\"mesada\",\"mesclar\",\"mesmo\",\"mesquita\",\"mestre\",\"metade\",\"meteoro\",\"metragem\",\"mexer\",\"mexicano\",\"micro\",\"migalha\",\"migrar\",\"milagre\",\"milenar\",\"milhar\",\"mimado\",\"minerar\",\"minhoca\",\"ministro\",\"minoria\",\"miolo\",\"mirante\",\"mirtilo\",\"misturar\",\"mocidade\",\"moderno\",\"modular\",\"moeda\",\"moer\",\"moinho\",\"moita\",\"moldura\",\"moleza\",\"molho\",\"molinete\",\"molusco\",\"montanha\",\"moqueca\",\"morango\",\"morcego\",\"mordomo\",\"morena\",\"mosaico\",\"mosquete\",\"mostarda\",\"motel\",\"motim\",\"moto\",\"motriz\",\"muda\",\"muito\",\"mulata\",\"mulher\",\"multar\",\"mundial\",\"munido\",\"muralha\",\"murcho\",\"muscular\",\"museu\",\"musical\",\"nacional\",\"nadador\",\"naja\",\"namoro\",\"narina\",\"narrado\",\"nascer\",\"nativa\",\"natureza\",\"navalha\",\"navegar\",\"navio\",\"neblina\",\"nebuloso\",\"negativa\",\"negociar\",\"negrito\",\"nervoso\",\"neta\",\"neural\",\"nevasca\",\"nevoeiro\",\"ninar\",\"ninho\",\"nitidez\",\"nivelar\",\"nobreza\",\"noite\",\"noiva\",\"nomear\",\"nominal\",\"nordeste\",\"nortear\",\"notar\",\"noticiar\",\"noturno\",\"novelo\",\"novilho\",\"novo\",\"nublado\",\"nudez\",\"numeral\",\"nupcial\",\"nutrir\",\"nuvem\",\"obcecado\",\"obedecer\",\"objetivo\",\"obrigado\",\"obscuro\",\"obstetra\",\"obter\",\"obturar\",\"ocidente\",\"ocioso\",\"ocorrer\",\"oculista\",\"ocupado\",\"ofegante\",\"ofensiva\",\"oferenda\",\"oficina\",\"ofuscado\",\"ogiva\",\"olaria\",\"oleoso\",\"olhar\",\"oliveira\",\"ombro\",\"omelete\",\"omisso\",\"omitir\",\"ondulado\",\"oneroso\",\"ontem\",\"opcional\",\"operador\",\"oponente\",\"oportuno\",\"oposto\",\"orar\",\"orbitar\",\"ordem\",\"ordinal\",\"orfanato\",\"orgasmo\",\"orgulho\",\"oriental\",\"origem\",\"oriundo\",\"orla\",\"ortodoxo\",\"orvalho\",\"oscilar\",\"ossada\",\"osso\",\"ostentar\",\"otimismo\",\"ousadia\",\"outono\",\"outubro\",\"ouvido\",\"ovelha\",\"ovular\",\"oxidar\",\"oxigenar\",\"pacato\",\"paciente\",\"pacote\",\"pactuar\",\"padaria\",\"padrinho\",\"pagar\",\"pagode\",\"painel\",\"pairar\",\"paisagem\",\"palavra\",\"palestra\",\"palheta\",\"palito\",\"palmada\",\"palpitar\",\"pancada\",\"panela\",\"panfleto\",\"panqueca\",\"pantanal\",\"papagaio\",\"papelada\",\"papiro\",\"parafina\",\"parcial\",\"pardal\",\"parede\",\"partida\",\"pasmo\",\"passado\",\"pastel\",\"patamar\",\"patente\",\"patinar\",\"patrono\",\"paulada\",\"pausar\",\"peculiar\",\"pedalar\",\"pedestre\",\"pediatra\",\"pedra\",\"pegada\",\"peitoral\",\"peixe\",\"pele\",\"pelicano\",\"penca\",\"pendurar\",\"peneira\",\"penhasco\",\"pensador\",\"pente\",\"perceber\",\"perfeito\",\"pergunta\",\"perito\",\"permitir\",\"perna\",\"perplexo\",\"persiana\",\"pertence\",\"peruca\",\"pescado\",\"pesquisa\",\"pessoa\",\"petiscar\",\"piada\",\"picado\",\"piedade\",\"pigmento\",\"pilastra\",\"pilhado\",\"pilotar\",\"pimenta\",\"pincel\",\"pinguim\",\"pinha\",\"pinote\",\"pintar\",\"pioneiro\",\"pipoca\",\"piquete\",\"piranha\",\"pires\",\"pirueta\",\"piscar\",\"pistola\",\"pitanga\",\"pivete\",\"planta\",\"plaqueta\",\"platina\",\"plebeu\",\"plumagem\",\"pluvial\",\"pneu\",\"poda\",\"poeira\",\"poetisa\",\"polegada\",\"policiar\",\"poluente\",\"polvilho\",\"pomar\",\"pomba\",\"ponderar\",\"pontaria\",\"populoso\",\"porta\",\"possuir\",\"postal\",\"pote\",\"poupar\",\"pouso\",\"povoar\",\"praia\",\"prancha\",\"prato\",\"praxe\",\"prece\",\"predador\",\"prefeito\",\"premiar\",\"prensar\",\"preparar\",\"presilha\",\"pretexto\",\"prevenir\",\"prezar\",\"primata\",\"princesa\",\"prisma\",\"privado\",\"processo\",\"produto\",\"profeta\",\"proibido\",\"projeto\",\"prometer\",\"propagar\",\"prosa\",\"protetor\",\"provador\",\"publicar\",\"pudim\",\"pular\",\"pulmonar\",\"pulseira\",\"punhal\",\"punir\",\"pupilo\",\"pureza\",\"puxador\",\"quadra\",\"quantia\",\"quarto\",\"quase\",\"quebrar\",\"queda\",\"queijo\",\"quente\",\"querido\",\"quimono\",\"quina\",\"quiosque\",\"rabanada\",\"rabisco\",\"rachar\",\"racionar\",\"radial\",\"raiar\",\"rainha\",\"raio\",\"raiva\",\"rajada\",\"ralado\",\"ramal\",\"ranger\",\"ranhura\",\"rapadura\",\"rapel\",\"rapidez\",\"raposa\",\"raquete\",\"raridade\",\"rasante\",\"rascunho\",\"rasgar\",\"raspador\",\"rasteira\",\"rasurar\",\"ratazana\",\"ratoeira\",\"realeza\",\"reanimar\",\"reaver\",\"rebaixar\",\"rebelde\",\"rebolar\",\"recado\",\"recente\",\"recheio\",\"recibo\",\"recordar\",\"recrutar\",\"recuar\",\"rede\",\"redimir\",\"redonda\",\"reduzida\",\"reenvio\",\"refinar\",\"refletir\",\"refogar\",\"refresco\",\"refugiar\",\"regalia\",\"regime\",\"regra\",\"reinado\",\"reitor\",\"rejeitar\",\"relativo\",\"remador\",\"remendo\",\"remorso\",\"renovado\",\"reparo\",\"repelir\",\"repleto\",\"repolho\",\"represa\",\"repudiar\",\"requerer\",\"resenha\",\"resfriar\",\"resgatar\",\"residir\",\"resolver\",\"respeito\",\"ressaca\",\"restante\",\"resumir\",\"retalho\",\"reter\",\"retirar\",\"retomada\",\"retratar\",\"revelar\",\"revisor\",\"revolta\",\"riacho\",\"rica\",\"rigidez\",\"rigoroso\",\"rimar\",\"ringue\",\"risada\",\"risco\",\"risonho\",\"robalo\",\"rochedo\",\"rodada\",\"rodeio\",\"rodovia\",\"roedor\",\"roleta\",\"romano\",\"roncar\",\"rosado\",\"roseira\",\"rosto\",\"rota\",\"roteiro\",\"rotina\",\"rotular\",\"rouco\",\"roupa\",\"roxo\",\"rubro\",\"rugido\",\"rugoso\",\"ruivo\",\"rumo\",\"rupestre\",\"russo\",\"sabor\",\"saciar\",\"sacola\",\"sacudir\",\"sadio\",\"safira\",\"saga\",\"sagrada\",\"saibro\",\"salada\",\"saleiro\",\"salgado\",\"saliva\",\"salpicar\",\"salsicha\",\"saltar\",\"salvador\",\"sambar\",\"samurai\",\"sanar\",\"sanfona\",\"sangue\",\"sanidade\",\"sapato\",\"sarda\",\"sargento\",\"sarjeta\",\"saturar\",\"saudade\",\"saxofone\",\"sazonal\",\"secar\",\"secular\",\"seda\",\"sedento\",\"sediado\",\"sedoso\",\"sedutor\",\"segmento\",\"segredo\",\"segundo\",\"seiva\",\"seleto\",\"selvagem\",\"semanal\",\"semente\",\"senador\",\"senhor\",\"sensual\",\"sentado\",\"separado\",\"sereia\",\"seringa\",\"serra\",\"servo\",\"setembro\",\"setor\",\"sigilo\",\"silhueta\",\"silicone\",\"simetria\",\"simpatia\",\"simular\",\"sinal\",\"sincero\",\"singular\",\"sinopse\",\"sintonia\",\"sirene\",\"siri\",\"situado\",\"soberano\",\"sobra\",\"socorro\",\"sogro\",\"soja\",\"solda\",\"soletrar\",\"solteiro\",\"sombrio\",\"sonata\",\"sondar\",\"sonegar\",\"sonhador\",\"sono\",\"soprano\",\"soquete\",\"sorrir\",\"sorteio\",\"sossego\",\"sotaque\",\"soterrar\",\"sovado\",\"sozinho\",\"suavizar\",\"subida\",\"submerso\",\"subsolo\",\"subtrair\",\"sucata\",\"sucesso\",\"suco\",\"sudeste\",\"sufixo\",\"sugador\",\"sugerir\",\"sujeito\",\"sulfato\",\"sumir\",\"suor\",\"superior\",\"suplicar\",\"suposto\",\"suprimir\",\"surdina\",\"surfista\",\"surpresa\",\"surreal\",\"surtir\",\"suspiro\",\"sustento\",\"tabela\",\"tablete\",\"tabuada\",\"tacho\",\"tagarela\",\"talher\",\"talo\",\"talvez\",\"tamanho\",\"tamborim\",\"tampa\",\"tangente\",\"tanto\",\"tapar\",\"tapioca\",\"tardio\",\"tarefa\",\"tarja\",\"tarraxa\",\"tatuagem\",\"taurino\",\"taxativo\",\"taxista\",\"teatral\",\"tecer\",\"tecido\",\"teclado\",\"tedioso\",\"teia\",\"teimar\",\"telefone\",\"telhado\",\"tempero\",\"tenente\",\"tensor\",\"tentar\",\"termal\",\"terno\",\"terreno\",\"tese\",\"tesoura\",\"testado\",\"teto\",\"textura\",\"texugo\",\"tiara\",\"tigela\",\"tijolo\",\"timbrar\",\"timidez\",\"tingido\",\"tinteiro\",\"tiragem\",\"titular\",\"toalha\",\"tocha\",\"tolerar\",\"tolice\",\"tomada\",\"tomilho\",\"tonel\",\"tontura\",\"topete\",\"tora\",\"torcido\",\"torneio\",\"torque\",\"torrada\",\"torto\",\"tostar\",\"touca\",\"toupeira\",\"toxina\",\"trabalho\",\"tracejar\",\"tradutor\",\"trafegar\",\"trajeto\",\"trama\",\"trancar\",\"trapo\",\"traseiro\",\"tratador\",\"travar\",\"treino\",\"tremer\",\"trepidar\",\"trevo\",\"triagem\",\"tribo\",\"triciclo\",\"tridente\",\"trilogia\",\"trindade\",\"triplo\",\"triturar\",\"triunfal\",\"trocar\",\"trombeta\",\"trova\",\"trunfo\",\"truque\",\"tubular\",\"tucano\",\"tudo\",\"tulipa\",\"tupi\",\"turbo\",\"turma\",\"turquesa\",\"tutelar\",\"tutorial\",\"uivar\",\"umbigo\",\"unha\",\"unidade\",\"uniforme\",\"urologia\",\"urso\",\"urtiga\",\"urubu\",\"usado\",\"usina\",\"usufruir\",\"vacina\",\"vadiar\",\"vagaroso\",\"vaidoso\",\"vala\",\"valente\",\"validade\",\"valores\",\"vantagem\",\"vaqueiro\",\"varanda\",\"vareta\",\"varrer\",\"vascular\",\"vasilha\",\"vassoura\",\"vazar\",\"vazio\",\"veado\",\"vedar\",\"vegetar\",\"veicular\",\"veleiro\",\"velhice\",\"veludo\",\"vencedor\",\"vendaval\",\"venerar\",\"ventre\",\"verbal\",\"verdade\",\"vereador\",\"vergonha\",\"vermelho\",\"verniz\",\"versar\",\"vertente\",\"vespa\",\"vestido\",\"vetorial\",\"viaduto\",\"viagem\",\"viajar\",\"viatura\",\"vibrador\",\"videira\",\"vidraria\",\"viela\",\"viga\",\"vigente\",\"vigiar\",\"vigorar\",\"vilarejo\",\"vinco\",\"vinheta\",\"vinil\",\"violeta\",\"virada\",\"virtude\",\"visitar\",\"visto\",\"vitral\",\"viveiro\",\"vizinho\",\"voador\",\"voar\",\"vogal\",\"volante\",\"voleibol\",\"voltagem\",\"volumoso\",\"vontade\",\"vulto\",\"vuvuzela\",\"xadrez\",\"xarope\",\"xeque\",\"xeretar\",\"xerife\",\"xingar\",\"zangado\",\"zarpar\",\"zebu\",\"zelador\",\"zombar\",\"zoologia\",\"zumbido\"][\"абзац\",\"абонент\",\"абсурд\",\"авангард\",\"авария\",\"август\",\"авиация\",\"автор\",\"агент\",\"агитация\",\"агрегат\",\"адвокат\",\"адмирал\",\"адрес\",\"азарт\",\"азот\",\"академия\",\"аквариум\",\"аксиома\",\"акула\",\"акцент\",\"акция\",\"аллея\",\"алмаз\",\"алтарь\",\"альбом\",\"альянс\",\"амбиция\",\"анализ\",\"анекдот\",\"анкета\",\"ансамбль\",\"антенна\",\"апельсин\",\"аппарат\",\"аппетит\",\"апрель\",\"аптека\",\"арбуз\",\"аргумент\",\"аренда\",\"арест\",\"армия\",\"аромат\",\"арсенал\",\"артерия\",\"артист\",\"архив\",\"аспирант\",\"асфальт\",\"атака\",\"атомный\",\"атрибут\",\"аукцион\",\"афиша\",\"аэропорт\",\"бабочка\",\"бабушка\",\"багаж\",\"база\",\"бактерия\",\"баланс\",\"балерина\",\"балкон\",\"бандит\",\"банк\",\"барабан\",\"барон\",\"барышня\",\"барьер\",\"бассейн\",\"батарея\",\"башмак\",\"башня\",\"бедный\",\"беженец\",\"бездна\",\"белка\",\"белый\",\"бензин\",\"берег\",\"беседа\",\"бешеный\",\"билет\",\"бинокль\",\"биржа\",\"битва\",\"благо\",\"блеск\",\"близкий\",\"блин\",\"блок\",\"блюдо\",\"богатый\",\"бодрый\",\"боец\",\"бокал\",\"боковой\",\"бокс\",\"более\",\"болото\",\"болтать\",\"большой\",\"бомба\",\"борт\",\"борьба\",\"босой\",\"ботинок\",\"бояться\",\"брак\",\"брать\",\"бревно\",\"бред\",\"бригада\",\"бродяга\",\"броня\",\"бросить\",\"брызги\",\"брюки\",\"брюхо\",\"бугор\",\"будка\",\"будни\",\"будущее\",\"буква\",\"букет\",\"бульвар\",\"бумага\",\"бунт\",\"бурный\",\"буря\",\"бутылка\",\"бухта\",\"бывший\",\"быстро\",\"бытовой\",\"быть\",\"бюджет\",\"бюро\",\"бюст\",\"вагон\",\"важный\",\"вакцина\",\"валенок\",\"вальс\",\"валюта\",\"ванная\",\"варенье\",\"вариант\",\"вблизи\",\"вверх\",\"вводить\",\"вдали\",\"вдвое\",\"вдова\",\"вдоль\",\"вдруг\",\"ведро\",\"ведущий\",\"ведьма\",\"вежливо\",\"везде\",\"веко\",\"вексель\",\"велеть\",\"великий\",\"венец\",\"веник\",\"веранда\",\"верблюд\",\"верить\",\"верный\",\"версия\",\"вертеть\",\"верхний\",\"вершина\",\"весело\",\"весна\",\"весомый\",\"вести\",\"весь\",\"ветеран\",\"ветхий\",\"вечер\",\"вечно\",\"вешалка\",\"вещество\",\"взамен\",\"взгляд\",\"вздох\",\"взнос\",\"взойти\",\"взор\",\"взрыв\",\"взять\",\"видеть\",\"видимо\",\"визг\",\"визит\",\"вилка\",\"вина\",\"вирус\",\"висок\",\"витамин\",\"витрина\",\"вихрь\",\"вишня\",\"вкус\",\"влага\",\"владелец\",\"власть\",\"влево\",\"влияние\",\"вложить\",\"вместе\",\"внешний\",\"вникать\",\"внимание\",\"вновь\",\"внук\",\"внутри\",\"внучка\",\"внушать\",\"вовлечь\",\"вовремя\",\"вовсю\",\"вода\",\"водород\",\"водяной\",\"воевать\",\"возврат\",\"возглас\",\"воздух\",\"возить\",\"возле\",\"возня\",\"возраст\",\"война\",\"войско\",\"вокзал\",\"волос\",\"волчий\",\"вольный\",\"воля\",\"вообще\",\"вопль\",\"вопрос\",\"ворота\",\"восемь\",\"восток\",\"вплоть\",\"вполне\",\"вправе\",\"впредь\",\"впрочем\",\"врач\",\"вредный\",\"время\",\"вручить\",\"всадник\",\"всегда\",\"вскоре\",\"вскрыть\",\"всплеск\",\"вспышка\",\"встреча\",\"всюду\",\"всякий\",\"второй\",\"вход\",\"вчера\",\"выбор\",\"вывод\",\"выгнать\",\"выдать\",\"выехать\",\"вызов\",\"выйти\",\"выкуп\",\"вылезти\",\"вымыть\",\"выпасть\",\"выпить\",\"выплата\",\"выпуск\",\"вырасти\",\"выручка\",\"выслать\",\"высокий\",\"выставка\",\"вышка\",\"вязать\",\"вялый\",\"газета\",\"газовый\",\"галерея\",\"галстук\",\"гамма\",\"гарантия\",\"гармония\",\"гарнизон\",\"гастроли\",\"гвардия\",\"гвоздь\",\"гектар\",\"генерал\",\"гений\",\"геном\",\"геолог\",\"герб\",\"герой\",\"гибкий\",\"гигант\",\"гимн\",\"гипотеза\",\"гитара\",\"главный\",\"глагол\",\"гладить\",\"глаз\",\"глина\",\"глоток\",\"глубокий\",\"глупый\",\"глухой\",\"глыба\",\"глядеть\",\"гнев\",\"гнездо\",\"гнилой\",\"годовой\",\"голова\",\"голубой\",\"голый\",\"гонорар\",\"гордость\",\"горизонт\",\"горло\",\"горный\",\"город\",\"горшок\",\"горький\",\"горючее\",\"горячий\",\"готовый\",\"градус\",\"грамм\",\"граница\",\"граф\",\"гребень\",\"гриб\",\"гримаса\",\"грозить\",\"грохот\",\"грош\",\"грубый\",\"грудь\",\"груз\",\"грунт\",\"группа\",\"груша\",\"грязный\",\"губа\",\"гудок\",\"гулкий\",\"гулять\",\"гусеница\",\"густо\",\"гусь\",\"давление\",\"давно\",\"даже\",\"дальний\",\"данный\",\"дарить\",\"датчик\",\"дать\",\"дача\",\"двадцать\",\"дважды\",\"дверь\",\"двигать\",\"движение\",\"двойной\",\"двор\",\"дебют\",\"девятый\",\"дежурный\",\"действие\",\"декабрь\",\"деление\",\"дело\",\"дельфин\",\"день\",\"дерево\",\"держать\",\"дерзкий\",\"десять\",\"деталь\",\"детский\",\"дефект\",\"дефицит\",\"деятель\",\"джаз\",\"джинсы\",\"джунгли\",\"диагноз\",\"диалог\",\"диапазон\",\"диван\",\"дивизия\",\"дивный\",\"диета\",\"дизайн\",\"дикарь\",\"дилер\",\"динамика\",\"диплом\",\"директор\",\"дитя\",\"длинный\",\"дневник\",\"добрый\",\"добыча\",\"доверие\",\"догадка\",\"догнать\",\"дождь\",\"доклад\",\"доктор\",\"документ\",\"долго\",\"должен\",\"долина\",\"донос\",\"дорога\",\"досада\",\"доска\",\"достать\",\"досуг\",\"доход\",\"доцент\",\"дощатый\",\"драка\",\"древний\",\"дремать\",\"дробный\",\"дрова\",\"дрожать\",\"другой\",\"дружба\",\"дубовый\",\"дуга\",\"думать\",\"дурной\",\"духи\",\"душный\",\"дуэль\",\"дуэт\",\"дыра\",\"дыхание\",\"дюжина\",\"дядя\",\"едва\",\"единый\",\"ерунда\",\"если\",\"ехать\",\"жадный\",\"жажда\",\"жалеть\",\"жалоба\",\"жанр\",\"жареный\",\"жаркий\",\"жгучий\",\"жевать\",\"желание\",\"желудок\",\"жена\",\"женщина\",\"жертва\",\"жест\",\"жидкость\",\"житель\",\"жить\",\"жрец\",\"жулик\",\"журнал\",\"жуткий\",\"забрать\",\"забыть\",\"завести\",\"завод\",\"завтра\",\"загадка\",\"загнать\",\"заговор\",\"задача\",\"задеть\",\"задний\",\"задолго\",\"заехать\",\"заказ\",\"закон\",\"закрыть\",\"закуска\",\"залезть\",\"залить\",\"залп\",\"замок\",\"замуж\",\"замысел\",\"занавес\",\"заново\",\"занять\",\"заодно\",\"запись\",\"запрос\",\"запуск\",\"запястье\",\"заранее\",\"заросль\",\"зарплата\",\"заря\",\"засада\",\"заслуга\",\"заснуть\",\"застать\",\"затвор\",\"затеять\",\"затрата\",\"затылок\",\"захват\",\"зачем\",\"защита\",\"заявить\",\"заяц\",\"звезда\",\"звено\",\"звонить\",\"здесь\",\"зелень\",\"земля\",\"зеркало\",\"зерно\",\"зима\",\"злой\",\"змея\",\"знамя\",\"знание\",\"значит\",\"золотой\",\"зона\",\"зонтик\",\"зоопарк\",\"зрачок\",\"зрение\",\"зритель\",\"зубной\",\"зубр\",\"игла\",\"идеал\",\"идеолог\",\"идея\",\"идол\",\"идти\",\"изба\",\"избить\",\"избрать\",\"избыток\",\"извлечь\",\"извне\",\"изгиб\",\"изгнать\",\"издание\",\"изделие\",\"изнутри\",\"изобилие\",\"изоляция\",\"изредка\",\"изрядно\",\"изучение\",\"изъять\",\"изящный\",\"икона\",\"икра\",\"иллюзия\",\"именно\",\"иметь\",\"имидж\",\"империя\",\"импульс\",\"иначе\",\"инвалид\",\"индекс\",\"индивид\",\"инерция\",\"инженер\",\"иногда\",\"иной\",\"институт\",\"интерес\",\"интрига\",\"интуиция\",\"инфаркт\",\"инцидент\",\"ирония\",\"искать\",\"испуг\",\"история\",\"итог\",\"июнь\",\"кабель\",\"кабинет\",\"каблук\",\"кавалер\",\"кадр\",\"каждый\",\"кажется\",\"казино\",\"калитка\",\"камень\",\"камин\",\"канал\",\"кандидат\",\"каникулы\",\"канон\",\"капитан\",\"капля\",\"капот\",\"капуста\",\"карандаш\",\"карета\",\"каркас\",\"карман\",\"картина\",\"карьера\",\"каска\",\"кассета\",\"кастрюля\",\"каталог\",\"катер\",\"каток\",\"катушка\",\"кафедра\",\"качество\",\"каша\",\"кашлять\",\"каюта\",\"квадрат\",\"квартира\",\"квота\",\"кепка\",\"кивнуть\",\"километр\",\"кино\",\"киоск\",\"кипяток\",\"кирпич\",\"кислота\",\"кисть\",\"клавиша\",\"клапан\",\"класс\",\"клей\",\"клетка\",\"клиент\",\"климат\",\"клиника\",\"кличка\",\"клоун\",\"клочок\",\"клуб\",\"клумба\",\"ключ\",\"книга\",\"кнопка\",\"кнут\",\"княгиня\",\"князь\",\"кобура\",\"когда\",\"кодекс\",\"кожа\",\"коктейль\",\"колено\",\"коллега\",\"колонна\",\"колпак\",\"кольцо\",\"колючий\",\"коляска\",\"команда\",\"комедия\",\"комиссия\",\"коммуна\",\"комната\",\"комок\",\"компания\",\"комфорт\",\"конвейер\",\"конгресс\",\"конечно\",\"конкурс\",\"контроль\",\"концерт\",\"конь\",\"конюшня\",\"копать\",\"копейка\",\"копыто\",\"корабль\",\"корень\",\"корзина\",\"коридор\",\"кормить\",\"корпус\",\"космос\",\"костюм\",\"косяк\",\"котел\",\"котлета\",\"который\",\"коттедж\",\"кофе\",\"кофта\",\"кошка\",\"кража\",\"край\",\"красный\",\"краткий\",\"кредит\",\"крем\",\"крепкий\",\"кресло\",\"кривой\",\"кризис\",\"кристалл\",\"критерий\",\"кричать\",\"кровь\",\"крокодил\",\"кролик\",\"кроме\",\"крона\",\"круг\",\"кружка\",\"крупный\",\"крутой\",\"крушение\",\"крыло\",\"крыша\",\"крючок\",\"кстати\",\"кубик\",\"куда\",\"кузов\",\"кукла\",\"кулак\",\"кулиса\",\"культура\",\"кумир\",\"купе\",\"купить\",\"купол\",\"купюра\",\"курица\",\"курорт\",\"курс\",\"куртка\",\"кусок\",\"куст\",\"кухня\",\"кушать\",\"лабиринт\",\"лавка\",\"лагерь\",\"ладно\",\"ладонь\",\"лапа\",\"лауреат\",\"лгать\",\"лебедь\",\"левый\",\"легенда\",\"легкий\",\"ледяной\",\"лежать\",\"лезвие\",\"лезть\",\"лекция\",\"ленивый\",\"лента\",\"лепесток\",\"лесной\",\"лестница\",\"лететь\",\"лето\",\"лечить\",\"лига\",\"лидер\",\"лиловый\",\"лимон\",\"линия\",\"липкий\",\"лист\",\"литр\",\"лихой\",\"лицо\",\"лишить\",\"лишний\",\"ловить\",\"логика\",\"лодка\",\"ложь\",\"лозунг\",\"локоть\",\"лопата\",\"лошадь\",\"лукавый\",\"луна\",\"лучший\",\"лысый\",\"льгота\",\"любить\",\"любой\",\"людской\",\"люстра\",\"лютый\",\"лягушка\",\"магазин\",\"магия\",\"майор\",\"майский\",\"максимум\",\"макушка\",\"мало\",\"мальчик\",\"мама\",\"манера\",\"марка\",\"март\",\"маршрут\",\"масса\",\"мастер\",\"масштаб\",\"материал\",\"матч\",\"махать\",\"машина\",\"маяк\",\"мебель\",\"медаль\",\"медведь\",\"медицина\",\"медь\",\"между\",\"мелкий\",\"мелочь\",\"мемуары\",\"меньше\",\"меню\",\"менять\",\"мера\",\"мерцать\",\"место\",\"месяц\",\"металл\",\"метод\",\"метр\",\"механизм\",\"меховой\",\"мечтать\",\"мешать\",\"мешок\",\"миграция\",\"микрофон\",\"милиция\",\"миллион\",\"милость\",\"миля\",\"мимо\",\"минерал\",\"министр\",\"минута\",\"мирный\",\"миска\",\"миссия\",\"митинг\",\"мишень\",\"младший\",\"мнение\",\"мнимый\",\"много\",\"могучий\",\"модель\",\"может\",\"мозг\",\"мокрый\",\"молекула\",\"молния\",\"молодой\",\"молчать\",\"момент\",\"монета\",\"монитор\",\"монолог\",\"монстр\",\"монтаж\",\"мораль\",\"море\",\"морковь\",\"мороз\",\"морщина\",\"мостовая\",\"мотать\",\"мотив\",\"мотор\",\"мохнатый\",\"мрамор\",\"мрачный\",\"мстить\",\"мудрый\",\"мужество\",\"мужчина\",\"музей\",\"музыка\",\"мундир\",\"муравей\",\"мусор\",\"муха\",\"мчаться\",\"мысль\",\"мыться\",\"мышца\",\"мышь\",\"мюзикл\",\"мягкий\",\"мясо\",\"набор\",\"навык\",\"наглый\",\"нагрузка\",\"надежда\",\"надзор\",\"надо\",\"наедине\",\"назад\",\"название\",\"назло\",\"наивный\",\"найти\",\"наконец\",\"налево\",\"наличие\",\"налог\",\"намерен\",\"нанести\",\"напасть\",\"например\",\"народ\",\"наследие\",\"натура\",\"наука\",\"наутро\",\"начать\",\"небо\",\"неважно\",\"невеста\",\"негодяй\",\"недавно\",\"неделя\",\"недолго\",\"недра\",\"недуг\",\"нежный\",\"незачем\",\"некто\",\"нелепый\",\"неловко\",\"нельзя\",\"немало\",\"немой\",\"неплохо\",\"нервный\",\"нередко\",\"нестись\",\"неудача\",\"неужели\",\"нефть\",\"неясный\",\"нигде\",\"низкий\",\"никакой\",\"никогда\",\"никуда\",\"ничто\",\"ничуть\",\"ниша\",\"нищий\",\"новость\",\"новый\",\"нога\",\"ноготь\",\"ножницы\",\"ноздря\",\"номер\",\"носить\",\"носок\",\"ночь\",\"ноябрь\",\"нрав\",\"нуль\",\"нынче\",\"нырять\",\"нюанс\",\"няня\",\"обаяние\",\"обед\",\"обезьяна\",\"обещать\",\"обжечь\",\"обзор\",\"обилие\",\"обитать\",\"область\",\"облик\",\"обложка\",\"обмен\",\"обморок\",\"обожать\",\"обои\",\"оболочка\",\"оборона\",\"обочина\",\"образ\",\"обрести\",\"обрыв\",\"обувь\",\"обучение\",\"обход\",\"общество\",\"общий\",\"объект\",\"обыск\",\"обычно\",\"обязать\",\"овощи\",\"овраг\",\"овца\",\"оговорка\",\"ограда\",\"огурец\",\"одежда\",\"одеяло\",\"один\",\"однако\",\"одолеть\",\"ожидать\",\"озеро\",\"океан\",\"окно\",\"около\",\"окоп\",\"окраина\",\"октябрь\",\"опасный\",\"опека\",\"операция\",\"описание\",\"оплата\",\"опора\",\"оппонент\",\"оптимизм\",\"оптовый\",\"опухоль\",\"опыт\",\"оратор\",\"орбита\",\"орган\",\"орден\",\"орел\",\"оригинал\",\"ориентир\",\"оркестр\",\"оружие\",\"осенний\",\"осколок\",\"осмотр\",\"остров\",\"отбор\",\"отбыть\",\"отвлечь\",\"отдать\",\"отдел\",\"отдых\",\"отель\",\"отец\",\"отзыв\",\"отказ\",\"отклик\",\"открыть\",\"откуда\",\"отличие\",\"отныне\",\"отойти\",\"отпуск\",\"отрасль\",\"отросток\",\"отрывок\",\"отряд\",\"отсек\",\"отставка\",\"отсюда\",\"оттенок\",\"оттого\",\"отчего\",\"отъезд\",\"офис\",\"офицер\",\"охота\",\"охрана\",\"оценка\",\"очаг\",\"очень\",\"очередь\",\"очищать\",\"ошибка\",\"ощущение\",\"павильон\",\"падать\",\"пазуха\",\"пакет\",\"палата\",\"палец\",\"палуба\",\"пальто\",\"память\",\"панель\",\"паника\",\"пара\",\"парень\",\"пароход\",\"партия\",\"парус\",\"паспорт\",\"пассажир\",\"пастух\",\"патент\",\"патрон\",\"пауза\",\"паук\",\"паутина\",\"пафос\",\"пахнуть\",\"пациент\",\"пачка\",\"певец\",\"педагог\",\"пейзаж\",\"пенсия\",\"пепел\",\"первый\",\"перед\",\"период\",\"перо\",\"перрон\",\"персонаж\",\"перчатка\",\"песня\",\"песок\",\"петля\",\"петрушка\",\"петух\",\"пехота\",\"печать\",\"печень\",\"пешком\",\"пещера\",\"пианист\",\"пиджак\",\"пилот\",\"пионер\",\"пирамида\",\"пирожок\",\"письмо\",\"пища\",\"плавание\",\"плакать\",\"пламя\",\"план\",\"пласт\",\"платить\",\"пленный\",\"плечо\",\"плита\",\"плод\",\"плоский\",\"плотный\",\"плохой\",\"площадь\",\"плыть\",\"плюс\",\"пляж\",\"плясать\",\"победа\",\"повар\",\"повод\",\"повсюду\",\"повязка\",\"погода\",\"погреб\",\"подбор\",\"подвиг\",\"подделка\",\"поджать\",\"поднос\",\"подпись\",\"подруга\",\"подход\",\"подчас\",\"подъезд\",\"поединок\",\"поезд\",\"поесть\",\"поехать\",\"пожалуй\",\"пожилой\",\"позади\",\"позвать\",\"поздний\",\"позиция\",\"позор\",\"поиск\",\"поймать\",\"пойти\",\"поклон\",\"покой\",\"покрыть\",\"полдень\",\"полезный\",\"ползти\",\"полк\",\"полный\",\"половина\",\"полтора\",\"польза\",\"поляна\",\"помидор\",\"помнить\",\"помощь\",\"попасть\",\"поперек\",\"поплыть\",\"пополам\",\"поправка\",\"попугай\",\"попытка\",\"порог\",\"портрет\",\"порция\",\"порыв\",\"порядок\",\"после\",\"посол\",\"посреди\",\"постель\",\"посуда\",\"потом\",\"похвала\",\"похожий\",\"поцелуй\",\"почва\",\"почему\",\"пошлина\",\"поэма\",\"поэтому\",\"право\",\"праздник\",\"практика\",\"прах\",\"преграда\",\"предмет\",\"прежде\",\"прелесть\",\"премия\",\"препарат\",\"пресса\",\"прибыть\",\"прижать\",\"прийти\",\"приказ\",\"прилавок\",\"пример\",\"принять\",\"природа\",\"притом\",\"прихожая\",\"прицел\",\"причина\",\"приют\",\"прогноз\",\"продукт\",\"проект\",\"прожить\",\"прокат\",\"промысел\",\"пропуск\",\"просто\",\"против\",\"профиль\",\"процесс\",\"прочий\",\"прошлый\",\"прощать\",\"пружина\",\"прут\",\"прыжок\",\"прямой\",\"птица\",\"публика\",\"пугать\",\"пуговица\",\"пузырь\",\"пульт\",\"пуля\",\"пункт\",\"пускать\",\"пустой\",\"путь\",\"пухлый\",\"пучок\",\"пушистый\",\"пушка\",\"пчела\",\"пшеница\",\"пылать\",\"пыль\",\"пышный\",\"пьеса\",\"пятка\",\"пятно\",\"пятый\",\"пятьсот\",\"работа\",\"равнина\",\"ради\",\"радость\",\"радуга\",\"разбить\",\"развитие\",\"разговор\",\"раздел\",\"различие\",\"размер\",\"разный\",\"разрыв\",\"разум\",\"район\",\"ракета\",\"раковина\",\"рамка\",\"рано\",\"рапорт\",\"распад\",\"рассказ\",\"расти\",\"расход\",\"расцвет\",\"рация\",\"рвануть\",\"рваться\",\"реакция\",\"ребро\",\"реветь\",\"редактор\",\"редкий\",\"реестр\",\"режим\",\"резать\",\"резерв\",\"резина\",\"резко\",\"резной\",\"рейс\",\"реклама\",\"рекорд\",\"религия\",\"рельс\",\"ремень\",\"ремонт\",\"реплика\",\"репортаж\",\"ресница\",\"ресторан\",\"реформа\",\"рецепт\",\"речь\",\"решение\",\"ржавый\",\"риск\",\"рисунок\",\"ритуал\",\"рифма\",\"робко\",\"робот\",\"ровесник\",\"ровно\",\"родной\",\"рождение\",\"роза\",\"розовый\",\"розыск\",\"роль\",\"роман\",\"роскошь\",\"роспись\",\"рост\",\"рубашка\",\"рубеж\",\"рубить\",\"рубрика\",\"рудник\",\"рука\",\"рукопись\",\"румяный\",\"русло\",\"рухнуть\",\"ручей\",\"ручной\",\"рыба\",\"рыжий\",\"рынок\",\"рыхлый\",\"рыцарь\",\"рычаг\",\"рюкзак\",\"рядом\",\"садовый\",\"сажать\",\"салон\",\"салфетка\",\"салют\",\"самец\",\"самовар\",\"самый\",\"сани\",\"санкция\",\"сапог\",\"сарай\",\"сатира\",\"сахар\",\"сбить\",\"сбоку\",\"сборная\",\"сбыт\",\"свадьба\",\"свалка\",\"сварить\",\"свежий\",\"сверху\",\"свет\",\"свеча\",\"свинья\",\"свист\",\"свитер\",\"свобода\",\"сводка\",\"свой\",\"свыше\",\"связь\",\"сдаться\",\"сделать\",\"сегмент\",\"сегодня\",\"седло\",\"седой\",\"седьмой\",\"сезон\",\"сейф\",\"сейчас\",\"секрет\",\"сектор\",\"секунда\",\"семинар\",\"семья\",\"сенатор\",\"сено\",\"сенсация\",\"сентябрь\",\"сервис\",\"сердце\",\"середина\",\"сержант\",\"серия\",\"серый\",\"сессия\",\"сесть\",\"сетевой\",\"сжатый\",\"сжечь\",\"сзади\",\"сигнал\",\"сиденье\",\"сила\",\"силуэт\",\"сильный\",\"символ\",\"симпатия\",\"симфония\",\"синий\",\"синтез\",\"синяк\",\"сирень\",\"система\",\"ситуация\",\"сияние\",\"сказать\",\"скала\",\"скамейка\",\"скандал\",\"скатерть\",\"скачок\",\"скважина\",\"сквер\",\"сквозь\",\"скелет\",\"скидка\",\"склад\",\"сколько\",\"скорый\",\"скосить\",\"скот\",\"скрипка\",\"скудный\",\"скука\",\"слабый\",\"слава\",\"сладкий\",\"слегка\",\"след\",\"слеза\",\"слепой\",\"слесарь\",\"слишком\",\"слово\",\"слог\",\"сложный\",\"сломать\",\"служба\",\"слух\",\"случай\",\"слышать\",\"слюна\",\"смежный\",\"смелый\",\"сменить\",\"смесь\",\"сметана\",\"смех\",\"смола\",\"смуглый\",\"смутный\",\"смущать\",\"смысл\",\"снайпер\",\"снаряд\",\"сначала\",\"снег\",\"снизу\",\"сниться\",\"сно��а\",\"снять\",\"собака\",\"соблазн\",\"собрание\",\"событие\",\"совесть\",\"совсем\",\"согласие\",\"создать\",\"сознание\",\"созреть\",\"сойтись\",\"сокол\",\"солдат\",\"соленый\",\"солнце\",\"солома\",\"сомнение\",\"сонный\",\"соперник\",\"соратник\",\"сорвать\",\"сосед\",\"сосиска\",\"состав\",\"сотня\",\"соус\",\"союз\",\"спад\",\"спальня\",\"спасти\",\"спектр\",\"сперва\",\"спешить\",\"спина\",\"спирт\",\"список\",\"спичка\",\"сплав\",\"спонсор\",\"спор\",\"способ\",\"справка\",\"спустя\",\"спутник\",\"сразу\",\"средство\",\"срок\",\"срыв\",\"ссора\",\"ссылка\",\"ставить\",\"стадия\",\"стакан\",\"станция\",\"старый\",\"стая\",\"стебель\",\"стекло\",\"стена\",\"степень\",\"стереть\",\"стиль\",\"стимул\",\"стирать\",\"стихи\",\"стоить\",\"стойка\",\"стол\",\"стонать\",\"стопа\",\"сторона\",\"стоянка\",\"страна\",\"стричь\",\"строгий\",\"струя\",\"студент\",\"стук\",\"ступня\",\"стыдно\",\"суббота\",\"субъект\",\"сувенир\",\"сугроб\",\"сугубо\",\"судить\",\"судно\",\"судьба\",\"суета\",\"суметь\",\"сумма\",\"сумрак\",\"сундук\",\"супруг\",\"суровый\",\"сутки\",\"сухой\",\"суша\",\"существо\",\"сфера\",\"схема\",\"схожий\",\"сценарий\",\"счастье\",\"считать\",\"съезд\",\"сыграть\",\"сырой\",\"сытый\",\"сыщик\",\"сюда\",\"сюжет\",\"сюрприз\",\"тайна\",\"также\",\"такой\",\"такси\",\"тактика\",\"талия\",\"таможня\",\"танец\",\"таракан\",\"тарелка\",\"тариф\",\"тащить\",\"таять\",\"тварь\",\"театр\",\"тезис\",\"текст\",\"текущий\",\"телефон\",\"тема\",\"темнота\",\"теневой\",\"теннис\",\"теория\",\"теперь\",\"тепло\",\"терапия\",\"терзать\",\"термин\",\"терпеть\",\"терраса\",\"терять\",\"тесный\",\"тетрадь\",\"техника\",\"течение\",\"тигр\",\"типовой\",\"тираж\",\"титул\",\"тихий\",\"ткань\",\"товарищ\",\"тоже\",\"толпа\",\"толстый\",\"толчок\",\"толщина\",\"только\",\"тонкий\",\"тонна\",\"топить\",\"топор\",\"торговля\",\"тормоз\",\"торчать\",\"тотчас\",\"точка\",\"точно\",\"тощий\",\"трава\",\"традиция\",\"трактор\",\"трамвай\",\"траншея\",\"трасса\",\"тревога\",\"трезвый\",\"тренер\",\"трепет\",\"треск\",\"третий\",\"трещина\",\"трибуна\",\"тридцать\",\"триста\",\"триумф\",\"трогать\",\"тройка\",\"тронуть\",\"тропа\",\"тротуар\",\"трубка\",\"труд\",\"трюк\",\"тряпка\",\"туго\",\"туловище\",\"туман\",\"тумбочка\",\"тундра\",\"тупик\",\"турист\",\"турнир\",\"тусклый\",\"туфля\",\"туча\",\"тысяча\",\"тяга\",\"тяжело\",\"убежать\",\"убогий\",\"уборка\",\"уважение\",\"увезти\",\"уволить\",\"угадать\",\"угол\",\"угощать\",\"угроза\",\"угрюмый\",\"удар\",\"удачный\",\"уделять\",\"удивить\",\"удобный\",\"удочка\",\"уезжать\",\"ужин\",\"узел\",\"узкий\",\"уйти\",\"указание\",\"уклон\",\"украсть\",\"укусить\",\"улетать\",\"улица\",\"улыбка\",\"умело\",\"умение\",\"умный\",\"умолять\",\"унести\",\"унижать\",\"унылый\",\"упаковка\",\"упасть\",\"упорно\",\"упрек\",\"урна\",\"уровень\",\"урожай\",\"уронить\",\"усадьба\",\"усатый\",\"усвоить\",\"усилие\",\"условие\",\"услуга\",\"усмешка\",\"успеть\",\"устав\",\"устоять\",\"утечка\",\"утешать\",\"утро\",\"уцелеть\",\"участие\",\"ученик\",\"учесть\",\"ущелье\",\"ущерб\",\"уютный\",\"фабрика\",\"фаворит\",\"факел\",\"факт\",\"фамилия\",\"фантазия\",\"фасад\",\"февраль\",\"феномен\",\"фермер\",\"фигура\",\"физика\",\"филиал\",\"философ\",\"фильм\",\"финал\",\"флаг\",\"флот\",\"фойе\",\"фокус\",\"фонарь\",\"фонд\",\"фонтан\",\"форма\",\"форум\",\"фото\",\"фрагмент\",\"фраза\",\"фракция\",\"фронт\",\"фрукт\",\"функция\",\"фуражка\",\"футбол\",\"футляр\",\"халат\",\"хаос\",\"характер\",\"хата\",\"хвалить\",\"хватать\",\"хвойный\",\"хвост\",\"химия\",\"хирург\",\"хитрый\",\"хищник\",\"хлеб\",\"хлынуть\",\"хмурый\",\"ходить\",\"хозяин\",\"хоккей\",\"холм\",\"холст\",\"хорошо\",\"хотеть\",\"храбрый\",\"храм\",\"хранить\",\"хребет\",\"хрен\",\"хрипло\",\"хроника\",\"хрупкий\",\"художник\",\"худший\",\"хулиган\",\"хутор\",\"царь\",\"цветок\",\"целевой\",\"целиком\",\"целое\",\"цель\",\"цензура\",\"ценить\",\"центр\",\"цепной\",\"цикл\",\"цилиндр\",\"цирк\",\"цитата\",\"цифра\",\"чайник\",\"часы\",\"чашка\",\"человек\",\"челюсть\",\"чемодан\",\"чемпион\",\"чепуха\",\"червь\",\"чердак\",\"через\",\"чернила\",\"черта\",\"чеснок\",\"честно\",\"четверть\",\"четыре\",\"число\",\"чистый\",\"читатель\",\"чтение\",\"чтобы\",\"чувство\",\"чудак\",\"чудный\",\"чудо\",\"чужой\",\"чулок\",\"чума\",\"чушь\",\"чуять\",\"шагать\",\"шанс\",\"шапка\",\"шарик\",\"шарф\",\"шахматы\",\"шашлык\",\"шедевр\",\"шептать\",\"шерсть\",\"шестой\",\"шинель\",\"ширина\",\"шишка\",\"шкаф\",\"школа\",\"шкура\",\"шланг\",\"шлем\",\"шнур\",\"шоколад\",\"шорох\",\"шоссе\",\"шпион\",\"шприц\",\"штаб\",\"штамм\",\"штаны\",\"штатный\",\"штора\",\"штраф\",\"штурм\",\"штык\",\"шумно\",\"шуршать\",\"шутить\",\"шутка\",\"щедрый\",\"щека\",\"щенок\",\"экзамен\",\"экипаж\",\"экономия\",\"экран\",\"эксперт\",\"элемент\",\"элитный\",\"эмоция\",\"энергия\",\"эпизод\",\"эпоха\",\"эскиз\",\"эстрада\",\"этап\",\"этика\",\"этот\",\"эфир\",\"эффект\",\"эшелон\",\"юбилей\",\"юбка\",\"южный\",\"юмор\",\"юность\",\"юрист\",\"юстиция\",\"яблоко\",\"явление\",\"ягода\",\"ядро\",\"язык\",\"яйцо\",\"якобы\",\"якорь\",\"январь\",\"яркий\",\"ярмарка\",\"ярость\",\"ясный\",\"яхта\",\"ячейка\",\"ящик\"][\"ábaco\",\"abdomen\",\"abeja\",\"abierto\",\"abogado\",\"abono\",\"aborto\",\"abrazo\",\"abrir\",\"abuelo\",\"abuso\",\"acabar\",\"academia\",\"acceso\",\"acción\",\"aceite\",\"acelga\",\"acento\",\"aceptar\",\"ácido\",\"aclarar\",\"acné\",\"acoger\",\"acoso\",\"activo\",\"acto\",\"actriz\",\"actuar\",\"acudir\",\"acuerdo\",\"acusar\",\"adicto\",\"admitir\",\"adoptar\",\"adorno\",\"aduana\",\"adulto\",\"aéreo\",\"afectar\",\"afición\",\"afinar\",\"afirmar\",\"ágil\",\"agitar\",\"agonía\",\"agosto\",\"agotar\",\"agregar\",\"agrio\",\"agua\",\"agudo\",\"águila\",\"aguja\",\"ahogo\",\"ahorro\",\"aire\",\"aislar\",\"ajedrez\",\"ajeno\",\"ajuste\",\"alacrán\",\"alambre\",\"alarma\",\"alba\",\"álbum\",\"alcalde\",\"aldea\",\"alegre\",\"alejar\",\"alerta\",\"aleta\",\"alfiler\",\"alga\",\"algodón\",\"aliado\",\"aliento\",\"alivio\",\"alma\",\"almeja\",\"almíbar\",\"altar\",\"alteza\",\"altivo\",\"alto\",\"altura\",\"alumno\",\"alzar\",\"amable\",\"amante\",\"amapola\",\"amargo\",\"amasar\",\"ámbar\",\"ámbito\",\"ameno\",\"amigo\",\"amistad\",\"amor\",\"amparo\",\"amplio\",\"ancho\",\"anciano\",\"ancla\",\"andar\",\"andén\",\"anemia\",\"ángulo\",\"anillo\",\"ánimo\",\"anís\",\"anotar\",\"antena\",\"antiguo\",\"antojo\",\"anual\",\"anular\",\"anuncio\",\"añadir\",\"añejo\",\"año\",\"apagar\",\"aparato\",\"apetito\",\"apio\",\"aplicar\",\"apodo\",\"aporte\",\"apoyo\",\"aprender\",\"aprobar\",\"apuesta\",\"apuro\",\"arado\",\"araña\",\"arar\",\"árbitro\",\"árbol\",\"arbusto\",\"archivo\",\"arco\",\"arder\",\"ardilla\",\"arduo\",\"área\",\"árido\",\"aries\",\"armonía\",\"arnés\",\"aroma\",\"arpa\",\"arpón\",\"arreglo\",\"arroz\",\"arruga\",\"arte\",\"artista\",\"asa\",\"asado\",\"asalto\",\"ascenso\",\"asegurar\",\"aseo\",\"asesor\",\"asiento\",\"asilo\",\"asistir\",\"asno\",\"asombro\",\"áspero\",\"astilla\",\"astro\",\"astuto\",\"asumir\",\"asunto\",\"atajo\",\"ataque\",\"atar\",\"atento\",\"ateo\",\"ático\",\"atleta\",\"átomo\",\"atraer\",\"atroz\",\"atún\",\"audaz\",\"audio\",\"auge\",\"aula\",\"aumento\",\"ausente\",\"autor\",\"aval\",\"avance\",\"avaro\",\"ave\",\"avellana\",\"avena\",\"avestruz\",\"avión\",\"aviso\",\"ayer\",\"ayuda\",\"ayuno\",\"azafrán\",\"azar\",\"azote\",\"azúcar\",\"azufre\",\"azul\",\"baba\",\"babor\",\"bache\",\"bahía\",\"baile\",\"bajar\",\"balanza\",\"balcón\",\"balde\",\"bambú\",\"banco\",\"banda\",\"baño\",\"barba\",\"barco\",\"barniz\",\"barro\",\"báscula\",\"bastón\",\"basura\",\"batalla\",\"batería\",\"batir\",\"batuta\",\"baúl\",\"bazar\",\"bebé\",\"bebida\",\"bello\",\"besar\",\"beso\",\"bestia\",\"bicho\",\"bien\",\"bingo\",\"blanco\",\"bloque\",\"blusa\",\"boa\",\"bobina\",\"bobo\",\"boca\",\"bocina\",\"boda\",\"bodega\",\"boina\",\"bola\",\"bolero\",\"bolsa\",\"bomba\",\"bondad\",\"bonito\",\"bono\",\"bonsái\",\"borde\",\"borrar\",\"bosque\",\"bote\",\"botín\",\"bóveda\",\"bozal\",\"bravo\",\"brazo\",\"brecha\",\"breve\",\"brillo\",\"brinco\",\"brisa\",\"broca\",\"broma\",\"bronce\",\"brote\",\"bruja\",\"brusco\",\"bruto\",\"buceo\",\"bucle\",\"bueno\",\"buey\",\"bufanda\",\"bufón\",\"búho\",\"buitre\",\"bulto\",\"burbuja\",\"burla\",\"burro\",\"buscar\",\"butaca\",\"buzón\",\"caballo\",\"cabeza\",\"cabina\",\"cabra\",\"cacao\",\"cadáver\",\"cadena\",\"caer\",\"café\",\"caída\",\"caimán\",\"caja\",\"cajón\",\"cal\",\"calamar\",\"calcio\",\"caldo\",\"calidad\",\"calle\",\"calma\",\"calor\",\"calvo\",\"cama\",\"cambio\",\"camello\",\"camino\",\"campo\",\"cáncer\",\"candil\",\"canela\",\"canguro\",\"canica\",\"canto\",\"caña\",\"cañón\",\"caoba\",\"caos\",\"capaz\",\"capitán\",\"capote\",\"captar\",\"capucha\",\"cara\",\"carbón\",\"cárcel\",\"careta\",\"carga\",\"cariño\",\"carne\",\"carpeta\",\"carro\",\"carta\",\"casa\",\"casco\",\"casero\",\"caspa\",\"castor\",\"catorce\",\"catre\",\"caudal\",\"causa\",\"cazo\",\"cebolla\",\"ceder\",\"cedro\",\"celda\",\"célebre\",\"celoso\",\"célula\",\"cemento\",\"ceniza\",\"centro\",\"cerca\",\"cerdo\",\"cereza\",\"cero\",\"cerrar\",\"certeza\",\"césped\",\"cetro\",\"chacal\",\"chaleco\",\"champú\",\"chancla\",\"chapa\",\"charla\",\"chico\",\"chiste\",\"chivo\",\"choque\",\"choza\",\"chuleta\",\"chupar\",\"ciclón\",\"ciego\",\"cielo\",\"cien\",\"cierto\",\"cifra\",\"cigarro\",\"cima\",\"cinco\",\"cine\",\"cinta\",\"ciprés\",\"circo\",\"ciruela\",\"cisne\",\"cita\",\"ciudad\",\"clamor\",\"clan\",\"claro\",\"clase\",\"clave\",\"cliente\",\"clima\",\"clínica\",\"cobre\",\"cocción\",\"cochino\",\"cocina\",\"coco\",\"código\",\"codo\",\"cofre\",\"coger\",\"cohete\",\"cojín\",\"cojo\",\"cola\",\"colcha\",\"colegio\",\"colgar\",\"colina\",\"collar\",\"colmo\",\"columna\",\"combate\",\"comer\",\"comida\",\"cómodo\",\"compra\",\"conde\",\"conejo\",\"conga\",\"conocer\",\"consejo\",\"contar\",\"copa\",\"copia\",\"corazón\",\"corbata\",\"corcho\",\"cordón\",\"corona\",\"correr\",\"coser\",\"cosmos\",\"costa\",\"cráneo\",\"cráter\",\"crear\",\"crecer\",\"creído\",\"crema\",\"cría\",\"crimen\",\"cripta\",\"crisis\",\"cromo\",\"crónica\",\"croqueta\",\"crudo\",\"cruz\",\"cuadro\",\"cuarto\",\"cuatro\",\"cubo\",\"cubrir\",\"cuchara\",\"cuello\",\"cuento\",\"cuerda\",\"cuesta\",\"cueva\",\"cuidar\",\"culebra\",\"culpa\",\"culto\",\"cumbre\",\"cumplir\",\"cuna\",\"cuneta\",\"cuota\",\"cupón\",\"cúpula\",\"curar\",\"curioso\",\"curso\",\"curva\",\"cutis\",\"dama\",\"danza\",\"dar\",\"dardo\",\"dátil\",\"deber\",\"débil\",\"década\",\"decir\",\"dedo\",\"defensa\",\"definir\",\"dejar\",\"delfín\",\"delgado\",\"delito\",\"demora\",\"denso\",\"dental\",\"deporte\",\"derecho\",\"derrota\",\"desayuno\",\"deseo\",\"desfile\",\"desnudo\",\"destino\",\"desvío\",\"detalle\",\"detener\",\"deuda\",\"día\",\"diablo\",\"diadema\",\"diamante\",\"diana\",\"diario\",\"dibujo\",\"dictar\",\"diente\",\"dieta\",\"diez\",\"difícil\",\"digno\",\"dilema\",\"diluir\",\"dinero\",\"directo\",\"dirigir\",\"disco\",\"diseño\",\"disfraz\",\"diva\",\"divino\",\"doble\",\"doce\",\"dolor\",\"domingo\",\"don\",\"donar\",\"dorado\",\"dormir\",\"dorso\",\"dos\",\"dosis\",\"dragón\",\"droga\",\"ducha\",\"duda\",\"duelo\",\"dueño\",\"dulce\",\"dúo\",\"duque\",\"durar\",\"dureza\",\"duro\",\"ébano\",\"ebrio\",\"echar\",\"eco\",\"ecuador\",\"edad\",\"edición\",\"edificio\",\"editor\",\"educar\",\"efecto\",\"eficaz\",\"eje\",\"ejemplo\",\"elefante\",\"elegir\",\"elemento\",\"elevar\",\"elipse\",\"élite\",\"elixir\",\"elogio\",\"eludir\",\"embudo\",\"emitir\",\"emoción\",\"empate\",\"empeño\",\"empleo\",\"empresa\",\"enano\",\"encargo\",\"enchufe\",\"encía\",\"enemigo\",\"enero\",\"enfado\",\"enfermo\",\"engaño\",\"enigma\",\"enlace\",\"enorme\",\"enredo\",\"ensayo\",\"enseñar\",\"entero\",\"entrar\",\"envase\",\"envío\",\"época\",\"equipo\",\"erizo\",\"escala\",\"escena\",\"escolar\",\"escribir\",\"escudo\",\"esencia\",\"esfera\",\"esfuerzo\",\"espada\",\"espejo\",\"espía\",\"esposa\",\"espuma\",\"esquí\",\"estar\",\"este\",\"estilo\",\"estufa\",\"etapa\",\"eterno\",\"ética\",\"etnia\",\"evadir\",\"evaluar\",\"evento\",\"evitar\",\"exacto\",\"examen\",\"exceso\",\"excusa\",\"exento\",\"exigir\",\"exilio\",\"existir\",\"éxito\",\"experto\",\"explicar\",\"exponer\",\"extremo\",\"fábrica\",\"fábula\",\"fachada\",\"fácil\",\"factor\",\"faena\",\"faja\",\"falda\",\"fallo\",\"falso\",\"faltar\",\"fama\",\"familia\",\"famoso\",\"faraón\",\"farmacia\",\"farol\",\"farsa\",\"fase\",\"fatiga\",\"fauna\",\"favor\",\"fax\",\"febrero\",\"fecha\",\"feliz\",\"feo\",\"feria\",\"feroz\",\"fértil\",\"fervor\",\"festín\",\"fiable\",\"fianza\",\"fiar\",\"fibra\",\"ficción\",\"ficha\",\"fideo\",\"fiebre\",\"fiel\",\"fiera\",\"fiesta\",\"figura\",\"fijar\",\"fijo\",\"fila\",\"filete\",\"filial\",\"filtro\",\"fin\",\"finca\",\"fingir\",\"finito\",\"firma\",\"flaco\",\"flauta\",\"flecha\",\"flor\",\"flota\",\"fluir\",\"flujo\",\"flúor\",\"fobia\",\"foca\",\"fogata\",\"fogón\",\"folio\",\"folleto\",\"fondo\",\"forma\",\"forro\",\"fortuna\",\"forzar\",\"fosa\",\"foto\",\"fracaso\",\"frágil\",\"franja\",\"frase\",\"fraude\",\"freír\",\"freno\",\"fresa\",\"frío\",\"frito\",\"fruta\",\"fuego\",\"fuente\",\"fuerza\",\"fuga\",\"fumar\",\"función\",\"funda\",\"furgón\",\"furia\",\"fusil\",\"fútbol\",\"futuro\",\"gacela\",\"gafas\",\"gaita\",\"gajo\",\"gala\",\"galería\",\"gallo\",\"gamba\",\"ganar\",\"gancho\",\"ganga\",\"ganso\",\"garaje\",\"garza\",\"gasolina\",\"gastar\",\"gato\",\"gavilán\",\"gemelo\",\"gemir\",\"gen\",\"género\",\"genio\",\"gente\",\"geranio\",\"gerente\",\"germen\",\"gesto\",\"gigante\",\"gimnasio\",\"girar\",\"giro\",\"glaciar\",\"globo\",\"gloria\",\"gol\",\"golfo\",\"goloso\",\"golpe\",\"goma\",\"gordo\",\"gorila\",\"gorra\",\"gota\",\"goteo\",\"gozar\",\"grada\",\"gráfico\",\"grano\",\"grasa\",\"gratis\",\"grave\",\"grieta\",\"grillo\",\"gripe\",\"gris\",\"grito\",\"grosor\",\"grúa\",\"grueso\",\"grumo\",\"grupo\",\"guante\",\"guapo\",\"guardia\",\"guerra\",\"guía\",\"guiño\",\"guion\",\"guiso\",\"guitarra\",\"gusano\",\"gustar\",\"haber\",\"hábil\",\"hablar\",\"hacer\",\"hacha\",\"hada\",\"hallar\",\"hamaca\",\"harina\",\"haz\",\"hazaña\",\"hebilla\",\"hebra\",\"hecho\",\"helado\",\"helio\",\"hembra\",\"herir\",\"hermano\",\"héroe\",\"hervir\",\"hielo\",\"hierro\",\"hígado\",\"higiene\",\"hijo\",\"himno\",\"historia\",\"hocico\",\"hogar\",\"hoguera\",\"hoja\",\"hombre\",\"hongo\",\"honor\",\"honra\",\"hora\",\"hormiga\",\"horno\",\"hostil\",\"hoyo\",\"hueco\",\"huelga\",\"huerta\",\"hueso\",\"huevo\",\"huida\",\"huir\",\"humano\",\"húmedo\",\"humilde\",\"humo\",\"hundir\",\"huracán\",\"hurto\",\"icono\",\"ideal\",\"idioma\",\"ídolo\",\"iglesia\",\"iglú\",\"igual\",\"ilegal\",\"ilusión\",\"imagen\",\"imán\",\"imitar\",\"impar\",\"imperio\",\"imponer\",\"impulso\",\"incapaz\",\"índice\",\"inerte\",\"infiel\",\"informe\",\"ingenio\",\"inicio\",\"inmenso\",\"inmune\",\"innato\",\"insecto\",\"instante\",\"interés\",\"íntimo\",\"intuir\",\"inútil\",\"invierno\",\"ira\",\"iris\",\"ironía\",\"isla\",\"islote\",\"jabalí\",\"jabón\",\"jamón\",\"jarabe\",\"jardín\",\"jarra\",\"jaula\",\"jazmín\",\"jefe\",\"jeringa\",\"jinete\",\"jornada\",\"joroba\",\"joven\",\"joya\",\"juerga\",\"jueves\",\"juez\",\"jugador\",\"jugo\",\"juguete\",\"juicio\",\"junco\",\"jungla\",\"junio\",\"juntar\",\"júpiter\",\"jurar\",\"justo\",\"juvenil\",\"juzgar\",\"kilo\",\"koala\",\"labio\",\"lacio\",\"lacra\",\"lado\",\"ladrón\",\"lagarto\",\"lágrima\",\"laguna\",\"laico\",\"lamer\",\"lámina\",\"lámpara\",\"lana\",\"lancha\",\"langosta\",\"lanza\",\"lápiz\",\"largo\",\"larva\",\"lástima\",\"lata\",\"látex\",\"latir\",\"laurel\",\"lavar\",\"lazo\",\"leal\",\"lección\",\"leche\",\"lector\",\"leer\",\"legión\",\"legumbre\",\"lejano\",\"lengua\",\"lento\",\"leña\",\"león\",\"leopardo\",\"lesión\",\"letal\",\"letra\",\"leve\",\"leyenda\",\"libertad\",\"libro\",\"licor\",\"líder\",\"lidiar\",\"lienzo\",\"liga\",\"ligero\",\"lima\",\"límite\",\"limón\",\"limpio\",\"lince\",\"lindo\",\"línea\",\"lingote\",\"lino\",\"linterna\",\"líquido\",\"liso\",\"lista\",\"litera\",\"litio\",\"litro\",\"llaga\",\"llama\",\"llanto\",\"llave\",\"llegar\",\"llenar\",\"llevar\",\"llorar\",\"llover\",\"lluvia\",\"lobo\",\"loción\",\"loco\",\"locura\",\"lógica\",\"logro\",\"lombriz\",\"lomo\",\"lonja\",\"lote\",\"lucha\",\"lucir\",\"lugar\",\"lujo\",\"luna\",\"lunes\",\"lupa\",\"lustro\",\"luto\",\"luz\",\"maceta\",\"macho\",\"madera\",\"madre\",\"maduro\",\"maestro\",\"mafia\",\"magia\",\"mago\",\"maíz\",\"maldad\",\"maleta\",\"malla\",\"malo\",\"mamá\",\"mambo\",\"mamut\",\"manco\",\"mando\",\"manejar\",\"manga\",\"maniquí\",\"manjar\",\"mano\",\"manso\",\"manta\",\"mañana\",\"mapa\",\"máquina\",\"mar\",\"marco\",\"marea\",\"marfil\",\"margen\",\"marido\",\"mármol\",\"marrón\",\"martes\",\"marzo\",\"masa\",\"máscara\",\"masivo\",\"matar\",\"materia\",\"matiz\",\"matriz\",\"máximo\",\"mayor\",\"mazorca\",\"mecha\",\"medalla\",\"medio\",\"médula\",\"mejilla\",\"mejor\",\"melena\",\"melón\",\"memoria\",\"menor\",\"mensaje\",\"mente\",\"menú\",\"mercado\",\"merengue\",\"mérito\",\"mes\",\"mesón\",\"meta\",\"meter\",\"método\",\"metro\",\"mezcla\",\"miedo\",\"miel\",\"miembro\",\"miga\",\"mil\",\"milagro\",\"militar\",\"millón\",\"mimo\",\"mina\",\"minero\",\"mínimo\",\"minuto\",\"miope\",\"mirar\",\"misa\",\"miseria\",\"misil\",\"mismo\",\"mitad\",\"mito\",\"mochila\",\"moción\",\"moda\",\"modelo\",\"moho\",\"mojar\",\"molde\",\"moler\",\"molino\",\"momento\",\"momia\",\"monarca\",\"moneda\",\"monja\",\"monto\",\"moño\",\"morada\",\"morder\",\"moreno\",\"morir\",\"morro\",\"morsa\",\"mortal\",\"mosca\",\"mostrar\",\"motivo\",\"mover\",\"móvil\",\"mozo\",\"mucho\",\"mudar\",\"mueble\",\"muela\",\"muerte\",\"muestra\",\"mugre\",\"mujer\",\"mula\",\"muleta\",\"multa\",\"mundo\",\"muñeca\",\"mural\",\"muro\",\"músculo\",\"museo\",\"musgo\",\"música\",\"muslo\",\"nácar\",\"nación\",\"nadar\",\"naipe\",\"naranja\",\"nariz\",\"narrar\",\"nasal\",\"natal\",\"nativo\",\"natural\",\"náusea\",\"naval\",\"nave\",\"navidad\",\"necio\",\"néctar\",\"negar\",\"negocio\",\"negro\",\"neón\",\"nervio\",\"neto\",\"neutro\",\"nevar\",\"nevera\",\"nicho\",\"nido\",\"niebla\",\"nieto\",\"niñez\",\"niño\",\"nítido\",\"nivel\",\"nobleza\",\"noche\",\"nómina\",\"noria\",\"norma\",\"norte\",\"nota\",\"noticia\",\"novato\",\"novela\",\"novio\",\"nube\",\"nuca\",\"núcleo\",\"nudillo\",\"nudo\",\"nuera\",\"nueve\",\"nuez\",\"nulo\",\"número\",\"nutria\",\"oasis\",\"obeso\",\"obispo\",\"objeto\",\"obra\",\"obrero\",\"observar\",\"obtener\",\"obvio\",\"oca\",\"ocaso\",\"océano\",\"ochenta\",\"ocho\",\"ocio\",\"ocre\",\"octavo\",\"octubre\",\"oculto\",\"ocupar\",\"ocurrir\",\"odiar\",\"odio\",\"odisea\",\"oeste\",\"ofensa\",\"oferta\",\"oficio\",\"ofrecer\",\"ogro\",\"oído\",\"oír\",\"ojo\",\"ola\",\"oleada\",\"olfato\",\"olivo\",\"olla\",\"olmo\",\"olor\",\"olvido\",\"ombligo\",\"onda\",\"onza\",\"opaco\",\"opción\",\"ópera\",\"opinar\",\"oponer\",\"optar\",\"óptica\",\"opuesto\",\"oración\",\"orador\",\"oral\",\"órbita\",\"orca\",\"orden\",\"oreja\",\"órgano\",\"orgía\",\"orgullo\",\"oriente\",\"origen\",\"orilla\",\"oro\",\"orquesta\",\"oruga\",\"osadía\",\"oscuro\",\"osezno\",\"oso\",\"ostra\",\"otoño\",\"otro\",\"oveja\",\"óvulo\",\"óxido\",\"oxígeno\",\"oyente\",\"ozono\",\"pacto\",\"padre\",\"paella\",\"página\",\"pago\",\"país\",\"pájaro\",\"palabra\",\"palco\",\"paleta\",\"pálido\",\"palma\",\"paloma\",\"palpar\",\"pan\",\"panal\",\"pánico\",\"pantera\",\"pañuelo\",\"papá\",\"papel\",\"papilla\",\"paquete\",\"parar\",\"parcela\",\"pared\",\"parir\",\"paro\",\"párpado\",\"parque\",\"párrafo\",\"parte\",\"pasar\",\"paseo\",\"pasión\",\"paso\",\"pasta\",\"pata\",\"patio\",\"patria\",\"pausa\",\"pauta\",\"pavo\",\"payaso\",\"peatón\",\"pecado\",\"pecera\",\"pecho\",\"pedal\",\"pedir\",\"pegar\",\"peine\",\"pelar\",\"peldaño\",\"pelea\",\"peligro\",\"pellejo\",\"pelo\",\"peluca\",\"pena\",\"pensar\",\"peñón\",\"peón\",\"peor\",\"pepino\",\"pequeño\",\"pera\",\"percha\",\"perder\",\"pereza\",\"perfil\",\"perico\",\"perla\",\"permiso\",\"perro\",\"persona\",\"pesa\",\"pesca\",\"pésimo\",\"pestaña\",\"pétalo\",\"petróleo\",\"pez\",\"pezuña\",\"picar\",\"pichón\",\"pie\",\"piedra\",\"pierna\",\"pieza\",\"pijama\",\"pilar\",\"piloto\",\"pimienta\",\"pino\",\"pintor\",\"pinza\",\"piña\",\"piojo\",\"pipa\",\"pirata\",\"pisar\",\"piscina\",\"piso\",\"pista\",\"pitón\",\"pizca\",\"placa\",\"plan\",\"plata\",\"playa\",\"plaza\",\"pleito\",\"pleno\",\"plomo\",\"pluma\",\"plural\",\"pobre\",\"poco\",\"poder\",\"podio\",\"poema\",\"poesía\",\"poeta\",\"polen\",\"policía\",\"pollo\",\"polvo\",\"pomada\",\"pomelo\",\"pomo\",\"pompa\",\"poner\",\"porción\",\"portal\",\"posada\",\"poseer\",\"posible\",\"poste\",\"potencia\",\"potro\",\"pozo\",\"prado\",\"precoz\",\"pregunta\",\"premio\",\"prensa\",\"preso\",\"previo\",\"primo\",\"príncipe\",\"prisión\",\"privar\",\"proa\",\"probar\",\"proceso\",\"producto\",\"proeza\",\"profesor\",\"programa\",\"prole\",\"promesa\",\"pronto\",\"propio\",\"próximo\",\"prueba\",\"público\",\"puchero\",\"pudor\",\"pueblo\",\"puerta\",\"puesto\",\"pulga\",\"pulir\",\"pulmón\",\"pulpo\",\"pulso\",\"puma\",\"punto\",\"puñal\",\"puño\",\"pupa\",\"pupila\",\"puré\",\"quedar\",\"queja\",\"quemar\",\"querer\",\"queso\",\"quieto\",\"química\",\"quince\",\"quitar\",\"rábano\",\"rabia\",\"rabo\",\"ración\",\"radical\",\"raíz\",\"rama\",\"rampa\",\"rancho\",\"rango\",\"rapaz\",\"rápido\",\"rapto\",\"rasgo\",\"raspa\",\"rato\",\"rayo\",\"raza\",\"razón\",\"reacción\",\"realidad\",\"rebaño\",\"rebote\",\"recaer\",\"receta\",\"rechazo\",\"recoger\",\"recreo\",\"recto\",\"recurso\",\"red\",\"redondo\",\"reducir\",\"reflejo\",\"reforma\",\"refrán\",\"refugio\",\"regalo\",\"regir\",\"regla\",\"regreso\",\"rehén\",\"reino\",\"reír\",\"reja\",\"relato\",\"relevo\",\"relieve\",\"relleno\",\"reloj\",\"remar\",\"remedio\",\"remo\",\"rencor\",\"rendir\",\"renta\",\"reparto\",\"repetir\",\"reposo\",\"reptil\",\"res\",\"rescate\",\"resina\",\"respeto\",\"resto\",\"resumen\",\"retiro\",\"retorno\",\"retrato\",\"reunir\",\"revés\",\"revista\",\"rey\",\"rezar\",\"rico\",\"riego\",\"rienda\",\"riesgo\",\"rifa\",\"rígido\",\"rigor\",\"rincón\",\"riñón\",\"río\",\"riqueza\",\"risa\",\"ritmo\",\"rito\",\"rizo\",\"roble\",\"roce\",\"rociar\",\"rodar\",\"rodeo\",\"rodilla\",\"roer\",\"rojizo\",\"rojo\",\"romero\",\"romper\",\"ron\",\"ronco\",\"ronda\",\"ropa\",\"ropero\",\"rosa\",\"rosca\",\"rostro\",\"rotar\",\"rubí\",\"rubor\",\"rudo\",\"rueda\",\"rugir\",\"ruido\",\"ruina\",\"ruleta\",\"rulo\",\"rumbo\",\"rumor\",\"ruptura\",\"ruta\",\"rutina\",\"sábado\",\"saber\",\"sabio\",\"sable\",\"sacar\",\"sagaz\",\"sagrado\",\"sala\",\"saldo\",\"salero\",\"salir\",\"salmón\",\"salón\",\"salsa\",\"salto\",\"salud\",\"salvar\",\"samba\",\"sanción\",\"sandía\",\"sanear\",\"sangre\",\"sanidad\",\"sano\",\"santo\",\"sapo\",\"saque\",\"sardina\",\"sartén\",\"sastre\",\"satán\",\"sauna\",\"saxofón\",\"sección\",\"seco\",\"secreto\",\"secta\",\"sed\",\"seguir\",\"seis\",\"sello\",\"selva\",\"semana\",\"semilla\",\"senda\",\"sensor\",\"señal\",\"señor\",\"separar\",\"sepia\",\"sequía\",\"ser\",\"serie\",\"sermón\",\"servir\",\"sesenta\",\"sesión\",\"seta\",\"setenta\",\"severo\",\"sexo\",\"sexto\",\"sidra\",\"siesta\",\"siete\",\"siglo\",\"signo\",\"sílaba\",\"silbar\",\"silencio\",\"silla\",\"símbolo\",\"simio\",\"sirena\",\"sistema\",\"sitio\",\"situar\",\"sobre\",\"socio\",\"sodio\",\"sol\",\"solapa\",\"soldado\",\"soledad\",\"sólido\",\"soltar\",\"solución\",\"sombra\",\"sondeo\",\"sonido\",\"sonoro\",\"sonrisa\",\"sopa\",\"soplar\",\"soporte\",\"sordo\",\"sorpresa\",\"sorteo\",\"sostén\",\"sótano\",\"suave\",\"subir\",\"suceso\",\"sudor\",\"suegra\",\"suelo\",\"sueño\",\"suerte\",\"sufrir\",\"sujeto\",\"sultán\",\"sumar\",\"superar\",\"suplir\",\"suponer\",\"supremo\",\"sur\",\"surco\",\"sureño\",\"surgir\",\"susto\",\"sutil\",\"tabaco\",\"tabique\",\"tabla\",\"tabú\",\"taco\",\"tacto\",\"tajo\",\"talar\",\"talco\",\"talento\",\"talla\",\"talón\",\"tamaño\",\"tambor\",\"tango\",\"tanque\",\"tapa\",\"tapete\",\"tapia\",\"tapón\",\"taquilla\",\"tarde\",\"tarea\",\"tarifa\",\"tarjeta\",\"tarot\",\"tarro\",\"tarta\",\"tatuaje\",\"tauro\",\"taza\",\"tazón\",\"teatro\",\"techo\",\"tecla\",\"técnica\",\"tejado\",\"tejer\",\"tejido\",\"tela\",\"teléfono\",\"tema\",\"temor\",\"templo\",\"tenaz\",\"tender\",\"tener\",\"tenis\",\"tenso\",\"teoría\",\"terapia\",\"terco\",\"término\",\"ternura\",\"terror\",\"tesis\",\"tesoro\",\"testigo\",\"tetera\",\"texto\",\"tez\",\"tibio\",\"tiburón\",\"tiempo\",\"tienda\",\"tierra\",\"tieso\",\"tigre\",\"tijera\",\"tilde\",\"timbre\",\"tímido\",\"timo\",\"tinta\",\"tío\",\"típico\",\"tipo\",\"tira\",\"tirón\",\"titán\",\"títere\",\"título\",\"tiza\",\"toalla\",\"tobillo\",\"tocar\",\"tocino\",\"todo\",\"toga\",\"toldo\",\"tomar\",\"tono\",\"tonto\",\"topar\",\"tope\",\"toque\",\"tórax\",\"torero\",\"tormenta\",\"torneo\",\"toro\",\"torpedo\",\"torre\",\"torso\",\"tortuga\",\"tos\",\"tosco\",\"toser\",\"tóxico\",\"trabajo\",\"tractor\",\"traer\",\"tráfico\",\"trago\",\"traje\",\"tramo\",\"trance\",\"trato\",\"trauma\",\"trazar\",\"trébol\",\"tregua\",\"treinta\",\"tren\",\"trepar\",\"tres\",\"tribu\",\"trigo\",\"tripa\",\"triste\",\"triunfo\",\"trofeo\",\"trompa\",\"tronco\",\"tropa\",\"trote\",\"trozo\",\"truco\",\"trueno\",\"trufa\",\"tubería\",\"tubo\",\"tuerto\",\"tumba\",\"tumor\",\"túnel\",\"túnica\",\"turbina\",\"turismo\",\"turno\",\"tutor\",\"ubicar\",\"úlcera\",\"umbral\",\"unidad\",\"unir\",\"universo\",\"uno\",\"untar\",\"uña\",\"urbano\",\"urbe\",\"urgente\",\"urna\",\"usar\",\"usuario\",\"útil\",\"utopía\",\"uva\",\"vaca\",\"vacío\",\"vacuna\",\"vagar\",\"vago\",\"vaina\",\"vajilla\",\"vale\",\"válido\",\"valle\",\"valor\",\"válvula\",\"vampiro\",\"vara\",\"variar\",\"varón\",\"vaso\",\"vecino\",\"vector\",\"vehículo\",\"veinte\",\"vejez\",\"vela\",\"velero\",\"veloz\",\"vena\",\"vencer\",\"venda\",\"veneno\",\"vengar\",\"venir\",\"venta\",\"venus\",\"ver\",\"verano\",\"verbo\",\"verde\",\"vereda\",\"verja\",\"verso\",\"verter\",\"vía\",\"viaje\",\"vibrar\",\"vicio\",\"víctima\",\"vida\",\"vídeo\",\"vidrio\",\"viejo\",\"viernes\",\"vigor\",\"vil\",\"villa\",\"vinagre\",\"vino\",\"viñedo\",\"violín\",\"viral\",\"virgo\",\"virtud\",\"visor\",\"víspera\",\"vista\",\"vitamina\",\"viudo\",\"vivaz\",\"vivero\",\"vivir\",\"vivo\",\"volcán\",\"volumen\",\"volver\",\"voraz\",\"votar\",\"voto\",\"voz\",\"vuelo\",\"vulgar\",\"yacer\",\"yate\",\"yegua\",\"yema\",\"yerno\",\"yeso\",\"yodo\",\"yoga\",\"yogur\",\"zafiro\",\"zanja\",\"zapato\",\"zarza\",\"zona\",\"zorro\",\"zumo\",\"zurdo\"][\"abajur\",\"abaküs\",\"abartı\",\"abdal\",\"abdest\",\"abiye\",\"abluka\",\"abone\",\"absorbe\",\"absürt\",\"acayip\",\"acele\",\"acemi\",\"açıkgöz\",\"adalet\",\"adam\",\"adezyon\",\"adisyon\",\"adliye\",\"adres\",\"afacan\",\"afili\",\"afiş\",\"afiyet\",\"aforizm\",\"afra\",\"ağaç\",\"ağır\",\"ahbap\",\"ahkam\",\"ahlak\",\"ahtapot\",\"aidat\",\"aile\",\"ajan\",\"akademi\",\"akarsu\",\"akbaş\",\"akciğer\",\"akdeniz\",\"akıbet\",\"akıl\",\"akıntı\",\"akide\",\"akrep\",\"akrobasi\",\"aksiyon\",\"akşam\",\"aktif\",\"aktör\",\"aktris\",\"akustik\",\"alaca\",\"albüm\",\"alçak\",\"aldanma\",\"aleni\",\"alet\",\"alfabe\",\"algılama\",\"alıngan\",\"alkış\",\"alkol\",\"alpay\",\"alperen\",\"altın\",\"altüst\",\"altyapı\",\"alyuvar\",\"amade\",\"amatör\",\"amazon\",\"ambalaj\",\"amblem\",\"ambulans\",\"amca\",\"amel\",\"amigo\",\"amir\",\"amiyane\",\"amorti\",\"ampul\",\"anadolu\",\"anahtar\",\"anakonda\",\"anaokul\",\"anapara\",\"anarşi\",\"anatomi\",\"anayasa\",\"anekdot\",\"anestezi\",\"angaje\",\"anka\",\"anket\",\"anlamlı\",\"anne\",\"anomali\",\"anonim\",\"anten\",\"antlaşma\",\"apse\",\"araba\",\"aracı\",\"araf\",\"arbede\",\"arda\",\"arefe\",\"arena\",\"argo\",\"argüman\",\"arkadaş\",\"armoni\",\"aroma\",\"arsa\",\"arsız\",\"artı\",\"artist\",\"aruz\",\"asansör\",\"asayiş\",\"asfalt\",\"asgari\",\"asil\",\"asker\",\"askı\",\"aslan\",\"asosyal\",\"astsubay\",\"asya\",\"aşçı\",\"aşırı\",\"aşure\",\"atabey\",\"ataman\",\"ateş\",\"atmaca\",\"atmosfer\",\"atom\",\"atölye\",\"avcı\",\"avdet\",\"avize\",\"avlu\",\"avokado\",\"avrupa\",\"avukat\",\"ayaz\",\"ayçiçeği\",\"aydın\",\"aygıt\",\"ayna\",\"ayran\",\"ayrıntı\",\"azim\",\"baca\",\"bagaj\",\"bağlantı\",\"bahadır\",\"bahçe\",\"baki\",\"bakkal\",\"baklava\",\"bakteri\",\"balçık\",\"balina\",\"balo\",\"balta\",\"bant\",\"banyo\",\"bardak\",\"barış\",\"başbuğ\",\"başıboş\",\"başkan\",\"başlık\",\"bavul\",\"bayındır\",\"baykuş\",\"bazlama\",\"bedel\",\"begüm\",\"bekçi\",\"bekle\",\"belge\",\"belki\",\"bencil\",\"benek\",\"bengi\",\"benzer\",\"berjer\",\"berk\",\"bermuda\",\"berrak\",\"beşik\",\"beton\",\"beyin\",\"beyoğlu\",\"bıçak\",\"biberiye\",\"bidon\",\"biftek\",\"bihaber\",\"bikini\",\"bilezik\",\"bilinç\",\"bilye\",\"bina\",\"binbaşı\",\"binyıl\",\"bisiklet\",\"bisküvi\",\"bitki\",\"bizzat\",\"bodrum\",\"boğaz\",\"bohça\",\"bolero\",\"boncuk\",\"bonfile\",\"borsa\",\"boru\",\"bostan\",\"boşboğaz\",\"botanik\",\"boya\",\"boykot\",\"boynuz\",\"bozgun\",\"bozkır\",\"bölüm\",\"börek\",\"buçuk\",\"bugün\",\"buğday\",\"buhar\",\"buhran\",\"bulvar\",\"buram\",\"burçak\",\"burs\",\"burun\",\"butik\",\"buzdağı\",\"buzkıran\",\"bücür\",\"büfe\",\"bülten\",\"bütçe\",\"bütün\",\"büyük\",\"cacık\",\"cadı\",\"cahil\",\"cambaz\",\"canhıraş\",\"casus\",\"cazibe\",\"cehalet\",\"cehennem\",\"ceket\",\"cemre\",\"cenin\",\"cennet\",\"cepken\",\"cerrah\",\"cesur\",\"cetvel\",\"cevher\",\"ceylan\",\"cılız\",\"cıva\",\"cilt\",\"cisim\",\"ciyak\",\"coğrafya\",\"cömert\",\"cumba\",\"cüzdan\",\"çabucak\",\"çadır\",\"çağdaş\",\"çağlayan\",\"çağrı\",\"çakmak\",\"çalışkan\",\"çamaşır\",\"çapa\",\"çaput\",\"çarık\",\"çarpan\",\"çarşaf\",\"çayhane\",\"çekirdek\",\"çelebi\",\"çember\",\"çenet\",\"çengel\",\"çerçeve\",\"çerez\",\"çeşit\",\"çeşme\",\"çete\",\"çevre\",\"çeyiz\",\"çeyrek\",\"çığır\",\"çılgın\",\"çıngırak\",\"çift\",\"çiğdem\",\"çikolata\",\"çilek\",\"çimen\",\"çivi\",\"çoban\",\"çocuk\",\"çokgen\",\"çomak\",\"çorba\",\"çözelti\",\"çubuk\",\"çukur\",\"çuval\",\"çürük\",\"dağbaşı\",\"dağılım\",\"daktilo\",\"daldırış\",\"dalga\",\"dalkavuk\",\"damak\",\"damıtma\",\"damla\",\"dana\",\"dandik\",\"danışman\",\"daniska\",\"dantel\",\"dargeçit\",\"darphane\",\"davet\",\"dayı\",\"defter\",\"değer\",\"değirmen\",\"dehşet\",\"delgeç\",\"demir\",\"deneyim\",\"denge\",\"depo\",\"deprem\",\"derdest\",\"dere\",\"derhal\",\"derman\",\"dernek\",\"derviş\",\"desen\",\"destan\",\"dışarı\",\"dışbükey\",\"dijital\",\"dikbaşlı\",\"dilekçe\",\"dimağ\",\"dinamik\",\"dindar\",\"dinleme\",\"dinozor\",\"dipçik\",\"dipnot\",\"direniş\",\"dirsek\",\"disiplin\",\"disk\",\"divriği\",\"dizüstü\",\"dobra\",\"dodurga\",\"doğalgaz\",\"doktor\",\"doküman\",\"dolap\",\"donanım\",\"dondurma\",\"donör\",\"doruk\",\"dosdoğru\",\"dost\",\"dosya\",\"dozer\",\"döküm\",\"dönence\",\"dörtyol\",\"dövme\",\"dram\",\"dublaj\",\"durum\",\"duvak\",\"duyarga\",\"duyma\",\"duyuru\",\"düğme\",\"düğüm\",\"dükkan\",\"dünür\",\"düpedüz\",\"dürbün\",\"düşünür\",\"düzayak\",\"düzeltme\",\"ebeveyn\",\"ebru\",\"ecel\",\"ecnebi\",\"ecza\",\"edat\",\"edilgen\",\"efendi\",\"efor\",\"efsane\",\"egemen\",\"egzersiz\",\"eğrelti\",\"ekarte\",\"ekip\",\"eklem\",\"ekmek\",\"ekol\",\"ekonomi\",\"ekose\",\"ekran\",\"ekvator\",\"elaman\",\"elastik\",\"elbet\",\"elbise\",\"elçi\",\"eldiven\",\"elebaşı\",\"eleştiri\",\"elma\",\"eloğlu\",\"elveda\",\"emare\",\"emekçi\",\"emisyon\",\"emniyet\",\"empati\",\"emsal\",\"emzik\",\"endüstri\",\"enerji\",\"engebe\",\"engin\",\"enişte\",\"enkaz\",\"entari\",\"entegre\",\"entrika\",\"enzim\",\"erdem\",\"ergen\",\"erguvan\",\"erkek\",\"erozyon\",\"ertesi\",\"erzak\",\"esaret\",\"esenlik\",\"eser\",\"eski\",\"esnek\",\"eşarp\",\"eşofman\",\"eşraf\",\"eşya\",\"eşzaman\",\"etik\",\"etken\",\"etkinlik\",\"etüt\",\"evet\",\"evire\",\"evrak\",\"evrim\",\"eyalet\",\"eyvah\",\"ezber\",\"fabrika\",\"fanatik\",\"fanus\",\"fason\",\"fasulye\",\"fatih\",\"fatura\",\"fauna\",\"favori\",\"fayans\",\"fayton\",\"fazıl\",\"fazilet\",\"federal\",\"felsefe\",\"fener\",\"feribot\",\"fersah\",\"fesih\",\"festival\",\"feveran\",\"feza\",\"fıçı\",\"fıldır\",\"fındık\",\"fırça\",\"fırsat\",\"fırtına\",\"fıtık\",\"fidan\",\"fidye\",\"figür\",\"fihrist\",\"fikir\",\"fildişi\",\"filo\",\"filtre\",\"fincan\",\"firuze\",\"fitil\",\"fiyaka\",\"fizik\",\"flaş\",\"flüt\",\"fosil\",\"fren\",\"fukara\",\"futbol\",\"garabet\",\"gariban\",\"garnitür\",\"gazi\",\"gece\",\"gedik\",\"gelenek\",\"gelin\",\"gemi\",\"genç\",\"geniş\",\"geometri\",\"gerçek\",\"gevrek\",\"gezegen\",\"gezgin\",\"geziyolu\",\"gıcık\",\"gıda\",\"gıybet\",\"girdap\",\"girişim\",\"gitar\",\"giyecek\",\"giysi\",\"gizem\",\"gofret\",\"goril\",\"göbek\",\"göçebe\",\"göğüs\",\"gökdelen\",\"gökmen\",\"gökyüzü\",\"gölge\",\"gömlek\",\"gönül\",\"görenek\",\"görkemli\",\"görsel\",\"gösteri\",\"gövde\",\"gözaltı\",\"gözcü\",\"gözdağı\",\"gözleme\",\"gözyaşı\",\"grup\",\"gurbet\",\"gusül\",\"gübre\",\"güfte\",\"gümüş\",\"günaydın\",\"güncel\",\"gündüz\",\"güneş\",\"günyüzü\",\"gürbüz\",\"güvercin\",\"güzel\",\"haber\",\"hacamat\",\"hacim\",\"hademe\",\"hafız\",\"hafriyat\",\"hafta\",\"hakan\",\"hakem\",\"hakikat\",\"haksever\",\"halı\",\"hançer\",\"hane\",\"hangar\",\"hapis\",\"hapşırık\",\"harf\",\"haseki\",\"hasret\",\"hatun\",\"havuç\",\"haylaz\",\"haysiyet\",\"hayvan\",\"hedef\",\"hektar\",\"hemen\",\"hemfikir\",\"hendek\",\"hepsi\",\"hergele\",\"herhangi\",\"hesap\",\"heyecan\",\"heykel\",\"hezimet\",\"hıçkırık\",\"hızölçer\",\"hicviye\",\"hikaye\",\"hikmet\",\"hile\",\"hisse\",\"hobi\",\"hoca\",\"horlama\",\"hormon\",\"hoşbeş\",\"hoşgörü\",\"hoyrat\",\"hörgüç\",\"höyük\",\"hudut\",\"hukuk\",\"hunhar\",\"hurda\",\"huysuz\",\"huzur\",\"hücum\",\"hükümet\",\"hünkar\",\"hüviyet\",\"ırmak\",\"ısıölçer\",\"ısıtıcı\",\"ıspanak\",\"ısrar\",\"ışıldak\",\"ızdırap\",\"ızgara\",\"ibadet\",\"icat\",\"içbükey\",\"içecek\",\"içgüdü\",\"içsel\",\"idman\",\"iftihar\",\"iğne\",\"ihanet\",\"ihbar\",\"ihdas\",\"ihmal\",\"ihracat\",\"ihsan\",\"ikilem\",\"ikindi\",\"ikircik\",\"iklim\",\"iksir\",\"iktibas\",\"ilaç\",\"ilçe\",\"ileri\",\"iletişim\",\"ilgi\",\"ilhak\",\"ilkbahar\",\"ilkokul\",\"ilmek\",\"imkan\",\"imleç\",\"imsak\",\"imtihan\",\"imza\",\"ince\",\"inkar\",\"inşa\",\"ipek\",\"ipucu\",\"irade\",\"irfan\",\"irmik\",\"isabet\",\"iskele\",\"israf\",\"isyan\",\"işçi\",\"işgal\",\"işgüzar\",\"işlem\",\"itibar\",\"itiraf\",\"ivedi\",\"ivme\",\"iyileşme\",\"iyimser\",\"izbandut\",\"izci\",\"izdiham\",\"izin\",\"jakoben\",\"jandarma\",\"jargon\",\"kabadayı\",\"kablo\",\"kabus\",\"kaçamak\",\"kadeh\",\"kadın\",\"kadraj\",\"kafa\",\"kafkas\",\"kağıt\",\"kağnı\",\"kahkaha\",\"kahraman\",\"kahvaltı\",\"kakül\",\"kaldırım\",\"kale\",\"kalibre\",\"kalkan\",\"kalpak\",\"kamış\",\"kamyon\",\"kanat\",\"kandaş\",\"kanepe\",\"kanser\",\"kanun\",\"kaos\",\"kapı\",\"kaplıca\",\"kaptan\",\"karanlık\",\"kardeş\",\"karga\",\"karınca\",\"karmaşa\",\"karşıt\",\"kasırga\",\"kask\",\"kasvet\",\"katkı\",\"katman\",\"kavram\",\"kaygan\",\"kaynakça\",\"kayyum\",\"kedi\",\"kehanet\",\"kekik\",\"kelebek\",\"kenar\",\"kerkenez\",\"kerpiç\",\"kesirli\",\"kesmece\",\"kestane\",\"keşkek\",\"ketçap\",\"keyfiyet\",\"kıble\",\"kıdemli\",\"kılavuz\",\"kılçık\",\"kılıf\",\"kıraç\",\"kırmızı\",\"kırsal\",\"kısayol\",\"kısım\",\"kıskanç\",\"kısmet\",\"kışla\",\"kıvanç\",\"kıvılcım\",\"kıvrık\",\"kıyafet\",\"kıymetli\",\"kızak\",\"kızılcık\",\"kibar\",\"kinaye\",\"kira\",\"kiremit\",\"kirli\",\"kirpik\",\"kişisel\",\"kitap\",\"koçbaşı\",\"kodaman\",\"koğuş\",\"kokteyl\",\"kolaycı\",\"kolbastı\",\"kolonya\",\"koltuk\",\"kolye\",\"kombine\",\"komedyen\",\"komiser\",\"komposto\",\"komşu\",\"komuta\",\"konak\",\"konfor\",\"koni\",\"konsül\",\"kopya\",\"korkusuz\",\"korna\",\"korse\",\"korunak\",\"korvet\",\"kostüm\",\"koşul\",\"koyu\",\"kozmik\",\"köfte\",\"kökensel\",\"köprücük\",\"köpük\",\"kördüğüm\",\"körfez\",\"köstebek\",\"köşegen\",\"kötü\",\"kravat\",\"kriter\",\"kuantum\",\"kudurma\",\"kuluçka\",\"kulübe\",\"kumanya\",\"kumbara\",\"kumlu\",\"kumpir\",\"kumral\",\"kundura\",\"kupa\",\"kupkuru\",\"kuramsal\",\"kurbağa\",\"kurdele\",\"kurgu\",\"kurmay\",\"kurşun\",\"kurtuluş\",\"kurultay\",\"kurye\",\"kusursuz\",\"kuşak\",\"kuşbaşı\",\"kuşkulu\",\"kutlama\",\"kutsal\",\"kutup\",\"kuver\",\"kuyruk\",\"kuzey\",\"kuzgun\",\"küçük\",\"külçe\",\"külfet\",\"külliye\",\"kültürel\",\"kümes\",\"künefe\",\"küresel\",\"kütle\",\"lahana\",\"lahmacun\",\"lamba\",\"lansman\",\"lavaş\",\"layık\",\"leğen\",\"levent\",\"leziz\",\"lezzet\",\"lider\",\"likide\",\"liman\",\"liste\",\"litre\",\"liyakat\",\"lodos\",\"lokanta\",\"lokman\",\"lokum\",\"lunapark\",\"lütfen\",\"lüzum\",\"nokta\",\"mabet\",\"macera\",\"macun\",\"madalya\",\"madde\",\"madem\",\"mağara\",\"mağdur\",\"mağfiret\",\"mağlup\",\"mahalle\",\"mahcup\",\"mahir\",\"mahkeme\",\"mahlas\",\"mahrum\",\"mahsul\",\"makas\",\"makbuz\",\"makine\",\"makro\",\"maksat\",\"makul\",\"maliye\",\"manav\",\"mangal\",\"manidar\",\"manken\",\"mantık\",\"manzara\",\"mareşal\",\"margarin\",\"marifet\",\"market\",\"marmelat\",\"masaüstü\",\"masmavi\",\"masraf\",\"masum\",\"matah\",\"materyal\",\"matrak\",\"maval\",\"mavra\",\"maydanoz\",\"mayhoş\",\"maytap\",\"mazbata\",\"mazeret\",\"mazlum\",\"mazot\",\"mazur\",\"meblağ\",\"mebus\",\"mecaz\",\"mecbur\",\"meclis\",\"mecmua\",\"mecnun\",\"meçhul\",\"medeni\",\"mehtap\",\"mekanik\",\"melodi\",\"meltem\",\"memur\",\"mendil\",\"menekşe\",\"menteşe\",\"meraklı\",\"mercek\",\"merdiven\",\"merhaba\",\"merinos\",\"merkez\",\"mermi\",\"mert\",\"mesafe\",\"mesele\",\"mesken\",\"meslek\",\"meşale\",\"meşgul\",\"meşhur\",\"metafor\",\"metin\",\"metre\",\"mevcut\",\"mevkidaş\",\"meydan\",\"meyil\",\"meyve\",\"meziyet\",\"mezun\",\"mıknatıs\",\"mısra\",\"mızıka\",\"miğfer\",\"mihrak\",\"mikrofon\",\"miktar\",\"milat\",\"milli\",\"mimar\",\"minare\",\"mineral\",\"minik\",\"minyon\",\"mirliva\",\"misafir\",\"miskin\",\"miting\",\"miyop\",\"mizah\",\"mobilya\",\"model\",\"monitör\",\"morötesi\",\"motive\",\"motor\",\"mozaik\",\"muavin\",\"mucize\",\"muhafız\",\"muhteşem\",\"mukayese\",\"mumya\",\"musluk\",\"muşamba\",\"mutabık\",\"mutfak\",\"mutlu\",\"muzaffer\",\"muzdarip\",\"mübarek\",\"mücadele\",\"müdür\",\"müfredat\",\"müftü\",\"mühendis\",\"mühim\",\"mühlet\",\"mükemmel\",\"mülk\",\"mümkün\",\"mümtaz\",\"müsrif\",\"müstesna\",\"müşahit\",\"müşteri\",\"mütercim\",\"müthiş\",\"müze\",\"müzik\",\"nabız\",\"nadas\",\"nadir\",\"nahoş\",\"nakarat\",\"nakış\",\"nalbur\",\"namlu\",\"namus\",\"nankör\",\"nargile\",\"narkoz\",\"nasıl\",\"nasip\",\"naylon\",\"nazar\",\"nazım\",\"nazik\",\"neden\",\"nefes\",\"negatif\",\"neon\",\"neptün\",\"nerede\",\"nesil\",\"nesnel\",\"neşeli\",\"netice\",\"nevresim\",\"neyse\",\"neyzen\",\"nezaket\",\"nezih\",\"nezle\",\"nicel\",\"nilüfer\",\"nimet\",\"nisan\",\"nispet\",\"nitekim\",\"nizam\",\"nohut\",\"noksan\",\"normal\",\"nostalji\",\"noter\",\"nöbet\",\"numara\",\"numune\",\"nutuk\",\"nüfus\",\"obabaşı\",\"obez\",\"obje\",\"ocak\",\"odun\",\"ofansif\",\"ofis\",\"oğlak\",\"oğuz\",\"okçu\",\"oklava\",\"oksijen\",\"okul\",\"okumuş\",\"okutman\",\"okuyucu\",\"okyanus\",\"olağan\",\"olanak\",\"olası\",\"olay\",\"olgun\",\"olimpik\",\"olumlu\",\"omlet\",\"omurga\",\"onarım\",\"onursal\",\"opera\",\"optik\",\"oral\",\"orantı\",\"ordu\",\"organik\",\"orijin\",\"orkide\",\"orman\",\"orta\",\"oruç\",\"otağ\",\"otantik\",\"otel\",\"otoban\",\"otogar\",\"otomobil\",\"otonom\",\"otopark\",\"otorite\",\"otoyol\",\"oturum\",\"oyuk\",\"oyuncak\",\"ozan\",\"ödeme\",\"ödenek\",\"ödev\",\"ödül\",\"ödünç\",\"öfke\",\"öğlen\",\"öğrenci\",\"öğün\",\"öğütücü\",\"öksürük\",\"ölçme\",\"ölçü\",\"ölümsüz\",\"ömür\",\"önayak\",\"öncü\",\"önder\",\"önem\",\"önerge\",\"öngörü\",\"önlük\",\"önsezi\",\"öpücük\",\"ördek\",\"örgü\",\"örtbas\",\"örtme\",\"örtü\",\"örümcek\",\"örüntü\",\"öteberi\",\"öteki\",\"övünç\",\"öykü\",\"öyleyse\",\"özçekim\",\"özdeyiş\",\"özel\",\"özenti\",\"özerk\",\"özgürlük\",\"özlem\",\"özlü\",\"özne\",\"özsever\",\"özümseme\",\"özür\",\"özveri\",\"pabuç\",\"padişah\",\"palamut\",\"palmiye\",\"palto\",\"palyaço\",\"pamuk\",\"panayır\",\"pancar\",\"panda\",\"panel\",\"panik\",\"panjur\",\"pankart\",\"pano\",\"pansuman\",\"pantolon\",\"panzehir\",\"papatya\",\"papyon\",\"paraşüt\",\"parça\",\"pardösü\",\"parfüm\",\"parıltı\",\"parkur\",\"parmak\",\"parodi\",\"parsel\",\"partner\",\"pasaport\",\"pasif\",\"paskalya\",\"pastırma\",\"paşa\",\"patates\",\"paten\",\"patika\",\"patlıcan\",\"patolog\",\"patron\",\"payanda\",\"paydaş\",\"payidar\",\"paylaşma\",\"paytak\",\"peçete\",\"pedal\",\"peder\",\"pehlivan\",\"pekala\",\"pekmez\",\"pelerin\",\"pelikan\",\"pelüş\",\"pembe\",\"pena\",\"pencere\",\"pense\",\"perçin\",\"perde\",\"pergel\",\"perişan\",\"peron\",\"personel\",\"perşembe\",\"peruk\",\"pervane\",\"pespaye\",\"pestil\",\"peşin\",\"petek\",\"petrol\",\"petunya\",\"peynir\",\"peyzaj\",\"pınar\",\"pırasa\",\"pırlanta\",\"pide\",\"pikap\",\"piknik\",\"pilav\",\"piliç\",\"pilot\",\"pipet\",\"pipo\",\"piramit\",\"pirinç\",\"pirzola\",\"pist\",\"pişik\",\"pişman\",\"piyasa\",\"piyes\",\"plaj\",\"plaket\",\"planlama\",\"platform\",\"plazma\",\"podyum\",\"poğaça\",\"polat\",\"polen\",\"politika\",\"pompa\",\"popüler\",\"porselen\",\"portakal\",\"posa\",\"poster\",\"poşet\",\"poyraz\",\"pozitif\",\"pranga\",\"pratik\",\"prenses\",\"prim\",\"problem\",\"profil\",\"program\",\"proje\",\"protokol\",\"prova\",\"puan\",\"pudra\",\"pusula\",\"püre\",\"pürüz\",\"püstül\",\"püsür\",\"racon\",\"radar\",\"radikal\",\"radyo\",\"rafadan\",\"rafine\",\"rağbet\",\"rahat\",\"rahle\",\"rakam\",\"raket\",\"rakip\",\"rakun\",\"ralli\",\"rampa\",\"randevu\",\"ranza\",\"rapor\",\"rastgele\",\"rasyonel\",\"razı\",\"realite\",\"reçine\",\"refah\",\"referans\",\"refik\",\"reform\",\"rehber\",\"rehin\",\"reis\",\"rekabet\",\"reklam\",\"rekor\",\"rektör\",\"renk\",\"resim\",\"resmen\",\"restoran\",\"retorik\",\"revaç\",\"revize\",\"reyon\",\"rezalet\",\"rezerv\",\"rezil\",\"rıhtım\",\"rıza\",\"ritim\",\"ritüel\",\"rivayet\",\"robot\",\"roman\",\"rota\",\"rozet\",\"röportaj\",\"rötar\",\"ruble\",\"ruhban\",\"ruhsat\",\"rulet\",\"rulo\",\"runik\",\"rutin\",\"rutubet\",\"rüşvet\",\"rütbe\",\"rüya\",\"rüzgar\",\"sabah\",\"sabıka\",\"sabit\",\"sabun\",\"saçma\",\"sade\",\"sadık\",\"safahat\",\"safdil\",\"safkan\",\"sağanak\",\"sağduyu\",\"sağlam\",\"saha\",\"sahiden\",\"sahne\",\"sakal\",\"sakız\",\"sakin\",\"saklama\",\"saksağan\",\"salamura\",\"salça\",\"salgı\",\"salınım\",\"salkım\",\"salon\",\"saltanat\",\"sanatçı\",\"sancak\",\"sandalye\",\"saniye\",\"saplantı\",\"sapsız\",\"saray\",\"sarışın\",\"sarkık\",\"sarmaşık\",\"satır\",\"savaşım\",\"savunma\",\"saydam\",\"sayfa\",\"saygın\",\"sayısal\",\"sebep\",\"seçenek\",\"seçim\",\"seçkin\",\"seçmen\",\"seda\",\"sedir\",\"sedye\",\"sefer\",\"sehpa\",\"sekizgen\",\"selektör\",\"selvi\",\"semavi\",\"sembol\",\"seminer\",\"senaryo\",\"sendika\",\"senkron\",\"sensör\",\"sentez\",\"sepet\",\"seramik\",\"serbest\",\"serdar\",\"seremoni\",\"sergi\",\"serhat\",\"serin\",\"sermaye\",\"serpuş\",\"sersem\",\"serüven\",\"servis\",\"sesli\",\"sesteş\",\"sevap\",\"seviye\",\"seyahat\",\"seyirci\",\"sezon\",\"sıcak\",\"sıfat\",\"sıhhi\",\"sınanma\",\"sınır\",\"sıradan\",\"sırdaş\",\"sırma\",\"sırtüstü\",\"sızgıt\",\"siftah\",\"sigorta\",\"sihirbaz\",\"silah\",\"silecek\",\"silindir\",\"simetri\",\"simge\",\"simit\",\"sincap\",\"sindirim\",\"sinema\",\"sinirli\",\"sipariş\",\"sirke\",\"siroz\",\"sistem\",\"sivilce\",\"siyasi\",\"slogan\",\"soba\",\"sofra\",\"soğuk\",\"sohbet\",\"sokak\",\"solfej\",\"solunum\",\"somut\",\"sonbahar\",\"sonraki\",\"sonsuz\",\"sorunsuz\",\"sosyete\",\"soyağacı\",\"soydaş\",\"soygun\",\"soytarı\",\"söğüş\",\"sömürge\",\"sönük\",\"söylem\",\"sözcük\",\"sözde\",\"spatula\",\"spektrum\",\"spiker\",\"spiral\",\"sponsor\",\"sporcu\",\"sprey\",\"stabil\",\"statü\",\"stok\",\"stopaj\",\"strateji\",\"subay\",\"sucuk\",\"suçüstü\",\"suhulet\",\"sulama\",\"sungur\",\"sunucu\",\"surat\",\"susam\",\"suskun\",\"sükse\",\"sükut\",\"sülale\",\"sünger\",\"süpürge\",\"sürahi\",\"süreç\",\"sürgün\",\"sürüm\",\"süsleme\",\"sütanne\",\"sütlaç\",\"sütun\",\"süvari\",\"şahane\",\"şahbaz\",\"şahit\",\"şahsiyet\",\"şakıma\",\"şaklaban\",\"şakrak\",\"şamar\",\"şampiyon\",\"şanslı\",\"şantiye\",\"şapka\",\"şarkıcı\",\"şartname\",\"şaşırma\",\"şaşkın\",\"şatafat\",\"şayet\",\"şebeke\",\"şefkat\",\"şeftali\",\"şehir\",\"şehvet\",\"şeker\",\"şekil\",\"şelale\",\"şema\",\"şemsiye\",\"şerbet\",\"şeref\",\"şerit\",\"şımarık\",\"şıpıdık\",\"şifre\",\"şimdi\",\"şimşek\",\"şipşak\",\"şirin\",\"şişe\",\"şişirme\",\"şofben\",\"şöhret\",\"şölen\",\"şüphe\",\"tabaka\",\"tabela\",\"tabure\",\"tadilat\",\"taharet\",\"tahıl\",\"tahkim\",\"tahlil\",\"tahmin\",\"tahrifat\",\"tahsilat\",\"tahta\",\"taklit\",\"takoz\",\"taksici\",\"taktik\",\"takvim\",\"talebe\",\"talip\",\"tamamen\",\"tamirci\",\"tampon\",\"tamtakır\",\"tandır\",\"tanecik\",\"tanıtım\",\"tanrı\",\"tansiyon\",\"tapan\",\"tapınak\",\"taptaze\",\"tapu\",\"tarafgir\",\"tarhana\",\"tarım\",\"tarih\",\"tarla\",\"tartak\",\"tarumar\",\"tasarım\",\"tasdik\",\"taslak\",\"tastamam\",\"taşeron\",\"taşınmaz\",\"taşra\",\"tatava\",\"tatbikat\",\"tatil\",\"tatlı\",\"tavsiye\",\"tavşan\",\"tavuk\",\"taze\",\"taziye\",\"tazminat\",\"tebeşir\",\"tebrik\",\"tecrübe\",\"teçhizat\",\"tedarik\",\"tedbir\",\"teftiş\",\"teğet\",\"teğmen\",\"tehdit\",\"tehlike\",\"tekdüze\",\"tekerlek\",\"tekme\",\"teknik\",\"tekrar\",\"telef\",\"telsiz\",\"telve\",\"temas\",\"tembel\",\"temiz\",\"temkin\",\"tempo\",\"temsilci\",\"tendon\",\"teneke\",\"tenha\",\"tenkit\",\"tepegöz\",\"tepki\",\"terazi\",\"terbiye\",\"tercih\",\"tereyağı\",\"terfi\",\"terim\",\"terminal\",\"tersane\",\"tertip\",\"tesadüf\",\"tescil\",\"tesir\",\"teslimat\",\"tespit\",\"testere\",\"teşekkür\",\"teşhir\",\"teşrif\",\"teşvik\",\"teyze\",\"tezahür\",\"tezgah\",\"tıbbi\",\"tıkaç\",\"tıkışık\",\"tıknaz\",\"tılsım\",\"tıpkı\",\"tıraş\",\"tırışka\",\"tırmanış\",\"tırnak\",\"tırpan\",\"tıslama\",\"ticaret\",\"tilki\",\"tiryaki\",\"titreşim\",\"tohum\",\"tokat\",\"tolere\",\"tomar\",\"tombak\",\"tomurcuk\",\"topaç\",\"toplum\",\"toprak\",\"toptan\",\"toraman\",\"torpido\",\"tortu\",\"tosbağa\",\"toynak\",\"tören\",\"trafik\",\"trajedi\",\"tramvay\",\"transfer\",\"tribün\",\"triko\",\"tugay\",\"tuğla\",\"tuğrul\",\"tuhaf\",\"tulumba\",\"tunç\",\"turan\",\"turkuaz\",\"turnusol\",\"turşu\",\"turuncu\",\"tutanak\",\"tutkal\",\"tutsak\",\"tutum\",\"tuyuğ\",\"tuzlu\",\"tüccar\",\"tüfek\",\"tükenmez\",\"tülbent\",\"tümleç\",\"tünel\",\"türbin\",\"türev\",\"türk\",\"tüzük\",\"ucube\",\"ucuz\",\"uçak\",\"uçurtma\",\"ufuk\",\"uğrak\",\"uğur\",\"ukala\",\"ulaşım\",\"ulema\",\"ulus\",\"ulvi\",\"umursama\",\"umut\",\"unutkan\",\"uslu\",\"ustabaşı\",\"ustura\",\"usul\",\"utangaç\",\"uyanık\",\"uyarı\",\"uydu\",\"uygar\",\"uygulama\",\"uykusuz\",\"uysal\",\"uyuşma\",\"uzantı\",\"uzay\",\"uzgören\",\"uzlaşma\",\"uzman\",\"uzun\",\"ücra\",\"ücret\",\"üçbudak\",\"üçgen\",\"üçkağıt\",\"üçleme\",\"üfürük\",\"ülke\",\"ümit\",\"üniforma\",\"ünite\",\"ünlem\",\"üretken\",\"ürün\",\"üslup\",\"üstel\",\"üstün\",\"üşengeç\",\"üşüme\",\"ütopya\",\"üvey\",\"üzengi\",\"üzgün\",\"üzüm\",\"vagon\",\"vaka\",\"vakfiye\",\"vakıf\",\"vakit\",\"vakum\",\"vapur\",\"varil\",\"varlık\",\"varsayım\",\"varyemez\",\"vasıta\",\"vasiyet\",\"vatandaş\",\"vazife\",\"vazo\",\"veciz\",\"vefa\",\"vehim\",\"veliaht\",\"veresiye\",\"verimli\",\"verkaç\",\"vernik\",\"vertigo\",\"vesait\",\"vesika\",\"vestiyer\",\"veznedar\",\"vicdan\",\"vilayet\",\"virane\",\"virgül\",\"vişne\",\"vites\",\"vokal\",\"volkan\",\"vurma\",\"vurucu\",\"vücut\",\"yabancı\",\"yabgu\",\"yağış\",\"yağlı\",\"yağmur\",\"yakamoz\",\"yakın\",\"yaklaşık\",\"yalçın\",\"yalıtım\",\"yaman\",\"yanardağ\",\"yangın\",\"yanıt\",\"yankı\",\"yanlış\",\"yansıma\",\"yapay\",\"yapboz\",\"yapımcı\",\"yaprak\",\"yaratık\",\"yarbay\",\"yardım\",\"yargıç\",\"yarıçap\",\"yasemin\",\"yastık\",\"yaşam\",\"yatak\",\"yatırım\",\"yavru\",\"yaygara\",\"yayıncı\",\"yayla\",\"yazılım\",\"yekpare\",\"yekvücut\",\"yelkovan\",\"yelpaze\",\"yemek\",\"yemiş\",\"yengeç\",\"yeniçeri\",\"yeraltı\",\"yerküre\",\"yerleşke\",\"yeryüzü\",\"yeşil\",\"yetenek\",\"yetkili\",\"yığınak\",\"yıkama\",\"yılbaşı\",\"yıldırım\",\"yılkı\",\"yılmaz\",\"yırtıcı\",\"yiğit\",\"yoğurt\",\"yokuş\",\"yolcu\",\"yoldaş\",\"yolgeçen\",\"yolkesen\",\"yolüstü\",\"yordam\",\"yorgan\",\"yorumcu\",\"yosun\",\"yöndeş\",\"yönetim\",\"yönlü\",\"yöntem\",\"yöresel\",\"yörünge\",\"yufka\",\"yukarı\",\"yumruk\",\"yumurta\",\"yuvarlak\",\"yücelme\",\"yükçeker\",\"yüklem\",\"yüksek\",\"yürek\",\"yürütme\",\"yüzde\",\"yüzeysel\",\"yüzgeç\",\"yüzüstü\",\"yüzyıl\",\"zabıta\",\"zafer\",\"zahmet\",\"zambak\",\"zaptiye\",\"zarafet\",\"zaruret\",\"zeka\",\"zekice\",\"zemberek\",\"zemin\",\"zencefil\",\"zeplin\",\"zeytin\",\"zıbın\",\"zılgıt\",\"zımbırtı\",\"zımpara\",\"zıpkın\",\"zigon\",\"zihinsel\",\"zihniyet\",\"zincir\",\"zindan\",\"zirzop\",\"ziyaret\",\"ziynet\",\"zoraki\",\"zorlu\",\"zorunlu\",\"züğürt\",\"zümre\"]{\n  \"name\": \"bip39\",\n  \"version\": \"3.1.0\",\n  \"description\": \"Bitcoin BIP39: Mnemonic code for generating deterministic keys\",\n  \"main\": \"src/index.js\",\n  \"types\": \"./types/index.d.ts\",\n  \"scripts\": {\n    \"build\": \"npm run clean && tsc -p tsconfig.json\",\n    \"clean\": \"rm -rf src\",\n    \"coverage\": \"nyc --branches 85 --functions 100 --check-coverage npm run unit\",\n    \"format\": \"npm run prettier -- --write\",\n    \"format:ci\": \"npm run prettier -- --check\",\n    \"gitdiff:ci\": \"npm run build && git diff --exit-code\",\n    \"lint\": \"tslint -p tsconfig.json -c tslint.json\",\n    \"prettier\": \"prettier 'ts_src/**/*.ts' --ignore-path ./.prettierignore\",\n    \"test\": \"npm run build && npm run format:ci && npm run lint && npm run unit\",\n    \"unit\": \"tape test/*.js\",\n    \"update\": \"node -e \\\"require('./util/wordlists').update()\\\"\"\n  },\n  \"author\": \"Wei Lu\",\n  \"contributors\": [\n    {\n      \"name\": \"Daniel Cousens\",\n      \"email\": \"email@dcousens.com\",\n      \"url\": \"http://dcousens.com\"\n    }\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/bip39.git\"\n  },\n  \"license\": \"ISC\",\n  \"files\": [\n    \"src\",\n    \"types\"\n  ],\n  \"dependencies\": {\n    \"@noble/hashes\": \"^1.2.0\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"11.11.6\",\n    \"node-fetch\": \"2.6.9\",\n    \"nyc\": \"^15.0.0\",\n    \"prettier\": \"1.16.4\",\n    \"proxyquire\": \"^1.7.10\",\n    \"tape\": \"^4.13.2\",\n    \"tslint\": \"^6.1.0\",\n    \"typescript\": \"3.3.4000\"\n  }\n}\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// browserify by default only pulls in files that are hard coded in requires\n// In order of last to first in this file, the default wordlist will be chosen\n// based on what is present. (Bundles may remove wordlists they don't need)\nconst wordlists = {};\nexports.wordlists = wordlists;\nlet _default;\nexports._default = _default;\ntry {\n    exports._default = _default = require('./wordlists/czech.json');\n    wordlists.czech = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/chinese_simplified.json');\n    wordlists.chinese_simplified = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/chinese_traditional.json');\n    wordlists.chinese_traditional = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/korean.json');\n    wordlists.korean = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/french.json');\n    wordlists.french = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/italian.json');\n    wordlists.italian = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/spanish.json');\n    wordlists.spanish = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/japanese.json');\n    wordlists.japanese = _default;\n    wordlists.JA = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/portuguese.json');\n    wordlists.portuguese = _default;\n}\ncatch (err) { }\ntry {\n    exports._default = _default = require('./wordlists/english.json');\n    wordlists.english = _default;\n    wordlists.EN = _default;\n}\ncatch (err) { }\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst sha256_1 = require(\"@noble/hashes/sha256\");\nconst sha512_1 = require(\"@noble/hashes/sha512\");\nconst pbkdf2_1 = require(\"@noble/hashes/pbkdf2\");\nconst utils_1 = require(\"@noble/hashes/utils\");\nconst _wordlists_1 = require(\"./_wordlists\");\nlet DEFAULT_WORDLIST = _wordlists_1._default;\nconst INVALID_MNEMONIC = 'Invalid mnemonic';\nconst INVALID_ENTROPY = 'Invalid entropy';\nconst INVALID_CHECKSUM = 'Invalid mnemonic checksum';\nconst WORDLIST_REQUIRED = 'A wordlist is required but a default could not be found.\\n' +\n    'Please pass a 2048 word array explicitly.';\nfunction normalize(str) {\n    return (str || '').normalize('NFKD');\n}\nfunction lpad(str, padString, length) {\n    while (str.length < length) {\n        str = padString + str;\n    }\n    return str;\n}\nfunction binaryToByte(bin) {\n    return parseInt(bin, 2);\n}\nfunction bytesToBinary(bytes) {\n    return bytes.map((x) => lpad(x.toString(2), '0', 8)).join('');\n}\nfunction deriveChecksumBits(entropyBuffer) {\n    const ENT = entropyBuffer.length * 8;\n    const CS = ENT / 32;\n    const hash = sha256_1.sha256(Uint8Array.from(entropyBuffer));\n    return bytesToBinary(Array.from(hash)).slice(0, CS);\n}\nfunction salt(password) {\n    return 'mnemonic' + (password || '');\n}\nfunction mnemonicToSeedSync(mnemonic, password) {\n    const mnemonicBuffer = Uint8Array.from(Buffer.from(normalize(mnemonic), 'utf8'));\n    const saltBuffer = Uint8Array.from(Buffer.from(salt(normalize(password)), 'utf8'));\n    const res = pbkdf2_1.pbkdf2(sha512_1.sha512, mnemonicBuffer, saltBuffer, {\n        c: 2048,\n        dkLen: 64,\n    });\n    return Buffer.from(res);\n}\nexports.mnemonicToSeedSync = mnemonicToSeedSync;\nfunction mnemonicToSeed(mnemonic, password) {\n    const mnemonicBuffer = Uint8Array.from(Buffer.from(normalize(mnemonic), 'utf8'));\n    const saltBuffer = Uint8Array.from(Buffer.from(salt(normalize(password)), 'utf8'));\n    return pbkdf2_1.pbkdf2Async(sha512_1.sha512, mnemonicBuffer, saltBuffer, {\n        c: 2048,\n        dkLen: 64,\n    }).then((res) => Buffer.from(res));\n}\nexports.mnemonicToSeed = mnemonicToSeed;\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n    wordlist = wordlist || DEFAULT_WORDLIST;\n    if (!wordlist) {\n        throw new Error(WORDLIST_REQUIRED);\n    }\n    const words = normalize(mnemonic).split(' ');\n    if (words.length % 3 !== 0) {\n        throw new Error(INVALID_MNEMONIC);\n    }\n    // convert word indices to 11 bit binary strings\n    const bits = words\n        .map((word) => {\n        const index = wordlist.indexOf(word);\n        if (index === -1) {\n            throw new Error(INVALID_MNEMONIC);\n        }\n        return lpad(index.toString(2), '0', 11);\n    })\n        .join('');\n    // split the binary string into ENT/CS\n    const dividerIndex = Math.floor(bits.length / 33) * 32;\n    const entropyBits = bits.slice(0, dividerIndex);\n    const checksumBits = bits.slice(dividerIndex);\n    // calculate the checksum and compare\n    const entropyBytes = entropyBits.match(/(.{1,8})/g).map(binaryToByte);\n    if (entropyBytes.length < 16) {\n        throw new Error(INVALID_ENTROPY);\n    }\n    if (entropyBytes.length > 32) {\n        throw new Error(INVALID_ENTROPY);\n    }\n    if (entropyBytes.length % 4 !== 0) {\n        throw new Error(INVALID_ENTROPY);\n    }\n    const entropy = Buffer.from(entropyBytes);\n    const newChecksum = deriveChecksumBits(entropy);\n    if (newChecksum !== checksumBits) {\n        throw new Error(INVALID_CHECKSUM);\n    }\n    return entropy.toString('hex');\n}\nexports.mnemonicToEntropy = mnemonicToEntropy;\nfunction entropyToMnemonic(entropy, wordlist) {\n    if (!Buffer.isBuffer(entropy)) {\n        entropy = Buffer.from(entropy, 'hex');\n    }\n    wordlist = wordlist || DEFAULT_WORDLIST;\n    if (!wordlist) {\n        throw new Error(WORDLIST_REQUIRED);\n    }\n    // 128 <= ENT <= 256\n    if (entropy.length < 16) {\n        throw new TypeError(INVALID_ENTROPY);\n    }\n    if (entropy.length > 32) {\n        throw new TypeError(INVALID_ENTROPY);\n    }\n    if (entropy.length % 4 !== 0) {\n        throw new TypeError(INVALID_ENTROPY);\n    }\n    const entropyBits = bytesToBinary(Array.from(entropy));\n    const checksumBits = deriveChecksumBits(entropy);\n    const bits = entropyBits + checksumBits;\n    const chunks = bits.match(/(.{1,11})/g);\n    const words = chunks.map((binary) => {\n        const index = binaryToByte(binary);\n        return wordlist[index];\n    });\n    return wordlist[0] === '\\u3042\\u3044\\u3053\\u304f\\u3057\\u3093' // Japanese wordlist\n        ? words.join('\\u3000')\n        : words.join(' ');\n}\nexports.entropyToMnemonic = entropyToMnemonic;\nfunction generateMnemonic(strength, rng, wordlist) {\n    strength = strength || 128;\n    if (strength % 32 !== 0) {\n        throw new TypeError(INVALID_ENTROPY);\n    }\n    rng = rng || ((size) => Buffer.from(utils_1.randomBytes(size)));\n    return entropyToMnemonic(rng(strength / 8), wordlist);\n}\nexports.generateMnemonic = generateMnemonic;\nfunction validateMnemonic(mnemonic, wordlist) {\n    try {\n        mnemonicToEntropy(mnemonic, wordlist);\n    }\n    catch (e) {\n        return false;\n    }\n    return true;\n}\nexports.validateMnemonic = validateMnemonic;\nfunction setDefaultWordlist(language) {\n    const result = _wordlists_1.wordlists[language];\n    if (result) {\n        DEFAULT_WORDLIST = result;\n    }\n    else {\n        throw new Error('Could not find wordlist for language \"' + language + '\"');\n    }\n}\nexports.setDefaultWordlist = setDefaultWordlist;\nfunction getDefaultWordlist() {\n    if (!DEFAULT_WORDLIST) {\n        throw new Error('No Default Wordlist set');\n    }\n    return Object.keys(_wordlists_1.wordlists).filter((lang) => {\n        if (lang === 'JA' || lang === 'EN') {\n            return false;\n        }\n        return _wordlists_1.wordlists[lang].every((word, index) => word === DEFAULT_WORDLIST[index]);\n    })[0];\n}\nexports.getDefaultWordlist = getDefaultWordlist;\nvar _wordlists_2 = require(\"./_wordlists\");\nexports.wordlists = _wordlists_2.wordlists;\n[\n    \"的\",\n    \"一\",\n    \"是\",\n    \"在\",\n    \"不\",\n    \"了\",\n    \"有\",\n    \"和\",\n    \"人\",\n    \"这\",\n    \"中\",\n    \"大\",\n    \"为\",\n    \"上\",\n    \"个\",\n    \"国\",\n    \"我\",\n    \"以\",\n    \"要\",\n    \"他\",\n    \"时\",\n    \"来\",\n    \"用\",\n    \"们\",\n    \"生\",\n    \"到\",\n    \"作\",\n    \"地\",\n    \"于\",\n    \"出\",\n    \"就\",\n    \"分\",\n    \"对\",\n    \"成\",\n    \"会\",\n    \"可\",\n    \"主\",\n    \"发\",\n    \"年\",\n    \"动\",\n    \"同\",\n    \"工\",\n    \"也\",\n    \"能\",\n    \"下\",\n    \"过\",\n    \"子\",\n    \"说\",\n    \"产\",\n    \"种\",\n    \"面\",\n    \"而\",\n    \"方\",\n    \"后\",\n    \"多\",\n    \"定\",\n    \"行\",\n    \"学\",\n    \"法\",\n    \"所\",\n    \"民\",\n    \"得\",\n    \"经\",\n    \"十\",\n    \"三\",\n    \"之\",\n    \"进\",\n    \"着\",\n    \"等\",\n    \"部\",\n    \"度\",\n    \"家\",\n    \"电\",\n    \"力\",\n    \"里\",\n    \"如\",\n    \"水\",\n    \"化\",\n    \"高\",\n    \"自\",\n    \"二\",\n    \"理\",\n    \"起\",\n    \"小\",\n    \"物\",\n    \"现\",\n    \"实\",\n    \"加\",\n    \"量\",\n    \"都\",\n    \"两\",\n    \"体\",\n    \"制\",\n    \"机\",\n    \"当\",\n    \"使\",\n    \"点\",\n    \"从\",\n    \"业\",\n    \"本\",\n    \"去\",\n    \"把\",\n    \"性\",\n    \"好\",\n    \"应\",\n    \"开\",\n    \"它\",\n    \"合\",\n    \"还\",\n    \"因\",\n    \"由\",\n    \"其\",\n    \"些\",\n    \"然\",\n    \"前\",\n    \"外\",\n    \"天\",\n    \"政\",\n    \"四\",\n    \"日\",\n    \"那\",\n    \"社\",\n    \"义\",\n    \"事\",\n    \"平\",\n    \"形\",\n    \"相\",\n    \"全\",\n    \"表\",\n    \"间\",\n    \"样\",\n    \"与\",\n    \"关\",\n    \"各\",\n    \"重\",\n    \"新\",\n    \"线\",\n    \"内\",\n    \"数\",\n    \"正\",\n    \"心\",\n    \"反\",\n    \"你\",\n    \"明\",\n    \"看\",\n    \"原\",\n    \"又\",\n    \"么\",\n    \"利\",\n    \"比\",\n    \"或\",\n    \"但\",\n    \"质\",\n    \"气\",\n    \"第\",\n    \"向\",\n    \"道\",\n    \"命\",\n    \"此\",\n    \"变\",\n    \"条\",\n    \"只\",\n    \"没\",\n    \"结\",\n    \"解\",\n    \"问\",\n    \"意\",\n    \"建\",\n    \"月\",\n    \"公\",\n    \"无\",\n    \"系\",\n    \"军\",\n    \"很\",\n    \"情\",\n    \"者\",\n    \"最\",\n    \"立\",\n    \"代\",\n    \"想\",\n    \"已\",\n    \"通\",\n    \"并\",\n    \"提\",\n    \"直\",\n    \"题\",\n    \"党\",\n    \"程\",\n    \"展\",\n    \"五\",\n    \"果\",\n    \"料\",\n    \"象\",\n    \"员\",\n    \"革\",\n    \"位\",\n    \"入\",\n    \"常\",\n    \"文\",\n    \"总\",\n    \"次\",\n    \"品\",\n    \"式\",\n    \"活\",\n    \"设\",\n    \"及\",\n    \"管\",\n    \"特\",\n    \"件\",\n    \"长\",\n    \"求\",\n    \"老\",\n    \"头\",\n    \"基\",\n    \"资\",\n    \"边\",\n    \"流\",\n    \"路\",\n    \"级\",\n    \"少\",\n    \"图\",\n    \"山\",\n    \"统\",\n    \"接\",\n    \"知\",\n    \"较\",\n    \"将\",\n    \"组\",\n    \"见\",\n    \"计\",\n    \"别\",\n    \"她\",\n    \"手\",\n    \"角\",\n    \"期\",\n    \"根\",\n    \"论\",\n    \"运\",\n    \"农\",\n    \"指\",\n    \"几\",\n    \"九\",\n    \"区\",\n    \"强\",\n    \"放\",\n    \"决\",\n    \"西\",\n    \"被\",\n    \"干\",\n    \"做\",\n    \"必\",\n    \"战\",\n    \"先\",\n    \"回\",\n    \"则\",\n    \"任\",\n    \"取\",\n    \"据\",\n    \"处\",\n    \"队\",\n    \"南\",\n    \"给\",\n    \"色\",\n    \"光\",\n    \"门\",\n    \"即\",\n    \"保\",\n    \"治\",\n    \"北\",\n    \"造\",\n    \"百\",\n    \"规\",\n    \"热\",\n    \"领\",\n    \"七\",\n    \"海\",\n    \"口\",\n    \"东\",\n    \"导\",\n    \"器\",\n    \"压\",\n    \"志\",\n    \"世\",\n    \"金\",\n    \"增\",\n    \"争\",\n    \"济\",\n    \"阶\",\n    \"油\",\n    \"思\",\n    \"术\",\n    \"极\",\n    \"交\",\n    \"受\",\n    \"联\",\n    \"什\",\n    \"认\",\n    \"六\",\n    \"共\",\n    \"权\",\n    \"收\",\n    \"证\",\n    \"改\",\n    \"清\",\n    \"美\",\n    \"再\",\n    \"采\",\n    \"转\",\n    \"更\",\n    \"单\",\n    \"风\",\n    \"切\",\n    \"打\",\n    \"白\",\n    \"教\",\n    \"速\",\n    \"花\",\n    \"带\",\n    \"安\",\n    \"场\",\n    \"身\",\n    \"车\",\n    \"例\",\n    \"真\",\n    \"务\",\n    \"具\",\n    \"万\",\n    \"每\",\n    \"目\",\n    \"至\",\n    \"达\",\n    \"走\",\n    \"积\",\n    \"示\",\n    \"议\",\n    \"声\",\n    \"报\",\n    \"斗\",\n    \"完\",\n    \"类\",\n    \"八\",\n    \"离\",\n    \"华\",\n    \"名\",\n    \"确\",\n    \"才\",\n    \"科\",\n    \"张\",\n    \"信\",\n    \"马\",\n    \"节\",\n    \"话\",\n    \"米\",\n    \"整\",\n    \"空\",\n    \"元\",\n    \"况\",\n    \"今\",\n    \"集\",\n    \"温\",\n    \"传\",\n    \"土\",\n    \"许\",\n    \"步\",\n    \"群\",\n    \"广\",\n    \"石\",\n    \"记\",\n    \"需\",\n    \"段\",\n    \"研\",\n    \"界\",\n    \"拉\",\n    \"林\",\n    \"律\",\n    \"叫\",\n    \"且\",\n    \"究\",\n    \"观\",\n    \"越\",\n    \"织\",\n    \"装\",\n    \"影\",\n    \"算\",\n    \"低\",\n    \"持\",\n    \"音\",\n    \"众\",\n    \"书\",\n    \"布\",\n    \"复\",\n    \"容\",\n    \"儿\",\n    \"须\",\n    \"际\",\n    \"商\",\n    \"非\",\n    \"验\",\n    \"连\",\n    \"断\",\n    \"深\",\n    \"难\",\n    \"近\",\n    \"矿\",\n    \"千\",\n    \"周\",\n    \"委\",\n    \"素\",\n    \"技\",\n    \"备\",\n    \"半\",\n    \"办\",\n    \"青\",\n    \"省\",\n    \"列\",\n    \"习\",\n    \"响\",\n    \"约\",\n    \"支\",\n    \"般\",\n    \"史\",\n    \"感\",\n    \"劳\",\n    \"便\",\n    \"团\",\n    \"往\",\n    \"酸\",\n    \"历\",\n    \"市\",\n    \"克\",\n    \"何\",\n    \"除\",\n    \"消\",\n    \"构\",\n    \"府\",\n    \"称\",\n    \"太\",\n    \"准\",\n    \"精\",\n    \"值\",\n    \"号\",\n    \"率\",\n    \"族\",\n    \"维\",\n    \"划\",\n    \"选\",\n    \"标\",\n    \"写\",\n    \"存\",\n    \"候\",\n    \"毛\",\n    \"亲\",\n    \"快\",\n    \"效\",\n    \"斯\",\n    \"院\",\n    \"查\",\n    \"江\",\n    \"型\",\n    \"眼\",\n    \"王\",\n    \"按\",\n    \"格\",\n    \"养\",\n    \"易\",\n    \"置\",\n    \"派\",\n    \"层\",\n    \"片\",\n    \"始\",\n    \"却\",\n    \"专\",\n    \"状\",\n    \"育\",\n    \"厂\",\n    \"京\",\n    \"识\",\n    \"适\",\n    \"属\",\n    \"圆\",\n    \"包\",\n    \"火\",\n    \"住\",\n    \"调\",\n    \"满\",\n    \"县\",\n    \"局\",\n    \"照\",\n    \"参\",\n    \"红\",\n    \"细\",\n    \"引\",\n    \"听\",\n    \"该\",\n    \"铁\",\n    \"价\",\n    \"严\",\n    \"首\",\n    \"底\",\n    \"液\",\n    \"官\",\n    \"德\",\n    \"随\",\n    \"病\",\n    \"苏\",\n    \"失\",\n    \"尔\",\n    \"死\",\n    \"讲\",\n    \"配\",\n    \"女\",\n    \"黄\",\n    \"推\",\n    \"显\",\n    \"谈\",\n    \"罪\",\n    \"神\",\n    \"艺\",\n    \"呢\",\n    \"席\",\n    \"含\",\n    \"企\",\n    \"望\",\n    \"密\",\n    \"批\",\n    \"营\",\n    \"项\",\n    \"防\",\n    \"举\",\n    \"球\",\n    \"英\",\n    \"氧\",\n    \"势\",\n    \"告\",\n    \"李\",\n    \"台\",\n    \"落\",\n    \"木\",\n    \"帮\",\n    \"轮\",\n    \"破\",\n    \"亚\",\n    \"师\",\n    \"围\",\n    \"注\",\n    \"远\",\n    \"字\",\n    \"材\",\n    \"排\",\n    \"供\",\n    \"河\",\n    \"态\",\n    \"封\",\n    \"另\",\n    \"施\",\n    \"减\",\n    \"树\",\n    \"溶\",\n    \"怎\",\n    \"止\",\n    \"案\",\n    \"言\",\n    \"士\",\n    \"均\",\n    \"武\",\n    \"固\",\n    \"叶\",\n    \"鱼\",\n    \"波\",\n    \"视\",\n    \"仅\",\n    \"费\",\n    \"紧\",\n    \"爱\",\n    \"左\",\n    \"章\",\n    \"早\",\n    \"朝\",\n    \"害\",\n    \"续\",\n    \"轻\",\n    \"服\",\n    \"试\",\n    \"食\",\n    \"充\",\n    \"兵\",\n    \"源\",\n    \"判\",\n    \"护\",\n    \"司\",\n    \"足\",\n    \"某\",\n    \"练\",\n    \"差\",\n    \"致\",\n    \"板\",\n    \"田\",\n    \"降\",\n    \"黑\",\n    \"犯\",\n    \"负\",\n    \"击\",\n    \"范\",\n    \"继\",\n    \"兴\",\n    \"似\",\n    \"余\",\n    \"坚\",\n    \"曲\",\n    \"输\",\n    \"修\",\n    \"故\",\n    \"城\",\n    \"夫\",\n    \"够\",\n    \"送\",\n    \"笔\",\n    \"船\",\n    \"占\",\n    \"右\",\n    \"财\",\n    \"吃\",\n    \"富\",\n    \"春\",\n    \"职\",\n    \"觉\",\n    \"汉\",\n    \"画\",\n    \"功\",\n    \"巴\",\n    \"跟\",\n    \"虽\",\n    \"杂\",\n    \"飞\",\n    \"检\",\n    \"吸\",\n    \"助\",\n    \"升\",\n    \"阳\",\n    \"互\",\n    \"初\",\n    \"创\",\n    \"抗\",\n    \"考\",\n    \"投\",\n    \"坏\",\n    \"策\",\n    \"古\",\n    \"径\",\n    \"换\",\n    \"未\",\n    \"跑\",\n    \"留\",\n    \"钢\",\n    \"曾\",\n    \"端\",\n    \"责\",\n    \"站\",\n    \"简\",\n    \"述\",\n    \"钱\",\n    \"副\",\n    \"尽\",\n    \"帝\",\n    \"射\",\n    \"草\",\n    \"冲\",\n    \"承\",\n    \"独\",\n    \"令\",\n    \"限\",\n    \"阿\",\n    \"宣\",\n    \"环\",\n    \"双\",\n    \"请\",\n    \"超\",\n    \"微\",\n    \"让\",\n    \"控\",\n    \"州\",\n    \"良\",\n    \"轴\",\n    \"找\",\n    \"否\",\n    \"纪\",\n    \"益\",\n    \"依\",\n    \"优\",\n    \"顶\",\n    \"础\",\n    \"载\",\n    \"倒\",\n    \"房\",\n    \"突\",\n    \"坐\",\n    \"粉\",\n    \"敌\",\n    \"略\",\n    \"客\",\n    \"袁\",\n    \"冷\",\n    \"胜\",\n    \"绝\",\n    \"析\",\n    \"块\",\n    \"剂\",\n    \"测\",\n    \"丝\",\n    \"协\",\n    \"诉\",\n    \"念\",\n    \"陈\",\n    \"仍\",\n    \"罗\",\n    \"盐\",\n    \"友\",\n    \"洋\",\n    \"错\",\n    \"苦\",\n    \"夜\",\n    \"刑\",\n    \"移\",\n    \"频\",\n    \"逐\",\n    \"靠\",\n    \"混\",\n    \"母\",\n    \"短\",\n    \"皮\",\n    \"终\",\n    \"聚\",\n    \"汽\",\n    \"村\",\n    \"云\",\n    \"哪\",\n    \"既\",\n    \"距\",\n    \"卫\",\n    \"停\",\n    \"烈\",\n    \"央\",\n    \"察\",\n    \"烧\",\n    \"迅\",\n    \"境\",\n    \"若\",\n    \"印\",\n    \"洲\",\n    \"刻\",\n    \"括\",\n    \"激\",\n    \"孔\",\n    \"搞\",\n    \"甚\",\n    \"室\",\n    \"待\",\n    \"核\",\n    \"校\",\n    \"散\",\n    \"侵\",\n    \"吧\",\n    \"甲\",\n    \"游\",\n    \"久\",\n    \"菜\",\n    \"味\",\n    \"旧\",\n    \"模\",\n    \"湖\",\n    \"货\",\n    \"损\",\n    \"预\",\n    \"阻\",\n    \"毫\",\n    \"普\",\n    \"稳\",\n    \"乙\",\n    \"妈\",\n    \"植\",\n    \"息\",\n    \"扩\",\n    \"银\",\n    \"语\",\n    \"挥\",\n    \"酒\",\n    \"守\",\n    \"拿\",\n    \"序\",\n    \"纸\",\n    \"医\",\n    \"缺\",\n    \"雨\",\n    \"吗\",\n    \"针\",\n    \"刘\",\n    \"啊\",\n    \"急\",\n    \"唱\",\n    \"误\",\n    \"训\",\n    \"愿\",\n    \"审\",\n    \"附\",\n    \"获\",\n    \"茶\",\n    \"鲜\",\n    \"粮\",\n    \"斤\",\n    \"孩\",\n    \"脱\",\n    \"硫\",\n    \"肥\",\n    \"善\",\n    \"龙\",\n    \"演\",\n    \"父\",\n    \"渐\",\n    \"血\",\n    \"欢\",\n    \"械\",\n    \"掌\",\n    \"歌\",\n    \"沙\",\n    \"刚\",\n    \"攻\",\n    \"谓\",\n    \"盾\",\n    \"讨\",\n    \"晚\",\n    \"粒\",\n    \"乱\",\n    \"燃\",\n    \"矛\",\n    \"乎\",\n    \"杀\",\n    \"药\",\n    \"宁\",\n    \"鲁\",\n    \"贵\",\n    \"钟\",\n    \"煤\",\n    \"读\",\n    \"班\",\n    \"伯\",\n    \"香\",\n    \"介\",\n    \"迫\",\n    \"句\",\n    \"丰\",\n    \"培\",\n    \"握\",\n    \"兰\",\n    \"担\",\n    \"弦\",\n    \"蛋\",\n    \"沉\",\n    \"假\",\n    \"穿\",\n    \"执\",\n    \"答\",\n    \"乐\",\n    \"谁\",\n    \"顺\",\n    \"烟\",\n    \"缩\",\n    \"征\",\n    \"脸\",\n    \"喜\",\n    \"松\",\n    \"脚\",\n    \"困\",\n    \"异\",\n    \"免\",\n    \"背\",\n    \"星\",\n    \"福\",\n    \"买\",\n    \"染\",\n    \"井\",\n    \"概\",\n    \"慢\",\n    \"怕\",\n    \"磁\",\n    \"倍\",\n    \"祖\",\n    \"皇\",\n    \"促\",\n    \"静\",\n    \"补\",\n    \"评\",\n    \"翻\",\n    \"肉\",\n    \"践\",\n    \"尼\",\n    \"衣\",\n    \"宽\",\n    \"扬\",\n    \"棉\",\n    \"希\",\n    \"伤\",\n    \"操\",\n    \"垂\",\n    \"秋\",\n    \"宜\",\n    \"氢\",\n    \"套\",\n    \"督\",\n    \"振\",\n    \"架\",\n    \"亮\",\n    \"末\",\n    \"宪\",\n    \"庆\",\n    \"编\",\n    \"牛\",\n    \"触\",\n    \"映\",\n    \"雷\",\n    \"销\",\n    \"诗\",\n    \"座\",\n    \"居\",\n    \"抓\",\n    \"裂\",\n    \"胞\",\n    \"呼\",\n    \"娘\",\n    \"景\",\n    \"威\",\n    \"绿\",\n    \"晶\",\n    \"厚\",\n    \"盟\",\n    \"衡\",\n    \"鸡\",\n    \"孙\",\n    \"延\",\n    \"危\",\n    \"胶\",\n    \"屋\",\n    \"乡\",\n    \"临\",\n    \"陆\",\n    \"顾\",\n    \"掉\",\n    \"呀\",\n    \"灯\",\n    \"岁\",\n    \"措\",\n    \"束\",\n    \"耐\",\n    \"剧\",\n    \"玉\",\n    \"赵\",\n    \"跳\",\n    \"哥\",\n    \"季\",\n    \"课\",\n    \"凯\",\n    \"胡\",\n    \"额\",\n    \"款\",\n    \"绍\",\n    \"卷\",\n    \"齐\",\n    \"伟\",\n    \"蒸\",\n    \"殖\",\n    \"永\",\n    \"宗\",\n    \"苗\",\n    \"川\",\n    \"炉\",\n    \"岩\",\n    \"弱\",\n    \"零\",\n    \"杨\",\n    \"奏\",\n    \"沿\",\n    \"露\",\n    \"杆\",\n    \"探\",\n    \"滑\",\n    \"镇\",\n    \"饭\",\n    \"浓\",\n    \"航\",\n    \"怀\",\n    \"赶\",\n    \"库\",\n    \"夺\",\n    \"伊\",\n    \"灵\",\n    \"税\",\n    \"途\",\n    \"灭\",\n    \"赛\",\n    \"归\",\n    \"召\",\n    \"鼓\",\n    \"播\",\n    \"盘\",\n    \"裁\",\n    \"险\",\n    \"康\",\n    \"唯\",\n    \"录\",\n    \"菌\",\n    \"纯\",\n    \"借\",\n    \"糖\",\n    \"盖\",\n    \"横\",\n    \"符\",\n    \"私\",\n    \"努\",\n    \"堂\",\n    \"域\",\n    \"枪\",\n    \"润\",\n    \"幅\",\n    \"哈\",\n    \"竟\",\n    \"熟\",\n    \"虫\",\n    \"泽\",\n    \"脑\",\n    \"壤\",\n    \"碳\",\n    \"欧\",\n    \"遍\",\n    \"侧\",\n    \"寨\",\n    \"敢\",\n    \"彻\",\n    \"虑\",\n    \"斜\",\n    \"薄\",\n    \"庭\",\n    \"纳\",\n    \"弹\",\n    \"饲\",\n    \"伸\",\n    \"折\",\n    \"麦\",\n    \"湿\",\n    \"暗\",\n    \"荷\",\n    \"瓦\",\n    \"塞\",\n    \"床\",\n    \"筑\",\n    \"恶\",\n    \"户\",\n    \"访\",\n    \"塔\",\n    \"奇\",\n    \"透\",\n    \"梁\",\n    \"刀\",\n    \"旋\",\n    \"迹\",\n    \"卡\",\n    \"氯\",\n    \"遇\",\n    \"份\",\n    \"毒\",\n    \"泥\",\n    \"退\",\n    \"洗\",\n    \"摆\",\n    \"灰\",\n    \"彩\",\n    \"卖\",\n    \"耗\",\n    \"夏\",\n    \"择\",\n    \"忙\",\n    \"铜\",\n    \"献\",\n    \"硬\",\n    \"予\",\n    \"繁\",\n    \"圈\",\n    \"雪\",\n    \"函\",\n    \"亦\",\n    \"抽\",\n    \"篇\",\n    \"阵\",\n    \"阴\",\n    \"丁\",\n    \"尺\",\n    \"追\",\n    \"堆\",\n    \"雄\",\n    \"迎\",\n    \"泛\",\n    \"爸\",\n    \"楼\",\n    \"避\",\n    \"谋\",\n    \"吨\",\n    \"野\",\n    \"猪\",\n    \"旗\",\n    \"累\",\n    \"偏\",\n    \"典\",\n    \"馆\",\n    \"索\",\n    \"秦\",\n    \"脂\",\n    \"潮\",\n    \"爷\",\n    \"豆\",\n    \"忽\",\n    \"托\",\n    \"惊\",\n    \"塑\",\n    \"遗\",\n    \"愈\",\n    \"朱\",\n    \"替\",\n    \"纤\",\n    \"粗\",\n    \"倾\",\n    \"尚\",\n    \"痛\",\n    \"楚\",\n    \"谢\",\n    \"奋\",\n    \"购\",\n    \"磨\",\n    \"君\",\n    \"池\",\n    \"旁\",\n    \"碎\",\n    \"骨\",\n    \"监\",\n    \"捕\",\n    \"弟\",\n    \"暴\",\n    \"割\",\n    \"贯\",\n    \"殊\",\n    \"释\",\n    \"词\",\n    \"亡\",\n    \"壁\",\n    \"顿\",\n    \"宝\",\n    \"午\",\n    \"尘\",\n    \"闻\",\n    \"揭\",\n    \"炮\",\n    \"残\",\n    \"冬\",\n    \"桥\",\n    \"妇\",\n    \"警\",\n    \"综\",\n    \"招\",\n    \"吴\",\n    \"付\",\n    \"浮\",\n    \"遭\",\n    \"徐\",\n    \"您\",\n    \"摇\",\n    \"谷\",\n    \"赞\",\n    \"箱\",\n    \"隔\",\n    \"订\",\n    \"男\",\n    \"吹\",\n    \"园\",\n    \"纷\",\n    \"唐\",\n    \"败\",\n    \"宋\",\n    \"玻\",\n    \"巨\",\n    \"耕\",\n    \"坦\",\n    \"荣\",\n    \"闭\",\n    \"湾\",\n    \"键\",\n    \"凡\",\n    \"驻\",\n    \"锅\",\n    \"救\",\n    \"恩\",\n    \"剥\",\n    \"凝\",\n    \"碱\",\n    \"齿\",\n    \"截\",\n    \"炼\",\n    \"麻\",\n    \"纺\",\n    \"禁\",\n    \"废\",\n    \"盛\",\n    \"版\",\n    \"缓\",\n    \"净\",\n    \"睛\",\n    \"昌\",\n    \"婚\",\n    \"涉\",\n    \"筒\",\n    \"嘴\",\n    \"插\",\n    \"岸\",\n    \"朗\",\n    \"庄\",\n    \"街\",\n    \"藏\",\n    \"姑\",\n    \"贸\",\n    \"腐\",\n    \"奴\",\n    \"啦\",\n    \"惯\",\n    \"乘\",\n    \"伙\",\n    \"恢\",\n    \"匀\",\n    \"纱\",\n    \"扎\",\n    \"辩\",\n    \"耳\",\n    \"彪\",\n    \"臣\",\n    \"亿\",\n    \"璃\",\n    \"抵\",\n    \"脉\",\n    \"秀\",\n    \"萨\",\n    \"俄\",\n    \"网\",\n    \"舞\",\n    \"店\",\n    \"喷\",\n    \"纵\",\n    \"寸\",\n    \"汗\",\n    \"挂\",\n    \"洪\",\n    \"贺\",\n    \"闪\",\n    \"柬\",\n    \"爆\",\n    \"烯\",\n    \"津\",\n    \"稻\",\n    \"墙\",\n    \"软\",\n    \"勇\",\n    \"像\",\n    \"滚\",\n    \"厘\",\n    \"蒙\",\n    \"芳\",\n    \"肯\",\n    \"坡\",\n    \"柱\",\n    \"荡\",\n    \"腿\",\n    \"仪\",\n    \"旅\",\n    \"尾\",\n    \"轧\",\n    \"冰\",\n    \"贡\",\n    \"登\",\n    \"黎\",\n    \"削\",\n    \"钻\",\n    \"勒\",\n    \"逃\",\n    \"障\",\n    \"氨\",\n    \"郭\",\n    \"峰\",\n    \"币\",\n    \"港\",\n    \"伏\",\n    \"轨\",\n    \"亩\",\n    \"毕\",\n    \"擦\",\n    \"莫\",\n    \"刺\",\n    \"浪\",\n    \"秘\",\n    \"援\",\n    \"株\",\n    \"健\",\n    \"售\",\n    \"股\",\n    \"岛\",\n    \"甘\",\n    \"泡\",\n    \"睡\",\n    \"童\",\n    \"铸\",\n    \"汤\",\n    \"阀\",\n    \"休\",\n    \"汇\",\n    \"舍\",\n    \"牧\",\n    \"绕\",\n    \"炸\",\n    \"哲\",\n    \"磷\",\n    \"绩\",\n    \"朋\",\n    \"淡\",\n    \"尖\",\n    \"启\",\n    \"陷\",\n    \"柴\",\n    \"呈\",\n    \"徒\",\n    \"颜\",\n    \"泪\",\n    \"稍\",\n    \"忘\",\n    \"泵\",\n    \"蓝\",\n    \"拖\",\n    \"洞\",\n    \"授\",\n    \"镜\",\n    \"辛\",\n    \"壮\",\n    \"锋\",\n    \"贫\",\n    \"虚\",\n    \"弯\",\n    \"摩\",\n    \"泰\",\n    \"幼\",\n    \"廷\",\n    \"尊\",\n    \"窗\",\n    \"纲\",\n    \"弄\",\n    \"隶\",\n    \"疑\",\n    \"氏\",\n    \"宫\",\n    \"姐\",\n    \"震\",\n    \"瑞\",\n    \"怪\",\n    \"尤\",\n    \"琴\",\n    \"循\",\n    \"描\",\n    \"膜\",\n    \"违\",\n    \"夹\",\n    \"腰\",\n    \"缘\",\n    \"珠\",\n    \"穷\",\n    \"森\",\n    \"枝\",\n    \"竹\",\n    \"沟\",\n    \"催\",\n    \"绳\",\n    \"忆\",\n    \"邦\",\n    \"剩\",\n    \"幸\",\n    \"浆\",\n    \"栏\",\n    \"拥\",\n    \"牙\",\n    \"贮\",\n    \"礼\",\n    \"滤\",\n    \"钠\",\n    \"纹\",\n    \"罢\",\n    \"拍\",\n    \"咱\",\n    \"喊\",\n    \"袖\",\n    \"埃\",\n    \"勤\",\n    \"罚\",\n    \"焦\",\n    \"潜\",\n    \"伍\",\n    \"墨\",\n    \"欲\",\n    \"缝\",\n    \"姓\",\n    \"刊\",\n    \"饱\",\n    \"仿\",\n    \"奖\",\n    \"铝\",\n    \"鬼\",\n    \"丽\",\n    \"跨\",\n    \"默\",\n    \"挖\",\n    \"链\",\n    \"扫\",\n    \"喝\",\n    \"袋\",\n    \"炭\",\n    \"污\",\n    \"幕\",\n    \"诸\",\n    \"弧\",\n    \"励\",\n    \"梅\",\n    \"奶\",\n    \"洁\",\n    \"灾\",\n    \"舟\",\n    \"鉴\",\n    \"苯\",\n    \"讼\",\n    \"抱\",\n    \"毁\",\n    \"懂\",\n    \"寒\",\n    \"智\",\n    \"埔\",\n    \"寄\",\n    \"届\",\n    \"跃\",\n    \"渡\",\n    \"挑\",\n    \"丹\",\n    \"艰\",\n    \"贝\",\n    \"碰\",\n    \"拔\",\n    \"爹\",\n    \"戴\",\n    \"码\",\n    \"梦\",\n    \"芽\",\n    \"熔\",\n    \"赤\",\n    \"渔\",\n    \"哭\",\n    \"敬\",\n    \"颗\",\n    \"奔\",\n    \"铅\",\n    \"仲\",\n    \"虎\",\n    \"稀\",\n    \"妹\",\n    \"乏\",\n    \"珍\",\n    \"申\",\n    \"桌\",\n    \"遵\",\n    \"允\",\n    \"隆\",\n    \"螺\",\n    \"仓\",\n    \"魏\",\n    \"锐\",\n    \"晓\",\n    \"氮\",\n    \"兼\",\n    \"隐\",\n    \"碍\",\n    \"赫\",\n    \"拨\",\n    \"忠\",\n    \"肃\",\n    \"缸\",\n    \"牵\",\n    \"抢\",\n    \"博\",\n    \"巧\",\n    \"壳\",\n    \"兄\",\n    \"杜\",\n    \"讯\",\n    \"诚\",\n    \"碧\",\n    \"祥\",\n    \"柯\",\n    \"页\",\n    \"巡\",\n    \"矩\",\n    \"悲\",\n    \"灌\",\n    \"龄\",\n    \"伦\",\n    \"票\",\n    \"寻\",\n    \"桂\",\n    \"铺\",\n    \"圣\",\n    \"恐\",\n    \"恰\",\n    \"郑\",\n    \"趣\",\n    \"抬\",\n    \"荒\",\n    \"腾\",\n    \"贴\",\n    \"柔\",\n    \"滴\",\n    \"猛\",\n    \"阔\",\n    \"辆\",\n    \"妻\",\n    \"填\",\n    \"撤\",\n    \"储\",\n    \"签\",\n    \"闹\",\n    \"扰\",\n    \"紫\",\n    \"砂\",\n    \"递\",\n    \"戏\",\n    \"吊\",\n    \"陶\",\n    \"伐\",\n    \"喂\",\n    \"疗\",\n    \"瓶\",\n    \"婆\",\n    \"抚\",\n    \"臂\",\n    \"摸\",\n    \"忍\",\n    \"虾\",\n    \"蜡\",\n    \"邻\",\n    \"胸\",\n    \"巩\",\n    \"挤\",\n    \"偶\",\n    \"弃\",\n    \"槽\",\n    \"劲\",\n    \"乳\",\n    \"邓\",\n    \"吉\",\n    \"仁\",\n    \"烂\",\n    \"砖\",\n    \"租\",\n    \"乌\",\n    \"舰\",\n    \"伴\",\n    \"瓜\",\n    \"浅\",\n    \"丙\",\n    \"暂\",\n    \"燥\",\n    \"橡\",\n    \"柳\",\n    \"迷\",\n    \"暖\",\n    \"牌\",\n    \"秧\",\n    \"胆\",\n    \"详\",\n    \"簧\",\n    \"踏\",\n    \"瓷\",\n    \"谱\",\n    \"呆\",\n    \"宾\",\n    \"糊\",\n    \"洛\",\n    \"辉\",\n    \"愤\",\n    \"竞\",\n    \"隙\",\n    \"怒\",\n    \"粘\",\n    \"乃\",\n    \"绪\",\n    \"肩\",\n    \"籍\",\n    \"敏\",\n    \"涂\",\n    \"熙\",\n    \"皆\",\n    \"侦\",\n    \"悬\",\n    \"掘\",\n    \"享\",\n    \"纠\",\n    \"醒\",\n    \"狂\",\n    \"锁\",\n    \"淀\",\n    \"恨\",\n    \"牲\",\n    \"霸\",\n    \"爬\",\n    \"赏\",\n    \"逆\",\n    \"玩\",\n    \"陵\",\n    \"祝\",\n    \"秒\",\n    \"浙\",\n    \"貌\",\n    \"役\",\n    \"彼\",\n    \"悉\",\n    \"鸭\",\n    \"趋\",\n    \"凤\",\n    \"晨\",\n    \"畜\",\n    \"辈\",\n    \"秩\",\n    \"卵\",\n    \"署\",\n    \"梯\",\n    \"炎\",\n    \"滩\",\n    \"棋\",\n    \"驱\",\n    \"筛\",\n    \"峡\",\n    \"冒\",\n    \"啥\",\n    \"寿\",\n    \"译\",\n    \"浸\",\n    \"泉\",\n    \"帽\",\n    \"迟\",\n    \"硅\",\n    \"疆\",\n    \"贷\",\n    \"漏\",\n    \"稿\",\n    \"冠\",\n    \"嫩\",\n    \"胁\",\n    \"芯\",\n    \"牢\",\n    \"叛\",\n    \"蚀\",\n    \"奥\",\n    \"鸣\",\n    \"岭\",\n    \"羊\",\n    \"凭\",\n    \"串\",\n    \"塘\",\n    \"绘\",\n    \"酵\",\n    \"融\",\n    \"盆\",\n    \"锡\",\n    \"庙\",\n    \"筹\",\n    \"冻\",\n    \"辅\",\n    \"摄\",\n    \"袭\",\n    \"筋\",\n    \"拒\",\n    \"僚\",\n    \"旱\",\n    \"钾\",\n    \"鸟\",\n    \"漆\",\n    \"沈\",\n    \"眉\",\n    \"疏\",\n    \"添\",\n    \"棒\",\n    \"穗\",\n    \"硝\",\n    \"韩\",\n    \"逼\",\n    \"扭\",\n    \"侨\",\n    \"凉\",\n    \"挺\",\n    \"碗\",\n    \"栽\",\n    \"炒\",\n    \"杯\",\n    \"患\",\n    \"馏\",\n    \"劝\",\n    \"豪\",\n    \"辽\",\n    \"勃\",\n    \"鸿\",\n    \"旦\",\n    \"吏\",\n    \"拜\",\n    \"狗\",\n    \"埋\",\n    \"辊\",\n    \"掩\",\n    \"饮\",\n    \"搬\",\n    \"骂\",\n    \"辞\",\n    \"勾\",\n    \"扣\",\n    \"估\",\n    \"蒋\",\n    \"绒\",\n    \"雾\",\n    \"丈\",\n    \"朵\",\n    \"姆\",\n    \"拟\",\n    \"宇\",\n    \"辑\",\n    \"陕\",\n    \"雕\",\n    \"偿\",\n    \"蓄\",\n    \"崇\",\n    \"剪\",\n    \"倡\",\n    \"厅\",\n    \"咬\",\n    \"驶\",\n    \"薯\",\n    \"刷\",\n    \"斥\",\n    \"番\",\n    \"赋\",\n    \"奉\",\n    \"佛\",\n    \"浇\",\n    \"漫\",\n    \"曼\",\n    \"扇\",\n    \"钙\",\n    \"桃\",\n    \"扶\",\n    \"仔\",\n    \"返\",\n    \"俗\",\n    \"亏\",\n    \"腔\",\n    \"鞋\",\n    \"棱\",\n    \"覆\",\n    \"框\",\n    \"悄\",\n    \"叔\",\n    \"撞\",\n    \"骗\",\n    \"勘\",\n    \"旺\",\n    \"沸\",\n    \"孤\",\n    \"吐\",\n    \"孟\",\n    \"渠\",\n    \"屈\",\n    \"疾\",\n    \"妙\",\n    \"惜\",\n    \"仰\",\n    \"狠\",\n    \"胀\",\n    \"谐\",\n    \"抛\",\n    \"霉\",\n    \"桑\",\n    \"岗\",\n    \"嘛\",\n    \"衰\",\n    \"盗\",\n    \"渗\",\n    \"脏\",\n    \"赖\",\n    \"涌\",\n    \"甜\",\n    \"曹\",\n    \"阅\",\n    \"肌\",\n    \"哩\",\n    \"厉\",\n    \"烃\",\n    \"纬\",\n    \"毅\",\n    \"昨\",\n    \"伪\",\n    \"症\",\n    \"煮\",\n    \"叹\",\n    \"钉\",\n    \"搭\",\n    \"茎\",\n    \"笼\",\n    \"酷\",\n    \"偷\",\n    \"弓\",\n    \"锥\",\n    \"恒\",\n    \"杰\",\n    \"坑\",\n    \"鼻\",\n    \"翼\",\n    \"纶\",\n    \"叙\",\n    \"狱\",\n    \"逮\",\n    \"罐\",\n    \"络\",\n    \"棚\",\n    \"抑\",\n    \"膨\",\n    \"蔬\",\n    \"寺\",\n    \"骤\",\n    \"穆\",\n    \"冶\",\n    \"枯\",\n    \"册\",\n    \"尸\",\n    \"凸\",\n    \"绅\",\n    \"坯\",\n    \"牺\",\n    \"焰\",\n    \"轰\",\n    \"欣\",\n    \"晋\",\n    \"瘦\",\n    \"御\",\n    \"锭\",\n    \"锦\",\n    \"丧\",\n    \"旬\",\n    \"锻\",\n    \"垄\",\n    \"搜\",\n    \"扑\",\n    \"邀\",\n    \"亭\",\n    \"酯\",\n    \"迈\",\n    \"舒\",\n    \"脆\",\n    \"酶\",\n    \"闲\",\n    \"忧\",\n    \"酚\",\n    \"顽\",\n    \"羽\",\n    \"涨\",\n    \"卸\",\n    \"仗\",\n    \"陪\",\n    \"辟\",\n    \"惩\",\n    \"杭\",\n    \"姚\",\n    \"肚\",\n    \"捉\",\n    \"飘\",\n    \"漂\",\n    \"昆\",\n    \"欺\",\n    \"吾\",\n    \"郎\",\n    \"烷\",\n    \"汁\",\n    \"呵\",\n    \"饰\",\n    \"萧\",\n    \"雅\",\n    \"邮\",\n    \"迁\",\n    \"燕\",\n    \"撒\",\n    \"姻\",\n    \"赴\",\n    \"宴\",\n    \"烦\",\n    \"债\",\n    \"帐\",\n    \"斑\",\n    \"铃\",\n    \"旨\",\n    \"醇\",\n    \"董\",\n    \"饼\",\n    \"雏\",\n    \"姿\",\n    \"拌\",\n    \"傅\",\n    \"腹\",\n    \"妥\",\n    \"揉\",\n    \"贤\",\n    \"拆\",\n    \"歪\",\n    \"葡\",\n    \"胺\",\n    \"丢\",\n    \"浩\",\n    \"徽\",\n    \"昂\",\n    \"垫\",\n    \"挡\",\n    \"览\",\n    \"贪\",\n    \"慰\",\n    \"缴\",\n    \"汪\",\n    \"慌\",\n    \"冯\",\n    \"诺\",\n    \"姜\",\n    \"谊\",\n    \"凶\",\n    \"劣\",\n    \"诬\",\n    \"耀\",\n    \"昏\",\n    \"躺\",\n    \"盈\",\n    \"骑\",\n    \"乔\",\n    \"溪\",\n    \"丛\",\n    \"卢\",\n    \"抹\",\n    \"闷\",\n    \"咨\",\n    \"刮\",\n    \"驾\",\n    \"缆\",\n    \"悟\",\n    \"摘\",\n    \"铒\",\n    \"掷\",\n    \"颇\",\n    \"幻\",\n    \"柄\",\n    \"惠\",\n    \"惨\",\n    \"佳\",\n    \"仇\",\n    \"腊\",\n    \"窝\",\n    \"涤\",\n    \"剑\",\n    \"瞧\",\n    \"堡\",\n    \"泼\",\n    \"葱\",\n    \"罩\",\n    \"霍\",\n    \"捞\",\n    \"胎\",\n    \"苍\",\n    \"滨\",\n    \"俩\",\n    \"捅\",\n    \"湘\",\n    \"砍\",\n    \"霞\",\n    \"邵\",\n    \"萄\",\n    \"疯\",\n    \"淮\",\n    \"遂\",\n    \"熊\",\n    \"粪\",\n    \"烘\",\n    \"宿\",\n    \"档\",\n    \"戈\",\n    \"驳\",\n    \"嫂\",\n    \"裕\",\n    \"徙\",\n    \"箭\",\n    \"捐\",\n    \"肠\",\n    \"撑\",\n    \"晒\",\n    \"辨\",\n    \"殿\",\n    \"莲\",\n    \"摊\",\n    \"搅\",\n    \"酱\",\n    \"屏\",\n    \"疫\",\n    \"哀\",\n    \"蔡\",\n    \"堵\",\n    \"沫\",\n    \"皱\",\n    \"畅\",\n    \"叠\",\n    \"阁\",\n    \"莱\",\n    \"敲\",\n    \"辖\",\n    \"钩\",\n    \"痕\",\n    \"坝\",\n    \"巷\",\n    \"饿\",\n    \"祸\",\n    \"丘\",\n    \"玄\",\n    \"溜\",\n    \"曰\",\n    \"逻\",\n    \"彭\",\n    \"尝\",\n    \"卿\",\n    \"妨\",\n    \"艇\",\n    \"吞\",\n    \"韦\",\n    \"怨\",\n    \"矮\",\n    \"歇\"\n]\n[\n    \"的\",\n    \"一\",\n    \"是\",\n    \"在\",\n    \"不\",\n    \"了\",\n    \"有\",\n    \"和\",\n    \"人\",\n    \"這\",\n    \"中\",\n    \"大\",\n    \"為\",\n    \"上\",\n    \"個\",\n    \"國\",\n    \"我\",\n    \"以\",\n    \"要\",\n    \"他\",\n    \"時\",\n    \"來\",\n    \"用\",\n    \"們\",\n    \"生\",\n    \"到\",\n    \"作\",\n    \"地\",\n    \"於\",\n    \"出\",\n    \"就\",\n    \"分\",\n    \"對\",\n    \"成\",\n    \"會\",\n    \"可\",\n    \"主\",\n    \"發\",\n    \"年\",\n    \"動\",\n    \"同\",\n    \"工\",\n    \"也\",\n    \"能\",\n    \"下\",\n    \"過\",\n    \"子\",\n    \"說\",\n    \"產\",\n    \"種\",\n    \"面\",\n    \"而\",\n    \"方\",\n    \"後\",\n    \"多\",\n    \"定\",\n    \"行\",\n    \"學\",\n    \"法\",\n    \"所\",\n    \"民\",\n    \"得\",\n    \"經\",\n    \"十\",\n    \"三\",\n    \"之\",\n    \"進\",\n    \"著\",\n    \"等\",\n    \"部\",\n    \"度\",\n    \"家\",\n    \"電\",\n    \"力\",\n    \"裡\",\n    \"如\",\n    \"水\",\n    \"化\",\n    \"高\",\n    \"自\",\n    \"二\",\n    \"理\",\n    \"起\",\n    \"小\",\n    \"物\",\n    \"現\",\n    \"實\",\n    \"加\",\n    \"量\",\n    \"都\",\n    \"兩\",\n    \"體\",\n    \"制\",\n    \"機\",\n    \"當\",\n    \"使\",\n    \"點\",\n    \"從\",\n    \"業\",\n    \"本\",\n    \"去\",\n    \"把\",\n    \"性\",\n    \"好\",\n    \"應\",\n    \"開\",\n    \"它\",\n    \"合\",\n    \"還\",\n    \"因\",\n    \"由\",\n    \"其\",\n    \"些\",\n    \"然\",\n    \"前\",\n    \"外\",\n    \"天\",\n    \"政\",\n    \"四\",\n    \"日\",\n    \"那\",\n    \"社\",\n    \"義\",\n    \"事\",\n    \"平\",\n    \"形\",\n    \"相\",\n    \"全\",\n    \"表\",\n    \"間\",\n    \"樣\",\n    \"與\",\n    \"關\",\n    \"各\",\n    \"重\",\n    \"新\",\n    \"線\",\n    \"內\",\n    \"數\",\n    \"正\",\n    \"心\",\n    \"反\",\n    \"你\",\n    \"明\",\n    \"看\",\n    \"原\",\n    \"又\",\n    \"麼\",\n    \"利\",\n    \"比\",\n    \"或\",\n    \"但\",\n    \"質\",\n    \"氣\",\n    \"第\",\n    \"向\",\n    \"道\",\n    \"命\",\n    \"此\",\n    \"變\",\n    \"條\",\n    \"只\",\n    \"沒\",\n    \"結\",\n    \"解\",\n    \"問\",\n    \"意\",\n    \"建\",\n    \"月\",\n    \"公\",\n    \"無\",\n    \"系\",\n    \"軍\",\n    \"很\",\n    \"情\",\n    \"者\",\n    \"最\",\n    \"立\",\n    \"代\",\n    \"想\",\n    \"已\",\n    \"通\",\n    \"並\",\n    \"提\",\n    \"直\",\n    \"題\",\n    \"黨\",\n    \"程\",\n    \"展\",\n    \"五\",\n    \"果\",\n    \"料\",\n    \"象\",\n    \"員\",\n    \"革\",\n    \"位\",\n    \"入\",\n    \"常\",\n    \"文\",\n    \"總\",\n    \"次\",\n    \"品\",\n    \"式\",\n    \"活\",\n    \"設\",\n    \"及\",\n    \"管\",\n    \"特\",\n    \"件\",\n    \"長\",\n    \"求\",\n    \"老\",\n    \"頭\",\n    \"基\",\n    \"資\",\n    \"邊\",\n    \"流\",\n    \"路\",\n    \"級\",\n    \"少\",\n    \"圖\",\n    \"山\",\n    \"統\",\n    \"接\",\n    \"知\",\n    \"較\",\n    \"將\",\n    \"組\",\n    \"見\",\n    \"計\",\n    \"別\",\n    \"她\",\n    \"手\",\n    \"角\",\n    \"期\",\n    \"根\",\n    \"論\",\n    \"運\",\n    \"農\",\n    \"指\",\n    \"幾\",\n    \"九\",\n    \"區\",\n    \"強\",\n    \"放\",\n    \"決\",\n    \"西\",\n    \"被\",\n    \"幹\",\n    \"做\",\n    \"必\",\n    \"戰\",\n    \"先\",\n    \"回\",\n    \"則\",\n    \"任\",\n    \"取\",\n    \"據\",\n    \"處\",\n    \"隊\",\n    \"南\",\n    \"給\",\n    \"色\",\n    \"光\",\n    \"門\",\n    \"即\",\n    \"保\",\n    \"治\",\n    \"北\",\n    \"造\",\n    \"百\",\n    \"規\",\n    \"熱\",\n    \"領\",\n    \"七\",\n    \"海\",\n    \"口\",\n    \"東\",\n    \"導\",\n    \"器\",\n    \"壓\",\n    \"志\",\n    \"世\",\n    \"金\",\n    \"增\",\n    \"爭\",\n    \"濟\",\n    \"階\",\n    \"油\",\n    \"思\",\n    \"術\",\n    \"極\",\n    \"交\",\n    \"受\",\n    \"聯\",\n    \"什\",\n    \"認\",\n    \"六\",\n    \"共\",\n    \"權\",\n    \"收\",\n    \"證\",\n    \"改\",\n    \"清\",\n    \"美\",\n    \"再\",\n    \"採\",\n    \"轉\",\n    \"更\",\n    \"單\",\n    \"風\",\n    \"切\",\n    \"打\",\n    \"白\",\n    \"教\",\n    \"速\",\n    \"花\",\n    \"帶\",\n    \"安\",\n    \"場\",\n    \"身\",\n    \"車\",\n    \"例\",\n    \"真\",\n    \"務\",\n    \"具\",\n    \"萬\",\n    \"每\",\n    \"目\",\n    \"至\",\n    \"達\",\n    \"走\",\n    \"積\",\n    \"示\",\n    \"議\",\n    \"聲\",\n    \"報\",\n    \"鬥\",\n    \"完\",\n    \"類\",\n    \"八\",\n    \"離\",\n    \"華\",\n    \"名\",\n    \"確\",\n    \"才\",\n    \"科\",\n    \"張\",\n    \"信\",\n    \"馬\",\n    \"節\",\n    \"話\",\n    \"米\",\n    \"整\",\n    \"空\",\n    \"元\",\n    \"況\",\n    \"今\",\n    \"集\",\n    \"溫\",\n    \"傳\",\n    \"土\",\n    \"許\",\n    \"步\",\n    \"群\",\n    \"廣\",\n    \"石\",\n    \"記\",\n    \"需\",\n    \"段\",\n    \"研\",\n    \"界\",\n    \"拉\",\n    \"林\",\n    \"律\",\n    \"叫\",\n    \"且\",\n    \"究\",\n    \"觀\",\n    \"越\",\n    \"織\",\n    \"裝\",\n    \"影\",\n    \"算\",\n    \"低\",\n    \"持\",\n    \"音\",\n    \"眾\",\n    \"書\",\n    \"布\",\n    \"复\",\n    \"容\",\n    \"兒\",\n    \"須\",\n    \"際\",\n    \"商\",\n    \"非\",\n    \"驗\",\n    \"連\",\n    \"斷\",\n    \"深\",\n    \"難\",\n    \"近\",\n    \"礦\",\n    \"千\",\n    \"週\",\n    \"委\",\n    \"素\",\n    \"技\",\n    \"備\",\n    \"半\",\n    \"辦\",\n    \"青\",\n    \"省\",\n    \"列\",\n    \"習\",\n    \"響\",\n    \"約\",\n    \"支\",\n    \"般\",\n    \"史\",\n    \"感\",\n    \"勞\",\n    \"便\",\n    \"團\",\n    \"往\",\n    \"酸\",\n    \"歷\",\n    \"市\",\n    \"克\",\n    \"何\",\n    \"除\",\n    \"消\",\n    \"構\",\n    \"府\",\n    \"稱\",\n    \"太\",\n    \"準\",\n    \"精\",\n    \"值\",\n    \"號\",\n    \"率\",\n    \"族\",\n    \"維\",\n    \"劃\",\n    \"選\",\n    \"標\",\n    \"寫\",\n    \"存\",\n    \"候\",\n    \"毛\",\n    \"親\",\n    \"快\",\n    \"效\",\n    \"斯\",\n    \"院\",\n    \"查\",\n    \"江\",\n    \"型\",\n    \"眼\",\n    \"王\",\n    \"按\",\n    \"格\",\n    \"養\",\n    \"易\",\n    \"置\",\n    \"派\",\n    \"層\",\n    \"片\",\n    \"始\",\n    \"卻\",\n    \"專\",\n    \"狀\",\n    \"育\",\n    \"廠\",\n    \"京\",\n    \"識\",\n    \"適\",\n    \"屬\",\n    \"圓\",\n    \"包\",\n    \"火\",\n    \"住\",\n    \"調\",\n    \"滿\",\n    \"縣\",\n    \"局\",\n    \"照\",\n    \"參\",\n    \"紅\",\n    \"細\",\n    \"引\",\n    \"聽\",\n    \"該\",\n    \"鐵\",\n    \"價\",\n    \"嚴\",\n    \"首\",\n    \"底\",\n    \"液\",\n    \"官\",\n    \"德\",\n    \"隨\",\n    \"病\",\n    \"蘇\",\n    \"失\",\n    \"爾\",\n    \"死\",\n    \"講\",\n    \"配\",\n    \"女\",\n    \"黃\",\n    \"推\",\n    \"顯\",\n    \"談\",\n    \"罪\",\n    \"神\",\n    \"藝\",\n    \"呢\",\n    \"席\",\n    \"含\",\n    \"企\",\n    \"望\",\n    \"密\",\n    \"批\",\n    \"營\",\n    \"項\",\n    \"防\",\n    \"舉\",\n    \"球\",\n    \"英\",\n    \"氧\",\n    \"勢\",\n    \"告\",\n    \"李\",\n    \"台\",\n    \"落\",\n    \"木\",\n    \"幫\",\n    \"輪\",\n    \"破\",\n    \"亞\",\n    \"師\",\n    \"圍\",\n    \"注\",\n    \"遠\",\n    \"字\",\n    \"材\",\n    \"排\",\n    \"供\",\n    \"河\",\n    \"態\",\n    \"封\",\n    \"另\",\n    \"施\",\n    \"減\",\n    \"樹\",\n    \"溶\",\n    \"怎\",\n    \"止\",\n    \"案\",\n    \"言\",\n    \"士\",\n    \"均\",\n    \"武\",\n    \"固\",\n    \"葉\",\n    \"魚\",\n    \"波\",\n    \"視\",\n    \"僅\",\n    \"費\",\n    \"緊\",\n    \"愛\",\n    \"左\",\n    \"章\",\n    \"早\",\n    \"朝\",\n    \"害\",\n    \"續\",\n    \"輕\",\n    \"服\",\n    \"試\",\n    \"食\",\n    \"充\",\n    \"兵\",\n    \"源\",\n    \"判\",\n    \"護\",\n    \"司\",\n    \"足\",\n    \"某\",\n    \"練\",\n    \"差\",\n    \"致\",\n    \"板\",\n    \"田\",\n    \"降\",\n    \"黑\",\n    \"犯\",\n    \"負\",\n    \"擊\",\n    \"范\",\n    \"繼\",\n    \"興\",\n    \"似\",\n    \"餘\",\n    \"堅\",\n    \"曲\",\n    \"輸\",\n    \"修\",\n    \"故\",\n    \"城\",\n    \"夫\",\n    \"夠\",\n    \"送\",\n    \"筆\",\n    \"船\",\n    \"佔\",\n    \"右\",\n    \"財\",\n    \"吃\",\n    \"富\",\n    \"春\",\n    \"職\",\n    \"覺\",\n    \"漢\",\n    \"畫\",\n    \"功\",\n    \"巴\",\n    \"跟\",\n    \"雖\",\n    \"雜\",\n    \"飛\",\n    \"檢\",\n    \"吸\",\n    \"助\",\n    \"昇\",\n    \"陽\",\n    \"互\",\n    \"初\",\n    \"創\",\n    \"抗\",\n    \"考\",\n    \"投\",\n    \"壞\",\n    \"策\",\n    \"古\",\n    \"徑\",\n    \"換\",\n    \"未\",\n    \"跑\",\n    \"留\",\n    \"鋼\",\n    \"曾\",\n    \"端\",\n    \"責\",\n    \"站\",\n    \"簡\",\n    \"述\",\n    \"錢\",\n    \"副\",\n    \"盡\",\n    \"帝\",\n    \"射\",\n    \"草\",\n    \"衝\",\n    \"承\",\n    \"獨\",\n    \"令\",\n    \"限\",\n    \"阿\",\n    \"宣\",\n    \"環\",\n    \"雙\",\n    \"請\",\n    \"超\",\n    \"微\",\n    \"讓\",\n    \"控\",\n    \"州\",\n    \"良\",\n    \"軸\",\n    \"找\",\n    \"否\",\n    \"紀\",\n    \"益\",\n    \"依\",\n    \"優\",\n    \"頂\",\n    \"礎\",\n    \"載\",\n    \"倒\",\n    \"房\",\n    \"突\",\n    \"坐\",\n    \"粉\",\n    \"敵\",\n    \"略\",\n    \"客\",\n    \"袁\",\n    \"冷\",\n    \"勝\",\n    \"絕\",\n    \"析\",\n    \"塊\",\n    \"劑\",\n    \"測\",\n    \"絲\",\n    \"協\",\n    \"訴\",\n    \"念\",\n    \"陳\",\n    \"仍\",\n    \"羅\",\n    \"鹽\",\n    \"友\",\n    \"洋\",\n    \"錯\",\n    \"苦\",\n    \"夜\",\n    \"刑\",\n    \"移\",\n    \"頻\",\n    \"逐\",\n    \"靠\",\n    \"混\",\n    \"母\",\n    \"短\",\n    \"皮\",\n    \"終\",\n    \"聚\",\n    \"汽\",\n    \"村\",\n    \"雲\",\n    \"哪\",\n    \"既\",\n    \"距\",\n    \"衛\",\n    \"停\",\n    \"烈\",\n    \"央\",\n    \"察\",\n    \"燒\",\n    \"迅\",\n    \"境\",\n    \"若\",\n    \"印\",\n    \"洲\",\n    \"刻\",\n    \"括\",\n    \"激\",\n    \"孔\",\n    \"搞\",\n    \"甚\",\n    \"室\",\n    \"待\",\n    \"核\",\n    \"校\",\n    \"散\",\n    \"侵\",\n    \"吧\",\n    \"甲\",\n    \"遊\",\n    \"久\",\n    \"菜\",\n    \"味\",\n    \"舊\",\n    \"模\",\n    \"湖\",\n    \"貨\",\n    \"損\",\n    \"預\",\n    \"阻\",\n    \"毫\",\n    \"普\",\n    \"穩\",\n    \"乙\",\n    \"媽\",\n    \"植\",\n    \"息\",\n    \"擴\",\n    \"銀\",\n    \"語\",\n    \"揮\",\n    \"酒\",\n    \"守\",\n    \"拿\",\n    \"序\",\n    \"紙\",\n    \"醫\",\n    \"缺\",\n    \"雨\",\n    \"嗎\",\n    \"針\",\n    \"劉\",\n    \"啊\",\n    \"急\",\n    \"唱\",\n    \"誤\",\n    \"訓\",\n    \"願\",\n    \"審\",\n    \"附\",\n    \"獲\",\n    \"茶\",\n    \"鮮\",\n    \"糧\",\n    \"斤\",\n    \"孩\",\n    \"脫\",\n    \"硫\",\n    \"肥\",\n    \"善\",\n    \"龍\",\n    \"演\",\n    \"父\",\n    \"漸\",\n    \"血\",\n    \"歡\",\n    \"械\",\n    \"掌\",\n    \"歌\",\n    \"沙\",\n    \"剛\",\n    \"攻\",\n    \"謂\",\n    \"盾\",\n    \"討\",\n    \"晚\",\n    \"粒\",\n    \"亂\",\n    \"燃\",\n    \"矛\",\n    \"乎\",\n    \"殺\",\n    \"藥\",\n    \"寧\",\n    \"魯\",\n    \"貴\",\n    \"鐘\",\n    \"煤\",\n    \"讀\",\n    \"班\",\n    \"伯\",\n    \"香\",\n    \"介\",\n    \"迫\",\n    \"句\",\n    \"豐\",\n    \"培\",\n    \"握\",\n    \"蘭\",\n    \"擔\",\n    \"弦\",\n    \"蛋\",\n    \"沉\",\n    \"假\",\n    \"穿\",\n    \"執\",\n    \"答\",\n    \"樂\",\n    \"誰\",\n    \"順\",\n    \"煙\",\n    \"縮\",\n    \"徵\",\n    \"臉\",\n    \"喜\",\n    \"松\",\n    \"腳\",\n    \"困\",\n    \"異\",\n    \"免\",\n    \"背\",\n    \"星\",\n    \"福\",\n    \"買\",\n    \"染\",\n    \"井\",\n    \"概\",\n    \"慢\",\n    \"怕\",\n    \"磁\",\n    \"倍\",\n    \"祖\",\n    \"皇\",\n    \"促\",\n    \"靜\",\n    \"補\",\n    \"評\",\n    \"翻\",\n    \"肉\",\n    \"踐\",\n    \"尼\",\n    \"衣\",\n    \"寬\",\n    \"揚\",\n    \"棉\",\n    \"希\",\n    \"傷\",\n    \"操\",\n    \"垂\",\n    \"秋\",\n    \"宜\",\n    \"氫\",\n    \"套\",\n    \"督\",\n    \"振\",\n    \"架\",\n    \"亮\",\n    \"末\",\n    \"憲\",\n    \"慶\",\n    \"編\",\n    \"牛\",\n    \"觸\",\n    \"映\",\n    \"雷\",\n    \"銷\",\n    \"詩\",\n    \"座\",\n    \"居\",\n    \"抓\",\n    \"裂\",\n    \"胞\",\n    \"呼\",\n    \"娘\",\n    \"景\",\n    \"威\",\n    \"綠\",\n    \"晶\",\n    \"厚\",\n    \"盟\",\n    \"衡\",\n    \"雞\",\n    \"孫\",\n    \"延\",\n    \"危\",\n    \"膠\",\n    \"屋\",\n    \"鄉\",\n    \"臨\",\n    \"陸\",\n    \"顧\",\n    \"掉\",\n    \"呀\",\n    \"燈\",\n    \"歲\",\n    \"措\",\n    \"束\",\n    \"耐\",\n    \"劇\",\n    \"玉\",\n    \"趙\",\n    \"跳\",\n    \"哥\",\n    \"季\",\n    \"課\",\n    \"凱\",\n    \"胡\",\n    \"額\",\n    \"款\",\n    \"紹\",\n    \"卷\",\n    \"齊\",\n    \"偉\",\n    \"蒸\",\n    \"殖\",\n    \"永\",\n    \"宗\",\n    \"苗\",\n    \"川\",\n    \"爐\",\n    \"岩\",\n    \"弱\",\n    \"零\",\n    \"楊\",\n    \"奏\",\n    \"沿\",\n    \"露\",\n    \"桿\",\n    \"探\",\n    \"滑\",\n    \"鎮\",\n    \"飯\",\n    \"濃\",\n    \"航\",\n    \"懷\",\n    \"趕\",\n    \"庫\",\n    \"奪\",\n    \"伊\",\n    \"靈\",\n    \"稅\",\n    \"途\",\n    \"滅\",\n    \"賽\",\n    \"歸\",\n    \"召\",\n    \"鼓\",\n    \"播\",\n    \"盤\",\n    \"裁\",\n    \"險\",\n    \"康\",\n    \"唯\",\n    \"錄\",\n    \"菌\",\n    \"純\",\n    \"借\",\n    \"糖\",\n    \"蓋\",\n    \"橫\",\n    \"符\",\n    \"私\",\n    \"努\",\n    \"堂\",\n    \"域\",\n    \"槍\",\n    \"潤\",\n    \"幅\",\n    \"哈\",\n    \"竟\",\n    \"熟\",\n    \"蟲\",\n    \"澤\",\n    \"腦\",\n    \"壤\",\n    \"碳\",\n    \"歐\",\n    \"遍\",\n    \"側\",\n    \"寨\",\n    \"敢\",\n    \"徹\",\n    \"慮\",\n    \"斜\",\n    \"薄\",\n    \"庭\",\n    \"納\",\n    \"彈\",\n    \"飼\",\n    \"伸\",\n    \"折\",\n    \"麥\",\n    \"濕\",\n    \"暗\",\n    \"荷\",\n    \"瓦\",\n    \"塞\",\n    \"床\",\n    \"築\",\n    \"惡\",\n    \"戶\",\n    \"訪\",\n    \"塔\",\n    \"奇\",\n    \"透\",\n    \"梁\",\n    \"刀\",\n    \"旋\",\n    \"跡\",\n    \"卡\",\n    \"氯\",\n    \"遇\",\n    \"份\",\n    \"毒\",\n    \"泥\",\n    \"退\",\n    \"洗\",\n    \"擺\",\n    \"灰\",\n    \"彩\",\n    \"賣\",\n    \"耗\",\n    \"夏\",\n    \"擇\",\n    \"忙\",\n    \"銅\",\n    \"獻\",\n    \"硬\",\n    \"予\",\n    \"繁\",\n    \"圈\",\n    \"雪\",\n    \"函\",\n    \"亦\",\n    \"抽\",\n    \"篇\",\n    \"陣\",\n    \"陰\",\n    \"丁\",\n    \"尺\",\n    \"追\",\n    \"堆\",\n    \"雄\",\n    \"迎\",\n    \"泛\",\n    \"爸\",\n    \"樓\",\n    \"避\",\n    \"謀\",\n    \"噸\",\n    \"野\",\n    \"豬\",\n    \"旗\",\n    \"累\",\n    \"偏\",\n    \"典\",\n    \"館\",\n    \"索\",\n    \"秦\",\n    \"脂\",\n    \"潮\",\n    \"爺\",\n    \"豆\",\n    \"忽\",\n    \"托\",\n    \"驚\",\n    \"塑\",\n    \"遺\",\n    \"愈\",\n    \"朱\",\n    \"替\",\n    \"纖\",\n    \"粗\",\n    \"傾\",\n    \"尚\",\n    \"痛\",\n    \"楚\",\n    \"謝\",\n    \"奮\",\n    \"購\",\n    \"磨\",\n    \"君\",\n    \"池\",\n    \"旁\",\n    \"碎\",\n    \"骨\",\n    \"監\",\n    \"捕\",\n    \"弟\",\n    \"暴\",\n    \"割\",\n    \"貫\",\n    \"殊\",\n    \"釋\",\n    \"詞\",\n    \"亡\",\n    \"壁\",\n    \"頓\",\n    \"寶\",\n    \"午\",\n    \"塵\",\n    \"聞\",\n    \"揭\",\n    \"炮\",\n    \"殘\",\n    \"冬\",\n    \"橋\",\n    \"婦\",\n    \"警\",\n    \"綜\",\n    \"招\",\n    \"吳\",\n    \"付\",\n    \"浮\",\n    \"遭\",\n    \"徐\",\n    \"您\",\n    \"搖\",\n    \"谷\",\n    \"贊\",\n    \"箱\",\n    \"隔\",\n    \"訂\",\n    \"男\",\n    \"吹\",\n    \"園\",\n    \"紛\",\n    \"唐\",\n    \"敗\",\n    \"宋\",\n    \"玻\",\n    \"巨\",\n    \"耕\",\n    \"坦\",\n    \"榮\",\n    \"閉\",\n    \"灣\",\n    \"鍵\",\n    \"凡\",\n    \"駐\",\n    \"鍋\",\n    \"救\",\n    \"恩\",\n    \"剝\",\n    \"凝\",\n    \"鹼\",\n    \"齒\",\n    \"截\",\n    \"煉\",\n    \"麻\",\n    \"紡\",\n    \"禁\",\n    \"廢\",\n    \"盛\",\n    \"版\",\n    \"緩\",\n    \"淨\",\n    \"睛\",\n    \"昌\",\n    \"婚\",\n    \"涉\",\n    \"筒\",\n    \"嘴\",\n    \"插\",\n    \"岸\",\n    \"朗\",\n    \"莊\",\n    \"街\",\n    \"藏\",\n    \"姑\",\n    \"貿\",\n    \"腐\",\n    \"奴\",\n    \"啦\",\n    \"慣\",\n    \"乘\",\n    \"夥\",\n    \"恢\",\n    \"勻\",\n    \"紗\",\n    \"扎\",\n    \"辯\",\n    \"耳\",\n    \"彪\",\n    \"臣\",\n    \"億\",\n    \"璃\",\n    \"抵\",\n    \"脈\",\n    \"秀\",\n    \"薩\",\n    \"俄\",\n    \"網\",\n    \"舞\",\n    \"店\",\n    \"噴\",\n    \"縱\",\n    \"寸\",\n    \"汗\",\n    \"掛\",\n    \"洪\",\n    \"賀\",\n    \"閃\",\n    \"柬\",\n    \"爆\",\n    \"烯\",\n    \"津\",\n    \"稻\",\n    \"牆\",\n    \"軟\",\n    \"勇\",\n    \"像\",\n    \"滾\",\n    \"厘\",\n    \"蒙\",\n    \"芳\",\n    \"肯\",\n    \"坡\",\n    \"柱\",\n    \"盪\",\n    \"腿\",\n    \"儀\",\n    \"旅\",\n    \"尾\",\n    \"軋\",\n    \"冰\",\n    \"貢\",\n    \"登\",\n    \"黎\",\n    \"削\",\n    \"鑽\",\n    \"勒\",\n    \"逃\",\n    \"障\",\n    \"氨\",\n    \"郭\",\n    \"峰\",\n    \"幣\",\n    \"港\",\n    \"伏\",\n    \"軌\",\n    \"畝\",\n    \"畢\",\n    \"擦\",\n    \"莫\",\n    \"刺\",\n    \"浪\",\n    \"秘\",\n    \"援\",\n    \"株\",\n    \"健\",\n    \"售\",\n    \"股\",\n    \"島\",\n    \"甘\",\n    \"泡\",\n    \"睡\",\n    \"童\",\n    \"鑄\",\n    \"湯\",\n    \"閥\",\n    \"休\",\n    \"匯\",\n    \"舍\",\n    \"牧\",\n    \"繞\",\n    \"炸\",\n    \"哲\",\n    \"磷\",\n    \"績\",\n    \"朋\",\n    \"淡\",\n    \"尖\",\n    \"啟\",\n    \"陷\",\n    \"柴\",\n    \"呈\",\n    \"徒\",\n    \"顏\",\n    \"淚\",\n    \"稍\",\n    \"忘\",\n    \"泵\",\n    \"藍\",\n    \"拖\",\n    \"洞\",\n    \"授\",\n    \"鏡\",\n    \"辛\",\n    \"壯\",\n    \"鋒\",\n    \"貧\",\n    \"虛\",\n    \"彎\",\n    \"摩\",\n    \"泰\",\n    \"幼\",\n    \"廷\",\n    \"尊\",\n    \"窗\",\n    \"綱\",\n    \"弄\",\n    \"隸\",\n    \"疑\",\n    \"氏\",\n    \"宮\",\n    \"姐\",\n    \"震\",\n    \"瑞\",\n    \"怪\",\n    \"尤\",\n    \"琴\",\n    \"循\",\n    \"描\",\n    \"膜\",\n    \"違\",\n    \"夾\",\n    \"腰\",\n    \"緣\",\n    \"珠\",\n    \"窮\",\n    \"森\",\n    \"枝\",\n    \"竹\",\n    \"溝\",\n    \"催\",\n    \"繩\",\n    \"憶\",\n    \"邦\",\n    \"剩\",\n    \"幸\",\n    \"漿\",\n    \"欄\",\n    \"擁\",\n    \"牙\",\n    \"貯\",\n    \"禮\",\n    \"濾\",\n    \"鈉\",\n    \"紋\",\n    \"罷\",\n    \"拍\",\n    \"咱\",\n    \"喊\",\n    \"袖\",\n    \"埃\",\n    \"勤\",\n    \"罰\",\n    \"焦\",\n    \"潛\",\n    \"伍\",\n    \"墨\",\n    \"欲\",\n    \"縫\",\n    \"姓\",\n    \"刊\",\n    \"飽\",\n    \"仿\",\n    \"獎\",\n    \"鋁\",\n    \"鬼\",\n    \"麗\",\n    \"跨\",\n    \"默\",\n    \"挖\",\n    \"鏈\",\n    \"掃\",\n    \"喝\",\n    \"袋\",\n    \"炭\",\n    \"污\",\n    \"幕\",\n    \"諸\",\n    \"弧\",\n    \"勵\",\n    \"梅\",\n    \"奶\",\n    \"潔\",\n    \"災\",\n    \"舟\",\n    \"鑑\",\n    \"苯\",\n    \"訟\",\n    \"抱\",\n    \"毀\",\n    \"懂\",\n    \"寒\",\n    \"智\",\n    \"埔\",\n    \"寄\",\n    \"屆\",\n    \"躍\",\n    \"渡\",\n    \"挑\",\n    \"丹\",\n    \"艱\",\n    \"貝\",\n    \"碰\",\n    \"拔\",\n    \"爹\",\n    \"戴\",\n    \"碼\",\n    \"夢\",\n    \"芽\",\n    \"熔\",\n    \"赤\",\n    \"漁\",\n    \"哭\",\n    \"敬\",\n    \"顆\",\n    \"奔\",\n    \"鉛\",\n    \"仲\",\n    \"虎\",\n    \"稀\",\n    \"妹\",\n    \"乏\",\n    \"珍\",\n    \"申\",\n    \"桌\",\n    \"遵\",\n    \"允\",\n    \"隆\",\n    \"螺\",\n    \"倉\",\n    \"魏\",\n    \"銳\",\n    \"曉\",\n    \"氮\",\n    \"兼\",\n    \"隱\",\n    \"礙\",\n    \"赫\",\n    \"撥\",\n    \"忠\",\n    \"肅\",\n    \"缸\",\n    \"牽\",\n    \"搶\",\n    \"博\",\n    \"巧\",\n    \"殼\",\n    \"兄\",\n    \"杜\",\n    \"訊\",\n    \"誠\",\n    \"碧\",\n    \"祥\",\n    \"柯\",\n    \"頁\",\n    \"巡\",\n    \"矩\",\n    \"悲\",\n    \"灌\",\n    \"齡\",\n    \"倫\",\n    \"票\",\n    \"尋\",\n    \"桂\",\n    \"鋪\",\n    \"聖\",\n    \"恐\",\n    \"恰\",\n    \"鄭\",\n    \"趣\",\n    \"抬\",\n    \"荒\",\n    \"騰\",\n    \"貼\",\n    \"柔\",\n    \"滴\",\n    \"猛\",\n    \"闊\",\n    \"輛\",\n    \"妻\",\n    \"填\",\n    \"撤\",\n    \"儲\",\n    \"簽\",\n    \"鬧\",\n    \"擾\",\n    \"紫\",\n    \"砂\",\n    \"遞\",\n    \"戲\",\n    \"吊\",\n    \"陶\",\n    \"伐\",\n    \"餵\",\n    \"療\",\n    \"瓶\",\n    \"婆\",\n    \"撫\",\n    \"臂\",\n    \"摸\",\n    \"忍\",\n    \"蝦\",\n    \"蠟\",\n    \"鄰\",\n    \"胸\",\n    \"鞏\",\n    \"擠\",\n    \"偶\",\n    \"棄\",\n    \"槽\",\n    \"勁\",\n    \"乳\",\n    \"鄧\",\n    \"吉\",\n    \"仁\",\n    \"爛\",\n    \"磚\",\n    \"租\",\n    \"烏\",\n    \"艦\",\n    \"伴\",\n    \"瓜\",\n    \"淺\",\n    \"丙\",\n    \"暫\",\n    \"燥\",\n    \"橡\",\n    \"柳\",\n    \"迷\",\n    \"暖\",\n    \"牌\",\n    \"秧\",\n    \"膽\",\n    \"詳\",\n    \"簧\",\n    \"踏\",\n    \"瓷\",\n    \"譜\",\n    \"呆\",\n    \"賓\",\n    \"糊\",\n    \"洛\",\n    \"輝\",\n    \"憤\",\n    \"競\",\n    \"隙\",\n    \"怒\",\n    \"粘\",\n    \"乃\",\n    \"緒\",\n    \"肩\",\n    \"籍\",\n    \"敏\",\n    \"塗\",\n    \"熙\",\n    \"皆\",\n    \"偵\",\n    \"懸\",\n    \"掘\",\n    \"享\",\n    \"糾\",\n    \"醒\",\n    \"狂\",\n    \"鎖\",\n    \"淀\",\n    \"恨\",\n    \"牲\",\n    \"霸\",\n    \"爬\",\n    \"賞\",\n    \"逆\",\n    \"玩\",\n    \"陵\",\n    \"祝\",\n    \"秒\",\n    \"浙\",\n    \"貌\",\n    \"役\",\n    \"彼\",\n    \"悉\",\n    \"鴨\",\n    \"趨\",\n    \"鳳\",\n    \"晨\",\n    \"畜\",\n    \"輩\",\n    \"秩\",\n    \"卵\",\n    \"署\",\n    \"梯\",\n    \"炎\",\n    \"灘\",\n    \"棋\",\n    \"驅\",\n    \"篩\",\n    \"峽\",\n    \"冒\",\n    \"啥\",\n    \"壽\",\n    \"譯\",\n    \"浸\",\n    \"泉\",\n    \"帽\",\n    \"遲\",\n    \"矽\",\n    \"疆\",\n    \"貸\",\n    \"漏\",\n    \"稿\",\n    \"冠\",\n    \"嫩\",\n    \"脅\",\n    \"芯\",\n    \"牢\",\n    \"叛\",\n    \"蝕\",\n    \"奧\",\n    \"鳴\",\n    \"嶺\",\n    \"羊\",\n    \"憑\",\n    \"串\",\n    \"塘\",\n    \"繪\",\n    \"酵\",\n    \"融\",\n    \"盆\",\n    \"錫\",\n    \"廟\",\n    \"籌\",\n    \"凍\",\n    \"輔\",\n    \"攝\",\n    \"襲\",\n    \"筋\",\n    \"拒\",\n    \"僚\",\n    \"旱\",\n    \"鉀\",\n    \"鳥\",\n    \"漆\",\n    \"沈\",\n    \"眉\",\n    \"疏\",\n    \"添\",\n    \"棒\",\n    \"穗\",\n    \"硝\",\n    \"韓\",\n    \"逼\",\n    \"扭\",\n    \"僑\",\n    \"涼\",\n    \"挺\",\n    \"碗\",\n    \"栽\",\n    \"炒\",\n    \"杯\",\n    \"患\",\n    \"餾\",\n    \"勸\",\n    \"豪\",\n    \"遼\",\n    \"勃\",\n    \"鴻\",\n    \"旦\",\n    \"吏\",\n    \"拜\",\n    \"狗\",\n    \"埋\",\n    \"輥\",\n    \"掩\",\n    \"飲\",\n    \"搬\",\n    \"罵\",\n    \"辭\",\n    \"勾\",\n    \"扣\",\n    \"估\",\n    \"蔣\",\n    \"絨\",\n    \"霧\",\n    \"丈\",\n    \"朵\",\n    \"姆\",\n    \"擬\",\n    \"宇\",\n    \"輯\",\n    \"陝\",\n    \"雕\",\n    \"償\",\n    \"蓄\",\n    \"崇\",\n    \"剪\",\n    \"倡\",\n    \"廳\",\n    \"咬\",\n    \"駛\",\n    \"薯\",\n    \"刷\",\n    \"斥\",\n    \"番\",\n    \"賦\",\n    \"奉\",\n    \"佛\",\n    \"澆\",\n    \"漫\",\n    \"曼\",\n    \"扇\",\n    \"鈣\",\n    \"桃\",\n    \"扶\",\n    \"仔\",\n    \"返\",\n    \"俗\",\n    \"虧\",\n    \"腔\",\n    \"鞋\",\n    \"棱\",\n    \"覆\",\n    \"框\",\n    \"悄\",\n    \"叔\",\n    \"撞\",\n    \"騙\",\n    \"勘\",\n    \"旺\",\n    \"沸\",\n    \"孤\",\n    \"吐\",\n    \"孟\",\n    \"渠\",\n    \"屈\",\n    \"疾\",\n    \"妙\",\n    \"惜\",\n    \"仰\",\n    \"狠\",\n    \"脹\",\n    \"諧\",\n    \"拋\",\n    \"黴\",\n    \"桑\",\n    \"崗\",\n    \"嘛\",\n    \"衰\",\n    \"盜\",\n    \"滲\",\n    \"臟\",\n    \"賴\",\n    \"湧\",\n    \"甜\",\n    \"曹\",\n    \"閱\",\n    \"肌\",\n    \"哩\",\n    \"厲\",\n    \"烴\",\n    \"緯\",\n    \"毅\",\n    \"昨\",\n    \"偽\",\n    \"症\",\n    \"煮\",\n    \"嘆\",\n    \"釘\",\n    \"搭\",\n    \"莖\",\n    \"籠\",\n    \"酷\",\n    \"偷\",\n    \"弓\",\n    \"錐\",\n    \"恆\",\n    \"傑\",\n    \"坑\",\n    \"鼻\",\n    \"翼\",\n    \"綸\",\n    \"敘\",\n    \"獄\",\n    \"逮\",\n    \"罐\",\n    \"絡\",\n    \"棚\",\n    \"抑\",\n    \"膨\",\n    \"蔬\",\n    \"寺\",\n    \"驟\",\n    \"穆\",\n    \"冶\",\n    \"枯\",\n    \"冊\",\n    \"屍\",\n    \"凸\",\n    \"紳\",\n    \"坯\",\n    \"犧\",\n    \"焰\",\n    \"轟\",\n    \"欣\",\n    \"晉\",\n    \"瘦\",\n    \"禦\",\n    \"錠\",\n    \"錦\",\n    \"喪\",\n    \"旬\",\n    \"鍛\",\n    \"壟\",\n    \"搜\",\n    \"撲\",\n    \"邀\",\n    \"亭\",\n    \"酯\",\n    \"邁\",\n    \"舒\",\n    \"脆\",\n    \"酶\",\n    \"閒\",\n    \"憂\",\n    \"酚\",\n    \"頑\",\n    \"羽\",\n    \"漲\",\n    \"卸\",\n    \"仗\",\n    \"陪\",\n    \"闢\",\n    \"懲\",\n    \"杭\",\n    \"姚\",\n    \"肚\",\n    \"捉\",\n    \"飄\",\n    \"漂\",\n    \"昆\",\n    \"欺\",\n    \"吾\",\n    \"郎\",\n    \"烷\",\n    \"汁\",\n    \"呵\",\n    \"飾\",\n    \"蕭\",\n    \"雅\",\n    \"郵\",\n    \"遷\",\n    \"燕\",\n    \"撒\",\n    \"姻\",\n    \"赴\",\n    \"宴\",\n    \"煩\",\n    \"債\",\n    \"帳\",\n    \"斑\",\n    \"鈴\",\n    \"旨\",\n    \"醇\",\n    \"董\",\n    \"餅\",\n    \"雛\",\n    \"姿\",\n    \"拌\",\n    \"傅\",\n    \"腹\",\n    \"妥\",\n    \"揉\",\n    \"賢\",\n    \"拆\",\n    \"歪\",\n    \"葡\",\n    \"胺\",\n    \"丟\",\n    \"浩\",\n    \"徽\",\n    \"昂\",\n    \"墊\",\n    \"擋\",\n    \"覽\",\n    \"貪\",\n    \"慰\",\n    \"繳\",\n    \"汪\",\n    \"慌\",\n    \"馮\",\n    \"諾\",\n    \"姜\",\n    \"誼\",\n    \"兇\",\n    \"劣\",\n    \"誣\",\n    \"耀\",\n    \"昏\",\n    \"躺\",\n    \"盈\",\n    \"騎\",\n    \"喬\",\n    \"溪\",\n    \"叢\",\n    \"盧\",\n    \"抹\",\n    \"悶\",\n    \"諮\",\n    \"刮\",\n    \"駕\",\n    \"纜\",\n    \"悟\",\n    \"摘\",\n    \"鉺\",\n    \"擲\",\n    \"頗\",\n    \"幻\",\n    \"柄\",\n    \"惠\",\n    \"慘\",\n    \"佳\",\n    \"仇\",\n    \"臘\",\n    \"窩\",\n    \"滌\",\n    \"劍\",\n    \"瞧\",\n    \"堡\",\n    \"潑\",\n    \"蔥\",\n    \"罩\",\n    \"霍\",\n    \"撈\",\n    \"胎\",\n    \"蒼\",\n    \"濱\",\n    \"倆\",\n    \"捅\",\n    \"湘\",\n    \"砍\",\n    \"霞\",\n    \"邵\",\n    \"萄\",\n    \"瘋\",\n    \"淮\",\n    \"遂\",\n    \"熊\",\n    \"糞\",\n    \"烘\",\n    \"宿\",\n    \"檔\",\n    \"戈\",\n    \"駁\",\n    \"嫂\",\n    \"裕\",\n    \"徙\",\n    \"箭\",\n    \"捐\",\n    \"腸\",\n    \"撐\",\n    \"曬\",\n    \"辨\",\n    \"殿\",\n    \"蓮\",\n    \"攤\",\n    \"攪\",\n    \"醬\",\n    \"屏\",\n    \"疫\",\n    \"哀\",\n    \"蔡\",\n    \"堵\",\n    \"沫\",\n    \"皺\",\n    \"暢\",\n    \"疊\",\n    \"閣\",\n    \"萊\",\n    \"敲\",\n    \"轄\",\n    \"鉤\",\n    \"痕\",\n    \"壩\",\n    \"巷\",\n    \"餓\",\n    \"禍\",\n    \"丘\",\n    \"玄\",\n    \"溜\",\n    \"曰\",\n    \"邏\",\n    \"彭\",\n    \"嘗\",\n    \"卿\",\n    \"妨\",\n    \"艇\",\n    \"吞\",\n    \"韋\",\n    \"怨\",\n    \"矮\",\n    \"歇\"\n]\n[\n    \"abdikace\",\n    \"abeceda\",\n    \"adresa\",\n    \"agrese\",\n    \"akce\",\n    \"aktovka\",\n    \"alej\",\n    \"alkohol\",\n    \"amputace\",\n    \"ananas\",\n    \"andulka\",\n    \"anekdota\",\n    \"anketa\",\n    \"antika\",\n    \"anulovat\",\n    \"archa\",\n    \"arogance\",\n    \"asfalt\",\n    \"asistent\",\n    \"aspirace\",\n    \"astma\",\n    \"astronom\",\n    \"atlas\",\n    \"atletika\",\n    \"atol\",\n    \"autobus\",\n    \"azyl\",\n    \"babka\",\n    \"bachor\",\n    \"bacil\",\n    \"baculka\",\n    \"badatel\",\n    \"bageta\",\n    \"bagr\",\n    \"bahno\",\n    \"bakterie\",\n    \"balada\",\n    \"baletka\",\n    \"balkon\",\n    \"balonek\",\n    \"balvan\",\n    \"balza\",\n    \"bambus\",\n    \"bankomat\",\n    \"barbar\",\n    \"baret\",\n    \"barman\",\n    \"baroko\",\n    \"barva\",\n    \"baterka\",\n    \"batoh\",\n    \"bavlna\",\n    \"bazalka\",\n    \"bazilika\",\n    \"bazuka\",\n    \"bedna\",\n    \"beran\",\n    \"beseda\",\n    \"bestie\",\n    \"beton\",\n    \"bezinka\",\n    \"bezmoc\",\n    \"beztak\",\n    \"bicykl\",\n    \"bidlo\",\n    \"biftek\",\n    \"bikiny\",\n    \"bilance\",\n    \"biograf\",\n    \"biolog\",\n    \"bitva\",\n    \"bizon\",\n    \"blahobyt\",\n    \"blatouch\",\n    \"blecha\",\n    \"bledule\",\n    \"blesk\",\n    \"blikat\",\n    \"blizna\",\n    \"blokovat\",\n    \"bloudit\",\n    \"blud\",\n    \"bobek\",\n    \"bobr\",\n    \"bodlina\",\n    \"bodnout\",\n    \"bohatost\",\n    \"bojkot\",\n    \"bojovat\",\n    \"bokorys\",\n    \"bolest\",\n    \"borec\",\n    \"borovice\",\n    \"bota\",\n    \"boubel\",\n    \"bouchat\",\n    \"bouda\",\n    \"boule\",\n    \"bourat\",\n    \"boxer\",\n    \"bradavka\",\n    \"brambora\",\n    \"branka\",\n    \"bratr\",\n    \"brepta\",\n    \"briketa\",\n    \"brko\",\n    \"brloh\",\n    \"bronz\",\n    \"broskev\",\n    \"brunetka\",\n    \"brusinka\",\n    \"brzda\",\n    \"brzy\",\n    \"bublina\",\n    \"bubnovat\",\n    \"buchta\",\n    \"buditel\",\n    \"budka\",\n    \"budova\",\n    \"bufet\",\n    \"bujarost\",\n    \"bukvice\",\n    \"buldok\",\n    \"bulva\",\n    \"bunda\",\n    \"bunkr\",\n    \"burza\",\n    \"butik\",\n    \"buvol\",\n    \"buzola\",\n    \"bydlet\",\n    \"bylina\",\n    \"bytovka\",\n    \"bzukot\",\n    \"capart\",\n    \"carevna\",\n    \"cedr\",\n    \"cedule\",\n    \"cejch\",\n    \"cejn\",\n    \"cela\",\n    \"celer\",\n    \"celkem\",\n    \"celnice\",\n    \"cenina\",\n    \"cennost\",\n    \"cenovka\",\n    \"centrum\",\n    \"cenzor\",\n    \"cestopis\",\n    \"cetka\",\n    \"chalupa\",\n    \"chapadlo\",\n    \"charita\",\n    \"chata\",\n    \"chechtat\",\n    \"chemie\",\n    \"chichot\",\n    \"chirurg\",\n    \"chlad\",\n    \"chleba\",\n    \"chlubit\",\n    \"chmel\",\n    \"chmura\",\n    \"chobot\",\n    \"chochol\",\n    \"chodba\",\n    \"cholera\",\n    \"chomout\",\n    \"chopit\",\n    \"choroba\",\n    \"chov\",\n    \"chrapot\",\n    \"chrlit\",\n    \"chrt\",\n    \"chrup\",\n    \"chtivost\",\n    \"chudina\",\n    \"chutnat\",\n    \"chvat\",\n    \"chvilka\",\n    \"chvost\",\n    \"chyba\",\n    \"chystat\",\n    \"chytit\",\n    \"cibule\",\n    \"cigareta\",\n    \"cihelna\",\n    \"cihla\",\n    \"cinkot\",\n    \"cirkus\",\n    \"cisterna\",\n    \"citace\",\n    \"citrus\",\n    \"cizinec\",\n    \"cizost\",\n    \"clona\",\n    \"cokoliv\",\n    \"couvat\",\n    \"ctitel\",\n    \"ctnost\",\n    \"cudnost\",\n    \"cuketa\",\n    \"cukr\",\n    \"cupot\",\n    \"cvaknout\",\n    \"cval\",\n    \"cvik\",\n    \"cvrkot\",\n    \"cyklista\",\n    \"daleko\",\n    \"dareba\",\n    \"datel\",\n    \"datum\",\n    \"dcera\",\n    \"debata\",\n    \"dechovka\",\n    \"decibel\",\n    \"deficit\",\n    \"deflace\",\n    \"dekl\",\n    \"dekret\",\n    \"demokrat\",\n    \"deprese\",\n    \"derby\",\n    \"deska\",\n    \"detektiv\",\n    \"dikobraz\",\n    \"diktovat\",\n    \"dioda\",\n    \"diplom\",\n    \"disk\",\n    \"displej\",\n    \"divadlo\",\n    \"divoch\",\n    \"dlaha\",\n    \"dlouho\",\n    \"dluhopis\",\n    \"dnes\",\n    \"dobro\",\n    \"dobytek\",\n    \"docent\",\n    \"dochutit\",\n    \"dodnes\",\n    \"dohled\",\n    \"dohoda\",\n    \"dohra\",\n    \"dojem\",\n    \"dojnice\",\n    \"doklad\",\n    \"dokola\",\n    \"doktor\",\n    \"dokument\",\n    \"dolar\",\n    \"doleva\",\n    \"dolina\",\n    \"doma\",\n    \"dominant\",\n    \"domluvit\",\n    \"domov\",\n    \"donutit\",\n    \"dopad\",\n    \"dopis\",\n    \"doplnit\",\n    \"doposud\",\n    \"doprovod\",\n    \"dopustit\",\n    \"dorazit\",\n    \"dorost\",\n    \"dort\",\n    \"dosah\",\n    \"doslov\",\n    \"dostatek\",\n    \"dosud\",\n    \"dosyta\",\n    \"dotaz\",\n    \"dotek\",\n    \"dotknout\",\n    \"doufat\",\n    \"doutnat\",\n    \"dovozce\",\n    \"dozadu\",\n    \"doznat\",\n    \"dozorce\",\n    \"drahota\",\n    \"drak\",\n    \"dramatik\",\n    \"dravec\",\n    \"draze\",\n    \"drdol\",\n    \"drobnost\",\n    \"drogerie\",\n    \"drozd\",\n    \"drsnost\",\n    \"drtit\",\n    \"drzost\",\n    \"duben\",\n    \"duchovno\",\n    \"dudek\",\n    \"duha\",\n    \"duhovka\",\n    \"dusit\",\n    \"dusno\",\n    \"dutost\",\n    \"dvojice\",\n    \"dvorec\",\n    \"dynamit\",\n    \"ekolog\",\n    \"ekonomie\",\n    \"elektron\",\n    \"elipsa\",\n    \"email\",\n    \"emise\",\n    \"emoce\",\n    \"empatie\",\n    \"epizoda\",\n    \"epocha\",\n    \"epopej\",\n    \"epos\",\n    \"esej\",\n    \"esence\",\n    \"eskorta\",\n    \"eskymo\",\n    \"etiketa\",\n    \"euforie\",\n    \"evoluce\",\n    \"exekuce\",\n    \"exkurze\",\n    \"expedice\",\n    \"exploze\",\n    \"export\",\n    \"extrakt\",\n    \"facka\",\n    \"fajfka\",\n    \"fakulta\",\n    \"fanatik\",\n    \"fantazie\",\n    \"farmacie\",\n    \"favorit\",\n    \"fazole\",\n    \"federace\",\n    \"fejeton\",\n    \"fenka\",\n    \"fialka\",\n    \"figurant\",\n    \"filozof\",\n    \"filtr\",\n    \"finance\",\n    \"finta\",\n    \"fixace\",\n    \"fjord\",\n    \"flanel\",\n    \"flirt\",\n    \"flotila\",\n    \"fond\",\n    \"fosfor\",\n    \"fotbal\",\n    \"fotka\",\n    \"foton\",\n    \"frakce\",\n    \"freska\",\n    \"fronta\",\n    \"fukar\",\n    \"funkce\",\n    \"fyzika\",\n    \"galeje\",\n    \"garant\",\n    \"genetika\",\n    \"geolog\",\n    \"gilotina\",\n    \"glazura\",\n    \"glejt\",\n    \"golem\",\n    \"golfista\",\n    \"gotika\",\n    \"graf\",\n    \"gramofon\",\n    \"granule\",\n    \"grep\",\n    \"gril\",\n    \"grog\",\n    \"groteska\",\n    \"guma\",\n    \"hadice\",\n    \"hadr\",\n    \"hala\",\n    \"halenka\",\n    \"hanba\",\n    \"hanopis\",\n    \"harfa\",\n    \"harpuna\",\n    \"havran\",\n    \"hebkost\",\n    \"hejkal\",\n    \"hejno\",\n    \"hejtman\",\n    \"hektar\",\n    \"helma\",\n    \"hematom\",\n    \"herec\",\n    \"herna\",\n    \"heslo\",\n    \"hezky\",\n    \"historik\",\n    \"hladovka\",\n    \"hlasivky\",\n    \"hlava\",\n    \"hledat\",\n    \"hlen\",\n    \"hlodavec\",\n    \"hloh\",\n    \"hloupost\",\n    \"hltat\",\n    \"hlubina\",\n    \"hluchota\",\n    \"hmat\",\n    \"hmota\",\n    \"hmyz\",\n    \"hnis\",\n    \"hnojivo\",\n    \"hnout\",\n    \"hoblina\",\n    \"hoboj\",\n    \"hoch\",\n    \"hodiny\",\n    \"hodlat\",\n    \"hodnota\",\n    \"hodovat\",\n    \"hojnost\",\n    \"hokej\",\n    \"holinka\",\n    \"holka\",\n    \"holub\",\n    \"homole\",\n    \"honitba\",\n    \"honorace\",\n    \"horal\",\n    \"horda\",\n    \"horizont\",\n    \"horko\",\n    \"horlivec\",\n    \"hormon\",\n    \"hornina\",\n    \"horoskop\",\n    \"horstvo\",\n    \"hospoda\",\n    \"hostina\",\n    \"hotovost\",\n    \"houba\",\n    \"houf\",\n    \"houpat\",\n    \"houska\",\n    \"hovor\",\n    \"hradba\",\n    \"hranice\",\n    \"hravost\",\n    \"hrazda\",\n    \"hrbolek\",\n    \"hrdina\",\n    \"hrdlo\",\n    \"hrdost\",\n    \"hrnek\",\n    \"hrobka\",\n    \"hromada\",\n    \"hrot\",\n    \"hrouda\",\n    \"hrozen\",\n    \"hrstka\",\n    \"hrubost\",\n    \"hryzat\",\n    \"hubenost\",\n    \"hubnout\",\n    \"hudba\",\n    \"hukot\",\n    \"humr\",\n    \"husita\",\n    \"hustota\",\n    \"hvozd\",\n    \"hybnost\",\n    \"hydrant\",\n    \"hygiena\",\n    \"hymna\",\n    \"hysterik\",\n    \"idylka\",\n    \"ihned\",\n    \"ikona\",\n    \"iluze\",\n    \"imunita\",\n    \"infekce\",\n    \"inflace\",\n    \"inkaso\",\n    \"inovace\",\n    \"inspekce\",\n    \"internet\",\n    \"invalida\",\n    \"investor\",\n    \"inzerce\",\n    \"ironie\",\n    \"jablko\",\n    \"jachta\",\n    \"jahoda\",\n    \"jakmile\",\n    \"jakost\",\n    \"jalovec\",\n    \"jantar\",\n    \"jarmark\",\n    \"jaro\",\n    \"jasan\",\n    \"jasno\",\n    \"jatka\",\n    \"javor\",\n    \"jazyk\",\n    \"jedinec\",\n    \"jedle\",\n    \"jednatel\",\n    \"jehlan\",\n    \"jekot\",\n    \"jelen\",\n    \"jelito\",\n    \"jemnost\",\n    \"jenom\",\n    \"jepice\",\n    \"jeseter\",\n    \"jevit\",\n    \"jezdec\",\n    \"jezero\",\n    \"jinak\",\n    \"jindy\",\n    \"jinoch\",\n    \"jiskra\",\n    \"jistota\",\n    \"jitrnice\",\n    \"jizva\",\n    \"jmenovat\",\n    \"jogurt\",\n    \"jurta\",\n    \"kabaret\",\n    \"kabel\",\n    \"kabinet\",\n    \"kachna\",\n    \"kadet\",\n    \"kadidlo\",\n    \"kahan\",\n    \"kajak\",\n    \"kajuta\",\n    \"kakao\",\n    \"kaktus\",\n    \"kalamita\",\n    \"kalhoty\",\n    \"kalibr\",\n    \"kalnost\",\n    \"kamera\",\n    \"kamkoliv\",\n    \"kamna\",\n    \"kanibal\",\n    \"kanoe\",\n    \"kantor\",\n    \"kapalina\",\n    \"kapela\",\n    \"kapitola\",\n    \"kapka\",\n    \"kaple\",\n    \"kapota\",\n    \"kapr\",\n    \"kapusta\",\n    \"kapybara\",\n    \"karamel\",\n    \"karotka\",\n    \"karton\",\n    \"kasa\",\n    \"katalog\",\n    \"katedra\",\n    \"kauce\",\n    \"kauza\",\n    \"kavalec\",\n    \"kazajka\",\n    \"kazeta\",\n    \"kazivost\",\n    \"kdekoliv\",\n    \"kdesi\",\n    \"kedluben\",\n    \"kemp\",\n    \"keramika\",\n    \"kino\",\n    \"klacek\",\n    \"kladivo\",\n    \"klam\",\n    \"klapot\",\n    \"klasika\",\n    \"klaun\",\n    \"klec\",\n    \"klenba\",\n    \"klepat\",\n    \"klesnout\",\n    \"klid\",\n    \"klima\",\n    \"klisna\",\n    \"klobouk\",\n    \"klokan\",\n    \"klopa\",\n    \"kloub\",\n    \"klubovna\",\n    \"klusat\",\n    \"kluzkost\",\n    \"kmen\",\n    \"kmitat\",\n    \"kmotr\",\n    \"kniha\",\n    \"knot\",\n    \"koalice\",\n    \"koberec\",\n    \"kobka\",\n    \"kobliha\",\n    \"kobyla\",\n    \"kocour\",\n    \"kohout\",\n    \"kojenec\",\n    \"kokos\",\n    \"koktejl\",\n    \"kolaps\",\n    \"koleda\",\n    \"kolize\",\n    \"kolo\",\n    \"komando\",\n    \"kometa\",\n    \"komik\",\n    \"komnata\",\n    \"komora\",\n    \"kompas\",\n    \"komunita\",\n    \"konat\",\n    \"koncept\",\n    \"kondice\",\n    \"konec\",\n    \"konfese\",\n    \"kongres\",\n    \"konina\",\n    \"konkurs\",\n    \"kontakt\",\n    \"konzerva\",\n    \"kopanec\",\n    \"kopie\",\n    \"kopnout\",\n    \"koprovka\",\n    \"korbel\",\n    \"korektor\",\n    \"kormidlo\",\n    \"koroptev\",\n    \"korpus\",\n    \"koruna\",\n    \"koryto\",\n    \"korzet\",\n    \"kosatec\",\n    \"kostka\",\n    \"kotel\",\n    \"kotleta\",\n    \"kotoul\",\n    \"koukat\",\n    \"koupelna\",\n    \"kousek\",\n    \"kouzlo\",\n    \"kovboj\",\n    \"koza\",\n    \"kozoroh\",\n    \"krabice\",\n    \"krach\",\n    \"krajina\",\n    \"kralovat\",\n    \"krasopis\",\n    \"kravata\",\n    \"kredit\",\n    \"krejcar\",\n    \"kresba\",\n    \"kreveta\",\n    \"kriket\",\n    \"kritik\",\n    \"krize\",\n    \"krkavec\",\n    \"krmelec\",\n    \"krmivo\",\n    \"krocan\",\n    \"krok\",\n    \"kronika\",\n    \"kropit\",\n    \"kroupa\",\n    \"krovka\",\n    \"krtek\",\n    \"kruhadlo\",\n    \"krupice\",\n    \"krutost\",\n    \"krvinka\",\n    \"krychle\",\n    \"krypta\",\n    \"krystal\",\n    \"kryt\",\n    \"kudlanka\",\n    \"kufr\",\n    \"kujnost\",\n    \"kukla\",\n    \"kulajda\",\n    \"kulich\",\n    \"kulka\",\n    \"kulomet\",\n    \"kultura\",\n    \"kuna\",\n    \"kupodivu\",\n    \"kurt\",\n    \"kurzor\",\n    \"kutil\",\n    \"kvalita\",\n    \"kvasinka\",\n    \"kvestor\",\n    \"kynolog\",\n    \"kyselina\",\n    \"kytara\",\n    \"kytice\",\n    \"kytka\",\n    \"kytovec\",\n    \"kyvadlo\",\n    \"labrador\",\n    \"lachtan\",\n    \"ladnost\",\n    \"laik\",\n    \"lakomec\",\n    \"lamela\",\n    \"lampa\",\n    \"lanovka\",\n    \"lasice\",\n    \"laso\",\n    \"lastura\",\n    \"latinka\",\n    \"lavina\",\n    \"lebka\",\n    \"leckdy\",\n    \"leden\",\n    \"lednice\",\n    \"ledovka\",\n    \"ledvina\",\n    \"legenda\",\n    \"legie\",\n    \"legrace\",\n    \"lehce\",\n    \"lehkost\",\n    \"lehnout\",\n    \"lektvar\",\n    \"lenochod\",\n    \"lentilka\",\n    \"lepenka\",\n    \"lepidlo\",\n    \"letadlo\",\n    \"letec\",\n    \"letmo\",\n    \"letokruh\",\n    \"levhart\",\n    \"levitace\",\n    \"levobok\",\n    \"libra\",\n    \"lichotka\",\n    \"lidojed\",\n    \"lidskost\",\n    \"lihovina\",\n    \"lijavec\",\n    \"lilek\",\n    \"limetka\",\n    \"linie\",\n    \"linka\",\n    \"linoleum\",\n    \"listopad\",\n    \"litina\",\n    \"litovat\",\n    \"lobista\",\n    \"lodivod\",\n    \"logika\",\n    \"logoped\",\n    \"lokalita\",\n    \"loket\",\n    \"lomcovat\",\n    \"lopata\",\n    \"lopuch\",\n    \"lord\",\n    \"losos\",\n    \"lotr\",\n    \"loudal\",\n    \"louh\",\n    \"louka\",\n    \"louskat\",\n    \"lovec\",\n    \"lstivost\",\n    \"lucerna\",\n    \"lucifer\",\n    \"lump\",\n    \"lusk\",\n    \"lustrace\",\n    \"lvice\",\n    \"lyra\",\n    \"lyrika\",\n    \"lysina\",\n    \"madam\",\n    \"madlo\",\n    \"magistr\",\n    \"mahagon\",\n    \"majetek\",\n    \"majitel\",\n    \"majorita\",\n    \"makak\",\n    \"makovice\",\n    \"makrela\",\n    \"malba\",\n    \"malina\",\n    \"malovat\",\n    \"malvice\",\n    \"maminka\",\n    \"mandle\",\n    \"manko\",\n    \"marnost\",\n    \"masakr\",\n    \"maskot\",\n    \"masopust\",\n    \"matice\",\n    \"matrika\",\n    \"maturita\",\n    \"mazanec\",\n    \"mazivo\",\n    \"mazlit\",\n    \"mazurka\",\n    \"mdloba\",\n    \"mechanik\",\n    \"meditace\",\n    \"medovina\",\n    \"melasa\",\n    \"meloun\",\n    \"mentolka\",\n    \"metla\",\n    \"metoda\",\n    \"metr\",\n    \"mezera\",\n    \"migrace\",\n    \"mihnout\",\n    \"mihule\",\n    \"mikina\",\n    \"mikrofon\",\n    \"milenec\",\n    \"milimetr\",\n    \"milost\",\n    \"mimika\",\n    \"mincovna\",\n    \"minibar\",\n    \"minomet\",\n    \"minulost\",\n    \"miska\",\n    \"mistr\",\n    \"mixovat\",\n    \"mladost\",\n    \"mlha\",\n    \"mlhovina\",\n    \"mlok\",\n    \"mlsat\",\n    \"mluvit\",\n    \"mnich\",\n    \"mnohem\",\n    \"mobil\",\n    \"mocnost\",\n    \"modelka\",\n    \"modlitba\",\n    \"mohyla\",\n    \"mokro\",\n    \"molekula\",\n    \"momentka\",\n    \"monarcha\",\n    \"monokl\",\n    \"monstrum\",\n    \"montovat\",\n    \"monzun\",\n    \"mosaz\",\n    \"moskyt\",\n    \"most\",\n    \"motivace\",\n    \"motorka\",\n    \"motyka\",\n    \"moucha\",\n    \"moudrost\",\n    \"mozaika\",\n    \"mozek\",\n    \"mozol\",\n    \"mramor\",\n    \"mravenec\",\n    \"mrkev\",\n    \"mrtvola\",\n    \"mrzet\",\n    \"mrzutost\",\n    \"mstitel\",\n    \"mudrc\",\n    \"muflon\",\n    \"mulat\",\n    \"mumie\",\n    \"munice\",\n    \"muset\",\n    \"mutace\",\n    \"muzeum\",\n    \"muzikant\",\n    \"myslivec\",\n    \"mzda\",\n    \"nabourat\",\n    \"nachytat\",\n    \"nadace\",\n    \"nadbytek\",\n    \"nadhoz\",\n    \"nadobro\",\n    \"nadpis\",\n    \"nahlas\",\n    \"nahnat\",\n    \"nahodile\",\n    \"nahradit\",\n    \"naivita\",\n    \"najednou\",\n    \"najisto\",\n    \"najmout\",\n    \"naklonit\",\n    \"nakonec\",\n    \"nakrmit\",\n    \"nalevo\",\n    \"namazat\",\n    \"namluvit\",\n    \"nanometr\",\n    \"naoko\",\n    \"naopak\",\n    \"naostro\",\n    \"napadat\",\n    \"napevno\",\n    \"naplnit\",\n    \"napnout\",\n    \"naposled\",\n    \"naprosto\",\n    \"narodit\",\n    \"naruby\",\n    \"narychlo\",\n    \"nasadit\",\n    \"nasekat\",\n    \"naslepo\",\n    \"nastat\",\n    \"natolik\",\n    \"navenek\",\n    \"navrch\",\n    \"navzdory\",\n    \"nazvat\",\n    \"nebe\",\n    \"nechat\",\n    \"necky\",\n    \"nedaleko\",\n    \"nedbat\",\n    \"neduh\",\n    \"negace\",\n    \"nehet\",\n    \"nehoda\",\n    \"nejen\",\n    \"nejprve\",\n    \"neklid\",\n    \"nelibost\",\n    \"nemilost\",\n    \"nemoc\",\n    \"neochota\",\n    \"neonka\",\n    \"nepokoj\",\n    \"nerost\",\n    \"nerv\",\n    \"nesmysl\",\n    \"nesoulad\",\n    \"netvor\",\n    \"neuron\",\n    \"nevina\",\n    \"nezvykle\",\n    \"nicota\",\n    \"nijak\",\n    \"nikam\",\n    \"nikdy\",\n    \"nikl\",\n    \"nikterak\",\n    \"nitro\",\n    \"nocleh\",\n    \"nohavice\",\n    \"nominace\",\n    \"nora\",\n    \"norek\",\n    \"nositel\",\n    \"nosnost\",\n    \"nouze\",\n    \"noviny\",\n    \"novota\",\n    \"nozdra\",\n    \"nuda\",\n    \"nudle\",\n    \"nuget\",\n    \"nutit\",\n    \"nutnost\",\n    \"nutrie\",\n    \"nymfa\",\n    \"obal\",\n    \"obarvit\",\n    \"obava\",\n    \"obdiv\",\n    \"obec\",\n    \"obehnat\",\n    \"obejmout\",\n    \"obezita\",\n    \"obhajoba\",\n    \"obilnice\",\n    \"objasnit\",\n    \"objekt\",\n    \"obklopit\",\n    \"oblast\",\n    \"oblek\",\n    \"obliba\",\n    \"obloha\",\n    \"obluda\",\n    \"obnos\",\n    \"obohatit\",\n    \"obojek\",\n    \"obout\",\n    \"obrazec\",\n    \"obrna\",\n    \"obruba\",\n    \"obrys\",\n    \"obsah\",\n    \"obsluha\",\n    \"obstarat\",\n    \"obuv\",\n    \"obvaz\",\n    \"obvinit\",\n    \"obvod\",\n    \"obvykle\",\n    \"obyvatel\",\n    \"obzor\",\n    \"ocas\",\n    \"ocel\",\n    \"ocenit\",\n    \"ochladit\",\n    \"ochota\",\n    \"ochrana\",\n    \"ocitnout\",\n    \"odboj\",\n    \"odbyt\",\n    \"odchod\",\n    \"odcizit\",\n    \"odebrat\",\n    \"odeslat\",\n    \"odevzdat\",\n    \"odezva\",\n    \"odhadce\",\n    \"odhodit\",\n    \"odjet\",\n    \"odjinud\",\n    \"odkaz\",\n    \"odkoupit\",\n    \"odliv\",\n    \"odluka\",\n    \"odmlka\",\n    \"odolnost\",\n    \"odpad\",\n    \"odpis\",\n    \"odplout\",\n    \"odpor\",\n    \"odpustit\",\n    \"odpykat\",\n    \"odrazka\",\n    \"odsoudit\",\n    \"odstup\",\n    \"odsun\",\n    \"odtok\",\n    \"odtud\",\n    \"odvaha\",\n    \"odveta\",\n    \"odvolat\",\n    \"odvracet\",\n    \"odznak\",\n    \"ofina\",\n    \"ofsajd\",\n    \"ohlas\",\n    \"ohnisko\",\n    \"ohrada\",\n    \"ohrozit\",\n    \"ohryzek\",\n    \"okap\",\n    \"okenice\",\n    \"oklika\",\n    \"okno\",\n    \"okouzlit\",\n    \"okovy\",\n    \"okrasa\",\n    \"okres\",\n    \"okrsek\",\n    \"okruh\",\n    \"okupant\",\n    \"okurka\",\n    \"okusit\",\n    \"olejnina\",\n    \"olizovat\",\n    \"omak\",\n    \"omeleta\",\n    \"omezit\",\n    \"omladina\",\n    \"omlouvat\",\n    \"omluva\",\n    \"omyl\",\n    \"onehdy\",\n    \"opakovat\",\n    \"opasek\",\n    \"operace\",\n    \"opice\",\n    \"opilost\",\n    \"opisovat\",\n    \"opora\",\n    \"opozice\",\n    \"opravdu\",\n    \"oproti\",\n    \"orbital\",\n    \"orchestr\",\n    \"orgie\",\n    \"orlice\",\n    \"orloj\",\n    \"ortel\",\n    \"osada\",\n    \"oschnout\",\n    \"osika\",\n    \"osivo\",\n    \"oslava\",\n    \"oslepit\",\n    \"oslnit\",\n    \"oslovit\",\n    \"osnova\",\n    \"osoba\",\n    \"osolit\",\n    \"ospalec\",\n    \"osten\",\n    \"ostraha\",\n    \"ostuda\",\n    \"ostych\",\n    \"osvojit\",\n    \"oteplit\",\n    \"otisk\",\n    \"otop\",\n    \"otrhat\",\n    \"otrlost\",\n    \"otrok\",\n    \"otruby\",\n    \"otvor\",\n    \"ovanout\",\n    \"ovar\",\n    \"oves\",\n    \"ovlivnit\",\n    \"ovoce\",\n    \"oxid\",\n    \"ozdoba\",\n    \"pachatel\",\n    \"pacient\",\n    \"padouch\",\n    \"pahorek\",\n    \"pakt\",\n    \"palanda\",\n    \"palec\",\n    \"palivo\",\n    \"paluba\",\n    \"pamflet\",\n    \"pamlsek\",\n    \"panenka\",\n    \"panika\",\n    \"panna\",\n    \"panovat\",\n    \"panstvo\",\n    \"pantofle\",\n    \"paprika\",\n    \"parketa\",\n    \"parodie\",\n    \"parta\",\n    \"paruka\",\n    \"paryba\",\n    \"paseka\",\n    \"pasivita\",\n    \"pastelka\",\n    \"patent\",\n    \"patrona\",\n    \"pavouk\",\n    \"pazneht\",\n    \"pazourek\",\n    \"pecka\",\n    \"pedagog\",\n    \"pejsek\",\n    \"peklo\",\n    \"peloton\",\n    \"penalta\",\n    \"pendrek\",\n    \"penze\",\n    \"periskop\",\n    \"pero\",\n    \"pestrost\",\n    \"petarda\",\n    \"petice\",\n    \"petrolej\",\n    \"pevnina\",\n    \"pexeso\",\n    \"pianista\",\n    \"piha\",\n    \"pijavice\",\n    \"pikle\",\n    \"piknik\",\n    \"pilina\",\n    \"pilnost\",\n    \"pilulka\",\n    \"pinzeta\",\n    \"pipeta\",\n    \"pisatel\",\n    \"pistole\",\n    \"pitevna\",\n    \"pivnice\",\n    \"pivovar\",\n    \"placenta\",\n    \"plakat\",\n    \"plamen\",\n    \"planeta\",\n    \"plastika\",\n    \"platit\",\n    \"plavidlo\",\n    \"plaz\",\n    \"plech\",\n    \"plemeno\",\n    \"plenta\",\n    \"ples\",\n    \"pletivo\",\n    \"plevel\",\n    \"plivat\",\n    \"plnit\",\n    \"plno\",\n    \"plocha\",\n    \"plodina\",\n    \"plomba\",\n    \"plout\",\n    \"pluk\",\n    \"plyn\",\n    \"pobavit\",\n    \"pobyt\",\n    \"pochod\",\n    \"pocit\",\n    \"poctivec\",\n    \"podat\",\n    \"podcenit\",\n    \"podepsat\",\n    \"podhled\",\n    \"podivit\",\n    \"podklad\",\n    \"podmanit\",\n    \"podnik\",\n    \"podoba\",\n    \"podpora\",\n    \"podraz\",\n    \"podstata\",\n    \"podvod\",\n    \"podzim\",\n    \"poezie\",\n    \"pohanka\",\n    \"pohnutka\",\n    \"pohovor\",\n    \"pohroma\",\n    \"pohyb\",\n    \"pointa\",\n    \"pojistka\",\n    \"pojmout\",\n    \"pokazit\",\n    \"pokles\",\n    \"pokoj\",\n    \"pokrok\",\n    \"pokuta\",\n    \"pokyn\",\n    \"poledne\",\n    \"polibek\",\n    \"polknout\",\n    \"poloha\",\n    \"polynom\",\n    \"pomalu\",\n    \"pominout\",\n    \"pomlka\",\n    \"pomoc\",\n    \"pomsta\",\n    \"pomyslet\",\n    \"ponechat\",\n    \"ponorka\",\n    \"ponurost\",\n    \"popadat\",\n    \"popel\",\n    \"popisek\",\n    \"poplach\",\n    \"poprosit\",\n    \"popsat\",\n    \"popud\",\n    \"poradce\",\n    \"porce\",\n    \"porod\",\n    \"porucha\",\n    \"poryv\",\n    \"posadit\",\n    \"posed\",\n    \"posila\",\n    \"poskok\",\n    \"poslanec\",\n    \"posoudit\",\n    \"pospolu\",\n    \"postava\",\n    \"posudek\",\n    \"posyp\",\n    \"potah\",\n    \"potkan\",\n    \"potlesk\",\n    \"potomek\",\n    \"potrava\",\n    \"potupa\",\n    \"potvora\",\n    \"poukaz\",\n    \"pouto\",\n    \"pouzdro\",\n    \"povaha\",\n    \"povidla\",\n    \"povlak\",\n    \"povoz\",\n    \"povrch\",\n    \"povstat\",\n    \"povyk\",\n    \"povzdech\",\n    \"pozdrav\",\n    \"pozemek\",\n    \"poznatek\",\n    \"pozor\",\n    \"pozvat\",\n    \"pracovat\",\n    \"prahory\",\n    \"praktika\",\n    \"prales\",\n    \"praotec\",\n    \"praporek\",\n    \"prase\",\n    \"pravda\",\n    \"princip\",\n    \"prkno\",\n    \"probudit\",\n    \"procento\",\n    \"prodej\",\n    \"profese\",\n    \"prohra\",\n    \"projekt\",\n    \"prolomit\",\n    \"promile\",\n    \"pronikat\",\n    \"propad\",\n    \"prorok\",\n    \"prosba\",\n    \"proton\",\n    \"proutek\",\n    \"provaz\",\n    \"prskavka\",\n    \"prsten\",\n    \"prudkost\",\n    \"prut\",\n    \"prvek\",\n    \"prvohory\",\n    \"psanec\",\n    \"psovod\",\n    \"pstruh\",\n    \"ptactvo\",\n    \"puberta\",\n    \"puch\",\n    \"pudl\",\n    \"pukavec\",\n    \"puklina\",\n    \"pukrle\",\n    \"pult\",\n    \"pumpa\",\n    \"punc\",\n    \"pupen\",\n    \"pusa\",\n    \"pusinka\",\n    \"pustina\",\n    \"putovat\",\n    \"putyka\",\n    \"pyramida\",\n    \"pysk\",\n    \"pytel\",\n    \"racek\",\n    \"rachot\",\n    \"radiace\",\n    \"radnice\",\n    \"radon\",\n    \"raft\",\n    \"ragby\",\n    \"raketa\",\n    \"rakovina\",\n    \"rameno\",\n    \"rampouch\",\n    \"rande\",\n    \"rarach\",\n    \"rarita\",\n    \"rasovna\",\n    \"rastr\",\n    \"ratolest\",\n    \"razance\",\n    \"razidlo\",\n    \"reagovat\",\n    \"reakce\",\n    \"recept\",\n    \"redaktor\",\n    \"referent\",\n    \"reflex\",\n    \"rejnok\",\n    \"reklama\",\n    \"rekord\",\n    \"rekrut\",\n    \"rektor\",\n    \"reputace\",\n    \"revize\",\n    \"revma\",\n    \"revolver\",\n    \"rezerva\",\n    \"riskovat\",\n    \"riziko\",\n    \"robotika\",\n    \"rodokmen\",\n    \"rohovka\",\n    \"rokle\",\n    \"rokoko\",\n    \"romaneto\",\n    \"ropovod\",\n    \"ropucha\",\n    \"rorejs\",\n    \"rosol\",\n    \"rostlina\",\n    \"rotmistr\",\n    \"rotoped\",\n    \"rotunda\",\n    \"roubenka\",\n    \"roucho\",\n    \"roup\",\n    \"roura\",\n    \"rovina\",\n    \"rovnice\",\n    \"rozbor\",\n    \"rozchod\",\n    \"rozdat\",\n    \"rozeznat\",\n    \"rozhodce\",\n    \"rozinka\",\n    \"rozjezd\",\n    \"rozkaz\",\n    \"rozloha\",\n    \"rozmar\",\n    \"rozpad\",\n    \"rozruch\",\n    \"rozsah\",\n    \"roztok\",\n    \"rozum\",\n    \"rozvod\",\n    \"rubrika\",\n    \"ruchadlo\",\n    \"rukavice\",\n    \"rukopis\",\n    \"ryba\",\n    \"rybolov\",\n    \"rychlost\",\n    \"rydlo\",\n    \"rypadlo\",\n    \"rytina\",\n    \"ryzost\",\n    \"sadista\",\n    \"sahat\",\n    \"sako\",\n    \"samec\",\n    \"samizdat\",\n    \"samota\",\n    \"sanitka\",\n    \"sardinka\",\n    \"sasanka\",\n    \"satelit\",\n    \"sazba\",\n    \"sazenice\",\n    \"sbor\",\n    \"schovat\",\n    \"sebranka\",\n    \"secese\",\n    \"sedadlo\",\n    \"sediment\",\n    \"sedlo\",\n    \"sehnat\",\n    \"sejmout\",\n    \"sekera\",\n    \"sekta\",\n    \"sekunda\",\n    \"sekvoje\",\n    \"semeno\",\n    \"seno\",\n    \"servis\",\n    \"sesadit\",\n    \"seshora\",\n    \"seskok\",\n    \"seslat\",\n    \"sestra\",\n    \"sesuv\",\n    \"sesypat\",\n    \"setba\",\n    \"setina\",\n    \"setkat\",\n    \"setnout\",\n    \"setrvat\",\n    \"sever\",\n    \"seznam\",\n    \"shoda\",\n    \"shrnout\",\n    \"sifon\",\n    \"silnice\",\n    \"sirka\",\n    \"sirotek\",\n    \"sirup\",\n    \"situace\",\n    \"skafandr\",\n    \"skalisko\",\n    \"skanzen\",\n    \"skaut\",\n    \"skeptik\",\n    \"skica\",\n    \"skladba\",\n    \"sklenice\",\n    \"sklo\",\n    \"skluz\",\n    \"skoba\",\n    \"skokan\",\n    \"skoro\",\n    \"skripta\",\n    \"skrz\",\n    \"skupina\",\n    \"skvost\",\n    \"skvrna\",\n    \"slabika\",\n    \"sladidlo\",\n    \"slanina\",\n    \"slast\",\n    \"slavnost\",\n    \"sledovat\",\n    \"slepec\",\n    \"sleva\",\n    \"slezina\",\n    \"slib\",\n    \"slina\",\n    \"sliznice\",\n    \"slon\",\n    \"sloupek\",\n    \"slovo\",\n    \"sluch\",\n    \"sluha\",\n    \"slunce\",\n    \"slupka\",\n    \"slza\",\n    \"smaragd\",\n    \"smetana\",\n    \"smilstvo\",\n    \"smlouva\",\n    \"smog\",\n    \"smrad\",\n    \"smrk\",\n    \"smrtka\",\n    \"smutek\",\n    \"smysl\",\n    \"snad\",\n    \"snaha\",\n    \"snob\",\n    \"sobota\",\n    \"socha\",\n    \"sodovka\",\n    \"sokol\",\n    \"sopka\",\n    \"sotva\",\n    \"souboj\",\n    \"soucit\",\n    \"soudce\",\n    \"souhlas\",\n    \"soulad\",\n    \"soumrak\",\n    \"souprava\",\n    \"soused\",\n    \"soutok\",\n    \"souviset\",\n    \"spalovna\",\n    \"spasitel\",\n    \"spis\",\n    \"splav\",\n    \"spodek\",\n    \"spojenec\",\n    \"spolu\",\n    \"sponzor\",\n    \"spornost\",\n    \"spousta\",\n    \"sprcha\",\n    \"spustit\",\n    \"sranda\",\n    \"sraz\",\n    \"srdce\",\n    \"srna\",\n    \"srnec\",\n    \"srovnat\",\n    \"srpen\",\n    \"srst\",\n    \"srub\",\n    \"stanice\",\n    \"starosta\",\n    \"statika\",\n    \"stavba\",\n    \"stehno\",\n    \"stezka\",\n    \"stodola\",\n    \"stolek\",\n    \"stopa\",\n    \"storno\",\n    \"stoupat\",\n    \"strach\",\n    \"stres\",\n    \"strhnout\",\n    \"strom\",\n    \"struna\",\n    \"studna\",\n    \"stupnice\",\n    \"stvol\",\n    \"styk\",\n    \"subjekt\",\n    \"subtropy\",\n    \"suchar\",\n    \"sudost\",\n    \"sukno\",\n    \"sundat\",\n    \"sunout\",\n    \"surikata\",\n    \"surovina\",\n    \"svah\",\n    \"svalstvo\",\n    \"svetr\",\n    \"svatba\",\n    \"svazek\",\n    \"svisle\",\n    \"svitek\",\n    \"svoboda\",\n    \"svodidlo\",\n    \"svorka\",\n    \"svrab\",\n    \"sykavka\",\n    \"sykot\",\n    \"synek\",\n    \"synovec\",\n    \"sypat\",\n    \"sypkost\",\n    \"syrovost\",\n    \"sysel\",\n    \"sytost\",\n    \"tabletka\",\n    \"tabule\",\n    \"tahoun\",\n    \"tajemno\",\n    \"tajfun\",\n    \"tajga\",\n    \"tajit\",\n    \"tajnost\",\n    \"taktika\",\n    \"tamhle\",\n    \"tampon\",\n    \"tancovat\",\n    \"tanec\",\n    \"tanker\",\n    \"tapeta\",\n    \"tavenina\",\n    \"tazatel\",\n    \"technika\",\n    \"tehdy\",\n    \"tekutina\",\n    \"telefon\",\n    \"temnota\",\n    \"tendence\",\n    \"tenista\",\n    \"tenor\",\n    \"teplota\",\n    \"tepna\",\n    \"teprve\",\n    \"terapie\",\n    \"termoska\",\n    \"textil\",\n    \"ticho\",\n    \"tiskopis\",\n    \"titulek\",\n    \"tkadlec\",\n    \"tkanina\",\n    \"tlapka\",\n    \"tleskat\",\n    \"tlukot\",\n    \"tlupa\",\n    \"tmel\",\n    \"toaleta\",\n    \"topinka\",\n    \"topol\",\n    \"torzo\",\n    \"touha\",\n    \"toulec\",\n    \"tradice\",\n    \"traktor\",\n    \"tramp\",\n    \"trasa\",\n    \"traverza\",\n    \"trefit\",\n    \"trest\",\n    \"trezor\",\n    \"trhavina\",\n    \"trhlina\",\n    \"trochu\",\n    \"trojice\",\n    \"troska\",\n    \"trouba\",\n    \"trpce\",\n    \"trpitel\",\n    \"trpkost\",\n    \"trubec\",\n    \"truchlit\",\n    \"truhlice\",\n    \"trus\",\n    \"trvat\",\n    \"tudy\",\n    \"tuhnout\",\n    \"tuhost\",\n    \"tundra\",\n    \"turista\",\n    \"turnaj\",\n    \"tuzemsko\",\n    \"tvaroh\",\n    \"tvorba\",\n    \"tvrdost\",\n    \"tvrz\",\n    \"tygr\",\n    \"tykev\",\n    \"ubohost\",\n    \"uboze\",\n    \"ubrat\",\n    \"ubrousek\",\n    \"ubrus\",\n    \"ubytovna\",\n    \"ucho\",\n    \"uctivost\",\n    \"udivit\",\n    \"uhradit\",\n    \"ujednat\",\n    \"ujistit\",\n    \"ujmout\",\n    \"ukazatel\",\n    \"uklidnit\",\n    \"uklonit\",\n    \"ukotvit\",\n    \"ukrojit\",\n    \"ulice\",\n    \"ulita\",\n    \"ulovit\",\n    \"umyvadlo\",\n    \"unavit\",\n    \"uniforma\",\n    \"uniknout\",\n    \"upadnout\",\n    \"uplatnit\",\n    \"uplynout\",\n    \"upoutat\",\n    \"upravit\",\n    \"uran\",\n    \"urazit\",\n    \"usednout\",\n    \"usilovat\",\n    \"usmrtit\",\n    \"usnadnit\",\n    \"usnout\",\n    \"usoudit\",\n    \"ustlat\",\n    \"ustrnout\",\n    \"utahovat\",\n    \"utkat\",\n    \"utlumit\",\n    \"utonout\",\n    \"utopenec\",\n    \"utrousit\",\n    \"uvalit\",\n    \"uvolnit\",\n    \"uvozovka\",\n    \"uzdravit\",\n    \"uzel\",\n    \"uzenina\",\n    \"uzlina\",\n    \"uznat\",\n    \"vagon\",\n    \"valcha\",\n    \"valoun\",\n    \"vana\",\n    \"vandal\",\n    \"vanilka\",\n    \"varan\",\n    \"varhany\",\n    \"varovat\",\n    \"vcelku\",\n    \"vchod\",\n    \"vdova\",\n    \"vedro\",\n    \"vegetace\",\n    \"vejce\",\n    \"velbloud\",\n    \"veletrh\",\n    \"velitel\",\n    \"velmoc\",\n    \"velryba\",\n    \"venkov\",\n    \"veranda\",\n    \"verze\",\n    \"veselka\",\n    \"veskrze\",\n    \"vesnice\",\n    \"vespodu\",\n    \"vesta\",\n    \"veterina\",\n    \"veverka\",\n    \"vibrace\",\n    \"vichr\",\n    \"videohra\",\n    \"vidina\",\n    \"vidle\",\n    \"vila\",\n    \"vinice\",\n    \"viset\",\n    \"vitalita\",\n    \"vize\",\n    \"vizitka\",\n    \"vjezd\",\n    \"vklad\",\n    \"vkus\",\n    \"vlajka\",\n    \"vlak\",\n    \"vlasec\",\n    \"vlevo\",\n    \"vlhkost\",\n    \"vliv\",\n    \"vlnovka\",\n    \"vloupat\",\n    \"vnucovat\",\n    \"vnuk\",\n    \"voda\",\n    \"vodivost\",\n    \"vodoznak\",\n    \"vodstvo\",\n    \"vojensky\",\n    \"vojna\",\n    \"vojsko\",\n    \"volant\",\n    \"volba\",\n    \"volit\",\n    \"volno\",\n    \"voskovka\",\n    \"vozidlo\",\n    \"vozovna\",\n    \"vpravo\",\n    \"vrabec\",\n    \"vracet\",\n    \"vrah\",\n    \"vrata\",\n    \"vrba\",\n    \"vrcholek\",\n    \"vrhat\",\n    \"vrstva\",\n    \"vrtule\",\n    \"vsadit\",\n    \"vstoupit\",\n    \"vstup\",\n    \"vtip\",\n    \"vybavit\",\n    \"vybrat\",\n    \"vychovat\",\n    \"vydat\",\n    \"vydra\",\n    \"vyfotit\",\n    \"vyhledat\",\n    \"vyhnout\",\n    \"vyhodit\",\n    \"vyhradit\",\n    \"vyhubit\",\n    \"vyjasnit\",\n    \"vyjet\",\n    \"vyjmout\",\n    \"vyklopit\",\n    \"vykonat\",\n    \"vylekat\",\n    \"vymazat\",\n    \"vymezit\",\n    \"vymizet\",\n    \"vymyslet\",\n    \"vynechat\",\n    \"vynikat\",\n    \"vynutit\",\n    \"vypadat\",\n    \"vyplatit\",\n    \"vypravit\",\n    \"vypustit\",\n    \"vyrazit\",\n    \"vyrovnat\",\n    \"vyrvat\",\n    \"vyslovit\",\n    \"vysoko\",\n    \"vystavit\",\n    \"vysunout\",\n    \"vysypat\",\n    \"vytasit\",\n    \"vytesat\",\n    \"vytratit\",\n    \"vyvinout\",\n    \"vyvolat\",\n    \"vyvrhel\",\n    \"vyzdobit\",\n    \"vyznat\",\n    \"vzadu\",\n    \"vzbudit\",\n    \"vzchopit\",\n    \"vzdor\",\n    \"vzduch\",\n    \"vzdychat\",\n    \"vzestup\",\n    \"vzhledem\",\n    \"vzkaz\",\n    \"vzlykat\",\n    \"vznik\",\n    \"vzorek\",\n    \"vzpoura\",\n    \"vztah\",\n    \"vztek\",\n    \"xylofon\",\n    \"zabrat\",\n    \"zabydlet\",\n    \"zachovat\",\n    \"zadarmo\",\n    \"zadusit\",\n    \"zafoukat\",\n    \"zahltit\",\n    \"zahodit\",\n    \"zahrada\",\n    \"zahynout\",\n    \"zajatec\",\n    \"zajet\",\n    \"zajistit\",\n    \"zaklepat\",\n    \"zakoupit\",\n    \"zalepit\",\n    \"zamezit\",\n    \"zamotat\",\n    \"zamyslet\",\n    \"zanechat\",\n    \"zanikat\",\n    \"zaplatit\",\n    \"zapojit\",\n    \"zapsat\",\n    \"zarazit\",\n    \"zastavit\",\n    \"zasunout\",\n    \"zatajit\",\n    \"zatemnit\",\n    \"zatknout\",\n    \"zaujmout\",\n    \"zavalit\",\n    \"zavelet\",\n    \"zavinit\",\n    \"zavolat\",\n    \"zavrtat\",\n    \"zazvonit\",\n    \"zbavit\",\n    \"zbrusu\",\n    \"zbudovat\",\n    \"zbytek\",\n    \"zdaleka\",\n    \"zdarma\",\n    \"zdatnost\",\n    \"zdivo\",\n    \"zdobit\",\n    \"zdroj\",\n    \"zdvih\",\n    \"zdymadlo\",\n    \"zelenina\",\n    \"zeman\",\n    \"zemina\",\n    \"zeptat\",\n    \"zezadu\",\n    \"zezdola\",\n    \"zhatit\",\n    \"zhltnout\",\n    \"zhluboka\",\n    \"zhotovit\",\n    \"zhruba\",\n    \"zima\",\n    \"zimnice\",\n    \"zjemnit\",\n    \"zklamat\",\n    \"zkoumat\",\n    \"zkratka\",\n    \"zkumavka\",\n    \"zlato\",\n    \"zlehka\",\n    \"zloba\",\n    \"zlom\",\n    \"zlost\",\n    \"zlozvyk\",\n    \"zmapovat\",\n    \"zmar\",\n    \"zmatek\",\n    \"zmije\",\n    \"zmizet\",\n    \"zmocnit\",\n    \"zmodrat\",\n    \"zmrzlina\",\n    \"zmutovat\",\n    \"znak\",\n    \"znalost\",\n    \"znamenat\",\n    \"znovu\",\n    \"zobrazit\",\n    \"zotavit\",\n    \"zoubek\",\n    \"zoufale\",\n    \"zplodit\",\n    \"zpomalit\",\n    \"zprava\",\n    \"zprostit\",\n    \"zprudka\",\n    \"zprvu\",\n    \"zrada\",\n    \"zranit\",\n    \"zrcadlo\",\n    \"zrnitost\",\n    \"zrno\",\n    \"zrovna\",\n    \"zrychlit\",\n    \"zrzavost\",\n    \"zticha\",\n    \"ztratit\",\n    \"zubovina\",\n    \"zubr\",\n    \"zvednout\",\n    \"zvenku\",\n    \"zvesela\",\n    \"zvon\",\n    \"zvrat\",\n    \"zvukovod\",\n    \"zvyk\"\n]\n[\n    \"abandon\",\n    \"ability\",\n    \"able\",\n    \"about\",\n    \"above\",\n    \"absent\",\n    \"absorb\",\n    \"abstract\",\n    \"absurd\",\n    \"abuse\",\n    \"access\",\n    \"accident\",\n    \"account\",\n    \"accuse\",\n    \"achieve\",\n    \"acid\",\n    \"acoustic\",\n    \"acquire\",\n    \"across\",\n    \"act\",\n    \"action\",\n    \"actor\",\n    \"actress\",\n    \"actual\",\n    \"adapt\",\n    \"add\",\n    \"addict\",\n    \"address\",\n    \"adjust\",\n    \"admit\",\n    \"adult\",\n    \"advance\",\n    \"advice\",\n    \"aerobic\",\n    \"affair\",\n    \"afford\",\n    \"afraid\",\n    \"again\",\n    \"age\",\n    \"agent\",\n    \"agree\",\n    \"ahead\",\n    \"aim\",\n    \"air\",\n    \"airport\",\n    \"aisle\",\n    \"alarm\",\n    \"album\",\n    \"alcohol\",\n    \"alert\",\n    \"alien\",\n    \"all\",\n    \"alley\",\n    \"allow\",\n    \"almost\",\n    \"alone\",\n    \"alpha\",\n    \"already\",\n    \"also\",\n    \"alter\",\n    \"always\",\n    \"amateur\",\n    \"amazing\",\n    \"among\",\n    \"amount\",\n    \"amused\",\n    \"analyst\",\n    \"anchor\",\n    \"ancient\",\n    \"anger\",\n    \"angle\",\n    \"angry\",\n    \"animal\",\n    \"ankle\",\n    \"announce\",\n    \"annual\",\n    \"another\",\n    \"answer\",\n    \"antenna\",\n    \"antique\",\n    \"anxiety\",\n    \"any\",\n    \"apart\",\n    \"apology\",\n    \"appear\",\n    \"apple\",\n    \"approve\",\n    \"april\",\n    \"arch\",\n    \"arctic\",\n    \"area\",\n    \"arena\",\n    \"argue\",\n    \"arm\",\n    \"armed\",\n    \"armor\",\n    \"army\",\n    \"around\",\n    \"arrange\",\n    \"arrest\",\n    \"arrive\",\n    \"arrow\",\n    \"art\",\n    \"artefact\",\n    \"artist\",\n    \"artwork\",\n    \"ask\",\n    \"aspect\",\n    \"assault\",\n    \"asset\",\n    \"assist\",\n    \"assume\",\n    \"asthma\",\n    \"athlete\",\n    \"atom\",\n    \"attack\",\n    \"attend\",\n    \"attitude\",\n    \"attract\",\n    \"auction\",\n    \"audit\",\n    \"august\",\n    \"aunt\",\n    \"author\",\n    \"auto\",\n    \"autumn\",\n    \"average\",\n    \"avocado\",\n    \"avoid\",\n    \"awake\",\n    \"aware\",\n    \"away\",\n    \"awesome\",\n    \"awful\",\n    \"awkward\",\n    \"axis\",\n    \"baby\",\n    \"bachelor\",\n    \"bacon\",\n    \"badge\",\n    \"bag\",\n    \"balance\",\n    \"balcony\",\n    \"ball\",\n    \"bamboo\",\n    \"banana\",\n    \"banner\",\n    \"bar\",\n    \"barely\",\n    \"bargain\",\n    \"barrel\",\n    \"base\",\n    \"basic\",\n    \"basket\",\n    \"battle\",\n    \"beach\",\n    \"bean\",\n    \"beauty\",\n    \"because\",\n    \"become\",\n    \"beef\",\n    \"before\",\n    \"begin\",\n    \"behave\",\n    \"behind\",\n    \"believe\",\n    \"below\",\n    \"belt\",\n    \"bench\",\n    \"benefit\",\n    \"best\",\n    \"betray\",\n    \"better\",\n    \"between\",\n    \"beyond\",\n    \"bicycle\",\n    \"bid\",\n    \"bike\",\n    \"bind\",\n    \"biology\",\n    \"bird\",\n    \"birth\",\n    \"bitter\",\n    \"black\",\n    \"blade\",\n    \"blame\",\n    \"blanket\",\n    \"blast\",\n    \"bleak\",\n    \"bless\",\n    \"blind\",\n    \"blood\",\n    \"blossom\",\n    \"blouse\",\n    \"blue\",\n    \"blur\",\n    \"blush\",\n    \"board\",\n    \"boat\",\n    \"body\",\n    \"boil\",\n    \"bomb\",\n    \"bone\",\n    \"bonus\",\n    \"book\",\n    \"boost\",\n    \"border\",\n    \"boring\",\n    \"borrow\",\n    \"boss\",\n    \"bottom\",\n    \"bounce\",\n    \"box\",\n    \"boy\",\n    \"bracket\",\n    \"brain\",\n    \"brand\",\n    \"brass\",\n    \"brave\",\n    \"bread\",\n    \"breeze\",\n    \"brick\",\n    \"bridge\",\n    \"brief\",\n    \"bright\",\n    \"bring\",\n    \"brisk\",\n    \"broccoli\",\n    \"broken\",\n    \"bronze\",\n    \"broom\",\n    \"brother\",\n    \"brown\",\n    \"brush\",\n    \"bubble\",\n    \"buddy\",\n    \"budget\",\n    \"buffalo\",\n    \"build\",\n    \"bulb\",\n    \"bulk\",\n    \"bullet\",\n    \"bundle\",\n    \"bunker\",\n    \"burden\",\n    \"burger\",\n    \"burst\",\n    \"bus\",\n    \"business\",\n    \"busy\",\n    \"butter\",\n    \"buyer\",\n    \"buzz\",\n    \"cabbage\",\n    \"cabin\",\n    \"cable\",\n    \"cactus\",\n    \"cage\",\n    \"cake\",\n    \"call\",\n    \"calm\",\n    \"camera\",\n    \"camp\",\n    \"can\",\n    \"canal\",\n    \"cancel\",\n    \"candy\",\n    \"cannon\",\n    \"canoe\",\n    \"canvas\",\n    \"canyon\",\n    \"capable\",\n    \"capital\",\n    \"captain\",\n    \"car\",\n    \"carbon\",\n    \"card\",\n    \"cargo\",\n    \"carpet\",\n    \"carry\",\n    \"cart\",\n    \"case\",\n    \"cash\",\n    \"casino\",\n    \"castle\",\n    \"casual\",\n    \"cat\",\n    \"catalog\",\n    \"catch\",\n    \"category\",\n    \"cattle\",\n    \"caught\",\n    \"cause\",\n    \"caution\",\n    \"cave\",\n    \"ceiling\",\n    \"celery\",\n    \"cement\",\n    \"census\",\n    \"century\",\n    \"cereal\",\n    \"certain\",\n    \"chair\",\n    \"chalk\",\n    \"champion\",\n    \"change\",\n    \"chaos\",\n    \"chapter\",\n    \"charge\",\n    \"chase\",\n    \"chat\",\n    \"cheap\",\n    \"check\",\n    \"cheese\",\n    \"chef\",\n    \"cherry\",\n    \"chest\",\n    \"chicken\",\n    \"chief\",\n    \"child\",\n    \"chimney\",\n    \"choice\",\n    \"choose\",\n    \"chronic\",\n    \"chuckle\",\n    \"chunk\",\n    \"churn\",\n    \"cigar\",\n    \"cinnamon\",\n    \"circle\",\n    \"citizen\",\n    \"city\",\n    \"civil\",\n    \"claim\",\n    \"clap\",\n    \"clarify\",\n    \"claw\",\n    \"clay\",\n    \"clean\",\n    \"clerk\",\n    \"clever\",\n    \"click\",\n    \"client\",\n    \"cliff\",\n    \"climb\",\n    \"clinic\",\n    \"clip\",\n    \"clock\",\n    \"clog\",\n    \"close\",\n    \"cloth\",\n    \"cloud\",\n    \"clown\",\n    \"club\",\n    \"clump\",\n    \"cluster\",\n    \"clutch\",\n    \"coach\",\n    \"coast\",\n    \"coconut\",\n    \"code\",\n    \"coffee\",\n    \"coil\",\n    \"coin\",\n    \"collect\",\n    \"color\",\n    \"column\",\n    \"combine\",\n    \"come\",\n    \"comfort\",\n    \"comic\",\n    \"common\",\n    \"company\",\n    \"concert\",\n    \"conduct\",\n    \"confirm\",\n    \"congress\",\n    \"connect\",\n    \"consider\",\n    \"control\",\n    \"convince\",\n    \"cook\",\n    \"cool\",\n    \"copper\",\n    \"copy\",\n    \"coral\",\n    \"core\",\n    \"corn\",\n    \"correct\",\n    \"cost\",\n    \"cotton\",\n    \"couch\",\n    \"country\",\n    \"couple\",\n    \"course\",\n    \"cousin\",\n    \"cover\",\n    \"coyote\",\n    \"crack\",\n    \"cradle\",\n    \"craft\",\n    \"cram\",\n    \"crane\",\n    \"crash\",\n    \"crater\",\n    \"crawl\",\n    \"crazy\",\n    \"cream\",\n    \"credit\",\n    \"creek\",\n    \"crew\",\n    \"cricket\",\n    \"crime\",\n    \"crisp\",\n    \"critic\",\n    \"crop\",\n    \"cross\",\n    \"crouch\",\n    \"crowd\",\n    \"crucial\",\n    \"cruel\",\n    \"cruise\",\n    \"crumble\",\n    \"crunch\",\n    \"crush\",\n    \"cry\",\n    \"crystal\",\n    \"cube\",\n    \"culture\",\n    \"cup\",\n    \"cupboard\",\n    \"curious\",\n    \"current\",\n    \"curtain\",\n    \"curve\",\n    \"cushion\",\n    \"custom\",\n    \"cute\",\n    \"cycle\",\n    \"dad\",\n    \"damage\",\n    \"damp\",\n    \"dance\",\n    \"danger\",\n    \"daring\",\n    \"dash\",\n    \"daughter\",\n    \"dawn\",\n    \"day\",\n    \"deal\",\n    \"debate\",\n    \"debris\",\n    \"decade\",\n    \"december\",\n    \"decide\",\n    \"decline\",\n    \"decorate\",\n    \"decrease\",\n    \"deer\",\n    \"defense\",\n    \"define\",\n    \"defy\",\n    \"degree\",\n    \"delay\",\n    \"deliver\",\n    \"demand\",\n    \"demise\",\n    \"denial\",\n    \"dentist\",\n    \"deny\",\n    \"depart\",\n    \"depend\",\n    \"deposit\",\n    \"depth\",\n    \"deputy\",\n    \"derive\",\n    \"describe\",\n    \"desert\",\n    \"design\",\n    \"desk\",\n    \"despair\",\n    \"destroy\",\n    \"detail\",\n    \"detect\",\n    \"develop\",\n    \"device\",\n    \"devote\",\n    \"diagram\",\n    \"dial\",\n    \"diamond\",\n    \"diary\",\n    \"dice\",\n    \"diesel\",\n    \"diet\",\n    \"differ\",\n    \"digital\",\n    \"dignity\",\n    \"dilemma\",\n    \"dinner\",\n    \"dinosaur\",\n    \"direct\",\n    \"dirt\",\n    \"disagree\",\n    \"discover\",\n    \"disease\",\n    \"dish\",\n    \"dismiss\",\n    \"disorder\",\n    \"display\",\n    \"distance\",\n    \"divert\",\n    \"divide\",\n    \"divorce\",\n    \"dizzy\",\n    \"doctor\",\n    \"document\",\n    \"dog\",\n    \"doll\",\n    \"dolphin\",\n    \"domain\",\n    \"donate\",\n    \"donkey\",\n    \"donor\",\n    \"door\",\n    \"dose\",\n    \"double\",\n    \"dove\",\n    \"draft\",\n    \"dragon\",\n    \"drama\",\n    \"drastic\",\n    \"draw\",\n    \"dream\",\n    \"dress\",\n    \"drift\",\n    \"drill\",\n    \"drink\",\n    \"drip\",\n    \"drive\",\n    \"drop\",\n    \"drum\",\n    \"dry\",\n    \"duck\",\n    \"dumb\",\n    \"dune\",\n    \"during\",\n    \"dust\",\n    \"dutch\",\n    \"duty\",\n    \"dwarf\",\n    \"dynamic\",\n    \"eager\",\n    \"eagle\",\n    \"early\",\n    \"earn\",\n    \"earth\",\n    \"easily\",\n    \"east\",\n    \"easy\",\n    \"echo\",\n    \"ecology\",\n    \"economy\",\n    \"edge\",\n    \"edit\",\n    \"educate\",\n    \"effort\",\n    \"egg\",\n    \"eight\",\n    \"either\",\n    \"elbow\",\n    \"elder\",\n    \"electric\",\n    \"elegant\",\n    \"element\",\n    \"elephant\",\n    \"elevator\",\n    \"elite\",\n    \"else\",\n    \"embark\",\n    \"embody\",\n    \"embrace\",\n    \"emerge\",\n    \"emotion\",\n    \"employ\",\n    \"empower\",\n    \"empty\",\n    \"enable\",\n    \"enact\",\n    \"end\",\n    \"endless\",\n    \"endorse\",\n    \"enemy\",\n    \"energy\",\n    \"enforce\",\n    \"engage\",\n    \"engine\",\n    \"enhance\",\n    \"enjoy\",\n    \"enlist\",\n    \"enough\",\n    \"enrich\",\n    \"enroll\",\n    \"ensure\",\n    \"enter\",\n    \"entire\",\n    \"entry\",\n    \"envelope\",\n    \"episode\",\n    \"equal\",\n    \"equip\",\n    \"era\",\n    \"erase\",\n    \"erode\",\n    \"erosion\",\n    \"error\",\n    \"erupt\",\n    \"escape\",\n    \"essay\",\n    \"essence\",\n    \"estate\",\n    \"eternal\",\n    \"ethics\",\n    \"evidence\",\n    \"evil\",\n    \"evoke\",\n    \"evolve\",\n    \"exact\",\n    \"example\",\n    \"excess\",\n    \"exchange\",\n    \"excite\",\n    \"exclude\",\n    \"excuse\",\n    \"execute\",\n    \"exercise\",\n    \"exhaust\",\n    \"exhibit\",\n    \"exile\",\n    \"exist\",\n    \"exit\",\n    \"exotic\",\n    \"expand\",\n    \"expect\",\n    \"expire\",\n    \"explain\",\n    \"expose\",\n    \"express\",\n    \"extend\",\n    \"extra\",\n    \"eye\",\n    \"eyebrow\",\n    \"fabric\",\n    \"face\",\n    \"faculty\",\n    \"fade\",\n    \"faint\",\n    \"faith\",\n    \"fall\",\n    \"false\",\n    \"fame\",\n    \"family\",\n    \"famous\",\n    \"fan\",\n    \"fancy\",\n    \"fantasy\",\n    \"farm\",\n    \"fashion\",\n    \"fat\",\n    \"fatal\",\n    \"father\",\n    \"fatigue\",\n    \"fault\",\n    \"favorite\",\n    \"feature\",\n    \"february\",\n    \"federal\",\n    \"fee\",\n    \"feed\",\n    \"feel\",\n    \"female\",\n    \"fence\",\n    \"festival\",\n    \"fetch\",\n    \"fever\",\n    \"few\",\n    \"fiber\",\n    \"fiction\",\n    \"field\",\n    \"figure\",\n    \"file\",\n    \"film\",\n    \"filter\",\n    \"final\",\n    \"find\",\n    \"fine\",\n    \"finger\",\n    \"finish\",\n    \"fire\",\n    \"firm\",\n    \"first\",\n    \"fiscal\",\n    \"fish\",\n    \"fit\",\n    \"fitness\",\n    \"fix\",\n    \"flag\",\n    \"flame\",\n    \"flash\",\n    \"flat\",\n    \"flavor\",\n    \"flee\",\n    \"flight\",\n    \"flip\",\n    \"float\",\n    \"flock\",\n    \"floor\",\n    \"flower\",\n    \"fluid\",\n    \"flush\",\n    \"fly\",\n    \"foam\",\n    \"focus\",\n    \"fog\",\n    \"foil\",\n    \"fold\",\n    \"follow\",\n    \"food\",\n    \"foot\",\n    \"force\",\n    \"forest\",\n    \"forget\",\n    \"fork\",\n    \"fortune\",\n    \"forum\",\n    \"forward\",\n    \"fossil\",\n    \"foster\",\n    \"found\",\n    \"fox\",\n    \"fragile\",\n    \"frame\",\n    \"frequent\",\n    \"fresh\",\n    \"friend\",\n    \"fringe\",\n    \"frog\",\n    \"front\",\n    \"frost\",\n    \"frown\",\n    \"frozen\",\n    \"fruit\",\n    \"fuel\",\n    \"fun\",\n    \"funny\",\n    \"furnace\",\n    \"fury\",\n    \"future\",\n    \"gadget\",\n    \"gain\",\n    \"galaxy\",\n    \"gallery\",\n    \"game\",\n    \"gap\",\n    \"garage\",\n    \"garbage\",\n    \"garden\",\n    \"garlic\",\n    \"garment\",\n    \"gas\",\n    \"gasp\",\n    \"gate\",\n    \"gather\",\n    \"gauge\",\n    \"gaze\",\n    \"general\",\n    \"genius\",\n    \"genre\",\n    \"gentle\",\n    \"genuine\",\n    \"gesture\",\n    \"ghost\",\n    \"giant\",\n    \"gift\",\n    \"giggle\",\n    \"ginger\",\n    \"giraffe\",\n    \"girl\",\n    \"give\",\n    \"glad\",\n    \"glance\",\n    \"glare\",\n    \"glass\",\n    \"glide\",\n    \"glimpse\",\n    \"globe\",\n    \"gloom\",\n    \"glory\",\n    \"glove\",\n    \"glow\",\n    \"glue\",\n    \"goat\",\n    \"goddess\",\n    \"gold\",\n    \"good\",\n    \"goose\",\n    \"gorilla\",\n    \"gospel\",\n    \"gossip\",\n    \"govern\",\n    \"gown\",\n    \"grab\",\n    \"grace\",\n    \"grain\",\n    \"grant\",\n    \"grape\",\n    \"grass\",\n    \"gravity\",\n    \"great\",\n    \"green\",\n    \"grid\",\n    \"grief\",\n    \"grit\",\n    \"grocery\",\n    \"group\",\n    \"grow\",\n    \"grunt\",\n    \"guard\",\n    \"guess\",\n    \"guide\",\n    \"guilt\",\n    \"guitar\",\n    \"gun\",\n    \"gym\",\n    \"habit\",\n    \"hair\",\n    \"half\",\n    \"hammer\",\n    \"hamster\",\n    \"hand\",\n    \"happy\",\n    \"harbor\",\n    \"hard\",\n    \"harsh\",\n    \"harvest\",\n    \"hat\",\n    \"have\",\n    \"hawk\",\n    \"hazard\",\n    \"head\",\n    \"health\",\n    \"heart\",\n    \"heavy\",\n    \"hedgehog\",\n    \"height\",\n    \"hello\",\n    \"helmet\",\n    \"help\",\n    \"hen\",\n    \"hero\",\n    \"hidden\",\n    \"high\",\n    \"hill\",\n    \"hint\",\n    \"hip\",\n    \"hire\",\n    \"history\",\n    \"hobby\",\n    \"hockey\",\n    \"hold\",\n    \"hole\",\n    \"holiday\",\n    \"hollow\",\n    \"home\",\n    \"honey\",\n    \"hood\",\n    \"hope\",\n    \"horn\",\n    \"horror\",\n    \"horse\",\n    \"hospital\",\n    \"host\",\n    \"hotel\",\n    \"hour\",\n    \"hover\",\n    \"hub\",\n    \"huge\",\n    \"human\",\n    \"humble\",\n    \"humor\",\n    \"hundred\",\n    \"hungry\",\n    \"hunt\",\n    \"hurdle\",\n    \"hurry\",\n    \"hurt\",\n    \"husband\",\n    \"hybrid\",\n    \"ice\",\n    \"icon\",\n    \"idea\",\n    \"identify\",\n    \"idle\",\n    \"ignore\",\n    \"ill\",\n    \"illegal\",\n    \"illness\",\n    \"image\",\n    \"imitate\",\n    \"immense\",\n    \"immune\",\n    \"impact\",\n    \"impose\",\n    \"improve\",\n    \"impulse\",\n    \"inch\",\n    \"include\",\n    \"income\",\n    \"increase\",\n    \"index\",\n    \"indicate\",\n    \"indoor\",\n    \"industry\",\n    \"infant\",\n    \"inflict\",\n    \"inform\",\n    \"inhale\",\n    \"inherit\",\n    \"initial\",\n    \"inject\",\n    \"injury\",\n    \"inmate\",\n    \"inner\",\n    \"innocent\",\n    \"input\",\n    \"inquiry\",\n    \"insane\",\n    \"insect\",\n    \"inside\",\n    \"inspire\",\n    \"install\",\n    \"intact\",\n    \"interest\",\n    \"into\",\n    \"invest\",\n    \"invite\",\n    \"involve\",\n    \"iron\",\n    \"island\",\n    \"isolate\",\n    \"issue\",\n    \"item\",\n    \"ivory\",\n    \"jacket\",\n    \"jaguar\",\n    \"jar\",\n    \"jazz\",\n    \"jealous\",\n    \"jeans\",\n    \"jelly\",\n    \"jewel\",\n    \"job\",\n    \"join\",\n    \"joke\",\n    \"journey\",\n    \"joy\",\n    \"judge\",\n    \"juice\",\n    \"jump\",\n    \"jungle\",\n    \"junior\",\n    \"junk\",\n    \"just\",\n    \"kangaroo\",\n    \"keen\",\n    \"keep\",\n    \"ketchup\",\n    \"key\",\n    \"kick\",\n    \"kid\",\n    \"kidney\",\n    \"kind\",\n    \"kingdom\",\n    \"kiss\",\n    \"kit\",\n    \"kitchen\",\n    \"kite\",\n    \"kitten\",\n    \"kiwi\",\n    \"knee\",\n    \"knife\",\n    \"knock\",\n    \"know\",\n    \"lab\",\n    \"label\",\n    \"labor\",\n    \"ladder\",\n    \"lady\",\n    \"lake\",\n    \"lamp\",\n    \"language\",\n    \"laptop\",\n    \"large\",\n    \"later\",\n    \"latin\",\n    \"laugh\",\n    \"laundry\",\n    \"lava\",\n    \"law\",\n    \"lawn\",\n    \"lawsuit\",\n    \"layer\",\n    \"lazy\",\n    \"leader\",\n    \"leaf\",\n    \"learn\",\n    \"leave\",\n    \"lecture\",\n    \"left\",\n    \"leg\",\n    \"legal\",\n    \"legend\",\n    \"leisure\",\n    \"lemon\",\n    \"lend\",\n    \"length\",\n    \"lens\",\n    \"leopard\",\n    \"lesson\",\n    \"letter\",\n    \"level\",\n    \"liar\",\n    \"liberty\",\n    \"library\",\n    \"license\",\n    \"life\",\n    \"lift\",\n    \"light\",\n    \"like\",\n    \"limb\",\n    \"limit\",\n    \"link\",\n    \"lion\",\n    \"liquid\",\n    \"list\",\n    \"little\",\n    \"live\",\n    \"lizard\",\n    \"load\",\n    \"loan\",\n    \"lobster\",\n    \"local\",\n    \"lock\",\n    \"logic\",\n    \"lonely\",\n    \"long\",\n    \"loop\",\n    \"lottery\",\n    \"loud\",\n    \"lounge\",\n    \"love\",\n    \"loyal\",\n    \"lucky\",\n    \"luggage\",\n    \"lumber\",\n    \"lunar\",\n    \"lunch\",\n    \"luxury\",\n    \"lyrics\",\n    \"machine\",\n    \"mad\",\n    \"magic\",\n    \"magnet\",\n    \"maid\",\n    \"mail\",\n    \"main\",\n    \"major\",\n    \"make\",\n    \"mammal\",\n    \"man\",\n    \"manage\",\n    \"mandate\",\n    \"mango\",\n    \"mansion\",\n    \"manual\",\n    \"maple\",\n    \"marble\",\n    \"march\",\n    \"margin\",\n    \"marine\",\n    \"market\",\n    \"marriage\",\n    \"mask\",\n    \"mass\",\n    \"master\",\n    \"match\",\n    \"material\",\n    \"math\",\n    \"matrix\",\n    \"matter\",\n    \"maximum\",\n    \"maze\",\n    \"meadow\",\n    \"mean\",\n    \"measure\",\n    \"meat\",\n    \"mechanic\",\n    \"medal\",\n    \"media\",\n    \"melody\",\n    \"melt\",\n    \"member\",\n    \"memory\",\n    \"mention\",\n    \"menu\",\n    \"mercy\",\n    \"merge\",\n    \"merit\",\n    \"merry\",\n    \"mesh\",\n    \"message\",\n    \"metal\",\n    \"method\",\n    \"middle\",\n    \"midnight\",\n    \"milk\",\n    \"million\",\n    \"mimic\",\n    \"mind\",\n    \"minimum\",\n    \"minor\",\n    \"minute\",\n    \"miracle\",\n    \"mirror\",\n    \"misery\",\n    \"miss\",\n    \"mistake\",\n    \"mix\",\n    \"mixed\",\n    \"mixture\",\n    \"mobile\",\n    \"model\",\n    \"modify\",\n    \"mom\",\n    \"moment\",\n    \"monitor\",\n    \"monkey\",\n    \"monster\",\n    \"month\",\n    \"moon\",\n    \"moral\",\n    \"more\",\n    \"morning\",\n    \"mosquito\",\n    \"mother\",\n    \"motion\",\n    \"motor\",\n    \"mountain\",\n    \"mouse\",\n    \"move\",\n    \"movie\",\n    \"much\",\n    \"muffin\",\n    \"mule\",\n    \"multiply\",\n    \"muscle\",\n    \"museum\",\n    \"mushroom\",\n    \"music\",\n    \"must\",\n    \"mutual\",\n    \"myself\",\n    \"mystery\",\n    \"myth\",\n    \"naive\",\n    \"name\",\n    \"napkin\",\n    \"narrow\",\n    \"nasty\",\n    \"nation\",\n    \"nature\",\n    \"near\",\n    \"neck\",\n    \"need\",\n    \"negative\",\n    \"neglect\",\n    \"neither\",\n    \"nephew\",\n    \"nerve\",\n    \"nest\",\n    \"net\",\n    \"network\",\n    \"neutral\",\n    \"never\",\n    \"news\",\n    \"next\",\n    \"nice\",\n    \"night\",\n    \"noble\",\n    \"noise\",\n    \"nominee\",\n    \"noodle\",\n    \"normal\",\n    \"north\",\n    \"nose\",\n    \"notable\",\n    \"note\",\n    \"nothing\",\n    \"notice\",\n    \"novel\",\n    \"now\",\n    \"nuclear\",\n    \"number\",\n    \"nurse\",\n    \"nut\",\n    \"oak\",\n    \"obey\",\n    \"object\",\n    \"oblige\",\n    \"obscure\",\n    \"observe\",\n    \"obtain\",\n    \"obvious\",\n    \"occur\",\n    \"ocean\",\n    \"october\",\n    \"odor\",\n    \"off\",\n    \"offer\",\n    \"office\",\n    \"often\",\n    \"oil\",\n    \"okay\",\n    \"old\",\n    \"olive\",\n    \"olympic\",\n    \"omit\",\n    \"once\",\n    \"one\",\n    \"onion\",\n    \"online\",\n    \"only\",\n    \"open\",\n    \"opera\",\n    \"opinion\",\n    \"oppose\",\n    \"option\",\n    \"orange\",\n    \"orbit\",\n    \"orchard\",\n    \"order\",\n    \"ordinary\",\n    \"organ\",\n    \"orient\",\n    \"original\",\n    \"orphan\",\n    \"ostrich\",\n    \"other\",\n    \"outdoor\",\n    \"outer\",\n    \"output\",\n    \"outside\",\n    \"oval\",\n    \"oven\",\n    \"over\",\n    \"own\",\n    \"owner\",\n    \"oxygen\",\n    \"oyster\",\n    \"ozone\",\n    \"pact\",\n    \"paddle\",\n    \"page\",\n    \"pair\",\n    \"palace\",\n    \"palm\",\n    \"panda\",\n    \"panel\",\n    \"panic\",\n    \"panther\",\n    \"paper\",\n    \"parade\",\n    \"parent\",\n    \"park\",\n    \"parrot\",\n    \"party\",\n    \"pass\",\n    \"patch\",\n    \"path\",\n    \"patient\",\n    \"patrol\",\n    \"pattern\",\n    \"pause\",\n    \"pave\",\n    \"payment\",\n    \"peace\",\n    \"peanut\",\n    \"pear\",\n    \"peasant\",\n    \"pelican\",\n    \"pen\",\n    \"penalty\",\n    \"pencil\",\n    \"people\",\n    \"pepper\",\n    \"perfect\",\n    \"permit\",\n    \"person\",\n    \"pet\",\n    \"phone\",\n    \"photo\",\n    \"phrase\",\n    \"physical\",\n    \"piano\",\n    \"picnic\",\n    \"picture\",\n    \"piece\",\n    \"pig\",\n    \"pigeon\",\n    \"pill\",\n    \"pilot\",\n    \"pink\",\n    \"pioneer\",\n    \"pipe\",\n    \"pistol\",\n    \"pitch\",\n    \"pizza\",\n    \"place\",\n    \"planet\",\n    \"plastic\",\n    \"plate\",\n    \"play\",\n    \"please\",\n    \"pledge\",\n    \"pluck\",\n    \"plug\",\n    \"plunge\",\n    \"poem\",\n    \"poet\",\n    \"point\",\n    \"polar\",\n    \"pole\",\n    \"police\",\n    \"pond\",\n    \"pony\",\n    \"pool\",\n    \"popular\",\n    \"portion\",\n    \"position\",\n    \"possible\",\n    \"post\",\n    \"potato\",\n    \"pottery\",\n    \"poverty\",\n    \"powder\",\n    \"power\",\n    \"practice\",\n    \"praise\",\n    \"predict\",\n    \"prefer\",\n    \"prepare\",\n    \"present\",\n    \"pretty\",\n    \"prevent\",\n    \"price\",\n    \"pride\",\n    \"primary\",\n    \"print\",\n    \"priority\",\n    \"prison\",\n    \"private\",\n    \"prize\",\n    \"problem\",\n    \"process\",\n    \"produce\",\n    \"profit\",\n    \"program\",\n    \"project\",\n    \"promote\",\n    \"proof\",\n    \"property\",\n    \"prosper\",\n    \"protect\",\n    \"proud\",\n    \"provide\",\n    \"public\",\n    \"pudding\",\n    \"pull\",\n    \"pulp\",\n    \"pulse\",\n    \"pumpkin\",\n    \"punch\",\n    \"pupil\",\n    \"puppy\",\n    \"purchase\",\n    \"purity\",\n    \"purpose\",\n    \"purse\",\n    \"push\",\n    \"put\",\n    \"puzzle\",\n    \"pyramid\",\n    \"quality\",\n    \"quantum\",\n    \"quarter\",\n    \"question\",\n    \"quick\",\n    \"quit\",\n    \"quiz\",\n    \"quote\",\n    \"rabbit\",\n    \"raccoon\",\n    \"race\",\n    \"rack\",\n    \"radar\",\n    \"radio\",\n    \"rail\",\n    \"rain\",\n    \"raise\",\n    \"rally\",\n    \"ramp\",\n    \"ranch\",\n    \"random\",\n    \"range\",\n    \"rapid\",\n    \"rare\",\n    \"rate\",\n    \"rather\",\n    \"raven\",\n    \"raw\",\n    \"razor\",\n    \"ready\",\n    \"real\",\n    \"reason\",\n    \"rebel\",\n    \"rebuild\",\n    \"recall\",\n    \"receive\",\n    \"recipe\",\n    \"record\",\n    \"recycle\",\n    \"reduce\",\n    \"reflect\",\n    \"reform\",\n    \"refuse\",\n    \"region\",\n    \"regret\",\n    \"regular\",\n    \"reject\",\n    \"relax\",\n    \"release\",\n    \"relief\",\n    \"rely\",\n    \"remain\",\n    \"remember\",\n    \"remind\",\n    \"remove\",\n    \"render\",\n    \"renew\",\n    \"rent\",\n    \"reopen\",\n    \"repair\",\n    \"repeat\",\n    \"replace\",\n    \"report\",\n    \"require\",\n    \"rescue\",\n    \"resemble\",\n    \"resist\",\n    \"resource\",\n    \"response\",\n    \"result\",\n    \"retire\",\n    \"retreat\",\n    \"return\",\n    \"reunion\",\n    \"reveal\",\n    \"review\",\n    \"reward\",\n    \"rhythm\",\n    \"rib\",\n    \"ribbon\",\n    \"rice\",\n    \"rich\",\n    \"ride\",\n    \"ridge\",\n    \"rifle\",\n    \"right\",\n    \"rigid\",\n    \"ring\",\n    \"riot\",\n    \"ripple\",\n    \"risk\",\n    \"ritual\",\n    \"rival\",\n    \"river\",\n    \"road\",\n    \"roast\",\n    \"robot\",\n    \"robust\",\n    \"rocket\",\n    \"romance\",\n    \"roof\",\n    \"rookie\",\n    \"room\",\n    \"rose\",\n    \"rotate\",\n    \"rough\",\n    \"round\",\n    \"route\",\n    \"royal\",\n    \"rubber\",\n    \"rude\",\n    \"rug\",\n    \"rule\",\n    \"run\",\n    \"runway\",\n    \"rural\",\n    \"sad\",\n    \"saddle\",\n    \"sadness\",\n    \"safe\",\n    \"sail\",\n    \"salad\",\n    \"salmon\",\n    \"salon\",\n    \"salt\",\n    \"salute\",\n    \"same\",\n    \"sample\",\n    \"sand\",\n    \"satisfy\",\n    \"satoshi\",\n    \"sauce\",\n    \"sausage\",\n    \"save\",\n    \"say\",\n    \"scale\",\n    \"scan\",\n    \"scare\",\n    \"scatter\",\n    \"scene\",\n    \"scheme\",\n    \"school\",\n    \"science\",\n    \"scissors\",\n    \"scorpion\",\n    \"scout\",\n    \"scrap\",\n    \"screen\",\n    \"script\",\n    \"scrub\",\n    \"sea\",\n    \"search\",\n    \"season\",\n    \"seat\",\n    \"second\",\n    \"secret\",\n    \"section\",\n    \"security\",\n    \"seed\",\n    \"seek\",\n    \"segment\",\n    \"select\",\n    \"sell\",\n    \"seminar\",\n    \"senior\",\n    \"sense\",\n    \"sentence\",\n    \"series\",\n    \"service\",\n    \"session\",\n    \"settle\",\n    \"setup\",\n    \"seven\",\n    \"shadow\",\n    \"shaft\",\n    \"shallow\",\n    \"share\",\n    \"shed\",\n    \"shell\",\n    \"sheriff\",\n    \"shield\",\n    \"shift\",\n    \"shine\",\n    \"ship\",\n    \"shiver\",\n    \"shock\",\n    \"shoe\",\n    \"shoot\",\n    \"shop\",\n    \"short\",\n    \"shoulder\",\n    \"shove\",\n    \"shrimp\",\n    \"shrug\",\n    \"shuffle\",\n    \"shy\",\n    \"sibling\",\n    \"sick\",\n    \"side\",\n    \"siege\",\n    \"sight\",\n    \"sign\",\n    \"silent\",\n    \"silk\",\n    \"silly\",\n    \"silver\",\n    \"similar\",\n    \"simple\",\n    \"since\",\n    \"sing\",\n    \"siren\",\n    \"sister\",\n    \"situate\",\n    \"six\",\n    \"size\",\n    \"skate\",\n    \"sketch\",\n    \"ski\",\n    \"skill\",\n    \"skin\",\n    \"skirt\",\n    \"skull\",\n    \"slab\",\n    \"slam\",\n    \"sleep\",\n    \"slender\",\n    \"slice\",\n    \"slide\",\n    \"slight\",\n    \"slim\",\n    \"slogan\",\n    \"slot\",\n    \"slow\",\n    \"slush\",\n    \"small\",\n    \"smart\",\n    \"smile\",\n    \"smoke\",\n    \"smooth\",\n    \"snack\",\n    \"snake\",\n    \"snap\",\n    \"sniff\",\n    \"snow\",\n    \"soap\",\n    \"soccer\",\n    \"social\",\n    \"sock\",\n    \"soda\",\n    \"soft\",\n    \"solar\",\n    \"soldier\",\n    \"solid\",\n    \"solution\",\n    \"solve\",\n    \"someone\",\n    \"song\",\n    \"soon\",\n    \"sorry\",\n    \"sort\",\n    \"soul\",\n    \"sound\",\n    \"soup\",\n    \"source\",\n    \"south\",\n    \"space\",\n    \"spare\",\n    \"spatial\",\n    \"spawn\",\n    \"speak\",\n    \"special\",\n    \"speed\",\n    \"spell\",\n    \"spend\",\n    \"sphere\",\n    \"spice\",\n    \"spider\",\n    \"spike\",\n    \"spin\",\n    \"spirit\",\n    \"split\",\n    \"spoil\",\n    \"sponsor\",\n    \"spoon\",\n    \"sport\",\n    \"spot\",\n    \"spray\",\n    \"spread\",\n    \"spring\",\n    \"spy\",\n    \"square\",\n    \"squeeze\",\n    \"squirrel\",\n    \"stable\",\n    \"stadium\",\n    \"staff\",\n    \"stage\",\n    \"stairs\",\n    \"stamp\",\n    \"stand\",\n    \"start\",\n    \"state\",\n    \"stay\",\n    \"steak\",\n    \"steel\",\n    \"stem\",\n    \"step\",\n    \"stereo\",\n    \"stick\",\n    \"still\",\n    \"sting\",\n    \"stock\",\n    \"stomach\",\n    \"stone\",\n    \"stool\",\n    \"story\",\n    \"stove\",\n    \"strategy\",\n    \"street\",\n    \"strike\",\n    \"strong\",\n    \"struggle\",\n    \"student\",\n    \"stuff\",\n    \"stumble\",\n    \"style\",\n    \"subject\",\n    \"submit\",\n    \"subway\",\n    \"success\",\n    \"such\",\n    \"sudden\",\n    \"suffer\",\n    \"sugar\",\n    \"suggest\",\n    \"suit\",\n    \"summer\",\n    \"sun\",\n    \"sunny\",\n    \"sunset\",\n    \"super\",\n    \"supply\",\n    \"supreme\",\n    \"sure\",\n    \"surface\",\n    \"surge\",\n    \"surprise\",\n    \"surround\",\n    \"survey\",\n    \"suspect\",\n    \"sustain\",\n    \"swallow\",\n    \"swamp\",\n    \"swap\",\n    \"swarm\",\n    \"swear\",\n    \"sweet\",\n    \"swift\",\n    \"swim\",\n    \"swing\",\n    \"switch\",\n    \"sword\",\n    \"symbol\",\n    \"symptom\",\n    \"syrup\",\n    \"system\",\n    \"table\",\n    \"tackle\",\n    \"tag\",\n    \"tail\",\n    \"talent\",\n    \"talk\",\n    \"tank\",\n    \"tape\",\n    \"target\",\n    \"task\",\n    \"taste\",\n    \"tattoo\",\n    \"taxi\",\n    \"teach\",\n    \"team\",\n    \"tell\",\n    \"ten\",\n    \"tenant\",\n    \"tennis\",\n    \"tent\",\n    \"term\",\n    \"test\",\n    \"text\",\n    \"thank\",\n    \"that\",\n    \"theme\",\n    \"then\",\n    \"theory\",\n    \"there\",\n    \"they\",\n    \"thing\",\n    \"this\",\n    \"thought\",\n    \"three\",\n    \"thrive\",\n    \"throw\",\n    \"thumb\",\n    \"thunder\",\n    \"ticket\",\n    \"tide\",\n    \"tiger\",\n    \"tilt\",\n    \"timber\",\n    \"time\",\n    \"tiny\",\n    \"tip\",\n    \"tired\",\n    \"tissue\",\n    \"title\",\n    \"toast\",\n    \"tobacco\",\n    \"today\",\n    \"toddler\",\n    \"toe\",\n    \"together\",\n    \"toilet\",\n    \"token\",\n    \"tomato\",\n    \"tomorrow\",\n    \"tone\",\n    \"tongue\",\n    \"tonight\",\n    \"tool\",\n    \"tooth\",\n    \"top\",\n    \"topic\",\n    \"topple\",\n    \"torch\",\n    \"tornado\",\n    \"tortoise\",\n    \"toss\",\n    \"total\",\n    \"tourist\",\n    \"toward\",\n    \"tower\",\n    \"town\",\n    \"toy\",\n    \"track\",\n    \"trade\",\n    \"traffic\",\n    \"tragic\",\n    \"train\",\n    \"transfer\",\n    \"trap\",\n    \"trash\",\n    \"travel\",\n    \"tray\",\n    \"treat\",\n    \"tree\",\n    \"trend\",\n    \"trial\",\n    \"tribe\",\n    \"trick\",\n    \"trigger\",\n    \"trim\",\n    \"trip\",\n    \"trophy\",\n    \"trouble\",\n    \"truck\",\n    \"true\",\n    \"truly\",\n    \"trumpet\",\n    \"trust\",\n    \"truth\",\n    \"try\",\n    \"tube\",\n    \"tuition\",\n    \"tumble\",\n    \"tuna\",\n    \"tunnel\",\n    \"turkey\",\n    \"turn\",\n    \"turtle\",\n    \"twelve\",\n    \"twenty\",\n    \"twice\",\n    \"twin\",\n    \"twist\",\n    \"two\",\n    \"type\",\n    \"typical\",\n    \"ugly\",\n    \"umbrella\",\n    \"unable\",\n    \"unaware\",\n    \"uncle\",\n    \"uncover\",\n    \"under\",\n    \"undo\",\n    \"unfair\",\n    \"unfold\",\n    \"unhappy\",\n    \"uniform\",\n    \"unique\",\n    \"unit\",\n    \"universe\",\n    \"unknown\",\n    \"unlock\",\n    \"until\",\n    \"unusual\",\n    \"unveil\",\n    \"update\",\n    \"upgrade\",\n    \"uphold\",\n    \"upon\",\n    \"upper\",\n    \"upset\",\n    \"urban\",\n    \"urge\",\n    \"usage\",\n    \"use\",\n    \"used\",\n    \"useful\",\n    \"useless\",\n    \"usual\",\n    \"utility\",\n    \"vacant\",\n    \"vacuum\",\n    \"vague\",\n    \"valid\",\n    \"valley\",\n    \"valve\",\n    \"van\",\n    \"vanish\",\n    \"vapor\",\n    \"various\",\n    \"vast\",\n    \"vault\",\n    \"vehicle\",\n    \"velvet\",\n    \"vendor\",\n    \"venture\",\n    \"venue\",\n    \"verb\",\n    \"verify\",\n    \"version\",\n    \"very\",\n    \"vessel\",\n    \"veteran\",\n    \"viable\",\n    \"vibrant\",\n    \"vicious\",\n    \"victory\",\n    \"video\",\n    \"view\",\n    \"village\",\n    \"vintage\",\n    \"violin\",\n    \"virtual\",\n    \"virus\",\n    \"visa\",\n    \"visit\",\n    \"visual\",\n    \"vital\",\n    \"vivid\",\n    \"vocal\",\n    \"voice\",\n    \"void\",\n    \"volcano\",\n    \"volume\",\n    \"vote\",\n    \"voyage\",\n    \"wage\",\n    \"wagon\",\n    \"wait\",\n    \"walk\",\n    \"wall\",\n    \"walnut\",\n    \"want\",\n    \"warfare\",\n    \"warm\",\n    \"warrior\",\n    \"wash\",\n    \"wasp\",\n    \"waste\",\n    \"water\",\n    \"wave\",\n    \"way\",\n    \"wealth\",\n    \"weapon\",\n    \"wear\",\n    \"weasel\",\n    \"weather\",\n    \"web\",\n    \"wedding\",\n    \"weekend\",\n    \"weird\",\n    \"welcome\",\n    \"west\",\n    \"wet\",\n    \"whale\",\n    \"what\",\n    \"wheat\",\n    \"wheel\",\n    \"when\",\n    \"where\",\n    \"whip\",\n    \"whisper\",\n    \"wide\",\n    \"width\",\n    \"wife\",\n    \"wild\",\n    \"will\",\n    \"win\",\n    \"window\",\n    \"wine\",\n    \"wing\",\n    \"wink\",\n    \"winner\",\n    \"winter\",\n    \"wire\",\n    \"wisdom\",\n    \"wise\",\n    \"wish\",\n    \"witness\",\n    \"wolf\",\n    \"woman\",\n    \"wonder\",\n    \"wood\",\n    \"wool\",\n    \"word\",\n    \"work\",\n    \"world\",\n    \"worry\",\n    \"worth\",\n    \"wrap\",\n    \"wreck\",\n    \"wrestle\",\n    \"wrist\",\n    \"write\",\n    \"wrong\",\n    \"yard\",\n    \"year\",\n    \"yellow\",\n    \"you\",\n    \"young\",\n    \"youth\",\n    \"zebra\",\n    \"zero\",\n    \"zone\",\n    \"zoo\"\n]\n[\n    \"abaisser\",\n    \"abandon\",\n    \"abdiquer\",\n    \"abeille\",\n    \"abolir\",\n    \"aborder\",\n    \"aboutir\",\n    \"aboyer\",\n    \"abrasif\",\n    \"abreuver\",\n    \"abriter\",\n    \"abroger\",\n    \"abrupt\",\n    \"absence\",\n    \"absolu\",\n    \"absurde\",\n    \"abusif\",\n    \"abyssal\",\n    \"académie\",\n    \"acajou\",\n    \"acarien\",\n    \"accabler\",\n    \"accepter\",\n    \"acclamer\",\n    \"accolade\",\n    \"accroche\",\n    \"accuser\",\n    \"acerbe\",\n    \"achat\",\n    \"acheter\",\n    \"aciduler\",\n    \"acier\",\n    \"acompte\",\n    \"acquérir\",\n    \"acronyme\",\n    \"acteur\",\n    \"actif\",\n    \"actuel\",\n    \"adepte\",\n    \"adéquat\",\n    \"adhésif\",\n    \"adjectif\",\n    \"adjuger\",\n    \"admettre\",\n    \"admirer\",\n    \"adopter\",\n    \"adorer\",\n    \"adoucir\",\n    \"adresse\",\n    \"adroit\",\n    \"adulte\",\n    \"adverbe\",\n    \"aérer\",\n    \"aéronef\",\n    \"affaire\",\n    \"affecter\",\n    \"affiche\",\n    \"affreux\",\n    \"affubler\",\n    \"agacer\",\n    \"agencer\",\n    \"agile\",\n    \"agiter\",\n    \"agrafer\",\n    \"agréable\",\n    \"agrume\",\n    \"aider\",\n    \"aiguille\",\n    \"ailier\",\n    \"aimable\",\n    \"aisance\",\n    \"ajouter\",\n    \"ajuster\",\n    \"alarmer\",\n    \"alchimie\",\n    \"alerte\",\n    \"algèbre\",\n    \"algue\",\n    \"aliéner\",\n    \"aliment\",\n    \"alléger\",\n    \"alliage\",\n    \"allouer\",\n    \"allumer\",\n    \"alourdir\",\n    \"alpaga\",\n    \"altesse\",\n    \"alvéole\",\n    \"amateur\",\n    \"ambigu\",\n    \"ambre\",\n    \"aménager\",\n    \"amertume\",\n    \"amidon\",\n    \"amiral\",\n    \"amorcer\",\n    \"amour\",\n    \"amovible\",\n    \"amphibie\",\n    \"ampleur\",\n    \"amusant\",\n    \"analyse\",\n    \"anaphore\",\n    \"anarchie\",\n    \"anatomie\",\n    \"ancien\",\n    \"anéantir\",\n    \"angle\",\n    \"angoisse\",\n    \"anguleux\",\n    \"animal\",\n    \"annexer\",\n    \"annonce\",\n    \"annuel\",\n    \"anodin\",\n    \"anomalie\",\n    \"anonyme\",\n    \"anormal\",\n    \"antenne\",\n    \"antidote\",\n    \"anxieux\",\n    \"apaiser\",\n    \"apéritif\",\n    \"aplanir\",\n    \"apologie\",\n    \"appareil\",\n    \"appeler\",\n    \"apporter\",\n    \"appuyer\",\n    \"aquarium\",\n    \"aqueduc\",\n    \"arbitre\",\n    \"arbuste\",\n    \"ardeur\",\n    \"ardoise\",\n    \"argent\",\n    \"arlequin\",\n    \"armature\",\n    \"armement\",\n    \"armoire\",\n    \"armure\",\n    \"arpenter\",\n    \"arracher\",\n    \"arriver\",\n    \"arroser\",\n    \"arsenic\",\n    \"artériel\",\n    \"article\",\n    \"aspect\",\n    \"asphalte\",\n    \"aspirer\",\n    \"assaut\",\n    \"asservir\",\n    \"assiette\",\n    \"associer\",\n    \"assurer\",\n    \"asticot\",\n    \"astre\",\n    \"astuce\",\n    \"atelier\",\n    \"atome\",\n    \"atrium\",\n    \"atroce\",\n    \"attaque\",\n    \"attentif\",\n    \"attirer\",\n    \"attraper\",\n    \"aubaine\",\n    \"auberge\",\n    \"audace\",\n    \"audible\",\n    \"augurer\",\n    \"aurore\",\n    \"automne\",\n    \"autruche\",\n    \"avaler\",\n    \"avancer\",\n    \"avarice\",\n    \"avenir\",\n    \"averse\",\n    \"aveugle\",\n    \"aviateur\",\n    \"avide\",\n    \"avion\",\n    \"aviser\",\n    \"avoine\",\n    \"avouer\",\n    \"avril\",\n    \"axial\",\n    \"axiome\",\n    \"badge\",\n    \"bafouer\",\n    \"bagage\",\n    \"baguette\",\n    \"baignade\",\n    \"balancer\",\n    \"balcon\",\n    \"baleine\",\n    \"balisage\",\n    \"bambin\",\n    \"bancaire\",\n    \"bandage\",\n    \"banlieue\",\n    \"bannière\",\n    \"banquier\",\n    \"barbier\",\n    \"baril\",\n    \"baron\",\n    \"barque\",\n    \"barrage\",\n    \"bassin\",\n    \"bastion\",\n    \"bataille\",\n    \"bateau\",\n    \"batterie\",\n    \"baudrier\",\n    \"bavarder\",\n    \"belette\",\n    \"bélier\",\n    \"belote\",\n    \"bénéfice\",\n    \"berceau\",\n    \"berger\",\n    \"berline\",\n    \"bermuda\",\n    \"besace\",\n    \"besogne\",\n    \"bétail\",\n    \"beurre\",\n    \"biberon\",\n    \"bicycle\",\n    \"bidule\",\n    \"bijou\",\n    \"bilan\",\n    \"bilingue\",\n    \"billard\",\n    \"binaire\",\n    \"biologie\",\n    \"biopsie\",\n    \"biotype\",\n    \"biscuit\",\n    \"bison\",\n    \"bistouri\",\n    \"bitume\",\n    \"bizarre\",\n    \"blafard\",\n    \"blague\",\n    \"blanchir\",\n    \"blessant\",\n    \"blinder\",\n    \"blond\",\n    \"bloquer\",\n    \"blouson\",\n    \"bobard\",\n    \"bobine\",\n    \"boire\",\n    \"boiser\",\n    \"bolide\",\n    \"bonbon\",\n    \"bondir\",\n    \"bonheur\",\n    \"bonifier\",\n    \"bonus\",\n    \"bordure\",\n    \"borne\",\n    \"botte\",\n    \"boucle\",\n    \"boueux\",\n    \"bougie\",\n    \"boulon\",\n    \"bouquin\",\n    \"bourse\",\n    \"boussole\",\n    \"boutique\",\n    \"boxeur\",\n    \"branche\",\n    \"brasier\",\n    \"brave\",\n    \"brebis\",\n    \"brèche\",\n    \"breuvage\",\n    \"bricoler\",\n    \"brigade\",\n    \"brillant\",\n    \"brioche\",\n    \"brique\",\n    \"brochure\",\n    \"broder\",\n    \"bronzer\",\n    \"brousse\",\n    \"broyeur\",\n    \"brume\",\n    \"brusque\",\n    \"brutal\",\n    \"bruyant\",\n    \"buffle\",\n    \"buisson\",\n    \"bulletin\",\n    \"bureau\",\n    \"burin\",\n    \"bustier\",\n    \"butiner\",\n    \"butoir\",\n    \"buvable\",\n    \"buvette\",\n    \"cabanon\",\n    \"cabine\",\n    \"cachette\",\n    \"cadeau\",\n    \"cadre\",\n    \"caféine\",\n    \"caillou\",\n    \"caisson\",\n    \"calculer\",\n    \"calepin\",\n    \"calibre\",\n    \"calmer\",\n    \"calomnie\",\n    \"calvaire\",\n    \"camarade\",\n    \"caméra\",\n    \"camion\",\n    \"campagne\",\n    \"canal\",\n    \"caneton\",\n    \"canon\",\n    \"cantine\",\n    \"canular\",\n    \"capable\",\n    \"caporal\",\n    \"caprice\",\n    \"capsule\",\n    \"capter\",\n    \"capuche\",\n    \"carabine\",\n    \"carbone\",\n    \"caresser\",\n    \"caribou\",\n    \"carnage\",\n    \"carotte\",\n    \"carreau\",\n    \"carton\",\n    \"cascade\",\n    \"casier\",\n    \"casque\",\n    \"cassure\",\n    \"causer\",\n    \"caution\",\n    \"cavalier\",\n    \"caverne\",\n    \"caviar\",\n    \"cédille\",\n    \"ceinture\",\n    \"céleste\",\n    \"cellule\",\n    \"cendrier\",\n    \"censurer\",\n    \"central\",\n    \"cercle\",\n    \"cérébral\",\n    \"cerise\",\n    \"cerner\",\n    \"cerveau\",\n    \"cesser\",\n    \"chagrin\",\n    \"chaise\",\n    \"chaleur\",\n    \"chambre\",\n    \"chance\",\n    \"chapitre\",\n    \"charbon\",\n    \"chasseur\",\n    \"chaton\",\n    \"chausson\",\n    \"chavirer\",\n    \"chemise\",\n    \"chenille\",\n    \"chéquier\",\n    \"chercher\",\n    \"cheval\",\n    \"chien\",\n    \"chiffre\",\n    \"chignon\",\n    \"chimère\",\n    \"chiot\",\n    \"chlorure\",\n    \"chocolat\",\n    \"choisir\",\n    \"chose\",\n    \"chouette\",\n    \"chrome\",\n    \"chute\",\n    \"cigare\",\n    \"cigogne\",\n    \"cimenter\",\n    \"cinéma\",\n    \"cintrer\",\n    \"circuler\",\n    \"cirer\",\n    \"cirque\",\n    \"citerne\",\n    \"citoyen\",\n    \"citron\",\n    \"civil\",\n    \"clairon\",\n    \"clameur\",\n    \"claquer\",\n    \"classe\",\n    \"clavier\",\n    \"client\",\n    \"cligner\",\n    \"climat\",\n    \"clivage\",\n    \"cloche\",\n    \"clonage\",\n    \"cloporte\",\n    \"cobalt\",\n    \"cobra\",\n    \"cocasse\",\n    \"cocotier\",\n    \"coder\",\n    \"codifier\",\n    \"coffre\",\n    \"cogner\",\n    \"cohésion\",\n    \"coiffer\",\n    \"coincer\",\n    \"colère\",\n    \"colibri\",\n    \"colline\",\n    \"colmater\",\n    \"colonel\",\n    \"combat\",\n    \"comédie\",\n    \"commande\",\n    \"compact\",\n    \"concert\",\n    \"conduire\",\n    \"confier\",\n    \"congeler\",\n    \"connoter\",\n    \"consonne\",\n    \"contact\",\n    \"convexe\",\n    \"copain\",\n    \"copie\",\n    \"corail\",\n    \"corbeau\",\n    \"cordage\",\n    \"corniche\",\n    \"corpus\",\n    \"correct\",\n    \"cortège\",\n    \"cosmique\",\n    \"costume\",\n    \"coton\",\n    \"coude\",\n    \"coupure\",\n    \"courage\",\n    \"couteau\",\n    \"couvrir\",\n    \"coyote\",\n    \"crabe\",\n    \"crainte\",\n    \"cravate\",\n    \"crayon\",\n    \"créature\",\n    \"créditer\",\n    \"crémeux\",\n    \"creuser\",\n    \"crevette\",\n    \"cribler\",\n    \"crier\",\n    \"cristal\",\n    \"critère\",\n    \"croire\",\n    \"croquer\",\n    \"crotale\",\n    \"crucial\",\n    \"cruel\",\n    \"crypter\",\n    \"cubique\",\n    \"cueillir\",\n    \"cuillère\",\n    \"cuisine\",\n    \"cuivre\",\n    \"culminer\",\n    \"cultiver\",\n    \"cumuler\",\n    \"cupide\",\n    \"curatif\",\n    \"curseur\",\n    \"cyanure\",\n    \"cycle\",\n    \"cylindre\",\n    \"cynique\",\n    \"daigner\",\n    \"damier\",\n    \"danger\",\n    \"danseur\",\n    \"dauphin\",\n    \"débattre\",\n    \"débiter\",\n    \"déborder\",\n    \"débrider\",\n    \"débutant\",\n    \"décaler\",\n    \"décembre\",\n    \"déchirer\",\n    \"décider\",\n    \"déclarer\",\n    \"décorer\",\n    \"décrire\",\n    \"décupler\",\n    \"dédale\",\n    \"déductif\",\n    \"déesse\",\n    \"défensif\",\n    \"défiler\",\n    \"défrayer\",\n    \"dégager\",\n    \"dégivrer\",\n    \"déglutir\",\n    \"dégrafer\",\n    \"déjeuner\",\n    \"délice\",\n    \"déloger\",\n    \"demander\",\n    \"demeurer\",\n    \"démolir\",\n    \"dénicher\",\n    \"dénouer\",\n    \"dentelle\",\n    \"dénuder\",\n    \"départ\",\n    \"dépenser\",\n    \"déphaser\",\n    \"déplacer\",\n    \"déposer\",\n    \"déranger\",\n    \"dérober\",\n    \"désastre\",\n    \"descente\",\n    \"désert\",\n    \"désigner\",\n    \"désobéir\",\n    \"dessiner\",\n    \"destrier\",\n    \"détacher\",\n    \"détester\",\n    \"détourer\",\n    \"détresse\",\n    \"devancer\",\n    \"devenir\",\n    \"deviner\",\n    \"devoir\",\n    \"diable\",\n    \"dialogue\",\n    \"diamant\",\n    \"dicter\",\n    \"différer\",\n    \"digérer\",\n    \"digital\",\n    \"digne\",\n    \"diluer\",\n    \"dimanche\",\n    \"diminuer\",\n    \"dioxyde\",\n    \"directif\",\n    \"diriger\",\n    \"discuter\",\n    \"disposer\",\n    \"dissiper\",\n    \"distance\",\n    \"divertir\",\n    \"diviser\",\n    \"docile\",\n    \"docteur\",\n    \"dogme\",\n    \"doigt\",\n    \"domaine\",\n    \"domicile\",\n    \"dompter\",\n    \"donateur\",\n    \"donjon\",\n    \"donner\",\n    \"dopamine\",\n    \"dortoir\",\n    \"dorure\",\n    \"dosage\",\n    \"doseur\",\n    \"dossier\",\n    \"dotation\",\n    \"douanier\",\n    \"double\",\n    \"douceur\",\n    \"douter\",\n    \"doyen\",\n    \"dragon\",\n    \"draper\",\n    \"dresser\",\n    \"dribbler\",\n    \"droiture\",\n    \"duperie\",\n    \"duplexe\",\n    \"durable\",\n    \"durcir\",\n    \"dynastie\",\n    \"éblouir\",\n    \"écarter\",\n    \"écharpe\",\n    \"échelle\",\n    \"éclairer\",\n    \"éclipse\",\n    \"éclore\",\n    \"écluse\",\n    \"école\",\n    \"économie\",\n    \"écorce\",\n    \"écouter\",\n    \"écraser\",\n    \"écrémer\",\n    \"écrivain\",\n    \"écrou\",\n    \"écume\",\n    \"écureuil\",\n    \"édifier\",\n    \"éduquer\",\n    \"effacer\",\n    \"effectif\",\n    \"effigie\",\n    \"effort\",\n    \"effrayer\",\n    \"effusion\",\n    \"égaliser\",\n    \"égarer\",\n    \"éjecter\",\n    \"élaborer\",\n    \"élargir\",\n    \"électron\",\n    \"élégant\",\n    \"éléphant\",\n    \"élève\",\n    \"éligible\",\n    \"élitisme\",\n    \"éloge\",\n    \"élucider\",\n    \"éluder\",\n    \"emballer\",\n    \"embellir\",\n    \"embryon\",\n    \"émeraude\",\n    \"émission\",\n    \"emmener\",\n    \"émotion\",\n    \"émouvoir\",\n    \"empereur\",\n    \"employer\",\n    \"emporter\",\n    \"emprise\",\n    \"émulsion\",\n    \"encadrer\",\n    \"enchère\",\n    \"enclave\",\n    \"encoche\",\n    \"endiguer\",\n    \"endosser\",\n    \"endroit\",\n    \"enduire\",\n    \"énergie\",\n    \"enfance\",\n    \"enfermer\",\n    \"enfouir\",\n    \"engager\",\n    \"engin\",\n    \"englober\",\n    \"énigme\",\n    \"enjamber\",\n    \"enjeu\",\n    \"enlever\",\n    \"ennemi\",\n    \"ennuyeux\",\n    \"enrichir\",\n    \"enrobage\",\n    \"enseigne\",\n    \"entasser\",\n    \"entendre\",\n    \"entier\",\n    \"entourer\",\n    \"entraver\",\n    \"énumérer\",\n    \"envahir\",\n    \"enviable\",\n    \"envoyer\",\n    \"enzyme\",\n    \"éolien\",\n    \"épaissir\",\n    \"épargne\",\n    \"épatant\",\n    \"épaule\",\n    \"épicerie\",\n    \"épidémie\",\n    \"épier\",\n    \"épilogue\",\n    \"épine\",\n    \"épisode\",\n    \"épitaphe\",\n    \"époque\",\n    \"épreuve\",\n    \"éprouver\",\n    \"épuisant\",\n    \"équerre\",\n    \"équipe\",\n    \"ériger\",\n    \"érosion\",\n    \"erreur\",\n    \"éruption\",\n    \"escalier\",\n    \"espadon\",\n    \"espèce\",\n    \"espiègle\",\n    \"espoir\",\n    \"esprit\",\n    \"esquiver\",\n    \"essayer\",\n    \"essence\",\n    \"essieu\",\n    \"essorer\",\n    \"estime\",\n    \"estomac\",\n    \"estrade\",\n    \"étagère\",\n    \"étaler\",\n    \"étanche\",\n    \"étatique\",\n    \"éteindre\",\n    \"étendoir\",\n    \"éternel\",\n    \"éthanol\",\n    \"éthique\",\n    \"ethnie\",\n    \"étirer\",\n    \"étoffer\",\n    \"étoile\",\n    \"étonnant\",\n    \"étourdir\",\n    \"étrange\",\n    \"étroit\",\n    \"étude\",\n    \"euphorie\",\n    \"évaluer\",\n    \"évasion\",\n    \"éventail\",\n    \"évidence\",\n    \"éviter\",\n    \"évolutif\",\n    \"évoquer\",\n    \"exact\",\n    \"exagérer\",\n    \"exaucer\",\n    \"exceller\",\n    \"excitant\",\n    \"exclusif\",\n    \"excuse\",\n    \"exécuter\",\n    \"exemple\",\n    \"exercer\",\n    \"exhaler\",\n    \"exhorter\",\n    \"exigence\",\n    \"exiler\",\n    \"exister\",\n    \"exotique\",\n    \"expédier\",\n    \"explorer\",\n    \"exposer\",\n    \"exprimer\",\n    \"exquis\",\n    \"extensif\",\n    \"extraire\",\n    \"exulter\",\n    \"fable\",\n    \"fabuleux\",\n    \"facette\",\n    \"facile\",\n    \"facture\",\n    \"faiblir\",\n    \"falaise\",\n    \"fameux\",\n    \"famille\",\n    \"farceur\",\n    \"farfelu\",\n    \"farine\",\n    \"farouche\",\n    \"fasciner\",\n    \"fatal\",\n    \"fatigue\",\n    \"faucon\",\n    \"fautif\",\n    \"faveur\",\n    \"favori\",\n    \"fébrile\",\n    \"féconder\",\n    \"fédérer\",\n    \"félin\",\n    \"femme\",\n    \"fémur\",\n    \"fendoir\",\n    \"féodal\",\n    \"fermer\",\n    \"féroce\",\n    \"ferveur\",\n    \"festival\",\n    \"feuille\",\n    \"feutre\",\n    \"février\",\n    \"fiasco\",\n    \"ficeler\",\n    \"fictif\",\n    \"fidèle\",\n    \"figure\",\n    \"filature\",\n    \"filetage\",\n    \"filière\",\n    \"filleul\",\n    \"filmer\",\n    \"filou\",\n    \"filtrer\",\n    \"financer\",\n    \"finir\",\n    \"fiole\",\n    \"firme\",\n    \"fissure\",\n    \"fixer\",\n    \"flairer\",\n    \"flamme\",\n    \"flasque\",\n    \"flatteur\",\n    \"fléau\",\n    \"flèche\",\n    \"fleur\",\n    \"flexion\",\n    \"flocon\",\n    \"flore\",\n    \"fluctuer\",\n    \"fluide\",\n    \"fluvial\",\n    \"folie\",\n    \"fonderie\",\n    \"fongible\",\n    \"fontaine\",\n    \"forcer\",\n    \"forgeron\",\n    \"formuler\",\n    \"fortune\",\n    \"fossile\",\n    \"foudre\",\n    \"fougère\",\n    \"fouiller\",\n    \"foulure\",\n    \"fourmi\",\n    \"fragile\",\n    \"fraise\",\n    \"franchir\",\n    \"frapper\",\n    \"frayeur\",\n    \"frégate\",\n    \"freiner\",\n    \"frelon\",\n    \"frémir\",\n    \"frénésie\",\n    \"frère\",\n    \"friable\",\n    \"friction\",\n    \"frisson\",\n    \"frivole\",\n    \"froid\",\n    \"fromage\",\n    \"frontal\",\n    \"frotter\",\n    \"fruit\",\n    \"fugitif\",\n    \"fuite\",\n    \"fureur\",\n    \"furieux\",\n    \"furtif\",\n    \"fusion\",\n    \"futur\",\n    \"gagner\",\n    \"galaxie\",\n    \"galerie\",\n    \"gambader\",\n    \"garantir\",\n    \"gardien\",\n    \"garnir\",\n    \"garrigue\",\n    \"gazelle\",\n    \"gazon\",\n    \"géant\",\n    \"gélatine\",\n    \"gélule\",\n    \"gendarme\",\n    \"général\",\n    \"génie\",\n    \"genou\",\n    \"gentil\",\n    \"géologie\",\n    \"géomètre\",\n    \"géranium\",\n    \"germe\",\n    \"gestuel\",\n    \"geyser\",\n    \"gibier\",\n    \"gicler\",\n    \"girafe\",\n    \"givre\",\n    \"glace\",\n    \"glaive\",\n    \"glisser\",\n    \"globe\",\n    \"gloire\",\n    \"glorieux\",\n    \"golfeur\",\n    \"gomme\",\n    \"gonfler\",\n    \"gorge\",\n    \"gorille\",\n    \"goudron\",\n    \"gouffre\",\n    \"goulot\",\n    \"goupille\",\n    \"gourmand\",\n    \"goutte\",\n    \"graduel\",\n    \"graffiti\",\n    \"graine\",\n    \"grand\",\n    \"grappin\",\n    \"gratuit\",\n    \"gravir\",\n    \"grenat\",\n    \"griffure\",\n    \"griller\",\n    \"grimper\",\n    \"grogner\",\n    \"gronder\",\n    \"grotte\",\n    \"groupe\",\n    \"gruger\",\n    \"grutier\",\n    \"gruyère\",\n    \"guépard\",\n    \"guerrier\",\n    \"guide\",\n    \"guimauve\",\n    \"guitare\",\n    \"gustatif\",\n    \"gymnaste\",\n    \"gyrostat\",\n    \"habitude\",\n    \"hachoir\",\n    \"halte\",\n    \"hameau\",\n    \"hangar\",\n    \"hanneton\",\n    \"haricot\",\n    \"harmonie\",\n    \"harpon\",\n    \"hasard\",\n    \"hélium\",\n    \"hématome\",\n    \"herbe\",\n    \"hérisson\",\n    \"hermine\",\n    \"héron\",\n    \"hésiter\",\n    \"heureux\",\n    \"hiberner\",\n    \"hibou\",\n    \"hilarant\",\n    \"histoire\",\n    \"hiver\",\n    \"homard\",\n    \"hommage\",\n    \"homogène\",\n    \"honneur\",\n    \"honorer\",\n    \"honteux\",\n    \"horde\",\n    \"horizon\",\n    \"horloge\",\n    \"hormone\",\n    \"horrible\",\n    \"houleux\",\n    \"housse\",\n    \"hublot\",\n    \"huileux\",\n    \"humain\",\n    \"humble\",\n    \"humide\",\n    \"humour\",\n    \"hurler\",\n    \"hydromel\",\n    \"hygiène\",\n    \"hymne\",\n    \"hypnose\",\n    \"idylle\",\n    \"ignorer\",\n    \"iguane\",\n    \"illicite\",\n    \"illusion\",\n    \"image\",\n    \"imbiber\",\n    \"imiter\",\n    \"immense\",\n    \"immobile\",\n    \"immuable\",\n    \"impact\",\n    \"impérial\",\n    \"implorer\",\n    \"imposer\",\n    \"imprimer\",\n    \"imputer\",\n    \"incarner\",\n    \"incendie\",\n    \"incident\",\n    \"incliner\",\n    \"incolore\",\n    \"indexer\",\n    \"indice\",\n    \"inductif\",\n    \"inédit\",\n    \"ineptie\",\n    \"inexact\",\n    \"infini\",\n    \"infliger\",\n    \"informer\",\n    \"infusion\",\n    \"ingérer\",\n    \"inhaler\",\n    \"inhiber\",\n    \"injecter\",\n    \"injure\",\n    \"innocent\",\n    \"inoculer\",\n    \"inonder\",\n    \"inscrire\",\n    \"insecte\",\n    \"insigne\",\n    \"insolite\",\n    \"inspirer\",\n    \"instinct\",\n    \"insulter\",\n    \"intact\",\n    \"intense\",\n    \"intime\",\n    \"intrigue\",\n    \"intuitif\",\n    \"inutile\",\n    \"invasion\",\n    \"inventer\",\n    \"inviter\",\n    \"invoquer\",\n    \"ironique\",\n    \"irradier\",\n    \"irréel\",\n    \"irriter\",\n    \"isoler\",\n    \"ivoire\",\n    \"ivresse\",\n    \"jaguar\",\n    \"jaillir\",\n    \"jambe\",\n    \"janvier\",\n    \"jardin\",\n    \"jauger\",\n    \"jaune\",\n    \"javelot\",\n    \"jetable\",\n    \"jeton\",\n    \"jeudi\",\n    \"jeunesse\",\n    \"joindre\",\n    \"joncher\",\n    \"jongler\",\n    \"joueur\",\n    \"jouissif\",\n    \"journal\",\n    \"jovial\",\n    \"joyau\",\n    \"joyeux\",\n    \"jubiler\",\n    \"jugement\",\n    \"junior\",\n    \"jupon\",\n    \"juriste\",\n    \"justice\",\n    \"juteux\",\n    \"juvénile\",\n    \"kayak\",\n    \"kimono\",\n    \"kiosque\",\n    \"label\",\n    \"labial\",\n    \"labourer\",\n    \"lacérer\",\n    \"lactose\",\n    \"lagune\",\n    \"laine\",\n    \"laisser\",\n    \"laitier\",\n    \"lambeau\",\n    \"lamelle\",\n    \"lampe\",\n    \"lanceur\",\n    \"langage\",\n    \"lanterne\",\n    \"lapin\",\n    \"largeur\",\n    \"larme\",\n    \"laurier\",\n    \"lavabo\",\n    \"lavoir\",\n    \"lecture\",\n    \"légal\",\n    \"léger\",\n    \"légume\",\n    \"lessive\",\n    \"lettre\",\n    \"levier\",\n    \"lexique\",\n    \"lézard\",\n    \"liasse\",\n    \"libérer\",\n    \"libre\",\n    \"licence\",\n    \"licorne\",\n    \"liège\",\n    \"lièvre\",\n    \"ligature\",\n    \"ligoter\",\n    \"ligue\",\n    \"limer\",\n    \"limite\",\n    \"limonade\",\n    \"limpide\",\n    \"linéaire\",\n    \"lingot\",\n    \"lionceau\",\n    \"liquide\",\n    \"lisière\",\n    \"lister\",\n    \"lithium\",\n    \"litige\",\n    \"littoral\",\n    \"livreur\",\n    \"logique\",\n    \"lointain\",\n    \"loisir\",\n    \"lombric\",\n    \"loterie\",\n    \"louer\",\n    \"lourd\",\n    \"loutre\",\n    \"louve\",\n    \"loyal\",\n    \"lubie\",\n    \"lucide\",\n    \"lucratif\",\n    \"lueur\",\n    \"lugubre\",\n    \"luisant\",\n    \"lumière\",\n    \"lunaire\",\n    \"lundi\",\n    \"luron\",\n    \"lutter\",\n    \"luxueux\",\n    \"machine\",\n    \"magasin\",\n    \"magenta\",\n    \"magique\",\n    \"maigre\",\n    \"maillon\",\n    \"maintien\",\n    \"mairie\",\n    \"maison\",\n    \"majorer\",\n    \"malaxer\",\n    \"maléfice\",\n    \"malheur\",\n    \"malice\",\n    \"mallette\",\n    \"mammouth\",\n    \"mandater\",\n    \"maniable\",\n    \"manquant\",\n    \"manteau\",\n    \"manuel\",\n    \"marathon\",\n    \"marbre\",\n    \"marchand\",\n    \"mardi\",\n    \"maritime\",\n    \"marqueur\",\n    \"marron\",\n    \"marteler\",\n    \"mascotte\",\n    \"massif\",\n    \"matériel\",\n    \"matière\",\n    \"matraque\",\n    \"maudire\",\n    \"maussade\",\n    \"mauve\",\n    \"maximal\",\n    \"méchant\",\n    \"méconnu\",\n    \"médaille\",\n    \"médecin\",\n    \"méditer\",\n    \"méduse\",\n    \"meilleur\",\n    \"mélange\",\n    \"mélodie\",\n    \"membre\",\n    \"mémoire\",\n    \"menacer\",\n    \"mener\",\n    \"menhir\",\n    \"mensonge\",\n    \"mentor\",\n    \"mercredi\",\n    \"mérite\",\n    \"merle\",\n    \"messager\",\n    \"mesure\",\n    \"métal\",\n    \"météore\",\n    \"méthode\",\n    \"métier\",\n    \"meuble\",\n    \"miauler\",\n    \"microbe\",\n    \"miette\",\n    \"mignon\",\n    \"migrer\",\n    \"milieu\",\n    \"million\",\n    \"mimique\",\n    \"mince\",\n    \"minéral\",\n    \"minimal\",\n    \"minorer\",\n    \"minute\",\n    \"miracle\",\n    \"miroiter\",\n    \"missile\",\n    \"mixte\",\n    \"mobile\",\n    \"moderne\",\n    \"moelleux\",\n    \"mondial\",\n    \"moniteur\",\n    \"monnaie\",\n    \"monotone\",\n    \"monstre\",\n    \"montagne\",\n    \"monument\",\n    \"moqueur\",\n    \"morceau\",\n    \"morsure\",\n    \"mortier\",\n    \"moteur\",\n    \"motif\",\n    \"mouche\",\n    \"moufle\",\n    \"moulin\",\n    \"mousson\",\n    \"mouton\",\n    \"mouvant\",\n    \"multiple\",\n    \"munition\",\n    \"muraille\",\n    \"murène\",\n    \"murmure\",\n    \"muscle\",\n    \"muséum\",\n    \"musicien\",\n    \"mutation\",\n    \"muter\",\n    \"mutuel\",\n    \"myriade\",\n    \"myrtille\",\n    \"mystère\",\n    \"mythique\",\n    \"nageur\",\n    \"nappe\",\n    \"narquois\",\n    \"narrer\",\n    \"natation\",\n    \"nation\",\n    \"nature\",\n    \"naufrage\",\n    \"nautique\",\n    \"navire\",\n    \"nébuleux\",\n    \"nectar\",\n    \"néfaste\",\n    \"négation\",\n    \"négliger\",\n    \"négocier\",\n    \"neige\",\n    \"nerveux\",\n    \"nettoyer\",\n    \"neurone\",\n    \"neutron\",\n    \"neveu\",\n    \"niche\",\n    \"nickel\",\n    \"nitrate\",\n    \"niveau\",\n    \"noble\",\n    \"nocif\",\n    \"nocturne\",\n    \"noirceur\",\n    \"noisette\",\n    \"nomade\",\n    \"nombreux\",\n    \"nommer\",\n    \"normatif\",\n    \"notable\",\n    \"notifier\",\n    \"notoire\",\n    \"nourrir\",\n    \"nouveau\",\n    \"novateur\",\n    \"novembre\",\n    \"novice\",\n    \"nuage\",\n    \"nuancer\",\n    \"nuire\",\n    \"nuisible\",\n    \"numéro\",\n    \"nuptial\",\n    \"nuque\",\n    \"nutritif\",\n    \"obéir\",\n    \"objectif\",\n    \"obliger\",\n    \"obscur\",\n    \"observer\",\n    \"obstacle\",\n    \"obtenir\",\n    \"obturer\",\n    \"occasion\",\n    \"occuper\",\n    \"océan\",\n    \"octobre\",\n    \"octroyer\",\n    \"octupler\",\n    \"oculaire\",\n    \"odeur\",\n    \"odorant\",\n    \"offenser\",\n    \"officier\",\n    \"offrir\",\n    \"ogive\",\n    \"oiseau\",\n    \"oisillon\",\n    \"olfactif\",\n    \"olivier\",\n    \"ombrage\",\n    \"omettre\",\n    \"onctueux\",\n    \"onduler\",\n    \"onéreux\",\n    \"onirique\",\n    \"opale\",\n    \"opaque\",\n    \"opérer\",\n    \"opinion\",\n    \"opportun\",\n    \"opprimer\",\n    \"opter\",\n    \"optique\",\n    \"orageux\",\n    \"orange\",\n    \"orbite\",\n    \"ordonner\",\n    \"oreille\",\n    \"organe\",\n    \"orgueil\",\n    \"orifice\",\n    \"ornement\",\n    \"orque\",\n    \"ortie\",\n    \"osciller\",\n    \"osmose\",\n    \"ossature\",\n    \"otarie\",\n    \"ouragan\",\n    \"ourson\",\n    \"outil\",\n    \"outrager\",\n    \"ouvrage\",\n    \"ovation\",\n    \"oxyde\",\n    \"oxygène\",\n    \"ozone\",\n    \"paisible\",\n    \"palace\",\n    \"palmarès\",\n    \"palourde\",\n    \"palper\",\n    \"panache\",\n    \"panda\",\n    \"pangolin\",\n    \"paniquer\",\n    \"panneau\",\n    \"panorama\",\n    \"pantalon\",\n    \"papaye\",\n    \"papier\",\n    \"papoter\",\n    \"papyrus\",\n    \"paradoxe\",\n    \"parcelle\",\n    \"paresse\",\n    \"parfumer\",\n    \"parler\",\n    \"parole\",\n    \"parrain\",\n    \"parsemer\",\n    \"partager\",\n    \"parure\",\n    \"parvenir\",\n    \"passion\",\n    \"pastèque\",\n    \"paternel\",\n    \"patience\",\n    \"patron\",\n    \"pavillon\",\n    \"pavoiser\",\n    \"payer\",\n    \"paysage\",\n    \"peigne\",\n    \"peintre\",\n    \"pelage\",\n    \"pélican\",\n    \"pelle\",\n    \"pelouse\",\n    \"peluche\",\n    \"pendule\",\n    \"pénétrer\",\n    \"pénible\",\n    \"pensif\",\n    \"pénurie\",\n    \"pépite\",\n    \"péplum\",\n    \"perdrix\",\n    \"perforer\",\n    \"période\",\n    \"permuter\",\n    \"perplexe\",\n    \"persil\",\n    \"perte\",\n    \"peser\",\n    \"pétale\",\n    \"petit\",\n    \"pétrir\",\n    \"peuple\",\n    \"pharaon\",\n    \"phobie\",\n    \"phoque\",\n    \"photon\",\n    \"phrase\",\n    \"physique\",\n    \"piano\",\n    \"pictural\",\n    \"pièce\",\n    \"pierre\",\n    \"pieuvre\",\n    \"pilote\",\n    \"pinceau\",\n    \"pipette\",\n    \"piquer\",\n    \"pirogue\",\n    \"piscine\",\n    \"piston\",\n    \"pivoter\",\n    \"pixel\",\n    \"pizza\",\n    \"placard\",\n    \"plafond\",\n    \"plaisir\",\n    \"planer\",\n    \"plaque\",\n    \"plastron\",\n    \"plateau\",\n    \"pleurer\",\n    \"plexus\",\n    \"pliage\",\n    \"plomb\",\n    \"plonger\",\n    \"pluie\",\n    \"plumage\",\n    \"pochette\",\n    \"poésie\",\n    \"poète\",\n    \"pointe\",\n    \"poirier\",\n    \"poisson\",\n    \"poivre\",\n    \"polaire\",\n    \"policier\",\n    \"pollen\",\n    \"polygone\",\n    \"pommade\",\n    \"pompier\",\n    \"ponctuel\",\n    \"pondérer\",\n    \"poney\",\n    \"portique\",\n    \"position\",\n    \"posséder\",\n    \"posture\",\n    \"potager\",\n    \"poteau\",\n    \"potion\",\n    \"pouce\",\n    \"poulain\",\n    \"poumon\",\n    \"pourpre\",\n    \"poussin\",\n    \"pouvoir\",\n    \"prairie\",\n    \"pratique\",\n    \"précieux\",\n    \"prédire\",\n    \"préfixe\",\n    \"prélude\",\n    \"prénom\",\n    \"présence\",\n    \"prétexte\",\n    \"prévoir\",\n    \"primitif\",\n    \"prince\",\n    \"prison\",\n    \"priver\",\n    \"problème\",\n    \"procéder\",\n    \"prodige\",\n    \"profond\",\n    \"progrès\",\n    \"proie\",\n    \"projeter\",\n    \"prologue\",\n    \"promener\",\n    \"propre\",\n    \"prospère\",\n    \"protéger\",\n    \"prouesse\",\n    \"proverbe\",\n    \"prudence\",\n    \"pruneau\",\n    \"psychose\",\n    \"public\",\n    \"puceron\",\n    \"puiser\",\n    \"pulpe\",\n    \"pulsar\",\n    \"punaise\",\n    \"punitif\",\n    \"pupitre\",\n    \"purifier\",\n    \"puzzle\",\n    \"pyramide\",\n    \"quasar\",\n    \"querelle\",\n    \"question\",\n    \"quiétude\",\n    \"quitter\",\n    \"quotient\",\n    \"racine\",\n    \"raconter\",\n    \"radieux\",\n    \"ragondin\",\n    \"raideur\",\n    \"raisin\",\n    \"ralentir\",\n    \"rallonge\",\n    \"ramasser\",\n    \"rapide\",\n    \"rasage\",\n    \"ratisser\",\n    \"ravager\",\n    \"ravin\",\n    \"rayonner\",\n    \"réactif\",\n    \"réagir\",\n    \"réaliser\",\n    \"réanimer\",\n    \"recevoir\",\n    \"réciter\",\n    \"réclamer\",\n    \"récolter\",\n    \"recruter\",\n    \"reculer\",\n    \"recycler\",\n    \"rédiger\",\n    \"redouter\",\n    \"refaire\",\n    \"réflexe\",\n    \"réformer\",\n    \"refrain\",\n    \"refuge\",\n    \"régalien\",\n    \"région\",\n    \"réglage\",\n    \"régulier\",\n    \"réitérer\",\n    \"rejeter\",\n    \"rejouer\",\n    \"relatif\",\n    \"relever\",\n    \"relief\",\n    \"remarque\",\n    \"remède\",\n    \"remise\",\n    \"remonter\",\n    \"remplir\",\n    \"remuer\",\n    \"renard\",\n    \"renfort\",\n    \"renifler\",\n    \"renoncer\",\n    \"rentrer\",\n    \"renvoi\",\n    \"replier\",\n    \"reporter\",\n    \"reprise\",\n    \"reptile\",\n    \"requin\",\n    \"réserve\",\n    \"résineux\",\n    \"résoudre\",\n    \"respect\",\n    \"rester\",\n    \"résultat\",\n    \"rétablir\",\n    \"retenir\",\n    \"réticule\",\n    \"retomber\",\n    \"retracer\",\n    \"réunion\",\n    \"réussir\",\n    \"revanche\",\n    \"revivre\",\n    \"révolte\",\n    \"révulsif\",\n    \"richesse\",\n    \"rideau\",\n    \"rieur\",\n    \"rigide\",\n    \"rigoler\",\n    \"rincer\",\n    \"riposter\",\n    \"risible\",\n    \"risque\",\n    \"rituel\",\n    \"rival\",\n    \"rivière\",\n    \"rocheux\",\n    \"romance\",\n    \"rompre\",\n    \"ronce\",\n    \"rondin\",\n    \"roseau\",\n    \"rosier\",\n    \"rotatif\",\n    \"rotor\",\n    \"rotule\",\n    \"rouge\",\n    \"rouille\",\n    \"rouleau\",\n    \"routine\",\n    \"royaume\",\n    \"ruban\",\n    \"rubis\",\n    \"ruche\",\n    \"ruelle\",\n    \"rugueux\",\n    \"ruiner\",\n    \"ruisseau\",\n    \"ruser\",\n    \"rustique\",\n    \"rythme\",\n    \"sabler\",\n    \"saboter\",\n    \"sabre\",\n    \"sacoche\",\n    \"safari\",\n    \"sagesse\",\n    \"saisir\",\n    \"salade\",\n    \"salive\",\n    \"salon\",\n    \"saluer\",\n    \"samedi\",\n    \"sanction\",\n    \"sanglier\",\n    \"sarcasme\",\n    \"sardine\",\n    \"saturer\",\n    \"saugrenu\",\n    \"saumon\",\n    \"sauter\",\n    \"sauvage\",\n    \"savant\",\n    \"savonner\",\n    \"scalpel\",\n    \"scandale\",\n    \"scélérat\",\n    \"scénario\",\n    \"sceptre\",\n    \"schéma\",\n    \"science\",\n    \"scinder\",\n    \"score\",\n    \"scrutin\",\n    \"sculpter\",\n    \"séance\",\n    \"sécable\",\n    \"sécher\",\n    \"secouer\",\n    \"sécréter\",\n    \"sédatif\",\n    \"séduire\",\n    \"seigneur\",\n    \"séjour\",\n    \"sélectif\",\n    \"semaine\",\n    \"sembler\",\n    \"semence\",\n    \"séminal\",\n    \"sénateur\",\n    \"sensible\",\n    \"sentence\",\n    \"séparer\",\n    \"séquence\",\n    \"serein\",\n    \"sergent\",\n    \"sérieux\",\n    \"serrure\",\n    \"sérum\",\n    \"service\",\n    \"sésame\",\n    \"sévir\",\n    \"sevrage\",\n    \"sextuple\",\n    \"sidéral\",\n    \"siècle\",\n    \"siéger\",\n    \"siffler\",\n    \"sigle\",\n    \"signal\",\n    \"silence\",\n    \"silicium\",\n    \"simple\",\n    \"sincère\",\n    \"sinistre\",\n    \"siphon\",\n    \"sirop\",\n    \"sismique\",\n    \"situer\",\n    \"skier\",\n    \"social\",\n    \"socle\",\n    \"sodium\",\n    \"soigneux\",\n    \"soldat\",\n    \"soleil\",\n    \"solitude\",\n    \"soluble\",\n    \"sombre\",\n    \"sommeil\",\n    \"somnoler\",\n    \"sonde\",\n    \"songeur\",\n    \"sonnette\",\n    \"sonore\",\n    \"sorcier\",\n    \"sortir\",\n    \"sosie\",\n    \"sottise\",\n    \"soucieux\",\n    \"soudure\",\n    \"souffle\",\n    \"soulever\",\n    \"soupape\",\n    \"source\",\n    \"soutirer\",\n    \"souvenir\",\n    \"spacieux\",\n    \"spatial\",\n    \"spécial\",\n    \"sphère\",\n    \"spiral\",\n    \"stable\",\n    \"station\",\n    \"sternum\",\n    \"stimulus\",\n    \"stipuler\",\n    \"strict\",\n    \"studieux\",\n    \"stupeur\",\n    \"styliste\",\n    \"sublime\",\n    \"substrat\",\n    \"subtil\",\n    \"subvenir\",\n    \"succès\",\n    \"sucre\",\n    \"suffixe\",\n    \"suggérer\",\n    \"suiveur\",\n    \"sulfate\",\n    \"superbe\",\n    \"supplier\",\n    \"surface\",\n    \"suricate\",\n    \"surmener\",\n    \"surprise\",\n    \"sursaut\",\n    \"survie\",\n    \"suspect\",\n    \"syllabe\",\n    \"symbole\",\n    \"symétrie\",\n    \"synapse\",\n    \"syntaxe\",\n    \"système\",\n    \"tabac\",\n    \"tablier\",\n    \"tactile\",\n    \"tailler\",\n    \"talent\",\n    \"talisman\",\n    \"talonner\",\n    \"tambour\",\n    \"tamiser\",\n    \"tangible\",\n    \"tapis\",\n    \"taquiner\",\n    \"tarder\",\n    \"tarif\",\n    \"tartine\",\n    \"tasse\",\n    \"tatami\",\n    \"tatouage\",\n    \"taupe\",\n    \"taureau\",\n    \"taxer\",\n    \"témoin\",\n    \"temporel\",\n    \"tenaille\",\n    \"tendre\",\n    \"teneur\",\n    \"tenir\",\n    \"tension\",\n    \"terminer\",\n    \"terne\",\n    \"terrible\",\n    \"tétine\",\n    \"texte\",\n    \"thème\",\n    \"théorie\",\n    \"thérapie\",\n    \"thorax\",\n    \"tibia\",\n    \"tiède\",\n    \"timide\",\n    \"tirelire\",\n    \"tiroir\",\n    \"tissu\",\n    \"titane\",\n    \"titre\",\n    \"tituber\",\n    \"toboggan\",\n    \"tolérant\",\n    \"tomate\",\n    \"tonique\",\n    \"tonneau\",\n    \"toponyme\",\n    \"torche\",\n    \"tordre\",\n    \"tornade\",\n    \"torpille\",\n    \"torrent\",\n    \"torse\",\n    \"tortue\",\n    \"totem\",\n    \"toucher\",\n    \"tournage\",\n    \"tousser\",\n    \"toxine\",\n    \"traction\",\n    \"trafic\",\n    \"tragique\",\n    \"trahir\",\n    \"train\",\n    \"trancher\",\n    \"travail\",\n    \"trèfle\",\n    \"tremper\",\n    \"trésor\",\n    \"treuil\",\n    \"triage\",\n    \"tribunal\",\n    \"tricoter\",\n    \"trilogie\",\n    \"triomphe\",\n    \"tripler\",\n    \"triturer\",\n    \"trivial\",\n    \"trombone\",\n    \"tronc\",\n    \"tropical\",\n    \"troupeau\",\n    \"tuile\",\n    \"tulipe\",\n    \"tumulte\",\n    \"tunnel\",\n    \"turbine\",\n    \"tuteur\",\n    \"tutoyer\",\n    \"tuyau\",\n    \"tympan\",\n    \"typhon\",\n    \"typique\",\n    \"tyran\",\n    \"ubuesque\",\n    \"ultime\",\n    \"ultrason\",\n    \"unanime\",\n    \"unifier\",\n    \"union\",\n    \"unique\",\n    \"unitaire\",\n    \"univers\",\n    \"uranium\",\n    \"urbain\",\n    \"urticant\",\n    \"usage\",\n    \"usine\",\n    \"usuel\",\n    \"usure\",\n    \"utile\",\n    \"utopie\",\n    \"vacarme\",\n    \"vaccin\",\n    \"vagabond\",\n    \"vague\",\n    \"vaillant\",\n    \"vaincre\",\n    \"vaisseau\",\n    \"valable\",\n    \"valise\",\n    \"vallon\",\n    \"valve\",\n    \"vampire\",\n    \"vanille\",\n    \"vapeur\",\n    \"varier\",\n    \"vaseux\",\n    \"vassal\",\n    \"vaste\",\n    \"vecteur\",\n    \"vedette\",\n    \"végétal\",\n    \"véhicule\",\n    \"veinard\",\n    \"véloce\",\n    \"vendredi\",\n    \"vénérer\",\n    \"venger\",\n    \"venimeux\",\n    \"ventouse\",\n    \"verdure\",\n    \"vérin\",\n    \"vernir\",\n    \"verrou\",\n    \"verser\",\n    \"vertu\",\n    \"veston\",\n    \"vétéran\",\n    \"vétuste\",\n    \"vexant\",\n    \"vexer\",\n    \"viaduc\",\n    \"viande\",\n    \"victoire\",\n    \"vidange\",\n    \"vidéo\",\n    \"vignette\",\n    \"vigueur\",\n    \"vilain\",\n    \"village\",\n    \"vinaigre\",\n    \"violon\",\n    \"vipère\",\n    \"virement\",\n    \"virtuose\",\n    \"virus\",\n    \"visage\",\n    \"viseur\",\n    \"vision\",\n    \"visqueux\",\n    \"visuel\",\n    \"vital\",\n    \"vitesse\",\n    \"viticole\",\n    \"vitrine\",\n    \"vivace\",\n    \"vivipare\",\n    \"vocation\",\n    \"voguer\",\n    \"voile\",\n    \"voisin\",\n    \"voiture\",\n    \"volaille\",\n    \"volcan\",\n    \"voltiger\",\n    \"volume\",\n    \"vorace\",\n    \"vortex\",\n    \"voter\",\n    \"vouloir\",\n    \"voyage\",\n    \"voyelle\",\n    \"wagon\",\n    \"xénon\",\n    \"yacht\",\n    \"zèbre\",\n    \"zénith\",\n    \"zeste\",\n    \"zoologie\"\n]\n[\n    \"abaco\",\n    \"abbaglio\",\n    \"abbinato\",\n    \"abete\",\n    \"abisso\",\n    \"abolire\",\n    \"abrasivo\",\n    \"abrogato\",\n    \"accadere\",\n    \"accenno\",\n    \"accusato\",\n    \"acetone\",\n    \"achille\",\n    \"acido\",\n    \"acqua\",\n    \"acre\",\n    \"acrilico\",\n    \"acrobata\",\n    \"acuto\",\n    \"adagio\",\n    \"addebito\",\n    \"addome\",\n    \"adeguato\",\n    \"aderire\",\n    \"adipe\",\n    \"adottare\",\n    \"adulare\",\n    \"affabile\",\n    \"affetto\",\n    \"affisso\",\n    \"affranto\",\n    \"aforisma\",\n    \"afoso\",\n    \"africano\",\n    \"agave\",\n    \"agente\",\n    \"agevole\",\n    \"aggancio\",\n    \"agire\",\n    \"agitare\",\n    \"agonismo\",\n    \"agricolo\",\n    \"agrumeto\",\n    \"aguzzo\",\n    \"alabarda\",\n    \"alato\",\n    \"albatro\",\n    \"alberato\",\n    \"albo\",\n    \"albume\",\n    \"alce\",\n    \"alcolico\",\n    \"alettone\",\n    \"alfa\",\n    \"algebra\",\n    \"aliante\",\n    \"alibi\",\n    \"alimento\",\n    \"allagato\",\n    \"allegro\",\n    \"allievo\",\n    \"allodola\",\n    \"allusivo\",\n    \"almeno\",\n    \"alogeno\",\n    \"alpaca\",\n    \"alpestre\",\n    \"altalena\",\n    \"alterno\",\n    \"alticcio\",\n    \"altrove\",\n    \"alunno\",\n    \"alveolo\",\n    \"alzare\",\n    \"amalgama\",\n    \"amanita\",\n    \"amarena\",\n    \"ambito\",\n    \"ambrato\",\n    \"ameba\",\n    \"america\",\n    \"ametista\",\n    \"amico\",\n    \"ammasso\",\n    \"ammenda\",\n    \"ammirare\",\n    \"ammonito\",\n    \"amore\",\n    \"ampio\",\n    \"ampliare\",\n    \"amuleto\",\n    \"anacardo\",\n    \"anagrafe\",\n    \"analista\",\n    \"anarchia\",\n    \"anatra\",\n    \"anca\",\n    \"ancella\",\n    \"ancora\",\n    \"andare\",\n    \"andrea\",\n    \"anello\",\n    \"angelo\",\n    \"angolare\",\n    \"angusto\",\n    \"anima\",\n    \"annegare\",\n    \"annidato\",\n    \"anno\",\n    \"annuncio\",\n    \"anonimo\",\n    \"anticipo\",\n    \"anzi\",\n    \"apatico\",\n    \"apertura\",\n    \"apode\",\n    \"apparire\",\n    \"appetito\",\n    \"appoggio\",\n    \"approdo\",\n    \"appunto\",\n    \"aprile\",\n    \"arabica\",\n    \"arachide\",\n    \"aragosta\",\n    \"araldica\",\n    \"arancio\",\n    \"aratura\",\n    \"arazzo\",\n    \"arbitro\",\n    \"archivio\",\n    \"ardito\",\n    \"arenile\",\n    \"argento\",\n    \"argine\",\n    \"arguto\",\n    \"aria\",\n    \"armonia\",\n    \"arnese\",\n    \"arredato\",\n    \"arringa\",\n    \"arrosto\",\n    \"arsenico\",\n    \"arso\",\n    \"artefice\",\n    \"arzillo\",\n    \"asciutto\",\n    \"ascolto\",\n    \"asepsi\",\n    \"asettico\",\n    \"asfalto\",\n    \"asino\",\n    \"asola\",\n    \"aspirato\",\n    \"aspro\",\n    \"assaggio\",\n    \"asse\",\n    \"assoluto\",\n    \"assurdo\",\n    \"asta\",\n    \"astenuto\",\n    \"astice\",\n    \"astratto\",\n    \"atavico\",\n    \"ateismo\",\n    \"atomico\",\n    \"atono\",\n    \"attesa\",\n    \"attivare\",\n    \"attorno\",\n    \"attrito\",\n    \"attuale\",\n    \"ausilio\",\n    \"austria\",\n    \"autista\",\n    \"autonomo\",\n    \"autunno\",\n    \"avanzato\",\n    \"avere\",\n    \"avvenire\",\n    \"avviso\",\n    \"avvolgere\",\n    \"azione\",\n    \"azoto\",\n    \"azzimo\",\n    \"azzurro\",\n    \"babele\",\n    \"baccano\",\n    \"bacino\",\n    \"baco\",\n    \"badessa\",\n    \"badilata\",\n    \"bagnato\",\n    \"baita\",\n    \"balcone\",\n    \"baldo\",\n    \"balena\",\n    \"ballata\",\n    \"balzano\",\n    \"bambino\",\n    \"bandire\",\n    \"baraonda\",\n    \"barbaro\",\n    \"barca\",\n    \"baritono\",\n    \"barlume\",\n    \"barocco\",\n    \"basilico\",\n    \"basso\",\n    \"batosta\",\n    \"battuto\",\n    \"baule\",\n    \"bava\",\n    \"bavosa\",\n    \"becco\",\n    \"beffa\",\n    \"belgio\",\n    \"belva\",\n    \"benda\",\n    \"benevole\",\n    \"benigno\",\n    \"benzina\",\n    \"bere\",\n    \"berlina\",\n    \"beta\",\n    \"bibita\",\n    \"bici\",\n    \"bidone\",\n    \"bifido\",\n    \"biga\",\n    \"bilancia\",\n    \"bimbo\",\n    \"binocolo\",\n    \"biologo\",\n    \"bipede\",\n    \"bipolare\",\n    \"birbante\",\n    \"birra\",\n    \"biscotto\",\n    \"bisesto\",\n    \"bisnonno\",\n    \"bisonte\",\n    \"bisturi\",\n    \"bizzarro\",\n    \"blando\",\n    \"blatta\",\n    \"bollito\",\n    \"bonifico\",\n    \"bordo\",\n    \"bosco\",\n    \"botanico\",\n    \"bottino\",\n    \"bozzolo\",\n    \"braccio\",\n    \"bradipo\",\n    \"brama\",\n    \"branca\",\n    \"bravura\",\n    \"bretella\",\n    \"brevetto\",\n    \"brezza\",\n    \"briglia\",\n    \"brillante\",\n    \"brindare\",\n    \"broccolo\",\n    \"brodo\",\n    \"bronzina\",\n    \"brullo\",\n    \"bruno\",\n    \"bubbone\",\n    \"buca\",\n    \"budino\",\n    \"buffone\",\n    \"buio\",\n    \"bulbo\",\n    \"buono\",\n    \"burlone\",\n    \"burrasca\",\n    \"bussola\",\n    \"busta\",\n    \"cadetto\",\n    \"caduco\",\n    \"calamaro\",\n    \"calcolo\",\n    \"calesse\",\n    \"calibro\",\n    \"calmo\",\n    \"caloria\",\n    \"cambusa\",\n    \"camerata\",\n    \"camicia\",\n    \"cammino\",\n    \"camola\",\n    \"campale\",\n    \"canapa\",\n    \"candela\",\n    \"cane\",\n    \"canino\",\n    \"canotto\",\n    \"cantina\",\n    \"capace\",\n    \"capello\",\n    \"capitolo\",\n    \"capogiro\",\n    \"cappero\",\n    \"capra\",\n    \"capsula\",\n    \"carapace\",\n    \"carcassa\",\n    \"cardo\",\n    \"carisma\",\n    \"carovana\",\n    \"carretto\",\n    \"cartolina\",\n    \"casaccio\",\n    \"cascata\",\n    \"caserma\",\n    \"caso\",\n    \"cassone\",\n    \"castello\",\n    \"casuale\",\n    \"catasta\",\n    \"catena\",\n    \"catrame\",\n    \"cauto\",\n    \"cavillo\",\n    \"cedibile\",\n    \"cedrata\",\n    \"cefalo\",\n    \"celebre\",\n    \"cellulare\",\n    \"cena\",\n    \"cenone\",\n    \"centesimo\",\n    \"ceramica\",\n    \"cercare\",\n    \"certo\",\n    \"cerume\",\n    \"cervello\",\n    \"cesoia\",\n    \"cespo\",\n    \"ceto\",\n    \"chela\",\n    \"chiaro\",\n    \"chicca\",\n    \"chiedere\",\n    \"chimera\",\n    \"china\",\n    \"chirurgo\",\n    \"chitarra\",\n    \"ciao\",\n    \"ciclismo\",\n    \"cifrare\",\n    \"cigno\",\n    \"cilindro\",\n    \"ciottolo\",\n    \"circa\",\n    \"cirrosi\",\n    \"citrico\",\n    \"cittadino\",\n    \"ciuffo\",\n    \"civetta\",\n    \"civile\",\n    \"classico\",\n    \"clinica\",\n    \"cloro\",\n    \"cocco\",\n    \"codardo\",\n    \"codice\",\n    \"coerente\",\n    \"cognome\",\n    \"collare\",\n    \"colmato\",\n    \"colore\",\n    \"colposo\",\n    \"coltivato\",\n    \"colza\",\n    \"coma\",\n    \"cometa\",\n    \"commando\",\n    \"comodo\",\n    \"computer\",\n    \"comune\",\n    \"conciso\",\n    \"condurre\",\n    \"conferma\",\n    \"congelare\",\n    \"coniuge\",\n    \"connesso\",\n    \"conoscere\",\n    \"consumo\",\n    \"continuo\",\n    \"convegno\",\n    \"coperto\",\n    \"copione\",\n    \"coppia\",\n    \"copricapo\",\n    \"corazza\",\n    \"cordata\",\n    \"coricato\",\n    \"cornice\",\n    \"corolla\",\n    \"corpo\",\n    \"corredo\",\n    \"corsia\",\n    \"cortese\",\n    \"cosmico\",\n    \"costante\",\n    \"cottura\",\n    \"covato\",\n    \"cratere\",\n    \"cravatta\",\n    \"creato\",\n    \"credere\",\n    \"cremoso\",\n    \"crescita\",\n    \"creta\",\n    \"criceto\",\n    \"crinale\",\n    \"crisi\",\n    \"critico\",\n    \"croce\",\n    \"cronaca\",\n    \"crostata\",\n    \"cruciale\",\n    \"crusca\",\n    \"cucire\",\n    \"cuculo\",\n    \"cugino\",\n    \"cullato\",\n    \"cupola\",\n    \"curatore\",\n    \"cursore\",\n    \"curvo\",\n    \"cuscino\",\n    \"custode\",\n    \"dado\",\n    \"daino\",\n    \"dalmata\",\n    \"damerino\",\n    \"daniela\",\n    \"dannoso\",\n    \"danzare\",\n    \"datato\",\n    \"davanti\",\n    \"davvero\",\n    \"debutto\",\n    \"decennio\",\n    \"deciso\",\n    \"declino\",\n    \"decollo\",\n    \"decreto\",\n    \"dedicato\",\n    \"definito\",\n    \"deforme\",\n    \"degno\",\n    \"delegare\",\n    \"delfino\",\n    \"delirio\",\n    \"delta\",\n    \"demenza\",\n    \"denotato\",\n    \"dentro\",\n    \"deposito\",\n    \"derapata\",\n    \"derivare\",\n    \"deroga\",\n    \"descritto\",\n    \"deserto\",\n    \"desiderio\",\n    \"desumere\",\n    \"detersivo\",\n    \"devoto\",\n    \"diametro\",\n    \"dicembre\",\n    \"diedro\",\n    \"difeso\",\n    \"diffuso\",\n    \"digerire\",\n    \"digitale\",\n    \"diluvio\",\n    \"dinamico\",\n    \"dinnanzi\",\n    \"dipinto\",\n    \"diploma\",\n    \"dipolo\",\n    \"diradare\",\n    \"dire\",\n    \"dirotto\",\n    \"dirupo\",\n    \"disagio\",\n    \"discreto\",\n    \"disfare\",\n    \"disgelo\",\n    \"disposto\",\n    \"distanza\",\n    \"disumano\",\n    \"dito\",\n    \"divano\",\n    \"divelto\",\n    \"dividere\",\n    \"divorato\",\n    \"doblone\",\n    \"docente\",\n    \"doganale\",\n    \"dogma\",\n    \"dolce\",\n    \"domato\",\n    \"domenica\",\n    \"dominare\",\n    \"dondolo\",\n    \"dono\",\n    \"dormire\",\n    \"dote\",\n    \"dottore\",\n    \"dovuto\",\n    \"dozzina\",\n    \"drago\",\n    \"druido\",\n    \"dubbio\",\n    \"dubitare\",\n    \"ducale\",\n    \"duna\",\n    \"duomo\",\n    \"duplice\",\n    \"duraturo\",\n    \"ebano\",\n    \"eccesso\",\n    \"ecco\",\n    \"eclissi\",\n    \"economia\",\n    \"edera\",\n    \"edicola\",\n    \"edile\",\n    \"editoria\",\n    \"educare\",\n    \"egemonia\",\n    \"egli\",\n    \"egoismo\",\n    \"egregio\",\n    \"elaborato\",\n    \"elargire\",\n    \"elegante\",\n    \"elencato\",\n    \"eletto\",\n    \"elevare\",\n    \"elfico\",\n    \"elica\",\n    \"elmo\",\n    \"elsa\",\n    \"eluso\",\n    \"emanato\",\n    \"emblema\",\n    \"emesso\",\n    \"emiro\",\n    \"emotivo\",\n    \"emozione\",\n    \"empirico\",\n    \"emulo\",\n    \"endemico\",\n    \"enduro\",\n    \"energia\",\n    \"enfasi\",\n    \"enoteca\",\n    \"entrare\",\n    \"enzima\",\n    \"epatite\",\n    \"epilogo\",\n    \"episodio\",\n    \"epocale\",\n    \"eppure\",\n    \"equatore\",\n    \"erario\",\n    \"erba\",\n    \"erboso\",\n    \"erede\",\n    \"eremita\",\n    \"erigere\",\n    \"ermetico\",\n    \"eroe\",\n    \"erosivo\",\n    \"errante\",\n    \"esagono\",\n    \"esame\",\n    \"esanime\",\n    \"esaudire\",\n    \"esca\",\n    \"esempio\",\n    \"esercito\",\n    \"esibito\",\n    \"esigente\",\n    \"esistere\",\n    \"esito\",\n    \"esofago\",\n    \"esortato\",\n    \"esoso\",\n    \"espanso\",\n    \"espresso\",\n    \"essenza\",\n    \"esso\",\n    \"esteso\",\n    \"estimare\",\n    \"estonia\",\n    \"estroso\",\n    \"esultare\",\n    \"etilico\",\n    \"etnico\",\n    \"etrusco\",\n    \"etto\",\n    \"euclideo\",\n    \"europa\",\n    \"evaso\",\n    \"evidenza\",\n    \"evitato\",\n    \"evoluto\",\n    \"evviva\",\n    \"fabbrica\",\n    \"faccenda\",\n    \"fachiro\",\n    \"falco\",\n    \"famiglia\",\n    \"fanale\",\n    \"fanfara\",\n    \"fango\",\n    \"fantasma\",\n    \"fare\",\n    \"farfalla\",\n    \"farinoso\",\n    \"farmaco\",\n    \"fascia\",\n    \"fastoso\",\n    \"fasullo\",\n    \"faticare\",\n    \"fato\",\n    \"favoloso\",\n    \"febbre\",\n    \"fecola\",\n    \"fede\",\n    \"fegato\",\n    \"felpa\",\n    \"feltro\",\n    \"femmina\",\n    \"fendere\",\n    \"fenomeno\",\n    \"fermento\",\n    \"ferro\",\n    \"fertile\",\n    \"fessura\",\n    \"festivo\",\n    \"fetta\",\n    \"feudo\",\n    \"fiaba\",\n    \"fiducia\",\n    \"fifa\",\n    \"figurato\",\n    \"filo\",\n    \"finanza\",\n    \"finestra\",\n    \"finire\",\n    \"fiore\",\n    \"fiscale\",\n    \"fisico\",\n    \"fiume\",\n    \"flacone\",\n    \"flamenco\",\n    \"flebo\",\n    \"flemma\",\n    \"florido\",\n    \"fluente\",\n    \"fluoro\",\n    \"fobico\",\n    \"focaccia\",\n    \"focoso\",\n    \"foderato\",\n    \"foglio\",\n    \"folata\",\n    \"folclore\",\n    \"folgore\",\n    \"fondente\",\n    \"fonetico\",\n    \"fonia\",\n    \"fontana\",\n    \"forbito\",\n    \"forchetta\",\n    \"foresta\",\n    \"formica\",\n    \"fornaio\",\n    \"foro\",\n    \"fortezza\",\n    \"forzare\",\n    \"fosfato\",\n    \"fosso\",\n    \"fracasso\",\n    \"frana\",\n    \"frassino\",\n    \"fratello\",\n    \"freccetta\",\n    \"frenata\",\n    \"fresco\",\n    \"frigo\",\n    \"frollino\",\n    \"fronde\",\n    \"frugale\",\n    \"frutta\",\n    \"fucilata\",\n    \"fucsia\",\n    \"fuggente\",\n    \"fulmine\",\n    \"fulvo\",\n    \"fumante\",\n    \"fumetto\",\n    \"fumoso\",\n    \"fune\",\n    \"funzione\",\n    \"fuoco\",\n    \"furbo\",\n    \"furgone\",\n    \"furore\",\n    \"fuso\",\n    \"futile\",\n    \"gabbiano\",\n    \"gaffe\",\n    \"galateo\",\n    \"gallina\",\n    \"galoppo\",\n    \"gambero\",\n    \"gamma\",\n    \"garanzia\",\n    \"garbo\",\n    \"garofano\",\n    \"garzone\",\n    \"gasdotto\",\n    \"gasolio\",\n    \"gastrico\",\n    \"gatto\",\n    \"gaudio\",\n    \"gazebo\",\n    \"gazzella\",\n    \"geco\",\n    \"gelatina\",\n    \"gelso\",\n    \"gemello\",\n    \"gemmato\",\n    \"gene\",\n    \"genitore\",\n    \"gennaio\",\n    \"genotipo\",\n    \"gergo\",\n    \"ghepardo\",\n    \"ghiaccio\",\n    \"ghisa\",\n    \"giallo\",\n    \"gilda\",\n    \"ginepro\",\n    \"giocare\",\n    \"gioiello\",\n    \"giorno\",\n    \"giove\",\n    \"girato\",\n    \"girone\",\n    \"gittata\",\n    \"giudizio\",\n    \"giurato\",\n    \"giusto\",\n    \"globulo\",\n    \"glutine\",\n    \"gnomo\",\n    \"gobba\",\n    \"golf\",\n    \"gomito\",\n    \"gommone\",\n    \"gonfio\",\n    \"gonna\",\n    \"governo\",\n    \"gracile\",\n    \"grado\",\n    \"grafico\",\n    \"grammo\",\n    \"grande\",\n    \"grattare\",\n    \"gravoso\",\n    \"grazia\",\n    \"greca\",\n    \"gregge\",\n    \"grifone\",\n    \"grigio\",\n    \"grinza\",\n    \"grotta\",\n    \"gruppo\",\n    \"guadagno\",\n    \"guaio\",\n    \"guanto\",\n    \"guardare\",\n    \"gufo\",\n    \"guidare\",\n    \"ibernato\",\n    \"icona\",\n    \"identico\",\n    \"idillio\",\n    \"idolo\",\n    \"idra\",\n    \"idrico\",\n    \"idrogeno\",\n    \"igiene\",\n    \"ignaro\",\n    \"ignorato\",\n    \"ilare\",\n    \"illeso\",\n    \"illogico\",\n    \"illudere\",\n    \"imballo\",\n    \"imbevuto\",\n    \"imbocco\",\n    \"imbuto\",\n    \"immane\",\n    \"immerso\",\n    \"immolato\",\n    \"impacco\",\n    \"impeto\",\n    \"impiego\",\n    \"importo\",\n    \"impronta\",\n    \"inalare\",\n    \"inarcare\",\n    \"inattivo\",\n    \"incanto\",\n    \"incendio\",\n    \"inchino\",\n    \"incisivo\",\n    \"incluso\",\n    \"incontro\",\n    \"incrocio\",\n    \"incubo\",\n    \"indagine\",\n    \"india\",\n    \"indole\",\n    \"inedito\",\n    \"infatti\",\n    \"infilare\",\n    \"inflitto\",\n    \"ingaggio\",\n    \"ingegno\",\n    \"inglese\",\n    \"ingordo\",\n    \"ingrosso\",\n    \"innesco\",\n    \"inodore\",\n    \"inoltrare\",\n    \"inondato\",\n    \"insano\",\n    \"insetto\",\n    \"insieme\",\n    \"insonnia\",\n    \"insulina\",\n    \"intasato\",\n    \"intero\",\n    \"intonaco\",\n    \"intuito\",\n    \"inumidire\",\n    \"invalido\",\n    \"invece\",\n    \"invito\",\n    \"iperbole\",\n    \"ipnotico\",\n    \"ipotesi\",\n    \"ippica\",\n    \"iride\",\n    \"irlanda\",\n    \"ironico\",\n    \"irrigato\",\n    \"irrorare\",\n    \"isolato\",\n    \"isotopo\",\n    \"isterico\",\n    \"istituto\",\n    \"istrice\",\n    \"italia\",\n    \"iterare\",\n    \"labbro\",\n    \"labirinto\",\n    \"lacca\",\n    \"lacerato\",\n    \"lacrima\",\n    \"lacuna\",\n    \"laddove\",\n    \"lago\",\n    \"lampo\",\n    \"lancetta\",\n    \"lanterna\",\n    \"lardoso\",\n    \"larga\",\n    \"laringe\",\n    \"lastra\",\n    \"latenza\",\n    \"latino\",\n    \"lattuga\",\n    \"lavagna\",\n    \"lavoro\",\n    \"legale\",\n    \"leggero\",\n    \"lembo\",\n    \"lentezza\",\n    \"lenza\",\n    \"leone\",\n    \"lepre\",\n    \"lesivo\",\n    \"lessato\",\n    \"lesto\",\n    \"letterale\",\n    \"leva\",\n    \"levigato\",\n    \"libero\",\n    \"lido\",\n    \"lievito\",\n    \"lilla\",\n    \"limatura\",\n    \"limitare\",\n    \"limpido\",\n    \"lineare\",\n    \"lingua\",\n    \"liquido\",\n    \"lira\",\n    \"lirica\",\n    \"lisca\",\n    \"lite\",\n    \"litigio\",\n    \"livrea\",\n    \"locanda\",\n    \"lode\",\n    \"logica\",\n    \"lombare\",\n    \"londra\",\n    \"longevo\",\n    \"loquace\",\n    \"lorenzo\",\n    \"loto\",\n    \"lotteria\",\n    \"luce\",\n    \"lucidato\",\n    \"lumaca\",\n    \"luminoso\",\n    \"lungo\",\n    \"lupo\",\n    \"luppolo\",\n    \"lusinga\",\n    \"lusso\",\n    \"lutto\",\n    \"macabro\",\n    \"macchina\",\n    \"macero\",\n    \"macinato\",\n    \"madama\",\n    \"magico\",\n    \"maglia\",\n    \"magnete\",\n    \"magro\",\n    \"maiolica\",\n    \"malafede\",\n    \"malgrado\",\n    \"malinteso\",\n    \"malsano\",\n    \"malto\",\n    \"malumore\",\n    \"mana\",\n    \"mancia\",\n    \"mandorla\",\n    \"mangiare\",\n    \"manifesto\",\n    \"mannaro\",\n    \"manovra\",\n    \"mansarda\",\n    \"mantide\",\n    \"manubrio\",\n    \"mappa\",\n    \"maratona\",\n    \"marcire\",\n    \"maretta\",\n    \"marmo\",\n    \"marsupio\",\n    \"maschera\",\n    \"massaia\",\n    \"mastino\",\n    \"materasso\",\n    \"matricola\",\n    \"mattone\",\n    \"maturo\",\n    \"mazurca\",\n    \"meandro\",\n    \"meccanico\",\n    \"mecenate\",\n    \"medesimo\",\n    \"meditare\",\n    \"mega\",\n    \"melassa\",\n    \"melis\",\n    \"melodia\",\n    \"meninge\",\n    \"meno\",\n    \"mensola\",\n    \"mercurio\",\n    \"merenda\",\n    \"merlo\",\n    \"meschino\",\n    \"mese\",\n    \"messere\",\n    \"mestolo\",\n    \"metallo\",\n    \"metodo\",\n    \"mettere\",\n    \"miagolare\",\n    \"mica\",\n    \"micelio\",\n    \"michele\",\n    \"microbo\",\n    \"midollo\",\n    \"miele\",\n    \"migliore\",\n    \"milano\",\n    \"milite\",\n    \"mimosa\",\n    \"minerale\",\n    \"mini\",\n    \"minore\",\n    \"mirino\",\n    \"mirtillo\",\n    \"miscela\",\n    \"missiva\",\n    \"misto\",\n    \"misurare\",\n    \"mitezza\",\n    \"mitigare\",\n    \"mitra\",\n    \"mittente\",\n    \"mnemonico\",\n    \"modello\",\n    \"modifica\",\n    \"modulo\",\n    \"mogano\",\n    \"mogio\",\n    \"mole\",\n    \"molosso\",\n    \"monastero\",\n    \"monco\",\n    \"mondina\",\n    \"monetario\",\n    \"monile\",\n    \"monotono\",\n    \"monsone\",\n    \"montato\",\n    \"monviso\",\n    \"mora\",\n    \"mordere\",\n    \"morsicato\",\n    \"mostro\",\n    \"motivato\",\n    \"motosega\",\n    \"motto\",\n    \"movenza\",\n    \"movimento\",\n    \"mozzo\",\n    \"mucca\",\n    \"mucosa\",\n    \"muffa\",\n    \"mughetto\",\n    \"mugnaio\",\n    \"mulatto\",\n    \"mulinello\",\n    \"multiplo\",\n    \"mummia\",\n    \"munto\",\n    \"muovere\",\n    \"murale\",\n    \"musa\",\n    \"muscolo\",\n    \"musica\",\n    \"mutevole\",\n    \"muto\",\n    \"nababbo\",\n    \"nafta\",\n    \"nanometro\",\n    \"narciso\",\n    \"narice\",\n    \"narrato\",\n    \"nascere\",\n    \"nastrare\",\n    \"naturale\",\n    \"nautica\",\n    \"naviglio\",\n    \"nebulosa\",\n    \"necrosi\",\n    \"negativo\",\n    \"negozio\",\n    \"nemmeno\",\n    \"neofita\",\n    \"neretto\",\n    \"nervo\",\n    \"nessuno\",\n    \"nettuno\",\n    \"neutrale\",\n    \"neve\",\n    \"nevrotico\",\n    \"nicchia\",\n    \"ninfa\",\n    \"nitido\",\n    \"nobile\",\n    \"nocivo\",\n    \"nodo\",\n    \"nome\",\n    \"nomina\",\n    \"nordico\",\n    \"normale\",\n    \"norvegese\",\n    \"nostrano\",\n    \"notare\",\n    \"notizia\",\n    \"notturno\",\n    \"novella\",\n    \"nucleo\",\n    \"nulla\",\n    \"numero\",\n    \"nuovo\",\n    \"nutrire\",\n    \"nuvola\",\n    \"nuziale\",\n    \"oasi\",\n    \"obbedire\",\n    \"obbligo\",\n    \"obelisco\",\n    \"oblio\",\n    \"obolo\",\n    \"obsoleto\",\n    \"occasione\",\n    \"occhio\",\n    \"occidente\",\n    \"occorrere\",\n    \"occultare\",\n    \"ocra\",\n    \"oculato\",\n    \"odierno\",\n    \"odorare\",\n    \"offerta\",\n    \"offrire\",\n    \"offuscato\",\n    \"oggetto\",\n    \"oggi\",\n    \"ognuno\",\n    \"olandese\",\n    \"olfatto\",\n    \"oliato\",\n    \"oliva\",\n    \"ologramma\",\n    \"oltre\",\n    \"omaggio\",\n    \"ombelico\",\n    \"ombra\",\n    \"omega\",\n    \"omissione\",\n    \"ondoso\",\n    \"onere\",\n    \"onice\",\n    \"onnivoro\",\n    \"onorevole\",\n    \"onta\",\n    \"operato\",\n    \"opinione\",\n    \"opposto\",\n    \"oracolo\",\n    \"orafo\",\n    \"ordine\",\n    \"orecchino\",\n    \"orefice\",\n    \"orfano\",\n    \"organico\",\n    \"origine\",\n    \"orizzonte\",\n    \"orma\",\n    \"ormeggio\",\n    \"ornativo\",\n    \"orologio\",\n    \"orrendo\",\n    \"orribile\",\n    \"ortensia\",\n    \"ortica\",\n    \"orzata\",\n    \"orzo\",\n    \"osare\",\n    \"oscurare\",\n    \"osmosi\",\n    \"ospedale\",\n    \"ospite\",\n    \"ossa\",\n    \"ossidare\",\n    \"ostacolo\",\n    \"oste\",\n    \"otite\",\n    \"otre\",\n    \"ottagono\",\n    \"ottimo\",\n    \"ottobre\",\n    \"ovale\",\n    \"ovest\",\n    \"ovino\",\n    \"oviparo\",\n    \"ovocito\",\n    \"ovunque\",\n    \"ovviare\",\n    \"ozio\",\n    \"pacchetto\",\n    \"pace\",\n    \"pacifico\",\n    \"padella\",\n    \"padrone\",\n    \"paese\",\n    \"paga\",\n    \"pagina\",\n    \"palazzina\",\n    \"palesare\",\n    \"pallido\",\n    \"palo\",\n    \"palude\",\n    \"pandoro\",\n    \"pannello\",\n    \"paolo\",\n    \"paonazzo\",\n    \"paprica\",\n    \"parabola\",\n    \"parcella\",\n    \"parere\",\n    \"pargolo\",\n    \"pari\",\n    \"parlato\",\n    \"parola\",\n    \"partire\",\n    \"parvenza\",\n    \"parziale\",\n    \"passivo\",\n    \"pasticca\",\n    \"patacca\",\n    \"patologia\",\n    \"pattume\",\n    \"pavone\",\n    \"peccato\",\n    \"pedalare\",\n    \"pedonale\",\n    \"peggio\",\n    \"peloso\",\n    \"penare\",\n    \"pendice\",\n    \"penisola\",\n    \"pennuto\",\n    \"penombra\",\n    \"pensare\",\n    \"pentola\",\n    \"pepe\",\n    \"pepita\",\n    \"perbene\",\n    \"percorso\",\n    \"perdonato\",\n    \"perforare\",\n    \"pergamena\",\n    \"periodo\",\n    \"permesso\",\n    \"perno\",\n    \"perplesso\",\n    \"persuaso\",\n    \"pertugio\",\n    \"pervaso\",\n    \"pesatore\",\n    \"pesista\",\n    \"peso\",\n    \"pestifero\",\n    \"petalo\",\n    \"pettine\",\n    \"petulante\",\n    \"pezzo\",\n    \"piacere\",\n    \"pianta\",\n    \"piattino\",\n    \"piccino\",\n    \"picozza\",\n    \"piega\",\n    \"pietra\",\n    \"piffero\",\n    \"pigiama\",\n    \"pigolio\",\n    \"pigro\",\n    \"pila\",\n    \"pilifero\",\n    \"pillola\",\n    \"pilota\",\n    \"pimpante\",\n    \"pineta\",\n    \"pinna\",\n    \"pinolo\",\n    \"pioggia\",\n    \"piombo\",\n    \"piramide\",\n    \"piretico\",\n    \"pirite\",\n    \"pirolisi\",\n    \"pitone\",\n    \"pizzico\",\n    \"placebo\",\n    \"planare\",\n    \"plasma\",\n    \"platano\",\n    \"plenario\",\n    \"pochezza\",\n    \"poderoso\",\n    \"podismo\",\n    \"poesia\",\n    \"poggiare\",\n    \"polenta\",\n    \"poligono\",\n    \"pollice\",\n    \"polmonite\",\n    \"polpetta\",\n    \"polso\",\n    \"poltrona\",\n    \"polvere\",\n    \"pomice\",\n    \"pomodoro\",\n    \"ponte\",\n    \"popoloso\",\n    \"porfido\",\n    \"poroso\",\n    \"porpora\",\n    \"porre\",\n    \"portata\",\n    \"posa\",\n    \"positivo\",\n    \"possesso\",\n    \"postulato\",\n    \"potassio\",\n    \"potere\",\n    \"pranzo\",\n    \"prassi\",\n    \"pratica\",\n    \"precluso\",\n    \"predica\",\n    \"prefisso\",\n    \"pregiato\",\n    \"prelievo\",\n    \"premere\",\n    \"prenotare\",\n    \"preparato\",\n    \"presenza\",\n    \"pretesto\",\n    \"prevalso\",\n    \"prima\",\n    \"principe\",\n    \"privato\",\n    \"problema\",\n    \"procura\",\n    \"produrre\",\n    \"profumo\",\n    \"progetto\",\n    \"prolunga\",\n    \"promessa\",\n    \"pronome\",\n    \"proposta\",\n    \"proroga\",\n    \"proteso\",\n    \"prova\",\n    \"prudente\",\n    \"prugna\",\n    \"prurito\",\n    \"psiche\",\n    \"pubblico\",\n    \"pudica\",\n    \"pugilato\",\n    \"pugno\",\n    \"pulce\",\n    \"pulito\",\n    \"pulsante\",\n    \"puntare\",\n    \"pupazzo\",\n    \"pupilla\",\n    \"puro\",\n    \"quadro\",\n    \"qualcosa\",\n    \"quasi\",\n    \"querela\",\n    \"quota\",\n    \"raccolto\",\n    \"raddoppio\",\n    \"radicale\",\n    \"radunato\",\n    \"raffica\",\n    \"ragazzo\",\n    \"ragione\",\n    \"ragno\",\n    \"ramarro\",\n    \"ramingo\",\n    \"ramo\",\n    \"randagio\",\n    \"rantolare\",\n    \"rapato\",\n    \"rapina\",\n    \"rappreso\",\n    \"rasatura\",\n    \"raschiato\",\n    \"rasente\",\n    \"rassegna\",\n    \"rastrello\",\n    \"rata\",\n    \"ravveduto\",\n    \"reale\",\n    \"recepire\",\n    \"recinto\",\n    \"recluta\",\n    \"recondito\",\n    \"recupero\",\n    \"reddito\",\n    \"redimere\",\n    \"regalato\",\n    \"registro\",\n    \"regola\",\n    \"regresso\",\n    \"relazione\",\n    \"remare\",\n    \"remoto\",\n    \"renna\",\n    \"replica\",\n    \"reprimere\",\n    \"reputare\",\n    \"resa\",\n    \"residente\",\n    \"responso\",\n    \"restauro\",\n    \"rete\",\n    \"retina\",\n    \"retorica\",\n    \"rettifica\",\n    \"revocato\",\n    \"riassunto\",\n    \"ribadire\",\n    \"ribelle\",\n    \"ribrezzo\",\n    \"ricarica\",\n    \"ricco\",\n    \"ricevere\",\n    \"riciclato\",\n    \"ricordo\",\n    \"ricreduto\",\n    \"ridicolo\",\n    \"ridurre\",\n    \"rifasare\",\n    \"riflesso\",\n    \"riforma\",\n    \"rifugio\",\n    \"rigare\",\n    \"rigettato\",\n    \"righello\",\n    \"rilassato\",\n    \"rilevato\",\n    \"rimanere\",\n    \"rimbalzo\",\n    \"rimedio\",\n    \"rimorchio\",\n    \"rinascita\",\n    \"rincaro\",\n    \"rinforzo\",\n    \"rinnovo\",\n    \"rinomato\",\n    \"rinsavito\",\n    \"rintocco\",\n    \"rinuncia\",\n    \"rinvenire\",\n    \"riparato\",\n    \"ripetuto\",\n    \"ripieno\",\n    \"riportare\",\n    \"ripresa\",\n    \"ripulire\",\n    \"risata\",\n    \"rischio\",\n    \"riserva\",\n    \"risibile\",\n    \"riso\",\n    \"rispetto\",\n    \"ristoro\",\n    \"risultato\",\n    \"risvolto\",\n    \"ritardo\",\n    \"ritegno\",\n    \"ritmico\",\n    \"ritrovo\",\n    \"riunione\",\n    \"riva\",\n    \"riverso\",\n    \"rivincita\",\n    \"rivolto\",\n    \"rizoma\",\n    \"roba\",\n    \"robotico\",\n    \"robusto\",\n    \"roccia\",\n    \"roco\",\n    \"rodaggio\",\n    \"rodere\",\n    \"roditore\",\n    \"rogito\",\n    \"rollio\",\n    \"romantico\",\n    \"rompere\",\n    \"ronzio\",\n    \"rosolare\",\n    \"rospo\",\n    \"rotante\",\n    \"rotondo\",\n    \"rotula\",\n    \"rovescio\",\n    \"rubizzo\",\n    \"rubrica\",\n    \"ruga\",\n    \"rullino\",\n    \"rumine\",\n    \"rumoroso\",\n    \"ruolo\",\n    \"rupe\",\n    \"russare\",\n    \"rustico\",\n    \"sabato\",\n    \"sabbiare\",\n    \"sabotato\",\n    \"sagoma\",\n    \"salasso\",\n    \"saldatura\",\n    \"salgemma\",\n    \"salivare\",\n    \"salmone\",\n    \"salone\",\n    \"saltare\",\n    \"saluto\",\n    \"salvo\",\n    \"sapere\",\n    \"sapido\",\n    \"saporito\",\n    \"saraceno\",\n    \"sarcasmo\",\n    \"sarto\",\n    \"sassoso\",\n    \"satellite\",\n    \"satira\",\n    \"satollo\",\n    \"saturno\",\n    \"savana\",\n    \"savio\",\n    \"saziato\",\n    \"sbadiglio\",\n    \"sbalzo\",\n    \"sbancato\",\n    \"sbarra\",\n    \"sbattere\",\n    \"sbavare\",\n    \"sbendare\",\n    \"sbirciare\",\n    \"sbloccato\",\n    \"sbocciato\",\n    \"sbrinare\",\n    \"sbruffone\",\n    \"sbuffare\",\n    \"scabroso\",\n    \"scadenza\",\n    \"scala\",\n    \"scambiare\",\n    \"scandalo\",\n    \"scapola\",\n    \"scarso\",\n    \"scatenare\",\n    \"scavato\",\n    \"scelto\",\n    \"scenico\",\n    \"scettro\",\n    \"scheda\",\n    \"schiena\",\n    \"sciarpa\",\n    \"scienza\",\n    \"scindere\",\n    \"scippo\",\n    \"sciroppo\",\n    \"scivolo\",\n    \"sclerare\",\n    \"scodella\",\n    \"scolpito\",\n    \"scomparto\",\n    \"sconforto\",\n    \"scoprire\",\n    \"scorta\",\n    \"scossone\",\n    \"scozzese\",\n    \"scriba\",\n    \"scrollare\",\n    \"scrutinio\",\n    \"scuderia\",\n    \"scultore\",\n    \"scuola\",\n    \"scuro\",\n    \"scusare\",\n    \"sdebitare\",\n    \"sdoganare\",\n    \"seccatura\",\n    \"secondo\",\n    \"sedano\",\n    \"seggiola\",\n    \"segnalato\",\n    \"segregato\",\n    \"seguito\",\n    \"selciato\",\n    \"selettivo\",\n    \"sella\",\n    \"selvaggio\",\n    \"semaforo\",\n    \"sembrare\",\n    \"seme\",\n    \"seminato\",\n    \"sempre\",\n    \"senso\",\n    \"sentire\",\n    \"sepolto\",\n    \"sequenza\",\n    \"serata\",\n    \"serbato\",\n    \"sereno\",\n    \"serio\",\n    \"serpente\",\n    \"serraglio\",\n    \"servire\",\n    \"sestina\",\n    \"setola\",\n    \"settimana\",\n    \"sfacelo\",\n    \"sfaldare\",\n    \"sfamato\",\n    \"sfarzoso\",\n    \"sfaticato\",\n    \"sfera\",\n    \"sfida\",\n    \"sfilato\",\n    \"sfinge\",\n    \"sfocato\",\n    \"sfoderare\",\n    \"sfogo\",\n    \"sfoltire\",\n    \"sforzato\",\n    \"sfratto\",\n    \"sfruttato\",\n    \"sfuggito\",\n    \"sfumare\",\n    \"sfuso\",\n    \"sgabello\",\n    \"sgarbato\",\n    \"sgonfiare\",\n    \"sgorbio\",\n    \"sgrassato\",\n    \"sguardo\",\n    \"sibilo\",\n    \"siccome\",\n    \"sierra\",\n    \"sigla\",\n    \"signore\",\n    \"silenzio\",\n    \"sillaba\",\n    \"simbolo\",\n    \"simpatico\",\n    \"simulato\",\n    \"sinfonia\",\n    \"singolo\",\n    \"sinistro\",\n    \"sino\",\n    \"sintesi\",\n    \"sinusoide\",\n    \"sipario\",\n    \"sisma\",\n    \"sistole\",\n    \"situato\",\n    \"slitta\",\n    \"slogatura\",\n    \"sloveno\",\n    \"smarrito\",\n    \"smemorato\",\n    \"smentito\",\n    \"smeraldo\",\n    \"smilzo\",\n    \"smontare\",\n    \"smottato\",\n    \"smussato\",\n    \"snellire\",\n    \"snervato\",\n    \"snodo\",\n    \"sobbalzo\",\n    \"sobrio\",\n    \"soccorso\",\n    \"sociale\",\n    \"sodale\",\n    \"soffitto\",\n    \"sogno\",\n    \"soldato\",\n    \"solenne\",\n    \"solido\",\n    \"sollazzo\",\n    \"solo\",\n    \"solubile\",\n    \"solvente\",\n    \"somatico\",\n    \"somma\",\n    \"sonda\",\n    \"sonetto\",\n    \"sonnifero\",\n    \"sopire\",\n    \"soppeso\",\n    \"sopra\",\n    \"sorgere\",\n    \"sorpasso\",\n    \"sorriso\",\n    \"sorso\",\n    \"sorteggio\",\n    \"sorvolato\",\n    \"sospiro\",\n    \"sosta\",\n    \"sottile\",\n    \"spada\",\n    \"spalla\",\n    \"spargere\",\n    \"spatola\",\n    \"spavento\",\n    \"spazzola\",\n    \"specie\",\n    \"spedire\",\n    \"spegnere\",\n    \"spelatura\",\n    \"speranza\",\n    \"spessore\",\n    \"spettrale\",\n    \"spezzato\",\n    \"spia\",\n    \"spigoloso\",\n    \"spillato\",\n    \"spinoso\",\n    \"spirale\",\n    \"splendido\",\n    \"sportivo\",\n    \"sposo\",\n    \"spranga\",\n    \"sprecare\",\n    \"spronato\",\n    \"spruzzo\",\n    \"spuntino\",\n    \"squillo\",\n    \"sradicare\",\n    \"srotolato\",\n    \"stabile\",\n    \"stacco\",\n    \"staffa\",\n    \"stagnare\",\n    \"stampato\",\n    \"stantio\",\n    \"starnuto\",\n    \"stasera\",\n    \"statuto\",\n    \"stelo\",\n    \"steppa\",\n    \"sterzo\",\n    \"stiletto\",\n    \"stima\",\n    \"stirpe\",\n    \"stivale\",\n    \"stizzoso\",\n    \"stonato\",\n    \"storico\",\n    \"strappo\",\n    \"stregato\",\n    \"stridulo\",\n    \"strozzare\",\n    \"strutto\",\n    \"stuccare\",\n    \"stufo\",\n    \"stupendo\",\n    \"subentro\",\n    \"succoso\",\n    \"sudore\",\n    \"suggerito\",\n    \"sugo\",\n    \"sultano\",\n    \"suonare\",\n    \"superbo\",\n    \"supporto\",\n    \"surgelato\",\n    \"surrogato\",\n    \"sussurro\",\n    \"sutura\",\n    \"svagare\",\n    \"svedese\",\n    \"sveglio\",\n    \"svelare\",\n    \"svenuto\",\n    \"svezia\",\n    \"sviluppo\",\n    \"svista\",\n    \"svizzera\",\n    \"svolta\",\n    \"svuotare\",\n    \"tabacco\",\n    \"tabulato\",\n    \"tacciare\",\n    \"taciturno\",\n    \"tale\",\n    \"talismano\",\n    \"tampone\",\n    \"tannino\",\n    \"tara\",\n    \"tardivo\",\n    \"targato\",\n    \"tariffa\",\n    \"tarpare\",\n    \"tartaruga\",\n    \"tasto\",\n    \"tattico\",\n    \"taverna\",\n    \"tavolata\",\n    \"tazza\",\n    \"teca\",\n    \"tecnico\",\n    \"telefono\",\n    \"temerario\",\n    \"tempo\",\n    \"temuto\",\n    \"tendone\",\n    \"tenero\",\n    \"tensione\",\n    \"tentacolo\",\n    \"teorema\",\n    \"terme\",\n    \"terrazzo\",\n    \"terzetto\",\n    \"tesi\",\n    \"tesserato\",\n    \"testato\",\n    \"tetro\",\n    \"tettoia\",\n    \"tifare\",\n    \"tigella\",\n    \"timbro\",\n    \"tinto\",\n    \"tipico\",\n    \"tipografo\",\n    \"tiraggio\",\n    \"tiro\",\n    \"titanio\",\n    \"titolo\",\n    \"titubante\",\n    \"tizio\",\n    \"tizzone\",\n    \"toccare\",\n    \"tollerare\",\n    \"tolto\",\n    \"tombola\",\n    \"tomo\",\n    \"tonfo\",\n    \"tonsilla\",\n    \"topazio\",\n    \"topologia\",\n    \"toppa\",\n    \"torba\",\n    \"tornare\",\n    \"torrone\",\n    \"tortora\",\n    \"toscano\",\n    \"tossire\",\n    \"tostatura\",\n    \"totano\",\n    \"trabocco\",\n    \"trachea\",\n    \"trafila\",\n    \"tragedia\",\n    \"tralcio\",\n    \"tramonto\",\n    \"transito\",\n    \"trapano\",\n    \"trarre\",\n    \"trasloco\",\n    \"trattato\",\n    \"trave\",\n    \"treccia\",\n    \"tremolio\",\n    \"trespolo\",\n    \"tributo\",\n    \"tricheco\",\n    \"trifoglio\",\n    \"trillo\",\n    \"trincea\",\n    \"trio\",\n    \"tristezza\",\n    \"triturato\",\n    \"trivella\",\n    \"tromba\",\n    \"trono\",\n    \"troppo\",\n    \"trottola\",\n    \"trovare\",\n    \"truccato\",\n    \"tubatura\",\n    \"tuffato\",\n    \"tulipano\",\n    \"tumulto\",\n    \"tunisia\",\n    \"turbare\",\n    \"turchino\",\n    \"tuta\",\n    \"tutela\",\n    \"ubicato\",\n    \"uccello\",\n    \"uccisore\",\n    \"udire\",\n    \"uditivo\",\n    \"uffa\",\n    \"ufficio\",\n    \"uguale\",\n    \"ulisse\",\n    \"ultimato\",\n    \"umano\",\n    \"umile\",\n    \"umorismo\",\n    \"uncinetto\",\n    \"ungere\",\n    \"ungherese\",\n    \"unicorno\",\n    \"unificato\",\n    \"unisono\",\n    \"unitario\",\n    \"unte\",\n    \"uovo\",\n    \"upupa\",\n    \"uragano\",\n    \"urgenza\",\n    \"urlo\",\n    \"usanza\",\n    \"usato\",\n    \"uscito\",\n    \"usignolo\",\n    \"usuraio\",\n    \"utensile\",\n    \"utilizzo\",\n    \"utopia\",\n    \"vacante\",\n    \"vaccinato\",\n    \"vagabondo\",\n    \"vagliato\",\n    \"valanga\",\n    \"valgo\",\n    \"valico\",\n    \"valletta\",\n    \"valoroso\",\n    \"valutare\",\n    \"valvola\",\n    \"vampata\",\n    \"vangare\",\n    \"vanitoso\",\n    \"vano\",\n    \"vantaggio\",\n    \"vanvera\",\n    \"vapore\",\n    \"varano\",\n    \"varcato\",\n    \"variante\",\n    \"vasca\",\n    \"vedetta\",\n    \"vedova\",\n    \"veduto\",\n    \"vegetale\",\n    \"veicolo\",\n    \"velcro\",\n    \"velina\",\n    \"velluto\",\n    \"veloce\",\n    \"venato\",\n    \"vendemmia\",\n    \"vento\",\n    \"verace\",\n    \"verbale\",\n    \"vergogna\",\n    \"verifica\",\n    \"vero\",\n    \"verruca\",\n    \"verticale\",\n    \"vescica\",\n    \"vessillo\",\n    \"vestale\",\n    \"veterano\",\n    \"vetrina\",\n    \"vetusto\",\n    \"viandante\",\n    \"vibrante\",\n    \"vicenda\",\n    \"vichingo\",\n    \"vicinanza\",\n    \"vidimare\",\n    \"vigilia\",\n    \"vigneto\",\n    \"vigore\",\n    \"vile\",\n    \"villano\",\n    \"vimini\",\n    \"vincitore\",\n    \"viola\",\n    \"vipera\",\n    \"virgola\",\n    \"virologo\",\n    \"virulento\",\n    \"viscoso\",\n    \"visione\",\n    \"vispo\",\n    \"vissuto\",\n    \"visura\",\n    \"vita\",\n    \"vitello\",\n    \"vittima\",\n    \"vivanda\",\n    \"vivido\",\n    \"viziare\",\n    \"voce\",\n    \"voga\",\n    \"volatile\",\n    \"volere\",\n    \"volpe\",\n    \"voragine\",\n    \"vulcano\",\n    \"zampogna\",\n    \"zanna\",\n    \"zappato\",\n    \"zattera\",\n    \"zavorra\",\n    \"zefiro\",\n    \"zelante\",\n    \"zelo\",\n    \"zenzero\",\n    \"zerbino\",\n    \"zibetto\",\n    \"zinco\",\n    \"zircone\",\n    \"zitto\",\n    \"zolla\",\n    \"zotico\",\n    \"zucchero\",\n    \"zufolo\",\n    \"zulu\",\n    \"zuppa\"\n]\n[\n    \"あいこくしん\",\n    \"あいさつ\",\n    \"あいだ\",\n    \"あおぞら\",\n    \"あかちゃん\",\n    \"あきる\",\n    \"あけがた\",\n    \"あける\",\n    \"あこがれる\",\n    \"あさい\",\n    \"あさひ\",\n    \"あしあと\",\n    \"あじわう\",\n    \"あずかる\",\n    \"あずき\",\n    \"あそぶ\",\n    \"あたえる\",\n    \"あたためる\",\n    \"あたりまえ\",\n    \"あたる\",\n    \"あつい\",\n    \"あつかう\",\n    \"あっしゅく\",\n    \"あつまり\",\n    \"あつめる\",\n    \"あてな\",\n    \"あてはまる\",\n    \"あひる\",\n    \"あぶら\",\n    \"あぶる\",\n    \"あふれる\",\n    \"あまい\",\n    \"あまど\",\n    \"あまやかす\",\n    \"あまり\",\n    \"あみもの\",\n    \"あめりか\",\n    \"あやまる\",\n    \"あゆむ\",\n    \"あらいぐま\",\n    \"あらし\",\n    \"あらすじ\",\n    \"あらためる\",\n    \"あらゆる\",\n    \"あらわす\",\n    \"ありがとう\",\n    \"あわせる\",\n    \"あわてる\",\n    \"あんい\",\n    \"あんがい\",\n    \"あんこ\",\n    \"あんぜん\",\n    \"あんてい\",\n    \"あんない\",\n    \"あんまり\",\n    \"いいだす\",\n    \"いおん\",\n    \"いがい\",\n    \"いがく\",\n    \"いきおい\",\n    \"いきなり\",\n    \"いきもの\",\n    \"いきる\",\n    \"いくじ\",\n    \"いくぶん\",\n    \"いけばな\",\n    \"いけん\",\n    \"いこう\",\n    \"いこく\",\n    \"いこつ\",\n    \"いさましい\",\n    \"いさん\",\n    \"いしき\",\n    \"いじゅう\",\n    \"いじょう\",\n    \"いじわる\",\n    \"いずみ\",\n    \"いずれ\",\n    \"いせい\",\n    \"いせえび\",\n    \"いせかい\",\n    \"いせき\",\n    \"いぜん\",\n    \"いそうろう\",\n    \"いそがしい\",\n    \"いだい\",\n    \"いだく\",\n    \"いたずら\",\n    \"いたみ\",\n    \"いたりあ\",\n    \"いちおう\",\n    \"いちじ\",\n    \"いちど\",\n    \"いちば\",\n    \"いちぶ\",\n    \"いちりゅう\",\n    \"いつか\",\n    \"いっしゅん\",\n    \"いっせい\",\n    \"いっそう\",\n    \"いったん\",\n    \"いっち\",\n    \"いってい\",\n    \"いっぽう\",\n    \"いてざ\",\n    \"いてん\",\n    \"いどう\",\n    \"いとこ\",\n    \"いない\",\n    \"いなか\",\n    \"いねむり\",\n    \"いのち\",\n    \"いのる\",\n    \"いはつ\",\n    \"いばる\",\n    \"いはん\",\n    \"いびき\",\n    \"いひん\",\n    \"いふく\",\n    \"いへん\",\n    \"いほう\",\n    \"いみん\",\n    \"いもうと\",\n    \"いもたれ\",\n    \"いもり\",\n    \"いやがる\",\n    \"いやす\",\n    \"いよかん\",\n    \"いよく\",\n    \"いらい\",\n    \"いらすと\",\n    \"いりぐち\",\n    \"いりょう\",\n    \"いれい\",\n    \"いれもの\",\n    \"いれる\",\n    \"いろえんぴつ\",\n    \"いわい\",\n    \"いわう\",\n    \"いわかん\",\n    \"いわば\",\n    \"いわゆる\",\n    \"いんげんまめ\",\n    \"いんさつ\",\n    \"いんしょう\",\n    \"いんよう\",\n    \"うえき\",\n    \"うえる\",\n    \"うおざ\",\n    \"うがい\",\n    \"うかぶ\",\n    \"うかべる\",\n    \"うきわ\",\n    \"うくらいな\",\n    \"うくれれ\",\n    \"うけたまわる\",\n    \"うけつけ\",\n    \"うけとる\",\n    \"うけもつ\",\n    \"うける\",\n    \"うごかす\",\n    \"うごく\",\n    \"うこん\",\n    \"うさぎ\",\n    \"うしなう\",\n    \"うしろがみ\",\n    \"うすい\",\n    \"うすぎ\",\n    \"うすぐらい\",\n    \"うすめる\",\n    \"うせつ\",\n    \"うちあわせ\",\n    \"うちがわ\",\n    \"うちき\",\n    \"うちゅう\",\n    \"うっかり\",\n    \"うつくしい\",\n    \"うったえる\",\n    \"うつる\",\n    \"うどん\",\n    \"うなぎ\",\n    \"うなじ\",\n    \"うなずく\",\n    \"うなる\",\n    \"うねる\",\n    \"うのう\",\n    \"うぶげ\",\n    \"うぶごえ\",\n    \"うまれる\",\n    \"うめる\",\n    \"うもう\",\n    \"うやまう\",\n    \"うよく\",\n    \"うらがえす\",\n    \"うらぐち\",\n    \"うらない\",\n    \"うりあげ\",\n    \"うりきれ\",\n    \"うるさい\",\n    \"うれしい\",\n    \"うれゆき\",\n    \"うれる\",\n    \"うろこ\",\n    \"うわき\",\n    \"うわさ\",\n    \"うんこう\",\n    \"うんちん\",\n    \"うんてん\",\n    \"うんどう\",\n    \"えいえん\",\n    \"えいが\",\n    \"えいきょう\",\n    \"えいご\",\n    \"えいせい\",\n    \"えいぶん\",\n    \"えいよう\",\n    \"えいわ\",\n    \"えおり\",\n    \"えがお\",\n    \"えがく\",\n    \"えきたい\",\n    \"えくせる\",\n    \"えしゃく\",\n    \"えすて\",\n    \"えつらん\",\n    \"えのぐ\",\n    \"えほうまき\",\n    \"えほん\",\n    \"えまき\",\n    \"えもじ\",\n    \"えもの\",\n    \"えらい\",\n    \"えらぶ\",\n    \"えりあ\",\n    \"えんえん\",\n    \"えんかい\",\n    \"えんぎ\",\n    \"えんげき\",\n    \"えんしゅう\",\n    \"えんぜつ\",\n    \"えんそく\",\n    \"えんちょう\",\n    \"えんとつ\",\n    \"おいかける\",\n    \"おいこす\",\n    \"おいしい\",\n    \"おいつく\",\n    \"おうえん\",\n    \"おうさま\",\n    \"おうじ\",\n    \"おうせつ\",\n    \"おうたい\",\n    \"おうふく\",\n    \"おうべい\",\n    \"おうよう\",\n    \"おえる\",\n    \"おおい\",\n    \"おおう\",\n    \"おおどおり\",\n    \"おおや\",\n    \"おおよそ\",\n    \"おかえり\",\n    \"おかず\",\n    \"おがむ\",\n    \"おかわり\",\n    \"おぎなう\",\n    \"おきる\",\n    \"おくさま\",\n    \"おくじょう\",\n    \"おくりがな\",\n    \"おくる\",\n    \"おくれる\",\n    \"おこす\",\n    \"おこなう\",\n    \"おこる\",\n    \"おさえる\",\n    \"おさない\",\n    \"おさめる\",\n    \"おしいれ\",\n    \"おしえる\",\n    \"おじぎ\",\n    \"おじさん\",\n    \"おしゃれ\",\n    \"おそらく\",\n    \"おそわる\",\n    \"おたがい\",\n    \"おたく\",\n    \"おだやか\",\n    \"おちつく\",\n    \"おっと\",\n    \"おつり\",\n    \"おでかけ\",\n    \"おとしもの\",\n    \"おとなしい\",\n    \"おどり\",\n    \"おどろかす\",\n    \"おばさん\",\n    \"おまいり\",\n    \"おめでとう\",\n    \"おもいで\",\n    \"おもう\",\n    \"おもたい\",\n    \"おもちゃ\",\n    \"おやつ\",\n    \"おやゆび\",\n    \"およぼす\",\n    \"おらんだ\",\n    \"おろす\",\n    \"おんがく\",\n    \"おんけい\",\n    \"おんしゃ\",\n    \"おんせん\",\n    \"おんだん\",\n    \"おんちゅう\",\n    \"おんどけい\",\n    \"かあつ\",\n    \"かいが\",\n    \"がいき\",\n    \"がいけん\",\n    \"がいこう\",\n    \"かいさつ\",\n    \"かいしゃ\",\n    \"かいすいよく\",\n    \"かいぜん\",\n    \"かいぞうど\",\n    \"かいつう\",\n    \"かいてん\",\n    \"かいとう\",\n    \"かいふく\",\n    \"がいへき\",\n    \"かいほう\",\n    \"かいよう\",\n    \"がいらい\",\n    \"かいわ\",\n    \"かえる\",\n    \"かおり\",\n    \"かかえる\",\n    \"かがく\",\n    \"かがし\",\n    \"かがみ\",\n    \"かくご\",\n    \"かくとく\",\n    \"かざる\",\n    \"がぞう\",\n    \"かたい\",\n    \"かたち\",\n    \"がちょう\",\n    \"がっきゅう\",\n    \"がっこう\",\n    \"がっさん\",\n    \"がっしょう\",\n    \"かなざわし\",\n    \"かのう\",\n    \"がはく\",\n    \"かぶか\",\n    \"かほう\",\n    \"かほご\",\n    \"かまう\",\n    \"かまぼこ\",\n    \"かめれおん\",\n    \"かゆい\",\n    \"かようび\",\n    \"からい\",\n    \"かるい\",\n    \"かろう\",\n    \"かわく\",\n    \"かわら\",\n    \"がんか\",\n    \"かんけい\",\n    \"かんこう\",\n    \"かんしゃ\",\n    \"かんそう\",\n    \"かんたん\",\n    \"かんち\",\n    \"がんばる\",\n    \"きあい\",\n    \"きあつ\",\n    \"きいろ\",\n    \"ぎいん\",\n    \"きうい\",\n    \"きうん\",\n    \"きえる\",\n    \"きおう\",\n    \"きおく\",\n    \"きおち\",\n    \"きおん\",\n    \"きかい\",\n    \"きかく\",\n    \"きかんしゃ\",\n    \"ききて\",\n    \"きくばり\",\n    \"きくらげ\",\n    \"きけんせい\",\n    \"きこう\",\n    \"きこえる\",\n    \"きこく\",\n    \"きさい\",\n    \"きさく\",\n    \"きさま\",\n    \"きさらぎ\",\n    \"ぎじかがく\",\n    \"ぎしき\",\n    \"ぎじたいけん\",\n    \"ぎじにってい\",\n    \"ぎじゅつしゃ\",\n    \"きすう\",\n    \"きせい\",\n    \"きせき\",\n    \"きせつ\",\n    \"きそう\",\n    \"きぞく\",\n    \"きぞん\",\n    \"きたえる\",\n    \"きちょう\",\n    \"きつえん\",\n    \"ぎっちり\",\n    \"きつつき\",\n    \"きつね\",\n    \"きてい\",\n    \"きどう\",\n    \"きどく\",\n    \"きない\",\n    \"きなが\",\n    \"きなこ\",\n    \"きぬごし\",\n    \"きねん\",\n    \"きのう\",\n    \"きのした\",\n    \"きはく\",\n    \"きびしい\",\n    \"きひん\",\n    \"きふく\",\n    \"きぶん\",\n    \"きぼう\",\n    \"きほん\",\n    \"きまる\",\n    \"きみつ\",\n    \"きむずかしい\",\n    \"きめる\",\n    \"きもだめし\",\n    \"きもち\",\n    \"きもの\",\n    \"きゃく\",\n    \"きやく\",\n    \"ぎゅうにく\",\n    \"きよう\",\n    \"きょうりゅう\",\n    \"きらい\",\n    \"きらく\",\n    \"きりん\",\n    \"きれい\",\n    \"きれつ\",\n    \"きろく\",\n    \"ぎろん\",\n    \"きわめる\",\n    \"ぎんいろ\",\n    \"きんかくじ\",\n    \"きんじょ\",\n    \"きんようび\",\n    \"ぐあい\",\n    \"くいず\",\n    \"くうかん\",\n    \"くうき\",\n    \"くうぐん\",\n    \"くうこう\",\n    \"ぐうせい\",\n    \"くうそう\",\n    \"ぐうたら\",\n    \"くうふく\",\n    \"くうぼ\",\n    \"くかん\",\n    \"くきょう\",\n    \"くげん\",\n    \"ぐこう\",\n    \"くさい\",\n    \"くさき\",\n    \"くさばな\",\n    \"くさる\",\n    \"くしゃみ\",\n    \"くしょう\",\n    \"くすのき\",\n    \"くすりゆび\",\n    \"くせげ\",\n    \"くせん\",\n    \"ぐたいてき\",\n    \"くださる\",\n    \"くたびれる\",\n    \"くちこみ\",\n    \"くちさき\",\n    \"くつした\",\n    \"ぐっすり\",\n    \"くつろぐ\",\n    \"くとうてん\",\n    \"くどく\",\n    \"くなん\",\n    \"くねくね\",\n    \"くのう\",\n    \"くふう\",\n    \"くみあわせ\",\n    \"くみたてる\",\n    \"くめる\",\n    \"くやくしょ\",\n    \"くらす\",\n    \"くらべる\",\n    \"くるま\",\n    \"くれる\",\n    \"くろう\",\n    \"くわしい\",\n    \"ぐんかん\",\n    \"ぐんしょく\",\n    \"ぐんたい\",\n    \"ぐんて\",\n    \"けあな\",\n    \"けいかく\",\n    \"けいけん\",\n    \"けいこ\",\n    \"けいさつ\",\n    \"げいじゅつ\",\n    \"けいたい\",\n    \"げいのうじん\",\n    \"けいれき\",\n    \"けいろ\",\n    \"けおとす\",\n    \"けおりもの\",\n    \"げきか\",\n    \"げきげん\",\n    \"げきだん\",\n    \"げきちん\",\n    \"げきとつ\",\n    \"げきは\",\n    \"げきやく\",\n    \"げこう\",\n    \"げこくじょう\",\n    \"げざい\",\n    \"けさき\",\n    \"げざん\",\n    \"けしき\",\n    \"けしごむ\",\n    \"けしょう\",\n    \"げすと\",\n    \"けたば\",\n    \"けちゃっぷ\",\n    \"けちらす\",\n    \"けつあつ\",\n    \"けつい\",\n    \"けつえき\",\n    \"けっこん\",\n    \"けつじょ\",\n    \"けっせき\",\n    \"けってい\",\n    \"けつまつ\",\n    \"げつようび\",\n    \"げつれい\",\n    \"けつろん\",\n    \"げどく\",\n    \"けとばす\",\n    \"けとる\",\n    \"けなげ\",\n    \"けなす\",\n    \"けなみ\",\n    \"けぬき\",\n    \"げねつ\",\n    \"けねん\",\n    \"けはい\",\n    \"げひん\",\n    \"けぶかい\",\n    \"げぼく\",\n    \"けまり\",\n    \"けみかる\",\n    \"けむし\",\n    \"けむり\",\n    \"けもの\",\n    \"けらい\",\n    \"けろけろ\",\n    \"けわしい\",\n    \"けんい\",\n    \"けんえつ\",\n    \"けんお\",\n    \"けんか\",\n    \"げんき\",\n    \"けんげん\",\n    \"けんこう\",\n    \"けんさく\",\n    \"けんしゅう\",\n    \"けんすう\",\n    \"げんそう\",\n    \"けんちく\",\n    \"けんてい\",\n    \"けんとう\",\n    \"けんない\",\n    \"けんにん\",\n    \"げんぶつ\",\n    \"けんま\",\n    \"けんみん\",\n    \"けんめい\",\n    \"けんらん\",\n    \"けんり\",\n    \"こあくま\",\n    \"こいぬ\",\n    \"こいびと\",\n    \"ごうい\",\n    \"こうえん\",\n    \"こうおん\",\n    \"こうかん\",\n    \"ごうきゅう\",\n    \"ごうけい\",\n    \"こうこう\",\n    \"こうさい\",\n    \"こうじ\",\n    \"こうすい\",\n    \"ごうせい\",\n    \"こうそく\",\n    \"こうたい\",\n    \"こうちゃ\",\n    \"こうつう\",\n    \"こうてい\",\n    \"こうどう\",\n    \"こうない\",\n    \"こうはい\",\n    \"ごうほう\",\n    \"ごうまん\",\n    \"こうもく\",\n    \"こうりつ\",\n    \"こえる\",\n    \"こおり\",\n    \"ごかい\",\n    \"ごがつ\",\n    \"ごかん\",\n    \"こくご\",\n    \"こくさい\",\n    \"こくとう\",\n    \"こくない\",\n    \"こくはく\",\n    \"こぐま\",\n    \"こけい\",\n    \"こける\",\n    \"ここのか\",\n    \"こころ\",\n    \"こさめ\",\n    \"こしつ\",\n    \"こすう\",\n    \"こせい\",\n    \"こせき\",\n    \"こぜん\",\n    \"こそだて\",\n    \"こたい\",\n    \"こたえる\",\n    \"こたつ\",\n    \"こちょう\",\n    \"こっか\",\n    \"こつこつ\",\n    \"こつばん\",\n    \"こつぶ\",\n    \"こてい\",\n    \"こてん\",\n    \"ことがら\",\n    \"ことし\",\n    \"ことば\",\n    \"ことり\",\n    \"こなごな\",\n    \"こねこね\",\n    \"このまま\",\n    \"このみ\",\n    \"このよ\",\n    \"ごはん\",\n    \"こひつじ\",\n    \"こふう\",\n    \"こふん\",\n    \"こぼれる\",\n    \"ごまあぶら\",\n    \"こまかい\",\n    \"ごますり\",\n    \"こまつな\",\n    \"こまる\",\n    \"こむぎこ\",\n    \"こもじ\",\n    \"こもち\",\n    \"こもの\",\n    \"こもん\",\n    \"こやく\",\n    \"こやま\",\n    \"こゆう\",\n    \"こゆび\",\n    \"こよい\",\n    \"こよう\",\n    \"こりる\",\n    \"これくしょん\",\n    \"ころっけ\",\n    \"こわもて\",\n    \"こわれる\",\n    \"こんいん\",\n    \"こんかい\",\n    \"こんき\",\n    \"こんしゅう\",\n    \"こんすい\",\n    \"こんだて\",\n    \"こんとん\",\n    \"こんなん\",\n    \"こんびに\",\n    \"こんぽん\",\n    \"こんまけ\",\n    \"こんや\",\n    \"こんれい\",\n    \"こんわく\",\n    \"ざいえき\",\n    \"さいかい\",\n    \"さいきん\",\n    \"ざいげん\",\n    \"ざいこ\",\n    \"さいしょ\",\n    \"さいせい\",\n    \"ざいたく\",\n    \"ざいちゅう\",\n    \"さいてき\",\n    \"ざいりょう\",\n    \"さうな\",\n    \"さかいし\",\n    \"さがす\",\n    \"さかな\",\n    \"さかみち\",\n    \"さがる\",\n    \"さぎょう\",\n    \"さくし\",\n    \"さくひん\",\n    \"さくら\",\n    \"さこく\",\n    \"さこつ\",\n    \"さずかる\",\n    \"ざせき\",\n    \"さたん\",\n    \"さつえい\",\n    \"ざつおん\",\n    \"ざっか\",\n    \"ざつがく\",\n    \"さっきょく\",\n    \"ざっし\",\n    \"さつじん\",\n    \"ざっそう\",\n    \"さつたば\",\n    \"さつまいも\",\n    \"さてい\",\n    \"さといも\",\n    \"さとう\",\n    \"さとおや\",\n    \"さとし\",\n    \"さとる\",\n    \"さのう\",\n    \"さばく\",\n    \"さびしい\",\n    \"さべつ\",\n    \"さほう\",\n    \"さほど\",\n    \"さます\",\n    \"さみしい\",\n    \"さみだれ\",\n    \"さむけ\",\n    \"さめる\",\n    \"さやえんどう\",\n    \"さゆう\",\n    \"さよう\",\n    \"さよく\",\n    \"さらだ\",\n    \"ざるそば\",\n    \"さわやか\",\n    \"さわる\",\n    \"さんいん\",\n    \"さんか\",\n    \"さんきゃく\",\n    \"さんこう\",\n    \"さんさい\",\n    \"ざんしょ\",\n    \"さんすう\",\n    \"さんせい\",\n    \"さんそ\",\n    \"さんち\",\n    \"さんま\",\n    \"さんみ\",\n    \"さんらん\",\n    \"しあい\",\n    \"しあげ\",\n    \"しあさって\",\n    \"しあわせ\",\n    \"しいく\",\n    \"しいん\",\n    \"しうち\",\n    \"しえい\",\n    \"しおけ\",\n    \"しかい\",\n    \"しかく\",\n    \"じかん\",\n    \"しごと\",\n    \"しすう\",\n    \"じだい\",\n    \"したうけ\",\n    \"したぎ\",\n    \"したて\",\n    \"したみ\",\n    \"しちょう\",\n    \"しちりん\",\n    \"しっかり\",\n    \"しつじ\",\n    \"しつもん\",\n    \"してい\",\n    \"してき\",\n    \"してつ\",\n    \"じてん\",\n    \"じどう\",\n    \"しなぎれ\",\n    \"しなもの\",\n    \"しなん\",\n    \"しねま\",\n    \"しねん\",\n    \"しのぐ\",\n    \"しのぶ\",\n    \"しはい\",\n    \"しばかり\",\n    \"しはつ\",\n    \"しはらい\",\n    \"しはん\",\n    \"しひょう\",\n    \"しふく\",\n    \"じぶん\",\n    \"しへい\",\n    \"しほう\",\n    \"しほん\",\n    \"しまう\",\n    \"しまる\",\n    \"しみん\",\n    \"しむける\",\n    \"じむしょ\",\n    \"しめい\",\n    \"しめる\",\n    \"しもん\",\n    \"しゃいん\",\n    \"しゃうん\",\n    \"しゃおん\",\n    \"じゃがいも\",\n    \"しやくしょ\",\n    \"しゃくほう\",\n    \"しゃけん\",\n    \"しゃこ\",\n    \"しゃざい\",\n    \"しゃしん\",\n    \"しゃせん\",\n    \"しゃそう\",\n    \"しゃたい\",\n    \"しゃちょう\",\n    \"しゃっきん\",\n    \"じゃま\",\n    \"しゃりん\",\n    \"しゃれい\",\n    \"じゆう\",\n    \"じゅうしょ\",\n    \"しゅくはく\",\n    \"じゅしん\",\n    \"しゅっせき\",\n    \"しゅみ\",\n    \"しゅらば\",\n    \"じゅんばん\",\n    \"しょうかい\",\n    \"しょくたく\",\n    \"しょっけん\",\n    \"しょどう\",\n    \"しょもつ\",\n    \"しらせる\",\n    \"しらべる\",\n    \"しんか\",\n    \"しんこう\",\n    \"じんじゃ\",\n    \"しんせいじ\",\n    \"しんちく\",\n    \"しんりん\",\n    \"すあげ\",\n    \"すあし\",\n    \"すあな\",\n    \"ずあん\",\n    \"すいえい\",\n    \"すいか\",\n    \"すいとう\",\n    \"ずいぶん\",\n    \"すいようび\",\n    \"すうがく\",\n    \"すうじつ\",\n    \"すうせん\",\n    \"すおどり\",\n    \"すきま\",\n    \"すくう\",\n    \"すくない\",\n    \"すける\",\n    \"すごい\",\n    \"すこし\",\n    \"ずさん\",\n    \"すずしい\",\n    \"すすむ\",\n    \"すすめる\",\n    \"すっかり\",\n    \"ずっしり\",\n    \"ずっと\",\n    \"すてき\",\n    \"すてる\",\n    \"すねる\",\n    \"すのこ\",\n    \"すはだ\",\n    \"すばらしい\",\n    \"ずひょう\",\n    \"ずぶぬれ\",\n    \"すぶり\",\n    \"すふれ\",\n    \"すべて\",\n    \"すべる\",\n    \"ずほう\",\n    \"すぼん\",\n    \"すまい\",\n    \"すめし\",\n    \"すもう\",\n    \"すやき\",\n    \"すらすら\",\n    \"するめ\",\n    \"すれちがう\",\n    \"すろっと\",\n    \"すわる\",\n    \"すんぜん\",\n    \"すんぽう\",\n    \"せあぶら\",\n    \"せいかつ\",\n    \"せいげん\",\n    \"せいじ\",\n    \"せいよう\",\n    \"せおう\",\n    \"せかいかん\",\n    \"せきにん\",\n    \"せきむ\",\n    \"せきゆ\",\n    \"せきらんうん\",\n    \"せけん\",\n    \"せこう\",\n    \"せすじ\",\n    \"せたい\",\n    \"せたけ\",\n    \"せっかく\",\n    \"せっきゃく\",\n    \"ぜっく\",\n    \"せっけん\",\n    \"せっこつ\",\n    \"せっさたくま\",\n    \"せつぞく\",\n    \"せつだん\",\n    \"せつでん\",\n    \"せっぱん\",\n    \"せつび\",\n    \"せつぶん\",\n    \"せつめい\",\n    \"せつりつ\",\n    \"せなか\",\n    \"せのび\",\n    \"せはば\",\n    \"せびろ\",\n    \"せぼね\",\n    \"せまい\",\n    \"せまる\",\n    \"せめる\",\n    \"せもたれ\",\n    \"せりふ\",\n    \"ぜんあく\",\n    \"せんい\",\n    \"せんえい\",\n    \"せんか\",\n    \"せんきょ\",\n    \"せんく\",\n    \"せんげん\",\n    \"ぜんご\",\n    \"せんさい\",\n    \"せんしゅ\",\n    \"せんすい\",\n    \"せんせい\",\n    \"せんぞ\",\n    \"せんたく\",\n    \"せんちょう\",\n    \"せんてい\",\n    \"せんとう\",\n    \"せんぬき\",\n    \"せんねん\",\n    \"せんぱい\",\n    \"ぜんぶ\",\n    \"ぜんぽう\",\n    \"せんむ\",\n    \"せんめんじょ\",\n    \"せんもん\",\n    \"せんやく\",\n    \"せんゆう\",\n    \"せんよう\",\n    \"ぜんら\",\n    \"ぜんりゃく\",\n    \"せんれい\",\n    \"せんろ\",\n    \"そあく\",\n    \"そいとげる\",\n    \"そいね\",\n    \"そうがんきょう\",\n    \"そうき\",\n    \"そうご\",\n    \"そうしん\",\n    \"そうだん\",\n    \"そうなん\",\n    \"そうび\",\n    \"そうめん\",\n    \"そうり\",\n    \"そえもの\",\n    \"そえん\",\n    \"そがい\",\n    \"そげき\",\n    \"そこう\",\n    \"そこそこ\",\n    \"そざい\",\n    \"そしな\",\n    \"そせい\",\n    \"そせん\",\n    \"そそぐ\",\n    \"そだてる\",\n    \"そつう\",\n    \"そつえん\",\n    \"そっかん\",\n    \"そつぎょう\",\n    \"そっけつ\",\n    \"そっこう\",\n    \"そっせん\",\n    \"そっと\",\n    \"そとがわ\",\n    \"そとづら\",\n    \"そなえる\",\n    \"そなた\",\n    \"そふぼ\",\n    \"そぼく\",\n    \"そぼろ\",\n    \"そまつ\",\n    \"そまる\",\n    \"そむく\",\n    \"そむりえ\",\n    \"そめる\",\n    \"そもそも\",\n    \"そよかぜ\",\n    \"そらまめ\",\n    \"そろう\",\n    \"そんかい\",\n    \"そんけい\",\n    \"そんざい\",\n    \"そんしつ\",\n    \"そんぞく\",\n    \"そんちょう\",\n    \"ぞんび\",\n    \"ぞんぶん\",\n    \"そんみん\",\n    \"たあい\",\n    \"たいいん\",\n    \"たいうん\",\n    \"たいえき\",\n    \"たいおう\",\n    \"だいがく\",\n    \"たいき\",\n    \"たいぐう\",\n    \"たいけん\",\n    \"たいこ\",\n    \"たいざい\",\n    \"だいじょうぶ\",\n    \"だいすき\",\n    \"たいせつ\",\n    \"たいそう\",\n    \"だいたい\",\n    \"たいちょう\",\n    \"たいてい\",\n    \"だいどころ\",\n    \"たいない\",\n    \"たいねつ\",\n    \"たいのう\",\n    \"たいはん\",\n    \"だいひょう\",\n    \"たいふう\",\n    \"たいへん\",\n    \"たいほ\",\n    \"たいまつばな\",\n    \"たいみんぐ\",\n    \"たいむ\",\n    \"たいめん\",\n    \"たいやき\",\n    \"たいよう\",\n    \"たいら\",\n    \"たいりょく\",\n    \"たいる\",\n    \"たいわん\",\n    \"たうえ\",\n    \"たえる\",\n    \"たおす\",\n    \"たおる\",\n    \"たおれる\",\n    \"たかい\",\n    \"たかね\",\n    \"たきび\",\n    \"たくさん\",\n    \"たこく\",\n    \"たこやき\",\n    \"たさい\",\n    \"たしざん\",\n    \"だじゃれ\",\n    \"たすける\",\n    \"たずさわる\",\n    \"たそがれ\",\n    \"たたかう\",\n    \"たたく\",\n    \"ただしい\",\n    \"たたみ\",\n    \"たちばな\",\n    \"だっかい\",\n    \"だっきゃく\",\n    \"だっこ\",\n    \"だっしゅつ\",\n    \"だったい\",\n    \"たてる\",\n    \"たとえる\",\n    \"たなばた\",\n    \"たにん\",\n    \"たぬき\",\n    \"たのしみ\",\n    \"たはつ\",\n    \"たぶん\",\n    \"たべる\",\n    \"たぼう\",\n    \"たまご\",\n    \"たまる\",\n    \"だむる\",\n    \"ためいき\",\n    \"ためす\",\n    \"ためる\",\n    \"たもつ\",\n    \"たやすい\",\n    \"たよる\",\n    \"たらす\",\n    \"たりきほんがん\",\n    \"たりょう\",\n    \"たりる\",\n    \"たると\",\n    \"たれる\",\n    \"たれんと\",\n    \"たろっと\",\n    \"たわむれる\",\n    \"だんあつ\",\n    \"たんい\",\n    \"たんおん\",\n    \"たんか\",\n    \"たんき\",\n    \"たんけん\",\n    \"たんご\",\n    \"たんさん\",\n    \"たんじょうび\",\n    \"だんせい\",\n    \"たんそく\",\n    \"たんたい\",\n    \"だんち\",\n    \"たんてい\",\n    \"たんとう\",\n    \"だんな\",\n    \"たんにん\",\n    \"だんねつ\",\n    \"たんのう\",\n    \"たんぴん\",\n    \"だんぼう\",\n    \"たんまつ\",\n    \"たんめい\",\n    \"だんれつ\",\n    \"だんろ\",\n    \"だんわ\",\n    \"ちあい\",\n    \"ちあん\",\n    \"ちいき\",\n    \"ちいさい\",\n    \"ちえん\",\n    \"ちかい\",\n    \"ちから\",\n    \"ちきゅう\",\n    \"ちきん\",\n    \"ちけいず\",\n    \"ちけん\",\n    \"ちこく\",\n    \"ちさい\",\n    \"ちしき\",\n    \"ちしりょう\",\n    \"ちせい\",\n    \"ちそう\",\n    \"ちたい\",\n    \"ちたん\",\n    \"ちちおや\",\n    \"ちつじょ\",\n    \"ちてき\",\n    \"ちてん\",\n    \"ちぬき\",\n    \"ちぬり\",\n    \"ちのう\",\n    \"ちひょう\",\n    \"ちへいせん\",\n    \"ちほう\",\n    \"ちまた\",\n    \"ちみつ\",\n    \"ちみどろ\",\n    \"ちめいど\",\n    \"ちゃんこなべ\",\n    \"ちゅうい\",\n    \"ちゆりょく\",\n    \"ちょうし\",\n    \"ちょさくけん\",\n    \"ちらし\",\n    \"ちらみ\",\n    \"ちりがみ\",\n    \"ちりょう\",\n    \"ちるど\",\n    \"ちわわ\",\n    \"ちんたい\",\n    \"ちんもく\",\n    \"ついか\",\n    \"ついたち\",\n    \"つうか\",\n    \"つうじょう\",\n    \"つうはん\",\n    \"つうわ\",\n    \"つかう\",\n    \"つかれる\",\n    \"つくね\",\n    \"つくる\",\n    \"つけね\",\n    \"つける\",\n    \"つごう\",\n    \"つたえる\",\n    \"つづく\",\n    \"つつじ\",\n    \"つつむ\",\n    \"つとめる\",\n    \"つながる\",\n    \"つなみ\",\n    \"つねづね\",\n    \"つのる\",\n    \"つぶす\",\n    \"つまらない\",\n    \"つまる\",\n    \"つみき\",\n    \"つめたい\",\n    \"つもり\",\n    \"つもる\",\n    \"つよい\",\n    \"つるぼ\",\n    \"つるみく\",\n    \"つわもの\",\n    \"つわり\",\n    \"てあし\",\n    \"てあて\",\n    \"てあみ\",\n    \"ていおん\",\n    \"ていか\",\n    \"ていき\",\n    \"ていけい\",\n    \"ていこく\",\n    \"ていさつ\",\n    \"ていし\",\n    \"ていせい\",\n    \"ていたい\",\n    \"ていど\",\n    \"ていねい\",\n    \"ていひょう\",\n    \"ていへん\",\n    \"ていぼう\",\n    \"てうち\",\n    \"ておくれ\",\n    \"てきとう\",\n    \"てくび\",\n    \"でこぼこ\",\n    \"てさぎょう\",\n    \"てさげ\",\n    \"てすり\",\n    \"てそう\",\n    \"てちがい\",\n    \"てちょう\",\n    \"てつがく\",\n    \"てつづき\",\n    \"でっぱ\",\n    \"てつぼう\",\n    \"てつや\",\n    \"でぬかえ\",\n    \"てぬき\",\n    \"てぬぐい\",\n    \"てのひら\",\n    \"てはい\",\n    \"てぶくろ\",\n    \"てふだ\",\n    \"てほどき\",\n    \"てほん\",\n    \"てまえ\",\n    \"てまきずし\",\n    \"てみじか\",\n    \"てみやげ\",\n    \"てらす\",\n    \"てれび\",\n    \"てわけ\",\n    \"てわたし\",\n    \"でんあつ\",\n    \"てんいん\",\n    \"てんかい\",\n    \"てんき\",\n    \"てんぐ\",\n    \"てんけん\",\n    \"てんごく\",\n    \"てんさい\",\n    \"てんし\",\n    \"てんすう\",\n    \"でんち\",\n    \"てんてき\",\n    \"てんとう\",\n    \"てんない\",\n    \"てんぷら\",\n    \"てんぼうだい\",\n    \"てんめつ\",\n    \"てんらんかい\",\n    \"でんりょく\",\n    \"でんわ\",\n    \"どあい\",\n    \"といれ\",\n    \"どうかん\",\n    \"とうきゅう\",\n    \"どうぐ\",\n    \"とうし\",\n    \"とうむぎ\",\n    \"とおい\",\n    \"とおか\",\n    \"とおく\",\n    \"とおす\",\n    \"とおる\",\n    \"とかい\",\n    \"とかす\",\n    \"ときおり\",\n    \"ときどき\",\n    \"とくい\",\n    \"とくしゅう\",\n    \"とくてん\",\n    \"とくに\",\n    \"とくべつ\",\n    \"とけい\",\n    \"とける\",\n    \"とこや\",\n    \"とさか\",\n    \"としょかん\",\n    \"とそう\",\n    \"とたん\",\n    \"とちゅう\",\n    \"とっきゅう\",\n    \"とっくん\",\n    \"とつぜん\",\n    \"とつにゅう\",\n    \"とどける\",\n    \"ととのえる\",\n    \"とない\",\n    \"となえる\",\n    \"となり\",\n    \"とのさま\",\n    \"とばす\",\n    \"どぶがわ\",\n    \"とほう\",\n    \"とまる\",\n    \"とめる\",\n    \"ともだち\",\n    \"ともる\",\n    \"どようび\",\n    \"とらえる\",\n    \"とんかつ\",\n    \"どんぶり\",\n    \"ないかく\",\n    \"ないこう\",\n    \"ないしょ\",\n    \"ないす\",\n    \"ないせん\",\n    \"ないそう\",\n    \"なおす\",\n    \"ながい\",\n    \"なくす\",\n    \"なげる\",\n    \"なこうど\",\n    \"なさけ\",\n    \"なたでここ\",\n    \"なっとう\",\n    \"なつやすみ\",\n    \"ななおし\",\n    \"なにごと\",\n    \"なにもの\",\n    \"なにわ\",\n    \"なのか\",\n    \"なふだ\",\n    \"なまいき\",\n    \"なまえ\",\n    \"なまみ\",\n    \"なみだ\",\n    \"なめらか\",\n    \"なめる\",\n    \"なやむ\",\n    \"ならう\",\n    \"ならび\",\n    \"ならぶ\",\n    \"なれる\",\n    \"なわとび\",\n    \"なわばり\",\n    \"にあう\",\n    \"にいがた\",\n    \"にうけ\",\n    \"におい\",\n    \"にかい\",\n    \"にがて\",\n    \"にきび\",\n    \"にくしみ\",\n    \"にくまん\",\n    \"にげる\",\n    \"にさんかたんそ\",\n    \"にしき\",\n    \"にせもの\",\n    \"にちじょう\",\n    \"にちようび\",\n    \"にっか\",\n    \"にっき\",\n    \"にっけい\",\n    \"にっこう\",\n    \"にっさん\",\n    \"にっしょく\",\n    \"にっすう\",\n    \"にっせき\",\n    \"にってい\",\n    \"になう\",\n    \"にほん\",\n    \"にまめ\",\n    \"にもつ\",\n    \"にやり\",\n    \"にゅういん\",\n    \"にりんしゃ\",\n    \"にわとり\",\n    \"にんい\",\n    \"にんか\",\n    \"にんき\",\n    \"にんげん\",\n    \"にんしき\",\n    \"にんずう\",\n    \"にんそう\",\n    \"にんたい\",\n    \"にんち\",\n    \"にんてい\",\n    \"にんにく\",\n    \"にんぷ\",\n    \"にんまり\",\n    \"にんむ\",\n    \"にんめい\",\n    \"にんよう\",\n    \"ぬいくぎ\",\n    \"ぬかす\",\n    \"ぬぐいとる\",\n    \"ぬぐう\",\n    \"ぬくもり\",\n    \"ぬすむ\",\n    \"ぬまえび\",\n    \"ぬめり\",\n    \"ぬらす\",\n    \"ぬんちゃく\",\n    \"ねあげ\",\n    \"ねいき\",\n    \"ねいる\",\n    \"ねいろ\",\n    \"ねぐせ\",\n    \"ねくたい\",\n    \"ねくら\",\n    \"ねこぜ\",\n    \"ねこむ\",\n    \"ねさげ\",\n    \"ねすごす\",\n    \"ねそべる\",\n    \"ねだん\",\n    \"ねつい\",\n    \"ねっしん\",\n    \"ねつぞう\",\n    \"ねったいぎょ\",\n    \"ねぶそく\",\n    \"ねふだ\",\n    \"ねぼう\",\n    \"ねほりはほり\",\n    \"ねまき\",\n    \"ねまわし\",\n    \"ねみみ\",\n    \"ねむい\",\n    \"ねむたい\",\n    \"ねもと\",\n    \"ねらう\",\n    \"ねわざ\",\n    \"ねんいり\",\n    \"ねんおし\",\n    \"ねんかん\",\n    \"ねんきん\",\n    \"ねんぐ\",\n    \"ねんざ\",\n    \"ねんし\",\n    \"ねんちゃく\",\n    \"ねんど\",\n    \"ねんぴ\",\n    \"ねんぶつ\",\n    \"ねんまつ\",\n    \"ねんりょう\",\n    \"ねんれい\",\n    \"のいず\",\n    \"のおづま\",\n    \"のがす\",\n    \"のきなみ\",\n    \"のこぎり\",\n    \"のこす\",\n    \"のこる\",\n    \"のせる\",\n    \"のぞく\",\n    \"のぞむ\",\n    \"のたまう\",\n    \"のちほど\",\n    \"のっく\",\n    \"のばす\",\n    \"のはら\",\n    \"のべる\",\n    \"のぼる\",\n    \"のみもの\",\n    \"のやま\",\n    \"のらいぬ\",\n    \"のらねこ\",\n    \"のりもの\",\n    \"のりゆき\",\n    \"のれん\",\n    \"のんき\",\n    \"ばあい\",\n    \"はあく\",\n    \"ばあさん\",\n    \"ばいか\",\n    \"ばいく\",\n    \"はいけん\",\n    \"はいご\",\n    \"はいしん\",\n    \"はいすい\",\n    \"はいせん\",\n    \"はいそう\",\n    \"はいち\",\n    \"ばいばい\",\n    \"はいれつ\",\n    \"はえる\",\n    \"はおる\",\n    \"はかい\",\n    \"ばかり\",\n    \"はかる\",\n    \"はくしゅ\",\n    \"はけん\",\n    \"はこぶ\",\n    \"はさみ\",\n    \"はさん\",\n    \"はしご\",\n    \"ばしょ\",\n    \"はしる\",\n    \"はせる\",\n    \"ぱそこん\",\n    \"はそん\",\n    \"はたん\",\n    \"はちみつ\",\n    \"はつおん\",\n    \"はっかく\",\n    \"はづき\",\n    \"はっきり\",\n    \"はっくつ\",\n    \"はっけん\",\n    \"はっこう\",\n    \"はっさん\",\n    \"はっしん\",\n    \"はったつ\",\n    \"はっちゅう\",\n    \"はってん\",\n    \"はっぴょう\",\n    \"はっぽう\",\n    \"はなす\",\n    \"はなび\",\n    \"はにかむ\",\n    \"はぶらし\",\n    \"はみがき\",\n    \"はむかう\",\n    \"はめつ\",\n    \"はやい\",\n    \"はやし\",\n    \"はらう\",\n    \"はろうぃん\",\n    \"はわい\",\n    \"はんい\",\n    \"はんえい\",\n    \"はんおん\",\n    \"はんかく\",\n    \"はんきょう\",\n    \"ばんぐみ\",\n    \"はんこ\",\n    \"はんしゃ\",\n    \"はんすう\",\n    \"はんだん\",\n    \"ぱんち\",\n    \"ぱんつ\",\n    \"はんてい\",\n    \"はんとし\",\n    \"はんのう\",\n    \"はんぱ\",\n    \"はんぶん\",\n    \"はんぺん\",\n    \"はんぼうき\",\n    \"はんめい\",\n    \"はんらん\",\n    \"はんろん\",\n    \"ひいき\",\n    \"ひうん\",\n    \"ひえる\",\n    \"ひかく\",\n    \"ひかり\",\n    \"ひかる\",\n    \"ひかん\",\n    \"ひくい\",\n    \"ひけつ\",\n    \"ひこうき\",\n    \"ひこく\",\n    \"ひさい\",\n    \"ひさしぶり\",\n    \"ひさん\",\n    \"びじゅつかん\",\n    \"ひしょ\",\n    \"ひそか\",\n    \"ひそむ\",\n    \"ひたむき\",\n    \"ひだり\",\n    \"ひたる\",\n    \"ひつぎ\",\n    \"ひっこし\",\n    \"ひっし\",\n    \"ひつじゅひん\",\n    \"ひっす\",\n    \"ひつぜん\",\n    \"ぴったり\",\n    \"ぴっちり\",\n    \"ひつよう\",\n    \"ひてい\",\n    \"ひとごみ\",\n    \"ひなまつり\",\n    \"ひなん\",\n    \"ひねる\",\n    \"ひはん\",\n    \"ひびく\",\n    \"ひひょう\",\n    \"ひほう\",\n    \"ひまわり\",\n    \"ひまん\",\n    \"ひみつ\",\n    \"ひめい\",\n    \"ひめじし\",\n    \"ひやけ\",\n    \"ひやす\",\n    \"ひよう\",\n    \"びょうき\",\n    \"ひらがな\",\n    \"ひらく\",\n    \"ひりつ\",\n    \"ひりょう\",\n    \"ひるま\",\n    \"ひるやすみ\",\n    \"ひれい\",\n    \"ひろい\",\n    \"ひろう\",\n    \"ひろき\",\n    \"ひろゆき\",\n    \"ひんかく\",\n    \"ひんけつ\",\n    \"ひんこん\",\n    \"ひんしゅ\",\n    \"ひんそう\",\n    \"ぴんち\",\n    \"ひんぱん\",\n    \"びんぼう\",\n    \"ふあん\",\n    \"ふいうち\",\n    \"ふうけい\",\n    \"ふうせん\",\n    \"ぷうたろう\",\n    \"ふうとう\",\n    \"ふうふ\",\n    \"ふえる\",\n    \"ふおん\",\n    \"ふかい\",\n    \"ふきん\",\n    \"ふくざつ\",\n    \"ふくぶくろ\",\n    \"ふこう\",\n    \"ふさい\",\n    \"ふしぎ\",\n    \"ふじみ\",\n    \"ふすま\",\n    \"ふせい\",\n    \"ふせぐ\",\n    \"ふそく\",\n    \"ぶたにく\",\n    \"ふたん\",\n    \"ふちょう\",\n    \"ふつう\",\n    \"ふつか\",\n    \"ふっかつ\",\n    \"ふっき\",\n    \"ふっこく\",\n    \"ぶどう\",\n    \"ふとる\",\n    \"ふとん\",\n    \"ふのう\",\n    \"ふはい\",\n    \"ふひょう\",\n    \"ふへん\",\n    \"ふまん\",\n    \"ふみん\",\n    \"ふめつ\",\n    \"ふめん\",\n    \"ふよう\",\n    \"ふりこ\",\n    \"ふりる\",\n    \"ふるい\",\n    \"ふんいき\",\n    \"ぶんがく\",\n    \"ぶんぐ\",\n    \"ふんしつ\",\n    \"ぶんせき\",\n    \"ふんそう\",\n    \"ぶんぽう\",\n    \"へいあん\",\n    \"へいおん\",\n    \"へいがい\",\n    \"へいき\",\n    \"へいげん\",\n    \"へいこう\",\n    \"へいさ\",\n    \"へいしゃ\",\n    \"へいせつ\",\n    \"へいそ\",\n    \"へいたく\",\n    \"へいてん\",\n    \"へいねつ\",\n    \"へいわ\",\n    \"へきが\",\n    \"へこむ\",\n    \"べにいろ\",\n    \"べにしょうが\",\n    \"へらす\",\n    \"へんかん\",\n    \"べんきょう\",\n    \"べんごし\",\n    \"へんさい\",\n    \"へんたい\",\n    \"べんり\",\n    \"ほあん\",\n    \"ほいく\",\n    \"ぼうぎょ\",\n    \"ほうこく\",\n    \"ほうそう\",\n    \"ほうほう\",\n    \"ほうもん\",\n    \"ほうりつ\",\n    \"ほえる\",\n    \"ほおん\",\n    \"ほかん\",\n    \"ほきょう\",\n    \"ぼきん\",\n    \"ほくろ\",\n    \"ほけつ\",\n    \"ほけん\",\n    \"ほこう\",\n    \"ほこる\",\n    \"ほしい\",\n    \"ほしつ\",\n    \"ほしゅ\",\n    \"ほしょう\",\n    \"ほせい\",\n    \"ほそい\",\n    \"ほそく\",\n    \"ほたて\",\n    \"ほたる\",\n    \"ぽちぶくろ\",\n    \"ほっきょく\",\n    \"ほっさ\",\n    \"ほったん\",\n    \"ほとんど\",\n    \"ほめる\",\n    \"ほんい\",\n    \"ほんき\",\n    \"ほんけ\",\n    \"ほんしつ\",\n    \"ほんやく\",\n    \"まいにち\",\n    \"まかい\",\n    \"まかせる\",\n    \"まがる\",\n    \"まける\",\n    \"まこと\",\n    \"まさつ\",\n    \"まじめ\",\n    \"ますく\",\n    \"まぜる\",\n    \"まつり\",\n    \"まとめ\",\n    \"まなぶ\",\n    \"まぬけ\",\n    \"まねく\",\n    \"まほう\",\n    \"まもる\",\n    \"まゆげ\",\n    \"まよう\",\n    \"まろやか\",\n    \"まわす\",\n    \"まわり\",\n    \"まわる\",\n    \"まんが\",\n    \"まんきつ\",\n    \"まんぞく\",\n    \"まんなか\",\n    \"みいら\",\n    \"みうち\",\n    \"みえる\",\n    \"みがく\",\n    \"みかた\",\n    \"みかん\",\n    \"みけん\",\n    \"みこん\",\n    \"みじかい\",\n    \"みすい\",\n    \"みすえる\",\n    \"みせる\",\n    \"みっか\",\n    \"みつかる\",\n    \"みつける\",\n    \"みてい\",\n    \"みとめる\",\n    \"みなと\",\n    \"みなみかさい\",\n    \"みねらる\",\n    \"みのう\",\n    \"みのがす\",\n    \"みほん\",\n    \"みもと\",\n    \"みやげ\",\n    \"みらい\",\n    \"みりょく\",\n    \"みわく\",\n    \"みんか\",\n    \"みんぞく\",\n    \"むいか\",\n    \"むえき\",\n    \"むえん\",\n    \"むかい\",\n    \"むかう\",\n    \"むかえ\",\n    \"むかし\",\n    \"むぎちゃ\",\n    \"むける\",\n    \"むげん\",\n    \"むさぼる\",\n    \"むしあつい\",\n    \"むしば\",\n    \"むじゅん\",\n    \"むしろ\",\n    \"むすう\",\n    \"むすこ\",\n    \"むすぶ\",\n    \"むすめ\",\n    \"むせる\",\n    \"むせん\",\n    \"むちゅう\",\n    \"むなしい\",\n    \"むのう\",\n    \"むやみ\",\n    \"むよう\",\n    \"むらさき\",\n    \"むりょう\",\n    \"むろん\",\n    \"めいあん\",\n    \"めいうん\",\n    \"めいえん\",\n    \"めいかく\",\n    \"めいきょく\",\n    \"めいさい\",\n    \"めいし\",\n    \"めいそう\",\n    \"めいぶつ\",\n    \"めいれい\",\n    \"めいわく\",\n    \"めぐまれる\",\n    \"めざす\",\n    \"めした\",\n    \"めずらしい\",\n    \"めだつ\",\n    \"めまい\",\n    \"めやす\",\n    \"めんきょ\",\n    \"めんせき\",\n    \"めんどう\",\n    \"もうしあげる\",\n    \"もうどうけん\",\n    \"もえる\",\n    \"もくし\",\n    \"もくてき\",\n    \"もくようび\",\n    \"もちろん\",\n    \"もどる\",\n    \"もらう\",\n    \"もんく\",\n    \"もんだい\",\n    \"やおや\",\n    \"やける\",\n    \"やさい\",\n    \"やさしい\",\n    \"やすい\",\n    \"やすたろう\",\n    \"やすみ\",\n    \"やせる\",\n    \"やそう\",\n    \"やたい\",\n    \"やちん\",\n    \"やっと\",\n    \"やっぱり\",\n    \"やぶる\",\n    \"やめる\",\n    \"ややこしい\",\n    \"やよい\",\n    \"やわらかい\",\n    \"ゆうき\",\n    \"ゆうびんきょく\",\n    \"ゆうべ\",\n    \"ゆうめい\",\n    \"ゆけつ\",\n    \"ゆしゅつ\",\n    \"ゆせん\",\n    \"ゆそう\",\n    \"ゆたか\",\n    \"ゆちゃく\",\n    \"ゆでる\",\n    \"ゆにゅう\",\n    \"ゆびわ\",\n    \"ゆらい\",\n    \"ゆれる\",\n    \"ようい\",\n    \"ようか\",\n    \"ようきゅう\",\n    \"ようじ\",\n    \"ようす\",\n    \"ようちえん\",\n    \"よかぜ\",\n    \"よかん\",\n    \"よきん\",\n    \"よくせい\",\n    \"よくぼう\",\n    \"よけい\",\n    \"よごれる\",\n    \"よさん\",\n    \"よしゅう\",\n    \"よそう\",\n    \"よそく\",\n    \"よっか\",\n    \"よてい\",\n    \"よどがわく\",\n    \"よねつ\",\n    \"よやく\",\n    \"よゆう\",\n    \"よろこぶ\",\n    \"よろしい\",\n    \"らいう\",\n    \"らくがき\",\n    \"らくご\",\n    \"らくさつ\",\n    \"らくだ\",\n    \"らしんばん\",\n    \"らせん\",\n    \"らぞく\",\n    \"らたい\",\n    \"らっか\",\n    \"られつ\",\n    \"りえき\",\n    \"りかい\",\n    \"りきさく\",\n    \"りきせつ\",\n    \"りくぐん\",\n    \"りくつ\",\n    \"りけん\",\n    \"りこう\",\n    \"りせい\",\n    \"りそう\",\n    \"りそく\",\n    \"りてん\",\n    \"りねん\",\n    \"りゆう\",\n    \"りゅうがく\",\n    \"りよう\",\n    \"りょうり\",\n    \"りょかん\",\n    \"りょくちゃ\",\n    \"りょこう\",\n    \"りりく\",\n    \"りれき\",\n    \"りろん\",\n    \"りんご\",\n    \"るいけい\",\n    \"るいさい\",\n    \"るいじ\",\n    \"るいせき\",\n    \"るすばん\",\n    \"るりがわら\",\n    \"れいかん\",\n    \"れいぎ\",\n    \"れいせい\",\n    \"れいぞうこ\",\n    \"れいとう\",\n    \"れいぼう\",\n    \"れきし\",\n    \"れきだい\",\n    \"れんあい\",\n    \"れんけい\",\n    \"れんこん\",\n    \"れんさい\",\n    \"れんしゅう\",\n    \"れんぞく\",\n    \"れんらく\",\n    \"ろうか\",\n    \"ろうご\",\n    \"ろうじん\",\n    \"ろうそく\",\n    \"ろくが\",\n    \"ろこつ\",\n    \"ろじうら\",\n    \"ろしゅつ\",\n    \"ろせん\",\n    \"ろてん\",\n    \"ろめん\",\n    \"ろれつ\",\n    \"ろんぎ\",\n    \"ろんぱ\",\n    \"ろんぶん\",\n    \"ろんり\",\n    \"わかす\",\n    \"わかめ\",\n    \"わかやま\",\n    \"わかれる\",\n    \"わしつ\",\n    \"わじまし\",\n    \"わすれもの\",\n    \"わらう\",\n    \"われる\"\n]\n[\n    \"가격\",\n    \"가끔\",\n    \"가난\",\n    \"가능\",\n    \"가득\",\n    \"가르침\",\n    \"가뭄\",\n    \"가방\",\n    \"가상\",\n    \"가슴\",\n    \"가운데\",\n    \"가을\",\n    \"가이드\",\n    \"가입\",\n    \"가장\",\n    \"가정\",\n    \"가족\",\n    \"가죽\",\n    \"각오\",\n    \"각자\",\n    \"간격\",\n    \"간부\",\n    \"간섭\",\n    \"간장\",\n    \"간접\",\n    \"간판\",\n    \"갈등\",\n    \"갈비\",\n    \"갈색\",\n    \"갈증\",\n    \"감각\",\n    \"감기\",\n    \"감소\",\n    \"감수성\",\n    \"감자\",\n    \"감정\",\n    \"갑자기\",\n    \"강남\",\n    \"강당\",\n    \"강도\",\n    \"강력히\",\n    \"강변\",\n    \"강북\",\n    \"강사\",\n    \"강수량\",\n    \"강아지\",\n    \"강원도\",\n    \"강의\",\n    \"강제\",\n    \"강조\",\n    \"같이\",\n    \"개구리\",\n    \"개나리\",\n    \"개방\",\n    \"개별\",\n    \"개선\",\n    \"개성\",\n    \"개인\",\n    \"객관적\",\n    \"거실\",\n    \"거액\",\n    \"거울\",\n    \"거짓\",\n    \"거품\",\n    \"걱정\",\n    \"건강\",\n    \"건물\",\n    \"건설\",\n    \"건조\",\n    \"건축\",\n    \"걸음\",\n    \"검사\",\n    \"검토\",\n    \"게시판\",\n    \"게임\",\n    \"겨울\",\n    \"견해\",\n    \"결과\",\n    \"결국\",\n    \"결론\",\n    \"결석\",\n    \"결승\",\n    \"결심\",\n    \"결정\",\n    \"결혼\",\n    \"경계\",\n    \"경고\",\n    \"경기\",\n    \"경력\",\n    \"경복궁\",\n    \"경비\",\n    \"경상도\",\n    \"경영\",\n    \"경우\",\n    \"경쟁\",\n    \"경제\",\n    \"경주\",\n    \"경찰\",\n    \"경치\",\n    \"경향\",\n    \"경험\",\n    \"계곡\",\n    \"계단\",\n    \"계란\",\n    \"계산\",\n    \"계속\",\n    \"계약\",\n    \"계절\",\n    \"계층\",\n    \"계획\",\n    \"고객\",\n    \"고구려\",\n    \"고궁\",\n    \"고급\",\n    \"고등학생\",\n    \"고무신\",\n    \"고민\",\n    \"고양이\",\n    \"고장\",\n    \"고전\",\n    \"고집\",\n    \"고춧가루\",\n    \"고통\",\n    \"고향\",\n    \"곡식\",\n    \"골목\",\n    \"골짜기\",\n    \"골프\",\n    \"공간\",\n    \"공개\",\n    \"공격\",\n    \"공군\",\n    \"공급\",\n    \"공기\",\n    \"공동\",\n    \"공무원\",\n    \"공부\",\n    \"공사\",\n    \"공식\",\n    \"공업\",\n    \"공연\",\n    \"공원\",\n    \"공장\",\n    \"공짜\",\n    \"공책\",\n    \"공통\",\n    \"공포\",\n    \"공항\",\n    \"공휴일\",\n    \"과목\",\n    \"과일\",\n    \"과장\",\n    \"과정\",\n    \"과학\",\n    \"관객\",\n    \"관계\",\n    \"관광\",\n    \"관념\",\n    \"관람\",\n    \"관련\",\n    \"관리\",\n    \"관습\",\n    \"관심\",\n    \"관점\",\n    \"관찰\",\n    \"광경\",\n    \"광고\",\n    \"광장\",\n    \"광주\",\n    \"괴로움\",\n    \"굉장히\",\n    \"교과서\",\n    \"교문\",\n    \"교복\",\n    \"교실\",\n    \"교양\",\n    \"교육\",\n    \"교장\",\n    \"교직\",\n    \"교통\",\n    \"교환\",\n    \"교훈\",\n    \"구경\",\n    \"구름\",\n    \"구멍\",\n    \"구별\",\n    \"구분\",\n    \"구석\",\n    \"구성\",\n    \"구속\",\n    \"구역\",\n    \"구입\",\n    \"구청\",\n    \"구체적\",\n    \"국가\",\n    \"국기\",\n    \"국내\",\n    \"국립\",\n    \"국물\",\n    \"국민\",\n    \"국수\",\n    \"국어\",\n    \"국왕\",\n    \"국적\",\n    \"국제\",\n    \"국회\",\n    \"군대\",\n    \"군사\",\n    \"군인\",\n    \"궁극적\",\n    \"권리\",\n    \"권위\",\n    \"권투\",\n    \"귀국\",\n    \"귀신\",\n    \"규정\",\n    \"규칙\",\n    \"균형\",\n    \"그날\",\n    \"그냥\",\n    \"그늘\",\n    \"그러나\",\n    \"그룹\",\n    \"그릇\",\n    \"그림\",\n    \"그제서야\",\n    \"그토록\",\n    \"극복\",\n    \"극히\",\n    \"근거\",\n    \"근교\",\n    \"근래\",\n    \"근로\",\n    \"근무\",\n    \"근본\",\n    \"근원\",\n    \"근육\",\n    \"근처\",\n    \"글씨\",\n    \"글자\",\n    \"금강산\",\n    \"금고\",\n    \"금년\",\n    \"금메달\",\n    \"금액\",\n    \"금연\",\n    \"금요일\",\n    \"금지\",\n    \"긍정적\",\n    \"기간\",\n    \"기관\",\n    \"기념\",\n    \"기능\",\n    \"기독교\",\n    \"기둥\",\n    \"기록\",\n    \"기름\",\n    \"기법\",\n    \"기본\",\n    \"기분\",\n    \"기쁨\",\n    \"기숙사\",\n    \"기술\",\n    \"기억\",\n    \"기업\",\n    \"기온\",\n    \"기운\",\n    \"기원\",\n    \"기적\",\n    \"기준\",\n    \"기침\",\n    \"기혼\",\n    \"기획\",\n    \"긴급\",\n    \"긴장\",\n    \"길이\",\n    \"김밥\",\n    \"김치\",\n    \"김포공항\",\n    \"깍두기\",\n    \"깜빡\",\n    \"깨달음\",\n    \"깨소금\",\n    \"껍질\",\n    \"꼭대기\",\n    \"꽃잎\",\n    \"나들이\",\n    \"나란히\",\n    \"나머지\",\n    \"나물\",\n    \"나침반\",\n    \"나흘\",\n    \"낙엽\",\n    \"난방\",\n    \"날개\",\n    \"날씨\",\n    \"날짜\",\n    \"남녀\",\n    \"남대문\",\n    \"남매\",\n    \"남산\",\n    \"남자\",\n    \"남편\",\n    \"남학생\",\n    \"낭비\",\n    \"낱말\",\n    \"내년\",\n    \"내용\",\n    \"내일\",\n    \"냄비\",\n    \"냄새\",\n    \"냇물\",\n    \"냉동\",\n    \"냉면\",\n    \"냉방\",\n    \"냉장고\",\n    \"넥타이\",\n    \"넷째\",\n    \"노동\",\n    \"노란색\",\n    \"노력\",\n    \"노인\",\n    \"녹음\",\n    \"녹차\",\n    \"녹화\",\n    \"논리\",\n    \"논문\",\n    \"논쟁\",\n    \"놀이\",\n    \"농구\",\n    \"농담\",\n    \"농민\",\n    \"농부\",\n    \"농업\",\n    \"농장\",\n    \"농촌\",\n    \"높이\",\n    \"눈동자\",\n    \"눈물\",\n    \"눈썹\",\n    \"뉴욕\",\n    \"느낌\",\n    \"늑대\",\n    \"능동적\",\n    \"능력\",\n    \"다방\",\n    \"다양성\",\n    \"다음\",\n    \"다이어트\",\n    \"다행\",\n    \"단계\",\n    \"단골\",\n    \"단독\",\n    \"단맛\",\n    \"단순\",\n    \"단어\",\n    \"단위\",\n    \"단점\",\n    \"단체\",\n    \"단추\",\n    \"단편\",\n    \"단풍\",\n    \"달걀\",\n    \"달러\",\n    \"달력\",\n    \"달리\",\n    \"닭고기\",\n    \"담당\",\n    \"담배\",\n    \"담요\",\n    \"담임\",\n    \"답변\",\n    \"답장\",\n    \"당근\",\n    \"당분간\",\n    \"당연히\",\n    \"당장\",\n    \"대규모\",\n    \"대낮\",\n    \"대단히\",\n    \"대답\",\n    \"대도시\",\n    \"대략\",\n    \"대량\",\n    \"대륙\",\n    \"대문\",\n    \"대부분\",\n    \"대신\",\n    \"대응\",\n    \"대장\",\n    \"대전\",\n    \"대접\",\n    \"대중\",\n    \"대책\",\n    \"대출\",\n    \"대충\",\n    \"대통령\",\n    \"대학\",\n    \"대한민국\",\n    \"대합실\",\n    \"대형\",\n    \"덩어리\",\n    \"데이트\",\n    \"도대체\",\n    \"도덕\",\n    \"도둑\",\n    \"도망\",\n    \"도서관\",\n    \"도심\",\n    \"도움\",\n    \"도입\",\n    \"도자기\",\n    \"도저히\",\n    \"도전\",\n    \"도중\",\n    \"도착\",\n    \"독감\",\n    \"독립\",\n    \"독서\",\n    \"독일\",\n    \"독창적\",\n    \"동화책\",\n    \"뒷모습\",\n    \"뒷산\",\n    \"딸아이\",\n    \"마누라\",\n    \"마늘\",\n    \"마당\",\n    \"마라톤\",\n    \"마련\",\n    \"마무리\",\n    \"마사지\",\n    \"마약\",\n    \"마요네즈\",\n    \"마을\",\n    \"마음\",\n    \"마이크\",\n    \"마중\",\n    \"마지막\",\n    \"마찬가지\",\n    \"마찰\",\n    \"마흔\",\n    \"막걸리\",\n    \"막내\",\n    \"막상\",\n    \"만남\",\n    \"만두\",\n    \"만세\",\n    \"만약\",\n    \"만일\",\n    \"만점\",\n    \"만족\",\n    \"만화\",\n    \"많이\",\n    \"말기\",\n    \"말씀\",\n    \"말투\",\n    \"맘대로\",\n    \"망원경\",\n    \"매년\",\n    \"매달\",\n    \"매력\",\n    \"매번\",\n    \"매스컴\",\n    \"매일\",\n    \"매장\",\n    \"맥주\",\n    \"먹이\",\n    \"먼저\",\n    \"먼지\",\n    \"멀리\",\n    \"메일\",\n    \"며느리\",\n    \"며칠\",\n    \"면담\",\n    \"멸치\",\n    \"명단\",\n    \"명령\",\n    \"명예\",\n    \"명의\",\n    \"명절\",\n    \"명칭\",\n    \"명함\",\n    \"모금\",\n    \"모니터\",\n    \"모델\",\n    \"모든\",\n    \"모범\",\n    \"모습\",\n    \"모양\",\n    \"모임\",\n    \"모조리\",\n    \"모집\",\n    \"모퉁이\",\n    \"목걸이\",\n    \"목록\",\n    \"목사\",\n    \"목소리\",\n    \"목숨\",\n    \"목적\",\n    \"목표\",\n    \"몰래\",\n    \"몸매\",\n    \"몸무게\",\n    \"몸살\",\n    \"몸속\",\n    \"몸짓\",\n    \"몸통\",\n    \"몹시\",\n    \"무관심\",\n    \"무궁화\",\n    \"무더위\",\n    \"무덤\",\n    \"무릎\",\n    \"무슨\",\n    \"무엇\",\n    \"무역\",\n    \"무용\",\n    \"무조건\",\n    \"무지개\",\n    \"무척\",\n    \"문구\",\n    \"문득\",\n    \"문법\",\n    \"문서\",\n    \"문제\",\n    \"문학\",\n    \"문화\",\n    \"물가\",\n    \"물건\",\n    \"물결\",\n    \"물고기\",\n    \"물론\",\n    \"물리학\",\n    \"물음\",\n    \"물질\",\n    \"물체\",\n    \"미국\",\n    \"미디어\",\n    \"미사일\",\n    \"미술\",\n    \"미역\",\n    \"미용실\",\n    \"미움\",\n    \"미인\",\n    \"미팅\",\n    \"미혼\",\n    \"민간\",\n    \"민족\",\n    \"민주\",\n    \"믿음\",\n    \"밀가루\",\n    \"밀리미터\",\n    \"밑바닥\",\n    \"바가지\",\n    \"바구니\",\n    \"바나나\",\n    \"바늘\",\n    \"바닥\",\n    \"바닷가\",\n    \"바람\",\n    \"바이러스\",\n    \"바탕\",\n    \"박물관\",\n    \"박사\",\n    \"박수\",\n    \"반대\",\n    \"반드시\",\n    \"반말\",\n    \"반발\",\n    \"반성\",\n    \"반응\",\n    \"반장\",\n    \"반죽\",\n    \"반지\",\n    \"반찬\",\n    \"받침\",\n    \"발가락\",\n    \"발걸음\",\n    \"발견\",\n    \"발달\",\n    \"발레\",\n    \"발목\",\n    \"발바닥\",\n    \"발생\",\n    \"발음\",\n    \"발자국\",\n    \"발전\",\n    \"발톱\",\n    \"발표\",\n    \"밤하늘\",\n    \"밥그릇\",\n    \"밥맛\",\n    \"밥상\",\n    \"밥솥\",\n    \"방금\",\n    \"방면\",\n    \"방문\",\n    \"방바닥\",\n    \"방법\",\n    \"방송\",\n    \"방식\",\n    \"방안\",\n    \"방울\",\n    \"방지\",\n    \"방학\",\n    \"방해\",\n    \"방향\",\n    \"배경\",\n    \"배꼽\",\n    \"배달\",\n    \"배드민턴\",\n    \"백두산\",\n    \"백색\",\n    \"백성\",\n    \"백인\",\n    \"백제\",\n    \"백화점\",\n    \"버릇\",\n    \"버섯\",\n    \"버튼\",\n    \"번개\",\n    \"번역\",\n    \"번지\",\n    \"번호\",\n    \"벌금\",\n    \"벌레\",\n    \"벌써\",\n    \"범위\",\n    \"범인\",\n    \"범죄\",\n    \"법률\",\n    \"법원\",\n    \"법적\",\n    \"법칙\",\n    \"베이징\",\n    \"벨트\",\n    \"변경\",\n    \"변동\",\n    \"변명\",\n    \"변신\",\n    \"변호사\",\n    \"변화\",\n    \"별도\",\n    \"별명\",\n    \"별일\",\n    \"병실\",\n    \"병아리\",\n    \"병원\",\n    \"보관\",\n    \"보너스\",\n    \"보라색\",\n    \"보람\",\n    \"보름\",\n    \"보상\",\n    \"보안\",\n    \"보자기\",\n    \"보장\",\n    \"보전\",\n    \"보존\",\n    \"보통\",\n    \"보편적\",\n    \"보험\",\n    \"복도\",\n    \"복사\",\n    \"복숭아\",\n    \"복습\",\n    \"볶음\",\n    \"본격적\",\n    \"본래\",\n    \"본부\",\n    \"본사\",\n    \"본성\",\n    \"본인\",\n    \"본질\",\n    \"볼펜\",\n    \"봉사\",\n    \"봉지\",\n    \"봉투\",\n    \"부근\",\n    \"부끄러움\",\n    \"부담\",\n    \"부동산\",\n    \"부문\",\n    \"부분\",\n    \"부산\",\n    \"부상\",\n    \"부엌\",\n    \"부인\",\n    \"부작용\",\n    \"부장\",\n    \"부정\",\n    \"부족\",\n    \"부지런히\",\n    \"부친\",\n    \"부탁\",\n    \"부품\",\n    \"부회장\",\n    \"북부\",\n    \"북한\",\n    \"분노\",\n    \"분량\",\n    \"분리\",\n    \"분명\",\n    \"분석\",\n    \"분야\",\n    \"분위기\",\n    \"분필\",\n    \"분홍색\",\n    \"불고기\",\n    \"불과\",\n    \"불교\",\n    \"불꽃\",\n    \"불만\",\n    \"불법\",\n    \"불빛\",\n    \"불안\",\n    \"불이익\",\n    \"불행\",\n    \"브랜드\",\n    \"비극\",\n    \"비난\",\n    \"비닐\",\n    \"비둘기\",\n    \"비디오\",\n    \"비로소\",\n    \"비만\",\n    \"비명\",\n    \"비밀\",\n    \"비바람\",\n    \"비빔밥\",\n    \"비상\",\n    \"비용\",\n    \"비율\",\n    \"비중\",\n    \"비타민\",\n    \"비판\",\n    \"빌딩\",\n    \"빗물\",\n    \"빗방울\",\n    \"빗줄기\",\n    \"빛깔\",\n    \"빨간색\",\n    \"빨래\",\n    \"빨리\",\n    \"사건\",\n    \"사계절\",\n    \"사나이\",\n    \"사냥\",\n    \"사람\",\n    \"사랑\",\n    \"사립\",\n    \"사모님\",\n    \"사물\",\n    \"사방\",\n    \"사상\",\n    \"사생활\",\n    \"사설\",\n    \"사슴\",\n    \"사실\",\n    \"사업\",\n    \"사용\",\n    \"사월\",\n    \"사장\",\n    \"사전\",\n    \"사진\",\n    \"사촌\",\n    \"사춘기\",\n    \"사탕\",\n    \"사투리\",\n    \"사흘\",\n    \"산길\",\n    \"산부인과\",\n    \"산업\",\n    \"산책\",\n    \"살림\",\n    \"살인\",\n    \"살짝\",\n    \"삼계탕\",\n    \"삼국\",\n    \"삼십\",\n    \"삼월\",\n    \"삼촌\",\n    \"상관\",\n    \"상금\",\n    \"상대\",\n    \"상류\",\n    \"상반기\",\n    \"상상\",\n    \"상식\",\n    \"상업\",\n    \"상인\",\n    \"상자\",\n    \"상점\",\n    \"상처\",\n    \"상추\",\n    \"상태\",\n    \"상표\",\n    \"상품\",\n    \"상황\",\n    \"새벽\",\n    \"색깔\",\n    \"색연필\",\n    \"생각\",\n    \"생명\",\n    \"생물\",\n    \"생방송\",\n    \"생산\",\n    \"생선\",\n    \"생신\",\n    \"생일\",\n    \"생활\",\n    \"서랍\",\n    \"서른\",\n    \"서명\",\n    \"서민\",\n    \"서비스\",\n    \"서양\",\n    \"서울\",\n    \"서적\",\n    \"서점\",\n    \"서쪽\",\n    \"서클\",\n    \"석사\",\n    \"석유\",\n    \"선거\",\n    \"선물\",\n    \"선배\",\n    \"선생\",\n    \"선수\",\n    \"선원\",\n    \"선장\",\n    \"선전\",\n    \"선택\",\n    \"선풍기\",\n    \"설거지\",\n    \"설날\",\n    \"설렁탕\",\n    \"설명\",\n    \"설문\",\n    \"설사\",\n    \"설악산\",\n    \"설치\",\n    \"설탕\",\n    \"섭씨\",\n    \"성공\",\n    \"성당\",\n    \"성명\",\n    \"성별\",\n    \"성인\",\n    \"성장\",\n    \"성적\",\n    \"성질\",\n    \"성함\",\n    \"세금\",\n    \"세미나\",\n    \"세상\",\n    \"세월\",\n    \"세종대왕\",\n    \"세탁\",\n    \"센터\",\n    \"센티미터\",\n    \"셋째\",\n    \"소규모\",\n    \"소극적\",\n    \"소금\",\n    \"소나기\",\n    \"소년\",\n    \"소득\",\n    \"소망\",\n    \"소문\",\n    \"소설\",\n    \"소속\",\n    \"소아과\",\n    \"소용\",\n    \"소원\",\n    \"소음\",\n    \"소중히\",\n    \"소지품\",\n    \"소질\",\n    \"소풍\",\n    \"소형\",\n    \"속담\",\n    \"속도\",\n    \"속옷\",\n    \"손가락\",\n    \"손길\",\n    \"손녀\",\n    \"손님\",\n    \"손등\",\n    \"손목\",\n    \"손뼉\",\n    \"손실\",\n    \"손질\",\n    \"손톱\",\n    \"손해\",\n    \"솔직히\",\n    \"솜씨\",\n    \"송아지\",\n    \"송이\",\n    \"송편\",\n    \"쇠고기\",\n    \"쇼핑\",\n    \"수건\",\n    \"수년\",\n    \"수단\",\n    \"수돗물\",\n    \"수동적\",\n    \"수면\",\n    \"수명\",\n    \"수박\",\n    \"수상\",\n    \"수석\",\n    \"수술\",\n    \"수시로\",\n    \"수업\",\n    \"수염\",\n    \"수영\",\n    \"수입\",\n    \"수준\",\n    \"수집\",\n    \"수출\",\n    \"수컷\",\n    \"수필\",\n    \"수학\",\n    \"수험생\",\n    \"수화기\",\n    \"숙녀\",\n    \"숙소\",\n    \"숙제\",\n    \"순간\",\n    \"순서\",\n    \"순수\",\n    \"순식간\",\n    \"순위\",\n    \"숟가락\",\n    \"술병\",\n    \"술집\",\n    \"숫자\",\n    \"스님\",\n    \"스물\",\n    \"스스로\",\n    \"스승\",\n    \"스웨터\",\n    \"스위치\",\n    \"스케이트\",\n    \"스튜디오\",\n    \"스트레스\",\n    \"스포츠\",\n    \"슬쩍\",\n    \"슬픔\",\n    \"습관\",\n    \"습기\",\n    \"승객\",\n    \"승리\",\n    \"승부\",\n    \"승용차\",\n    \"승진\",\n    \"시각\",\n    \"시간\",\n    \"시골\",\n    \"시금치\",\n    \"시나리오\",\n    \"시댁\",\n    \"시리즈\",\n    \"시멘트\",\n    \"시민\",\n    \"시부모\",\n    \"시선\",\n    \"시설\",\n    \"시스템\",\n    \"시아버지\",\n    \"시어머니\",\n    \"시월\",\n    \"시인\",\n    \"시일\",\n    \"시작\",\n    \"시장\",\n    \"시절\",\n    \"시점\",\n    \"시중\",\n    \"시즌\",\n    \"시집\",\n    \"시청\",\n    \"시합\",\n    \"시험\",\n    \"식구\",\n    \"식기\",\n    \"식당\",\n    \"식량\",\n    \"식료품\",\n    \"식물\",\n    \"식빵\",\n    \"식사\",\n    \"식생활\",\n    \"식초\",\n    \"식탁\",\n    \"식품\",\n    \"신고\",\n    \"신규\",\n    \"신념\",\n    \"신문\",\n    \"신발\",\n    \"신비\",\n    \"신사\",\n    \"신세\",\n    \"신용\",\n    \"신제품\",\n    \"신청\",\n    \"신체\",\n    \"신화\",\n    \"실감\",\n    \"실내\",\n    \"실력\",\n    \"실례\",\n    \"실망\",\n    \"실수\",\n    \"실습\",\n    \"실시\",\n    \"실장\",\n    \"실정\",\n    \"실질적\",\n    \"실천\",\n    \"실체\",\n    \"실컷\",\n    \"실태\",\n    \"실패\",\n    \"실험\",\n    \"실현\",\n    \"심리\",\n    \"심부름\",\n    \"심사\",\n    \"심장\",\n    \"심정\",\n    \"심판\",\n    \"쌍둥이\",\n    \"씨름\",\n    \"씨앗\",\n    \"아가씨\",\n    \"아나운서\",\n    \"아드님\",\n    \"아들\",\n    \"아쉬움\",\n    \"아스팔트\",\n    \"아시아\",\n    \"아울러\",\n    \"아저씨\",\n    \"아줌마\",\n    \"아직\",\n    \"아침\",\n    \"아파트\",\n    \"아프리카\",\n    \"아픔\",\n    \"아홉\",\n    \"아흔\",\n    \"악기\",\n    \"악몽\",\n    \"악수\",\n    \"안개\",\n    \"안경\",\n    \"안과\",\n    \"안내\",\n    \"안녕\",\n    \"안동\",\n    \"안방\",\n    \"안부\",\n    \"안주\",\n    \"알루미늄\",\n    \"알코올\",\n    \"암시\",\n    \"암컷\",\n    \"압력\",\n    \"앞날\",\n    \"앞문\",\n    \"애인\",\n    \"애정\",\n    \"액수\",\n    \"앨범\",\n    \"야간\",\n    \"야단\",\n    \"야옹\",\n    \"약간\",\n    \"약국\",\n    \"약속\",\n    \"약수\",\n    \"약점\",\n    \"약품\",\n    \"약혼녀\",\n    \"양념\",\n    \"양력\",\n    \"양말\",\n    \"양배추\",\n    \"양주\",\n    \"양파\",\n    \"어둠\",\n    \"어려움\",\n    \"어른\",\n    \"어젯밤\",\n    \"어쨌든\",\n    \"어쩌다가\",\n    \"어쩐지\",\n    \"언니\",\n    \"언덕\",\n    \"언론\",\n    \"언어\",\n    \"얼굴\",\n    \"얼른\",\n    \"얼음\",\n    \"얼핏\",\n    \"엄마\",\n    \"업무\",\n    \"업종\",\n    \"업체\",\n    \"엉덩이\",\n    \"엉망\",\n    \"엉터리\",\n    \"엊그제\",\n    \"에너지\",\n    \"에어컨\",\n    \"엔진\",\n    \"여건\",\n    \"여고생\",\n    \"여관\",\n    \"여군\",\n    \"여권\",\n    \"여대생\",\n    \"여덟\",\n    \"여동생\",\n    \"여든\",\n    \"여론\",\n    \"여름\",\n    \"여섯\",\n    \"여성\",\n    \"여왕\",\n    \"여인\",\n    \"여전히\",\n    \"여직원\",\n    \"여학생\",\n    \"여행\",\n    \"역사\",\n    \"역시\",\n    \"역할\",\n    \"연결\",\n    \"연구\",\n    \"연극\",\n    \"연기\",\n    \"연락\",\n    \"연설\",\n    \"연세\",\n    \"연속\",\n    \"연습\",\n    \"연애\",\n    \"연예인\",\n    \"연인\",\n    \"연장\",\n    \"연주\",\n    \"연출\",\n    \"연필\",\n    \"연합\",\n    \"연휴\",\n    \"열기\",\n    \"열매\",\n    \"열쇠\",\n    \"열심히\",\n    \"열정\",\n    \"열차\",\n    \"열흘\",\n    \"염려\",\n    \"엽서\",\n    \"영국\",\n    \"영남\",\n    \"영상\",\n    \"영양\",\n    \"영역\",\n    \"영웅\",\n    \"영원히\",\n    \"영하\",\n    \"영향\",\n    \"영혼\",\n    \"영화\",\n    \"옆구리\",\n    \"옆방\",\n    \"옆집\",\n    \"예감\",\n    \"예금\",\n    \"예방\",\n    \"예산\",\n    \"예상\",\n    \"예선\",\n    \"예술\",\n    \"예습\",\n    \"예식장\",\n    \"예약\",\n    \"예전\",\n    \"예절\",\n    \"예정\",\n    \"예컨대\",\n    \"옛날\",\n    \"오늘\",\n    \"오락\",\n    \"오랫동안\",\n    \"오렌지\",\n    \"오로지\",\n    \"오른발\",\n    \"오븐\",\n    \"오십\",\n    \"오염\",\n    \"오월\",\n    \"오전\",\n    \"오직\",\n    \"오징어\",\n    \"오페라\",\n    \"오피스텔\",\n    \"오히려\",\n    \"옥상\",\n    \"옥수수\",\n    \"온갖\",\n    \"온라인\",\n    \"온몸\",\n    \"온종일\",\n    \"온통\",\n    \"올가을\",\n    \"올림픽\",\n    \"올해\",\n    \"옷차림\",\n    \"와이셔츠\",\n    \"와인\",\n    \"완성\",\n    \"완전\",\n    \"왕비\",\n    \"왕자\",\n    \"왜냐하면\",\n    \"왠지\",\n    \"외갓집\",\n    \"외국\",\n    \"외로움\",\n    \"외삼촌\",\n    \"외출\",\n    \"외침\",\n    \"외할머니\",\n    \"왼발\",\n    \"왼손\",\n    \"왼쪽\",\n    \"요금\",\n    \"요일\",\n    \"요즘\",\n    \"요청\",\n    \"용기\",\n    \"용서\",\n    \"용어\",\n    \"우산\",\n    \"우선\",\n    \"우승\",\n    \"우연히\",\n    \"우정\",\n    \"우체국\",\n    \"우편\",\n    \"운동\",\n    \"운명\",\n    \"운반\",\n    \"운전\",\n    \"운행\",\n    \"울산\",\n    \"울음\",\n    \"움직임\",\n    \"웃어른\",\n    \"웃음\",\n    \"워낙\",\n    \"원고\",\n    \"원래\",\n    \"원서\",\n    \"원숭이\",\n    \"원인\",\n    \"원장\",\n    \"원피스\",\n    \"월급\",\n    \"월드컵\",\n    \"월세\",\n    \"월요일\",\n    \"웨이터\",\n    \"위반\",\n    \"위법\",\n    \"위성\",\n    \"위원\",\n    \"위험\",\n    \"위협\",\n    \"윗사람\",\n    \"유난히\",\n    \"유럽\",\n    \"유명\",\n    \"유물\",\n    \"유산\",\n    \"유적\",\n    \"유치원\",\n    \"유학\",\n    \"유행\",\n    \"유형\",\n    \"육군\",\n    \"육상\",\n    \"육십\",\n    \"육체\",\n    \"은행\",\n    \"음력\",\n    \"음료\",\n    \"음반\",\n    \"음성\",\n    \"음식\",\n    \"음악\",\n    \"음주\",\n    \"의견\",\n    \"의논\",\n    \"의문\",\n    \"의복\",\n    \"의식\",\n    \"의심\",\n    \"의외로\",\n    \"의욕\",\n    \"의원\",\n    \"의학\",\n    \"이것\",\n    \"이곳\",\n    \"이념\",\n    \"이놈\",\n    \"이달\",\n    \"이대로\",\n    \"이동\",\n    \"이렇게\",\n    \"이력서\",\n    \"이론적\",\n    \"이름\",\n    \"이민\",\n    \"이발소\",\n    \"이별\",\n    \"이불\",\n    \"이빨\",\n    \"이상\",\n    \"이성\",\n    \"이슬\",\n    \"이야기\",\n    \"이용\",\n    \"이웃\",\n    \"이월\",\n    \"이윽고\",\n    \"이익\",\n    \"이전\",\n    \"이중\",\n    \"이튿날\",\n    \"이틀\",\n    \"이혼\",\n    \"인간\",\n    \"인격\",\n    \"인공\",\n    \"인구\",\n    \"인근\",\n    \"인기\",\n    \"인도\",\n    \"인류\",\n    \"인물\",\n    \"인생\",\n    \"인쇄\",\n    \"인연\",\n    \"인원\",\n    \"인재\",\n    \"인종\",\n    \"인천\",\n    \"인체\",\n    \"인터넷\",\n    \"인하\",\n    \"인형\",\n    \"일곱\",\n    \"일기\",\n    \"일단\",\n    \"일대\",\n    \"일등\",\n    \"일반\",\n    \"일본\",\n    \"일부\",\n    \"일상\",\n    \"일생\",\n    \"일손\",\n    \"일요일\",\n    \"일월\",\n    \"일정\",\n    \"일종\",\n    \"일주일\",\n    \"일찍\",\n    \"일체\",\n    \"일치\",\n    \"일행\",\n    \"일회용\",\n    \"임금\",\n    \"임무\",\n    \"입대\",\n    \"입력\",\n    \"입맛\",\n    \"입사\",\n    \"입술\",\n    \"입시\",\n    \"입원\",\n    \"입장\",\n    \"입학\",\n    \"자가용\",\n    \"자격\",\n    \"자극\",\n    \"자동\",\n    \"자랑\",\n    \"자부심\",\n    \"자식\",\n    \"자신\",\n    \"자연\",\n    \"자원\",\n    \"자율\",\n    \"자전거\",\n    \"자정\",\n    \"자존심\",\n    \"자판\",\n    \"작가\",\n    \"작년\",\n    \"작성\",\n    \"작업\",\n    \"작용\",\n    \"작은딸\",\n    \"작품\",\n    \"잔디\",\n    \"잔뜩\",\n    \"잔치\",\n    \"잘못\",\n    \"잠깐\",\n    \"잠수함\",\n    \"잠시\",\n    \"잠옷\",\n    \"잠자리\",\n    \"잡지\",\n    \"장관\",\n    \"장군\",\n    \"장기간\",\n    \"장래\",\n    \"장례\",\n    \"장르\",\n    \"장마\",\n    \"장면\",\n    \"장모\",\n    \"장미\",\n    \"장비\",\n    \"장사\",\n    \"장소\",\n    \"장식\",\n    \"장애인\",\n    \"장인\",\n    \"장점\",\n    \"장차\",\n    \"장학금\",\n    \"재능\",\n    \"재빨리\",\n    \"재산\",\n    \"재생\",\n    \"재작년\",\n    \"재정\",\n    \"재채기\",\n    \"재판\",\n    \"재학\",\n    \"재활용\",\n    \"저것\",\n    \"저고리\",\n    \"저곳\",\n    \"저녁\",\n    \"저런\",\n    \"저렇게\",\n    \"저번\",\n    \"저울\",\n    \"저절로\",\n    \"저축\",\n    \"적극\",\n    \"적당히\",\n    \"적성\",\n    \"적용\",\n    \"적응\",\n    \"전개\",\n    \"전공\",\n    \"전기\",\n    \"전달\",\n    \"전라도\",\n    \"전망\",\n    \"전문\",\n    \"전반\",\n    \"전부\",\n    \"전세\",\n    \"전시\",\n    \"전용\",\n    \"전자\",\n    \"전쟁\",\n    \"전주\",\n    \"전철\",\n    \"전체\",\n    \"전통\",\n    \"전혀\",\n    \"전후\",\n    \"절대\",\n    \"절망\",\n    \"절반\",\n    \"절약\",\n    \"절차\",\n    \"점검\",\n    \"점수\",\n    \"점심\",\n    \"점원\",\n    \"점점\",\n    \"점차\",\n    \"접근\",\n    \"접시\",\n    \"접촉\",\n    \"젓가락\",\n    \"정거장\",\n    \"정도\",\n    \"정류장\",\n    \"정리\",\n    \"정말\",\n    \"정면\",\n    \"정문\",\n    \"정반대\",\n    \"정보\",\n    \"정부\",\n    \"정비\",\n    \"정상\",\n    \"정성\",\n    \"정오\",\n    \"정원\",\n    \"정장\",\n    \"정지\",\n    \"정치\",\n    \"정확히\",\n    \"제공\",\n    \"제과점\",\n    \"제대로\",\n    \"제목\",\n    \"제발\",\n    \"제법\",\n    \"제삿날\",\n    \"제안\",\n    \"제일\",\n    \"제작\",\n    \"제주도\",\n    \"제출\",\n    \"제품\",\n    \"제한\",\n    \"조각\",\n    \"조건\",\n    \"조금\",\n    \"조깅\",\n    \"조명\",\n    \"조미료\",\n    \"조상\",\n    \"조선\",\n    \"조용히\",\n    \"조절\",\n    \"조정\",\n    \"조직\",\n    \"존댓말\",\n    \"존재\",\n    \"졸업\",\n    \"졸음\",\n    \"종교\",\n    \"종로\",\n    \"종류\",\n    \"종소리\",\n    \"종업원\",\n    \"종종\",\n    \"종합\",\n    \"좌석\",\n    \"죄인\",\n    \"주관적\",\n    \"주름\",\n    \"주말\",\n    \"주머니\",\n    \"주먹\",\n    \"주문\",\n    \"주민\",\n    \"주방\",\n    \"주변\",\n    \"주식\",\n    \"주인\",\n    \"주일\",\n    \"주장\",\n    \"주전자\",\n    \"주택\",\n    \"준비\",\n    \"줄거리\",\n    \"줄기\",\n    \"줄무늬\",\n    \"중간\",\n    \"중계방송\",\n    \"중국\",\n    \"중년\",\n    \"중단\",\n    \"중독\",\n    \"중반\",\n    \"중부\",\n    \"중세\",\n    \"중소기업\",\n    \"중순\",\n    \"중앙\",\n    \"중요\",\n    \"중학교\",\n    \"즉석\",\n    \"즉시\",\n    \"즐거움\",\n    \"증가\",\n    \"증거\",\n    \"증권\",\n    \"증상\",\n    \"증세\",\n    \"지각\",\n    \"지갑\",\n    \"지경\",\n    \"지극히\",\n    \"지금\",\n    \"지급\",\n    \"지능\",\n    \"지름길\",\n    \"지리산\",\n    \"지방\",\n    \"지붕\",\n    \"지식\",\n    \"지역\",\n    \"지우개\",\n    \"지원\",\n    \"지적\",\n    \"지점\",\n    \"지진\",\n    \"지출\",\n    \"직선\",\n    \"직업\",\n    \"직원\",\n    \"직장\",\n    \"진급\",\n    \"진동\",\n    \"진로\",\n    \"진료\",\n    \"진리\",\n    \"진짜\",\n    \"진찰\",\n    \"진출\",\n    \"진통\",\n    \"진행\",\n    \"질문\",\n    \"질병\",\n    \"질서\",\n    \"짐작\",\n    \"집단\",\n    \"집안\",\n    \"집중\",\n    \"짜증\",\n    \"찌꺼기\",\n    \"차남\",\n    \"차라리\",\n    \"차량\",\n    \"차림\",\n    \"차별\",\n    \"차선\",\n    \"차츰\",\n    \"착각\",\n    \"찬물\",\n    \"찬성\",\n    \"참가\",\n    \"참기름\",\n    \"참새\",\n    \"참석\",\n    \"참여\",\n    \"참외\",\n    \"참조\",\n    \"찻잔\",\n    \"창가\",\n    \"창고\",\n    \"창구\",\n    \"창문\",\n    \"창밖\",\n    \"창작\",\n    \"창조\",\n    \"채널\",\n    \"채점\",\n    \"책가방\",\n    \"책방\",\n    \"책상\",\n    \"책임\",\n    \"챔피언\",\n    \"처벌\",\n    \"처음\",\n    \"천국\",\n    \"천둥\",\n    \"천장\",\n    \"천재\",\n    \"천천히\",\n    \"철도\",\n    \"철저히\",\n    \"철학\",\n    \"첫날\",\n    \"첫째\",\n    \"청년\",\n    \"청바지\",\n    \"청소\",\n    \"청춘\",\n    \"체계\",\n    \"체력\",\n    \"체온\",\n    \"체육\",\n    \"체중\",\n    \"체험\",\n    \"초등학생\",\n    \"초반\",\n    \"초밥\",\n    \"초상화\",\n    \"초순\",\n    \"초여름\",\n    \"초원\",\n    \"초저녁\",\n    \"초점\",\n    \"초청\",\n    \"초콜릿\",\n    \"촛불\",\n    \"총각\",\n    \"총리\",\n    \"총장\",\n    \"촬영\",\n    \"최근\",\n    \"최상\",\n    \"최선\",\n    \"최신\",\n    \"최악\",\n    \"최종\",\n    \"추석\",\n    \"추억\",\n    \"추진\",\n    \"추천\",\n    \"추측\",\n    \"축구\",\n    \"축소\",\n    \"축제\",\n    \"축하\",\n    \"출근\",\n    \"출발\",\n    \"출산\",\n    \"출신\",\n    \"출연\",\n    \"출입\",\n    \"출장\",\n    \"출판\",\n    \"충격\",\n    \"충고\",\n    \"충돌\",\n    \"충분히\",\n    \"충청도\",\n    \"취업\",\n    \"취직\",\n    \"취향\",\n    \"치약\",\n    \"친구\",\n    \"친척\",\n    \"칠십\",\n    \"칠월\",\n    \"칠판\",\n    \"침대\",\n    \"침묵\",\n    \"침실\",\n    \"칫솔\",\n    \"칭찬\",\n    \"카메라\",\n    \"카운터\",\n    \"칼국수\",\n    \"캐릭터\",\n    \"캠퍼스\",\n    \"캠페인\",\n    \"커튼\",\n    \"컨디션\",\n    \"컬러\",\n    \"컴퓨터\",\n    \"코끼리\",\n    \"코미디\",\n    \"콘서트\",\n    \"콜라\",\n    \"콤플렉스\",\n    \"콩나물\",\n    \"쾌감\",\n    \"쿠데타\",\n    \"크림\",\n    \"큰길\",\n    \"큰딸\",\n    \"큰소리\",\n    \"큰아들\",\n    \"큰어머니\",\n    \"큰일\",\n    \"큰절\",\n    \"클래식\",\n    \"클럽\",\n    \"킬로\",\n    \"타입\",\n    \"타자기\",\n    \"탁구\",\n    \"탁자\",\n    \"탄생\",\n    \"태권도\",\n    \"태양\",\n    \"태풍\",\n    \"택시\",\n    \"탤런트\",\n    \"터널\",\n    \"터미널\",\n    \"테니스\",\n    \"테스트\",\n    \"테이블\",\n    \"텔레비전\",\n    \"토론\",\n    \"토마토\",\n    \"토요일\",\n    \"통계\",\n    \"통과\",\n    \"통로\",\n    \"통신\",\n    \"통역\",\n    \"통일\",\n    \"통장\",\n    \"통제\",\n    \"통증\",\n    \"통합\",\n    \"통화\",\n    \"퇴근\",\n    \"퇴원\",\n    \"퇴직금\",\n    \"튀김\",\n    \"트럭\",\n    \"특급\",\n    \"특별\",\n    \"특성\",\n    \"특수\",\n    \"특징\",\n    \"특히\",\n    \"튼튼히\",\n    \"티셔츠\",\n    \"파란색\",\n    \"파일\",\n    \"파출소\",\n    \"판결\",\n    \"판단\",\n    \"판매\",\n    \"판사\",\n    \"팔십\",\n    \"팔월\",\n    \"팝송\",\n    \"패션\",\n    \"팩스\",\n    \"팩시밀리\",\n    \"팬티\",\n    \"퍼센트\",\n    \"페인트\",\n    \"편견\",\n    \"편의\",\n    \"편지\",\n    \"편히\",\n    \"평가\",\n    \"평균\",\n    \"평생\",\n    \"평소\",\n    \"평양\",\n    \"평일\",\n    \"평화\",\n    \"포스터\",\n    \"포인트\",\n    \"포장\",\n    \"포함\",\n    \"표면\",\n    \"표정\",\n    \"표준\",\n    \"표현\",\n    \"품목\",\n    \"품질\",\n    \"풍경\",\n    \"풍속\",\n    \"풍습\",\n    \"프랑스\",\n    \"프린터\",\n    \"플라스틱\",\n    \"피곤\",\n    \"피망\",\n    \"피아노\",\n    \"필름\",\n    \"필수\",\n    \"필요\",\n    \"필자\",\n    \"필통\",\n    \"핑계\",\n    \"하느님\",\n    \"하늘\",\n    \"하드웨어\",\n    \"하룻밤\",\n    \"하반기\",\n    \"하숙집\",\n    \"하순\",\n    \"하여튼\",\n    \"하지만\",\n    \"하천\",\n    \"하품\",\n    \"하필\",\n    \"학과\",\n    \"학교\",\n    \"학급\",\n    \"학기\",\n    \"학년\",\n    \"학력\",\n    \"학번\",\n    \"학부모\",\n    \"학비\",\n    \"학생\",\n    \"학술\",\n    \"학습\",\n    \"학용품\",\n    \"학원\",\n    \"학위\",\n    \"학자\",\n    \"학점\",\n    \"한계\",\n    \"한글\",\n    \"한꺼번에\",\n    \"한낮\",\n    \"한눈\",\n    \"한동안\",\n    \"한때\",\n    \"한라산\",\n    \"한마디\",\n    \"한문\",\n    \"한번\",\n    \"한복\",\n    \"한식\",\n    \"한여름\",\n    \"한쪽\",\n    \"할머니\",\n    \"할아버지\",\n    \"할인\",\n    \"함께\",\n    \"함부로\",\n    \"합격\",\n    \"합리적\",\n    \"항공\",\n    \"항구\",\n    \"항상\",\n    \"항의\",\n    \"해결\",\n    \"해군\",\n    \"해답\",\n    \"해당\",\n    \"해물\",\n    \"해석\",\n    \"해설\",\n    \"해수욕장\",\n    \"해안\",\n    \"핵심\",\n    \"핸드백\",\n    \"햄버거\",\n    \"햇볕\",\n    \"햇살\",\n    \"행동\",\n    \"행복\",\n    \"행사\",\n    \"행운\",\n    \"행위\",\n    \"향기\",\n    \"향상\",\n    \"향수\",\n    \"허락\",\n    \"허용\",\n    \"헬기\",\n    \"현관\",\n    \"현금\",\n    \"현대\",\n    \"현상\",\n    \"현실\",\n    \"현장\",\n    \"현재\",\n    \"현지\",\n    \"혈액\",\n    \"협력\",\n    \"형부\",\n    \"형사\",\n    \"형수\",\n    \"형식\",\n    \"형제\",\n    \"형태\",\n    \"형편\",\n    \"혜택\",\n    \"호기심\",\n    \"호남\",\n    \"호랑이\",\n    \"호박\",\n    \"호텔\",\n    \"호흡\",\n    \"혹시\",\n    \"홀로\",\n    \"홈페이지\",\n    \"홍보\",\n    \"홍수\",\n    \"홍차\",\n    \"화면\",\n    \"화분\",\n    \"화살\",\n    \"화요일\",\n    \"화장\",\n    \"화학\",\n    \"확보\",\n    \"확인\",\n    \"확장\",\n    \"확정\",\n    \"환갑\",\n    \"환경\",\n    \"환영\",\n    \"환율\",\n    \"환자\",\n    \"활기\",\n    \"활동\",\n    \"활발히\",\n    \"활용\",\n    \"활짝\",\n    \"회견\",\n    \"회관\",\n    \"회복\",\n    \"회색\",\n    \"회원\",\n    \"회장\",\n    \"회전\",\n    \"횟수\",\n    \"횡단보도\",\n    \"효율적\",\n    \"후반\",\n    \"후춧가루\",\n    \"훈련\",\n    \"훨씬\",\n    \"휴식\",\n    \"휴일\",\n    \"흉내\",\n    \"흐름\",\n    \"흑백\",\n    \"흑인\",\n    \"흔적\",\n    \"흔히\",\n    \"흥미\",\n    \"흥분\",\n    \"희곡\",\n    \"희망\",\n    \"희생\",\n    \"흰색\",\n    \"힘껏\"\n]\n[\n    \"abacate\",\n    \"abaixo\",\n    \"abalar\",\n    \"abater\",\n    \"abduzir\",\n    \"abelha\",\n    \"aberto\",\n    \"abismo\",\n    \"abotoar\",\n    \"abranger\",\n    \"abreviar\",\n    \"abrigar\",\n    \"abrupto\",\n    \"absinto\",\n    \"absoluto\",\n    \"absurdo\",\n    \"abutre\",\n    \"acabado\",\n    \"acalmar\",\n    \"acampar\",\n    \"acanhar\",\n    \"acaso\",\n    \"aceitar\",\n    \"acelerar\",\n    \"acenar\",\n    \"acervo\",\n    \"acessar\",\n    \"acetona\",\n    \"achatar\",\n    \"acidez\",\n    \"acima\",\n    \"acionado\",\n    \"acirrar\",\n    \"aclamar\",\n    \"aclive\",\n    \"acolhida\",\n    \"acomodar\",\n    \"acoplar\",\n    \"acordar\",\n    \"acumular\",\n    \"acusador\",\n    \"adaptar\",\n    \"adega\",\n    \"adentro\",\n    \"adepto\",\n    \"adequar\",\n    \"aderente\",\n    \"adesivo\",\n    \"adeus\",\n    \"adiante\",\n    \"aditivo\",\n    \"adjetivo\",\n    \"adjunto\",\n    \"admirar\",\n    \"adorar\",\n    \"adquirir\",\n    \"adubo\",\n    \"adverso\",\n    \"advogado\",\n    \"aeronave\",\n    \"afastar\",\n    \"aferir\",\n    \"afetivo\",\n    \"afinador\",\n    \"afivelar\",\n    \"aflito\",\n    \"afluente\",\n    \"afrontar\",\n    \"agachar\",\n    \"agarrar\",\n    \"agasalho\",\n    \"agenciar\",\n    \"agilizar\",\n    \"agiota\",\n    \"agitado\",\n    \"agora\",\n    \"agradar\",\n    \"agreste\",\n    \"agrupar\",\n    \"aguardar\",\n    \"agulha\",\n    \"ajoelhar\",\n    \"ajudar\",\n    \"ajustar\",\n    \"alameda\",\n    \"alarme\",\n    \"alastrar\",\n    \"alavanca\",\n    \"albergue\",\n    \"albino\",\n    \"alcatra\",\n    \"aldeia\",\n    \"alecrim\",\n    \"alegria\",\n    \"alertar\",\n    \"alface\",\n    \"alfinete\",\n    \"algum\",\n    \"alheio\",\n    \"aliar\",\n    \"alicate\",\n    \"alienar\",\n    \"alinhar\",\n    \"aliviar\",\n    \"almofada\",\n    \"alocar\",\n    \"alpiste\",\n    \"alterar\",\n    \"altitude\",\n    \"alucinar\",\n    \"alugar\",\n    \"aluno\",\n    \"alusivo\",\n    \"alvo\",\n    \"amaciar\",\n    \"amador\",\n    \"amarelo\",\n    \"amassar\",\n    \"ambas\",\n    \"ambiente\",\n    \"ameixa\",\n    \"amenizar\",\n    \"amido\",\n    \"amistoso\",\n    \"amizade\",\n    \"amolador\",\n    \"amontoar\",\n    \"amoroso\",\n    \"amostra\",\n    \"amparar\",\n    \"ampliar\",\n    \"ampola\",\n    \"anagrama\",\n    \"analisar\",\n    \"anarquia\",\n    \"anatomia\",\n    \"andaime\",\n    \"anel\",\n    \"anexo\",\n    \"angular\",\n    \"animar\",\n    \"anjo\",\n    \"anomalia\",\n    \"anotado\",\n    \"ansioso\",\n    \"anterior\",\n    \"anuidade\",\n    \"anunciar\",\n    \"anzol\",\n    \"apagador\",\n    \"apalpar\",\n    \"apanhado\",\n    \"apego\",\n    \"apelido\",\n    \"apertada\",\n    \"apesar\",\n    \"apetite\",\n    \"apito\",\n    \"aplauso\",\n    \"aplicada\",\n    \"apoio\",\n    \"apontar\",\n    \"aposta\",\n    \"aprendiz\",\n    \"aprovar\",\n    \"aquecer\",\n    \"arame\",\n    \"aranha\",\n    \"arara\",\n    \"arcada\",\n    \"ardente\",\n    \"areia\",\n    \"arejar\",\n    \"arenito\",\n    \"aresta\",\n    \"argiloso\",\n    \"argola\",\n    \"arma\",\n    \"arquivo\",\n    \"arraial\",\n    \"arrebate\",\n    \"arriscar\",\n    \"arroba\",\n    \"arrumar\",\n    \"arsenal\",\n    \"arterial\",\n    \"artigo\",\n    \"arvoredo\",\n    \"asfaltar\",\n    \"asilado\",\n    \"aspirar\",\n    \"assador\",\n    \"assinar\",\n    \"assoalho\",\n    \"assunto\",\n    \"astral\",\n    \"atacado\",\n    \"atadura\",\n    \"atalho\",\n    \"atarefar\",\n    \"atear\",\n    \"atender\",\n    \"aterro\",\n    \"ateu\",\n    \"atingir\",\n    \"atirador\",\n    \"ativo\",\n    \"atoleiro\",\n    \"atracar\",\n    \"atrevido\",\n    \"atriz\",\n    \"atual\",\n    \"atum\",\n    \"auditor\",\n    \"aumentar\",\n    \"aura\",\n    \"aurora\",\n    \"autismo\",\n    \"autoria\",\n    \"autuar\",\n    \"avaliar\",\n    \"avante\",\n    \"avaria\",\n    \"avental\",\n    \"avesso\",\n    \"aviador\",\n    \"avisar\",\n    \"avulso\",\n    \"axila\",\n    \"azarar\",\n    \"azedo\",\n    \"azeite\",\n    \"azulejo\",\n    \"babar\",\n    \"babosa\",\n    \"bacalhau\",\n    \"bacharel\",\n    \"bacia\",\n    \"bagagem\",\n    \"baiano\",\n    \"bailar\",\n    \"baioneta\",\n    \"bairro\",\n    \"baixista\",\n    \"bajular\",\n    \"baleia\",\n    \"baliza\",\n    \"balsa\",\n    \"banal\",\n    \"bandeira\",\n    \"banho\",\n    \"banir\",\n    \"banquete\",\n    \"barato\",\n    \"barbado\",\n    \"baronesa\",\n    \"barraca\",\n    \"barulho\",\n    \"baseado\",\n    \"bastante\",\n    \"batata\",\n    \"batedor\",\n    \"batida\",\n    \"batom\",\n    \"batucar\",\n    \"baunilha\",\n    \"beber\",\n    \"beijo\",\n    \"beirada\",\n    \"beisebol\",\n    \"beldade\",\n    \"beleza\",\n    \"belga\",\n    \"beliscar\",\n    \"bendito\",\n    \"bengala\",\n    \"benzer\",\n    \"berimbau\",\n    \"berlinda\",\n    \"berro\",\n    \"besouro\",\n    \"bexiga\",\n    \"bezerro\",\n    \"bico\",\n    \"bicudo\",\n    \"bienal\",\n    \"bifocal\",\n    \"bifurcar\",\n    \"bigorna\",\n    \"bilhete\",\n    \"bimestre\",\n    \"bimotor\",\n    \"biologia\",\n    \"biombo\",\n    \"biosfera\",\n    \"bipolar\",\n    \"birrento\",\n    \"biscoito\",\n    \"bisneto\",\n    \"bispo\",\n    \"bissexto\",\n    \"bitola\",\n    \"bizarro\",\n    \"blindado\",\n    \"bloco\",\n    \"bloquear\",\n    \"boato\",\n    \"bobagem\",\n    \"bocado\",\n    \"bocejo\",\n    \"bochecha\",\n    \"boicotar\",\n    \"bolada\",\n    \"boletim\",\n    \"bolha\",\n    \"bolo\",\n    \"bombeiro\",\n    \"bonde\",\n    \"boneco\",\n    \"bonita\",\n    \"borbulha\",\n    \"borda\",\n    \"boreal\",\n    \"borracha\",\n    \"bovino\",\n    \"boxeador\",\n    \"branco\",\n    \"brasa\",\n    \"braveza\",\n    \"breu\",\n    \"briga\",\n    \"brilho\",\n    \"brincar\",\n    \"broa\",\n    \"brochura\",\n    \"bronzear\",\n    \"broto\",\n    \"bruxo\",\n    \"bucha\",\n    \"budismo\",\n    \"bufar\",\n    \"bule\",\n    \"buraco\",\n    \"busca\",\n    \"busto\",\n    \"buzina\",\n    \"cabana\",\n    \"cabelo\",\n    \"cabide\",\n    \"cabo\",\n    \"cabrito\",\n    \"cacau\",\n    \"cacetada\",\n    \"cachorro\",\n    \"cacique\",\n    \"cadastro\",\n    \"cadeado\",\n    \"cafezal\",\n    \"caiaque\",\n    \"caipira\",\n    \"caixote\",\n    \"cajado\",\n    \"caju\",\n    \"calafrio\",\n    \"calcular\",\n    \"caldeira\",\n    \"calibrar\",\n    \"calmante\",\n    \"calota\",\n    \"camada\",\n    \"cambista\",\n    \"camisa\",\n    \"camomila\",\n    \"campanha\",\n    \"camuflar\",\n    \"canavial\",\n    \"cancelar\",\n    \"caneta\",\n    \"canguru\",\n    \"canhoto\",\n    \"canivete\",\n    \"canoa\",\n    \"cansado\",\n    \"cantar\",\n    \"canudo\",\n    \"capacho\",\n    \"capela\",\n    \"capinar\",\n    \"capotar\",\n    \"capricho\",\n    \"captador\",\n    \"capuz\",\n    \"caracol\",\n    \"carbono\",\n    \"cardeal\",\n    \"careca\",\n    \"carimbar\",\n    \"carneiro\",\n    \"carpete\",\n    \"carreira\",\n    \"cartaz\",\n    \"carvalho\",\n    \"casaco\",\n    \"casca\",\n    \"casebre\",\n    \"castelo\",\n    \"casulo\",\n    \"catarata\",\n    \"cativar\",\n    \"caule\",\n    \"causador\",\n    \"cautelar\",\n    \"cavalo\",\n    \"caverna\",\n    \"cebola\",\n    \"cedilha\",\n    \"cegonha\",\n    \"celebrar\",\n    \"celular\",\n    \"cenoura\",\n    \"censo\",\n    \"centeio\",\n    \"cercar\",\n    \"cerrado\",\n    \"certeiro\",\n    \"cerveja\",\n    \"cetim\",\n    \"cevada\",\n    \"chacota\",\n    \"chaleira\",\n    \"chamado\",\n    \"chapada\",\n    \"charme\",\n    \"chatice\",\n    \"chave\",\n    \"chefe\",\n    \"chegada\",\n    \"cheiro\",\n    \"cheque\",\n    \"chicote\",\n    \"chifre\",\n    \"chinelo\",\n    \"chocalho\",\n    \"chover\",\n    \"chumbo\",\n    \"chutar\",\n    \"chuva\",\n    \"cicatriz\",\n    \"ciclone\",\n    \"cidade\",\n    \"cidreira\",\n    \"ciente\",\n    \"cigana\",\n    \"cimento\",\n    \"cinto\",\n    \"cinza\",\n    \"ciranda\",\n    \"circuito\",\n    \"cirurgia\",\n    \"citar\",\n    \"clareza\",\n    \"clero\",\n    \"clicar\",\n    \"clone\",\n    \"clube\",\n    \"coado\",\n    \"coagir\",\n    \"cobaia\",\n    \"cobertor\",\n    \"cobrar\",\n    \"cocada\",\n    \"coelho\",\n    \"coentro\",\n    \"coeso\",\n    \"cogumelo\",\n    \"coibir\",\n    \"coifa\",\n    \"coiote\",\n    \"colar\",\n    \"coleira\",\n    \"colher\",\n    \"colidir\",\n    \"colmeia\",\n    \"colono\",\n    \"coluna\",\n    \"comando\",\n    \"combinar\",\n    \"comentar\",\n    \"comitiva\",\n    \"comover\",\n    \"complexo\",\n    \"comum\",\n    \"concha\",\n    \"condor\",\n    \"conectar\",\n    \"confuso\",\n    \"congelar\",\n    \"conhecer\",\n    \"conjugar\",\n    \"consumir\",\n    \"contrato\",\n    \"convite\",\n    \"cooperar\",\n    \"copeiro\",\n    \"copiador\",\n    \"copo\",\n    \"coquetel\",\n    \"coragem\",\n    \"cordial\",\n    \"corneta\",\n    \"coronha\",\n    \"corporal\",\n    \"correio\",\n    \"cortejo\",\n    \"coruja\",\n    \"corvo\",\n    \"cosseno\",\n    \"costela\",\n    \"cotonete\",\n    \"couro\",\n    \"couve\",\n    \"covil\",\n    \"cozinha\",\n    \"cratera\",\n    \"cravo\",\n    \"creche\",\n    \"credor\",\n    \"creme\",\n    \"crer\",\n    \"crespo\",\n    \"criada\",\n    \"criminal\",\n    \"crioulo\",\n    \"crise\",\n    \"criticar\",\n    \"crosta\",\n    \"crua\",\n    \"cruzeiro\",\n    \"cubano\",\n    \"cueca\",\n    \"cuidado\",\n    \"cujo\",\n    \"culatra\",\n    \"culminar\",\n    \"culpar\",\n    \"cultura\",\n    \"cumprir\",\n    \"cunhado\",\n    \"cupido\",\n    \"curativo\",\n    \"curral\",\n    \"cursar\",\n    \"curto\",\n    \"cuspir\",\n    \"custear\",\n    \"cutelo\",\n    \"damasco\",\n    \"datar\",\n    \"debater\",\n    \"debitar\",\n    \"deboche\",\n    \"debulhar\",\n    \"decalque\",\n    \"decimal\",\n    \"declive\",\n    \"decote\",\n    \"decretar\",\n    \"dedal\",\n    \"dedicado\",\n    \"deduzir\",\n    \"defesa\",\n    \"defumar\",\n    \"degelo\",\n    \"degrau\",\n    \"degustar\",\n    \"deitado\",\n    \"deixar\",\n    \"delator\",\n    \"delegado\",\n    \"delinear\",\n    \"delonga\",\n    \"demanda\",\n    \"demitir\",\n    \"demolido\",\n    \"dentista\",\n    \"depenado\",\n    \"depilar\",\n    \"depois\",\n    \"depressa\",\n    \"depurar\",\n    \"deriva\",\n    \"derramar\",\n    \"desafio\",\n    \"desbotar\",\n    \"descanso\",\n    \"desenho\",\n    \"desfiado\",\n    \"desgaste\",\n    \"desigual\",\n    \"deslize\",\n    \"desmamar\",\n    \"desova\",\n    \"despesa\",\n    \"destaque\",\n    \"desviar\",\n    \"detalhar\",\n    \"detentor\",\n    \"detonar\",\n    \"detrito\",\n    \"deusa\",\n    \"dever\",\n    \"devido\",\n    \"devotado\",\n    \"dezena\",\n    \"diagrama\",\n    \"dialeto\",\n    \"didata\",\n    \"difuso\",\n    \"digitar\",\n    \"dilatado\",\n    \"diluente\",\n    \"diminuir\",\n    \"dinastia\",\n    \"dinheiro\",\n    \"diocese\",\n    \"direto\",\n    \"discreta\",\n    \"disfarce\",\n    \"disparo\",\n    \"disquete\",\n    \"dissipar\",\n    \"distante\",\n    \"ditador\",\n    \"diurno\",\n    \"diverso\",\n    \"divisor\",\n    \"divulgar\",\n    \"dizer\",\n    \"dobrador\",\n    \"dolorido\",\n    \"domador\",\n    \"dominado\",\n    \"donativo\",\n    \"donzela\",\n    \"dormente\",\n    \"dorsal\",\n    \"dosagem\",\n    \"dourado\",\n    \"doutor\",\n    \"drenagem\",\n    \"drible\",\n    \"drogaria\",\n    \"duelar\",\n    \"duende\",\n    \"dueto\",\n    \"duplo\",\n    \"duquesa\",\n    \"durante\",\n    \"duvidoso\",\n    \"eclodir\",\n    \"ecoar\",\n    \"ecologia\",\n    \"edificar\",\n    \"edital\",\n    \"educado\",\n    \"efeito\",\n    \"efetivar\",\n    \"ejetar\",\n    \"elaborar\",\n    \"eleger\",\n    \"eleitor\",\n    \"elenco\",\n    \"elevador\",\n    \"eliminar\",\n    \"elogiar\",\n    \"embargo\",\n    \"embolado\",\n    \"embrulho\",\n    \"embutido\",\n    \"emenda\",\n    \"emergir\",\n    \"emissor\",\n    \"empatia\",\n    \"empenho\",\n    \"empinado\",\n    \"empolgar\",\n    \"emprego\",\n    \"empurrar\",\n    \"emulador\",\n    \"encaixe\",\n    \"encenado\",\n    \"enchente\",\n    \"encontro\",\n    \"endeusar\",\n    \"endossar\",\n    \"enfaixar\",\n    \"enfeite\",\n    \"enfim\",\n    \"engajado\",\n    \"engenho\",\n    \"englobar\",\n    \"engomado\",\n    \"engraxar\",\n    \"enguia\",\n    \"enjoar\",\n    \"enlatar\",\n    \"enquanto\",\n    \"enraizar\",\n    \"enrolado\",\n    \"enrugar\",\n    \"ensaio\",\n    \"enseada\",\n    \"ensino\",\n    \"ensopado\",\n    \"entanto\",\n    \"enteado\",\n    \"entidade\",\n    \"entortar\",\n    \"entrada\",\n    \"entulho\",\n    \"envergar\",\n    \"enviado\",\n    \"envolver\",\n    \"enxame\",\n    \"enxerto\",\n    \"enxofre\",\n    \"enxuto\",\n    \"epiderme\",\n    \"equipar\",\n    \"ereto\",\n    \"erguido\",\n    \"errata\",\n    \"erva\",\n    \"ervilha\",\n    \"esbanjar\",\n    \"esbelto\",\n    \"escama\",\n    \"escola\",\n    \"escrita\",\n    \"escuta\",\n    \"esfinge\",\n    \"esfolar\",\n    \"esfregar\",\n    \"esfumado\",\n    \"esgrima\",\n    \"esmalte\",\n    \"espanto\",\n    \"espelho\",\n    \"espiga\",\n    \"esponja\",\n    \"espreita\",\n    \"espumar\",\n    \"esquerda\",\n    \"estaca\",\n    \"esteira\",\n    \"esticar\",\n    \"estofado\",\n    \"estrela\",\n    \"estudo\",\n    \"esvaziar\",\n    \"etanol\",\n    \"etiqueta\",\n    \"euforia\",\n    \"europeu\",\n    \"evacuar\",\n    \"evaporar\",\n    \"evasivo\",\n    \"eventual\",\n    \"evidente\",\n    \"evoluir\",\n    \"exagero\",\n    \"exalar\",\n    \"examinar\",\n    \"exato\",\n    \"exausto\",\n    \"excesso\",\n    \"excitar\",\n    \"exclamar\",\n    \"executar\",\n    \"exemplo\",\n    \"exibir\",\n    \"exigente\",\n    \"exonerar\",\n    \"expandir\",\n    \"expelir\",\n    \"expirar\",\n    \"explanar\",\n    \"exposto\",\n    \"expresso\",\n    \"expulsar\",\n    \"externo\",\n    \"extinto\",\n    \"extrato\",\n    \"fabricar\",\n    \"fabuloso\",\n    \"faceta\",\n    \"facial\",\n    \"fada\",\n    \"fadiga\",\n    \"faixa\",\n    \"falar\",\n    \"falta\",\n    \"familiar\",\n    \"fandango\",\n    \"fanfarra\",\n    \"fantoche\",\n    \"fardado\",\n    \"farelo\",\n    \"farinha\",\n    \"farofa\",\n    \"farpa\",\n    \"fartura\",\n    \"fatia\",\n    \"fator\",\n    \"favorita\",\n    \"faxina\",\n    \"fazenda\",\n    \"fechado\",\n    \"feijoada\",\n    \"feirante\",\n    \"felino\",\n    \"feminino\",\n    \"fenda\",\n    \"feno\",\n    \"fera\",\n    \"feriado\",\n    \"ferrugem\",\n    \"ferver\",\n    \"festejar\",\n    \"fetal\",\n    \"feudal\",\n    \"fiapo\",\n    \"fibrose\",\n    \"ficar\",\n    \"ficheiro\",\n    \"figurado\",\n    \"fileira\",\n    \"filho\",\n    \"filme\",\n    \"filtrar\",\n    \"firmeza\",\n    \"fisgada\",\n    \"fissura\",\n    \"fita\",\n    \"fivela\",\n    \"fixador\",\n    \"fixo\",\n    \"flacidez\",\n    \"flamingo\",\n    \"flanela\",\n    \"flechada\",\n    \"flora\",\n    \"flutuar\",\n    \"fluxo\",\n    \"focal\",\n    \"focinho\",\n    \"fofocar\",\n    \"fogo\",\n    \"foguete\",\n    \"foice\",\n    \"folgado\",\n    \"folheto\",\n    \"forjar\",\n    \"formiga\",\n    \"forno\",\n    \"forte\",\n    \"fosco\",\n    \"fossa\",\n    \"fragata\",\n    \"fralda\",\n    \"frango\",\n    \"frasco\",\n    \"fraterno\",\n    \"freira\",\n    \"frente\",\n    \"fretar\",\n    \"frieza\",\n    \"friso\",\n    \"fritura\",\n    \"fronha\",\n    \"frustrar\",\n    \"fruteira\",\n    \"fugir\",\n    \"fulano\",\n    \"fuligem\",\n    \"fundar\",\n    \"fungo\",\n    \"funil\",\n    \"furador\",\n    \"furioso\",\n    \"futebol\",\n    \"gabarito\",\n    \"gabinete\",\n    \"gado\",\n    \"gaiato\",\n    \"gaiola\",\n    \"gaivota\",\n    \"galega\",\n    \"galho\",\n    \"galinha\",\n    \"galocha\",\n    \"ganhar\",\n    \"garagem\",\n    \"garfo\",\n    \"gargalo\",\n    \"garimpo\",\n    \"garoupa\",\n    \"garrafa\",\n    \"gasoduto\",\n    \"gasto\",\n    \"gata\",\n    \"gatilho\",\n    \"gaveta\",\n    \"gazela\",\n    \"gelado\",\n    \"geleia\",\n    \"gelo\",\n    \"gemada\",\n    \"gemer\",\n    \"gemido\",\n    \"generoso\",\n    \"gengiva\",\n    \"genial\",\n    \"genoma\",\n    \"genro\",\n    \"geologia\",\n    \"gerador\",\n    \"germinar\",\n    \"gesso\",\n    \"gestor\",\n    \"ginasta\",\n    \"gincana\",\n    \"gingado\",\n    \"girafa\",\n    \"girino\",\n    \"glacial\",\n    \"glicose\",\n    \"global\",\n    \"glorioso\",\n    \"goela\",\n    \"goiaba\",\n    \"golfe\",\n    \"golpear\",\n    \"gordura\",\n    \"gorjeta\",\n    \"gorro\",\n    \"gostoso\",\n    \"goteira\",\n    \"governar\",\n    \"gracejo\",\n    \"gradual\",\n    \"grafite\",\n    \"gralha\",\n    \"grampo\",\n    \"granada\",\n    \"gratuito\",\n    \"graveto\",\n    \"graxa\",\n    \"grego\",\n    \"grelhar\",\n    \"greve\",\n    \"grilo\",\n    \"grisalho\",\n    \"gritaria\",\n    \"grosso\",\n    \"grotesco\",\n    \"grudado\",\n    \"grunhido\",\n    \"gruta\",\n    \"guache\",\n    \"guarani\",\n    \"guaxinim\",\n    \"guerrear\",\n    \"guiar\",\n    \"guincho\",\n    \"guisado\",\n    \"gula\",\n    \"guloso\",\n    \"guru\",\n    \"habitar\",\n    \"harmonia\",\n    \"haste\",\n    \"haver\",\n    \"hectare\",\n    \"herdar\",\n    \"heresia\",\n    \"hesitar\",\n    \"hiato\",\n    \"hibernar\",\n    \"hidratar\",\n    \"hiena\",\n    \"hino\",\n    \"hipismo\",\n    \"hipnose\",\n    \"hipoteca\",\n    \"hoje\",\n    \"holofote\",\n    \"homem\",\n    \"honesto\",\n    \"honrado\",\n    \"hormonal\",\n    \"hospedar\",\n    \"humorado\",\n    \"iate\",\n    \"ideia\",\n    \"idoso\",\n    \"ignorado\",\n    \"igreja\",\n    \"iguana\",\n    \"ileso\",\n    \"ilha\",\n    \"iludido\",\n    \"iluminar\",\n    \"ilustrar\",\n    \"imagem\",\n    \"imediato\",\n    \"imenso\",\n    \"imersivo\",\n    \"iminente\",\n    \"imitador\",\n    \"imortal\",\n    \"impacto\",\n    \"impedir\",\n    \"implante\",\n    \"impor\",\n    \"imprensa\",\n    \"impune\",\n    \"imunizar\",\n    \"inalador\",\n    \"inapto\",\n    \"inativo\",\n    \"incenso\",\n    \"inchar\",\n    \"incidir\",\n    \"incluir\",\n    \"incolor\",\n    \"indeciso\",\n    \"indireto\",\n    \"indutor\",\n    \"ineficaz\",\n    \"inerente\",\n    \"infantil\",\n    \"infestar\",\n    \"infinito\",\n    \"inflamar\",\n    \"informal\",\n    \"infrator\",\n    \"ingerir\",\n    \"inibido\",\n    \"inicial\",\n    \"inimigo\",\n    \"injetar\",\n    \"inocente\",\n    \"inodoro\",\n    \"inovador\",\n    \"inox\",\n    \"inquieto\",\n    \"inscrito\",\n    \"inseto\",\n    \"insistir\",\n    \"inspetor\",\n    \"instalar\",\n    \"insulto\",\n    \"intacto\",\n    \"integral\",\n    \"intimar\",\n    \"intocado\",\n    \"intriga\",\n    \"invasor\",\n    \"inverno\",\n    \"invicto\",\n    \"invocar\",\n    \"iogurte\",\n    \"iraniano\",\n    \"ironizar\",\n    \"irreal\",\n    \"irritado\",\n    \"isca\",\n    \"isento\",\n    \"isolado\",\n    \"isqueiro\",\n    \"italiano\",\n    \"janeiro\",\n    \"jangada\",\n    \"janta\",\n    \"jararaca\",\n    \"jardim\",\n    \"jarro\",\n    \"jasmim\",\n    \"jato\",\n    \"javali\",\n    \"jazida\",\n    \"jejum\",\n    \"joaninha\",\n    \"joelhada\",\n    \"jogador\",\n    \"joia\",\n    \"jornal\",\n    \"jorrar\",\n    \"jovem\",\n    \"juba\",\n    \"judeu\",\n    \"judoca\",\n    \"juiz\",\n    \"julgador\",\n    \"julho\",\n    \"jurado\",\n    \"jurista\",\n    \"juro\",\n    \"justa\",\n    \"labareda\",\n    \"laboral\",\n    \"lacre\",\n    \"lactante\",\n    \"ladrilho\",\n    \"lagarta\",\n    \"lagoa\",\n    \"laje\",\n    \"lamber\",\n    \"lamentar\",\n    \"laminar\",\n    \"lampejo\",\n    \"lanche\",\n    \"lapidar\",\n    \"lapso\",\n    \"laranja\",\n    \"lareira\",\n    \"largura\",\n    \"lasanha\",\n    \"lastro\",\n    \"lateral\",\n    \"latido\",\n    \"lavanda\",\n    \"lavoura\",\n    \"lavrador\",\n    \"laxante\",\n    \"lazer\",\n    \"lealdade\",\n    \"lebre\",\n    \"legado\",\n    \"legendar\",\n    \"legista\",\n    \"leigo\",\n    \"leiloar\",\n    \"leitura\",\n    \"lembrete\",\n    \"leme\",\n    \"lenhador\",\n    \"lentilha\",\n    \"leoa\",\n    \"lesma\",\n    \"leste\",\n    \"letivo\",\n    \"letreiro\",\n    \"levar\",\n    \"leveza\",\n    \"levitar\",\n    \"liberal\",\n    \"libido\",\n    \"liderar\",\n    \"ligar\",\n    \"ligeiro\",\n    \"limitar\",\n    \"limoeiro\",\n    \"limpador\",\n    \"linda\",\n    \"linear\",\n    \"linhagem\",\n    \"liquidez\",\n    \"listagem\",\n    \"lisura\",\n    \"litoral\",\n    \"livro\",\n    \"lixa\",\n    \"lixeira\",\n    \"locador\",\n    \"locutor\",\n    \"lojista\",\n    \"lombo\",\n    \"lona\",\n    \"longe\",\n    \"lontra\",\n    \"lorde\",\n    \"lotado\",\n    \"loteria\",\n    \"loucura\",\n    \"lousa\",\n    \"louvar\",\n    \"luar\",\n    \"lucidez\",\n    \"lucro\",\n    \"luneta\",\n    \"lustre\",\n    \"lutador\",\n    \"luva\",\n    \"macaco\",\n    \"macete\",\n    \"machado\",\n    \"macio\",\n    \"madeira\",\n    \"madrinha\",\n    \"magnata\",\n    \"magreza\",\n    \"maior\",\n    \"mais\",\n    \"malandro\",\n    \"malha\",\n    \"malote\",\n    \"maluco\",\n    \"mamilo\",\n    \"mamoeiro\",\n    \"mamute\",\n    \"manada\",\n    \"mancha\",\n    \"mandato\",\n    \"manequim\",\n    \"manhoso\",\n    \"manivela\",\n    \"manobrar\",\n    \"mansa\",\n    \"manter\",\n    \"manusear\",\n    \"mapeado\",\n    \"maquinar\",\n    \"marcador\",\n    \"maresia\",\n    \"marfim\",\n    \"margem\",\n    \"marinho\",\n    \"marmita\",\n    \"maroto\",\n    \"marquise\",\n    \"marreco\",\n    \"martelo\",\n    \"marujo\",\n    \"mascote\",\n    \"masmorra\",\n    \"massagem\",\n    \"mastigar\",\n    \"matagal\",\n    \"materno\",\n    \"matinal\",\n    \"matutar\",\n    \"maxilar\",\n    \"medalha\",\n    \"medida\",\n    \"medusa\",\n    \"megafone\",\n    \"meiga\",\n    \"melancia\",\n    \"melhor\",\n    \"membro\",\n    \"memorial\",\n    \"menino\",\n    \"menos\",\n    \"mensagem\",\n    \"mental\",\n    \"merecer\",\n    \"mergulho\",\n    \"mesada\",\n    \"mesclar\",\n    \"mesmo\",\n    \"mesquita\",\n    \"mestre\",\n    \"metade\",\n    \"meteoro\",\n    \"metragem\",\n    \"mexer\",\n    \"mexicano\",\n    \"micro\",\n    \"migalha\",\n    \"migrar\",\n    \"milagre\",\n    \"milenar\",\n    \"milhar\",\n    \"mimado\",\n    \"minerar\",\n    \"minhoca\",\n    \"ministro\",\n    \"minoria\",\n    \"miolo\",\n    \"mirante\",\n    \"mirtilo\",\n    \"misturar\",\n    \"mocidade\",\n    \"moderno\",\n    \"modular\",\n    \"moeda\",\n    \"moer\",\n    \"moinho\",\n    \"moita\",\n    \"moldura\",\n    \"moleza\",\n    \"molho\",\n    \"molinete\",\n    \"molusco\",\n    \"montanha\",\n    \"moqueca\",\n    \"morango\",\n    \"morcego\",\n    \"mordomo\",\n    \"morena\",\n    \"mosaico\",\n    \"mosquete\",\n    \"mostarda\",\n    \"motel\",\n    \"motim\",\n    \"moto\",\n    \"motriz\",\n    \"muda\",\n    \"muito\",\n    \"mulata\",\n    \"mulher\",\n    \"multar\",\n    \"mundial\",\n    \"munido\",\n    \"muralha\",\n    \"murcho\",\n    \"muscular\",\n    \"museu\",\n    \"musical\",\n    \"nacional\",\n    \"nadador\",\n    \"naja\",\n    \"namoro\",\n    \"narina\",\n    \"narrado\",\n    \"nascer\",\n    \"nativa\",\n    \"natureza\",\n    \"navalha\",\n    \"navegar\",\n    \"navio\",\n    \"neblina\",\n    \"nebuloso\",\n    \"negativa\",\n    \"negociar\",\n    \"negrito\",\n    \"nervoso\",\n    \"neta\",\n    \"neural\",\n    \"nevasca\",\n    \"nevoeiro\",\n    \"ninar\",\n    \"ninho\",\n    \"nitidez\",\n    \"nivelar\",\n    \"nobreza\",\n    \"noite\",\n    \"noiva\",\n    \"nomear\",\n    \"nominal\",\n    \"nordeste\",\n    \"nortear\",\n    \"notar\",\n    \"noticiar\",\n    \"noturno\",\n    \"novelo\",\n    \"novilho\",\n    \"novo\",\n    \"nublado\",\n    \"nudez\",\n    \"numeral\",\n    \"nupcial\",\n    \"nutrir\",\n    \"nuvem\",\n    \"obcecado\",\n    \"obedecer\",\n    \"objetivo\",\n    \"obrigado\",\n    \"obscuro\",\n    \"obstetra\",\n    \"obter\",\n    \"obturar\",\n    \"ocidente\",\n    \"ocioso\",\n    \"ocorrer\",\n    \"oculista\",\n    \"ocupado\",\n    \"ofegante\",\n    \"ofensiva\",\n    \"oferenda\",\n    \"oficina\",\n    \"ofuscado\",\n    \"ogiva\",\n    \"olaria\",\n    \"oleoso\",\n    \"olhar\",\n    \"oliveira\",\n    \"ombro\",\n    \"omelete\",\n    \"omisso\",\n    \"omitir\",\n    \"ondulado\",\n    \"oneroso\",\n    \"ontem\",\n    \"opcional\",\n    \"operador\",\n    \"oponente\",\n    \"oportuno\",\n    \"oposto\",\n    \"orar\",\n    \"orbitar\",\n    \"ordem\",\n    \"ordinal\",\n    \"orfanato\",\n    \"orgasmo\",\n    \"orgulho\",\n    \"oriental\",\n    \"origem\",\n    \"oriundo\",\n    \"orla\",\n    \"ortodoxo\",\n    \"orvalho\",\n    \"oscilar\",\n    \"ossada\",\n    \"osso\",\n    \"ostentar\",\n    \"otimismo\",\n    \"ousadia\",\n    \"outono\",\n    \"outubro\",\n    \"ouvido\",\n    \"ovelha\",\n    \"ovular\",\n    \"oxidar\",\n    \"oxigenar\",\n    \"pacato\",\n    \"paciente\",\n    \"pacote\",\n    \"pactuar\",\n    \"padaria\",\n    \"padrinho\",\n    \"pagar\",\n    \"pagode\",\n    \"painel\",\n    \"pairar\",\n    \"paisagem\",\n    \"palavra\",\n    \"palestra\",\n    \"palheta\",\n    \"palito\",\n    \"palmada\",\n    \"palpitar\",\n    \"pancada\",\n    \"panela\",\n    \"panfleto\",\n    \"panqueca\",\n    \"pantanal\",\n    \"papagaio\",\n    \"papelada\",\n    \"papiro\",\n    \"parafina\",\n    \"parcial\",\n    \"pardal\",\n    \"parede\",\n    \"partida\",\n    \"pasmo\",\n    \"passado\",\n    \"pastel\",\n    \"patamar\",\n    \"patente\",\n    \"patinar\",\n    \"patrono\",\n    \"paulada\",\n    \"pausar\",\n    \"peculiar\",\n    \"pedalar\",\n    \"pedestre\",\n    \"pediatra\",\n    \"pedra\",\n    \"pegada\",\n    \"peitoral\",\n    \"peixe\",\n    \"pele\",\n    \"pelicano\",\n    \"penca\",\n    \"pendurar\",\n    \"peneira\",\n    \"penhasco\",\n    \"pensador\",\n    \"pente\",\n    \"perceber\",\n    \"perfeito\",\n    \"pergunta\",\n    \"perito\",\n    \"permitir\",\n    \"perna\",\n    \"perplexo\",\n    \"persiana\",\n    \"pertence\",\n    \"peruca\",\n    \"pescado\",\n    \"pesquisa\",\n    \"pessoa\",\n    \"petiscar\",\n    \"piada\",\n    \"picado\",\n    \"piedade\",\n    \"pigmento\",\n    \"pilastra\",\n    \"pilhado\",\n    \"pilotar\",\n    \"pimenta\",\n    \"pincel\",\n    \"pinguim\",\n    \"pinha\",\n    \"pinote\",\n    \"pintar\",\n    \"pioneiro\",\n    \"pipoca\",\n    \"piquete\",\n    \"piranha\",\n    \"pires\",\n    \"pirueta\",\n    \"piscar\",\n    \"pistola\",\n    \"pitanga\",\n    \"pivete\",\n    \"planta\",\n    \"plaqueta\",\n    \"platina\",\n    \"plebeu\",\n    \"plumagem\",\n    \"pluvial\",\n    \"pneu\",\n    \"poda\",\n    \"poeira\",\n    \"poetisa\",\n    \"polegada\",\n    \"policiar\",\n    \"poluente\",\n    \"polvilho\",\n    \"pomar\",\n    \"pomba\",\n    \"ponderar\",\n    \"pontaria\",\n    \"populoso\",\n    \"porta\",\n    \"possuir\",\n    \"postal\",\n    \"pote\",\n    \"poupar\",\n    \"pouso\",\n    \"povoar\",\n    \"praia\",\n    \"prancha\",\n    \"prato\",\n    \"praxe\",\n    \"prece\",\n    \"predador\",\n    \"prefeito\",\n    \"premiar\",\n    \"prensar\",\n    \"preparar\",\n    \"presilha\",\n    \"pretexto\",\n    \"prevenir\",\n    \"prezar\",\n    \"primata\",\n    \"princesa\",\n    \"prisma\",\n    \"privado\",\n    \"processo\",\n    \"produto\",\n    \"profeta\",\n    \"proibido\",\n    \"projeto\",\n    \"prometer\",\n    \"propagar\",\n    \"prosa\",\n    \"protetor\",\n    \"provador\",\n    \"publicar\",\n    \"pudim\",\n    \"pular\",\n    \"pulmonar\",\n    \"pulseira\",\n    \"punhal\",\n    \"punir\",\n    \"pupilo\",\n    \"pureza\",\n    \"puxador\",\n    \"quadra\",\n    \"quantia\",\n    \"quarto\",\n    \"quase\",\n    \"quebrar\",\n    \"queda\",\n    \"queijo\",\n    \"quente\",\n    \"querido\",\n    \"quimono\",\n    \"quina\",\n    \"quiosque\",\n    \"rabanada\",\n    \"rabisco\",\n    \"rachar\",\n    \"racionar\",\n    \"radial\",\n    \"raiar\",\n    \"rainha\",\n    \"raio\",\n    \"raiva\",\n    \"rajada\",\n    \"ralado\",\n    \"ramal\",\n    \"ranger\",\n    \"ranhura\",\n    \"rapadura\",\n    \"rapel\",\n    \"rapidez\",\n    \"raposa\",\n    \"raquete\",\n    \"raridade\",\n    \"rasante\",\n    \"rascunho\",\n    \"rasgar\",\n    \"raspador\",\n    \"rasteira\",\n    \"rasurar\",\n    \"ratazana\",\n    \"ratoeira\",\n    \"realeza\",\n    \"reanimar\",\n    \"reaver\",\n    \"rebaixar\",\n    \"rebelde\",\n    \"rebolar\",\n    \"recado\",\n    \"recente\",\n    \"recheio\",\n    \"recibo\",\n    \"recordar\",\n    \"recrutar\",\n    \"recuar\",\n    \"rede\",\n    \"redimir\",\n    \"redonda\",\n    \"reduzida\",\n    \"reenvio\",\n    \"refinar\",\n    \"refletir\",\n    \"refogar\",\n    \"refresco\",\n    \"refugiar\",\n    \"regalia\",\n    \"regime\",\n    \"regra\",\n    \"reinado\",\n    \"reitor\",\n    \"rejeitar\",\n    \"relativo\",\n    \"remador\",\n    \"remendo\",\n    \"remorso\",\n    \"renovado\",\n    \"reparo\",\n    \"repelir\",\n    \"repleto\",\n    \"repolho\",\n    \"represa\",\n    \"repudiar\",\n    \"requerer\",\n    \"resenha\",\n    \"resfriar\",\n    \"resgatar\",\n    \"residir\",\n    \"resolver\",\n    \"respeito\",\n    \"ressaca\",\n    \"restante\",\n    \"resumir\",\n    \"retalho\",\n    \"reter\",\n    \"retirar\",\n    \"retomada\",\n    \"retratar\",\n    \"revelar\",\n    \"revisor\",\n    \"revolta\",\n    \"riacho\",\n    \"rica\",\n    \"rigidez\",\n    \"rigoroso\",\n    \"rimar\",\n    \"ringue\",\n    \"risada\",\n    \"risco\",\n    \"risonho\",\n    \"robalo\",\n    \"rochedo\",\n    \"rodada\",\n    \"rodeio\",\n    \"rodovia\",\n    \"roedor\",\n    \"roleta\",\n    \"romano\",\n    \"roncar\",\n    \"rosado\",\n    \"roseira\",\n    \"rosto\",\n    \"rota\",\n    \"roteiro\",\n    \"rotina\",\n    \"rotular\",\n    \"rouco\",\n    \"roupa\",\n    \"roxo\",\n    \"rubro\",\n    \"rugido\",\n    \"rugoso\",\n    \"ruivo\",\n    \"rumo\",\n    \"rupestre\",\n    \"russo\",\n    \"sabor\",\n    \"saciar\",\n    \"sacola\",\n    \"sacudir\",\n    \"sadio\",\n    \"safira\",\n    \"saga\",\n    \"sagrada\",\n    \"saibro\",\n    \"salada\",\n    \"saleiro\",\n    \"salgado\",\n    \"saliva\",\n    \"salpicar\",\n    \"salsicha\",\n    \"saltar\",\n    \"salvador\",\n    \"sambar\",\n    \"samurai\",\n    \"sanar\",\n    \"sanfona\",\n    \"sangue\",\n    \"sanidade\",\n    \"sapato\",\n    \"sarda\",\n    \"sargento\",\n    \"sarjeta\",\n    \"saturar\",\n    \"saudade\",\n    \"saxofone\",\n    \"sazonal\",\n    \"secar\",\n    \"secular\",\n    \"seda\",\n    \"sedento\",\n    \"sediado\",\n    \"sedoso\",\n    \"sedutor\",\n    \"segmento\",\n    \"segredo\",\n    \"segundo\",\n    \"seiva\",\n    \"seleto\",\n    \"selvagem\",\n    \"semanal\",\n    \"semente\",\n    \"senador\",\n    \"senhor\",\n    \"sensual\",\n    \"sentado\",\n    \"separado\",\n    \"sereia\",\n    \"seringa\",\n    \"serra\",\n    \"servo\",\n    \"setembro\",\n    \"setor\",\n    \"sigilo\",\n    \"silhueta\",\n    \"silicone\",\n    \"simetria\",\n    \"simpatia\",\n    \"simular\",\n    \"sinal\",\n    \"sincero\",\n    \"singular\",\n    \"sinopse\",\n    \"sintonia\",\n    \"sirene\",\n    \"siri\",\n    \"situado\",\n    \"soberano\",\n    \"sobra\",\n    \"socorro\",\n    \"sogro\",\n    \"soja\",\n    \"solda\",\n    \"soletrar\",\n    \"solteiro\",\n    \"sombrio\",\n    \"sonata\",\n    \"sondar\",\n    \"sonegar\",\n    \"sonhador\",\n    \"sono\",\n    \"soprano\",\n    \"soquete\",\n    \"sorrir\",\n    \"sorteio\",\n    \"sossego\",\n    \"sotaque\",\n    \"soterrar\",\n    \"sovado\",\n    \"sozinho\",\n    \"suavizar\",\n    \"subida\",\n    \"submerso\",\n    \"subsolo\",\n    \"subtrair\",\n    \"sucata\",\n    \"sucesso\",\n    \"suco\",\n    \"sudeste\",\n    \"sufixo\",\n    \"sugador\",\n    \"sugerir\",\n    \"sujeito\",\n    \"sulfato\",\n    \"sumir\",\n    \"suor\",\n    \"superior\",\n    \"suplicar\",\n    \"suposto\",\n    \"suprimir\",\n    \"surdina\",\n    \"surfista\",\n    \"surpresa\",\n    \"surreal\",\n    \"surtir\",\n    \"suspiro\",\n    \"sustento\",\n    \"tabela\",\n    \"tablete\",\n    \"tabuada\",\n    \"tacho\",\n    \"tagarela\",\n    \"talher\",\n    \"talo\",\n    \"talvez\",\n    \"tamanho\",\n    \"tamborim\",\n    \"tampa\",\n    \"tangente\",\n    \"tanto\",\n    \"tapar\",\n    \"tapioca\",\n    \"tardio\",\n    \"tarefa\",\n    \"tarja\",\n    \"tarraxa\",\n    \"tatuagem\",\n    \"taurino\",\n    \"taxativo\",\n    \"taxista\",\n    \"teatral\",\n    \"tecer\",\n    \"tecido\",\n    \"teclado\",\n    \"tedioso\",\n    \"teia\",\n    \"teimar\",\n    \"telefone\",\n    \"telhado\",\n    \"tempero\",\n    \"tenente\",\n    \"tensor\",\n    \"tentar\",\n    \"termal\",\n    \"terno\",\n    \"terreno\",\n    \"tese\",\n    \"tesoura\",\n    \"testado\",\n    \"teto\",\n    \"textura\",\n    \"texugo\",\n    \"tiara\",\n    \"tigela\",\n    \"tijolo\",\n    \"timbrar\",\n    \"timidez\",\n    \"tingido\",\n    \"tinteiro\",\n    \"tiragem\",\n    \"titular\",\n    \"toalha\",\n    \"tocha\",\n    \"tolerar\",\n    \"tolice\",\n    \"tomada\",\n    \"tomilho\",\n    \"tonel\",\n    \"tontura\",\n    \"topete\",\n    \"tora\",\n    \"torcido\",\n    \"torneio\",\n    \"torque\",\n    \"torrada\",\n    \"torto\",\n    \"tostar\",\n    \"touca\",\n    \"toupeira\",\n    \"toxina\",\n    \"trabalho\",\n    \"tracejar\",\n    \"tradutor\",\n    \"trafegar\",\n    \"trajeto\",\n    \"trama\",\n    \"trancar\",\n    \"trapo\",\n    \"traseiro\",\n    \"tratador\",\n    \"travar\",\n    \"treino\",\n    \"tremer\",\n    \"trepidar\",\n    \"trevo\",\n    \"triagem\",\n    \"tribo\",\n    \"triciclo\",\n    \"tridente\",\n    \"trilogia\",\n    \"trindade\",\n    \"triplo\",\n    \"triturar\",\n    \"triunfal\",\n    \"trocar\",\n    \"trombeta\",\n    \"trova\",\n    \"trunfo\",\n    \"truque\",\n    \"tubular\",\n    \"tucano\",\n    \"tudo\",\n    \"tulipa\",\n    \"tupi\",\n    \"turbo\",\n    \"turma\",\n    \"turquesa\",\n    \"tutelar\",\n    \"tutorial\",\n    \"uivar\",\n    \"umbigo\",\n    \"unha\",\n    \"unidade\",\n    \"uniforme\",\n    \"urologia\",\n    \"urso\",\n    \"urtiga\",\n    \"urubu\",\n    \"usado\",\n    \"usina\",\n    \"usufruir\",\n    \"vacina\",\n    \"vadiar\",\n    \"vagaroso\",\n    \"vaidoso\",\n    \"vala\",\n    \"valente\",\n    \"validade\",\n    \"valores\",\n    \"vantagem\",\n    \"vaqueiro\",\n    \"varanda\",\n    \"vareta\",\n    \"varrer\",\n    \"vascular\",\n    \"vasilha\",\n    \"vassoura\",\n    \"vazar\",\n    \"vazio\",\n    \"veado\",\n    \"vedar\",\n    \"vegetar\",\n    \"veicular\",\n    \"veleiro\",\n    \"velhice\",\n    \"veludo\",\n    \"vencedor\",\n    \"vendaval\",\n    \"venerar\",\n    \"ventre\",\n    \"verbal\",\n    \"verdade\",\n    \"vereador\",\n    \"vergonha\",\n    \"vermelho\",\n    \"verniz\",\n    \"versar\",\n    \"vertente\",\n    \"vespa\",\n    \"vestido\",\n    \"vetorial\",\n    \"viaduto\",\n    \"viagem\",\n    \"viajar\",\n    \"viatura\",\n    \"vibrador\",\n    \"videira\",\n    \"vidraria\",\n    \"viela\",\n    \"viga\",\n    \"vigente\",\n    \"vigiar\",\n    \"vigorar\",\n    \"vilarejo\",\n    \"vinco\",\n    \"vinheta\",\n    \"vinil\",\n    \"violeta\",\n    \"virada\",\n    \"virtude\",\n    \"visitar\",\n    \"visto\",\n    \"vitral\",\n    \"viveiro\",\n    \"vizinho\",\n    \"voador\",\n    \"voar\",\n    \"vogal\",\n    \"volante\",\n    \"voleibol\",\n    \"voltagem\",\n    \"volumoso\",\n    \"vontade\",\n    \"vulto\",\n    \"vuvuzela\",\n    \"xadrez\",\n    \"xarope\",\n    \"xeque\",\n    \"xeretar\",\n    \"xerife\",\n    \"xingar\",\n    \"zangado\",\n    \"zarpar\",\n    \"zebu\",\n    \"zelador\",\n    \"zombar\",\n    \"zoologia\",\n    \"zumbido\"\n]\n[\n    \"ábaco\",\n    \"abdomen\",\n    \"abeja\",\n    \"abierto\",\n    \"abogado\",\n    \"abono\",\n    \"aborto\",\n    \"abrazo\",\n    \"abrir\",\n    \"abuelo\",\n    \"abuso\",\n    \"acabar\",\n    \"academia\",\n    \"acceso\",\n    \"acción\",\n    \"aceite\",\n    \"acelga\",\n    \"acento\",\n    \"aceptar\",\n    \"ácido\",\n    \"aclarar\",\n    \"acné\",\n    \"acoger\",\n    \"acoso\",\n    \"activo\",\n    \"acto\",\n    \"actriz\",\n    \"actuar\",\n    \"acudir\",\n    \"acuerdo\",\n    \"acusar\",\n    \"adicto\",\n    \"admitir\",\n    \"adoptar\",\n    \"adorno\",\n    \"aduana\",\n    \"adulto\",\n    \"aéreo\",\n    \"afectar\",\n    \"afición\",\n    \"afinar\",\n    \"afirmar\",\n    \"ágil\",\n    \"agitar\",\n    \"agonía\",\n    \"agosto\",\n    \"agotar\",\n    \"agregar\",\n    \"agrio\",\n    \"agua\",\n    \"agudo\",\n    \"águila\",\n    \"aguja\",\n    \"ahogo\",\n    \"ahorro\",\n    \"aire\",\n    \"aislar\",\n    \"ajedrez\",\n    \"ajeno\",\n    \"ajuste\",\n    \"alacrán\",\n    \"alambre\",\n    \"alarma\",\n    \"alba\",\n    \"álbum\",\n    \"alcalde\",\n    \"aldea\",\n    \"alegre\",\n    \"alejar\",\n    \"alerta\",\n    \"aleta\",\n    \"alfiler\",\n    \"alga\",\n    \"algodón\",\n    \"aliado\",\n    \"aliento\",\n    \"alivio\",\n    \"alma\",\n    \"almeja\",\n    \"almíbar\",\n    \"altar\",\n    \"alteza\",\n    \"altivo\",\n    \"alto\",\n    \"altura\",\n    \"alumno\",\n    \"alzar\",\n    \"amable\",\n    \"amante\",\n    \"amapola\",\n    \"amargo\",\n    \"amasar\",\n    \"ámbar\",\n    \"ámbito\",\n    \"ameno\",\n    \"amigo\",\n    \"amistad\",\n    \"amor\",\n    \"amparo\",\n    \"amplio\",\n    \"ancho\",\n    \"anciano\",\n    \"ancla\",\n    \"andar\",\n    \"andén\",\n    \"anemia\",\n    \"ángulo\",\n    \"anillo\",\n    \"ánimo\",\n    \"anís\",\n    \"anotar\",\n    \"antena\",\n    \"antiguo\",\n    \"antojo\",\n    \"anual\",\n    \"anular\",\n    \"anuncio\",\n    \"añadir\",\n    \"añejo\",\n    \"año\",\n    \"apagar\",\n    \"aparato\",\n    \"apetito\",\n    \"apio\",\n    \"aplicar\",\n    \"apodo\",\n    \"aporte\",\n    \"apoyo\",\n    \"aprender\",\n    \"aprobar\",\n    \"apuesta\",\n    \"apuro\",\n    \"arado\",\n    \"araña\",\n    \"arar\",\n    \"árbitro\",\n    \"árbol\",\n    \"arbusto\",\n    \"archivo\",\n    \"arco\",\n    \"arder\",\n    \"ardilla\",\n    \"arduo\",\n    \"área\",\n    \"árido\",\n    \"aries\",\n    \"armonía\",\n    \"arnés\",\n    \"aroma\",\n    \"arpa\",\n    \"arpón\",\n    \"arreglo\",\n    \"arroz\",\n    \"arruga\",\n    \"arte\",\n    \"artista\",\n    \"asa\",\n    \"asado\",\n    \"asalto\",\n    \"ascenso\",\n    \"asegurar\",\n    \"aseo\",\n    \"asesor\",\n    \"asiento\",\n    \"asilo\",\n    \"asistir\",\n    \"asno\",\n    \"asombro\",\n    \"áspero\",\n    \"astilla\",\n    \"astro\",\n    \"astuto\",\n    \"asumir\",\n    \"asunto\",\n    \"atajo\",\n    \"ataque\",\n    \"atar\",\n    \"atento\",\n    \"ateo\",\n    \"ático\",\n    \"atleta\",\n    \"átomo\",\n    \"atraer\",\n    \"atroz\",\n    \"atún\",\n    \"audaz\",\n    \"audio\",\n    \"auge\",\n    \"aula\",\n    \"aumento\",\n    \"ausente\",\n    \"autor\",\n    \"aval\",\n    \"avance\",\n    \"avaro\",\n    \"ave\",\n    \"avellana\",\n    \"avena\",\n    \"avestruz\",\n    \"avión\",\n    \"aviso\",\n    \"ayer\",\n    \"ayuda\",\n    \"ayuno\",\n    \"azafrán\",\n    \"azar\",\n    \"azote\",\n    \"azúcar\",\n    \"azufre\",\n    \"azul\",\n    \"baba\",\n    \"babor\",\n    \"bache\",\n    \"bahía\",\n    \"baile\",\n    \"bajar\",\n    \"balanza\",\n    \"balcón\",\n    \"balde\",\n    \"bambú\",\n    \"banco\",\n    \"banda\",\n    \"baño\",\n    \"barba\",\n    \"barco\",\n    \"barniz\",\n    \"barro\",\n    \"báscula\",\n    \"bastón\",\n    \"basura\",\n    \"batalla\",\n    \"batería\",\n    \"batir\",\n    \"batuta\",\n    \"baúl\",\n    \"bazar\",\n    \"bebé\",\n    \"bebida\",\n    \"bello\",\n    \"besar\",\n    \"beso\",\n    \"bestia\",\n    \"bicho\",\n    \"bien\",\n    \"bingo\",\n    \"blanco\",\n    \"bloque\",\n    \"blusa\",\n    \"boa\",\n    \"bobina\",\n    \"bobo\",\n    \"boca\",\n    \"bocina\",\n    \"boda\",\n    \"bodega\",\n    \"boina\",\n    \"bola\",\n    \"bolero\",\n    \"bolsa\",\n    \"bomba\",\n    \"bondad\",\n    \"bonito\",\n    \"bono\",\n    \"bonsái\",\n    \"borde\",\n    \"borrar\",\n    \"bosque\",\n    \"bote\",\n    \"botín\",\n    \"bóveda\",\n    \"bozal\",\n    \"bravo\",\n    \"brazo\",\n    \"brecha\",\n    \"breve\",\n    \"brillo\",\n    \"brinco\",\n    \"brisa\",\n    \"broca\",\n    \"broma\",\n    \"bronce\",\n    \"brote\",\n    \"bruja\",\n    \"brusco\",\n    \"bruto\",\n    \"buceo\",\n    \"bucle\",\n    \"bueno\",\n    \"buey\",\n    \"bufanda\",\n    \"bufón\",\n    \"búho\",\n    \"buitre\",\n    \"bulto\",\n    \"burbuja\",\n    \"burla\",\n    \"burro\",\n    \"buscar\",\n    \"butaca\",\n    \"buzón\",\n    \"caballo\",\n    \"cabeza\",\n    \"cabina\",\n    \"cabra\",\n    \"cacao\",\n    \"cadáver\",\n    \"cadena\",\n    \"caer\",\n    \"café\",\n    \"caída\",\n    \"caimán\",\n    \"caja\",\n    \"cajón\",\n    \"cal\",\n    \"calamar\",\n    \"calcio\",\n    \"caldo\",\n    \"calidad\",\n    \"calle\",\n    \"calma\",\n    \"calor\",\n    \"calvo\",\n    \"cama\",\n    \"cambio\",\n    \"camello\",\n    \"camino\",\n    \"campo\",\n    \"cáncer\",\n    \"candil\",\n    \"canela\",\n    \"canguro\",\n    \"canica\",\n    \"canto\",\n    \"caña\",\n    \"cañón\",\n    \"caoba\",\n    \"caos\",\n    \"capaz\",\n    \"capitán\",\n    \"capote\",\n    \"captar\",\n    \"capucha\",\n    \"cara\",\n    \"carbón\",\n    \"cárcel\",\n    \"careta\",\n    \"carga\",\n    \"cariño\",\n    \"carne\",\n    \"carpeta\",\n    \"carro\",\n    \"carta\",\n    \"casa\",\n    \"casco\",\n    \"casero\",\n    \"caspa\",\n    \"castor\",\n    \"catorce\",\n    \"catre\",\n    \"caudal\",\n    \"causa\",\n    \"cazo\",\n    \"cebolla\",\n    \"ceder\",\n    \"cedro\",\n    \"celda\",\n    \"célebre\",\n    \"celoso\",\n    \"célula\",\n    \"cemento\",\n    \"ceniza\",\n    \"centro\",\n    \"cerca\",\n    \"cerdo\",\n    \"cereza\",\n    \"cero\",\n    \"cerrar\",\n    \"certeza\",\n    \"césped\",\n    \"cetro\",\n    \"chacal\",\n    \"chaleco\",\n    \"champú\",\n    \"chancla\",\n    \"chapa\",\n    \"charla\",\n    \"chico\",\n    \"chiste\",\n    \"chivo\",\n    \"choque\",\n    \"choza\",\n    \"chuleta\",\n    \"chupar\",\n    \"ciclón\",\n    \"ciego\",\n    \"cielo\",\n    \"cien\",\n    \"cierto\",\n    \"cifra\",\n    \"cigarro\",\n    \"cima\",\n    \"cinco\",\n    \"cine\",\n    \"cinta\",\n    \"ciprés\",\n    \"circo\",\n    \"ciruela\",\n    \"cisne\",\n    \"cita\",\n    \"ciudad\",\n    \"clamor\",\n    \"clan\",\n    \"claro\",\n    \"clase\",\n    \"clave\",\n    \"cliente\",\n    \"clima\",\n    \"clínica\",\n    \"cobre\",\n    \"cocción\",\n    \"cochino\",\n    \"cocina\",\n    \"coco\",\n    \"código\",\n    \"codo\",\n    \"cofre\",\n    \"coger\",\n    \"cohete\",\n    \"cojín\",\n    \"cojo\",\n    \"cola\",\n    \"colcha\",\n    \"colegio\",\n    \"colgar\",\n    \"colina\",\n    \"collar\",\n    \"colmo\",\n    \"columna\",\n    \"combate\",\n    \"comer\",\n    \"comida\",\n    \"cómodo\",\n    \"compra\",\n    \"conde\",\n    \"conejo\",\n    \"conga\",\n    \"conocer\",\n    \"consejo\",\n    \"contar\",\n    \"copa\",\n    \"copia\",\n    \"corazón\",\n    \"corbata\",\n    \"corcho\",\n    \"cordón\",\n    \"corona\",\n    \"correr\",\n    \"coser\",\n    \"cosmos\",\n    \"costa\",\n    \"cráneo\",\n    \"cráter\",\n    \"crear\",\n    \"crecer\",\n    \"creído\",\n    \"crema\",\n    \"cría\",\n    \"crimen\",\n    \"cripta\",\n    \"crisis\",\n    \"cromo\",\n    \"crónica\",\n    \"croqueta\",\n    \"crudo\",\n    \"cruz\",\n    \"cuadro\",\n    \"cuarto\",\n    \"cuatro\",\n    \"cubo\",\n    \"cubrir\",\n    \"cuchara\",\n    \"cuello\",\n    \"cuento\",\n    \"cuerda\",\n    \"cuesta\",\n    \"cueva\",\n    \"cuidar\",\n    \"culebra\",\n    \"culpa\",\n    \"culto\",\n    \"cumbre\",\n    \"cumplir\",\n    \"cuna\",\n    \"cuneta\",\n    \"cuota\",\n    \"cupón\",\n    \"cúpula\",\n    \"curar\",\n    \"curioso\",\n    \"curso\",\n    \"curva\",\n    \"cutis\",\n    \"dama\",\n    \"danza\",\n    \"dar\",\n    \"dardo\",\n    \"dátil\",\n    \"deber\",\n    \"débil\",\n    \"década\",\n    \"decir\",\n    \"dedo\",\n    \"defensa\",\n    \"definir\",\n    \"dejar\",\n    \"delfín\",\n    \"delgado\",\n    \"delito\",\n    \"demora\",\n    \"denso\",\n    \"dental\",\n    \"deporte\",\n    \"derecho\",\n    \"derrota\",\n    \"desayuno\",\n    \"deseo\",\n    \"desfile\",\n    \"desnudo\",\n    \"destino\",\n    \"desvío\",\n    \"detalle\",\n    \"detener\",\n    \"deuda\",\n    \"día\",\n    \"diablo\",\n    \"diadema\",\n    \"diamante\",\n    \"diana\",\n    \"diario\",\n    \"dibujo\",\n    \"dictar\",\n    \"diente\",\n    \"dieta\",\n    \"diez\",\n    \"difícil\",\n    \"digno\",\n    \"dilema\",\n    \"diluir\",\n    \"dinero\",\n    \"directo\",\n    \"dirigir\",\n    \"disco\",\n    \"diseño\",\n    \"disfraz\",\n    \"diva\",\n    \"divino\",\n    \"doble\",\n    \"doce\",\n    \"dolor\",\n    \"domingo\",\n    \"don\",\n    \"donar\",\n    \"dorado\",\n    \"dormir\",\n    \"dorso\",\n    \"dos\",\n    \"dosis\",\n    \"dragón\",\n    \"droga\",\n    \"ducha\",\n    \"duda\",\n    \"duelo\",\n    \"dueño\",\n    \"dulce\",\n    \"dúo\",\n    \"duque\",\n    \"durar\",\n    \"dureza\",\n    \"duro\",\n    \"ébano\",\n    \"ebrio\",\n    \"echar\",\n    \"eco\",\n    \"ecuador\",\n    \"edad\",\n    \"edición\",\n    \"edificio\",\n    \"editor\",\n    \"educar\",\n    \"efecto\",\n    \"eficaz\",\n    \"eje\",\n    \"ejemplo\",\n    \"elefante\",\n    \"elegir\",\n    \"elemento\",\n    \"elevar\",\n    \"elipse\",\n    \"élite\",\n    \"elixir\",\n    \"elogio\",\n    \"eludir\",\n    \"embudo\",\n    \"emitir\",\n    \"emoción\",\n    \"empate\",\n    \"empeño\",\n    \"empleo\",\n    \"empresa\",\n    \"enano\",\n    \"encargo\",\n    \"enchufe\",\n    \"encía\",\n    \"enemigo\",\n    \"enero\",\n    \"enfado\",\n    \"enfermo\",\n    \"engaño\",\n    \"enigma\",\n    \"enlace\",\n    \"enorme\",\n    \"enredo\",\n    \"ensayo\",\n    \"enseñar\",\n    \"entero\",\n    \"entrar\",\n    \"envase\",\n    \"envío\",\n    \"época\",\n    \"equipo\",\n    \"erizo\",\n    \"escala\",\n    \"escena\",\n    \"escolar\",\n    \"escribir\",\n    \"escudo\",\n    \"esencia\",\n    \"esfera\",\n    \"esfuerzo\",\n    \"espada\",\n    \"espejo\",\n    \"espía\",\n    \"esposa\",\n    \"espuma\",\n    \"esquí\",\n    \"estar\",\n    \"este\",\n    \"estilo\",\n    \"estufa\",\n    \"etapa\",\n    \"eterno\",\n    \"ética\",\n    \"etnia\",\n    \"evadir\",\n    \"evaluar\",\n    \"evento\",\n    \"evitar\",\n    \"exacto\",\n    \"examen\",\n    \"exceso\",\n    \"excusa\",\n    \"exento\",\n    \"exigir\",\n    \"exilio\",\n    \"existir\",\n    \"éxito\",\n    \"experto\",\n    \"explicar\",\n    \"exponer\",\n    \"extremo\",\n    \"fábrica\",\n    \"fábula\",\n    \"fachada\",\n    \"fácil\",\n    \"factor\",\n    \"faena\",\n    \"faja\",\n    \"falda\",\n    \"fallo\",\n    \"falso\",\n    \"faltar\",\n    \"fama\",\n    \"familia\",\n    \"famoso\",\n    \"faraón\",\n    \"farmacia\",\n    \"farol\",\n    \"farsa\",\n    \"fase\",\n    \"fatiga\",\n    \"fauna\",\n    \"favor\",\n    \"fax\",\n    \"febrero\",\n    \"fecha\",\n    \"feliz\",\n    \"feo\",\n    \"feria\",\n    \"feroz\",\n    \"fértil\",\n    \"fervor\",\n    \"festín\",\n    \"fiable\",\n    \"fianza\",\n    \"fiar\",\n    \"fibra\",\n    \"ficción\",\n    \"ficha\",\n    \"fideo\",\n    \"fiebre\",\n    \"fiel\",\n    \"fiera\",\n    \"fiesta\",\n    \"figura\",\n    \"fijar\",\n    \"fijo\",\n    \"fila\",\n    \"filete\",\n    \"filial\",\n    \"filtro\",\n    \"fin\",\n    \"finca\",\n    \"fingir\",\n    \"finito\",\n    \"firma\",\n    \"flaco\",\n    \"flauta\",\n    \"flecha\",\n    \"flor\",\n    \"flota\",\n    \"fluir\",\n    \"flujo\",\n    \"flúor\",\n    \"fobia\",\n    \"foca\",\n    \"fogata\",\n    \"fogón\",\n    \"folio\",\n    \"folleto\",\n    \"fondo\",\n    \"forma\",\n    \"forro\",\n    \"fortuna\",\n    \"forzar\",\n    \"fosa\",\n    \"foto\",\n    \"fracaso\",\n    \"frágil\",\n    \"franja\",\n    \"frase\",\n    \"fraude\",\n    \"freír\",\n    \"freno\",\n    \"fresa\",\n    \"frío\",\n    \"frito\",\n    \"fruta\",\n    \"fuego\",\n    \"fuente\",\n    \"fuerza\",\n    \"fuga\",\n    \"fumar\",\n    \"función\",\n    \"funda\",\n    \"furgón\",\n    \"furia\",\n    \"fusil\",\n    \"fútbol\",\n    \"futuro\",\n    \"gacela\",\n    \"gafas\",\n    \"gaita\",\n    \"gajo\",\n    \"gala\",\n    \"galería\",\n    \"gallo\",\n    \"gamba\",\n    \"ganar\",\n    \"gancho\",\n    \"ganga\",\n    \"ganso\",\n    \"garaje\",\n    \"garza\",\n    \"gasolina\",\n    \"gastar\",\n    \"gato\",\n    \"gavilán\",\n    \"gemelo\",\n    \"gemir\",\n    \"gen\",\n    \"género\",\n    \"genio\",\n    \"gente\",\n    \"geranio\",\n    \"gerente\",\n    \"germen\",\n    \"gesto\",\n    \"gigante\",\n    \"gimnasio\",\n    \"girar\",\n    \"giro\",\n    \"glaciar\",\n    \"globo\",\n    \"gloria\",\n    \"gol\",\n    \"golfo\",\n    \"goloso\",\n    \"golpe\",\n    \"goma\",\n    \"gordo\",\n    \"gorila\",\n    \"gorra\",\n    \"gota\",\n    \"goteo\",\n    \"gozar\",\n    \"grada\",\n    \"gráfico\",\n    \"grano\",\n    \"grasa\",\n    \"gratis\",\n    \"grave\",\n    \"grieta\",\n    \"grillo\",\n    \"gripe\",\n    \"gris\",\n    \"grito\",\n    \"grosor\",\n    \"grúa\",\n    \"grueso\",\n    \"grumo\",\n    \"grupo\",\n    \"guante\",\n    \"guapo\",\n    \"guardia\",\n    \"guerra\",\n    \"guía\",\n    \"guiño\",\n    \"guion\",\n    \"guiso\",\n    \"guitarra\",\n    \"gusano\",\n    \"gustar\",\n    \"haber\",\n    \"hábil\",\n    \"hablar\",\n    \"hacer\",\n    \"hacha\",\n    \"hada\",\n    \"hallar\",\n    \"hamaca\",\n    \"harina\",\n    \"haz\",\n    \"hazaña\",\n    \"hebilla\",\n    \"hebra\",\n    \"hecho\",\n    \"helado\",\n    \"helio\",\n    \"hembra\",\n    \"herir\",\n    \"hermano\",\n    \"héroe\",\n    \"hervir\",\n    \"hielo\",\n    \"hierro\",\n    \"hígado\",\n    \"higiene\",\n    \"hijo\",\n    \"himno\",\n    \"historia\",\n    \"hocico\",\n    \"hogar\",\n    \"hoguera\",\n    \"hoja\",\n    \"hombre\",\n    \"hongo\",\n    \"honor\",\n    \"honra\",\n    \"hora\",\n    \"hormiga\",\n    \"horno\",\n    \"hostil\",\n    \"hoyo\",\n    \"hueco\",\n    \"huelga\",\n    \"huerta\",\n    \"hueso\",\n    \"huevo\",\n    \"huida\",\n    \"huir\",\n    \"humano\",\n    \"húmedo\",\n    \"humilde\",\n    \"humo\",\n    \"hundir\",\n    \"huracán\",\n    \"hurto\",\n    \"icono\",\n    \"ideal\",\n    \"idioma\",\n    \"ídolo\",\n    \"iglesia\",\n    \"iglú\",\n    \"igual\",\n    \"ilegal\",\n    \"ilusión\",\n    \"imagen\",\n    \"imán\",\n    \"imitar\",\n    \"impar\",\n    \"imperio\",\n    \"imponer\",\n    \"impulso\",\n    \"incapaz\",\n    \"índice\",\n    \"inerte\",\n    \"infiel\",\n    \"informe\",\n    \"ingenio\",\n    \"inicio\",\n    \"inmenso\",\n    \"inmune\",\n    \"innato\",\n    \"insecto\",\n    \"instante\",\n    \"interés\",\n    \"íntimo\",\n    \"intuir\",\n    \"inútil\",\n    \"invierno\",\n    \"ira\",\n    \"iris\",\n    \"ironía\",\n    \"isla\",\n    \"islote\",\n    \"jabalí\",\n    \"jabón\",\n    \"jamón\",\n    \"jarabe\",\n    \"jardín\",\n    \"jarra\",\n    \"jaula\",\n    \"jazmín\",\n    \"jefe\",\n    \"jeringa\",\n    \"jinete\",\n    \"jornada\",\n    \"joroba\",\n    \"joven\",\n    \"joya\",\n    \"juerga\",\n    \"jueves\",\n    \"juez\",\n    \"jugador\",\n    \"jugo\",\n    \"juguete\",\n    \"juicio\",\n    \"junco\",\n    \"jungla\",\n    \"junio\",\n    \"juntar\",\n    \"júpiter\",\n    \"jurar\",\n    \"justo\",\n    \"juvenil\",\n    \"juzgar\",\n    \"kilo\",\n    \"koala\",\n    \"labio\",\n    \"lacio\",\n    \"lacra\",\n    \"lado\",\n    \"ladrón\",\n    \"lagarto\",\n    \"lágrima\",\n    \"laguna\",\n    \"laico\",\n    \"lamer\",\n    \"lámina\",\n    \"lámpara\",\n    \"lana\",\n    \"lancha\",\n    \"langosta\",\n    \"lanza\",\n    \"lápiz\",\n    \"largo\",\n    \"larva\",\n    \"lástima\",\n    \"lata\",\n    \"látex\",\n    \"latir\",\n    \"laurel\",\n    \"lavar\",\n    \"lazo\",\n    \"leal\",\n    \"lección\",\n    \"leche\",\n    \"lector\",\n    \"leer\",\n    \"legión\",\n    \"legumbre\",\n    \"lejano\",\n    \"lengua\",\n    \"lento\",\n    \"leña\",\n    \"león\",\n    \"leopardo\",\n    \"lesión\",\n    \"letal\",\n    \"letra\",\n    \"leve\",\n    \"leyenda\",\n    \"libertad\",\n    \"libro\",\n    \"licor\",\n    \"líder\",\n    \"lidiar\",\n    \"lienzo\",\n    \"liga\",\n    \"ligero\",\n    \"lima\",\n    \"límite\",\n    \"limón\",\n    \"limpio\",\n    \"lince\",\n    \"lindo\",\n    \"línea\",\n    \"lingote\",\n    \"lino\",\n    \"linterna\",\n    \"líquido\",\n    \"liso\",\n    \"lista\",\n    \"litera\",\n    \"litio\",\n    \"litro\",\n    \"llaga\",\n    \"llama\",\n    \"llanto\",\n    \"llave\",\n    \"llegar\",\n    \"llenar\",\n    \"llevar\",\n    \"llorar\",\n    \"llover\",\n    \"lluvia\",\n    \"lobo\",\n    \"loción\",\n    \"loco\",\n    \"locura\",\n    \"lógica\",\n    \"logro\",\n    \"lombriz\",\n    \"lomo\",\n    \"lonja\",\n    \"lote\",\n    \"lucha\",\n    \"lucir\",\n    \"lugar\",\n    \"lujo\",\n    \"luna\",\n    \"lunes\",\n    \"lupa\",\n    \"lustro\",\n    \"luto\",\n    \"luz\",\n    \"maceta\",\n    \"macho\",\n    \"madera\",\n    \"madre\",\n    \"maduro\",\n    \"maestro\",\n    \"mafia\",\n    \"magia\",\n    \"mago\",\n    \"maíz\",\n    \"maldad\",\n    \"maleta\",\n    \"malla\",\n    \"malo\",\n    \"mamá\",\n    \"mambo\",\n    \"mamut\",\n    \"manco\",\n    \"mando\",\n    \"manejar\",\n    \"manga\",\n    \"maniquí\",\n    \"manjar\",\n    \"mano\",\n    \"manso\",\n    \"manta\",\n    \"mañana\",\n    \"mapa\",\n    \"máquina\",\n    \"mar\",\n    \"marco\",\n    \"marea\",\n    \"marfil\",\n    \"margen\",\n    \"marido\",\n    \"mármol\",\n    \"marrón\",\n    \"martes\",\n    \"marzo\",\n    \"masa\",\n    \"máscara\",\n    \"masivo\",\n    \"matar\",\n    \"materia\",\n    \"matiz\",\n    \"matriz\",\n    \"máximo\",\n    \"mayor\",\n    \"mazorca\",\n    \"mecha\",\n    \"medalla\",\n    \"medio\",\n    \"médula\",\n    \"mejilla\",\n    \"mejor\",\n    \"melena\",\n    \"melón\",\n    \"memoria\",\n    \"menor\",\n    \"mensaje\",\n    \"mente\",\n    \"menú\",\n    \"mercado\",\n    \"merengue\",\n    \"mérito\",\n    \"mes\",\n    \"mesón\",\n    \"meta\",\n    \"meter\",\n    \"método\",\n    \"metro\",\n    \"mezcla\",\n    \"miedo\",\n    \"miel\",\n    \"miembro\",\n    \"miga\",\n    \"mil\",\n    \"milagro\",\n    \"militar\",\n    \"millón\",\n    \"mimo\",\n    \"mina\",\n    \"minero\",\n    \"mínimo\",\n    \"minuto\",\n    \"miope\",\n    \"mirar\",\n    \"misa\",\n    \"miseria\",\n    \"misil\",\n    \"mismo\",\n    \"mitad\",\n    \"mito\",\n    \"mochila\",\n    \"moción\",\n    \"moda\",\n    \"modelo\",\n    \"moho\",\n    \"mojar\",\n    \"molde\",\n    \"moler\",\n    \"molino\",\n    \"momento\",\n    \"momia\",\n    \"monarca\",\n    \"moneda\",\n    \"monja\",\n    \"monto\",\n    \"moño\",\n    \"morada\",\n    \"morder\",\n    \"moreno\",\n    \"morir\",\n    \"morro\",\n    \"morsa\",\n    \"mortal\",\n    \"mosca\",\n    \"mostrar\",\n    \"motivo\",\n    \"mover\",\n    \"móvil\",\n    \"mozo\",\n    \"mucho\",\n    \"mudar\",\n    \"mueble\",\n    \"muela\",\n    \"muerte\",\n    \"muestra\",\n    \"mugre\",\n    \"mujer\",\n    \"mula\",\n    \"muleta\",\n    \"multa\",\n    \"mundo\",\n    \"muñeca\",\n    \"mural\",\n    \"muro\",\n    \"músculo\",\n    \"museo\",\n    \"musgo\",\n    \"música\",\n    \"muslo\",\n    \"nácar\",\n    \"nación\",\n    \"nadar\",\n    \"naipe\",\n    \"naranja\",\n    \"nariz\",\n    \"narrar\",\n    \"nasal\",\n    \"natal\",\n    \"nativo\",\n    \"natural\",\n    \"náusea\",\n    \"naval\",\n    \"nave\",\n    \"navidad\",\n    \"necio\",\n    \"néctar\",\n    \"negar\",\n    \"negocio\",\n    \"negro\",\n    \"neón\",\n    \"nervio\",\n    \"neto\",\n    \"neutro\",\n    \"nevar\",\n    \"nevera\",\n    \"nicho\",\n    \"nido\",\n    \"niebla\",\n    \"nieto\",\n    \"niñez\",\n    \"niño\",\n    \"nítido\",\n    \"nivel\",\n    \"nobleza\",\n    \"noche\",\n    \"nómina\",\n    \"noria\",\n    \"norma\",\n    \"norte\",\n    \"nota\",\n    \"noticia\",\n    \"novato\",\n    \"novela\",\n    \"novio\",\n    \"nube\",\n    \"nuca\",\n    \"núcleo\",\n    \"nudillo\",\n    \"nudo\",\n    \"nuera\",\n    \"nueve\",\n    \"nuez\",\n    \"nulo\",\n    \"número\",\n    \"nutria\",\n    \"oasis\",\n    \"obeso\",\n    \"obispo\",\n    \"objeto\",\n    \"obra\",\n    \"obrero\",\n    \"observar\",\n    \"obtener\",\n    \"obvio\",\n    \"oca\",\n    \"ocaso\",\n    \"océano\",\n    \"ochenta\",\n    \"ocho\",\n    \"ocio\",\n    \"ocre\",\n    \"octavo\",\n    \"octubre\",\n    \"oculto\",\n    \"ocupar\",\n    \"ocurrir\",\n    \"odiar\",\n    \"odio\",\n    \"odisea\",\n    \"oeste\",\n    \"ofensa\",\n    \"oferta\",\n    \"oficio\",\n    \"ofrecer\",\n    \"ogro\",\n    \"oído\",\n    \"oír\",\n    \"ojo\",\n    \"ola\",\n    \"oleada\",\n    \"olfato\",\n    \"olivo\",\n    \"olla\",\n    \"olmo\",\n    \"olor\",\n    \"olvido\",\n    \"ombligo\",\n    \"onda\",\n    \"onza\",\n    \"opaco\",\n    \"opción\",\n    \"ópera\",\n    \"opinar\",\n    \"oponer\",\n    \"optar\",\n    \"óptica\",\n    \"opuesto\",\n    \"oración\",\n    \"orador\",\n    \"oral\",\n    \"órbita\",\n    \"orca\",\n    \"orden\",\n    \"oreja\",\n    \"órgano\",\n    \"orgía\",\n    \"orgullo\",\n    \"oriente\",\n    \"origen\",\n    \"orilla\",\n    \"oro\",\n    \"orquesta\",\n    \"oruga\",\n    \"osadía\",\n    \"oscuro\",\n    \"osezno\",\n    \"oso\",\n    \"ostra\",\n    \"otoño\",\n    \"otro\",\n    \"oveja\",\n    \"óvulo\",\n    \"óxido\",\n    \"oxígeno\",\n    \"oyente\",\n    \"ozono\",\n    \"pacto\",\n    \"padre\",\n    \"paella\",\n    \"página\",\n    \"pago\",\n    \"país\",\n    \"pájaro\",\n    \"palabra\",\n    \"palco\",\n    \"paleta\",\n    \"pálido\",\n    \"palma\",\n    \"paloma\",\n    \"palpar\",\n    \"pan\",\n    \"panal\",\n    \"pánico\",\n    \"pantera\",\n    \"pañuelo\",\n    \"papá\",\n    \"papel\",\n    \"papilla\",\n    \"paquete\",\n    \"parar\",\n    \"parcela\",\n    \"pared\",\n    \"parir\",\n    \"paro\",\n    \"párpado\",\n    \"parque\",\n    \"párrafo\",\n    \"parte\",\n    \"pasar\",\n    \"paseo\",\n    \"pasión\",\n    \"paso\",\n    \"pasta\",\n    \"pata\",\n    \"patio\",\n    \"patria\",\n    \"pausa\",\n    \"pauta\",\n    \"pavo\",\n    \"payaso\",\n    \"peatón\",\n    \"pecado\",\n    \"pecera\",\n    \"pecho\",\n    \"pedal\",\n    \"pedir\",\n    \"pegar\",\n    \"peine\",\n    \"pelar\",\n    \"peldaño\",\n    \"pelea\",\n    \"peligro\",\n    \"pellejo\",\n    \"pelo\",\n    \"peluca\",\n    \"pena\",\n    \"pensar\",\n    \"peñón\",\n    \"peón\",\n    \"peor\",\n    \"pepino\",\n    \"pequeño\",\n    \"pera\",\n    \"percha\",\n    \"perder\",\n    \"pereza\",\n    \"perfil\",\n    \"perico\",\n    \"perla\",\n    \"permiso\",\n    \"perro\",\n    \"persona\",\n    \"pesa\",\n    \"pesca\",\n    \"pésimo\",\n    \"pestaña\",\n    \"pétalo\",\n    \"petróleo\",\n    \"pez\",\n    \"pezuña\",\n    \"picar\",\n    \"pichón\",\n    \"pie\",\n    \"piedra\",\n    \"pierna\",\n    \"pieza\",\n    \"pijama\",\n    \"pilar\",\n    \"piloto\",\n    \"pimienta\",\n    \"pino\",\n    \"pintor\",\n    \"pinza\",\n    \"piña\",\n    \"piojo\",\n    \"pipa\",\n    \"pirata\",\n    \"pisar\",\n    \"piscina\",\n    \"piso\",\n    \"pista\",\n    \"pitón\",\n    \"pizca\",\n    \"placa\",\n    \"plan\",\n    \"plata\",\n    \"playa\",\n    \"plaza\",\n    \"pleito\",\n    \"pleno\",\n    \"plomo\",\n    \"pluma\",\n    \"plural\",\n    \"pobre\",\n    \"poco\",\n    \"poder\",\n    \"podio\",\n    \"poema\",\n    \"poesía\",\n    \"poeta\",\n    \"polen\",\n    \"policía\",\n    \"pollo\",\n    \"polvo\",\n    \"pomada\",\n    \"pomelo\",\n    \"pomo\",\n    \"pompa\",\n    \"poner\",\n    \"porción\",\n    \"portal\",\n    \"posada\",\n    \"poseer\",\n    \"posible\",\n    \"poste\",\n    \"potencia\",\n    \"potro\",\n    \"pozo\",\n    \"prado\",\n    \"precoz\",\n    \"pregunta\",\n    \"premio\",\n    \"prensa\",\n    \"preso\",\n    \"previo\",\n    \"primo\",\n    \"príncipe\",\n    \"prisión\",\n    \"privar\",\n    \"proa\",\n    \"probar\",\n    \"proceso\",\n    \"producto\",\n    \"proeza\",\n    \"profesor\",\n    \"programa\",\n    \"prole\",\n    \"promesa\",\n    \"pronto\",\n    \"propio\",\n    \"próximo\",\n    \"prueba\",\n    \"público\",\n    \"puchero\",\n    \"pudor\",\n    \"pueblo\",\n    \"puerta\",\n    \"puesto\",\n    \"pulga\",\n    \"pulir\",\n    \"pulmón\",\n    \"pulpo\",\n    \"pulso\",\n    \"puma\",\n    \"punto\",\n    \"puñal\",\n    \"puño\",\n    \"pupa\",\n    \"pupila\",\n    \"puré\",\n    \"quedar\",\n    \"queja\",\n    \"quemar\",\n    \"querer\",\n    \"queso\",\n    \"quieto\",\n    \"química\",\n    \"quince\",\n    \"quitar\",\n    \"rábano\",\n    \"rabia\",\n    \"rabo\",\n    \"ración\",\n    \"radical\",\n    \"raíz\",\n    \"rama\",\n    \"rampa\",\n    \"rancho\",\n    \"rango\",\n    \"rapaz\",\n    \"rápido\",\n    \"rapto\",\n    \"rasgo\",\n    \"raspa\",\n    \"rato\",\n    \"rayo\",\n    \"raza\",\n    \"razón\",\n    \"reacción\",\n    \"realidad\",\n    \"rebaño\",\n    \"rebote\",\n    \"recaer\",\n    \"receta\",\n    \"rechazo\",\n    \"recoger\",\n    \"recreo\",\n    \"recto\",\n    \"recurso\",\n    \"red\",\n    \"redondo\",\n    \"reducir\",\n    \"reflejo\",\n    \"reforma\",\n    \"refrán\",\n    \"refugio\",\n    \"regalo\",\n    \"regir\",\n    \"regla\",\n    \"regreso\",\n    \"rehén\",\n    \"reino\",\n    \"reír\",\n    \"reja\",\n    \"relato\",\n    \"relevo\",\n    \"relieve\",\n    \"relleno\",\n    \"reloj\",\n    \"remar\",\n    \"remedio\",\n    \"remo\",\n    \"rencor\",\n    \"rendir\",\n    \"renta\",\n    \"reparto\",\n    \"repetir\",\n    \"reposo\",\n    \"reptil\",\n    \"res\",\n    \"rescate\",\n    \"resina\",\n    \"respeto\",\n    \"resto\",\n    \"resumen\",\n    \"retiro\",\n    \"retorno\",\n    \"retrato\",\n    \"reunir\",\n    \"revés\",\n    \"revista\",\n    \"rey\",\n    \"rezar\",\n    \"rico\",\n    \"riego\",\n    \"rienda\",\n    \"riesgo\",\n    \"rifa\",\n    \"rígido\",\n    \"rigor\",\n    \"rincón\",\n    \"riñón\",\n    \"río\",\n    \"riqueza\",\n    \"risa\",\n    \"ritmo\",\n    \"rito\",\n    \"rizo\",\n    \"roble\",\n    \"roce\",\n    \"rociar\",\n    \"rodar\",\n    \"rodeo\",\n    \"rodilla\",\n    \"roer\",\n    \"rojizo\",\n    \"rojo\",\n    \"romero\",\n    \"romper\",\n    \"ron\",\n    \"ronco\",\n    \"ronda\",\n    \"ropa\",\n    \"ropero\",\n    \"rosa\",\n    \"rosca\",\n    \"rostro\",\n    \"rotar\",\n    \"rubí\",\n    \"rubor\",\n    \"rudo\",\n    \"rueda\",\n    \"rugir\",\n    \"ruido\",\n    \"ruina\",\n    \"ruleta\",\n    \"rulo\",\n    \"rumbo\",\n    \"rumor\",\n    \"ruptura\",\n    \"ruta\",\n    \"rutina\",\n    \"sábado\",\n    \"saber\",\n    \"sabio\",\n    \"sable\",\n    \"sacar\",\n    \"sagaz\",\n    \"sagrado\",\n    \"sala\",\n    \"saldo\",\n    \"salero\",\n    \"salir\",\n    \"salmón\",\n    \"salón\",\n    \"salsa\",\n    \"salto\",\n    \"salud\",\n    \"salvar\",\n    \"samba\",\n    \"sanción\",\n    \"sandía\",\n    \"sanear\",\n    \"sangre\",\n    \"sanidad\",\n    \"sano\",\n    \"santo\",\n    \"sapo\",\n    \"saque\",\n    \"sardina\",\n    \"sartén\",\n    \"sastre\",\n    \"satán\",\n    \"sauna\",\n    \"saxofón\",\n    \"sección\",\n    \"seco\",\n    \"secreto\",\n    \"secta\",\n    \"sed\",\n    \"seguir\",\n    \"seis\",\n    \"sello\",\n    \"selva\",\n    \"semana\",\n    \"semilla\",\n    \"senda\",\n    \"sensor\",\n    \"señal\",\n    \"señor\",\n    \"separar\",\n    \"sepia\",\n    \"sequía\",\n    \"ser\",\n    \"serie\",\n    \"sermón\",\n    \"servir\",\n    \"sesenta\",\n    \"sesión\",\n    \"seta\",\n    \"setenta\",\n    \"severo\",\n    \"sexo\",\n    \"sexto\",\n    \"sidra\",\n    \"siesta\",\n    \"siete\",\n    \"siglo\",\n    \"signo\",\n    \"sílaba\",\n    \"silbar\",\n    \"silencio\",\n    \"silla\",\n    \"símbolo\",\n    \"simio\",\n    \"sirena\",\n    \"sistema\",\n    \"sitio\",\n    \"situar\",\n    \"sobre\",\n    \"socio\",\n    \"sodio\",\n    \"sol\",\n    \"solapa\",\n    \"soldado\",\n    \"soledad\",\n    \"sólido\",\n    \"soltar\",\n    \"solución\",\n    \"sombra\",\n    \"sondeo\",\n    \"sonido\",\n    \"sonoro\",\n    \"sonrisa\",\n    \"sopa\",\n    \"soplar\",\n    \"soporte\",\n    \"sordo\",\n    \"sorpresa\",\n    \"sorteo\",\n    \"sostén\",\n    \"sótano\",\n    \"suave\",\n    \"subir\",\n    \"suceso\",\n    \"sudor\",\n    \"suegra\",\n    \"suelo\",\n    \"sueño\",\n    \"suerte\",\n    \"sufrir\",\n    \"sujeto\",\n    \"sultán\",\n    \"sumar\",\n    \"superar\",\n    \"suplir\",\n    \"suponer\",\n    \"supremo\",\n    \"sur\",\n    \"surco\",\n    \"sureño\",\n    \"surgir\",\n    \"susto\",\n    \"sutil\",\n    \"tabaco\",\n    \"tabique\",\n    \"tabla\",\n    \"tabú\",\n    \"taco\",\n    \"tacto\",\n    \"tajo\",\n    \"talar\",\n    \"talco\",\n    \"talento\",\n    \"talla\",\n    \"talón\",\n    \"tamaño\",\n    \"tambor\",\n    \"tango\",\n    \"tanque\",\n    \"tapa\",\n    \"tapete\",\n    \"tapia\",\n    \"tapón\",\n    \"taquilla\",\n    \"tarde\",\n    \"tarea\",\n    \"tarifa\",\n    \"tarjeta\",\n    \"tarot\",\n    \"tarro\",\n    \"tarta\",\n    \"tatuaje\",\n    \"tauro\",\n    \"taza\",\n    \"tazón\",\n    \"teatro\",\n    \"techo\",\n    \"tecla\",\n    \"técnica\",\n    \"tejado\",\n    \"tejer\",\n    \"tejido\",\n    \"tela\",\n    \"teléfono\",\n    \"tema\",\n    \"temor\",\n    \"templo\",\n    \"tenaz\",\n    \"tender\",\n    \"tener\",\n    \"tenis\",\n    \"tenso\",\n    \"teoría\",\n    \"terapia\",\n    \"terco\",\n    \"término\",\n    \"ternura\",\n    \"terror\",\n    \"tesis\",\n    \"tesoro\",\n    \"testigo\",\n    \"tetera\",\n    \"texto\",\n    \"tez\",\n    \"tibio\",\n    \"tiburón\",\n    \"tiempo\",\n    \"tienda\",\n    \"tierra\",\n    \"tieso\",\n    \"tigre\",\n    \"tijera\",\n    \"tilde\",\n    \"timbre\",\n    \"tímido\",\n    \"timo\",\n    \"tinta\",\n    \"tío\",\n    \"típico\",\n    \"tipo\",\n    \"tira\",\n    \"tirón\",\n    \"titán\",\n    \"títere\",\n    \"título\",\n    \"tiza\",\n    \"toalla\",\n    \"tobillo\",\n    \"tocar\",\n    \"tocino\",\n    \"todo\",\n    \"toga\",\n    \"toldo\",\n    \"tomar\",\n    \"tono\",\n    \"tonto\",\n    \"topar\",\n    \"tope\",\n    \"toque\",\n    \"tórax\",\n    \"torero\",\n    \"tormenta\",\n    \"torneo\",\n    \"toro\",\n    \"torpedo\",\n    \"torre\",\n    \"torso\",\n    \"tortuga\",\n    \"tos\",\n    \"tosco\",\n    \"toser\",\n    \"tóxico\",\n    \"trabajo\",\n    \"tractor\",\n    \"traer\",\n    \"tráfico\",\n    \"trago\",\n    \"traje\",\n    \"tramo\",\n    \"trance\",\n    \"trato\",\n    \"trauma\",\n    \"trazar\",\n    \"trébol\",\n    \"tregua\",\n    \"treinta\",\n    \"tren\",\n    \"trepar\",\n    \"tres\",\n    \"tribu\",\n    \"trigo\",\n    \"tripa\",\n    \"triste\",\n    \"triunfo\",\n    \"trofeo\",\n    \"trompa\",\n    \"tronco\",\n    \"tropa\",\n    \"trote\",\n    \"trozo\",\n    \"truco\",\n    \"trueno\",\n    \"trufa\",\n    \"tubería\",\n    \"tubo\",\n    \"tuerto\",\n    \"tumba\",\n    \"tumor\",\n    \"túnel\",\n    \"túnica\",\n    \"turbina\",\n    \"turismo\",\n    \"turno\",\n    \"tutor\",\n    \"ubicar\",\n    \"úlcera\",\n    \"umbral\",\n    \"unidad\",\n    \"unir\",\n    \"universo\",\n    \"uno\",\n    \"untar\",\n    \"uña\",\n    \"urbano\",\n    \"urbe\",\n    \"urgente\",\n    \"urna\",\n    \"usar\",\n    \"usuario\",\n    \"útil\",\n    \"utopía\",\n    \"uva\",\n    \"vaca\",\n    \"vacío\",\n    \"vacuna\",\n    \"vagar\",\n    \"vago\",\n    \"vaina\",\n    \"vajilla\",\n    \"vale\",\n    \"válido\",\n    \"valle\",\n    \"valor\",\n    \"válvula\",\n    \"vampiro\",\n    \"vara\",\n    \"variar\",\n    \"varón\",\n    \"vaso\",\n    \"vecino\",\n    \"vector\",\n    \"vehículo\",\n    \"veinte\",\n    \"vejez\",\n    \"vela\",\n    \"velero\",\n    \"veloz\",\n    \"vena\",\n    \"vencer\",\n    \"venda\",\n    \"veneno\",\n    \"vengar\",\n    \"venir\",\n    \"venta\",\n    \"venus\",\n    \"ver\",\n    \"verano\",\n    \"verbo\",\n    \"verde\",\n    \"vereda\",\n    \"verja\",\n    \"verso\",\n    \"verter\",\n    \"vía\",\n    \"viaje\",\n    \"vibrar\",\n    \"vicio\",\n    \"víctima\",\n    \"vida\",\n    \"vídeo\",\n    \"vidrio\",\n    \"viejo\",\n    \"viernes\",\n    \"vigor\",\n    \"vil\",\n    \"villa\",\n    \"vinagre\",\n    \"vino\",\n    \"viñedo\",\n    \"violín\",\n    \"viral\",\n    \"virgo\",\n    \"virtud\",\n    \"visor\",\n    \"víspera\",\n    \"vista\",\n    \"vitamina\",\n    \"viudo\",\n    \"vivaz\",\n    \"vivero\",\n    \"vivir\",\n    \"vivo\",\n    \"volcán\",\n    \"volumen\",\n    \"volver\",\n    \"voraz\",\n    \"votar\",\n    \"voto\",\n    \"voz\",\n    \"vuelo\",\n    \"vulgar\",\n    \"yacer\",\n    \"yate\",\n    \"yegua\",\n    \"yema\",\n    \"yerno\",\n    \"yeso\",\n    \"yodo\",\n    \"yoga\",\n    \"yogur\",\n    \"zafiro\",\n    \"zanja\",\n    \"zapato\",\n    \"zarza\",\n    \"zona\",\n    \"zorro\",\n    \"zumo\",\n    \"zurdo\"\n]\n// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki\n// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n// NOTE: SIGHASH byte ignored AND restricted, truncate before use\n\nvar Buffer = require('safe-buffer').Buffer\n\nfunction check (buffer) {\n  if (buffer.length < 8) return false\n  if (buffer.length > 72) return false\n  if (buffer[0] !== 0x30) return false\n  if (buffer[1] !== buffer.length - 2) return false\n  if (buffer[2] !== 0x02) return false\n\n  var lenR = buffer[3]\n  if (lenR === 0) return false\n  if (5 + lenR >= buffer.length) return false\n  if (buffer[4 + lenR] !== 0x02) return false\n\n  var lenS = buffer[5 + lenR]\n  if (lenS === 0) return false\n  if ((6 + lenR + lenS) !== buffer.length) return false\n\n  if (buffer[4] & 0x80) return false\n  if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n  if (buffer[lenR + 6] & 0x80) return false\n  if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n  return true\n}\n\nfunction decode (buffer) {\n  if (buffer.length < 8) throw new Error('DER sequence length is too short')\n  if (buffer.length > 72) throw new Error('DER sequence length is too long')\n  if (buffer[0] !== 0x30) throw new Error('Expected DER sequence')\n  if (buffer[1] !== buffer.length - 2) throw new Error('DER sequence length is invalid')\n  if (buffer[2] !== 0x02) throw new Error('Expected DER integer')\n\n  var lenR = buffer[3]\n  if (lenR === 0) throw new Error('R length is zero')\n  if (5 + lenR >= buffer.length) throw new Error('R length is too long')\n  if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)')\n\n  var lenS = buffer[5 + lenR]\n  if (lenS === 0) throw new Error('S length is zero')\n  if ((6 + lenR + lenS) !== buffer.length) throw new Error('S length is invalid')\n\n  if (buffer[4] & 0x80) throw new Error('R value is negative')\n  if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) throw new Error('R value excessively padded')\n\n  if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative')\n  if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) throw new Error('S value excessively padded')\n\n  // non-BIP66 - extract R, S values\n  return {\n    r: buffer.slice(4, 4 + lenR),\n    s: buffer.slice(6 + lenR)\n  }\n}\n\n/*\n * Expects r and s to be positive DER integers.\n *\n * The DER format uses the most significant bit as a sign bit (& 0x80).\n * If the significant bit is set AND the integer is positive, a 0x00 is prepended.\n *\n * Examples:\n *\n *      0 =>     0x00\n *      1 =>     0x01\n *     -1 =>     0xff\n *    127 =>     0x7f\n *   -127 =>     0x81\n *    128 =>   0x0080\n *   -128 =>     0x80\n *    255 =>   0x00ff\n *   -255 =>   0xff01\n *  16300 =>   0x3fac\n * -16300 =>   0xc054\n *  62300 => 0x00f35c\n * -62300 => 0xff0ca4\n*/\nfunction encode (r, s) {\n  var lenR = r.length\n  var lenS = s.length\n  if (lenR === 0) throw new Error('R length is zero')\n  if (lenS === 0) throw new Error('S length is zero')\n  if (lenR > 33) throw new Error('R length is too long')\n  if (lenS > 33) throw new Error('S length is too long')\n  if (r[0] & 0x80) throw new Error('R value is negative')\n  if (s[0] & 0x80) throw new Error('S value is negative')\n  if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) throw new Error('R value excessively padded')\n  if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) throw new Error('S value excessively padded')\n\n  var signature = Buffer.allocUnsafe(6 + lenR + lenS)\n\n  // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n  signature[0] = 0x30\n  signature[1] = signature.length - 2\n  signature[2] = 0x02\n  signature[3] = r.length\n  r.copy(signature, 4)\n  signature[4 + lenR] = 0x02\n  signature[5 + lenR] = s.length\n  s.copy(signature, 6 + lenR)\n\n  return signature\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n{\n  \"name\": \"bip66\",\n  \"version\": \"1.1.5\",\n  \"description\": \"Strict DER signature encoding/decoding.\",\n  \"keywords\": [\n    \"bip66\",\n    \"bitcoin\"\n  ],\n  \"homepage\": \"https://github.com/bitcoinjs/bip66\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/bip66/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Daniel Cousens\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"main\": \"index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/bip66.git\"\n  },\n  \"scripts\": {\n    \"coverage\": \"nyc --check-coverage --branches 100 --functions 100 tape test/*.js\",\n    \"lint\": \"standard\",\n    \"test\": \"npm run lint && npm run unit\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"devDependencies\": {\n    \"nyc\": \"^6.4.0\",\n    \"standard\": \"^10.0.2\",\n    \"tape\": \"^4.5.1\"\n  },\n  \"dependencies\": {\n    \"safe-buffer\": \"^5.0.1\"\n  }\n}\n// see https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki#compatibility\n\nconst SEQUENCE_FINAL = 0xffffffff\nconst SEQUENCE_LOCKTIME_DISABLE_FLAG = (1 << 31)\nconst SEQUENCE_LOCKTIME_GRANULARITY = 9\nconst SEQUENCE_LOCKTIME_MASK = 0x0000ffff\nconst SEQUENCE_LOCKTIME_TYPE_FLAG = (1 << 22)\n\nconst BLOCKS_MAX = SEQUENCE_LOCKTIME_MASK\nconst SECONDS_MOD = 1 << SEQUENCE_LOCKTIME_GRANULARITY\nconst SECONDS_MAX = SEQUENCE_LOCKTIME_MASK << SEQUENCE_LOCKTIME_GRANULARITY\n\nfunction decode (sequence) {\n  if (sequence & SEQUENCE_LOCKTIME_DISABLE_FLAG) return {}\n  if (sequence & SEQUENCE_LOCKTIME_TYPE_FLAG) {\n    return {\n      seconds: (sequence & SEQUENCE_LOCKTIME_MASK) << SEQUENCE_LOCKTIME_GRANULARITY\n    }\n  }\n\n  return {\n    blocks: sequence & SEQUENCE_LOCKTIME_MASK\n  }\n}\n\nfunction encode ({ blocks, seconds }) {\n  if (blocks !== undefined && seconds !== undefined) throw new TypeError('Cannot encode blocks AND seconds')\n  if (blocks === undefined && seconds === undefined) return SEQUENCE_FINAL // neither? assume final\n\n  if (seconds !== undefined) {\n    if (!Number.isFinite(seconds)) throw new TypeError('Expected Number seconds')\n    if (seconds > SECONDS_MAX) throw new TypeError('Expected Number seconds <= ' + SECONDS_MAX)\n    if (seconds % SECONDS_MOD !== 0) throw new TypeError('Expected Number seconds as a multiple of ' + SECONDS_MOD)\n\n    return SEQUENCE_LOCKTIME_TYPE_FLAG | (seconds >> SEQUENCE_LOCKTIME_GRANULARITY)\n  }\n\n  if (!Number.isFinite(blocks)) throw new TypeError('Expected Number blocks')\n  if (blocks > SEQUENCE_LOCKTIME_MASK) throw new TypeError('Expected Number blocks <= ' + BLOCKS_MAX)\n\n  return blocks\n}\n\nmodule.exports = { decode, encode }\n{\n  \"name\": \"bip68\",\n  \"version\": \"1.0.4\",\n  \"description\": \"A BIP68 relative lock-time encoding library.\",\n  \"keywords\": [\n    \"bip68\",\n    \"htlc\",\n    \"csv\",\n    \"checksequenceverify\",\n    \"OP_CHECKSEQUENCEVERIFY\",\n    \"OP_CSV\",\n    \"bitcoin\"\n  ],\n  \"homepage\": \"https://github.com/bitcoinjs/bip68\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/bip68/issues\"\n  },\n  \"license\": \"ISC\",\n  \"author\": \"Daniel Cousens\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"main\": \"index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/bip68.git\"\n  },\n  \"scripts\": {\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run unit\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"devDependencies\": {\n    \"nyc\": \"*\",\n    \"standard\": \"*\",\n    \"tape\": \"*\"\n  },\n  \"engines\": {\n    \"node\": \">=4.5.0\"\n  }\n}\n{\n  \"name\": \"bitcoinjs-lib\",\n  \"version\": \"6.1.7\",\n  \"description\": \"Client-side Bitcoin JavaScript library\",\n  \"main\": \"./src/index.js\",\n  \"types\": \"./src/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=8.0.0\"\n  },\n  \"keywords\": [\n    \"bitcoinjs\",\n    \"bitcoin\",\n    \"browserify\",\n    \"javascript\",\n    \"bitcoinjs\"\n  ],\n  \"scripts\": {\n    \"build\": \"npm run clean && tsc -p ./tsconfig.json && npm run formatjs\",\n    \"build:tests\": \"npm run clean:jstests && tsc -p ./test/tsconfig.json\",\n    \"clean\": \"rimraf src\",\n    \"clean:jstests\": \"rimraf 'test/**/!(ts-node-register)*.js'\",\n    \"coverage-report\": \"npm run build && npm run nobuild:coverage-report\",\n    \"coverage-html\": \"npm run build && npm run nobuild:coverage-html\",\n    \"coverage\": \"npm run build && npm run nobuild:coverage\",\n    \"doc\": \"typedoc\",\n    \"format\": \"npm run prettier -- --write\",\n    \"formatjs\": \"npm run prettierjs -- --write\",\n    \"format:ci\": \"npm run prettier -- --check && npm run prettierjs -- --check\",\n    \"gitdiff:ci\": \"npm run build && git diff --exit-code\",\n    \"integration\": \"npm run build && npm run nobuild:integration\",\n    \"lint\": \"eslint ts_src/** src/**/*.js\",\n    \"lint:tests\": \"eslint test/**/*.spec.ts\",\n    \"mocha:ts\": \"mocha --recursive --require test/ts-node-register\",\n    \"nobuild:coverage-report\": \"nyc report --reporter=lcov\",\n    \"nobuild:coverage-html\": \"nyc report --reporter=html\",\n    \"nobuild:coverage\": \"npm run build:tests && nyc --check-coverage --branches 85 --functions 90 --lines 90 mocha && npm run clean:jstests\",\n    \"nobuild:integration\": \"npm run mocha:ts -- --timeout 50000 'test/integration/*.ts'\",\n    \"nobuild:unit\": \"npm run mocha:ts -- 'test/*.ts'\",\n    \"prettier\": \"prettier \\\"ts_src/**/*.ts\\\" \\\"test/**/*.ts\\\" --ignore-path ./.prettierignore\",\n    \"prettierjs\": \"prettier \\\"src/**/*.js\\\" --ignore-path ./.prettierignore\",\n    \"test\": \"npm run build && npm run format:ci && npm run lint && npm run nobuild:coverage\",\n    \"unit\": \"npm run build && npm run nobuild:unit\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/bitcoinjs-lib.git\"\n  },\n  \"files\": [\n    \"src\"\n  ],\n  \"dependencies\": {\n    \"@noble/hashes\": \"^1.2.0\",\n    \"bech32\": \"^2.0.0\",\n    \"bip174\": \"^2.1.1\",\n    \"bs58check\": \"^3.0.1\",\n    \"typeforce\": \"^1.11.3\",\n    \"varuint-bitcoin\": \"^1.1.2\"\n  },\n  \"devDependencies\": {\n    \"@types/bs58\": \"^4.0.0\",\n    \"@types/bs58check\": \"^2.1.0\",\n    \"@types/mocha\": \"^5.2.7\",\n    \"@types/node\": \"^16.11.7\",\n    \"@types/proxyquire\": \"^1.3.28\",\n    \"@types/randombytes\": \"^2.0.0\",\n    \"@typescript-eslint/eslint-plugin\": \"^5.45.0\",\n    \"@typescript-eslint/parser\": \"^5.45.0\",\n    \"bip32\": \"^4.0.0\",\n    \"bip39\": \"^3.1.0\",\n    \"bip65\": \"^1.0.1\",\n    \"bip68\": \"^1.0.3\",\n    \"bs58\": \"^4.0.0\",\n    \"dhttp\": \"^3.0.0\",\n    \"ecpair\": \"^2.0.1\",\n    \"eslint\": \"^8.29.0\",\n    \"eslint-config-prettier\": \"^8.5.0\",\n    \"eslint-plugin-prettier\": \"^4.2.1\",\n    \"hoodwink\": \"^2.0.0\",\n    \"minimaldata\": \"^1.0.2\",\n    \"mocha\": \"^10.0.0\",\n    \"nyc\": \"^15.1.0\",\n    \"prettier\": \"^2.8.0\",\n    \"proxyquire\": \"^2.0.1\",\n    \"randombytes\": \"^2.1.0\",\n    \"regtest-client\": \"0.2.0\",\n    \"rimraf\": \"^2.6.3\",\n    \"tiny-secp256k1\": \"^2.2.0\",\n    \"ts-node\": \"^8.3.0\",\n    \"typedoc\": \"^0.25.1\",\n    \"typescript\": \"^4.4.4\"\n  },\n  \"license\": \"MIT\"\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.toOutputScript =\n  exports.fromOutputScript =\n  exports.toBech32 =\n  exports.toBase58Check =\n  exports.fromBech32 =\n  exports.fromBase58Check =\n    void 0;\nconst networks = require('./networks');\nconst payments = require('./payments');\nconst bscript = require('./script');\nconst types_1 = require('./types');\nconst bech32_1 = require('bech32');\nconst bs58check = require('bs58check');\nconst FUTURE_SEGWIT_MAX_SIZE = 40;\nconst FUTURE_SEGWIT_MIN_SIZE = 2;\nconst FUTURE_SEGWIT_MAX_VERSION = 16;\nconst FUTURE_SEGWIT_MIN_VERSION = 2;\nconst FUTURE_SEGWIT_VERSION_DIFF = 0x50;\nconst FUTURE_SEGWIT_VERSION_WARNING =\n  'WARNING: Sending to a future segwit version address can lead to loss of funds. ' +\n  'End users MUST be warned carefully in the GUI and asked if they wish to proceed ' +\n  'with caution. Wallets should verify the segwit version from the output of fromBech32, ' +\n  'then decide when it is safe to use which version of segwit.';\nfunction _toFutureSegwitAddress(output, network) {\n  const data = output.slice(2);\n  if (\n    data.length < FUTURE_SEGWIT_MIN_SIZE ||\n    data.length > FUTURE_SEGWIT_MAX_SIZE\n  )\n    throw new TypeError('Invalid program length for segwit address');\n  const version = output[0] - FUTURE_SEGWIT_VERSION_DIFF;\n  if (\n    version < FUTURE_SEGWIT_MIN_VERSION ||\n    version > FUTURE_SEGWIT_MAX_VERSION\n  )\n    throw new TypeError('Invalid version for segwit address');\n  if (output[1] !== data.length)\n    throw new TypeError('Invalid script for segwit address');\n  console.warn(FUTURE_SEGWIT_VERSION_WARNING);\n  return toBech32(data, version, network.bech32);\n}\n/**\n * decode address with base58 specification,  return address version and address hash if valid\n */\nfunction fromBase58Check(address) {\n  const payload = Buffer.from(bs58check.decode(address));\n  // TODO: 4.0.0, move to \"toOutputScript\"\n  if (payload.length < 21) throw new TypeError(address + ' is too short');\n  if (payload.length > 21) throw new TypeError(address + ' is too long');\n  const version = payload.readUInt8(0);\n  const hash = payload.slice(1);\n  return { version, hash };\n}\nexports.fromBase58Check = fromBase58Check;\n/**\n * decode address with bech32 specification,  return address version、address prefix and address data if valid\n */\nfunction fromBech32(address) {\n  let result;\n  let version;\n  try {\n    result = bech32_1.bech32.decode(address);\n  } catch (e) {}\n  if (result) {\n    version = result.words[0];\n    if (version !== 0) throw new TypeError(address + ' uses wrong encoding');\n  } else {\n    result = bech32_1.bech32m.decode(address);\n    version = result.words[0];\n    if (version === 0) throw new TypeError(address + ' uses wrong encoding');\n  }\n  const data = bech32_1.bech32.fromWords(result.words.slice(1));\n  return {\n    version,\n    prefix: result.prefix,\n    data: Buffer.from(data),\n  };\n}\nexports.fromBech32 = fromBech32;\n/**\n * encode address hash to base58 address with version\n */\nfunction toBase58Check(hash, version) {\n  (0, types_1.typeforce)(\n    (0, types_1.tuple)(types_1.Hash160bit, types_1.UInt8),\n    arguments,\n  );\n  const payload = Buffer.allocUnsafe(21);\n  payload.writeUInt8(version, 0);\n  hash.copy(payload, 1);\n  return bs58check.encode(payload);\n}\nexports.toBase58Check = toBase58Check;\n/**\n * encode address hash to bech32 address with version and prefix\n */\nfunction toBech32(data, version, prefix) {\n  const words = bech32_1.bech32.toWords(data);\n  words.unshift(version);\n  return version === 0\n    ? bech32_1.bech32.encode(prefix, words)\n    : bech32_1.bech32m.encode(prefix, words);\n}\nexports.toBech32 = toBech32;\n/**\n * decode address from output script with network, return address if matched\n */\nfunction fromOutputScript(output, network) {\n  // TODO: Network\n  network = network || networks.bitcoin;\n  try {\n    return payments.p2pkh({ output, network }).address;\n  } catch (e) {}\n  try {\n    return payments.p2sh({ output, network }).address;\n  } catch (e) {}\n  try {\n    return payments.p2wpkh({ output, network }).address;\n  } catch (e) {}\n  try {\n    return payments.p2wsh({ output, network }).address;\n  } catch (e) {}\n  try {\n    return payments.p2tr({ output, network }).address;\n  } catch (e) {}\n  try {\n    return _toFutureSegwitAddress(output, network);\n  } catch (e) {}\n  throw new Error(bscript.toASM(output) + ' has no matching Address');\n}\nexports.fromOutputScript = fromOutputScript;\n/**\n * encodes address to output script with network, return output script if address matched\n */\nfunction toOutputScript(address, network) {\n  network = network || networks.bitcoin;\n  let decodeBase58;\n  let decodeBech32;\n  try {\n    decodeBase58 = fromBase58Check(address);\n  } catch (e) {}\n  if (decodeBase58) {\n    if (decodeBase58.version === network.pubKeyHash)\n      return payments.p2pkh({ hash: decodeBase58.hash }).output;\n    if (decodeBase58.version === network.scriptHash)\n      return payments.p2sh({ hash: decodeBase58.hash }).output;\n  } else {\n    try {\n      decodeBech32 = fromBech32(address);\n    } catch (e) {}\n    if (decodeBech32) {\n      if (decodeBech32.prefix !== network.bech32)\n        throw new Error(address + ' has an invalid prefix');\n      if (decodeBech32.version === 0) {\n        if (decodeBech32.data.length === 20)\n          return payments.p2wpkh({ hash: decodeBech32.data }).output;\n        if (decodeBech32.data.length === 32)\n          return payments.p2wsh({ hash: decodeBech32.data }).output;\n      } else if (decodeBech32.version === 1) {\n        if (decodeBech32.data.length === 32)\n          return payments.p2tr({ pubkey: decodeBech32.data }).output;\n      } else if (\n        decodeBech32.version >= FUTURE_SEGWIT_MIN_VERSION &&\n        decodeBech32.version <= FUTURE_SEGWIT_MAX_VERSION &&\n        decodeBech32.data.length >= FUTURE_SEGWIT_MIN_SIZE &&\n        decodeBech32.data.length <= FUTURE_SEGWIT_MAX_SIZE\n      ) {\n        console.warn(FUTURE_SEGWIT_VERSION_WARNING);\n        return bscript.compile([\n          decodeBech32.version + FUTURE_SEGWIT_VERSION_DIFF,\n          decodeBech32.data,\n        ]);\n      }\n    }\n  }\n  throw new Error(address + ' has no matching Script');\n}\nexports.toOutputScript = toOutputScript;\n'use strict';\n// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki\n// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n// NOTE: SIGHASH byte ignored AND restricted, truncate before use\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.encode = exports.decode = exports.check = void 0;\nfunction check(buffer) {\n  if (buffer.length < 8) return false;\n  if (buffer.length > 72) return false;\n  if (buffer[0] !== 0x30) return false;\n  if (buffer[1] !== buffer.length - 2) return false;\n  if (buffer[2] !== 0x02) return false;\n  const lenR = buffer[3];\n  if (lenR === 0) return false;\n  if (5 + lenR >= buffer.length) return false;\n  if (buffer[4 + lenR] !== 0x02) return false;\n  const lenS = buffer[5 + lenR];\n  if (lenS === 0) return false;\n  if (6 + lenR + lenS !== buffer.length) return false;\n  if (buffer[4] & 0x80) return false;\n  if (lenR > 1 && buffer[4] === 0x00 && !(buffer[5] & 0x80)) return false;\n  if (buffer[lenR + 6] & 0x80) return false;\n  if (lenS > 1 && buffer[lenR + 6] === 0x00 && !(buffer[lenR + 7] & 0x80))\n    return false;\n  return true;\n}\nexports.check = check;\nfunction decode(buffer) {\n  if (buffer.length < 8) throw new Error('DER sequence length is too short');\n  if (buffer.length > 72) throw new Error('DER sequence length is too long');\n  if (buffer[0] !== 0x30) throw new Error('Expected DER sequence');\n  if (buffer[1] !== buffer.length - 2)\n    throw new Error('DER sequence length is invalid');\n  if (buffer[2] !== 0x02) throw new Error('Expected DER integer');\n  const lenR = buffer[3];\n  if (lenR === 0) throw new Error('R length is zero');\n  if (5 + lenR >= buffer.length) throw new Error('R length is too long');\n  if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)');\n  const lenS = buffer[5 + lenR];\n  if (lenS === 0) throw new Error('S length is zero');\n  if (6 + lenR + lenS !== buffer.length) throw new Error('S length is invalid');\n  if (buffer[4] & 0x80) throw new Error('R value is negative');\n  if (lenR > 1 && buffer[4] === 0x00 && !(buffer[5] & 0x80))\n    throw new Error('R value excessively padded');\n  if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative');\n  if (lenS > 1 && buffer[lenR + 6] === 0x00 && !(buffer[lenR + 7] & 0x80))\n    throw new Error('S value excessively padded');\n  // non-BIP66 - extract R, S values\n  return {\n    r: buffer.slice(4, 4 + lenR),\n    s: buffer.slice(6 + lenR),\n  };\n}\nexports.decode = decode;\n/*\n * Expects r and s to be positive DER integers.\n *\n * The DER format uses the most significant bit as a sign bit (& 0x80).\n * If the significant bit is set AND the integer is positive, a 0x00 is prepended.\n *\n * Examples:\n *\n *      0 =>     0x00\n *      1 =>     0x01\n *     -1 =>     0xff\n *    127 =>     0x7f\n *   -127 =>     0x81\n *    128 =>   0x0080\n *   -128 =>     0x80\n *    255 =>   0x00ff\n *   -255 =>   0xff01\n *  16300 =>   0x3fac\n * -16300 =>   0xc054\n *  62300 => 0x00f35c\n * -62300 => 0xff0ca4\n */\nfunction encode(r, s) {\n  const lenR = r.length;\n  const lenS = s.length;\n  if (lenR === 0) throw new Error('R length is zero');\n  if (lenS === 0) throw new Error('S length is zero');\n  if (lenR > 33) throw new Error('R length is too long');\n  if (lenS > 33) throw new Error('S length is too long');\n  if (r[0] & 0x80) throw new Error('R value is negative');\n  if (s[0] & 0x80) throw new Error('S value is negative');\n  if (lenR > 1 && r[0] === 0x00 && !(r[1] & 0x80))\n    throw new Error('R value excessively padded');\n  if (lenS > 1 && s[0] === 0x00 && !(s[1] & 0x80))\n    throw new Error('S value excessively padded');\n  const signature = Buffer.allocUnsafe(6 + lenR + lenS);\n  // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n  signature[0] = 0x30;\n  signature[1] = signature.length - 2;\n  signature[2] = 0x02;\n  signature[3] = r.length;\n  r.copy(signature, 4);\n  signature[4 + lenR] = 0x02;\n  signature[5 + lenR] = s.length;\n  s.copy(signature, 6 + lenR);\n  return signature;\n}\nexports.encode = encode;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.Block = void 0;\nconst bufferutils_1 = require('./bufferutils');\nconst bcrypto = require('./crypto');\nconst merkle_1 = require('./merkle');\nconst transaction_1 = require('./transaction');\nconst types = require('./types');\nconst { typeforce } = types;\nconst errorMerkleNoTxes = new TypeError(\n  'Cannot compute merkle root for zero transactions',\n);\nconst errorWitnessNotSegwit = new TypeError(\n  'Cannot compute witness commit for non-segwit block',\n);\nclass Block {\n  constructor() {\n    this.version = 1;\n    this.prevHash = undefined;\n    this.merkleRoot = undefined;\n    this.timestamp = 0;\n    this.witnessCommit = undefined;\n    this.bits = 0;\n    this.nonce = 0;\n    this.transactions = undefined;\n  }\n  static fromBuffer(buffer) {\n    if (buffer.length < 80) throw new Error('Buffer too small (< 80 bytes)');\n    const bufferReader = new bufferutils_1.BufferReader(buffer);\n    const block = new Block();\n    block.version = bufferReader.readInt32();\n    block.prevHash = bufferReader.readSlice(32);\n    block.merkleRoot = bufferReader.readSlice(32);\n    block.timestamp = bufferReader.readUInt32();\n    block.bits = bufferReader.readUInt32();\n    block.nonce = bufferReader.readUInt32();\n    if (buffer.length === 80) return block;\n    const readTransaction = () => {\n      const tx = transaction_1.Transaction.fromBuffer(\n        bufferReader.buffer.slice(bufferReader.offset),\n        true,\n      );\n      bufferReader.offset += tx.byteLength();\n      return tx;\n    };\n    const nTransactions = bufferReader.readVarInt();\n    block.transactions = [];\n    for (let i = 0; i < nTransactions; ++i) {\n      const tx = readTransaction();\n      block.transactions.push(tx);\n    }\n    const witnessCommit = block.getWitnessCommit();\n    // This Block contains a witness commit\n    if (witnessCommit) block.witnessCommit = witnessCommit;\n    return block;\n  }\n  static fromHex(hex) {\n    return Block.fromBuffer(Buffer.from(hex, 'hex'));\n  }\n  static calculateTarget(bits) {\n    const exponent = ((bits & 0xff000000) >> 24) - 3;\n    const mantissa = bits & 0x007fffff;\n    const target = Buffer.alloc(32, 0);\n    target.writeUIntBE(mantissa, 29 - exponent, 3);\n    return target;\n  }\n  static calculateMerkleRoot(transactions, forWitness) {\n    typeforce([{ getHash: types.Function }], transactions);\n    if (transactions.length === 0) throw errorMerkleNoTxes;\n    if (forWitness && !txesHaveWitnessCommit(transactions))\n      throw errorWitnessNotSegwit;\n    const hashes = transactions.map(transaction =>\n      transaction.getHash(forWitness),\n    );\n    const rootHash = (0, merkle_1.fastMerkleRoot)(hashes, bcrypto.hash256);\n    return forWitness\n      ? bcrypto.hash256(\n          Buffer.concat([rootHash, transactions[0].ins[0].witness[0]]),\n        )\n      : rootHash;\n  }\n  getWitnessCommit() {\n    if (!txesHaveWitnessCommit(this.transactions)) return null;\n    // The merkle root for the witness data is in an OP_RETURN output.\n    // There is no rule for the index of the output, so use filter to find it.\n    // The root is prepended with 0xaa21a9ed so check for 0x6a24aa21a9ed\n    // If multiple commits are found, the output with highest index is assumed.\n    const witnessCommits = this.transactions[0].outs\n      .filter(out =>\n        out.script.slice(0, 6).equals(Buffer.from('6a24aa21a9ed', 'hex')),\n      )\n      .map(out => out.script.slice(6, 38));\n    if (witnessCommits.length === 0) return null;\n    // Use the commit with the highest output (should only be one though)\n    const result = witnessCommits[witnessCommits.length - 1];\n    if (!(result instanceof Buffer && result.length === 32)) return null;\n    return result;\n  }\n  hasWitnessCommit() {\n    if (\n      this.witnessCommit instanceof Buffer &&\n      this.witnessCommit.length === 32\n    )\n      return true;\n    if (this.getWitnessCommit() !== null) return true;\n    return false;\n  }\n  hasWitness() {\n    return anyTxHasWitness(this.transactions);\n  }\n  weight() {\n    const base = this.byteLength(false, false);\n    const total = this.byteLength(false, true);\n    return base * 3 + total;\n  }\n  byteLength(headersOnly, allowWitness = true) {\n    if (headersOnly || !this.transactions) return 80;\n    return (\n      80 +\n      bufferutils_1.varuint.encodingLength(this.transactions.length) +\n      this.transactions.reduce((a, x) => a + x.byteLength(allowWitness), 0)\n    );\n  }\n  getHash() {\n    return bcrypto.hash256(this.toBuffer(true));\n  }\n  getId() {\n    return (0, bufferutils_1.reverseBuffer)(this.getHash()).toString('hex');\n  }\n  getUTCDate() {\n    const date = new Date(0); // epoch\n    date.setUTCSeconds(this.timestamp);\n    return date;\n  }\n  // TODO: buffer, offset compatibility\n  toBuffer(headersOnly) {\n    const buffer = Buffer.allocUnsafe(this.byteLength(headersOnly));\n    const bufferWriter = new bufferutils_1.BufferWriter(buffer);\n    bufferWriter.writeInt32(this.version);\n    bufferWriter.writeSlice(this.prevHash);\n    bufferWriter.writeSlice(this.merkleRoot);\n    bufferWriter.writeUInt32(this.timestamp);\n    bufferWriter.writeUInt32(this.bits);\n    bufferWriter.writeUInt32(this.nonce);\n    if (headersOnly || !this.transactions) return buffer;\n    bufferutils_1.varuint.encode(\n      this.transactions.length,\n      buffer,\n      bufferWriter.offset,\n    );\n    bufferWriter.offset += bufferutils_1.varuint.encode.bytes;\n    this.transactions.forEach(tx => {\n      const txSize = tx.byteLength(); // TODO: extract from toBuffer?\n      tx.toBuffer(buffer, bufferWriter.offset);\n      bufferWriter.offset += txSize;\n    });\n    return buffer;\n  }\n  toHex(headersOnly) {\n    return this.toBuffer(headersOnly).toString('hex');\n  }\n  checkTxRoots() {\n    // If the Block has segwit transactions but no witness commit,\n    // there's no way it can be valid, so fail the check.\n    const hasWitnessCommit = this.hasWitnessCommit();\n    if (!hasWitnessCommit && this.hasWitness()) return false;\n    return (\n      this.__checkMerkleRoot() &&\n      (hasWitnessCommit ? this.__checkWitnessCommit() : true)\n    );\n  }\n  checkProofOfWork() {\n    const hash = (0, bufferutils_1.reverseBuffer)(this.getHash());\n    const target = Block.calculateTarget(this.bits);\n    return hash.compare(target) <= 0;\n  }\n  __checkMerkleRoot() {\n    if (!this.transactions) throw errorMerkleNoTxes;\n    const actualMerkleRoot = Block.calculateMerkleRoot(this.transactions);\n    return this.merkleRoot.compare(actualMerkleRoot) === 0;\n  }\n  __checkWitnessCommit() {\n    if (!this.transactions) throw errorMerkleNoTxes;\n    if (!this.hasWitnessCommit()) throw errorWitnessNotSegwit;\n    const actualWitnessCommit = Block.calculateMerkleRoot(\n      this.transactions,\n      true,\n    );\n    return this.witnessCommit.compare(actualWitnessCommit) === 0;\n  }\n}\nexports.Block = Block;\nfunction txesHaveWitnessCommit(transactions) {\n  return (\n    transactions instanceof Array &&\n    transactions[0] &&\n    transactions[0].ins &&\n    transactions[0].ins instanceof Array &&\n    transactions[0].ins[0] &&\n    transactions[0].ins[0].witness &&\n    transactions[0].ins[0].witness instanceof Array &&\n    transactions[0].ins[0].witness.length > 0\n  );\n}\nfunction anyTxHasWitness(transactions) {\n  return (\n    transactions instanceof Array &&\n    transactions.some(\n      tx =>\n        typeof tx === 'object' &&\n        tx.ins instanceof Array &&\n        tx.ins.some(\n          input =>\n            typeof input === 'object' &&\n            input.witness instanceof Array &&\n            input.witness.length > 0,\n        ),\n    )\n  );\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.BufferReader =\n  exports.BufferWriter =\n  exports.cloneBuffer =\n  exports.reverseBuffer =\n  exports.writeUInt64LE =\n  exports.readUInt64LE =\n  exports.varuint =\n    void 0;\nconst types = require('./types');\nconst { typeforce } = types;\nconst varuint = require('varuint-bitcoin');\nexports.varuint = varuint;\n// https://github.com/feross/buffer/blob/master/index.js#L1127\nfunction verifuint(value, max) {\n  if (typeof value !== 'number')\n    throw new Error('cannot write a non-number as a number');\n  if (value < 0)\n    throw new Error('specified a negative value for writing an unsigned value');\n  if (value > max) throw new Error('RangeError: value out of range');\n  if (Math.floor(value) !== value)\n    throw new Error('value has a fractional component');\n}\nfunction readUInt64LE(buffer, offset) {\n  const a = buffer.readUInt32LE(offset);\n  let b = buffer.readUInt32LE(offset + 4);\n  b *= 0x100000000;\n  verifuint(b + a, 0x001fffffffffffff);\n  return b + a;\n}\nexports.readUInt64LE = readUInt64LE;\n/**\n * Writes a 64-bit unsigned integer in little-endian format to the specified buffer at the given offset.\n *\n * @param buffer - The buffer to write the value to.\n * @param value - The 64-bit unsigned integer value to write.\n * @param offset - The offset in the buffer where the value should be written.\n * @returns The new offset after writing the value.\n */\nfunction writeUInt64LE(buffer, value, offset) {\n  verifuint(value, 0x001fffffffffffff);\n  buffer.writeInt32LE(value & -1, offset);\n  buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4);\n  return offset + 8;\n}\nexports.writeUInt64LE = writeUInt64LE;\n/**\n * Reverses the order of bytes in a buffer.\n * @param buffer - The buffer to reverse.\n * @returns A new buffer with the bytes reversed.\n */\nfunction reverseBuffer(buffer) {\n  if (buffer.length < 1) return buffer;\n  let j = buffer.length - 1;\n  let tmp = 0;\n  for (let i = 0; i < buffer.length / 2; i++) {\n    tmp = buffer[i];\n    buffer[i] = buffer[j];\n    buffer[j] = tmp;\n    j--;\n  }\n  return buffer;\n}\nexports.reverseBuffer = reverseBuffer;\nfunction cloneBuffer(buffer) {\n  const clone = Buffer.allocUnsafe(buffer.length);\n  buffer.copy(clone);\n  return clone;\n}\nexports.cloneBuffer = cloneBuffer;\n/**\n * Helper class for serialization of bitcoin data types into a pre-allocated buffer.\n */\nclass BufferWriter {\n  static withCapacity(size) {\n    return new BufferWriter(Buffer.alloc(size));\n  }\n  constructor(buffer, offset = 0) {\n    this.buffer = buffer;\n    this.offset = offset;\n    typeforce(types.tuple(types.Buffer, types.UInt32), [buffer, offset]);\n  }\n  writeUInt8(i) {\n    this.offset = this.buffer.writeUInt8(i, this.offset);\n  }\n  writeInt32(i) {\n    this.offset = this.buffer.writeInt32LE(i, this.offset);\n  }\n  writeUInt32(i) {\n    this.offset = this.buffer.writeUInt32LE(i, this.offset);\n  }\n  writeUInt64(i) {\n    this.offset = writeUInt64LE(this.buffer, i, this.offset);\n  }\n  writeVarInt(i) {\n    varuint.encode(i, this.buffer, this.offset);\n    this.offset += varuint.encode.bytes;\n  }\n  writeSlice(slice) {\n    if (this.buffer.length < this.offset + slice.length) {\n      throw new Error('Cannot write slice out of bounds');\n    }\n    this.offset += slice.copy(this.buffer, this.offset);\n  }\n  writeVarSlice(slice) {\n    this.writeVarInt(slice.length);\n    this.writeSlice(slice);\n  }\n  writeVector(vector) {\n    this.writeVarInt(vector.length);\n    vector.forEach(buf => this.writeVarSlice(buf));\n  }\n  end() {\n    if (this.buffer.length === this.offset) {\n      return this.buffer;\n    }\n    throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`);\n  }\n}\nexports.BufferWriter = BufferWriter;\n/**\n * Helper class for reading of bitcoin data types from a buffer.\n */\nclass BufferReader {\n  constructor(buffer, offset = 0) {\n    this.buffer = buffer;\n    this.offset = offset;\n    typeforce(types.tuple(types.Buffer, types.UInt32), [buffer, offset]);\n  }\n  readUInt8() {\n    const result = this.buffer.readUInt8(this.offset);\n    this.offset++;\n    return result;\n  }\n  readInt32() {\n    const result = this.buffer.readInt32LE(this.offset);\n    this.offset += 4;\n    return result;\n  }\n  readUInt32() {\n    const result = this.buffer.readUInt32LE(this.offset);\n    this.offset += 4;\n    return result;\n  }\n  readUInt64() {\n    const result = readUInt64LE(this.buffer, this.offset);\n    this.offset += 8;\n    return result;\n  }\n  readVarInt() {\n    const vi = varuint.decode(this.buffer, this.offset);\n    this.offset += varuint.decode.bytes;\n    return vi;\n  }\n  readSlice(n) {\n    if (this.buffer.length < this.offset + n) {\n      throw new Error('Cannot read slice out of bounds');\n    }\n    const result = this.buffer.slice(this.offset, this.offset + n);\n    this.offset += n;\n    return result;\n  }\n  readVarSlice() {\n    return this.readSlice(this.readVarInt());\n  }\n  readVector() {\n    const count = this.readVarInt();\n    const vector = [];\n    for (let i = 0; i < count; i++) vector.push(this.readVarSlice());\n    return vector;\n  }\n}\nexports.BufferReader = BufferReader;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.taggedHash =\n  exports.TAGGED_HASH_PREFIXES =\n  exports.TAGS =\n  exports.hash256 =\n  exports.hash160 =\n  exports.sha256 =\n  exports.sha1 =\n  exports.ripemd160 =\n    void 0;\n/**\n * A module for hashing functions.\n * include ripemd160、sha1、sha256、hash160、hash256、taggedHash\n *\n * @packageDocumentation\n */\nconst ripemd160_1 = require('@noble/hashes/ripemd160');\nconst sha1_1 = require('@noble/hashes/sha1');\nconst sha256_1 = require('@noble/hashes/sha256');\nfunction ripemd160(buffer) {\n  return Buffer.from((0, ripemd160_1.ripemd160)(Uint8Array.from(buffer)));\n}\nexports.ripemd160 = ripemd160;\nfunction sha1(buffer) {\n  return Buffer.from((0, sha1_1.sha1)(Uint8Array.from(buffer)));\n}\nexports.sha1 = sha1;\nfunction sha256(buffer) {\n  return Buffer.from((0, sha256_1.sha256)(Uint8Array.from(buffer)));\n}\nexports.sha256 = sha256;\nfunction hash160(buffer) {\n  return Buffer.from(\n    (0, ripemd160_1.ripemd160)((0, sha256_1.sha256)(Uint8Array.from(buffer))),\n  );\n}\nexports.hash160 = hash160;\nfunction hash256(buffer) {\n  return Buffer.from(\n    (0, sha256_1.sha256)((0, sha256_1.sha256)(Uint8Array.from(buffer))),\n  );\n}\nexports.hash256 = hash256;\nexports.TAGS = [\n  'BIP0340/challenge',\n  'BIP0340/aux',\n  'BIP0340/nonce',\n  'TapLeaf',\n  'TapBranch',\n  'TapSighash',\n  'TapTweak',\n  'KeyAgg list',\n  'KeyAgg coefficient',\n];\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\n/**\n * Defines the tagged hash prefixes used in the crypto module.\n */\nexports.TAGGED_HASH_PREFIXES = {\n  'BIP0340/challenge': Buffer.from([\n    123, 181, 45, 122, 159, 239, 88, 50, 62, 177, 191, 122, 64, 125, 179, 130,\n    210, 243, 242, 216, 27, 177, 34, 79, 73, 254, 81, 143, 109, 72, 211, 124,\n    123, 181, 45, 122, 159, 239, 88, 50, 62, 177, 191, 122, 64, 125, 179, 130,\n    210, 243, 242, 216, 27, 177, 34, 79, 73, 254, 81, 143, 109, 72, 211, 124,\n  ]),\n  'BIP0340/aux': Buffer.from([\n    241, 239, 78, 94, 192, 99, 202, 218, 109, 148, 202, 250, 157, 152, 126, 160,\n    105, 38, 88, 57, 236, 193, 31, 151, 45, 119, 165, 46, 216, 193, 204, 144,\n    241, 239, 78, 94, 192, 99, 202, 218, 109, 148, 202, 250, 157, 152, 126, 160,\n    105, 38, 88, 57, 236, 193, 31, 151, 45, 119, 165, 46, 216, 193, 204, 144,\n  ]),\n  'BIP0340/nonce': Buffer.from([\n    7, 73, 119, 52, 167, 155, 203, 53, 91, 155, 140, 125, 3, 79, 18, 28, 244,\n    52, 215, 62, 247, 45, 218, 25, 135, 0, 97, 251, 82, 191, 235, 47, 7, 73,\n    119, 52, 167, 155, 203, 53, 91, 155, 140, 125, 3, 79, 18, 28, 244, 52, 215,\n    62, 247, 45, 218, 25, 135, 0, 97, 251, 82, 191, 235, 47,\n  ]),\n  TapLeaf: Buffer.from([\n    174, 234, 143, 220, 66, 8, 152, 49, 5, 115, 75, 88, 8, 29, 30, 38, 56, 211,\n    95, 28, 181, 64, 8, 212, 211, 87, 202, 3, 190, 120, 233, 238, 174, 234, 143,\n    220, 66, 8, 152, 49, 5, 115, 75, 88, 8, 29, 30, 38, 56, 211, 95, 28, 181,\n    64, 8, 212, 211, 87, 202, 3, 190, 120, 233, 238,\n  ]),\n  TapBranch: Buffer.from([\n    25, 65, 161, 242, 229, 110, 185, 95, 162, 169, 241, 148, 190, 92, 1, 247,\n    33, 111, 51, 237, 130, 176, 145, 70, 52, 144, 208, 91, 245, 22, 160, 21, 25,\n    65, 161, 242, 229, 110, 185, 95, 162, 169, 241, 148, 190, 92, 1, 247, 33,\n    111, 51, 237, 130, 176, 145, 70, 52, 144, 208, 91, 245, 22, 160, 21,\n  ]),\n  TapSighash: Buffer.from([\n    244, 10, 72, 223, 75, 42, 112, 200, 180, 146, 75, 242, 101, 70, 97, 237, 61,\n    149, 253, 102, 163, 19, 235, 135, 35, 117, 151, 198, 40, 228, 160, 49, 244,\n    10, 72, 223, 75, 42, 112, 200, 180, 146, 75, 242, 101, 70, 97, 237, 61, 149,\n    253, 102, 163, 19, 235, 135, 35, 117, 151, 198, 40, 228, 160, 49,\n  ]),\n  TapTweak: Buffer.from([\n    232, 15, 225, 99, 156, 156, 160, 80, 227, 175, 27, 57, 193, 67, 198, 62, 66,\n    156, 188, 235, 21, 217, 64, 251, 181, 197, 161, 244, 175, 87, 197, 233, 232,\n    15, 225, 99, 156, 156, 160, 80, 227, 175, 27, 57, 193, 67, 198, 62, 66, 156,\n    188, 235, 21, 217, 64, 251, 181, 197, 161, 244, 175, 87, 197, 233,\n  ]),\n  'KeyAgg list': Buffer.from([\n    72, 28, 151, 28, 60, 11, 70, 215, 240, 178, 117, 174, 89, 141, 78, 44, 126,\n    215, 49, 156, 89, 74, 92, 110, 199, 158, 160, 212, 153, 2, 148, 240, 72, 28,\n    151, 28, 60, 11, 70, 215, 240, 178, 117, 174, 89, 141, 78, 44, 126, 215, 49,\n    156, 89, 74, 92, 110, 199, 158, 160, 212, 153, 2, 148, 240,\n  ]),\n  'KeyAgg coefficient': Buffer.from([\n    191, 201, 4, 3, 77, 28, 136, 232, 200, 14, 34, 229, 61, 36, 86, 109, 100,\n    130, 78, 214, 66, 114, 129, 192, 145, 0, 249, 77, 205, 82, 201, 129, 191,\n    201, 4, 3, 77, 28, 136, 232, 200, 14, 34, 229, 61, 36, 86, 109, 100, 130,\n    78, 214, 66, 114, 129, 192, 145, 0, 249, 77, 205, 82, 201, 129,\n  ]),\n};\nfunction taggedHash(prefix, data) {\n  return sha256(Buffer.concat([exports.TAGGED_HASH_PREFIXES[prefix], data]));\n}\nexports.taggedHash = taggedHash;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.getEccLib = exports.initEccLib = void 0;\nconst _ECCLIB_CACHE = {};\n/**\n * Initializes the ECC library with the provided instance.\n * If `eccLib` is `undefined`, the library will be cleared.\n * If `eccLib` is a new instance, it will be verified before setting it as the active library.\n *\n * @param eccLib The instance of the ECC library to initialize.\n * @param opts Extra initialization options. Use {DANGER_DO_NOT_VERIFY_ECCLIB:true} if ecc verification should not be executed. Not recommended!\n */\nfunction initEccLib(eccLib, opts) {\n  if (!eccLib) {\n    // allow clearing the library\n    _ECCLIB_CACHE.eccLib = eccLib;\n  } else if (eccLib !== _ECCLIB_CACHE.eccLib) {\n    if (!opts?.DANGER_DO_NOT_VERIFY_ECCLIB)\n      // new instance, verify it\n      verifyEcc(eccLib);\n    _ECCLIB_CACHE.eccLib = eccLib;\n  }\n}\nexports.initEccLib = initEccLib;\n/**\n * Retrieves the ECC Library instance.\n * Throws an error if the ECC Library is not provided.\n * You must call initEccLib() with a valid TinySecp256k1Interface instance before calling this function.\n * @returns The ECC Library instance.\n * @throws Error if the ECC Library is not provided.\n */\nfunction getEccLib() {\n  if (!_ECCLIB_CACHE.eccLib)\n    throw new Error(\n      'No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance',\n    );\n  return _ECCLIB_CACHE.eccLib;\n}\nexports.getEccLib = getEccLib;\nconst h = hex => Buffer.from(hex, 'hex');\n/**\n * Verifies the ECC functionality.\n *\n * @param ecc - The TinySecp256k1Interface object.\n */\nfunction verifyEcc(ecc) {\n  assert(typeof ecc.isXOnlyPoint === 'function');\n  assert(\n    ecc.isXOnlyPoint(\n      h('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n    ),\n  );\n  assert(\n    ecc.isXOnlyPoint(\n      h('fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e'),\n    ),\n  );\n  assert(\n    ecc.isXOnlyPoint(\n      h('f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9'),\n    ),\n  );\n  assert(\n    ecc.isXOnlyPoint(\n      h('0000000000000000000000000000000000000000000000000000000000000001'),\n    ),\n  );\n  assert(\n    !ecc.isXOnlyPoint(\n      h('0000000000000000000000000000000000000000000000000000000000000000'),\n    ),\n  );\n  assert(\n    !ecc.isXOnlyPoint(\n      h('fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'),\n    ),\n  );\n  assert(typeof ecc.xOnlyPointAddTweak === 'function');\n  tweakAddVectors.forEach(t => {\n    const r = ecc.xOnlyPointAddTweak(h(t.pubkey), h(t.tweak));\n    if (t.result === null) {\n      assert(r === null);\n    } else {\n      assert(r !== null);\n      assert(r.parity === t.parity);\n      assert(Buffer.from(r.xOnlyPubkey).equals(h(t.result)));\n    }\n  });\n}\nfunction assert(bool) {\n  if (!bool) throw new Error('ecc library invalid');\n}\nconst tweakAddVectors = [\n  {\n    pubkey: '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n    tweak: 'fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140',\n    parity: -1,\n    result: null,\n  },\n  {\n    pubkey: '1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b',\n    tweak: 'a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac',\n    parity: 1,\n    result: 'e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf',\n  },\n  {\n    pubkey: '2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991',\n    tweak: '823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47',\n    parity: 0,\n    result: '9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c',\n  },\n];\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.initEccLib =\n  exports.Transaction =\n  exports.opcodes =\n  exports.Psbt =\n  exports.Block =\n  exports.script =\n  exports.payments =\n  exports.networks =\n  exports.crypto =\n  exports.address =\n    void 0;\nconst address = require('./address');\nexports.address = address;\nconst crypto = require('./crypto');\nexports.crypto = crypto;\nconst networks = require('./networks');\nexports.networks = networks;\nconst payments = require('./payments');\nexports.payments = payments;\nconst script = require('./script');\nexports.script = script;\nvar block_1 = require('./block');\nObject.defineProperty(exports, 'Block', {\n  enumerable: true,\n  get: function () {\n    return block_1.Block;\n  },\n});\nvar psbt_1 = require('./psbt');\nObject.defineProperty(exports, 'Psbt', {\n  enumerable: true,\n  get: function () {\n    return psbt_1.Psbt;\n  },\n});\n/** @hidden */\nvar ops_1 = require('./ops');\nObject.defineProperty(exports, 'opcodes', {\n  enumerable: true,\n  get: function () {\n    return ops_1.OPS;\n  },\n});\nvar transaction_1 = require('./transaction');\nObject.defineProperty(exports, 'Transaction', {\n  enumerable: true,\n  get: function () {\n    return transaction_1.Transaction;\n  },\n});\nvar ecc_lib_1 = require('./ecc_lib');\nObject.defineProperty(exports, 'initEccLib', {\n  enumerable: true,\n  get: function () {\n    return ecc_lib_1.initEccLib;\n  },\n});\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.fastMerkleRoot = void 0;\n/**\n * Calculates the Merkle root of an array of buffers using a specified digest function.\n *\n * @param values - The array of buffers.\n * @param digestFn - The digest function used to calculate the hash of the concatenated buffers.\n * @returns The Merkle root as a buffer.\n * @throws {TypeError} If the values parameter is not an array or the digestFn parameter is not a function.\n */\nfunction fastMerkleRoot(values, digestFn) {\n  if (!Array.isArray(values)) throw TypeError('Expected values Array');\n  if (typeof digestFn !== 'function')\n    throw TypeError('Expected digest Function');\n  let length = values.length;\n  const results = values.concat();\n  while (length > 1) {\n    let j = 0;\n    for (let i = 0; i < length; i += 2, ++j) {\n      const left = results[i];\n      const right = i + 1 === length ? left : results[i + 1];\n      const data = Buffer.concat([left, right]);\n      results[j] = digestFn(data);\n    }\n    length = j;\n  }\n  return results[0];\n}\nexports.fastMerkleRoot = fastMerkleRoot;\n'use strict';\n// https://en.bitcoin.it/wiki/List_of_address_prefixes\n// Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.testnet = exports.regtest = exports.bitcoin = void 0;\n/**\n * Represents the Bitcoin network configuration.\n */\nexports.bitcoin = {\n  /**\n   * The message prefix used for signing Bitcoin messages.\n   */\n  messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n  /**\n   * The Bech32 prefix used for Bitcoin addresses.\n   */\n  bech32: 'bc',\n  /**\n   * The BIP32 key prefixes for Bitcoin.\n   */\n  bip32: {\n    /**\n     * The public key prefix for BIP32 extended public keys.\n     */\n    public: 0x0488b21e,\n    /**\n     * The private key prefix for BIP32 extended private keys.\n     */\n    private: 0x0488ade4,\n  },\n  /**\n   * The prefix for Bitcoin public key hashes.\n   */\n  pubKeyHash: 0x00,\n  /**\n   * The prefix for Bitcoin script hashes.\n   */\n  scriptHash: 0x05,\n  /**\n   * The prefix for Bitcoin Wallet Import Format (WIF) private keys.\n   */\n  wif: 0x80,\n};\n/**\n * Represents the regtest network configuration.\n */\nexports.regtest = {\n  messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n  bech32: 'bcrt',\n  bip32: {\n    public: 0x043587cf,\n    private: 0x04358394,\n  },\n  pubKeyHash: 0x6f,\n  scriptHash: 0xc4,\n  wif: 0xef,\n};\n/**\n * Represents the testnet network configuration.\n */\nexports.testnet = {\n  messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n  bech32: 'tb',\n  bip32: {\n    public: 0x043587cf,\n    private: 0x04358394,\n  },\n  pubKeyHash: 0x6f,\n  scriptHash: 0xc4,\n  wif: 0xef,\n};\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.REVERSE_OPS = exports.OPS = void 0;\nconst OPS = {\n  OP_FALSE: 0,\n  OP_0: 0,\n  OP_PUSHDATA1: 76,\n  OP_PUSHDATA2: 77,\n  OP_PUSHDATA4: 78,\n  OP_1NEGATE: 79,\n  OP_RESERVED: 80,\n  OP_TRUE: 81,\n  OP_1: 81,\n  OP_2: 82,\n  OP_3: 83,\n  OP_4: 84,\n  OP_5: 85,\n  OP_6: 86,\n  OP_7: 87,\n  OP_8: 88,\n  OP_9: 89,\n  OP_10: 90,\n  OP_11: 91,\n  OP_12: 92,\n  OP_13: 93,\n  OP_14: 94,\n  OP_15: 95,\n  OP_16: 96,\n  OP_NOP: 97,\n  OP_VER: 98,\n  OP_IF: 99,\n  OP_NOTIF: 100,\n  OP_VERIF: 101,\n  OP_VERNOTIF: 102,\n  OP_ELSE: 103,\n  OP_ENDIF: 104,\n  OP_VERIFY: 105,\n  OP_RETURN: 106,\n  OP_TOALTSTACK: 107,\n  OP_FROMALTSTACK: 108,\n  OP_2DROP: 109,\n  OP_2DUP: 110,\n  OP_3DUP: 111,\n  OP_2OVER: 112,\n  OP_2ROT: 113,\n  OP_2SWAP: 114,\n  OP_IFDUP: 115,\n  OP_DEPTH: 116,\n  OP_DROP: 117,\n  OP_DUP: 118,\n  OP_NIP: 119,\n  OP_OVER: 120,\n  OP_PICK: 121,\n  OP_ROLL: 122,\n  OP_ROT: 123,\n  OP_SWAP: 124,\n  OP_TUCK: 125,\n  OP_CAT: 126,\n  OP_SUBSTR: 127,\n  OP_LEFT: 128,\n  OP_RIGHT: 129,\n  OP_SIZE: 130,\n  OP_INVERT: 131,\n  OP_AND: 132,\n  OP_OR: 133,\n  OP_XOR: 134,\n  OP_EQUAL: 135,\n  OP_EQUALVERIFY: 136,\n  OP_RESERVED1: 137,\n  OP_RESERVED2: 138,\n  OP_1ADD: 139,\n  OP_1SUB: 140,\n  OP_2MUL: 141,\n  OP_2DIV: 142,\n  OP_NEGATE: 143,\n  OP_ABS: 144,\n  OP_NOT: 145,\n  OP_0NOTEQUAL: 146,\n  OP_ADD: 147,\n  OP_SUB: 148,\n  OP_MUL: 149,\n  OP_DIV: 150,\n  OP_MOD: 151,\n  OP_LSHIFT: 152,\n  OP_RSHIFT: 153,\n  OP_BOOLAND: 154,\n  OP_BOOLOR: 155,\n  OP_NUMEQUAL: 156,\n  OP_NUMEQUALVERIFY: 157,\n  OP_NUMNOTEQUAL: 158,\n  OP_LESSTHAN: 159,\n  OP_GREATERTHAN: 160,\n  OP_LESSTHANOREQUAL: 161,\n  OP_GREATERTHANOREQUAL: 162,\n  OP_MIN: 163,\n  OP_MAX: 164,\n  OP_WITHIN: 165,\n  OP_RIPEMD160: 166,\n  OP_SHA1: 167,\n  OP_SHA256: 168,\n  OP_HASH160: 169,\n  OP_HASH256: 170,\n  OP_CODESEPARATOR: 171,\n  OP_CHECKSIG: 172,\n  OP_CHECKSIGVERIFY: 173,\n  OP_CHECKMULTISIG: 174,\n  OP_CHECKMULTISIGVERIFY: 175,\n  OP_NOP1: 176,\n  OP_NOP2: 177,\n  OP_CHECKLOCKTIMEVERIFY: 177,\n  OP_NOP3: 178,\n  OP_CHECKSEQUENCEVERIFY: 178,\n  OP_NOP4: 179,\n  OP_NOP5: 180,\n  OP_NOP6: 181,\n  OP_NOP7: 182,\n  OP_NOP8: 183,\n  OP_NOP9: 184,\n  OP_NOP10: 185,\n  OP_CHECKSIGADD: 186,\n  OP_PUBKEYHASH: 253,\n  OP_PUBKEY: 254,\n  OP_INVALIDOPCODE: 255,\n};\nexports.OPS = OPS;\nconst REVERSE_OPS = {};\nexports.REVERSE_OPS = REVERSE_OPS;\nfor (const op of Object.keys(OPS)) {\n  const code = OPS[op];\n  REVERSE_OPS[code] = op;\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.tweakKey =\n  exports.tapTweakHash =\n  exports.tapleafHash =\n  exports.findScriptPath =\n  exports.toHashTree =\n  exports.rootHashFromPath =\n  exports.MAX_TAPTREE_DEPTH =\n  exports.LEAF_VERSION_TAPSCRIPT =\n    void 0;\nconst buffer_1 = require('buffer');\nconst ecc_lib_1 = require('../ecc_lib');\nconst bcrypto = require('../crypto');\nconst bufferutils_1 = require('../bufferutils');\nconst types_1 = require('../types');\nexports.LEAF_VERSION_TAPSCRIPT = 0xc0;\nexports.MAX_TAPTREE_DEPTH = 128;\nconst isHashBranch = ht => 'left' in ht && 'right' in ht;\n/**\n * Calculates the root hash from a given control block and leaf hash.\n * @param controlBlock - The control block buffer.\n * @param leafHash - The leaf hash buffer.\n * @returns The root hash buffer.\n * @throws {TypeError} If the control block length is less than 33.\n */\nfunction rootHashFromPath(controlBlock, leafHash) {\n  if (controlBlock.length < 33)\n    throw new TypeError(\n      `The control-block length is too small. Got ${controlBlock.length}, expected min 33.`,\n    );\n  const m = (controlBlock.length - 33) / 32;\n  let kj = leafHash;\n  for (let j = 0; j < m; j++) {\n    const ej = controlBlock.slice(33 + 32 * j, 65 + 32 * j);\n    if (kj.compare(ej) < 0) {\n      kj = tapBranchHash(kj, ej);\n    } else {\n      kj = tapBranchHash(ej, kj);\n    }\n  }\n  return kj;\n}\nexports.rootHashFromPath = rootHashFromPath;\n/**\n * Build a hash tree of merkle nodes from the scripts binary tree.\n * @param scriptTree - the tree of scripts to pairwise hash.\n */\nfunction toHashTree(scriptTree) {\n  if ((0, types_1.isTapleaf)(scriptTree))\n    return { hash: tapleafHash(scriptTree) };\n  const hashes = [toHashTree(scriptTree[0]), toHashTree(scriptTree[1])];\n  hashes.sort((a, b) => a.hash.compare(b.hash));\n  const [left, right] = hashes;\n  return {\n    hash: tapBranchHash(left.hash, right.hash),\n    left,\n    right,\n  };\n}\nexports.toHashTree = toHashTree;\n/**\n * Given a HashTree, finds the path from a particular hash to the root.\n * @param node - the root of the tree\n * @param hash - the hash to search for\n * @returns - array of sibling hashes, from leaf (inclusive) to root\n * (exclusive) needed to prove inclusion of the specified hash. undefined if no\n * path is found\n */\nfunction findScriptPath(node, hash) {\n  if (isHashBranch(node)) {\n    const leftPath = findScriptPath(node.left, hash);\n    if (leftPath !== undefined) return [...leftPath, node.right.hash];\n    const rightPath = findScriptPath(node.right, hash);\n    if (rightPath !== undefined) return [...rightPath, node.left.hash];\n  } else if (node.hash.equals(hash)) {\n    return [];\n  }\n  return undefined;\n}\nexports.findScriptPath = findScriptPath;\nfunction tapleafHash(leaf) {\n  const version = leaf.version || exports.LEAF_VERSION_TAPSCRIPT;\n  return bcrypto.taggedHash(\n    'TapLeaf',\n    buffer_1.Buffer.concat([\n      buffer_1.Buffer.from([version]),\n      serializeScript(leaf.output),\n    ]),\n  );\n}\nexports.tapleafHash = tapleafHash;\nfunction tapTweakHash(pubKey, h) {\n  return bcrypto.taggedHash(\n    'TapTweak',\n    buffer_1.Buffer.concat(h ? [pubKey, h] : [pubKey]),\n  );\n}\nexports.tapTweakHash = tapTweakHash;\nfunction tweakKey(pubKey, h) {\n  if (!buffer_1.Buffer.isBuffer(pubKey)) return null;\n  if (pubKey.length !== 32) return null;\n  if (h && h.length !== 32) return null;\n  const tweakHash = tapTweakHash(pubKey, h);\n  const res = (0, ecc_lib_1.getEccLib)().xOnlyPointAddTweak(pubKey, tweakHash);\n  if (!res || res.xOnlyPubkey === null) return null;\n  return {\n    parity: res.parity,\n    x: buffer_1.Buffer.from(res.xOnlyPubkey),\n  };\n}\nexports.tweakKey = tweakKey;\nfunction tapBranchHash(a, b) {\n  return bcrypto.taggedHash('TapBranch', buffer_1.Buffer.concat([a, b]));\n}\nfunction serializeScript(s) {\n  const varintLen = bufferutils_1.varuint.encodingLength(s.length);\n  const buffer = buffer_1.Buffer.allocUnsafe(varintLen); // better\n  bufferutils_1.varuint.encode(s.length, buffer);\n  return buffer_1.Buffer.concat([buffer, s]);\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2data = void 0;\nconst networks_1 = require('../networks');\nconst bscript = require('../script');\nconst types_1 = require('../types');\nconst lazy = require('./lazy');\nconst OPS = bscript.OPS;\n// output: OP_RETURN ...\n/**\n * Embeds data in a Bitcoin payment.\n * @param a - The payment object.\n * @param opts - Optional payment options.\n * @returns The modified payment object.\n * @throws {TypeError} If there is not enough data or if the output is invalid.\n */\nfunction p2data(a, opts) {\n  if (!a.data && !a.output) throw new TypeError('Not enough data');\n  opts = Object.assign({ validate: true }, opts || {});\n  (0, types_1.typeforce)(\n    {\n      network: types_1.typeforce.maybe(types_1.typeforce.Object),\n      output: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n      data: types_1.typeforce.maybe(\n        types_1.typeforce.arrayOf(types_1.typeforce.Buffer),\n      ),\n    },\n    a,\n  );\n  const network = a.network || networks_1.bitcoin;\n  const o = { name: 'embed', network };\n  lazy.prop(o, 'output', () => {\n    if (!a.data) return;\n    return bscript.compile([OPS.OP_RETURN].concat(a.data));\n  });\n  lazy.prop(o, 'data', () => {\n    if (!a.output) return;\n    return bscript.decompile(a.output).slice(1);\n  });\n  // extended validation\n  if (opts.validate) {\n    if (a.output) {\n      const chunks = bscript.decompile(a.output);\n      if (chunks[0] !== OPS.OP_RETURN) throw new TypeError('Output is invalid');\n      if (!chunks.slice(1).every(types_1.typeforce.Buffer))\n        throw new TypeError('Output is invalid');\n      if (a.data && !(0, types_1.stacksEqual)(a.data, o.data))\n        throw new TypeError('Data mismatch');\n    }\n  }\n  return Object.assign(o, a);\n}\nexports.p2data = p2data;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2tr =\n  exports.p2wsh =\n  exports.p2wpkh =\n  exports.p2sh =\n  exports.p2pkh =\n  exports.p2pk =\n  exports.p2ms =\n  exports.embed =\n    void 0;\nconst embed_1 = require('./embed');\nObject.defineProperty(exports, 'embed', {\n  enumerable: true,\n  get: function () {\n    return embed_1.p2data;\n  },\n});\nconst p2ms_1 = require('./p2ms');\nObject.defineProperty(exports, 'p2ms', {\n  enumerable: true,\n  get: function () {\n    return p2ms_1.p2ms;\n  },\n});\nconst p2pk_1 = require('./p2pk');\nObject.defineProperty(exports, 'p2pk', {\n  enumerable: true,\n  get: function () {\n    return p2pk_1.p2pk;\n  },\n});\nconst p2pkh_1 = require('./p2pkh');\nObject.defineProperty(exports, 'p2pkh', {\n  enumerable: true,\n  get: function () {\n    return p2pkh_1.p2pkh;\n  },\n});\nconst p2sh_1 = require('./p2sh');\nObject.defineProperty(exports, 'p2sh', {\n  enumerable: true,\n  get: function () {\n    return p2sh_1.p2sh;\n  },\n});\nconst p2wpkh_1 = require('./p2wpkh');\nObject.defineProperty(exports, 'p2wpkh', {\n  enumerable: true,\n  get: function () {\n    return p2wpkh_1.p2wpkh;\n  },\n});\nconst p2wsh_1 = require('./p2wsh');\nObject.defineProperty(exports, 'p2wsh', {\n  enumerable: true,\n  get: function () {\n    return p2wsh_1.p2wsh;\n  },\n});\nconst p2tr_1 = require('./p2tr');\nObject.defineProperty(exports, 'p2tr', {\n  enumerable: true,\n  get: function () {\n    return p2tr_1.p2tr;\n  },\n});\n// TODO\n// witness commitment\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.value = exports.prop = void 0;\nfunction prop(object, name, f) {\n  Object.defineProperty(object, name, {\n    configurable: true,\n    enumerable: true,\n    get() {\n      const _value = f.call(this);\n      this[name] = _value;\n      return _value;\n    },\n    set(_value) {\n      Object.defineProperty(this, name, {\n        configurable: true,\n        enumerable: true,\n        value: _value,\n        writable: true,\n      });\n    },\n  });\n}\nexports.prop = prop;\nfunction value(f) {\n  let _value;\n  return () => {\n    if (_value !== undefined) return _value;\n    _value = f();\n    return _value;\n  };\n}\nexports.value = value;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2ms = void 0;\nconst networks_1 = require('../networks');\nconst bscript = require('../script');\nconst types_1 = require('../types');\nconst lazy = require('./lazy');\nconst OPS = bscript.OPS;\nconst OP_INT_BASE = OPS.OP_RESERVED; // OP_1 - 1\n// input: OP_0 [signatures ...]\n// output: m [pubKeys ...] n OP_CHECKMULTISIG\n/**\n * Represents a function that creates a Pay-to-Multisig (P2MS) payment object.\n * @param a - The payment object.\n * @param opts - Optional payment options.\n * @returns The created payment object.\n * @throws {TypeError} If the provided data is not valid.\n */\nfunction p2ms(a, opts) {\n  if (\n    !a.input &&\n    !a.output &&\n    !(a.pubkeys && a.m !== undefined) &&\n    !a.signatures\n  )\n    throw new TypeError('Not enough data');\n  opts = Object.assign({ validate: true }, opts || {});\n  function isAcceptableSignature(x) {\n    return (\n      bscript.isCanonicalScriptSignature(x) ||\n      (opts.allowIncomplete && x === OPS.OP_0) !== undefined\n    );\n  }\n  (0, types_1.typeforce)(\n    {\n      network: types_1.typeforce.maybe(types_1.typeforce.Object),\n      m: types_1.typeforce.maybe(types_1.typeforce.Number),\n      n: types_1.typeforce.maybe(types_1.typeforce.Number),\n      output: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n      pubkeys: types_1.typeforce.maybe(\n        types_1.typeforce.arrayOf(types_1.isPoint),\n      ),\n      signatures: types_1.typeforce.maybe(\n        types_1.typeforce.arrayOf(isAcceptableSignature),\n      ),\n      input: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n    },\n    a,\n  );\n  const network = a.network || networks_1.bitcoin;\n  const o = { network };\n  let chunks = [];\n  let decoded = false;\n  function decode(output) {\n    if (decoded) return;\n    decoded = true;\n    chunks = bscript.decompile(output);\n    o.m = chunks[0] - OP_INT_BASE;\n    o.n = chunks[chunks.length - 2] - OP_INT_BASE;\n    o.pubkeys = chunks.slice(1, -2);\n  }\n  lazy.prop(o, 'output', () => {\n    if (!a.m) return;\n    if (!o.n) return;\n    if (!a.pubkeys) return;\n    return bscript.compile(\n      [].concat(\n        OP_INT_BASE + a.m,\n        a.pubkeys,\n        OP_INT_BASE + o.n,\n        OPS.OP_CHECKMULTISIG,\n      ),\n    );\n  });\n  lazy.prop(o, 'm', () => {\n    if (!o.output) return;\n    decode(o.output);\n    return o.m;\n  });\n  lazy.prop(o, 'n', () => {\n    if (!o.pubkeys) return;\n    return o.pubkeys.length;\n  });\n  lazy.prop(o, 'pubkeys', () => {\n    if (!a.output) return;\n    decode(a.output);\n    return o.pubkeys;\n  });\n  lazy.prop(o, 'signatures', () => {\n    if (!a.input) return;\n    return bscript.decompile(a.input).slice(1);\n  });\n  lazy.prop(o, 'input', () => {\n    if (!a.signatures) return;\n    return bscript.compile([OPS.OP_0].concat(a.signatures));\n  });\n  lazy.prop(o, 'witness', () => {\n    if (!o.input) return;\n    return [];\n  });\n  lazy.prop(o, 'name', () => {\n    if (!o.m || !o.n) return;\n    return `p2ms(${o.m} of ${o.n})`;\n  });\n  // extended validation\n  if (opts.validate) {\n    if (a.output) {\n      decode(a.output);\n      if (!types_1.typeforce.Number(chunks[0]))\n        throw new TypeError('Output is invalid');\n      if (!types_1.typeforce.Number(chunks[chunks.length - 2]))\n        throw new TypeError('Output is invalid');\n      if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG)\n        throw new TypeError('Output is invalid');\n      if (o.m <= 0 || o.n > 16 || o.m > o.n || o.n !== chunks.length - 3)\n        throw new TypeError('Output is invalid');\n      if (!o.pubkeys.every(x => (0, types_1.isPoint)(x)))\n        throw new TypeError('Output is invalid');\n      if (a.m !== undefined && a.m !== o.m) throw new TypeError('m mismatch');\n      if (a.n !== undefined && a.n !== o.n) throw new TypeError('n mismatch');\n      if (a.pubkeys && !(0, types_1.stacksEqual)(a.pubkeys, o.pubkeys))\n        throw new TypeError('Pubkeys mismatch');\n    }\n    if (a.pubkeys) {\n      if (a.n !== undefined && a.n !== a.pubkeys.length)\n        throw new TypeError('Pubkey count mismatch');\n      o.n = a.pubkeys.length;\n      if (o.n < o.m) throw new TypeError('Pubkey count cannot be less than m');\n    }\n    if (a.signatures) {\n      if (a.signatures.length < o.m)\n        throw new TypeError('Not enough signatures provided');\n      if (a.signatures.length > o.m)\n        throw new TypeError('Too many signatures provided');\n    }\n    if (a.input) {\n      if (a.input[0] !== OPS.OP_0) throw new TypeError('Input is invalid');\n      if (\n        o.signatures.length === 0 ||\n        !o.signatures.every(isAcceptableSignature)\n      )\n        throw new TypeError('Input has invalid signature(s)');\n      if (a.signatures && !(0, types_1.stacksEqual)(a.signatures, o.signatures))\n        throw new TypeError('Signature mismatch');\n      if (a.m !== undefined && a.m !== a.signatures.length)\n        throw new TypeError('Signature count mismatch');\n    }\n  }\n  return Object.assign(o, a);\n}\nexports.p2ms = p2ms;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2pk = void 0;\nconst networks_1 = require('../networks');\nconst bscript = require('../script');\nconst types_1 = require('../types');\nconst lazy = require('./lazy');\nconst OPS = bscript.OPS;\n// input: {signature}\n// output: {pubKey} OP_CHECKSIG\n/**\n * Creates a pay-to-public-key (P2PK) payment object.\n *\n * @param a - The payment object containing the necessary data.\n * @param opts - Optional payment options.\n * @returns The P2PK payment object.\n * @throws {TypeError} If the required data is not provided or if the data is invalid.\n */\nfunction p2pk(a, opts) {\n  if (!a.input && !a.output && !a.pubkey && !a.input && !a.signature)\n    throw new TypeError('Not enough data');\n  opts = Object.assign({ validate: true }, opts || {});\n  (0, types_1.typeforce)(\n    {\n      network: types_1.typeforce.maybe(types_1.typeforce.Object),\n      output: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n      pubkey: types_1.typeforce.maybe(types_1.isPoint),\n      signature: types_1.typeforce.maybe(bscript.isCanonicalScriptSignature),\n      input: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n    },\n    a,\n  );\n  const _chunks = lazy.value(() => {\n    return bscript.decompile(a.input);\n  });\n  const network = a.network || networks_1.bitcoin;\n  const o = { name: 'p2pk', network };\n  lazy.prop(o, 'output', () => {\n    if (!a.pubkey) return;\n    return bscript.compile([a.pubkey, OPS.OP_CHECKSIG]);\n  });\n  lazy.prop(o, 'pubkey', () => {\n    if (!a.output) return;\n    return a.output.slice(1, -1);\n  });\n  lazy.prop(o, 'signature', () => {\n    if (!a.input) return;\n    return _chunks()[0];\n  });\n  lazy.prop(o, 'input', () => {\n    if (!a.signature) return;\n    return bscript.compile([a.signature]);\n  });\n  lazy.prop(o, 'witness', () => {\n    if (!o.input) return;\n    return [];\n  });\n  // extended validation\n  if (opts.validate) {\n    if (a.output) {\n      if (a.output[a.output.length - 1] !== OPS.OP_CHECKSIG)\n        throw new TypeError('Output is invalid');\n      if (!(0, types_1.isPoint)(o.pubkey))\n        throw new TypeError('Output pubkey is invalid');\n      if (a.pubkey && !a.pubkey.equals(o.pubkey))\n        throw new TypeError('Pubkey mismatch');\n    }\n    if (a.signature) {\n      if (a.input && !a.input.equals(o.input))\n        throw new TypeError('Signature mismatch');\n    }\n    if (a.input) {\n      if (_chunks().length !== 1) throw new TypeError('Input is invalid');\n      if (!bscript.isCanonicalScriptSignature(o.signature))\n        throw new TypeError('Input has invalid signature');\n    }\n  }\n  return Object.assign(o, a);\n}\nexports.p2pk = p2pk;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2pkh = void 0;\nconst bcrypto = require('../crypto');\nconst networks_1 = require('../networks');\nconst bscript = require('../script');\nconst types_1 = require('../types');\nconst lazy = require('./lazy');\nconst bs58check = require('bs58check');\nconst OPS = bscript.OPS;\n// input: {signature} {pubkey}\n// output: OP_DUP OP_HASH160 {hash160(pubkey)} OP_EQUALVERIFY OP_CHECKSIG\n/**\n * Creates a Pay-to-Public-Key-Hash (P2PKH) payment object.\n *\n * @param a - The payment object containing the necessary data.\n * @param opts - Optional payment options.\n * @returns The P2PKH payment object.\n * @throws {TypeError} If the required data is not provided or if the data is invalid.\n */\nfunction p2pkh(a, opts) {\n  if (!a.address && !a.hash && !a.output && !a.pubkey && !a.input)\n    throw new TypeError('Not enough data');\n  opts = Object.assign({ validate: true }, opts || {});\n  (0, types_1.typeforce)(\n    {\n      network: types_1.typeforce.maybe(types_1.typeforce.Object),\n      address: types_1.typeforce.maybe(types_1.typeforce.String),\n      hash: types_1.typeforce.maybe(types_1.typeforce.BufferN(20)),\n      output: types_1.typeforce.maybe(types_1.typeforce.BufferN(25)),\n      pubkey: types_1.typeforce.maybe(types_1.isPoint),\n      signature: types_1.typeforce.maybe(bscript.isCanonicalScriptSignature),\n      input: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n    },\n    a,\n  );\n  const _address = lazy.value(() => {\n    const payload = Buffer.from(bs58check.decode(a.address));\n    const version = payload.readUInt8(0);\n    const hash = payload.slice(1);\n    return { version, hash };\n  });\n  const _chunks = lazy.value(() => {\n    return bscript.decompile(a.input);\n  });\n  const network = a.network || networks_1.bitcoin;\n  const o = { name: 'p2pkh', network };\n  lazy.prop(o, 'address', () => {\n    if (!o.hash) return;\n    const payload = Buffer.allocUnsafe(21);\n    payload.writeUInt8(network.pubKeyHash, 0);\n    o.hash.copy(payload, 1);\n    return bs58check.encode(payload);\n  });\n  lazy.prop(o, 'hash', () => {\n    if (a.output) return a.output.slice(3, 23);\n    if (a.address) return _address().hash;\n    if (a.pubkey || o.pubkey) return bcrypto.hash160(a.pubkey || o.pubkey);\n  });\n  lazy.prop(o, 'output', () => {\n    if (!o.hash) return;\n    return bscript.compile([\n      OPS.OP_DUP,\n      OPS.OP_HASH160,\n      o.hash,\n      OPS.OP_EQUALVERIFY,\n      OPS.OP_CHECKSIG,\n    ]);\n  });\n  lazy.prop(o, 'pubkey', () => {\n    if (!a.input) return;\n    return _chunks()[1];\n  });\n  lazy.prop(o, 'signature', () => {\n    if (!a.input) return;\n    return _chunks()[0];\n  });\n  lazy.prop(o, 'input', () => {\n    if (!a.pubkey) return;\n    if (!a.signature) return;\n    return bscript.compile([a.signature, a.pubkey]);\n  });\n  lazy.prop(o, 'witness', () => {\n    if (!o.input) return;\n    return [];\n  });\n  // extended validation\n  if (opts.validate) {\n    let hash = Buffer.from([]);\n    if (a.address) {\n      if (_address().version !== network.pubKeyHash)\n        throw new TypeError('Invalid version or Network mismatch');\n      if (_address().hash.length !== 20) throw new TypeError('Invalid address');\n      hash = _address().hash;\n    }\n    if (a.hash) {\n      if (hash.length > 0 && !hash.equals(a.hash))\n        throw new TypeError('Hash mismatch');\n      else hash = a.hash;\n    }\n    if (a.output) {\n      if (\n        a.output.length !== 25 ||\n        a.output[0] !== OPS.OP_DUP ||\n        a.output[1] !== OPS.OP_HASH160 ||\n        a.output[2] !== 0x14 ||\n        a.output[23] !== OPS.OP_EQUALVERIFY ||\n        a.output[24] !== OPS.OP_CHECKSIG\n      )\n        throw new TypeError('Output is invalid');\n      const hash2 = a.output.slice(3, 23);\n      if (hash.length > 0 && !hash.equals(hash2))\n        throw new TypeError('Hash mismatch');\n      else hash = hash2;\n    }\n    if (a.pubkey) {\n      const pkh = bcrypto.hash160(a.pubkey);\n      if (hash.length > 0 && !hash.equals(pkh))\n        throw new TypeError('Hash mismatch');\n      else hash = pkh;\n    }\n    if (a.input) {\n      const chunks = _chunks();\n      if (chunks.length !== 2) throw new TypeError('Input is invalid');\n      if (!bscript.isCanonicalScriptSignature(chunks[0]))\n        throw new TypeError('Input has invalid signature');\n      if (!(0, types_1.isPoint)(chunks[1]))\n        throw new TypeError('Input has invalid pubkey');\n      if (a.signature && !a.signature.equals(chunks[0]))\n        throw new TypeError('Signature mismatch');\n      if (a.pubkey && !a.pubkey.equals(chunks[1]))\n        throw new TypeError('Pubkey mismatch');\n      const pkh = bcrypto.hash160(chunks[1]);\n      if (hash.length > 0 && !hash.equals(pkh))\n        throw new TypeError('Hash mismatch');\n    }\n  }\n  return Object.assign(o, a);\n}\nexports.p2pkh = p2pkh;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2sh = void 0;\nconst bcrypto = require('../crypto');\nconst networks_1 = require('../networks');\nconst bscript = require('../script');\nconst types_1 = require('../types');\nconst lazy = require('./lazy');\nconst bs58check = require('bs58check');\nconst OPS = bscript.OPS;\n// input: [redeemScriptSig ...] {redeemScript}\n// witness: <?>\n// output: OP_HASH160 {hash160(redeemScript)} OP_EQUAL\n/**\n * Creates a Pay-to-Script-Hash (P2SH) payment object.\n *\n * @param a - The payment object containing the necessary data.\n * @param opts - Optional payment options.\n * @returns The P2SH payment object.\n * @throws {TypeError} If the required data is not provided or if the data is invalid.\n */\nfunction p2sh(a, opts) {\n  if (!a.address && !a.hash && !a.output && !a.redeem && !a.input)\n    throw new TypeError('Not enough data');\n  opts = Object.assign({ validate: true }, opts || {});\n  (0, types_1.typeforce)(\n    {\n      network: types_1.typeforce.maybe(types_1.typeforce.Object),\n      address: types_1.typeforce.maybe(types_1.typeforce.String),\n      hash: types_1.typeforce.maybe(types_1.typeforce.BufferN(20)),\n      output: types_1.typeforce.maybe(types_1.typeforce.BufferN(23)),\n      redeem: types_1.typeforce.maybe({\n        network: types_1.typeforce.maybe(types_1.typeforce.Object),\n        output: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n        input: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n        witness: types_1.typeforce.maybe(\n          types_1.typeforce.arrayOf(types_1.typeforce.Buffer),\n        ),\n      }),\n      input: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n      witness: types_1.typeforce.maybe(\n        types_1.typeforce.arrayOf(types_1.typeforce.Buffer),\n      ),\n    },\n    a,\n  );\n  let network = a.network;\n  if (!network) {\n    network = (a.redeem && a.redeem.network) || networks_1.bitcoin;\n  }\n  const o = { network };\n  const _address = lazy.value(() => {\n    const payload = Buffer.from(bs58check.decode(a.address));\n    const version = payload.readUInt8(0);\n    const hash = payload.slice(1);\n    return { version, hash };\n  });\n  const _chunks = lazy.value(() => {\n    return bscript.decompile(a.input);\n  });\n  const _redeem = lazy.value(() => {\n    const chunks = _chunks();\n    const lastChunk = chunks[chunks.length - 1];\n    return {\n      network,\n      output: lastChunk === OPS.OP_FALSE ? Buffer.from([]) : lastChunk,\n      input: bscript.compile(chunks.slice(0, -1)),\n      witness: a.witness || [],\n    };\n  });\n  // output dependents\n  lazy.prop(o, 'address', () => {\n    if (!o.hash) return;\n    const payload = Buffer.allocUnsafe(21);\n    payload.writeUInt8(o.network.scriptHash, 0);\n    o.hash.copy(payload, 1);\n    return bs58check.encode(payload);\n  });\n  lazy.prop(o, 'hash', () => {\n    // in order of least effort\n    if (a.output) return a.output.slice(2, 22);\n    if (a.address) return _address().hash;\n    if (o.redeem && o.redeem.output) return bcrypto.hash160(o.redeem.output);\n  });\n  lazy.prop(o, 'output', () => {\n    if (!o.hash) return;\n    return bscript.compile([OPS.OP_HASH160, o.hash, OPS.OP_EQUAL]);\n  });\n  // input dependents\n  lazy.prop(o, 'redeem', () => {\n    if (!a.input) return;\n    return _redeem();\n  });\n  lazy.prop(o, 'input', () => {\n    if (!a.redeem || !a.redeem.input || !a.redeem.output) return;\n    return bscript.compile(\n      [].concat(bscript.decompile(a.redeem.input), a.redeem.output),\n    );\n  });\n  lazy.prop(o, 'witness', () => {\n    if (o.redeem && o.redeem.witness) return o.redeem.witness;\n    if (o.input) return [];\n  });\n  lazy.prop(o, 'name', () => {\n    const nameParts = ['p2sh'];\n    if (o.redeem !== undefined && o.redeem.name !== undefined)\n      nameParts.push(o.redeem.name);\n    return nameParts.join('-');\n  });\n  if (opts.validate) {\n    let hash = Buffer.from([]);\n    if (a.address) {\n      if (_address().version !== network.scriptHash)\n        throw new TypeError('Invalid version or Network mismatch');\n      if (_address().hash.length !== 20) throw new TypeError('Invalid address');\n      hash = _address().hash;\n    }\n    if (a.hash) {\n      if (hash.length > 0 && !hash.equals(a.hash))\n        throw new TypeError('Hash mismatch');\n      else hash = a.hash;\n    }\n    if (a.output) {\n      if (\n        a.output.length !== 23 ||\n        a.output[0] !== OPS.OP_HASH160 ||\n        a.output[1] !== 0x14 ||\n        a.output[22] !== OPS.OP_EQUAL\n      )\n        throw new TypeError('Output is invalid');\n      const hash2 = a.output.slice(2, 22);\n      if (hash.length > 0 && !hash.equals(hash2))\n        throw new TypeError('Hash mismatch');\n      else hash = hash2;\n    }\n    // inlined to prevent 'no-inner-declarations' failing\n    const checkRedeem = redeem => {\n      // is the redeem output empty/invalid?\n      if (redeem.output) {\n        const decompile = bscript.decompile(redeem.output);\n        if (!decompile || decompile.length < 1)\n          throw new TypeError('Redeem.output too short');\n        if (redeem.output.byteLength > 520)\n          throw new TypeError(\n            'Redeem.output unspendable if larger than 520 bytes',\n          );\n        if (bscript.countNonPushOnlyOPs(decompile) > 201)\n          throw new TypeError(\n            'Redeem.output unspendable with more than 201 non-push ops',\n          );\n        // match hash against other sources\n        const hash2 = bcrypto.hash160(redeem.output);\n        if (hash.length > 0 && !hash.equals(hash2))\n          throw new TypeError('Hash mismatch');\n        else hash = hash2;\n      }\n      if (redeem.input) {\n        const hasInput = redeem.input.length > 0;\n        const hasWitness = redeem.witness && redeem.witness.length > 0;\n        if (!hasInput && !hasWitness) throw new TypeError('Empty input');\n        if (hasInput && hasWitness)\n          throw new TypeError('Input and witness provided');\n        if (hasInput) {\n          const richunks = bscript.decompile(redeem.input);\n          if (!bscript.isPushOnly(richunks))\n            throw new TypeError('Non push-only scriptSig');\n        }\n      }\n    };\n    if (a.input) {\n      const chunks = _chunks();\n      if (!chunks || chunks.length < 1) throw new TypeError('Input too short');\n      if (!Buffer.isBuffer(_redeem().output))\n        throw new TypeError('Input is invalid');\n      checkRedeem(_redeem());\n    }\n    if (a.redeem) {\n      if (a.redeem.network && a.redeem.network !== network)\n        throw new TypeError('Network mismatch');\n      if (a.input) {\n        const redeem = _redeem();\n        if (a.redeem.output && !a.redeem.output.equals(redeem.output))\n          throw new TypeError('Redeem.output mismatch');\n        if (a.redeem.input && !a.redeem.input.equals(redeem.input))\n          throw new TypeError('Redeem.input mismatch');\n      }\n      checkRedeem(a.redeem);\n    }\n    if (a.witness) {\n      if (\n        a.redeem &&\n        a.redeem.witness &&\n        !(0, types_1.stacksEqual)(a.redeem.witness, a.witness)\n      )\n        throw new TypeError('Witness and redeem.witness mismatch');\n    }\n  }\n  return Object.assign(o, a);\n}\nexports.p2sh = p2sh;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2tr = void 0;\nconst buffer_1 = require('buffer');\nconst networks_1 = require('../networks');\nconst bscript = require('../script');\nconst types_1 = require('../types');\nconst ecc_lib_1 = require('../ecc_lib');\nconst bip341_1 = require('./bip341');\nconst lazy = require('./lazy');\nconst bech32_1 = require('bech32');\nconst address_1 = require('../address');\nconst OPS = bscript.OPS;\nconst TAPROOT_WITNESS_VERSION = 0x01;\nconst ANNEX_PREFIX = 0x50;\n/**\n * Creates a Pay-to-Taproot (P2TR) payment object.\n *\n * @param a - The payment object containing the necessary data for P2TR.\n * @param opts - Optional payment options.\n * @returns The P2TR payment object.\n * @throws {TypeError} If the provided data is invalid or insufficient.\n */\nfunction p2tr(a, opts) {\n  if (\n    !a.address &&\n    !a.output &&\n    !a.pubkey &&\n    !a.internalPubkey &&\n    !(a.witness && a.witness.length > 1)\n  )\n    throw new TypeError('Not enough data');\n  opts = Object.assign({ validate: true }, opts || {});\n  (0, types_1.typeforce)(\n    {\n      address: types_1.typeforce.maybe(types_1.typeforce.String),\n      input: types_1.typeforce.maybe(types_1.typeforce.BufferN(0)),\n      network: types_1.typeforce.maybe(types_1.typeforce.Object),\n      output: types_1.typeforce.maybe(types_1.typeforce.BufferN(34)),\n      internalPubkey: types_1.typeforce.maybe(types_1.typeforce.BufferN(32)),\n      hash: types_1.typeforce.maybe(types_1.typeforce.BufferN(32)),\n      pubkey: types_1.typeforce.maybe(types_1.typeforce.BufferN(32)),\n      signature: types_1.typeforce.maybe(\n        types_1.typeforce.anyOf(\n          types_1.typeforce.BufferN(64),\n          types_1.typeforce.BufferN(65),\n        ),\n      ),\n      witness: types_1.typeforce.maybe(\n        types_1.typeforce.arrayOf(types_1.typeforce.Buffer),\n      ),\n      scriptTree: types_1.typeforce.maybe(types_1.isTaptree),\n      redeem: types_1.typeforce.maybe({\n        output: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n        redeemVersion: types_1.typeforce.maybe(types_1.typeforce.Number),\n        witness: types_1.typeforce.maybe(\n          types_1.typeforce.arrayOf(types_1.typeforce.Buffer),\n        ),\n      }),\n      redeemVersion: types_1.typeforce.maybe(types_1.typeforce.Number),\n    },\n    a,\n  );\n  const _address = lazy.value(() => {\n    return (0, address_1.fromBech32)(a.address);\n  });\n  // remove annex if present, ignored by taproot\n  const _witness = lazy.value(() => {\n    if (!a.witness || !a.witness.length) return;\n    if (\n      a.witness.length >= 2 &&\n      a.witness[a.witness.length - 1][0] === ANNEX_PREFIX\n    ) {\n      return a.witness.slice(0, -1);\n    }\n    return a.witness.slice();\n  });\n  const _hashTree = lazy.value(() => {\n    if (a.scriptTree) return (0, bip341_1.toHashTree)(a.scriptTree);\n    if (a.hash) return { hash: a.hash };\n    return;\n  });\n  const network = a.network || networks_1.bitcoin;\n  const o = { name: 'p2tr', network };\n  lazy.prop(o, 'address', () => {\n    if (!o.pubkey) return;\n    const words = bech32_1.bech32m.toWords(o.pubkey);\n    words.unshift(TAPROOT_WITNESS_VERSION);\n    return bech32_1.bech32m.encode(network.bech32, words);\n  });\n  lazy.prop(o, 'hash', () => {\n    const hashTree = _hashTree();\n    if (hashTree) return hashTree.hash;\n    const w = _witness();\n    if (w && w.length > 1) {\n      const controlBlock = w[w.length - 1];\n      const leafVersion = controlBlock[0] & types_1.TAPLEAF_VERSION_MASK;\n      const script = w[w.length - 2];\n      const leafHash = (0, bip341_1.tapleafHash)({\n        output: script,\n        version: leafVersion,\n      });\n      return (0, bip341_1.rootHashFromPath)(controlBlock, leafHash);\n    }\n    return null;\n  });\n  lazy.prop(o, 'output', () => {\n    if (!o.pubkey) return;\n    return bscript.compile([OPS.OP_1, o.pubkey]);\n  });\n  lazy.prop(o, 'redeemVersion', () => {\n    if (a.redeemVersion) return a.redeemVersion;\n    if (\n      a.redeem &&\n      a.redeem.redeemVersion !== undefined &&\n      a.redeem.redeemVersion !== null\n    ) {\n      return a.redeem.redeemVersion;\n    }\n    return bip341_1.LEAF_VERSION_TAPSCRIPT;\n  });\n  lazy.prop(o, 'redeem', () => {\n    const witness = _witness(); // witness without annex\n    if (!witness || witness.length < 2) return;\n    return {\n      output: witness[witness.length - 2],\n      witness: witness.slice(0, -2),\n      redeemVersion:\n        witness[witness.length - 1][0] & types_1.TAPLEAF_VERSION_MASK,\n    };\n  });\n  lazy.prop(o, 'pubkey', () => {\n    if (a.pubkey) return a.pubkey;\n    if (a.output) return a.output.slice(2);\n    if (a.address) return _address().data;\n    if (o.internalPubkey) {\n      const tweakedKey = (0, bip341_1.tweakKey)(o.internalPubkey, o.hash);\n      if (tweakedKey) return tweakedKey.x;\n    }\n  });\n  lazy.prop(o, 'internalPubkey', () => {\n    if (a.internalPubkey) return a.internalPubkey;\n    const witness = _witness();\n    if (witness && witness.length > 1)\n      return witness[witness.length - 1].slice(1, 33);\n  });\n  lazy.prop(o, 'signature', () => {\n    if (a.signature) return a.signature;\n    const witness = _witness(); // witness without annex\n    if (!witness || witness.length !== 1) return;\n    return witness[0];\n  });\n  lazy.prop(o, 'witness', () => {\n    if (a.witness) return a.witness;\n    const hashTree = _hashTree();\n    if (hashTree && a.redeem && a.redeem.output && a.internalPubkey) {\n      const leafHash = (0, bip341_1.tapleafHash)({\n        output: a.redeem.output,\n        version: o.redeemVersion,\n      });\n      const path = (0, bip341_1.findScriptPath)(hashTree, leafHash);\n      if (!path) return;\n      const outputKey = (0, bip341_1.tweakKey)(a.internalPubkey, hashTree.hash);\n      if (!outputKey) return;\n      const controlBock = buffer_1.Buffer.concat(\n        [\n          buffer_1.Buffer.from([o.redeemVersion | outputKey.parity]),\n          a.internalPubkey,\n        ].concat(path),\n      );\n      return [a.redeem.output, controlBock];\n    }\n    if (a.signature) return [a.signature];\n  });\n  // extended validation\n  if (opts.validate) {\n    let pubkey = buffer_1.Buffer.from([]);\n    if (a.address) {\n      if (network && network.bech32 !== _address().prefix)\n        throw new TypeError('Invalid prefix or Network mismatch');\n      if (_address().version !== TAPROOT_WITNESS_VERSION)\n        throw new TypeError('Invalid address version');\n      if (_address().data.length !== 32)\n        throw new TypeError('Invalid address data');\n      pubkey = _address().data;\n    }\n    if (a.pubkey) {\n      if (pubkey.length > 0 && !pubkey.equals(a.pubkey))\n        throw new TypeError('Pubkey mismatch');\n      else pubkey = a.pubkey;\n    }\n    if (a.output) {\n      if (\n        a.output.length !== 34 ||\n        a.output[0] !== OPS.OP_1 ||\n        a.output[1] !== 0x20\n      )\n        throw new TypeError('Output is invalid');\n      if (pubkey.length > 0 && !pubkey.equals(a.output.slice(2)))\n        throw new TypeError('Pubkey mismatch');\n      else pubkey = a.output.slice(2);\n    }\n    if (a.internalPubkey) {\n      const tweakedKey = (0, bip341_1.tweakKey)(a.internalPubkey, o.hash);\n      if (pubkey.length > 0 && !pubkey.equals(tweakedKey.x))\n        throw new TypeError('Pubkey mismatch');\n      else pubkey = tweakedKey.x;\n    }\n    if (pubkey && pubkey.length) {\n      if (!(0, ecc_lib_1.getEccLib)().isXOnlyPoint(pubkey))\n        throw new TypeError('Invalid pubkey for p2tr');\n    }\n    const hashTree = _hashTree();\n    if (a.hash && hashTree) {\n      if (!a.hash.equals(hashTree.hash)) throw new TypeError('Hash mismatch');\n    }\n    if (a.redeem && a.redeem.output && hashTree) {\n      const leafHash = (0, bip341_1.tapleafHash)({\n        output: a.redeem.output,\n        version: o.redeemVersion,\n      });\n      if (!(0, bip341_1.findScriptPath)(hashTree, leafHash))\n        throw new TypeError('Redeem script not in tree');\n    }\n    const witness = _witness();\n    // compare the provided redeem data with the one computed from witness\n    if (a.redeem && o.redeem) {\n      if (a.redeem.redeemVersion) {\n        if (a.redeem.redeemVersion !== o.redeem.redeemVersion)\n          throw new TypeError('Redeem.redeemVersion and witness mismatch');\n      }\n      if (a.redeem.output) {\n        if (bscript.decompile(a.redeem.output).length === 0)\n          throw new TypeError('Redeem.output is invalid');\n        // output redeem is constructed from the witness\n        if (o.redeem.output && !a.redeem.output.equals(o.redeem.output))\n          throw new TypeError('Redeem.output and witness mismatch');\n      }\n      if (a.redeem.witness) {\n        if (\n          o.redeem.witness &&\n          !(0, types_1.stacksEqual)(a.redeem.witness, o.redeem.witness)\n        )\n          throw new TypeError('Redeem.witness and witness mismatch');\n      }\n    }\n    if (witness && witness.length) {\n      if (witness.length === 1) {\n        // key spending\n        if (a.signature && !a.signature.equals(witness[0]))\n          throw new TypeError('Signature mismatch');\n      } else {\n        // script path spending\n        const controlBlock = witness[witness.length - 1];\n        if (controlBlock.length < 33)\n          throw new TypeError(\n            `The control-block length is too small. Got ${controlBlock.length}, expected min 33.`,\n          );\n        if ((controlBlock.length - 33) % 32 !== 0)\n          throw new TypeError(\n            `The control-block length of ${controlBlock.length} is incorrect!`,\n          );\n        const m = (controlBlock.length - 33) / 32;\n        if (m > 128)\n          throw new TypeError(\n            `The script path is too long. Got ${m}, expected max 128.`,\n          );\n        const internalPubkey = controlBlock.slice(1, 33);\n        if (a.internalPubkey && !a.internalPubkey.equals(internalPubkey))\n          throw new TypeError('Internal pubkey mismatch');\n        if (!(0, ecc_lib_1.getEccLib)().isXOnlyPoint(internalPubkey))\n          throw new TypeError('Invalid internalPubkey for p2tr witness');\n        const leafVersion = controlBlock[0] & types_1.TAPLEAF_VERSION_MASK;\n        const script = witness[witness.length - 2];\n        const leafHash = (0, bip341_1.tapleafHash)({\n          output: script,\n          version: leafVersion,\n        });\n        const hash = (0, bip341_1.rootHashFromPath)(controlBlock, leafHash);\n        const outputKey = (0, bip341_1.tweakKey)(internalPubkey, hash);\n        if (!outputKey)\n          // todo: needs test data\n          throw new TypeError('Invalid outputKey for p2tr witness');\n        if (pubkey.length && !pubkey.equals(outputKey.x))\n          throw new TypeError('Pubkey mismatch for p2tr witness');\n        if (outputKey.parity !== (controlBlock[0] & 1))\n          throw new Error('Incorrect parity');\n      }\n    }\n  }\n  return Object.assign(o, a);\n}\nexports.p2tr = p2tr;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2wpkh = void 0;\nconst bcrypto = require('../crypto');\nconst networks_1 = require('../networks');\nconst bscript = require('../script');\nconst types_1 = require('../types');\nconst lazy = require('./lazy');\nconst bech32_1 = require('bech32');\nconst OPS = bscript.OPS;\nconst EMPTY_BUFFER = Buffer.alloc(0);\n// witness: {signature} {pubKey}\n// input: <>\n// output: OP_0 {pubKeyHash}\n/**\n * Creates a pay-to-witness-public-key-hash (p2wpkh) payment object.\n *\n * @param a - The payment object containing the necessary data.\n * @param opts - Optional payment options.\n * @returns The p2wpkh payment object.\n * @throws {TypeError} If the required data is missing or invalid.\n */\nfunction p2wpkh(a, opts) {\n  if (!a.address && !a.hash && !a.output && !a.pubkey && !a.witness)\n    throw new TypeError('Not enough data');\n  opts = Object.assign({ validate: true }, opts || {});\n  (0, types_1.typeforce)(\n    {\n      address: types_1.typeforce.maybe(types_1.typeforce.String),\n      hash: types_1.typeforce.maybe(types_1.typeforce.BufferN(20)),\n      input: types_1.typeforce.maybe(types_1.typeforce.BufferN(0)),\n      network: types_1.typeforce.maybe(types_1.typeforce.Object),\n      output: types_1.typeforce.maybe(types_1.typeforce.BufferN(22)),\n      pubkey: types_1.typeforce.maybe(types_1.isPoint),\n      signature: types_1.typeforce.maybe(bscript.isCanonicalScriptSignature),\n      witness: types_1.typeforce.maybe(\n        types_1.typeforce.arrayOf(types_1.typeforce.Buffer),\n      ),\n    },\n    a,\n  );\n  const _address = lazy.value(() => {\n    const result = bech32_1.bech32.decode(a.address);\n    const version = result.words.shift();\n    const data = bech32_1.bech32.fromWords(result.words);\n    return {\n      version,\n      prefix: result.prefix,\n      data: Buffer.from(data),\n    };\n  });\n  const network = a.network || networks_1.bitcoin;\n  const o = { name: 'p2wpkh', network };\n  lazy.prop(o, 'address', () => {\n    if (!o.hash) return;\n    const words = bech32_1.bech32.toWords(o.hash);\n    words.unshift(0x00);\n    return bech32_1.bech32.encode(network.bech32, words);\n  });\n  lazy.prop(o, 'hash', () => {\n    if (a.output) return a.output.slice(2, 22);\n    if (a.address) return _address().data;\n    if (a.pubkey || o.pubkey) return bcrypto.hash160(a.pubkey || o.pubkey);\n  });\n  lazy.prop(o, 'output', () => {\n    if (!o.hash) return;\n    return bscript.compile([OPS.OP_0, o.hash]);\n  });\n  lazy.prop(o, 'pubkey', () => {\n    if (a.pubkey) return a.pubkey;\n    if (!a.witness) return;\n    return a.witness[1];\n  });\n  lazy.prop(o, 'signature', () => {\n    if (!a.witness) return;\n    return a.witness[0];\n  });\n  lazy.prop(o, 'input', () => {\n    if (!o.witness) return;\n    return EMPTY_BUFFER;\n  });\n  lazy.prop(o, 'witness', () => {\n    if (!a.pubkey) return;\n    if (!a.signature) return;\n    return [a.signature, a.pubkey];\n  });\n  // extended validation\n  if (opts.validate) {\n    let hash = Buffer.from([]);\n    if (a.address) {\n      if (network && network.bech32 !== _address().prefix)\n        throw new TypeError('Invalid prefix or Network mismatch');\n      if (_address().version !== 0x00)\n        throw new TypeError('Invalid address version');\n      if (_address().data.length !== 20)\n        throw new TypeError('Invalid address data');\n      hash = _address().data;\n    }\n    if (a.hash) {\n      if (hash.length > 0 && !hash.equals(a.hash))\n        throw new TypeError('Hash mismatch');\n      else hash = a.hash;\n    }\n    if (a.output) {\n      if (\n        a.output.length !== 22 ||\n        a.output[0] !== OPS.OP_0 ||\n        a.output[1] !== 0x14\n      )\n        throw new TypeError('Output is invalid');\n      if (hash.length > 0 && !hash.equals(a.output.slice(2)))\n        throw new TypeError('Hash mismatch');\n      else hash = a.output.slice(2);\n    }\n    if (a.pubkey) {\n      const pkh = bcrypto.hash160(a.pubkey);\n      if (hash.length > 0 && !hash.equals(pkh))\n        throw new TypeError('Hash mismatch');\n      else hash = pkh;\n      if (!(0, types_1.isPoint)(a.pubkey) || a.pubkey.length !== 33)\n        throw new TypeError('Invalid pubkey for p2wpkh');\n    }\n    if (a.witness) {\n      if (a.witness.length !== 2) throw new TypeError('Witness is invalid');\n      if (!bscript.isCanonicalScriptSignature(a.witness[0]))\n        throw new TypeError('Witness has invalid signature');\n      if (!(0, types_1.isPoint)(a.witness[1]) || a.witness[1].length !== 33)\n        throw new TypeError('Witness has invalid pubkey');\n      if (a.signature && !a.signature.equals(a.witness[0]))\n        throw new TypeError('Signature mismatch');\n      if (a.pubkey && !a.pubkey.equals(a.witness[1]))\n        throw new TypeError('Pubkey mismatch');\n      const pkh = bcrypto.hash160(a.witness[1]);\n      if (hash.length > 0 && !hash.equals(pkh))\n        throw new TypeError('Hash mismatch');\n    }\n  }\n  return Object.assign(o, a);\n}\nexports.p2wpkh = p2wpkh;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.p2wsh = void 0;\nconst bcrypto = require('../crypto');\nconst networks_1 = require('../networks');\nconst bscript = require('../script');\nconst types_1 = require('../types');\nconst lazy = require('./lazy');\nconst bech32_1 = require('bech32');\nconst OPS = bscript.OPS;\nconst EMPTY_BUFFER = Buffer.alloc(0);\nfunction chunkHasUncompressedPubkey(chunk) {\n  if (\n    Buffer.isBuffer(chunk) &&\n    chunk.length === 65 &&\n    chunk[0] === 0x04 &&\n    (0, types_1.isPoint)(chunk)\n  ) {\n    return true;\n  } else {\n    return false;\n  }\n}\n// input: <>\n// witness: [redeemScriptSig ...] {redeemScript}\n// output: OP_0 {sha256(redeemScript)}\n/**\n * Creates a Pay-to-Witness-Script-Hash (P2WSH) payment object.\n *\n * @param a - The payment object containing the necessary data.\n * @param opts - Optional payment options.\n * @returns The P2WSH payment object.\n * @throws {TypeError} If the required data is missing or invalid.\n */\nfunction p2wsh(a, opts) {\n  if (!a.address && !a.hash && !a.output && !a.redeem && !a.witness)\n    throw new TypeError('Not enough data');\n  opts = Object.assign({ validate: true }, opts || {});\n  (0, types_1.typeforce)(\n    {\n      network: types_1.typeforce.maybe(types_1.typeforce.Object),\n      address: types_1.typeforce.maybe(types_1.typeforce.String),\n      hash: types_1.typeforce.maybe(types_1.typeforce.BufferN(32)),\n      output: types_1.typeforce.maybe(types_1.typeforce.BufferN(34)),\n      redeem: types_1.typeforce.maybe({\n        input: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n        network: types_1.typeforce.maybe(types_1.typeforce.Object),\n        output: types_1.typeforce.maybe(types_1.typeforce.Buffer),\n        witness: types_1.typeforce.maybe(\n          types_1.typeforce.arrayOf(types_1.typeforce.Buffer),\n        ),\n      }),\n      input: types_1.typeforce.maybe(types_1.typeforce.BufferN(0)),\n      witness: types_1.typeforce.maybe(\n        types_1.typeforce.arrayOf(types_1.typeforce.Buffer),\n      ),\n    },\n    a,\n  );\n  const _address = lazy.value(() => {\n    const result = bech32_1.bech32.decode(a.address);\n    const version = result.words.shift();\n    const data = bech32_1.bech32.fromWords(result.words);\n    return {\n      version,\n      prefix: result.prefix,\n      data: Buffer.from(data),\n    };\n  });\n  const _rchunks = lazy.value(() => {\n    return bscript.decompile(a.redeem.input);\n  });\n  let network = a.network;\n  if (!network) {\n    network = (a.redeem && a.redeem.network) || networks_1.bitcoin;\n  }\n  const o = { network };\n  lazy.prop(o, 'address', () => {\n    if (!o.hash) return;\n    const words = bech32_1.bech32.toWords(o.hash);\n    words.unshift(0x00);\n    return bech32_1.bech32.encode(network.bech32, words);\n  });\n  lazy.prop(o, 'hash', () => {\n    if (a.output) return a.output.slice(2);\n    if (a.address) return _address().data;\n    if (o.redeem && o.redeem.output) return bcrypto.sha256(o.redeem.output);\n  });\n  lazy.prop(o, 'output', () => {\n    if (!o.hash) return;\n    return bscript.compile([OPS.OP_0, o.hash]);\n  });\n  lazy.prop(o, 'redeem', () => {\n    if (!a.witness) return;\n    return {\n      output: a.witness[a.witness.length - 1],\n      input: EMPTY_BUFFER,\n      witness: a.witness.slice(0, -1),\n    };\n  });\n  lazy.prop(o, 'input', () => {\n    if (!o.witness) return;\n    return EMPTY_BUFFER;\n  });\n  lazy.prop(o, 'witness', () => {\n    // transform redeem input to witness stack?\n    if (\n      a.redeem &&\n      a.redeem.input &&\n      a.redeem.input.length > 0 &&\n      a.redeem.output &&\n      a.redeem.output.length > 0\n    ) {\n      const stack = bscript.toStack(_rchunks());\n      // assign, and blank the existing input\n      o.redeem = Object.assign({ witness: stack }, a.redeem);\n      o.redeem.input = EMPTY_BUFFER;\n      return [].concat(stack, a.redeem.output);\n    }\n    if (!a.redeem) return;\n    if (!a.redeem.output) return;\n    if (!a.redeem.witness) return;\n    return [].concat(a.redeem.witness, a.redeem.output);\n  });\n  lazy.prop(o, 'name', () => {\n    const nameParts = ['p2wsh'];\n    if (o.redeem !== undefined && o.redeem.name !== undefined)\n      nameParts.push(o.redeem.name);\n    return nameParts.join('-');\n  });\n  // extended validation\n  if (opts.validate) {\n    let hash = Buffer.from([]);\n    if (a.address) {\n      if (_address().prefix !== network.bech32)\n        throw new TypeError('Invalid prefix or Network mismatch');\n      if (_address().version !== 0x00)\n        throw new TypeError('Invalid address version');\n      if (_address().data.length !== 32)\n        throw new TypeError('Invalid address data');\n      hash = _address().data;\n    }\n    if (a.hash) {\n      if (hash.length > 0 && !hash.equals(a.hash))\n        throw new TypeError('Hash mismatch');\n      else hash = a.hash;\n    }\n    if (a.output) {\n      if (\n        a.output.length !== 34 ||\n        a.output[0] !== OPS.OP_0 ||\n        a.output[1] !== 0x20\n      )\n        throw new TypeError('Output is invalid');\n      const hash2 = a.output.slice(2);\n      if (hash.length > 0 && !hash.equals(hash2))\n        throw new TypeError('Hash mismatch');\n      else hash = hash2;\n    }\n    if (a.redeem) {\n      if (a.redeem.network && a.redeem.network !== network)\n        throw new TypeError('Network mismatch');\n      // is there two redeem sources?\n      if (\n        a.redeem.input &&\n        a.redeem.input.length > 0 &&\n        a.redeem.witness &&\n        a.redeem.witness.length > 0\n      )\n        throw new TypeError('Ambiguous witness source');\n      // is the redeem output non-empty/valid?\n      if (a.redeem.output) {\n        const decompile = bscript.decompile(a.redeem.output);\n        if (!decompile || decompile.length < 1)\n          throw new TypeError('Redeem.output is invalid');\n        if (a.redeem.output.byteLength > 3600)\n          throw new TypeError(\n            'Redeem.output unspendable if larger than 3600 bytes',\n          );\n        if (bscript.countNonPushOnlyOPs(decompile) > 201)\n          throw new TypeError(\n            'Redeem.output unspendable with more than 201 non-push ops',\n          );\n        // match hash against other sources\n        const hash2 = bcrypto.sha256(a.redeem.output);\n        if (hash.length > 0 && !hash.equals(hash2))\n          throw new TypeError('Hash mismatch');\n        else hash = hash2;\n      }\n      if (a.redeem.input && !bscript.isPushOnly(_rchunks()))\n        throw new TypeError('Non push-only scriptSig');\n      if (\n        a.witness &&\n        a.redeem.witness &&\n        !(0, types_1.stacksEqual)(a.witness, a.redeem.witness)\n      )\n        throw new TypeError('Witness and redeem.witness mismatch');\n      if (\n        (a.redeem.input && _rchunks().some(chunkHasUncompressedPubkey)) ||\n        (a.redeem.output &&\n          (bscript.decompile(a.redeem.output) || []).some(\n            chunkHasUncompressedPubkey,\n          ))\n      ) {\n        throw new TypeError(\n          'redeem.input or redeem.output contains uncompressed pubkey',\n        );\n      }\n    }\n    if (a.witness && a.witness.length > 0) {\n      const wScript = a.witness[a.witness.length - 1];\n      if (a.redeem && a.redeem.output && !a.redeem.output.equals(wScript))\n        throw new TypeError('Witness and redeem.output mismatch');\n      if (\n        a.witness.some(chunkHasUncompressedPubkey) ||\n        (bscript.decompile(wScript) || []).some(chunkHasUncompressedPubkey)\n      )\n        throw new TypeError('Witness contains uncompressed pubkey');\n    }\n  }\n  return Object.assign(o, a);\n}\nexports.p2wsh = p2wsh;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.Psbt = void 0;\nconst bip174_1 = require('bip174');\nconst varuint = require('bip174/src/lib/converter/varint');\nconst utils_1 = require('bip174/src/lib/utils');\nconst address_1 = require('./address');\nconst bufferutils_1 = require('./bufferutils');\nconst networks_1 = require('./networks');\nconst payments = require('./payments');\nconst bip341_1 = require('./payments/bip341');\nconst bscript = require('./script');\nconst transaction_1 = require('./transaction');\nconst bip371_1 = require('./psbt/bip371');\nconst psbtutils_1 = require('./psbt/psbtutils');\n/**\n * These are the default arguments for a Psbt instance.\n */\nconst DEFAULT_OPTS = {\n  /**\n   * A bitcoinjs Network object. This is only used if you pass an `address`\n   * parameter to addOutput. Otherwise it is not needed and can be left default.\n   */\n  network: networks_1.bitcoin,\n  /**\n   * When extractTransaction is called, the fee rate is checked.\n   * THIS IS NOT TO BE RELIED ON.\n   * It is only here as a last ditch effort to prevent sending a 500 BTC fee etc.\n   */\n  maximumFeeRate: 5000, // satoshi per byte\n};\n/**\n * Psbt class can parse and generate a PSBT binary based off of the BIP174.\n * There are 6 roles that this class fulfills. (Explained in BIP174)\n *\n * Creator: This can be done with `new Psbt()`\n *\n * Updater: This can be done with `psbt.addInput(input)`, `psbt.addInputs(inputs)`,\n *   `psbt.addOutput(output)`, `psbt.addOutputs(outputs)` when you are looking to\n *   add new inputs and outputs to the PSBT, and `psbt.updateGlobal(itemObject)`,\n *   `psbt.updateInput(itemObject)`, `psbt.updateOutput(itemObject)`\n *   addInput requires hash: Buffer | string; and index: number; as attributes\n *   and can also include any attributes that are used in updateInput method.\n *   addOutput requires script: Buffer; and value: number; and likewise can include\n *   data for updateOutput.\n *   For a list of what attributes should be what types. Check the bip174 library.\n *   Also, check the integration tests for some examples of usage.\n *\n * Signer: There are a few methods. signAllInputs and signAllInputsAsync, which will search all input\n *   information for your pubkey or pubkeyhash, and only sign inputs where it finds\n *   your info. Or you can explicitly sign a specific input with signInput and\n *   signInputAsync. For the async methods you can create a SignerAsync object\n *   and use something like a hardware wallet to sign with. (You must implement this)\n *\n * Combiner: psbts can be combined easily with `psbt.combine(psbt2, psbt3, psbt4 ...)`\n *   the psbt calling combine will always have precedence when a conflict occurs.\n *   Combine checks if the internal bitcoin transaction is the same, so be sure that\n *   all sequences, version, locktime, etc. are the same before combining.\n *\n * Input Finalizer: This role is fairly important. Not only does it need to construct\n *   the input scriptSigs and witnesses, but it SHOULD verify the signatures etc.\n *   Before running `psbt.finalizeAllInputs()` please run `psbt.validateSignaturesOfAllInputs()`\n *   Running any finalize method will delete any data in the input(s) that are no longer\n *   needed due to the finalized scripts containing the information.\n *\n * Transaction Extractor: This role will perform some checks before returning a\n *   Transaction object. Such as fee rate not being larger than maximumFeeRate etc.\n */\nclass Psbt {\n  static fromBase64(data, opts = {}) {\n    const buffer = Buffer.from(data, 'base64');\n    return this.fromBuffer(buffer, opts);\n  }\n  static fromHex(data, opts = {}) {\n    const buffer = Buffer.from(data, 'hex');\n    return this.fromBuffer(buffer, opts);\n  }\n  static fromBuffer(buffer, opts = {}) {\n    const psbtBase = bip174_1.Psbt.fromBuffer(buffer, transactionFromBuffer);\n    const psbt = new Psbt(opts, psbtBase);\n    checkTxForDupeIns(psbt.__CACHE.__TX, psbt.__CACHE);\n    return psbt;\n  }\n  constructor(opts = {}, data = new bip174_1.Psbt(new PsbtTransaction())) {\n    this.data = data;\n    // set defaults\n    this.opts = Object.assign({}, DEFAULT_OPTS, opts);\n    this.__CACHE = {\n      __NON_WITNESS_UTXO_TX_CACHE: [],\n      __NON_WITNESS_UTXO_BUF_CACHE: [],\n      __TX_IN_CACHE: {},\n      __TX: this.data.globalMap.unsignedTx.tx,\n      // Psbt's predecessor (TransactionBuilder - now removed) behavior\n      // was to not confirm input values  before signing.\n      // Even though we highly encourage people to get\n      // the full parent transaction to verify values, the ability to\n      // sign non-segwit inputs without the full transaction was often\n      // requested. So the only way to activate is to use @ts-ignore.\n      // We will disable exporting the Psbt when unsafe sign is active.\n      // because it is not BIP174 compliant.\n      __UNSAFE_SIGN_NONSEGWIT: false,\n    };\n    if (this.data.inputs.length === 0) this.setVersion(2);\n    // Make data hidden when enumerating\n    const dpew = (obj, attr, enumerable, writable) =>\n      Object.defineProperty(obj, attr, {\n        enumerable,\n        writable,\n      });\n    dpew(this, '__CACHE', false, true);\n    dpew(this, 'opts', false, true);\n  }\n  get inputCount() {\n    return this.data.inputs.length;\n  }\n  get version() {\n    return this.__CACHE.__TX.version;\n  }\n  set version(version) {\n    this.setVersion(version);\n  }\n  get locktime() {\n    return this.__CACHE.__TX.locktime;\n  }\n  set locktime(locktime) {\n    this.setLocktime(locktime);\n  }\n  get txInputs() {\n    return this.__CACHE.__TX.ins.map(input => ({\n      hash: (0, bufferutils_1.cloneBuffer)(input.hash),\n      index: input.index,\n      sequence: input.sequence,\n    }));\n  }\n  get txOutputs() {\n    return this.__CACHE.__TX.outs.map(output => {\n      let address;\n      try {\n        address = (0, address_1.fromOutputScript)(\n          output.script,\n          this.opts.network,\n        );\n      } catch (_) {}\n      return {\n        script: (0, bufferutils_1.cloneBuffer)(output.script),\n        value: output.value,\n        address,\n      };\n    });\n  }\n  combine(...those) {\n    this.data.combine(...those.map(o => o.data));\n    return this;\n  }\n  clone() {\n    // TODO: more efficient cloning\n    const res = Psbt.fromBuffer(this.data.toBuffer());\n    res.opts = JSON.parse(JSON.stringify(this.opts));\n    return res;\n  }\n  setMaximumFeeRate(satoshiPerByte) {\n    check32Bit(satoshiPerByte); // 42.9 BTC per byte IS excessive... so throw\n    this.opts.maximumFeeRate = satoshiPerByte;\n  }\n  setVersion(version) {\n    check32Bit(version);\n    checkInputsForPartialSig(this.data.inputs, 'setVersion');\n    const c = this.__CACHE;\n    c.__TX.version = version;\n    c.__EXTRACTED_TX = undefined;\n    return this;\n  }\n  setLocktime(locktime) {\n    check32Bit(locktime);\n    checkInputsForPartialSig(this.data.inputs, 'setLocktime');\n    const c = this.__CACHE;\n    c.__TX.locktime = locktime;\n    c.__EXTRACTED_TX = undefined;\n    return this;\n  }\n  setInputSequence(inputIndex, sequence) {\n    check32Bit(sequence);\n    checkInputsForPartialSig(this.data.inputs, 'setInputSequence');\n    const c = this.__CACHE;\n    if (c.__TX.ins.length <= inputIndex) {\n      throw new Error('Input index too high');\n    }\n    c.__TX.ins[inputIndex].sequence = sequence;\n    c.__EXTRACTED_TX = undefined;\n    return this;\n  }\n  addInputs(inputDatas) {\n    inputDatas.forEach(inputData => this.addInput(inputData));\n    return this;\n  }\n  addInput(inputData) {\n    if (\n      arguments.length > 1 ||\n      !inputData ||\n      inputData.hash === undefined ||\n      inputData.index === undefined\n    ) {\n      throw new Error(\n        `Invalid arguments for Psbt.addInput. ` +\n          `Requires single object with at least [hash] and [index]`,\n      );\n    }\n    (0, bip371_1.checkTaprootInputFields)(inputData, inputData, 'addInput');\n    checkInputsForPartialSig(this.data.inputs, 'addInput');\n    if (inputData.witnessScript) checkInvalidP2WSH(inputData.witnessScript);\n    const c = this.__CACHE;\n    this.data.addInput(inputData);\n    const txIn = c.__TX.ins[c.__TX.ins.length - 1];\n    checkTxInputCache(c, txIn);\n    const inputIndex = this.data.inputs.length - 1;\n    const input = this.data.inputs[inputIndex];\n    if (input.nonWitnessUtxo) {\n      addNonWitnessTxCache(this.__CACHE, input, inputIndex);\n    }\n    c.__FEE = undefined;\n    c.__FEE_RATE = undefined;\n    c.__EXTRACTED_TX = undefined;\n    return this;\n  }\n  addOutputs(outputDatas) {\n    outputDatas.forEach(outputData => this.addOutput(outputData));\n    return this;\n  }\n  addOutput(outputData) {\n    if (\n      arguments.length > 1 ||\n      !outputData ||\n      outputData.value === undefined ||\n      (outputData.address === undefined && outputData.script === undefined)\n    ) {\n      throw new Error(\n        `Invalid arguments for Psbt.addOutput. ` +\n          `Requires single object with at least [script or address] and [value]`,\n      );\n    }\n    checkInputsForPartialSig(this.data.inputs, 'addOutput');\n    const { address } = outputData;\n    if (typeof address === 'string') {\n      const { network } = this.opts;\n      const script = (0, address_1.toOutputScript)(address, network);\n      outputData = Object.assign({}, outputData, { script });\n    }\n    (0, bip371_1.checkTaprootOutputFields)(outputData, outputData, 'addOutput');\n    const c = this.__CACHE;\n    this.data.addOutput(outputData);\n    c.__FEE = undefined;\n    c.__FEE_RATE = undefined;\n    c.__EXTRACTED_TX = undefined;\n    return this;\n  }\n  extractTransaction(disableFeeCheck) {\n    if (!this.data.inputs.every(isFinalized)) throw new Error('Not finalized');\n    const c = this.__CACHE;\n    if (!disableFeeCheck) {\n      checkFees(this, c, this.opts);\n    }\n    if (c.__EXTRACTED_TX) return c.__EXTRACTED_TX;\n    const tx = c.__TX.clone();\n    inputFinalizeGetAmts(this.data.inputs, tx, c, true);\n    return tx;\n  }\n  getFeeRate() {\n    return getTxCacheValue(\n      '__FEE_RATE',\n      'fee rate',\n      this.data.inputs,\n      this.__CACHE,\n    );\n  }\n  getFee() {\n    return getTxCacheValue('__FEE', 'fee', this.data.inputs, this.__CACHE);\n  }\n  finalizeAllInputs() {\n    (0, utils_1.checkForInput)(this.data.inputs, 0); // making sure we have at least one\n    range(this.data.inputs.length).forEach(idx => this.finalizeInput(idx));\n    return this;\n  }\n  finalizeInput(inputIndex, finalScriptsFunc) {\n    const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n    if ((0, bip371_1.isTaprootInput)(input))\n      return this._finalizeTaprootInput(\n        inputIndex,\n        input,\n        undefined,\n        finalScriptsFunc,\n      );\n    return this._finalizeInput(inputIndex, input, finalScriptsFunc);\n  }\n  finalizeTaprootInput(\n    inputIndex,\n    tapLeafHashToFinalize,\n    finalScriptsFunc = bip371_1.tapScriptFinalizer,\n  ) {\n    const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n    if ((0, bip371_1.isTaprootInput)(input))\n      return this._finalizeTaprootInput(\n        inputIndex,\n        input,\n        tapLeafHashToFinalize,\n        finalScriptsFunc,\n      );\n    throw new Error(`Cannot finalize input #${inputIndex}. Not Taproot.`);\n  }\n  _finalizeInput(inputIndex, input, finalScriptsFunc = getFinalScripts) {\n    const { script, isP2SH, isP2WSH, isSegwit } = getScriptFromInput(\n      inputIndex,\n      input,\n      this.__CACHE,\n    );\n    if (!script) throw new Error(`No script found for input #${inputIndex}`);\n    checkPartialSigSighashes(input);\n    const { finalScriptSig, finalScriptWitness } = finalScriptsFunc(\n      inputIndex,\n      input,\n      script,\n      isSegwit,\n      isP2SH,\n      isP2WSH,\n    );\n    if (finalScriptSig) this.data.updateInput(inputIndex, { finalScriptSig });\n    if (finalScriptWitness)\n      this.data.updateInput(inputIndex, { finalScriptWitness });\n    if (!finalScriptSig && !finalScriptWitness)\n      throw new Error(`Unknown error finalizing input #${inputIndex}`);\n    this.data.clearFinalizedInput(inputIndex);\n    return this;\n  }\n  _finalizeTaprootInput(\n    inputIndex,\n    input,\n    tapLeafHashToFinalize,\n    finalScriptsFunc = bip371_1.tapScriptFinalizer,\n  ) {\n    if (!input.witnessUtxo)\n      throw new Error(\n        `Cannot finalize input #${inputIndex}. Missing withness utxo.`,\n      );\n    // Check key spend first. Increased privacy and reduced block space.\n    if (input.tapKeySig) {\n      const payment = payments.p2tr({\n        output: input.witnessUtxo.script,\n        signature: input.tapKeySig,\n      });\n      const finalScriptWitness = (0, psbtutils_1.witnessStackToScriptWitness)(\n        payment.witness,\n      );\n      this.data.updateInput(inputIndex, { finalScriptWitness });\n    } else {\n      const { finalScriptWitness } = finalScriptsFunc(\n        inputIndex,\n        input,\n        tapLeafHashToFinalize,\n      );\n      this.data.updateInput(inputIndex, { finalScriptWitness });\n    }\n    this.data.clearFinalizedInput(inputIndex);\n    return this;\n  }\n  getInputType(inputIndex) {\n    const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n    const script = getScriptFromUtxo(inputIndex, input, this.__CACHE);\n    const result = getMeaningfulScript(\n      script,\n      inputIndex,\n      'input',\n      input.redeemScript || redeemFromFinalScriptSig(input.finalScriptSig),\n      input.witnessScript ||\n        redeemFromFinalWitnessScript(input.finalScriptWitness),\n    );\n    const type = result.type === 'raw' ? '' : result.type + '-';\n    const mainType = classifyScript(result.meaningfulScript);\n    return type + mainType;\n  }\n  inputHasPubkey(inputIndex, pubkey) {\n    const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n    return pubkeyInInput(pubkey, input, inputIndex, this.__CACHE);\n  }\n  inputHasHDKey(inputIndex, root) {\n    const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n    const derivationIsMine = bip32DerivationIsMine(root);\n    return (\n      !!input.bip32Derivation && input.bip32Derivation.some(derivationIsMine)\n    );\n  }\n  outputHasPubkey(outputIndex, pubkey) {\n    const output = (0, utils_1.checkForOutput)(this.data.outputs, outputIndex);\n    return pubkeyInOutput(pubkey, output, outputIndex, this.__CACHE);\n  }\n  outputHasHDKey(outputIndex, root) {\n    const output = (0, utils_1.checkForOutput)(this.data.outputs, outputIndex);\n    const derivationIsMine = bip32DerivationIsMine(root);\n    return (\n      !!output.bip32Derivation && output.bip32Derivation.some(derivationIsMine)\n    );\n  }\n  validateSignaturesOfAllInputs(validator) {\n    (0, utils_1.checkForInput)(this.data.inputs, 0); // making sure we have at least one\n    const results = range(this.data.inputs.length).map(idx =>\n      this.validateSignaturesOfInput(idx, validator),\n    );\n    return results.reduce((final, res) => res === true && final, true);\n  }\n  validateSignaturesOfInput(inputIndex, validator, pubkey) {\n    const input = this.data.inputs[inputIndex];\n    if ((0, bip371_1.isTaprootInput)(input))\n      return this.validateSignaturesOfTaprootInput(\n        inputIndex,\n        validator,\n        pubkey,\n      );\n    return this._validateSignaturesOfInput(inputIndex, validator, pubkey);\n  }\n  _validateSignaturesOfInput(inputIndex, validator, pubkey) {\n    const input = this.data.inputs[inputIndex];\n    const partialSig = (input || {}).partialSig;\n    if (!input || !partialSig || partialSig.length < 1)\n      throw new Error('No signatures to validate');\n    if (typeof validator !== 'function')\n      throw new Error('Need validator function to validate signatures');\n    const mySigs = pubkey\n      ? partialSig.filter(sig => sig.pubkey.equals(pubkey))\n      : partialSig;\n    if (mySigs.length < 1) throw new Error('No signatures for this pubkey');\n    const results = [];\n    let hashCache;\n    let scriptCache;\n    let sighashCache;\n    for (const pSig of mySigs) {\n      const sig = bscript.signature.decode(pSig.signature);\n      const { hash, script } =\n        sighashCache !== sig.hashType\n          ? getHashForSig(\n              inputIndex,\n              Object.assign({}, input, { sighashType: sig.hashType }),\n              this.__CACHE,\n              true,\n            )\n          : { hash: hashCache, script: scriptCache };\n      sighashCache = sig.hashType;\n      hashCache = hash;\n      scriptCache = script;\n      checkScriptForPubkey(pSig.pubkey, script, 'verify');\n      results.push(validator(pSig.pubkey, hash, sig.signature));\n    }\n    return results.every(res => res === true);\n  }\n  validateSignaturesOfTaprootInput(inputIndex, validator, pubkey) {\n    const input = this.data.inputs[inputIndex];\n    const tapKeySig = (input || {}).tapKeySig;\n    const tapScriptSig = (input || {}).tapScriptSig;\n    if (!input && !tapKeySig && !(tapScriptSig && !tapScriptSig.length))\n      throw new Error('No signatures to validate');\n    if (typeof validator !== 'function')\n      throw new Error('Need validator function to validate signatures');\n    pubkey = pubkey && (0, bip371_1.toXOnly)(pubkey);\n    const allHashses = pubkey\n      ? getTaprootHashesForSig(\n          inputIndex,\n          input,\n          this.data.inputs,\n          pubkey,\n          this.__CACHE,\n        )\n      : getAllTaprootHashesForSig(\n          inputIndex,\n          input,\n          this.data.inputs,\n          this.__CACHE,\n        );\n    if (!allHashses.length) throw new Error('No signatures for this pubkey');\n    const tapKeyHash = allHashses.find(h => !h.leafHash);\n    let validationResultCount = 0;\n    if (tapKeySig && tapKeyHash) {\n      const isValidTapkeySig = validator(\n        tapKeyHash.pubkey,\n        tapKeyHash.hash,\n        trimTaprootSig(tapKeySig),\n      );\n      if (!isValidTapkeySig) return false;\n      validationResultCount++;\n    }\n    if (tapScriptSig) {\n      for (const tapSig of tapScriptSig) {\n        const tapSigHash = allHashses.find(h => tapSig.pubkey.equals(h.pubkey));\n        if (tapSigHash) {\n          const isValidTapScriptSig = validator(\n            tapSig.pubkey,\n            tapSigHash.hash,\n            trimTaprootSig(tapSig.signature),\n          );\n          if (!isValidTapScriptSig) return false;\n          validationResultCount++;\n        }\n      }\n    }\n    return validationResultCount > 0;\n  }\n  signAllInputsHD(\n    hdKeyPair,\n    sighashTypes = [transaction_1.Transaction.SIGHASH_ALL],\n  ) {\n    if (!hdKeyPair || !hdKeyPair.publicKey || !hdKeyPair.fingerprint) {\n      throw new Error('Need HDSigner to sign input');\n    }\n    const results = [];\n    for (const i of range(this.data.inputs.length)) {\n      try {\n        this.signInputHD(i, hdKeyPair, sighashTypes);\n        results.push(true);\n      } catch (err) {\n        results.push(false);\n      }\n    }\n    if (results.every(v => v === false)) {\n      throw new Error('No inputs were signed');\n    }\n    return this;\n  }\n  signAllInputsHDAsync(\n    hdKeyPair,\n    sighashTypes = [transaction_1.Transaction.SIGHASH_ALL],\n  ) {\n    return new Promise((resolve, reject) => {\n      if (!hdKeyPair || !hdKeyPair.publicKey || !hdKeyPair.fingerprint) {\n        return reject(new Error('Need HDSigner to sign input'));\n      }\n      const results = [];\n      const promises = [];\n      for (const i of range(this.data.inputs.length)) {\n        promises.push(\n          this.signInputHDAsync(i, hdKeyPair, sighashTypes).then(\n            () => {\n              results.push(true);\n            },\n            () => {\n              results.push(false);\n            },\n          ),\n        );\n      }\n      return Promise.all(promises).then(() => {\n        if (results.every(v => v === false)) {\n          return reject(new Error('No inputs were signed'));\n        }\n        resolve();\n      });\n    });\n  }\n  signInputHD(\n    inputIndex,\n    hdKeyPair,\n    sighashTypes = [transaction_1.Transaction.SIGHASH_ALL],\n  ) {\n    if (!hdKeyPair || !hdKeyPair.publicKey || !hdKeyPair.fingerprint) {\n      throw new Error('Need HDSigner to sign input');\n    }\n    const signers = getSignersFromHD(inputIndex, this.data.inputs, hdKeyPair);\n    signers.forEach(signer => this.signInput(inputIndex, signer, sighashTypes));\n    return this;\n  }\n  signInputHDAsync(\n    inputIndex,\n    hdKeyPair,\n    sighashTypes = [transaction_1.Transaction.SIGHASH_ALL],\n  ) {\n    return new Promise((resolve, reject) => {\n      if (!hdKeyPair || !hdKeyPair.publicKey || !hdKeyPair.fingerprint) {\n        return reject(new Error('Need HDSigner to sign input'));\n      }\n      const signers = getSignersFromHD(inputIndex, this.data.inputs, hdKeyPair);\n      const promises = signers.map(signer =>\n        this.signInputAsync(inputIndex, signer, sighashTypes),\n      );\n      return Promise.all(promises)\n        .then(() => {\n          resolve();\n        })\n        .catch(reject);\n    });\n  }\n  signAllInputs(keyPair, sighashTypes) {\n    if (!keyPair || !keyPair.publicKey)\n      throw new Error('Need Signer to sign input');\n    // TODO: Add a pubkey/pubkeyhash cache to each input\n    // as input information is added, then eventually\n    // optimize this method.\n    const results = [];\n    for (const i of range(this.data.inputs.length)) {\n      try {\n        this.signInput(i, keyPair, sighashTypes);\n        results.push(true);\n      } catch (err) {\n        results.push(false);\n      }\n    }\n    if (results.every(v => v === false)) {\n      throw new Error('No inputs were signed');\n    }\n    return this;\n  }\n  signAllInputsAsync(keyPair, sighashTypes) {\n    return new Promise((resolve, reject) => {\n      if (!keyPair || !keyPair.publicKey)\n        return reject(new Error('Need Signer to sign input'));\n      // TODO: Add a pubkey/pubkeyhash cache to each input\n      // as input information is added, then eventually\n      // optimize this method.\n      const results = [];\n      const promises = [];\n      for (const [i] of this.data.inputs.entries()) {\n        promises.push(\n          this.signInputAsync(i, keyPair, sighashTypes).then(\n            () => {\n              results.push(true);\n            },\n            () => {\n              results.push(false);\n            },\n          ),\n        );\n      }\n      return Promise.all(promises).then(() => {\n        if (results.every(v => v === false)) {\n          return reject(new Error('No inputs were signed'));\n        }\n        resolve();\n      });\n    });\n  }\n  signInput(inputIndex, keyPair, sighashTypes) {\n    if (!keyPair || !keyPair.publicKey)\n      throw new Error('Need Signer to sign input');\n    const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n    if ((0, bip371_1.isTaprootInput)(input)) {\n      return this._signTaprootInput(\n        inputIndex,\n        input,\n        keyPair,\n        undefined,\n        sighashTypes,\n      );\n    }\n    return this._signInput(inputIndex, keyPair, sighashTypes);\n  }\n  signTaprootInput(inputIndex, keyPair, tapLeafHashToSign, sighashTypes) {\n    if (!keyPair || !keyPair.publicKey)\n      throw new Error('Need Signer to sign input');\n    const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n    if ((0, bip371_1.isTaprootInput)(input))\n      return this._signTaprootInput(\n        inputIndex,\n        input,\n        keyPair,\n        tapLeafHashToSign,\n        sighashTypes,\n      );\n    throw new Error(`Input #${inputIndex} is not of type Taproot.`);\n  }\n  _signInput(\n    inputIndex,\n    keyPair,\n    sighashTypes = [transaction_1.Transaction.SIGHASH_ALL],\n  ) {\n    const { hash, sighashType } = getHashAndSighashType(\n      this.data.inputs,\n      inputIndex,\n      keyPair.publicKey,\n      this.__CACHE,\n      sighashTypes,\n    );\n    const partialSig = [\n      {\n        pubkey: keyPair.publicKey,\n        signature: bscript.signature.encode(keyPair.sign(hash), sighashType),\n      },\n    ];\n    this.data.updateInput(inputIndex, { partialSig });\n    return this;\n  }\n  _signTaprootInput(\n    inputIndex,\n    input,\n    keyPair,\n    tapLeafHashToSign,\n    allowedSighashTypes = [transaction_1.Transaction.SIGHASH_DEFAULT],\n  ) {\n    const hashesForSig = this.checkTaprootHashesForSig(\n      inputIndex,\n      input,\n      keyPair,\n      tapLeafHashToSign,\n      allowedSighashTypes,\n    );\n    const tapKeySig = hashesForSig\n      .filter(h => !h.leafHash)\n      .map(h =>\n        (0, bip371_1.serializeTaprootSignature)(\n          keyPair.signSchnorr(h.hash),\n          input.sighashType,\n        ),\n      )[0];\n    const tapScriptSig = hashesForSig\n      .filter(h => !!h.leafHash)\n      .map(h => ({\n        pubkey: (0, bip371_1.toXOnly)(keyPair.publicKey),\n        signature: (0, bip371_1.serializeTaprootSignature)(\n          keyPair.signSchnorr(h.hash),\n          input.sighashType,\n        ),\n        leafHash: h.leafHash,\n      }));\n    if (tapKeySig) {\n      this.data.updateInput(inputIndex, { tapKeySig });\n    }\n    if (tapScriptSig.length) {\n      this.data.updateInput(inputIndex, { tapScriptSig });\n    }\n    return this;\n  }\n  signInputAsync(inputIndex, keyPair, sighashTypes) {\n    return Promise.resolve().then(() => {\n      if (!keyPair || !keyPair.publicKey)\n        throw new Error('Need Signer to sign input');\n      const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n      if ((0, bip371_1.isTaprootInput)(input))\n        return this._signTaprootInputAsync(\n          inputIndex,\n          input,\n          keyPair,\n          undefined,\n          sighashTypes,\n        );\n      return this._signInputAsync(inputIndex, keyPair, sighashTypes);\n    });\n  }\n  signTaprootInputAsync(inputIndex, keyPair, tapLeafHash, sighashTypes) {\n    return Promise.resolve().then(() => {\n      if (!keyPair || !keyPair.publicKey)\n        throw new Error('Need Signer to sign input');\n      const input = (0, utils_1.checkForInput)(this.data.inputs, inputIndex);\n      if ((0, bip371_1.isTaprootInput)(input))\n        return this._signTaprootInputAsync(\n          inputIndex,\n          input,\n          keyPair,\n          tapLeafHash,\n          sighashTypes,\n        );\n      throw new Error(`Input #${inputIndex} is not of type Taproot.`);\n    });\n  }\n  _signInputAsync(\n    inputIndex,\n    keyPair,\n    sighashTypes = [transaction_1.Transaction.SIGHASH_ALL],\n  ) {\n    const { hash, sighashType } = getHashAndSighashType(\n      this.data.inputs,\n      inputIndex,\n      keyPair.publicKey,\n      this.__CACHE,\n      sighashTypes,\n    );\n    return Promise.resolve(keyPair.sign(hash)).then(signature => {\n      const partialSig = [\n        {\n          pubkey: keyPair.publicKey,\n          signature: bscript.signature.encode(signature, sighashType),\n        },\n      ];\n      this.data.updateInput(inputIndex, { partialSig });\n    });\n  }\n  async _signTaprootInputAsync(\n    inputIndex,\n    input,\n    keyPair,\n    tapLeafHash,\n    sighashTypes = [transaction_1.Transaction.SIGHASH_DEFAULT],\n  ) {\n    const hashesForSig = this.checkTaprootHashesForSig(\n      inputIndex,\n      input,\n      keyPair,\n      tapLeafHash,\n      sighashTypes,\n    );\n    const signaturePromises = [];\n    const tapKeyHash = hashesForSig.filter(h => !h.leafHash)[0];\n    if (tapKeyHash) {\n      const tapKeySigPromise = Promise.resolve(\n        keyPair.signSchnorr(tapKeyHash.hash),\n      ).then(sig => {\n        return {\n          tapKeySig: (0, bip371_1.serializeTaprootSignature)(\n            sig,\n            input.sighashType,\n          ),\n        };\n      });\n      signaturePromises.push(tapKeySigPromise);\n    }\n    const tapScriptHashes = hashesForSig.filter(h => !!h.leafHash);\n    if (tapScriptHashes.length) {\n      const tapScriptSigPromises = tapScriptHashes.map(tsh => {\n        return Promise.resolve(keyPair.signSchnorr(tsh.hash)).then(\n          signature => {\n            const tapScriptSig = [\n              {\n                pubkey: (0, bip371_1.toXOnly)(keyPair.publicKey),\n                signature: (0, bip371_1.serializeTaprootSignature)(\n                  signature,\n                  input.sighashType,\n                ),\n                leafHash: tsh.leafHash,\n              },\n            ];\n            return { tapScriptSig };\n          },\n        );\n      });\n      signaturePromises.push(...tapScriptSigPromises);\n    }\n    return Promise.all(signaturePromises).then(results => {\n      results.forEach(v => this.data.updateInput(inputIndex, v));\n    });\n  }\n  checkTaprootHashesForSig(\n    inputIndex,\n    input,\n    keyPair,\n    tapLeafHashToSign,\n    allowedSighashTypes,\n  ) {\n    if (typeof keyPair.signSchnorr !== 'function')\n      throw new Error(\n        `Need Schnorr Signer to sign taproot input #${inputIndex}.`,\n      );\n    const hashesForSig = getTaprootHashesForSig(\n      inputIndex,\n      input,\n      this.data.inputs,\n      keyPair.publicKey,\n      this.__CACHE,\n      tapLeafHashToSign,\n      allowedSighashTypes,\n    );\n    if (!hashesForSig || !hashesForSig.length)\n      throw new Error(\n        `Can not sign for input #${inputIndex} with the key ${keyPair.publicKey.toString(\n          'hex',\n        )}`,\n      );\n    return hashesForSig;\n  }\n  toBuffer() {\n    checkCache(this.__CACHE);\n    return this.data.toBuffer();\n  }\n  toHex() {\n    checkCache(this.__CACHE);\n    return this.data.toHex();\n  }\n  toBase64() {\n    checkCache(this.__CACHE);\n    return this.data.toBase64();\n  }\n  updateGlobal(updateData) {\n    this.data.updateGlobal(updateData);\n    return this;\n  }\n  updateInput(inputIndex, updateData) {\n    if (updateData.witnessScript) checkInvalidP2WSH(updateData.witnessScript);\n    (0, bip371_1.checkTaprootInputFields)(\n      this.data.inputs[inputIndex],\n      updateData,\n      'updateInput',\n    );\n    this.data.updateInput(inputIndex, updateData);\n    if (updateData.nonWitnessUtxo) {\n      addNonWitnessTxCache(\n        this.__CACHE,\n        this.data.inputs[inputIndex],\n        inputIndex,\n      );\n    }\n    return this;\n  }\n  updateOutput(outputIndex, updateData) {\n    const outputData = this.data.outputs[outputIndex];\n    (0, bip371_1.checkTaprootOutputFields)(\n      outputData,\n      updateData,\n      'updateOutput',\n    );\n    this.data.updateOutput(outputIndex, updateData);\n    return this;\n  }\n  addUnknownKeyValToGlobal(keyVal) {\n    this.data.addUnknownKeyValToGlobal(keyVal);\n    return this;\n  }\n  addUnknownKeyValToInput(inputIndex, keyVal) {\n    this.data.addUnknownKeyValToInput(inputIndex, keyVal);\n    return this;\n  }\n  addUnknownKeyValToOutput(outputIndex, keyVal) {\n    this.data.addUnknownKeyValToOutput(outputIndex, keyVal);\n    return this;\n  }\n  clearFinalizedInput(inputIndex) {\n    this.data.clearFinalizedInput(inputIndex);\n    return this;\n  }\n}\nexports.Psbt = Psbt;\n/**\n * This function is needed to pass to the bip174 base class's fromBuffer.\n * It takes the \"transaction buffer\" portion of the psbt buffer and returns a\n * Transaction (From the bip174 library) interface.\n */\nconst transactionFromBuffer = buffer => new PsbtTransaction(buffer);\n/**\n * This class implements the Transaction interface from bip174 library.\n * It contains a bitcoinjs-lib Transaction object.\n */\nclass PsbtTransaction {\n  constructor(buffer = Buffer.from([2, 0, 0, 0, 0, 0, 0, 0, 0, 0])) {\n    this.tx = transaction_1.Transaction.fromBuffer(buffer);\n    checkTxEmpty(this.tx);\n    Object.defineProperty(this, 'tx', {\n      enumerable: false,\n      writable: true,\n    });\n  }\n  getInputOutputCounts() {\n    return {\n      inputCount: this.tx.ins.length,\n      outputCount: this.tx.outs.length,\n    };\n  }\n  addInput(input) {\n    if (\n      input.hash === undefined ||\n      input.index === undefined ||\n      (!Buffer.isBuffer(input.hash) && typeof input.hash !== 'string') ||\n      typeof input.index !== 'number'\n    ) {\n      throw new Error('Error adding input.');\n    }\n    const hash =\n      typeof input.hash === 'string'\n        ? (0, bufferutils_1.reverseBuffer)(Buffer.from(input.hash, 'hex'))\n        : input.hash;\n    this.tx.addInput(hash, input.index, input.sequence);\n  }\n  addOutput(output) {\n    if (\n      output.script === undefined ||\n      output.value === undefined ||\n      !Buffer.isBuffer(output.script) ||\n      typeof output.value !== 'number'\n    ) {\n      throw new Error('Error adding output.');\n    }\n    this.tx.addOutput(output.script, output.value);\n  }\n  toBuffer() {\n    return this.tx.toBuffer();\n  }\n}\nfunction canFinalize(input, script, scriptType) {\n  switch (scriptType) {\n    case 'pubkey':\n    case 'pubkeyhash':\n    case 'witnesspubkeyhash':\n      return hasSigs(1, input.partialSig);\n    case 'multisig':\n      const p2ms = payments.p2ms({ output: script });\n      return hasSigs(p2ms.m, input.partialSig, p2ms.pubkeys);\n    default:\n      return false;\n  }\n}\nfunction checkCache(cache) {\n  if (cache.__UNSAFE_SIGN_NONSEGWIT !== false) {\n    throw new Error('Not BIP174 compliant, can not export');\n  }\n}\nfunction hasSigs(neededSigs, partialSig, pubkeys) {\n  if (!partialSig) return false;\n  let sigs;\n  if (pubkeys) {\n    sigs = pubkeys\n      .map(pkey => {\n        const pubkey = compressPubkey(pkey);\n        return partialSig.find(pSig => pSig.pubkey.equals(pubkey));\n      })\n      .filter(v => !!v);\n  } else {\n    sigs = partialSig;\n  }\n  if (sigs.length > neededSigs) throw new Error('Too many signatures');\n  return sigs.length === neededSigs;\n}\nfunction isFinalized(input) {\n  return !!input.finalScriptSig || !!input.finalScriptWitness;\n}\nfunction bip32DerivationIsMine(root) {\n  return d => {\n    if (!d.masterFingerprint.equals(root.fingerprint)) return false;\n    if (!root.derivePath(d.path).publicKey.equals(d.pubkey)) return false;\n    return true;\n  };\n}\nfunction check32Bit(num) {\n  if (\n    typeof num !== 'number' ||\n    num !== Math.floor(num) ||\n    num > 0xffffffff ||\n    num < 0\n  ) {\n    throw new Error('Invalid 32 bit integer');\n  }\n}\nfunction checkFees(psbt, cache, opts) {\n  const feeRate = cache.__FEE_RATE || psbt.getFeeRate();\n  const vsize = cache.__EXTRACTED_TX.virtualSize();\n  const satoshis = feeRate * vsize;\n  if (feeRate >= opts.maximumFeeRate) {\n    throw new Error(\n      `Warning: You are paying around ${(satoshis / 1e8).toFixed(8)} in ` +\n        `fees, which is ${feeRate} satoshi per byte for a transaction ` +\n        `with a VSize of ${vsize} bytes (segwit counted as 0.25 byte per ` +\n        `byte). Use setMaximumFeeRate method to raise your threshold, or ` +\n        `pass true to the first arg of extractTransaction.`,\n    );\n  }\n}\nfunction checkInputsForPartialSig(inputs, action) {\n  inputs.forEach(input => {\n    const throws = (0, bip371_1.isTaprootInput)(input)\n      ? (0, bip371_1.checkTaprootInputForSigs)(input, action)\n      : (0, psbtutils_1.checkInputForSig)(input, action);\n    if (throws)\n      throw new Error('Can not modify transaction, signatures exist.');\n  });\n}\nfunction checkPartialSigSighashes(input) {\n  if (!input.sighashType || !input.partialSig) return;\n  const { partialSig, sighashType } = input;\n  partialSig.forEach(pSig => {\n    const { hashType } = bscript.signature.decode(pSig.signature);\n    if (sighashType !== hashType) {\n      throw new Error('Signature sighash does not match input sighash type');\n    }\n  });\n}\nfunction checkScriptForPubkey(pubkey, script, action) {\n  if (!(0, psbtutils_1.pubkeyInScript)(pubkey, script)) {\n    throw new Error(\n      `Can not ${action} for this input with the key ${pubkey.toString('hex')}`,\n    );\n  }\n}\nfunction checkTxEmpty(tx) {\n  const isEmpty = tx.ins.every(\n    input =>\n      input.script &&\n      input.script.length === 0 &&\n      input.witness &&\n      input.witness.length === 0,\n  );\n  if (!isEmpty) {\n    throw new Error('Format Error: Transaction ScriptSigs are not empty');\n  }\n}\nfunction checkTxForDupeIns(tx, cache) {\n  tx.ins.forEach(input => {\n    checkTxInputCache(cache, input);\n  });\n}\nfunction checkTxInputCache(cache, input) {\n  const key =\n    (0, bufferutils_1.reverseBuffer)(Buffer.from(input.hash)).toString('hex') +\n    ':' +\n    input.index;\n  if (cache.__TX_IN_CACHE[key]) throw new Error('Duplicate input detected.');\n  cache.__TX_IN_CACHE[key] = 1;\n}\nfunction scriptCheckerFactory(payment, paymentScriptName) {\n  return (inputIndex, scriptPubKey, redeemScript, ioType) => {\n    const redeemScriptOutput = payment({\n      redeem: { output: redeemScript },\n    }).output;\n    if (!scriptPubKey.equals(redeemScriptOutput)) {\n      throw new Error(\n        `${paymentScriptName} for ${ioType} #${inputIndex} doesn't match the scriptPubKey in the prevout`,\n      );\n    }\n  };\n}\nconst checkRedeemScript = scriptCheckerFactory(payments.p2sh, 'Redeem script');\nconst checkWitnessScript = scriptCheckerFactory(\n  payments.p2wsh,\n  'Witness script',\n);\nfunction getTxCacheValue(key, name, inputs, c) {\n  if (!inputs.every(isFinalized))\n    throw new Error(`PSBT must be finalized to calculate ${name}`);\n  if (key === '__FEE_RATE' && c.__FEE_RATE) return c.__FEE_RATE;\n  if (key === '__FEE' && c.__FEE) return c.__FEE;\n  let tx;\n  let mustFinalize = true;\n  if (c.__EXTRACTED_TX) {\n    tx = c.__EXTRACTED_TX;\n    mustFinalize = false;\n  } else {\n    tx = c.__TX.clone();\n  }\n  inputFinalizeGetAmts(inputs, tx, c, mustFinalize);\n  if (key === '__FEE_RATE') return c.__FEE_RATE;\n  else if (key === '__FEE') return c.__FEE;\n}\nfunction getFinalScripts(inputIndex, input, script, isSegwit, isP2SH, isP2WSH) {\n  const scriptType = classifyScript(script);\n  if (!canFinalize(input, script, scriptType))\n    throw new Error(`Can not finalize input #${inputIndex}`);\n  return prepareFinalScripts(\n    script,\n    scriptType,\n    input.partialSig,\n    isSegwit,\n    isP2SH,\n    isP2WSH,\n  );\n}\nfunction prepareFinalScripts(\n  script,\n  scriptType,\n  partialSig,\n  isSegwit,\n  isP2SH,\n  isP2WSH,\n) {\n  let finalScriptSig;\n  let finalScriptWitness;\n  // Wow, the payments API is very handy\n  const payment = getPayment(script, scriptType, partialSig);\n  const p2wsh = !isP2WSH ? null : payments.p2wsh({ redeem: payment });\n  const p2sh = !isP2SH ? null : payments.p2sh({ redeem: p2wsh || payment });\n  if (isSegwit) {\n    if (p2wsh) {\n      finalScriptWitness = (0, psbtutils_1.witnessStackToScriptWitness)(\n        p2wsh.witness,\n      );\n    } else {\n      finalScriptWitness = (0, psbtutils_1.witnessStackToScriptWitness)(\n        payment.witness,\n      );\n    }\n    if (p2sh) {\n      finalScriptSig = p2sh.input;\n    }\n  } else {\n    if (p2sh) {\n      finalScriptSig = p2sh.input;\n    } else {\n      finalScriptSig = payment.input;\n    }\n  }\n  return {\n    finalScriptSig,\n    finalScriptWitness,\n  };\n}\nfunction getHashAndSighashType(\n  inputs,\n  inputIndex,\n  pubkey,\n  cache,\n  sighashTypes,\n) {\n  const input = (0, utils_1.checkForInput)(inputs, inputIndex);\n  const { hash, sighashType, script } = getHashForSig(\n    inputIndex,\n    input,\n    cache,\n    false,\n    sighashTypes,\n  );\n  checkScriptForPubkey(pubkey, script, 'sign');\n  return {\n    hash,\n    sighashType,\n  };\n}\nfunction getHashForSig(inputIndex, input, cache, forValidate, sighashTypes) {\n  const unsignedTx = cache.__TX;\n  const sighashType =\n    input.sighashType || transaction_1.Transaction.SIGHASH_ALL;\n  checkSighashTypeAllowed(sighashType, sighashTypes);\n  let hash;\n  let prevout;\n  if (input.nonWitnessUtxo) {\n    const nonWitnessUtxoTx = nonWitnessUtxoTxFromCache(\n      cache,\n      input,\n      inputIndex,\n    );\n    const prevoutHash = unsignedTx.ins[inputIndex].hash;\n    const utxoHash = nonWitnessUtxoTx.getHash();\n    // If a non-witness UTXO is provided, its hash must match the hash specified in the prevout\n    if (!prevoutHash.equals(utxoHash)) {\n      throw new Error(\n        `Non-witness UTXO hash for input #${inputIndex} doesn't match the hash specified in the prevout`,\n      );\n    }\n    const prevoutIndex = unsignedTx.ins[inputIndex].index;\n    prevout = nonWitnessUtxoTx.outs[prevoutIndex];\n  } else if (input.witnessUtxo) {\n    prevout = input.witnessUtxo;\n  } else {\n    throw new Error('Need a Utxo input item for signing');\n  }\n  const { meaningfulScript, type } = getMeaningfulScript(\n    prevout.script,\n    inputIndex,\n    'input',\n    input.redeemScript,\n    input.witnessScript,\n  );\n  if (['p2sh-p2wsh', 'p2wsh'].indexOf(type) >= 0) {\n    hash = unsignedTx.hashForWitnessV0(\n      inputIndex,\n      meaningfulScript,\n      prevout.value,\n      sighashType,\n    );\n  } else if ((0, psbtutils_1.isP2WPKH)(meaningfulScript)) {\n    // P2WPKH uses the P2PKH template for prevoutScript when signing\n    const signingScript = payments.p2pkh({\n      hash: meaningfulScript.slice(2),\n    }).output;\n    hash = unsignedTx.hashForWitnessV0(\n      inputIndex,\n      signingScript,\n      prevout.value,\n      sighashType,\n    );\n  } else {\n    // non-segwit\n    if (\n      input.nonWitnessUtxo === undefined &&\n      cache.__UNSAFE_SIGN_NONSEGWIT === false\n    )\n      throw new Error(\n        `Input #${inputIndex} has witnessUtxo but non-segwit script: ` +\n          `${meaningfulScript.toString('hex')}`,\n      );\n    if (!forValidate && cache.__UNSAFE_SIGN_NONSEGWIT !== false)\n      console.warn(\n        'Warning: Signing non-segwit inputs without the full parent transaction ' +\n          'means there is a chance that a miner could feed you incorrect information ' +\n          \"to trick you into paying large fees. This behavior is the same as Psbt's predecessor \" +\n          '(TransactionBuilder - now removed) when signing non-segwit scripts. You are not ' +\n          'able to export this Psbt with toBuffer|toBase64|toHex since it is not ' +\n          'BIP174 compliant.\\n*********************\\nPROCEED WITH CAUTION!\\n' +\n          '*********************',\n      );\n    hash = unsignedTx.hashForSignature(\n      inputIndex,\n      meaningfulScript,\n      sighashType,\n    );\n  }\n  return {\n    script: meaningfulScript,\n    sighashType,\n    hash,\n  };\n}\nfunction getAllTaprootHashesForSig(inputIndex, input, inputs, cache) {\n  const allPublicKeys = [];\n  if (input.tapInternalKey) {\n    const key = getPrevoutTaprootKey(inputIndex, input, cache);\n    if (key) {\n      allPublicKeys.push(key);\n    }\n  }\n  if (input.tapScriptSig) {\n    const tapScriptPubkeys = input.tapScriptSig.map(tss => tss.pubkey);\n    allPublicKeys.push(...tapScriptPubkeys);\n  }\n  const allHashes = allPublicKeys.map(pubicKey =>\n    getTaprootHashesForSig(inputIndex, input, inputs, pubicKey, cache),\n  );\n  return allHashes.flat();\n}\nfunction getPrevoutTaprootKey(inputIndex, input, cache) {\n  const { script } = getScriptAndAmountFromUtxo(inputIndex, input, cache);\n  return (0, psbtutils_1.isP2TR)(script) ? script.subarray(2, 34) : null;\n}\nfunction trimTaprootSig(signature) {\n  return signature.length === 64 ? signature : signature.subarray(0, 64);\n}\nfunction getTaprootHashesForSig(\n  inputIndex,\n  input,\n  inputs,\n  pubkey,\n  cache,\n  tapLeafHashToSign,\n  allowedSighashTypes,\n) {\n  const unsignedTx = cache.__TX;\n  const sighashType =\n    input.sighashType || transaction_1.Transaction.SIGHASH_DEFAULT;\n  checkSighashTypeAllowed(sighashType, allowedSighashTypes);\n  const prevOuts = inputs.map((i, index) =>\n    getScriptAndAmountFromUtxo(index, i, cache),\n  );\n  const signingScripts = prevOuts.map(o => o.script);\n  const values = prevOuts.map(o => o.value);\n  const hashes = [];\n  if (input.tapInternalKey && !tapLeafHashToSign) {\n    const outputKey =\n      getPrevoutTaprootKey(inputIndex, input, cache) || Buffer.from([]);\n    if ((0, bip371_1.toXOnly)(pubkey).equals(outputKey)) {\n      const tapKeyHash = unsignedTx.hashForWitnessV1(\n        inputIndex,\n        signingScripts,\n        values,\n        sighashType,\n      );\n      hashes.push({ pubkey, hash: tapKeyHash });\n    }\n  }\n  const tapLeafHashes = (input.tapLeafScript || [])\n    .filter(tapLeaf => (0, psbtutils_1.pubkeyInScript)(pubkey, tapLeaf.script))\n    .map(tapLeaf => {\n      const hash = (0, bip341_1.tapleafHash)({\n        output: tapLeaf.script,\n        version: tapLeaf.leafVersion,\n      });\n      return Object.assign({ hash }, tapLeaf);\n    })\n    .filter(\n      tapLeaf => !tapLeafHashToSign || tapLeafHashToSign.equals(tapLeaf.hash),\n    )\n    .map(tapLeaf => {\n      const tapScriptHash = unsignedTx.hashForWitnessV1(\n        inputIndex,\n        signingScripts,\n        values,\n        sighashType,\n        tapLeaf.hash,\n      );\n      return {\n        pubkey,\n        hash: tapScriptHash,\n        leafHash: tapLeaf.hash,\n      };\n    });\n  return hashes.concat(tapLeafHashes);\n}\nfunction checkSighashTypeAllowed(sighashType, sighashTypes) {\n  if (sighashTypes && sighashTypes.indexOf(sighashType) < 0) {\n    const str = sighashTypeToString(sighashType);\n    throw new Error(\n      `Sighash type is not allowed. Retry the sign method passing the ` +\n        `sighashTypes array of whitelisted types. Sighash type: ${str}`,\n    );\n  }\n}\nfunction getPayment(script, scriptType, partialSig) {\n  let payment;\n  switch (scriptType) {\n    case 'multisig':\n      const sigs = getSortedSigs(script, partialSig);\n      payment = payments.p2ms({\n        output: script,\n        signatures: sigs,\n      });\n      break;\n    case 'pubkey':\n      payment = payments.p2pk({\n        output: script,\n        signature: partialSig[0].signature,\n      });\n      break;\n    case 'pubkeyhash':\n      payment = payments.p2pkh({\n        output: script,\n        pubkey: partialSig[0].pubkey,\n        signature: partialSig[0].signature,\n      });\n      break;\n    case 'witnesspubkeyhash':\n      payment = payments.p2wpkh({\n        output: script,\n        pubkey: partialSig[0].pubkey,\n        signature: partialSig[0].signature,\n      });\n      break;\n  }\n  return payment;\n}\nfunction getScriptFromInput(inputIndex, input, cache) {\n  const unsignedTx = cache.__TX;\n  const res = {\n    script: null,\n    isSegwit: false,\n    isP2SH: false,\n    isP2WSH: false,\n  };\n  res.isP2SH = !!input.redeemScript;\n  res.isP2WSH = !!input.witnessScript;\n  if (input.witnessScript) {\n    res.script = input.witnessScript;\n  } else if (input.redeemScript) {\n    res.script = input.redeemScript;\n  } else {\n    if (input.nonWitnessUtxo) {\n      const nonWitnessUtxoTx = nonWitnessUtxoTxFromCache(\n        cache,\n        input,\n        inputIndex,\n      );\n      const prevoutIndex = unsignedTx.ins[inputIndex].index;\n      res.script = nonWitnessUtxoTx.outs[prevoutIndex].script;\n    } else if (input.witnessUtxo) {\n      res.script = input.witnessUtxo.script;\n    }\n  }\n  if (input.witnessScript || (0, psbtutils_1.isP2WPKH)(res.script)) {\n    res.isSegwit = true;\n  }\n  return res;\n}\nfunction getSignersFromHD(inputIndex, inputs, hdKeyPair) {\n  const input = (0, utils_1.checkForInput)(inputs, inputIndex);\n  if (!input.bip32Derivation || input.bip32Derivation.length === 0) {\n    throw new Error('Need bip32Derivation to sign with HD');\n  }\n  const myDerivations = input.bip32Derivation\n    .map(bipDv => {\n      if (bipDv.masterFingerprint.equals(hdKeyPair.fingerprint)) {\n        return bipDv;\n      } else {\n        return;\n      }\n    })\n    .filter(v => !!v);\n  if (myDerivations.length === 0) {\n    throw new Error(\n      'Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint',\n    );\n  }\n  const signers = myDerivations.map(bipDv => {\n    const node = hdKeyPair.derivePath(bipDv.path);\n    if (!bipDv.pubkey.equals(node.publicKey)) {\n      throw new Error('pubkey did not match bip32Derivation');\n    }\n    return node;\n  });\n  return signers;\n}\nfunction getSortedSigs(script, partialSig) {\n  const p2ms = payments.p2ms({ output: script });\n  // for each pubkey in order of p2ms script\n  return p2ms.pubkeys\n    .map(pk => {\n      // filter partialSig array by pubkey being equal\n      return (\n        partialSig.filter(ps => {\n          return ps.pubkey.equals(pk);\n        })[0] || {}\n      ).signature;\n      // Any pubkey without a match will return undefined\n      // this last filter removes all the undefined items in the array.\n    })\n    .filter(v => !!v);\n}\nfunction scriptWitnessToWitnessStack(buffer) {\n  let offset = 0;\n  function readSlice(n) {\n    offset += n;\n    return buffer.slice(offset - n, offset);\n  }\n  function readVarInt() {\n    const vi = varuint.decode(buffer, offset);\n    offset += varuint.decode.bytes;\n    return vi;\n  }\n  function readVarSlice() {\n    return readSlice(readVarInt());\n  }\n  function readVector() {\n    const count = readVarInt();\n    const vector = [];\n    for (let i = 0; i < count; i++) vector.push(readVarSlice());\n    return vector;\n  }\n  return readVector();\n}\nfunction sighashTypeToString(sighashType) {\n  let text =\n    sighashType & transaction_1.Transaction.SIGHASH_ANYONECANPAY\n      ? 'SIGHASH_ANYONECANPAY | '\n      : '';\n  const sigMod = sighashType & 0x1f;\n  switch (sigMod) {\n    case transaction_1.Transaction.SIGHASH_ALL:\n      text += 'SIGHASH_ALL';\n      break;\n    case transaction_1.Transaction.SIGHASH_SINGLE:\n      text += 'SIGHASH_SINGLE';\n      break;\n    case transaction_1.Transaction.SIGHASH_NONE:\n      text += 'SIGHASH_NONE';\n      break;\n  }\n  return text;\n}\nfunction addNonWitnessTxCache(cache, input, inputIndex) {\n  cache.__NON_WITNESS_UTXO_BUF_CACHE[inputIndex] = input.nonWitnessUtxo;\n  const tx = transaction_1.Transaction.fromBuffer(input.nonWitnessUtxo);\n  cache.__NON_WITNESS_UTXO_TX_CACHE[inputIndex] = tx;\n  const self = cache;\n  const selfIndex = inputIndex;\n  delete input.nonWitnessUtxo;\n  Object.defineProperty(input, 'nonWitnessUtxo', {\n    enumerable: true,\n    get() {\n      const buf = self.__NON_WITNESS_UTXO_BUF_CACHE[selfIndex];\n      const txCache = self.__NON_WITNESS_UTXO_TX_CACHE[selfIndex];\n      if (buf !== undefined) {\n        return buf;\n      } else {\n        const newBuf = txCache.toBuffer();\n        self.__NON_WITNESS_UTXO_BUF_CACHE[selfIndex] = newBuf;\n        return newBuf;\n      }\n    },\n    set(data) {\n      self.__NON_WITNESS_UTXO_BUF_CACHE[selfIndex] = data;\n    },\n  });\n}\nfunction inputFinalizeGetAmts(inputs, tx, cache, mustFinalize) {\n  let inputAmount = 0;\n  inputs.forEach((input, idx) => {\n    if (mustFinalize && input.finalScriptSig)\n      tx.ins[idx].script = input.finalScriptSig;\n    if (mustFinalize && input.finalScriptWitness) {\n      tx.ins[idx].witness = scriptWitnessToWitnessStack(\n        input.finalScriptWitness,\n      );\n    }\n    if (input.witnessUtxo) {\n      inputAmount += input.witnessUtxo.value;\n    } else if (input.nonWitnessUtxo) {\n      const nwTx = nonWitnessUtxoTxFromCache(cache, input, idx);\n      const vout = tx.ins[idx].index;\n      const out = nwTx.outs[vout];\n      inputAmount += out.value;\n    }\n  });\n  const outputAmount = tx.outs.reduce((total, o) => total + o.value, 0);\n  const fee = inputAmount - outputAmount;\n  if (fee < 0) {\n    throw new Error('Outputs are spending more than Inputs');\n  }\n  const bytes = tx.virtualSize();\n  cache.__FEE = fee;\n  cache.__EXTRACTED_TX = tx;\n  cache.__FEE_RATE = Math.floor(fee / bytes);\n}\nfunction nonWitnessUtxoTxFromCache(cache, input, inputIndex) {\n  const c = cache.__NON_WITNESS_UTXO_TX_CACHE;\n  if (!c[inputIndex]) {\n    addNonWitnessTxCache(cache, input, inputIndex);\n  }\n  return c[inputIndex];\n}\nfunction getScriptFromUtxo(inputIndex, input, cache) {\n  const { script } = getScriptAndAmountFromUtxo(inputIndex, input, cache);\n  return script;\n}\nfunction getScriptAndAmountFromUtxo(inputIndex, input, cache) {\n  if (input.witnessUtxo !== undefined) {\n    return {\n      script: input.witnessUtxo.script,\n      value: input.witnessUtxo.value,\n    };\n  } else if (input.nonWitnessUtxo !== undefined) {\n    const nonWitnessUtxoTx = nonWitnessUtxoTxFromCache(\n      cache,\n      input,\n      inputIndex,\n    );\n    const o = nonWitnessUtxoTx.outs[cache.__TX.ins[inputIndex].index];\n    return { script: o.script, value: o.value };\n  } else {\n    throw new Error(\"Can't find pubkey in input without Utxo data\");\n  }\n}\nfunction pubkeyInInput(pubkey, input, inputIndex, cache) {\n  const script = getScriptFromUtxo(inputIndex, input, cache);\n  const { meaningfulScript } = getMeaningfulScript(\n    script,\n    inputIndex,\n    'input',\n    input.redeemScript,\n    input.witnessScript,\n  );\n  return (0, psbtutils_1.pubkeyInScript)(pubkey, meaningfulScript);\n}\nfunction pubkeyInOutput(pubkey, output, outputIndex, cache) {\n  const script = cache.__TX.outs[outputIndex].script;\n  const { meaningfulScript } = getMeaningfulScript(\n    script,\n    outputIndex,\n    'output',\n    output.redeemScript,\n    output.witnessScript,\n  );\n  return (0, psbtutils_1.pubkeyInScript)(pubkey, meaningfulScript);\n}\nfunction redeemFromFinalScriptSig(finalScript) {\n  if (!finalScript) return;\n  const decomp = bscript.decompile(finalScript);\n  if (!decomp) return;\n  const lastItem = decomp[decomp.length - 1];\n  if (\n    !Buffer.isBuffer(lastItem) ||\n    isPubkeyLike(lastItem) ||\n    isSigLike(lastItem)\n  )\n    return;\n  const sDecomp = bscript.decompile(lastItem);\n  if (!sDecomp) return;\n  return lastItem;\n}\nfunction redeemFromFinalWitnessScript(finalScript) {\n  if (!finalScript) return;\n  const decomp = scriptWitnessToWitnessStack(finalScript);\n  const lastItem = decomp[decomp.length - 1];\n  if (isPubkeyLike(lastItem)) return;\n  const sDecomp = bscript.decompile(lastItem);\n  if (!sDecomp) return;\n  return lastItem;\n}\nfunction compressPubkey(pubkey) {\n  if (pubkey.length === 65) {\n    const parity = pubkey[64] & 1;\n    const newKey = pubkey.slice(0, 33);\n    newKey[0] = 2 | parity;\n    return newKey;\n  }\n  return pubkey.slice();\n}\nfunction isPubkeyLike(buf) {\n  return buf.length === 33 && bscript.isCanonicalPubKey(buf);\n}\nfunction isSigLike(buf) {\n  return bscript.isCanonicalScriptSignature(buf);\n}\nfunction getMeaningfulScript(\n  script,\n  index,\n  ioType,\n  redeemScript,\n  witnessScript,\n) {\n  const isP2SH = (0, psbtutils_1.isP2SHScript)(script);\n  const isP2SHP2WSH =\n    isP2SH && redeemScript && (0, psbtutils_1.isP2WSHScript)(redeemScript);\n  const isP2WSH = (0, psbtutils_1.isP2WSHScript)(script);\n  if (isP2SH && redeemScript === undefined)\n    throw new Error('scriptPubkey is P2SH but redeemScript missing');\n  if ((isP2WSH || isP2SHP2WSH) && witnessScript === undefined)\n    throw new Error(\n      'scriptPubkey or redeemScript is P2WSH but witnessScript missing',\n    );\n  let meaningfulScript;\n  if (isP2SHP2WSH) {\n    meaningfulScript = witnessScript;\n    checkRedeemScript(index, script, redeemScript, ioType);\n    checkWitnessScript(index, redeemScript, witnessScript, ioType);\n    checkInvalidP2WSH(meaningfulScript);\n  } else if (isP2WSH) {\n    meaningfulScript = witnessScript;\n    checkWitnessScript(index, script, witnessScript, ioType);\n    checkInvalidP2WSH(meaningfulScript);\n  } else if (isP2SH) {\n    meaningfulScript = redeemScript;\n    checkRedeemScript(index, script, redeemScript, ioType);\n  } else {\n    meaningfulScript = script;\n  }\n  return {\n    meaningfulScript,\n    type: isP2SHP2WSH\n      ? 'p2sh-p2wsh'\n      : isP2SH\n      ? 'p2sh'\n      : isP2WSH\n      ? 'p2wsh'\n      : 'raw',\n  };\n}\nfunction checkInvalidP2WSH(script) {\n  if (\n    (0, psbtutils_1.isP2WPKH)(script) ||\n    (0, psbtutils_1.isP2SHScript)(script)\n  ) {\n    throw new Error('P2WPKH or P2SH can not be contained within P2WSH');\n  }\n}\nfunction classifyScript(script) {\n  if ((0, psbtutils_1.isP2WPKH)(script)) return 'witnesspubkeyhash';\n  if ((0, psbtutils_1.isP2PKH)(script)) return 'pubkeyhash';\n  if ((0, psbtutils_1.isP2MS)(script)) return 'multisig';\n  if ((0, psbtutils_1.isP2PK)(script)) return 'pubkey';\n  return 'nonstandard';\n}\nfunction range(n) {\n  return [...Array(n).keys()];\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.checkTaprootInputForSigs =\n  exports.tapTreeFromList =\n  exports.tapTreeToList =\n  exports.tweakInternalPubKey =\n  exports.checkTaprootOutputFields =\n  exports.checkTaprootInputFields =\n  exports.isTaprootOutput =\n  exports.isTaprootInput =\n  exports.serializeTaprootSignature =\n  exports.tapScriptFinalizer =\n  exports.toXOnly =\n    void 0;\nconst types_1 = require('../types');\nconst transaction_1 = require('../transaction');\nconst psbtutils_1 = require('./psbtutils');\nconst bip341_1 = require('../payments/bip341');\nconst payments_1 = require('../payments');\nconst psbtutils_2 = require('./psbtutils');\nconst toXOnly = pubKey => (pubKey.length === 32 ? pubKey : pubKey.slice(1, 33));\nexports.toXOnly = toXOnly;\n/**\n * Default tapscript finalizer. It searches for the `tapLeafHashToFinalize` if provided.\n * Otherwise it will search for the tapleaf that has at least one signature and has the shortest path.\n * @param inputIndex the position of the PSBT input.\n * @param input the PSBT input.\n * @param tapLeafHashToFinalize optional, if provided the finalizer will search for a tapleaf that has this hash\n *                              and will try to build the finalScriptWitness.\n * @returns the finalScriptWitness or throws an exception if no tapleaf found.\n */\nfunction tapScriptFinalizer(inputIndex, input, tapLeafHashToFinalize) {\n  const tapLeaf = findTapLeafToFinalize(\n    input,\n    inputIndex,\n    tapLeafHashToFinalize,\n  );\n  try {\n    const sigs = sortSignatures(input, tapLeaf);\n    const witness = sigs.concat(tapLeaf.script).concat(tapLeaf.controlBlock);\n    return {\n      finalScriptWitness: (0, psbtutils_1.witnessStackToScriptWitness)(witness),\n    };\n  } catch (err) {\n    throw new Error(`Can not finalize taproot input #${inputIndex}: ${err}`);\n  }\n}\nexports.tapScriptFinalizer = tapScriptFinalizer;\nfunction serializeTaprootSignature(sig, sighashType) {\n  const sighashTypeByte = sighashType\n    ? Buffer.from([sighashType])\n    : Buffer.from([]);\n  return Buffer.concat([sig, sighashTypeByte]);\n}\nexports.serializeTaprootSignature = serializeTaprootSignature;\nfunction isTaprootInput(input) {\n  return (\n    input &&\n    !!(\n      input.tapInternalKey ||\n      input.tapMerkleRoot ||\n      (input.tapLeafScript && input.tapLeafScript.length) ||\n      (input.tapBip32Derivation && input.tapBip32Derivation.length) ||\n      (input.witnessUtxo && (0, psbtutils_1.isP2TR)(input.witnessUtxo.script))\n    )\n  );\n}\nexports.isTaprootInput = isTaprootInput;\nfunction isTaprootOutput(output, script) {\n  return (\n    output &&\n    !!(\n      output.tapInternalKey ||\n      output.tapTree ||\n      (output.tapBip32Derivation && output.tapBip32Derivation.length) ||\n      (script && (0, psbtutils_1.isP2TR)(script))\n    )\n  );\n}\nexports.isTaprootOutput = isTaprootOutput;\nfunction checkTaprootInputFields(inputData, newInputData, action) {\n  checkMixedTaprootAndNonTaprootInputFields(inputData, newInputData, action);\n  checkIfTapLeafInTree(inputData, newInputData, action);\n}\nexports.checkTaprootInputFields = checkTaprootInputFields;\nfunction checkTaprootOutputFields(outputData, newOutputData, action) {\n  checkMixedTaprootAndNonTaprootOutputFields(outputData, newOutputData, action);\n  checkTaprootScriptPubkey(outputData, newOutputData);\n}\nexports.checkTaprootOutputFields = checkTaprootOutputFields;\nfunction checkTaprootScriptPubkey(outputData, newOutputData) {\n  if (!newOutputData.tapTree && !newOutputData.tapInternalKey) return;\n  const tapInternalKey =\n    newOutputData.tapInternalKey || outputData.tapInternalKey;\n  const tapTree = newOutputData.tapTree || outputData.tapTree;\n  if (tapInternalKey) {\n    const { script: scriptPubkey } = outputData;\n    const script = getTaprootScripPubkey(tapInternalKey, tapTree);\n    if (scriptPubkey && !scriptPubkey.equals(script))\n      throw new Error('Error adding output. Script or address missmatch.');\n  }\n}\nfunction getTaprootScripPubkey(tapInternalKey, tapTree) {\n  const scriptTree = tapTree && tapTreeFromList(tapTree.leaves);\n  const { output } = (0, payments_1.p2tr)({\n    internalPubkey: tapInternalKey,\n    scriptTree,\n  });\n  return output;\n}\nfunction tweakInternalPubKey(inputIndex, input) {\n  const tapInternalKey = input.tapInternalKey;\n  const outputKey =\n    tapInternalKey &&\n    (0, bip341_1.tweakKey)(tapInternalKey, input.tapMerkleRoot);\n  if (!outputKey)\n    throw new Error(\n      `Cannot tweak tap internal key for input #${inputIndex}. Public key: ${\n        tapInternalKey && tapInternalKey.toString('hex')\n      }`,\n    );\n  return outputKey.x;\n}\nexports.tweakInternalPubKey = tweakInternalPubKey;\n/**\n * Convert a binary tree to a BIP371 type list. Each element of the list is (according to BIP371):\n * One or more tuples representing the depth, leaf version, and script for a leaf in the Taproot tree,\n * allowing the entire tree to be reconstructed. The tuples must be in depth first search order so that\n * the tree is correctly reconstructed.\n * @param tree the binary tap tree\n * @returns a list of BIP 371 tapleaves\n */\nfunction tapTreeToList(tree) {\n  if (!(0, types_1.isTaptree)(tree))\n    throw new Error(\n      'Cannot convert taptree to tapleaf list. Expecting a tapree structure.',\n    );\n  return _tapTreeToList(tree);\n}\nexports.tapTreeToList = tapTreeToList;\n/**\n * Convert a BIP371 TapLeaf list to a TapTree (binary).\n * @param leaves a list of tapleaves where each element of the list is (according to BIP371):\n * One or more tuples representing the depth, leaf version, and script for a leaf in the Taproot tree,\n * allowing the entire tree to be reconstructed. The tuples must be in depth first search order so that\n * the tree is correctly reconstructed.\n * @returns the corresponding taptree, or throws an exception if the tree cannot be reconstructed\n */\nfunction tapTreeFromList(leaves = []) {\n  if (leaves.length === 1 && leaves[0].depth === 0)\n    return {\n      output: leaves[0].script,\n      version: leaves[0].leafVersion,\n    };\n  return instertLeavesInTree(leaves);\n}\nexports.tapTreeFromList = tapTreeFromList;\nfunction checkTaprootInputForSigs(input, action) {\n  const sigs = extractTaprootSigs(input);\n  return sigs.some(sig =>\n    (0, psbtutils_2.signatureBlocksAction)(sig, decodeSchnorrSignature, action),\n  );\n}\nexports.checkTaprootInputForSigs = checkTaprootInputForSigs;\nfunction decodeSchnorrSignature(signature) {\n  return {\n    signature: signature.slice(0, 64),\n    hashType:\n      signature.slice(64)[0] || transaction_1.Transaction.SIGHASH_DEFAULT,\n  };\n}\nfunction extractTaprootSigs(input) {\n  const sigs = [];\n  if (input.tapKeySig) sigs.push(input.tapKeySig);\n  if (input.tapScriptSig)\n    sigs.push(...input.tapScriptSig.map(s => s.signature));\n  if (!sigs.length) {\n    const finalTapKeySig = getTapKeySigFromWithness(input.finalScriptWitness);\n    if (finalTapKeySig) sigs.push(finalTapKeySig);\n  }\n  return sigs;\n}\nfunction getTapKeySigFromWithness(finalScriptWitness) {\n  if (!finalScriptWitness) return;\n  const witness = finalScriptWitness.slice(2);\n  // todo: add schnorr signature validation\n  if (witness.length === 64 || witness.length === 65) return witness;\n}\nfunction _tapTreeToList(tree, leaves = [], depth = 0) {\n  if (depth > bip341_1.MAX_TAPTREE_DEPTH)\n    throw new Error('Max taptree depth exceeded.');\n  if (!tree) return [];\n  if ((0, types_1.isTapleaf)(tree)) {\n    leaves.push({\n      depth,\n      leafVersion: tree.version || bip341_1.LEAF_VERSION_TAPSCRIPT,\n      script: tree.output,\n    });\n    return leaves;\n  }\n  if (tree[0]) _tapTreeToList(tree[0], leaves, depth + 1);\n  if (tree[1]) _tapTreeToList(tree[1], leaves, depth + 1);\n  return leaves;\n}\nfunction instertLeavesInTree(leaves) {\n  let tree;\n  for (const leaf of leaves) {\n    tree = instertLeafInTree(leaf, tree);\n    if (!tree) throw new Error(`No room left to insert tapleaf in tree`);\n  }\n  return tree;\n}\nfunction instertLeafInTree(leaf, tree, depth = 0) {\n  if (depth > bip341_1.MAX_TAPTREE_DEPTH)\n    throw new Error('Max taptree depth exceeded.');\n  if (leaf.depth === depth) {\n    if (!tree)\n      return {\n        output: leaf.script,\n        version: leaf.leafVersion,\n      };\n    return;\n  }\n  if ((0, types_1.isTapleaf)(tree)) return;\n  const leftSide = instertLeafInTree(leaf, tree && tree[0], depth + 1);\n  if (leftSide) return [leftSide, tree && tree[1]];\n  const rightSide = instertLeafInTree(leaf, tree && tree[1], depth + 1);\n  if (rightSide) return [tree && tree[0], rightSide];\n}\nfunction checkMixedTaprootAndNonTaprootInputFields(\n  inputData,\n  newInputData,\n  action,\n) {\n  const isBadTaprootUpdate =\n    isTaprootInput(inputData) && hasNonTaprootFields(newInputData);\n  const isBadNonTaprootUpdate =\n    hasNonTaprootFields(inputData) && isTaprootInput(newInputData);\n  const hasMixedFields =\n    inputData === newInputData &&\n    isTaprootInput(newInputData) &&\n    hasNonTaprootFields(newInputData); // todo: bad? use !===\n  if (isBadTaprootUpdate || isBadNonTaprootUpdate || hasMixedFields)\n    throw new Error(\n      `Invalid arguments for Psbt.${action}. ` +\n        `Cannot use both taproot and non-taproot fields.`,\n    );\n}\nfunction checkMixedTaprootAndNonTaprootOutputFields(\n  inputData,\n  newInputData,\n  action,\n) {\n  const isBadTaprootUpdate =\n    isTaprootOutput(inputData) && hasNonTaprootFields(newInputData);\n  const isBadNonTaprootUpdate =\n    hasNonTaprootFields(inputData) && isTaprootOutput(newInputData);\n  const hasMixedFields =\n    inputData === newInputData &&\n    isTaprootOutput(newInputData) &&\n    hasNonTaprootFields(newInputData);\n  if (isBadTaprootUpdate || isBadNonTaprootUpdate || hasMixedFields)\n    throw new Error(\n      `Invalid arguments for Psbt.${action}. ` +\n        `Cannot use both taproot and non-taproot fields.`,\n    );\n}\n/**\n * Checks if the tap leaf is part of the tap tree for the given input data.\n * Throws an error if the tap leaf is not part of the tap tree.\n * @param inputData - The original PsbtInput data.\n * @param newInputData - The new PsbtInput data.\n * @param action - The action being performed.\n * @throws {Error} - If the tap leaf is not part of the tap tree.\n */\nfunction checkIfTapLeafInTree(inputData, newInputData, action) {\n  if (newInputData.tapMerkleRoot) {\n    const newLeafsInTree = (newInputData.tapLeafScript || []).every(l =>\n      isTapLeafInTree(l, newInputData.tapMerkleRoot),\n    );\n    const oldLeafsInTree = (inputData.tapLeafScript || []).every(l =>\n      isTapLeafInTree(l, newInputData.tapMerkleRoot),\n    );\n    if (!newLeafsInTree || !oldLeafsInTree)\n      throw new Error(\n        `Invalid arguments for Psbt.${action}. Tapleaf not part of taptree.`,\n      );\n  } else if (inputData.tapMerkleRoot) {\n    const newLeafsInTree = (newInputData.tapLeafScript || []).every(l =>\n      isTapLeafInTree(l, inputData.tapMerkleRoot),\n    );\n    if (!newLeafsInTree)\n      throw new Error(\n        `Invalid arguments for Psbt.${action}. Tapleaf not part of taptree.`,\n      );\n  }\n}\n/**\n * Checks if a TapLeafScript is present in a Merkle tree.\n * @param tapLeaf The TapLeafScript to check.\n * @param merkleRoot The Merkle root of the tree. If not provided, the function assumes the TapLeafScript is present.\n * @returns A boolean indicating whether the TapLeafScript is present in the tree.\n */\nfunction isTapLeafInTree(tapLeaf, merkleRoot) {\n  if (!merkleRoot) return true;\n  const leafHash = (0, bip341_1.tapleafHash)({\n    output: tapLeaf.script,\n    version: tapLeaf.leafVersion,\n  });\n  const rootHash = (0, bip341_1.rootHashFromPath)(\n    tapLeaf.controlBlock,\n    leafHash,\n  );\n  return rootHash.equals(merkleRoot);\n}\n/**\n * Sorts the signatures in the input's tapScriptSig array based on their position in the tapLeaf script.\n *\n * @param input - The PsbtInput object.\n * @param tapLeaf - The TapLeafScript object.\n * @returns An array of sorted signatures as Buffers.\n */\nfunction sortSignatures(input, tapLeaf) {\n  const leafHash = (0, bip341_1.tapleafHash)({\n    output: tapLeaf.script,\n    version: tapLeaf.leafVersion,\n  });\n  return (input.tapScriptSig || [])\n    .filter(tss => tss.leafHash.equals(leafHash))\n    .map(tss => addPubkeyPositionInScript(tapLeaf.script, tss))\n    .sort((t1, t2) => t2.positionInScript - t1.positionInScript)\n    .map(t => t.signature);\n}\n/**\n * Adds the position of a public key in a script to a TapScriptSig object.\n * @param script The script in which to find the position of the public key.\n * @param tss The TapScriptSig object to add the position to.\n * @returns A TapScriptSigWitPosition object with the added position.\n */\nfunction addPubkeyPositionInScript(script, tss) {\n  return Object.assign(\n    {\n      positionInScript: (0, psbtutils_1.pubkeyPositionInScript)(\n        tss.pubkey,\n        script,\n      ),\n    },\n    tss,\n  );\n}\n/**\n * Find tapleaf by hash, or get the signed tapleaf with the shortest path.\n */\nfunction findTapLeafToFinalize(input, inputIndex, leafHashToFinalize) {\n  if (!input.tapScriptSig || !input.tapScriptSig.length)\n    throw new Error(\n      `Can not finalize taproot input #${inputIndex}. No tapleaf script signature provided.`,\n    );\n  const tapLeaf = (input.tapLeafScript || [])\n    .sort((a, b) => a.controlBlock.length - b.controlBlock.length)\n    .find(leaf =>\n      canFinalizeLeaf(leaf, input.tapScriptSig, leafHashToFinalize),\n    );\n  if (!tapLeaf)\n    throw new Error(\n      `Can not finalize taproot input #${inputIndex}. Signature for tapleaf script not found.`,\n    );\n  return tapLeaf;\n}\n/**\n * Determines whether a TapLeafScript can be finalized.\n *\n * @param leaf - The TapLeafScript to check.\n * @param tapScriptSig - The array of TapScriptSig objects.\n * @param hash - The optional hash to compare with the leaf hash.\n * @returns A boolean indicating whether the TapLeafScript can be finalized.\n */\nfunction canFinalizeLeaf(leaf, tapScriptSig, hash) {\n  const leafHash = (0, bip341_1.tapleafHash)({\n    output: leaf.script,\n    version: leaf.leafVersion,\n  });\n  const whiteListedHash = !hash || hash.equals(leafHash);\n  return (\n    whiteListedHash &&\n    tapScriptSig.find(tss => tss.leafHash.equals(leafHash)) !== undefined\n  );\n}\n/**\n * Checks if the given PsbtInput or PsbtOutput has non-taproot fields.\n * Non-taproot fields include redeemScript, witnessScript, and bip32Derivation.\n * @param io The PsbtInput or PsbtOutput to check.\n * @returns A boolean indicating whether the given input or output has non-taproot fields.\n */\nfunction hasNonTaprootFields(io) {\n  return (\n    io &&\n    !!(\n      io.redeemScript ||\n      io.witnessScript ||\n      (io.bip32Derivation && io.bip32Derivation.length)\n    )\n  );\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.signatureBlocksAction =\n  exports.checkInputForSig =\n  exports.pubkeyInScript =\n  exports.pubkeyPositionInScript =\n  exports.witnessStackToScriptWitness =\n  exports.isP2TR =\n  exports.isP2SHScript =\n  exports.isP2WSHScript =\n  exports.isP2WPKH =\n  exports.isP2PKH =\n  exports.isP2PK =\n  exports.isP2MS =\n    void 0;\nconst varuint = require('bip174/src/lib/converter/varint');\nconst bscript = require('../script');\nconst transaction_1 = require('../transaction');\nconst crypto_1 = require('../crypto');\nconst payments = require('../payments');\nfunction isPaymentFactory(payment) {\n  return script => {\n    try {\n      payment({ output: script });\n      return true;\n    } catch (err) {\n      return false;\n    }\n  };\n}\nexports.isP2MS = isPaymentFactory(payments.p2ms);\nexports.isP2PK = isPaymentFactory(payments.p2pk);\nexports.isP2PKH = isPaymentFactory(payments.p2pkh);\nexports.isP2WPKH = isPaymentFactory(payments.p2wpkh);\nexports.isP2WSHScript = isPaymentFactory(payments.p2wsh);\nexports.isP2SHScript = isPaymentFactory(payments.p2sh);\nexports.isP2TR = isPaymentFactory(payments.p2tr);\n/**\n * Converts a witness stack to a script witness.\n * @param witness The witness stack to convert.\n * @returns The script witness as a Buffer.\n */\n/**\n * Converts a witness stack to a script witness.\n * @param witness The witness stack to convert.\n * @returns The converted script witness.\n */\nfunction witnessStackToScriptWitness(witness) {\n  let buffer = Buffer.allocUnsafe(0);\n  function writeSlice(slice) {\n    buffer = Buffer.concat([buffer, Buffer.from(slice)]);\n  }\n  function writeVarInt(i) {\n    const currentLen = buffer.length;\n    const varintLen = varuint.encodingLength(i);\n    buffer = Buffer.concat([buffer, Buffer.allocUnsafe(varintLen)]);\n    varuint.encode(i, buffer, currentLen);\n  }\n  function writeVarSlice(slice) {\n    writeVarInt(slice.length);\n    writeSlice(slice);\n  }\n  function writeVector(vector) {\n    writeVarInt(vector.length);\n    vector.forEach(writeVarSlice);\n  }\n  writeVector(witness);\n  return buffer;\n}\nexports.witnessStackToScriptWitness = witnessStackToScriptWitness;\n/**\n * Finds the position of a public key in a script.\n * @param pubkey The public key to search for.\n * @param script The script to search in.\n * @returns The index of the public key in the script, or -1 if not found.\n * @throws {Error} If there is an unknown script error.\n */\nfunction pubkeyPositionInScript(pubkey, script) {\n  const pubkeyHash = (0, crypto_1.hash160)(pubkey);\n  const pubkeyXOnly = pubkey.slice(1, 33); // slice before calling?\n  const decompiled = bscript.decompile(script);\n  if (decompiled === null) throw new Error('Unknown script error');\n  return decompiled.findIndex(element => {\n    if (typeof element === 'number') return false;\n    return (\n      element.equals(pubkey) ||\n      element.equals(pubkeyHash) ||\n      element.equals(pubkeyXOnly)\n    );\n  });\n}\nexports.pubkeyPositionInScript = pubkeyPositionInScript;\n/**\n * Checks if a public key is present in a script.\n * @param pubkey The public key to check.\n * @param script The script to search in.\n * @returns A boolean indicating whether the public key is present in the script.\n */\nfunction pubkeyInScript(pubkey, script) {\n  return pubkeyPositionInScript(pubkey, script) !== -1;\n}\nexports.pubkeyInScript = pubkeyInScript;\n/**\n * Checks if an input contains a signature for a specific action.\n * @param input - The input to check.\n * @param action - The action to check for.\n * @returns A boolean indicating whether the input contains a signature for the specified action.\n */\nfunction checkInputForSig(input, action) {\n  const pSigs = extractPartialSigs(input);\n  return pSigs.some(pSig =>\n    signatureBlocksAction(pSig, bscript.signature.decode, action),\n  );\n}\nexports.checkInputForSig = checkInputForSig;\n/**\n * Determines if a given action is allowed for a signature block.\n * @param signature - The signature block.\n * @param signatureDecodeFn - The function used to decode the signature.\n * @param action - The action to be checked.\n * @returns True if the action is allowed, false otherwise.\n */\nfunction signatureBlocksAction(signature, signatureDecodeFn, action) {\n  const { hashType } = signatureDecodeFn(signature);\n  const whitelist = [];\n  const isAnyoneCanPay =\n    hashType & transaction_1.Transaction.SIGHASH_ANYONECANPAY;\n  if (isAnyoneCanPay) whitelist.push('addInput');\n  const hashMod = hashType & 0x1f;\n  switch (hashMod) {\n    case transaction_1.Transaction.SIGHASH_ALL:\n      break;\n    case transaction_1.Transaction.SIGHASH_SINGLE:\n    case transaction_1.Transaction.SIGHASH_NONE:\n      whitelist.push('addOutput');\n      whitelist.push('setInputSequence');\n      break;\n  }\n  if (whitelist.indexOf(action) === -1) {\n    return true;\n  }\n  return false;\n}\nexports.signatureBlocksAction = signatureBlocksAction;\n/**\n * Extracts the signatures from a PsbtInput object.\n * If the input has partial signatures, it returns an array of the signatures.\n * If the input does not have partial signatures, it checks if it has a finalScriptSig or finalScriptWitness.\n * If it does, it extracts the signatures from the final scripts and returns them.\n * If none of the above conditions are met, it returns an empty array.\n *\n * @param input - The PsbtInput object from which to extract the signatures.\n * @returns An array of signatures extracted from the PsbtInput object.\n */\nfunction extractPartialSigs(input) {\n  let pSigs = [];\n  if ((input.partialSig || []).length === 0) {\n    if (!input.finalScriptSig && !input.finalScriptWitness) return [];\n    pSigs = getPsigsFromInputFinalScripts(input);\n  } else {\n    pSigs = input.partialSig;\n  }\n  return pSigs.map(p => p.signature);\n}\n/**\n * Retrieves the partial signatures (Psigs) from the input's final scripts.\n * Psigs are extracted from both the final scriptSig and final scriptWitness of the input.\n * Only canonical script signatures are considered.\n *\n * @param input - The PsbtInput object representing the input.\n * @returns An array of PartialSig objects containing the extracted Psigs.\n */\nfunction getPsigsFromInputFinalScripts(input) {\n  const scriptItems = !input.finalScriptSig\n    ? []\n    : bscript.decompile(input.finalScriptSig) || [];\n  const witnessItems = !input.finalScriptWitness\n    ? []\n    : bscript.decompile(input.finalScriptWitness) || [];\n  return scriptItems\n    .concat(witnessItems)\n    .filter(item => {\n      return Buffer.isBuffer(item) && bscript.isCanonicalScriptSignature(item);\n    })\n    .map(sig => ({ signature: sig }));\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.decode = exports.encode = exports.encodingLength = void 0;\nconst ops_1 = require('./ops');\n/**\n * Calculates the encoding length of a number used for push data in Bitcoin transactions.\n * @param i The number to calculate the encoding length for.\n * @returns The encoding length of the number.\n */\nfunction encodingLength(i) {\n  return i < ops_1.OPS.OP_PUSHDATA1 ? 1 : i <= 0xff ? 2 : i <= 0xffff ? 3 : 5;\n}\nexports.encodingLength = encodingLength;\n/**\n * Encodes a number into a buffer using a variable-length encoding scheme.\n * The encoded buffer is written starting at the specified offset.\n * Returns the size of the encoded buffer.\n *\n * @param buffer - The buffer to write the encoded data into.\n * @param num - The number to encode.\n * @param offset - The offset at which to start writing the encoded buffer.\n * @returns The size of the encoded buffer.\n */\nfunction encode(buffer, num, offset) {\n  const size = encodingLength(num);\n  // ~6 bit\n  if (size === 1) {\n    buffer.writeUInt8(num, offset);\n    // 8 bit\n  } else if (size === 2) {\n    buffer.writeUInt8(ops_1.OPS.OP_PUSHDATA1, offset);\n    buffer.writeUInt8(num, offset + 1);\n    // 16 bit\n  } else if (size === 3) {\n    buffer.writeUInt8(ops_1.OPS.OP_PUSHDATA2, offset);\n    buffer.writeUInt16LE(num, offset + 1);\n    // 32 bit\n  } else {\n    buffer.writeUInt8(ops_1.OPS.OP_PUSHDATA4, offset);\n    buffer.writeUInt32LE(num, offset + 1);\n  }\n  return size;\n}\nexports.encode = encode;\n/**\n * Decodes a buffer and returns information about the opcode, number, and size.\n * @param buffer - The buffer to decode.\n * @param offset - The offset within the buffer to start decoding.\n * @returns An object containing the opcode, number, and size, or null if decoding fails.\n */\nfunction decode(buffer, offset) {\n  const opcode = buffer.readUInt8(offset);\n  let num;\n  let size;\n  // ~6 bit\n  if (opcode < ops_1.OPS.OP_PUSHDATA1) {\n    num = opcode;\n    size = 1;\n    // 8 bit\n  } else if (opcode === ops_1.OPS.OP_PUSHDATA1) {\n    if (offset + 2 > buffer.length) return null;\n    num = buffer.readUInt8(offset + 1);\n    size = 2;\n    // 16 bit\n  } else if (opcode === ops_1.OPS.OP_PUSHDATA2) {\n    if (offset + 3 > buffer.length) return null;\n    num = buffer.readUInt16LE(offset + 1);\n    size = 3;\n    // 32 bit\n  } else {\n    if (offset + 5 > buffer.length) return null;\n    if (opcode !== ops_1.OPS.OP_PUSHDATA4) throw new Error('Unexpected opcode');\n    num = buffer.readUInt32LE(offset + 1);\n    size = 5;\n  }\n  return {\n    opcode,\n    number: num,\n    size,\n  };\n}\nexports.decode = decode;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.signature =\n  exports.number =\n  exports.isCanonicalScriptSignature =\n  exports.isDefinedHashType =\n  exports.isCanonicalPubKey =\n  exports.toStack =\n  exports.fromASM =\n  exports.toASM =\n  exports.decompile =\n  exports.compile =\n  exports.countNonPushOnlyOPs =\n  exports.isPushOnly =\n  exports.OPS =\n    void 0;\n/**\n * Script tools, including decompile, compile, toASM, fromASM, toStack, isCanonicalPubKey, isCanonicalScriptSignature\n * @packageDocumentation\n */\nconst bip66 = require('./bip66');\nconst ops_1 = require('./ops');\nObject.defineProperty(exports, 'OPS', {\n  enumerable: true,\n  get: function () {\n    return ops_1.OPS;\n  },\n});\nconst pushdata = require('./push_data');\nconst scriptNumber = require('./script_number');\nconst scriptSignature = require('./script_signature');\nconst types = require('./types');\nconst { typeforce } = types;\nconst OP_INT_BASE = ops_1.OPS.OP_RESERVED; // OP_1 - 1\nfunction isOPInt(value) {\n  return (\n    types.Number(value) &&\n    (value === ops_1.OPS.OP_0 ||\n      (value >= ops_1.OPS.OP_1 && value <= ops_1.OPS.OP_16) ||\n      value === ops_1.OPS.OP_1NEGATE)\n  );\n}\nfunction isPushOnlyChunk(value) {\n  return types.Buffer(value) || isOPInt(value);\n}\nfunction isPushOnly(value) {\n  return types.Array(value) && value.every(isPushOnlyChunk);\n}\nexports.isPushOnly = isPushOnly;\nfunction countNonPushOnlyOPs(value) {\n  return value.length - value.filter(isPushOnlyChunk).length;\n}\nexports.countNonPushOnlyOPs = countNonPushOnlyOPs;\nfunction asMinimalOP(buffer) {\n  if (buffer.length === 0) return ops_1.OPS.OP_0;\n  if (buffer.length !== 1) return;\n  if (buffer[0] >= 1 && buffer[0] <= 16) return OP_INT_BASE + buffer[0];\n  if (buffer[0] === 0x81) return ops_1.OPS.OP_1NEGATE;\n}\nfunction chunksIsBuffer(buf) {\n  return Buffer.isBuffer(buf);\n}\nfunction chunksIsArray(buf) {\n  return types.Array(buf);\n}\nfunction singleChunkIsBuffer(buf) {\n  return Buffer.isBuffer(buf);\n}\n/**\n * Compiles an array of chunks into a Buffer.\n *\n * @param chunks - The array of chunks to compile.\n * @returns The compiled Buffer.\n * @throws Error if the compilation fails.\n */\nfunction compile(chunks) {\n  // TODO: remove me\n  if (chunksIsBuffer(chunks)) return chunks;\n  typeforce(types.Array, chunks);\n  const bufferSize = chunks.reduce((accum, chunk) => {\n    // data chunk\n    if (singleChunkIsBuffer(chunk)) {\n      // adhere to BIP62.3, minimal push policy\n      if (chunk.length === 1 && asMinimalOP(chunk) !== undefined) {\n        return accum + 1;\n      }\n      return accum + pushdata.encodingLength(chunk.length) + chunk.length;\n    }\n    // opcode\n    return accum + 1;\n  }, 0.0);\n  const buffer = Buffer.allocUnsafe(bufferSize);\n  let offset = 0;\n  chunks.forEach(chunk => {\n    // data chunk\n    if (singleChunkIsBuffer(chunk)) {\n      // adhere to BIP62.3, minimal push policy\n      const opcode = asMinimalOP(chunk);\n      if (opcode !== undefined) {\n        buffer.writeUInt8(opcode, offset);\n        offset += 1;\n        return;\n      }\n      offset += pushdata.encode(buffer, chunk.length, offset);\n      chunk.copy(buffer, offset);\n      offset += chunk.length;\n      // opcode\n    } else {\n      buffer.writeUInt8(chunk, offset);\n      offset += 1;\n    }\n  });\n  if (offset !== buffer.length) throw new Error('Could not decode chunks');\n  return buffer;\n}\nexports.compile = compile;\nfunction decompile(buffer) {\n  // TODO: remove me\n  if (chunksIsArray(buffer)) return buffer;\n  typeforce(types.Buffer, buffer);\n  const chunks = [];\n  let i = 0;\n  while (i < buffer.length) {\n    const opcode = buffer[i];\n    // data chunk\n    if (opcode > ops_1.OPS.OP_0 && opcode <= ops_1.OPS.OP_PUSHDATA4) {\n      const d = pushdata.decode(buffer, i);\n      // did reading a pushDataInt fail?\n      if (d === null) return null;\n      i += d.size;\n      // attempt to read too much data?\n      if (i + d.number > buffer.length) return null;\n      const data = buffer.slice(i, i + d.number);\n      i += d.number;\n      // decompile minimally\n      const op = asMinimalOP(data);\n      if (op !== undefined) {\n        chunks.push(op);\n      } else {\n        chunks.push(data);\n      }\n      // opcode\n    } else {\n      chunks.push(opcode);\n      i += 1;\n    }\n  }\n  return chunks;\n}\nexports.decompile = decompile;\n/**\n * Converts the given chunks into an ASM (Assembly) string representation.\n * If the chunks parameter is a Buffer, it will be decompiled into a Stack before conversion.\n * @param chunks - The chunks to convert into ASM.\n * @returns The ASM string representation of the chunks.\n */\nfunction toASM(chunks) {\n  if (chunksIsBuffer(chunks)) {\n    chunks = decompile(chunks);\n  }\n  if (!chunks) {\n    throw new Error('Could not convert invalid chunks to ASM');\n  }\n  return chunks\n    .map(chunk => {\n      // data?\n      if (singleChunkIsBuffer(chunk)) {\n        const op = asMinimalOP(chunk);\n        if (op === undefined) return chunk.toString('hex');\n        chunk = op;\n      }\n      // opcode!\n      return ops_1.REVERSE_OPS[chunk];\n    })\n    .join(' ');\n}\nexports.toASM = toASM;\n/**\n * Converts an ASM string to a Buffer.\n * @param asm The ASM string to convert.\n * @returns The converted Buffer.\n */\nfunction fromASM(asm) {\n  typeforce(types.String, asm);\n  return compile(\n    asm.split(' ').map(chunkStr => {\n      // opcode?\n      if (ops_1.OPS[chunkStr] !== undefined) return ops_1.OPS[chunkStr];\n      typeforce(types.Hex, chunkStr);\n      // data!\n      return Buffer.from(chunkStr, 'hex');\n    }),\n  );\n}\nexports.fromASM = fromASM;\n/**\n * Converts the given chunks into a stack of buffers.\n *\n * @param chunks - The chunks to convert.\n * @returns The stack of buffers.\n */\nfunction toStack(chunks) {\n  chunks = decompile(chunks);\n  typeforce(isPushOnly, chunks);\n  return chunks.map(op => {\n    if (singleChunkIsBuffer(op)) return op;\n    if (op === ops_1.OPS.OP_0) return Buffer.allocUnsafe(0);\n    return scriptNumber.encode(op - OP_INT_BASE);\n  });\n}\nexports.toStack = toStack;\nfunction isCanonicalPubKey(buffer) {\n  return types.isPoint(buffer);\n}\nexports.isCanonicalPubKey = isCanonicalPubKey;\nfunction isDefinedHashType(hashType) {\n  const hashTypeMod = hashType & ~0x80;\n  // return hashTypeMod > SIGHASH_ALL && hashTypeMod < SIGHASH_SINGLE\n  return hashTypeMod > 0x00 && hashTypeMod < 0x04;\n}\nexports.isDefinedHashType = isDefinedHashType;\nfunction isCanonicalScriptSignature(buffer) {\n  if (!Buffer.isBuffer(buffer)) return false;\n  if (!isDefinedHashType(buffer[buffer.length - 1])) return false;\n  return bip66.check(buffer.slice(0, -1));\n}\nexports.isCanonicalScriptSignature = isCanonicalScriptSignature;\nexports.number = scriptNumber;\nexports.signature = scriptSignature;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.encode = exports.decode = void 0;\n/**\n * Decodes a script number from a buffer.\n *\n * @param buffer - The buffer containing the script number.\n * @param maxLength - The maximum length of the script number. Defaults to 4.\n * @param minimal - Whether the script number should be minimal. Defaults to true.\n * @returns The decoded script number.\n * @throws {TypeError} If the script number overflows the maximum length.\n * @throws {Error} If the script number is not minimally encoded when minimal is true.\n */\nfunction decode(buffer, maxLength, minimal) {\n  maxLength = maxLength || 4;\n  minimal = minimal === undefined ? true : minimal;\n  const length = buffer.length;\n  if (length === 0) return 0;\n  if (length > maxLength) throw new TypeError('Script number overflow');\n  if (minimal) {\n    if ((buffer[length - 1] & 0x7f) === 0) {\n      if (length <= 1 || (buffer[length - 2] & 0x80) === 0)\n        throw new Error('Non-minimally encoded script number');\n    }\n  }\n  // 40-bit\n  if (length === 5) {\n    const a = buffer.readUInt32LE(0);\n    const b = buffer.readUInt8(4);\n    if (b & 0x80) return -((b & ~0x80) * 0x100000000 + a);\n    return b * 0x100000000 + a;\n  }\n  // 32-bit / 24-bit / 16-bit / 8-bit\n  let result = 0;\n  for (let i = 0; i < length; ++i) {\n    result |= buffer[i] << (8 * i);\n  }\n  if (buffer[length - 1] & 0x80)\n    return -(result & ~(0x80 << (8 * (length - 1))));\n  return result;\n}\nexports.decode = decode;\nfunction scriptNumSize(i) {\n  return i > 0x7fffffff\n    ? 5\n    : i > 0x7fffff\n    ? 4\n    : i > 0x7fff\n    ? 3\n    : i > 0x7f\n    ? 2\n    : i > 0x00\n    ? 1\n    : 0;\n}\n/**\n * Encodes a number into a Buffer using a specific format.\n *\n * @param _number - The number to encode.\n * @returns The encoded number as a Buffer.\n */\nfunction encode(_number) {\n  let value = Math.abs(_number);\n  const size = scriptNumSize(value);\n  const buffer = Buffer.allocUnsafe(size);\n  const negative = _number < 0;\n  for (let i = 0; i < size; ++i) {\n    buffer.writeUInt8(value & 0xff, i);\n    value >>= 8;\n  }\n  if (buffer[size - 1] & 0x80) {\n    buffer.writeUInt8(negative ? 0x80 : 0x00, size - 1);\n  } else if (negative) {\n    buffer[size - 1] |= 0x80;\n  }\n  return buffer;\n}\nexports.encode = encode;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.encode = exports.decode = void 0;\nconst bip66 = require('./bip66');\nconst script_1 = require('./script');\nconst types = require('./types');\nconst { typeforce } = types;\nconst ZERO = Buffer.alloc(1, 0);\n/**\n * Converts a buffer to a DER-encoded buffer.\n * @param x - The buffer to be converted.\n * @returns The DER-encoded buffer.\n */\nfunction toDER(x) {\n  let i = 0;\n  while (x[i] === 0) ++i;\n  if (i === x.length) return ZERO;\n  x = x.slice(i);\n  if (x[0] & 0x80) return Buffer.concat([ZERO, x], 1 + x.length);\n  return x;\n}\n/**\n * Converts a DER-encoded signature to a buffer.\n * If the first byte of the input buffer is 0x00, it is skipped.\n * The resulting buffer is 32 bytes long, filled with zeros if necessary.\n * @param x - The DER-encoded signature.\n * @returns The converted buffer.\n */\nfunction fromDER(x) {\n  if (x[0] === 0x00) x = x.slice(1);\n  const buffer = Buffer.alloc(32, 0);\n  const bstart = Math.max(0, 32 - x.length);\n  x.copy(buffer, bstart);\n  return buffer;\n}\n// BIP62: 1 byte hashType flag (only 0x01, 0x02, 0x03, 0x81, 0x82 and 0x83 are allowed)\n/**\n * Decodes a buffer into a ScriptSignature object.\n * @param buffer - The buffer to decode.\n * @returns The decoded ScriptSignature object.\n * @throws Error if the hashType is invalid.\n */\nfunction decode(buffer) {\n  const hashType = buffer.readUInt8(buffer.length - 1);\n  if (!(0, script_1.isDefinedHashType)(hashType)) {\n    throw new Error('Invalid hashType ' + hashType);\n  }\n  const decoded = bip66.decode(buffer.slice(0, -1));\n  const r = fromDER(decoded.r);\n  const s = fromDER(decoded.s);\n  const signature = Buffer.concat([r, s], 64);\n  return { signature, hashType };\n}\nexports.decode = decode;\n/**\n * Encodes a signature and hash type into a buffer.\n * @param signature - The signature to encode.\n * @param hashType - The hash type to encode.\n * @returns The encoded buffer.\n * @throws Error if the hashType is invalid.\n */\nfunction encode(signature, hashType) {\n  typeforce(\n    {\n      signature: types.BufferN(64),\n      hashType: types.UInt8,\n    },\n    { signature, hashType },\n  );\n  if (!(0, script_1.isDefinedHashType)(hashType)) {\n    throw new Error('Invalid hashType ' + hashType);\n  }\n  const hashTypeBuffer = Buffer.allocUnsafe(1);\n  hashTypeBuffer.writeUInt8(hashType, 0);\n  const r = toDER(signature.slice(0, 32));\n  const s = toDER(signature.slice(32, 64));\n  return Buffer.concat([bip66.encode(r, s), hashTypeBuffer]);\n}\nexports.encode = encode;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.Transaction = void 0;\nconst bufferutils_1 = require('./bufferutils');\nconst bcrypto = require('./crypto');\nconst bscript = require('./script');\nconst script_1 = require('./script');\nconst types = require('./types');\nconst { typeforce } = types;\nfunction varSliceSize(someScript) {\n  const length = someScript.length;\n  return bufferutils_1.varuint.encodingLength(length) + length;\n}\nfunction vectorSize(someVector) {\n  const length = someVector.length;\n  return (\n    bufferutils_1.varuint.encodingLength(length) +\n    someVector.reduce((sum, witness) => {\n      return sum + varSliceSize(witness);\n    }, 0)\n  );\n}\nconst EMPTY_BUFFER = Buffer.allocUnsafe(0);\nconst EMPTY_WITNESS = [];\nconst ZERO = Buffer.from(\n  '0000000000000000000000000000000000000000000000000000000000000000',\n  'hex',\n);\nconst ONE = Buffer.from(\n  '0000000000000000000000000000000000000000000000000000000000000001',\n  'hex',\n);\nconst VALUE_UINT64_MAX = Buffer.from('ffffffffffffffff', 'hex');\nconst BLANK_OUTPUT = {\n  script: EMPTY_BUFFER,\n  valueBuffer: VALUE_UINT64_MAX,\n};\nfunction isOutput(out) {\n  return out.value !== undefined;\n}\n/**\n * Represents a Bitcoin transaction.\n */\nclass Transaction {\n  constructor() {\n    this.version = 1;\n    this.locktime = 0;\n    this.ins = [];\n    this.outs = [];\n  }\n  static fromBuffer(buffer, _NO_STRICT) {\n    const bufferReader = new bufferutils_1.BufferReader(buffer);\n    const tx = new Transaction();\n    tx.version = bufferReader.readInt32();\n    const marker = bufferReader.readUInt8();\n    const flag = bufferReader.readUInt8();\n    let hasWitnesses = false;\n    if (\n      marker === Transaction.ADVANCED_TRANSACTION_MARKER &&\n      flag === Transaction.ADVANCED_TRANSACTION_FLAG\n    ) {\n      hasWitnesses = true;\n    } else {\n      bufferReader.offset -= 2;\n    }\n    const vinLen = bufferReader.readVarInt();\n    for (let i = 0; i < vinLen; ++i) {\n      tx.ins.push({\n        hash: bufferReader.readSlice(32),\n        index: bufferReader.readUInt32(),\n        script: bufferReader.readVarSlice(),\n        sequence: bufferReader.readUInt32(),\n        witness: EMPTY_WITNESS,\n      });\n    }\n    const voutLen = bufferReader.readVarInt();\n    for (let i = 0; i < voutLen; ++i) {\n      tx.outs.push({\n        value: bufferReader.readUInt64(),\n        script: bufferReader.readVarSlice(),\n      });\n    }\n    if (hasWitnesses) {\n      for (let i = 0; i < vinLen; ++i) {\n        tx.ins[i].witness = bufferReader.readVector();\n      }\n      // was this pointless?\n      if (!tx.hasWitnesses())\n        throw new Error('Transaction has superfluous witness data');\n    }\n    tx.locktime = bufferReader.readUInt32();\n    if (_NO_STRICT) return tx;\n    if (bufferReader.offset !== buffer.length)\n      throw new Error('Transaction has unexpected data');\n    return tx;\n  }\n  static fromHex(hex) {\n    return Transaction.fromBuffer(Buffer.from(hex, 'hex'), false);\n  }\n  static isCoinbaseHash(buffer) {\n    typeforce(types.Hash256bit, buffer);\n    for (let i = 0; i < 32; ++i) {\n      if (buffer[i] !== 0) return false;\n    }\n    return true;\n  }\n  isCoinbase() {\n    return (\n      this.ins.length === 1 && Transaction.isCoinbaseHash(this.ins[0].hash)\n    );\n  }\n  addInput(hash, index, sequence, scriptSig) {\n    typeforce(\n      types.tuple(\n        types.Hash256bit,\n        types.UInt32,\n        types.maybe(types.UInt32),\n        types.maybe(types.Buffer),\n      ),\n      arguments,\n    );\n    if (types.Null(sequence)) {\n      sequence = Transaction.DEFAULT_SEQUENCE;\n    }\n    // Add the input and return the input's index\n    return (\n      this.ins.push({\n        hash,\n        index,\n        script: scriptSig || EMPTY_BUFFER,\n        sequence: sequence,\n        witness: EMPTY_WITNESS,\n      }) - 1\n    );\n  }\n  addOutput(scriptPubKey, value) {\n    typeforce(types.tuple(types.Buffer, types.Satoshi), arguments);\n    // Add the output and return the output's index\n    return (\n      this.outs.push({\n        script: scriptPubKey,\n        value,\n      }) - 1\n    );\n  }\n  hasWitnesses() {\n    return this.ins.some(x => {\n      return x.witness.length !== 0;\n    });\n  }\n  stripWitnesses() {\n    this.ins.forEach(input => {\n      input.witness = EMPTY_WITNESS; // Set witness data to an empty array\n    });\n  }\n  weight() {\n    const base = this.byteLength(false);\n    const total = this.byteLength(true);\n    return base * 3 + total;\n  }\n  virtualSize() {\n    return Math.ceil(this.weight() / 4);\n  }\n  byteLength(_ALLOW_WITNESS = true) {\n    const hasWitnesses = _ALLOW_WITNESS && this.hasWitnesses();\n    return (\n      (hasWitnesses ? 10 : 8) +\n      bufferutils_1.varuint.encodingLength(this.ins.length) +\n      bufferutils_1.varuint.encodingLength(this.outs.length) +\n      this.ins.reduce((sum, input) => {\n        return sum + 40 + varSliceSize(input.script);\n      }, 0) +\n      this.outs.reduce((sum, output) => {\n        return sum + 8 + varSliceSize(output.script);\n      }, 0) +\n      (hasWitnesses\n        ? this.ins.reduce((sum, input) => {\n            return sum + vectorSize(input.witness);\n          }, 0)\n        : 0)\n    );\n  }\n  clone() {\n    const newTx = new Transaction();\n    newTx.version = this.version;\n    newTx.locktime = this.locktime;\n    newTx.ins = this.ins.map(txIn => {\n      return {\n        hash: txIn.hash,\n        index: txIn.index,\n        script: txIn.script,\n        sequence: txIn.sequence,\n        witness: txIn.witness,\n      };\n    });\n    newTx.outs = this.outs.map(txOut => {\n      return {\n        script: txOut.script,\n        value: txOut.value,\n      };\n    });\n    return newTx;\n  }\n  /**\n   * Hash transaction for signing a specific input.\n   *\n   * Bitcoin uses a different hash for each signed transaction input.\n   * This method copies the transaction, makes the necessary changes based on the\n   * hashType, and then hashes the result.\n   * This hash can then be used to sign the provided transaction input.\n   */\n  hashForSignature(inIndex, prevOutScript, hashType) {\n    typeforce(\n      types.tuple(types.UInt32, types.Buffer, /* types.UInt8 */ types.Number),\n      arguments,\n    );\n    // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L29\n    if (inIndex >= this.ins.length) return ONE;\n    // ignore OP_CODESEPARATOR\n    const ourScript = bscript.compile(\n      bscript.decompile(prevOutScript).filter(x => {\n        return x !== script_1.OPS.OP_CODESEPARATOR;\n      }),\n    );\n    const txTmp = this.clone();\n    // SIGHASH_NONE: ignore all outputs? (wildcard payee)\n    if ((hashType & 0x1f) === Transaction.SIGHASH_NONE) {\n      txTmp.outs = [];\n      // ignore sequence numbers (except at inIndex)\n      txTmp.ins.forEach((input, i) => {\n        if (i === inIndex) return;\n        input.sequence = 0;\n      });\n      // SIGHASH_SINGLE: ignore all outputs, except at the same index?\n    } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE) {\n      // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L60\n      if (inIndex >= this.outs.length) return ONE;\n      // truncate outputs after\n      txTmp.outs.length = inIndex + 1;\n      // \"blank\" outputs before\n      for (let i = 0; i < inIndex; i++) {\n        txTmp.outs[i] = BLANK_OUTPUT;\n      }\n      // ignore sequence numbers (except at inIndex)\n      txTmp.ins.forEach((input, y) => {\n        if (y === inIndex) return;\n        input.sequence = 0;\n      });\n    }\n    // SIGHASH_ANYONECANPAY: ignore inputs entirely?\n    if (hashType & Transaction.SIGHASH_ANYONECANPAY) {\n      txTmp.ins = [txTmp.ins[inIndex]];\n      txTmp.ins[0].script = ourScript;\n      // SIGHASH_ALL: only ignore input scripts\n    } else {\n      // \"blank\" others input scripts\n      txTmp.ins.forEach(input => {\n        input.script = EMPTY_BUFFER;\n      });\n      txTmp.ins[inIndex].script = ourScript;\n    }\n    // serialize and hash\n    const buffer = Buffer.allocUnsafe(txTmp.byteLength(false) + 4);\n    buffer.writeInt32LE(hashType, buffer.length - 4);\n    txTmp.__toBuffer(buffer, 0, false);\n    return bcrypto.hash256(buffer);\n  }\n  hashForWitnessV1(inIndex, prevOutScripts, values, hashType, leafHash, annex) {\n    // https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#common-signature-message\n    typeforce(\n      types.tuple(\n        types.UInt32,\n        typeforce.arrayOf(types.Buffer),\n        typeforce.arrayOf(types.Satoshi),\n        types.UInt32,\n      ),\n      arguments,\n    );\n    if (\n      values.length !== this.ins.length ||\n      prevOutScripts.length !== this.ins.length\n    ) {\n      throw new Error('Must supply prevout script and value for all inputs');\n    }\n    const outputType =\n      hashType === Transaction.SIGHASH_DEFAULT\n        ? Transaction.SIGHASH_ALL\n        : hashType & Transaction.SIGHASH_OUTPUT_MASK;\n    const inputType = hashType & Transaction.SIGHASH_INPUT_MASK;\n    const isAnyoneCanPay = inputType === Transaction.SIGHASH_ANYONECANPAY;\n    const isNone = outputType === Transaction.SIGHASH_NONE;\n    const isSingle = outputType === Transaction.SIGHASH_SINGLE;\n    let hashPrevouts = EMPTY_BUFFER;\n    let hashAmounts = EMPTY_BUFFER;\n    let hashScriptPubKeys = EMPTY_BUFFER;\n    let hashSequences = EMPTY_BUFFER;\n    let hashOutputs = EMPTY_BUFFER;\n    if (!isAnyoneCanPay) {\n      let bufferWriter = bufferutils_1.BufferWriter.withCapacity(\n        36 * this.ins.length,\n      );\n      this.ins.forEach(txIn => {\n        bufferWriter.writeSlice(txIn.hash);\n        bufferWriter.writeUInt32(txIn.index);\n      });\n      hashPrevouts = bcrypto.sha256(bufferWriter.end());\n      bufferWriter = bufferutils_1.BufferWriter.withCapacity(\n        8 * this.ins.length,\n      );\n      values.forEach(value => bufferWriter.writeUInt64(value));\n      hashAmounts = bcrypto.sha256(bufferWriter.end());\n      bufferWriter = bufferutils_1.BufferWriter.withCapacity(\n        prevOutScripts.map(varSliceSize).reduce((a, b) => a + b),\n      );\n      prevOutScripts.forEach(prevOutScript =>\n        bufferWriter.writeVarSlice(prevOutScript),\n      );\n      hashScriptPubKeys = bcrypto.sha256(bufferWriter.end());\n      bufferWriter = bufferutils_1.BufferWriter.withCapacity(\n        4 * this.ins.length,\n      );\n      this.ins.forEach(txIn => bufferWriter.writeUInt32(txIn.sequence));\n      hashSequences = bcrypto.sha256(bufferWriter.end());\n    }\n    if (!(isNone || isSingle)) {\n      const txOutsSize = this.outs\n        .map(output => 8 + varSliceSize(output.script))\n        .reduce((a, b) => a + b);\n      const bufferWriter = bufferutils_1.BufferWriter.withCapacity(txOutsSize);\n      this.outs.forEach(out => {\n        bufferWriter.writeUInt64(out.value);\n        bufferWriter.writeVarSlice(out.script);\n      });\n      hashOutputs = bcrypto.sha256(bufferWriter.end());\n    } else if (isSingle && inIndex < this.outs.length) {\n      const output = this.outs[inIndex];\n      const bufferWriter = bufferutils_1.BufferWriter.withCapacity(\n        8 + varSliceSize(output.script),\n      );\n      bufferWriter.writeUInt64(output.value);\n      bufferWriter.writeVarSlice(output.script);\n      hashOutputs = bcrypto.sha256(bufferWriter.end());\n    }\n    const spendType = (leafHash ? 2 : 0) + (annex ? 1 : 0);\n    // Length calculation from:\n    // https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#cite_note-14\n    // With extension from:\n    // https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki#signature-validation\n    const sigMsgSize =\n      174 -\n      (isAnyoneCanPay ? 49 : 0) -\n      (isNone ? 32 : 0) +\n      (annex ? 32 : 0) +\n      (leafHash ? 37 : 0);\n    const sigMsgWriter = bufferutils_1.BufferWriter.withCapacity(sigMsgSize);\n    sigMsgWriter.writeUInt8(hashType);\n    // Transaction\n    sigMsgWriter.writeInt32(this.version);\n    sigMsgWriter.writeUInt32(this.locktime);\n    sigMsgWriter.writeSlice(hashPrevouts);\n    sigMsgWriter.writeSlice(hashAmounts);\n    sigMsgWriter.writeSlice(hashScriptPubKeys);\n    sigMsgWriter.writeSlice(hashSequences);\n    if (!(isNone || isSingle)) {\n      sigMsgWriter.writeSlice(hashOutputs);\n    }\n    // Input\n    sigMsgWriter.writeUInt8(spendType);\n    if (isAnyoneCanPay) {\n      const input = this.ins[inIndex];\n      sigMsgWriter.writeSlice(input.hash);\n      sigMsgWriter.writeUInt32(input.index);\n      sigMsgWriter.writeUInt64(values[inIndex]);\n      sigMsgWriter.writeVarSlice(prevOutScripts[inIndex]);\n      sigMsgWriter.writeUInt32(input.sequence);\n    } else {\n      sigMsgWriter.writeUInt32(inIndex);\n    }\n    if (annex) {\n      const bufferWriter = bufferutils_1.BufferWriter.withCapacity(\n        varSliceSize(annex),\n      );\n      bufferWriter.writeVarSlice(annex);\n      sigMsgWriter.writeSlice(bcrypto.sha256(bufferWriter.end()));\n    }\n    // Output\n    if (isSingle) {\n      sigMsgWriter.writeSlice(hashOutputs);\n    }\n    // BIP342 extension\n    if (leafHash) {\n      sigMsgWriter.writeSlice(leafHash);\n      sigMsgWriter.writeUInt8(0);\n      sigMsgWriter.writeUInt32(0xffffffff);\n    }\n    // Extra zero byte because:\n    // https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#cite_note-19\n    return bcrypto.taggedHash(\n      'TapSighash',\n      Buffer.concat([Buffer.from([0x00]), sigMsgWriter.end()]),\n    );\n  }\n  hashForWitnessV0(inIndex, prevOutScript, value, hashType) {\n    typeforce(\n      types.tuple(types.UInt32, types.Buffer, types.Satoshi, types.UInt32),\n      arguments,\n    );\n    let tbuffer = Buffer.from([]);\n    let bufferWriter;\n    let hashOutputs = ZERO;\n    let hashPrevouts = ZERO;\n    let hashSequence = ZERO;\n    if (!(hashType & Transaction.SIGHASH_ANYONECANPAY)) {\n      tbuffer = Buffer.allocUnsafe(36 * this.ins.length);\n      bufferWriter = new bufferutils_1.BufferWriter(tbuffer, 0);\n      this.ins.forEach(txIn => {\n        bufferWriter.writeSlice(txIn.hash);\n        bufferWriter.writeUInt32(txIn.index);\n      });\n      hashPrevouts = bcrypto.hash256(tbuffer);\n    }\n    if (\n      !(hashType & Transaction.SIGHASH_ANYONECANPAY) &&\n      (hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&\n      (hashType & 0x1f) !== Transaction.SIGHASH_NONE\n    ) {\n      tbuffer = Buffer.allocUnsafe(4 * this.ins.length);\n      bufferWriter = new bufferutils_1.BufferWriter(tbuffer, 0);\n      this.ins.forEach(txIn => {\n        bufferWriter.writeUInt32(txIn.sequence);\n      });\n      hashSequence = bcrypto.hash256(tbuffer);\n    }\n    if (\n      (hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&\n      (hashType & 0x1f) !== Transaction.SIGHASH_NONE\n    ) {\n      const txOutsSize = this.outs.reduce((sum, output) => {\n        return sum + 8 + varSliceSize(output.script);\n      }, 0);\n      tbuffer = Buffer.allocUnsafe(txOutsSize);\n      bufferWriter = new bufferutils_1.BufferWriter(tbuffer, 0);\n      this.outs.forEach(out => {\n        bufferWriter.writeUInt64(out.value);\n        bufferWriter.writeVarSlice(out.script);\n      });\n      hashOutputs = bcrypto.hash256(tbuffer);\n    } else if (\n      (hashType & 0x1f) === Transaction.SIGHASH_SINGLE &&\n      inIndex < this.outs.length\n    ) {\n      const output = this.outs[inIndex];\n      tbuffer = Buffer.allocUnsafe(8 + varSliceSize(output.script));\n      bufferWriter = new bufferutils_1.BufferWriter(tbuffer, 0);\n      bufferWriter.writeUInt64(output.value);\n      bufferWriter.writeVarSlice(output.script);\n      hashOutputs = bcrypto.hash256(tbuffer);\n    }\n    tbuffer = Buffer.allocUnsafe(156 + varSliceSize(prevOutScript));\n    bufferWriter = new bufferutils_1.BufferWriter(tbuffer, 0);\n    const input = this.ins[inIndex];\n    bufferWriter.writeInt32(this.version);\n    bufferWriter.writeSlice(hashPrevouts);\n    bufferWriter.writeSlice(hashSequence);\n    bufferWriter.writeSlice(input.hash);\n    bufferWriter.writeUInt32(input.index);\n    bufferWriter.writeVarSlice(prevOutScript);\n    bufferWriter.writeUInt64(value);\n    bufferWriter.writeUInt32(input.sequence);\n    bufferWriter.writeSlice(hashOutputs);\n    bufferWriter.writeUInt32(this.locktime);\n    bufferWriter.writeUInt32(hashType);\n    return bcrypto.hash256(tbuffer);\n  }\n  getHash(forWitness) {\n    // wtxid for coinbase is always 32 bytes of 0x00\n    if (forWitness && this.isCoinbase()) return Buffer.alloc(32, 0);\n    return bcrypto.hash256(this.__toBuffer(undefined, undefined, forWitness));\n  }\n  getId() {\n    // transaction hash's are displayed in reverse order\n    return (0, bufferutils_1.reverseBuffer)(this.getHash(false)).toString(\n      'hex',\n    );\n  }\n  toBuffer(buffer, initialOffset) {\n    return this.__toBuffer(buffer, initialOffset, true);\n  }\n  toHex() {\n    return this.toBuffer(undefined, undefined).toString('hex');\n  }\n  setInputScript(index, scriptSig) {\n    typeforce(types.tuple(types.Number, types.Buffer), arguments);\n    this.ins[index].script = scriptSig;\n  }\n  setWitness(index, witness) {\n    typeforce(types.tuple(types.Number, [types.Buffer]), arguments);\n    this.ins[index].witness = witness;\n  }\n  __toBuffer(buffer, initialOffset, _ALLOW_WITNESS = false) {\n    if (!buffer) buffer = Buffer.allocUnsafe(this.byteLength(_ALLOW_WITNESS));\n    const bufferWriter = new bufferutils_1.BufferWriter(\n      buffer,\n      initialOffset || 0,\n    );\n    bufferWriter.writeInt32(this.version);\n    const hasWitnesses = _ALLOW_WITNESS && this.hasWitnesses();\n    if (hasWitnesses) {\n      bufferWriter.writeUInt8(Transaction.ADVANCED_TRANSACTION_MARKER);\n      bufferWriter.writeUInt8(Transaction.ADVANCED_TRANSACTION_FLAG);\n    }\n    bufferWriter.writeVarInt(this.ins.length);\n    this.ins.forEach(txIn => {\n      bufferWriter.writeSlice(txIn.hash);\n      bufferWriter.writeUInt32(txIn.index);\n      bufferWriter.writeVarSlice(txIn.script);\n      bufferWriter.writeUInt32(txIn.sequence);\n    });\n    bufferWriter.writeVarInt(this.outs.length);\n    this.outs.forEach(txOut => {\n      if (isOutput(txOut)) {\n        bufferWriter.writeUInt64(txOut.value);\n      } else {\n        bufferWriter.writeSlice(txOut.valueBuffer);\n      }\n      bufferWriter.writeVarSlice(txOut.script);\n    });\n    if (hasWitnesses) {\n      this.ins.forEach(input => {\n        bufferWriter.writeVector(input.witness);\n      });\n    }\n    bufferWriter.writeUInt32(this.locktime);\n    // avoid slicing unless necessary\n    if (initialOffset !== undefined)\n      return buffer.slice(initialOffset, bufferWriter.offset);\n    return buffer;\n  }\n}\nexports.Transaction = Transaction;\nTransaction.DEFAULT_SEQUENCE = 0xffffffff;\nTransaction.SIGHASH_DEFAULT = 0x00;\nTransaction.SIGHASH_ALL = 0x01;\nTransaction.SIGHASH_NONE = 0x02;\nTransaction.SIGHASH_SINGLE = 0x03;\nTransaction.SIGHASH_ANYONECANPAY = 0x80;\nTransaction.SIGHASH_OUTPUT_MASK = 0x03;\nTransaction.SIGHASH_INPUT_MASK = 0x80;\nTransaction.ADVANCED_TRANSACTION_MARKER = 0x00;\nTransaction.ADVANCED_TRANSACTION_FLAG = 0x01;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.oneOf =\n  exports.Null =\n  exports.BufferN =\n  exports.Function =\n  exports.UInt32 =\n  exports.UInt8 =\n  exports.tuple =\n  exports.maybe =\n  exports.Hex =\n  exports.Buffer =\n  exports.String =\n  exports.Boolean =\n  exports.Array =\n  exports.Number =\n  exports.Hash256bit =\n  exports.Hash160bit =\n  exports.Buffer256bit =\n  exports.isTaptree =\n  exports.isTapleaf =\n  exports.TAPLEAF_VERSION_MASK =\n  exports.Satoshi =\n  exports.isPoint =\n  exports.stacksEqual =\n  exports.typeforce =\n    void 0;\nconst buffer_1 = require('buffer');\nexports.typeforce = require('typeforce');\nconst ZERO32 = buffer_1.Buffer.alloc(32, 0);\nconst EC_P = buffer_1.Buffer.from(\n  'fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f',\n  'hex',\n);\n/**\n * Checks if two arrays of Buffers are equal.\n * @param a - The first array of Buffers.\n * @param b - The second array of Buffers.\n * @returns True if the arrays are equal, false otherwise.\n */\nfunction stacksEqual(a, b) {\n  if (a.length !== b.length) return false;\n  return a.every((x, i) => {\n    return x.equals(b[i]);\n  });\n}\nexports.stacksEqual = stacksEqual;\n/**\n * Checks if the given value is a valid elliptic curve point.\n * @param p - The value to check.\n * @returns True if the value is a valid elliptic curve point, false otherwise.\n */\nfunction isPoint(p) {\n  if (!buffer_1.Buffer.isBuffer(p)) return false;\n  if (p.length < 33) return false;\n  const t = p[0];\n  const x = p.slice(1, 33);\n  if (x.compare(ZERO32) === 0) return false;\n  if (x.compare(EC_P) >= 0) return false;\n  if ((t === 0x02 || t === 0x03) && p.length === 33) {\n    return true;\n  }\n  const y = p.slice(33);\n  if (y.compare(ZERO32) === 0) return false;\n  if (y.compare(EC_P) >= 0) return false;\n  if (t === 0x04 && p.length === 65) return true;\n  return false;\n}\nexports.isPoint = isPoint;\nconst SATOSHI_MAX = 21 * 1e14;\nfunction Satoshi(value) {\n  return exports.typeforce.UInt53(value) && value <= SATOSHI_MAX;\n}\nexports.Satoshi = Satoshi;\nexports.TAPLEAF_VERSION_MASK = 0xfe;\nfunction isTapleaf(o) {\n  if (!o || !('output' in o)) return false;\n  if (!buffer_1.Buffer.isBuffer(o.output)) return false;\n  if (o.version !== undefined)\n    return (o.version & exports.TAPLEAF_VERSION_MASK) === o.version;\n  return true;\n}\nexports.isTapleaf = isTapleaf;\nfunction isTaptree(scriptTree) {\n  if (!(0, exports.Array)(scriptTree)) return isTapleaf(scriptTree);\n  if (scriptTree.length !== 2) return false;\n  return scriptTree.every(t => isTaptree(t));\n}\nexports.isTaptree = isTaptree;\nexports.Buffer256bit = exports.typeforce.BufferN(32);\nexports.Hash160bit = exports.typeforce.BufferN(20);\nexports.Hash256bit = exports.typeforce.BufferN(32);\nexports.Number = exports.typeforce.Number;\nexports.Array = exports.typeforce.Array;\nexports.Boolean = exports.typeforce.Boolean;\nexports.String = exports.typeforce.String;\nexports.Buffer = exports.typeforce.Buffer;\nexports.Hex = exports.typeforce.Hex;\nexports.maybe = exports.typeforce.maybe;\nexports.tuple = exports.typeforce.tuple;\nexports.UInt8 = exports.typeforce.UInt8;\nexports.UInt32 = exports.typeforce.UInt32;\nexports.Function = exports.typeforce.Function;\nexports.BufferN = exports.typeforce.BufferN;\nexports.Null = exports.typeforce.Null;\nexports.oneOf = exports.typeforce.oneOf;\nconst bs58check = require('bs58check')\nconst bech32 = require('bech32')\nconst bufferEquals = require('buffer-equals')\nconst createHash = require('create-hash')\nconst secp256k1 = require('secp256k1')\nconst varuint = require('varuint-bitcoin')\n\nconst SEGWIT_TYPES = {\n  P2WPKH: 'p2wpkh',\n  P2SH_P2WPKH: 'p2sh(p2wpkh)'\n}\n\nfunction sha256 (b) {\n  return createHash('sha256')\n    .update(b)\n    .digest()\n}\nfunction hash256 (buffer) {\n  return sha256(sha256(buffer))\n}\nfunction hash160 (buffer) {\n  return createHash('ripemd160')\n    .update(sha256(buffer))\n    .digest()\n}\n\nfunction encodeSignature (signature, recovery, compressed, segwitType) {\n  if (segwitType !== undefined) {\n    recovery += 8\n    if (segwitType === SEGWIT_TYPES.P2WPKH) recovery += 4\n  } else {\n    if (compressed) recovery += 4\n  }\n  return Buffer.concat([Buffer.alloc(1, recovery + 27), signature])\n}\n\nfunction decodeSignature (buffer) {\n  if (buffer.length !== 65) throw new Error('Invalid signature length')\n\n  const flagByte = buffer.readUInt8(0) - 27\n  if (flagByte > 15 || flagByte < 0) {\n    throw new Error('Invalid signature parameter')\n  }\n\n  return {\n    compressed: !!(flagByte & 12),\n    segwitType: !(flagByte & 8)\n      ? null\n      : !(flagByte & 4)\n        ? SEGWIT_TYPES.P2SH_P2WPKH\n        : SEGWIT_TYPES.P2WPKH,\n    recovery: flagByte & 3,\n    signature: buffer.slice(1)\n  }\n}\n\nfunction magicHash (message, messagePrefix) {\n  messagePrefix = messagePrefix || '\\u0018Bitcoin Signed Message:\\n'\n  if (!Buffer.isBuffer(messagePrefix)) {\n    messagePrefix = Buffer.from(messagePrefix, 'utf8')\n  }\n  if (!Buffer.isBuffer(message)) {\n    message = Buffer.from(message, 'utf8')\n  }\n  const messageVISize = varuint.encodingLength(message.length)\n  const buffer = Buffer.allocUnsafe(\n    messagePrefix.length + messageVISize + message.length\n  )\n  messagePrefix.copy(buffer, 0)\n  varuint.encode(message.length, buffer, messagePrefix.length)\n  message.copy(buffer, messagePrefix.length + messageVISize)\n  return hash256(buffer)\n}\n\nfunction prepareSign (\n  messagePrefixArg,\n  sigOptions\n) {\n  if (typeof messagePrefixArg === 'object' && sigOptions === undefined) {\n    sigOptions = messagePrefixArg\n    messagePrefixArg = undefined\n  }\n  let { segwitType, extraEntropy } = sigOptions || {}\n  if (\n    segwitType &&\n    (typeof segwitType === 'string' || segwitType instanceof String)\n  ) {\n    segwitType = segwitType.toLowerCase()\n  }\n  if (\n    segwitType &&\n    segwitType !== SEGWIT_TYPES.P2SH_P2WPKH &&\n    segwitType !== SEGWIT_TYPES.P2WPKH\n  ) {\n    throw new Error(\n      'Unrecognized segwitType: use \"' +\n        SEGWIT_TYPES.P2SH_P2WPKH +\n        '\" or \"' +\n        SEGWIT_TYPES.P2WPKH +\n        '\"'\n    )\n  }\n\n  return {\n    messagePrefixArg,\n    segwitType,\n    extraEntropy\n  }\n}\n\nfunction isSigner (obj) {\n  return obj && typeof obj.sign === 'function'\n}\n\nfunction sign (\n  message,\n  privateKey,\n  compressed,\n  messagePrefix,\n  sigOptions\n) {\n  const {\n    messagePrefixArg,\n    segwitType,\n    extraEntropy\n  } = prepareSign(messagePrefix, sigOptions)\n  const hash = magicHash(message, messagePrefixArg)\n  const sigObj = isSigner(privateKey)\n    ? privateKey.sign(hash, extraEntropy)\n    : secp256k1.sign(hash, privateKey, { data: extraEntropy })\n  return encodeSignature(\n    sigObj.signature,\n    sigObj.recovery,\n    compressed,\n    segwitType\n  )\n}\n\nfunction signAsync (\n  message,\n  privateKey,\n  compressed,\n  messagePrefix,\n  sigOptions\n) {\n  let messagePrefixArg, segwitType, extraEntropy\n  return Promise.resolve().then(() => {\n    ({\n      messagePrefixArg,\n      segwitType,\n      extraEntropy\n    } = prepareSign(messagePrefix, sigOptions))\n    const hash = magicHash(message, messagePrefixArg)\n    return isSigner(privateKey)\n      ? privateKey.sign(hash, extraEntropy)\n      : secp256k1.sign(hash, privateKey, { data: extraEntropy })\n  }).then((sigObj) => {\n    return encodeSignature(\n      sigObj.signature,\n      sigObj.recovery,\n      compressed,\n      segwitType\n    )\n  })\n}\n\nfunction segwitRedeemHash (publicKeyHash) {\n  const redeemScript = Buffer.concat([\n    Buffer.from('0014', 'hex'),\n    publicKeyHash\n  ])\n  return hash160(redeemScript)\n}\n\nfunction decodeBech32 (address) {\n  const result = bech32.decode(address)\n  const data = bech32.fromWords(result.words.slice(1))\n  return Buffer.from(data)\n}\n\nfunction verify (message, address, signature, messagePrefix, checkSegwitAlways) {\n  if (!Buffer.isBuffer(signature)) signature = Buffer.from(signature, 'base64')\n\n  const parsed = decodeSignature(signature)\n\n  if (checkSegwitAlways && !parsed.compressed) {\n    throw new Error('checkSegwitAlways can only be used with a compressed pubkey signature flagbyte')\n  }\n\n  const hash = magicHash(message, messagePrefix)\n  const publicKey = secp256k1.recover(\n    hash,\n    parsed.signature,\n    parsed.recovery,\n    parsed.compressed\n  )\n  const publicKeyHash = hash160(publicKey)\n  let actual, expected\n\n  if (parsed.segwitType) {\n    if (parsed.segwitType === SEGWIT_TYPES.P2SH_P2WPKH) {\n      actual = segwitRedeemHash(publicKeyHash)\n      expected = bs58check.decode(address).slice(1)\n    } else {\n      // parsed.segwitType === SEGWIT_TYPES.P2WPKH\n      // must be true since we only return null, P2SH_P2WPKH, or P2WPKH\n      // from the decodeSignature function.\n      actual = publicKeyHash\n      expected = decodeBech32(address)\n    }\n  } else {\n    if (checkSegwitAlways) {\n      try {\n        expected = decodeBech32(address)\n        // if address is bech32 it is not p2sh\n        return bufferEquals(publicKeyHash, expected)\n      } catch (e) {\n        const redeemHash = segwitRedeemHash(publicKeyHash)\n        expected = bs58check.decode(address).slice(1)\n        // base58 can be p2pkh or p2sh-p2wpkh\n        return (\n          bufferEquals(publicKeyHash, expected) ||\n          bufferEquals(redeemHash, expected)\n        )\n      }\n    } else {\n      actual = publicKeyHash\n      expected = bs58check.decode(address).slice(1)\n    }\n  }\n\n  return bufferEquals(actual, expected)\n}\n\nmodule.exports = {\n  magicHash: magicHash,\n  sign: sign,\n  signAsync: signAsync,\n  verify: verify\n}\n{\n  \"name\": \"base-x\",\n  \"version\": \"3.0.11\",\n  \"description\": \"Fast base encoding / decoding of any given alphabet\",\n  \"keywords\": [\n    \"base-x\",\n    \"base58\",\n    \"base62\",\n    \"base64\",\n    \"crypto\",\n    \"crytography\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\"\n  ],\n  \"homepage\": \"https://github.com/cryptocoinjs/base-x\",\n  \"bugs\": {\n    \"url\": \"https://github.com/cryptocoinjs/base-x/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Daniel Cousens\",\n  \"files\": [\n    \"src\"\n  ],\n  \"main\": \"src/index.js\",\n  \"types\": \"src/index.d.ts\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/cryptocoinjs/base-x.git\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc -p ./tsconfig.json ; standard --fix\",\n    \"gitdiff\": \"npm run build && git diff --exit-code\",\n    \"prepublish\": \"npm run gitdiff\",\n    \"standard\": \"standard\",\n    \"test\": \"npm run unit && npm run standard\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"12.0.10\",\n    \"standard\": \"^10.0.3\",\n    \"tape\": \"^4.5.1\",\n    \"typescript\": \"3.5.2\"\n  },\n  \"dependencies\": {\n    \"safe-buffer\": \"^5.0.1\"\n  }\n}\n'use strict'\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\n// @ts-ignore\nvar _Buffer = require('safe-buffer').Buffer\nfunction base (ALPHABET) {\n  if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n  var BASE_MAP = new Uint8Array(256)\n  for (var j = 0; j < BASE_MAP.length; j++) {\n    BASE_MAP[j] = 255\n  }\n  for (var i = 0; i < ALPHABET.length; i++) {\n    var x = ALPHABET.charAt(i)\n    var xc = x.charCodeAt(0)\n    if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n    BASE_MAP[xc] = i\n  }\n  var BASE = ALPHABET.length\n  var LEADER = ALPHABET.charAt(0)\n  var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n  var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n  function encode (source) {\n    if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer.from(source) }\n    if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') }\n    if (source.length === 0) { return '' }\n        // Skip & count leading zeroes.\n    var zeroes = 0\n    var length = 0\n    var pbegin = 0\n    var pend = source.length\n    while (pbegin !== pend && source[pbegin] === 0) {\n      pbegin++\n      zeroes++\n    }\n        // Allocate enough space in big-endian base58 representation.\n    var size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n    var b58 = new Uint8Array(size)\n        // Process the bytes.\n    while (pbegin !== pend) {\n      var carry = source[pbegin]\n            // Apply \"b58 = b58 * 256 + ch\".\n      var i = 0\n      for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n        carry += (256 * b58[it1]) >>> 0\n        b58[it1] = (carry % BASE) >>> 0\n        carry = (carry / BASE) >>> 0\n      }\n      if (carry !== 0) { throw new Error('Non-zero carry') }\n      length = i\n      pbegin++\n    }\n        // Skip leading zeroes in base58 result.\n    var it2 = size - length\n    while (it2 !== size && b58[it2] === 0) {\n      it2++\n    }\n        // Translate the result into a string.\n    var str = LEADER.repeat(zeroes)\n    for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }\n    return str\n  }\n  function decodeUnsafe (source) {\n    if (typeof source !== 'string') { throw new TypeError('Expected String') }\n    if (source.length === 0) { return _Buffer.alloc(0) }\n    var psz = 0\n        // Skip and count leading '1's.\n    var zeroes = 0\n    var length = 0\n    while (source[psz] === LEADER) {\n      zeroes++\n      psz++\n    }\n        // Allocate enough space in big-endian base256 representation.\n    var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n    var b256 = new Uint8Array(size)\n        // Process the characters.\n    while (psz < source.length) {\n            // Find code of next character\n      var charCode = source.charCodeAt(psz)\n            // Base map can not be indexed using char code\n      if (charCode > 255) { return }\n            // Decode character\n      var carry = BASE_MAP[charCode]\n            // Invalid character\n      if (carry === 255) { return }\n      var i = 0\n      for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n        carry += (BASE * b256[it3]) >>> 0\n        b256[it3] = (carry % 256) >>> 0\n        carry = (carry / 256) >>> 0\n      }\n      if (carry !== 0) { throw new Error('Non-zero carry') }\n      length = i\n      psz++\n    }\n        // Skip leading zeroes in b256.\n    var it4 = size - length\n    while (it4 !== size && b256[it4] === 0) {\n      it4++\n    }\n    var vch = _Buffer.allocUnsafe(zeroes + (size - it4))\n    vch.fill(0x00, 0, zeroes)\n    var j = zeroes\n    while (it4 !== size) {\n      vch[j++] = b256[it4++]\n    }\n    return vch\n  }\n  function decode (string) {\n    var buffer = decodeUnsafe(string)\n    if (buffer) { return buffer }\n    throw new Error('Non-base' + BASE + ' character')\n  }\n  return {\n    encode: encode,\n    decodeUnsafe: decodeUnsafe,\n    decode: decode\n  }\n}\nmodule.exports = base\n'use strict'\nvar ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'\n\n// pre-compute lookup table\nvar ALPHABET_MAP = {}\nfor (var z = 0; z < ALPHABET.length; z++) {\n  var x = ALPHABET.charAt(z)\n\n  if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n  ALPHABET_MAP[x] = z\n}\n\nfunction polymodStep (pre) {\n  var b = pre >> 25\n  return ((pre & 0x1FFFFFF) << 5) ^\n    (-((b >> 0) & 1) & 0x3b6a57b2) ^\n    (-((b >> 1) & 1) & 0x26508e6d) ^\n    (-((b >> 2) & 1) & 0x1ea119fa) ^\n    (-((b >> 3) & 1) & 0x3d4233dd) ^\n    (-((b >> 4) & 1) & 0x2a1462b3)\n}\n\nfunction prefixChk (prefix) {\n  var chk = 1\n  for (var i = 0; i < prefix.length; ++i) {\n    var c = prefix.charCodeAt(i)\n    if (c < 33 || c > 126) return 'Invalid prefix (' + prefix + ')'\n\n    chk = polymodStep(chk) ^ (c >> 5)\n  }\n  chk = polymodStep(chk)\n\n  for (i = 0; i < prefix.length; ++i) {\n    var v = prefix.charCodeAt(i)\n    chk = polymodStep(chk) ^ (v & 0x1f)\n  }\n  return chk\n}\n\nfunction encode (prefix, words, LIMIT) {\n  LIMIT = LIMIT || 90\n  if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit')\n\n  prefix = prefix.toLowerCase()\n\n  // determine chk mod\n  var chk = prefixChk(prefix)\n  if (typeof chk === 'string') throw new Error(chk)\n\n  var result = prefix + '1'\n  for (var i = 0; i < words.length; ++i) {\n    var x = words[i]\n    if ((x >> 5) !== 0) throw new Error('Non 5-bit word')\n\n    chk = polymodStep(chk) ^ x\n    result += ALPHABET.charAt(x)\n  }\n\n  for (i = 0; i < 6; ++i) {\n    chk = polymodStep(chk)\n  }\n  chk ^= 1\n\n  for (i = 0; i < 6; ++i) {\n    var v = (chk >> ((5 - i) * 5)) & 0x1f\n    result += ALPHABET.charAt(v)\n  }\n\n  return result\n}\n\nfunction __decode (str, LIMIT) {\n  LIMIT = LIMIT || 90\n  if (str.length < 8) return str + ' too short'\n  if (str.length > LIMIT) return 'Exceeds length limit'\n\n  // don't allow mixed case\n  var lowered = str.toLowerCase()\n  var uppered = str.toUpperCase()\n  if (str !== lowered && str !== uppered) return 'Mixed-case string ' + str\n  str = lowered\n\n  var split = str.lastIndexOf('1')\n  if (split === -1) return 'No separator character for ' + str\n  if (split === 0) return 'Missing prefix for ' + str\n\n  var prefix = str.slice(0, split)\n  var wordChars = str.slice(split + 1)\n  if (wordChars.length < 6) return 'Data too short'\n\n  var chk = prefixChk(prefix)\n  if (typeof chk === 'string') return chk\n\n  var words = []\n  for (var i = 0; i < wordChars.length; ++i) {\n    var c = wordChars.charAt(i)\n    var v = ALPHABET_MAP[c]\n    if (v === undefined) return 'Unknown character ' + c\n    chk = polymodStep(chk) ^ v\n\n    // not in the checksum?\n    if (i + 6 >= wordChars.length) continue\n    words.push(v)\n  }\n\n  if (chk !== 1) return 'Invalid checksum for ' + str\n  return { prefix: prefix, words: words }\n}\n\nfunction decodeUnsafe () {\n  var res = __decode.apply(null, arguments)\n  if (typeof res === 'object') return res\n}\n\nfunction decode (str) {\n  var res = __decode.apply(null, arguments)\n  if (typeof res === 'object') return res\n\n  throw new Error(res)\n}\n\nfunction convert (data, inBits, outBits, pad) {\n  var value = 0\n  var bits = 0\n  var maxV = (1 << outBits) - 1\n\n  var result = []\n  for (var i = 0; i < data.length; ++i) {\n    value = (value << inBits) | data[i]\n    bits += inBits\n\n    while (bits >= outBits) {\n      bits -= outBits\n      result.push((value >> bits) & maxV)\n    }\n  }\n\n  if (pad) {\n    if (bits > 0) {\n      result.push((value << (outBits - bits)) & maxV)\n    }\n  } else {\n    if (bits >= inBits) return 'Excess padding'\n    if ((value << (outBits - bits)) & maxV) return 'Non-zero padding'\n  }\n\n  return result\n}\n\nfunction toWordsUnsafe (bytes) {\n  var res = convert(bytes, 8, 5, true)\n  if (Array.isArray(res)) return res\n}\n\nfunction toWords (bytes) {\n  var res = convert(bytes, 8, 5, true)\n  if (Array.isArray(res)) return res\n\n  throw new Error(res)\n}\n\nfunction fromWordsUnsafe (words) {\n  var res = convert(words, 5, 8, false)\n  if (Array.isArray(res)) return res\n}\n\nfunction fromWords (words) {\n  var res = convert(words, 5, 8, false)\n  if (Array.isArray(res)) return res\n\n  throw new Error(res)\n}\n\nmodule.exports = {\n  decodeUnsafe: decodeUnsafe,\n  decode: decode,\n  encode: encode,\n  toWordsUnsafe: toWordsUnsafe,\n  toWords: toWords,\n  fromWordsUnsafe: fromWordsUnsafe,\n  fromWords: fromWords\n}\n{\n  \"name\": \"bech32\",\n  \"version\": \"1.1.4\",\n  \"description\": \"Bech32 encoding / decoding\",\n  \"keywords\": [\n    \"base32\",\n    \"bech32\",\n    \"bitcoin\",\n    \"crypto\",\n    \"crytography\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\"\n  ],\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\"\n  ],\n  \"license\": \"MIT\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"nyc\": \"^15.0.0\",\n    \"standard\": \"^14.3.3\",\n    \"tap-dot\": \"*\",\n    \"tape\": \"^4.13.2\"\n  },\n  \"repository\": {\n    \"url\": \"http://github.com/bitcoinjs/bech32\",\n    \"type\": \"git\"\n  },\n  \"scripts\": {\n    \"coverage\": \"nyc --check-coverage --branches 90 --functions 90 tape test/*.js\",\n    \"standard\": \"standard\",\n    \"test\": \"tape test/*.js | tap-dot\"\n  }\n}\nvar basex = require('base-x')\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n{\n  \"name\": \"bs58\",\n  \"version\": \"4.0.1\",\n  \"description\": \"Base 58 encoding / decoding\",\n  \"keywords\": [\n    \"base58\",\n    \"bitcoin\",\n    \"crypto\",\n    \"crytography\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\",\n    \"litecoin\"\n  ],\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"standard\": \"*\",\n    \"tape\": \"^4.6.3\"\n  },\n  \"repository\": {\n    \"url\": \"https://github.com/cryptocoinjs/bs58\",\n    \"type\": \"git\"\n  },\n  \"files\": [\n    \"./index.js\"\n  ],\n  \"main\": \"./index.js\",\n  \"scripts\": {\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run unit\",\n    \"unit\": \"tape test/index.js\"\n  },\n  \"dependencies\": {\n    \"base-x\": \"^3.0.2\"\n  }\n}\n'use strict'\n\nvar base58 = require('bs58')\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function (checksumFn) {\n  // Encode a buffer as a base58-check encoded string\n  function encode (payload) {\n    var checksum = checksumFn(payload)\n\n    return base58.encode(Buffer.concat([\n      payload,\n      checksum\n    ], payload.length + 4))\n  }\n\n  function decodeRaw (buffer) {\n    var payload = buffer.slice(0, -4)\n    var checksum = buffer.slice(-4)\n    var newChecksum = checksumFn(payload)\n\n    if (checksum[0] ^ newChecksum[0] |\n        checksum[1] ^ newChecksum[1] |\n        checksum[2] ^ newChecksum[2] |\n        checksum[3] ^ newChecksum[3]) return\n\n    return payload\n  }\n\n  // Decode a base58-check encoded string to a buffer, no result if checksum is wrong\n  function decodeUnsafe (string) {\n    var buffer = base58.decodeUnsafe(string)\n    if (!buffer) return\n\n    return decodeRaw(buffer)\n  }\n\n  function decode (string) {\n    var buffer = base58.decode(string)\n    var payload = decodeRaw(buffer, checksumFn)\n    if (!payload) throw new Error('Invalid checksum')\n    return payload\n  }\n\n  return {\n    encode: encode,\n    decode: decode,\n    decodeUnsafe: decodeUnsafe\n  }\n}\n'use strict'\n\nvar createHash = require('create-hash')\nvar bs58checkBase = require('./base')\n\n// SHA256(SHA256(buffer))\nfunction sha256x2 (buffer) {\n  var tmp = createHash('sha256').update(buffer).digest()\n  return createHash('sha256').update(tmp).digest()\n}\n\nmodule.exports = bs58checkBase(sha256x2)\n{\n  \"name\": \"bs58check\",\n  \"version\": \"2.1.2\",\n  \"description\": \"A straightforward implementation of base58-check encoding\",\n  \"keywords\": [\n    \"base\",\n    \"base58\",\n    \"base58check\",\n    \"bitcoin\",\n    \"bs58\",\n    \"check\",\n    \"checksum\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\",\n    \"litecoin\"\n  ],\n  \"homepage\": \"https://github.com/bitcoinjs/bs58check\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/bs58check/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Daniel Cousens\",\n  \"files\": [\n    \"index.js\",\n    \"base.js\"\n  ],\n  \"main\": \"index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/bs58check.git\"\n  },\n  \"scripts\": {\n    \"coverage-report\": \"nyc report --reporter=lcov\",\n    \"coverage\": \"nyc --check-coverage --branches 90 --functions 90 npm run unit\",\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run coverage\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"dependencies\": {\n    \"bs58\": \"^4.0.0\",\n    \"create-hash\": \"^1.1.0\",\n    \"safe-buffer\": \"^5.1.2\"\n  },\n  \"devDependencies\": {\n    \"blake-hash\": \"^1.0.0\",\n    \"nyc\": \"^11.3.0\",\n    \"standard\": \"^10.0.3\",\n    \"tape\": \"^4.6.2\"\n  }\n}\n{\n  \"name\": \"bitcoinjs-message\",\n  \"version\": \"2.2.0\",\n  \"description\": \"bitcoinjs-message\",\n  \"keywords\": [\n    \"bitcoinjs-message\",\n    \"bitcoin\"\n  ],\n  \"homepage\": \"https://github.com/bitcoinjs/bitcoinjs-message\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/bitcoinjs-message/issues\"\n  },\n  \"license\": \"MIT\",\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\"\n  ],\n  \"main\": \"./index.js\",\n  \"types\": \"./index.d.ts\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/bitcoinjs-message.git\"\n  },\n  \"scripts\": {\n    \"coverage\": \"nyc tape test/*.js\",\n    \"prepublish\": \"npm run test\",\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run unit\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"dependencies\": {\n    \"bech32\": \"^1.1.3\",\n    \"bs58check\": \"^2.1.2\",\n    \"buffer-equals\": \"^1.0.3\",\n    \"create-hash\": \"^1.1.2\",\n    \"secp256k1\": \"^3.0.1\",\n    \"varuint-bitcoin\": \"^1.0.1\"\n  },\n  \"devDependencies\": {\n    \"bigi\": \"^1.4.1\",\n    \"bitcoinjs-lib\": \"^3.2.0\",\n    \"nyc\": \"^14.1.1\",\n    \"standard\": \"^12.0.1\",\n    \"tape\": \"^4.5.1\"\n  },\n  \"engines\": {\n    \"node\": \">=0.10\"\n  }\n}\n(function (module, exports) {\n  'use strict';\n\n  // Utils\n  function assert (val, msg) {\n    if (!val) throw new Error(msg || 'Assertion failed');\n  }\n\n  // Could use `inherits` module, but don't want to move from single file\n  // architecture yet.\n  function inherits (ctor, superCtor) {\n    ctor.super_ = superCtor;\n    var TempCtor = function () {};\n    TempCtor.prototype = superCtor.prototype;\n    ctor.prototype = new TempCtor();\n    ctor.prototype.constructor = ctor;\n  }\n\n  // BN\n\n  function BN (number, base, endian) {\n    if (BN.isBN(number)) {\n      return number;\n    }\n\n    this.negative = 0;\n    this.words = null;\n    this.length = 0;\n\n    // Reduction context\n    this.red = null;\n\n    if (number !== null) {\n      if (base === 'le' || base === 'be') {\n        endian = base;\n        base = 10;\n      }\n\n      this._init(number || 0, base || 10, endian || 'be');\n    }\n  }\n  if (typeof module === 'object') {\n    module.exports = BN;\n  } else {\n    exports.BN = BN;\n  }\n\n  BN.BN = BN;\n  BN.wordSize = 26;\n\n  var Buffer;\n  try {\n    if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n      Buffer = window.Buffer;\n    } else {\n      Buffer = require('buffer').Buffer;\n    }\n  } catch (e) {\n  }\n\n  BN.isBN = function isBN (num) {\n    if (num instanceof BN) {\n      return true;\n    }\n\n    return num !== null && typeof num === 'object' &&\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n  };\n\n  BN.max = function max (left, right) {\n    if (left.cmp(right) > 0) return left;\n    return right;\n  };\n\n  BN.min = function min (left, right) {\n    if (left.cmp(right) < 0) return left;\n    return right;\n  };\n\n  BN.prototype._init = function init (number, base, endian) {\n    if (typeof number === 'number') {\n      return this._initNumber(number, base, endian);\n    }\n\n    if (typeof number === 'object') {\n      return this._initArray(number, base, endian);\n    }\n\n    if (base === 'hex') {\n      base = 16;\n    }\n    assert(base === (base | 0) && base >= 2 && base <= 36);\n\n    number = number.toString().replace(/\\s+/g, '');\n    var start = 0;\n    if (number[0] === '-') {\n      start++;\n      this.negative = 1;\n    }\n\n    if (start < number.length) {\n      if (base === 16) {\n        this._parseHex(number, start, endian);\n      } else {\n        this._parseBase(number, base, start);\n        if (endian === 'le') {\n          this._initArray(this.toArray(), base, endian);\n        }\n      }\n    }\n  };\n\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\n    if (number < 0) {\n      this.negative = 1;\n      number = -number;\n    }\n    if (number < 0x4000000) {\n      this.words = [ number & 0x3ffffff ];\n      this.length = 1;\n    } else if (number < 0x10000000000000) {\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff\n      ];\n      this.length = 2;\n    } else {\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff,\n        1\n      ];\n      this.length = 3;\n    }\n\n    if (endian !== 'le') return;\n\n    // Reverse the bytes\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initArray = function _initArray (number, base, endian) {\n    // Perhaps a Uint8Array\n    assert(typeof number.length === 'number');\n    if (number.length <= 0) {\n      this.words = [ 0 ];\n      this.length = 1;\n      return this;\n    }\n\n    this.length = Math.ceil(number.length / 3);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    var off = 0;\n    if (endian === 'be') {\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    } else if (endian === 'le') {\n      for (i = 0, j = 0; i < number.length; i += 3) {\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    }\n    return this.strip();\n  };\n\n  function parseHex4Bits (string, index) {\n    var c = string.charCodeAt(index);\n    // 'A' - 'F'\n    if (c >= 65 && c <= 70) {\n      return c - 55;\n    // 'a' - 'f'\n    } else if (c >= 97 && c <= 102) {\n      return c - 87;\n    // '0' - '9'\n    } else {\n      return (c - 48) & 0xf;\n    }\n  }\n\n  function parseHexByte (string, lowerBound, index) {\n    var r = parseHex4Bits(string, index);\n    if (index - 1 >= lowerBound) {\n      r |= parseHex4Bits(string, index - 1) << 4;\n    }\n    return r;\n  }\n\n  BN.prototype._parseHex = function _parseHex (number, start, endian) {\n    // Create possibly bigger array to ensure that it fits the number\n    this.length = Math.ceil((number.length - start) / 6);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    // 24-bits chunks\n    var off = 0;\n    var j = 0;\n\n    var w;\n    if (endian === 'be') {\n      for (i = number.length - 1; i >= start; i -= 2) {\n        w = parseHexByte(number, start, i) << off;\n        this.words[j] |= w & 0x3ffffff;\n        if (off >= 18) {\n          off -= 18;\n          j += 1;\n          this.words[j] |= w >>> 26;\n        } else {\n          off += 8;\n        }\n      }\n    } else {\n      var parseLength = number.length - start;\n      for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n        w = parseHexByte(number, start, i) << off;\n        this.words[j] |= w & 0x3ffffff;\n        if (off >= 18) {\n          off -= 18;\n          j += 1;\n          this.words[j] |= w >>> 26;\n        } else {\n          off += 8;\n        }\n      }\n    }\n\n    this.strip();\n  };\n\n  function parseBase (str, start, end, mul) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r *= mul;\n\n      // 'a'\n      if (c >= 49) {\n        r += c - 49 + 0xa;\n\n      // 'A'\n      } else if (c >= 17) {\n        r += c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r += c;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\n    // Initialize as zero\n    this.words = [ 0 ];\n    this.length = 1;\n\n    // Find length of limb in base\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n      limbLen++;\n    }\n    limbLen--;\n    limbPow = (limbPow / base) | 0;\n\n    var total = number.length - start;\n    var mod = total % limbLen;\n    var end = Math.min(total, total - mod) + start;\n\n    var word = 0;\n    for (var i = start; i < end; i += limbLen) {\n      word = parseBase(number, i, i + limbLen, base);\n\n      this.imuln(limbPow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n\n    if (mod !== 0) {\n      var pow = 1;\n      word = parseBase(number, i, number.length, base);\n\n      for (i = 0; i < mod; i++) {\n        pow *= base;\n      }\n\n      this.imuln(pow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n\n    this.strip();\n  };\n\n  BN.prototype.copy = function copy (dest) {\n    dest.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      dest.words[i] = this.words[i];\n    }\n    dest.length = this.length;\n    dest.negative = this.negative;\n    dest.red = this.red;\n  };\n\n  BN.prototype.clone = function clone () {\n    var r = new BN(null);\n    this.copy(r);\n    return r;\n  };\n\n  BN.prototype._expand = function _expand (size) {\n    while (this.length < size) {\n      this.words[this.length++] = 0;\n    }\n    return this;\n  };\n\n  // Remove leading `0` from `this`\n  BN.prototype.strip = function strip () {\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\n      this.length--;\n    }\n    return this._normSign();\n  };\n\n  BN.prototype._normSign = function _normSign () {\n    // -0 = 0\n    if (this.length === 1 && this.words[0] === 0) {\n      this.negative = 0;\n    }\n    return this;\n  };\n\n  BN.prototype.inspect = function inspect () {\n    return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n  };\n\n  /*\n\n  var zeros = [];\n  var groupSizes = [];\n  var groupBases = [];\n\n  var s = '';\n  var i = -1;\n  while (++i < BN.wordSize) {\n    zeros[i] = s;\n    s += '0';\n  }\n  groupSizes[0] = 0;\n  groupSizes[1] = 0;\n  groupBases[0] = 0;\n  groupBases[1] = 0;\n  var base = 2 - 1;\n  while (++base < 36 + 1) {\n    var groupSize = 0;\n    var groupBase = 1;\n    while (groupBase < (1 << BN.wordSize) / base) {\n      groupBase *= base;\n      groupSize += 1;\n    }\n    groupSizes[base] = groupSize;\n    groupBases[base] = groupBase;\n  }\n\n  */\n\n  var zeros = [\n    '',\n    '0',\n    '00',\n    '000',\n    '0000',\n    '00000',\n    '000000',\n    '0000000',\n    '00000000',\n    '000000000',\n    '0000000000',\n    '00000000000',\n    '000000000000',\n    '0000000000000',\n    '00000000000000',\n    '000000000000000',\n    '0000000000000000',\n    '00000000000000000',\n    '000000000000000000',\n    '0000000000000000000',\n    '00000000000000000000',\n    '000000000000000000000',\n    '0000000000000000000000',\n    '00000000000000000000000',\n    '000000000000000000000000',\n    '0000000000000000000000000'\n  ];\n\n  var groupSizes = [\n    0, 0,\n    25, 16, 12, 11, 10, 9, 8,\n    8, 7, 7, 7, 7, 6, 6,\n    6, 6, 6, 6, 6, 5, 5,\n    5, 5, 5, 5, 5, 5, 5,\n    5, 5, 5, 5, 5, 5, 5\n  ];\n\n  var groupBases = [\n    0, 0,\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n  ];\n\n  BN.prototype.toString = function toString (base, padding) {\n    base = base || 10;\n    padding = padding | 0 || 1;\n\n    var out;\n    if (base === 16 || base === 'hex') {\n      out = '';\n      var off = 0;\n      var carry = 0;\n      for (var i = 0; i < this.length; i++) {\n        var w = this.words[i];\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\n        carry = (w >>> (24 - off)) & 0xffffff;\n        off += 2;\n        if (off >= 26) {\n          off -= 26;\n          i--;\n        }\n        if (carry !== 0 || i !== this.length - 1) {\n          out = zeros[6 - word.length] + word + out;\n        } else {\n          out = word + out;\n        }\n      }\n      if (carry !== 0) {\n        out = carry.toString(16) + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    if (base === (base | 0) && base >= 2 && base <= 36) {\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n      var groupSize = groupSizes[base];\n      // var groupBase = Math.pow(base, groupSize);\n      var groupBase = groupBases[base];\n      out = '';\n      var c = this.clone();\n      c.negative = 0;\n      while (!c.isZero()) {\n        var r = c.modn(groupBase).toString(base);\n        c = c.idivn(groupBase);\n\n        if (!c.isZero()) {\n          out = zeros[groupSize - r.length] + r + out;\n        } else {\n          out = r + out;\n        }\n      }\n      if (this.isZero()) {\n        out = '0' + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    assert(false, 'Base should be between 2 and 36');\n  };\n\n  BN.prototype.toNumber = function toNumber () {\n    var ret = this.words[0];\n    if (this.length === 2) {\n      ret += this.words[1] * 0x4000000;\n    } else if (this.length === 3 && this.words[2] === 0x01) {\n      // NOTE: at this stage it is known that the top bit is set\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n    } else if (this.length > 2) {\n      assert(false, 'Number can only safely store up to 53 bits');\n    }\n    return (this.negative !== 0) ? -ret : ret;\n  };\n\n  BN.prototype.toJSON = function toJSON () {\n    return this.toString(16);\n  };\n\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\n    assert(typeof Buffer !== 'undefined');\n    return this.toArrayLike(Buffer, endian, length);\n  };\n\n  BN.prototype.toArray = function toArray (endian, length) {\n    return this.toArrayLike(Array, endian, length);\n  };\n\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n    var byteLength = this.byteLength();\n    var reqLength = length || Math.max(1, byteLength);\n    assert(byteLength <= reqLength, 'byte array longer than desired length');\n    assert(reqLength > 0, 'Requested array length <= 0');\n\n    this.strip();\n    var littleEndian = endian === 'le';\n    var res = new ArrayType(reqLength);\n\n    var b, i;\n    var q = this.clone();\n    if (!littleEndian) {\n      // Assume big-endian\n      for (i = 0; i < reqLength - byteLength; i++) {\n        res[i] = 0;\n      }\n\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[reqLength - i - 1] = b;\n      }\n    } else {\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[i] = b;\n      }\n\n      for (; i < reqLength; i++) {\n        res[i] = 0;\n      }\n    }\n\n    return res;\n  };\n\n  if (Math.clz32) {\n    BN.prototype._countBits = function _countBits (w) {\n      return 32 - Math.clz32(w);\n    };\n  } else {\n    BN.prototype._countBits = function _countBits (w) {\n      var t = w;\n      var r = 0;\n      if (t >= 0x1000) {\n        r += 13;\n        t >>>= 13;\n      }\n      if (t >= 0x40) {\n        r += 7;\n        t >>>= 7;\n      }\n      if (t >= 0x8) {\n        r += 4;\n        t >>>= 4;\n      }\n      if (t >= 0x02) {\n        r += 2;\n        t >>>= 2;\n      }\n      return r + t;\n    };\n  }\n\n  BN.prototype._zeroBits = function _zeroBits (w) {\n    // Short-cut\n    if (w === 0) return 26;\n\n    var t = w;\n    var r = 0;\n    if ((t & 0x1fff) === 0) {\n      r += 13;\n      t >>>= 13;\n    }\n    if ((t & 0x7f) === 0) {\n      r += 7;\n      t >>>= 7;\n    }\n    if ((t & 0xf) === 0) {\n      r += 4;\n      t >>>= 4;\n    }\n    if ((t & 0x3) === 0) {\n      r += 2;\n      t >>>= 2;\n    }\n    if ((t & 0x1) === 0) {\n      r++;\n    }\n    return r;\n  };\n\n  // Return number of used bits in a BN\n  BN.prototype.bitLength = function bitLength () {\n    var w = this.words[this.length - 1];\n    var hi = this._countBits(w);\n    return (this.length - 1) * 26 + hi;\n  };\n\n  function toBitArray (num) {\n    var w = new Array(num.bitLength());\n\n    for (var bit = 0; bit < w.length; bit++) {\n      var off = (bit / 26) | 0;\n      var wbit = bit % 26;\n\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n    }\n\n    return w;\n  }\n\n  // Number of trailing zero bits\n  BN.prototype.zeroBits = function zeroBits () {\n    if (this.isZero()) return 0;\n\n    var r = 0;\n    for (var i = 0; i < this.length; i++) {\n      var b = this._zeroBits(this.words[i]);\n      r += b;\n      if (b !== 26) break;\n    }\n    return r;\n  };\n\n  BN.prototype.byteLength = function byteLength () {\n    return Math.ceil(this.bitLength() / 8);\n  };\n\n  BN.prototype.toTwos = function toTwos (width) {\n    if (this.negative !== 0) {\n      return this.abs().inotn(width).iaddn(1);\n    }\n    return this.clone();\n  };\n\n  BN.prototype.fromTwos = function fromTwos (width) {\n    if (this.testn(width - 1)) {\n      return this.notn(width).iaddn(1).ineg();\n    }\n    return this.clone();\n  };\n\n  BN.prototype.isNeg = function isNeg () {\n    return this.negative !== 0;\n  };\n\n  // Return negative clone of `this`\n  BN.prototype.neg = function neg () {\n    return this.clone().ineg();\n  };\n\n  BN.prototype.ineg = function ineg () {\n    if (!this.isZero()) {\n      this.negative ^= 1;\n    }\n\n    return this;\n  };\n\n  // Or `num` with `this` in-place\n  BN.prototype.iuor = function iuor (num) {\n    while (this.length < num.length) {\n      this.words[this.length++] = 0;\n    }\n\n    for (var i = 0; i < num.length; i++) {\n      this.words[i] = this.words[i] | num.words[i];\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ior = function ior (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuor(num);\n  };\n\n  // Or `num` with `this`\n  BN.prototype.or = function or (num) {\n    if (this.length > num.length) return this.clone().ior(num);\n    return num.clone().ior(this);\n  };\n\n  BN.prototype.uor = function uor (num) {\n    if (this.length > num.length) return this.clone().iuor(num);\n    return num.clone().iuor(this);\n  };\n\n  // And `num` with `this` in-place\n  BN.prototype.iuand = function iuand (num) {\n    // b = min-length(num, this)\n    var b;\n    if (this.length > num.length) {\n      b = num;\n    } else {\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = this.words[i] & num.words[i];\n    }\n\n    this.length = b.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.iand = function iand (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuand(num);\n  };\n\n  // And `num` with `this`\n  BN.prototype.and = function and (num) {\n    if (this.length > num.length) return this.clone().iand(num);\n    return num.clone().iand(this);\n  };\n\n  BN.prototype.uand = function uand (num) {\n    if (this.length > num.length) return this.clone().iuand(num);\n    return num.clone().iuand(this);\n  };\n\n  // Xor `num` with `this` in-place\n  BN.prototype.iuxor = function iuxor (num) {\n    // a.length > b.length\n    var a;\n    var b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = a.words[i] ^ b.words[i];\n    }\n\n    if (this !== a) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = a.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.ixor = function ixor (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuxor(num);\n  };\n\n  // Xor `num` with `this`\n  BN.prototype.xor = function xor (num) {\n    if (this.length > num.length) return this.clone().ixor(num);\n    return num.clone().ixor(this);\n  };\n\n  BN.prototype.uxor = function uxor (num) {\n    if (this.length > num.length) return this.clone().iuxor(num);\n    return num.clone().iuxor(this);\n  };\n\n  // Not ``this`` with ``width`` bitwidth\n  BN.prototype.inotn = function inotn (width) {\n    assert(typeof width === 'number' && width >= 0);\n\n    var bytesNeeded = Math.ceil(width / 26) | 0;\n    var bitsLeft = width % 26;\n\n    // Extend the buffer with leading zeroes\n    this._expand(bytesNeeded);\n\n    if (bitsLeft > 0) {\n      bytesNeeded--;\n    }\n\n    // Handle complete words\n    for (var i = 0; i < bytesNeeded; i++) {\n      this.words[i] = ~this.words[i] & 0x3ffffff;\n    }\n\n    // Handle the residue\n    if (bitsLeft > 0) {\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n    }\n\n    // And remove leading zeroes\n    return this.strip();\n  };\n\n  BN.prototype.notn = function notn (width) {\n    return this.clone().inotn(width);\n  };\n\n  // Set `bit` of `this`\n  BN.prototype.setn = function setn (bit, val) {\n    assert(typeof bit === 'number' && bit >= 0);\n\n    var off = (bit / 26) | 0;\n    var wbit = bit % 26;\n\n    this._expand(off + 1);\n\n    if (val) {\n      this.words[off] = this.words[off] | (1 << wbit);\n    } else {\n      this.words[off] = this.words[off] & ~(1 << wbit);\n    }\n\n    return this.strip();\n  };\n\n  // Add `num` to `this` in-place\n  BN.prototype.iadd = function iadd (num) {\n    var r;\n\n    // negative + positive\n    if (this.negative !== 0 && num.negative === 0) {\n      this.negative = 0;\n      r = this.isub(num);\n      this.negative ^= 1;\n      return this._normSign();\n\n    // positive + negative\n    } else if (this.negative === 0 && num.negative !== 0) {\n      num.negative = 0;\n      r = this.isub(num);\n      num.negative = 1;\n      return r._normSign();\n    }\n\n    // a.length > b.length\n    var a, b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n\n    this.length = a.length;\n    if (carry !== 0) {\n      this.words[this.length] = carry;\n      this.length++;\n    // Copy the rest of the words\n    } else if (a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    return this;\n  };\n\n  // Add `num` to `this`\n  BN.prototype.add = function add (num) {\n    var res;\n    if (num.negative !== 0 && this.negative === 0) {\n      num.negative = 0;\n      res = this.sub(num);\n      num.negative ^= 1;\n      return res;\n    } else if (num.negative === 0 && this.negative !== 0) {\n      this.negative = 0;\n      res = num.sub(this);\n      this.negative = 1;\n      return res;\n    }\n\n    if (this.length > num.length) return this.clone().iadd(num);\n\n    return num.clone().iadd(this);\n  };\n\n  // Subtract `num` from `this` in-place\n  BN.prototype.isub = function isub (num) {\n    // this - (-num) = this + num\n    if (num.negative !== 0) {\n      num.negative = 0;\n      var r = this.iadd(num);\n      num.negative = 1;\n      return r._normSign();\n\n    // -this - num = -(this + num)\n    } else if (this.negative !== 0) {\n      this.negative = 0;\n      this.iadd(num);\n      this.negative = 1;\n      return this._normSign();\n    }\n\n    // At this point both numbers are positive\n    var cmp = this.cmp(num);\n\n    // Optimization - zeroify\n    if (cmp === 0) {\n      this.negative = 0;\n      this.length = 1;\n      this.words[0] = 0;\n      return this;\n    }\n\n    // a > b\n    var a, b;\n    if (cmp > 0) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n\n    // Copy rest of the words\n    if (carry === 0 && i < a.length && a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = Math.max(this.length, i);\n\n    if (a !== this) {\n      this.negative = 1;\n    }\n\n    return this.strip();\n  };\n\n  // Subtract `num` from `this`\n  BN.prototype.sub = function sub (num) {\n    return this.clone().isub(num);\n  };\n\n  function smallMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    var len = (self.length + num.length) | 0;\n    out.length = len;\n    len = (len - 1) | 0;\n\n    // Peel one iteration (compiler can't do it, because of code complexity)\n    var a = self.words[0] | 0;\n    var b = num.words[0] | 0;\n    var r = a * b;\n\n    var lo = r & 0x3ffffff;\n    var carry = (r / 0x4000000) | 0;\n    out.words[0] = lo;\n\n    for (var k = 1; k < len; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = carry >>> 26;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = (k - j) | 0;\n        a = self.words[i] | 0;\n        b = num.words[j] | 0;\n        r = a * b + rword;\n        ncarry += (r / 0x4000000) | 0;\n        rword = r & 0x3ffffff;\n      }\n      out.words[k] = rword | 0;\n      carry = ncarry | 0;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry | 0;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  // TODO(indutny): it may be reasonable to omit it for users who don't need\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n  // multiplication (like elliptic secp256k1).\n  var comb10MulTo = function comb10MulTo (self, num, out) {\n    var a = self.words;\n    var b = num.words;\n    var o = out.words;\n    var c = 0;\n    var lo;\n    var mid;\n    var hi;\n    var a0 = a[0] | 0;\n    var al0 = a0 & 0x1fff;\n    var ah0 = a0 >>> 13;\n    var a1 = a[1] | 0;\n    var al1 = a1 & 0x1fff;\n    var ah1 = a1 >>> 13;\n    var a2 = a[2] | 0;\n    var al2 = a2 & 0x1fff;\n    var ah2 = a2 >>> 13;\n    var a3 = a[3] | 0;\n    var al3 = a3 & 0x1fff;\n    var ah3 = a3 >>> 13;\n    var a4 = a[4] | 0;\n    var al4 = a4 & 0x1fff;\n    var ah4 = a4 >>> 13;\n    var a5 = a[5] | 0;\n    var al5 = a5 & 0x1fff;\n    var ah5 = a5 >>> 13;\n    var a6 = a[6] | 0;\n    var al6 = a6 & 0x1fff;\n    var ah6 = a6 >>> 13;\n    var a7 = a[7] | 0;\n    var al7 = a7 & 0x1fff;\n    var ah7 = a7 >>> 13;\n    var a8 = a[8] | 0;\n    var al8 = a8 & 0x1fff;\n    var ah8 = a8 >>> 13;\n    var a9 = a[9] | 0;\n    var al9 = a9 & 0x1fff;\n    var ah9 = a9 >>> 13;\n    var b0 = b[0] | 0;\n    var bl0 = b0 & 0x1fff;\n    var bh0 = b0 >>> 13;\n    var b1 = b[1] | 0;\n    var bl1 = b1 & 0x1fff;\n    var bh1 = b1 >>> 13;\n    var b2 = b[2] | 0;\n    var bl2 = b2 & 0x1fff;\n    var bh2 = b2 >>> 13;\n    var b3 = b[3] | 0;\n    var bl3 = b3 & 0x1fff;\n    var bh3 = b3 >>> 13;\n    var b4 = b[4] | 0;\n    var bl4 = b4 & 0x1fff;\n    var bh4 = b4 >>> 13;\n    var b5 = b[5] | 0;\n    var bl5 = b5 & 0x1fff;\n    var bh5 = b5 >>> 13;\n    var b6 = b[6] | 0;\n    var bl6 = b6 & 0x1fff;\n    var bh6 = b6 >>> 13;\n    var b7 = b[7] | 0;\n    var bl7 = b7 & 0x1fff;\n    var bh7 = b7 >>> 13;\n    var b8 = b[8] | 0;\n    var bl8 = b8 & 0x1fff;\n    var bh8 = b8 >>> 13;\n    var b9 = b[9] | 0;\n    var bl9 = b9 & 0x1fff;\n    var bh9 = b9 >>> 13;\n\n    out.negative = self.negative ^ num.negative;\n    out.length = 19;\n    /* k = 0 */\n    lo = Math.imul(al0, bl0);\n    mid = Math.imul(al0, bh0);\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\n    hi = Math.imul(ah0, bh0);\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n    w0 &= 0x3ffffff;\n    /* k = 1 */\n    lo = Math.imul(al1, bl0);\n    mid = Math.imul(al1, bh0);\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\n    hi = Math.imul(ah1, bh0);\n    lo = (lo + Math.imul(al0, bl1)) | 0;\n    mid = (mid + Math.imul(al0, bh1)) | 0;\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n    w1 &= 0x3ffffff;\n    /* k = 2 */\n    lo = Math.imul(al2, bl0);\n    mid = Math.imul(al2, bh0);\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\n    hi = Math.imul(ah2, bh0);\n    lo = (lo + Math.imul(al1, bl1)) | 0;\n    mid = (mid + Math.imul(al1, bh1)) | 0;\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\n    lo = (lo + Math.imul(al0, bl2)) | 0;\n    mid = (mid + Math.imul(al0, bh2)) | 0;\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n    w2 &= 0x3ffffff;\n    /* k = 3 */\n    lo = Math.imul(al3, bl0);\n    mid = Math.imul(al3, bh0);\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\n    hi = Math.imul(ah3, bh0);\n    lo = (lo + Math.imul(al2, bl1)) | 0;\n    mid = (mid + Math.imul(al2, bh1)) | 0;\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\n    lo = (lo + Math.imul(al1, bl2)) | 0;\n    mid = (mid + Math.imul(al1, bh2)) | 0;\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\n    lo = (lo + Math.imul(al0, bl3)) | 0;\n    mid = (mid + Math.imul(al0, bh3)) | 0;\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n    w3 &= 0x3ffffff;\n    /* k = 4 */\n    lo = Math.imul(al4, bl0);\n    mid = Math.imul(al4, bh0);\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\n    hi = Math.imul(ah4, bh0);\n    lo = (lo + Math.imul(al3, bl1)) | 0;\n    mid = (mid + Math.imul(al3, bh1)) | 0;\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\n    lo = (lo + Math.imul(al2, bl2)) | 0;\n    mid = (mid + Math.imul(al2, bh2)) | 0;\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\n    lo = (lo + Math.imul(al1, bl3)) | 0;\n    mid = (mid + Math.imul(al1, bh3)) | 0;\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\n    lo = (lo + Math.imul(al0, bl4)) | 0;\n    mid = (mid + Math.imul(al0, bh4)) | 0;\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n    w4 &= 0x3ffffff;\n    /* k = 5 */\n    lo = Math.imul(al5, bl0);\n    mid = Math.imul(al5, bh0);\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\n    hi = Math.imul(ah5, bh0);\n    lo = (lo + Math.imul(al4, bl1)) | 0;\n    mid = (mid + Math.imul(al4, bh1)) | 0;\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\n    lo = (lo + Math.imul(al3, bl2)) | 0;\n    mid = (mid + Math.imul(al3, bh2)) | 0;\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\n    lo = (lo + Math.imul(al2, bl3)) | 0;\n    mid = (mid + Math.imul(al2, bh3)) | 0;\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\n    lo = (lo + Math.imul(al1, bl4)) | 0;\n    mid = (mid + Math.imul(al1, bh4)) | 0;\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\n    lo = (lo + Math.imul(al0, bl5)) | 0;\n    mid = (mid + Math.imul(al0, bh5)) | 0;\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n    w5 &= 0x3ffffff;\n    /* k = 6 */\n    lo = Math.imul(al6, bl0);\n    mid = Math.imul(al6, bh0);\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\n    hi = Math.imul(ah6, bh0);\n    lo = (lo + Math.imul(al5, bl1)) | 0;\n    mid = (mid + Math.imul(al5, bh1)) | 0;\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\n    lo = (lo + Math.imul(al4, bl2)) | 0;\n    mid = (mid + Math.imul(al4, bh2)) | 0;\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\n    lo = (lo + Math.imul(al3, bl3)) | 0;\n    mid = (mid + Math.imul(al3, bh3)) | 0;\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\n    lo = (lo + Math.imul(al2, bl4)) | 0;\n    mid = (mid + Math.imul(al2, bh4)) | 0;\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\n    lo = (lo + Math.imul(al1, bl5)) | 0;\n    mid = (mid + Math.imul(al1, bh5)) | 0;\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\n    lo = (lo + Math.imul(al0, bl6)) | 0;\n    mid = (mid + Math.imul(al0, bh6)) | 0;\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n    w6 &= 0x3ffffff;\n    /* k = 7 */\n    lo = Math.imul(al7, bl0);\n    mid = Math.imul(al7, bh0);\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\n    hi = Math.imul(ah7, bh0);\n    lo = (lo + Math.imul(al6, bl1)) | 0;\n    mid = (mid + Math.imul(al6, bh1)) | 0;\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\n    lo = (lo + Math.imul(al5, bl2)) | 0;\n    mid = (mid + Math.imul(al5, bh2)) | 0;\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\n    lo = (lo + Math.imul(al4, bl3)) | 0;\n    mid = (mid + Math.imul(al4, bh3)) | 0;\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\n    lo = (lo + Math.imul(al3, bl4)) | 0;\n    mid = (mid + Math.imul(al3, bh4)) | 0;\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\n    lo = (lo + Math.imul(al2, bl5)) | 0;\n    mid = (mid + Math.imul(al2, bh5)) | 0;\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\n    lo = (lo + Math.imul(al1, bl6)) | 0;\n    mid = (mid + Math.imul(al1, bh6)) | 0;\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\n    lo = (lo + Math.imul(al0, bl7)) | 0;\n    mid = (mid + Math.imul(al0, bh7)) | 0;\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n    w7 &= 0x3ffffff;\n    /* k = 8 */\n    lo = Math.imul(al8, bl0);\n    mid = Math.imul(al8, bh0);\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\n    hi = Math.imul(ah8, bh0);\n    lo = (lo + Math.imul(al7, bl1)) | 0;\n    mid = (mid + Math.imul(al7, bh1)) | 0;\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\n    lo = (lo + Math.imul(al6, bl2)) | 0;\n    mid = (mid + Math.imul(al6, bh2)) | 0;\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\n    lo = (lo + Math.imul(al5, bl3)) | 0;\n    mid = (mid + Math.imul(al5, bh3)) | 0;\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\n    lo = (lo + Math.imul(al4, bl4)) | 0;\n    mid = (mid + Math.imul(al4, bh4)) | 0;\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\n    lo = (lo + Math.imul(al3, bl5)) | 0;\n    mid = (mid + Math.imul(al3, bh5)) | 0;\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\n    lo = (lo + Math.imul(al2, bl6)) | 0;\n    mid = (mid + Math.imul(al2, bh6)) | 0;\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\n    lo = (lo + Math.imul(al1, bl7)) | 0;\n    mid = (mid + Math.imul(al1, bh7)) | 0;\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\n    lo = (lo + Math.imul(al0, bl8)) | 0;\n    mid = (mid + Math.imul(al0, bh8)) | 0;\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n    w8 &= 0x3ffffff;\n    /* k = 9 */\n    lo = Math.imul(al9, bl0);\n    mid = Math.imul(al9, bh0);\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\n    hi = Math.imul(ah9, bh0);\n    lo = (lo + Math.imul(al8, bl1)) | 0;\n    mid = (mid + Math.imul(al8, bh1)) | 0;\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\n    lo = (lo + Math.imul(al7, bl2)) | 0;\n    mid = (mid + Math.imul(al7, bh2)) | 0;\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\n    lo = (lo + Math.imul(al6, bl3)) | 0;\n    mid = (mid + Math.imul(al6, bh3)) | 0;\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\n    lo = (lo + Math.imul(al5, bl4)) | 0;\n    mid = (mid + Math.imul(al5, bh4)) | 0;\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\n    lo = (lo + Math.imul(al4, bl5)) | 0;\n    mid = (mid + Math.imul(al4, bh5)) | 0;\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\n    lo = (lo + Math.imul(al3, bl6)) | 0;\n    mid = (mid + Math.imul(al3, bh6)) | 0;\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\n    lo = (lo + Math.imul(al2, bl7)) | 0;\n    mid = (mid + Math.imul(al2, bh7)) | 0;\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\n    lo = (lo + Math.imul(al1, bl8)) | 0;\n    mid = (mid + Math.imul(al1, bh8)) | 0;\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\n    lo = (lo + Math.imul(al0, bl9)) | 0;\n    mid = (mid + Math.imul(al0, bh9)) | 0;\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n    w9 &= 0x3ffffff;\n    /* k = 10 */\n    lo = Math.imul(al9, bl1);\n    mid = Math.imul(al9, bh1);\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\n    hi = Math.imul(ah9, bh1);\n    lo = (lo + Math.imul(al8, bl2)) | 0;\n    mid = (mid + Math.imul(al8, bh2)) | 0;\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\n    lo = (lo + Math.imul(al7, bl3)) | 0;\n    mid = (mid + Math.imul(al7, bh3)) | 0;\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\n    lo = (lo + Math.imul(al6, bl4)) | 0;\n    mid = (mid + Math.imul(al6, bh4)) | 0;\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\n    lo = (lo + Math.imul(al5, bl5)) | 0;\n    mid = (mid + Math.imul(al5, bh5)) | 0;\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\n    lo = (lo + Math.imul(al4, bl6)) | 0;\n    mid = (mid + Math.imul(al4, bh6)) | 0;\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\n    lo = (lo + Math.imul(al3, bl7)) | 0;\n    mid = (mid + Math.imul(al3, bh7)) | 0;\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\n    lo = (lo + Math.imul(al2, bl8)) | 0;\n    mid = (mid + Math.imul(al2, bh8)) | 0;\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\n    lo = (lo + Math.imul(al1, bl9)) | 0;\n    mid = (mid + Math.imul(al1, bh9)) | 0;\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n    w10 &= 0x3ffffff;\n    /* k = 11 */\n    lo = Math.imul(al9, bl2);\n    mid = Math.imul(al9, bh2);\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\n    hi = Math.imul(ah9, bh2);\n    lo = (lo + Math.imul(al8, bl3)) | 0;\n    mid = (mid + Math.imul(al8, bh3)) | 0;\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\n    lo = (lo + Math.imul(al7, bl4)) | 0;\n    mid = (mid + Math.imul(al7, bh4)) | 0;\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\n    lo = (lo + Math.imul(al6, bl5)) | 0;\n    mid = (mid + Math.imul(al6, bh5)) | 0;\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\n    lo = (lo + Math.imul(al5, bl6)) | 0;\n    mid = (mid + Math.imul(al5, bh6)) | 0;\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\n    lo = (lo + Math.imul(al4, bl7)) | 0;\n    mid = (mid + Math.imul(al4, bh7)) | 0;\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\n    lo = (lo + Math.imul(al3, bl8)) | 0;\n    mid = (mid + Math.imul(al3, bh8)) | 0;\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\n    lo = (lo + Math.imul(al2, bl9)) | 0;\n    mid = (mid + Math.imul(al2, bh9)) | 0;\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n    w11 &= 0x3ffffff;\n    /* k = 12 */\n    lo = Math.imul(al9, bl3);\n    mid = Math.imul(al9, bh3);\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\n    hi = Math.imul(ah9, bh3);\n    lo = (lo + Math.imul(al8, bl4)) | 0;\n    mid = (mid + Math.imul(al8, bh4)) | 0;\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\n    lo = (lo + Math.imul(al7, bl5)) | 0;\n    mid = (mid + Math.imul(al7, bh5)) | 0;\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\n    lo = (lo + Math.imul(al6, bl6)) | 0;\n    mid = (mid + Math.imul(al6, bh6)) | 0;\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\n    lo = (lo + Math.imul(al5, bl7)) | 0;\n    mid = (mid + Math.imul(al5, bh7)) | 0;\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\n    lo = (lo + Math.imul(al4, bl8)) | 0;\n    mid = (mid + Math.imul(al4, bh8)) | 0;\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\n    lo = (lo + Math.imul(al3, bl9)) | 0;\n    mid = (mid + Math.imul(al3, bh9)) | 0;\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n    w12 &= 0x3ffffff;\n    /* k = 13 */\n    lo = Math.imul(al9, bl4);\n    mid = Math.imul(al9, bh4);\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\n    hi = Math.imul(ah9, bh4);\n    lo = (lo + Math.imul(al8, bl5)) | 0;\n    mid = (mid + Math.imul(al8, bh5)) | 0;\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\n    lo = (lo + Math.imul(al7, bl6)) | 0;\n    mid = (mid + Math.imul(al7, bh6)) | 0;\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\n    lo = (lo + Math.imul(al6, bl7)) | 0;\n    mid = (mid + Math.imul(al6, bh7)) | 0;\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\n    lo = (lo + Math.imul(al5, bl8)) | 0;\n    mid = (mid + Math.imul(al5, bh8)) | 0;\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\n    lo = (lo + Math.imul(al4, bl9)) | 0;\n    mid = (mid + Math.imul(al4, bh9)) | 0;\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n    w13 &= 0x3ffffff;\n    /* k = 14 */\n    lo = Math.imul(al9, bl5);\n    mid = Math.imul(al9, bh5);\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\n    hi = Math.imul(ah9, bh5);\n    lo = (lo + Math.imul(al8, bl6)) | 0;\n    mid = (mid + Math.imul(al8, bh6)) | 0;\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\n    lo = (lo + Math.imul(al7, bl7)) | 0;\n    mid = (mid + Math.imul(al7, bh7)) | 0;\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\n    lo = (lo + Math.imul(al6, bl8)) | 0;\n    mid = (mid + Math.imul(al6, bh8)) | 0;\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\n    lo = (lo + Math.imul(al5, bl9)) | 0;\n    mid = (mid + Math.imul(al5, bh9)) | 0;\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n    w14 &= 0x3ffffff;\n    /* k = 15 */\n    lo = Math.imul(al9, bl6);\n    mid = Math.imul(al9, bh6);\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\n    hi = Math.imul(ah9, bh6);\n    lo = (lo + Math.imul(al8, bl7)) | 0;\n    mid = (mid + Math.imul(al8, bh7)) | 0;\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\n    lo = (lo + Math.imul(al7, bl8)) | 0;\n    mid = (mid + Math.imul(al7, bh8)) | 0;\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\n    lo = (lo + Math.imul(al6, bl9)) | 0;\n    mid = (mid + Math.imul(al6, bh9)) | 0;\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n    w15 &= 0x3ffffff;\n    /* k = 16 */\n    lo = Math.imul(al9, bl7);\n    mid = Math.imul(al9, bh7);\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\n    hi = Math.imul(ah9, bh7);\n    lo = (lo + Math.imul(al8, bl8)) | 0;\n    mid = (mid + Math.imul(al8, bh8)) | 0;\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\n    lo = (lo + Math.imul(al7, bl9)) | 0;\n    mid = (mid + Math.imul(al7, bh9)) | 0;\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n    w16 &= 0x3ffffff;\n    /* k = 17 */\n    lo = Math.imul(al9, bl8);\n    mid = Math.imul(al9, bh8);\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\n    hi = Math.imul(ah9, bh8);\n    lo = (lo + Math.imul(al8, bl9)) | 0;\n    mid = (mid + Math.imul(al8, bh9)) | 0;\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n    w17 &= 0x3ffffff;\n    /* k = 18 */\n    lo = Math.imul(al9, bl9);\n    mid = Math.imul(al9, bh9);\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\n    hi = Math.imul(ah9, bh9);\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n    w18 &= 0x3ffffff;\n    o[0] = w0;\n    o[1] = w1;\n    o[2] = w2;\n    o[3] = w3;\n    o[4] = w4;\n    o[5] = w5;\n    o[6] = w6;\n    o[7] = w7;\n    o[8] = w8;\n    o[9] = w9;\n    o[10] = w10;\n    o[11] = w11;\n    o[12] = w12;\n    o[13] = w13;\n    o[14] = w14;\n    o[15] = w15;\n    o[16] = w16;\n    o[17] = w17;\n    o[18] = w18;\n    if (c !== 0) {\n      o[19] = c;\n      out.length++;\n    }\n    return out;\n  };\n\n  // Polyfill comb\n  if (!Math.imul) {\n    comb10MulTo = smallMulTo;\n  }\n\n  function bigMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    out.length = self.length + num.length;\n\n    var carry = 0;\n    var hncarry = 0;\n    for (var k = 0; k < out.length - 1; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = hncarry;\n      hncarry = 0;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = k - j;\n        var a = self.words[i] | 0;\n        var b = num.words[j] | 0;\n        var r = a * b;\n\n        var lo = r & 0x3ffffff;\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n        lo = (lo + rword) | 0;\n        rword = lo & 0x3ffffff;\n        ncarry = (ncarry + (lo >>> 26)) | 0;\n\n        hncarry += ncarry >>> 26;\n        ncarry &= 0x3ffffff;\n      }\n      out.words[k] = rword;\n      carry = ncarry;\n      ncarry = hncarry;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  function jumboMulTo (self, num, out) {\n    var fftm = new FFTM();\n    return fftm.mulp(self, num, out);\n  }\n\n  BN.prototype.mulTo = function mulTo (num, out) {\n    var res;\n    var len = this.length + num.length;\n    if (this.length === 10 && num.length === 10) {\n      res = comb10MulTo(this, num, out);\n    } else if (len < 63) {\n      res = smallMulTo(this, num, out);\n    } else if (len < 1024) {\n      res = bigMulTo(this, num, out);\n    } else {\n      res = jumboMulTo(this, num, out);\n    }\n\n    return res;\n  };\n\n  // Cooley-Tukey algorithm for FFT\n  // slightly revisited to rely on looping instead of recursion\n\n  function FFTM (x, y) {\n    this.x = x;\n    this.y = y;\n  }\n\n  FFTM.prototype.makeRBT = function makeRBT (N) {\n    var t = new Array(N);\n    var l = BN.prototype._countBits(N) - 1;\n    for (var i = 0; i < N; i++) {\n      t[i] = this.revBin(i, l, N);\n    }\n\n    return t;\n  };\n\n  // Returns binary-reversed representation of `x`\n  FFTM.prototype.revBin = function revBin (x, l, N) {\n    if (x === 0 || x === N - 1) return x;\n\n    var rb = 0;\n    for (var i = 0; i < l; i++) {\n      rb |= (x & 1) << (l - i - 1);\n      x >>= 1;\n    }\n\n    return rb;\n  };\n\n  // Performs \"tweedling\" phase, therefore 'emulating'\n  // behaviour of the recursive algorithm\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n    for (var i = 0; i < N; i++) {\n      rtws[i] = rws[rbt[i]];\n      itws[i] = iws[rbt[i]];\n    }\n  };\n\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n    this.permute(rbt, rws, iws, rtws, itws, N);\n\n    for (var s = 1; s < N; s <<= 1) {\n      var l = s << 1;\n\n      var rtwdf = Math.cos(2 * Math.PI / l);\n      var itwdf = Math.sin(2 * Math.PI / l);\n\n      for (var p = 0; p < N; p += l) {\n        var rtwdf_ = rtwdf;\n        var itwdf_ = itwdf;\n\n        for (var j = 0; j < s; j++) {\n          var re = rtws[p + j];\n          var ie = itws[p + j];\n\n          var ro = rtws[p + j + s];\n          var io = itws[p + j + s];\n\n          var rx = rtwdf_ * ro - itwdf_ * io;\n\n          io = rtwdf_ * io + itwdf_ * ro;\n          ro = rx;\n\n          rtws[p + j] = re + ro;\n          itws[p + j] = ie + io;\n\n          rtws[p + j + s] = re - ro;\n          itws[p + j + s] = ie - io;\n\n          /* jshint maxdepth : false */\n          if (j !== l) {\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n            rtwdf_ = rx;\n          }\n        }\n      }\n    }\n  };\n\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n    var N = Math.max(m, n) | 1;\n    var odd = N & 1;\n    var i = 0;\n    for (N = N / 2 | 0; N; N = N >>> 1) {\n      i++;\n    }\n\n    return 1 << i + 1 + odd;\n  };\n\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n    if (N <= 1) return;\n\n    for (var i = 0; i < N / 2; i++) {\n      var t = rws[i];\n\n      rws[i] = rws[N - i - 1];\n      rws[N - i - 1] = t;\n\n      t = iws[i];\n\n      iws[i] = -iws[N - i - 1];\n      iws[N - i - 1] = -t;\n    }\n  };\n\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n    var carry = 0;\n    for (var i = 0; i < N / 2; i++) {\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n        Math.round(ws[2 * i] / N) +\n        carry;\n\n      ws[i] = w & 0x3ffffff;\n\n      if (w < 0x4000000) {\n        carry = 0;\n      } else {\n        carry = w / 0x4000000 | 0;\n      }\n    }\n\n    return ws;\n  };\n\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n    var carry = 0;\n    for (var i = 0; i < len; i++) {\n      carry = carry + (ws[i] | 0);\n\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n    }\n\n    // Pad with zeroes\n    for (i = 2 * len; i < N; ++i) {\n      rws[i] = 0;\n    }\n\n    assert(carry === 0);\n    assert((carry & ~0x1fff) === 0);\n  };\n\n  FFTM.prototype.stub = function stub (N) {\n    var ph = new Array(N);\n    for (var i = 0; i < N; i++) {\n      ph[i] = 0;\n    }\n\n    return ph;\n  };\n\n  FFTM.prototype.mulp = function mulp (x, y, out) {\n    var N = 2 * this.guessLen13b(x.length, y.length);\n\n    var rbt = this.makeRBT(N);\n\n    var _ = this.stub(N);\n\n    var rws = new Array(N);\n    var rwst = new Array(N);\n    var iwst = new Array(N);\n\n    var nrws = new Array(N);\n    var nrwst = new Array(N);\n    var niwst = new Array(N);\n\n    var rmws = out.words;\n    rmws.length = N;\n\n    this.convert13b(x.words, x.length, rws, N);\n    this.convert13b(y.words, y.length, nrws, N);\n\n    this.transform(rws, _, rwst, iwst, N, rbt);\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n    for (var i = 0; i < N; i++) {\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n      rwst[i] = rx;\n    }\n\n    this.conjugate(rwst, iwst, N);\n    this.transform(rwst, iwst, rmws, _, N, rbt);\n    this.conjugate(rmws, _, N);\n    this.normalize13b(rmws, N);\n\n    out.negative = x.negative ^ y.negative;\n    out.length = x.length + y.length;\n    return out.strip();\n  };\n\n  // Multiply `this` by `num`\n  BN.prototype.mul = function mul (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return this.mulTo(num, out);\n  };\n\n  // Multiply employing FFT\n  BN.prototype.mulf = function mulf (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return jumboMulTo(this, num, out);\n  };\n\n  // In-place Multiplication\n  BN.prototype.imul = function imul (num) {\n    return this.clone().mulTo(num, this);\n  };\n\n  BN.prototype.imuln = function imuln (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n\n    // Carry\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var w = (this.words[i] | 0) * num;\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n      carry >>= 26;\n      carry += (w / 0x4000000) | 0;\n      // NOTE: lo is 27bit maximum\n      carry += lo >>> 26;\n      this.words[i] = lo & 0x3ffffff;\n    }\n\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n    this.length = num === 0 ? 1 : this.length;\n\n    return this;\n  };\n\n  BN.prototype.muln = function muln (num) {\n    return this.clone().imuln(num);\n  };\n\n  // `this` * `this`\n  BN.prototype.sqr = function sqr () {\n    return this.mul(this);\n  };\n\n  // `this` * `this` in-place\n  BN.prototype.isqr = function isqr () {\n    return this.imul(this.clone());\n  };\n\n  // Math.pow(`this`, `num`)\n  BN.prototype.pow = function pow (num) {\n    var w = toBitArray(num);\n    if (w.length === 0) return new BN(1);\n\n    // Skip leading zeroes\n    var res = this;\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\n      if (w[i] !== 0) break;\n    }\n\n    if (++i < w.length) {\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n        if (w[i] === 0) continue;\n\n        res = res.mul(q);\n      }\n    }\n\n    return res;\n  };\n\n  // Shift-left in-place\n  BN.prototype.iushln = function iushln (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n    var i;\n\n    if (r !== 0) {\n      var carry = 0;\n\n      for (i = 0; i < this.length; i++) {\n        var newCarry = this.words[i] & carryMask;\n        var c = ((this.words[i] | 0) - newCarry) << r;\n        this.words[i] = c | carry;\n        carry = newCarry >>> (26 - r);\n      }\n\n      if (carry) {\n        this.words[i] = carry;\n        this.length++;\n      }\n    }\n\n    if (s !== 0) {\n      for (i = this.length - 1; i >= 0; i--) {\n        this.words[i + s] = this.words[i];\n      }\n\n      for (i = 0; i < s; i++) {\n        this.words[i] = 0;\n      }\n\n      this.length += s;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishln = function ishln (bits) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushln(bits);\n  };\n\n  // Shift-right in-place\n  // NOTE: `hint` is a lowest bit before trailing zeroes\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var h;\n    if (hint) {\n      h = (hint - (hint % 26)) / 26;\n    } else {\n      h = 0;\n    }\n\n    var r = bits % 26;\n    var s = Math.min((bits - r) / 26, this.length);\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n    var maskedWords = extended;\n\n    h -= s;\n    h = Math.max(0, h);\n\n    // Extended mode, copy masked part\n    if (maskedWords) {\n      for (var i = 0; i < s; i++) {\n        maskedWords.words[i] = this.words[i];\n      }\n      maskedWords.length = s;\n    }\n\n    if (s === 0) {\n      // No-op, we should not move anything at all\n    } else if (this.length > s) {\n      this.length -= s;\n      for (i = 0; i < this.length; i++) {\n        this.words[i] = this.words[i + s];\n      }\n    } else {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    var carry = 0;\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n      var word = this.words[i] | 0;\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\n      carry = word & mask;\n    }\n\n    // Push carried bits as a mask\n    if (maskedWords && carry !== 0) {\n      maskedWords.words[maskedWords.length++] = carry;\n    }\n\n    if (this.length === 0) {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushrn(bits, hint, extended);\n  };\n\n  // Shift-left\n  BN.prototype.shln = function shln (bits) {\n    return this.clone().ishln(bits);\n  };\n\n  BN.prototype.ushln = function ushln (bits) {\n    return this.clone().iushln(bits);\n  };\n\n  // Shift-right\n  BN.prototype.shrn = function shrn (bits) {\n    return this.clone().ishrn(bits);\n  };\n\n  BN.prototype.ushrn = function ushrn (bits) {\n    return this.clone().iushrn(bits);\n  };\n\n  // Test if n bit is set\n  BN.prototype.testn = function testn (bit) {\n    assert(typeof bit === 'number' && bit >= 0);\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) return false;\n\n    // Check bit and return\n    var w = this.words[s];\n\n    return !!(w & q);\n  };\n\n  // Return only lowers bits of number (in-place)\n  BN.prototype.imaskn = function imaskn (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n\n    assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n    if (this.length <= s) {\n      return this;\n    }\n\n    if (r !== 0) {\n      s++;\n    }\n    this.length = Math.min(s, this.length);\n\n    if (r !== 0) {\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n      this.words[this.length - 1] &= mask;\n    }\n\n    return this.strip();\n  };\n\n  // Return only lowers bits of number\n  BN.prototype.maskn = function maskn (bits) {\n    return this.clone().imaskn(bits);\n  };\n\n  // Add plain number `num` to `this`\n  BN.prototype.iaddn = function iaddn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.isubn(-num);\n\n    // Possible sign change\n    if (this.negative !== 0) {\n      if (this.length === 1 && (this.words[0] | 0) < num) {\n        this.words[0] = num - (this.words[0] | 0);\n        this.negative = 0;\n        return this;\n      }\n\n      this.negative = 0;\n      this.isubn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    // Add without checks\n    return this._iaddn(num);\n  };\n\n  BN.prototype._iaddn = function _iaddn (num) {\n    this.words[0] += num;\n\n    // Carry\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n      this.words[i] -= 0x4000000;\n      if (i === this.length - 1) {\n        this.words[i + 1] = 1;\n      } else {\n        this.words[i + 1]++;\n      }\n    }\n    this.length = Math.max(this.length, i + 1);\n\n    return this;\n  };\n\n  // Subtract plain number `num` from `this`\n  BN.prototype.isubn = function isubn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.iaddn(-num);\n\n    if (this.negative !== 0) {\n      this.negative = 0;\n      this.iaddn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    this.words[0] -= num;\n\n    if (this.length === 1 && this.words[0] < 0) {\n      this.words[0] = -this.words[0];\n      this.negative = 1;\n    } else {\n      // Carry\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n        this.words[i] += 0x4000000;\n        this.words[i + 1] -= 1;\n      }\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.addn = function addn (num) {\n    return this.clone().iaddn(num);\n  };\n\n  BN.prototype.subn = function subn (num) {\n    return this.clone().isubn(num);\n  };\n\n  BN.prototype.iabs = function iabs () {\n    this.negative = 0;\n\n    return this;\n  };\n\n  BN.prototype.abs = function abs () {\n    return this.clone().iabs();\n  };\n\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n    var len = num.length + shift;\n    var i;\n\n    this._expand(len);\n\n    var w;\n    var carry = 0;\n    for (i = 0; i < num.length; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      var right = (num.words[i] | 0) * mul;\n      w -= right & 0x3ffffff;\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n    for (; i < this.length - shift; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      carry = w >> 26;\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n\n    if (carry === 0) return this.strip();\n\n    // Subtraction overflow\n    assert(carry === -1);\n    carry = 0;\n    for (i = 0; i < this.length; i++) {\n      w = -(this.words[i] | 0) + carry;\n      carry = w >> 26;\n      this.words[i] = w & 0x3ffffff;\n    }\n    this.negative = 1;\n\n    return this.strip();\n  };\n\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\n    var shift = this.length - num.length;\n\n    var a = this.clone();\n    var b = num;\n\n    // Normalize\n    var bhi = b.words[b.length - 1] | 0;\n    var bhiBits = this._countBits(bhi);\n    shift = 26 - bhiBits;\n    if (shift !== 0) {\n      b = b.ushln(shift);\n      a.iushln(shift);\n      bhi = b.words[b.length - 1] | 0;\n    }\n\n    // Initialize quotient\n    var m = a.length - b.length;\n    var q;\n\n    if (mode !== 'mod') {\n      q = new BN(null);\n      q.length = m + 1;\n      q.words = new Array(q.length);\n      for (var i = 0; i < q.length; i++) {\n        q.words[i] = 0;\n      }\n    }\n\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\n    if (diff.negative === 0) {\n      a = diff;\n      if (q) {\n        q.words[m] = 1;\n      }\n    }\n\n    for (var j = m - 1; j >= 0; j--) {\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n        (a.words[b.length + j - 1] | 0);\n\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n      // (0x7ffffff)\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n      a._ishlnsubmul(b, qj, j);\n      while (a.negative !== 0) {\n        qj--;\n        a.negative = 0;\n        a._ishlnsubmul(b, 1, j);\n        if (!a.isZero()) {\n          a.negative ^= 1;\n        }\n      }\n      if (q) {\n        q.words[j] = qj;\n      }\n    }\n    if (q) {\n      q.strip();\n    }\n    a.strip();\n\n    // Denormalize\n    if (mode !== 'div' && shift !== 0) {\n      a.iushrn(shift);\n    }\n\n    return {\n      div: q || null,\n      mod: a\n    };\n  };\n\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\n  //       to `div` to request div only, or be absent to\n  //       request both div & mod\n  //       2) `positive` is true if unsigned mod is requested\n  BN.prototype.divmod = function divmod (num, mode, positive) {\n    assert(!num.isZero());\n\n    if (this.isZero()) {\n      return {\n        div: new BN(0),\n        mod: new BN(0)\n      };\n    }\n\n    var div, mod, res;\n    if (this.negative !== 0 && num.negative === 0) {\n      res = this.neg().divmod(num, mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.iadd(num);\n        }\n      }\n\n      return {\n        div: div,\n        mod: mod\n      };\n    }\n\n    if (this.negative === 0 && num.negative !== 0) {\n      res = this.divmod(num.neg(), mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      return {\n        div: div,\n        mod: res.mod\n      };\n    }\n\n    if ((this.negative & num.negative) !== 0) {\n      res = this.neg().divmod(num.neg(), mode);\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.isub(num);\n        }\n      }\n\n      return {\n        div: res.div,\n        mod: mod\n      };\n    }\n\n    // Both numbers are positive at this point\n\n    // Strip both numbers to approximate shift value\n    if (num.length > this.length || this.cmp(num) < 0) {\n      return {\n        div: new BN(0),\n        mod: this\n      };\n    }\n\n    // Very short reduction\n    if (num.length === 1) {\n      if (mode === 'div') {\n        return {\n          div: this.divn(num.words[0]),\n          mod: null\n        };\n      }\n\n      if (mode === 'mod') {\n        return {\n          div: null,\n          mod: new BN(this.modn(num.words[0]))\n        };\n      }\n\n      return {\n        div: this.divn(num.words[0]),\n        mod: new BN(this.modn(num.words[0]))\n      };\n    }\n\n    return this._wordDiv(num, mode);\n  };\n\n  // Find `this` / `num`\n  BN.prototype.div = function div (num) {\n    return this.divmod(num, 'div', false).div;\n  };\n\n  // Find `this` % `num`\n  BN.prototype.mod = function mod (num) {\n    return this.divmod(num, 'mod', false).mod;\n  };\n\n  BN.prototype.umod = function umod (num) {\n    return this.divmod(num, 'mod', true).mod;\n  };\n\n  // Find Round(`this` / `num`)\n  BN.prototype.divRound = function divRound (num) {\n    var dm = this.divmod(num);\n\n    // Fast case - exact division\n    if (dm.mod.isZero()) return dm.div;\n\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n    var half = num.ushrn(1);\n    var r2 = num.andln(1);\n    var cmp = mod.cmp(half);\n\n    // Round down\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n    // Round up\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n  };\n\n  BN.prototype.modn = function modn (num) {\n    assert(num <= 0x3ffffff);\n    var p = (1 << 26) % num;\n\n    var acc = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      acc = (p * acc + (this.words[i] | 0)) % num;\n    }\n\n    return acc;\n  };\n\n  // In-place division by number\n  BN.prototype.idivn = function idivn (num) {\n    assert(num <= 0x3ffffff);\n\n    var carry = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var w = (this.words[i] | 0) + carry * 0x4000000;\n      this.words[i] = (w / num) | 0;\n      carry = w % num;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.divn = function divn (num) {\n    return this.clone().idivn(num);\n  };\n\n  BN.prototype.egcd = function egcd (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var x = this;\n    var y = p.clone();\n\n    if (x.negative !== 0) {\n      x = x.umod(p);\n    } else {\n      x = x.clone();\n    }\n\n    // A * x + B * y = x\n    var A = new BN(1);\n    var B = new BN(0);\n\n    // C * x + D * y = y\n    var C = new BN(0);\n    var D = new BN(1);\n\n    var g = 0;\n\n    while (x.isEven() && y.isEven()) {\n      x.iushrn(1);\n      y.iushrn(1);\n      ++g;\n    }\n\n    var yp = y.clone();\n    var xp = x.clone();\n\n    while (!x.isZero()) {\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        x.iushrn(i);\n        while (i-- > 0) {\n          if (A.isOdd() || B.isOdd()) {\n            A.iadd(yp);\n            B.isub(xp);\n          }\n\n          A.iushrn(1);\n          B.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        y.iushrn(j);\n        while (j-- > 0) {\n          if (C.isOdd() || D.isOdd()) {\n            C.iadd(yp);\n            D.isub(xp);\n          }\n\n          C.iushrn(1);\n          D.iushrn(1);\n        }\n      }\n\n      if (x.cmp(y) >= 0) {\n        x.isub(y);\n        A.isub(C);\n        B.isub(D);\n      } else {\n        y.isub(x);\n        C.isub(A);\n        D.isub(B);\n      }\n    }\n\n    return {\n      a: C,\n      b: D,\n      gcd: y.iushln(g)\n    };\n  };\n\n  // This is reduced incarnation of the binary EEA\n  // above, designated to invert members of the\n  // _prime_ fields F(p) at a maximal speed\n  BN.prototype._invmp = function _invmp (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var a = this;\n    var b = p.clone();\n\n    if (a.negative !== 0) {\n      a = a.umod(p);\n    } else {\n      a = a.clone();\n    }\n\n    var x1 = new BN(1);\n    var x2 = new BN(0);\n\n    var delta = b.clone();\n\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        a.iushrn(i);\n        while (i-- > 0) {\n          if (x1.isOdd()) {\n            x1.iadd(delta);\n          }\n\n          x1.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        b.iushrn(j);\n        while (j-- > 0) {\n          if (x2.isOdd()) {\n            x2.iadd(delta);\n          }\n\n          x2.iushrn(1);\n        }\n      }\n\n      if (a.cmp(b) >= 0) {\n        a.isub(b);\n        x1.isub(x2);\n      } else {\n        b.isub(a);\n        x2.isub(x1);\n      }\n    }\n\n    var res;\n    if (a.cmpn(1) === 0) {\n      res = x1;\n    } else {\n      res = x2;\n    }\n\n    if (res.cmpn(0) < 0) {\n      res.iadd(p);\n    }\n\n    return res;\n  };\n\n  BN.prototype.gcd = function gcd (num) {\n    if (this.isZero()) return num.abs();\n    if (num.isZero()) return this.abs();\n\n    var a = this.clone();\n    var b = num.clone();\n    a.negative = 0;\n    b.negative = 0;\n\n    // Remove common factor of two\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n      a.iushrn(1);\n      b.iushrn(1);\n    }\n\n    do {\n      while (a.isEven()) {\n        a.iushrn(1);\n      }\n      while (b.isEven()) {\n        b.iushrn(1);\n      }\n\n      var r = a.cmp(b);\n      if (r < 0) {\n        // Swap `a` and `b` to make `a` always bigger than `b`\n        var t = a;\n        a = b;\n        b = t;\n      } else if (r === 0 || b.cmpn(1) === 0) {\n        break;\n      }\n\n      a.isub(b);\n    } while (true);\n\n    return b.iushln(shift);\n  };\n\n  // Invert number in the field F(num)\n  BN.prototype.invm = function invm (num) {\n    return this.egcd(num).a.umod(num);\n  };\n\n  BN.prototype.isEven = function isEven () {\n    return (this.words[0] & 1) === 0;\n  };\n\n  BN.prototype.isOdd = function isOdd () {\n    return (this.words[0] & 1) === 1;\n  };\n\n  // And first word and num\n  BN.prototype.andln = function andln (num) {\n    return this.words[0] & num;\n  };\n\n  // Increment at the bit position in-line\n  BN.prototype.bincn = function bincn (bit) {\n    assert(typeof bit === 'number');\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) {\n      this._expand(s + 1);\n      this.words[s] |= q;\n      return this;\n    }\n\n    // Add bit and propagate, if needed\n    var carry = q;\n    for (var i = s; carry !== 0 && i < this.length; i++) {\n      var w = this.words[i] | 0;\n      w += carry;\n      carry = w >>> 26;\n      w &= 0x3ffffff;\n      this.words[i] = w;\n    }\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n    return this;\n  };\n\n  BN.prototype.isZero = function isZero () {\n    return this.length === 1 && this.words[0] === 0;\n  };\n\n  BN.prototype.cmpn = function cmpn (num) {\n    var negative = num < 0;\n\n    if (this.negative !== 0 && !negative) return -1;\n    if (this.negative === 0 && negative) return 1;\n\n    this.strip();\n\n    var res;\n    if (this.length > 1) {\n      res = 1;\n    } else {\n      if (negative) {\n        num = -num;\n      }\n\n      assert(num <= 0x3ffffff, 'Number is too big');\n\n      var w = this.words[0] | 0;\n      res = w === num ? 0 : w < num ? -1 : 1;\n    }\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Compare two numbers and return:\n  // 1 - if `this` > `num`\n  // 0 - if `this` == `num`\n  // -1 - if `this` < `num`\n  BN.prototype.cmp = function cmp (num) {\n    if (this.negative !== 0 && num.negative === 0) return -1;\n    if (this.negative === 0 && num.negative !== 0) return 1;\n\n    var res = this.ucmp(num);\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Unsigned comparison\n  BN.prototype.ucmp = function ucmp (num) {\n    // At this point both numbers have the same sign\n    if (this.length > num.length) return 1;\n    if (this.length < num.length) return -1;\n\n    var res = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var a = this.words[i] | 0;\n      var b = num.words[i] | 0;\n\n      if (a === b) continue;\n      if (a < b) {\n        res = -1;\n      } else if (a > b) {\n        res = 1;\n      }\n      break;\n    }\n    return res;\n  };\n\n  BN.prototype.gtn = function gtn (num) {\n    return this.cmpn(num) === 1;\n  };\n\n  BN.prototype.gt = function gt (num) {\n    return this.cmp(num) === 1;\n  };\n\n  BN.prototype.gten = function gten (num) {\n    return this.cmpn(num) >= 0;\n  };\n\n  BN.prototype.gte = function gte (num) {\n    return this.cmp(num) >= 0;\n  };\n\n  BN.prototype.ltn = function ltn (num) {\n    return this.cmpn(num) === -1;\n  };\n\n  BN.prototype.lt = function lt (num) {\n    return this.cmp(num) === -1;\n  };\n\n  BN.prototype.lten = function lten (num) {\n    return this.cmpn(num) <= 0;\n  };\n\n  BN.prototype.lte = function lte (num) {\n    return this.cmp(num) <= 0;\n  };\n\n  BN.prototype.eqn = function eqn (num) {\n    return this.cmpn(num) === 0;\n  };\n\n  BN.prototype.eq = function eq (num) {\n    return this.cmp(num) === 0;\n  };\n\n  //\n  // A reduce context, could be using montgomery or something better, depending\n  // on the `m` itself.\n  //\n  BN.red = function red (num) {\n    return new Red(num);\n  };\n\n  BN.prototype.toRed = function toRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    assert(this.negative === 0, 'red works only with positives');\n    return ctx.convertTo(this)._forceRed(ctx);\n  };\n\n  BN.prototype.fromRed = function fromRed () {\n    assert(this.red, 'fromRed works only with numbers in reduction context');\n    return this.red.convertFrom(this);\n  };\n\n  BN.prototype._forceRed = function _forceRed (ctx) {\n    this.red = ctx;\n    return this;\n  };\n\n  BN.prototype.forceRed = function forceRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    return this._forceRed(ctx);\n  };\n\n  BN.prototype.redAdd = function redAdd (num) {\n    assert(this.red, 'redAdd works only with red numbers');\n    return this.red.add(this, num);\n  };\n\n  BN.prototype.redIAdd = function redIAdd (num) {\n    assert(this.red, 'redIAdd works only with red numbers');\n    return this.red.iadd(this, num);\n  };\n\n  BN.prototype.redSub = function redSub (num) {\n    assert(this.red, 'redSub works only with red numbers');\n    return this.red.sub(this, num);\n  };\n\n  BN.prototype.redISub = function redISub (num) {\n    assert(this.red, 'redISub works only with red numbers');\n    return this.red.isub(this, num);\n  };\n\n  BN.prototype.redShl = function redShl (num) {\n    assert(this.red, 'redShl works only with red numbers');\n    return this.red.shl(this, num);\n  };\n\n  BN.prototype.redMul = function redMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.mul(this, num);\n  };\n\n  BN.prototype.redIMul = function redIMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.imul(this, num);\n  };\n\n  BN.prototype.redSqr = function redSqr () {\n    assert(this.red, 'redSqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqr(this);\n  };\n\n  BN.prototype.redISqr = function redISqr () {\n    assert(this.red, 'redISqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.isqr(this);\n  };\n\n  // Square root over p\n  BN.prototype.redSqrt = function redSqrt () {\n    assert(this.red, 'redSqrt works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqrt(this);\n  };\n\n  BN.prototype.redInvm = function redInvm () {\n    assert(this.red, 'redInvm works only with red numbers');\n    this.red._verify1(this);\n    return this.red.invm(this);\n  };\n\n  // Return negative clone of `this` % `red modulo`\n  BN.prototype.redNeg = function redNeg () {\n    assert(this.red, 'redNeg works only with red numbers');\n    this.red._verify1(this);\n    return this.red.neg(this);\n  };\n\n  BN.prototype.redPow = function redPow (num) {\n    assert(this.red && !num.red, 'redPow(normalNum)');\n    this.red._verify1(this);\n    return this.red.pow(this, num);\n  };\n\n  // Prime numbers with efficient reduction\n  var primes = {\n    k256: null,\n    p224: null,\n    p192: null,\n    p25519: null\n  };\n\n  // Pseudo-Mersenne prime\n  function MPrime (name, p) {\n    // P = 2 ^ N - K\n    this.name = name;\n    this.p = new BN(p, 16);\n    this.n = this.p.bitLength();\n    this.k = new BN(1).iushln(this.n).isub(this.p);\n\n    this.tmp = this._tmp();\n  }\n\n  MPrime.prototype._tmp = function _tmp () {\n    var tmp = new BN(null);\n    tmp.words = new Array(Math.ceil(this.n / 13));\n    return tmp;\n  };\n\n  MPrime.prototype.ireduce = function ireduce (num) {\n    // Assumes that `num` is less than `P^2`\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n    var r = num;\n    var rlen;\n\n    do {\n      this.split(r, this.tmp);\n      r = this.imulK(r);\n      r = r.iadd(this.tmp);\n      rlen = r.bitLength();\n    } while (rlen > this.n);\n\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n    if (cmp === 0) {\n      r.words[0] = 0;\n      r.length = 1;\n    } else if (cmp > 0) {\n      r.isub(this.p);\n    } else {\n      if (r.strip !== undefined) {\n        // r is BN v4 instance\n        r.strip();\n      } else {\n        // r is BN v5 instance\n        r._strip();\n      }\n    }\n\n    return r;\n  };\n\n  MPrime.prototype.split = function split (input, out) {\n    input.iushrn(this.n, 0, out);\n  };\n\n  MPrime.prototype.imulK = function imulK (num) {\n    return num.imul(this.k);\n  };\n\n  function K256 () {\n    MPrime.call(\n      this,\n      'k256',\n      'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n  }\n  inherits(K256, MPrime);\n\n  K256.prototype.split = function split (input, output) {\n    // 256 = 9 * 26 + 22\n    var mask = 0x3fffff;\n\n    var outLen = Math.min(input.length, 9);\n    for (var i = 0; i < outLen; i++) {\n      output.words[i] = input.words[i];\n    }\n    output.length = outLen;\n\n    if (input.length <= 9) {\n      input.words[0] = 0;\n      input.length = 1;\n      return;\n    }\n\n    // Shift by 9 limbs\n    var prev = input.words[9];\n    output.words[output.length++] = prev & mask;\n\n    for (i = 10; i < input.length; i++) {\n      var next = input.words[i] | 0;\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n      prev = next;\n    }\n    prev >>>= 22;\n    input.words[i - 10] = prev;\n    if (prev === 0 && input.length > 10) {\n      input.length -= 10;\n    } else {\n      input.length -= 9;\n    }\n  };\n\n  K256.prototype.imulK = function imulK (num) {\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n    num.words[num.length] = 0;\n    num.words[num.length + 1] = 0;\n    num.length += 2;\n\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n    var lo = 0;\n    for (var i = 0; i < num.length; i++) {\n      var w = num.words[i] | 0;\n      lo += w * 0x3d1;\n      num.words[i] = lo & 0x3ffffff;\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\n    }\n\n    // Fast length reduction\n    if (num.words[num.length - 1] === 0) {\n      num.length--;\n      if (num.words[num.length - 1] === 0) {\n        num.length--;\n      }\n    }\n    return num;\n  };\n\n  function P224 () {\n    MPrime.call(\n      this,\n      'p224',\n      'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n  }\n  inherits(P224, MPrime);\n\n  function P192 () {\n    MPrime.call(\n      this,\n      'p192',\n      'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n  }\n  inherits(P192, MPrime);\n\n  function P25519 () {\n    // 2 ^ 255 - 19\n    MPrime.call(\n      this,\n      '25519',\n      '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n  }\n  inherits(P25519, MPrime);\n\n  P25519.prototype.imulK = function imulK (num) {\n    // K = 0x13\n    var carry = 0;\n    for (var i = 0; i < num.length; i++) {\n      var hi = (num.words[i] | 0) * 0x13 + carry;\n      var lo = hi & 0x3ffffff;\n      hi >>>= 26;\n\n      num.words[i] = lo;\n      carry = hi;\n    }\n    if (carry !== 0) {\n      num.words[num.length++] = carry;\n    }\n    return num;\n  };\n\n  // Exported mostly for testing purposes, use plain name instead\n  BN._prime = function prime (name) {\n    // Cached version of prime\n    if (primes[name]) return primes[name];\n\n    var prime;\n    if (name === 'k256') {\n      prime = new K256();\n    } else if (name === 'p224') {\n      prime = new P224();\n    } else if (name === 'p192') {\n      prime = new P192();\n    } else if (name === 'p25519') {\n      prime = new P25519();\n    } else {\n      throw new Error('Unknown prime ' + name);\n    }\n    primes[name] = prime;\n\n    return prime;\n  };\n\n  //\n  // Base reduction engine\n  //\n  function Red (m) {\n    if (typeof m === 'string') {\n      var prime = BN._prime(m);\n      this.m = prime.p;\n      this.prime = prime;\n    } else {\n      assert(m.gtn(1), 'modulus must be greater than 1');\n      this.m = m;\n      this.prime = null;\n    }\n  }\n\n  Red.prototype._verify1 = function _verify1 (a) {\n    assert(a.negative === 0, 'red works only with positives');\n    assert(a.red, 'red works only with red numbers');\n  };\n\n  Red.prototype._verify2 = function _verify2 (a, b) {\n    assert((a.negative | b.negative) === 0, 'red works only with positives');\n    assert(a.red && a.red === b.red,\n      'red works only with red numbers');\n  };\n\n  Red.prototype.imod = function imod (a) {\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n    return a.umod(this.m)._forceRed(this);\n  };\n\n  Red.prototype.neg = function neg (a) {\n    if (a.isZero()) {\n      return a.clone();\n    }\n\n    return this.m.sub(a)._forceRed(this);\n  };\n\n  Red.prototype.add = function add (a, b) {\n    this._verify2(a, b);\n\n    var res = a.add(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.iadd = function iadd (a, b) {\n    this._verify2(a, b);\n\n    var res = a.iadd(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.sub = function sub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.sub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.isub = function isub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.isub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.shl = function shl (a, num) {\n    this._verify1(a);\n    return this.imod(a.ushln(num));\n  };\n\n  Red.prototype.imul = function imul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.imul(b));\n  };\n\n  Red.prototype.mul = function mul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.mul(b));\n  };\n\n  Red.prototype.isqr = function isqr (a) {\n    return this.imul(a, a.clone());\n  };\n\n  Red.prototype.sqr = function sqr (a) {\n    return this.mul(a, a);\n  };\n\n  Red.prototype.sqrt = function sqrt (a) {\n    if (a.isZero()) return a.clone();\n\n    var mod3 = this.m.andln(3);\n    assert(mod3 % 2 === 1);\n\n    // Fast case\n    if (mod3 === 3) {\n      var pow = this.m.add(new BN(1)).iushrn(2);\n      return this.pow(a, pow);\n    }\n\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n    //\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\n    var q = this.m.subn(1);\n    var s = 0;\n    while (!q.isZero() && q.andln(1) === 0) {\n      s++;\n      q.iushrn(1);\n    }\n    assert(!q.isZero());\n\n    var one = new BN(1).toRed(this);\n    var nOne = one.redNeg();\n\n    // Find quadratic non-residue\n    // NOTE: Max is such because of generalized Riemann hypothesis.\n    var lpow = this.m.subn(1).iushrn(1);\n    var z = this.m.bitLength();\n    z = new BN(2 * z * z).toRed(this);\n\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\n      z.redIAdd(nOne);\n    }\n\n    var c = this.pow(z, q);\n    var r = this.pow(a, q.addn(1).iushrn(1));\n    var t = this.pow(a, q);\n    var m = s;\n    while (t.cmp(one) !== 0) {\n      var tmp = t;\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\n        tmp = tmp.redSqr();\n      }\n      assert(i < m);\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n      r = r.redMul(b);\n      c = b.redSqr();\n      t = t.redMul(c);\n      m = i;\n    }\n\n    return r;\n  };\n\n  Red.prototype.invm = function invm (a) {\n    var inv = a._invmp(this.m);\n    if (inv.negative !== 0) {\n      inv.negative = 0;\n      return this.imod(inv).redNeg();\n    } else {\n      return this.imod(inv);\n    }\n  };\n\n  Red.prototype.pow = function pow (a, num) {\n    if (num.isZero()) return new BN(1).toRed(this);\n    if (num.cmpn(1) === 0) return a.clone();\n\n    var windowSize = 4;\n    var wnd = new Array(1 << windowSize);\n    wnd[0] = new BN(1).toRed(this);\n    wnd[1] = a;\n    for (var i = 2; i < wnd.length; i++) {\n      wnd[i] = this.mul(wnd[i - 1], a);\n    }\n\n    var res = wnd[0];\n    var current = 0;\n    var currentLen = 0;\n    var start = num.bitLength() % 26;\n    if (start === 0) {\n      start = 26;\n    }\n\n    for (i = num.length - 1; i >= 0; i--) {\n      var word = num.words[i];\n      for (var j = start - 1; j >= 0; j--) {\n        var bit = (word >> j) & 1;\n        if (res !== wnd[0]) {\n          res = this.sqr(res);\n        }\n\n        if (bit === 0 && current === 0) {\n          currentLen = 0;\n          continue;\n        }\n\n        current <<= 1;\n        current |= bit;\n        currentLen++;\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n        res = this.mul(res, wnd[current]);\n        currentLen = 0;\n        current = 0;\n      }\n      start = 26;\n    }\n\n    return res;\n  };\n\n  Red.prototype.convertTo = function convertTo (num) {\n    var r = num.umod(this.m);\n\n    return r === num ? r.clone() : r;\n  };\n\n  Red.prototype.convertFrom = function convertFrom (num) {\n    var res = num.clone();\n    res.red = null;\n    return res;\n  };\n\n  //\n  // Montgomery method engine\n  //\n\n  BN.mont = function mont (num) {\n    return new Mont(num);\n  };\n\n  function Mont (m) {\n    Red.call(this, m);\n\n    this.shift = this.m.bitLength();\n    if (this.shift % 26 !== 0) {\n      this.shift += 26 - (this.shift % 26);\n    }\n\n    this.r = new BN(1).iushln(this.shift);\n    this.r2 = this.imod(this.r.sqr());\n    this.rinv = this.r._invmp(this.m);\n\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n    this.minv = this.minv.umod(this.r);\n    this.minv = this.r.sub(this.minv);\n  }\n  inherits(Mont, Red);\n\n  Mont.prototype.convertTo = function convertTo (num) {\n    return this.imod(num.ushln(this.shift));\n  };\n\n  Mont.prototype.convertFrom = function convertFrom (num) {\n    var r = this.imod(num.mul(this.rinv));\n    r.red = null;\n    return r;\n  };\n\n  Mont.prototype.imul = function imul (a, b) {\n    if (a.isZero() || b.isZero()) {\n      a.words[0] = 0;\n      a.length = 1;\n      return a;\n    }\n\n    var t = a.imul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.mul = function mul (a, b) {\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n    var t = a.mul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.invm = function invm (a) {\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\n    return res._forceRed(this);\n  };\n})(typeof module === 'undefined' || module, this);\n{\n  \"name\": \"bn.js\",\n  \"version\": \"4.12.2\",\n  \"description\": \"Big number implementation in pure javascript\",\n  \"main\": \"lib/bn.js\",\n  \"scripts\": {\n    \"lint\": \"semistandard\",\n    \"unit\": \"mocha --reporter=spec test/*-test.js\",\n    \"test\": \"npm run lint && npm run unit\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git@github.com:indutny/bn.js\"\n  },\n  \"keywords\": [\n    \"BN\",\n    \"BigNum\",\n    \"Big number\",\n    \"Modulo\",\n    \"Montgomery\"\n  ],\n  \"author\": \"Fedor Indutny <fedor@indutny.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/indutny/bn.js/issues\"\n  },\n  \"homepage\": \"https://github.com/indutny/bn.js\",\n  \"browser\": {\n    \"buffer\": false\n  },\n  \"devDependencies\": {\n    \"istanbul\": \"^0.3.5\",\n    \"mocha\": \"^2.1.0\",\n    \"semistandard\": \"^7.0.4\"\n  }\n}\nvar r;\n\nmodule.exports = function rand(len) {\n  if (!r)\n    r = new Rand(null);\n\n  return r.generate(len);\n};\n\nfunction Rand(rand) {\n  this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n  return this._rand(len);\n};\n\n// Emulate crypto API using randy\nRand.prototype._rand = function _rand(n) {\n  if (this.rand.getBytes)\n    return this.rand.getBytes(n);\n\n  var res = new Uint8Array(n);\n  for (var i = 0; i < res.length; i++)\n    res[i] = this.rand.getByte();\n  return res;\n};\n\nif (typeof self === 'object') {\n  if (self.crypto && self.crypto.getRandomValues) {\n    // Modern browsers\n    Rand.prototype._rand = function _rand(n) {\n      var arr = new Uint8Array(n);\n      self.crypto.getRandomValues(arr);\n      return arr;\n    };\n  } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n    // IE\n    Rand.prototype._rand = function _rand(n) {\n      var arr = new Uint8Array(n);\n      self.msCrypto.getRandomValues(arr);\n      return arr;\n    };\n\n  // Safari's WebWorkers do not have `crypto`\n  } else if (typeof window === 'object') {\n    // Old junk\n    Rand.prototype._rand = function() {\n      throw new Error('Not implemented yet');\n    };\n  }\n} else {\n  // Node.js or Web worker with no crypto support\n  try {\n    var crypto = require('crypto');\n    if (typeof crypto.randomBytes !== 'function')\n      throw new Error('Not supported');\n\n    Rand.prototype._rand = function _rand(n) {\n      return crypto.randomBytes(n);\n    };\n  } catch (e) {\n  }\n}\n{\n  \"name\": \"brorand\",\n  \"version\": \"1.1.0\",\n  \"description\": \"Random number generator for browsers and node.js\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"mocha --reporter=spec test/**/*-test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git@github.com:indutny/brorand\"\n  },\n  \"keywords\": [\n    \"Random\",\n    \"RNG\",\n    \"browser\",\n    \"crypto\"\n  ],\n  \"author\": \"Fedor Indutny <fedor@indutny.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/indutny/brorand/issues\"\n  },\n  \"homepage\": \"https://github.com/indutny/brorand\",\n  \"devDependencies\": {\n    \"mocha\": \"^2.0.1\"\n  },\n  \"browser\": {\n    \"crypto\": false\n  }\n}\nconst basex = require('base-x')\nconst ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n{\n  \"name\": \"bs58\",\n  \"version\": \"5.0.0\",\n  \"description\": \"Base 58 encoding / decoding\",\n  \"keywords\": [\n    \"base58\",\n    \"bitcoin\",\n    \"crypto\",\n    \"crytography\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\",\n    \"litecoin\"\n  ],\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"standard\": \"^16.0.4\",\n    \"tape\": \"^4.6.3\"\n  },\n  \"repository\": {\n    \"url\": \"https://github.com/cryptocoinjs/bs58\",\n    \"type\": \"git\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\"\n  ],\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"scripts\": {\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run unit\",\n    \"unit\": \"tape test/index.js\"\n  },\n  \"dependencies\": {\n    \"base-x\": \"^4.0.0\"\n  }\n}\n'use strict'\n\nvar base58 = require('bs58')\n\nmodule.exports = function (checksumFn) {\n  // Encode a buffer as a base58-check encoded string\n  function encode (payload) {\n    var payloadU8 = Uint8Array.from(payload)\n    var checksum = checksumFn(payloadU8)\n    var length = payloadU8.length + 4\n    var both = new Uint8Array(length)\n    both.set(payloadU8, 0)\n    both.set(checksum.subarray(0, 4), payloadU8.length)\n    return base58.encode(both, length)\n  }\n\n  function decodeRaw (buffer) {\n    var payload = buffer.slice(0, -4)\n    var checksum = buffer.slice(-4)\n    var newChecksum = checksumFn(payload)\n\n    if (checksum[0] ^ newChecksum[0] |\n        checksum[1] ^ newChecksum[1] |\n        checksum[2] ^ newChecksum[2] |\n        checksum[3] ^ newChecksum[3]) return\n\n    return payload\n  }\n\n  // Decode a base58-check encoded string to a buffer, no result if checksum is wrong\n  function decodeUnsafe (string) {\n    var buffer = base58.decodeUnsafe(string)\n    if (!buffer) return\n\n    return decodeRaw(buffer)\n  }\n\n  function decode (string) {\n    var buffer = base58.decode(string)\n    var payload = decodeRaw(buffer, checksumFn)\n    if (!payload) throw new Error('Invalid checksum')\n    return payload\n  }\n\n  return {\n    encode: encode,\n    decode: decode,\n    decodeUnsafe: decodeUnsafe\n  }\n}\n'use strict'\n\nvar { sha256 } = require('@noble/hashes/sha256')\nvar bs58checkBase = require('./base')\n\n// SHA256(SHA256(buffer))\nfunction sha256x2 (buffer) {\n  return sha256(sha256(buffer))\n}\n\nmodule.exports = bs58checkBase(sha256x2)\n{\n  \"name\": \"bs58check\",\n  \"version\": \"3.0.1\",\n  \"description\": \"A straightforward implementation of base58-check encoding\",\n  \"keywords\": [\n    \"base\",\n    \"base58\",\n    \"base58check\",\n    \"bitcoin\",\n    \"bs58\",\n    \"check\",\n    \"checksum\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\",\n    \"litecoin\"\n  ],\n  \"homepage\": \"https://github.com/bitcoinjs/bs58check\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/bs58check/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Daniel Cousens\",\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"base.js\"\n  ],\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/bs58check.git\"\n  },\n  \"scripts\": {\n    \"coverage-report\": \"nyc report --reporter=lcov\",\n    \"coverage\": \"nyc --check-coverage --branches 90 --functions 90 npm run unit\",\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run coverage\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"dependencies\": {\n    \"@noble/hashes\": \"^1.2.0\",\n    \"bs58\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"blake-hash\": \"^1.0.0\",\n    \"nyc\": \"^15.0.0\",\n    \"safe-buffer\": \"^5.1.2\",\n    \"standard\": \"^14.3.3\",\n    \"tape\": \"^4.13.2\"\n  }\n}\n'use strict';\nmodule.exports = function (a, b) {\n\tif (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n\t\tthrow new TypeError('Arguments must be Buffers');\n\t}\n\n\tif (a === b) {\n\t\treturn true;\n\t}\n\n\tif (typeof a.equals === 'function') {\n\t\treturn a.equals(b);\n\t}\n\n\tif (a.length !== b.length) {\n\t\treturn false;\n\t}\n\n\tfor (var i = 0; i < a.length; i++) {\n\t\tif (a[i] !== b[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n};\n{\n  \"name\": \"buffer-equals\",\n  \"version\": \"1.0.4\",\n  \"description\": \"Node.js 0.12 buffer.equals() ponyfill\",\n  \"license\": \"MIT\",\n  \"repository\": \"sindresorhus/buffer-equals\",\n  \"author\": {\n    \"name\": \"Sindre Sorhus\",\n    \"email\": \"sindresorhus@gmail.com\",\n    \"url\": \"sindresorhus.com\"\n  },\n  \"engines\": {\n    \"node\": \">=0.10.0\"\n  },\n  \"scripts\": {\n    \"test\": \"xo && ava\"\n  },\n  \"files\": [\n    \"index.js\"\n  ],\n  \"keywords\": [\n    \"builtin\",\n    \"core\",\n    \"ponyfill\",\n    \"polyfill\",\n    \"shim\",\n    \"buffer\",\n    \"buffers\",\n    \"equals\",\n    \"equal\",\n    \"compare\",\n    \"comparison\"\n  ],\n  \"devDependencies\": {\n    \"ava\": \"*\",\n    \"xo\": \"*\"\n  }\n}\n'use strict';\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nconst mask = (source, mask, output, offset, length) => {\n  for (var i = 0; i < length; i++) {\n    output[offset + i] = source[i] ^ mask[i & 3];\n  }\n};\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nconst unmask = (buffer, mask) => {\n  // Required until https://github.com/nodejs/node/issues/9006 is resolved.\n  const length = buffer.length;\n  for (var i = 0; i < length; i++) {\n    buffer[i] ^= mask[i & 3];\n  }\n};\n\nmodule.exports = { mask, unmask };\n'use strict';\n\ntry {\n  module.exports = require('node-gyp-build')(__dirname);\n} catch (e) {\n  module.exports = require('./fallback');\n}\n{\n  \"name\": \"bufferutil\",\n  \"version\": \"4.1.0\",\n  \"description\": \"WebSocket buffer utils\",\n  \"main\": \"index.js\",\n  \"engines\": {\n    \"node\": \">=6.14.2\"\n  },\n  \"scripts\": {\n    \"install\": \"node-gyp-build\",\n    \"prebuild\": \"prebuildify --napi --strip --target=8.11.2\",\n    \"test\": \"mocha\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/websockets/bufferutil\"\n  },\n  \"keywords\": [\n    \"bufferutil\"\n  ],\n  \"author\": \"Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/websockets/bufferutil/issues\"\n  },\n  \"homepage\": \"https://github.com/websockets/bufferutil\",\n  \"dependencies\": {\n    \"node-gyp-build\": \"^4.3.0\"\n  },\n  \"devDependencies\": {\n    \"mocha\": \"^11.0.1\",\n    \"node-gyp\": \"^12.1.0\",\n    \"prebuildify\": \"^6.0.0\"\n  }\n}\nconst b4a = require('b4a')\n\nmodule.exports = codecs\n\ncodecs.ascii = createString('ascii')\ncodecs.utf8 = createString('utf-8')\ncodecs.hex = createString('hex')\ncodecs.base64 = createString('base64')\ncodecs.ucs2 = createString('ucs2')\ncodecs.utf16le = createString('utf16le')\ncodecs.ndjson = createJSON(true)\ncodecs.json = createJSON(false)\ncodecs.binary = {\n  name: 'binary',\n  encode: function encodeBinary (obj) {\n    return typeof obj === 'string'\n      ? b4a.from(obj, 'utf-8')\n      : b4a.toBuffer(obj)\n  },\n  decode: function decodeBinary (buf) {\n    return b4a.toBuffer(buf)\n  }\n}\n\nfunction isCompactEncoding (c) {\n  return !!(c.encode && c.decode && c.preencode)\n}\n\nfunction fromCompactEncoding (c) {\n  return {\n    name: 'compact-encoding',\n    encode: function encodeWithCompact (value) {\n      const state = { start: 0, end: 0, buffer: null, cache: null }\n      c.preencode(state, value)\n      state.buffer = b4a.allocUnsafe(state.end)\n      c.encode(state, value)\n      return state.buffer\n    },\n    decode: function decodeWithCompact (buffer) {\n      return c.decode({ start: 0, end: buffer.byteLength, buffer, cache: null })\n    }\n  }\n}\n\nfunction codecs (fmt, fallback) {\n  if (typeof fmt === 'object' && fmt) {\n    return isCompactEncoding(fmt) ? fromCompactEncoding(fmt) : fmt\n  }\n\n  switch (fmt) {\n    case 'ndjson': return codecs.ndjson\n    case 'json': return codecs.json\n    case 'ascii': return codecs.ascii\n    case 'utf-8':\n    case 'utf8': return codecs.utf8\n    case 'hex': return codecs.hex\n    case 'base64': return codecs.base64\n    case 'ucs-2':\n    case 'ucs2': return codecs.ucs2\n    case 'utf16-le':\n    case 'utf16le': return codecs.utf16le\n  }\n\n  return fallback !== undefined ? fallback : codecs.binary\n}\n\nfunction createJSON (newline) {\n  return {\n    name: newline ? 'ndjson' : 'json',\n    encode: newline ? encodeNDJSON : encodeJSON,\n    decode: function decodeJSON (buf) {\n      return JSON.parse(b4a.toString(buf))\n    }\n  }\n\n  function encodeJSON (val) {\n    return b4a.from(JSON.stringify(val))\n  }\n\n  function encodeNDJSON (val) {\n    return b4a.from(JSON.stringify(val) + '\\n')\n  }\n}\n\nfunction createString (type) {\n  return {\n    name: type,\n    encode: function encodeString (val) {\n      if (typeof val !== 'string') val = val.toString()\n      return b4a.from(val, type)\n    },\n    decode: function decodeString (buf) {\n      return b4a.toString(buf, type)\n    }\n  }\n}\n{\n  \"name\": \"codecs\",\n  \"version\": \"3.1.0\",\n  \"description\": \"Create an binary encoder/decoder for json, utf-8 or custom types\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.3\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.2.1\",\n    \"compact-encoding\": \"^2.11.0\",\n    \"standard\": \"^17.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/codecs.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/codecs/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/codecs\"\n}\nconst LE = (exports.LE =\n  new Uint8Array(new Uint16Array([0xff]).buffer)[0] === 0xff)\n\nexports.BE = !LE\nconst b4a = require('b4a')\n\nconst { BE } = require('./endian')\n\nexports.state = function (start = 0, end = 0, buffer = null) {\n  return { start, end, buffer }\n}\n\nconst raw = (exports.raw = require('./raw'))\n\nconst uint = (exports.uint = {\n  preencode(state, n) {\n    state.end += n <= 0xfc ? 1 : n <= 0xffff ? 3 : n <= 0xffffffff ? 5 : 9\n  },\n  encode(state, n) {\n    if (n <= 0xfc) uint8.encode(state, n)\n    else if (n <= 0xffff) {\n      state.buffer[state.start++] = 0xfd\n      uint16.encode(state, n)\n    } else if (n <= 0xffffffff) {\n      state.buffer[state.start++] = 0xfe\n      uint32.encode(state, n)\n    } else {\n      state.buffer[state.start++] = 0xff\n      uint64.encode(state, n)\n    }\n  },\n  decode(state) {\n    const a = uint8.decode(state)\n    if (a <= 0xfc) return a\n    if (a === 0xfd) return uint16.decode(state)\n    if (a === 0xfe) return uint32.decode(state)\n    return uint64.decode(state)\n  }\n})\n\nconst uint8 = (exports.uint8 = {\n  preencode(state, n) {\n    state.end += 1\n  },\n  encode(state, n) {\n    validateUint(n)\n    state.buffer[state.start++] = n\n  },\n  decode(state) {\n    if (state.start >= state.end) throw new Error('Out of bounds')\n    return state.buffer[state.start++]\n  }\n})\n\nconst uint16 = (exports.uint16 = {\n  preencode(state, n) {\n    state.end += 2\n  },\n  encode(state, n) {\n    validateUint(n)\n    state.buffer[state.start++] = n\n    state.buffer[state.start++] = n >>> 8\n  },\n  decode(state) {\n    if (state.end - state.start < 2) throw new Error('Out of bounds')\n    return state.buffer[state.start++] + state.buffer[state.start++] * 0x100\n  }\n})\n\nconst uint24 = (exports.uint24 = {\n  preencode(state, n) {\n    state.end += 3\n  },\n  encode(state, n) {\n    validateUint(n)\n    state.buffer[state.start++] = n\n    state.buffer[state.start++] = n >>> 8\n    state.buffer[state.start++] = n >>> 16\n  },\n  decode(state) {\n    if (state.end - state.start < 3) throw new Error('Out of bounds')\n    return (\n      state.buffer[state.start++] +\n      state.buffer[state.start++] * 0x100 +\n      state.buffer[state.start++] * 0x10000\n    )\n  }\n})\n\nconst uint32 = (exports.uint32 = {\n  preencode(state, n) {\n    state.end += 4\n  },\n  encode(state, n) {\n    validateUint(n)\n    state.buffer[state.start++] = n\n    state.buffer[state.start++] = n >>> 8\n    state.buffer[state.start++] = n >>> 16\n    state.buffer[state.start++] = n >>> 24\n  },\n  decode(state) {\n    if (state.end - state.start < 4) throw new Error('Out of bounds')\n    return (\n      state.buffer[state.start++] +\n      state.buffer[state.start++] * 0x100 +\n      state.buffer[state.start++] * 0x10000 +\n      state.buffer[state.start++] * 0x1000000\n    )\n  }\n})\n\nconst uint40 = (exports.uint40 = {\n  preencode(state, n) {\n    state.end += 5\n  },\n  encode(state, n) {\n    validateUint(n)\n    const r = Math.floor(n / 0x100)\n    uint8.encode(state, n)\n    uint32.encode(state, r)\n  },\n  decode(state) {\n    if (state.end - state.start < 5) throw new Error('Out of bounds')\n    return uint8.decode(state) + 0x100 * uint32.decode(state)\n  }\n})\n\nconst uint48 = (exports.uint48 = {\n  preencode(state, n) {\n    state.end += 6\n  },\n  encode(state, n) {\n    validateUint(n)\n    const r = Math.floor(n / 0x10000)\n    uint16.encode(state, n)\n    uint32.encode(state, r)\n  },\n  decode(state) {\n    if (state.end - state.start < 6) throw new Error('Out of bounds')\n    return uint16.decode(state) + 0x10000 * uint32.decode(state)\n  }\n})\n\nconst uint56 = (exports.uint56 = {\n  preencode(state, n) {\n    state.end += 7\n  },\n  encode(state, n) {\n    validateUint(n)\n    const r = Math.floor(n / 0x1000000)\n    uint24.encode(state, n)\n    uint32.encode(state, r)\n  },\n  decode(state) {\n    if (state.end - state.start < 7) throw new Error('Out of bounds')\n    return uint24.decode(state) + 0x1000000 * uint32.decode(state)\n  }\n})\n\nconst uint64 = (exports.uint64 = {\n  preencode(state, n) {\n    state.end += 8\n  },\n  encode(state, n) {\n    validateUint(n)\n    const r = Math.floor(n / 0x100000000)\n    uint32.encode(state, n)\n    uint32.encode(state, r)\n  },\n  decode(state) {\n    if (state.end - state.start < 8) throw new Error('Out of bounds')\n    return uint32.decode(state) + 0x100000000 * uint32.decode(state)\n  }\n})\n\nconst int = (exports.int = zigZagInt(uint))\nexports.int8 = zigZagInt(uint8)\nexports.int16 = zigZagInt(uint16)\nexports.int24 = zigZagInt(uint24)\nexports.int32 = zigZagInt(uint32)\nexports.int40 = zigZagInt(uint40)\nexports.int48 = zigZagInt(uint48)\nexports.int56 = zigZagInt(uint56)\nexports.int64 = zigZagInt(uint64)\n\nconst biguint64 = (exports.biguint64 = {\n  preencode(state, n) {\n    state.end += 8\n  },\n  encode(state, n) {\n    const view = new DataView(\n      state.buffer.buffer,\n      state.start + state.buffer.byteOffset,\n      8\n    )\n    view.setBigUint64(0, n, true) // little endian\n    state.start += 8\n  },\n  decode(state) {\n    if (state.end - state.start < 8) throw new Error('Out of bounds')\n    const view = new DataView(\n      state.buffer.buffer,\n      state.start + state.buffer.byteOffset,\n      8\n    )\n    const n = view.getBigUint64(0, true) // little endian\n    state.start += 8\n    return n\n  }\n})\n\nexports.bigint64 = zigZagBigInt(biguint64)\n\nconst biguint = (exports.biguint = {\n  preencode(state, n) {\n    let len = 0\n    for (let m = n; m; m = m >> 64n) len++\n    uint.preencode(state, len)\n    state.end += 8 * len\n  },\n  encode(state, n) {\n    let len = 0\n    for (let m = n; m; m = m >> 64n) len++\n    uint.encode(state, len)\n    const view = new DataView(\n      state.buffer.buffer,\n      state.start + state.buffer.byteOffset,\n      8 * len\n    )\n    for (let m = n, i = 0; m; m = m >> 64n, i += 8) {\n      view.setBigUint64(i, BigInt.asUintN(64, m), true) // little endian\n    }\n    state.start += 8 * len\n  },\n  decode(state) {\n    const len = uint.decode(state)\n    if (state.end - state.start < 8 * len) throw new Error('Out of bounds')\n    const view = new DataView(\n      state.buffer.buffer,\n      state.start + state.buffer.byteOffset,\n      8 * len\n    )\n    let n = 0n\n    for (let i = len - 1; i >= 0; i--)\n      n = (n << 64n) + view.getBigUint64(i * 8, true) // little endian\n    state.start += 8 * len\n    return n\n  }\n})\n\nexports.bigint = zigZagBigInt(biguint)\n\nexports.lexint = require('./lexint')\n\nexports.float32 = {\n  preencode(state, n) {\n    state.end += 4\n  },\n  encode(state, n) {\n    const view = new DataView(\n      state.buffer.buffer,\n      state.start + state.buffer.byteOffset,\n      4\n    )\n    view.setFloat32(0, n, true) // little endian\n    state.start += 4\n  },\n  decode(state) {\n    if (state.end - state.start < 4) throw new Error('Out of bounds')\n    const view = new DataView(\n      state.buffer.buffer,\n      state.start + state.buffer.byteOffset,\n      4\n    )\n    const float = view.getFloat32(0, true) // little endian\n    state.start += 4\n    return float\n  }\n}\n\nexports.float64 = {\n  preencode(state, n) {\n    state.end += 8\n  },\n  encode(state, n) {\n    const view = new DataView(\n      state.buffer.buffer,\n      state.start + state.buffer.byteOffset,\n      8\n    )\n    view.setFloat64(0, n, true) // little endian\n    state.start += 8\n  },\n  decode(state) {\n    if (state.end - state.start < 8) throw new Error('Out of bounds')\n    const view = new DataView(\n      state.buffer.buffer,\n      state.start + state.buffer.byteOffset,\n      8\n    )\n    const float = view.getFloat64(0, true) // little endian\n    state.start += 8\n    return float\n  }\n}\n\nconst buffer = (exports.buffer = {\n  preencode(state, b) {\n    if (b) uint8array.preencode(state, b)\n    else state.end++\n  },\n  encode(state, b) {\n    if (b) uint8array.encode(state, b)\n    else state.buffer[state.start++] = 0\n  },\n  decode(state) {\n    const len = uint.decode(state)\n    if (len === 0) return null\n    if (state.end - state.start < len) throw new Error('Out of bounds')\n    return state.buffer.subarray(state.start, (state.start += len))\n  }\n})\n\nexports.binary = {\n  ...buffer,\n  preencode(state, b) {\n    if (typeof b === 'string') utf8.preencode(state, b)\n    else buffer.preencode(state, b)\n  },\n  encode(state, b) {\n    if (typeof b === 'string') utf8.encode(state, b)\n    else buffer.encode(state, b)\n  }\n}\n\nexports.arraybuffer = {\n  preencode(state, b) {\n    uint.preencode(state, b.byteLength)\n    state.end += b.byteLength\n  },\n  encode(state, b) {\n    uint.encode(state, b.byteLength)\n\n    const view = new Uint8Array(b)\n\n    state.buffer.set(view, state.start)\n    state.start += b.byteLength\n  },\n  decode(state) {\n    const len = uint.decode(state)\n\n    const b = new ArrayBuffer(len)\n    const view = new Uint8Array(b)\n\n    view.set(state.buffer.subarray(state.start, (state.start += len)))\n\n    return b\n  }\n}\n\nfunction typedarray(TypedArray, swap) {\n  const n = TypedArray.BYTES_PER_ELEMENT\n\n  return {\n    preencode(state, b) {\n      uint.preencode(state, b.length)\n      state.end += b.byteLength\n    },\n    encode(state, b) {\n      uint.encode(state, b.length)\n\n      const view = new Uint8Array(b.buffer, b.byteOffset, b.byteLength)\n\n      if (BE && swap) swap(view)\n\n      state.buffer.set(view, state.start)\n      state.start += b.byteLength\n    },\n    decode(state) {\n      const len = uint.decode(state)\n\n      let b = state.buffer.subarray(state.start, (state.start += len * n))\n      if (b.byteLength !== len * n) throw new Error('Out of bounds')\n      if (b.byteOffset % n !== 0) b = new Uint8Array(b)\n\n      if (BE && swap) swap(b)\n\n      return new TypedArray(b.buffer, b.byteOffset, b.byteLength / n)\n    }\n  }\n}\n\nconst uint8array = (exports.uint8array = typedarray(Uint8Array))\nexports.uint16array = typedarray(Uint16Array, b4a.swap16)\nexports.uint32array = typedarray(Uint32Array, b4a.swap32)\n\nexports.int8array = typedarray(Int8Array)\nexports.int16array = typedarray(Int16Array, b4a.swap16)\nexports.int32array = typedarray(Int32Array, b4a.swap32)\n\nexports.biguint64array = typedarray(BigUint64Array, b4a.swap64)\nexports.bigint64array = typedarray(BigInt64Array, b4a.swap64)\n\nexports.float32array = typedarray(Float32Array, b4a.swap32)\nexports.float64array = typedarray(Float64Array, b4a.swap64)\n\nfunction string(encoding) {\n  return {\n    preencode(state, s) {\n      const len = b4a.byteLength(s, encoding)\n      uint.preencode(state, len)\n      state.end += len\n    },\n    encode(state, s) {\n      const len = b4a.byteLength(s, encoding)\n      uint.encode(state, len)\n      b4a.write(state.buffer, s, state.start, encoding)\n      state.start += len\n    },\n    decode(state) {\n      const len = uint.decode(state)\n      if (state.end - state.start < len) throw new Error('Out of bounds')\n      return b4a.toString(\n        state.buffer,\n        encoding,\n        state.start,\n        (state.start += len)\n      )\n    },\n    fixed(n) {\n      return {\n        preencode(state) {\n          state.end += n\n        },\n        encode(state, s) {\n          b4a.write(state.buffer, s, state.start, n, encoding)\n          state.start += n\n        },\n        decode(state) {\n          if (state.end - state.start < n) throw new Error('Out of bounds')\n          return b4a.toString(\n            state.buffer,\n            encoding,\n            state.start,\n            (state.start += n)\n          )\n        }\n      }\n    }\n  }\n}\n\nconst utf8 = (exports.string = exports.utf8 = string('utf-8'))\nexports.ascii = string('ascii')\nexports.hex = string('hex')\nexports.base64 = string('base64')\nexports.ucs2 = exports.utf16le = string('utf16le')\n\nexports.bool = {\n  preencode(state, b) {\n    state.end++\n  },\n  encode(state, b) {\n    state.buffer[state.start++] = b ? 1 : 0\n  },\n  decode(state) {\n    if (state.start >= state.end) throw Error('Out of bounds')\n    return state.buffer[state.start++] === 1\n  }\n}\n\nconst fixed = (exports.fixed = function fixed(n) {\n  return {\n    preencode(state, s) {\n      if (s.byteLength !== n) throw new Error('Incorrect buffer size')\n      state.end += n\n    },\n    encode(state, s) {\n      state.buffer.set(s, state.start)\n      state.start += n\n    },\n    decode(state) {\n      if (state.end - state.start < n) throw new Error('Out of bounds')\n      return state.buffer.subarray(state.start, (state.start += n))\n    }\n  }\n})\n\nexports.fixed32 = fixed(32)\nexports.fixed64 = fixed(64)\n\nexports.array = function array(enc) {\n  return {\n    preencode(state, list) {\n      uint.preencode(state, list.length)\n      for (let i = 0; i < list.length; i++) enc.preencode(state, list[i])\n    },\n    encode(state, list) {\n      uint.encode(state, list.length)\n      for (let i = 0; i < list.length; i++) enc.encode(state, list[i])\n    },\n    decode(state) {\n      const len = uint.decode(state)\n      if (len > 0x100000) throw new Error('Array is too big')\n      const arr = new Array(len)\n      for (let i = 0; i < len; i++) arr[i] = enc.decode(state)\n      return arr\n    }\n  }\n}\n\nexports.frame = function frame(enc) {\n  const dummy = exports.state()\n\n  return {\n    preencode(state, m) {\n      const end = state.end\n      enc.preencode(state, m)\n      uint.preencode(state, state.end - end)\n    },\n    encode(state, m) {\n      dummy.end = 0\n      enc.preencode(dummy, m)\n      uint.encode(state, dummy.end)\n      enc.encode(state, m)\n    },\n    decode(state) {\n      const end = state.end\n      const len = uint.decode(state)\n      state.end = state.start + len\n      const m = enc.decode(state)\n      state.start = state.end\n      state.end = end\n      return m\n    }\n  }\n}\n\nexports.date = {\n  preencode(state, d) {\n    int.preencode(state, d.getTime())\n  },\n  encode(state, d) {\n    int.encode(state, d.getTime())\n  },\n  decode(state, d) {\n    return new Date(int.decode(state))\n  }\n}\n\nexports.json = {\n  preencode(state, v) {\n    utf8.preencode(state, JSON.stringify(v))\n  },\n  encode(state, v) {\n    utf8.encode(state, JSON.stringify(v))\n  },\n  decode(state) {\n    return JSON.parse(utf8.decode(state))\n  }\n}\n\nexports.ndjson = {\n  preencode(state, v) {\n    utf8.preencode(state, JSON.stringify(v) + '\\n')\n  },\n  encode(state, v) {\n    utf8.encode(state, JSON.stringify(v) + '\\n')\n  },\n  decode(state) {\n    return JSON.parse(utf8.decode(state))\n  }\n}\n\n// simple helper for when you want to just express nothing\nexports.none = {\n  preencode(state, n) {\n    // do nothing\n  },\n  encode(state, n) {\n    // do nothing\n  },\n  decode(state) {\n    return null\n  }\n}\n\n// \"any\" encoders here for helping just structure any object without schematising it\n\nconst anyArray = {\n  preencode(state, arr) {\n    uint.preencode(state, arr.length)\n    for (let i = 0; i < arr.length; i++) {\n      any.preencode(state, arr[i])\n    }\n  },\n  encode(state, arr) {\n    uint.encode(state, arr.length)\n    for (let i = 0; i < arr.length; i++) {\n      any.encode(state, arr[i])\n    }\n  },\n  decode(state) {\n    const arr = []\n    let len = uint.decode(state)\n    while (len-- > 0) {\n      arr.push(any.decode(state))\n    }\n    return arr\n  }\n}\n\nconst anyObject = {\n  preencode(state, o) {\n    const keys = Object.keys(o)\n    uint.preencode(state, keys.length)\n    for (const key of keys) {\n      utf8.preencode(state, key)\n      any.preencode(state, o[key])\n    }\n  },\n  encode(state, o) {\n    const keys = Object.keys(o)\n    uint.encode(state, keys.length)\n    for (const key of keys) {\n      utf8.encode(state, key)\n      any.encode(state, o[key])\n    }\n  },\n  decode(state) {\n    let len = uint.decode(state)\n    const o = {}\n    while (len-- > 0) {\n      const key = utf8.decode(state)\n      o[key] = any.decode(state)\n    }\n    return o\n  }\n}\n\nconst anyTypes = [\n  exports.none,\n  exports.bool,\n  exports.string,\n  exports.buffer,\n  exports.uint,\n  exports.int,\n  exports.float64,\n  anyArray,\n  anyObject,\n  exports.date\n]\n\nconst any = (exports.any = {\n  preencode(state, o) {\n    const t = getType(o)\n    uint.preencode(state, t)\n    anyTypes[t].preencode(state, o)\n  },\n  encode(state, o) {\n    const t = getType(o)\n    uint.encode(state, t)\n    anyTypes[t].encode(state, o)\n  },\n  decode(state) {\n    const t = uint.decode(state)\n    if (t >= anyTypes.length) throw new Error('Unknown type: ' + t)\n    return anyTypes[t].decode(state)\n  }\n})\n\nconst port = (exports.port = uint16)\n\nconst address = (host, family) => {\n  return {\n    preencode(state, m) {\n      host.preencode(state, m.host)\n      port.preencode(state, m.port)\n    },\n    encode(state, m) {\n      host.encode(state, m.host)\n      port.encode(state, m.port)\n    },\n    decode(state) {\n      return {\n        host: host.decode(state),\n        family,\n        port: port.decode(state)\n      }\n    }\n  }\n}\n\nconst ipv4 = (exports.ipv4 = {\n  preencode(state) {\n    state.end += 4\n  },\n  encode(state, string) {\n    const start = state.start\n    const end = start + 4\n\n    let i = 0\n\n    while (i < string.length) {\n      let n = 0\n      let c\n\n      while (\n        i < string.length &&\n        (c = string.charCodeAt(i++)) !== /* . */ 0x2e\n      ) {\n        n = n * 10 + (c - /* 0 */ 0x30)\n      }\n\n      state.buffer[state.start++] = n\n    }\n\n    state.start = end\n  },\n  decode(state) {\n    if (state.end - state.start < 4) throw new Error('Out of bounds')\n    return (\n      state.buffer[state.start++] +\n      '.' +\n      state.buffer[state.start++] +\n      '.' +\n      state.buffer[state.start++] +\n      '.' +\n      state.buffer[state.start++]\n    )\n  }\n})\n\nexports.ipv4Address = address(ipv4, 4)\n\nconst ipv6 = (exports.ipv6 = {\n  preencode(state) {\n    state.end += 16\n  },\n  encode(state, string) {\n    const start = state.start\n    const end = start + 16\n\n    let i = 0\n    let split = null\n\n    while (i < string.length) {\n      let n = 0\n      let c\n\n      while (\n        i < string.length &&\n        (c = string.charCodeAt(i++)) !== /* : */ 0x3a\n      ) {\n        if (c >= 0x30 && c <= 0x39) n = n * 0x10 + (c - /* 0 */ 0x30)\n        else if (c >= 0x41 && c <= 0x46) n = n * 0x10 + (c - /* A */ 0x41 + 10)\n        else if (c >= 0x61 && c <= 0x66) n = n * 0x10 + (c - /* a */ 0x61 + 10)\n      }\n\n      state.buffer[state.start++] = n >>> 8\n      state.buffer[state.start++] = n\n\n      if (i < string.length && string.charCodeAt(i) === /* : */ 0x3a) {\n        i++\n        split = state.start\n      }\n    }\n\n    if (split !== null) {\n      const offset = end - state.start\n      state.buffer\n        .copyWithin(split + offset, split)\n        .fill(0, split, split + offset)\n    }\n\n    state.start = end\n  },\n  decode(state) {\n    if (state.end - state.start < 16) throw new Error('Out of bounds')\n    return (\n      (\n        state.buffer[state.start++] * 256 +\n        state.buffer[state.start++]\n      ).toString(16) +\n      ':' +\n      (\n        state.buffer[state.start++] * 256 +\n        state.buffer[state.start++]\n      ).toString(16) +\n      ':' +\n      (\n        state.buffer[state.start++] * 256 +\n        state.buffer[state.start++]\n      ).toString(16) +\n      ':' +\n      (\n        state.buffer[state.start++] * 256 +\n        state.buffer[state.start++]\n      ).toString(16) +\n      ':' +\n      (\n        state.buffer[state.start++] * 256 +\n        state.buffer[state.start++]\n      ).toString(16) +\n      ':' +\n      (\n        state.buffer[state.start++] * 256 +\n        state.buffer[state.start++]\n      ).toString(16) +\n      ':' +\n      (\n        state.buffer[state.start++] * 256 +\n        state.buffer[state.start++]\n      ).toString(16) +\n      ':' +\n      (\n        state.buffer[state.start++] * 256 +\n        state.buffer[state.start++]\n      ).toString(16)\n    )\n  }\n})\n\nexports.ipv6Address = address(ipv6, 6)\n\nconst ip = (exports.ip = {\n  preencode(state, string) {\n    const family = string.includes(':') ? 6 : 4\n    uint8.preencode(state, family)\n    if (family === 4) ipv4.preencode(state)\n    else ipv6.preencode(state)\n  },\n  encode(state, string) {\n    const family = string.includes(':') ? 6 : 4\n    uint8.encode(state, family)\n    if (family === 4) ipv4.encode(state, string)\n    else ipv6.encode(state, string)\n  },\n  decode(state) {\n    const family = uint8.decode(state)\n    if (family === 4) return ipv4.decode(state)\n    else return ipv6.decode(state)\n  }\n})\n\nexports.ipAddress = {\n  preencode(state, m) {\n    ip.preencode(state, m.host)\n    port.preencode(state, m.port)\n  },\n  encode(state, m) {\n    ip.encode(state, m.host)\n    port.encode(state, m.port)\n  },\n  decode(state) {\n    const family = uint8.decode(state)\n    return {\n      host: family === 4 ? ipv4.decode(state) : ipv6.decode(state),\n      family,\n      port: port.decode(state)\n    }\n  }\n}\n\nfunction getType(o) {\n  if (o === null || o === undefined) return 0\n  if (typeof o === 'boolean') return 1\n  if (typeof o === 'string') return 2\n  if (b4a.isBuffer(o)) return 3\n  if (typeof o === 'number') {\n    if (Number.isInteger(o)) return o >= 0 ? 4 : 5\n    return 6\n  }\n  if (Array.isArray(o)) return 7\n  if (o instanceof Date) return 9\n  if (typeof o === 'object') return 8\n\n  throw new Error('Unsupported type for ' + o)\n}\n\nexports.from = function from(enc) {\n  if (typeof enc === 'string') return fromNamed(enc)\n  if (enc.preencode) return enc\n  if (enc.encodingLength) return fromAbstractEncoder(enc)\n  return fromCodec(enc)\n}\n\nfunction fromNamed(enc) {\n  switch (enc) {\n    case 'ascii':\n      return raw.ascii\n    case 'utf-8':\n    case 'utf8':\n      return raw.utf8\n    case 'hex':\n      return raw.hex\n    case 'base64':\n      return raw.base64\n    case 'utf16-le':\n    case 'utf16le':\n    case 'ucs-2':\n    case 'ucs2':\n      return raw.ucs2\n    case 'ndjson':\n      return raw.ndjson\n    case 'json':\n      return raw.json\n    case 'binary':\n    default:\n      return raw.binary\n  }\n}\n\nfunction fromCodec(enc) {\n  let tmpM = null\n  let tmpBuf = null\n\n  return {\n    preencode(state, m) {\n      tmpM = m\n      tmpBuf = enc.encode(m)\n      state.end += tmpBuf.byteLength\n    },\n    encode(state, m) {\n      raw.encode(state, m === tmpM ? tmpBuf : enc.encode(m))\n      tmpM = tmpBuf = null\n    },\n    decode(state) {\n      return enc.decode(raw.decode(state))\n    }\n  }\n}\n\nfunction fromAbstractEncoder(enc) {\n  return {\n    preencode(state, m) {\n      state.end += enc.encodingLength(m)\n    },\n    encode(state, m) {\n      enc.encode(m, state.buffer, state.start)\n      state.start += enc.encode.bytes\n    },\n    decode(state) {\n      const m = enc.decode(state.buffer, state.start, state.end)\n      state.start += enc.decode.bytes\n      return m\n    }\n  }\n}\n\nexports.encode = function encode(enc, m) {\n  const state = exports.state()\n  enc.preencode(state, m)\n  state.buffer = b4a.allocUnsafe(state.end)\n  enc.encode(state, m)\n  return state.buffer\n}\n\nexports.decode = function decode(enc, buffer) {\n  return enc.decode(exports.state(0, buffer.byteLength, buffer))\n}\n\nfunction zigZagInt(enc) {\n  return {\n    preencode(state, n) {\n      enc.preencode(state, zigZagEncodeInt(n))\n    },\n    encode(state, n) {\n      enc.encode(state, zigZagEncodeInt(n))\n    },\n    decode(state) {\n      return zigZagDecodeInt(enc.decode(state))\n    }\n  }\n}\n\nfunction zigZagDecodeInt(n) {\n  return n === 0 ? n : (n & 1) === 0 ? n / 2 : -(n + 1) / 2\n}\n\nfunction zigZagEncodeInt(n) {\n  // 0, -1, 1, -2, 2, ...\n  return n < 0 ? 2 * -n - 1 : n === 0 ? 0 : 2 * n\n}\n\nfunction zigZagBigInt(enc) {\n  return {\n    preencode(state, n) {\n      enc.preencode(state, zigZagEncodeBigInt(n))\n    },\n    encode(state, n) {\n      enc.encode(state, zigZagEncodeBigInt(n))\n    },\n    decode(state) {\n      return zigZagDecodeBigInt(enc.decode(state))\n    }\n  }\n}\n\nfunction zigZagDecodeBigInt(n) {\n  return n === 0n ? n : (n & 1n) === 0n ? n / 2n : -(n + 1n) / 2n\n}\n\nfunction zigZagEncodeBigInt(n) {\n  // 0, -1, 1, -2, 2, ...\n  return n < 0n ? 2n * -n - 1n : n === 0n ? 0n : 2n * n\n}\n\nfunction validateUint(n) {\n  if (n >= 0 === false /* Handles NaN as well */)\n    throw new Error('uint must be positive')\n}\nmodule.exports = {\n  preencode,\n  encode,\n  decode\n}\n\nfunction preencode(state, num) {\n  if (num < 251) {\n    state.end++\n  } else if (num < 256) {\n    state.end += 2\n  } else if (num < 0x10000) {\n    state.end += 3\n  } else if (num < 0x1000000) {\n    state.end += 4\n  } else if (num < 0x100000000) {\n    state.end += 5\n  } else {\n    state.end++\n    const exp = Math.floor(Math.log(num) / Math.log(2)) - 32\n    preencode(state, exp)\n    state.end += 6\n  }\n}\n\nfunction encode(state, num) {\n  const max = 251\n  const x = num - max\n\n  if (num < max) {\n    state.buffer[state.start++] = num\n  } else if (num < 256) {\n    state.buffer[state.start++] = max\n    state.buffer[state.start++] = x\n  } else if (num < 0x10000) {\n    state.buffer[state.start++] = max + 1\n    state.buffer[state.start++] = (x >> 8) & 0xff\n    state.buffer[state.start++] = x & 0xff\n  } else if (num < 0x1000000) {\n    state.buffer[state.start++] = max + 2\n    state.buffer[state.start++] = x >> 16\n    state.buffer[state.start++] = (x >> 8) & 0xff\n    state.buffer[state.start++] = x & 0xff\n  } else if (num < 0x100000000) {\n    state.buffer[state.start++] = max + 3\n    state.buffer[state.start++] = x >> 24\n    state.buffer[state.start++] = (x >> 16) & 0xff\n    state.buffer[state.start++] = (x >> 8) & 0xff\n    state.buffer[state.start++] = x & 0xff\n  } else {\n    // need to use Math here as bitwise ops are 32 bit\n    const exp = Math.floor(Math.log(x) / Math.log(2)) - 32\n    state.buffer[state.start++] = 0xff\n\n    encode(state, exp)\n    const rem = x / Math.pow(2, exp - 11)\n\n    for (let i = 5; i >= 0; i--) {\n      state.buffer[state.start++] = (rem / Math.pow(2, 8 * i)) & 0xff\n    }\n  }\n}\n\nfunction decode(state) {\n  const max = 251\n\n  if (state.end - state.start < 1) throw new Error('Out of bounds')\n\n  const flag = state.buffer[state.start++]\n\n  if (flag < max) return flag\n\n  if (state.end - state.start < flag - max + 1) {\n    throw new Error('Out of bounds.')\n  }\n\n  if (flag < 252) {\n    return state.buffer[state.start++] + max\n  }\n\n  if (flag < 253) {\n    return (\n      (state.buffer[state.start++] << 8) + state.buffer[state.start++] + max\n    )\n  }\n\n  if (flag < 254) {\n    return (\n      (state.buffer[state.start++] << 16) +\n      (state.buffer[state.start++] << 8) +\n      state.buffer[state.start++] +\n      max\n    )\n  }\n\n  // << 24 result may be interpreted as negative\n  if (flag < 255) {\n    return (\n      state.buffer[state.start++] * 0x1000000 +\n      (state.buffer[state.start++] << 16) +\n      (state.buffer[state.start++] << 8) +\n      state.buffer[state.start++] +\n      max\n    )\n  }\n\n  const exp = decode(state)\n\n  if (state.end - state.start < 6) throw new Error('Out of bounds')\n\n  let rem = 0\n  for (let i = 5; i >= 0; i--) {\n    rem += state.buffer[state.start++] * Math.pow(2, 8 * i)\n  }\n\n  return rem * Math.pow(2, exp - 11) + max\n}\n{\n  \"name\": \"compact-encoding\",\n  \"version\": \"2.18.0\",\n  \"description\": \"A series of compact encoding schemes for building small and fast parsers and serializers\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"b4a\": \"^1.3.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.0.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^1.0.0\"\n  },\n  \"scripts\": {\n    \"format\": \"prettier . --write\",\n    \"test\": \"prettier . --check && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/compact-encoding/compact-encoding.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/compact-encoding/compact-encoding/issues\"\n  },\n  \"homepage\": \"https://github.com/compact-encoding/compact-encoding\"\n}\nconst b4a = require('b4a')\n\nconst { BE } = require('./endian')\n\nexports = module.exports = {\n  preencode(state, b) {\n    state.end += b.byteLength\n  },\n  encode(state, b) {\n    state.buffer.set(b, state.start)\n    state.start += b.byteLength\n  },\n  decode(state) {\n    const b = state.buffer.subarray(state.start, state.end)\n    state.start = state.end\n    return b\n  }\n}\n\nconst buffer = (exports.buffer = {\n  preencode(state, b) {\n    if (b) uint8array.preencode(state, b)\n    else state.end++\n  },\n  encode(state, b) {\n    if (b) uint8array.encode(state, b)\n    else state.buffer[state.start++] = 0\n  },\n  decode(state) {\n    const b = state.buffer.subarray(state.start)\n    if (b.byteLength === 0) return null\n    state.start = state.end\n    return b\n  }\n})\n\nexports.binary = {\n  ...buffer,\n  preencode(state, b) {\n    if (typeof b === 'string') utf8.preencode(state, b)\n    else buffer.preencode(state, b)\n  },\n  encode(state, b) {\n    if (typeof b === 'string') utf8.encode(state, b)\n    else buffer.encode(state, b)\n  }\n}\n\nexports.arraybuffer = {\n  preencode(state, b) {\n    state.end += b.byteLength\n  },\n  encode(state, b) {\n    const view = new Uint8Array(b)\n\n    state.buffer.set(view, state.start)\n    state.start += b.byteLength\n  },\n  decode(state) {\n    const b = new ArrayBuffer(state.end - state.start)\n    const view = new Uint8Array(b)\n\n    view.set(state.buffer.subarray(state.start))\n\n    state.start = state.end\n\n    return b\n  }\n}\n\nfunction typedarray(TypedArray, swap) {\n  const n = TypedArray.BYTES_PER_ELEMENT\n\n  return {\n    preencode(state, b) {\n      state.end += b.byteLength\n    },\n    encode(state, b) {\n      const view = new Uint8Array(b.buffer, b.byteOffset, b.byteLength)\n\n      if (BE && swap) swap(view)\n\n      state.buffer.set(view, state.start)\n      state.start += b.byteLength\n    },\n    decode(state) {\n      let b = state.buffer.subarray(state.start)\n      if (b.byteOffset % n !== 0) b = new Uint8Array(b)\n\n      if (BE && swap) swap(b)\n\n      state.start = state.end\n\n      return new TypedArray(b.buffer, b.byteOffset, b.byteLength / n)\n    }\n  }\n}\n\nconst uint8array = (exports.uint8array = typedarray(Uint8Array))\nexports.uint16array = typedarray(Uint16Array, b4a.swap16)\nexports.uint32array = typedarray(Uint32Array, b4a.swap32)\n\nexports.int8array = typedarray(Int8Array)\nexports.int16array = typedarray(Int16Array, b4a.swap16)\nexports.int32array = typedarray(Int32Array, b4a.swap32)\n\nexports.biguint64array = typedarray(BigUint64Array, b4a.swap64)\nexports.bigint64array = typedarray(BigInt64Array, b4a.swap64)\n\nexports.float32array = typedarray(Float32Array, b4a.swap32)\nexports.float64array = typedarray(Float64Array, b4a.swap64)\n\nfunction string(encoding) {\n  return {\n    preencode(state, s) {\n      state.end += b4a.byteLength(s, encoding)\n    },\n    encode(state, s) {\n      state.start += b4a.write(state.buffer, s, state.start, encoding)\n    },\n    decode(state) {\n      const s = b4a.toString(state.buffer, encoding, state.start)\n      state.start = state.end\n      return s\n    }\n  }\n}\n\nconst utf8 = (exports.string = exports.utf8 = string('utf-8'))\nexports.ascii = string('ascii')\nexports.hex = string('hex')\nexports.base64 = string('base64')\nexports.ucs2 = exports.utf16le = string('utf16le')\n\nexports.array = function array(enc) {\n  return {\n    preencode(state, list) {\n      for (const value of list) enc.preencode(state, value)\n    },\n    encode(state, list) {\n      for (const value of list) enc.encode(state, value)\n    },\n    decode(state) {\n      const arr = []\n      while (state.start < state.end) arr.push(enc.decode(state))\n      return arr\n    }\n  }\n}\n\nexports.json = {\n  preencode(state, v) {\n    utf8.preencode(state, JSON.stringify(v))\n  },\n  encode(state, v) {\n    utf8.encode(state, JSON.stringify(v))\n  },\n  decode(state) {\n    return JSON.parse(utf8.decode(state))\n  }\n}\n\nexports.ndjson = {\n  preencode(state, v) {\n    utf8.preencode(state, JSON.stringify(v) + '\\n')\n  },\n  encode(state, v) {\n    utf8.encode(state, JSON.stringify(v) + '\\n')\n  },\n  decode(state) {\n    return JSON.parse(utf8.decode(state))\n  }\n}\nconst safetyCatch = require('safety-catch')\n\nmodule.exports = class CoreCoupler {\n  constructor (target, wakeup) {\n    this.target = target\n    this.wakeup = wakeup\n    this.coupled = new Set()\n\n    this._onpeeraddBound = this._onpeeradd.bind(this)\n    this.target.on('peer-add', this._onpeeraddBound)\n  }\n\n  add (core) {\n    const added = this.coupled.size\n    this.coupled.add(core)\n    if (added !== this.coupled.size) this._couple(core)\n  }\n\n  remove (core) {\n    this.coupled.delete(core)\n  }\n\n  destroy () {\n    this.target.off('peer-add', this._onpeeraddBound)\n  }\n\n  async update (stream) {\n    const muxer = stream.userData\n    if (!muxer) return\n\n    try {\n      if (!(await this._hasMuxer(this.target, muxer))) return\n\n      let wakeup = null\n\n      for (const core of this.coupled) {\n        if (await this._hasMuxer(core, muxer)) continue\n        if (wakeup === null) wakeup = []\n        wakeup.push(core)\n      }\n\n      if (wakeup !== null) {\n        this.wakeup(stream, wakeup)\n      }\n    } catch (err) {\n      safetyCatch(err)\n    }\n  }\n\n  async _couple (core) {\n    try {\n      let wakeup = null\n\n      for (const peer of this.target.peers) {\n        if (await this._hasPeer(core, peer)) continue\n        if (wakeup === null) wakeup = []\n        wakeup.push(peer)\n      }\n\n      if (wakeup !== null && this.coupled.has(core)) {\n        for (const peer of wakeup) this.wakeup(peer.stream, [core])\n      }\n    } catch (err) {\n      safetyCatch(err)\n    }\n  }\n\n  async _onpeeradd (peer) {\n    try {\n      let wakeup = null\n\n      for (const core of this.coupled) {\n        if (await this._hasPeer(core, peer)) continue\n        if (wakeup === null) wakeup = []\n        wakeup.push(core)\n      }\n\n      if (wakeup !== null) {\n        this.wakeup(peer.stream, wakeup)\n      }\n    } catch (err) {\n      safetyCatch(err)\n    }\n  }\n\n  _hasMuxer (core, muxer) {\n    const ch = muxer.getLastChannel({ protocol: 'hypercore', id: core.discoveryKey })\n    if (ch) return ch.fullyOpened()\n\n    const cha = muxer.getLastChannel({ protocol: 'hypercore/alpha', id: core.discoveryKey })\n    if (cha) return cha.fullyOpened()\n\n    return Promise.resolve(false)\n  }\n\n  _hasPeer (core, peer) {\n    return this._hasMuxer(core, peer.protomux)\n  }\n}\n{\n  \"name\": \"core-coupler\",\n  \"version\": \"2.0.0\",\n  \"description\": \"Couple the peers of cores\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"standard\"\n  },\n  \"dependencies\": {\n    \"safety-catch\": \"^1.0.2\"\n  },\n  \"devDependencies\": {\n    \"corestore\": \"^6.18.2\",\n    \"standard\": \"^17.1.0\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/core-coupler.git\"\n  },\n  \"author\": \"Holepunch Inc\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/core-coupler/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/core-coupler\"\n}\nconst b4a = require('b4a')\nconst Hypercore = require('hypercore')\nconst ReadyResource = require('ready-resource')\nconst sodium = require('sodium-universal')\nconst crypto = require('hypercore-crypto')\nconst ID = require('hypercore-id-encoding')\nconst { isAndroid } = require('which-runtime')\nconst { STORAGE_EMPTY, ASSERTION } = require('hypercore-errors')\n\nconst auditStore = require('./lib/audit.js')\n\nconst [NS] = crypto.namespace('corestore', 1)\nconst DEFAULT_NAMESPACE = b4a.alloc(32) // This is meant to be 32 0-bytes\n\nclass StreamTracker {\n  constructor() {\n    this.records = []\n  }\n\n  add(stream, isExternal) {\n    const record = { index: 0, stream, isExternal }\n    record.index = this.records.push(record) - 1\n    return record\n  }\n\n  remove(record) {\n    const popped = this.records.pop()\n    if (popped === record) return\n    this.records[(popped.index = record.index)] = popped\n  }\n\n  attachAll(core) {\n    for (let i = 0; i < this.records.length; i++) {\n      const record = this.records[i]\n      const muxer = record.stream.noiseStream.userData\n      if (!core.replicator.attached(muxer)) core.replicator.attachTo(muxer)\n    }\n  }\n\n  destroy() {\n    // reverse is safer cause we delete mb\n    for (let i = this.records.length - 1; i >= 0; i--) {\n      const record = this.records[i]\n      if (!record.isExternal) record.stream.destroy()\n    }\n  }\n}\n\nclass SessionTracker {\n  constructor() {\n    this.map = new Map()\n  }\n\n  get size() {\n    return this.map.size\n  }\n\n  get(id) {\n    const existing = this.map.get(id)\n    if (existing !== undefined) return existing\n    const fresh = []\n    this.map.set(id, fresh)\n    return fresh\n  }\n\n  gc(id) {\n    this.map.delete(id)\n  }\n\n  list(id) {\n    return id ? this.map.get(id) || [] : [...this]\n  }\n\n  *[Symbol.iterator]() {\n    for (const sessions of this.map.values()) {\n      yield* sessions[Symbol.iterator]()\n    }\n  }\n}\n\nclass CoreTracker {\n  constructor() {\n    this.map = new Map()\n    this.watching = []\n\n    this._gcing = new Set()\n    this._gcInterval = null\n    this._gcCycleBound = this._gcCycle.bind(this)\n  }\n\n  get size() {\n    return this.map.size\n  }\n\n  watch(store) {\n    if (store.watchIndex !== -1) return\n    store.watchIndex = this.watching.push(store) - 1\n  }\n\n  unwatch(store) {\n    if (store.watchIndex === -1) return\n    const head = this.watching.pop()\n    if (head !== store) this.watching[(head.watchIndex = store.watchIndex)] = head\n    store.watchIndex = -1\n  }\n\n  resume(id) {\n    const core = this.map.get(id)\n\n    if (!core) return null\n\n    // signal back that we have a closing one stored\n    if (core.closing) return core\n\n    if (core.gc) {\n      this._gcing.delete(core)\n      if (this._gcing.size === 0) this._stopGC()\n      core.gc = 0\n    }\n\n    return core\n  }\n\n  opened(id) {\n    const core = this.map.get(id)\n    return !!(core && core.opened && !core.closing)\n  }\n\n  get(id) {\n    // we allow you do call this from the outside, so support normal buffers also\n    if (b4a.isBuffer(id)) id = b4a.toString(id, 'hex')\n    const core = this.map.get(id)\n    if (!core || core.closing) return null\n    return core\n  }\n\n  set(id, core) {\n    this.map.set(id, core)\n    if (this.watching.length > 0) this._emit(core)\n  }\n\n  _emit(core) {\n    for (let i = this.watching.length - 1; i >= 0; i--) {\n      const store = this.watching[i]\n      for (const fn of store.watchers) fn(core)\n    }\n  }\n\n  _gc(core) {\n    const id = toHex(core.discoveryKey)\n    if (this.map.get(id) === core) this.map.delete(id)\n  }\n\n  _gcCycle() {\n    for (const core of this._gcing) {\n      if (++core.gc < 4) continue\n      const gc = this._gc.bind(this, core)\n      core.close().then(gc, gc)\n      this._gcing.delete(core)\n    }\n\n    if (this._gcing.size === 0) this._stopGC()\n  }\n\n  gc(core) {\n    core.gc = 1 // first strike\n    this._gcing.add(core)\n    if (this._gcing.size === 1) this._startGC()\n  }\n\n  _stopGC() {\n    clearInterval(this._gcInterval)\n    this._gcInterval = null\n  }\n\n  _startGC() {\n    if (this._gcInterval) return\n    this._gcInterval = setInterval(this._gcCycleBound, 2000)\n    if (this._gcInterval.unref) this._gcInterval.unref()\n  }\n\n  close() {\n    this._stopGC()\n    this._gcing.clear()\n\n    const all = []\n    for (const core of this.map.values()) {\n      core.onidle = noop // no reentry\n      all.push(core.close())\n    }\n    this.map.clear()\n\n    return Promise.all(all)\n  }\n\n  *[Symbol.iterator]() {\n    for (const core of this.map.values()) {\n      if (!core.closing) yield core\n    }\n  }\n}\n\nclass FindingPeers {\n  constructor() {\n    this.count = 0\n    this.pending = []\n  }\n\n  add(core) {\n    if (this.count === 0) return\n    this.pending.push(core.findingPeers())\n  }\n\n  inc(sessions) {\n    if (++this.count !== 1) return\n\n    for (const core of sessions) {\n      this.pending.push(core.findingPeers())\n    }\n  }\n\n  dec(sessions) {\n    if (--this.count !== 0) return\n    while (this.pending.length > 0) this.pending.pop()()\n  }\n}\n\nclass Corestore extends ReadyResource {\n  constructor(storage, opts = {}) {\n    super()\n\n    this.root = opts.root || null\n    this.storage = this.root\n      ? this.root.storage\n      : Hypercore.defaultStorage(storage, {\n          id: opts.id,\n          allowBackup: opts.allowBackup,\n          readOnly: opts.readOnly,\n          wait: opts.wait\n        })\n    this.streamTracker = this.root ? this.root.streamTracker : new StreamTracker()\n    this.cores = this.root ? this.root.cores : new CoreTracker()\n    this.sessions = new SessionTracker()\n    this.corestores = this.root ? this.root.corestores : new Set()\n    this.readOnly = opts.writable === false || !!opts.readOnly\n    this.globalCache = this.root ? this.root.globalCache : opts.globalCache || null\n    this.primaryKey = this.root ? this.root.primaryKey : opts.primaryKey || null\n    this.ns = opts.namespace || DEFAULT_NAMESPACE\n    this.manifestVersion = opts.manifestVersion || 1\n    this.shouldSuspend = isAndroid ? !!opts.suspend : opts.suspend !== false\n    this.active = opts.active !== false\n\n    this.watchers = null\n    this.watchIndex = -1\n\n    this._findingPeers = null // here for legacy\n    this._ongcBound = this._ongc.bind(this)\n\n    if (opts.primaryKey && !this.root && !opts.unsafe) {\n      throw ASSERTION(\n        'Passing the primary key is unsafe unless you know what you are doing. Set unsafe: true to acknowledge that'\n      )\n    }\n\n    if (this.root) this.corestores.add(this)\n\n    this.ready().catch(noop)\n  }\n\n  watch(fn) {\n    if (this.watchers === null) {\n      this.watchers = new Set()\n      this.cores.watch(this)\n    }\n\n    this.watchers.add(fn)\n  }\n\n  unwatch(fn) {\n    if (this.watchers === null) return\n\n    this.watchers.delete(fn)\n\n    if (this.watchers.size === 0) {\n      this.watchers = null\n      this.cores.unwatch(this)\n    }\n  }\n\n  findingPeers() {\n    if (this._findingPeers === null) this._findingPeers = new FindingPeers()\n    this._findingPeers.inc(this.sessions)\n    let done = false\n    return () => {\n      if (done) return\n      done = true\n      this._findingPeers.dec(this.sessions)\n    }\n  }\n\n  audit(opts = {}) {\n    return auditStore(this, opts)\n  }\n\n  async suspend({ log = noop } = {}) {\n    await log('Flushing db...')\n    // If readOnly we don't need to flush\n    if (!this.storage.readOnly) await this.storage.db.flush()\n    if (!this.shouldSuspend) return\n    await log('Suspending db...')\n    await this.storage.suspend()\n  }\n\n  resume() {\n    return this.storage.resume()\n  }\n\n  session(opts) {\n    this._maybeClosed()\n    const root = this.root || this\n    return new Corestore(null, {\n      manifestVersion: this.manifestVersion,\n      ...opts,\n      root\n    })\n  }\n\n  namespace(name, opts) {\n    return this.session({\n      ...opts,\n      namespace: generateNamespace(this.ns, name)\n    })\n  }\n\n  list(namespace) {\n    return this.storage.createDiscoveryKeyStream(namespace)\n  }\n\n  getAuth(discoveryKey) {\n    return this.storage.getAuth(discoveryKey)\n  }\n\n  _ongc(session) {\n    if (session.sessions.length === 0) this.sessions.gc(session.id)\n  }\n\n  async _getOrSetSeed() {\n    const seed = await this.storage.getSeed()\n    if (seed !== null) return seed\n    return await this.storage.setSeed(this.primaryKey || crypto.randomBytes(32))\n  }\n\n  async _open() {\n    if (this.root !== null) {\n      if (this.root.opened === false) await this.root.ready()\n      this.primaryKey = this.root.primaryKey\n      return\n    }\n\n    const primaryKey = await this._getOrSetSeed()\n\n    if (this.primaryKey === null) {\n      this.primaryKey = primaryKey\n      return\n    }\n\n    if (!b4a.equals(primaryKey, this.primaryKey)) {\n      throw new Error('Another corestore is stored here')\n    }\n  }\n\n  async _close() {\n    const closing = []\n    const hanging = [...this.sessions]\n    for (const sess of hanging) closing.push(sess.close())\n\n    if (this.watchers !== null) this.cores.unwatch(this)\n\n    if (this.root !== null) {\n      await Promise.all(closing)\n      return\n    }\n\n    for (const store of this.corestores) {\n      closing.push(store.close())\n    }\n\n    await Promise.all(closing)\n\n    await this.cores.close()\n    await this.storage.close()\n  }\n\n  async _attachMaybe(muxer, discoveryKey) {\n    if (this.opened === false) await this.ready()\n    if (\n      !this.cores.opened(toHex(discoveryKey)) &&\n      !(await this.storage.hasCore(discoveryKey, { ifMigrated: true }))\n    )\n      return\n    if (this.closing) return\n\n    const core = this._openCore(discoveryKey, { createIfMissing: false })\n\n    if (!core) return\n    if (!core.opened) await core.ready()\n\n    if (!core.replicator.attached(muxer)) {\n      core.replicator.attachTo(muxer)\n    }\n\n    core.checkIfIdle()\n  }\n\n  _shouldReplicate(core, muxer) {\n    return (\n      core.replicator.downloading && !core.replicator.attached(muxer) && core.opened && this.active\n    )\n  }\n\n  replicate(isInitiator, opts) {\n    this._maybeClosed()\n\n    const isExternal = isStream(isInitiator)\n    const stream = Hypercore.createProtocolStream(isInitiator, {\n      ...opts,\n      ondiscoverykey: (discoveryKey) => {\n        if (this.closing) return\n        const muxer = stream.noiseStream.userData\n        return this._attachMaybe(muxer, discoveryKey)\n      }\n    })\n\n    if (this.cores.size > 0) {\n      const muxer = stream.noiseStream.userData\n      const uncork = muxer.uncork.bind(muxer)\n      muxer.cork()\n\n      for (const core of this.cores) {\n        if (!this._shouldReplicate(core, muxer)) {\n          continue\n        }\n        core.replicator.attachTo(muxer)\n      }\n\n      stream.noiseStream.opened.then(uncork)\n    }\n\n    const record = this.streamTracker.add(stream, isExternal)\n    stream.once('close', () => this.streamTracker.remove(record))\n    return stream\n  }\n\n  _maybeClosed() {\n    if (this.closing || (this.root !== null && this.root.closing)) {\n      throw new Error('Corestore is closed')\n    }\n  }\n\n  async staticify(core, opts) {\n    if (!this.opened) await this.ready()\n    if (!core.opened) await core.ready()\n\n    const rx = core.state.storage.read()\n\n    const headPromise = rx.getHead()\n    const authPromise = rx.getAuth()\n\n    rx.tryFlush()\n\n    const [head, auth] = await Promise.all([headPromise, authPromise])\n    if (!head || head.length === 0) throw new Error('Core must have data')\n\n    const prologue = {\n      length: head.length,\n      hash: head.rootHash\n    }\n\n    const manifest = {\n      version: 1,\n      hash: auth.manifest.hash,\n      quorum: 0,\n      signers: [],\n      prologue\n    }\n\n    const c = {\n      key: null,\n      discoveryKey: null,\n      manifest,\n      core: core.state.storage.core\n    }\n\n    c.key = Hypercore.key(c.manifest)\n    c.discoveryKey = Hypercore.discoveryKey(c.key)\n\n    await this.storage.createCore(c)\n\n    const staticCore = this.get({ ...opts, key: c.key })\n    await staticCore.ready()\n    return staticCore\n  }\n\n  get(opts) {\n    this._maybeClosed()\n\n    if (b4a.isBuffer(opts) || typeof opts === 'string') opts = { key: opts }\n    if (!opts) opts = {}\n\n    const conf = {\n      preload: null,\n      sessions: null,\n      ongc: null,\n      core: null,\n      active: opts.active !== false,\n      encryption: opts.encryption || null,\n      encryptionKey: opts.encryptionKey || null, // back compat, should remove\n      isBlockKey: !!opts.isBlockKey, // back compat, should remove\n      valueEncoding: opts.valueEncoding || null,\n      exclusive: !!opts.exclusive,\n      manifest: opts.manifest || null,\n      keyPair: opts.keyPair || null,\n      onwait: opts.onwait || null,\n      wait: opts.wait !== false,\n      timeout: opts.timeout || 0,\n      draft: !!opts.draft,\n      writable: opts.writable === undefined && this.readOnly ? false : opts.writable\n    }\n\n    // name requires us to rt to storage + ready, so needs preload\n    // same goes if user has defined async preload obvs\n    if (opts.name || opts.preload) {\n      conf.preload = this._preload(opts)\n      return this._makeSession(conf)\n    }\n\n    if (opts.discoveryKey && !opts.key && !opts.manifest) {\n      conf.preload = this._preloadCheckIfExists(opts)\n      return this._makeSession(conf)\n    }\n\n    // if not not we can sync create it, which just is easier for the\n    // upstream user in terms of guarantees (key is there etc etc)\n    const core = this._openCore(null, opts)\n\n    conf.core = core\n    conf.sessions = this.sessions.get(core.id)\n    conf.ongc = this._ongcBound\n\n    return this._makeSession(conf)\n  }\n\n  _makeSession(conf) {\n    const session = new Hypercore(null, null, conf)\n    if (this._findingPeers !== null) this._findingPeers.add(session)\n    return session\n  }\n\n  async createKeyPair(name, ns = this.ns) {\n    if (this.opened === false) await this.ready()\n    return createKeyPair(this.primaryKey, ns, name)\n  }\n\n  async _preloadCheckIfExists(opts) {\n    const has = await this.storage.hasCore(opts.discoveryKey)\n    if (!has) throw STORAGE_EMPTY('No Hypercore is stored here')\n    return this._preload(opts)\n  }\n\n  async _preload(opts) {\n    if (opts.preload) opts = { ...opts, ...(await opts.preload) }\n    if (this.opened === false) await this.ready()\n\n    const discoveryKey = opts.name\n      ? await this.storage.getAlias({ name: opts.name, namespace: this.ns })\n      : null\n    this._maybeClosed()\n\n    const core = this._openCore(discoveryKey, opts)\n\n    return {\n      core,\n      sessions: this.sessions.get(core.id),\n      ongc: this._ongcBound,\n      encryption: opts.encryption || null,\n      encryptionKey: opts.encryptionKey || null, // back compat, should remove\n      isBlockKey: !!opts.isBlockKey // back compat, should remove\n    }\n  }\n\n  _auth(discoveryKey, opts) {\n    const result = {\n      keyPair: null,\n      key: null,\n      discoveryKey,\n      manifest: null\n    }\n\n    if (opts.name) {\n      result.keyPair = createKeyPair(this.primaryKey, this.ns, opts.name)\n    } else if (opts.keyPair) {\n      result.keyPair = opts.keyPair\n    }\n\n    if (opts.manifest) {\n      result.manifest = opts.manifest\n    } else if (result.keyPair && !result.discoveryKey) {\n      result.manifest = {\n        version: this.manifestVersion,\n        signers: [{ publicKey: result.keyPair.publicKey }]\n      }\n    }\n\n    if (opts.key) result.key = ID.decode(opts.key)\n    else if (result.manifest) result.key = Hypercore.key(result.manifest)\n\n    if (result.discoveryKey) return result\n\n    if (opts.discoveryKey) result.discoveryKey = ID.decode(opts.discoveryKey)\n    else if (result.key) result.discoveryKey = crypto.discoveryKey(result.key)\n    else throw new Error('Could not derive discovery from input')\n\n    return result\n  }\n\n  _openCore(discoveryKey, opts) {\n    const auth = this._auth(discoveryKey, opts)\n\n    const id = toHex(auth.discoveryKey)\n    const existing = this.cores.resume(id)\n    if (existing && !existing.closing) return existing\n\n    const core = Hypercore.createCore(this.storage, {\n      preopen: existing && existing.opened ? existing.closing : null, // always wait for the prev one to close first in any case...\n      eagerUpgrade: true,\n      notDownloadingLinger: opts.notDownloadingLinger,\n      allowFork: opts.allowFork !== false,\n      inflightRange: opts.inflightRange,\n      compat: false, // no compat for now :)\n      force: opts.force,\n      createIfMissing: opts.createIfMissing,\n      discoveryKey: auth.discoveryKey,\n      overwrite: opts.overwrite,\n      key: auth.key,\n      keyPair: auth.keyPair,\n      legacy: opts.legacy,\n      manifest: auth.manifest,\n      globalCache: opts.globalCache || this.globalCache || null,\n      alias: opts.name ? { name: opts.name, namespace: this.ns } : null\n    })\n\n    core.onidle = () => {\n      this.cores.gc(core)\n    }\n\n    core.replicator.ondownloading = () => {\n      if (this.active) this.streamTracker.attachAll(core)\n    }\n\n    this.cores.set(id, core)\n    return core\n  }\n}\n\nmodule.exports = Corestore\n\nfunction isStream(s) {\n  return typeof s === 'object' && s && typeof s.pipe === 'function'\n}\n\nfunction generateNamespace(namespace, name) {\n  if (!b4a.isBuffer(name)) name = b4a.from(name)\n  const out = b4a.allocUnsafeSlow(32)\n  sodium.crypto_generichash_batch(out, [namespace, name])\n  return out\n}\n\nfunction deriveSeed(primaryKey, namespace, name) {\n  if (!b4a.isBuffer(name)) name = b4a.from(name)\n  const out = b4a.alloc(32)\n  sodium.crypto_generichash_batch(out, [NS, namespace, name], primaryKey)\n  return out\n}\n\nfunction createKeyPair(primaryKey, namespace, name) {\n  const seed = deriveSeed(primaryKey, namespace, name)\n  const buf = b4a.alloc(sodium.crypto_sign_PUBLICKEYBYTES + sodium.crypto_sign_SECRETKEYBYTES)\n  const keyPair = {\n    publicKey: buf.subarray(0, sodium.crypto_sign_PUBLICKEYBYTES),\n    secretKey: buf.subarray(sodium.crypto_sign_PUBLICKEYBYTES)\n  }\n  sodium.crypto_sign_seed_keypair(keyPair.publicKey, keyPair.secretKey, seed)\n  return keyPair\n}\n\nfunction noop() {}\n\nfunction toHex(discoveryKey) {\n  return b4a.toString(discoveryKey, 'hex')\n}\nmodule.exports = async function* audit(store, { dryRun = false } = {}) {\n  for await (const { discoveryKey, core } of store.storage.createCoreStream()) {\n    if (core.version < 1) continue // not migrated, ignore\n\n    const c = store.get({ discoveryKey, active: false })\n    await c.ready()\n\n    yield { discoveryKey, key: c.key, audit: await c.core.audit({ dryRun }) }\n\n    try {\n      await c.close()\n    } catch {\n      // ignore if failed, we are auditing...\n    }\n  }\n}\n{\n  \"name\": \"corestore\",\n  \"version\": \"7.7.0\",\n  \"description\": \"A Hypercore factory that simplifies managing collections of cores.\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"lib/*\"\n  ],\n  \"dependencies\": {\n    \"b4a\": \"^1.6.7\",\n    \"hypercore\": \"^11.19.0\",\n    \"hypercore-crypto\": \"^3.4.2\",\n    \"hypercore-errors\": \"^1.4.0\",\n    \"hypercore-id-encoding\": \"^1.3.0\",\n    \"ready-resource\": \"^1.1.1\",\n    \"sodium-universal\": \"^5.0.1\",\n    \"which-runtime\": \"^1.2.1\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.7.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"rache\": \"^1.0.0\",\n    \"test-tmp\": \"^1.3.0\"\n  },\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"test\": \"prettier --check . && brittle test/*.js\",\n    \"test:bare\": \"bare test/basic.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/corestore.git\"\n  },\n  \"author\": \"Holepunch Inc\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/corestore/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/corestore\"\n}\nmodule.exports = require('crypto').createHash\n{\n  \"name\": \"create-hash\",\n  \"version\": \"1.2.0\",\n  \"description\": \"create hashes for browserify\",\n  \"browser\": \"browser.js\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"standard\": \"standard\",\n    \"test\": \"npm run-script standard && npm run-script unit\",\n    \"unit\": \"node test.js | tspec\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git@github.com:crypto-browserify/createHash.git\"\n  },\n  \"keywords\": [\n    \"crypto\"\n  ],\n  \"author\": \"\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/crypto-browserify/createHash/issues\"\n  },\n  \"homepage\": \"https://github.com/crypto-browserify/createHash\",\n  \"devDependencies\": {\n    \"hash-test-vectors\": \"^1.3.2\",\n    \"safe-buffer\": \"^5.0.1\",\n    \"standard\": \"^10.0.2\",\n    \"tap-spec\": \"^2.1.2\",\n    \"tape\": \"^4.6.3\"\n  },\n  \"dependencies\": {\n    \"cipher-base\": \"^1.0.1\",\n    \"inherits\": \"^2.0.1\",\n    \"md5.js\": \"^1.3.4\",\n    \"ripemd160\": \"^2.0.1\",\n    \"sha.js\": \"^2.4.0\"\n  }\n}\nmodule.exports = function debounce (worker, context = null) {\n  debounced.running = null\n  return debounced\n\n  async function debounced () {\n    if (debounced.running !== null) {\n      try {\n        await debounced.running\n      } catch (_) {\n        // ignore - do not fail on old errors\n      }\n    }\n\n    // another \"thread\" beat us to it, just piggy pack on that one\n    if (debounced.running !== null) return debounced.running\n\n    debounced.running = worker.call(context)\n\n    try {\n      return await debounced.running\n    } finally {\n      debounced.running = null\n    }\n  }\n}\n{\n  \"name\": \"debounceify\",\n  \"version\": \"1.1.0\",\n  \"description\": \"Tiny async debouncer\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"standard\": \"^16.0.3\",\n    \"tape\": \"^5.1.1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/debounceify.git\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && tape test.js\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/debounceify/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/debounceify\"\n}\nconst fs = require('fs')\nconst path = require('path')\nconst fsx = require('fs-native-extensions')\nconst b4a = require('b4a')\nconst ReadyResource = require('ready-resource')\nconst FDLock = require('fd-lock')\n\nconst PLATFORM = global.Bare ? global.Bare.platform : global.process.platform\nconst IS_WIN = PLATFORM === 'win32'\nconst IS_LINUX = PLATFORM === 'linux'\nconst MODIFIED_SLACK = 5000\nconst EMPTY = b4a.alloc(0)\nconst ATTR = IS_LINUX ? 'user.device-file' : 'device-file'\n\nconst nl = IS_WIN ? '\\r\\n' : '\\n'\n\nmodule.exports = class DeviceFile extends ReadyResource {\n  constructor(filename, { create = true, wait = false, lock = wait, data = {} } = {}) {\n    super()\n\n    this.filename = filename\n    this.data = data\n    this.lock = null\n\n    this._create = create\n    this._wait = wait\n    this._lock = lock\n  }\n\n  async _open() {\n    if (await verifyDeviceFile(this)) return\n    if (!this._create) throwDeviceFileError('No device file present', false)\n    await writeDeviceFile(this)\n  }\n\n  transfer() {\n    return this.lock ? this.lock.transfer() : -1\n  }\n\n  async _close() {\n    if (this.lock) await this.lock.close()\n  }\n\n  async suspend() {\n    if (!this.opened) await this.ready()\n    if (this.lock) await this.lock.suspend()\n  }\n\n  async resume() {\n    if (!this.opened) await this.ready()\n    if (this.lock) await this.lock.resume()\n  }\n}\n\nasync function writeDeviceFile(device) {\n  let s = ''\n\n  for (const [key, value] of Object.entries(device.data)) {\n    if (value === null) continue\n    s += key + '=' + value + nl\n  }\n\n  await fs.promises.mkdir(path.dirname(device.filename), { recursive: true })\n\n  const fd = await open(device.filename, 'w')\n\n  device.lock = device._lock ? new FDLock(fd, { wait: device._wait }) : null\n\n  if (device.lock) {\n    try {\n      await device.lock.ready()\n    } catch (err) {\n      await device.lock.close()\n      throw err\n    }\n  }\n\n  const st = await fstat(fd)\n\n  const created = Date.now()\n\n  s += 'device/platform=' + PLATFORM + nl\n  s += 'device/inode=' + st.ino + nl\n  s += 'device/created=' + created + nl\n\n  if (await setAttr(fd, ATTR, b4a.from('original'))) {\n    s += 'device/attribute=original' + nl\n  }\n\n  await write(fd, b4a.from(s))\n\n  if (!device.lock) await close(fd)\n}\n\nasync function verifyDeviceFile(device) {\n  let fd = 0\n\n  try {\n    fd = await open(device.filename, 'r+')\n  } catch (e) {\n    fd = 0\n  }\n\n  if (fd === 0) return false\n\n  device.lock = device._lock ? new FDLock(fd, { wait: device._wait }) : null\n\n  if (device.lock) {\n    try {\n      await device.lock.ready()\n    } catch (err) {\n      await device.lock.close()\n      throw err\n    }\n  }\n\n  const buf = await read(fd)\n  const result = {}\n\n  const s = b4a.toString(buf).trim().split('\\n')\n\n  let inode = 0\n  let created = 0\n  let attr = ''\n  let platform = ''\n\n  for (const ln of s) {\n    const i = ln.indexOf('=')\n    if (i === -1) continue\n\n    const k = ln.slice(0, i).trim()\n    const v = ln.slice(i + 1).trim()\n\n    switch (k) {\n      case 'device/platform':\n        platform = v\n        break\n      case 'device/inode':\n        inode = Number(v)\n        break\n      case 'device/created':\n        created = Number(v)\n        break\n      case 'device/attribute':\n        attr = v\n        break\n      default:\n        result[k] = v\n        break\n    }\n  }\n\n  for (const [k, v] of Object.entries(device.data)) {\n    if (v === null) continue\n    if (result[k] === undefined) continue // allow upserts\n    if (result[k] !== '' + v) {\n      await teardown()\n      throwDeviceFileError(`Invalid device file, ${k} has changed. Was ${result[k]}, is ${v}`, true)\n    }\n  }\n\n  const st = await fstat(fd)\n  const at = await getAttr(fd, ATTR)\n\n  const sameAttr = b4a.toString(at || EMPTY) === attr\n  const modified = Math.max(st.mtime.getTime(), st.birthtime.getTime())\n\n  if (platform && platform !== PLATFORM) {\n    await teardown()\n    throwDeviceFileError('Invalid device file, was made on different platform', true)\n  }\n\n  if (!sameAttr) {\n    await teardown()\n    throwDeviceFileError('Invalid device file, was moved unsafely', true)\n  }\n\n  if (st.ino !== inode || (created && Math.abs(modified - created) >= MODIFIED_SLACK)) {\n    await teardown()\n    throwDeviceFileError('Invalid device file, was modified', true)\n  }\n\n  if (!device.lock) await close(fd)\n\n  device.data = result\n  return true\n\n  async function teardown() {\n    if (device.lock) await device.lock.close()\n    else await close(fd)\n  }\n}\n\nasync function getAttr(fd, name) {\n  try {\n    return await fsx.getAttr(fd, name)\n  } catch {\n    return null\n  }\n}\n\nasync function setAttr(fd, name, value) {\n  try {\n    await fsx.setAttr(fd, name, value)\n    return true\n  } catch {\n    return false\n  }\n}\n\nfunction fstat(fd) {\n  return new Promise((resolve, reject) => {\n    fs.fstat(fd, (err, st) => {\n      if (err) reject(err)\n      resolve(st)\n    })\n  })\n}\n\nfunction close(fd) {\n  return new Promise((resolve, reject) => {\n    fs.close(fd, (err, st) => {\n      if (err) reject(err)\n      resolve(st)\n    })\n  })\n}\n\nfunction write(fd, buf) {\n  return new Promise((resolve, reject) => {\n    let offset = 0\n\n    onwrite(null, 0)\n\n    function onwrite(err, wrote) {\n      if (err) return reject(err)\n      if (offset === buf.byteLength) return resolve()\n      offset += wrote\n      fs.write(fd, buf, offset, buf.byteLength - offset, offset, onwrite)\n    }\n  })\n}\n\nfunction read(fd) {\n  const buf = b4a.allocUnsafe(4096)\n\n  return new Promise((resolve, reject) => {\n    let offset = 0\n\n    fs.read(fd, buf, 0, buf.byteLength, 0, onread)\n\n    function onread(err, read) {\n      if (err) return reject(err)\n      if (read === 0) return resolve(buf.subarray(0, offset))\n      offset += read\n      fs.read(fd, buf, offset, buf.byteLength - offset, offset, onread)\n    }\n  })\n}\n\nfunction open(filename, flags) {\n  return new Promise((resolve, reject) => {\n    fs.open(filename, flags, (err, fd) => {\n      if (err) reject(err)\n      resolve(fd)\n    })\n  })\n}\n\nfunction throwDeviceFileError(message, fatal) {\n  const err = new Error(message)\n  err.code = 'DEVICE_FILE'\n  err.fatal = fatal\n  throw err\n}\n{\n  \"name\": \"device-file\",\n  \"version\": \"2.2.0\",\n  \"description\": \"Device only file\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {\n    \"b4a\": \"^1.6.7\",\n    \"bare-fs\": \"^4.0.1\",\n    \"bare-path\": \"^3.0.0\",\n    \"fd-lock\": \"^2.1.0\",\n    \"fs-native-extensions\": \"^1.4.0\",\n    \"ready-resource\": \"^1.2.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.13.1\",\n    \"lunte\": \"^1.3.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  },\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"lint\": \"prettier --check . && lunte\",\n    \"test\": \"npm run test:node && npm run test:bare\",\n    \"test:node\": \"brittle-node --coverage test.js\",\n    \"test:bare\": \"brittle-bare --coverage test.js\"\n  },\n  \"imports\": {\n    \"fs\": {\n      \"bare\": \"bare-fs\",\n      \"default\": \"fs\"\n    },\n    \"path\": {\n      \"bare\": \"bare-path\",\n      \"default\": \"path\"\n    }\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/device-file.git\"\n  },\n  \"author\": \"Holepunch Inc\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/device-file/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/device-file\"\n}\n{\n  \"name\": \"ecpair\",\n  \"version\": \"2.1.0\",\n  \"description\": \"Client-side Bitcoin JavaScript library ECPair\",\n  \"main\": \"./src/index.js\",\n  \"types\": \"./src/index.d.ts\",\n  \"engines\": {\n    \"node\": \">=8.0.0\"\n  },\n  \"keywords\": [\n    \"bitcoinjs\",\n    \"bitcoin\",\n    \"browserify\",\n    \"javascript\",\n    \"bitcoinjs\"\n  ],\n  \"scripts\": {\n    \"audit\": \"NPM_AUDIT_IGNORE_DEV=1 NPM_AUDIT_IGNORE_LEVEL=low npm-audit-whitelister .npm-audit-whitelister.json\",\n    \"build\": \"npm run clean && tsc -p ./tsconfig.json && npm run formatjs\",\n    \"build:tests\": \"npm run clean:jstests && tsc -p ./test/tsconfig.json\",\n    \"clean\": \"rimraf src\",\n    \"clean:jstests\": \"rimraf 'test/**/!(ts-node-register)*.js'\",\n    \"coverage-report\": \"npm run build && npm run nobuild:coverage-report\",\n    \"coverage-html\": \"npm run build && npm run nobuild:coverage-html\",\n    \"coverage\": \"npm run build && npm run nobuild:coverage\",\n    \"format\": \"npm run prettier -- --write\",\n    \"formatjs\": \"npm run prettierjs -- --write\",\n    \"format:ci\": \"npm run prettier -- --check && npm run prettierjs -- --check\",\n    \"gitdiff:ci\": \"npm run build && git diff --exit-code\",\n    \"lint\": \"tslint -p tsconfig.json -c tslint.json\",\n    \"lint:tests\": \"tslint -p test/tsconfig.json -c tslint.json\",\n    \"mocha:ts\": \"mocha --recursive --require test/ts-node-register\",\n    \"nobuild:coverage-report\": \"nyc report --reporter=lcov\",\n    \"nobuild:coverage-html\": \"nyc report --reporter=html\",\n    \"nobuild:coverage\": \"npm run build:tests && nyc --check-coverage --branches 90 --functions 90 --lines 90 mocha && npm run clean:jstests\",\n    \"nobuild:unit\": \"npm run mocha:ts -- 'test/*.ts'\",\n    \"prettier\": \"prettier \\\"ts_src/**/*.ts\\\" \\\"test/**/*.ts\\\" --ignore-path ./.prettierignore\",\n    \"prettierjs\": \"prettier \\\"src/**/*.js\\\" --ignore-path ./.prettierignore\",\n    \"test\": \"npm run build && npm run format:ci && npm run lint && npm run nobuild:coverage\",\n    \"unit\": \"npm run build && npm run nobuild:unit\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/ecpair.git\"\n  },\n  \"files\": [\n    \"src\"\n  ],\n  \"dependencies\": {\n    \"randombytes\": \"^2.1.0\",\n    \"typeforce\": \"^1.18.0\",\n    \"wif\": \"^2.0.6\"\n  },\n  \"devDependencies\": {\n    \"@types/create-hash\": \"^1.2.2\",\n    \"@types/mocha\": \"^5.2.7\",\n    \"@types/node\": \"^16.11.1\",\n    \"@types/proxyquire\": \"^1.3.28\",\n    \"@types/randombytes\": \"^2.0.0\",\n    \"@types/wif\": \"^2.0.2\",\n    \"bip39\": \"^3.0.2\",\n    \"bip65\": \"^1.0.1\",\n    \"bip68\": \"^1.0.3\",\n    \"bn.js\": \"^4.11.8\",\n    \"bs58\": \"^4.0.0\",\n    \"create-hash\": \"^1.2.0\",\n    \"dhttp\": \"^3.0.0\",\n    \"hoodwink\": \"^2.0.0\",\n    \"minimaldata\": \"^1.0.2\",\n    \"mocha\": \"^7.1.1\",\n    \"npm-audit-whitelister\": \"^1.0.2\",\n    \"nyc\": \"^15.1.0\",\n    \"prettier\": \"^2.4.1\",\n    \"proxyquire\": \"^2.0.1\",\n    \"rimraf\": \"^2.6.3\",\n    \"tiny-secp256k1\": \"^2.2.1\",\n    \"ts-node\": \"^8.3.0\",\n    \"tslint\": \"^6.1.3\",\n    \"typescript\": \"^4.4.4\"\n  },\n  \"license\": \"MIT\"\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.ECPairFactory = exports.networks = void 0;\nconst networks = require('./networks');\nexports.networks = networks;\nconst types = require('./types');\nconst randomBytes = require('randombytes');\nconst wif = require('wif');\nconst testecc_1 = require('./testecc');\nconst isOptions = types.typeforce.maybe(\n  types.typeforce.compile({\n    compressed: types.maybe(types.Boolean),\n    network: types.maybe(types.Network),\n  }),\n);\nconst toXOnly = (pubKey) =>\n  pubKey.length === 32 ? pubKey : pubKey.slice(1, 33);\nfunction ECPairFactory(ecc) {\n  (0, testecc_1.testEcc)(ecc);\n  function isPoint(maybePoint) {\n    return ecc.isPoint(maybePoint);\n  }\n  function fromPrivateKey(buffer, options) {\n    types.typeforce(types.Buffer256bit, buffer);\n    if (!ecc.isPrivate(buffer))\n      throw new TypeError('Private key not in range [1, n)');\n    types.typeforce(isOptions, options);\n    return new ECPair(buffer, undefined, options);\n  }\n  function fromPublicKey(buffer, options) {\n    types.typeforce(ecc.isPoint, buffer);\n    types.typeforce(isOptions, options);\n    return new ECPair(undefined, buffer, options);\n  }\n  function fromWIF(wifString, network) {\n    const decoded = wif.decode(wifString);\n    const version = decoded.version;\n    // list of networks?\n    if (types.Array(network)) {\n      network = network\n        .filter((x) => {\n          return version === x.wif;\n        })\n        .pop();\n      if (!network) throw new Error('Unknown network version');\n      // otherwise, assume a network object (or default to bitcoin)\n    } else {\n      network = network || networks.bitcoin;\n      if (version !== network.wif) throw new Error('Invalid network version');\n    }\n    return fromPrivateKey(decoded.privateKey, {\n      compressed: decoded.compressed,\n      network: network,\n    });\n  }\n  function makeRandom(options) {\n    types.typeforce(isOptions, options);\n    if (options === undefined) options = {};\n    const rng = options.rng || randomBytes;\n    let d;\n    do {\n      d = rng(32);\n      types.typeforce(types.Buffer256bit, d);\n    } while (!ecc.isPrivate(d));\n    return fromPrivateKey(d, options);\n  }\n  class ECPair {\n    __D;\n    __Q;\n    compressed;\n    network;\n    lowR;\n    constructor(__D, __Q, options) {\n      this.__D = __D;\n      this.__Q = __Q;\n      this.lowR = false;\n      if (options === undefined) options = {};\n      this.compressed =\n        options.compressed === undefined ? true : options.compressed;\n      this.network = options.network || networks.bitcoin;\n      if (__Q !== undefined)\n        this.__Q = Buffer.from(ecc.pointCompress(__Q, this.compressed));\n    }\n    get privateKey() {\n      return this.__D;\n    }\n    get publicKey() {\n      if (!this.__Q) {\n        // It is not possible for both `__Q` and `__D` to be `undefined` at the same time.\n        // The factory methods guard for this.\n        const p = ecc.pointFromScalar(this.__D, this.compressed);\n        // It is not possible for `p` to be null.\n        // `fromPrivateKey()` checks that `__D` is a valid scalar.\n        this.__Q = Buffer.from(p);\n      }\n      return this.__Q;\n    }\n    toWIF() {\n      if (!this.__D) throw new Error('Missing private key');\n      return wif.encode(this.network.wif, this.__D, this.compressed);\n    }\n    tweak(t) {\n      if (this.privateKey) return this.tweakFromPrivateKey(t);\n      return this.tweakFromPublicKey(t);\n    }\n    sign(hash, lowR) {\n      if (!this.__D) throw new Error('Missing private key');\n      if (lowR === undefined) lowR = this.lowR;\n      if (lowR === false) {\n        return Buffer.from(ecc.sign(hash, this.__D));\n      } else {\n        let sig = ecc.sign(hash, this.__D);\n        const extraData = Buffer.alloc(32, 0);\n        let counter = 0;\n        // if first try is lowR, skip the loop\n        // for second try and on, add extra entropy counting up\n        while (sig[0] > 0x7f) {\n          counter++;\n          extraData.writeUIntLE(counter, 0, 6);\n          sig = ecc.sign(hash, this.__D, extraData);\n        }\n        return Buffer.from(sig);\n      }\n    }\n    signSchnorr(hash) {\n      if (!this.privateKey) throw new Error('Missing private key');\n      if (!ecc.signSchnorr)\n        throw new Error('signSchnorr not supported by ecc library');\n      return Buffer.from(ecc.signSchnorr(hash, this.privateKey));\n    }\n    verify(hash, signature) {\n      return ecc.verify(hash, this.publicKey, signature);\n    }\n    verifySchnorr(hash, signature) {\n      if (!ecc.verifySchnorr)\n        throw new Error('verifySchnorr not supported by ecc library');\n      return ecc.verifySchnorr(hash, this.publicKey.subarray(1, 33), signature);\n    }\n    tweakFromPublicKey(t) {\n      const xOnlyPubKey = toXOnly(this.publicKey);\n      const tweakedPublicKey = ecc.xOnlyPointAddTweak(xOnlyPubKey, t);\n      if (!tweakedPublicKey || tweakedPublicKey.xOnlyPubkey === null)\n        throw new Error('Cannot tweak public key!');\n      const parityByte = Buffer.from([\n        tweakedPublicKey.parity === 0 ? 0x02 : 0x03,\n      ]);\n      return fromPublicKey(\n        Buffer.concat([parityByte, tweakedPublicKey.xOnlyPubkey]),\n        { network: this.network, compressed: this.compressed },\n      );\n    }\n    tweakFromPrivateKey(t) {\n      const hasOddY =\n        this.publicKey[0] === 3 ||\n        (this.publicKey[0] === 4 && (this.publicKey[64] & 1) === 1);\n      const privateKey = hasOddY\n        ? ecc.privateNegate(this.privateKey)\n        : this.privateKey;\n      const tweakedPrivateKey = ecc.privateAdd(privateKey, t);\n      if (!tweakedPrivateKey) throw new Error('Invalid tweaked private key!');\n      return fromPrivateKey(Buffer.from(tweakedPrivateKey), {\n        network: this.network,\n        compressed: this.compressed,\n      });\n    }\n  }\n  return {\n    isPoint,\n    fromPrivateKey,\n    fromPublicKey,\n    fromWIF,\n    makeRandom,\n  };\n}\nexports.ECPairFactory = ECPairFactory;\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.networks = exports.ECPairFactory = exports.default = void 0;\nvar ecpair_1 = require('./ecpair');\nObject.defineProperty(exports, 'default', {\n  enumerable: true,\n  get: function () {\n    return ecpair_1.ECPairFactory;\n  },\n});\nObject.defineProperty(exports, 'ECPairFactory', {\n  enumerable: true,\n  get: function () {\n    return ecpair_1.ECPairFactory;\n  },\n});\nObject.defineProperty(exports, 'networks', {\n  enumerable: true,\n  get: function () {\n    return ecpair_1.networks;\n  },\n});\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.testnet = exports.bitcoin = void 0;\nexports.bitcoin = {\n  messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n  bech32: 'bc',\n  bip32: {\n    public: 0x0488b21e,\n    private: 0x0488ade4,\n  },\n  pubKeyHash: 0x00,\n  scriptHash: 0x05,\n  wif: 0x80,\n};\nexports.testnet = {\n  messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n  bech32: 'tb',\n  bip32: {\n    public: 0x043587cf,\n    private: 0x04358394,\n  },\n  pubKeyHash: 0x6f,\n  scriptHash: 0xc4,\n  wif: 0xef,\n};\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.testEcc = void 0;\nconst h = (hex) => Buffer.from(hex, 'hex');\nfunction testEcc(ecc) {\n  assert(\n    ecc.isPoint(\n      h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n    ),\n  );\n  assert(\n    !ecc.isPoint(\n      h('030000000000000000000000000000000000000000000000000000000000000005'),\n    ),\n  );\n  assert(\n    ecc.isPrivate(\n      h('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n    ),\n  );\n  // order - 1\n  assert(\n    ecc.isPrivate(\n      h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'),\n    ),\n  );\n  // 0\n  assert(\n    !ecc.isPrivate(\n      h('0000000000000000000000000000000000000000000000000000000000000000'),\n    ),\n  );\n  // order\n  assert(\n    !ecc.isPrivate(\n      h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'),\n    ),\n  );\n  // order + 1\n  assert(\n    !ecc.isPrivate(\n      h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142'),\n    ),\n  );\n  // 1 + 0 == 1\n  assert(\n    Buffer.from(\n      ecc.privateAdd(\n        h('0000000000000000000000000000000000000000000000000000000000000001'),\n        h('0000000000000000000000000000000000000000000000000000000000000000'),\n      ),\n    ).equals(\n      h('0000000000000000000000000000000000000000000000000000000000000001'),\n    ),\n  );\n  // -3 + 3 == 0\n  assert(\n    ecc.privateAdd(\n      h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e'),\n      h('0000000000000000000000000000000000000000000000000000000000000003'),\n    ) === null,\n  );\n  assert(\n    Buffer.from(\n      ecc.privateAdd(\n        h('e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500'),\n        h('b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665'),\n      ),\n    ).equals(\n      h('9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24'),\n    ),\n  );\n  assert(\n    Buffer.from(\n      ecc.privateNegate(\n        h('0000000000000000000000000000000000000000000000000000000000000001'),\n      ),\n    ).equals(\n      h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'),\n    ),\n  );\n  assert(\n    Buffer.from(\n      ecc.privateNegate(\n        h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e'),\n      ),\n    ).equals(\n      h('0000000000000000000000000000000000000000000000000000000000000003'),\n    ),\n  );\n  assert(\n    Buffer.from(\n      ecc.privateNegate(\n        h('b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af'),\n      ),\n    ).equals(\n      h('4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792'),\n    ),\n  );\n  assert(\n    Buffer.from(\n      ecc.pointCompress(\n        h(\n          '0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n        ),\n        true,\n      ),\n    ).equals(\n      h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n    ),\n  );\n  assert(\n    Buffer.from(\n      ecc.pointCompress(\n        h(\n          '0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n        ),\n        false,\n      ),\n    ).equals(\n      h(\n        '0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n      ),\n    ),\n  );\n  assert(\n    Buffer.from(\n      ecc.pointCompress(\n        h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n        true,\n      ),\n    ).equals(\n      h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n    ),\n  );\n  assert(\n    Buffer.from(\n      ecc.pointCompress(\n        h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n        false,\n      ),\n    ).equals(\n      h(\n        '0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n      ),\n    ),\n  );\n  assert(\n    Buffer.from(\n      ecc.pointFromScalar(\n        h('b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af'),\n      ),\n    ).equals(\n      h('02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99'),\n    ),\n  );\n  assert(\n    ecc.xOnlyPointAddTweak(\n      h('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n      h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'),\n    ) === null,\n  );\n  let xOnlyRes = ecc.xOnlyPointAddTweak(\n    h('1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b'),\n    h('a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac'),\n  );\n  assert(\n    Buffer.from(xOnlyRes.xOnlyPubkey).equals(\n      h('e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf'),\n    ) && xOnlyRes.parity === 1,\n  );\n  xOnlyRes = ecc.xOnlyPointAddTweak(\n    h('2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991'),\n    h('823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47'),\n  );\n  assert(\n    Buffer.from(xOnlyRes.xOnlyPubkey).equals(\n      h('9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c'),\n    ) && xOnlyRes.parity === 0,\n  );\n  assert(\n    Buffer.from(\n      ecc.sign(\n        h('5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed'),\n        h('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'),\n      ),\n    ).equals(\n      h(\n        '54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5',\n      ),\n    ),\n  );\n  assert(\n    ecc.verify(\n      h('5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed'),\n      h('0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),\n      h(\n        '54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5',\n      ),\n    ),\n  );\n  if (ecc.signSchnorr) {\n    assert(\n      Buffer.from(\n        ecc.signSchnorr(\n          h('7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c'),\n          h('c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9'),\n          h('c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906'),\n        ),\n      ).equals(\n        h(\n          '5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7',\n        ),\n      ),\n    );\n  }\n  if (ecc.verifySchnorr) {\n    assert(\n      ecc.verifySchnorr(\n        h('7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c'),\n        h('dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8'),\n        h(\n          '5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7',\n        ),\n      ),\n    );\n  }\n}\nexports.testEcc = testEcc;\nfunction assert(bool) {\n  if (!bool) throw new Error('ecc library invalid');\n}\n'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nexports.maybe =\n  exports.Boolean =\n  exports.Array =\n  exports.Buffer256bit =\n  exports.Network =\n  exports.typeforce =\n    void 0;\nexports.typeforce = require('typeforce');\n// exposed, external API\nexports.Network = exports.typeforce.compile({\n  messagePrefix: exports.typeforce.oneOf(\n    exports.typeforce.Buffer,\n    exports.typeforce.String,\n  ),\n  bip32: {\n    public: exports.typeforce.UInt32,\n    private: exports.typeforce.UInt32,\n  },\n  pubKeyHash: exports.typeforce.UInt8,\n  scriptHash: exports.typeforce.UInt8,\n  wif: exports.typeforce.UInt8,\n});\nexports.Buffer256bit = exports.typeforce.BufferN(32);\nexports.Array = exports.typeforce.Array;\nexports.Boolean = exports.typeforce.Boolean; // tslint:disable-line variable-name\nexports.maybe = exports.typeforce.maybe;\n'use strict';\n\nvar elliptic = exports;\n\nelliptic.version = require('../package.json').version;\nelliptic.utils = require('./elliptic/utils');\nelliptic.rand = require('brorand');\nelliptic.curve = require('./elliptic/curve');\nelliptic.curves = require('./elliptic/curves');\n\n// Protocols\nelliptic.ec = require('./elliptic/ec');\nelliptic.eddsa = require('./elliptic/eddsa');\n'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.assert;\n\nfunction BaseCurve(type, conf) {\n  this.type = type;\n  this.p = new BN(conf.p, 16);\n\n  // Use Montgomery, when there is no fast reduction for the prime\n  this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n\n  // Useful for many curves\n  this.zero = new BN(0).toRed(this.red);\n  this.one = new BN(1).toRed(this.red);\n  this.two = new BN(2).toRed(this.red);\n\n  // Curve configuration, optional\n  this.n = conf.n && new BN(conf.n, 16);\n  this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n  // Temporary arrays\n  this._wnafT1 = new Array(4);\n  this._wnafT2 = new Array(4);\n  this._wnafT3 = new Array(4);\n  this._wnafT4 = new Array(4);\n\n  this._bitLength = this.n ? this.n.bitLength() : 0;\n\n  // Generalized Greg Maxwell's trick\n  var adjustCount = this.n && this.p.div(this.n);\n  if (!adjustCount || adjustCount.cmpn(100) > 0) {\n    this.redN = null;\n  } else {\n    this._maxwellTrick = true;\n    this.redN = this.n.toRed(this.red);\n  }\n}\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n  throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n  throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n  assert(p.precomputed);\n  var doubles = p._getDoubles();\n\n  var naf = getNAF(k, 1, this._bitLength);\n  var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n  I /= 3;\n\n  // Translate into more windowed form\n  var repr = [];\n  var j;\n  var nafW;\n  for (j = 0; j < naf.length; j += doubles.step) {\n    nafW = 0;\n    for (var l = j + doubles.step - 1; l >= j; l--)\n      nafW = (nafW << 1) + naf[l];\n    repr.push(nafW);\n  }\n\n  var a = this.jpoint(null, null, null);\n  var b = this.jpoint(null, null, null);\n  for (var i = I; i > 0; i--) {\n    for (j = 0; j < repr.length; j++) {\n      nafW = repr[j];\n      if (nafW === i)\n        b = b.mixedAdd(doubles.points[j]);\n      else if (nafW === -i)\n        b = b.mixedAdd(doubles.points[j].neg());\n    }\n    a = a.add(b);\n  }\n  return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n  var w = 4;\n\n  // Precompute window\n  var nafPoints = p._getNAFPoints(w);\n  w = nafPoints.wnd;\n  var wnd = nafPoints.points;\n\n  // Get NAF form\n  var naf = getNAF(k, w, this._bitLength);\n\n  // Add `this`*(N+1) for every w-NAF index\n  var acc = this.jpoint(null, null, null);\n  for (var i = naf.length - 1; i >= 0; i--) {\n    // Count zeroes\n    for (var l = 0; i >= 0 && naf[i] === 0; i--)\n      l++;\n    if (i >= 0)\n      l++;\n    acc = acc.dblp(l);\n\n    if (i < 0)\n      break;\n    var z = naf[i];\n    assert(z !== 0);\n    if (p.type === 'affine') {\n      // J +- P\n      if (z > 0)\n        acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n      else\n        acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n    } else {\n      // J +- J\n      if (z > 0)\n        acc = acc.add(wnd[(z - 1) >> 1]);\n      else\n        acc = acc.add(wnd[(-z - 1) >> 1].neg());\n    }\n  }\n  return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n  points,\n  coeffs,\n  len,\n  jacobianResult) {\n  var wndWidth = this._wnafT1;\n  var wnd = this._wnafT2;\n  var naf = this._wnafT3;\n\n  // Fill all arrays\n  var max = 0;\n  var i;\n  var j;\n  var p;\n  for (i = 0; i < len; i++) {\n    p = points[i];\n    var nafPoints = p._getNAFPoints(defW);\n    wndWidth[i] = nafPoints.wnd;\n    wnd[i] = nafPoints.points;\n  }\n\n  // Comb small window NAFs\n  for (i = len - 1; i >= 1; i -= 2) {\n    var a = i - 1;\n    var b = i;\n    if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n      naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);\n      naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);\n      max = Math.max(naf[a].length, max);\n      max = Math.max(naf[b].length, max);\n      continue;\n    }\n\n    var comb = [\n      points[a], /* 1 */\n      null, /* 3 */\n      null, /* 5 */\n      points[b], /* 7 */\n    ];\n\n    // Try to avoid Projective points, if possible\n    if (points[a].y.cmp(points[b].y) === 0) {\n      comb[1] = points[a].add(points[b]);\n      comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n    } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n      comb[1] = points[a].toJ().mixedAdd(points[b]);\n      comb[2] = points[a].add(points[b].neg());\n    } else {\n      comb[1] = points[a].toJ().mixedAdd(points[b]);\n      comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n    }\n\n    var index = [\n      -3, /* -1 -1 */\n      -1, /* -1 0 */\n      -5, /* -1 1 */\n      -7, /* 0 -1 */\n      0, /* 0 0 */\n      7, /* 0 1 */\n      5, /* 1 -1 */\n      1, /* 1 0 */\n      3,  /* 1 1 */\n    ];\n\n    var jsf = getJSF(coeffs[a], coeffs[b]);\n    max = Math.max(jsf[0].length, max);\n    naf[a] = new Array(max);\n    naf[b] = new Array(max);\n    for (j = 0; j < max; j++) {\n      var ja = jsf[0][j] | 0;\n      var jb = jsf[1][j] | 0;\n\n      naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n      naf[b][j] = 0;\n      wnd[a] = comb;\n    }\n  }\n\n  var acc = this.jpoint(null, null, null);\n  var tmp = this._wnafT4;\n  for (i = max; i >= 0; i--) {\n    var k = 0;\n\n    while (i >= 0) {\n      var zero = true;\n      for (j = 0; j < len; j++) {\n        tmp[j] = naf[j][i] | 0;\n        if (tmp[j] !== 0)\n          zero = false;\n      }\n      if (!zero)\n        break;\n      k++;\n      i--;\n    }\n    if (i >= 0)\n      k++;\n    acc = acc.dblp(k);\n    if (i < 0)\n      break;\n\n    for (j = 0; j < len; j++) {\n      var z = tmp[j];\n      p;\n      if (z === 0)\n        continue;\n      else if (z > 0)\n        p = wnd[j][(z - 1) >> 1];\n      else if (z < 0)\n        p = wnd[j][(-z - 1) >> 1].neg();\n\n      if (p.type === 'affine')\n        acc = acc.mixedAdd(p);\n      else\n        acc = acc.add(p);\n    }\n  }\n  // Zeroify references\n  for (i = 0; i < len; i++)\n    wnd[i] = null;\n\n  if (jacobianResult)\n    return acc;\n  else\n    return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n  this.curve = curve;\n  this.type = type;\n  this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n  throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n  return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n  bytes = utils.toArray(bytes, enc);\n\n  var len = this.p.byteLength();\n\n  // uncompressed, hybrid-odd, hybrid-even\n  if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n      bytes.length - 1 === 2 * len) {\n    if (bytes[0] === 0x06)\n      assert(bytes[bytes.length - 1] % 2 === 0);\n    else if (bytes[0] === 0x07)\n      assert(bytes[bytes.length - 1] % 2 === 1);\n\n    var res =  this.point(bytes.slice(1, 1 + len),\n      bytes.slice(1 + len, 1 + 2 * len));\n\n    return res;\n  } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n              bytes.length - 1 === len) {\n    return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n  }\n  throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n  return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n  var len = this.curve.p.byteLength();\n  var x = this.getX().toArray('be', len);\n\n  if (compact)\n    return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n  return [ 0x04 ].concat(x, this.getY().toArray('be', len));\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n  return utils.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n  if (this.precomputed)\n    return this;\n\n  var precomputed = {\n    doubles: null,\n    naf: null,\n    beta: null,\n  };\n  precomputed.naf = this._getNAFPoints(8);\n  precomputed.doubles = this._getDoubles(4, power);\n  precomputed.beta = this._getBeta();\n  this.precomputed = precomputed;\n\n  return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n  if (!this.precomputed)\n    return false;\n\n  var doubles = this.precomputed.doubles;\n  if (!doubles)\n    return false;\n\n  return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n  if (this.precomputed && this.precomputed.doubles)\n    return this.precomputed.doubles;\n\n  var doubles = [ this ];\n  var acc = this;\n  for (var i = 0; i < power; i += step) {\n    for (var j = 0; j < step; j++)\n      acc = acc.dbl();\n    doubles.push(acc);\n  }\n  return {\n    step: step,\n    points: doubles,\n  };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n  if (this.precomputed && this.precomputed.naf)\n    return this.precomputed.naf;\n\n  var res = [ this ];\n  var max = (1 << wnd) - 1;\n  var dbl = max === 1 ? null : this.dbl();\n  for (var i = 1; i < max; i++)\n    res[i] = res[i - 1].add(dbl);\n  return {\n    wnd: wnd,\n    points: res,\n  };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n  return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n  var r = this;\n  for (var i = 0; i < k; i++)\n    r = r.dbl();\n  return r;\n};\n'use strict';\n\nvar utils = require('../utils');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar assert = utils.assert;\n\nfunction EdwardsCurve(conf) {\n  // NOTE: Important as we are creating point in Base.call()\n  this.twisted = (conf.a | 0) !== 1;\n  this.mOneA = this.twisted && (conf.a | 0) === -1;\n  this.extended = this.mOneA;\n\n  Base.call(this, 'edwards', conf);\n\n  this.a = new BN(conf.a, 16).umod(this.red.m);\n  this.a = this.a.toRed(this.red);\n  this.c = new BN(conf.c, 16).toRed(this.red);\n  this.c2 = this.c.redSqr();\n  this.d = new BN(conf.d, 16).toRed(this.red);\n  this.dd = this.d.redAdd(this.d);\n\n  assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\n  this.oneC = (conf.c | 0) === 1;\n}\ninherits(EdwardsCurve, Base);\nmodule.exports = EdwardsCurve;\n\nEdwardsCurve.prototype._mulA = function _mulA(num) {\n  if (this.mOneA)\n    return num.redNeg();\n  else\n    return this.a.redMul(num);\n};\n\nEdwardsCurve.prototype._mulC = function _mulC(num) {\n  if (this.oneC)\n    return num;\n  else\n    return this.c.redMul(num);\n};\n\n// Just for compatibility with Short curve\nEdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\n  return this.point(x, y, z, t);\n};\n\nEdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {\n  x = new BN(x, 16);\n  if (!x.red)\n    x = x.toRed(this.red);\n\n  var x2 = x.redSqr();\n  var rhs = this.c2.redSub(this.a.redMul(x2));\n  var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\n\n  var y2 = rhs.redMul(lhs.redInvm());\n  var y = y2.redSqrt();\n  if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n    throw new Error('invalid point');\n\n  var isOdd = y.fromRed().isOdd();\n  if (odd && !isOdd || !odd && isOdd)\n    y = y.redNeg();\n\n  return this.point(x, y);\n};\n\nEdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {\n  y = new BN(y, 16);\n  if (!y.red)\n    y = y.toRed(this.red);\n\n  // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)\n  var y2 = y.redSqr();\n  var lhs = y2.redSub(this.c2);\n  var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);\n  var x2 = lhs.redMul(rhs.redInvm());\n\n  if (x2.cmp(this.zero) === 0) {\n    if (odd)\n      throw new Error('invalid point');\n    else\n      return this.point(this.zero, y);\n  }\n\n  var x = x2.redSqrt();\n  if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n    throw new Error('invalid point');\n\n  if (x.fromRed().isOdd() !== odd)\n    x = x.redNeg();\n\n  return this.point(x, y);\n};\n\nEdwardsCurve.prototype.validate = function validate(point) {\n  if (point.isInfinity())\n    return true;\n\n  // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)\n  point.normalize();\n\n  var x2 = point.x.redSqr();\n  var y2 = point.y.redSqr();\n  var lhs = x2.redMul(this.a).redAdd(y2);\n  var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n\n  return lhs.cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, y, z, t) {\n  Base.BasePoint.call(this, curve, 'projective');\n  if (x === null && y === null && z === null) {\n    this.x = this.curve.zero;\n    this.y = this.curve.one;\n    this.z = this.curve.one;\n    this.t = this.curve.zero;\n    this.zOne = true;\n  } else {\n    this.x = new BN(x, 16);\n    this.y = new BN(y, 16);\n    this.z = z ? new BN(z, 16) : this.curve.one;\n    this.t = t && new BN(t, 16);\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.y.red)\n      this.y = this.y.toRed(this.curve.red);\n    if (!this.z.red)\n      this.z = this.z.toRed(this.curve.red);\n    if (this.t && !this.t.red)\n      this.t = this.t.toRed(this.curve.red);\n    this.zOne = this.z === this.curve.one;\n\n    // Use extended coordinates\n    if (this.curve.extended && !this.t) {\n      this.t = this.x.redMul(this.y);\n      if (!this.zOne)\n        this.t = this.t.redMul(this.z.redInvm());\n    }\n  }\n}\ninherits(Point, Base.BasePoint);\n\nEdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n  return Point.fromJSON(this, obj);\n};\n\nEdwardsCurve.prototype.point = function point(x, y, z, t) {\n  return new Point(this, x, y, z, t);\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n  return new Point(curve, obj[0], obj[1], obj[2]);\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' y: ' + this.y.fromRed().toString(16, 2) +\n      ' z: ' + this.z.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.x.cmpn(0) === 0 &&\n    (this.y.cmp(this.z) === 0 ||\n    (this.zOne && this.y.cmp(this.curve.c) === 0));\n};\n\nPoint.prototype._extDbl = function _extDbl() {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n  //     #doubling-dbl-2008-hwcd\n  // 4M + 4S\n\n  // A = X1^2\n  var a = this.x.redSqr();\n  // B = Y1^2\n  var b = this.y.redSqr();\n  // C = 2 * Z1^2\n  var c = this.z.redSqr();\n  c = c.redIAdd(c);\n  // D = a * A\n  var d = this.curve._mulA(a);\n  // E = (X1 + Y1)^2 - A - B\n  var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n  // G = D + B\n  var g = d.redAdd(b);\n  // F = G - C\n  var f = g.redSub(c);\n  // H = D - B\n  var h = d.redSub(b);\n  // X3 = E * F\n  var nx = e.redMul(f);\n  // Y3 = G * H\n  var ny = g.redMul(h);\n  // T3 = E * H\n  var nt = e.redMul(h);\n  // Z3 = F * G\n  var nz = f.redMul(g);\n  return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projDbl = function _projDbl() {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n  //     #doubling-dbl-2008-bbjlp\n  //     #doubling-dbl-2007-bl\n  // and others\n  // Generally 3M + 4S or 2M + 4S\n\n  // B = (X1 + Y1)^2\n  var b = this.x.redAdd(this.y).redSqr();\n  // C = X1^2\n  var c = this.x.redSqr();\n  // D = Y1^2\n  var d = this.y.redSqr();\n\n  var nx;\n  var ny;\n  var nz;\n  var e;\n  var h;\n  var j;\n  if (this.curve.twisted) {\n    // E = a * C\n    e = this.curve._mulA(c);\n    // F = E + D\n    var f = e.redAdd(d);\n    if (this.zOne) {\n      // X3 = (B - C - D) * (F - 2)\n      nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));\n      // Y3 = F * (E - D)\n      ny = f.redMul(e.redSub(d));\n      // Z3 = F^2 - 2 * F\n      nz = f.redSqr().redSub(f).redSub(f);\n    } else {\n      // H = Z1^2\n      h = this.z.redSqr();\n      // J = F - 2 * H\n      j = f.redSub(h).redISub(h);\n      // X3 = (B-C-D)*J\n      nx = b.redSub(c).redISub(d).redMul(j);\n      // Y3 = F * (E - D)\n      ny = f.redMul(e.redSub(d));\n      // Z3 = F * J\n      nz = f.redMul(j);\n    }\n  } else {\n    // E = C + D\n    e = c.redAdd(d);\n    // H = (c * Z1)^2\n    h = this.curve._mulC(this.z).redSqr();\n    // J = E - 2 * H\n    j = e.redSub(h).redSub(h);\n    // X3 = c * (B - E) * J\n    nx = this.curve._mulC(b.redISub(e)).redMul(j);\n    // Y3 = c * E * (C - D)\n    ny = this.curve._mulC(e).redMul(c.redISub(d));\n    // Z3 = E * J\n    nz = e.redMul(j);\n  }\n  return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.dbl = function dbl() {\n  if (this.isInfinity())\n    return this;\n\n  // Double in extended coordinates\n  if (this.curve.extended)\n    return this._extDbl();\n  else\n    return this._projDbl();\n};\n\nPoint.prototype._extAdd = function _extAdd(p) {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n  //     #addition-add-2008-hwcd-3\n  // 8M\n\n  // A = (Y1 - X1) * (Y2 - X2)\n  var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n  // B = (Y1 + X1) * (Y2 + X2)\n  var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n  // C = T1 * k * T2\n  var c = this.t.redMul(this.curve.dd).redMul(p.t);\n  // D = Z1 * 2 * Z2\n  var d = this.z.redMul(p.z.redAdd(p.z));\n  // E = B - A\n  var e = b.redSub(a);\n  // F = D - C\n  var f = d.redSub(c);\n  // G = D + C\n  var g = d.redAdd(c);\n  // H = B + A\n  var h = b.redAdd(a);\n  // X3 = E * F\n  var nx = e.redMul(f);\n  // Y3 = G * H\n  var ny = g.redMul(h);\n  // T3 = E * H\n  var nt = e.redMul(h);\n  // Z3 = F * G\n  var nz = f.redMul(g);\n  return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projAdd = function _projAdd(p) {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n  //     #addition-add-2008-bbjlp\n  //     #addition-add-2007-bl\n  // 10M + 1S\n\n  // A = Z1 * Z2\n  var a = this.z.redMul(p.z);\n  // B = A^2\n  var b = a.redSqr();\n  // C = X1 * X2\n  var c = this.x.redMul(p.x);\n  // D = Y1 * Y2\n  var d = this.y.redMul(p.y);\n  // E = d * C * D\n  var e = this.curve.d.redMul(c).redMul(d);\n  // F = B - E\n  var f = b.redSub(e);\n  // G = B + E\n  var g = b.redAdd(e);\n  // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)\n  var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\n  var nx = a.redMul(f).redMul(tmp);\n  var ny;\n  var nz;\n  if (this.curve.twisted) {\n    // Y3 = A * G * (D - a * C)\n    ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));\n    // Z3 = F * G\n    nz = f.redMul(g);\n  } else {\n    // Y3 = A * G * (D - C)\n    ny = a.redMul(g).redMul(d.redSub(c));\n    // Z3 = c * F * G\n    nz = this.curve._mulC(f).redMul(g);\n  }\n  return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.add = function add(p) {\n  if (this.isInfinity())\n    return p;\n  if (p.isInfinity())\n    return this;\n\n  if (this.curve.extended)\n    return this._extAdd(p);\n  else\n    return this._projAdd(p);\n};\n\nPoint.prototype.mul = function mul(k) {\n  if (this._hasDoubles(k))\n    return this.curve._fixedNafMul(this, k);\n  else\n    return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p, k2) {\n  return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p, k2) {\n  return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);\n};\n\nPoint.prototype.normalize = function normalize() {\n  if (this.zOne)\n    return this;\n\n  // Normalize coordinates\n  var zi = this.z.redInvm();\n  this.x = this.x.redMul(zi);\n  this.y = this.y.redMul(zi);\n  if (this.t)\n    this.t = this.t.redMul(zi);\n  this.z = this.curve.one;\n  this.zOne = true;\n  return this;\n};\n\nPoint.prototype.neg = function neg() {\n  return this.curve.point(this.x.redNeg(),\n    this.y,\n    this.z,\n    this.t && this.t.redNeg());\n};\n\nPoint.prototype.getX = function getX() {\n  this.normalize();\n  return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n  this.normalize();\n  return this.y.fromRed();\n};\n\nPoint.prototype.eq = function eq(other) {\n  return this === other ||\n         this.getX().cmp(other.getX()) === 0 &&\n         this.getY().cmp(other.getY()) === 0;\n};\n\nPoint.prototype.eqXToP = function eqXToP(x) {\n  var rx = x.toRed(this.curve.red).redMul(this.z);\n  if (this.x.cmp(rx) === 0)\n    return true;\n\n  var xc = x.clone();\n  var t = this.curve.redN.redMul(this.z);\n  for (;;) {\n    xc.iadd(this.curve.n);\n    if (xc.cmp(this.curve.p) >= 0)\n      return false;\n\n    rx.redIAdd(t);\n    if (this.x.cmp(rx) === 0)\n      return true;\n  }\n};\n\n// Compatibility with BaseCurve\nPoint.prototype.toP = Point.prototype.normalize;\nPoint.prototype.mixedAdd = Point.prototype.add;\n'use strict';\n\nvar curve = exports;\n\ncurve.base = require('./base');\ncurve.short = require('./short');\ncurve.mont = require('./mont');\ncurve.edwards = require('./edwards');\n'use strict';\n\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar utils = require('../utils');\n\nfunction MontCurve(conf) {\n  Base.call(this, 'mont', conf);\n\n  this.a = new BN(conf.a, 16).toRed(this.red);\n  this.b = new BN(conf.b, 16).toRed(this.red);\n  this.i4 = new BN(4).toRed(this.red).redInvm();\n  this.two = new BN(2).toRed(this.red);\n  this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n}\ninherits(MontCurve, Base);\nmodule.exports = MontCurve;\n\nMontCurve.prototype.validate = function validate(point) {\n  var x = point.normalize().x;\n  var x2 = x.redSqr();\n  var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\n  var y = rhs.redSqrt();\n\n  return y.redSqr().cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, z) {\n  Base.BasePoint.call(this, curve, 'projective');\n  if (x === null && z === null) {\n    this.x = this.curve.one;\n    this.z = this.curve.zero;\n  } else {\n    this.x = new BN(x, 16);\n    this.z = new BN(z, 16);\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.z.red)\n      this.z = this.z.toRed(this.curve.red);\n  }\n}\ninherits(Point, Base.BasePoint);\n\nMontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n  return this.point(utils.toArray(bytes, enc), 1);\n};\n\nMontCurve.prototype.point = function point(x, z) {\n  return new Point(this, x, z);\n};\n\nMontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n  return Point.fromJSON(this, obj);\n};\n\nPoint.prototype.precompute = function precompute() {\n  // No-op\n};\n\nPoint.prototype._encode = function _encode() {\n  return this.getX().toArray('be', this.curve.p.byteLength());\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n  return new Point(curve, obj[0], obj[1] || curve.one);\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' z: ' + this.z.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.z.cmpn(0) === 0;\n};\n\nPoint.prototype.dbl = function dbl() {\n  // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n  // 2M + 2S + 4A\n\n  // A = X1 + Z1\n  var a = this.x.redAdd(this.z);\n  // AA = A^2\n  var aa = a.redSqr();\n  // B = X1 - Z1\n  var b = this.x.redSub(this.z);\n  // BB = B^2\n  var bb = b.redSqr();\n  // C = AA - BB\n  var c = aa.redSub(bb);\n  // X3 = AA * BB\n  var nx = aa.redMul(bb);\n  // Z3 = C * (BB + A24 * C)\n  var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n  return this.curve.point(nx, nz);\n};\n\nPoint.prototype.add = function add() {\n  throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.diffAdd = function diffAdd(p, diff) {\n  // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3\n  // 4M + 2S + 6A\n\n  // A = X2 + Z2\n  var a = this.x.redAdd(this.z);\n  // B = X2 - Z2\n  var b = this.x.redSub(this.z);\n  // C = X3 + Z3\n  var c = p.x.redAdd(p.z);\n  // D = X3 - Z3\n  var d = p.x.redSub(p.z);\n  // DA = D * A\n  var da = d.redMul(a);\n  // CB = C * B\n  var cb = c.redMul(b);\n  // X5 = Z1 * (DA + CB)^2\n  var nx = diff.z.redMul(da.redAdd(cb).redSqr());\n  // Z5 = X1 * (DA - CB)^2\n  var nz = diff.x.redMul(da.redISub(cb).redSqr());\n  return this.curve.point(nx, nz);\n};\n\nPoint.prototype.mul = function mul(k) {\n  var t = k.clone();\n  var a = this; // (N / 2) * Q + Q\n  var b = this.curve.point(null, null); // (N / 2) * Q\n  var c = this; // Q\n\n  for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))\n    bits.push(t.andln(1));\n\n  for (var i = bits.length - 1; i >= 0; i--) {\n    if (bits[i] === 0) {\n      // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q\n      a = a.diffAdd(b, c);\n      // N * Q = 2 * ((N / 2) * Q + Q))\n      b = b.dbl();\n    } else {\n      // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)\n      b = a.diffAdd(b, c);\n      // N * Q + Q = 2 * ((N / 2) * Q + Q)\n      a = a.dbl();\n    }\n  }\n  return b;\n};\n\nPoint.prototype.mulAdd = function mulAdd() {\n  throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.jumlAdd = function jumlAdd() {\n  throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.eq = function eq(other) {\n  return this.getX().cmp(other.getX()) === 0;\n};\n\nPoint.prototype.normalize = function normalize() {\n  this.x = this.x.redMul(this.z.redInvm());\n  this.z = this.curve.one;\n  return this;\n};\n\nPoint.prototype.getX = function getX() {\n  // Normalize coordinates\n  this.normalize();\n\n  return this.x.fromRed();\n};\n'use strict';\n\nvar utils = require('../utils');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar assert = utils.assert;\n\nfunction ShortCurve(conf) {\n  Base.call(this, 'short', conf);\n\n  this.a = new BN(conf.a, 16).toRed(this.red);\n  this.b = new BN(conf.b, 16).toRed(this.red);\n  this.tinv = this.two.redInvm();\n\n  this.zeroA = this.a.fromRed().cmpn(0) === 0;\n  this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n  // If the curve is endomorphic, precalculate beta and lambda\n  this.endo = this._getEndomorphism(conf);\n  this._endoWnafT1 = new Array(4);\n  this._endoWnafT2 = new Array(4);\n}\ninherits(ShortCurve, Base);\nmodule.exports = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n  // No efficient endomorphism\n  if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n    return;\n\n  // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n  var beta;\n  var lambda;\n  if (conf.beta) {\n    beta = new BN(conf.beta, 16).toRed(this.red);\n  } else {\n    var betas = this._getEndoRoots(this.p);\n    // Choose the smallest beta\n    beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n    beta = beta.toRed(this.red);\n  }\n  if (conf.lambda) {\n    lambda = new BN(conf.lambda, 16);\n  } else {\n    // Choose the lambda that is matching selected beta\n    var lambdas = this._getEndoRoots(this.n);\n    if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n      lambda = lambdas[0];\n    } else {\n      lambda = lambdas[1];\n      assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n    }\n  }\n\n  // Get basis vectors, used for balanced length-two representation\n  var basis;\n  if (conf.basis) {\n    basis = conf.basis.map(function(vec) {\n      return {\n        a: new BN(vec.a, 16),\n        b: new BN(vec.b, 16),\n      };\n    });\n  } else {\n    basis = this._getEndoBasis(lambda);\n  }\n\n  return {\n    beta: beta,\n    lambda: lambda,\n    basis: basis,\n  };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n  // Find roots of for x^2 + x + 1 in F\n  // Root = (-1 +- Sqrt(-3)) / 2\n  //\n  var red = num === this.p ? this.red : BN.mont(num);\n  var tinv = new BN(2).toRed(red).redInvm();\n  var ntinv = tinv.redNeg();\n\n  var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n  var l1 = ntinv.redAdd(s).fromRed();\n  var l2 = ntinv.redSub(s).fromRed();\n  return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n  // aprxSqrt >= sqrt(this.n)\n  var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n\n  // 3.74\n  // Run EGCD, until r(L + 1) < aprxSqrt\n  var u = lambda;\n  var v = this.n.clone();\n  var x1 = new BN(1);\n  var y1 = new BN(0);\n  var x2 = new BN(0);\n  var y2 = new BN(1);\n\n  // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n  var a0;\n  var b0;\n  // First vector\n  var a1;\n  var b1;\n  // Second vector\n  var a2;\n  var b2;\n\n  var prevR;\n  var i = 0;\n  var r;\n  var x;\n  while (u.cmpn(0) !== 0) {\n    var q = v.div(u);\n    r = v.sub(q.mul(u));\n    x = x2.sub(q.mul(x1));\n    var y = y2.sub(q.mul(y1));\n\n    if (!a1 && r.cmp(aprxSqrt) < 0) {\n      a0 = prevR.neg();\n      b0 = x1;\n      a1 = r.neg();\n      b1 = x;\n    } else if (a1 && ++i === 2) {\n      break;\n    }\n    prevR = r;\n\n    v = u;\n    u = r;\n    x2 = x1;\n    x1 = x;\n    y2 = y1;\n    y1 = y;\n  }\n  a2 = r.neg();\n  b2 = x;\n\n  var len1 = a1.sqr().add(b1.sqr());\n  var len2 = a2.sqr().add(b2.sqr());\n  if (len2.cmp(len1) >= 0) {\n    a2 = a0;\n    b2 = b0;\n  }\n\n  // Normalize signs\n  if (a1.negative) {\n    a1 = a1.neg();\n    b1 = b1.neg();\n  }\n  if (a2.negative) {\n    a2 = a2.neg();\n    b2 = b2.neg();\n  }\n\n  return [\n    { a: a1, b: b1 },\n    { a: a2, b: b2 },\n  ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n  var basis = this.endo.basis;\n  var v1 = basis[0];\n  var v2 = basis[1];\n\n  var c1 = v2.b.mul(k).divRound(this.n);\n  var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n  var p1 = c1.mul(v1.a);\n  var p2 = c2.mul(v2.a);\n  var q1 = c1.mul(v1.b);\n  var q2 = c2.mul(v2.b);\n\n  // Calculate answer\n  var k1 = k.sub(p1).sub(p2);\n  var k2 = q1.add(q2).neg();\n  return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n  x = new BN(x, 16);\n  if (!x.red)\n    x = x.toRed(this.red);\n\n  var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n  var y = y2.redSqrt();\n  if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n    throw new Error('invalid point');\n\n  // XXX Is there any way to tell if the number is odd without converting it\n  // to non-red form?\n  var isOdd = y.fromRed().isOdd();\n  if (odd && !isOdd || !odd && isOdd)\n    y = y.redNeg();\n\n  return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n  if (point.inf)\n    return true;\n\n  var x = point.x;\n  var y = point.y;\n\n  var ax = this.a.redMul(x);\n  var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n  return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n    function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n      var npoints = this._endoWnafT1;\n      var ncoeffs = this._endoWnafT2;\n      for (var i = 0; i < points.length; i++) {\n        var split = this._endoSplit(coeffs[i]);\n        var p = points[i];\n        var beta = p._getBeta();\n\n        if (split.k1.negative) {\n          split.k1.ineg();\n          p = p.neg(true);\n        }\n        if (split.k2.negative) {\n          split.k2.ineg();\n          beta = beta.neg(true);\n        }\n\n        npoints[i * 2] = p;\n        npoints[i * 2 + 1] = beta;\n        ncoeffs[i * 2] = split.k1;\n        ncoeffs[i * 2 + 1] = split.k2;\n      }\n      var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n\n      // Clean-up references to points and coefficients\n      for (var j = 0; j < i * 2; j++) {\n        npoints[j] = null;\n        ncoeffs[j] = null;\n      }\n      return res;\n    };\n\nfunction Point(curve, x, y, isRed) {\n  Base.BasePoint.call(this, curve, 'affine');\n  if (x === null && y === null) {\n    this.x = null;\n    this.y = null;\n    this.inf = true;\n  } else {\n    this.x = new BN(x, 16);\n    this.y = new BN(y, 16);\n    // Force redgomery representation when loading from JSON\n    if (isRed) {\n      this.x.forceRed(this.curve.red);\n      this.y.forceRed(this.curve.red);\n    }\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.y.red)\n      this.y = this.y.toRed(this.curve.red);\n    this.inf = false;\n  }\n}\ninherits(Point, Base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n  return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n  return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n  if (!this.curve.endo)\n    return;\n\n  var pre = this.precomputed;\n  if (pre && pre.beta)\n    return pre.beta;\n\n  var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n  if (pre) {\n    var curve = this.curve;\n    var endoMul = function(p) {\n      return curve.point(p.x.redMul(curve.endo.beta), p.y);\n    };\n    pre.beta = beta;\n    beta.precomputed = {\n      beta: null,\n      naf: pre.naf && {\n        wnd: pre.naf.wnd,\n        points: pre.naf.points.map(endoMul),\n      },\n      doubles: pre.doubles && {\n        step: pre.doubles.step,\n        points: pre.doubles.points.map(endoMul),\n      },\n    };\n  }\n  return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n  if (!this.precomputed)\n    return [ this.x, this.y ];\n\n  return [ this.x, this.y, this.precomputed && {\n    doubles: this.precomputed.doubles && {\n      step: this.precomputed.doubles.step,\n      points: this.precomputed.doubles.points.slice(1),\n    },\n    naf: this.precomputed.naf && {\n      wnd: this.precomputed.naf.wnd,\n      points: this.precomputed.naf.points.slice(1),\n    },\n  } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n  if (typeof obj === 'string')\n    obj = JSON.parse(obj);\n  var res = curve.point(obj[0], obj[1], red);\n  if (!obj[2])\n    return res;\n\n  function obj2point(obj) {\n    return curve.point(obj[0], obj[1], red);\n  }\n\n  var pre = obj[2];\n  res.precomputed = {\n    beta: null,\n    doubles: pre.doubles && {\n      step: pre.doubles.step,\n      points: [ res ].concat(pre.doubles.points.map(obj2point)),\n    },\n    naf: pre.naf && {\n      wnd: pre.naf.wnd,\n      points: [ res ].concat(pre.naf.points.map(obj2point)),\n    },\n  };\n  return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' y: ' + this.y.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n  // O + P = P\n  if (this.inf)\n    return p;\n\n  // P + O = P\n  if (p.inf)\n    return this;\n\n  // P + P = 2P\n  if (this.eq(p))\n    return this.dbl();\n\n  // P + (-P) = O\n  if (this.neg().eq(p))\n    return this.curve.point(null, null);\n\n  // P + Q = O\n  if (this.x.cmp(p.x) === 0)\n    return this.curve.point(null, null);\n\n  var c = this.y.redSub(p.y);\n  if (c.cmpn(0) !== 0)\n    c = c.redMul(this.x.redSub(p.x).redInvm());\n  var nx = c.redSqr().redISub(this.x).redISub(p.x);\n  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n  return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n  if (this.inf)\n    return this;\n\n  // 2P = O\n  var ys1 = this.y.redAdd(this.y);\n  if (ys1.cmpn(0) === 0)\n    return this.curve.point(null, null);\n\n  var a = this.curve.a;\n\n  var x2 = this.x.redSqr();\n  var dyinv = ys1.redInvm();\n  var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n  var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n  return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n  return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n  return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n  k = new BN(k, 16);\n  if (this.isInfinity())\n    return this;\n  else if (this._hasDoubles(k))\n    return this.curve._fixedNafMul(this, k);\n  else if (this.curve.endo)\n    return this.curve._endoWnafMulAdd([ this ], [ k ]);\n  else\n    return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n  var points = [ this, p2 ];\n  var coeffs = [ k1, k2 ];\n  if (this.curve.endo)\n    return this.curve._endoWnafMulAdd(points, coeffs);\n  else\n    return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n  var points = [ this, p2 ];\n  var coeffs = [ k1, k2 ];\n  if (this.curve.endo)\n    return this.curve._endoWnafMulAdd(points, coeffs, true);\n  else\n    return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n  return this === p ||\n         this.inf === p.inf &&\n             (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n  if (this.inf)\n    return this;\n\n  var res = this.curve.point(this.x, this.y.redNeg());\n  if (_precompute && this.precomputed) {\n    var pre = this.precomputed;\n    var negate = function(p) {\n      return p.neg();\n    };\n    res.precomputed = {\n      naf: pre.naf && {\n        wnd: pre.naf.wnd,\n        points: pre.naf.points.map(negate),\n      },\n      doubles: pre.doubles && {\n        step: pre.doubles.step,\n        points: pre.doubles.points.map(negate),\n      },\n    };\n  }\n  return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n  if (this.inf)\n    return this.curve.jpoint(null, null, null);\n\n  var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n  return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n  Base.BasePoint.call(this, curve, 'jacobian');\n  if (x === null && y === null && z === null) {\n    this.x = this.curve.one;\n    this.y = this.curve.one;\n    this.z = new BN(0);\n  } else {\n    this.x = new BN(x, 16);\n    this.y = new BN(y, 16);\n    this.z = new BN(z, 16);\n  }\n  if (!this.x.red)\n    this.x = this.x.toRed(this.curve.red);\n  if (!this.y.red)\n    this.y = this.y.toRed(this.curve.red);\n  if (!this.z.red)\n    this.z = this.z.toRed(this.curve.red);\n\n  this.zOne = this.z === this.curve.one;\n}\ninherits(JPoint, Base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n  return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n  if (this.isInfinity())\n    return this.curve.point(null, null);\n\n  var zinv = this.z.redInvm();\n  var zinv2 = zinv.redSqr();\n  var ax = this.x.redMul(zinv2);\n  var ay = this.y.redMul(zinv2).redMul(zinv);\n\n  return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n  return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n  // O + P = P\n  if (this.isInfinity())\n    return p;\n\n  // P + O = P\n  if (p.isInfinity())\n    return this;\n\n  // 12M + 4S + 7A\n  var pz2 = p.z.redSqr();\n  var z2 = this.z.redSqr();\n  var u1 = this.x.redMul(pz2);\n  var u2 = p.x.redMul(z2);\n  var s1 = this.y.redMul(pz2.redMul(p.z));\n  var s2 = p.y.redMul(z2.redMul(this.z));\n\n  var h = u1.redSub(u2);\n  var r = s1.redSub(s2);\n  if (h.cmpn(0) === 0) {\n    if (r.cmpn(0) !== 0)\n      return this.curve.jpoint(null, null, null);\n    else\n      return this.dbl();\n  }\n\n  var h2 = h.redSqr();\n  var h3 = h2.redMul(h);\n  var v = u1.redMul(h2);\n\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n  var nz = this.z.redMul(p.z).redMul(h);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n  // O + P = P\n  if (this.isInfinity())\n    return p.toJ();\n\n  // P + O = P\n  if (p.isInfinity())\n    return this;\n\n  // 8M + 3S + 7A\n  var z2 = this.z.redSqr();\n  var u1 = this.x;\n  var u2 = p.x.redMul(z2);\n  var s1 = this.y;\n  var s2 = p.y.redMul(z2).redMul(this.z);\n\n  var h = u1.redSub(u2);\n  var r = s1.redSub(s2);\n  if (h.cmpn(0) === 0) {\n    if (r.cmpn(0) !== 0)\n      return this.curve.jpoint(null, null, null);\n    else\n      return this.dbl();\n  }\n\n  var h2 = h.redSqr();\n  var h3 = h2.redMul(h);\n  var v = u1.redMul(h2);\n\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n  var nz = this.z.redMul(h);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n  if (pow === 0)\n    return this;\n  if (this.isInfinity())\n    return this;\n  if (!pow)\n    return this.dbl();\n\n  var i;\n  if (this.curve.zeroA || this.curve.threeA) {\n    var r = this;\n    for (i = 0; i < pow; i++)\n      r = r.dbl();\n    return r;\n  }\n\n  // 1M + 2S + 1A + N * (4S + 5M + 8A)\n  // N = 1 => 6M + 6S + 9A\n  var a = this.curve.a;\n  var tinv = this.curve.tinv;\n\n  var jx = this.x;\n  var jy = this.y;\n  var jz = this.z;\n  var jz4 = jz.redSqr().redSqr();\n\n  // Reuse results\n  var jyd = jy.redAdd(jy);\n  for (i = 0; i < pow; i++) {\n    var jx2 = jx.redSqr();\n    var jyd2 = jyd.redSqr();\n    var jyd4 = jyd2.redSqr();\n    var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n    var t1 = jx.redMul(jyd2);\n    var nx = c.redSqr().redISub(t1.redAdd(t1));\n    var t2 = t1.redISub(nx);\n    var dny = c.redMul(t2);\n    dny = dny.redIAdd(dny).redISub(jyd4);\n    var nz = jyd.redMul(jz);\n    if (i + 1 < pow)\n      jz4 = jz4.redMul(jyd4);\n\n    jx = nx;\n    jz = nz;\n    jyd = dny;\n  }\n\n  return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n  if (this.isInfinity())\n    return this;\n\n  if (this.curve.zeroA)\n    return this._zeroDbl();\n  else if (this.curve.threeA)\n    return this._threeDbl();\n  else\n    return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n  var nx;\n  var ny;\n  var nz;\n  // Z = 1\n  if (this.zOne) {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n    //     #doubling-mdbl-2007-bl\n    // 1M + 5S + 14A\n\n    // XX = X1^2\n    var xx = this.x.redSqr();\n    // YY = Y1^2\n    var yy = this.y.redSqr();\n    // YYYY = YY^2\n    var yyyy = yy.redSqr();\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n    s = s.redIAdd(s);\n    // M = 3 * XX + a; a = 0\n    var m = xx.redAdd(xx).redIAdd(xx);\n    // T = M ^ 2 - 2*S\n    var t = m.redSqr().redISub(s).redISub(s);\n\n    // 8 * YYYY\n    var yyyy8 = yyyy.redIAdd(yyyy);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n\n    // X3 = T\n    nx = t;\n    // Y3 = M * (S - T) - 8 * YYYY\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n    // Z3 = 2*Y1\n    nz = this.y.redAdd(this.y);\n  } else {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n    //     #doubling-dbl-2009-l\n    // 2M + 5S + 13A\n\n    // A = X1^2\n    var a = this.x.redSqr();\n    // B = Y1^2\n    var b = this.y.redSqr();\n    // C = B^2\n    var c = b.redSqr();\n    // D = 2 * ((X1 + B)^2 - A - C)\n    var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n    d = d.redIAdd(d);\n    // E = 3 * A\n    var e = a.redAdd(a).redIAdd(a);\n    // F = E^2\n    var f = e.redSqr();\n\n    // 8 * C\n    var c8 = c.redIAdd(c);\n    c8 = c8.redIAdd(c8);\n    c8 = c8.redIAdd(c8);\n\n    // X3 = F - 2 * D\n    nx = f.redISub(d).redISub(d);\n    // Y3 = E * (D - X3) - 8 * C\n    ny = e.redMul(d.redISub(nx)).redISub(c8);\n    // Z3 = 2 * Y1 * Z1\n    nz = this.y.redMul(this.z);\n    nz = nz.redIAdd(nz);\n  }\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n  var nx;\n  var ny;\n  var nz;\n  // Z = 1\n  if (this.zOne) {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n    //     #doubling-mdbl-2007-bl\n    // 1M + 5S + 15A\n\n    // XX = X1^2\n    var xx = this.x.redSqr();\n    // YY = Y1^2\n    var yy = this.y.redSqr();\n    // YYYY = YY^2\n    var yyyy = yy.redSqr();\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n    s = s.redIAdd(s);\n    // M = 3 * XX + a\n    var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n    // T = M^2 - 2 * S\n    var t = m.redSqr().redISub(s).redISub(s);\n    // X3 = T\n    nx = t;\n    // Y3 = M * (S - T) - 8 * YYYY\n    var yyyy8 = yyyy.redIAdd(yyyy);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n    // Z3 = 2 * Y1\n    nz = this.y.redAdd(this.y);\n  } else {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n    // 3M + 5S\n\n    // delta = Z1^2\n    var delta = this.z.redSqr();\n    // gamma = Y1^2\n    var gamma = this.y.redSqr();\n    // beta = X1 * gamma\n    var beta = this.x.redMul(gamma);\n    // alpha = 3 * (X1 - delta) * (X1 + delta)\n    var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n    alpha = alpha.redAdd(alpha).redIAdd(alpha);\n    // X3 = alpha^2 - 8 * beta\n    var beta4 = beta.redIAdd(beta);\n    beta4 = beta4.redIAdd(beta4);\n    var beta8 = beta4.redAdd(beta4);\n    nx = alpha.redSqr().redISub(beta8);\n    // Z3 = (Y1 + Z1)^2 - gamma - delta\n    nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n    // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n    var ggamma8 = gamma.redSqr();\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n  }\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n  var a = this.curve.a;\n\n  // 4M + 6S + 10A\n  var jx = this.x;\n  var jy = this.y;\n  var jz = this.z;\n  var jz4 = jz.redSqr().redSqr();\n\n  var jx2 = jx.redSqr();\n  var jy2 = jy.redSqr();\n\n  var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n  var jxd4 = jx.redAdd(jx);\n  jxd4 = jxd4.redIAdd(jxd4);\n  var t1 = jxd4.redMul(jy2);\n  var nx = c.redSqr().redISub(t1.redAdd(t1));\n  var t2 = t1.redISub(nx);\n\n  var jyd8 = jy2.redSqr();\n  jyd8 = jyd8.redIAdd(jyd8);\n  jyd8 = jyd8.redIAdd(jyd8);\n  jyd8 = jyd8.redIAdd(jyd8);\n  var ny = c.redMul(t2).redISub(jyd8);\n  var nz = jy.redAdd(jy).redMul(jz);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n  if (!this.curve.zeroA)\n    return this.dbl().add(this);\n\n  // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n  // 5M + 10S + ...\n\n  // XX = X1^2\n  var xx = this.x.redSqr();\n  // YY = Y1^2\n  var yy = this.y.redSqr();\n  // ZZ = Z1^2\n  var zz = this.z.redSqr();\n  // YYYY = YY^2\n  var yyyy = yy.redSqr();\n  // M = 3 * XX + a * ZZ2; a = 0\n  var m = xx.redAdd(xx).redIAdd(xx);\n  // MM = M^2\n  var mm = m.redSqr();\n  // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n  var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n  e = e.redIAdd(e);\n  e = e.redAdd(e).redIAdd(e);\n  e = e.redISub(mm);\n  // EE = E^2\n  var ee = e.redSqr();\n  // T = 16*YYYY\n  var t = yyyy.redIAdd(yyyy);\n  t = t.redIAdd(t);\n  t = t.redIAdd(t);\n  t = t.redIAdd(t);\n  // U = (M + E)^2 - MM - EE - T\n  var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n  // X3 = 4 * (X1 * EE - 4 * YY * U)\n  var yyu4 = yy.redMul(u);\n  yyu4 = yyu4.redIAdd(yyu4);\n  yyu4 = yyu4.redIAdd(yyu4);\n  var nx = this.x.redMul(ee).redISub(yyu4);\n  nx = nx.redIAdd(nx);\n  nx = nx.redIAdd(nx);\n  // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n  var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n  ny = ny.redIAdd(ny);\n  ny = ny.redIAdd(ny);\n  ny = ny.redIAdd(ny);\n  // Z3 = (Z1 + E)^2 - ZZ - EE\n  var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n  k = new BN(k, kbase);\n\n  return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n  if (p.type === 'affine')\n    return this.eq(p.toJ());\n\n  if (this === p)\n    return true;\n\n  // x1 * z2^2 == x2 * z1^2\n  var z2 = this.z.redSqr();\n  var pz2 = p.z.redSqr();\n  if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n    return false;\n\n  // y1 * z2^3 == y2 * z1^3\n  var z3 = z2.redMul(this.z);\n  var pz3 = pz2.redMul(p.z);\n  return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n  var zs = this.z.redSqr();\n  var rx = x.toRed(this.curve.red).redMul(zs);\n  if (this.x.cmp(rx) === 0)\n    return true;\n\n  var xc = x.clone();\n  var t = this.curve.redN.redMul(zs);\n  for (;;) {\n    xc.iadd(this.curve.n);\n    if (xc.cmp(this.curve.p) >= 0)\n      return false;\n\n    rx.redIAdd(t);\n    if (this.x.cmp(rx) === 0)\n      return true;\n  }\n};\n\nJPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC JPoint Infinity>';\n  return '<EC JPoint x: ' + this.x.toString(16, 2) +\n      ' y: ' + this.y.toString(16, 2) +\n      ' z: ' + this.z.toString(16, 2) + '>';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.z.cmpn(0) === 0;\n};\n'use strict';\n\nvar curves = exports;\n\nvar hash = require('hash.js');\nvar curve = require('./curve');\nvar utils = require('./utils');\n\nvar assert = utils.assert;\n\nfunction PresetCurve(options) {\n  if (options.type === 'short')\n    this.curve = new curve.short(options);\n  else if (options.type === 'edwards')\n    this.curve = new curve.edwards(options);\n  else\n    this.curve = new curve.mont(options);\n  this.g = this.curve.g;\n  this.n = this.curve.n;\n  this.hash = options.hash;\n\n  assert(this.g.validate(), 'Invalid curve');\n  assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n  Object.defineProperty(curves, name, {\n    configurable: true,\n    enumerable: true,\n    get: function() {\n      var curve = new PresetCurve(options);\n      Object.defineProperty(curves, name, {\n        configurable: true,\n        enumerable: true,\n        value: curve,\n      });\n      return curve;\n    },\n  });\n}\n\ndefineCurve('p192', {\n  type: 'short',\n  prime: 'p192',\n  p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n  a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n  b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n  n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n    '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811',\n  ],\n});\n\ndefineCurve('p224', {\n  type: 'short',\n  prime: 'p224',\n  p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n  a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n  b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n  n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n    'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34',\n  ],\n});\n\ndefineCurve('p256', {\n  type: 'short',\n  prime: null,\n  p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n  a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n  b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n  n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n    '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5',\n  ],\n});\n\ndefineCurve('p384', {\n  type: 'short',\n  prime: null,\n  p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'fffffffe ffffffff 00000000 00000000 ffffffff',\n  a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'fffffffe ffffffff 00000000 00000000 fffffffc',\n  b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n     '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n  n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n     'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n  hash: hash.sha384,\n  gRed: false,\n  g: [\n    'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n    '5502f25d bf55296c 3a545e38 72760ab7',\n    '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n    '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f',\n  ],\n});\n\ndefineCurve('p521', {\n  type: 'short',\n  prime: null,\n  p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff ffffffff ffffffff ffffffff',\n  a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff ffffffff ffffffff fffffffc',\n  b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n     '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n     '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n  n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n     'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n  hash: hash.sha512,\n  gRed: false,\n  g: [\n    '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n    '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n    'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n    '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n    '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n    '3fad0761 353c7086 a272c240 88be9476 9fd16650',\n  ],\n});\n\ndefineCurve('curve25519', {\n  type: 'mont',\n  prime: 'p25519',\n  p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n  a: '76d06',\n  b: '1',\n  n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '9',\n  ],\n});\n\ndefineCurve('ed25519', {\n  type: 'edwards',\n  prime: 'p25519',\n  p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n  a: '-1',\n  c: '1',\n  // -121665 * (121666^(-1)) (mod P)\n  d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n  n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n    // 4/5\n    '6666666666666666666666666666666666666666666666666666666666666658',\n  ],\n});\n\nvar pre;\ntry {\n  pre = require('./precomputed/secp256k1');\n} catch (e) {\n  pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n  type: 'short',\n  prime: 'k256',\n  p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n  a: '0',\n  b: '7',\n  n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n  h: '1',\n  hash: hash.sha256,\n\n  // Precomputed endomorphism\n  beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n  lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n  basis: [\n    {\n      a: '3086d221a7d46bcde86c90e49284eb15',\n      b: '-e4437ed6010e88286f547fa90abfe4c3',\n    },\n    {\n      a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n      b: '3086d221a7d46bcde86c90e49284eb15',\n    },\n  ],\n\n  gRed: false,\n  g: [\n    '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n    '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n    pre,\n  ],\n});\n'use strict';\n\nvar BN = require('bn.js');\nvar HmacDRBG = require('hmac-drbg');\nvar utils = require('../utils');\nvar curves = require('../curves');\nvar rand = require('brorand');\nvar assert = utils.assert;\n\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EC(options) {\n  if (!(this instanceof EC))\n    return new EC(options);\n\n  // Shortcut `elliptic.ec(curve-name)`\n  if (typeof options === 'string') {\n    assert(Object.prototype.hasOwnProperty.call(curves, options),\n      'Unknown curve ' + options);\n\n    options = curves[options];\n  }\n\n  // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n  if (options instanceof curves.PresetCurve)\n    options = { curve: options };\n\n  this.curve = options.curve.curve;\n  this.n = this.curve.n;\n  this.nh = this.n.ushrn(1);\n  this.g = this.curve.g;\n\n  // Point on curve\n  this.g = options.curve.g;\n  this.g.precompute(options.curve.n.bitLength() + 1);\n\n  // Hash for function for DRBG\n  this.hash = options.hash || options.curve.hash;\n}\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n  return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n  return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n  return KeyPair.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n  if (!options)\n    options = {};\n\n  // Instantiate Hmac_DRBG\n  var drbg = new HmacDRBG({\n    hash: this.hash,\n    pers: options.pers,\n    persEnc: options.persEnc || 'utf8',\n    entropy: options.entropy || rand(this.hash.hmacStrength),\n    entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n    nonce: this.n.toArray(),\n  });\n\n  var bytes = this.n.byteLength();\n  var ns2 = this.n.sub(new BN(2));\n  for (;;) {\n    var priv = new BN(drbg.generate(bytes));\n    if (priv.cmp(ns2) > 0)\n      continue;\n\n    priv.iaddn(1);\n    return this.keyFromPrivate(priv);\n  }\n};\n\nEC.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) {\n  var byteLength;\n  if (BN.isBN(msg) || typeof msg === 'number') {\n    msg = new BN(msg, 16);\n    byteLength = msg.byteLength();\n  } else if (typeof msg === 'object') {\n    // BN assumes an array-like input and asserts length\n    byteLength = msg.length;\n    msg = new BN(msg, 16);\n  } else {\n    // BN converts the value to string\n    var str = msg.toString();\n    // HEX encoding\n    byteLength = (str.length + 1) >>> 1;\n    msg = new BN(str, 16);\n  }\n  // Allow overriding\n  if (typeof bitLength !== 'number') {\n    bitLength = byteLength * 8;\n  }\n  var delta = bitLength - this.n.bitLength();\n  if (delta > 0)\n    msg = msg.ushrn(delta);\n  if (!truncOnly && msg.cmp(this.n) >= 0)\n    return msg.sub(this.n);\n  else\n    return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n  if (typeof enc === 'object') {\n    options = enc;\n    enc = null;\n  }\n  if (!options)\n    options = {};\n\n  if (typeof msg !== 'string' && typeof msg !== 'number' && !BN.isBN(msg)) {\n    assert(typeof msg === 'object' && msg && typeof msg.length === 'number',\n      'Expected message to be an array-like, a hex string, or a BN instance');\n    assert((msg.length >>> 0) === msg.length); // non-negative 32-bit integer\n    for (var i = 0; i < msg.length; i++) assert((msg[i] & 255) === msg[i]);\n  }\n\n  key = this.keyFromPrivate(key, enc);\n  msg = this._truncateToN(msg, false, options.msgBitLength);\n\n  // Would fail further checks, but let's make the error message clear\n  assert(!msg.isNeg(), 'Can not sign a negative message');\n\n  // Zero-extend key to provide enough entropy\n  var bytes = this.n.byteLength();\n  var bkey = key.getPrivate().toArray('be', bytes);\n\n  // Zero-extend nonce to have the same byte size as N\n  var nonce = msg.toArray('be', bytes);\n\n  // Recheck nonce to be bijective to msg\n  assert((new BN(nonce)).eq(msg), 'Can not sign message');\n\n  // Instantiate Hmac_DRBG\n  var drbg = new HmacDRBG({\n    hash: this.hash,\n    entropy: bkey,\n    nonce: nonce,\n    pers: options.pers,\n    persEnc: options.persEnc || 'utf8',\n  });\n\n  // Number of bytes to generate\n  var ns1 = this.n.sub(new BN(1));\n\n  for (var iter = 0; ; iter++) {\n    var k = options.k ?\n      options.k(iter) :\n      new BN(drbg.generate(this.n.byteLength()));\n    k = this._truncateToN(k, true);\n    if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n      continue;\n\n    var kp = this.g.mul(k);\n    if (kp.isInfinity())\n      continue;\n\n    var kpX = kp.getX();\n    var r = kpX.umod(this.n);\n    if (r.cmpn(0) === 0)\n      continue;\n\n    var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n    s = s.umod(this.n);\n    if (s.cmpn(0) === 0)\n      continue;\n\n    var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\n                        (kpX.cmp(r) !== 0 ? 2 : 0);\n\n    // Use complement of `s`, if it is > `n / 2`\n    if (options.canonical && s.cmp(this.nh) > 0) {\n      s = this.n.sub(s);\n      recoveryParam ^= 1;\n    }\n\n    return new Signature({ r: r, s: s, recoveryParam: recoveryParam });\n  }\n};\n\nEC.prototype.verify = function verify(msg, signature, key, enc, options) {\n  if (!options)\n    options = {};\n\n  msg = this._truncateToN(msg, false, options.msgBitLength);\n  key = this.keyFromPublic(key, enc);\n  signature = new Signature(signature, 'hex');\n\n  // Perform primitive values validation\n  var r = signature.r;\n  var s = signature.s;\n  if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n    return false;\n  if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n    return false;\n\n  // Validate signature\n  var sinv = s.invm(this.n);\n  var u1 = sinv.mul(msg).umod(this.n);\n  var u2 = sinv.mul(r).umod(this.n);\n  var p;\n\n  if (!this.curve._maxwellTrick) {\n    p = this.g.mulAdd(u1, key.getPublic(), u2);\n    if (p.isInfinity())\n      return false;\n\n    return p.getX().umod(this.n).cmp(r) === 0;\n  }\n\n  // NOTE: Greg Maxwell's trick, inspired by:\n  // https://git.io/vad3K\n\n  p = this.g.jmulAdd(u1, key.getPublic(), u2);\n  if (p.isInfinity())\n    return false;\n\n  // Compare `p.x` of Jacobian point with `r`,\n  // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n  // inverse of `p.z^2`\n  return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n  assert((3 & j) === j, 'The recovery param is more than two bits');\n  signature = new Signature(signature, enc);\n\n  var n = this.n;\n  var e = new BN(msg);\n  var r = signature.r;\n  var s = signature.s;\n\n  // A set LSB signifies that the y-coordinate is odd\n  var isYOdd = j & 1;\n  var isSecondKey = j >> 1;\n  if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n    throw new Error('Unable to find sencond key candinate');\n\n  // 1.1. Let x = r + jn.\n  if (isSecondKey)\n    r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n  else\n    r = this.curve.pointFromX(r, isYOdd);\n\n  var rInv = signature.r.invm(n);\n  var s1 = n.sub(e).mul(rInv).umod(n);\n  var s2 = s.mul(rInv).umod(n);\n\n  // 1.6.1 Compute Q = r^-1 (sR -  eG)\n  //               Q = r^-1 (sR + -eG)\n  return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n  signature = new Signature(signature, enc);\n  if (signature.recoveryParam !== null)\n    return signature.recoveryParam;\n\n  for (var i = 0; i < 4; i++) {\n    var Qprime;\n    try {\n      Qprime = this.recoverPubKey(e, signature, i);\n    } catch (e) {\n      continue;\n    }\n\n    if (Qprime.eq(Q))\n      return i;\n  }\n  throw new Error('Unable to find valid recovery factor');\n};\n'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar assert = utils.assert;\n\nfunction KeyPair(ec, options) {\n  this.ec = ec;\n  this.priv = null;\n  this.pub = null;\n\n  // KeyPair(ec, { priv: ..., pub: ... })\n  if (options.priv)\n    this._importPrivate(options.priv, options.privEnc);\n  if (options.pub)\n    this._importPublic(options.pub, options.pubEnc);\n}\nmodule.exports = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n  if (pub instanceof KeyPair)\n    return pub;\n\n  return new KeyPair(ec, {\n    pub: pub,\n    pubEnc: enc,\n  });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n  if (priv instanceof KeyPair)\n    return priv;\n\n  return new KeyPair(ec, {\n    priv: priv,\n    privEnc: enc,\n  });\n};\n\nKeyPair.prototype.validate = function validate() {\n  var pub = this.getPublic();\n\n  if (pub.isInfinity())\n    return { result: false, reason: 'Invalid public key' };\n  if (!pub.validate())\n    return { result: false, reason: 'Public key is not a point' };\n  if (!pub.mul(this.ec.curve.n).isInfinity())\n    return { result: false, reason: 'Public key * N != O' };\n\n  return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n  // compact is optional argument\n  if (typeof compact === 'string') {\n    enc = compact;\n    compact = null;\n  }\n\n  if (!this.pub)\n    this.pub = this.ec.g.mul(this.priv);\n\n  if (!enc)\n    return this.pub;\n\n  return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n  if (enc === 'hex')\n    return this.priv.toString(16, 2);\n  else\n    return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n  this.priv = new BN(key, enc || 16);\n\n  // Ensure that the priv won't be bigger than n, otherwise we may fail\n  // in fixed multiplication method\n  this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n  if (key.x || key.y) {\n    // Montgomery points only have an `x` coordinate.\n    // Weierstrass/Edwards points on the other hand have both `x` and\n    // `y` coordinates.\n    if (this.ec.curve.type === 'mont') {\n      assert(key.x, 'Need x coordinate');\n    } else if (this.ec.curve.type === 'short' ||\n               this.ec.curve.type === 'edwards') {\n      assert(key.x && key.y, 'Need both x and y coordinate');\n    }\n    this.pub = this.ec.curve.point(key.x, key.y);\n    return;\n  }\n  this.pub = this.ec.curve.decodePoint(key, enc);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n  if(!pub.validate()) {\n    assert(pub.validate(), 'public point not validated');\n  }\n  return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n  return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature, options) {\n  return this.ec.verify(msg, signature, this, undefined, options);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n  return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +\n         ' pub: ' + (this.pub && this.pub.inspect()) + ' >';\n};\n'use strict';\n\nvar BN = require('bn.js');\n\nvar utils = require('../utils');\nvar assert = utils.assert;\n\nfunction Signature(options, enc) {\n  if (options instanceof Signature)\n    return options;\n\n  if (this._importDER(options, enc))\n    return;\n\n  assert(options.r && options.s, 'Signature without r or s');\n  this.r = new BN(options.r, 16);\n  this.s = new BN(options.s, 16);\n  if (options.recoveryParam === undefined)\n    this.recoveryParam = null;\n  else\n    this.recoveryParam = options.recoveryParam;\n}\nmodule.exports = Signature;\n\nfunction Position() {\n  this.place = 0;\n}\n\nfunction getLength(buf, p) {\n  var initial = buf[p.place++];\n  if (!(initial & 0x80)) {\n    return initial;\n  }\n  var octetLen = initial & 0xf;\n\n  // Indefinite length or overflow\n  if (octetLen === 0 || octetLen > 4) {\n    return false;\n  }\n\n  if(buf[p.place] === 0x00) {\n    return false;\n  }\n\n  var val = 0;\n  for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n    val <<= 8;\n    val |= buf[off];\n    val >>>= 0;\n  }\n\n  // Leading zeroes\n  if (val <= 0x7f) {\n    return false;\n  }\n\n  p.place = off;\n  return val;\n}\n\nfunction rmPadding(buf) {\n  var i = 0;\n  var len = buf.length - 1;\n  while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n    i++;\n  }\n  if (i === 0) {\n    return buf;\n  }\n  return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n  data = utils.toArray(data, enc);\n  var p = new Position();\n  if (data[p.place++] !== 0x30) {\n    return false;\n  }\n  var len = getLength(data, p);\n  if (len === false) {\n    return false;\n  }\n  if ((len + p.place) !== data.length) {\n    return false;\n  }\n  if (data[p.place++] !== 0x02) {\n    return false;\n  }\n  var rlen = getLength(data, p);\n  if (rlen === false) {\n    return false;\n  }\n  if ((data[p.place] & 128) !== 0) {\n    return false;\n  }\n  var r = data.slice(p.place, rlen + p.place);\n  p.place += rlen;\n  if (data[p.place++] !== 0x02) {\n    return false;\n  }\n  var slen = getLength(data, p);\n  if (slen === false) {\n    return false;\n  }\n  if (data.length !== slen + p.place) {\n    return false;\n  }\n  if ((data[p.place] & 128) !== 0) {\n    return false;\n  }\n  var s = data.slice(p.place, slen + p.place);\n  if (r[0] === 0) {\n    if (r[1] & 0x80) {\n      r = r.slice(1);\n    } else {\n      // Leading zeroes\n      return false;\n    }\n  }\n  if (s[0] === 0) {\n    if (s[1] & 0x80) {\n      s = s.slice(1);\n    } else {\n      // Leading zeroes\n      return false;\n    }\n  }\n\n  this.r = new BN(r);\n  this.s = new BN(s);\n  this.recoveryParam = null;\n\n  return true;\n};\n\nfunction constructLength(arr, len) {\n  if (len < 0x80) {\n    arr.push(len);\n    return;\n  }\n  var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n  arr.push(octets | 0x80);\n  while (--octets) {\n    arr.push((len >>> (octets << 3)) & 0xff);\n  }\n  arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n  var r = this.r.toArray();\n  var s = this.s.toArray();\n\n  // Pad values\n  if (r[0] & 0x80)\n    r = [ 0 ].concat(r);\n  // Pad values\n  if (s[0] & 0x80)\n    s = [ 0 ].concat(s);\n\n  r = rmPadding(r);\n  s = rmPadding(s);\n\n  while (!s[0] && !(s[1] & 0x80)) {\n    s = s.slice(1);\n  }\n  var arr = [ 0x02 ];\n  constructLength(arr, r.length);\n  arr = arr.concat(r);\n  arr.push(0x02);\n  constructLength(arr, s.length);\n  var backHalf = arr.concat(s);\n  var res = [ 0x30 ];\n  constructLength(res, backHalf.length);\n  res = res.concat(backHalf);\n  return utils.encode(res, enc);\n};\n'use strict';\n\nvar hash = require('hash.js');\nvar curves = require('../curves');\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EDDSA(curve) {\n  assert(curve === 'ed25519', 'only tested with ed25519 so far');\n\n  if (!(this instanceof EDDSA))\n    return new EDDSA(curve);\n\n  curve = curves[curve].curve;\n  this.curve = curve;\n  this.g = curve.g;\n  this.g.precompute(curve.n.bitLength() + 1);\n\n  this.pointClass = curve.point().constructor;\n  this.encodingLength = Math.ceil(curve.n.bitLength() / 8);\n  this.hash = hash.sha512;\n}\n\nmodule.exports = EDDSA;\n\n/**\n* @param {Array|String} message - message bytes\n* @param {Array|String|KeyPair} secret - secret bytes or a keypair\n* @returns {Signature} - signature\n*/\nEDDSA.prototype.sign = function sign(message, secret) {\n  message = parseBytes(message);\n  var key = this.keyFromSecret(secret);\n  var r = this.hashInt(key.messagePrefix(), message);\n  var R = this.g.mul(r);\n  var Rencoded = this.encodePoint(R);\n  var s_ = this.hashInt(Rencoded, key.pubBytes(), message)\n    .mul(key.priv());\n  var S = r.add(s_).umod(this.curve.n);\n  return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });\n};\n\n/**\n* @param {Array} message - message bytes\n* @param {Array|String|Signature} sig - sig bytes\n* @param {Array|String|Point|KeyPair} pub - public key\n* @returns {Boolean} - true if public key matches sig of message\n*/\nEDDSA.prototype.verify = function verify(message, sig, pub) {\n  message = parseBytes(message);\n  sig = this.makeSignature(sig);\n  if (sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()) {\n    return false;\n  }\n  var key = this.keyFromPublic(pub);\n  var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);\n  var SG = this.g.mul(sig.S());\n  var RplusAh = sig.R().add(key.pub().mul(h));\n  return RplusAh.eq(SG);\n};\n\nEDDSA.prototype.hashInt = function hashInt() {\n  var hash = this.hash();\n  for (var i = 0; i < arguments.length; i++)\n    hash.update(arguments[i]);\n  return utils.intFromLE(hash.digest()).umod(this.curve.n);\n};\n\nEDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {\n  return KeyPair.fromPublic(this, pub);\n};\n\nEDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {\n  return KeyPair.fromSecret(this, secret);\n};\n\nEDDSA.prototype.makeSignature = function makeSignature(sig) {\n  if (sig instanceof Signature)\n    return sig;\n  return new Signature(this, sig);\n};\n\n/**\n* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2\n*\n* EDDSA defines methods for encoding and decoding points and integers. These are\n* helper convenience methods, that pass along to utility functions implied\n* parameters.\n*\n*/\nEDDSA.prototype.encodePoint = function encodePoint(point) {\n  var enc = point.getY().toArray('le', this.encodingLength);\n  enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;\n  return enc;\n};\n\nEDDSA.prototype.decodePoint = function decodePoint(bytes) {\n  bytes = utils.parseBytes(bytes);\n\n  var lastIx = bytes.length - 1;\n  var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);\n  var xIsOdd = (bytes[lastIx] & 0x80) !== 0;\n\n  var y = utils.intFromLE(normed);\n  return this.curve.pointFromY(y, xIsOdd);\n};\n\nEDDSA.prototype.encodeInt = function encodeInt(num) {\n  return num.toArray('le', this.encodingLength);\n};\n\nEDDSA.prototype.decodeInt = function decodeInt(bytes) {\n  return utils.intFromLE(bytes);\n};\n\nEDDSA.prototype.isPoint = function isPoint(val) {\n  return val instanceof this.pointClass;\n};\n'use strict';\n\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar cachedProperty = utils.cachedProperty;\n\n/**\n* @param {EDDSA} eddsa - instance\n* @param {Object} params - public/private key parameters\n*\n* @param {Array<Byte>} [params.secret] - secret seed bytes\n* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)\n* @param {Array<Byte>} [params.pub] - public key point encoded as bytes\n*\n*/\nfunction KeyPair(eddsa, params) {\n  this.eddsa = eddsa;\n  this._secret = parseBytes(params.secret);\n  if (eddsa.isPoint(params.pub))\n    this._pub = params.pub;\n  else\n    this._pubBytes = parseBytes(params.pub);\n}\n\nKeyPair.fromPublic = function fromPublic(eddsa, pub) {\n  if (pub instanceof KeyPair)\n    return pub;\n  return new KeyPair(eddsa, { pub: pub });\n};\n\nKeyPair.fromSecret = function fromSecret(eddsa, secret) {\n  if (secret instanceof KeyPair)\n    return secret;\n  return new KeyPair(eddsa, { secret: secret });\n};\n\nKeyPair.prototype.secret = function secret() {\n  return this._secret;\n};\n\ncachedProperty(KeyPair, 'pubBytes', function pubBytes() {\n  return this.eddsa.encodePoint(this.pub());\n});\n\ncachedProperty(KeyPair, 'pub', function pub() {\n  if (this._pubBytes)\n    return this.eddsa.decodePoint(this._pubBytes);\n  return this.eddsa.g.mul(this.priv());\n});\n\ncachedProperty(KeyPair, 'privBytes', function privBytes() {\n  var eddsa = this.eddsa;\n  var hash = this.hash();\n  var lastIx = eddsa.encodingLength - 1;\n\n  var a = hash.slice(0, eddsa.encodingLength);\n  a[0] &= 248;\n  a[lastIx] &= 127;\n  a[lastIx] |= 64;\n\n  return a;\n});\n\ncachedProperty(KeyPair, 'priv', function priv() {\n  return this.eddsa.decodeInt(this.privBytes());\n});\n\ncachedProperty(KeyPair, 'hash', function hash() {\n  return this.eddsa.hash().update(this.secret()).digest();\n});\n\ncachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {\n  return this.hash().slice(this.eddsa.encodingLength);\n});\n\nKeyPair.prototype.sign = function sign(message) {\n  assert(this._secret, 'KeyPair can only verify');\n  return this.eddsa.sign(message, this);\n};\n\nKeyPair.prototype.verify = function verify(message, sig) {\n  return this.eddsa.verify(message, sig, this);\n};\n\nKeyPair.prototype.getSecret = function getSecret(enc) {\n  assert(this._secret, 'KeyPair is public only');\n  return utils.encode(this.secret(), enc);\n};\n\nKeyPair.prototype.getPublic = function getPublic(enc) {\n  return utils.encode(this.pubBytes(), enc);\n};\n\nmodule.exports = KeyPair;\n'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar cachedProperty = utils.cachedProperty;\nvar parseBytes = utils.parseBytes;\n\n/**\n* @param {EDDSA} eddsa - eddsa instance\n* @param {Array<Bytes>|Object} sig -\n* @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes\n* @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes\n* @param {Array<Bytes>} [sig.Rencoded] - R point encoded\n* @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded\n*/\nfunction Signature(eddsa, sig) {\n  this.eddsa = eddsa;\n\n  if (typeof sig !== 'object')\n    sig = parseBytes(sig);\n\n  if (Array.isArray(sig)) {\n    assert(sig.length === eddsa.encodingLength * 2, 'Signature has invalid size');\n    sig = {\n      R: sig.slice(0, eddsa.encodingLength),\n      S: sig.slice(eddsa.encodingLength),\n    };\n  }\n\n  assert(sig.R && sig.S, 'Signature without R or S');\n\n  if (eddsa.isPoint(sig.R))\n    this._R = sig.R;\n  if (sig.S instanceof BN)\n    this._S = sig.S;\n\n  this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;\n  this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;\n}\n\ncachedProperty(Signature, 'S', function S() {\n  return this.eddsa.decodeInt(this.Sencoded());\n});\n\ncachedProperty(Signature, 'R', function R() {\n  return this.eddsa.decodePoint(this.Rencoded());\n});\n\ncachedProperty(Signature, 'Rencoded', function Rencoded() {\n  return this.eddsa.encodePoint(this.R());\n});\n\ncachedProperty(Signature, 'Sencoded', function Sencoded() {\n  return this.eddsa.encodeInt(this.S());\n});\n\nSignature.prototype.toBytes = function toBytes() {\n  return this.Rencoded().concat(this.Sencoded());\n};\n\nSignature.prototype.toHex = function toHex() {\n  return utils.encode(this.toBytes(), 'hex').toUpperCase();\n};\n\nmodule.exports = Signature;\nmodule.exports = {\n  doubles: {\n    step: 4,\n    points: [\n      [\n        'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',\n        'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821',\n      ],\n      [\n        '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',\n        '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf',\n      ],\n      [\n        '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',\n        'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695',\n      ],\n      [\n        '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',\n        '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9',\n      ],\n      [\n        '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',\n        '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36',\n      ],\n      [\n        '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',\n        '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f',\n      ],\n      [\n        'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',\n        '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999',\n      ],\n      [\n        '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',\n        'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09',\n      ],\n      [\n        'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',\n        '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d',\n      ],\n      [\n        'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',\n        'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088',\n      ],\n      [\n        'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',\n        '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d',\n      ],\n      [\n        '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',\n        '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8',\n      ],\n      [\n        '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',\n        '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a',\n      ],\n      [\n        '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',\n        '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453',\n      ],\n      [\n        '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',\n        '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160',\n      ],\n      [\n        '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',\n        '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0',\n      ],\n      [\n        '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',\n        '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6',\n      ],\n      [\n        '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',\n        '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589',\n      ],\n      [\n        '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',\n        'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17',\n      ],\n      [\n        'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',\n        '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda',\n      ],\n      [\n        'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',\n        '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd',\n      ],\n      [\n        '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',\n        '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2',\n      ],\n      [\n        '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',\n        '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6',\n      ],\n      [\n        'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',\n        '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f',\n      ],\n      [\n        '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',\n        'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01',\n      ],\n      [\n        'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',\n        '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3',\n      ],\n      [\n        'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',\n        'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f',\n      ],\n      [\n        'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',\n        '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7',\n      ],\n      [\n        'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',\n        'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78',\n      ],\n      [\n        'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',\n        '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1',\n      ],\n      [\n        '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',\n        'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150',\n      ],\n      [\n        '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',\n        '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82',\n      ],\n      [\n        'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',\n        '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc',\n      ],\n      [\n        '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',\n        'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b',\n      ],\n      [\n        'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',\n        '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51',\n      ],\n      [\n        'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',\n        '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45',\n      ],\n      [\n        'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',\n        'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120',\n      ],\n      [\n        '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',\n        '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84',\n      ],\n      [\n        '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',\n        '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d',\n      ],\n      [\n        '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',\n        'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d',\n      ],\n      [\n        '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',\n        '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8',\n      ],\n      [\n        'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',\n        '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8',\n      ],\n      [\n        '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',\n        '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac',\n      ],\n      [\n        '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',\n        'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f',\n      ],\n      [\n        '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',\n        '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962',\n      ],\n      [\n        'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',\n        '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907',\n      ],\n      [\n        '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',\n        'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec',\n      ],\n      [\n        'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',\n        'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d',\n      ],\n      [\n        'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',\n        '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414',\n      ],\n      [\n        '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',\n        'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd',\n      ],\n      [\n        '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',\n        'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0',\n      ],\n      [\n        'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',\n        '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811',\n      ],\n      [\n        'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',\n        '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1',\n      ],\n      [\n        'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',\n        '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c',\n      ],\n      [\n        '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',\n        'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73',\n      ],\n      [\n        '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',\n        '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd',\n      ],\n      [\n        'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',\n        'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405',\n      ],\n      [\n        '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',\n        'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589',\n      ],\n      [\n        '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',\n        '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e',\n      ],\n      [\n        '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',\n        '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27',\n      ],\n      [\n        'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',\n        'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1',\n      ],\n      [\n        '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',\n        '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482',\n      ],\n      [\n        '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',\n        '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945',\n      ],\n      [\n        'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',\n        '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573',\n      ],\n      [\n        'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',\n        'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82',\n      ],\n    ],\n  },\n  naf: {\n    wnd: 7,\n    points: [\n      [\n        'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',\n        '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672',\n      ],\n      [\n        '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',\n        'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6',\n      ],\n      [\n        '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',\n        '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da',\n      ],\n      [\n        'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',\n        'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37',\n      ],\n      [\n        '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',\n        'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b',\n      ],\n      [\n        'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',\n        'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81',\n      ],\n      [\n        'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',\n        '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58',\n      ],\n      [\n        'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',\n        '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77',\n      ],\n      [\n        '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',\n        '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a',\n      ],\n      [\n        '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',\n        '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c',\n      ],\n      [\n        '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',\n        '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67',\n      ],\n      [\n        '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',\n        '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402',\n      ],\n      [\n        'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',\n        'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55',\n      ],\n      [\n        'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',\n        '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482',\n      ],\n      [\n        '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',\n        'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82',\n      ],\n      [\n        '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',\n        'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396',\n      ],\n      [\n        '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',\n        '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49',\n      ],\n      [\n        '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',\n        '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf',\n      ],\n      [\n        '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',\n        '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a',\n      ],\n      [\n        '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',\n        'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7',\n      ],\n      [\n        'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',\n        'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933',\n      ],\n      [\n        '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',\n        '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a',\n      ],\n      [\n        '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',\n        '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6',\n      ],\n      [\n        'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',\n        'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37',\n      ],\n      [\n        '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',\n        '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e',\n      ],\n      [\n        'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',\n        'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6',\n      ],\n      [\n        'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',\n        'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476',\n      ],\n      [\n        '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',\n        '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40',\n      ],\n      [\n        '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',\n        '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61',\n      ],\n      [\n        '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',\n        '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683',\n      ],\n      [\n        'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',\n        '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5',\n      ],\n      [\n        '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',\n        '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b',\n      ],\n      [\n        'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',\n        '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417',\n      ],\n      [\n        '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',\n        'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868',\n      ],\n      [\n        '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',\n        'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a',\n      ],\n      [\n        'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',\n        'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6',\n      ],\n      [\n        '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',\n        '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996',\n      ],\n      [\n        '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',\n        'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e',\n      ],\n      [\n        'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',\n        'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d',\n      ],\n      [\n        '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',\n        '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2',\n      ],\n      [\n        '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',\n        'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e',\n      ],\n      [\n        '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',\n        '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437',\n      ],\n      [\n        '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',\n        'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311',\n      ],\n      [\n        'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',\n        '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4',\n      ],\n      [\n        '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',\n        '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575',\n      ],\n      [\n        '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',\n        'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d',\n      ],\n      [\n        '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',\n        'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d',\n      ],\n      [\n        'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',\n        'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629',\n      ],\n      [\n        'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',\n        'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06',\n      ],\n      [\n        '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',\n        '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374',\n      ],\n      [\n        '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',\n        '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee',\n      ],\n      [\n        'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',\n        '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1',\n      ],\n      [\n        'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',\n        'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b',\n      ],\n      [\n        '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',\n        '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661',\n      ],\n      [\n        '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',\n        '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6',\n      ],\n      [\n        'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',\n        '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e',\n      ],\n      [\n        '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',\n        '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d',\n      ],\n      [\n        'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',\n        'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc',\n      ],\n      [\n        '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',\n        'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4',\n      ],\n      [\n        '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',\n        '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c',\n      ],\n      [\n        'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',\n        '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b',\n      ],\n      [\n        'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',\n        '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913',\n      ],\n      [\n        '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',\n        '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154',\n      ],\n      [\n        '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',\n        '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865',\n      ],\n      [\n        '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',\n        'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc',\n      ],\n      [\n        '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',\n        'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224',\n      ],\n      [\n        '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',\n        '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e',\n      ],\n      [\n        '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',\n        '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6',\n      ],\n      [\n        '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',\n        '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511',\n      ],\n      [\n        '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',\n        'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b',\n      ],\n      [\n        'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',\n        'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2',\n      ],\n      [\n        '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',\n        'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c',\n      ],\n      [\n        'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',\n        '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3',\n      ],\n      [\n        'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',\n        '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d',\n      ],\n      [\n        'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',\n        '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700',\n      ],\n      [\n        'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',\n        '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4',\n      ],\n      [\n        '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',\n        'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196',\n      ],\n      [\n        '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',\n        '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4',\n      ],\n      [\n        '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',\n        'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257',\n      ],\n      [\n        'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',\n        'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13',\n      ],\n      [\n        'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',\n        '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096',\n      ],\n      [\n        'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',\n        'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38',\n      ],\n      [\n        'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',\n        '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f',\n      ],\n      [\n        '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',\n        '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448',\n      ],\n      [\n        'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',\n        '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a',\n      ],\n      [\n        'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',\n        '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4',\n      ],\n      [\n        '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',\n        '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437',\n      ],\n      [\n        '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',\n        'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7',\n      ],\n      [\n        'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',\n        '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d',\n      ],\n      [\n        'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',\n        '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a',\n      ],\n      [\n        'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',\n        '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54',\n      ],\n      [\n        '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',\n        '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77',\n      ],\n      [\n        'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',\n        'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517',\n      ],\n      [\n        '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',\n        'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10',\n      ],\n      [\n        'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',\n        'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125',\n      ],\n      [\n        'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',\n        '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e',\n      ],\n      [\n        '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',\n        'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1',\n      ],\n      [\n        'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',\n        '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2',\n      ],\n      [\n        'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',\n        '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423',\n      ],\n      [\n        'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',\n        '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8',\n      ],\n      [\n        '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',\n        'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758',\n      ],\n      [\n        '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',\n        'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375',\n      ],\n      [\n        'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',\n        '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d',\n      ],\n      [\n        '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',\n        'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec',\n      ],\n      [\n        '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',\n        '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0',\n      ],\n      [\n        '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',\n        'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c',\n      ],\n      [\n        'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',\n        'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4',\n      ],\n      [\n        '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',\n        'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f',\n      ],\n      [\n        '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',\n        '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649',\n      ],\n      [\n        '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',\n        'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826',\n      ],\n      [\n        '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',\n        '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5',\n      ],\n      [\n        'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',\n        'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87',\n      ],\n      [\n        '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',\n        '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b',\n      ],\n      [\n        'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',\n        '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc',\n      ],\n      [\n        '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',\n        '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c',\n      ],\n      [\n        'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',\n        'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f',\n      ],\n      [\n        'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',\n        '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a',\n      ],\n      [\n        'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',\n        'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46',\n      ],\n      [\n        '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',\n        'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f',\n      ],\n      [\n        '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',\n        '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03',\n      ],\n      [\n        '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',\n        'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08',\n      ],\n      [\n        '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',\n        '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8',\n      ],\n      [\n        '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',\n        '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373',\n      ],\n      [\n        '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',\n        'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3',\n      ],\n      [\n        '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',\n        '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8',\n      ],\n      [\n        '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',\n        '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1',\n      ],\n      [\n        '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',\n        '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9',\n      ],\n    ],\n  },\n};\n'use strict';\n\nvar utils = exports;\nvar BN = require('bn.js');\nvar minAssert = require('minimalistic-assert');\nvar minUtils = require('minimalistic-crypto-utils');\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w, bits) {\n  var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n  var i;\n  for (i = 0; i < naf.length; i += 1) {\n    naf[i] = 0;\n  }\n\n  var ws = 1 << (w + 1);\n  var k = num.clone();\n\n  for (i = 0; i < naf.length; i++) {\n    var z;\n    var mod = k.andln(ws - 1);\n    if (k.isOdd()) {\n      if (mod > (ws >> 1) - 1)\n        z = (ws >> 1) - mod;\n      else\n        z = mod;\n      k.isubn(z);\n    } else {\n      z = 0;\n    }\n\n    naf[i] = z;\n    k.iushrn(1);\n  }\n\n  return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n  var jsf = [\n    [],\n    [],\n  ];\n\n  k1 = k1.clone();\n  k2 = k2.clone();\n  var d1 = 0;\n  var d2 = 0;\n  var m8;\n  while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n    // First phase\n    var m14 = (k1.andln(3) + d1) & 3;\n    var m24 = (k2.andln(3) + d2) & 3;\n    if (m14 === 3)\n      m14 = -1;\n    if (m24 === 3)\n      m24 = -1;\n    var u1;\n    if ((m14 & 1) === 0) {\n      u1 = 0;\n    } else {\n      m8 = (k1.andln(7) + d1) & 7;\n      if ((m8 === 3 || m8 === 5) && m24 === 2)\n        u1 = -m14;\n      else\n        u1 = m14;\n    }\n    jsf[0].push(u1);\n\n    var u2;\n    if ((m24 & 1) === 0) {\n      u2 = 0;\n    } else {\n      m8 = (k2.andln(7) + d2) & 7;\n      if ((m8 === 3 || m8 === 5) && m14 === 2)\n        u2 = -m24;\n      else\n        u2 = m24;\n    }\n    jsf[1].push(u2);\n\n    // Second phase\n    if (2 * d1 === u1 + 1)\n      d1 = 1 - d1;\n    if (2 * d2 === u2 + 1)\n      d2 = 1 - d2;\n    k1.iushrn(1);\n    k2.iushrn(1);\n  }\n\n  return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n  var key = '_' + name;\n  obj.prototype[name] = function cachedProperty() {\n    return this[key] !== undefined ? this[key] :\n      this[key] = computer.call(this);\n  };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n  return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n    bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n  return new BN(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n\n{\n  \"name\": \"elliptic\",\n  \"version\": \"6.6.1\",\n  \"description\": \"EC cryptography\",\n  \"main\": \"lib/elliptic.js\",\n  \"files\": [\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"lint\": \"eslint lib test\",\n    \"lint:fix\": \"npm run lint -- --fix\",\n    \"unit\": \"istanbul test _mocha --reporter=spec test/index.js\",\n    \"test\": \"npm run lint && npm run unit\",\n    \"version\": \"grunt dist && git add dist/\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git@github.com:indutny/elliptic\"\n  },\n  \"keywords\": [\n    \"EC\",\n    \"Elliptic\",\n    \"curve\",\n    \"Cryptography\"\n  ],\n  \"author\": \"Fedor Indutny <fedor@indutny.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/indutny/elliptic/issues\"\n  },\n  \"homepage\": \"https://github.com/indutny/elliptic\",\n  \"devDependencies\": {\n    \"brfs\": \"^2.0.2\",\n    \"coveralls\": \"^3.1.0\",\n    \"eslint\": \"^7.6.0\",\n    \"grunt\": \"^1.2.1\",\n    \"grunt-browserify\": \"^5.3.0\",\n    \"grunt-cli\": \"^1.3.2\",\n    \"grunt-contrib-connect\": \"^3.0.0\",\n    \"grunt-contrib-copy\": \"^1.0.0\",\n    \"grunt-contrib-uglify\": \"^5.0.0\",\n    \"grunt-mocha-istanbul\": \"^5.0.2\",\n    \"grunt-saucelabs\": \"^9.0.1\",\n    \"istanbul\": \"^0.4.5\",\n    \"mocha\": \"^8.0.1\"\n  },\n  \"dependencies\": {\n    \"bn.js\": \"^4.11.9\",\n    \"brorand\": \"^1.1.0\",\n    \"hash.js\": \"^1.0.0\",\n    \"hmac-drbg\": \"^1.0.1\",\n    \"inherits\": \"^2.0.4\",\n    \"minimalistic-assert\": \"^1.0.1\",\n    \"minimalistic-crypto-utils\": \"^1.0.1\"\n  }\n}\nconst { encode, decode } = require('./spec/hyperschema')\n\nasync function encrypt(data, cb) {\n  const result = await cb(data)\n\n  return encode('@encryption/encrypted-data', result)\n}\n\nasync function decrypt(data, cb) {\n  const decoded = decode('@encryption/encrypted-data', data)\n  const decrypted = await cb(decoded)\n\n  return decrypted\n}\n\nmodule.exports = { encrypt, decrypt }\n{\n  \"name\": \"encryption-encoding\",\n  \"version\": \"1.0.3\",\n  \"description\": \"Compact encoding for versioned encrypted values with automatic string/buffer handling.\",\n  \"main\": \"index.js\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"types\": \"./index.d.ts\",\n      \"default\": \"./index.js\"\n    }\n  },\n  \"files\": [\n    \"package.json\",\n    \"index.js\",\n    \"index.d.ts\",\n    \"spec\"\n  ],\n  \"keywords\": [\n    \"pear\",\n    \"p2p\",\n    \"bare\",\n    \"autobase\",\n    \"encryption\",\n    \"hyperschema\"\n  ],\n  \"devDependencies\": {\n    \"b4a\": \"^1.7.3\",\n    \"brittle\": \"^3.19.0\",\n    \"lunte\": \"^1.2.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"sodium-universal\": \"^5.0.1\"\n  },\n  \"scripts\": {\n    \"format\": \"prettier . --write\",\n    \"test\": \"prettier . --check && lunte && brittle-bare test/all.js\",\n    \"lint\": \"lunte\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/encryption-encoding.git\"\n  },\n  \"author\": \"Holepunch Inc\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/encryption-encoding/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/encryption-encoding\",\n  \"dependencies\": {\n    \"hyperschema\": \"^1.19.0\"\n  }\n}\n// This file is autogenerated by the hyperschema compiler\n// Schema Version: 1\n/* eslint-disable camelcase */\n/* eslint-disable quotes */\n/* eslint-disable space-before-function-paren */\n\nconst { c } = require('hyperschema/runtime')\n\nconst VERSION = 1\n\n// eslint-disable-next-line no-unused-vars\nlet version = VERSION\n\n// @encryption/encrypted-data\nconst encoding0 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.type)\n    c.buffer.preencode(state, m.value)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.type)\n    c.buffer.encode(state, m.value)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = c.buffer.decode(state)\n\n    return {\n      type: r0,\n      value: r1\n    }\n  }\n}\n\nfunction setVersion(v) {\n  version = v\n}\n\nfunction encode(name, value, v = VERSION) {\n  version = v\n  return c.encode(getEncoding(name), value)\n}\n\nfunction decode(name, buffer, v = VERSION) {\n  version = v\n  return c.decode(getEncoding(name), buffer)\n}\n\nfunction getEnum(name) {\n  switch (name) {\n    default:\n      throw new Error('Enum not found ' + name)\n  }\n}\n\nfunction getEncoding(name) {\n  switch (name) {\n    case '@encryption/encrypted-data':\n      return encoding0\n    default:\n      throw new Error('Encoder not found ' + name)\n  }\n}\n\nfunction getStruct(name, v = VERSION) {\n  const enc = getEncoding(name)\n  return {\n    preencode(state, m) {\n      version = v\n      enc.preencode(state, m)\n    },\n    encode(state, m) {\n      version = v\n      enc.encode(state, m)\n    },\n    decode(state) {\n      version = v\n      return enc.decode(state)\n    }\n  }\n}\n\nconst resolveStruct = getStruct // compat\n\nmodule.exports = {\n  resolveStruct,\n  getStruct,\n  getEnum,\n  getEncoding,\n  encode,\n  decode,\n  setVersion,\n  version\n}\n/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n/**\n *  The current version of Ethers.\n */\nexport const version = \"6.14.3\";\n//# sourceMappingURL=_version.js.map/**\n *  When sending values to or receiving values from a [[Contract]], the\n *  data is generally encoded using the [ABI standard](link-solc-abi).\n *\n *  The AbiCoder provides a utility to encode values to ABI data and\n *  decode values from ABI data.\n *\n *  Most of the time, developers should favour the [[Contract]] class,\n *  which further abstracts a lot of the finer details of ABI data.\n *\n *  @_section api/abi/abi-coder:ABI Encoding\n */\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nlet defaultMaxInflation = 1024;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n    let message = \"missing revert data\";\n    let reason = null;\n    const invocation = null;\n    let revert = null;\n    if (data) {\n        message = \"execution reverted\";\n        const bytes = getBytes(data);\n        data = hexlify(data);\n        if (bytes.length === 0) {\n            message += \" (no data present; likely require(false) occurred\";\n            reason = \"require(false)\";\n        }\n        else if (bytes.length % 32 !== 4) {\n            message += \" (could not decode reason; invalid data length)\";\n        }\n        else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n            // Error(string)\n            try {\n                reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n                revert = {\n                    signature: \"Error(string)\",\n                    name: \"Error\",\n                    args: [reason]\n                };\n                message += `: ${JSON.stringify(reason)}`;\n            }\n            catch (error) {\n                message += \" (could not decode reason; invalid string data)\";\n            }\n        }\n        else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n            // Panic(uint256)\n            try {\n                const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n                revert = {\n                    signature: \"Panic(uint256)\",\n                    name: \"Panic\",\n                    args: [code]\n                };\n                reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n                message += `: ${reason}`;\n            }\n            catch (error) {\n                message += \" (could not decode panic code)\";\n            }\n        }\n        else {\n            message += \" (unknown custom error)\";\n        }\n    }\n    const transaction = {\n        to: (tx.to ? getAddress(tx.to) : null),\n        data: (tx.data || \"0x\")\n    };\n    if (tx.from) {\n        transaction.from = getAddress(tx.from);\n    }\n    return makeError(message, \"CALL_EXCEPTION\", {\n        action, data, reason, transaction, invocation, revert\n    });\n}\n/**\n *  The **AbiCoder** is a low-level class responsible for encoding JavaScript\n *  values into binary data and decoding binary data into JavaScript values.\n */\nexport class AbiCoder {\n    #getCoder(param) {\n        if (param.isArray()) {\n            return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n        }\n        if (param.isTuple()) {\n            return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n        }\n        switch (param.baseType) {\n            case \"address\":\n                return new AddressCoder(param.name);\n            case \"bool\":\n                return new BooleanCoder(param.name);\n            case \"string\":\n                return new StringCoder(param.name);\n            case \"bytes\":\n                return new BytesCoder(param.name);\n            case \"\":\n                return new NullCoder(param.name);\n        }\n        // u?int[0-9]*\n        let match = param.type.match(paramTypeNumber);\n        if (match) {\n            let size = parseInt(match[2] || \"256\");\n            assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n            return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n        }\n        // bytes[0-9]+\n        match = param.type.match(paramTypeBytes);\n        if (match) {\n            let size = parseInt(match[1]);\n            assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n            return new FixedBytesCoder(size, param.name);\n        }\n        assertArgument(false, \"invalid type\", \"type\", param.type);\n    }\n    /**\n     *  Get the default values for the given %%types%%.\n     *\n     *  For example, a ``uint`` is by default ``0`` and ``bool``\n     *  is by default ``false``.\n     */\n    getDefaultValue(types) {\n        const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n        const coder = new TupleCoder(coders, \"_\");\n        return coder.defaultValue();\n    }\n    /**\n     *  Encode the %%values%% as the %%types%% into ABI data.\n     *\n     *  @returns DataHexstring\n     */\n    encode(types, values) {\n        assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n        const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n        const coder = (new TupleCoder(coders, \"_\"));\n        const writer = new Writer();\n        coder.encode(writer, values);\n        return writer.data;\n    }\n    /**\n     *  Decode the ABI %%data%% as the %%types%% into values.\n     *\n     *  If %%loose%% decoding is enabled, then strict padding is\n     *  not enforced. Some older versions of Solidity incorrectly\n     *  padded event data emitted from ``external`` functions.\n     */\n    decode(types, data, loose) {\n        const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n        const coder = new TupleCoder(coders, \"_\");\n        return coder.decode(new Reader(data, loose, defaultMaxInflation));\n    }\n    static _setDefaultMaxInflation(value) {\n        assertArgument(typeof (value) === \"number\" && Number.isInteger(value), \"invalid defaultMaxInflation factor\", \"value\", value);\n        defaultMaxInflation = value;\n    }\n    /**\n     *  Returns the shared singleton instance of a default [[AbiCoder]].\n     *\n     *  On the first call, the instance is created internally.\n     */\n    static defaultAbiCoder() {\n        if (defaultCoder == null) {\n            defaultCoder = new AbiCoder();\n        }\n        return defaultCoder;\n    }\n    /**\n     *  Returns an ethers-compatible [[CallExceptionError]] Error for the given\n     *  result %%data%% for the [[CallExceptionAction]] %%action%% against\n     *  the Transaction %%tx%%.\n     */\n    static getBuiltinCallException(action, tx, data) {\n        return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n    }\n}\n//# sourceMappingURL=abi-coder.js.map/**\n *  About bytes32 strings...\n *\n *  @_docloc: api/utils:Bytes32 Strings\n */\nimport { getBytes, toUtf8Bytes, toUtf8String, zeroPadBytes } from \"../utils/index.js\";\n/**\n *  Encodes %%text%% as a Bytes32 string.\n */\nexport function encodeBytes32String(text) {\n    // Get the bytes\n    const bytes = toUtf8Bytes(text);\n    // Check we have room for null-termination\n    if (bytes.length > 31) {\n        throw new Error(\"bytes32 string must be less than 32 bytes\");\n    }\n    // Zero-pad (implicitly null-terminates)\n    return zeroPadBytes(bytes, 32);\n}\n/**\n *  Encodes the Bytes32-encoded %%bytes%% into a string.\n */\nexport function decodeBytes32String(_bytes) {\n    const data = getBytes(_bytes, \"bytes\");\n    // Must be 32 bytes with a null-termination\n    if (data.length !== 32) {\n        throw new Error(\"invalid bytes32 - not 32 bytes long\");\n    }\n    if (data[31] !== 0) {\n        throw new Error(\"invalid bytes32 string - no null terminator\");\n    }\n    // Find the null termination\n    let length = 31;\n    while (data[length - 1] === 0) {\n        length--;\n    }\n    // Determine the string value\n    return toUtf8String(data.slice(0, length));\n}\n//# sourceMappingURL=bytes32.js.mapimport { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument\n/*, isError*/\n } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nconst resultNames = new WeakMap();\nfunction getNames(result) {\n    return resultNames.get(result);\n}\nfunction setNames(result, names) {\n    resultNames.set(result, names);\n}\nfunction throwError(name, error) {\n    const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n    wrapped.error = error;\n    throw wrapped;\n}\nfunction toObject(names, items, deep) {\n    if (names.indexOf(null) >= 0) {\n        return items.map((item, index) => {\n            if (item instanceof Result) {\n                return toObject(getNames(item), item, deep);\n            }\n            return item;\n        });\n    }\n    return names.reduce((accum, name, index) => {\n        let item = items.getValue(name);\n        if (!(name in accum)) {\n            if (deep && item instanceof Result) {\n                item = toObject(getNames(item), item, deep);\n            }\n            accum[name] = item;\n        }\n        return accum;\n    }, {});\n}\n/**\n *  A [[Result]] is a sub-class of Array, which allows accessing any\n *  of its values either positionally by its index or, if keys are\n *  provided by its name.\n *\n *  @_docloc: api/abi\n */\nexport class Result extends Array {\n    // No longer used; but cannot be removed as it will remove the\n    // #private field from the .d.ts which may break backwards\n    // compatibility\n    #names;\n    /**\n     *  @private\n     */\n    constructor(...args) {\n        // To properly sub-class Array so the other built-in\n        // functions work, the constructor has to behave fairly\n        // well. So, in the event we are created via fromItems()\n        // we build the read-only Result object we want, but on\n        // any other input, we use the default constructor\n        // constructor(guard: any, items: Array<any>, keys?: Array<null | string>);\n        const guard = args[0];\n        let items = args[1];\n        let names = (args[2] || []).slice();\n        let wrap = true;\n        if (guard !== _guard) {\n            items = args;\n            names = [];\n            wrap = false;\n        }\n        // Can't just pass in ...items since an array of length 1\n        // is a special case in the super.\n        super(items.length);\n        items.forEach((item, index) => { this[index] = item; });\n        // Find all unique keys\n        const nameCounts = names.reduce((accum, name) => {\n            if (typeof (name) === \"string\") {\n                accum.set(name, (accum.get(name) || 0) + 1);\n            }\n            return accum;\n        }, (new Map()));\n        // Remove any key thats not unique\n        setNames(this, Object.freeze(items.map((item, index) => {\n            const name = names[index];\n            if (name != null && nameCounts.get(name) === 1) {\n                return name;\n            }\n            return null;\n        })));\n        // Dummy operations to prevent TypeScript from complaining\n        this.#names = [];\n        if (this.#names == null) {\n            void (this.#names);\n        }\n        if (!wrap) {\n            return;\n        }\n        // A wrapped Result is immutable\n        Object.freeze(this);\n        // Proxy indices and names so we can trap deferred errors\n        const proxy = new Proxy(this, {\n            get: (target, prop, receiver) => {\n                if (typeof (prop) === \"string\") {\n                    // Index accessor\n                    if (prop.match(/^[0-9]+$/)) {\n                        const index = getNumber(prop, \"%index\");\n                        if (index < 0 || index >= this.length) {\n                            throw new RangeError(\"out of result range\");\n                        }\n                        const item = target[index];\n                        if (item instanceof Error) {\n                            throwError(`index ${index}`, item);\n                        }\n                        return item;\n                    }\n                    // Pass important checks (like `then` for Promise) through\n                    if (passProperties.indexOf(prop) >= 0) {\n                        return Reflect.get(target, prop, receiver);\n                    }\n                    const value = target[prop];\n                    if (value instanceof Function) {\n                        // Make sure functions work with private variables\n                        // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n                        return function (...args) {\n                            return value.apply((this === receiver) ? target : this, args);\n                        };\n                    }\n                    else if (!(prop in target)) {\n                        // Possible name accessor\n                        return target.getValue.apply((this === receiver) ? target : this, [prop]);\n                    }\n                }\n                return Reflect.get(target, prop, receiver);\n            }\n        });\n        setNames(proxy, getNames(this));\n        return proxy;\n    }\n    /**\n     *  Returns the Result as a normal Array. If %%deep%%, any children\n     *  which are Result objects are also converted to a normal Array.\n     *\n     *  This will throw if there are any outstanding deferred\n     *  errors.\n     */\n    toArray(deep) {\n        const result = [];\n        this.forEach((item, index) => {\n            if (item instanceof Error) {\n                throwError(`index ${index}`, item);\n            }\n            if (deep && item instanceof Result) {\n                item = item.toArray(deep);\n            }\n            result.push(item);\n        });\n        return result;\n    }\n    /**\n     *  Returns the Result as an Object with each name-value pair. If\n     *  %%deep%%, any children which are Result objects are also\n     *  converted to an Object.\n     *\n     *  This will throw if any value is unnamed, or if there are\n     *  any outstanding deferred errors.\n     */\n    toObject(deep) {\n        const names = getNames(this);\n        return names.reduce((accum, name, index) => {\n            assert(name != null, `value at index ${index} unnamed`, \"UNSUPPORTED_OPERATION\", {\n                operation: \"toObject()\"\n            });\n            return toObject(names, this, deep);\n        }, {});\n    }\n    /**\n     *  @_ignore\n     */\n    slice(start, end) {\n        if (start == null) {\n            start = 0;\n        }\n        if (start < 0) {\n            start += this.length;\n            if (start < 0) {\n                start = 0;\n            }\n        }\n        if (end == null) {\n            end = this.length;\n        }\n        if (end < 0) {\n            end += this.length;\n            if (end < 0) {\n                end = 0;\n            }\n        }\n        if (end > this.length) {\n            end = this.length;\n        }\n        const _names = getNames(this);\n        const result = [], names = [];\n        for (let i = start; i < end; i++) {\n            result.push(this[i]);\n            names.push(_names[i]);\n        }\n        return new Result(_guard, result, names);\n    }\n    /**\n     *  @_ignore\n     */\n    filter(callback, thisArg) {\n        const _names = getNames(this);\n        const result = [], names = [];\n        for (let i = 0; i < this.length; i++) {\n            const item = this[i];\n            if (item instanceof Error) {\n                throwError(`index ${i}`, item);\n            }\n            if (callback.call(thisArg, item, i, this)) {\n                result.push(item);\n                names.push(_names[i]);\n            }\n        }\n        return new Result(_guard, result, names);\n    }\n    /**\n     *  @_ignore\n     */\n    map(callback, thisArg) {\n        const result = [];\n        for (let i = 0; i < this.length; i++) {\n            const item = this[i];\n            if (item instanceof Error) {\n                throwError(`index ${i}`, item);\n            }\n            result.push(callback.call(thisArg, item, i, this));\n        }\n        return result;\n    }\n    /**\n     *  Returns the value for %%name%%.\n     *\n     *  Since it is possible to have a key whose name conflicts with\n     *  a method on a [[Result]] or its superclass Array, or any\n     *  JavaScript keyword, this ensures all named values are still\n     *  accessible by name.\n     */\n    getValue(name) {\n        const index = getNames(this).indexOf(name);\n        if (index === -1) {\n            return undefined;\n        }\n        const value = this[index];\n        if (value instanceof Error) {\n            throwError(`property ${JSON.stringify(name)}`, value.error);\n        }\n        return value;\n    }\n    /**\n     *  Creates a new [[Result]] for %%items%% with each entry\n     *  also accessible by its corresponding name in %%keys%%.\n     */\n    static fromItems(items, keys) {\n        return new Result(_guard, items, keys);\n    }\n}\n/**\n *  Returns all errors found in a [[Result]].\n *\n *  Since certain errors encountered when creating a [[Result]] do\n *  not impact the ability to continue parsing data, they are\n *  deferred until they are actually accessed. Hence a faulty string\n *  in an Event that is never used does not impact the program flow.\n *\n *  However, sometimes it may be useful to access, identify or\n *  validate correctness of a [[Result]].\n *\n *  @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n    // Find the first error (if any)\n    const errors = [];\n    const checkErrors = function (path, object) {\n        if (!Array.isArray(object)) {\n            return;\n        }\n        for (let key in object) {\n            const childPath = path.slice();\n            childPath.push(key);\n            try {\n                checkErrors(childPath, object[key]);\n            }\n            catch (error) {\n                errors.push({ path: childPath, error: error });\n            }\n        }\n    };\n    checkErrors([], result);\n    return errors;\n}\nfunction getValue(value) {\n    let bytes = toBeArray(value);\n    assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", { buffer: bytes, length: WordSize, offset: bytes.length });\n    if (bytes.length !== WordSize) {\n        bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n    }\n    return bytes;\n}\n/**\n *  @_ignore\n */\nexport class Coder {\n    // The coder name:\n    //   - address, uint256, tuple, array, etc.\n    name;\n    // The fully expanded type, including composite types:\n    //   - address, uint256, tuple(address,bytes), uint256[3][4][],  etc.\n    type;\n    // The localName bound in the signature, in this example it is \"baz\":\n    //   - tuple(address foo, uint bar) baz\n    localName;\n    // Whether this type is dynamic:\n    //  - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n    //  - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n    dynamic;\n    constructor(name, type, localName, dynamic) {\n        defineProperties(this, { name, type, localName, dynamic }, {\n            name: \"string\", type: \"string\", localName: \"string\", dynamic: \"boolean\"\n        });\n    }\n    _throwError(message, value) {\n        assertArgument(false, message, this.localName, value);\n    }\n}\n/**\n *  @_ignore\n */\nexport class Writer {\n    // An array of WordSize lengthed objects to concatenation\n    #data;\n    #dataLength;\n    constructor() {\n        this.#data = [];\n        this.#dataLength = 0;\n    }\n    get data() {\n        return concat(this.#data);\n    }\n    get length() { return this.#dataLength; }\n    #writeData(data) {\n        this.#data.push(data);\n        this.#dataLength += data.length;\n        return data.length;\n    }\n    appendWriter(writer) {\n        return this.#writeData(getBytesCopy(writer.data));\n    }\n    // Arrayish item; pad on the right to *nearest* WordSize\n    writeBytes(value) {\n        let bytes = getBytesCopy(value);\n        const paddingOffset = bytes.length % WordSize;\n        if (paddingOffset) {\n            bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n        }\n        return this.#writeData(bytes);\n    }\n    // Numeric item; pad on the left *to* WordSize\n    writeValue(value) {\n        return this.#writeData(getValue(value));\n    }\n    // Inserts a numeric place-holder, returning a callback that can\n    // be used to asjust the value later\n    writeUpdatableValue() {\n        const offset = this.#data.length;\n        this.#data.push(Padding);\n        this.#dataLength += WordSize;\n        return (value) => {\n            this.#data[offset] = getValue(value);\n        };\n    }\n}\n/**\n *  @_ignore\n */\nexport class Reader {\n    // Allows incomplete unpadded data to be read; otherwise an error\n    // is raised if attempting to overrun the buffer. This is required\n    // to deal with an old Solidity bug, in which event data for\n    // external (not public thoguh) was tightly packed.\n    allowLoose;\n    #data;\n    #offset;\n    #bytesRead;\n    #parent;\n    #maxInflation;\n    constructor(data, allowLoose, maxInflation) {\n        defineProperties(this, { allowLoose: !!allowLoose });\n        this.#data = getBytesCopy(data);\n        this.#bytesRead = 0;\n        this.#parent = null;\n        this.#maxInflation = (maxInflation != null) ? maxInflation : 1024;\n        this.#offset = 0;\n    }\n    get data() { return hexlify(this.#data); }\n    get dataLength() { return this.#data.length; }\n    get consumed() { return this.#offset; }\n    get bytes() { return new Uint8Array(this.#data); }\n    #incrementBytesRead(count) {\n        if (this.#parent) {\n            return this.#parent.#incrementBytesRead(count);\n        }\n        this.#bytesRead += count;\n        // Check for excessive inflation (see: #4537)\n        assert(this.#maxInflation < 1 || this.#bytesRead <= this.#maxInflation * this.dataLength, `compressed ABI data exceeds inflation ratio of ${this.#maxInflation} ( see: https:/\\/github.com/ethers-io/ethers.js/issues/4537 )`, \"BUFFER_OVERRUN\", {\n            buffer: getBytesCopy(this.#data), offset: this.#offset,\n            length: count, info: {\n                bytesRead: this.#bytesRead,\n                dataLength: this.dataLength\n            }\n        });\n    }\n    #peekBytes(offset, length, loose) {\n        let alignedLength = Math.ceil(length / WordSize) * WordSize;\n        if (this.#offset + alignedLength > this.#data.length) {\n            if (this.allowLoose && loose && this.#offset + length <= this.#data.length) {\n                alignedLength = length;\n            }\n            else {\n                assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n                    buffer: getBytesCopy(this.#data),\n                    length: this.#data.length,\n                    offset: this.#offset + alignedLength\n                });\n            }\n        }\n        return this.#data.slice(this.#offset, this.#offset + alignedLength);\n    }\n    // Create a sub-reader with the same underlying data, but offset\n    subReader(offset) {\n        const reader = new Reader(this.#data.slice(this.#offset + offset), this.allowLoose, this.#maxInflation);\n        reader.#parent = this;\n        return reader;\n    }\n    // Read bytes\n    readBytes(length, loose) {\n        let bytes = this.#peekBytes(0, length, !!loose);\n        this.#incrementBytesRead(length);\n        this.#offset += bytes.length;\n        // @TODO: Make sure the length..end bytes are all 0?\n        return bytes.slice(0, length);\n    }\n    // Read a numeric values\n    readValue() {\n        return toBigInt(this.readBytes(WordSize));\n    }\n    readIndex() {\n        return toNumber(this.readBytes(WordSize));\n    }\n}\n//# sourceMappingURL=abstract-coder.js.mapimport { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n *  @_ignore\n */\nexport class AddressCoder extends Coder {\n    constructor(localName) {\n        super(\"address\", \"address\", localName, false);\n    }\n    defaultValue() {\n        return \"0x0000000000000000000000000000000000000000\";\n    }\n    encode(writer, _value) {\n        let value = Typed.dereference(_value, \"string\");\n        try {\n            value = getAddress(value);\n        }\n        catch (error) {\n            return this._throwError(error.message, _value);\n        }\n        return writer.writeValue(value);\n    }\n    decode(reader) {\n        return getAddress(toBeHex(reader.readValue(), 20));\n    }\n}\n//# sourceMappingURL=address.js.mapimport { Coder } from \"./abstract-coder.js\";\n/**\n *  Clones the functionality of an existing Coder, but without a localName\n *\n *  @_ignore\n */\nexport class AnonymousCoder extends Coder {\n    coder;\n    constructor(coder) {\n        super(coder.name, coder.type, \"_\", coder.dynamic);\n        this.coder = coder;\n    }\n    defaultValue() {\n        return this.coder.defaultValue();\n    }\n    encode(writer, value) {\n        return this.coder.encode(writer, value);\n    }\n    decode(reader) {\n        return this.coder.decode(reader);\n    }\n}\n//# sourceMappingURL=anonymous.js.mapimport { defineProperties, isError, assert, assertArgument, assertArgumentCount } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n *  @_ignore\n */\nexport function pack(writer, coders, values) {\n    let arrayValues = [];\n    if (Array.isArray(values)) {\n        arrayValues = values;\n    }\n    else if (values && typeof (values) === \"object\") {\n        let unique = {};\n        arrayValues = coders.map((coder) => {\n            const name = coder.localName;\n            assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n            assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n            unique[name] = true;\n            return values[name];\n        });\n    }\n    else {\n        assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n    }\n    assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n    let staticWriter = new Writer();\n    let dynamicWriter = new Writer();\n    let updateFuncs = [];\n    coders.forEach((coder, index) => {\n        let value = arrayValues[index];\n        if (coder.dynamic) {\n            // Get current dynamic offset (for the future pointer)\n            let dynamicOffset = dynamicWriter.length;\n            // Encode the dynamic value into the dynamicWriter\n            coder.encode(dynamicWriter, value);\n            // Prepare to populate the correct offset once we are done\n            let updateFunc = staticWriter.writeUpdatableValue();\n            updateFuncs.push((baseOffset) => {\n                updateFunc(baseOffset + dynamicOffset);\n            });\n        }\n        else {\n            coder.encode(staticWriter, value);\n        }\n    });\n    // Backfill all the dynamic offsets, now that we know the static length\n    updateFuncs.forEach((func) => { func(staticWriter.length); });\n    let length = writer.appendWriter(staticWriter);\n    length += writer.appendWriter(dynamicWriter);\n    return length;\n}\n/**\n *  @_ignore\n */\nexport function unpack(reader, coders) {\n    let values = [];\n    let keys = [];\n    // A reader anchored to this base\n    let baseReader = reader.subReader(0);\n    coders.forEach((coder) => {\n        let value = null;\n        if (coder.dynamic) {\n            let offset = reader.readIndex();\n            let offsetReader = baseReader.subReader(offset);\n            try {\n                value = coder.decode(offsetReader);\n            }\n            catch (error) {\n                // Cannot recover from this\n                if (isError(error, \"BUFFER_OVERRUN\")) {\n                    throw error;\n                }\n                value = error;\n                value.baseType = coder.name;\n                value.name = coder.localName;\n                value.type = coder.type;\n            }\n        }\n        else {\n            try {\n                value = coder.decode(reader);\n            }\n            catch (error) {\n                // Cannot recover from this\n                if (isError(error, \"BUFFER_OVERRUN\")) {\n                    throw error;\n                }\n                value = error;\n                value.baseType = coder.name;\n                value.name = coder.localName;\n                value.type = coder.type;\n            }\n        }\n        if (value == undefined) {\n            throw new Error(\"investigate\");\n        }\n        values.push(value);\n        keys.push(coder.localName || null);\n    });\n    return Result.fromItems(values, keys);\n}\n/**\n *  @_ignore\n */\nexport class ArrayCoder extends Coder {\n    coder;\n    length;\n    constructor(coder, length, localName) {\n        const type = (coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\");\n        const dynamic = (length === -1 || coder.dynamic);\n        super(\"array\", type, localName, dynamic);\n        defineProperties(this, { coder, length });\n    }\n    defaultValue() {\n        // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n        const defaultChild = this.coder.defaultValue();\n        const result = [];\n        for (let i = 0; i < this.length; i++) {\n            result.push(defaultChild);\n        }\n        return result;\n    }\n    encode(writer, _value) {\n        const value = Typed.dereference(_value, \"array\");\n        if (!Array.isArray(value)) {\n            this._throwError(\"expected array value\", value);\n        }\n        let count = this.length;\n        if (count === -1) {\n            count = value.length;\n            writer.writeValue(value.length);\n        }\n        assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? (\" \" + this.localName) : \"\"));\n        let coders = [];\n        for (let i = 0; i < value.length; i++) {\n            coders.push(this.coder);\n        }\n        return pack(writer, coders, value);\n    }\n    decode(reader) {\n        let count = this.length;\n        if (count === -1) {\n            count = reader.readIndex();\n            // Check that there is *roughly* enough data to ensure\n            // stray random data is not being read as a length. Each\n            // slot requires at least 32 bytes for their value (or 32\n            // bytes as a link to the data). This could use a much\n            // tighter bound, but we are erroring on the side of safety.\n            assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", { buffer: reader.bytes, offset: count * WordSize, length: reader.dataLength });\n        }\n        let coders = [];\n        for (let i = 0; i < count; i++) {\n            coders.push(new AnonymousCoder(this.coder));\n        }\n        return unpack(reader, coders);\n    }\n}\n//# sourceMappingURL=array.js.mapimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n *  @_ignore\n */\nexport class BooleanCoder extends Coder {\n    constructor(localName) {\n        super(\"bool\", \"bool\", localName, false);\n    }\n    defaultValue() {\n        return false;\n    }\n    encode(writer, _value) {\n        const value = Typed.dereference(_value, \"bool\");\n        return writer.writeValue(value ? 1 : 0);\n    }\n    decode(reader) {\n        return !!reader.readValue();\n    }\n}\n//# sourceMappingURL=boolean.js.mapimport { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n *  @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n    constructor(type, localName) {\n        super(type, type, localName, true);\n    }\n    defaultValue() {\n        return \"0x\";\n    }\n    encode(writer, value) {\n        value = getBytesCopy(value);\n        let length = writer.writeValue(value.length);\n        length += writer.writeBytes(value);\n        return length;\n    }\n    decode(reader) {\n        return reader.readBytes(reader.readIndex(), true);\n    }\n}\n/**\n *  @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n    constructor(localName) {\n        super(\"bytes\", localName);\n    }\n    decode(reader) {\n        return hexlify(super.decode(reader));\n    }\n}\n//# sourceMappingURL=bytes.js.mapimport { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n *  @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n    size;\n    constructor(size, localName) {\n        let name = \"bytes\" + String(size);\n        super(name, name, localName, false);\n        defineProperties(this, { size }, { size: \"number\" });\n    }\n    defaultValue() {\n        return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\n    }\n    encode(writer, _value) {\n        let data = getBytesCopy(Typed.dereference(_value, this.type));\n        if (data.length !== this.size) {\n            this._throwError(\"incorrect data length\", _value);\n        }\n        return writer.writeBytes(data);\n    }\n    decode(reader) {\n        return hexlify(reader.readBytes(this.size));\n    }\n}\n//# sourceMappingURL=fixed-bytes.js.mapimport { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n *  @_ignore\n */\nexport class NullCoder extends Coder {\n    constructor(localName) {\n        super(\"null\", \"\", localName, false);\n    }\n    defaultValue() {\n        return null;\n    }\n    encode(writer, value) {\n        if (value != null) {\n            this._throwError(\"not null\", value);\n        }\n        return writer.writeBytes(Empty);\n    }\n    decode(reader) {\n        reader.readBytes(0);\n        return null;\n    }\n}\n//# sourceMappingURL=null.js.mapimport { defineProperties, fromTwos, getBigInt, mask, toTwos } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n *  @_ignore\n */\nexport class NumberCoder extends Coder {\n    size;\n    signed;\n    constructor(size, signed, localName) {\n        const name = ((signed ? \"int\" : \"uint\") + (size * 8));\n        super(name, name, localName, false);\n        defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n    }\n    defaultValue() {\n        return 0;\n    }\n    encode(writer, _value) {\n        let value = getBigInt(Typed.dereference(_value, this.type));\n        // Check bounds are safe for encoding\n        let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n        if (this.signed) {\n            let bounds = mask(maxUintValue, (this.size * 8) - 1);\n            if (value > bounds || value < -(bounds + BN_1)) {\n                this._throwError(\"value out-of-bounds\", _value);\n            }\n            value = toTwos(value, 8 * WordSize);\n        }\n        else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n            this._throwError(\"value out-of-bounds\", _value);\n        }\n        return writer.writeValue(value);\n    }\n    decode(reader) {\n        let value = mask(reader.readValue(), this.size * 8);\n        if (this.signed) {\n            value = fromTwos(value, this.size * 8);\n        }\n        return value;\n    }\n}\n//# sourceMappingURL=number.js.mapimport { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n *  @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n    constructor(localName) {\n        super(\"string\", localName);\n    }\n    defaultValue() {\n        return \"\";\n    }\n    encode(writer, _value) {\n        return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n    }\n    decode(reader) {\n        return toUtf8String(super.decode(reader));\n    }\n}\n//# sourceMappingURL=string.js.mapimport { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n *  @_ignore\n */\nexport class TupleCoder extends Coder {\n    coders;\n    constructor(coders, localName) {\n        let dynamic = false;\n        const types = [];\n        coders.forEach((coder) => {\n            if (coder.dynamic) {\n                dynamic = true;\n            }\n            types.push(coder.type);\n        });\n        const type = (\"tuple(\" + types.join(\",\") + \")\");\n        super(\"tuple\", type, localName, dynamic);\n        defineProperties(this, { coders: Object.freeze(coders.slice()) });\n    }\n    defaultValue() {\n        const values = [];\n        this.coders.forEach((coder) => {\n            values.push(coder.defaultValue());\n        });\n        // We only output named properties for uniquely named coders\n        const uniqueNames = this.coders.reduce((accum, coder) => {\n            const name = coder.localName;\n            if (name) {\n                if (!accum[name]) {\n                    accum[name] = 0;\n                }\n                accum[name]++;\n            }\n            return accum;\n        }, {});\n        // Add named values\n        this.coders.forEach((coder, index) => {\n            let name = coder.localName;\n            if (!name || uniqueNames[name] !== 1) {\n                return;\n            }\n            if (name === \"length\") {\n                name = \"_length\";\n            }\n            if (values[name] != null) {\n                return;\n            }\n            values[name] = values[index];\n        });\n        return Object.freeze(values);\n    }\n    encode(writer, _value) {\n        const value = Typed.dereference(_value, \"tuple\");\n        return pack(writer, this.coders, value);\n    }\n    decode(reader) {\n        return unpack(reader, this.coders);\n    }\n}\n//# sourceMappingURL=tuple.js.map/**\n *  A fragment is a single item from an ABI, which may represent any of:\n *\n *  - [Functions](FunctionFragment)\n *  - [Events](EventFragment)\n *  - [Constructors](ConstructorFragment)\n *  - Custom [Errors](ErrorFragment)\n *  - [Fallback or Receive](FallbackFragment) functions\n *\n *  @_subsection api/abi/abi-coder:Fragments  [about-fragments]\n */\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n;\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n    const result = new Set();\n    items.forEach((k) => result.add(k));\n    return Object.freeze(result);\n}\nconst _kwVisibDeploy = \"external public payable override\";\nconst KwVisibDeploy = setify(_kwVisibDeploy.split(\" \"));\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view override\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n    \"(\": \"OPEN_PAREN\", \")\": \"CLOSE_PAREN\",\n    \"[\": \"OPEN_BRACKET\", \"]\": \"CLOSE_BRACKET\",\n    \",\": \"COMMA\", \"@\": \"AT\"\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n    #offset;\n    #tokens;\n    get offset() { return this.#offset; }\n    get length() { return this.#tokens.length - this.#offset; }\n    constructor(tokens) {\n        this.#offset = 0;\n        this.#tokens = tokens.slice();\n    }\n    clone() { return new TokenString(this.#tokens); }\n    reset() { this.#offset = 0; }\n    #subTokenString(from = 0, to = 0) {\n        return new TokenString(this.#tokens.slice(from, to).map((t) => {\n            return Object.freeze(Object.assign({}, t, {\n                match: (t.match - from),\n                linkBack: (t.linkBack - from),\n                linkNext: (t.linkNext - from),\n            }));\n        }));\n    }\n    // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n    popKeyword(allowed) {\n        const top = this.peek();\n        if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n            throw new Error(`expected keyword ${top.text}`);\n        }\n        return this.pop().text;\n    }\n    // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n    popType(type) {\n        if (this.peek().type !== type) {\n            const top = this.peek();\n            throw new Error(`expected ${type}; got ${top.type} ${JSON.stringify(top.text)}`);\n        }\n        return this.pop().text;\n    }\n    // Pops and returns a \"(\" TOKENS \")\"\n    popParen() {\n        const top = this.peek();\n        if (top.type !== \"OPEN_PAREN\") {\n            throw new Error(\"bad start\");\n        }\n        const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n        this.#offset = top.match + 1;\n        return result;\n    }\n    // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n    popParams() {\n        const top = this.peek();\n        if (top.type !== \"OPEN_PAREN\") {\n            throw new Error(\"bad start\");\n        }\n        const result = [];\n        while (this.#offset < top.match - 1) {\n            const link = this.peek().linkNext;\n            result.push(this.#subTokenString(this.#offset + 1, link));\n            this.#offset = link;\n        }\n        this.#offset = top.match + 1;\n        return result;\n    }\n    // Returns the top Token, throwing if out of tokens\n    peek() {\n        if (this.#offset >= this.#tokens.length) {\n            throw new Error(\"out-of-bounds\");\n        }\n        return this.#tokens[this.#offset];\n    }\n    // Returns the next value, if it is a keyword in `allowed`\n    peekKeyword(allowed) {\n        const top = this.peekType(\"KEYWORD\");\n        return (top != null && allowed.has(top)) ? top : null;\n    }\n    // Returns the value of the next token if it is `type`\n    peekType(type) {\n        if (this.length === 0) {\n            return null;\n        }\n        const top = this.peek();\n        return (top.type === type) ? top.text : null;\n    }\n    // Returns the next token; throws if out of tokens\n    pop() {\n        const result = this.peek();\n        this.#offset++;\n        return result;\n    }\n    toString() {\n        const tokens = [];\n        for (let i = this.#offset; i < this.#tokens.length; i++) {\n            const token = this.#tokens[i];\n            tokens.push(`${token.type}:${token.text}`);\n        }\n        return `<TokenString ${tokens.join(\" \")}>`;\n    }\n}\nfunction lex(text) {\n    const tokens = [];\n    const throwError = (message) => {\n        const token = (offset < text.length) ? JSON.stringify(text[offset]) : \"$EOI\";\n        throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n    };\n    let brackets = [];\n    let commas = [];\n    let offset = 0;\n    while (offset < text.length) {\n        // Strip off any leading whitespace\n        let cur = text.substring(offset);\n        let match = cur.match(regexWhitespacePrefix);\n        if (match) {\n            offset += match[1].length;\n            cur = text.substring(offset);\n        }\n        const token = { depth: brackets.length, linkBack: -1, linkNext: -1, match: -1, type: \"\", text: \"\", offset, value: -1 };\n        tokens.push(token);\n        let type = (SimpleTokens[cur[0]] || \"\");\n        if (type) {\n            token.type = type;\n            token.text = cur[0];\n            offset++;\n            if (type === \"OPEN_PAREN\") {\n                brackets.push(tokens.length - 1);\n                commas.push(tokens.length - 1);\n            }\n            else if (type == \"CLOSE_PAREN\") {\n                if (brackets.length === 0) {\n                    throwError(\"no matching open bracket\");\n                }\n                token.match = brackets.pop();\n                (tokens[token.match]).match = tokens.length - 1;\n                token.depth--;\n                token.linkBack = commas.pop();\n                (tokens[token.linkBack]).linkNext = tokens.length - 1;\n            }\n            else if (type === \"COMMA\") {\n                token.linkBack = commas.pop();\n                (tokens[token.linkBack]).linkNext = tokens.length - 1;\n                commas.push(tokens.length - 1);\n            }\n            else if (type === \"OPEN_BRACKET\") {\n                token.type = \"BRACKET\";\n            }\n            else if (type === \"CLOSE_BRACKET\") {\n                // Remove the CLOSE_BRACKET\n                let suffix = tokens.pop().text;\n                if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n                    const value = tokens.pop().text;\n                    suffix = value + suffix;\n                    (tokens[tokens.length - 1]).value = getNumber(value);\n                }\n                if (tokens.length === 0 || tokens[tokens.length - 1].type !== \"BRACKET\") {\n                    throw new Error(\"missing opening bracket\");\n                }\n                (tokens[tokens.length - 1]).text += suffix;\n            }\n            continue;\n        }\n        match = cur.match(regexIdPrefix);\n        if (match) {\n            token.text = match[1];\n            offset += token.text.length;\n            if (Keywords.has(token.text)) {\n                token.type = \"KEYWORD\";\n                continue;\n            }\n            if (token.text.match(regexType)) {\n                token.type = \"TYPE\";\n                continue;\n            }\n            token.type = \"ID\";\n            continue;\n        }\n        match = cur.match(regexNumberPrefix);\n        if (match) {\n            token.text = match[1];\n            token.type = \"NUMBER\";\n            offset += token.text.length;\n            continue;\n        }\n        throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n    }\n    return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n    let included = [];\n    for (const key in allowed.keys()) {\n        if (set.has(key)) {\n            included.push(key);\n        }\n    }\n    if (included.length > 1) {\n        throw new Error(`conflicting types: ${included.join(\", \")}`);\n    }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n    if (tokens.peekKeyword(KwTypes)) {\n        const keyword = tokens.pop().text;\n        if (keyword !== type) {\n            throw new Error(`expected ${type}, got ${keyword}`);\n        }\n    }\n    return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n    const keywords = new Set();\n    while (true) {\n        const keyword = tokens.peekType(\"KEYWORD\");\n        if (keyword == null || (allowed && !allowed.has(keyword))) {\n            break;\n        }\n        tokens.pop();\n        if (keywords.has(keyword)) {\n            throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n        }\n        keywords.add(keyword);\n    }\n    return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n    let modifiers = consumeKeywords(tokens, KwVisib);\n    // Detect conflicting modifiers\n    allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n    allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n    // Process mutability states\n    if (modifiers.has(\"view\")) {\n        return \"view\";\n    }\n    if (modifiers.has(\"pure\")) {\n        return \"pure\";\n    }\n    if (modifiers.has(\"payable\")) {\n        return \"payable\";\n    }\n    if (modifiers.has(\"nonpayable\")) {\n        return \"nonpayable\";\n    }\n    // Process legacy `constant` last\n    if (modifiers.has(\"constant\")) {\n        return \"view\";\n    }\n    return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n    return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a gas limit, returning a BigNumber or null if none\nfunction consumeGas(tokens) {\n    if (tokens.peekType(\"AT\")) {\n        tokens.pop();\n        if (tokens.peekType(\"NUMBER\")) {\n            return getBigInt(tokens.pop().text);\n        }\n        throw new Error(\"invalid gas\");\n    }\n    return null;\n}\nfunction consumeEoi(tokens) {\n    if (tokens.length) {\n        throw new Error(`unexpected tokens at offset ${tokens.offset}: ${tokens.toString()}`);\n    }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n    const match = type.match(regexType);\n    assertArgument(match, \"invalid type\", \"type\", type);\n    if (type === \"uint\") {\n        return \"uint256\";\n    }\n    if (type === \"int\") {\n        return \"int256\";\n    }\n    if (match[2]) {\n        // bytesXX\n        const length = parseInt(match[2]);\n        assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n    }\n    else if (match[3]) {\n        // intXX or uintXX\n        const size = parseInt(match[3]);\n        assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, \"invalid numeric width\", \"type\", type);\n    }\n    return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_ethers_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n *  Each input and output of a [[Fragment]] is an Array of **ParamType**.\n */\nexport class ParamType {\n    /**\n     *  The local name of the parameter (or ``\"\"`` if unbound)\n     */\n    name;\n    /**\n     *  The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n     *  ``\"uint256[3][]\"``)\n     */\n    type;\n    /**\n     *  The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n     */\n    baseType;\n    /**\n     *  True if the parameters is indexed.\n     *\n     *  For non-indexable types this is ``null``.\n     */\n    indexed;\n    /**\n     *  The components for the tuple.\n     *\n     *  For non-tuple types this is ``null``.\n     */\n    components;\n    /**\n     *  The array length, or ``-1`` for dynamic-lengthed arrays.\n     *\n     *  For non-array types this is ``null``.\n     */\n    arrayLength;\n    /**\n     *  The type of each child in the array.\n     *\n     *  For non-array types this is ``null``.\n     */\n    arrayChildren;\n    /**\n     *  @private\n     */\n    constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n        assertPrivate(guard, _guard, \"ParamType\");\n        Object.defineProperty(this, internal, { value: ParamTypeInternal });\n        if (components) {\n            components = Object.freeze(components.slice());\n        }\n        if (baseType === \"array\") {\n            if (arrayLength == null || arrayChildren == null) {\n                throw new Error(\"\");\n            }\n        }\n        else if (arrayLength != null || arrayChildren != null) {\n            throw new Error(\"\");\n        }\n        if (baseType === \"tuple\") {\n            if (components == null) {\n                throw new Error(\"\");\n            }\n        }\n        else if (components != null) {\n            throw new Error(\"\");\n        }\n        defineProperties(this, {\n            name, type, baseType, indexed, components, arrayLength, arrayChildren\n        });\n    }\n    /**\n     *  Return a string representation of this type.\n     *\n     *  For example,\n     *\n     *  ``sighash\" => \"(uint256,address)\"``\n     *\n     *  ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n     *\n     *  ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n     */\n    format(format) {\n        if (format == null) {\n            format = \"sighash\";\n        }\n        if (format === \"json\") {\n            const name = this.name || \"\";\n            if (this.isArray()) {\n                const result = JSON.parse(this.arrayChildren.format(\"json\"));\n                result.name = name;\n                result.type += `[${(this.arrayLength < 0 ? \"\" : String(this.arrayLength))}]`;\n                return JSON.stringify(result);\n            }\n            const result = {\n                type: ((this.baseType === \"tuple\") ? \"tuple\" : this.type),\n                name\n            };\n            if (typeof (this.indexed) === \"boolean\") {\n                result.indexed = this.indexed;\n            }\n            if (this.isTuple()) {\n                result.components = this.components.map((c) => JSON.parse(c.format(format)));\n            }\n            return JSON.stringify(result);\n        }\n        let result = \"\";\n        // Array\n        if (this.isArray()) {\n            result += this.arrayChildren.format(format);\n            result += `[${(this.arrayLength < 0 ? \"\" : String(this.arrayLength))}]`;\n        }\n        else {\n            if (this.isTuple()) {\n                result += \"(\" + this.components.map((comp) => comp.format(format)).join((format === \"full\") ? \", \" : \",\") + \")\";\n            }\n            else {\n                result += this.type;\n            }\n        }\n        if (format !== \"sighash\") {\n            if (this.indexed === true) {\n                result += \" indexed\";\n            }\n            if (format === \"full\" && this.name) {\n                result += \" \" + this.name;\n            }\n        }\n        return result;\n    }\n    /**\n     *  Returns true if %%this%% is an Array type.\n     *\n     *  This provides a type gaurd ensuring that [[arrayChildren]]\n     *  and [[arrayLength]] are non-null.\n     */\n    isArray() {\n        return (this.baseType === \"array\");\n    }\n    /**\n     *  Returns true if %%this%% is a Tuple type.\n     *\n     *  This provides a type gaurd ensuring that [[components]]\n     *  is non-null.\n     */\n    isTuple() {\n        return (this.baseType === \"tuple\");\n    }\n    /**\n     *  Returns true if %%this%% is an Indexable type.\n     *\n     *  This provides a type gaurd ensuring that [[indexed]]\n     *  is non-null.\n     */\n    isIndexable() {\n        return (this.indexed != null);\n    }\n    /**\n     *  Walks the **ParamType** with %%value%%, calling %%process%%\n     *  on each type, destructing the %%value%% recursively.\n     */\n    walk(value, process) {\n        if (this.isArray()) {\n            if (!Array.isArray(value)) {\n                throw new Error(\"invalid array value\");\n            }\n            if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n                throw new Error(\"array is wrong length\");\n            }\n            const _this = this;\n            return value.map((v) => (_this.arrayChildren.walk(v, process)));\n        }\n        if (this.isTuple()) {\n            if (!Array.isArray(value)) {\n                throw new Error(\"invalid tuple value\");\n            }\n            if (value.length !== this.components.length) {\n                throw new Error(\"array is wrong length\");\n            }\n            const _this = this;\n            return value.map((v, i) => (_this.components[i].walk(v, process)));\n        }\n        return process(this.type, value);\n    }\n    #walkAsync(promises, value, process, setValue) {\n        if (this.isArray()) {\n            if (!Array.isArray(value)) {\n                throw new Error(\"invalid array value\");\n            }\n            if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n                throw new Error(\"array is wrong length\");\n            }\n            const childType = this.arrayChildren;\n            const result = value.slice();\n            result.forEach((value, index) => {\n                childType.#walkAsync(promises, value, process, (value) => {\n                    result[index] = value;\n                });\n            });\n            setValue(result);\n            return;\n        }\n        if (this.isTuple()) {\n            const components = this.components;\n            // Convert the object into an array\n            let result;\n            if (Array.isArray(value)) {\n                result = value.slice();\n            }\n            else {\n                if (value == null || typeof (value) !== \"object\") {\n                    throw new Error(\"invalid tuple value\");\n                }\n                result = components.map((param) => {\n                    if (!param.name) {\n                        throw new Error(\"cannot use object value with unnamed components\");\n                    }\n                    if (!(param.name in value)) {\n                        throw new Error(`missing value for component ${param.name}`);\n                    }\n                    return value[param.name];\n                });\n            }\n            if (result.length !== this.components.length) {\n                throw new Error(\"array is wrong length\");\n            }\n            result.forEach((value, index) => {\n                components[index].#walkAsync(promises, value, process, (value) => {\n                    result[index] = value;\n                });\n            });\n            setValue(result);\n            return;\n        }\n        const result = process(this.type, value);\n        if (result.then) {\n            promises.push((async function () { setValue(await result); })());\n        }\n        else {\n            setValue(result);\n        }\n    }\n    /**\n     *  Walks the **ParamType** with %%value%%, asynchronously calling\n     *  %%process%% on each type, destructing the %%value%% recursively.\n     *\n     *  This can be used to resolve ENS names by walking and resolving each\n     *  ``\"address\"`` type.\n     */\n    async walkAsync(value, process) {\n        const promises = [];\n        const result = [value];\n        this.#walkAsync(promises, value, process, (value) => {\n            result[0] = value;\n        });\n        if (promises.length) {\n            await Promise.all(promises);\n        }\n        return result[0];\n    }\n    /**\n     *  Creates a new **ParamType** for %%obj%%.\n     *\n     *  If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n     *  otherwise the ``indexed`` keyword will throw an error.\n     */\n    static from(obj, allowIndexed) {\n        if (ParamType.isParamType(obj)) {\n            return obj;\n        }\n        if (typeof (obj) === \"string\") {\n            try {\n                return ParamType.from(lex(obj), allowIndexed);\n            }\n            catch (error) {\n                assertArgument(false, \"invalid param type\", \"obj\", obj);\n            }\n        }\n        else if (obj instanceof TokenString) {\n            let type = \"\", baseType = \"\";\n            let comps = null;\n            if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") || obj.peekType(\"OPEN_PAREN\")) {\n                // Tuple\n                baseType = \"tuple\";\n                comps = obj.popParams().map((t) => ParamType.from(t));\n                type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n            }\n            else {\n                // Normal\n                type = verifyBasicType(obj.popType(\"TYPE\"));\n                baseType = type;\n            }\n            // Check for Array\n            let arrayChildren = null;\n            let arrayLength = null;\n            while (obj.length && obj.peekType(\"BRACKET\")) {\n                const bracket = obj.pop(); //arrays[i];\n                arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n                arrayLength = bracket.value;\n                type += bracket.text;\n                baseType = \"array\";\n                comps = null;\n            }\n            let indexed = null;\n            const keywords = consumeKeywords(obj, KwModifiers);\n            if (keywords.has(\"indexed\")) {\n                if (!allowIndexed) {\n                    throw new Error(\"\");\n                }\n                indexed = true;\n            }\n            const name = (obj.peekType(\"ID\") ? obj.pop().text : \"\");\n            if (obj.length) {\n                throw new Error(\"leftover tokens\");\n            }\n            return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n        }\n        const name = obj.name;\n        assertArgument(!name || (typeof (name) === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n        let indexed = obj.indexed;\n        if (indexed != null) {\n            assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n            indexed = !!indexed;\n        }\n        let type = obj.type;\n        let arrayMatch = type.match(regexArrayType);\n        if (arrayMatch) {\n            const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n            const arrayChildren = ParamType.from({\n                type: arrayMatch[1],\n                components: obj.components\n            });\n            return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n        }\n        if (type === \"tuple\" || type.startsWith(\"tuple(\" /* fix: ) */) || type.startsWith(\"(\" /* fix: ) */)) {\n            const comps = (obj.components != null) ? obj.components.map((c) => ParamType.from(c)) : null;\n            const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n            // @TODO: use lexer to validate and normalize type\n            return tuple;\n        }\n        type = verifyBasicType(obj.type);\n        return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n    }\n    /**\n     *  Returns true if %%value%% is a **ParamType**.\n     */\n    static isParamType(value) {\n        return (value && value[internal] === ParamTypeInternal);\n    }\n}\n/**\n *  An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n    /**\n     *  The type of the fragment.\n     */\n    type;\n    /**\n     *  The inputs for the fragment.\n     */\n    inputs;\n    /**\n     *  @private\n     */\n    constructor(guard, type, inputs) {\n        assertPrivate(guard, _guard, \"Fragment\");\n        inputs = Object.freeze(inputs.slice());\n        defineProperties(this, { type, inputs });\n    }\n    /**\n     *  Creates a new **Fragment** for %%obj%%, wich can be any supported\n     *  ABI frgament type.\n     */\n    static from(obj) {\n        if (typeof (obj) === \"string\") {\n            // Try parsing JSON...\n            try {\n                Fragment.from(JSON.parse(obj));\n            }\n            catch (e) { }\n            // ...otherwise, use the human-readable lexer\n            return Fragment.from(lex(obj));\n        }\n        if (obj instanceof TokenString) {\n            // Human-readable ABI (already lexed)\n            const type = obj.peekKeyword(KwTypes);\n            switch (type) {\n                case \"constructor\": return ConstructorFragment.from(obj);\n                case \"error\": return ErrorFragment.from(obj);\n                case \"event\": return EventFragment.from(obj);\n                case \"fallback\":\n                case \"receive\":\n                    return FallbackFragment.from(obj);\n                case \"function\": return FunctionFragment.from(obj);\n                case \"struct\": return StructFragment.from(obj);\n            }\n        }\n        else if (typeof (obj) === \"object\") {\n            // JSON ABI\n            switch (obj.type) {\n                case \"constructor\": return ConstructorFragment.from(obj);\n                case \"error\": return ErrorFragment.from(obj);\n                case \"event\": return EventFragment.from(obj);\n                case \"fallback\":\n                case \"receive\":\n                    return FallbackFragment.from(obj);\n                case \"function\": return FunctionFragment.from(obj);\n                case \"struct\": return StructFragment.from(obj);\n            }\n            assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n                operation: \"Fragment.from\"\n            });\n        }\n        assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n    }\n    /**\n     *  Returns true if %%value%% is a [[ConstructorFragment]].\n     */\n    static isConstructor(value) {\n        return ConstructorFragment.isFragment(value);\n    }\n    /**\n     *  Returns true if %%value%% is an [[ErrorFragment]].\n     */\n    static isError(value) {\n        return ErrorFragment.isFragment(value);\n    }\n    /**\n     *  Returns true if %%value%% is an [[EventFragment]].\n     */\n    static isEvent(value) {\n        return EventFragment.isFragment(value);\n    }\n    /**\n     *  Returns true if %%value%% is a [[FunctionFragment]].\n     */\n    static isFunction(value) {\n        return FunctionFragment.isFragment(value);\n    }\n    /**\n     *  Returns true if %%value%% is a [[StructFragment]].\n     */\n    static isStruct(value) {\n        return StructFragment.isFragment(value);\n    }\n}\n/**\n *  An abstract class to represent An individual fragment\n *  which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n    /**\n     *  The name of the fragment.\n     */\n    name;\n    /**\n     *  @private\n     */\n    constructor(guard, type, name, inputs) {\n        super(guard, type, inputs);\n        assertArgument(typeof (name) === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n        inputs = Object.freeze(inputs.slice());\n        defineProperties(this, { name });\n    }\n}\nfunction joinParams(format, params) {\n    return \"(\" + params.map((p) => p.format(format)).join((format === \"full\") ? \", \" : \",\") + \")\";\n}\n/**\n *  A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n    /**\n     *  @private\n     */\n    constructor(guard, name, inputs) {\n        super(guard, \"error\", name, inputs);\n        Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n    }\n    /**\n     *  The Custom Error selector.\n     */\n    get selector() {\n        return id(this.format(\"sighash\")).substring(0, 10);\n    }\n    /**\n     *  Returns a string representation of this fragment as %%format%%.\n     */\n    format(format) {\n        if (format == null) {\n            format = \"sighash\";\n        }\n        if (format === \"json\") {\n            return JSON.stringify({\n                type: \"error\",\n                name: this.name,\n                inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n            });\n        }\n        const result = [];\n        if (format !== \"sighash\") {\n            result.push(\"error\");\n        }\n        result.push(this.name + joinParams(format, this.inputs));\n        return result.join(\" \");\n    }\n    /**\n     *  Returns a new **ErrorFragment** for %%obj%%.\n     */\n    static from(obj) {\n        if (ErrorFragment.isFragment(obj)) {\n            return obj;\n        }\n        if (typeof (obj) === \"string\") {\n            return ErrorFragment.from(lex(obj));\n        }\n        else if (obj instanceof TokenString) {\n            const name = consumeName(\"error\", obj);\n            const inputs = consumeParams(obj);\n            consumeEoi(obj);\n            return new ErrorFragment(_guard, name, inputs);\n        }\n        return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n    }\n    /**\n     *  Returns ``true`` and provides a type guard if %%value%% is an\n     *  **ErrorFragment**.\n     */\n    static isFragment(value) {\n        return (value && value[internal] === ErrorFragmentInternal);\n    }\n}\n/**\n *  A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n    /**\n     *  Whether this event is anonymous.\n     */\n    anonymous;\n    /**\n     *  @private\n     */\n    constructor(guard, name, inputs, anonymous) {\n        super(guard, \"event\", name, inputs);\n        Object.defineProperty(this, internal, { value: EventFragmentInternal });\n        defineProperties(this, { anonymous });\n    }\n    /**\n     *  The Event topic hash.\n     */\n    get topicHash() {\n        return id(this.format(\"sighash\"));\n    }\n    /**\n     *  Returns a string representation of this event as %%format%%.\n     */\n    format(format) {\n        if (format == null) {\n            format = \"sighash\";\n        }\n        if (format === \"json\") {\n            return JSON.stringify({\n                type: \"event\",\n                anonymous: this.anonymous,\n                name: this.name,\n                inputs: this.inputs.map((i) => JSON.parse(i.format(format)))\n            });\n        }\n        const result = [];\n        if (format !== \"sighash\") {\n            result.push(\"event\");\n        }\n        result.push(this.name + joinParams(format, this.inputs));\n        if (format !== \"sighash\" && this.anonymous) {\n            result.push(\"anonymous\");\n        }\n        return result.join(\" \");\n    }\n    /**\n     *  Return the topic hash for an event with %%name%% and %%params%%.\n     */\n    static getTopicHash(name, params) {\n        params = (params || []).map((p) => ParamType.from(p));\n        const fragment = new EventFragment(_guard, name, params, false);\n        return fragment.topicHash;\n    }\n    /**\n     *  Returns a new **EventFragment** for %%obj%%.\n     */\n    static from(obj) {\n        if (EventFragment.isFragment(obj)) {\n            return obj;\n        }\n        if (typeof (obj) === \"string\") {\n            try {\n                return EventFragment.from(lex(obj));\n            }\n            catch (error) {\n                assertArgument(false, \"invalid event fragment\", \"obj\", obj);\n            }\n        }\n        else if (obj instanceof TokenString) {\n            const name = consumeName(\"event\", obj);\n            const inputs = consumeParams(obj, true);\n            const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n            consumeEoi(obj);\n            return new EventFragment(_guard, name, inputs, anonymous);\n        }\n        return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n    }\n    /**\n     *  Returns ``true`` and provides a type guard if %%value%% is an\n     *  **EventFragment**.\n     */\n    static isFragment(value) {\n        return (value && value[internal] === EventFragmentInternal);\n    }\n}\n/**\n *  A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n    /**\n     *  Whether the constructor can receive an endowment.\n     */\n    payable;\n    /**\n     *  The recommended gas limit for deployment or ``null``.\n     */\n    gas;\n    /**\n     *  @private\n     */\n    constructor(guard, type, inputs, payable, gas) {\n        super(guard, type, inputs);\n        Object.defineProperty(this, internal, { value: ConstructorFragmentInternal });\n        defineProperties(this, { payable, gas });\n    }\n    /**\n     *  Returns a string representation of this constructor as %%format%%.\n     */\n    format(format) {\n        assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n        if (format === \"json\") {\n            return JSON.stringify({\n                type: \"constructor\",\n                stateMutability: (this.payable ? \"payable\" : \"undefined\"),\n                payable: this.payable,\n                gas: ((this.gas != null) ? this.gas : undefined),\n                inputs: this.inputs.map((i) => JSON.parse(i.format(format)))\n            });\n        }\n        const result = [`constructor${joinParams(format, this.inputs)}`];\n        if (this.payable) {\n            result.push(\"payable\");\n        }\n        if (this.gas != null) {\n            result.push(`@${this.gas.toString()}`);\n        }\n        return result.join(\" \");\n    }\n    /**\n     *  Returns a new **ConstructorFragment** for %%obj%%.\n     */\n    static from(obj) {\n        if (ConstructorFragment.isFragment(obj)) {\n            return obj;\n        }\n        if (typeof (obj) === \"string\") {\n            try {\n                return ConstructorFragment.from(lex(obj));\n            }\n            catch (error) {\n                assertArgument(false, \"invalid constuctor fragment\", \"obj\", obj);\n            }\n        }\n        else if (obj instanceof TokenString) {\n            consumeKeywords(obj, setify([\"constructor\"]));\n            const inputs = consumeParams(obj);\n            const payable = !!consumeKeywords(obj, KwVisibDeploy).has(\"payable\");\n            const gas = consumeGas(obj);\n            consumeEoi(obj);\n            return new ConstructorFragment(_guard, \"constructor\", inputs, payable, gas);\n        }\n        return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, (obj.gas != null) ? obj.gas : null);\n    }\n    /**\n     *  Returns ``true`` and provides a type guard if %%value%% is a\n     *  **ConstructorFragment**.\n     */\n    static isFragment(value) {\n        return (value && value[internal] === ConstructorFragmentInternal);\n    }\n}\n/**\n *  A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n    /**\n     *  If the function can be sent value during invocation.\n     */\n    payable;\n    constructor(guard, inputs, payable) {\n        super(guard, \"fallback\", inputs);\n        Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n        defineProperties(this, { payable });\n    }\n    /**\n     *  Returns a string representation of this fallback as %%format%%.\n     */\n    format(format) {\n        const type = ((this.inputs.length === 0) ? \"receive\" : \"fallback\");\n        if (format === \"json\") {\n            const stateMutability = (this.payable ? \"payable\" : \"nonpayable\");\n            return JSON.stringify({ type, stateMutability });\n        }\n        return `${type}()${this.payable ? \" payable\" : \"\"}`;\n    }\n    /**\n     *  Returns a new **FallbackFragment** for %%obj%%.\n     */\n    static from(obj) {\n        if (FallbackFragment.isFragment(obj)) {\n            return obj;\n        }\n        if (typeof (obj) === \"string\") {\n            try {\n                return FallbackFragment.from(lex(obj));\n            }\n            catch (error) {\n                assertArgument(false, \"invalid fallback fragment\", \"obj\", obj);\n            }\n        }\n        else if (obj instanceof TokenString) {\n            const errorObj = obj.toString();\n            const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n            assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n            const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n            // receive()\n            if (type === \"receive\") {\n                const inputs = consumeParams(obj);\n                assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n                consumeKeywords(obj, setify([\"payable\"]));\n                consumeEoi(obj);\n                return new FallbackFragment(_guard, [], true);\n            }\n            // fallback() [payable]\n            // fallback(bytes) [payable] returns (bytes)\n            let inputs = consumeParams(obj);\n            if (inputs.length) {\n                assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n            }\n            else {\n                inputs = [ParamType.from(\"bytes\")];\n            }\n            const mutability = consumeMutability(obj);\n            assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n            if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n                const outputs = consumeParams(obj);\n                assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n            }\n            consumeEoi(obj);\n            return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n        }\n        if (obj.type === \"receive\") {\n            return new FallbackFragment(_guard, [], true);\n        }\n        if (obj.type === \"fallback\") {\n            const inputs = [ParamType.from(\"bytes\")];\n            const payable = (obj.stateMutability === \"payable\");\n            return new FallbackFragment(_guard, inputs, payable);\n        }\n        assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n    }\n    /**\n     *  Returns ``true`` and provides a type guard if %%value%% is a\n     *  **FallbackFragment**.\n     */\n    static isFragment(value) {\n        return (value && value[internal] === FallbackFragmentInternal);\n    }\n}\n/**\n *  A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n    /**\n     *  If the function is constant (e.g. ``pure`` or ``view`` functions).\n     */\n    constant;\n    /**\n     *  The returned types for the result of calling this function.\n     */\n    outputs;\n    /**\n     *  The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n     *  or ``pure``)\n     */\n    stateMutability;\n    /**\n     *  If the function can be sent value during invocation.\n     */\n    payable;\n    /**\n     *  The recommended gas limit to send when calling this function.\n     */\n    gas;\n    /**\n     *  @private\n     */\n    constructor(guard, name, stateMutability, inputs, outputs, gas) {\n        super(guard, \"function\", name, inputs);\n        Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n        outputs = Object.freeze(outputs.slice());\n        const constant = (stateMutability === \"view\" || stateMutability === \"pure\");\n        const payable = (stateMutability === \"payable\");\n        defineProperties(this, { constant, gas, outputs, payable, stateMutability });\n    }\n    /**\n     *  The Function selector.\n     */\n    get selector() {\n        return id(this.format(\"sighash\")).substring(0, 10);\n    }\n    /**\n     *  Returns a string representation of this function as %%format%%.\n     */\n    format(format) {\n        if (format == null) {\n            format = \"sighash\";\n        }\n        if (format === \"json\") {\n            return JSON.stringify({\n                type: \"function\",\n                name: this.name,\n                constant: this.constant,\n                stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n                payable: this.payable,\n                gas: ((this.gas != null) ? this.gas : undefined),\n                inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n                outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n            });\n        }\n        const result = [];\n        if (format !== \"sighash\") {\n            result.push(\"function\");\n        }\n        result.push(this.name + joinParams(format, this.inputs));\n        if (format !== \"sighash\") {\n            if (this.stateMutability !== \"nonpayable\") {\n                result.push(this.stateMutability);\n            }\n            if (this.outputs && this.outputs.length) {\n                result.push(\"returns\");\n                result.push(joinParams(format, this.outputs));\n            }\n            if (this.gas != null) {\n                result.push(`@${this.gas.toString()}`);\n            }\n        }\n        return result.join(\" \");\n    }\n    /**\n     *  Return the selector for a function with %%name%% and %%params%%.\n     */\n    static getSelector(name, params) {\n        params = (params || []).map((p) => ParamType.from(p));\n        const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n        return fragment.selector;\n    }\n    /**\n     *  Returns a new **FunctionFragment** for %%obj%%.\n     */\n    static from(obj) {\n        if (FunctionFragment.isFragment(obj)) {\n            return obj;\n        }\n        if (typeof (obj) === \"string\") {\n            try {\n                return FunctionFragment.from(lex(obj));\n            }\n            catch (error) {\n                assertArgument(false, \"invalid function fragment\", \"obj\", obj);\n            }\n        }\n        else if (obj instanceof TokenString) {\n            const name = consumeName(\"function\", obj);\n            const inputs = consumeParams(obj);\n            const mutability = consumeMutability(obj);\n            let outputs = [];\n            if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n                outputs = consumeParams(obj);\n            }\n            const gas = consumeGas(obj);\n            consumeEoi(obj);\n            return new FunctionFragment(_guard, name, mutability, inputs, outputs, gas);\n        }\n        let stateMutability = obj.stateMutability;\n        // Use legacy Solidity ABI logic if stateMutability is missing\n        if (stateMutability == null) {\n            stateMutability = \"payable\";\n            if (typeof (obj.constant) === \"boolean\") {\n                stateMutability = \"view\";\n                if (!obj.constant) {\n                    stateMutability = \"payable\";\n                    if (typeof (obj.payable) === \"boolean\" && !obj.payable) {\n                        stateMutability = \"nonpayable\";\n                    }\n                }\n            }\n            else if (typeof (obj.payable) === \"boolean\" && !obj.payable) {\n                stateMutability = \"nonpayable\";\n            }\n        }\n        // @TODO: verifyState for stateMutability (e.g. throw if\n        //        payable: false but stateMutability is \"nonpayable\")\n        return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], (obj.gas != null) ? obj.gas : null);\n    }\n    /**\n     *  Returns ``true`` and provides a type guard if %%value%% is a\n     *  **FunctionFragment**.\n     */\n    static isFragment(value) {\n        return (value && value[internal] === FunctionFragmentInternal);\n    }\n}\n/**\n *  A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n    /**\n     *  @private\n     */\n    constructor(guard, name, inputs) {\n        super(guard, \"struct\", name, inputs);\n        Object.defineProperty(this, internal, { value: StructFragmentInternal });\n    }\n    /**\n     *  Returns a string representation of this struct as %%format%%.\n     */\n    format() {\n        throw new Error(\"@TODO\");\n    }\n    /**\n     *  Returns a new **StructFragment** for %%obj%%.\n     */\n    static from(obj) {\n        if (typeof (obj) === \"string\") {\n            try {\n                return StructFragment.from(lex(obj));\n            }\n            catch (error) {\n                assertArgument(false, \"invalid struct fragment\", \"obj\", obj);\n            }\n        }\n        else if (obj instanceof TokenString) {\n            const name = consumeName(\"struct\", obj);\n            const inputs = consumeParams(obj);\n            consumeEoi(obj);\n            return new StructFragment(_guard, name, inputs);\n        }\n        return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n    }\n    // @TODO: fix this return type\n    /**\n     *  Returns ``true`` and provides a type guard if %%value%% is a\n     *  **StructFragment**.\n     */\n    static isFragment(value) {\n        return (value && value[internal] === StructFragmentInternal);\n    }\n}\n//# sourceMappingURL=fragments.js.map/**\n *  The Application Binary Interface (ABI) describes how method input\n *  parameters should be encoded, their results decoded, and how to\n *  decode events and errors.\n *\n *  See [About ABIs](docs-abi) for more details how they are used.\n *\n *  @_section api/abi:Application Binary Interface  [about-abi]\n *  @_navTitle: ABI\n */\n//////\nexport { AbiCoder } from \"./abi-coder.js\";\nexport { decodeBytes32String, encodeBytes32String } from \"./bytes32.js\";\nexport { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from \"./fragments.js\";\nexport { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result } from \"./interface.js\";\nexport { Typed } from \"./typed.js\";\n//# sourceMappingURL=index.js.map/**\n *  The Interface class is a low-level class that accepts an\n *  ABI and provides all the necessary functionality to encode\n *  and decode paramaters to and results from methods, events\n *  and errors.\n *\n *  It also provides several convenience methods to automatically\n *  search and find matching transactions and events to parse them.\n *\n *  @_subsection api/abi:Interfaces  [interfaces]\n */\nimport { keccak256 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadBytes, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nexport { checkResultErrors, Result };\n/**\n *  When using the [[Interface-parseLog]] to automatically match a Log to its event\n *  for parsing, a **LogDescription** is returned.\n */\nexport class LogDescription {\n    /**\n     *  The matching fragment for the ``topic0``.\n     */\n    fragment;\n    /**\n     *  The name of the Event.\n     */\n    name;\n    /**\n     *  The full Event signature.\n     */\n    signature;\n    /**\n     *  The topic hash for the Event.\n     */\n    topic;\n    /**\n     *  The arguments passed into the Event with ``emit``.\n     */\n    args;\n    /**\n     *  @_ignore:\n     */\n    constructor(fragment, topic, args) {\n        const name = fragment.name, signature = fragment.format();\n        defineProperties(this, {\n            fragment, name, signature, topic, args\n        });\n    }\n}\n/**\n *  When using the [[Interface-parseTransaction]] to automatically match\n *  a transaction data to its function for parsing,\n *  a **TransactionDescription** is returned.\n */\nexport class TransactionDescription {\n    /**\n     *  The matching fragment from the transaction ``data``.\n     */\n    fragment;\n    /**\n     *  The name of the Function from the transaction ``data``.\n     */\n    name;\n    /**\n     *  The arguments passed to the Function from the transaction ``data``.\n     */\n    args;\n    /**\n     *  The full Function signature from the transaction ``data``.\n     */\n    signature;\n    /**\n     *  The selector for the Function from the transaction ``data``.\n     */\n    selector;\n    /**\n     *  The ``value`` (in wei) from the transaction.\n     */\n    value;\n    /**\n     *  @_ignore:\n     */\n    constructor(fragment, selector, args, value) {\n        const name = fragment.name, signature = fragment.format();\n        defineProperties(this, {\n            fragment, name, args, signature, selector, value\n        });\n    }\n}\n/**\n *  When using the [[Interface-parseError]] to automatically match an\n *  error for a call result for parsing, an **ErrorDescription** is returned.\n */\nexport class ErrorDescription {\n    /**\n     *  The matching fragment.\n     */\n    fragment;\n    /**\n     *  The name of the Error.\n     */\n    name;\n    /**\n     *  The arguments passed to the Error with ``revert``.\n     */\n    args;\n    /**\n     *  The full Error signature.\n     */\n    signature;\n    /**\n     *  The selector for the Error.\n     */\n    selector;\n    /**\n     *  @_ignore:\n     */\n    constructor(fragment, selector, args) {\n        const name = fragment.name, signature = fragment.format();\n        defineProperties(this, {\n            fragment, name, args, signature, selector\n        });\n    }\n}\n/**\n *  An **Indexed** is used as a value when a value that does not\n *  fit within a topic (i.e. not a fixed-length, 32-byte type). It\n *  is the ``keccak256`` of the value, and used for types such as\n *  arrays, tuples, bytes and strings.\n */\nexport class Indexed {\n    /**\n     *  The ``keccak256`` of the value logged.\n     */\n    hash;\n    /**\n     *  @_ignore:\n     */\n    _isIndexed;\n    /**\n     *  Returns ``true`` if %%value%% is an **Indexed**.\n     *\n     *  This provides a Type Guard for property access.\n     */\n    static isIndexed(value) {\n        return !!(value && value._isIndexed);\n    }\n    /**\n     *  @_ignore:\n     */\n    constructor(hash) {\n        defineProperties(this, { hash, _isIndexed: true });\n    }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n    \"0\": \"generic panic\",\n    \"1\": \"assert(false)\",\n    \"17\": \"arithmetic overflow\",\n    \"18\": \"division or modulo by zero\",\n    \"33\": \"enum overflow\",\n    \"34\": \"invalid encoded storage byte array accessed\",\n    \"49\": \"out-of-bounds array access; popping on an empty array\",\n    \"50\": \"out-of-bounds access of an array or bytesN\",\n    \"65\": \"out of memory\",\n    \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n    \"0x08c379a0\": {\n        signature: \"Error(string)\",\n        name: \"Error\",\n        inputs: [\"string\"],\n        reason: (message) => {\n            return `reverted with reason string ${JSON.stringify(message)}`;\n        }\n    },\n    \"0x4e487b71\": {\n        signature: \"Panic(uint256)\",\n        name: \"Panic\",\n        inputs: [\"uint256\"],\n        reason: (code) => {\n            let reason = \"unknown panic code\";\n            if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n                reason = PanicReasons[code.toString()];\n            }\n            return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n        }\n    }\n};\n/**\n *  An Interface abstracts many of the low-level details for\n *  encoding and decoding the data on the blockchain.\n *\n *  An ABI provides information on how to encode data to send to\n *  a Contract, how to decode the results and events and how to\n *  interpret revert errors.\n *\n *  The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n    /**\n     *  All the Contract ABI members (i.e. methods, events, errors, etc).\n     */\n    fragments;\n    /**\n     *  The Contract constructor.\n     */\n    deploy;\n    /**\n     *  The Fallback method, if any.\n     */\n    fallback;\n    /**\n     *  If receiving ether is supported.\n     */\n    receive;\n    #errors;\n    #events;\n    #functions;\n    //    #structs: Map<string, StructFragment>;\n    #abiCoder;\n    /**\n     *  Create a new Interface for the %%fragments%%.\n     */\n    constructor(fragments) {\n        let abi = [];\n        if (typeof (fragments) === \"string\") {\n            abi = JSON.parse(fragments);\n        }\n        else {\n            abi = fragments;\n        }\n        this.#functions = new Map();\n        this.#errors = new Map();\n        this.#events = new Map();\n        //        this.#structs = new Map();\n        const frags = [];\n        for (const a of abi) {\n            try {\n                frags.push(Fragment.from(a));\n            }\n            catch (error) {\n                console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`, error.message);\n            }\n        }\n        defineProperties(this, {\n            fragments: Object.freeze(frags)\n        });\n        let fallback = null;\n        let receive = false;\n        this.#abiCoder = this.getAbiCoder();\n        // Add all fragments by their signature\n        this.fragments.forEach((fragment, index) => {\n            let bucket;\n            switch (fragment.type) {\n                case \"constructor\":\n                    if (this.deploy) {\n                        console.log(\"duplicate definition - constructor\");\n                        return;\n                    }\n                    //checkNames(fragment, \"input\", fragment.inputs);\n                    defineProperties(this, { deploy: fragment });\n                    return;\n                case \"fallback\":\n                    if (fragment.inputs.length === 0) {\n                        receive = true;\n                    }\n                    else {\n                        assertArgument(!fallback || fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n                        fallback = fragment;\n                        receive = fallback.payable;\n                    }\n                    return;\n                case \"function\":\n                    //checkNames(fragment, \"input\", fragment.inputs);\n                    //checkNames(fragment, \"output\", (<FunctionFragment>fragment).outputs);\n                    bucket = this.#functions;\n                    break;\n                case \"event\":\n                    //checkNames(fragment, \"input\", fragment.inputs);\n                    bucket = this.#events;\n                    break;\n                case \"error\":\n                    bucket = this.#errors;\n                    break;\n                default:\n                    return;\n            }\n            // Two identical entries; ignore it\n            const signature = fragment.format();\n            if (bucket.has(signature)) {\n                return;\n            }\n            bucket.set(signature, fragment);\n        });\n        // If we do not have a constructor add a default\n        if (!this.deploy) {\n            defineProperties(this, {\n                deploy: ConstructorFragment.from(\"constructor()\")\n            });\n        }\n        defineProperties(this, { fallback, receive });\n    }\n    /**\n     *  Returns the entire Human-Readable ABI, as an array of\n     *  signatures, optionally as %%minimal%% strings, which\n     *  removes parameter names and unneceesary spaces.\n     */\n    format(minimal) {\n        const format = (minimal ? \"minimal\" : \"full\");\n        const abi = this.fragments.map((f) => f.format(format));\n        return abi;\n    }\n    /**\n     *  Return the JSON-encoded ABI. This is the format Solidiy\n     *  returns.\n     */\n    formatJson() {\n        const abi = this.fragments.map((f) => f.format(\"json\"));\n        // We need to re-bundle the JSON fragments a bit\n        return JSON.stringify(abi.map((j) => JSON.parse(j)));\n    }\n    /**\n     *  The ABI coder that will be used to encode and decode binary\n     *  data.\n     */\n    getAbiCoder() {\n        return AbiCoder.defaultAbiCoder();\n    }\n    // Find a function definition by any means necessary (unless it is ambiguous)\n    #getFunction(key, values, forceUnique) {\n        // Selector\n        if (isHexString(key)) {\n            const selector = key.toLowerCase();\n            for (const fragment of this.#functions.values()) {\n                if (selector === fragment.selector) {\n                    return fragment;\n                }\n            }\n            return null;\n        }\n        // It is a bare name, look up the function (will return null if ambiguous)\n        if (key.indexOf(\"(\") === -1) {\n            const matching = [];\n            for (const [name, fragment] of this.#functions) {\n                if (name.split(\"(\" /* fix:) */)[0] === key) {\n                    matching.push(fragment);\n                }\n            }\n            if (values) {\n                const lastValue = (values.length > 0) ? values[values.length - 1] : null;\n                let valueLength = values.length;\n                let allowOptions = true;\n                if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n                    allowOptions = false;\n                    valueLength--;\n                }\n                // Remove all matches that don't have a compatible length. The args\n                // may contain an overrides, so the match may have n or n - 1 parameters\n                for (let i = matching.length - 1; i >= 0; i--) {\n                    const inputs = matching[i].inputs.length;\n                    if (inputs !== valueLength && (!allowOptions || inputs !== valueLength - 1)) {\n                        matching.splice(i, 1);\n                    }\n                }\n                // Remove all matches that don't match the Typed signature\n                for (let i = matching.length - 1; i >= 0; i--) {\n                    const inputs = matching[i].inputs;\n                    for (let j = 0; j < values.length; j++) {\n                        // Not a typed value\n                        if (!Typed.isTyped(values[j])) {\n                            continue;\n                        }\n                        // We are past the inputs\n                        if (j >= inputs.length) {\n                            if (values[j].type === \"overrides\") {\n                                continue;\n                            }\n                            matching.splice(i, 1);\n                            break;\n                        }\n                        // Make sure the value type matches the input type\n                        if (values[j].type !== inputs[j].baseType) {\n                            matching.splice(i, 1);\n                            break;\n                        }\n                    }\n                }\n            }\n            // We found a single matching signature with an overrides, but the\n            // last value is something that cannot possibly be an options\n            if (matching.length === 1 && values && values.length !== matching[0].inputs.length) {\n                const lastArg = values[values.length - 1];\n                if (lastArg == null || Array.isArray(lastArg) || typeof (lastArg) !== \"object\") {\n                    matching.splice(0, 1);\n                }\n            }\n            if (matching.length === 0) {\n                return null;\n            }\n            if (matching.length > 1 && forceUnique) {\n                const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n                assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n            }\n            return matching[0];\n        }\n        // Normalize the signature and lookup the function\n        const result = this.#functions.get(FunctionFragment.from(key).format());\n        if (result) {\n            return result;\n        }\n        return null;\n    }\n    /**\n     *  Get the function name for %%key%%, which may be a function selector,\n     *  function name or function signature that belongs to the ABI.\n     */\n    getFunctionName(key) {\n        const fragment = this.#getFunction(key, null, false);\n        assertArgument(fragment, \"no matching function\", \"key\", key);\n        return fragment.name;\n    }\n    /**\n     *  Returns true if %%key%% (a function selector, function name or\n     *  function signature) is present in the ABI.\n     *\n     *  In the case of a function name, the name may be ambiguous, so\n     *  accessing the [[FunctionFragment]] may require refinement.\n     */\n    hasFunction(key) {\n        return !!this.#getFunction(key, null, false);\n    }\n    /**\n     *  Get the [[FunctionFragment]] for %%key%%, which may be a function\n     *  selector, function name or function signature that belongs to the ABI.\n     *\n     *  If %%values%% is provided, it will use the Typed API to handle\n     *  ambiguous cases where multiple functions match by name.\n     *\n     *  If the %%key%% and %%values%% do not refine to a single function in\n     *  the ABI, this will throw.\n     */\n    getFunction(key, values) {\n        return this.#getFunction(key, values || null, true);\n    }\n    /**\n     *  Iterate over all functions, calling %%callback%%, sorted by their name.\n     */\n    forEachFunction(callback) {\n        const names = Array.from(this.#functions.keys());\n        names.sort((a, b) => a.localeCompare(b));\n        for (let i = 0; i < names.length; i++) {\n            const name = names[i];\n            callback((this.#functions.get(name)), i);\n        }\n    }\n    // Find an event definition by any means necessary (unless it is ambiguous)\n    #getEvent(key, values, forceUnique) {\n        // EventTopic\n        if (isHexString(key)) {\n            const eventTopic = key.toLowerCase();\n            for (const fragment of this.#events.values()) {\n                if (eventTopic === fragment.topicHash) {\n                    return fragment;\n                }\n            }\n            return null;\n        }\n        // It is a bare name, look up the function (will return null if ambiguous)\n        if (key.indexOf(\"(\") === -1) {\n            const matching = [];\n            for (const [name, fragment] of this.#events) {\n                if (name.split(\"(\" /* fix:) */)[0] === key) {\n                    matching.push(fragment);\n                }\n            }\n            if (values) {\n                // Remove all matches that don't have a compatible length.\n                for (let i = matching.length - 1; i >= 0; i--) {\n                    if (matching[i].inputs.length < values.length) {\n                        matching.splice(i, 1);\n                    }\n                }\n                // Remove all matches that don't match the Typed signature\n                for (let i = matching.length - 1; i >= 0; i--) {\n                    const inputs = matching[i].inputs;\n                    for (let j = 0; j < values.length; j++) {\n                        // Not a typed value\n                        if (!Typed.isTyped(values[j])) {\n                            continue;\n                        }\n                        // Make sure the value type matches the input type\n                        if (values[j].type !== inputs[j].baseType) {\n                            matching.splice(i, 1);\n                            break;\n                        }\n                    }\n                }\n            }\n            if (matching.length === 0) {\n                return null;\n            }\n            if (matching.length > 1 && forceUnique) {\n                const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n                assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n            }\n            return matching[0];\n        }\n        // Normalize the signature and lookup the function\n        const result = this.#events.get(EventFragment.from(key).format());\n        if (result) {\n            return result;\n        }\n        return null;\n    }\n    /**\n     *  Get the event name for %%key%%, which may be a topic hash,\n     *  event name or event signature that belongs to the ABI.\n     */\n    getEventName(key) {\n        const fragment = this.#getEvent(key, null, false);\n        assertArgument(fragment, \"no matching event\", \"key\", key);\n        return fragment.name;\n    }\n    /**\n     *  Returns true if %%key%% (an event topic hash, event name or\n     *  event signature) is present in the ABI.\n     *\n     *  In the case of an event name, the name may be ambiguous, so\n     *  accessing the [[EventFragment]] may require refinement.\n     */\n    hasEvent(key) {\n        return !!this.#getEvent(key, null, false);\n    }\n    /**\n     *  Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n     *  event name or event signature that belongs to the ABI.\n     *\n     *  If %%values%% is provided, it will use the Typed API to handle\n     *  ambiguous cases where multiple events match by name.\n     *\n     *  If the %%key%% and %%values%% do not refine to a single event in\n     *  the ABI, this will throw.\n     */\n    getEvent(key, values) {\n        return this.#getEvent(key, values || null, true);\n    }\n    /**\n     *  Iterate over all events, calling %%callback%%, sorted by their name.\n     */\n    forEachEvent(callback) {\n        const names = Array.from(this.#events.keys());\n        names.sort((a, b) => a.localeCompare(b));\n        for (let i = 0; i < names.length; i++) {\n            const name = names[i];\n            callback((this.#events.get(name)), i);\n        }\n    }\n    /**\n     *  Get the [[ErrorFragment]] for %%key%%, which may be an error\n     *  selector, error name or error signature that belongs to the ABI.\n     *\n     *  If %%values%% is provided, it will use the Typed API to handle\n     *  ambiguous cases where multiple errors match by name.\n     *\n     *  If the %%key%% and %%values%% do not refine to a single error in\n     *  the ABI, this will throw.\n     */\n    getError(key, values) {\n        if (isHexString(key)) {\n            const selector = key.toLowerCase();\n            if (BuiltinErrors[selector]) {\n                return ErrorFragment.from(BuiltinErrors[selector].signature);\n            }\n            for (const fragment of this.#errors.values()) {\n                if (selector === fragment.selector) {\n                    return fragment;\n                }\n            }\n            return null;\n        }\n        // It is a bare name, look up the function (will return null if ambiguous)\n        if (key.indexOf(\"(\") === -1) {\n            const matching = [];\n            for (const [name, fragment] of this.#errors) {\n                if (name.split(\"(\" /* fix:) */)[0] === key) {\n                    matching.push(fragment);\n                }\n            }\n            if (matching.length === 0) {\n                if (key === \"Error\") {\n                    return ErrorFragment.from(\"error Error(string)\");\n                }\n                if (key === \"Panic\") {\n                    return ErrorFragment.from(\"error Panic(uint256)\");\n                }\n                return null;\n            }\n            else if (matching.length > 1) {\n                const matchStr = matching.map((m) => JSON.stringify(m.format())).join(\", \");\n                assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n            }\n            return matching[0];\n        }\n        // Normalize the signature and lookup the function\n        key = ErrorFragment.from(key).format();\n        if (key === \"Error(string)\") {\n            return ErrorFragment.from(\"error Error(string)\");\n        }\n        if (key === \"Panic(uint256)\") {\n            return ErrorFragment.from(\"error Panic(uint256)\");\n        }\n        const result = this.#errors.get(key);\n        if (result) {\n            return result;\n        }\n        return null;\n    }\n    /**\n     *  Iterate over all errors, calling %%callback%%, sorted by their name.\n     */\n    forEachError(callback) {\n        const names = Array.from(this.#errors.keys());\n        names.sort((a, b) => a.localeCompare(b));\n        for (let i = 0; i < names.length; i++) {\n            const name = names[i];\n            callback((this.#errors.get(name)), i);\n        }\n    }\n    // Get the 4-byte selector used by Solidity to identify a function\n    /*\ngetSelector(fragment: ErrorFragment | FunctionFragment): string {\n    if (typeof(fragment) === \"string\") {\n        const matches: Array<Fragment> = [ ];\n\n        try { matches.push(this.getFunction(fragment)); } catch (error) { }\n        try { matches.push(this.getError(<string>fragment)); } catch (_) { }\n\n        if (matches.length === 0) {\n            logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n        } else if (matches.length > 1) {\n            logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n        }\n\n        fragment = matches[0];\n    }\n\n    return dataSlice(id(fragment.format()), 0, 4);\n}\n    */\n    // Get the 32-byte topic hash used by Solidity to identify an event\n    /*\n    getEventTopic(fragment: EventFragment): string {\n        //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n        return id(fragment.format());\n    }\n    */\n    _decodeParams(params, data) {\n        return this.#abiCoder.decode(params, data);\n    }\n    _encodeParams(params, values) {\n        return this.#abiCoder.encode(params, values);\n    }\n    /**\n     *  Encodes a ``tx.data`` object for deploying the Contract with\n     *  the %%values%% as the constructor arguments.\n     */\n    encodeDeploy(values) {\n        return this._encodeParams(this.deploy.inputs, values || []);\n    }\n    /**\n     *  Decodes the result %%data%% (e.g. from an ``eth_call``) for the\n     *  specified error (see [[getError]] for valid values for\n     *  %%key%%).\n     *\n     *  Most developers should prefer the [[parseCallResult]] method instead,\n     *  which will automatically detect a ``CALL_EXCEPTION`` and throw the\n     *  corresponding error.\n     */\n    decodeErrorResult(fragment, data) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getError(fragment);\n            assertArgument(f, \"unknown error\", \"fragment\", fragment);\n            fragment = f;\n        }\n        assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n        return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n    }\n    /**\n     *  Encodes the transaction revert data for a call result that\n     *  reverted from the the Contract with the sepcified %%error%%\n     *  (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n     *\n     *  This is generally not used by most developers, unless trying to mock\n     *  a result from a Contract.\n     */\n    encodeErrorResult(fragment, values) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getError(fragment);\n            assertArgument(f, \"unknown error\", \"fragment\", fragment);\n            fragment = f;\n        }\n        return concat([\n            fragment.selector,\n            this._encodeParams(fragment.inputs, values || [])\n        ]);\n    }\n    /**\n     *  Decodes the %%data%% from a transaction ``tx.data`` for\n     *  the function specified (see [[getFunction]] for valid values\n     *  for %%fragment%%).\n     *\n     *  Most developers should prefer the [[parseTransaction]] method\n     *  instead, which will automatically detect the fragment.\n     */\n    decodeFunctionData(fragment, data) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getFunction(fragment);\n            assertArgument(f, \"unknown function\", \"fragment\", fragment);\n            fragment = f;\n        }\n        assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n        return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n    }\n    /**\n     *  Encodes the ``tx.data`` for a transaction that calls the function\n     *  specified (see [[getFunction]] for valid values for %%fragment%%) with\n     *  the %%values%%.\n     */\n    encodeFunctionData(fragment, values) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getFunction(fragment);\n            assertArgument(f, \"unknown function\", \"fragment\", fragment);\n            fragment = f;\n        }\n        return concat([\n            fragment.selector,\n            this._encodeParams(fragment.inputs, values || [])\n        ]);\n    }\n    /**\n     *  Decodes the result %%data%% (e.g. from an ``eth_call``) for the\n     *  specified function (see [[getFunction]] for valid values for\n     *  %%key%%).\n     *\n     *  Most developers should prefer the [[parseCallResult]] method instead,\n     *  which will automatically detect a ``CALL_EXCEPTION`` and throw the\n     *  corresponding error.\n     */\n    decodeFunctionResult(fragment, data) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getFunction(fragment);\n            assertArgument(f, \"unknown function\", \"fragment\", fragment);\n            fragment = f;\n        }\n        let message = \"invalid length for result data\";\n        const bytes = getBytesCopy(data);\n        if ((bytes.length % 32) === 0) {\n            try {\n                return this.#abiCoder.decode(fragment.outputs, bytes);\n            }\n            catch (error) {\n                message = \"could not decode result data\";\n            }\n        }\n        // Call returned data with no error, but the data is junk\n        assert(false, message, \"BAD_DATA\", {\n            value: hexlify(bytes),\n            info: { method: fragment.name, signature: fragment.format() }\n        });\n    }\n    makeError(_data, tx) {\n        const data = getBytes(_data, \"data\");\n        const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n        // Not a built-in error; try finding a custom error\n        const customPrefix = \"execution reverted (unknown custom error)\";\n        if (error.message.startsWith(customPrefix)) {\n            const selector = hexlify(data.slice(0, 4));\n            const ef = this.getError(selector);\n            if (ef) {\n                try {\n                    const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n                    error.revert = {\n                        name: ef.name, signature: ef.format(), args\n                    };\n                    error.reason = error.revert.signature;\n                    error.message = `execution reverted: ${error.reason}`;\n                }\n                catch (e) {\n                    error.message = `execution reverted (coult not decode custom error)`;\n                }\n            }\n        }\n        // Add the invocation, if available\n        const parsed = this.parseTransaction(tx);\n        if (parsed) {\n            error.invocation = {\n                method: parsed.name,\n                signature: parsed.signature,\n                args: parsed.args\n            };\n        }\n        return error;\n    }\n    /**\n     *  Encodes the result data (e.g. from an ``eth_call``) for the\n     *  specified function (see [[getFunction]] for valid values\n     *  for %%fragment%%) with %%values%%.\n     *\n     *  This is generally not used by most developers, unless trying to mock\n     *  a result from a Contract.\n     */\n    encodeFunctionResult(fragment, values) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getFunction(fragment);\n            assertArgument(f, \"unknown function\", \"fragment\", fragment);\n            fragment = f;\n        }\n        return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n    }\n    /*\n        spelunk(inputs: Array<ParamType>, values: ReadonlyArray<any>, processfunc: (type: string, value: any) => Promise<any>): Promise<Array<any>> {\n            const promises: Array<Promise<>> = [ ];\n            const process = function(type: ParamType, value: any): any {\n                if (type.baseType === \"array\") {\n                    return descend(type.child\n                }\n                if (type. === \"address\") {\n                }\n            };\n    \n            const descend = function (inputs: Array<ParamType>, values: ReadonlyArray<any>) {\n                if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n                \n            };\n    \n            const result: Array<any> = [ ];\n            values.forEach((value, index) => {\n                if (value == null) {\n                    topics.push(null);\n                } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n                    logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n                } else if (Array.isArray(value)) {\n                    topics.push(value.map((value) => encodeTopic(param, value)));\n                } else {\n                    topics.push(encodeTopic(param, value));\n                }\n            });\n        }\n    */\n    // Create the filter for the event with search criteria (e.g. for eth_filterLog)\n    encodeFilterTopics(fragment, values) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getEvent(fragment);\n            assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n            fragment = f;\n        }\n        assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n        const topics = [];\n        if (!fragment.anonymous) {\n            topics.push(fragment.topicHash);\n        }\n        // @TODO: Use the coders for this; to properly support tuples, etc.\n        const encodeTopic = (param, value) => {\n            if (param.type === \"string\") {\n                return id(value);\n            }\n            else if (param.type === \"bytes\") {\n                return keccak256(hexlify(value));\n            }\n            if (param.type === \"bool\" && typeof (value) === \"boolean\") {\n                value = (value ? \"0x01\" : \"0x00\");\n            }\n            else if (param.type.match(/^u?int/)) {\n                value = toBeHex(value); // @TODO: Should this toTwos??\n            }\n            else if (param.type.match(/^bytes/)) {\n                value = zeroPadBytes(value, 32);\n            }\n            else if (param.type === \"address\") {\n                // Check addresses are valid\n                this.#abiCoder.encode([\"address\"], [value]);\n            }\n            return zeroPadValue(hexlify(value), 32);\n        };\n        values.forEach((value, index) => {\n            const param = fragment.inputs[index];\n            if (!param.indexed) {\n                assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", (\"contract.\" + param.name), value);\n                return;\n            }\n            if (value == null) {\n                topics.push(null);\n            }\n            else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n                assertArgument(false, \"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n            }\n            else if (Array.isArray(value)) {\n                topics.push(value.map((value) => encodeTopic(param, value)));\n            }\n            else {\n                topics.push(encodeTopic(param, value));\n            }\n        });\n        // Trim off trailing nulls\n        while (topics.length && topics[topics.length - 1] === null) {\n            topics.pop();\n        }\n        return topics;\n    }\n    encodeEventLog(fragment, values) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getEvent(fragment);\n            assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n            fragment = f;\n        }\n        const topics = [];\n        const dataTypes = [];\n        const dataValues = [];\n        if (!fragment.anonymous) {\n            topics.push(fragment.topicHash);\n        }\n        assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n        fragment.inputs.forEach((param, index) => {\n            const value = values[index];\n            if (param.indexed) {\n                if (param.type === \"string\") {\n                    topics.push(id(value));\n                }\n                else if (param.type === \"bytes\") {\n                    topics.push(keccak256(value));\n                }\n                else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n                    // @TODO\n                    throw new Error(\"not implemented\");\n                }\n                else {\n                    topics.push(this.#abiCoder.encode([param.type], [value]));\n                }\n            }\n            else {\n                dataTypes.push(param);\n                dataValues.push(value);\n            }\n        });\n        return {\n            data: this.#abiCoder.encode(dataTypes, dataValues),\n            topics: topics\n        };\n    }\n    // Decode a filter for the event and the search criteria\n    decodeEventLog(fragment, data, topics) {\n        if (typeof (fragment) === \"string\") {\n            const f = this.getEvent(fragment);\n            assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n            fragment = f;\n        }\n        if (topics != null && !fragment.anonymous) {\n            const eventTopic = fragment.topicHash;\n            assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n            topics = topics.slice(1);\n        }\n        const indexed = [];\n        const nonIndexed = [];\n        const dynamic = [];\n        fragment.inputs.forEach((param, index) => {\n            if (param.indexed) {\n                if (param.type === \"string\" || param.type === \"bytes\" || param.baseType === \"tuple\" || param.baseType === \"array\") {\n                    indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n                    dynamic.push(true);\n                }\n                else {\n                    indexed.push(param);\n                    dynamic.push(false);\n                }\n            }\n            else {\n                nonIndexed.push(param);\n                dynamic.push(false);\n            }\n        });\n        const resultIndexed = (topics != null) ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n        const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n        //const result: (Array<any> & { [ key: string ]: any }) = [ ];\n        const values = [];\n        const keys = [];\n        let nonIndexedIndex = 0, indexedIndex = 0;\n        fragment.inputs.forEach((param, index) => {\n            let value = null;\n            if (param.indexed) {\n                if (resultIndexed == null) {\n                    value = new Indexed(null);\n                }\n                else if (dynamic[index]) {\n                    value = new Indexed(resultIndexed[indexedIndex++]);\n                }\n                else {\n                    try {\n                        value = resultIndexed[indexedIndex++];\n                    }\n                    catch (error) {\n                        value = error;\n                    }\n                }\n            }\n            else {\n                try {\n                    value = resultNonIndexed[nonIndexedIndex++];\n                }\n                catch (error) {\n                    value = error;\n                }\n            }\n            values.push(value);\n            keys.push(param.name || null);\n        });\n        return Result.fromItems(values, keys);\n    }\n    /**\n     *  Parses a transaction, finding the matching function and extracts\n     *  the parameter values along with other useful function details.\n     *\n     *  If the matching function cannot be found, return null.\n     */\n    parseTransaction(tx) {\n        const data = getBytes(tx.data, \"tx.data\");\n        const value = getBigInt((tx.value != null) ? tx.value : 0, \"tx.value\");\n        const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n        if (!fragment) {\n            return null;\n        }\n        const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n        return new TransactionDescription(fragment, fragment.selector, args, value);\n    }\n    parseCallResult(data) {\n        throw new Error(\"@TODO\");\n    }\n    /**\n     *  Parses a receipt log, finding the matching event and extracts\n     *  the parameter values along with other useful event details.\n     *\n     *  If the matching event cannot be found, returns null.\n     */\n    parseLog(log) {\n        const fragment = this.getEvent(log.topics[0]);\n        if (!fragment || fragment.anonymous) {\n            return null;\n        }\n        // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n        //        Probably not, because just because it is the only event in the ABI does\n        //        not mean we have the full ABI; maybe just a fragment?\n        return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n    }\n    /**\n     *  Parses a revert data, finding the matching error and extracts\n     *  the parameter values along with other useful error details.\n     *\n     *  If the matching error cannot be found, returns null.\n     */\n    parseError(data) {\n        const hexData = hexlify(data);\n        const fragment = this.getError(dataSlice(hexData, 0, 4));\n        if (!fragment) {\n            return null;\n        }\n        const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n        return new ErrorDescription(fragment, fragment.selector, args);\n    }\n    /**\n     *  Creates a new [[Interface]] from the ABI %%value%%.\n     *\n     *  The %%value%% may be provided as an existing [[Interface]] object,\n     *  a JSON-encoded ABI or any Human-Readable ABI format.\n     */\n    static from(value) {\n        // Already an Interface, which is immutable\n        if (value instanceof Interface) {\n            return value;\n        }\n        // JSON\n        if (typeof (value) === \"string\") {\n            return new Interface(JSON.parse(value));\n        }\n        // An Interface; possibly from another v6 instance\n        if (typeof (value.formatJson) === \"function\") {\n            return new Interface(value.formatJson());\n        }\n        // A legacy Interface; from an older version\n        if (typeof (value.format) === \"function\") {\n            return new Interface(value.format(\"json\"));\n        }\n        // Array of fragments\n        return new Interface(value);\n    }\n}\n//# sourceMappingURL=interface.js.map/**\n *  A Typed object allows a value to have its type explicitly\n *  specified.\n *\n *  For example, in Solidity, the value ``45`` could represent a\n *  ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n *  a ``bytes2`` or ``bytes``.\n *\n *  Since JavaScript has no meaningful way to explicitly inform any\n *  APIs which what the type is, this allows transparent interoperation\n *  with Soldity.\n *\n *  @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n    let signed = false;\n    if (width < 0) {\n        signed = true;\n        width *= -1;\n    }\n    // @TODO: Check range is valid for value\n    return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, { signed, width });\n}\nfunction b(value, size) {\n    // @TODO: Check range is valid for value\n    return new Typed(_gaurd, `bytes${(size) ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_ethers_typed\");\n/**\n *  The **Typed** class to wrap values providing explicit type information.\n */\nexport class Typed {\n    /**\n     *  The type, as a Solidity-compatible type.\n     */\n    type;\n    /**\n     *  The actual value.\n     */\n    value;\n    #options;\n    /**\n     *  @_ignore:\n     */\n    _typedSymbol;\n    /**\n     *  @_ignore:\n     */\n    constructor(gaurd, type, value, options) {\n        if (options == null) {\n            options = null;\n        }\n        assertPrivate(_gaurd, gaurd, \"Typed\");\n        defineProperties(this, { _typedSymbol, type, value });\n        this.#options = options;\n        // Check the value is valid\n        this.format();\n    }\n    /**\n     *  Format the type as a Human-Readable type.\n     */\n    format() {\n        if (this.type === \"array\") {\n            throw new Error(\"\");\n        }\n        else if (this.type === \"dynamicArray\") {\n            throw new Error(\"\");\n        }\n        else if (this.type === \"tuple\") {\n            return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n        }\n        return this.type;\n    }\n    /**\n     *  The default value returned by this type.\n     */\n    defaultValue() {\n        return 0;\n    }\n    /**\n     *  The minimum value for numeric types.\n     */\n    minValue() {\n        return 0;\n    }\n    /**\n     *  The maximum value for numeric types.\n     */\n    maxValue() {\n        return 0;\n    }\n    /**\n     *  Returns ``true`` and provides a type guard is this is a [[TypedBigInt]].\n     */\n    isBigInt() {\n        return !!(this.type.match(/^u?int[0-9]+$/));\n    }\n    /**\n     *  Returns ``true`` and provides a type guard is this is a [[TypedData]].\n     */\n    isData() {\n        return this.type.startsWith(\"bytes\");\n    }\n    /**\n     *  Returns ``true`` and provides a type guard is this is a [[TypedString]].\n     */\n    isString() {\n        return (this.type === \"string\");\n    }\n    /**\n     *  Returns the tuple name, if this is a tuple. Throws otherwise.\n     */\n    get tupleName() {\n        if (this.type !== \"tuple\") {\n            throw TypeError(\"not a tuple\");\n        }\n        return this.#options;\n    }\n    // Returns the length of this type as an array\n    // - `null` indicates the length is unforced, it could be dynamic\n    // - `-1` indicates the length is dynamic\n    // - any other value indicates it is a static array and is its length\n    /**\n     *  Returns the length of the array type or ``-1`` if it is dynamic.\n     *\n     *  Throws if the type is not an array.\n     */\n    get arrayLength() {\n        if (this.type !== \"array\") {\n            throw TypeError(\"not an array\");\n        }\n        if (this.#options === true) {\n            return -1;\n        }\n        if (this.#options === false) {\n            return (this.value).length;\n        }\n        return null;\n    }\n    /**\n     *  Returns a new **Typed** of %%type%% with the %%value%%.\n     */\n    static from(type, value) {\n        return new Typed(_gaurd, type, value);\n    }\n    /**\n     *  Return a new ``uint8`` type for %%v%%.\n     */\n    static uint8(v) { return n(v, 8); }\n    /**\n     *  Return a new ``uint16`` type for %%v%%.\n     */\n    static uint16(v) { return n(v, 16); }\n    /**\n     *  Return a new ``uint24`` type for %%v%%.\n     */\n    static uint24(v) { return n(v, 24); }\n    /**\n     *  Return a new ``uint32`` type for %%v%%.\n     */\n    static uint32(v) { return n(v, 32); }\n    /**\n     *  Return a new ``uint40`` type for %%v%%.\n     */\n    static uint40(v) { return n(v, 40); }\n    /**\n     *  Return a new ``uint48`` type for %%v%%.\n     */\n    static uint48(v) { return n(v, 48); }\n    /**\n     *  Return a new ``uint56`` type for %%v%%.\n     */\n    static uint56(v) { return n(v, 56); }\n    /**\n     *  Return a new ``uint64`` type for %%v%%.\n     */\n    static uint64(v) { return n(v, 64); }\n    /**\n     *  Return a new ``uint72`` type for %%v%%.\n     */\n    static uint72(v) { return n(v, 72); }\n    /**\n     *  Return a new ``uint80`` type for %%v%%.\n     */\n    static uint80(v) { return n(v, 80); }\n    /**\n     *  Return a new ``uint88`` type for %%v%%.\n     */\n    static uint88(v) { return n(v, 88); }\n    /**\n     *  Return a new ``uint96`` type for %%v%%.\n     */\n    static uint96(v) { return n(v, 96); }\n    /**\n     *  Return a new ``uint104`` type for %%v%%.\n     */\n    static uint104(v) { return n(v, 104); }\n    /**\n     *  Return a new ``uint112`` type for %%v%%.\n     */\n    static uint112(v) { return n(v, 112); }\n    /**\n     *  Return a new ``uint120`` type for %%v%%.\n     */\n    static uint120(v) { return n(v, 120); }\n    /**\n     *  Return a new ``uint128`` type for %%v%%.\n     */\n    static uint128(v) { return n(v, 128); }\n    /**\n     *  Return a new ``uint136`` type for %%v%%.\n     */\n    static uint136(v) { return n(v, 136); }\n    /**\n     *  Return a new ``uint144`` type for %%v%%.\n     */\n    static uint144(v) { return n(v, 144); }\n    /**\n     *  Return a new ``uint152`` type for %%v%%.\n     */\n    static uint152(v) { return n(v, 152); }\n    /**\n     *  Return a new ``uint160`` type for %%v%%.\n     */\n    static uint160(v) { return n(v, 160); }\n    /**\n     *  Return a new ``uint168`` type for %%v%%.\n     */\n    static uint168(v) { return n(v, 168); }\n    /**\n     *  Return a new ``uint176`` type for %%v%%.\n     */\n    static uint176(v) { return n(v, 176); }\n    /**\n     *  Return a new ``uint184`` type for %%v%%.\n     */\n    static uint184(v) { return n(v, 184); }\n    /**\n     *  Return a new ``uint192`` type for %%v%%.\n     */\n    static uint192(v) { return n(v, 192); }\n    /**\n     *  Return a new ``uint200`` type for %%v%%.\n     */\n    static uint200(v) { return n(v, 200); }\n    /**\n     *  Return a new ``uint208`` type for %%v%%.\n     */\n    static uint208(v) { return n(v, 208); }\n    /**\n     *  Return a new ``uint216`` type for %%v%%.\n     */\n    static uint216(v) { return n(v, 216); }\n    /**\n     *  Return a new ``uint224`` type for %%v%%.\n     */\n    static uint224(v) { return n(v, 224); }\n    /**\n     *  Return a new ``uint232`` type for %%v%%.\n     */\n    static uint232(v) { return n(v, 232); }\n    /**\n     *  Return a new ``uint240`` type for %%v%%.\n     */\n    static uint240(v) { return n(v, 240); }\n    /**\n     *  Return a new ``uint248`` type for %%v%%.\n     */\n    static uint248(v) { return n(v, 248); }\n    /**\n     *  Return a new ``uint256`` type for %%v%%.\n     */\n    static uint256(v) { return n(v, 256); }\n    /**\n     *  Return a new ``uint256`` type for %%v%%.\n     */\n    static uint(v) { return n(v, 256); }\n    /**\n     *  Return a new ``int8`` type for %%v%%.\n     */\n    static int8(v) { return n(v, -8); }\n    /**\n     *  Return a new ``int16`` type for %%v%%.\n     */\n    static int16(v) { return n(v, -16); }\n    /**\n     *  Return a new ``int24`` type for %%v%%.\n     */\n    static int24(v) { return n(v, -24); }\n    /**\n     *  Return a new ``int32`` type for %%v%%.\n     */\n    static int32(v) { return n(v, -32); }\n    /**\n     *  Return a new ``int40`` type for %%v%%.\n     */\n    static int40(v) { return n(v, -40); }\n    /**\n     *  Return a new ``int48`` type for %%v%%.\n     */\n    static int48(v) { return n(v, -48); }\n    /**\n     *  Return a new ``int56`` type for %%v%%.\n     */\n    static int56(v) { return n(v, -56); }\n    /**\n     *  Return a new ``int64`` type for %%v%%.\n     */\n    static int64(v) { return n(v, -64); }\n    /**\n     *  Return a new ``int72`` type for %%v%%.\n     */\n    static int72(v) { return n(v, -72); }\n    /**\n     *  Return a new ``int80`` type for %%v%%.\n     */\n    static int80(v) { return n(v, -80); }\n    /**\n     *  Return a new ``int88`` type for %%v%%.\n     */\n    static int88(v) { return n(v, -88); }\n    /**\n     *  Return a new ``int96`` type for %%v%%.\n     */\n    static int96(v) { return n(v, -96); }\n    /**\n     *  Return a new ``int104`` type for %%v%%.\n     */\n    static int104(v) { return n(v, -104); }\n    /**\n     *  Return a new ``int112`` type for %%v%%.\n     */\n    static int112(v) { return n(v, -112); }\n    /**\n     *  Return a new ``int120`` type for %%v%%.\n     */\n    static int120(v) { return n(v, -120); }\n    /**\n     *  Return a new ``int128`` type for %%v%%.\n     */\n    static int128(v) { return n(v, -128); }\n    /**\n     *  Return a new ``int136`` type for %%v%%.\n     */\n    static int136(v) { return n(v, -136); }\n    /**\n     *  Return a new ``int144`` type for %%v%%.\n     */\n    static int144(v) { return n(v, -144); }\n    /**\n     *  Return a new ``int52`` type for %%v%%.\n     */\n    static int152(v) { return n(v, -152); }\n    /**\n     *  Return a new ``int160`` type for %%v%%.\n     */\n    static int160(v) { return n(v, -160); }\n    /**\n     *  Return a new ``int168`` type for %%v%%.\n     */\n    static int168(v) { return n(v, -168); }\n    /**\n     *  Return a new ``int176`` type for %%v%%.\n     */\n    static int176(v) { return n(v, -176); }\n    /**\n     *  Return a new ``int184`` type for %%v%%.\n     */\n    static int184(v) { return n(v, -184); }\n    /**\n     *  Return a new ``int92`` type for %%v%%.\n     */\n    static int192(v) { return n(v, -192); }\n    /**\n     *  Return a new ``int200`` type for %%v%%.\n     */\n    static int200(v) { return n(v, -200); }\n    /**\n     *  Return a new ``int208`` type for %%v%%.\n     */\n    static int208(v) { return n(v, -208); }\n    /**\n     *  Return a new ``int216`` type for %%v%%.\n     */\n    static int216(v) { return n(v, -216); }\n    /**\n     *  Return a new ``int224`` type for %%v%%.\n     */\n    static int224(v) { return n(v, -224); }\n    /**\n     *  Return a new ``int232`` type for %%v%%.\n     */\n    static int232(v) { return n(v, -232); }\n    /**\n     *  Return a new ``int240`` type for %%v%%.\n     */\n    static int240(v) { return n(v, -240); }\n    /**\n     *  Return a new ``int248`` type for %%v%%.\n     */\n    static int248(v) { return n(v, -248); }\n    /**\n     *  Return a new ``int256`` type for %%v%%.\n     */\n    static int256(v) { return n(v, -256); }\n    /**\n     *  Return a new ``int256`` type for %%v%%.\n     */\n    static int(v) { return n(v, -256); }\n    /**\n     *  Return a new ``bytes1`` type for %%v%%.\n     */\n    static bytes1(v) { return b(v, 1); }\n    /**\n     *  Return a new ``bytes2`` type for %%v%%.\n     */\n    static bytes2(v) { return b(v, 2); }\n    /**\n     *  Return a new ``bytes3`` type for %%v%%.\n     */\n    static bytes3(v) { return b(v, 3); }\n    /**\n     *  Return a new ``bytes4`` type for %%v%%.\n     */\n    static bytes4(v) { return b(v, 4); }\n    /**\n     *  Return a new ``bytes5`` type for %%v%%.\n     */\n    static bytes5(v) { return b(v, 5); }\n    /**\n     *  Return a new ``bytes6`` type for %%v%%.\n     */\n    static bytes6(v) { return b(v, 6); }\n    /**\n     *  Return a new ``bytes7`` type for %%v%%.\n     */\n    static bytes7(v) { return b(v, 7); }\n    /**\n     *  Return a new ``bytes8`` type for %%v%%.\n     */\n    static bytes8(v) { return b(v, 8); }\n    /**\n     *  Return a new ``bytes9`` type for %%v%%.\n     */\n    static bytes9(v) { return b(v, 9); }\n    /**\n     *  Return a new ``bytes10`` type for %%v%%.\n     */\n    static bytes10(v) { return b(v, 10); }\n    /**\n     *  Return a new ``bytes11`` type for %%v%%.\n     */\n    static bytes11(v) { return b(v, 11); }\n    /**\n     *  Return a new ``bytes12`` type for %%v%%.\n     */\n    static bytes12(v) { return b(v, 12); }\n    /**\n     *  Return a new ``bytes13`` type for %%v%%.\n     */\n    static bytes13(v) { return b(v, 13); }\n    /**\n     *  Return a new ``bytes14`` type for %%v%%.\n     */\n    static bytes14(v) { return b(v, 14); }\n    /**\n     *  Return a new ``bytes15`` type for %%v%%.\n     */\n    static bytes15(v) { return b(v, 15); }\n    /**\n     *  Return a new ``bytes16`` type for %%v%%.\n     */\n    static bytes16(v) { return b(v, 16); }\n    /**\n     *  Return a new ``bytes17`` type for %%v%%.\n     */\n    static bytes17(v) { return b(v, 17); }\n    /**\n     *  Return a new ``bytes18`` type for %%v%%.\n     */\n    static bytes18(v) { return b(v, 18); }\n    /**\n     *  Return a new ``bytes19`` type for %%v%%.\n     */\n    static bytes19(v) { return b(v, 19); }\n    /**\n     *  Return a new ``bytes20`` type for %%v%%.\n     */\n    static bytes20(v) { return b(v, 20); }\n    /**\n     *  Return a new ``bytes21`` type for %%v%%.\n     */\n    static bytes21(v) { return b(v, 21); }\n    /**\n     *  Return a new ``bytes22`` type for %%v%%.\n     */\n    static bytes22(v) { return b(v, 22); }\n    /**\n     *  Return a new ``bytes23`` type for %%v%%.\n     */\n    static bytes23(v) { return b(v, 23); }\n    /**\n     *  Return a new ``bytes24`` type for %%v%%.\n     */\n    static bytes24(v) { return b(v, 24); }\n    /**\n     *  Return a new ``bytes25`` type for %%v%%.\n     */\n    static bytes25(v) { return b(v, 25); }\n    /**\n     *  Return a new ``bytes26`` type for %%v%%.\n     */\n    static bytes26(v) { return b(v, 26); }\n    /**\n     *  Return a new ``bytes27`` type for %%v%%.\n     */\n    static bytes27(v) { return b(v, 27); }\n    /**\n     *  Return a new ``bytes28`` type for %%v%%.\n     */\n    static bytes28(v) { return b(v, 28); }\n    /**\n     *  Return a new ``bytes29`` type for %%v%%.\n     */\n    static bytes29(v) { return b(v, 29); }\n    /**\n     *  Return a new ``bytes30`` type for %%v%%.\n     */\n    static bytes30(v) { return b(v, 30); }\n    /**\n     *  Return a new ``bytes31`` type for %%v%%.\n     */\n    static bytes31(v) { return b(v, 31); }\n    /**\n     *  Return a new ``bytes32`` type for %%v%%.\n     */\n    static bytes32(v) { return b(v, 32); }\n    /**\n     *  Return a new ``address`` type for %%v%%.\n     */\n    static address(v) { return new Typed(_gaurd, \"address\", v); }\n    /**\n     *  Return a new ``bool`` type for %%v%%.\n     */\n    static bool(v) { return new Typed(_gaurd, \"bool\", !!v); }\n    /**\n     *  Return a new ``bytes`` type for %%v%%.\n     */\n    static bytes(v) { return new Typed(_gaurd, \"bytes\", v); }\n    /**\n     *  Return a new ``string`` type for %%v%%.\n     */\n    static string(v) { return new Typed(_gaurd, \"string\", v); }\n    /**\n     *  Return a new ``array`` type for %%v%%, allowing %%dynamic%% length.\n     */\n    static array(v, dynamic) {\n        throw new Error(\"not implemented yet\");\n        return new Typed(_gaurd, \"array\", v, dynamic);\n    }\n    /**\n     *  Return a new ``tuple`` type for %%v%%, with the optional %%name%%.\n     */\n    static tuple(v, name) {\n        throw new Error(\"not implemented yet\");\n        return new Typed(_gaurd, \"tuple\", v, name);\n    }\n    /**\n     *  Return a new ``uint8`` type for %%v%%.\n     */\n    static overrides(v) {\n        return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n    }\n    /**\n     *  Returns true only if %%value%% is a [[Typed]] instance.\n     */\n    static isTyped(value) {\n        return (value\n            && typeof (value) === \"object\"\n            && \"_typedSymbol\" in value\n            && value._typedSymbol === _typedSymbol);\n    }\n    /**\n     *  If the value is a [[Typed]] instance, validates the underlying value\n     *  and returns it, otherwise returns value directly.\n     *\n     *  This is useful for functions that with to accept either a [[Typed]]\n     *  object or values.\n     */\n    static dereference(value, type) {\n        if (Typed.isTyped(value)) {\n            if (value.type !== type) {\n                throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n            }\n            return value.value;\n        }\n        return value;\n    }\n}\n//# sourceMappingURL=typed.js.mapimport { keccak256 } from \"../crypto/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\nconst BN_36 = BigInt(36);\nfunction getChecksumAddress(address) {\n    //    if (!isHexString(address, 20)) {\n    //        logger.throwArgumentError(\"invalid address\", \"address\", address);\n    //    }\n    address = address.toLowerCase();\n    const chars = address.substring(2).split(\"\");\n    const expanded = new Uint8Array(40);\n    for (let i = 0; i < 40; i++) {\n        expanded[i] = chars[i].charCodeAt(0);\n    }\n    const hashed = getBytes(keccak256(expanded));\n    for (let i = 0; i < 40; i += 2) {\n        if ((hashed[i >> 1] >> 4) >= 8) {\n            chars[i] = chars[i].toUpperCase();\n        }\n        if ((hashed[i >> 1] & 0x0f) >= 8) {\n            chars[i + 1] = chars[i + 1].toUpperCase();\n        }\n    }\n    return \"0x\" + chars.join(\"\");\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n    ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n    ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n    address = address.toUpperCase();\n    address = address.substring(4) + address.substring(0, 2) + \"00\";\n    let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n    // Javascript can handle integers safely up to 15 (decimal) digits\n    while (expanded.length >= safeDigits) {\n        let block = expanded.substring(0, safeDigits);\n        expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);\n    }\n    let checksum = String(98 - (parseInt(expanded, 10) % 97));\n    while (checksum.length < 2) {\n        checksum = \"0\" + checksum;\n    }\n    return checksum;\n}\n;\nconst Base36 = (function () {\n    ;\n    const result = {};\n    for (let i = 0; i < 36; i++) {\n        const key = \"0123456789abcdefghijklmnopqrstuvwxyz\"[i];\n        result[key] = BigInt(i);\n    }\n    return result;\n})();\nfunction fromBase36(value) {\n    value = value.toLowerCase();\n    let result = BN_0;\n    for (let i = 0; i < value.length; i++) {\n        result = result * BN_36 + Base36[value[i]];\n    }\n    return result;\n}\n/**\n *  Returns a normalized and checksumed address for %%address%%.\n *  This accepts non-checksum addresses, checksum addresses and\n *  [[getIcapAddress]] formats.\n *\n *  The checksum in Ethereum uses the capitalization (upper-case\n *  vs lower-case) of the characters within an address to encode\n *  its checksum, which offers, on average, a checksum of 15-bits.\n *\n *  If %%address%% contains both upper-case and lower-case, it is\n *  assumed to already be a checksum address and its checksum is\n *  validated, and if the address fails its expected checksum an\n *  error is thrown.\n *\n *  If you wish the checksum of %%address%% to be ignore, it should\n *  be converted to lower-case (i.e. ``.toLowercase()``) before\n *  being passed in. This should be a very rare situation though,\n *  that you wish to bypass the safegaurds in place to protect\n *  against an address that has been incorrectly copied from another\n *  source.\n *\n *  @example:\n *    // Adds the checksum (via upper-casing specific letters)\n *    getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n *    //_result:\n *\n *    // Converts ICAP address and adds checksum\n *    getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n *    //_result:\n *\n *    // Throws an error if an address contains mixed case,\n *    // but the checksum fails\n *    getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n *    //_error:\n */\nexport function getAddress(address) {\n    assertArgument(typeof (address) === \"string\", \"invalid address\", \"address\", address);\n    if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n        // Missing the 0x prefix\n        if (!address.startsWith(\"0x\")) {\n            address = \"0x\" + address;\n        }\n        const result = getChecksumAddress(address);\n        // It is a checksummed address with a bad checksum\n        assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, \"bad address checksum\", \"address\", address);\n        return result;\n    }\n    // Maybe ICAP? (we only support direct mode)\n    if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n        // It is an ICAP address with a bad checksum\n        assertArgument(address.substring(2, 4) === ibanChecksum(address), \"bad icap checksum\", \"address\", address);\n        let result = fromBase36(address.substring(4)).toString(16);\n        while (result.length < 40) {\n            result = \"0\" + result;\n        }\n        return getChecksumAddress(\"0x\" + result);\n    }\n    assertArgument(false, \"invalid address\", \"address\", address);\n}\n/**\n *  The [ICAP Address format](link-icap) format is an early checksum\n *  format which attempts to be compatible with the banking\n *  industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n *  It is no longer common or a recommended format.\n *\n *  @example:\n *    getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n *    //_result:\n *\n *    getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n *    //_result:\n *\n *    // Throws an error if the ICAP checksum is wrong\n *    getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n *    //_error:\n */\nexport function getIcapAddress(address) {\n    //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n    let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n    while (base36.length < 30) {\n        base36 = \"0\" + base36;\n    }\n    return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n//# sourceMappingURL=address.js.mapimport { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./address.js\";\n/**\n *  Returns true if %%value%% is an object which implements the\n *  [[Addressable]] interface.\n *\n *  @example:\n *    // Wallets and AbstractSigner sub-classes\n *    isAddressable(Wallet.createRandom())\n *    //_result:\n *\n *    // Contracts\n *    contract = new Contract(\"dai.tokens.ethers.eth\", [ ], provider)\n *    isAddressable(contract)\n *    //_result:\n */\nexport function isAddressable(value) {\n    return (value && typeof (value.getAddress) === \"function\");\n}\n/**\n *  Returns true if %%value%% is a valid address.\n *\n *  @example:\n *    // Valid address\n *    isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n *    //_result:\n *\n *    // Valid ICAP address\n *    isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n *    //_result:\n *\n *    // Invalid checksum\n *    isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n *    //_result:\n *\n *    // Invalid ICAP checksum\n *    isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n *    //_result:\n *\n *    // Not an address (an ENS name requires a provided and an\n *    // asynchronous API to access)\n *    isAddress(\"ricmoo.eth\")\n *    //_result:\n */\nexport function isAddress(value) {\n    try {\n        getAddress(value);\n        return true;\n    }\n    catch (error) { }\n    return false;\n}\nasync function checkAddress(target, promise) {\n    const result = await promise;\n    if (result == null || result === \"0x0000000000000000000000000000000000000000\") {\n        assert(typeof (target) !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n        assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n    }\n    return getAddress(result);\n}\n/**\n *  Resolves to an address for the %%target%%, which may be any\n *  supported address type, an [[Addressable]] or a Promise which\n *  resolves to an address.\n *\n *  If an ENS name is provided, but that name has not been correctly\n *  configured a [[UnconfiguredNameError]] is thrown.\n *\n *  @example:\n *    addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n *    // Addresses are return synchronously\n *    resolveAddress(addr, provider)\n *    //_result:\n *\n *    // Address promises are resolved asynchronously\n *    resolveAddress(Promise.resolve(addr))\n *    //_result:\n *\n *    // ENS names are resolved asynchronously\n *    resolveAddress(\"dai.tokens.ethers.eth\", provider)\n *    //_result:\n *\n *    // Addressable objects are resolved asynchronously\n *    contract = new Contract(addr, [ ])\n *    resolveAddress(contract, provider)\n *    //_result:\n *\n *    // Unconfigured ENS names reject\n *    resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n *    //_error:\n *\n *    // ENS names require a NameResolver object passed in\n *    // (notice the provider was omitted)\n *    resolveAddress(\"nothing-here.ricmoo.eth\")\n *    //_error:\n */\nexport function resolveAddress(target, resolver) {\n    if (typeof (target) === \"string\") {\n        if (target.match(/^0x[0-9a-f]{40}$/i)) {\n            return getAddress(target);\n        }\n        assert(resolver != null, \"ENS resolution requires a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n        return checkAddress(target, resolver.resolveName(target));\n    }\n    else if (isAddressable(target)) {\n        return checkAddress(target, target.getAddress());\n    }\n    else if (target && typeof (target.then) === \"function\") {\n        return checkAddress(target, target);\n    }\n    assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.mapimport { keccak256 } from \"../crypto/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, encodeRlp, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./address.js\";\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\n/**\n *  Returns the address that would result from a ``CREATE`` for %%tx%%.\n *\n *  This can be used to compute the address a contract will be\n *  deployed to by an EOA when sending a deployment transaction (i.e.\n *  when the ``to`` address is ``null``).\n *\n *  This can also be used to compute the address a contract will be\n *  deployed to by a contract, by using the contract's address as the\n *  ``to`` and the contract's nonce.\n *\n *  @example\n *    from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\";\n *    nonce = 5;\n *\n *    getCreateAddress({ from, nonce });\n *    //_result:\n */\nexport function getCreateAddress(tx) {\n    const from = getAddress(tx.from);\n    const nonce = getBigInt(tx.nonce, \"tx.nonce\");\n    let nonceHex = nonce.toString(16);\n    if (nonceHex === \"0\") {\n        nonceHex = \"0x\";\n    }\n    else if (nonceHex.length % 2) {\n        nonceHex = \"0x0\" + nonceHex;\n    }\n    else {\n        nonceHex = \"0x\" + nonceHex;\n    }\n    return getAddress(dataSlice(keccak256(encodeRlp([from, nonceHex])), 12));\n}\n/**\n *  Returns the address that would result from a ``CREATE2`` operation\n *  with the given %%from%%, %%salt%% and %%initCodeHash%%.\n *\n *  To compute the %%initCodeHash%% from a contract's init code, use\n *  the [[keccak256]] function.\n *\n *  For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]].\n *\n *  @example\n *    // The address of the contract\n *    from = \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\"\n *\n *    // The salt\n *    salt = id(\"HelloWorld\")\n *\n *    // The hash of the initCode\n *    initCode = \"0x6394198df16000526103ff60206004601c335afa6040516060f3\";\n *    initCodeHash = keccak256(initCode)\n *\n *    getCreate2Address(from, salt, initCodeHash)\n *    //_result:\n */\nexport function getCreate2Address(_from, _salt, _initCodeHash) {\n    const from = getAddress(_from);\n    const salt = getBytes(_salt, \"salt\");\n    const initCodeHash = getBytes(_initCodeHash, \"initCodeHash\");\n    assertArgument(salt.length === 32, \"salt must be 32 bytes\", \"salt\", _salt);\n    assertArgument(initCodeHash.length === 32, \"initCodeHash must be 32 bytes\", \"initCodeHash\", _initCodeHash);\n    return getAddress(dataSlice(keccak256(concat([\"0xff\", from, salt, initCodeHash])), 12));\n}\n//# sourceMappingURL=contract-address.js.map/**\n *  Addresses are a fundamental part of interacting with Ethereum. They\n *  represent the global identity of Externally Owned Accounts (accounts\n *  backed by a private key) and contracts.\n *\n *  The Ethereum Naming Service (ENS) provides an interconnected ecosystem\n *  of contracts, standards and libraries which enable looking up an\n *  address for an ENS name.\n *\n *  These functions help convert between various formats, validate\n *  addresses and safely resolve ENS names.\n *\n *  @_section: api/address:Addresses  [about-addresses]\n */\nnull;\nexport { getAddress, getIcapAddress } from \"./address.js\";\nexport { getCreateAddress, getCreate2Address } from \"./contract-address.js\";\nexport { isAddressable, isAddress, resolveAddress } from \"./checks.js\";\n//# sourceMappingURL=index.js.map/**\n *  A constant for the zero address.\n *\n *  (**i.e.** ``\"0x0000000000000000000000000000000000000000\"``)\n */\nexport const ZeroAddress = \"0x0000000000000000000000000000000000000000\";\n//# sourceMappingURL=addresses.js.map/**\n *  A constant for the zero hash.\n *\n *  (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map/**\n *  Some common constants useful for Ethereum.\n *\n *  @_section: api/constants: Constants  [about-constants]\n */\nexport { ZeroAddress } from \"./addresses.js\";\nexport { ZeroHash } from \"./hashes.js\";\nexport { N, WeiPerEther, MaxUint256, MinInt256, MaxInt256 } from \"./numbers.js\";\nexport { EtherSymbol, MessagePrefix } from \"./strings.js\";\n//# sourceMappingURL=index.js.map/**\n *  A constant for the order N for the secp256k1 curve.\n *\n *  (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n *  A constant for the number of wei in a single ether.\n *\n *  (**i.e.** ``1000000000000000000n``)\n */\nexport const WeiPerEther = BigInt(\"1000000000000000000\");\n/**\n *  A constant for the maximum value for a ``uint256``.\n *\n *  (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n *  A constant for the minimum value for an ``int256``.\n *\n *  (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") * BigInt(-1);\n/**\n *  A constant for the maximum value for an ``int256``.\n *\n *  (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n//# sourceMappingURL=numbers.js.map// NFKC (composed)             // (decomposed)\n/**\n *  A constant for the ether symbol (normalized using NFKC).\n *\n *  (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const EtherSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n *  A constant for the [[link-eip-191]] personal message prefix.\n *\n *  (**i.e.** ``\"\\\\x19Ethereum Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Ethereum Signed Message:\\n\";\n//# sourceMappingURL=strings.js.mapimport { Interface, Typed } from \"../abi/index.js\";\nimport { isAddressable, resolveAddress } from \"../address/index.js\";\n// import from provider.ts instead of index.ts to prevent circular dep\n// from EtherscanProvider\nimport { copyRequest, Log } from \"../providers/provider.js\";\nimport { defineProperties, getBigInt, isCallException, isHexString, resolveProperties, isError, makeError, assert, assertArgument } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, UndecodedEventLog } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n    return (value && typeof (value.call) === \"function\");\n}\nfunction canEstimate(value) {\n    return (value && typeof (value.estimateGas) === \"function\");\n}\nfunction canResolve(value) {\n    return (value && typeof (value.resolveName) === \"function\");\n}\nfunction canSend(value) {\n    return (value && typeof (value.sendTransaction) === \"function\");\n}\nfunction getResolver(value) {\n    if (value != null) {\n        if (canResolve(value)) {\n            return value;\n        }\n        if (value.provider) {\n            return value.provider;\n        }\n    }\n    return undefined;\n}\nclass PreparedTopicFilter {\n    #filter;\n    fragment;\n    constructor(contract, fragment, args) {\n        defineProperties(this, { fragment });\n        if (fragment.inputs.length < args.length) {\n            throw new Error(\"too many arguments\");\n        }\n        // Recursively descend into args and resolve any addresses\n        const runner = getRunner(contract.runner, \"resolveName\");\n        const resolver = canResolve(runner) ? runner : null;\n        this.#filter = (async function () {\n            const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n                const arg = args[index];\n                if (arg == null) {\n                    return null;\n                }\n                return param.walkAsync(args[index], (type, value) => {\n                    if (type === \"address\") {\n                        if (Array.isArray(value)) {\n                            return Promise.all(value.map((v) => resolveAddress(v, resolver)));\n                        }\n                        return resolveAddress(value, resolver);\n                    }\n                    return value;\n                });\n            }));\n            return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n        })();\n    }\n    getTopicFilter() {\n        return this.#filter;\n    }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n//     the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n//     TransactionResponse otherwise)\n//export interface ContractMethod<A extends Array<any> = Array<any>, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n    if (value == null) {\n        return null;\n    }\n    if (typeof (value[feature]) === \"function\") {\n        return value;\n    }\n    if (value.provider && typeof (value.provider[feature]) === \"function\") {\n        return value.provider;\n    }\n    return null;\n}\nfunction getProvider(value) {\n    if (value == null) {\n        return null;\n    }\n    return value.provider || null;\n}\n/**\n *  @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n    // Make sure the overrides passed in are a valid overrides object\n    const _overrides = Typed.dereference(arg, \"overrides\");\n    assertArgument(typeof (_overrides) === \"object\", \"invalid overrides parameter\", \"overrides\", arg);\n    // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n    const overrides = copyRequest(_overrides);\n    assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n    assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n    // Resolve any from\n    if (overrides.from) {\n        overrides.from = overrides.from;\n    }\n    return overrides;\n}\n/**\n *  @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n    // Recursively descend into args and resolve any addresses\n    const runner = getRunner(_runner, \"resolveName\");\n    const resolver = canResolve(runner) ? runner : null;\n    return await Promise.all(inputs.map((param, index) => {\n        return param.walkAsync(args[index], (type, value) => {\n            value = Typed.dereference(value, type);\n            if (type === \"address\") {\n                return resolveAddress(value, resolver);\n            }\n            return value;\n        });\n    }));\n}\nfunction buildWrappedFallback(contract) {\n    const populateTransaction = async function (overrides) {\n        // If an overrides was passed in, copy it and normalize the values\n        const tx = (await copyOverrides(overrides, [\"data\"]));\n        tx.to = await contract.getAddress();\n        if (tx.from) {\n            tx.from = await resolveAddress(tx.from, getResolver(contract.runner));\n        }\n        const iface = contract.interface;\n        const noValue = (getBigInt((tx.value || BN_0), \"overrides.value\") === BN_0);\n        const noData = ((tx.data || \"0x\") === \"0x\");\n        if (iface.fallback && !iface.fallback.payable && iface.receive && !noData && !noValue) {\n            assertArgument(false, \"cannot send data to receive or send value to non-payable fallback\", \"overrides\", overrides);\n        }\n        assertArgument(iface.fallback || noData, \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n        // Only allow payable contracts to set non-zero value\n        const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n        assertArgument(payable || noValue, \"cannot send value to non-payable fallback\", \"overrides.value\", tx.value);\n        // Only allow fallback contracts to set non-empty data\n        assertArgument(iface.fallback || noData, \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n        return tx;\n    };\n    const staticCall = async function (overrides) {\n        const runner = getRunner(contract.runner, \"call\");\n        assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n        const tx = await populateTransaction(overrides);\n        try {\n            return await runner.call(tx);\n        }\n        catch (error) {\n            if (isCallException(error) && error.data) {\n                throw contract.interface.makeError(error.data, tx);\n            }\n            throw error;\n        }\n    };\n    const send = async function (overrides) {\n        const runner = contract.runner;\n        assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n        const tx = await runner.sendTransaction(await populateTransaction(overrides));\n        const provider = getProvider(contract.runner);\n        // @TODO: the provider can be null; make a custom dummy provider that will throw a\n        // meaningful error\n        return new ContractTransactionResponse(contract.interface, provider, tx);\n    };\n    const estimateGas = async function (overrides) {\n        const runner = getRunner(contract.runner, \"estimateGas\");\n        assert(canEstimate(runner), \"contract runner does not support gas estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateGas\" });\n        return await runner.estimateGas(await populateTransaction(overrides));\n    };\n    const method = async (overrides) => {\n        return await send(overrides);\n    };\n    defineProperties(method, {\n        _contract: contract,\n        estimateGas,\n        populateTransaction,\n        send, staticCall\n    });\n    return method;\n}\nfunction buildWrappedMethod(contract, key) {\n    const getFragment = function (...args) {\n        const fragment = contract.interface.getFunction(key, args);\n        assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"fragment\",\n            info: { key, args }\n        });\n        return fragment;\n    };\n    const populateTransaction = async function (...args) {\n        const fragment = getFragment(...args);\n        // If an overrides was passed in, copy it and normalize the values\n        let overrides = {};\n        if (fragment.inputs.length + 1 === args.length) {\n            overrides = await copyOverrides(args.pop());\n            if (overrides.from) {\n                overrides.from = await resolveAddress(overrides.from, getResolver(contract.runner));\n            }\n        }\n        if (fragment.inputs.length !== args.length) {\n            throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n        }\n        const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n        return Object.assign({}, overrides, await resolveProperties({\n            to: contract.getAddress(),\n            data: contract.interface.encodeFunctionData(fragment, resolvedArgs)\n        }));\n    };\n    const staticCall = async function (...args) {\n        const result = await staticCallResult(...args);\n        if (result.length === 1) {\n            return result[0];\n        }\n        return result;\n    };\n    const send = async function (...args) {\n        const runner = contract.runner;\n        assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n        const tx = await runner.sendTransaction(await populateTransaction(...args));\n        const provider = getProvider(contract.runner);\n        // @TODO: the provider can be null; make a custom dummy provider that will throw a\n        // meaningful error\n        return new ContractTransactionResponse(contract.interface, provider, tx);\n    };\n    const estimateGas = async function (...args) {\n        const runner = getRunner(contract.runner, \"estimateGas\");\n        assert(canEstimate(runner), \"contract runner does not support gas estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateGas\" });\n        return await runner.estimateGas(await populateTransaction(...args));\n    };\n    const staticCallResult = async function (...args) {\n        const runner = getRunner(contract.runner, \"call\");\n        assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n        const tx = await populateTransaction(...args);\n        let result = \"0x\";\n        try {\n            result = await runner.call(tx);\n        }\n        catch (error) {\n            if (isCallException(error) && error.data) {\n                throw contract.interface.makeError(error.data, tx);\n            }\n            throw error;\n        }\n        const fragment = getFragment(...args);\n        return contract.interface.decodeFunctionResult(fragment, result);\n    };\n    const method = async (...args) => {\n        const fragment = getFragment(...args);\n        if (fragment.constant) {\n            return await staticCall(...args);\n        }\n        return await send(...args);\n    };\n    defineProperties(method, {\n        name: contract.interface.getFunctionName(key),\n        _contract: contract, _key: key,\n        getFragment,\n        estimateGas,\n        populateTransaction,\n        send, staticCall, staticCallResult,\n    });\n    // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n    Object.defineProperty(method, \"fragment\", {\n        configurable: false,\n        enumerable: true,\n        get: () => {\n            const fragment = contract.interface.getFunction(key);\n            assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n                operation: \"fragment\",\n                info: { key }\n            });\n            return fragment;\n        }\n    });\n    return method;\n}\nfunction buildWrappedEvent(contract, key) {\n    const getFragment = function (...args) {\n        const fragment = contract.interface.getEvent(key, args);\n        assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"fragment\",\n            info: { key, args }\n        });\n        return fragment;\n    };\n    const method = function (...args) {\n        return new PreparedTopicFilter(contract, getFragment(...args), args);\n    };\n    defineProperties(method, {\n        name: contract.interface.getEventName(key),\n        _contract: contract, _key: key,\n        getFragment\n    });\n    // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n    Object.defineProperty(method, \"fragment\", {\n        configurable: false,\n        enumerable: true,\n        get: () => {\n            const fragment = contract.interface.getEvent(key);\n            assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n                operation: \"fragment\",\n                info: { key }\n            });\n            return fragment;\n        }\n    });\n    return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_ethersInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n    internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n    return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n    return (value && typeof (value) === \"object\" && (\"getTopicFilter\" in value) &&\n        (typeof (value.getTopicFilter) === \"function\") && value.fragment);\n}\nasync function getSubInfo(contract, event) {\n    let topics;\n    let fragment = null;\n    // Convert named events to topicHash and get the fragment for\n    // events which need deconstructing.\n    if (Array.isArray(event)) {\n        const topicHashify = function (name) {\n            if (isHexString(name, 32)) {\n                return name;\n            }\n            const fragment = contract.interface.getEvent(name);\n            assertArgument(fragment, \"unknown fragment\", \"name\", name);\n            return fragment.topicHash;\n        };\n        // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n        topics = event.map((e) => {\n            if (e == null) {\n                return null;\n            }\n            if (Array.isArray(e)) {\n                return e.map(topicHashify);\n            }\n            return topicHashify(e);\n        });\n    }\n    else if (event === \"*\") {\n        topics = [null];\n    }\n    else if (typeof (event) === \"string\") {\n        if (isHexString(event, 32)) {\n            // Topic Hash\n            topics = [event];\n        }\n        else {\n            // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n            fragment = contract.interface.getEvent(event);\n            assertArgument(fragment, \"unknown fragment\", \"event\", event);\n            topics = [fragment.topicHash];\n        }\n    }\n    else if (isDeferred(event)) {\n        // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n        topics = await event.getTopicFilter();\n    }\n    else if (\"fragment\" in event) {\n        // ContractEvent; e.g. `contract.filter.Transfer`\n        fragment = event.fragment;\n        topics = [fragment.topicHash];\n    }\n    else {\n        assertArgument(false, \"unknown event name\", \"event\", event);\n    }\n    // Normalize topics and sort TopicSets\n    topics = topics.map((t) => {\n        if (t == null) {\n            return null;\n        }\n        if (Array.isArray(t)) {\n            const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n            if (items.length === 1) {\n                return items[0];\n            }\n            items.sort();\n            return items;\n        }\n        return t.toLowerCase();\n    });\n    const tag = topics.map((t) => {\n        if (t == null) {\n            return \"null\";\n        }\n        if (Array.isArray(t)) {\n            return t.join(\"|\");\n        }\n        return t;\n    }).join(\"&\");\n    return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n    const { subs } = getInternal(contract);\n    return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n    // Make sure our runner can actually subscribe to events\n    const provider = getProvider(contract.runner);\n    assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n    const { fragment, tag, topics } = await getSubInfo(contract, event);\n    const { addr, subs } = getInternal(contract);\n    let sub = subs.get(tag);\n    if (!sub) {\n        const address = (addr ? addr : contract);\n        const filter = { address, topics };\n        const listener = (log) => {\n            let foundFragment = fragment;\n            if (foundFragment == null) {\n                try {\n                    foundFragment = contract.interface.getEvent(log.topics[0]);\n                }\n                catch (error) { }\n            }\n            // If fragment is null, we do not deconstruct the args to emit\n            if (foundFragment) {\n                const _foundFragment = foundFragment;\n                const args = fragment ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : [];\n                emit(contract, event, args, (listener) => {\n                    return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n                });\n            }\n            else {\n                emit(contract, event, [], (listener) => {\n                    return new ContractUnknownEventPayload(contract, listener, event, log);\n                });\n            }\n        };\n        let starting = [];\n        const start = () => {\n            if (starting.length) {\n                return;\n            }\n            starting.push(provider.on(filter, listener));\n        };\n        const stop = async () => {\n            if (starting.length == 0) {\n                return;\n            }\n            let started = starting;\n            starting = [];\n            await Promise.all(started);\n            provider.off(filter, listener);\n        };\n        sub = { tag, listeners: [], start, stop };\n        subs.set(tag, sub);\n    }\n    return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n    await lastEmit;\n    const sub = await hasSub(contract, event);\n    if (!sub) {\n        return false;\n    }\n    const count = sub.listeners.length;\n    sub.listeners = sub.listeners.filter(({ listener, once }) => {\n        const passArgs = Array.from(args);\n        if (payloadFunc) {\n            passArgs.push(payloadFunc(once ? null : listener));\n        }\n        try {\n            listener.call(contract, ...passArgs);\n        }\n        catch (error) { }\n        return !once;\n    });\n    if (sub.listeners.length === 0) {\n        sub.stop();\n        getInternal(contract).subs.delete(sub.tag);\n    }\n    return (count > 0);\n}\nasync function emit(contract, event, args, payloadFunc) {\n    try {\n        await lastEmit;\n    }\n    catch (error) { }\n    const resultPromise = _emit(contract, event, args, payloadFunc);\n    lastEmit = resultPromise;\n    return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n    /**\n     *  The target to connect to.\n     *\n     *  This can be an address, ENS name or any [[Addressable]], such as\n     *  another contract. To get the resovled address, use the ``getAddress``\n     *  method.\n     */\n    target;\n    /**\n     *  The contract Interface.\n     */\n    interface;\n    /**\n     *  The connected runner. This is generally a [[Provider]] or a\n     *  [[Signer]], which dictates what operations are supported.\n     *\n     *  For example, a **Contract** connected to a [[Provider]] may\n     *  only execute read-only operations.\n     */\n    runner;\n    /**\n     *  All the Events available on this contract.\n     */\n    filters;\n    /**\n     *  @_ignore:\n     */\n    [internal];\n    /**\n     *  The fallback or receive function if any.\n     */\n    fallback;\n    /**\n     *  Creates a new contract connected to %%target%% with the %%abi%% and\n     *  optionally connected to a %%runner%% to perform operations on behalf\n     *  of.\n     */\n    constructor(target, abi, runner, _deployTx) {\n        assertArgument(typeof (target) === \"string\" || isAddressable(target), \"invalid value for Contract target\", \"target\", target);\n        if (runner == null) {\n            runner = null;\n        }\n        const iface = Interface.from(abi);\n        defineProperties(this, { target, runner, interface: iface });\n        Object.defineProperty(this, internal, { value: {} });\n        let addrPromise;\n        let addr = null;\n        let deployTx = null;\n        if (_deployTx) {\n            const provider = getProvider(runner);\n            // @TODO: the provider can be null; make a custom dummy provider that will throw a\n            // meaningful error\n            deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n        }\n        let subs = new Map();\n        // Resolve the target as the address\n        if (typeof (target) === \"string\") {\n            if (isHexString(target)) {\n                addr = target;\n                addrPromise = Promise.resolve(target);\n            }\n            else {\n                const resolver = getRunner(runner, \"resolveName\");\n                if (!canResolve(resolver)) {\n                    throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n                        operation: \"resolveName\"\n                    });\n                }\n                addrPromise = resolver.resolveName(target).then((addr) => {\n                    if (addr == null) {\n                        throw makeError(\"an ENS name used for a contract target must be correctly configured\", \"UNCONFIGURED_NAME\", {\n                            value: target\n                        });\n                    }\n                    getInternal(this).addr = addr;\n                    return addr;\n                });\n            }\n        }\n        else {\n            addrPromise = target.getAddress().then((addr) => {\n                if (addr == null) {\n                    throw new Error(\"TODO\");\n                }\n                getInternal(this).addr = addr;\n                return addr;\n            });\n        }\n        // Set our private values\n        setInternal(this, { addrPromise, addr, deployTx, subs });\n        // Add the event filters\n        const filters = new Proxy({}, {\n            get: (target, prop, receiver) => {\n                // Pass important checks (like `then` for Promise) through\n                if (typeof (prop) === \"symbol\" || passProperties.indexOf(prop) >= 0) {\n                    return Reflect.get(target, prop, receiver);\n                }\n                try {\n                    return this.getEvent(prop);\n                }\n                catch (error) {\n                    if (!isError(error, \"INVALID_ARGUMENT\") || error.argument !== \"key\") {\n                        throw error;\n                    }\n                }\n                return undefined;\n            },\n            has: (target, prop) => {\n                // Pass important checks (like `then` for Promise) through\n                if (passProperties.indexOf(prop) >= 0) {\n                    return Reflect.has(target, prop);\n                }\n                return Reflect.has(target, prop) || this.interface.hasEvent(String(prop));\n            }\n        });\n        defineProperties(this, { filters });\n        defineProperties(this, {\n            fallback: ((iface.receive || iface.fallback) ? (buildWrappedFallback(this)) : null)\n        });\n        // Return a Proxy that will respond to functions\n        return new Proxy(this, {\n            get: (target, prop, receiver) => {\n                if (typeof (prop) === \"symbol\" || prop in target || passProperties.indexOf(prop) >= 0) {\n                    return Reflect.get(target, prop, receiver);\n                }\n                // Undefined properties should return undefined\n                try {\n                    return target.getFunction(prop);\n                }\n                catch (error) {\n                    if (!isError(error, \"INVALID_ARGUMENT\") || error.argument !== \"key\") {\n                        throw error;\n                    }\n                }\n                return undefined;\n            },\n            has: (target, prop) => {\n                if (typeof (prop) === \"symbol\" || prop in target || passProperties.indexOf(prop) >= 0) {\n                    return Reflect.has(target, prop);\n                }\n                return target.interface.hasFunction(prop);\n            }\n        });\n    }\n    /**\n     *  Return a new Contract instance with the same target and ABI, but\n     *  a different %%runner%%.\n     */\n    connect(runner) {\n        return new BaseContract(this.target, this.interface, runner);\n    }\n    /**\n     *  Return a new Contract instance with the same ABI and runner, but\n     *  a different %%target%%.\n     */\n    attach(target) {\n        return new BaseContract(target, this.interface, this.runner);\n    }\n    /**\n     *  Return the resolved address of this Contract.\n     */\n    async getAddress() { return await getInternal(this).addrPromise; }\n    /**\n     *  Return the deployed bytecode or null if no bytecode is found.\n     */\n    async getDeployedCode() {\n        const provider = getProvider(this.runner);\n        assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n        const code = await provider.getCode(await this.getAddress());\n        if (code === \"0x\") {\n            return null;\n        }\n        return code;\n    }\n    /**\n     *  Resolve to this Contract once the bytecode has been deployed, or\n     *  resolve immediately if already deployed.\n     */\n    async waitForDeployment() {\n        // We have the deployement transaction; just use that (throws if deployement fails)\n        const deployTx = this.deploymentTransaction();\n        if (deployTx) {\n            await deployTx.wait();\n            return this;\n        }\n        // Check for code\n        const code = await this.getDeployedCode();\n        if (code != null) {\n            return this;\n        }\n        // Make sure we can subscribe to a provider event\n        const provider = getProvider(this.runner);\n        assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n        return new Promise((resolve, reject) => {\n            const checkCode = async () => {\n                try {\n                    const code = await this.getDeployedCode();\n                    if (code != null) {\n                        return resolve(this);\n                    }\n                    provider.once(\"block\", checkCode);\n                }\n                catch (error) {\n                    reject(error);\n                }\n            };\n            checkCode();\n        });\n    }\n    /**\n     *  Return the transaction used to deploy this contract.\n     *\n     *  This is only available if this instance was returned from a\n     *  [[ContractFactory]].\n     */\n    deploymentTransaction() {\n        return getInternal(this).deployTx;\n    }\n    /**\n     *  Return the function for a given name. This is useful when a contract\n     *  method name conflicts with a JavaScript name such as ``prototype`` or\n     *  when using a Contract programatically.\n     */\n    getFunction(key) {\n        if (typeof (key) !== \"string\") {\n            key = key.format();\n        }\n        const func = buildWrappedMethod(this, key);\n        return func;\n    }\n    /**\n     *  Return the event for a given name. This is useful when a contract\n     *  event name conflicts with a JavaScript name such as ``prototype`` or\n     *  when using a Contract programatically.\n     */\n    getEvent(key) {\n        if (typeof (key) !== \"string\") {\n            key = key.format();\n        }\n        return buildWrappedEvent(this, key);\n    }\n    /**\n     *  @_ignore:\n     */\n    async queryTransaction(hash) {\n        throw new Error(\"@TODO\");\n    }\n    /*\n    // @TODO: this is a non-backwards compatible change, but will be added\n    //        in v7 and in a potential SmartContract class in an upcoming\n    //        v6 release\n    async getTransactionReceipt(hash: string): Promise<null | ContractTransactionReceipt> {\n        const provider = getProvider(this.runner);\n        assert(provider, \"contract runner does not have a provider\",\n            \"UNSUPPORTED_OPERATION\", { operation: \"queryTransaction\" });\n\n        const receipt = await provider.getTransactionReceipt(hash);\n        if (receipt == null) { return null; }\n\n        return new ContractTransactionReceipt(this.interface, provider, receipt);\n    }\n    */\n    /**\n     *  Provide historic access to event data for %%event%% in the range\n     *  %%fromBlock%% (default: ``0``) to %%toBlock%% (default: ``\"latest\"``)\n     *  inclusive.\n     */\n    async queryFilter(event, fromBlock, toBlock) {\n        if (fromBlock == null) {\n            fromBlock = 0;\n        }\n        if (toBlock == null) {\n            toBlock = \"latest\";\n        }\n        const { addr, addrPromise } = getInternal(this);\n        const address = (addr ? addr : (await addrPromise));\n        const { fragment, topics } = await getSubInfo(this, event);\n        const filter = { address, topics, fromBlock, toBlock };\n        const provider = getProvider(this.runner);\n        assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n        return (await provider.getLogs(filter)).map((log) => {\n            let foundFragment = fragment;\n            if (foundFragment == null) {\n                try {\n                    foundFragment = this.interface.getEvent(log.topics[0]);\n                }\n                catch (error) { }\n            }\n            if (foundFragment) {\n                try {\n                    return new EventLog(log, this.interface, foundFragment);\n                }\n                catch (error) {\n                    return new UndecodedEventLog(log, error);\n                }\n            }\n            return new Log(log, provider);\n        });\n    }\n    /**\n     *  Add an event %%listener%% for the %%event%%.\n     */\n    async on(event, listener) {\n        const sub = await getSub(this, \"on\", event);\n        sub.listeners.push({ listener, once: false });\n        sub.start();\n        return this;\n    }\n    /**\n     *  Add an event %%listener%% for the %%event%%, but remove the listener\n     *  after it is fired once.\n     */\n    async once(event, listener) {\n        const sub = await getSub(this, \"once\", event);\n        sub.listeners.push({ listener, once: true });\n        sub.start();\n        return this;\n    }\n    /**\n     *  Emit an %%event%% calling all listeners with %%args%%.\n     *\n     *  Resolves to ``true`` if any listeners were called.\n     */\n    async emit(event, ...args) {\n        return await emit(this, event, args, null);\n    }\n    /**\n     *  Resolves to the number of listeners of %%event%% or the total number\n     *  of listeners if unspecified.\n     */\n    async listenerCount(event) {\n        if (event) {\n            const sub = await hasSub(this, event);\n            if (!sub) {\n                return 0;\n            }\n            return sub.listeners.length;\n        }\n        const { subs } = getInternal(this);\n        let total = 0;\n        for (const { listeners } of subs.values()) {\n            total += listeners.length;\n        }\n        return total;\n    }\n    /**\n     *  Resolves to the listeners subscribed to %%event%% or all listeners\n     *  if unspecified.\n     */\n    async listeners(event) {\n        if (event) {\n            const sub = await hasSub(this, event);\n            if (!sub) {\n                return [];\n            }\n            return sub.listeners.map(({ listener }) => listener);\n        }\n        const { subs } = getInternal(this);\n        let result = [];\n        for (const { listeners } of subs.values()) {\n            result = result.concat(listeners.map(({ listener }) => listener));\n        }\n        return result;\n    }\n    /**\n     *  Remove the %%listener%% from the listeners for %%event%% or remove\n     *  all listeners if unspecified.\n     */\n    async off(event, listener) {\n        const sub = await hasSub(this, event);\n        if (!sub) {\n            return this;\n        }\n        if (listener) {\n            const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);\n            if (index >= 0) {\n                sub.listeners.splice(index, 1);\n            }\n        }\n        if (listener == null || sub.listeners.length === 0) {\n            sub.stop();\n            getInternal(this).subs.delete(sub.tag);\n        }\n        return this;\n    }\n    /**\n     *  Remove all the listeners for %%event%% or remove all listeners if\n     *  unspecified.\n     */\n    async removeAllListeners(event) {\n        if (event) {\n            const sub = await hasSub(this, event);\n            if (!sub) {\n                return this;\n            }\n            sub.stop();\n            getInternal(this).subs.delete(sub.tag);\n        }\n        else {\n            const { subs } = getInternal(this);\n            for (const { tag, stop } of subs.values()) {\n                stop();\n                subs.delete(tag);\n            }\n        }\n        return this;\n    }\n    /**\n     *  Alias for [on].\n     */\n    async addListener(event, listener) {\n        return await this.on(event, listener);\n    }\n    /**\n     *  Alias for [off].\n     */\n    async removeListener(event, listener) {\n        return await this.off(event, listener);\n    }\n    /**\n     *  Create a new Class for the %%abi%%.\n     */\n    static buildClass(abi) {\n        class CustomContract extends BaseContract {\n            constructor(address, runner = null) {\n                super(address, abi, runner);\n            }\n        }\n        return CustomContract;\n    }\n    ;\n    /**\n     *  Create a new BaseContract with a specified Interface.\n     */\n    static from(target, abi, runner) {\n        if (runner == null) {\n            runner = null;\n        }\n        const contract = new this(target, abi, runner);\n        return contract;\n    }\n}\nfunction _ContractBase() {\n    return BaseContract;\n}\n/**\n *  A [[BaseContract]] with no type guards on its methods or events.\n */\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.mapimport { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/index.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\n/**\n *  A **ContractFactory** is used to deploy a Contract to the blockchain.\n */\nexport class ContractFactory {\n    /**\n     *  The Contract Interface.\n     */\n    interface;\n    /**\n     *  The Contract deployment bytecode. Often called the initcode.\n     */\n    bytecode;\n    /**\n     *  The ContractRunner to deploy the Contract as.\n     */\n    runner;\n    /**\n     *  Create a new **ContractFactory** with %%abi%% and %%bytecode%%,\n     *  optionally connected to %%runner%%.\n     *\n     *  The %%bytecode%% may be the ``bytecode`` property within the\n     *  standard Solidity JSON output.\n     */\n    constructor(abi, bytecode, runner) {\n        const iface = Interface.from(abi);\n        // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n        if (bytecode instanceof Uint8Array) {\n            bytecode = hexlify(getBytes(bytecode));\n        }\n        else {\n            if (typeof (bytecode) === \"object\") {\n                bytecode = bytecode.object;\n            }\n            if (!bytecode.startsWith(\"0x\")) {\n                bytecode = \"0x\" + bytecode;\n            }\n            bytecode = hexlify(getBytes(bytecode));\n        }\n        defineProperties(this, {\n            bytecode, interface: iface, runner: (runner || null)\n        });\n    }\n    attach(target) {\n        return new BaseContract(target, this.interface, this.runner);\n    }\n    /**\n     *  Resolves to the transaction to deploy the contract, passing %%args%%\n     *  into the constructor.\n     */\n    async getDeployTransaction(...args) {\n        let overrides = {};\n        const fragment = this.interface.deploy;\n        if (fragment.inputs.length + 1 === args.length) {\n            overrides = await copyOverrides(args.pop());\n        }\n        if (fragment.inputs.length !== args.length) {\n            throw new Error(\"incorrect number of arguments to constructor\");\n        }\n        const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n        const data = concat([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]);\n        return Object.assign({}, overrides, { data });\n    }\n    /**\n     *  Resolves to the Contract deployed by passing %%args%% into the\n     *  constructor.\n     *\n     *  This will resolve to the Contract before it has been deployed to the\n     *  network, so the [[BaseContract-waitForDeployment]] should be used before\n     *  sending any transactions to it.\n     */\n    async deploy(...args) {\n        const tx = await this.getDeployTransaction(...args);\n        assert(this.runner && typeof (this.runner.sendTransaction) === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"sendTransaction\"\n        });\n        const sentTx = await this.runner.sendTransaction(tx);\n        const address = getCreateAddress(sentTx);\n        return new BaseContract(address, this.interface, this.runner, sentTx);\n    }\n    /**\n     *  Return a new **ContractFactory** with the same ABI and bytecode,\n     *  but connected to %%runner%%.\n     */\n    connect(runner) {\n        return new ContractFactory(this.interface, this.bytecode, runner);\n    }\n    /**\n     *  Create a new **ContractFactory** from the standard Solidity JSON output.\n     */\n    static fromSolidity(output, runner) {\n        assertArgument(output != null, \"bad compiler output\", \"output\", output);\n        if (typeof (output) === \"string\") {\n            output = JSON.parse(output);\n        }\n        const abi = output.abi;\n        let bytecode = \"\";\n        if (output.bytecode) {\n            bytecode = output.bytecode;\n        }\n        else if (output.evm && output.evm.bytecode) {\n            bytecode = output.evm.bytecode;\n        }\n        return new this(abi, bytecode, runner);\n    }\n}\n//# sourceMappingURL=factory.js.map/**\n *  A **Contract** object is a meta-class (a class whose definition is\n *  defined at runtime), which communicates with a deployed smart contract\n *  on the blockchain and provides a simple JavaScript interface to call\n *  methods, send transaction, query historic logs and listen for its events.\n *\n *  @_section: api/contract:Contracts  [about-contracts]\n */\nexport { BaseContract, Contract } from \"./contract.js\";\nexport { ContractFactory } from \"./factory.js\";\nexport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, UndecodedEventLog } from \"./wrappers.js\";\n//# sourceMappingURL=index.js.map// import from provider.ts instead of index.ts to prevent circular dep\n// from EtherscanProvider\nimport { Log, TransactionReceipt, TransactionResponse } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\n/**\n *  An **EventLog** contains additional properties parsed from the [[Log]].\n */\nexport class EventLog extends Log {\n    /**\n     *  The Contract Interface.\n     */\n    interface;\n    /**\n     *  The matching event.\n     */\n    fragment;\n    /**\n     *  The parsed arguments passed to the event by ``emit``.\n     */\n    args;\n    /**\n     * @_ignore:\n     */\n    constructor(log, iface, fragment) {\n        super(log, log.provider);\n        const args = iface.decodeEventLog(fragment, log.data, log.topics);\n        defineProperties(this, { args, fragment, interface: iface });\n    }\n    /**\n     *  The name of the event.\n     */\n    get eventName() { return this.fragment.name; }\n    /**\n     *  The signature of the event.\n     */\n    get eventSignature() { return this.fragment.format(); }\n}\n/**\n *  An **EventLog** contains additional properties parsed from the [[Log]].\n */\nexport class UndecodedEventLog extends Log {\n    /**\n     *  The error encounted when trying to decode the log.\n     */\n    error;\n    /**\n     * @_ignore:\n     */\n    constructor(log, error) {\n        super(log, log.provider);\n        defineProperties(this, { error });\n    }\n}\n/**\n *  A **ContractTransactionReceipt** includes the parsed logs from a\n *  [[TransactionReceipt]].\n */\nexport class ContractTransactionReceipt extends TransactionReceipt {\n    #iface;\n    /**\n     *  @_ignore:\n     */\n    constructor(iface, provider, tx) {\n        super(tx, provider);\n        this.#iface = iface;\n    }\n    /**\n     *  The parsed logs for any [[Log]] which has a matching event in the\n     *  Contract ABI.\n     */\n    get logs() {\n        return super.logs.map((log) => {\n            const fragment = log.topics.length ? this.#iface.getEvent(log.topics[0]) : null;\n            if (fragment) {\n                try {\n                    return new EventLog(log, this.#iface, fragment);\n                }\n                catch (error) {\n                    return new UndecodedEventLog(log, error);\n                }\n            }\n            return log;\n        });\n    }\n}\n/**\n *  A **ContractTransactionResponse** will return a\n *  [[ContractTransactionReceipt]] when waited on.\n */\nexport class ContractTransactionResponse extends TransactionResponse {\n    #iface;\n    /**\n     *  @_ignore:\n     */\n    constructor(iface, provider, tx) {\n        super(tx, provider);\n        this.#iface = iface;\n    }\n    /**\n     *  Resolves once this transaction has been mined and has\n     *  %%confirms%% blocks including it (default: ``1``) with an\n     *  optional %%timeout%%.\n     *\n     *  This can resolve to ``null`` only if %%confirms%% is ``0``\n     *  and the transaction has not been mined, otherwise this will\n     *  wait until enough confirmations have completed.\n     */\n    async wait(confirms, timeout) {\n        const receipt = await super.wait(confirms, timeout);\n        if (receipt == null) {\n            return null;\n        }\n        return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n    }\n}\n/**\n *  A **ContractUnknownEventPayload** is included as the last parameter to\n *  Contract Events when the event does not match any events in the ABI.\n */\nexport class ContractUnknownEventPayload extends EventPayload {\n    /**\n     *  The log with no matching events.\n     */\n    log;\n    /**\n     *  @_event:\n     */\n    constructor(contract, listener, filter, log) {\n        super(contract, listener, filter);\n        defineProperties(this, { log });\n    }\n    /**\n     *  Resolves to the block the event occured in.\n     */\n    async getBlock() {\n        return await this.log.getBlock();\n    }\n    /**\n     *  Resolves to the transaction the event occured in.\n     */\n    async getTransaction() {\n        return await this.log.getTransaction();\n    }\n    /**\n     *  Resolves to the transaction receipt the event occured in.\n     */\n    async getTransactionReceipt() {\n        return await this.log.getTransactionReceipt();\n    }\n}\n/**\n *  A **ContractEventPayload** is included as the last parameter to\n *  Contract Events when the event is known.\n */\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n    /**\n     *  @_ignore:\n     */\n    constructor(contract, listener, filter, fragment, _log) {\n        super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n        const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n        defineProperties(this, { args, fragment });\n    }\n    /**\n     *  The event name.\n     */\n    get eventName() {\n        return this.fragment.name;\n    }\n    /**\n     *  The event signature.\n     */\n    get eventSignature() {\n        return this.fragment.format();\n    }\n}\n//# sourceMappingURL=wrappers.js.mapexport { createHash, createHmac, pbkdf2Sync, randomBytes } from \"crypto\";\n//# sourceMappingURL=crypto.js.map/**\n *  An **HMAC** enables verification that a given key was used\n *  to authenticate a payload.\n *\n *  See: [[link-wiki-hmac]]\n *\n *  @_subsection: api/crypto:HMAC  [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n    return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n *  Return the HMAC for %%data%% using the %%key%% key with the underlying\n *  %%algo%% used for compression.\n *\n *  @example:\n *    key = id(\"some-secret\")\n *\n *    // Compute the HMAC\n *    computeHmac(\"sha256\", key, \"0x1337\")\n *    //_result:\n *\n *    // To compute the HMAC of UTF-8 data, the data must be\n *    // converted to UTF-8 bytes\n *    computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n *    //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n    const key = getBytes(_key, \"key\");\n    const data = getBytes(_data, \"data\");\n    return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () { locked = true; };\ncomputeHmac.register = function (func) {\n    if (locked) {\n        throw new Error(\"computeHmac is locked\");\n    }\n    __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map/**\n *  A fundamental building block of Ethereum is the underlying\n *  cryptographic primitives.\n *\n *  @_section: api/crypto:Cryptographic Functions   [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { keccak256 } from \"./keccak.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha2.js\";\nexport { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\n/**\n *  Once called, prevents any future change to the underlying cryptographic\n *  primitives using the ``.register`` feature for hooks.\n */\nfunction lock() {\n    computeHmac.lock();\n    keccak256.lock();\n    pbkdf2.lock();\n    randomBytes.lock();\n    ripemd160.lock();\n    scrypt.lock();\n    scryptSync.lock();\n    sha256.lock();\n    sha512.lock();\n    randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map/**\n *  Cryptographic hashing functions\n *\n *  @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n    return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n *  Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n *  The %%data%% **must** be a data representation, to compute the\n *  hash of UTF-8 data use the [[id]] function.\n *\n *  @returns DataHexstring\n *  @example:\n *    keccak256(\"0x\")\n *    //_result:\n *\n *    keccak256(\"0x1337\")\n *    //_result:\n *\n *    keccak256(new Uint8Array([ 0x13, 0x37 ]))\n *    //_result:\n *\n *    // Strings are assumed to be DataHexString, otherwise it will\n *    // throw. To hash UTF-8 data, see the note above.\n *    keccak256(\"Hello World\")\n *    //_error:\n */\nexport function keccak256(_data) {\n    const data = getBytes(_data, \"data\");\n    return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () { locked = true; };\nkeccak256.register = function (func) {\n    if (locked) {\n        throw new TypeError(\"keccak256 is locked\");\n    }\n    __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map/**\n *  A **Password-Based Key-Derivation Function** is designed to create\n *  a sequence of bytes suitible as a **key** from a human-rememberable\n *  password.\n *\n *  @_subsection: api/crypto:Passwords  [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n    return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n *  Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n *  the %%salt%% and using %%iterations%% of %%algo%%.\n *\n *  This PBKDF is outdated and should not be used in new projects, but is\n *  required to decrypt older files.\n *\n *  @example:\n *    // The password must be converted to bytes, and it is generally\n *    // best practices to ensure the string has been normalized. Many\n *    // formats explicitly indicate the normalization form to use.\n *    password = \"hello\"\n *    passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n *    salt = id(\"some-salt\")\n *\n *    // Compute the PBKDF2\n *    pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n *    //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n    const password = getBytes(_password, \"password\");\n    const salt = getBytes(_salt, \"salt\");\n    return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () { locked = true; };\npbkdf2.register = function (func) {\n    if (locked) {\n        throw new Error(\"pbkdf2 is locked\");\n    }\n    __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map/**\n *  A **Cryptographically Secure Random Value** is one that has been\n *  generated with additional care take to prevent side-channels\n *  from allowing others to detect it and prevent others from through\n *  coincidence generate the same values.\n *\n *  @_subsection: api/crypto:Random Values  [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n    return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n *  Return %%length%% bytes of cryptographically secure random data.\n *\n *  @example:\n *    randomBytes(8)\n *    //_result:\n */\nexport function randomBytes(length) {\n    return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () { locked = true; };\nrandomBytes.register = function (func) {\n    if (locked) {\n        throw new Error(\"randomBytes is locked\");\n    }\n    __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.mapimport { ripemd160 as noble_ripemd160 } from \"@noble/hashes/ripemd160\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n    return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n *  Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n *  @_docloc: api/crypto:Hash Functions\n *  @returns DataHexstring\n *\n *  @example:\n *    ripemd160(\"0x\")\n *    //_result:\n *\n *    ripemd160(\"0x1337\")\n *    //_result:\n *\n *    ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n *    //_result:\n *\n */\nexport function ripemd160(_data) {\n    const data = getBytes(_data, \"data\");\n    return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () { locked = true; };\nripemd160.register = function (func) {\n    if (locked) {\n        throw new TypeError(\"ripemd160 is locked\");\n    }\n    __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.mapimport { scrypt as _nobleSync, scryptAsync as _nobleAsync } from \"@noble/hashes/scrypt\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n    return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n    return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n *  The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n *  derivation to increase the resource cost to brute-force a password\n *  for a given key.\n *\n *  This means this algorithm is intentionally slow, and can be tuned to\n *  become slower. As computation and memory speed improve over time,\n *  increasing the difficulty maintains the cost of an attacker.\n *\n *  For example, if a target time of 5 seconds is used, a legitimate user\n *  which knows their password requires only 5 seconds to unlock their\n *  account. A 6 character password has 68 billion possibilities, which\n *  would require an attacker to invest over 10,000 years of CPU time. This\n *  is of course a crude example (as password generally aren't random),\n *  but demonstrates to value of imposing large costs to decryption.\n *\n *  For this reason, if building a UI which involved decrypting or\n *  encrypting datsa using scrypt, it is recommended to use a\n *  [[ProgressCallback]] (as event short periods can seem lik an eternity\n *  if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n *  can also help, assuring the user their waiting is for a good reason.\n *\n *  @_docloc: api/crypto:Passwords\n *\n *  @example:\n *    // The password must be converted to bytes, and it is generally\n *    // best practices to ensure the string has been normalized. Many\n *    // formats explicitly indicate the normalization form to use.\n *    password = \"hello\"\n *    passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n *    salt = id(\"some-salt\")\n *\n *    // Compute the scrypt\n *    scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n *    //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n    const passwd = getBytes(_passwd, \"passwd\");\n    const salt = getBytes(_salt, \"salt\");\n    return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () { lockedAsync = true; };\nscrypt.register = function (func) {\n    if (lockedAsync) {\n        throw new Error(\"scrypt is locked\");\n    }\n    __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n *  Provides a synchronous variant of [[scrypt]].\n *\n *  This will completely lock up and freeze the UI in a browser and will\n *  prevent any event loop from progressing. For this reason, it is\n *  preferred to use the [async variant](scrypt).\n *\n *  @_docloc: api/crypto:Passwords\n *\n *  @example:\n *    // The password must be converted to bytes, and it is generally\n *    // best practices to ensure the string has been normalized. Many\n *    // formats explicitly indicate the normalization form to use.\n *    password = \"hello\"\n *    passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n *    salt = id(\"some-salt\")\n *\n *    // Compute the scrypt\n *    scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n *    //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n    const passwd = getBytes(_passwd, \"passwd\");\n    const salt = getBytes(_salt, \"salt\");\n    return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () { lockedSync = true; };\nscryptSync.register = function (func) {\n    if (lockedSync) {\n        throw new Error(\"scryptSync is locked\");\n    }\n    __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.mapimport { createHash } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nconst _sha256 = function (data) {\n    return createHash(\"sha256\").update(data).digest();\n};\nconst _sha512 = function (data) {\n    return createHash(\"sha512\").update(data).digest();\n};\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n *  Compute the cryptographic SHA2-256 hash of %%data%%.\n *\n *  @_docloc: api/crypto:Hash Functions\n *  @returns DataHexstring\n *\n *  @example:\n *    sha256(\"0x\")\n *    //_result:\n *\n *    sha256(\"0x1337\")\n *    //_result:\n *\n *    sha256(new Uint8Array([ 0x13, 0x37 ]))\n *    //_result:\n *\n */\nexport function sha256(_data) {\n    const data = getBytes(_data, \"data\");\n    return hexlify(__sha256(data));\n}\nsha256._ = _sha256;\nsha256.lock = function () { locked256 = true; };\nsha256.register = function (func) {\n    if (locked256) {\n        throw new Error(\"sha256 is locked\");\n    }\n    __sha256 = func;\n};\nObject.freeze(sha256);\n/**\n *  Compute the cryptographic SHA2-512 hash of %%data%%.\n *\n *  @_docloc: api/crypto:Hash Functions\n *  @returns DataHexstring\n *\n *  @example:\n *    sha512(\"0x\")\n *    //_result:\n *\n *    sha512(\"0x1337\")\n *    //_result:\n *\n *    sha512(new Uint8Array([ 0x13, 0x37 ]))\n *    //_result:\n */\nexport function sha512(_data) {\n    const data = getBytes(_data, \"data\");\n    return hexlify(__sha512(data));\n}\nsha512._ = _sha512;\nsha512.lock = function () { locked512 = true; };\nsha512.register = function (func) {\n    if (locked512) {\n        throw new Error(\"sha512 is locked\");\n    }\n    __sha512 = func;\n};\nObject.freeze(sha256);\n//# sourceMappingURL=sha2.js.mapimport { ZeroHash } from \"../constants/index.js\";\nimport { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, toBeArray, isHexString, zeroPadValue, assertArgument, assertPrivate } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\nfunction toUint256(value) {\n    return zeroPadValue(toBeArray(value), 32);\n}\n/**\n *  A Signature  @TODO\n *\n *\n *  @_docloc: api/crypto:Signing\n */\nexport class Signature {\n    #r;\n    #s;\n    #v;\n    #networkV;\n    /**\n     *  The ``r`` value for a signature.\n     *\n     *  This represents the ``x`` coordinate of a \"reference\" or\n     *  challenge point, from which the ``y`` can be computed.\n     */\n    get r() { return this.#r; }\n    set r(value) {\n        assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n        this.#r = hexlify(value);\n    }\n    /**\n     *  The ``s`` value for a signature.\n     */\n    get s() { return this.#s; }\n    set s(_value) {\n        assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n        const value = hexlify(_value);\n        assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n        this.#s = value;\n    }\n    /**\n     *  The ``v`` value for a signature.\n     *\n     *  Since a given ``x`` value for ``r`` has two possible values for\n     *  its correspondin ``y``, the ``v`` indicates which of the two ``y``\n     *  values to use.\n     *\n     *  It is normalized to the values ``27`` or ``28`` for legacy\n     *  purposes.\n     */\n    get v() { return this.#v; }\n    set v(value) {\n        const v = getNumber(value, \"value\");\n        assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n        this.#v = v;\n    }\n    /**\n     *  The EIP-155 ``v`` for legacy transactions. For non-legacy\n     *  transactions, this value is ``null``.\n     */\n    get networkV() { return this.#networkV; }\n    /**\n     *  The chain ID for EIP-155 legacy transactions. For non-legacy\n     *  transactions, this value is ``null``.\n     */\n    get legacyChainId() {\n        const v = this.networkV;\n        if (v == null) {\n            return null;\n        }\n        return Signature.getChainId(v);\n    }\n    /**\n     *  The ``yParity`` for the signature.\n     *\n     *  See ``v`` for more details on how this value is used.\n     */\n    get yParity() {\n        return (this.v === 27) ? 0 : 1;\n    }\n    /**\n     *  The [[link-eip-2098]] compact representation of the ``yParity``\n     *  and ``s`` compacted into a single ``bytes32``.\n     */\n    get yParityAndS() {\n        // The EIP-2098 compact representation\n        const yParityAndS = getBytes(this.s);\n        if (this.yParity) {\n            yParityAndS[0] |= 0x80;\n        }\n        return hexlify(yParityAndS);\n    }\n    /**\n     *  The [[link-eip-2098]] compact representation.\n     */\n    get compactSerialized() {\n        return concat([this.r, this.yParityAndS]);\n    }\n    /**\n     *  The serialized representation.\n     */\n    get serialized() {\n        return concat([this.r, this.s, (this.yParity ? \"0x1c\" : \"0x1b\")]);\n    }\n    /**\n     *  @private\n     */\n    constructor(guard, r, s, v) {\n        assertPrivate(guard, _guard, \"Signature\");\n        this.#r = r;\n        this.#s = s;\n        this.#v = v;\n        this.#networkV = null;\n    }\n    [Symbol.for('nodejs.util.inspect.custom')]() {\n        return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n    }\n    /**\n     *  Returns a new identical [[Signature]].\n     */\n    clone() {\n        const clone = new Signature(_guard, this.r, this.s, this.v);\n        if (this.networkV) {\n            clone.#networkV = this.networkV;\n        }\n        return clone;\n    }\n    /**\n     *  Returns a representation that is compatible with ``JSON.stringify``.\n     */\n    toJSON() {\n        const networkV = this.networkV;\n        return {\n            _type: \"signature\",\n            networkV: ((networkV != null) ? networkV.toString() : null),\n            r: this.r, s: this.s, v: this.v,\n        };\n    }\n    /**\n     *  Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n     *\n     *  @example:\n     *    Signature.getChainId(45)\n     *    //_result:\n     *\n     *    Signature.getChainId(46)\n     *    //_result:\n     */\n    static getChainId(v) {\n        const bv = getBigInt(v, \"v\");\n        // The v is not an EIP-155 v, so it is the unspecified chain ID\n        if ((bv == BN_27) || (bv == BN_28)) {\n            return BN_0;\n        }\n        // Bad value for an EIP-155 v\n        assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n        return (bv - BN_35) / BN_2;\n    }\n    /**\n     *  Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n     *\n     *  Legacy transactions which use [[link-eip-155]] hijack the ``v``\n     *  property to include the chain ID.\n     *\n     *  @example:\n     *    Signature.getChainIdV(5, 27)\n     *    //_result:\n     *\n     *    Signature.getChainIdV(5, 28)\n     *    //_result:\n     *\n     */\n    static getChainIdV(chainId, v) {\n        return (getBigInt(chainId) * BN_2) + BigInt(35 + v - 27);\n    }\n    /**\n     *  Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n     *  a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n     *\n     *  @example:\n     *    // The values 0 and 1 imply v is actually yParity\n     *    Signature.getNormalizedV(0)\n     *    //_result:\n     *\n     *    // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n     *    Signature.getNormalizedV(27)\n     *    //_result:\n     *\n     *    // Legacy EIP-155 transaction (i.e. >= 35)\n     *    Signature.getNormalizedV(46)\n     *    //_result:\n     *\n     *    // Invalid values throw\n     *    Signature.getNormalizedV(5)\n     *    //_error:\n     */\n    static getNormalizedV(v) {\n        const bv = getBigInt(v);\n        if (bv === BN_0 || bv === BN_27) {\n            return 27;\n        }\n        if (bv === BN_1 || bv === BN_28) {\n            return 28;\n        }\n        assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n        // Otherwise, EIP-155 v means odd is 27 and even is 28\n        return (bv & BN_1) ? 27 : 28;\n    }\n    /**\n     *  Creates a new [[Signature]].\n     *\n     *  If no %%sig%% is provided, a new [[Signature]] is created\n     *  with default values.\n     *\n     *  If %%sig%% is a string, it is parsed.\n     */\n    static from(sig) {\n        function assertError(check, message) {\n            assertArgument(check, message, \"signature\", sig);\n        }\n        ;\n        if (sig == null) {\n            return new Signature(_guard, ZeroHash, ZeroHash, 27);\n        }\n        if (typeof (sig) === \"string\") {\n            const bytes = getBytes(sig, \"signature\");\n            if (bytes.length === 64) {\n                const r = hexlify(bytes.slice(0, 32));\n                const s = bytes.slice(32, 64);\n                const v = (s[0] & 0x80) ? 28 : 27;\n                s[0] &= 0x7f;\n                return new Signature(_guard, r, hexlify(s), v);\n            }\n            if (bytes.length === 65) {\n                const r = hexlify(bytes.slice(0, 32));\n                const s = bytes.slice(32, 64);\n                assertError((s[0] & 0x80) === 0, \"non-canonical s\");\n                const v = Signature.getNormalizedV(bytes[64]);\n                return new Signature(_guard, r, hexlify(s), v);\n            }\n            assertError(false, \"invalid raw signature length\");\n        }\n        if (sig instanceof Signature) {\n            return sig.clone();\n        }\n        // Get r\n        const _r = sig.r;\n        assertError(_r != null, \"missing r\");\n        const r = toUint256(_r);\n        // Get s; by any means necessary (we check consistency below)\n        const s = (function (s, yParityAndS) {\n            if (s != null) {\n                return toUint256(s);\n            }\n            if (yParityAndS != null) {\n                assertError(isHexString(yParityAndS, 32), \"invalid yParityAndS\");\n                const bytes = getBytes(yParityAndS);\n                bytes[0] &= 0x7f;\n                return hexlify(bytes);\n            }\n            assertError(false, \"missing s\");\n        })(sig.s, sig.yParityAndS);\n        assertError((getBytes(s)[0] & 0x80) == 0, \"non-canonical s\");\n        // Get v; by any means necessary (we check consistency below)\n        const { networkV, v } = (function (_v, yParityAndS, yParity) {\n            if (_v != null) {\n                const v = getBigInt(_v);\n                return {\n                    networkV: ((v >= BN_35) ? v : undefined),\n                    v: Signature.getNormalizedV(v)\n                };\n            }\n            if (yParityAndS != null) {\n                assertError(isHexString(yParityAndS, 32), \"invalid yParityAndS\");\n                return { v: ((getBytes(yParityAndS)[0] & 0x80) ? 28 : 27) };\n            }\n            if (yParity != null) {\n                switch (getNumber(yParity, \"sig.yParity\")) {\n                    case 0: return { v: 27 };\n                    case 1: return { v: 28 };\n                }\n                assertError(false, \"invalid yParity\");\n            }\n            assertError(false, \"missing v\");\n        })(sig.v, sig.yParityAndS, sig.yParity);\n        const result = new Signature(_guard, r, s, v);\n        if (networkV) {\n            result.#networkV = networkV;\n        }\n        // If multiple of v, yParity, yParityAndS we given, check they match\n        assertError(sig.yParity == null || getNumber(sig.yParity, \"sig.yParity\") === result.yParity, \"yParity mismatch\");\n        assertError(sig.yParityAndS == null || sig.yParityAndS === result.yParityAndS, \"yParityAndS mismatch\");\n        return result;\n    }\n}\n//# sourceMappingURL=signature.js.map/**\n *  Add details about signing here.\n *\n *  @_subsection: api/crypto:Signing  [about-signing]\n */\nimport { secp256k1 } from \"@noble/curves/secp256k1\";\nimport { concat, dataLength, getBytes, getBytesCopy, hexlify, toBeHex, assertArgument } from \"../utils/index.js\";\nimport { Signature } from \"./signature.js\";\n/**\n *  A **SigningKey** provides high-level access to the elliptic curve\n *  cryptography (ECC) operations and key management.\n */\nexport class SigningKey {\n    #privateKey;\n    /**\n     *  Creates a new **SigningKey** for %%privateKey%%.\n     */\n    constructor(privateKey) {\n        assertArgument(dataLength(privateKey) === 32, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n        this.#privateKey = hexlify(privateKey);\n    }\n    /**\n     *  The private key.\n     */\n    get privateKey() { return this.#privateKey; }\n    /**\n     *  The uncompressed public key.\n     *\n     * This will always begin with the prefix ``0x04`` and be 132\n     * characters long (the ``0x`` prefix and 130 hexadecimal nibbles).\n     */\n    get publicKey() { return SigningKey.computePublicKey(this.#privateKey); }\n    /**\n     *  The compressed public key.\n     *\n     *  This will always begin with either the prefix ``0x02`` or ``0x03``\n     *  and be 68 characters long (the ``0x`` prefix and 33 hexadecimal\n     *  nibbles)\n     */\n    get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); }\n    /**\n     *  Return the signature of the signed %%digest%%.\n     */\n    sign(digest) {\n        assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n        const sig = secp256k1.sign(getBytesCopy(digest), getBytesCopy(this.#privateKey), {\n            lowS: true\n        });\n        return Signature.from({\n            r: toBeHex(sig.r, 32),\n            s: toBeHex(sig.s, 32),\n            v: (sig.recovery ? 0x1c : 0x1b)\n        });\n    }\n    /**\n     *  Returns the [[link-wiki-ecdh]] shared secret between this\n     *  private key and the %%other%% key.\n     *\n     *  The %%other%% key may be any type of key, a raw public key,\n     *  a compressed/uncompressed pubic key or aprivate key.\n     *\n     *  Best practice is usually to use a cryptographic hash on the\n     *  returned value before using it as a symetric secret.\n     *\n     *  @example:\n     *    sign1 = new SigningKey(id(\"some-secret-1\"))\n     *    sign2 = new SigningKey(id(\"some-secret-2\"))\n     *\n     *    // Notice that privA.computeSharedSecret(pubB)...\n     *    sign1.computeSharedSecret(sign2.publicKey)\n     *    //_result:\n     *\n     *    // ...is equal to privB.computeSharedSecret(pubA).\n     *    sign2.computeSharedSecret(sign1.publicKey)\n     *    //_result:\n     */\n    computeSharedSecret(other) {\n        const pubKey = SigningKey.computePublicKey(other);\n        return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey), false));\n    }\n    /**\n     *  Compute the public key for %%key%%, optionally %%compressed%%.\n     *\n     *  The %%key%% may be any type of key, a raw public key, a\n     *  compressed/uncompressed public key or private key.\n     *\n     *  @example:\n     *    sign = new SigningKey(id(\"some-secret\"));\n     *\n     *    // Compute the uncompressed public key for a private key\n     *    SigningKey.computePublicKey(sign.privateKey)\n     *    //_result:\n     *\n     *    // Compute the compressed public key for a private key\n     *    SigningKey.computePublicKey(sign.privateKey, true)\n     *    //_result:\n     *\n     *    // Compute the uncompressed public key\n     *    SigningKey.computePublicKey(sign.publicKey, false);\n     *    //_result:\n     *\n     *    // Compute the Compressed a public key\n     *    SigningKey.computePublicKey(sign.publicKey, true);\n     *    //_result:\n     */\n    static computePublicKey(key, compressed) {\n        let bytes = getBytes(key, \"key\");\n        // private key\n        if (bytes.length === 32) {\n            const pubKey = secp256k1.getPublicKey(bytes, !!compressed);\n            return hexlify(pubKey);\n        }\n        // raw public key; use uncompressed key with 0x04 prefix\n        if (bytes.length === 64) {\n            const pub = new Uint8Array(65);\n            pub[0] = 0x04;\n            pub.set(bytes, 1);\n            bytes = pub;\n        }\n        const point = secp256k1.ProjectivePoint.fromHex(bytes);\n        return hexlify(point.toRawBytes(compressed));\n    }\n    /**\n     *  Returns the public key for the private key which produced the\n     *  %%signature%% for the given %%digest%%.\n     *\n     *  @example:\n     *    key = new SigningKey(id(\"some-secret\"))\n     *    digest = id(\"hello world\")\n     *    sig = key.sign(digest)\n     *\n     *    // Notice the signer public key...\n     *    key.publicKey\n     *    //_result:\n     *\n     *    // ...is equal to the recovered public key\n     *    SigningKey.recoverPublicKey(digest, sig)\n     *    //_result:\n     *\n     */\n    static recoverPublicKey(digest, signature) {\n        assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n        const sig = Signature.from(signature);\n        let secpSig = secp256k1.Signature.fromCompact(getBytesCopy(concat([sig.r, sig.s])));\n        secpSig = secpSig.addRecoveryBit(sig.yParity);\n        const pubKey = secpSig.recoverPublicKey(getBytesCopy(digest));\n        assertArgument(pubKey != null, \"invalid signature for digest\", \"signature\", signature);\n        return \"0x\" + pubKey.toHex(false);\n    }\n    /**\n     *  Returns the point resulting from adding the ellipic curve points\n     *  %%p0%% and %%p1%%.\n     *\n     *  This is not a common function most developers should require, but\n     *  can be useful for certain privacy-specific techniques.\n     *\n     *  For example, it is used by [[HDNodeWallet]] to compute child\n     *  addresses from parent public keys and chain codes.\n     */\n    static addPoints(p0, p1, compressed) {\n        const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2));\n        const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2));\n        return \"0x\" + pub0.add(pub1).toHex(!!compressed);\n    }\n}\n//# sourceMappingURL=signing-key.js.map/////////////////////////////\n//\nexport { version } from \"./_version.js\";\nexport { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from \"./abi/index.js\";\nexport { getAddress, getIcapAddress, getCreateAddress, getCreate2Address, isAddressable, isAddress, resolveAddress } from \"./address/index.js\";\nexport { ZeroAddress, WeiPerEther, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, EtherSymbol, MessagePrefix } from \"./constants/index.js\";\nexport { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, UndecodedEventLog } from \"./contract/index.js\";\nexport { computeHmac, randomBytes, keccak256, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Signature, SigningKey } from \"./crypto/index.js\";\nexport { id, ensNormalize, isValidName, namehash, dnsEncode, hashAuthorization, verifyAuthorization, hashMessage, verifyMessage, solidityPacked, solidityPackedKeccak256, solidityPackedSha256, TypedDataEncoder, verifyTypedData } from \"./hash/index.js\";\nexport { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, BlockscoutProvider, ChainstackProvider, CloudflareProvider, EtherscanProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, EnsResolver, Network, EnsPlugin, EtherscanPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin, NetworkPlugin, MulticoinProviderPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage } from \"./providers/index.js\";\nexport { accessListify, authorizationify, computeAddress, recoverAddress, Transaction } from \"./transaction/index.js\";\nexport { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatEther, parseEther, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, } from \"./utils/index.js\";\nexport { Mnemonic, BaseWallet, HDNodeWallet, HDNodeVoidWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./wallet/index.js\";\nexport { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists } from \"./wordlists/index.js\";\n// dummy change; to pick-up ws security issue changes\n//# sourceMappingURL=ethers.js.mapimport { getAddress } from \"../address/index.js\";\nimport { keccak256 } from \"../crypto/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { assertArgument, concat, encodeRlp, toBeArray } from \"../utils/index.js\";\n/**\n *  Computes the [[link-eip-7702]] authorization digest to sign.\n */\nexport function hashAuthorization(auth) {\n    assertArgument(typeof (auth.address) === \"string\", \"invalid address for hashAuthorization\", \"auth.address\", auth);\n    return keccak256(concat([\n        \"0x05\", encodeRlp([\n            (auth.chainId != null) ? toBeArray(auth.chainId) : \"0x\",\n            getAddress(auth.address),\n            (auth.nonce != null) ? toBeArray(auth.nonce) : \"0x\",\n        ])\n    ]));\n}\n/**\n *  Return the address of the private key that produced\n *  the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyAuthorization(auth, sig) {\n    return recoverAddress(hashAuthorization(auth), sig);\n}\n//# sourceMappingURL=authorization.js.mapimport { keccak256 } from \"../crypto/index.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n *  A simple hashing function which operates on UTF-8 strings to\n *  compute an 32-byte identifier.\n *\n *  This simply computes the [UTF-8 bytes](toUtf8Bytes) and computes\n *  the [[keccak256]].\n *\n *  @example:\n *    id(\"hello world\")\n *    //_result:\n */\nexport function id(value) {\n    return keccak256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map/**\n *  Utilities for common tasks involving hashing. Also see\n *  [cryptographic hashing](about-crypto-hashing).\n *\n *  @_section: api/hashing:Hashing Utilities  [about-hashing]\n */\nexport { hashAuthorization, verifyAuthorization } from \"./authorization.js\";\nexport { id } from \"./id.js\";\nexport { ensNormalize, isValidName, namehash, dnsEncode } from \"./namehash.js\";\nexport { hashMessage, verifyMessage } from \"./message.js\";\nexport { solidityPacked, solidityPackedKeccak256, solidityPackedSha256 } from \"./solidity.js\";\nexport { TypedDataEncoder, verifyTypedData } from \"./typed-data.js\";\n//# sourceMappingURL=index.js.mapimport { keccak256 } from \"../crypto/index.js\";\nimport { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\n/**\n *  Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *  This prefixes the message with [[MessagePrefix]] and the decimal length\n *  of %%message%% and computes the [[keccak256]] digest.\n *\n *  If %%message%% is a string, it is converted to its UTF-8 bytes\n *  first. To compute the digest of a [[DataHexString]], it must be converted\n *  to [bytes](getBytes).\n *\n *  @example:\n *    hashMessage(\"Hello World\")\n *    //_result:\n *\n *    // Hashes the SIX (6) string characters, i.e.\n *    // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n *    hashMessage(\"0x4243\")\n *    //_result:\n *\n *    // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n *    hashMessage(getBytes(\"0x4243\"))\n *    //_result:\n *\n *    // ...which is equal to using data\n *    hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n *    //_result:\n *\n */\nexport function hashMessage(message) {\n    if (typeof (message) === \"string\") {\n        message = toUtf8Bytes(message);\n    }\n    return keccak256(concat([\n        toUtf8Bytes(MessagePrefix),\n        toUtf8Bytes(String(message.length)),\n        message\n    ]));\n}\n/**\n *  Return the address of the private key that produced\n *  the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig) {\n    const digest = hashMessage(message);\n    return recoverAddress(digest, sig);\n}\n//# sourceMappingURL=message.js.mapimport { keccak256 } from \"../crypto/index.js\";\nimport { concat, hexlify, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nimport { ens_normalize } from \"@adraffy/ens-normalize\";\nconst Zeros = new Uint8Array(32);\nZeros.fill(0);\nfunction checkComponent(comp) {\n    assertArgument(comp.length !== 0, \"invalid ENS name; empty component\", \"comp\", comp);\n    return comp;\n}\nfunction ensNameSplit(name) {\n    const bytes = toUtf8Bytes(ensNormalize(name));\n    const comps = [];\n    if (name.length === 0) {\n        return comps;\n    }\n    let last = 0;\n    for (let i = 0; i < bytes.length; i++) {\n        const d = bytes[i];\n        // A separator (i.e. \".\"); copy this component\n        if (d === 0x2e) {\n            comps.push(checkComponent(bytes.slice(last, i)));\n            last = i + 1;\n        }\n    }\n    // There was a stray separator at the end of the name\n    assertArgument(last < bytes.length, \"invalid ENS name; empty component\", \"name\", name);\n    comps.push(checkComponent(bytes.slice(last)));\n    return comps;\n}\n/**\n *  Returns the ENS %%name%% normalized.\n */\nexport function ensNormalize(name) {\n    try {\n        if (name.length === 0) {\n            throw new Error(\"empty label\");\n        }\n        return ens_normalize(name);\n    }\n    catch (error) {\n        assertArgument(false, `invalid ENS name (${error.message})`, \"name\", name);\n    }\n}\n/**\n *  Returns ``true`` if %%name%% is a valid ENS name.\n */\nexport function isValidName(name) {\n    try {\n        return (ensNameSplit(name).length !== 0);\n    }\n    catch (error) { }\n    return false;\n}\n/**\n *  Returns the [[link-namehash]] for %%name%%.\n */\nexport function namehash(name) {\n    assertArgument(typeof (name) === \"string\", \"invalid ENS name; not a string\", \"name\", name);\n    assertArgument(name.length, `invalid ENS name (empty label)`, \"name\", name);\n    let result = Zeros;\n    const comps = ensNameSplit(name);\n    while (comps.length) {\n        result = keccak256(concat([result, keccak256((comps.pop()))]));\n    }\n    return hexlify(result);\n}\n/**\n *  Returns the DNS encoded %%name%%.\n *\n *  This is used for various parts of ENS name resolution, such\n *  as the wildcard resolution.\n */\nexport function dnsEncode(name, _maxLength) {\n    const length = (_maxLength != null) ? _maxLength : 63;\n    assertArgument(length <= 255, \"DNS encoded label cannot exceed 255\", \"length\", length);\n    return hexlify(concat(ensNameSplit(name).map((comp) => {\n        assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, \"name\", name);\n        const bytes = new Uint8Array(comp.length + 1);\n        bytes.set(comp, 1);\n        bytes[0] = bytes.length - 1;\n        return bytes;\n    }))) + \"00\";\n}\n//# sourceMappingURL=namehash.js.mapimport { getAddress } from \"../address/index.js\";\nimport { keccak256 as _keccak256, sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n    switch (type) {\n        case \"address\":\n            if (isArray) {\n                return getBytes(zeroPadValue(value, 32));\n            }\n            return getBytes(getAddress(value));\n        case \"string\":\n            return toUtf8Bytes(value);\n        case \"bytes\":\n            return getBytes(value);\n        case \"bool\":\n            value = (!!value ? \"0x01\" : \"0x00\");\n            if (isArray) {\n                return getBytes(zeroPadValue(value, 32));\n            }\n            return getBytes(value);\n    }\n    let match = type.match(regexNumber);\n    if (match) {\n        let signed = (match[1] === \"int\");\n        let size = parseInt(match[2] || \"256\");\n        assertArgument((!match[2] || match[2] === String(size)) && (size % 8 === 0) && size !== 0 && size <= 256, \"invalid number type\", \"type\", type);\n        if (isArray) {\n            size = 256;\n        }\n        if (signed) {\n            value = toTwos(value, size);\n        }\n        return getBytes(zeroPadValue(toBeArray(value), size / 8));\n    }\n    match = type.match(regexBytes);\n    if (match) {\n        const size = parseInt(match[1]);\n        assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n        assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n        if (isArray) {\n            return getBytes(zeroPadBytes(value, 32));\n        }\n        return value;\n    }\n    match = type.match(regexArray);\n    if (match && Array.isArray(value)) {\n        const baseType = match[1];\n        const count = parseInt(match[2] || String(value.length));\n        assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n        const result = [];\n        value.forEach(function (value) {\n            result.push(_pack(baseType, value, true));\n        });\n        return getBytes(concat(result));\n    }\n    assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n *   Computes the [[link-solc-packed]] representation of %%values%%\n *   respectively to their %%types%%.\n *\n *   @example:\n *       addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n *       solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n *       //_result:\n */\nexport function solidityPacked(types, values) {\n    assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n    const tight = [];\n    types.forEach(function (type, index) {\n        tight.push(_pack(type, values[index]));\n    });\n    return hexlify(concat(tight));\n}\n/**\n *   Computes the [[link-solc-packed]] [[keccak256]] hash of %%values%%\n *   respectively to their %%types%%.\n *\n *   @example:\n *       addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n *       solidityPackedKeccak256([ \"address\", \"uint\" ], [ addr, 45 ]);\n *       //_result:\n */\nexport function solidityPackedKeccak256(types, values) {\n    return _keccak256(solidityPacked(types, values));\n}\n/**\n *   Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n *   respectively to their %%types%%.\n *\n *   @example:\n *       addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n *       solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n *       //_result:\n */\nexport function solidityPackedSha256(types, values) {\n    return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map//import { TypedDataDomain, TypedDataField } from \"@ethersproject/providerabstract-signer\";\nimport { getAddress } from \"../address/index.js\";\nimport { keccak256 } from \"../crypto/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, defineProperties, getBigInt, getBytes, hexlify, isHexString, mask, toBeHex, toQuantity, toTwos, zeroPadValue, assertArgument } from \"../utils/index.js\";\nimport { id } from \"./id.js\";\nconst padding = new Uint8Array(32);\npadding.fill(0);\nconst BN__1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n;\n;\nfunction hexPadRight(value) {\n    const bytes = getBytes(value);\n    const padOffset = bytes.length % 32;\n    if (padOffset) {\n        return concat([bytes, padding.slice(padOffset)]);\n    }\n    return hexlify(bytes);\n}\nconst hexTrue = toBeHex(BN_1, 32);\nconst hexFalse = toBeHex(BN_0, 32);\nconst domainFieldTypes = {\n    name: \"string\",\n    version: \"string\",\n    chainId: \"uint256\",\n    verifyingContract: \"address\",\n    salt: \"bytes32\"\n};\nconst domainFieldNames = [\n    \"name\", \"version\", \"chainId\", \"verifyingContract\", \"salt\"\n];\nfunction checkString(key) {\n    return function (value) {\n        assertArgument(typeof (value) === \"string\", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);\n        return value;\n    };\n}\nconst domainChecks = {\n    name: checkString(\"name\"),\n    version: checkString(\"version\"),\n    chainId: function (_value) {\n        const value = getBigInt(_value, \"domain.chainId\");\n        assertArgument(value >= 0, \"invalid chain ID\", \"domain.chainId\", _value);\n        if (Number.isSafeInteger(value)) {\n            return Number(value);\n        }\n        return toQuantity(value);\n    },\n    verifyingContract: function (value) {\n        try {\n            return getAddress(value).toLowerCase();\n        }\n        catch (error) { }\n        assertArgument(false, `invalid domain value \"verifyingContract\"`, \"domain.verifyingContract\", value);\n    },\n    salt: function (value) {\n        const bytes = getBytes(value, \"domain.salt\");\n        assertArgument(bytes.length === 32, `invalid domain value \"salt\"`, \"domain.salt\", value);\n        return hexlify(bytes);\n    }\n};\nfunction getBaseEncoder(type) {\n    // intXX and uintXX\n    {\n        const match = type.match(/^(u?)int(\\d+)$/);\n        if (match) {\n            const signed = (match[1] === \"\");\n            const width = parseInt(match[2]);\n            assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && match[2] === String(width), \"invalid numeric width\", \"type\", type);\n            const boundsUpper = mask(BN_MAX_UINT256, signed ? (width - 1) : width);\n            const boundsLower = signed ? ((boundsUpper + BN_1) * BN__1) : BN_0;\n            return function (_value) {\n                const value = getBigInt(_value, \"value\");\n                assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, \"value\", value);\n                return toBeHex(signed ? toTwos(value, 256) : value, 32);\n            };\n        }\n    }\n    // bytesXX\n    {\n        const match = type.match(/^bytes(\\d+)$/);\n        if (match) {\n            const width = parseInt(match[1]);\n            assertArgument(width !== 0 && width <= 32 && match[1] === String(width), \"invalid bytes width\", \"type\", type);\n            return function (value) {\n                const bytes = getBytes(value);\n                assertArgument(bytes.length === width, `invalid length for ${type}`, \"value\", value);\n                return hexPadRight(value);\n            };\n        }\n    }\n    switch (type) {\n        case \"address\": return function (value) {\n            return zeroPadValue(getAddress(value), 32);\n        };\n        case \"bool\": return function (value) {\n            return ((!value) ? hexFalse : hexTrue);\n        };\n        case \"bytes\": return function (value) {\n            return keccak256(value);\n        };\n        case \"string\": return function (value) {\n            return id(value);\n        };\n    }\n    return null;\n}\nfunction encodeType(name, fields) {\n    return `${name}(${fields.map(({ name, type }) => (type + \" \" + name)).join(\",\")})`;\n}\n// foo[][3] => { base: \"foo\", index: \"[][3]\", array: {\n//     base: \"foo\", prefix: \"foo[]\", count: 3 } }\nfunction splitArray(type) {\n    const match = type.match(/^([^\\x5b]*)((\\x5b\\d*\\x5d)*)(\\x5b(\\d*)\\x5d)$/);\n    if (match) {\n        return {\n            base: match[1],\n            index: (match[2] + match[4]),\n            array: {\n                base: match[1],\n                prefix: (match[1] + match[2]),\n                count: (match[5] ? parseInt(match[5]) : -1),\n            }\n        };\n    }\n    return { base: type };\n}\n/**\n *  A **TypedDataEncode** prepares and encodes [[link-eip-712]] payloads\n *  for signed typed data.\n *\n *  This is useful for those that wish to compute various components of a\n *  typed data hash, primary types, or sub-components, but generally the\n *  higher level [[Signer-signTypedData]] is more useful.\n */\nexport class TypedDataEncoder {\n    /**\n     *  The primary type for the structured [[types]].\n     *\n     *  This is derived automatically from the [[types]], since no\n     *  recursion is possible, once the DAG for the types is consturcted\n     *  internally, the primary type must be the only remaining type with\n     *  no parent nodes.\n     */\n    primaryType;\n    #types;\n    /**\n     *  The types.\n     */\n    get types() {\n        return JSON.parse(this.#types);\n    }\n    #fullTypes;\n    #encoderCache;\n    /**\n     *  Create a new **TypedDataEncoder** for %%types%%.\n     *\n     *  This performs all necessary checking that types are valid and\n     *  do not violate the [[link-eip-712]] structural constraints as\n     *  well as computes the [[primaryType]].\n     */\n    constructor(_types) {\n        this.#fullTypes = new Map();\n        this.#encoderCache = new Map();\n        // Link struct types to their direct child structs\n        const links = new Map();\n        // Link structs to structs which contain them as a child\n        const parents = new Map();\n        // Link all subtypes within a given struct\n        const subtypes = new Map();\n        const types = {};\n        Object.keys(_types).forEach((type) => {\n            types[type] = _types[type].map(({ name, type }) => {\n                // Normalize the base type (unless name conflict)\n                let { base, index } = splitArray(type);\n                if (base === \"int\" && !_types[\"int\"]) {\n                    base = \"int256\";\n                }\n                if (base === \"uint\" && !_types[\"uint\"]) {\n                    base = \"uint256\";\n                }\n                return { name, type: (base + (index || \"\")) };\n            });\n            links.set(type, new Set());\n            parents.set(type, []);\n            subtypes.set(type, new Set());\n        });\n        this.#types = JSON.stringify(types);\n        for (const name in types) {\n            const uniqueNames = new Set();\n            for (const field of types[name]) {\n                // Check each field has a unique name\n                assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, \"types\", _types);\n                uniqueNames.add(field.name);\n                // Get the base type (drop any array specifiers)\n                const baseType = splitArray(field.type).base;\n                assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, \"types\", _types);\n                // Is this a base encoding type?\n                const encoder = getBaseEncoder(baseType);\n                if (encoder) {\n                    continue;\n                }\n                assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, \"types\", _types);\n                // Add linkage\n                parents.get(baseType).push(name);\n                links.get(name).add(baseType);\n            }\n        }\n        // Deduce the primary type\n        const primaryTypes = Array.from(parents.keys()).filter((n) => (parents.get(n).length === 0));\n        assertArgument(primaryTypes.length !== 0, \"missing primary type\", \"types\", _types);\n        assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes.map((t) => (JSON.stringify(t))).join(\", \")}`, \"types\", _types);\n        defineProperties(this, { primaryType: primaryTypes[0] });\n        // Check for circular type references\n        function checkCircular(type, found) {\n            assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, \"types\", _types);\n            found.add(type);\n            for (const child of links.get(type)) {\n                if (!parents.has(child)) {\n                    continue;\n                }\n                // Recursively check children\n                checkCircular(child, found);\n                // Mark all ancestors as having this decendant\n                for (const subtype of found) {\n                    subtypes.get(subtype).add(child);\n                }\n            }\n            found.delete(type);\n        }\n        checkCircular(this.primaryType, new Set());\n        // Compute each fully describe type\n        for (const [name, set] of subtypes) {\n            const st = Array.from(set);\n            st.sort();\n            this.#fullTypes.set(name, encodeType(name, types[name]) + st.map((t) => encodeType(t, types[t])).join(\"\"));\n        }\n    }\n    /**\n     *  Returnthe encoder for the specific %%type%%.\n     */\n    getEncoder(type) {\n        let encoder = this.#encoderCache.get(type);\n        if (!encoder) {\n            encoder = this.#getEncoder(type);\n            this.#encoderCache.set(type, encoder);\n        }\n        return encoder;\n    }\n    #getEncoder(type) {\n        // Basic encoder type (address, bool, uint256, etc)\n        {\n            const encoder = getBaseEncoder(type);\n            if (encoder) {\n                return encoder;\n            }\n        }\n        // Array\n        const array = splitArray(type).array;\n        if (array) {\n            const subtype = array.prefix;\n            const subEncoder = this.getEncoder(subtype);\n            return (value) => {\n                assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, \"value\", value);\n                let result = value.map(subEncoder);\n                if (this.#fullTypes.has(subtype)) {\n                    result = result.map(keccak256);\n                }\n                return keccak256(concat(result));\n            };\n        }\n        // Struct\n        const fields = this.types[type];\n        if (fields) {\n            const encodedType = id(this.#fullTypes.get(type));\n            return (value) => {\n                const values = fields.map(({ name, type }) => {\n                    const result = this.getEncoder(type)(value[name]);\n                    if (this.#fullTypes.has(type)) {\n                        return keccak256(result);\n                    }\n                    return result;\n                });\n                values.unshift(encodedType);\n                return concat(values);\n            };\n        }\n        assertArgument(false, `unknown type: ${type}`, \"type\", type);\n    }\n    /**\n     *  Return the full type for %%name%%.\n     */\n    encodeType(name) {\n        const result = this.#fullTypes.get(name);\n        assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n        return result;\n    }\n    /**\n     *  Return the encoded %%value%% for the %%type%%.\n     */\n    encodeData(type, value) {\n        return this.getEncoder(type)(value);\n    }\n    /**\n     *  Returns the hash of %%value%% for the type of %%name%%.\n     */\n    hashStruct(name, value) {\n        return keccak256(this.encodeData(name, value));\n    }\n    /**\n     *  Return the fulled encoded %%value%% for the [[types]].\n     */\n    encode(value) {\n        return this.encodeData(this.primaryType, value);\n    }\n    /**\n     *  Return the hash of the fully encoded %%value%% for the [[types]].\n     */\n    hash(value) {\n        return this.hashStruct(this.primaryType, value);\n    }\n    /**\n     *  @_ignore:\n     */\n    _visit(type, value, callback) {\n        // Basic encoder type (address, bool, uint256, etc)\n        {\n            const encoder = getBaseEncoder(type);\n            if (encoder) {\n                return callback(type, value);\n            }\n        }\n        // Array\n        const array = splitArray(type).array;\n        if (array) {\n            assertArgument(array.count === -1 || array.count === value.length, `array length mismatch; expected length ${array.count}`, \"value\", value);\n            return value.map((v) => this._visit(array.prefix, v, callback));\n        }\n        // Struct\n        const fields = this.types[type];\n        if (fields) {\n            return fields.reduce((accum, { name, type }) => {\n                accum[name] = this._visit(type, value[name], callback);\n                return accum;\n            }, {});\n        }\n        assertArgument(false, `unknown type: ${type}`, \"type\", type);\n    }\n    /**\n     *  Call %%calback%% for each value in %%value%%, passing the type and\n     *  component within %%value%%.\n     *\n     *  This is useful for replacing addresses or other transformation that\n     *  may be desired on each component, based on its type.\n     */\n    visit(value, callback) {\n        return this._visit(this.primaryType, value, callback);\n    }\n    /**\n     *  Create a new **TypedDataEncoder** for %%types%%.\n     */\n    static from(types) {\n        return new TypedDataEncoder(types);\n    }\n    /**\n     *  Return the primary type for %%types%%.\n     */\n    static getPrimaryType(types) {\n        return TypedDataEncoder.from(types).primaryType;\n    }\n    /**\n     *  Return the hashed struct for %%value%% using %%types%% and %%name%%.\n     */\n    static hashStruct(name, types, value) {\n        return TypedDataEncoder.from(types).hashStruct(name, value);\n    }\n    /**\n     *  Return the domain hash for %%domain%%.\n     */\n    static hashDomain(domain) {\n        const domainFields = [];\n        for (const name in domain) {\n            if (domain[name] == null) {\n                continue;\n            }\n            const type = domainFieldTypes[name];\n            assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, \"domain\", domain);\n            domainFields.push({ name, type });\n        }\n        domainFields.sort((a, b) => {\n            return domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name);\n        });\n        return TypedDataEncoder.hashStruct(\"EIP712Domain\", { EIP712Domain: domainFields }, domain);\n    }\n    /**\n     *  Return the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.\n     */\n    static encode(domain, types, value) {\n        return concat([\n            \"0x1901\",\n            TypedDataEncoder.hashDomain(domain),\n            TypedDataEncoder.from(types).hash(value)\n        ]);\n    }\n    /**\n     *  Return the hash of the fully encoded [[link-eip-712]] %%value%% for %%types%% with %%domain%%.\n     */\n    static hash(domain, types, value) {\n        return keccak256(TypedDataEncoder.encode(domain, types, value));\n    }\n    // Replaces all address types with ENS names with their looked up address\n    /**\n     * Resolves to the value from resolving all addresses in %%value%% for\n     * %%types%% and the %%domain%%.\n     */\n    static async resolveNames(domain, types, value, resolveName) {\n        // Make a copy to isolate it from the object passed in\n        domain = Object.assign({}, domain);\n        // Allow passing null to ignore value\n        for (const key in domain) {\n            if (domain[key] == null) {\n                delete domain[key];\n            }\n        }\n        // Look up all ENS names\n        const ensCache = {};\n        // Do we need to look up the domain's verifyingContract?\n        if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) {\n            ensCache[domain.verifyingContract] = \"0x\";\n        }\n        // We are going to use the encoder to visit all the base values\n        const encoder = TypedDataEncoder.from(types);\n        // Get a list of all the addresses\n        encoder.visit(value, (type, value) => {\n            if (type === \"address\" && !isHexString(value, 20)) {\n                ensCache[value] = \"0x\";\n            }\n            return value;\n        });\n        // Lookup each name\n        for (const name in ensCache) {\n            ensCache[name] = await resolveName(name);\n        }\n        // Replace the domain verifyingContract if needed\n        if (domain.verifyingContract && ensCache[domain.verifyingContract]) {\n            domain.verifyingContract = ensCache[domain.verifyingContract];\n        }\n        // Replace all ENS names with their address\n        value = encoder.visit(value, (type, value) => {\n            if (type === \"address\" && ensCache[value]) {\n                return ensCache[value];\n            }\n            return value;\n        });\n        return { domain, value };\n    }\n    /**\n     *  Returns the JSON-encoded payload expected by nodes which implement\n     *  the JSON-RPC [[link-eip-712]] method.\n     */\n    static getPayload(domain, types, value) {\n        // Validate the domain fields\n        TypedDataEncoder.hashDomain(domain);\n        // Derive the EIP712Domain Struct reference type\n        const domainValues = {};\n        const domainTypes = [];\n        domainFieldNames.forEach((name) => {\n            const value = domain[name];\n            if (value == null) {\n                return;\n            }\n            domainValues[name] = domainChecks[name](value);\n            domainTypes.push({ name, type: domainFieldTypes[name] });\n        });\n        const encoder = TypedDataEncoder.from(types);\n        // Get the normalized types\n        types = encoder.types;\n        const typesWithDomain = Object.assign({}, types);\n        assertArgument(typesWithDomain.EIP712Domain == null, \"types must not contain EIP712Domain type\", \"types.EIP712Domain\", types);\n        typesWithDomain.EIP712Domain = domainTypes;\n        // Validate the data structures and types\n        encoder.encode(value);\n        return {\n            types: typesWithDomain,\n            domain: domainValues,\n            primaryType: encoder.primaryType,\n            message: encoder.visit(value, (type, value) => {\n                // bytes\n                if (type.match(/^bytes(\\d*)/)) {\n                    return hexlify(getBytes(value));\n                }\n                // uint or int\n                if (type.match(/^u?int/)) {\n                    return getBigInt(value).toString();\n                }\n                switch (type) {\n                    case \"address\":\n                        return value.toLowerCase();\n                    case \"bool\":\n                        return !!value;\n                    case \"string\":\n                        assertArgument(typeof (value) === \"string\", \"invalid string\", \"value\", value);\n                        return value;\n                }\n                assertArgument(false, \"unsupported type\", \"type\", type);\n            })\n        };\n    }\n}\n/**\n *  Compute the address used to sign the typed data for the %%signature%%.\n */\nexport function verifyTypedData(domain, types, value, signature) {\n    return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature);\n}\n//# sourceMappingURL=typed-data.js.map/**\n *  The Application Programming Interface (API) is the collection of\n *  functions, classes and types offered by the Ethers library.\n *\n *  @_section: api:Application Programming Interface  [about-api]\n *  @_navTitle: API\n */\nimport * as ethers from \"./ethers.js\";\nexport { ethers };\nexport * from \"./ethers.js\";\n//# sourceMappingURL=index.js.map{\n  \"browser\": {\n    \"./crypto/crypto.js\": \"./crypto/crypto-browser.js\",\n    \"./providers/provider-ipcsocket.js\": \"./providers/provider-ipcsocket-browser.js\",\n    \"./providers/ws.js\": \"./providers/ws-browser.js\",\n    \"./utils/base64.js\": \"./utils/base64-browser.js\",\n    \"./utils/geturl.js\": \"./utils/geturl-browser.js\",\n    \"./wordlists/wordlists.js\": \"./wordlists/wordlists-browser.js\"\n  },\n  \"sideEffects\": false,\n  \"type\": \"module\"\n}\n/**\n *  The available providers should suffice for most developers purposes,\n *  but the [[AbstractProvider]] class has many features which enable\n *  sub-classing it for specific purposes.\n *\n *  @_section: api/providers/abstract-provider: Subclassing Provider  [abstract-provider]\n */\n// @TODO\n// Event coalescence\n//   When we register an event with an async value (e.g. address is a Signer\n//   or ENS name), we need to add it immeidately for the Event API, but also\n//   need time to resolve the address. Upon resolving the address, we need to\n//   migrate the listener to the static event. We also need to maintain a map\n//   of Signer/ENS name to address so we can sync respond to listenerCount.\nimport { getAddress, resolveAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { namehash } from \"../hash/index.js\";\nimport { Transaction } from \"../transaction/index.js\";\nimport { concat, dataLength, dataSlice, hexlify, isHexString, getBigInt, getBytes, getNumber, isCallException, isError, makeError, assert, assertArgument, FetchRequest, toBeArray, toQuantity, defineProperties, EventPayload, resolveProperties, toUtf8String } from \"../utils/index.js\";\nimport { EnsResolver } from \"./ens-resolver.js\";\nimport { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingBlockTagSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber } from \"./subscriber-polling.js\";\n// Constants\nconst BN_2 = BigInt(2);\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n    return (value && typeof (value.then) === \"function\");\n}\nfunction getTag(prefix, value) {\n    return prefix + \":\" + JSON.stringify(value, (k, v) => {\n        if (v == null) {\n            return \"null\";\n        }\n        if (typeof (v) === \"bigint\") {\n            return `bigint:${v.toString()}`;\n        }\n        if (typeof (v) === \"string\") {\n            return v.toLowerCase();\n        }\n        // Sort object keys\n        if (typeof (v) === \"object\" && !Array.isArray(v)) {\n            const keys = Object.keys(v);\n            keys.sort();\n            return keys.reduce((accum, key) => {\n                accum[key] = v[key];\n                return accum;\n            }, {});\n        }\n        return v;\n    });\n}\n/**\n *  An **UnmanagedSubscriber** is useful for events which do not require\n *  any additional management, such as ``\"debug\"`` which only requires\n *  emit in synchronous event loop triggered calls.\n */\nexport class UnmanagedSubscriber {\n    /**\n     *  The name fof the event.\n     */\n    name;\n    /**\n     *  Create a new UnmanagedSubscriber with %%name%%.\n     */\n    constructor(name) { defineProperties(this, { name }); }\n    start() { }\n    stop() { }\n    pause(dropWhilePaused) { }\n    resume() { }\n}\nfunction copy(value) {\n    return JSON.parse(JSON.stringify(value));\n}\nfunction concisify(items) {\n    items = Array.from((new Set(items)).values());\n    items.sort();\n    return items;\n}\nasync function getSubscription(_event, provider) {\n    if (_event == null) {\n        throw new Error(\"invalid event\");\n    }\n    // Normalize topic array info an EventFilter\n    if (Array.isArray(_event)) {\n        _event = { topics: _event };\n    }\n    if (typeof (_event) === \"string\") {\n        switch (_event) {\n            case \"block\":\n            case \"debug\":\n            case \"error\":\n            case \"finalized\":\n            case \"network\":\n            case \"pending\":\n            case \"safe\": {\n                return { type: _event, tag: _event };\n            }\n        }\n    }\n    if (isHexString(_event, 32)) {\n        const hash = _event.toLowerCase();\n        return { type: \"transaction\", tag: getTag(\"tx\", { hash }), hash };\n    }\n    if (_event.orphan) {\n        const event = _event;\n        // @TODO: Should lowercase and whatnot things here instead of copy...\n        return { type: \"orphan\", tag: getTag(\"orphan\", event), filter: copy(event) };\n    }\n    if ((_event.address || _event.topics)) {\n        const event = _event;\n        const filter = {\n            topics: ((event.topics || []).map((t) => {\n                if (t == null) {\n                    return null;\n                }\n                if (Array.isArray(t)) {\n                    return concisify(t.map((t) => t.toLowerCase()));\n                }\n                return t.toLowerCase();\n            }))\n        };\n        if (event.address) {\n            const addresses = [];\n            const promises = [];\n            const addAddress = (addr) => {\n                if (isHexString(addr)) {\n                    addresses.push(addr);\n                }\n                else {\n                    promises.push((async () => {\n                        addresses.push(await resolveAddress(addr, provider));\n                    })());\n                }\n            };\n            if (Array.isArray(event.address)) {\n                event.address.forEach(addAddress);\n            }\n            else {\n                addAddress(event.address);\n            }\n            if (promises.length) {\n                await Promise.all(promises);\n            }\n            filter.address = concisify(addresses.map((a) => a.toLowerCase()));\n        }\n        return { filter, tag: getTag(\"event\", filter), type: \"event\" };\n    }\n    assertArgument(false, \"unknown ProviderEvent\", \"event\", _event);\n}\nfunction getTime() { return (new Date()).getTime(); }\nconst defaultOptions = {\n    cacheTimeout: 250,\n    pollingInterval: 4000\n};\n/**\n *  An **AbstractProvider** provides a base class for other sub-classes to\n *  implement the [[Provider]] API by normalizing input arguments and\n *  formatting output results as well as tracking events for consistent\n *  behaviour on an eventually-consistent network.\n */\nexport class AbstractProvider {\n    #subs;\n    #plugins;\n    // null=unpaused, true=paused+dropWhilePaused, false=paused\n    #pausedState;\n    #destroyed;\n    #networkPromise;\n    #anyNetwork;\n    #performCache;\n    // The most recent block number if running an event or -1 if no \"block\" event\n    #lastBlockNumber;\n    #nextTimer;\n    #timers;\n    #disableCcipRead;\n    #options;\n    /**\n     *  Create a new **AbstractProvider** connected to %%network%%, or\n     *  use the various network detection capabilities to discover the\n     *  [[Network]] if necessary.\n     */\n    constructor(_network, options) {\n        this.#options = Object.assign({}, defaultOptions, options || {});\n        if (_network === \"any\") {\n            this.#anyNetwork = true;\n            this.#networkPromise = null;\n        }\n        else if (_network) {\n            const network = Network.from(_network);\n            this.#anyNetwork = false;\n            this.#networkPromise = Promise.resolve(network);\n            setTimeout(() => { this.emit(\"network\", network, null); }, 0);\n        }\n        else {\n            this.#anyNetwork = false;\n            this.#networkPromise = null;\n        }\n        this.#lastBlockNumber = -1;\n        this.#performCache = new Map();\n        this.#subs = new Map();\n        this.#plugins = new Map();\n        this.#pausedState = null;\n        this.#destroyed = false;\n        this.#nextTimer = 1;\n        this.#timers = new Map();\n        this.#disableCcipRead = false;\n    }\n    get pollingInterval() { return this.#options.pollingInterval; }\n    /**\n     *  Returns ``this``, to allow an **AbstractProvider** to implement\n     *  the [[ContractRunner]] interface.\n     */\n    get provider() { return this; }\n    /**\n     *  Returns all the registered plug-ins.\n     */\n    get plugins() {\n        return Array.from(this.#plugins.values());\n    }\n    /**\n     *  Attach a new plug-in.\n     */\n    attachPlugin(plugin) {\n        if (this.#plugins.get(plugin.name)) {\n            throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n        }\n        this.#plugins.set(plugin.name, plugin.connect(this));\n        return this;\n    }\n    /**\n     *  Get a plugin by name.\n     */\n    getPlugin(name) {\n        return (this.#plugins.get(name)) || null;\n    }\n    /**\n     *  Prevent any CCIP-read operation, regardless of whether requested\n     *  in a [[call]] using ``enableCcipRead``.\n     */\n    get disableCcipRead() { return this.#disableCcipRead; }\n    set disableCcipRead(value) { this.#disableCcipRead = !!value; }\n    // Shares multiple identical requests made during the same 250ms\n    async #perform(req) {\n        const timeout = this.#options.cacheTimeout;\n        // Caching disabled\n        if (timeout < 0) {\n            return await this._perform(req);\n        }\n        // Create a tag\n        const tag = getTag(req.method, req);\n        let perform = this.#performCache.get(tag);\n        if (!perform) {\n            perform = this._perform(req);\n            this.#performCache.set(tag, perform);\n            setTimeout(() => {\n                if (this.#performCache.get(tag) === perform) {\n                    this.#performCache.delete(tag);\n                }\n            }, timeout);\n        }\n        return await perform;\n    }\n    /**\n     *  Resolves to the data for executing the CCIP-read operations.\n     */\n    async ccipReadFetch(tx, calldata, urls) {\n        if (this.disableCcipRead || urls.length === 0 || tx.to == null) {\n            return null;\n        }\n        const sender = tx.to.toLowerCase();\n        const data = calldata.toLowerCase();\n        const errorMessages = [];\n        for (let i = 0; i < urls.length; i++) {\n            const url = urls[i];\n            // URL expansion\n            const href = url.replace(\"{sender}\", sender).replace(\"{data}\", data);\n            // If no {data} is present, use POST; otherwise GET\n            //const json: string | null = (url.indexOf(\"{data}\") >= 0) ? null: JSON.stringify({ data, sender });\n            //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => {\n            //    value.status = response.statusCode;\n            //    return value;\n            //});\n            const request = new FetchRequest(href);\n            if (url.indexOf(\"{data}\") === -1) {\n                request.body = { data, sender };\n            }\n            this.emit(\"debug\", { action: \"sendCcipReadFetchRequest\", request, index: i, urls });\n            let errorMessage = \"unknown error\";\n            // Fetch the resource...\n            let resp;\n            try {\n                resp = await request.send();\n            }\n            catch (error) {\n                // ...low-level fetch error (missing host, bad SSL, etc.),\n                // so try next URL\n                errorMessages.push(error.message);\n                this.emit(\"debug\", { action: \"receiveCcipReadFetchError\", request, result: { error } });\n                continue;\n            }\n            try {\n                const result = resp.bodyJson;\n                if (result.data) {\n                    this.emit(\"debug\", { action: \"receiveCcipReadFetchResult\", request, result });\n                    return result.data;\n                }\n                if (result.message) {\n                    errorMessage = result.message;\n                }\n                this.emit(\"debug\", { action: \"receiveCcipReadFetchError\", request, result });\n            }\n            catch (error) { }\n            // 4xx indicates the result is not present; stop\n            assert(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, \"OFFCHAIN_FAULT\", { reason: \"404_MISSING_RESOURCE\", transaction: tx, info: { url, errorMessage } });\n            // 5xx indicates server issue; try the next url\n            errorMessages.push(errorMessage);\n        }\n        assert(false, `error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(\", \")}`, \"OFFCHAIN_FAULT\", {\n            reason: \"500_SERVER_ERROR\",\n            transaction: tx, info: { urls, errorMessages }\n        });\n    }\n    /**\n     *  Provides the opportunity for a sub-class to wrap a block before\n     *  returning it, to add additional properties or an alternate\n     *  sub-class of [[Block]].\n     */\n    _wrapBlock(value, network) {\n        return new Block(formatBlock(value), this);\n    }\n    /**\n     *  Provides the opportunity for a sub-class to wrap a log before\n     *  returning it, to add additional properties or an alternate\n     *  sub-class of [[Log]].\n     */\n    _wrapLog(value, network) {\n        return new Log(formatLog(value), this);\n    }\n    /**\n     *  Provides the opportunity for a sub-class to wrap a transaction\n     *  receipt before returning it, to add additional properties or an\n     *  alternate sub-class of [[TransactionReceipt]].\n     */\n    _wrapTransactionReceipt(value, network) {\n        return new TransactionReceipt(formatTransactionReceipt(value), this);\n    }\n    /**\n     *  Provides the opportunity for a sub-class to wrap a transaction\n     *  response before returning it, to add additional properties or an\n     *  alternate sub-class of [[TransactionResponse]].\n     */\n    _wrapTransactionResponse(tx, network) {\n        return new TransactionResponse(formatTransactionResponse(tx), this);\n    }\n    /**\n     *  Resolves to the Network, forcing a network detection using whatever\n     *  technique the sub-class requires.\n     *\n     *  Sub-classes **must** override this.\n     */\n    _detectNetwork() {\n        assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"_detectNetwork\"\n        });\n    }\n    /**\n     *  Sub-classes should use this to perform all built-in operations. All\n     *  methods sanitizes and normalizes the values passed into this.\n     *\n     *  Sub-classes **must** override this.\n     */\n    async _perform(req) {\n        assert(false, `unsupported method: ${req.method}`, \"UNSUPPORTED_OPERATION\", {\n            operation: req.method,\n            info: req\n        });\n    }\n    // State\n    async getBlockNumber() {\n        const blockNumber = getNumber(await this.#perform({ method: \"getBlockNumber\" }), \"%response\");\n        if (this.#lastBlockNumber >= 0) {\n            this.#lastBlockNumber = blockNumber;\n        }\n        return blockNumber;\n    }\n    /**\n     *  Returns or resolves to the address for %%address%%, resolving ENS\n     *  names and [[Addressable]] objects and returning if already an\n     *  address.\n     */\n    _getAddress(address) {\n        return resolveAddress(address, this);\n    }\n    /**\n     *  Returns or resolves to a valid block tag for %%blockTag%%, resolving\n     *  negative values and returning if already a valid block tag.\n     */\n    _getBlockTag(blockTag) {\n        if (blockTag == null) {\n            return \"latest\";\n        }\n        switch (blockTag) {\n            case \"earliest\":\n                return \"0x0\";\n            case \"finalized\":\n            case \"latest\":\n            case \"pending\":\n            case \"safe\":\n                return blockTag;\n        }\n        if (isHexString(blockTag)) {\n            if (isHexString(blockTag, 32)) {\n                return blockTag;\n            }\n            return toQuantity(blockTag);\n        }\n        if (typeof (blockTag) === \"bigint\") {\n            blockTag = getNumber(blockTag, \"blockTag\");\n        }\n        if (typeof (blockTag) === \"number\") {\n            if (blockTag >= 0) {\n                return toQuantity(blockTag);\n            }\n            if (this.#lastBlockNumber >= 0) {\n                return toQuantity(this.#lastBlockNumber + blockTag);\n            }\n            return this.getBlockNumber().then((b) => toQuantity(b + blockTag));\n        }\n        assertArgument(false, \"invalid blockTag\", \"blockTag\", blockTag);\n    }\n    /**\n     *  Returns or resolves to a filter for %%filter%%, resolving any ENS\n     *  names or [[Addressable]] object and returning if already a valid\n     *  filter.\n     */\n    _getFilter(filter) {\n        // Create a canonical representation of the topics\n        const topics = (filter.topics || []).map((t) => {\n            if (t == null) {\n                return null;\n            }\n            if (Array.isArray(t)) {\n                return concisify(t.map((t) => t.toLowerCase()));\n            }\n            return t.toLowerCase();\n        });\n        const blockHash = (\"blockHash\" in filter) ? filter.blockHash : undefined;\n        const resolve = (_address, fromBlock, toBlock) => {\n            let address = undefined;\n            switch (_address.length) {\n                case 0: break;\n                case 1:\n                    address = _address[0];\n                    break;\n                default:\n                    _address.sort();\n                    address = _address;\n            }\n            if (blockHash) {\n                if (fromBlock != null || toBlock != null) {\n                    throw new Error(\"invalid filter\");\n                }\n            }\n            const filter = {};\n            if (address) {\n                filter.address = address;\n            }\n            if (topics.length) {\n                filter.topics = topics;\n            }\n            if (fromBlock) {\n                filter.fromBlock = fromBlock;\n            }\n            if (toBlock) {\n                filter.toBlock = toBlock;\n            }\n            if (blockHash) {\n                filter.blockHash = blockHash;\n            }\n            return filter;\n        };\n        // Addresses could be async (ENS names or Addressables)\n        let address = [];\n        if (filter.address) {\n            if (Array.isArray(filter.address)) {\n                for (const addr of filter.address) {\n                    address.push(this._getAddress(addr));\n                }\n            }\n            else {\n                address.push(this._getAddress(filter.address));\n            }\n        }\n        let fromBlock = undefined;\n        if (\"fromBlock\" in filter) {\n            fromBlock = this._getBlockTag(filter.fromBlock);\n        }\n        let toBlock = undefined;\n        if (\"toBlock\" in filter) {\n            toBlock = this._getBlockTag(filter.toBlock);\n        }\n        if (address.filter((a) => (typeof (a) !== \"string\")).length ||\n            (fromBlock != null && typeof (fromBlock) !== \"string\") ||\n            (toBlock != null && typeof (toBlock) !== \"string\")) {\n            return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => {\n                return resolve(result[0], result[1], result[2]);\n            });\n        }\n        return resolve(address, fromBlock, toBlock);\n    }\n    /**\n     *  Returns or resolves to a transaction for %%request%%, resolving\n     *  any ENS names or [[Addressable]] and returning if already a valid\n     *  transaction.\n     */\n    _getTransactionRequest(_request) {\n        const request = copyRequest(_request);\n        const promises = [];\n        [\"to\", \"from\"].forEach((key) => {\n            if (request[key] == null) {\n                return;\n            }\n            const addr = resolveAddress(request[key], this);\n            if (isPromise(addr)) {\n                promises.push((async function () { request[key] = await addr; })());\n            }\n            else {\n                request[key] = addr;\n            }\n        });\n        if (request.blockTag != null) {\n            const blockTag = this._getBlockTag(request.blockTag);\n            if (isPromise(blockTag)) {\n                promises.push((async function () { request.blockTag = await blockTag; })());\n            }\n            else {\n                request.blockTag = blockTag;\n            }\n        }\n        if (promises.length) {\n            return (async function () {\n                await Promise.all(promises);\n                return request;\n            })();\n        }\n        return request;\n    }\n    async getNetwork() {\n        // No explicit network was set and this is our first time\n        if (this.#networkPromise == null) {\n            // Detect the current network (shared with all calls)\n            const detectNetwork = (async () => {\n                try {\n                    const network = await this._detectNetwork();\n                    this.emit(\"network\", network, null);\n                    return network;\n                }\n                catch (error) {\n                    if (this.#networkPromise === detectNetwork) {\n                        this.#networkPromise = null;\n                    }\n                    throw error;\n                }\n            })();\n            this.#networkPromise = detectNetwork;\n            return (await detectNetwork).clone();\n        }\n        const networkPromise = this.#networkPromise;\n        const [expected, actual] = await Promise.all([\n            networkPromise,\n            this._detectNetwork() // The actual connected network\n        ]);\n        if (expected.chainId !== actual.chainId) {\n            if (this.#anyNetwork) {\n                // The \"any\" network can change, so notify listeners\n                this.emit(\"network\", actual, expected);\n                // Update the network if something else hasn't already changed it\n                if (this.#networkPromise === networkPromise) {\n                    this.#networkPromise = Promise.resolve(actual);\n                }\n            }\n            else {\n                // Otherwise, we do not allow changes to the underlying network\n                assert(false, `network changed: ${expected.chainId} => ${actual.chainId} `, \"NETWORK_ERROR\", {\n                    event: \"changed\"\n                });\n            }\n        }\n        return expected.clone();\n    }\n    async getFeeData() {\n        const network = await this.getNetwork();\n        const getFeeDataFunc = async () => {\n            const { _block, gasPrice, priorityFee } = await resolveProperties({\n                _block: this.#getBlock(\"latest\", false),\n                gasPrice: ((async () => {\n                    try {\n                        const value = await this.#perform({ method: \"getGasPrice\" });\n                        return getBigInt(value, \"%response\");\n                    }\n                    catch (error) { }\n                    return null;\n                })()),\n                priorityFee: ((async () => {\n                    try {\n                        const value = await this.#perform({ method: \"getPriorityFee\" });\n                        return getBigInt(value, \"%response\");\n                    }\n                    catch (error) { }\n                    return null;\n                })())\n            });\n            let maxFeePerGas = null;\n            let maxPriorityFeePerGas = null;\n            // These are the recommended EIP-1559 heuristics for fee data\n            const block = this._wrapBlock(_block, network);\n            if (block && block.baseFeePerGas) {\n                maxPriorityFeePerGas = (priorityFee != null) ? priorityFee : BigInt(\"1000000000\");\n                maxFeePerGas = (block.baseFeePerGas * BN_2) + maxPriorityFeePerGas;\n            }\n            return new FeeData(gasPrice, maxFeePerGas, maxPriorityFeePerGas);\n        };\n        // Check for a FeeDataNetWorkPlugin\n        const plugin = network.getPlugin(\"org.ethers.plugins.network.FetchUrlFeeDataPlugin\");\n        if (plugin) {\n            const req = new FetchRequest(plugin.url);\n            const feeData = await plugin.processFunc(getFeeDataFunc, this, req);\n            return new FeeData(feeData.gasPrice, feeData.maxFeePerGas, feeData.maxPriorityFeePerGas);\n        }\n        return await getFeeDataFunc();\n    }\n    async estimateGas(_tx) {\n        let tx = this._getTransactionRequest(_tx);\n        if (isPromise(tx)) {\n            tx = await tx;\n        }\n        return getBigInt(await this.#perform({\n            method: \"estimateGas\", transaction: tx\n        }), \"%response\");\n    }\n    async #call(tx, blockTag, attempt) {\n        assert(attempt < MAX_CCIP_REDIRECTS, \"CCIP read exceeded maximum redirections\", \"OFFCHAIN_FAULT\", {\n            reason: \"TOO_MANY_REDIRECTS\",\n            transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true })\n        });\n        // This came in as a PerformActionTransaction, so to/from are safe; we can cast\n        const transaction = copyRequest(tx);\n        try {\n            return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n        }\n        catch (error) {\n            // CCIP Read OffchainLookup\n            if (!this.disableCcipRead && isCallException(error) && error.data && attempt >= 0 && blockTag === \"latest\" && transaction.to != null && dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n                const data = error.data;\n                const txSender = await resolveAddress(transaction.to, this);\n                // Parse the CCIP Read Arguments\n                let ccipArgs;\n                try {\n                    ccipArgs = parseOffchainLookup(dataSlice(error.data, 4));\n                }\n                catch (error) {\n                    assert(false, error.message, \"OFFCHAIN_FAULT\", {\n                        reason: \"BAD_DATA\", transaction, info: { data }\n                    });\n                }\n                // Check the sender of the OffchainLookup matches the transaction\n                assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), \"CCIP Read sender mismatch\", \"CALL_EXCEPTION\", {\n                    action: \"call\",\n                    data,\n                    reason: \"OffchainLookup\",\n                    transaction: transaction,\n                    invocation: null,\n                    revert: {\n                        signature: \"OffchainLookup(address,string[],bytes,bytes4,bytes)\",\n                        name: \"OffchainLookup\",\n                        args: ccipArgs.errorArgs\n                    }\n                });\n                const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls);\n                assert(ccipResult != null, \"CCIP Read failed to fetch data\", \"OFFCHAIN_FAULT\", {\n                    reason: \"FETCH_FAILED\", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs }\n                });\n                const tx = {\n                    to: txSender,\n                    data: concat([ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData])])\n                };\n                this.emit(\"debug\", { action: \"sendCcipReadCall\", transaction: tx });\n                try {\n                    const result = await this.#call(tx, blockTag, attempt + 1);\n                    this.emit(\"debug\", { action: \"receiveCcipReadCallResult\", transaction: Object.assign({}, tx), result });\n                    return result;\n                }\n                catch (error) {\n                    this.emit(\"debug\", { action: \"receiveCcipReadCallError\", transaction: Object.assign({}, tx), error });\n                    throw error;\n                }\n            }\n            throw error;\n        }\n    }\n    async #checkNetwork(promise) {\n        const { value } = await resolveProperties({\n            network: this.getNetwork(),\n            value: promise\n        });\n        return value;\n    }\n    async call(_tx) {\n        const { tx, blockTag } = await resolveProperties({\n            tx: this._getTransactionRequest(_tx),\n            blockTag: this._getBlockTag(_tx.blockTag)\n        });\n        return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1));\n    }\n    // Account\n    async #getAccountValue(request, _address, _blockTag) {\n        let address = this._getAddress(_address);\n        let blockTag = this._getBlockTag(_blockTag);\n        if (typeof (address) !== \"string\" || typeof (blockTag) !== \"string\") {\n            [address, blockTag] = await Promise.all([address, blockTag]);\n        }\n        return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag })));\n    }\n    async getBalance(address, blockTag) {\n        return getBigInt(await this.#getAccountValue({ method: \"getBalance\" }, address, blockTag), \"%response\");\n    }\n    async getTransactionCount(address, blockTag) {\n        return getNumber(await this.#getAccountValue({ method: \"getTransactionCount\" }, address, blockTag), \"%response\");\n    }\n    async getCode(address, blockTag) {\n        return hexlify(await this.#getAccountValue({ method: \"getCode\" }, address, blockTag));\n    }\n    async getStorage(address, _position, blockTag) {\n        const position = getBigInt(_position, \"position\");\n        return hexlify(await this.#getAccountValue({ method: \"getStorage\", position }, address, blockTag));\n    }\n    // Write\n    async broadcastTransaction(signedTx) {\n        const { blockNumber, hash, network } = await resolveProperties({\n            blockNumber: this.getBlockNumber(),\n            hash: this._perform({\n                method: \"broadcastTransaction\",\n                signedTransaction: signedTx\n            }),\n            network: this.getNetwork()\n        });\n        const tx = Transaction.from(signedTx);\n        if (tx.hash !== hash) {\n            throw new Error(\"@TODO: the returned hash did not match\");\n        }\n        return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber);\n    }\n    async #getBlock(block, includeTransactions) {\n        // @TODO: Add CustomBlockPlugin check\n        if (isHexString(block, 32)) {\n            return await this.#perform({\n                method: \"getBlock\", blockHash: block, includeTransactions\n            });\n        }\n        let blockTag = this._getBlockTag(block);\n        if (typeof (blockTag) !== \"string\") {\n            blockTag = await blockTag;\n        }\n        return await this.#perform({\n            method: \"getBlock\", blockTag, includeTransactions\n        });\n    }\n    // Queries\n    async getBlock(block, prefetchTxs) {\n        const { network, params } = await resolveProperties({\n            network: this.getNetwork(),\n            params: this.#getBlock(block, !!prefetchTxs)\n        });\n        if (params == null) {\n            return null;\n        }\n        return this._wrapBlock(params, network);\n    }\n    async getTransaction(hash) {\n        const { network, params } = await resolveProperties({\n            network: this.getNetwork(),\n            params: this.#perform({ method: \"getTransaction\", hash })\n        });\n        if (params == null) {\n            return null;\n        }\n        return this._wrapTransactionResponse(params, network);\n    }\n    async getTransactionReceipt(hash) {\n        const { network, params } = await resolveProperties({\n            network: this.getNetwork(),\n            params: this.#perform({ method: \"getTransactionReceipt\", hash })\n        });\n        if (params == null) {\n            return null;\n        }\n        // Some backends did not backfill the effectiveGasPrice into old transactions\n        // in the receipt, so we look it up manually and inject it.\n        if (params.gasPrice == null && params.effectiveGasPrice == null) {\n            const tx = await this.#perform({ method: \"getTransaction\", hash });\n            if (tx == null) {\n                throw new Error(\"report this; could not find tx or effectiveGasPrice\");\n            }\n            params.effectiveGasPrice = tx.gasPrice;\n        }\n        return this._wrapTransactionReceipt(params, network);\n    }\n    async getTransactionResult(hash) {\n        const { result } = await resolveProperties({\n            network: this.getNetwork(),\n            result: this.#perform({ method: \"getTransactionResult\", hash })\n        });\n        if (result == null) {\n            return null;\n        }\n        return hexlify(result);\n    }\n    // Bloom-filter Queries\n    async getLogs(_filter) {\n        let filter = this._getFilter(_filter);\n        if (isPromise(filter)) {\n            filter = await filter;\n        }\n        const { network, params } = await resolveProperties({\n            network: this.getNetwork(),\n            params: this.#perform({ method: \"getLogs\", filter })\n        });\n        return params.map((p) => this._wrapLog(p, network));\n    }\n    // ENS\n    _getProvider(chainId) {\n        assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"_getProvider()\"\n        });\n    }\n    async getResolver(name) {\n        return await EnsResolver.fromName(this, name);\n    }\n    async getAvatar(name) {\n        const resolver = await this.getResolver(name);\n        if (resolver) {\n            return await resolver.getAvatar();\n        }\n        return null;\n    }\n    async resolveName(name) {\n        const resolver = await this.getResolver(name);\n        if (resolver) {\n            return await resolver.getAddress();\n        }\n        return null;\n    }\n    async lookupAddress(address) {\n        address = getAddress(address);\n        const node = namehash(address.substring(2).toLowerCase() + \".addr.reverse\");\n        try {\n            const ensAddr = await EnsResolver.getEnsAddress(this);\n            const ensContract = new Contract(ensAddr, [\n                \"function resolver(bytes32) view returns (address)\"\n            ], this);\n            const resolver = await ensContract.resolver(node);\n            if (resolver == null || resolver === ZeroAddress) {\n                return null;\n            }\n            const resolverContract = new Contract(resolver, [\n                \"function name(bytes32) view returns (string)\"\n            ], this);\n            const name = await resolverContract.name(node);\n            // Failed forward resolution\n            const check = await this.resolveName(name);\n            if (check !== address) {\n                return null;\n            }\n            return name;\n        }\n        catch (error) {\n            // No data was returned from the resolver\n            if (isError(error, \"BAD_DATA\") && error.value === \"0x\") {\n                return null;\n            }\n            // Something reerted\n            if (isError(error, \"CALL_EXCEPTION\")) {\n                return null;\n            }\n            throw error;\n        }\n        return null;\n    }\n    async waitForTransaction(hash, _confirms, timeout) {\n        const confirms = (_confirms != null) ? _confirms : 1;\n        if (confirms === 0) {\n            return this.getTransactionReceipt(hash);\n        }\n        return new Promise(async (resolve, reject) => {\n            let timer = null;\n            const listener = (async (blockNumber) => {\n                try {\n                    const receipt = await this.getTransactionReceipt(hash);\n                    if (receipt != null) {\n                        if (blockNumber - receipt.blockNumber + 1 >= confirms) {\n                            resolve(receipt);\n                            //this.off(\"block\", listener);\n                            if (timer) {\n                                clearTimeout(timer);\n                                timer = null;\n                            }\n                            return;\n                        }\n                    }\n                }\n                catch (error) {\n                    console.log(\"EEE\", error);\n                }\n                this.once(\"block\", listener);\n            });\n            if (timeout != null) {\n                timer = setTimeout(() => {\n                    if (timer == null) {\n                        return;\n                    }\n                    timer = null;\n                    this.off(\"block\", listener);\n                    reject(makeError(\"timeout\", \"TIMEOUT\", { reason: \"timeout\" }));\n                }, timeout);\n            }\n            listener(await this.getBlockNumber());\n        });\n    }\n    async waitForBlock(blockTag) {\n        assert(false, \"not implemented yet\", \"NOT_IMPLEMENTED\", {\n            operation: \"waitForBlock\"\n        });\n    }\n    /**\n     *  Clear a timer created using the [[_setTimeout]] method.\n     */\n    _clearTimeout(timerId) {\n        const timer = this.#timers.get(timerId);\n        if (!timer) {\n            return;\n        }\n        if (timer.timer) {\n            clearTimeout(timer.timer);\n        }\n        this.#timers.delete(timerId);\n    }\n    /**\n     *  Create a timer that will execute %%func%% after at least %%timeout%%\n     *  (in ms). If %%timeout%% is unspecified, then %%func%% will execute\n     *  in the next event loop.\n     *\n     *  [Pausing](AbstractProvider-paused) the provider will pause any\n     *  associated timers.\n     */\n    _setTimeout(_func, timeout) {\n        if (timeout == null) {\n            timeout = 0;\n        }\n        const timerId = this.#nextTimer++;\n        const func = () => {\n            this.#timers.delete(timerId);\n            _func();\n        };\n        if (this.paused) {\n            this.#timers.set(timerId, { timer: null, func, time: timeout });\n        }\n        else {\n            const timer = setTimeout(func, timeout);\n            this.#timers.set(timerId, { timer, func, time: getTime() });\n        }\n        return timerId;\n    }\n    /**\n     *  Perform %%func%% on each subscriber.\n     */\n    _forEachSubscriber(func) {\n        for (const sub of this.#subs.values()) {\n            func(sub.subscriber);\n        }\n    }\n    /**\n     *  Sub-classes may override this to customize subscription\n     *  implementations.\n     */\n    _getSubscriber(sub) {\n        switch (sub.type) {\n            case \"debug\":\n            case \"error\":\n            case \"network\":\n                return new UnmanagedSubscriber(sub.type);\n            case \"block\": {\n                const subscriber = new PollingBlockSubscriber(this);\n                subscriber.pollingInterval = this.pollingInterval;\n                return subscriber;\n            }\n            case \"safe\":\n            case \"finalized\":\n                return new PollingBlockTagSubscriber(this, sub.type);\n            case \"event\":\n                return new PollingEventSubscriber(this, sub.filter);\n            case \"transaction\":\n                return new PollingTransactionSubscriber(this, sub.hash);\n            case \"orphan\":\n                return new PollingOrphanSubscriber(this, sub.filter);\n        }\n        throw new Error(`unsupported event: ${sub.type}`);\n    }\n    /**\n     *  If a [[Subscriber]] fails and needs to replace itself, this\n     *  method may be used.\n     *\n     *  For example, this is used for providers when using the\n     *  ``eth_getFilterChanges`` method, which can return null if state\n     *  filters are not supported by the backend, allowing the Subscriber\n     *  to swap in a [[PollingEventSubscriber]].\n     */\n    _recoverSubscriber(oldSub, newSub) {\n        for (const sub of this.#subs.values()) {\n            if (sub.subscriber === oldSub) {\n                if (sub.started) {\n                    sub.subscriber.stop();\n                }\n                sub.subscriber = newSub;\n                if (sub.started) {\n                    newSub.start();\n                }\n                if (this.#pausedState != null) {\n                    newSub.pause(this.#pausedState);\n                }\n                break;\n            }\n        }\n    }\n    async #hasSub(event, emitArgs) {\n        let sub = await getSubscription(event, this);\n        // This is a log that is removing an existing log; we actually want\n        // to emit an orphan event for the removed log\n        if (sub.type === \"event\" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) {\n            sub = await getSubscription({ orphan: \"drop-log\", log: emitArgs[0] }, this);\n        }\n        return this.#subs.get(sub.tag) || null;\n    }\n    async #getSub(event) {\n        const subscription = await getSubscription(event, this);\n        // Prevent tampering with our tag in any subclass' _getSubscriber\n        const tag = subscription.tag;\n        let sub = this.#subs.get(tag);\n        if (!sub) {\n            const subscriber = this._getSubscriber(subscription);\n            const addressableMap = new WeakMap();\n            const nameMap = new Map();\n            sub = { subscriber, tag, addressableMap, nameMap, started: false, listeners: [] };\n            this.#subs.set(tag, sub);\n        }\n        return sub;\n    }\n    async on(event, listener) {\n        const sub = await this.#getSub(event);\n        sub.listeners.push({ listener, once: false });\n        if (!sub.started) {\n            sub.subscriber.start();\n            sub.started = true;\n            if (this.#pausedState != null) {\n                sub.subscriber.pause(this.#pausedState);\n            }\n        }\n        return this;\n    }\n    async once(event, listener) {\n        const sub = await this.#getSub(event);\n        sub.listeners.push({ listener, once: true });\n        if (!sub.started) {\n            sub.subscriber.start();\n            sub.started = true;\n            if (this.#pausedState != null) {\n                sub.subscriber.pause(this.#pausedState);\n            }\n        }\n        return this;\n    }\n    async emit(event, ...args) {\n        const sub = await this.#hasSub(event, args);\n        // If there is not subscription or if a recent emit removed\n        // the last of them (which also deleted the sub) do nothing\n        if (!sub || sub.listeners.length === 0) {\n            return false;\n        }\n        ;\n        const count = sub.listeners.length;\n        sub.listeners = sub.listeners.filter(({ listener, once }) => {\n            const payload = new EventPayload(this, (once ? null : listener), event);\n            try {\n                listener.call(this, ...args, payload);\n            }\n            catch (error) { }\n            return !once;\n        });\n        if (sub.listeners.length === 0) {\n            if (sub.started) {\n                sub.subscriber.stop();\n            }\n            this.#subs.delete(sub.tag);\n        }\n        return (count > 0);\n    }\n    async listenerCount(event) {\n        if (event) {\n            const sub = await this.#hasSub(event);\n            if (!sub) {\n                return 0;\n            }\n            return sub.listeners.length;\n        }\n        let total = 0;\n        for (const { listeners } of this.#subs.values()) {\n            total += listeners.length;\n        }\n        return total;\n    }\n    async listeners(event) {\n        if (event) {\n            const sub = await this.#hasSub(event);\n            if (!sub) {\n                return [];\n            }\n            return sub.listeners.map(({ listener }) => listener);\n        }\n        let result = [];\n        for (const { listeners } of this.#subs.values()) {\n            result = result.concat(listeners.map(({ listener }) => listener));\n        }\n        return result;\n    }\n    async off(event, listener) {\n        const sub = await this.#hasSub(event);\n        if (!sub) {\n            return this;\n        }\n        if (listener) {\n            const index = sub.listeners.map(({ listener }) => listener).indexOf(listener);\n            if (index >= 0) {\n                sub.listeners.splice(index, 1);\n            }\n        }\n        if (!listener || sub.listeners.length === 0) {\n            if (sub.started) {\n                sub.subscriber.stop();\n            }\n            this.#subs.delete(sub.tag);\n        }\n        return this;\n    }\n    async removeAllListeners(event) {\n        if (event) {\n            const { tag, started, subscriber } = await this.#getSub(event);\n            if (started) {\n                subscriber.stop();\n            }\n            this.#subs.delete(tag);\n        }\n        else {\n            for (const [tag, { started, subscriber }] of this.#subs) {\n                if (started) {\n                    subscriber.stop();\n                }\n                this.#subs.delete(tag);\n            }\n        }\n        return this;\n    }\n    // Alias for \"on\"\n    async addListener(event, listener) {\n        return await this.on(event, listener);\n    }\n    // Alias for \"off\"\n    async removeListener(event, listener) {\n        return this.off(event, listener);\n    }\n    /**\n     *  If this provider has been destroyed using the [[destroy]] method.\n     *\n     *  Once destroyed, all resources are reclaimed, internal event loops\n     *  and timers are cleaned up and no further requests may be sent to\n     *  the provider.\n     */\n    get destroyed() {\n        return this.#destroyed;\n    }\n    /**\n     *  Sub-classes may use this to shutdown any sockets or release their\n     *  resources and reject any pending requests.\n     *\n     *  Sub-classes **must** call ``super.destroy()``.\n     */\n    destroy() {\n        // Stop all listeners\n        this.removeAllListeners();\n        // Shut down all tiemrs\n        for (const timerId of this.#timers.keys()) {\n            this._clearTimeout(timerId);\n        }\n        this.#destroyed = true;\n    }\n    /**\n     *  Whether the provider is currently paused.\n     *\n     *  A paused provider will not emit any events, and generally should\n     *  not make any requests to the network, but that is up to sub-classes\n     *  to manage.\n     *\n     *  Setting ``paused = true`` is identical to calling ``.pause(false)``,\n     *  which will buffer any events that occur while paused until the\n     *  provider is unpaused.\n     */\n    get paused() { return (this.#pausedState != null); }\n    set paused(pause) {\n        if (!!pause === this.paused) {\n            return;\n        }\n        if (this.paused) {\n            this.resume();\n        }\n        else {\n            this.pause(false);\n        }\n    }\n    /**\n     *  Pause the provider. If %%dropWhilePaused%%, any events that occur\n     *  while paused are dropped, otherwise all events will be emitted once\n     *  the provider is unpaused.\n     */\n    pause(dropWhilePaused) {\n        this.#lastBlockNumber = -1;\n        if (this.#pausedState != null) {\n            if (this.#pausedState == !!dropWhilePaused) {\n                return;\n            }\n            assert(false, \"cannot change pause type; resume first\", \"UNSUPPORTED_OPERATION\", {\n                operation: \"pause\"\n            });\n        }\n        this._forEachSubscriber((s) => s.pause(dropWhilePaused));\n        this.#pausedState = !!dropWhilePaused;\n        for (const timer of this.#timers.values()) {\n            // Clear the timer\n            if (timer.timer) {\n                clearTimeout(timer.timer);\n            }\n            // Remaining time needed for when we become unpaused\n            timer.time = getTime() - timer.time;\n        }\n    }\n    /**\n     *  Resume the provider.\n     */\n    resume() {\n        if (this.#pausedState == null) {\n            return;\n        }\n        this._forEachSubscriber((s) => s.resume());\n        this.#pausedState = null;\n        for (const timer of this.#timers.values()) {\n            // Remaining time when we were paused\n            let timeout = timer.time;\n            if (timeout < 0) {\n                timeout = 0;\n            }\n            // Start time (in cause paused, so we con compute remaininf time)\n            timer.time = getTime();\n            // Start the timer\n            setTimeout(timer.func, timeout);\n        }\n    }\n}\nfunction _parseString(result, start) {\n    try {\n        const bytes = _parseBytes(result, start);\n        if (bytes) {\n            return toUtf8String(bytes);\n        }\n    }\n    catch (error) { }\n    return null;\n}\nfunction _parseBytes(result, start) {\n    if (result === \"0x\") {\n        return null;\n    }\n    try {\n        const offset = getNumber(dataSlice(result, start, start + 32));\n        const length = getNumber(dataSlice(result, offset, offset + 32));\n        return dataSlice(result, offset + 32, offset + 32 + length);\n    }\n    catch (error) { }\n    return null;\n}\nfunction numPad(value) {\n    const result = toBeArray(value);\n    if (result.length > 32) {\n        throw new Error(\"internal; should not happen\");\n    }\n    const padded = new Uint8Array(32);\n    padded.set(result, 32 - result.length);\n    return padded;\n}\nfunction bytesPad(value) {\n    if ((value.length % 32) === 0) {\n        return value;\n    }\n    const result = new Uint8Array(Math.ceil(value.length / 32) * 32);\n    result.set(value);\n    return result;\n}\nconst empty = new Uint8Array([]);\n// ABI Encodes a series of (bytes, bytes, ...)\nfunction encodeBytes(datas) {\n    const result = [];\n    let byteCount = 0;\n    // Add place-holders for pointers as we add items\n    for (let i = 0; i < datas.length; i++) {\n        result.push(empty);\n        byteCount += 32;\n    }\n    for (let i = 0; i < datas.length; i++) {\n        const data = getBytes(datas[i]);\n        // Update the bytes offset\n        result[i] = numPad(byteCount);\n        // The length and padded value of data\n        result.push(numPad(data.length));\n        result.push(bytesPad(data));\n        byteCount += 32 + Math.ceil(data.length / 32) * 32;\n    }\n    return concat(result);\n}\nconst zeros = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\nfunction parseOffchainLookup(data) {\n    const result = {\n        sender: \"\", urls: [], calldata: \"\", selector: \"\", extraData: \"\", errorArgs: []\n    };\n    assert(dataLength(data) >= 5 * 32, \"insufficient OffchainLookup data\", \"OFFCHAIN_FAULT\", {\n        reason: \"insufficient OffchainLookup data\"\n    });\n    const sender = dataSlice(data, 0, 32);\n    assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), \"corrupt OffchainLookup sender\", \"OFFCHAIN_FAULT\", {\n        reason: \"corrupt OffchainLookup sender\"\n    });\n    result.sender = dataSlice(sender, 12);\n    // Read the URLs from the response\n    try {\n        const urls = [];\n        const urlsOffset = getNumber(dataSlice(data, 32, 64));\n        const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32));\n        const urlsData = dataSlice(data, urlsOffset + 32);\n        for (let u = 0; u < urlsLength; u++) {\n            const url = _parseString(urlsData, u * 32);\n            if (url == null) {\n                throw new Error(\"abort\");\n            }\n            urls.push(url);\n        }\n        result.urls = urls;\n    }\n    catch (error) {\n        assert(false, \"corrupt OffchainLookup urls\", \"OFFCHAIN_FAULT\", {\n            reason: \"corrupt OffchainLookup urls\"\n        });\n    }\n    // Get the CCIP calldata to forward\n    try {\n        const calldata = _parseBytes(data, 64);\n        if (calldata == null) {\n            throw new Error(\"abort\");\n        }\n        result.calldata = calldata;\n    }\n    catch (error) {\n        assert(false, \"corrupt OffchainLookup calldata\", \"OFFCHAIN_FAULT\", {\n            reason: \"corrupt OffchainLookup calldata\"\n        });\n    }\n    // Get the callbackSelector (bytes4)\n    assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), \"corrupt OffchainLookup callbaackSelector\", \"OFFCHAIN_FAULT\", {\n        reason: \"corrupt OffchainLookup callbaackSelector\"\n    });\n    result.selector = dataSlice(data, 96, 100);\n    // Get the extra data to send back to the contract as context\n    try {\n        const extraData = _parseBytes(data, 128);\n        if (extraData == null) {\n            throw new Error(\"abort\");\n        }\n        result.extraData = extraData;\n    }\n    catch (error) {\n        assert(false, \"corrupt OffchainLookup extraData\", \"OFFCHAIN_FAULT\", {\n            reason: \"corrupt OffchainLookup extraData\"\n        });\n    }\n    result.errorArgs = \"sender,urls,calldata,selector,extraData\".split(/,/).map((k) => result[k]);\n    return result;\n}\n//# sourceMappingURL=abstract-provider.js.map/**\n *  Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes\n *  are sufficent for most developers, but this is provided to\n *  fascilitate more complex Signers.\n *\n *  @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/index.js\";\nimport { Transaction } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from \"../utils/index.js\";\nimport { copyRequest } from \"./provider.js\";\nfunction checkProvider(signer, operation) {\n    if (signer.provider) {\n        return signer.provider;\n    }\n    assert(false, \"missing provider\", \"UNSUPPORTED_OPERATION\", { operation });\n}\nasync function populate(signer, tx) {\n    let pop = copyRequest(tx);\n    if (pop.to != null) {\n        pop.to = resolveAddress(pop.to, signer);\n    }\n    if (pop.from != null) {\n        const from = pop.from;\n        pop.from = Promise.all([\n            signer.getAddress(),\n            resolveAddress(from, signer)\n        ]).then(([address, from]) => {\n            assertArgument(address.toLowerCase() === from.toLowerCase(), \"transaction from mismatch\", \"tx.from\", from);\n            return address;\n        });\n    }\n    else {\n        pop.from = signer.getAddress();\n    }\n    return await resolveProperties(pop);\n}\n/**\n *  An **AbstractSigner** includes most of teh functionality required\n *  to get a [[Signer]] working as expected, but requires a few\n *  Signer-specific methods be overridden.\n *\n */\nexport class AbstractSigner {\n    /**\n     *  The provider this signer is connected to.\n     */\n    provider;\n    /**\n     *  Creates a new Signer connected to %%provider%%.\n     */\n    constructor(provider) {\n        defineProperties(this, { provider: (provider || null) });\n    }\n    async getNonce(blockTag) {\n        return checkProvider(this, \"getTransactionCount\").getTransactionCount(await this.getAddress(), blockTag);\n    }\n    async populateCall(tx) {\n        const pop = await populate(this, tx);\n        return pop;\n    }\n    async populateTransaction(tx) {\n        const provider = checkProvider(this, \"populateTransaction\");\n        const pop = await populate(this, tx);\n        if (pop.nonce == null) {\n            pop.nonce = await this.getNonce(\"pending\");\n        }\n        if (pop.gasLimit == null) {\n            pop.gasLimit = await this.estimateGas(pop);\n        }\n        // Populate the chain ID\n        const network = await (this.provider).getNetwork();\n        if (pop.chainId != null) {\n            const chainId = getBigInt(pop.chainId);\n            assertArgument(chainId === network.chainId, \"transaction chainId mismatch\", \"tx.chainId\", tx.chainId);\n        }\n        else {\n            pop.chainId = network.chainId;\n        }\n        // Do not allow mixing pre-eip-1559 and eip-1559 properties\n        const hasEip1559 = (pop.maxFeePerGas != null || pop.maxPriorityFeePerGas != null);\n        if (pop.gasPrice != null && (pop.type === 2 || hasEip1559)) {\n            assertArgument(false, \"eip-1559 transaction do not support gasPrice\", \"tx\", tx);\n        }\n        else if ((pop.type === 0 || pop.type === 1) && hasEip1559) {\n            assertArgument(false, \"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas\", \"tx\", tx);\n        }\n        if ((pop.type === 2 || pop.type == null) && (pop.maxFeePerGas != null && pop.maxPriorityFeePerGas != null)) {\n            // Fully-formed EIP-1559 transaction (skip getFeeData)\n            pop.type = 2;\n        }\n        else if (pop.type === 0 || pop.type === 1) {\n            // Explicit Legacy or EIP-2930 transaction\n            // We need to get fee data to determine things\n            const feeData = await provider.getFeeData();\n            assert(feeData.gasPrice != null, \"network does not support gasPrice\", \"UNSUPPORTED_OPERATION\", {\n                operation: \"getGasPrice\"\n            });\n            // Populate missing gasPrice\n            if (pop.gasPrice == null) {\n                pop.gasPrice = feeData.gasPrice;\n            }\n        }\n        else {\n            // We need to get fee data to determine things\n            const feeData = await provider.getFeeData();\n            if (pop.type == null) {\n                // We need to auto-detect the intended type of this transaction...\n                if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) {\n                    // The network supports EIP-1559!\n                    // Upgrade transaction from null to eip-1559\n                    if (pop.authorizationList && pop.authorizationList.length) {\n                        pop.type = 4;\n                    }\n                    else {\n                        pop.type = 2;\n                    }\n                    if (pop.gasPrice != null) {\n                        // Using legacy gasPrice property on an eip-1559 network,\n                        // so use gasPrice as both fee properties\n                        const gasPrice = pop.gasPrice;\n                        delete pop.gasPrice;\n                        pop.maxFeePerGas = gasPrice;\n                        pop.maxPriorityFeePerGas = gasPrice;\n                    }\n                    else {\n                        // Populate missing fee data\n                        if (pop.maxFeePerGas == null) {\n                            pop.maxFeePerGas = feeData.maxFeePerGas;\n                        }\n                        if (pop.maxPriorityFeePerGas == null) {\n                            pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n                        }\n                    }\n                }\n                else if (feeData.gasPrice != null) {\n                    // Network doesn't support EIP-1559...\n                    // ...but they are trying to use EIP-1559 properties\n                    assert(!hasEip1559, \"network does not support EIP-1559\", \"UNSUPPORTED_OPERATION\", {\n                        operation: \"populateTransaction\"\n                    });\n                    // Populate missing fee data\n                    if (pop.gasPrice == null) {\n                        pop.gasPrice = feeData.gasPrice;\n                    }\n                    // Explicitly set untyped transaction to legacy\n                    // @TODO: Maybe this shold allow type 1?\n                    pop.type = 0;\n                }\n                else {\n                    // getFeeData has failed us.\n                    assert(false, \"failed to get consistent fee data\", \"UNSUPPORTED_OPERATION\", {\n                        operation: \"signer.getFeeData\"\n                    });\n                }\n            }\n            else if (pop.type === 2 || pop.type === 3 || pop.type === 4) {\n                // Explicitly using EIP-1559 or EIP-4844\n                // Populate missing fee data\n                if (pop.maxFeePerGas == null) {\n                    pop.maxFeePerGas = feeData.maxFeePerGas;\n                }\n                if (pop.maxPriorityFeePerGas == null) {\n                    pop.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n                }\n            }\n        }\n        //@TOOD: Don't await all over the place; save them up for\n        // the end for better batching\n        return await resolveProperties(pop);\n    }\n    async populateAuthorization(_auth) {\n        const auth = Object.assign({}, _auth);\n        // Add a chain ID if not explicitly set to 0\n        if (auth.chainId == null) {\n            auth.chainId = (await checkProvider(this, \"getNetwork\").getNetwork()).chainId;\n        }\n        // @TODO: Take chain ID into account when populating noce?\n        if (auth.nonce == null) {\n            auth.nonce = await this.getNonce();\n        }\n        return auth;\n    }\n    async estimateGas(tx) {\n        return checkProvider(this, \"estimateGas\").estimateGas(await this.populateCall(tx));\n    }\n    async call(tx) {\n        return checkProvider(this, \"call\").call(await this.populateCall(tx));\n    }\n    async resolveName(name) {\n        const provider = checkProvider(this, \"resolveName\");\n        return await provider.resolveName(name);\n    }\n    async sendTransaction(tx) {\n        const provider = checkProvider(this, \"sendTransaction\");\n        const pop = await this.populateTransaction(tx);\n        delete pop.from;\n        const txObj = Transaction.from(pop);\n        return await provider.broadcastTransaction(await this.signTransaction(txObj));\n    }\n    // @TODO: in v7 move this to be abstract\n    authorize(authorization) {\n        assert(false, \"authorization not implemented for this signer\", \"UNSUPPORTED_OPERATION\", { operation: \"authorize\" });\n    }\n}\n/**\n *  A **VoidSigner** is a class deisgned to allow an address to be used\n *  in any API which accepts a Signer, but for which there are no\n *  credentials available to perform any actual signing.\n *\n *  This for example allow impersonating an account for the purpose of\n *  static calls or estimating gas, but does not allow sending transactions.\n */\nexport class VoidSigner extends AbstractSigner {\n    /**\n     *  The signer address.\n     */\n    address;\n    /**\n     *  Creates a new **VoidSigner** with %%address%% attached to\n     *  %%provider%%.\n     */\n    constructor(address, provider) {\n        super(provider);\n        defineProperties(this, { address });\n    }\n    async getAddress() { return this.address; }\n    connect(provider) {\n        return new VoidSigner(this.address, provider);\n    }\n    #throwUnsupported(suffix, operation) {\n        assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", { operation });\n    }\n    async signTransaction(tx) {\n        this.#throwUnsupported(\"transactions\", \"signTransaction\");\n    }\n    async signMessage(message) {\n        this.#throwUnsupported(\"messages\", \"signMessage\");\n    }\n    async signTypedData(domain, types, value) {\n        this.#throwUnsupported(\"typed-data\", \"signTypedData\");\n    }\n}\n//# sourceMappingURL=abstract-signer.js.map/**\n *  There are many awesome community services that provide Ethereum\n *  nodes both for developers just starting out and for large-scale\n *  communities.\n *\n *  @_section: api/providers/thirdparty: Community Providers  [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n *  Displays a warning in the console when the community resource is\n *  being used too heavily by the app, recommending the developer\n *  acquire their own credentials instead of using the community\n *  credentials.\n *\n *  The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n    if (shown.has(service)) {\n        return;\n    }\n    shown.add(service);\n    console.log(\"========= NOTICE =========\");\n    console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n    console.log(\"\");\n    console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n    console.log(\"community resource for low-traffic projects and early prototyping.\");\n    console.log(\"\");\n    console.log(\"While your application will continue to function, we highly recommended\");\n    console.log(\"signing up for your own API keys to improve performance, increase your\");\n    console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n    console.log(\"\");\n    console.log(\"For more details: https:/\\/docs.ethers.org/api-keys/\");\n    console.log(\"==========================\");\n}\n//# sourceMappingURL=community.js.mapimport { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\n//import { BlockscoutProvider } from \"./provider-blockscout.js\";\nimport { ChainstackProvider } from \"./provider-chainstack.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { EtherscanProvider } from \"./provider-etherscan.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { Network } from \"./network.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n    return (value && typeof (value.send) === \"function\" &&\n        typeof (value.close) === \"function\");\n}\nconst Testnets = \"goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt\".split(\" \");\n/**\n *  Returns a default provider for %%network%%.\n *\n *  If %%network%% is a [[WebSocketLike]] or string that begins with\n *  ``\"ws:\"`` or ``\"wss:\"``, a [[WebSocketProvider]] is returned backed\n *  by that WebSocket or URL.\n *\n *  If %%network%% is a string that begins with ``\"HTTP:\"`` or ``\"HTTPS:\"``,\n *  a [[JsonRpcProvider]] is returned connected to that URL.\n *\n *  Otherwise, a default provider is created backed by well-known public\n *  Web3 backends (such as [[link-infura]]) using community-provided API\n *  keys.\n *\n *  The %%options%% allows specifying custom API keys per backend (setting\n *  an API key to ``\"-\"`` will omit that provider) and ``options.exclusive``\n *  can be set to either a backend name or and array of backend names, which\n *  will whitelist **only** those backends.\n *\n *  Current backend strings supported are:\n *  - ``\"alchemy\"``\n *  - ``\"ankr\"``\n *  - ``\"cloudflare\"``\n *  - ``\"chainstack\"``\n *  - ``\"etherscan\"``\n *  - ``\"infura\"``\n *  - ``\"publicPolygon\"``\n *  - ``\"quicknode\"``\n *\n *  @example:\n *    // Connect to a local Geth node\n *    provider = getDefaultProvider(\"http://localhost:8545/\");\n *\n *    // Connect to Ethereum mainnet with any current and future\n *    // third-party services available\n *    provider = getDefaultProvider(\"mainnet\");\n *\n *    // Connect to Polygon, but only allow Etherscan and\n *    // INFURA and use \"MY_API_KEY\" in calls to Etherscan.\n *    provider = getDefaultProvider(\"matic\", {\n *      etherscan: \"MY_API_KEY\",\n *      exclusive: [ \"etherscan\", \"infura\" ]\n *    });\n */\nexport function getDefaultProvider(network, options) {\n    if (options == null) {\n        options = {};\n    }\n    const allowService = (name) => {\n        if (options[name] === \"-\") {\n            return false;\n        }\n        if (typeof (options.exclusive) === \"string\") {\n            return (name === options.exclusive);\n        }\n        if (Array.isArray(options.exclusive)) {\n            return (options.exclusive.indexOf(name) !== -1);\n        }\n        return true;\n    };\n    if (typeof (network) === \"string\" && network.match(/^https?:/)) {\n        return new JsonRpcProvider(network);\n    }\n    if (typeof (network) === \"string\" && network.match(/^wss?:/) || isWebSocketLike(network)) {\n        return new WebSocketProvider(network);\n    }\n    // Get the network and name, if possible\n    let staticNetwork = null;\n    try {\n        staticNetwork = Network.from(network);\n    }\n    catch (error) { }\n    const providers = [];\n    if (allowService(\"publicPolygon\") && staticNetwork) {\n        if (staticNetwork.name === \"matic\") {\n            providers.push(new JsonRpcProvider(\"https:/\\/polygon-rpc.com/\", staticNetwork, { staticNetwork }));\n        }\n        else if (staticNetwork.name === \"matic-amoy\") {\n            providers.push(new JsonRpcProvider(\"https:/\\/rpc-amoy.polygon.technology/\", staticNetwork, { staticNetwork }));\n        }\n    }\n    if (allowService(\"alchemy\")) {\n        try {\n            providers.push(new AlchemyProvider(network, options.alchemy));\n        }\n        catch (error) { }\n    }\n    if (allowService(\"ankr\") && options.ankr != null) {\n        try {\n            providers.push(new AnkrProvider(network, options.ankr));\n        }\n        catch (error) { }\n    }\n    /* Temporarily remove until custom error issue is fixed\n        if (allowService(\"blockscout\")) {\n            try {\n                providers.push(new BlockscoutProvider(network, options.blockscout));\n            } catch (error) { }\n        }\n    */\n    if (allowService(\"chainstack\")) {\n        try {\n            providers.push(new ChainstackProvider(network, options.chainstack));\n        }\n        catch (error) { }\n    }\n    if (allowService(\"cloudflare\")) {\n        try {\n            providers.push(new CloudflareProvider(network));\n        }\n        catch (error) { }\n    }\n    if (allowService(\"etherscan\")) {\n        try {\n            providers.push(new EtherscanProvider(network, options.etherscan));\n        }\n        catch (error) { }\n    }\n    if (allowService(\"infura\")) {\n        try {\n            let projectId = options.infura;\n            let projectSecret = undefined;\n            if (typeof (projectId) === \"object\") {\n                projectSecret = projectId.projectSecret;\n                projectId = projectId.projectId;\n            }\n            providers.push(new InfuraProvider(network, projectId, projectSecret));\n        }\n        catch (error) { }\n    }\n    /*\n        if (options.pocket !== \"-\") {\n            try {\n                let appId = options.pocket;\n                let secretKey: undefined | string = undefined;\n                let loadBalancer: undefined | boolean = undefined;\n                if (typeof(appId) === \"object\") {\n                    loadBalancer = !!appId.loadBalancer;\n                    secretKey = appId.secretKey;\n                    appId = appId.appId;\n                }\n                providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n            } catch (error) { console.log(error); }\n        }\n    */\n    if (allowService(\"quicknode\")) {\n        try {\n            let token = options.quicknode;\n            providers.push(new QuickNodeProvider(network, token));\n        }\n        catch (error) { }\n    }\n    assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n        operation: \"getDefaultProvider\"\n    });\n    // No need for a FallbackProvider\n    if (providers.length === 1) {\n        return providers[0];\n    }\n    // We use the floor because public third-party providers can be unreliable,\n    // so a low number of providers with a large quorum will fail too often\n    let quorum = Math.floor(providers.length / 2);\n    if (quorum > 2) {\n        quorum = 2;\n    }\n    // Testnets don't need as strong a security gaurantee and speed is\n    // more useful during testing\n    if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) {\n        quorum = 1;\n    }\n    // Provided override qorum takes priority\n    if (options && options.quorum) {\n        quorum = options.quorum;\n    }\n    return new FallbackProvider(providers, undefined, { quorum });\n}\n//# sourceMappingURL=default-provider.js.map/**\n *  ENS is a service which allows easy-to-remember names to map to\n *  network addresses.\n *\n *  @_section: api/providers/ens-resolver:ENS Resolver  [about-ens-rsolver]\n */\nimport { getAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { dnsEncode, namehash } from \"../hash/index.js\";\nimport { hexlify, isHexString, toBeHex, defineProperties, encodeBase58, assert, assertArgument, isError, FetchRequest } from \"../utils/index.js\";\n// @TODO: This should use the fetch-data:ipfs gateway\n// Trim off the ipfs:// prefix and return the default gateway URL\nfunction getIpfsLink(link) {\n    if (link.match(/^ipfs:\\/\\/ipfs\\//i)) {\n        link = link.substring(12);\n    }\n    else if (link.match(/^ipfs:\\/\\//i)) {\n        link = link.substring(7);\n    }\n    else {\n        assertArgument(false, \"unsupported IPFS format\", \"link\", link);\n    }\n    return `https:/\\/gateway.ipfs.io/ipfs/${link}`;\n}\n;\n;\n/**\n *  A provider plugin super-class for processing multicoin address types.\n */\nexport class MulticoinProviderPlugin {\n    /**\n     *  The name.\n     */\n    name;\n    /**\n     *  Creates a new **MulticoinProviderPluing** for %%name%%.\n     */\n    constructor(name) {\n        defineProperties(this, { name });\n    }\n    connect(proivder) {\n        return this;\n    }\n    /**\n     *  Returns ``true`` if %%coinType%% is supported by this plugin.\n     */\n    supportsCoinType(coinType) {\n        return false;\n    }\n    /**\n     *  Resolves to the encoded %%address%% for %%coinType%%.\n     */\n    async encodeAddress(coinType, address) {\n        throw new Error(\"unsupported coin\");\n    }\n    /**\n     *  Resolves to the decoded %%data%% for %%coinType%%.\n     */\n    async decodeAddress(coinType, data) {\n        throw new Error(\"unsupported coin\");\n    }\n}\nconst BasicMulticoinPluginId = \"org.ethers.plugins.provider.BasicMulticoin\";\n/**\n *  A **BasicMulticoinProviderPlugin** provides service for common\n *  coin types, which do not require additional libraries to encode or\n *  decode.\n */\nexport class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin {\n    /**\n     *  Creates a new **BasicMulticoinProviderPlugin**.\n     */\n    constructor() {\n        super(BasicMulticoinPluginId);\n    }\n}\nconst matcherIpfs = new RegExp(\"^(ipfs):/\\/(.*)$\", \"i\");\nconst matchers = [\n    new RegExp(\"^(https):/\\/(.*)$\", \"i\"),\n    new RegExp(\"^(data):(.*)$\", \"i\"),\n    matcherIpfs,\n    new RegExp(\"^eip155:[0-9]+/(erc[0-9]+):(.*)$\", \"i\"),\n];\n/**\n *  A connected object to a resolved ENS name resolver, which can be\n *  used to query additional details.\n */\nexport class EnsResolver {\n    /**\n     *  The connected provider.\n     */\n    provider;\n    /**\n     *  The address of the resolver.\n     */\n    address;\n    /**\n     *  The name this resolver was resolved against.\n     */\n    name;\n    // For EIP-2544 names, the ancestor that provided the resolver\n    #supports2544;\n    #resolver;\n    constructor(provider, address, name) {\n        defineProperties(this, { provider, address, name });\n        this.#supports2544 = null;\n        this.#resolver = new Contract(address, [\n            \"function supportsInterface(bytes4) view returns (bool)\",\n            \"function resolve(bytes, bytes) view returns (bytes)\",\n            \"function addr(bytes32) view returns (address)\",\n            \"function addr(bytes32, uint) view returns (bytes)\",\n            \"function text(bytes32, string) view returns (string)\",\n            \"function contenthash(bytes32) view returns (bytes)\",\n        ], provider);\n    }\n    /**\n     *  Resolves to true if the resolver supports wildcard resolution.\n     */\n    async supportsWildcard() {\n        if (this.#supports2544 == null) {\n            this.#supports2544 = (async () => {\n                try {\n                    return await this.#resolver.supportsInterface(\"0x9061b923\");\n                }\n                catch (error) {\n                    // Wildcard resolvers must understand supportsInterface\n                    // and return true.\n                    if (isError(error, \"CALL_EXCEPTION\")) {\n                        return false;\n                    }\n                    // Let future attempts try again...\n                    this.#supports2544 = null;\n                    throw error;\n                }\n            })();\n        }\n        return await this.#supports2544;\n    }\n    async #fetch(funcName, params) {\n        params = (params || []).slice();\n        const iface = this.#resolver.interface;\n        // The first parameters is always the nodehash\n        params.unshift(namehash(this.name));\n        let fragment = null;\n        if (await this.supportsWildcard()) {\n            fragment = iface.getFunction(funcName);\n            assert(fragment, \"missing fragment\", \"UNKNOWN_ERROR\", {\n                info: { funcName }\n            });\n            params = [\n                dnsEncode(this.name, 255),\n                iface.encodeFunctionData(fragment, params)\n            ];\n            funcName = \"resolve(bytes,bytes)\";\n        }\n        params.push({\n            enableCcipRead: true\n        });\n        try {\n            const result = await this.#resolver[funcName](...params);\n            if (fragment) {\n                return iface.decodeFunctionResult(fragment, result)[0];\n            }\n            return result;\n        }\n        catch (error) {\n            if (!isError(error, \"CALL_EXCEPTION\")) {\n                throw error;\n            }\n        }\n        return null;\n    }\n    /**\n     *  Resolves to the address for %%coinType%% or null if the\n     *  provided %%coinType%% has not been configured.\n     */\n    async getAddress(coinType) {\n        if (coinType == null) {\n            coinType = 60;\n        }\n        if (coinType === 60) {\n            try {\n                const result = await this.#fetch(\"addr(bytes32)\");\n                // No address\n                if (result == null || result === ZeroAddress) {\n                    return null;\n                }\n                return result;\n            }\n            catch (error) {\n                if (isError(error, \"CALL_EXCEPTION\")) {\n                    return null;\n                }\n                throw error;\n            }\n        }\n        // Try decoding its EVM canonical chain as an EVM chain address first\n        if (coinType >= 0 && coinType < 0x80000000) {\n            let ethCoinType = coinType + 0x80000000;\n            const data = await this.#fetch(\"addr(bytes32,uint)\", [ethCoinType]);\n            if (isHexString(data, 20)) {\n                return getAddress(data);\n            }\n        }\n        let coinPlugin = null;\n        for (const plugin of this.provider.plugins) {\n            if (!(plugin instanceof MulticoinProviderPlugin)) {\n                continue;\n            }\n            if (plugin.supportsCoinType(coinType)) {\n                coinPlugin = plugin;\n                break;\n            }\n        }\n        if (coinPlugin == null) {\n            return null;\n        }\n        // keccak256(\"addr(bytes32,uint256\")\n        const data = await this.#fetch(\"addr(bytes32,uint)\", [coinType]);\n        // No address\n        if (data == null || data === \"0x\") {\n            return null;\n        }\n        // Compute the address\n        const address = await coinPlugin.decodeAddress(coinType, data);\n        if (address != null) {\n            return address;\n        }\n        assert(false, `invalid coin data`, \"UNSUPPORTED_OPERATION\", {\n            operation: `getAddress(${coinType})`,\n            info: { coinType, data }\n        });\n    }\n    /**\n     *  Resolves to the EIP-634 text record for %%key%%, or ``null``\n     *  if unconfigured.\n     */\n    async getText(key) {\n        const data = await this.#fetch(\"text(bytes32,string)\", [key]);\n        if (data == null || data === \"0x\") {\n            return null;\n        }\n        return data;\n    }\n    /**\n     *  Rsolves to the content-hash or ``null`` if unconfigured.\n     */\n    async getContentHash() {\n        // keccak256(\"contenthash()\")\n        const data = await this.#fetch(\"contenthash(bytes32)\");\n        // No contenthash\n        if (data == null || data === \"0x\") {\n            return null;\n        }\n        // IPFS (CID: 1, Type: 70=DAG-PB, 72=libp2p-key)\n        const ipfs = data.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);\n        if (ipfs) {\n            const scheme = (ipfs[1] === \"e3010170\") ? \"ipfs\" : \"ipns\";\n            const length = parseInt(ipfs[4], 16);\n            if (ipfs[5].length === length * 2) {\n                return `${scheme}:/\\/${encodeBase58(\"0x\" + ipfs[2])}`;\n            }\n        }\n        // Swarm (CID: 1, Type: swarm-manifest; hash/length hard-coded to keccak256/32)\n        const swarm = data.match(/^0xe40101fa011b20([0-9a-f]*)$/);\n        if (swarm && swarm[1].length === 64) {\n            return `bzz:/\\/${swarm[1]}`;\n        }\n        assert(false, `invalid or unsupported content hash data`, \"UNSUPPORTED_OPERATION\", {\n            operation: \"getContentHash()\",\n            info: { data }\n        });\n    }\n    /**\n     *  Resolves to the avatar url or ``null`` if the avatar is either\n     *  unconfigured or incorrectly configured (e.g. references an NFT\n     *  not owned by the address).\n     *\n     *  If diagnosing issues with configurations, the [[_getAvatar]]\n     *  method may be useful.\n     */\n    async getAvatar() {\n        const avatar = await this._getAvatar();\n        return avatar.url;\n    }\n    /**\n     *  When resolving an avatar, there are many steps involved, such\n     *  fetching metadata and possibly validating ownership of an\n     *  NFT.\n     *\n     *  This method can be used to examine each step and the value it\n     *  was working from.\n     */\n    async _getAvatar() {\n        const linkage = [{ type: \"name\", value: this.name }];\n        try {\n            // test data for ricmoo.eth\n            //const avatar = \"eip155:1/erc721:0x265385c7f4132228A0d54EB1A9e7460b91c0cC68/29233\";\n            const avatar = await this.getText(\"avatar\");\n            if (avatar == null) {\n                linkage.push({ type: \"!avatar\", value: \"\" });\n                return { url: null, linkage };\n            }\n            linkage.push({ type: \"avatar\", value: avatar });\n            for (let i = 0; i < matchers.length; i++) {\n                const match = avatar.match(matchers[i]);\n                if (match == null) {\n                    continue;\n                }\n                const scheme = match[1].toLowerCase();\n                switch (scheme) {\n                    case \"https\":\n                    case \"data\":\n                        linkage.push({ type: \"url\", value: avatar });\n                        return { linkage, url: avatar };\n                    case \"ipfs\": {\n                        const url = getIpfsLink(avatar);\n                        linkage.push({ type: \"ipfs\", value: avatar });\n                        linkage.push({ type: \"url\", value: url });\n                        return { linkage, url };\n                    }\n                    case \"erc721\":\n                    case \"erc1155\": {\n                        // Depending on the ERC type, use tokenURI(uint256) or url(uint256)\n                        const selector = (scheme === \"erc721\") ? \"tokenURI(uint256)\" : \"uri(uint256)\";\n                        linkage.push({ type: scheme, value: avatar });\n                        // The owner of this name\n                        const owner = await this.getAddress();\n                        if (owner == null) {\n                            linkage.push({ type: \"!owner\", value: \"\" });\n                            return { url: null, linkage };\n                        }\n                        const comps = (match[2] || \"\").split(\"/\");\n                        if (comps.length !== 2) {\n                            linkage.push({ type: `!${scheme}caip`, value: (match[2] || \"\") });\n                            return { url: null, linkage };\n                        }\n                        const tokenId = comps[1];\n                        const contract = new Contract(comps[0], [\n                            // ERC-721\n                            \"function tokenURI(uint) view returns (string)\",\n                            \"function ownerOf(uint) view returns (address)\",\n                            // ERC-1155\n                            \"function uri(uint) view returns (string)\",\n                            \"function balanceOf(address, uint256) view returns (uint)\"\n                        ], this.provider);\n                        // Check that this account owns the token\n                        if (scheme === \"erc721\") {\n                            const tokenOwner = await contract.ownerOf(tokenId);\n                            if (owner !== tokenOwner) {\n                                linkage.push({ type: \"!owner\", value: tokenOwner });\n                                return { url: null, linkage };\n                            }\n                            linkage.push({ type: \"owner\", value: tokenOwner });\n                        }\n                        else if (scheme === \"erc1155\") {\n                            const balance = await contract.balanceOf(owner, tokenId);\n                            if (!balance) {\n                                linkage.push({ type: \"!balance\", value: \"0\" });\n                                return { url: null, linkage };\n                            }\n                            linkage.push({ type: \"balance\", value: balance.toString() });\n                        }\n                        // Call the token contract for the metadata URL\n                        let metadataUrl = await contract[selector](tokenId);\n                        if (metadataUrl == null || metadataUrl === \"0x\") {\n                            linkage.push({ type: \"!metadata-url\", value: \"\" });\n                            return { url: null, linkage };\n                        }\n                        linkage.push({ type: \"metadata-url-base\", value: metadataUrl });\n                        // ERC-1155 allows a generic {id} in the URL\n                        if (scheme === \"erc1155\") {\n                            metadataUrl = metadataUrl.replace(\"{id}\", toBeHex(tokenId, 32).substring(2));\n                            linkage.push({ type: \"metadata-url-expanded\", value: metadataUrl });\n                        }\n                        // Transform IPFS metadata links\n                        if (metadataUrl.match(/^ipfs:/i)) {\n                            metadataUrl = getIpfsLink(metadataUrl);\n                        }\n                        linkage.push({ type: \"metadata-url\", value: metadataUrl });\n                        // Get the token metadata\n                        let metadata = {};\n                        const response = await (new FetchRequest(metadataUrl)).send();\n                        response.assertOk();\n                        try {\n                            metadata = response.bodyJson;\n                        }\n                        catch (error) {\n                            try {\n                                linkage.push({ type: \"!metadata\", value: response.bodyText });\n                            }\n                            catch (error) {\n                                const bytes = response.body;\n                                if (bytes) {\n                                    linkage.push({ type: \"!metadata\", value: hexlify(bytes) });\n                                }\n                                return { url: null, linkage };\n                            }\n                            return { url: null, linkage };\n                        }\n                        if (!metadata) {\n                            linkage.push({ type: \"!metadata\", value: \"\" });\n                            return { url: null, linkage };\n                        }\n                        linkage.push({ type: \"metadata\", value: JSON.stringify(metadata) });\n                        // Pull the image URL out\n                        let imageUrl = metadata.image;\n                        if (typeof (imageUrl) !== \"string\") {\n                            linkage.push({ type: \"!imageUrl\", value: \"\" });\n                            return { url: null, linkage };\n                        }\n                        if (imageUrl.match(/^(https:\\/\\/|data:)/i)) {\n                            // Allow\n                        }\n                        else {\n                            // Transform IPFS link to gateway\n                            const ipfs = imageUrl.match(matcherIpfs);\n                            if (ipfs == null) {\n                                linkage.push({ type: \"!imageUrl-ipfs\", value: imageUrl });\n                                return { url: null, linkage };\n                            }\n                            linkage.push({ type: \"imageUrl-ipfs\", value: imageUrl });\n                            imageUrl = getIpfsLink(imageUrl);\n                        }\n                        linkage.push({ type: \"url\", value: imageUrl });\n                        return { linkage, url: imageUrl };\n                    }\n                }\n            }\n        }\n        catch (error) { }\n        return { linkage, url: null };\n    }\n    static async getEnsAddress(provider) {\n        const network = await provider.getNetwork();\n        const ensPlugin = network.getPlugin(\"org.ethers.plugins.network.Ens\");\n        // No ENS...\n        assert(ensPlugin, \"network does not support ENS\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"getEnsAddress\", info: { network }\n        });\n        return ensPlugin.address;\n    }\n    static async #getResolver(provider, name) {\n        const ensAddr = await EnsResolver.getEnsAddress(provider);\n        try {\n            const contract = new Contract(ensAddr, [\n                \"function resolver(bytes32) view returns (address)\"\n            ], provider);\n            const addr = await contract.resolver(namehash(name), {\n                enableCcipRead: true\n            });\n            if (addr === ZeroAddress) {\n                return null;\n            }\n            return addr;\n        }\n        catch (error) {\n            // ENS registry cannot throw errors on resolver(bytes32),\n            // so probably a link error\n            throw error;\n        }\n        return null;\n    }\n    /**\n     *  Resolve to the ENS resolver for %%name%% using %%provider%% or\n     *  ``null`` if unconfigured.\n     */\n    static async fromName(provider, name) {\n        let currentName = name;\n        while (true) {\n            if (currentName === \"\" || currentName === \".\") {\n                return null;\n            }\n            // Optimization since the eth node cannot change and does\n            // not have a wildcard resolver\n            if (name !== \"eth\" && currentName === \"eth\") {\n                return null;\n            }\n            // Check the current node for a resolver\n            const addr = await EnsResolver.#getResolver(provider, currentName);\n            // Found a resolver!\n            if (addr != null) {\n                const resolver = new EnsResolver(provider, addr, name);\n                // Legacy resolver found, using EIP-2544 so it isn't safe to use\n                if (currentName !== name && !(await resolver.supportsWildcard())) {\n                    return null;\n                }\n                return resolver;\n            }\n            // Get the parent node\n            currentName = currentName.split(\".\").slice(1).join(\".\");\n        }\n    }\n}\n//# sourceMappingURL=ens-resolver.js.map/**\n *  @_ignore\n */\nimport { getAddress, getCreateAddress } from \"../address/index.js\";\nimport { Signature } from \"../crypto/index.js\";\nimport { accessListify } from \"../transaction/index.js\";\nimport { getBigInt, getNumber, hexlify, isHexString, zeroPadValue, assert, assertArgument } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\nexport function allowNull(format, nullValue) {\n    return (function (value) {\n        if (value == null) {\n            return nullValue;\n        }\n        return format(value);\n    });\n}\nexport function arrayOf(format, allowNull) {\n    return ((array) => {\n        if (allowNull && array == null) {\n            return null;\n        }\n        if (!Array.isArray(array)) {\n            throw new Error(\"not an array\");\n        }\n        return array.map((i) => format(i));\n    });\n}\n// Requires an object which matches a fleet of other formatters\n// Any FormatFunc may return `undefined` to have the value omitted\n// from the result object. Calls preserve `this`.\nexport function object(format, altNames) {\n    return ((value) => {\n        const result = {};\n        for (const key in format) {\n            let srcKey = key;\n            if (altNames && key in altNames && !(srcKey in value)) {\n                for (const altKey of altNames[key]) {\n                    if (altKey in value) {\n                        srcKey = altKey;\n                        break;\n                    }\n                }\n            }\n            try {\n                const nv = format[key](value[srcKey]);\n                if (nv !== undefined) {\n                    result[key] = nv;\n                }\n            }\n            catch (error) {\n                const message = (error instanceof Error) ? error.message : \"not-an-error\";\n                assert(false, `invalid value for value.${key} (${message})`, \"BAD_DATA\", { value });\n            }\n        }\n        return result;\n    });\n}\nexport function formatBoolean(value) {\n    switch (value) {\n        case true:\n        case \"true\":\n            return true;\n        case false:\n        case \"false\":\n            return false;\n    }\n    assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, \"value\", value);\n}\nexport function formatData(value) {\n    assertArgument(isHexString(value, true), \"invalid data\", \"value\", value);\n    return value;\n}\nexport function formatHash(value) {\n    assertArgument(isHexString(value, 32), \"invalid hash\", \"value\", value);\n    return value;\n}\nexport function formatUint256(value) {\n    if (!isHexString(value)) {\n        throw new Error(\"invalid uint256\");\n    }\n    return zeroPadValue(value, 32);\n}\nconst _formatLog = object({\n    address: getAddress,\n    blockHash: formatHash,\n    blockNumber: getNumber,\n    data: formatData,\n    index: getNumber,\n    removed: allowNull(formatBoolean, false),\n    topics: arrayOf(formatHash),\n    transactionHash: formatHash,\n    transactionIndex: getNumber,\n}, {\n    index: [\"logIndex\"]\n});\nexport function formatLog(value) {\n    return _formatLog(value);\n}\nconst _formatBlock = object({\n    hash: allowNull(formatHash),\n    parentHash: formatHash,\n    parentBeaconBlockRoot: allowNull(formatHash, null),\n    number: getNumber,\n    timestamp: getNumber,\n    nonce: allowNull(formatData),\n    difficulty: getBigInt,\n    gasLimit: getBigInt,\n    gasUsed: getBigInt,\n    stateRoot: allowNull(formatHash, null),\n    receiptsRoot: allowNull(formatHash, null),\n    blobGasUsed: allowNull(getBigInt, null),\n    excessBlobGas: allowNull(getBigInt, null),\n    miner: allowNull(getAddress),\n    prevRandao: allowNull(formatHash, null),\n    extraData: formatData,\n    baseFeePerGas: allowNull(getBigInt)\n}, {\n    prevRandao: [\"mixHash\"]\n});\nexport function formatBlock(value) {\n    const result = _formatBlock(value);\n    result.transactions = value.transactions.map((tx) => {\n        if (typeof (tx) === \"string\") {\n            return tx;\n        }\n        return formatTransactionResponse(tx);\n    });\n    return result;\n}\nconst _formatReceiptLog = object({\n    transactionIndex: getNumber,\n    blockNumber: getNumber,\n    transactionHash: formatHash,\n    address: getAddress,\n    topics: arrayOf(formatHash),\n    data: formatData,\n    index: getNumber,\n    blockHash: formatHash,\n}, {\n    index: [\"logIndex\"]\n});\nexport function formatReceiptLog(value) {\n    return _formatReceiptLog(value);\n}\nconst _formatTransactionReceipt = object({\n    to: allowNull(getAddress, null),\n    from: allowNull(getAddress, null),\n    contractAddress: allowNull(getAddress, null),\n    // should be allowNull(hash), but broken-EIP-658 support is handled in receipt\n    index: getNumber,\n    root: allowNull(hexlify),\n    gasUsed: getBigInt,\n    blobGasUsed: allowNull(getBigInt, null),\n    logsBloom: allowNull(formatData),\n    blockHash: formatHash,\n    hash: formatHash,\n    logs: arrayOf(formatReceiptLog),\n    blockNumber: getNumber,\n    //confirmations: allowNull(getNumber, null),\n    cumulativeGasUsed: getBigInt,\n    effectiveGasPrice: allowNull(getBigInt),\n    blobGasPrice: allowNull(getBigInt, null),\n    status: allowNull(getNumber),\n    type: allowNull(getNumber, 0)\n}, {\n    effectiveGasPrice: [\"gasPrice\"],\n    hash: [\"transactionHash\"],\n    index: [\"transactionIndex\"],\n});\nexport function formatTransactionReceipt(value) {\n    return _formatTransactionReceipt(value);\n}\nexport function formatTransactionResponse(value) {\n    // Some clients (TestRPC) do strange things like return 0x0 for the\n    // 0 address; correct this to be a real address\n    if (value.to && getBigInt(value.to) === BN_0) {\n        value.to = \"0x0000000000000000000000000000000000000000\";\n    }\n    const result = object({\n        hash: formatHash,\n        // Some nodes do not return this, usually test nodes (like Ganache)\n        index: allowNull(getNumber, undefined),\n        type: (value) => {\n            if (value === \"0x\" || value == null) {\n                return 0;\n            }\n            return getNumber(value);\n        },\n        accessList: allowNull(accessListify, null),\n        blobVersionedHashes: allowNull(arrayOf(formatHash, true), null),\n        authorizationList: allowNull(arrayOf((v) => {\n            let sig;\n            if (v.signature) {\n                sig = v.signature;\n            }\n            else {\n                let yParity = v.yParity;\n                if (yParity === \"0x1b\") {\n                    yParity = 0;\n                }\n                else if (yParity === \"0x1c\") {\n                    yParity = 1;\n                }\n                sig = Object.assign({}, v, { yParity });\n            }\n            return {\n                address: getAddress(v.address),\n                chainId: getBigInt(v.chainId),\n                nonce: getBigInt(v.nonce),\n                signature: Signature.from(sig)\n            };\n        }, false), null),\n        blockHash: allowNull(formatHash, null),\n        blockNumber: allowNull(getNumber, null),\n        transactionIndex: allowNull(getNumber, null),\n        from: getAddress,\n        // either (gasPrice) or (maxPriorityFeePerGas + maxFeePerGas) must be set\n        gasPrice: allowNull(getBigInt),\n        maxPriorityFeePerGas: allowNull(getBigInt),\n        maxFeePerGas: allowNull(getBigInt),\n        maxFeePerBlobGas: allowNull(getBigInt, null),\n        gasLimit: getBigInt,\n        to: allowNull(getAddress, null),\n        value: getBigInt,\n        nonce: getNumber,\n        data: formatData,\n        creates: allowNull(getAddress, null),\n        chainId: allowNull(getBigInt, null)\n    }, {\n        data: [\"input\"],\n        gasLimit: [\"gas\"],\n        index: [\"transactionIndex\"]\n    })(value);\n    // If to and creates are empty, populate the creates from the value\n    if (result.to == null && result.creates == null) {\n        result.creates = getCreateAddress(result);\n    }\n    // @TODO: Check fee data\n    // Add an access list to supported transaction types\n    if ((value.type === 1 || value.type === 2) && value.accessList == null) {\n        result.accessList = [];\n    }\n    // Compute the signature\n    if (value.signature) {\n        result.signature = Signature.from(value.signature);\n    }\n    else {\n        result.signature = Signature.from(value);\n    }\n    // Some backends omit ChainId on legacy transactions, but we can compute it\n    if (result.chainId == null) {\n        const chainId = result.signature.legacyChainId;\n        if (chainId != null) {\n            result.chainId = chainId;\n        }\n    }\n    // @TODO: check chainID\n    /*\n    if (value.chainId != null) {\n        let chainId = value.chainId;\n\n        if (isHexString(chainId)) {\n            chainId = BigNumber.from(chainId).toNumber();\n        }\n\n        result.chainId = chainId;\n\n    } else {\n        let chainId = value.networkId;\n\n        // geth-etc returns chainId\n        if (chainId == null && result.v == null) {\n            chainId = value.chainId;\n        }\n\n        if (isHexString(chainId)) {\n            chainId = BigNumber.from(chainId).toNumber();\n        }\n\n        if (typeof(chainId) !== \"number\" && result.v != null) {\n            chainId = (result.v - 35) / 2;\n            if (chainId < 0) { chainId = 0; }\n            chainId = parseInt(chainId);\n        }\n\n        if (typeof(chainId) !== \"number\") { chainId = 0; }\n\n        result.chainId = chainId;\n    }\n    */\n    // 0x0000... should actually be null\n    if (result.blockHash && getBigInt(result.blockHash) === BN_0) {\n        result.blockHash = null;\n    }\n    return result;\n}\n//# sourceMappingURL=format.js.map/**\n *  A **Provider** provides a connection to the blockchain, whch can be\n *  used to query its current state, simulate execution and send transactions\n *  to update the state.\n *\n *  It is one of the most fundamental components of interacting with a\n *  blockchain application, and there are many ways to connect, such as over\n *  HTTP, WebSockets or injected providers such as [MetaMask](link-metamask).\n *\n *  @_section: api/providers:Providers  [about-providers]\n */\nexport { AbstractProvider, UnmanagedSubscriber } from \"./abstract-provider.js\";\nexport { AbstractSigner, VoidSigner, } from \"./abstract-signer.js\";\nexport { showThrottleMessage } from \"./community.js\";\nexport { getDefaultProvider } from \"./default-provider.js\";\nexport { EnsResolver, MulticoinProviderPlugin } from \"./ens-resolver.js\";\nexport { Network } from \"./network.js\";\nexport { NonceManager } from \"./signer-noncemanager.js\";\nexport { NetworkPlugin, GasCostPlugin, EnsPlugin, FeeDataNetworkPlugin, FetchUrlFeeDataNetworkPlugin, } from \"./plugins-network.js\";\nexport { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest,\n//resolveTransactionRequest,\n } from \"./provider.js\";\nexport { FallbackProvider } from \"./provider-fallback.js\";\nexport { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner } from \"./provider-jsonrpc.js\";\nexport { BrowserProvider } from \"./provider-browser.js\";\nexport { AlchemyProvider } from \"./provider-alchemy.js\";\nexport { BlockscoutProvider } from \"./provider-blockscout.js\";\nexport { AnkrProvider } from \"./provider-ankr.js\";\nexport { CloudflareProvider } from \"./provider-cloudflare.js\";\nexport { ChainstackProvider } from \"./provider-chainstack.js\";\nexport { EtherscanProvider, EtherscanPlugin } from \"./provider-etherscan.js\";\nexport { InfuraProvider, InfuraWebSocketProvider } from \"./provider-infura.js\";\nexport { PocketProvider } from \"./provider-pocket.js\";\nexport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { IpcSocketProvider } from \"./provider-ipcsocket.js\"; /*-browser*/\nexport { IpcSocketProvider };\nexport { SocketProvider } from \"./provider-socket.js\";\nexport { WebSocketProvider } from \"./provider-websocket.js\";\nexport { SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, SocketEventSubscriber } from \"./provider-socket.js\";\n//# sourceMappingURL=index.js.map/**\n *  A **Network** encapsulates the various properties required to\n *  interact with a specific chain.\n *\n *  @_subsection: api/providers:Networks  [networks]\n */\nimport { accessListify } from \"../transaction/index.js\";\nimport { getBigInt, assert, assertArgument } from \"../utils/index.js\";\nimport { EnsPlugin, FetchUrlFeeDataNetworkPlugin, GasCostPlugin } from \"./plugins-network.js\";\n/* * * *\n// Networks which operation against an L2 can use this plugin to\n// specify how to access L1, for the purpose of resolving ENS,\n// for example.\nexport class LayerOneConnectionPlugin extends NetworkPlugin {\n    readonly provider!: Provider;\n// @TODO: Rename to ChainAccess and allow for connecting to any chain\n    constructor(provider: Provider) {\n        super(\"org.ethers.plugins.layer-one-connection\");\n        defineProperties<LayerOneConnectionPlugin>(this, { provider });\n    }\n\n    clone(): LayerOneConnectionPlugin {\n        return new LayerOneConnectionPlugin(this.provider);\n    }\n}\n*/\nconst Networks = new Map();\n/**\n *  A **Network** provides access to a chain's properties and allows\n *  for plug-ins to extend functionality.\n */\nexport class Network {\n    #name;\n    #chainId;\n    #plugins;\n    /**\n     *  Creates a new **Network** for %%name%% and %%chainId%%.\n     */\n    constructor(name, chainId) {\n        this.#name = name;\n        this.#chainId = getBigInt(chainId);\n        this.#plugins = new Map();\n    }\n    /**\n     *  Returns a JSON-compatible representation of a Network.\n     */\n    toJSON() {\n        return { name: this.name, chainId: String(this.chainId) };\n    }\n    /**\n     *  The network common name.\n     *\n     *  This is the canonical name, as networks migh have multiple\n     *  names.\n     */\n    get name() { return this.#name; }\n    set name(value) { this.#name = value; }\n    /**\n     *  The network chain ID.\n     */\n    get chainId() { return this.#chainId; }\n    set chainId(value) { this.#chainId = getBigInt(value, \"chainId\"); }\n    /**\n     *  Returns true if %%other%% matches this network. Any chain ID\n     *  must match, and if no chain ID is present, the name must match.\n     *\n     *  This method does not currently check for additional properties,\n     *  such as ENS address or plug-in compatibility.\n     */\n    matches(other) {\n        if (other == null) {\n            return false;\n        }\n        if (typeof (other) === \"string\") {\n            try {\n                return (this.chainId === getBigInt(other));\n            }\n            catch (error) { }\n            return (this.name === other);\n        }\n        if (typeof (other) === \"number\" || typeof (other) === \"bigint\") {\n            try {\n                return (this.chainId === getBigInt(other));\n            }\n            catch (error) { }\n            return false;\n        }\n        if (typeof (other) === \"object\") {\n            if (other.chainId != null) {\n                try {\n                    return (this.chainId === getBigInt(other.chainId));\n                }\n                catch (error) { }\n                return false;\n            }\n            if (other.name != null) {\n                return (this.name === other.name);\n            }\n            return false;\n        }\n        return false;\n    }\n    /**\n     *  Returns the list of plugins currently attached to this Network.\n     */\n    get plugins() {\n        return Array.from(this.#plugins.values());\n    }\n    /**\n     *  Attach a new %%plugin%% to this Network. The network name\n     *  must be unique, excluding any fragment.\n     */\n    attachPlugin(plugin) {\n        if (this.#plugins.get(plugin.name)) {\n            throw new Error(`cannot replace existing plugin: ${plugin.name} `);\n        }\n        this.#plugins.set(plugin.name, plugin.clone());\n        return this;\n    }\n    /**\n     *  Return the plugin, if any, matching %%name%% exactly. Plugins\n     *  with fragments will not be returned unless %%name%% includes\n     *  a fragment.\n     */\n    getPlugin(name) {\n        return (this.#plugins.get(name)) || null;\n    }\n    /**\n     *  Gets a list of all plugins that match %%name%%, with otr without\n     *  a fragment.\n     */\n    getPlugins(basename) {\n        return (this.plugins.filter((p) => (p.name.split(\"#\")[0] === basename)));\n    }\n    /**\n     *  Create a copy of this Network.\n     */\n    clone() {\n        const clone = new Network(this.name, this.chainId);\n        this.plugins.forEach((plugin) => {\n            clone.attachPlugin(plugin.clone());\n        });\n        return clone;\n    }\n    /**\n     *  Compute the intrinsic gas required for a transaction.\n     *\n     *  A GasCostPlugin can be attached to override the default\n     *  values.\n     */\n    computeIntrinsicGas(tx) {\n        const costs = this.getPlugin(\"org.ethers.plugins.network.GasCost\") || (new GasCostPlugin());\n        let gas = costs.txBase;\n        if (tx.to == null) {\n            gas += costs.txCreate;\n        }\n        if (tx.data) {\n            for (let i = 2; i < tx.data.length; i += 2) {\n                if (tx.data.substring(i, i + 2) === \"00\") {\n                    gas += costs.txDataZero;\n                }\n                else {\n                    gas += costs.txDataNonzero;\n                }\n            }\n        }\n        if (tx.accessList) {\n            const accessList = accessListify(tx.accessList);\n            for (const addr in accessList) {\n                gas += costs.txAccessListAddress + costs.txAccessListStorageKey * accessList[addr].storageKeys.length;\n            }\n        }\n        return gas;\n    }\n    /**\n     *  Returns a new Network for the %%network%% name or chainId.\n     */\n    static from(network) {\n        injectCommonNetworks();\n        // Default network\n        if (network == null) {\n            return Network.from(\"mainnet\");\n        }\n        // Canonical name or chain ID\n        if (typeof (network) === \"number\") {\n            network = BigInt(network);\n        }\n        if (typeof (network) === \"string\" || typeof (network) === \"bigint\") {\n            const networkFunc = Networks.get(network);\n            if (networkFunc) {\n                return networkFunc();\n            }\n            if (typeof (network) === \"bigint\") {\n                return new Network(\"unknown\", network);\n            }\n            assertArgument(false, \"unknown network\", \"network\", network);\n        }\n        // Clonable with network-like abilities\n        if (typeof (network.clone) === \"function\") {\n            const clone = network.clone();\n            //if (typeof(network.name) !== \"string\" || typeof(network.chainId) !== \"number\") {\n            //}\n            return clone;\n        }\n        // Networkish\n        if (typeof (network) === \"object\") {\n            assertArgument(typeof (network.name) === \"string\" && typeof (network.chainId) === \"number\", \"invalid network object name or chainId\", \"network\", network);\n            const custom = new Network((network.name), (network.chainId));\n            if (network.ensAddress || network.ensNetwork != null) {\n                custom.attachPlugin(new EnsPlugin(network.ensAddress, network.ensNetwork));\n            }\n            //if ((<any>network).layerOneConnection) {\n            //    custom.attachPlugin(new LayerOneConnectionPlugin((<any>network).layerOneConnection));\n            //}\n            return custom;\n        }\n        assertArgument(false, \"invalid network\", \"network\", network);\n    }\n    /**\n     *  Register %%nameOrChainId%% with a function which returns\n     *  an instance of a Network representing that chain.\n     */\n    static register(nameOrChainId, networkFunc) {\n        if (typeof (nameOrChainId) === \"number\") {\n            nameOrChainId = BigInt(nameOrChainId);\n        }\n        const existing = Networks.get(nameOrChainId);\n        if (existing) {\n            assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrChainId\", nameOrChainId);\n        }\n        Networks.set(nameOrChainId, networkFunc);\n    }\n}\n// We don't want to bring in formatUnits because it is backed by\n// FixedNumber and we want to keep Networks tiny. The values\n// included by the Gas Stations are also IEEE 754 with lots of\n// rounding issues and exceed the strict checks formatUnits has.\nfunction parseUnits(_value, decimals) {\n    const value = String(_value);\n    if (!value.match(/^[0-9.]+$/)) {\n        throw new Error(`invalid gwei value: ${_value}`);\n    }\n    // Break into [ whole, fraction ]\n    const comps = value.split(\".\");\n    if (comps.length === 1) {\n        comps.push(\"\");\n    }\n    // More than 1 decimal point or too many fractional positions\n    if (comps.length !== 2) {\n        throw new Error(`invalid gwei value: ${_value}`);\n    }\n    // Pad the fraction to 9 decimalplaces\n    while (comps[1].length < decimals) {\n        comps[1] += \"0\";\n    }\n    // Too many decimals and some non-zero ending, take the ceiling\n    if (comps[1].length > 9) {\n        let frac = BigInt(comps[1].substring(0, 9));\n        if (!comps[1].substring(9).match(/^0+$/)) {\n            frac++;\n        }\n        comps[1] = frac.toString();\n    }\n    return BigInt(comps[0] + comps[1]);\n}\n// Used by Polygon to use a gas station for fee data\nfunction getGasStationPlugin(url) {\n    return new FetchUrlFeeDataNetworkPlugin(url, async (fetchFeeData, provider, request) => {\n        // Prevent Cloudflare from blocking our request in node.js\n        request.setHeader(\"User-Agent\", \"ethers\");\n        let response;\n        try {\n            const [_response, _feeData] = await Promise.all([\n                request.send(), fetchFeeData()\n            ]);\n            response = _response;\n            const payload = response.bodyJson.standard;\n            const feeData = {\n                gasPrice: _feeData.gasPrice,\n                maxFeePerGas: parseUnits(payload.maxFee, 9),\n                maxPriorityFeePerGas: parseUnits(payload.maxPriorityFee, 9),\n            };\n            return feeData;\n        }\n        catch (error) {\n            assert(false, `error encountered with polygon gas station (${JSON.stringify(request.url)})`, \"SERVER_ERROR\", { request, response, error });\n        }\n    });\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n    if (injected) {\n        return;\n    }\n    injected = true;\n    /// Register popular Ethereum networks\n    function registerEth(name, chainId, options) {\n        const func = function () {\n            const network = new Network(name, chainId);\n            // We use 0 to disable ENS\n            if (options.ensNetwork != null) {\n                network.attachPlugin(new EnsPlugin(null, options.ensNetwork));\n            }\n            network.attachPlugin(new GasCostPlugin());\n            (options.plugins || []).forEach((plugin) => {\n                network.attachPlugin(plugin);\n            });\n            return network;\n        };\n        // Register the network by name and chain ID\n        Network.register(name, func);\n        Network.register(chainId, func);\n        if (options.altNames) {\n            options.altNames.forEach((name) => {\n                Network.register(name, func);\n            });\n        }\n    }\n    registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\n    registerEth(\"ropsten\", 3, { ensNetwork: 3 });\n    registerEth(\"rinkeby\", 4, { ensNetwork: 4 });\n    registerEth(\"goerli\", 5, { ensNetwork: 5 });\n    registerEth(\"kovan\", 42, { ensNetwork: 42 });\n    registerEth(\"sepolia\", 11155111, { ensNetwork: 11155111 });\n    registerEth(\"holesky\", 17000, { ensNetwork: 17000 });\n    registerEth(\"classic\", 61, {});\n    registerEth(\"classicKotti\", 6, {});\n    registerEth(\"arbitrum\", 42161, {\n        ensNetwork: 1,\n    });\n    registerEth(\"arbitrum-goerli\", 421613, {});\n    registerEth(\"arbitrum-sepolia\", 421614, {});\n    registerEth(\"base\", 8453, { ensNetwork: 1 });\n    registerEth(\"base-goerli\", 84531, {});\n    registerEth(\"base-sepolia\", 84532, {});\n    registerEth(\"bnb\", 56, { ensNetwork: 1 });\n    registerEth(\"bnbt\", 97, {});\n    registerEth(\"linea\", 59144, { ensNetwork: 1 });\n    registerEth(\"linea-goerli\", 59140, {});\n    registerEth(\"linea-sepolia\", 59141, {});\n    registerEth(\"matic\", 137, {\n        ensNetwork: 1,\n        plugins: [\n            getGasStationPlugin(\"https:/\\/gasstation.polygon.technology/v2\")\n        ]\n    });\n    registerEth(\"matic-amoy\", 80002, {});\n    registerEth(\"matic-mumbai\", 80001, {\n        altNames: [\"maticMumbai\", \"maticmum\"],\n        plugins: [\n            getGasStationPlugin(\"https:/\\/gasstation-testnet.polygon.technology/v2\")\n        ]\n    });\n    registerEth(\"optimism\", 10, {\n        ensNetwork: 1,\n        plugins: []\n    });\n    registerEth(\"optimism-goerli\", 420, {});\n    registerEth(\"optimism-sepolia\", 11155420, {});\n    registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.mapimport { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nconst EnsAddress = \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\";\n/**\n *  A **NetworkPlugin** provides additional functionality on a [[Network]].\n */\nexport class NetworkPlugin {\n    /**\n     *  The name of the plugin.\n     *\n     *  It is recommended to use reverse-domain-notation, which permits\n     *  unique names with a known authority as well as hierarchal entries.\n     */\n    name;\n    /**\n     *  Creates a new **NetworkPlugin**.\n     */\n    constructor(name) {\n        defineProperties(this, { name });\n    }\n    /**\n     *  Creates a copy of this plugin.\n     */\n    clone() {\n        return new NetworkPlugin(this.name);\n    }\n}\n/**\n *  A **GasCostPlugin** allows a network to provide alternative values when\n *  computing the intrinsic gas required for a transaction.\n */\nexport class GasCostPlugin extends NetworkPlugin {\n    /**\n     *  The block number to treat these values as valid from.\n     *\n     *  This allows a hardfork to have updated values included as well as\n     *  mulutiple hardforks to be supported.\n     */\n    effectiveBlock;\n    /**\n     *  The transactions base fee.\n     */\n    txBase;\n    /**\n     *  The fee for creating a new account.\n     */\n    txCreate;\n    /**\n     *  The fee per zero-byte in the data.\n     */\n    txDataZero;\n    /**\n     *  The fee per non-zero-byte in the data.\n     */\n    txDataNonzero;\n    /**\n     *  The fee per storage key in the [[link-eip-2930]] access list.\n     */\n    txAccessListStorageKey;\n    /**\n     *  The fee per address in the [[link-eip-2930]] access list.\n     */\n    txAccessListAddress;\n    /**\n     *  Creates a new GasCostPlugin from %%effectiveBlock%% until the\n     *  latest block or another GasCostPlugin supercedes that block number,\n     *  with the associated %%costs%%.\n     */\n    constructor(effectiveBlock, costs) {\n        if (effectiveBlock == null) {\n            effectiveBlock = 0;\n        }\n        super(`org.ethers.network.plugins.GasCost#${(effectiveBlock || 0)}`);\n        const props = { effectiveBlock };\n        function set(name, nullish) {\n            let value = (costs || {})[name];\n            if (value == null) {\n                value = nullish;\n            }\n            assertArgument(typeof (value) === \"number\", `invalud value for ${name}`, \"costs\", costs);\n            props[name] = value;\n        }\n        set(\"txBase\", 21000);\n        set(\"txCreate\", 32000);\n        set(\"txDataZero\", 4);\n        set(\"txDataNonzero\", 16);\n        set(\"txAccessListStorageKey\", 1900);\n        set(\"txAccessListAddress\", 2400);\n        defineProperties(this, props);\n    }\n    clone() {\n        return new GasCostPlugin(this.effectiveBlock, this);\n    }\n}\n/**\n *  An **EnsPlugin** allows a [[Network]] to specify the ENS Registry\n *  Contract address and the target network to use when using that\n *  contract.\n *\n *  Various testnets have their own instance of the contract to use, but\n *  in general, the mainnet instance supports multi-chain addresses and\n *  should be used.\n */\nexport class EnsPlugin extends NetworkPlugin {\n    /**\n     *  The ENS Registrty Contract address.\n     */\n    address;\n    /**\n     *  The chain ID that the ENS contract lives on.\n     */\n    targetNetwork;\n    /**\n     *  Creates a new **EnsPlugin** connected to %%address%% on the\n     *  %%targetNetwork%%. The default ENS address and mainnet is used\n     *  if unspecified.\n     */\n    constructor(address, targetNetwork) {\n        super(\"org.ethers.plugins.network.Ens\");\n        defineProperties(this, {\n            address: (address || EnsAddress),\n            targetNetwork: ((targetNetwork == null) ? 1 : targetNetwork)\n        });\n    }\n    clone() {\n        return new EnsPlugin(this.address, this.targetNetwork);\n    }\n}\n/**\n *  A **FeeDataNetworkPlugin** allows a network to provide and alternate\n *  means to specify its fee data.\n *\n *  For example, a network which does not support [[link-eip-1559]] may\n *  choose to use a Gas Station site to approximate the gas price.\n */\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n    #feeDataFunc;\n    /**\n     *  The fee data function provided to the constructor.\n     */\n    get feeDataFunc() {\n        return this.#feeDataFunc;\n    }\n    /**\n     *  Creates a new **FeeDataNetworkPlugin**.\n     */\n    constructor(feeDataFunc) {\n        super(\"org.ethers.plugins.network.FeeData\");\n        this.#feeDataFunc = feeDataFunc;\n    }\n    /**\n     *  Resolves to the fee data.\n     */\n    async getFeeData(provider) {\n        return await this.#feeDataFunc(provider);\n    }\n    clone() {\n        return new FeeDataNetworkPlugin(this.#feeDataFunc);\n    }\n}\nexport class FetchUrlFeeDataNetworkPlugin extends NetworkPlugin {\n    #url;\n    #processFunc;\n    /**\n     *  The URL to initialize the FetchRequest with in %%processFunc%%.\n     */\n    get url() { return this.#url; }\n    /**\n     *  The callback to use when computing the FeeData.\n     */\n    get processFunc() { return this.#processFunc; }\n    /**\n     *  Creates a new **FetchUrlFeeDataNetworkPlugin** which will\n     *  be used when computing the fee data for the network.\n     */\n    constructor(url, processFunc) {\n        super(\"org.ethers.plugins.network.FetchUrlFeeDataPlugin\");\n        this.#url = url;\n        this.#processFunc = processFunc;\n    }\n    // We are immutable, so we can serve as our own clone\n    clone() { return this; }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n    readonly #blockFunc: (provider: Provider, block: BlockParams<string>) => Block<string>;\n    readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams<TransactionResponseParams>) => Block<TransactionResponse>;\n\n    constructor(blockFunc: (provider: Provider, block: BlockParams<string>) => Block<string>, blockWithTxsFunc: (provider: Provider, block: BlockParams<TransactionResponseParams>) => Block<TransactionResponse>) {\n        super(\"org.ethers.network-plugins.custom-block\");\n        this.#blockFunc = blockFunc;\n        this.#blockWithTxsFunc = blockWithTxsFunc;\n    }\n\n    async getBlock(provider: Provider, block: BlockParams<string>): Promise<Block<string>> {\n        return await this.#blockFunc(provider, block);\n    }\n\n    async getBlockions(provider: Provider, block: BlockParams<TransactionResponseParams>): Promise<Block<TransactionResponse>> {\n        return await this.#blockWithTxsFunc(provider, block);\n    }\n\n    clone(): CustomBlockNetworkPlugin {\n        return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc);\n    }\n}\n*/\n//# sourceMappingURL=plugins-network.js.map/**\n *  [[link-alchemy]] provides a third-party service for connecting to\n *  various blockchains over JSON-RPC.\n *\n *  **Supported Networks**\n *\n *  - Ethereum Mainnet (``mainnet``)\n *  - Goerli Testnet (``goerli``)\n *  - Sepolia Testnet (``sepolia``)\n *  - Arbitrum (``arbitrum``)\n *  - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n *  - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n *  - Base (``base``)\n *  - Base Goerlia Testnet (``base-goerli``)\n *  - Base Sepolia Testnet (``base-sepolia``)\n *  - Optimism (``optimism``)\n *  - Optimism Goerli Testnet (``optimism-goerli``)\n *  - Optimism Sepolia Testnet (``optimism-sepolia``)\n *  - Polygon (``matic``)\n *  - Polygon Amoy Testnet (``matic-amoy``)\n *  - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n *  @_subsection: api/providers/thirdparty:Alchemy  [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n    switch (name) {\n        case \"mainnet\":\n            return \"eth-mainnet.alchemyapi.io\";\n        case \"goerli\":\n            return \"eth-goerli.g.alchemy.com\";\n        case \"sepolia\":\n            return \"eth-sepolia.g.alchemy.com\";\n        case \"arbitrum\":\n            return \"arb-mainnet.g.alchemy.com\";\n        case \"arbitrum-goerli\":\n            return \"arb-goerli.g.alchemy.com\";\n        case \"arbitrum-sepolia\":\n            return \"arb-sepolia.g.alchemy.com\";\n        case \"base\":\n            return \"base-mainnet.g.alchemy.com\";\n        case \"base-goerli\":\n            return \"base-goerli.g.alchemy.com\";\n        case \"base-sepolia\":\n            return \"base-sepolia.g.alchemy.com\";\n        case \"matic\":\n            return \"polygon-mainnet.g.alchemy.com\";\n        case \"matic-amoy\":\n            return \"polygon-amoy.g.alchemy.com\";\n        case \"matic-mumbai\":\n            return \"polygon-mumbai.g.alchemy.com\";\n        case \"optimism\":\n            return \"opt-mainnet.g.alchemy.com\";\n        case \"optimism-goerli\":\n            return \"opt-goerli.g.alchemy.com\";\n        case \"optimism-sepolia\":\n            return \"opt-sepolia.g.alchemy.com\";\n    }\n    assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n *  The **AlchemyProvider** connects to the [[link-alchemy]]\n *  JSON-RPC end-points.\n *\n *  By default, a highly-throttled API key is used, which is\n *  appropriate for quick prototypes and simple scripts. To\n *  gain access to an increased rate-limit, it is highly\n *  recommended to [sign up here](link-alchemy-signup).\n *\n *  @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n    apiKey;\n    constructor(_network, apiKey) {\n        if (_network == null) {\n            _network = \"mainnet\";\n        }\n        const network = Network.from(_network);\n        if (apiKey == null) {\n            apiKey = defaultApiKey;\n        }\n        const request = AlchemyProvider.getRequest(network, apiKey);\n        super(request, network, { staticNetwork: network });\n        defineProperties(this, { apiKey });\n    }\n    _getProvider(chainId) {\n        try {\n            return new AlchemyProvider(chainId, this.apiKey);\n        }\n        catch (error) { }\n        return super._getProvider(chainId);\n    }\n    async _perform(req) {\n        // https://docs.alchemy.com/reference/trace-transaction\n        if (req.method === \"getTransactionResult\") {\n            const { trace, tx } = await resolveProperties({\n                trace: this.send(\"trace_transaction\", [req.hash]),\n                tx: this.getTransaction(req.hash)\n            });\n            if (trace == null || tx == null) {\n                return null;\n            }\n            let data;\n            let error = false;\n            try {\n                data = trace[0].result.output;\n                error = (trace[0].error === \"Reverted\");\n            }\n            catch (error) { }\n            if (data) {\n                assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n                    action: \"getTransactionResult\",\n                    data,\n                    reason: null,\n                    transaction: tx,\n                    invocation: null,\n                    revert: null // @TODO\n                });\n                return data;\n            }\n            assert(false, \"could not parse trace result\", \"BAD_DATA\", { value: trace });\n        }\n        return await super._perform(req);\n    }\n    isCommunityResource() {\n        return (this.apiKey === defaultApiKey);\n    }\n    static getRequest(network, apiKey) {\n        if (apiKey == null) {\n            apiKey = defaultApiKey;\n        }\n        const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n        request.allowGzip = true;\n        if (apiKey === defaultApiKey) {\n            request.retryFunc = async (request, response, attempt) => {\n                showThrottleMessage(\"alchemy\");\n                return true;\n            };\n        }\n        return request;\n    }\n}\n//# sourceMappingURL=provider-alchemy.js.map/**\n *  [[link-ankr]] provides a third-party service for connecting to\n *  various blockchains over JSON-RPC.\n *\n *  **Supported Networks**\n *\n *  - Ethereum Mainnet (``mainnet``)\n *  - Goerli Testnet (``goerli``)\n *  - Sepolia Testnet (``sepolia``)\n *  - Arbitrum (``arbitrum``)\n *  - Base (``base``)\n *  - Base Goerlia Testnet (``base-goerli``)\n *  - Base Sepolia Testnet (``base-sepolia``)\n *  - BNB (``bnb``)\n *  - BNB Testnet (``bnbt``)\n *  - Optimism (``optimism``)\n *  - Optimism Goerli Testnet (``optimism-goerli``)\n *  - Optimism Sepolia Testnet (``optimism-sepolia``)\n *  - Polygon (``matic``)\n *  - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n *  @_subsection: api/providers/thirdparty:Ankr  [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n    switch (name) {\n        case \"mainnet\":\n            return \"rpc.ankr.com/eth\";\n        case \"goerli\":\n            return \"rpc.ankr.com/eth_goerli\";\n        case \"sepolia\":\n            return \"rpc.ankr.com/eth_sepolia\";\n        case \"arbitrum\":\n            return \"rpc.ankr.com/arbitrum\";\n        case \"base\":\n            return \"rpc.ankr.com/base\";\n        case \"base-goerli\":\n            return \"rpc.ankr.com/base_goerli\";\n        case \"base-sepolia\":\n            return \"rpc.ankr.com/base_sepolia\";\n        case \"bnb\":\n            return \"rpc.ankr.com/bsc\";\n        case \"bnbt\":\n            return \"rpc.ankr.com/bsc_testnet_chapel\";\n        case \"matic\":\n            return \"rpc.ankr.com/polygon\";\n        case \"matic-mumbai\":\n            return \"rpc.ankr.com/polygon_mumbai\";\n        case \"optimism\":\n            return \"rpc.ankr.com/optimism\";\n        case \"optimism-goerli\":\n            return \"rpc.ankr.com/optimism_testnet\";\n        case \"optimism-sepolia\":\n            return \"rpc.ankr.com/optimism_sepolia\";\n    }\n    assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n *  The **AnkrProvider** connects to the [[link-ankr]]\n *  JSON-RPC end-points.\n *\n *  By default, a highly-throttled API key is used, which is\n *  appropriate for quick prototypes and simple scripts. To\n *  gain access to an increased rate-limit, it is highly\n *  recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n    /**\n     *  The API key for the Ankr connection.\n     */\n    apiKey;\n    /**\n     *  Create a new **AnkrProvider**.\n     *\n     *  By default connecting to ``mainnet`` with a highly throttled\n     *  API key.\n     */\n    constructor(_network, apiKey) {\n        if (_network == null) {\n            _network = \"mainnet\";\n        }\n        const network = Network.from(_network);\n        if (apiKey == null) {\n            apiKey = defaultApiKey;\n        }\n        // Ankr does not support filterId, so we force polling\n        const options = { polling: true, staticNetwork: network };\n        const request = AnkrProvider.getRequest(network, apiKey);\n        super(request, network, options);\n        defineProperties(this, { apiKey });\n    }\n    _getProvider(chainId) {\n        try {\n            return new AnkrProvider(chainId, this.apiKey);\n        }\n        catch (error) { }\n        return super._getProvider(chainId);\n    }\n    /**\n     *  Returns a prepared request for connecting to %%network%% with\n     *  %%apiKey%%.\n     */\n    static getRequest(network, apiKey) {\n        if (apiKey == null) {\n            apiKey = defaultApiKey;\n        }\n        const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n        request.allowGzip = true;\n        if (apiKey === defaultApiKey) {\n            request.retryFunc = async (request, response, attempt) => {\n                showThrottleMessage(\"AnkrProvider\");\n                return true;\n            };\n        }\n        return request;\n    }\n    getRpcError(payload, error) {\n        if (payload.method === \"eth_sendRawTransaction\") {\n            if (error && error.error && error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n                error.error.message = \"replacement transaction underpriced\";\n            }\n        }\n        return super.getRpcError(payload, error);\n    }\n    isCommunityResource() {\n        return (this.apiKey === defaultApiKey);\n    }\n}\n//# sourceMappingURL=provider-ankr.js.map/**\n *  [[link-blockscout]] provides a third-party service for connecting to\n *  various blockchains over JSON-RPC.\n *\n *  **Supported Networks**\n *\n *  - Ethereum Mainnet (``mainnet``)\n *  - Sepolia Testnet (``sepolia``)\n *  - Holesky Testnet (``holesky``)\n *  - Ethereum Classic (``classic``)\n *  - Arbitrum (``arbitrum``)\n *  - Base (``base``)\n *  - Base Sepolia Testnet (``base-sepolia``)\n *  - Gnosis (``xdai``)\n *  - Optimism (``optimism``)\n *  - Optimism Sepolia Testnet (``optimism-sepolia``)\n *  - Polygon (``matic``)\n *\n *  @_subsection: api/providers/thirdparty:Blockscout  [providers-blockscout]\n */\nimport { assertArgument, defineProperties, FetchRequest, isHexString } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nfunction getUrl(name) {\n    switch (name) {\n        case \"mainnet\":\n            return \"https:/\\/eth.blockscout.com/api/eth-rpc\";\n        case \"sepolia\":\n            return \"https:/\\/eth-sepolia.blockscout.com/api/eth-rpc\";\n        case \"holesky\":\n            return \"https:/\\/eth-holesky.blockscout.com/api/eth-rpc\";\n        case \"classic\":\n            return \"https:/\\/etc.blockscout.com/api/eth-rpc\";\n        case \"arbitrum\":\n            return \"https:/\\/arbitrum.blockscout.com/api/eth-rpc\";\n        case \"base\":\n            return \"https:/\\/base.blockscout.com/api/eth-rpc\";\n        case \"base-sepolia\":\n            return \"https:/\\/base-sepolia.blockscout.com/api/eth-rpc\";\n        case \"matic\":\n            return \"https:/\\/polygon.blockscout.com/api/eth-rpc\";\n        case \"optimism\":\n            return \"https:/\\/optimism.blockscout.com/api/eth-rpc\";\n        case \"optimism-sepolia\":\n            return \"https:/\\/optimism-sepolia.blockscout.com/api/eth-rpc\";\n        case \"xdai\":\n            return \"https:/\\/gnosis.blockscout.com/api/eth-rpc\";\n    }\n    assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n *  The **BlockscoutProvider** connects to the [[link-blockscout]]\n *  JSON-RPC end-points.\n *\n *  By default, a highly-throttled API key is used, which is\n *  appropriate for quick prototypes and simple scripts. To\n *  gain access to an increased rate-limit, it is highly\n *  recommended to [sign up here](link-blockscout).\n */\nexport class BlockscoutProvider extends JsonRpcProvider {\n    /**\n     *  The API key.\n     */\n    apiKey;\n    /**\n     *  Creates a new **BlockscoutProvider**.\n     */\n    constructor(_network, apiKey) {\n        if (_network == null) {\n            _network = \"mainnet\";\n        }\n        const network = Network.from(_network);\n        if (apiKey == null) {\n            apiKey = null;\n        }\n        const request = BlockscoutProvider.getRequest(network);\n        super(request, network, { staticNetwork: network });\n        defineProperties(this, { apiKey });\n    }\n    _getProvider(chainId) {\n        try {\n            return new BlockscoutProvider(chainId, this.apiKey);\n        }\n        catch (error) { }\n        return super._getProvider(chainId);\n    }\n    isCommunityResource() {\n        return (this.apiKey === null);\n    }\n    getRpcRequest(req) {\n        // Blockscout enforces the TAG argument for estimateGas\n        const resp = super.getRpcRequest(req);\n        if (resp && resp.method === \"eth_estimateGas\" && resp.args.length == 1) {\n            resp.args = resp.args.slice();\n            resp.args.push(\"latest\");\n        }\n        return resp;\n    }\n    getRpcError(payload, _error) {\n        const error = _error ? _error.error : null;\n        // Blockscout currently drops the VM result and replaces it with a\n        // human-readable string, so we need to make it machine-readable.\n        if (error && error.code === -32015 && !isHexString(error.data || \"\", true)) {\n            const panicCodes = {\n                \"assert(false)\": \"01\",\n                \"arithmetic underflow or overflow\": \"11\",\n                \"division or modulo by zero\": \"12\",\n                \"out-of-bounds array access; popping on an empty array\": \"31\",\n                \"out-of-bounds access of an array or bytesN\": \"32\"\n            };\n            let panicCode = \"\";\n            if (error.message === \"VM execution error.\") {\n                // eth_call passes this message\n                panicCode = panicCodes[error.data] || \"\";\n            }\n            else if (panicCodes[error.message || \"\"]) {\n                panicCode = panicCodes[error.message || \"\"];\n            }\n            if (panicCode) {\n                error.message += ` (reverted: ${error.data})`;\n                error.data = \"0x4e487b7100000000000000000000000000000000000000000000000000000000000000\" + panicCode;\n            }\n        }\n        else if (error && error.code === -32000) {\n            if (error.message === \"wrong transaction nonce\") {\n                error.message += \" (nonce too low)\";\n            }\n        }\n        return super.getRpcError(payload, _error);\n    }\n    /**\n     *  Returns a prepared request for connecting to %%network%%\n     *  with %%apiKey%%.\n     */\n    static getRequest(network) {\n        const request = new FetchRequest(getUrl(network.name));\n        request.allowGzip = true;\n        return request;\n    }\n}\n//# sourceMappingURL=provider-blockscout.js.mapimport { assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\n;\n/**\n *  A **BrowserProvider** is intended to wrap an injected provider which\n *  adheres to the [[link-eip-1193]] standard, which most (if not all)\n *  currently do.\n */\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n    #request;\n    #providerInfo;\n    /**\n     *  Connect to the %%ethereum%% provider, optionally forcing the\n     *  %%network%%.\n     */\n    constructor(ethereum, network, _options) {\n        // Copy the options\n        const options = Object.assign({}, ((_options != null) ? _options : {}), { batchMaxCount: 1 });\n        assertArgument(ethereum && ethereum.request, \"invalid EIP-1193 provider\", \"ethereum\", ethereum);\n        super(network, options);\n        this.#providerInfo = null;\n        if (_options && _options.providerInfo) {\n            this.#providerInfo = _options.providerInfo;\n        }\n        this.#request = async (method, params) => {\n            const payload = { method, params };\n            this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n            try {\n                const result = await ethereum.request(payload);\n                this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n                return result;\n            }\n            catch (e) {\n                const error = new Error(e.message);\n                error.code = e.code;\n                error.data = e.data;\n                error.payload = payload;\n                this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n                throw error;\n            }\n        };\n    }\n    get providerInfo() {\n        return this.#providerInfo;\n    }\n    async send(method, params) {\n        await this._start();\n        return await super.send(method, params);\n    }\n    async _send(payload) {\n        assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n        try {\n            const result = await this.#request(payload.method, payload.params || []);\n            return [{ id: payload.id, result }];\n        }\n        catch (e) {\n            return [{\n                    id: payload.id,\n                    error: { code: e.code, data: e.data, message: e.message }\n                }];\n        }\n    }\n    getRpcError(payload, error) {\n        error = JSON.parse(JSON.stringify(error));\n        // EIP-1193 gives us some machine-readable error codes, so rewrite\n        // them into Ethers standard errors.\n        switch (error.error.code || -1) {\n            case 4001:\n                error.error.message = `ethers-user-denied: ${error.error.message}`;\n                break;\n            case 4200:\n                error.error.message = `ethers-unsupported: ${error.error.message}`;\n                break;\n        }\n        return super.getRpcError(payload, error);\n    }\n    /**\n     *  Resolves to ``true`` if the provider manages the %%address%%.\n     */\n    async hasSigner(address) {\n        if (address == null) {\n            address = 0;\n        }\n        const accounts = await this.send(\"eth_accounts\", []);\n        if (typeof (address) === \"number\") {\n            return (accounts.length > address);\n        }\n        address = address.toLowerCase();\n        return accounts.filter((a) => (a.toLowerCase() === address)).length !== 0;\n    }\n    async getSigner(address) {\n        if (address == null) {\n            address = 0;\n        }\n        if (!(await this.hasSigner(address))) {\n            try {\n                await this.#request(\"eth_requestAccounts\", []);\n            }\n            catch (error) {\n                const payload = error.payload;\n                throw this.getRpcError(payload, { id: payload.id, error });\n            }\n        }\n        return await super.getSigner(address);\n    }\n    /**\n     *  Discover and connect to a Provider in the Browser using the\n     *  [[link-eip-6963]] discovery mechanism. If no providers are\n     *  present, ``null`` is resolved.\n     */\n    static async discover(options) {\n        if (options == null) {\n            options = {};\n        }\n        if (options.provider) {\n            return new BrowserProvider(options.provider);\n        }\n        const context = options.window ? options.window :\n            (typeof (window) !== \"undefined\") ? window : null;\n        if (context == null) {\n            return null;\n        }\n        const anyProvider = options.anyProvider;\n        if (anyProvider && context.ethereum) {\n            return new BrowserProvider(context.ethereum);\n        }\n        if (!(\"addEventListener\" in context && \"dispatchEvent\" in context\n            && \"removeEventListener\" in context)) {\n            return null;\n        }\n        const timeout = options.timeout ? options.timeout : 300;\n        if (timeout === 0) {\n            return null;\n        }\n        return await (new Promise((resolve, reject) => {\n            let found = [];\n            const addProvider = (event) => {\n                found.push(event.detail);\n                if (anyProvider) {\n                    finalize();\n                }\n            };\n            const finalize = () => {\n                clearTimeout(timer);\n                if (found.length) {\n                    // If filtering is provided:\n                    if (options && options.filter) {\n                        // Call filter, with a copies of found provider infos\n                        const filtered = options.filter(found.map(i => Object.assign({}, (i.info))));\n                        if (filtered == null) {\n                            // No provider selected\n                            resolve(null);\n                        }\n                        else if (filtered instanceof BrowserProvider) {\n                            // Custom provider created\n                            resolve(filtered);\n                        }\n                        else {\n                            // Find the matching provider\n                            let match = null;\n                            if (filtered.uuid) {\n                                const matches = found.filter(f => (filtered.uuid === f.info.uuid));\n                                // @TODO: What should happen if multiple values\n                                //        for the same UUID?\n                                match = matches[0];\n                            }\n                            if (match) {\n                                const { provider, info } = match;\n                                resolve(new BrowserProvider(provider, undefined, {\n                                    providerInfo: info\n                                }));\n                            }\n                            else {\n                                reject(makeError(\"filter returned unknown info\", \"UNSUPPORTED_OPERATION\", {\n                                    value: filtered\n                                }));\n                            }\n                        }\n                    }\n                    else {\n                        // Pick the first found provider\n                        const { provider, info } = found[0];\n                        resolve(new BrowserProvider(provider, undefined, {\n                            providerInfo: info\n                        }));\n                    }\n                }\n                else {\n                    // Nothing found\n                    resolve(null);\n                }\n                context.removeEventListener(\"eip6963:announceProvider\", addProvider);\n            };\n            const timer = setTimeout(() => { finalize(); }, timeout);\n            context.addEventListener(\"eip6963:announceProvider\", addProvider);\n            context.dispatchEvent(new Event(\"eip6963:requestProvider\"));\n        }));\n    }\n}\n//# sourceMappingURL=provider-browser.js.map/**\n *  [[link-chainstack]] provides a third-party service for connecting to\n *  various blockchains over JSON-RPC.\n *\n *  **Supported Networks**\n *\n *  - Ethereum Mainnet (``mainnet``)\n *  - Arbitrum (``arbitrum``)\n *  - BNB Smart Chain Mainnet (``bnb``)\n *  - Polygon (``matic``)\n *\n *  @_subsection: api/providers/thirdparty:Chainstack  [providers-chainstack]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nfunction getApiKey(name) {\n    switch (name) {\n        case \"mainnet\": return \"39f1d67cedf8b7831010a665328c9197\";\n        case \"arbitrum\": return \"0550c209db33c3abf4cc927e1e18cea1\";\n        case \"bnb\": return \"98b5a77e531614387366f6fc5da097f8\";\n        case \"matic\": return \"cd9d4d70377471aa7c142ec4a4205249\";\n    }\n    assertArgument(false, \"unsupported network\", \"network\", name);\n}\nfunction getHost(name) {\n    switch (name) {\n        case \"mainnet\":\n            return \"ethereum-mainnet.core.chainstack.com\";\n        case \"arbitrum\":\n            return \"arbitrum-mainnet.core.chainstack.com\";\n        case \"bnb\":\n            return \"bsc-mainnet.core.chainstack.com\";\n        case \"matic\":\n            return \"polygon-mainnet.core.chainstack.com\";\n    }\n    assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n *  The **ChainstackProvider** connects to the [[link-chainstack]]\n *  JSON-RPC end-points.\n *\n *  By default, a highly-throttled API key is used, which is\n *  appropriate for quick prototypes and simple scripts. To\n *  gain access to an increased rate-limit, it is highly\n *  recommended to [sign up here](link-chainstack).\n */\nexport class ChainstackProvider extends JsonRpcProvider {\n    /**\n     *  The API key for the Chainstack connection.\n     */\n    apiKey;\n    /**\n     *  Creates a new **ChainstackProvider**.\n     */\n    constructor(_network, apiKey) {\n        if (_network == null) {\n            _network = \"mainnet\";\n        }\n        const network = Network.from(_network);\n        if (apiKey == null) {\n            apiKey = getApiKey(network.name);\n        }\n        const request = ChainstackProvider.getRequest(network, apiKey);\n        super(request, network, { staticNetwork: network });\n        defineProperties(this, { apiKey });\n    }\n    _getProvider(chainId) {\n        try {\n            return new ChainstackProvider(chainId, this.apiKey);\n        }\n        catch (error) { }\n        return super._getProvider(chainId);\n    }\n    isCommunityResource() {\n        return (this.apiKey === getApiKey(this._network.name));\n    }\n    /**\n     *  Returns a prepared request for connecting to %%network%%\n     *  with %%apiKey%% and %%projectSecret%%.\n     */\n    static getRequest(network, apiKey) {\n        if (apiKey == null) {\n            apiKey = getApiKey(network.name);\n        }\n        const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n        request.allowGzip = true;\n        if (apiKey === getApiKey(network.name)) {\n            request.retryFunc = async (request, response, attempt) => {\n                showThrottleMessage(\"ChainstackProvider\");\n                return true;\n            };\n        }\n        return request;\n    }\n}\n//# sourceMappingURL=provider-chainstack.js.map/**\n *  About Cloudflare\n *\n *  @_subsection: api/providers/thirdparty:Cloudflare  [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n *  About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n    constructor(_network) {\n        if (_network == null) {\n            _network = \"mainnet\";\n        }\n        const network = Network.from(_network);\n        assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n        super(\"https:/\\/cloudflare-eth.com/\", network, { staticNetwork: network });\n    }\n}\n//# sourceMappingURL=provider-cloudflare.js.map/**\n *  [[link-etherscan]] provides a third-party service for connecting to\n *  various blockchains over a combination of JSON-RPC and custom API\n *  endpoints.\n *\n *  **Supported Networks**\n *\n *  - Ethereum Mainnet (``mainnet``)\n *  - Goerli Testnet (``goerli``)\n *  - Sepolia Testnet (``sepolia``)\n *  - Holesky Testnet (``holesky``)\n *  - Arbitrum (``arbitrum``)\n *  - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n *  - Base (``base``)\n *  - Base Sepolia Testnet (``base-sepolia``)\n *  - BNB Smart Chain Mainnet (``bnb``)\n *  - BNB Smart Chain Testnet (``bnbt``)\n *  - Optimism (``optimism``)\n *  - Optimism Goerli Testnet (``optimism-goerli``)\n *  - Polygon (``matic``)\n *  - Polygon Mumbai Testnet (``matic-mumbai``)\n *  - Polygon Amoy Testnet (``matic-amoy``)\n *\n *  @_subsection api/providers/thirdparty:Etherscan  [providers-etherscan]\n */\nimport { AbiCoder } from \"../abi/index.js\";\nimport { Contract } from \"../contract/index.js\";\nimport { accessListify, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, hexlify, toQuantity, FetchRequest, assert, assertArgument, isError, \n//    parseUnits,\ntoUtf8String } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nimport { NetworkPlugin } from \"./plugins-network.js\";\nimport { showThrottleMessage } from \"./community.js\";\nconst THROTTLE = 2000;\nfunction isPromise(value) {\n    return (value && typeof (value.then) === \"function\");\n}\nconst EtherscanPluginId = \"org.ethers.plugins.provider.Etherscan\";\n/**\n *  A Network can include an **EtherscanPlugin** to provide\n *  a custom base URL.\n *\n *  @_docloc: api/providers/thirdparty:Etherscan\n */\nexport class EtherscanPlugin extends NetworkPlugin {\n    /**\n     *  The Etherscan API base URL.\n     */\n    baseUrl;\n    /**\n     *  Creates a new **EtherscanProvider** which will use\n     *  %%baseUrl%%.\n     */\n    constructor(baseUrl) {\n        super(EtherscanPluginId);\n        defineProperties(this, { baseUrl });\n    }\n    clone() {\n        return new EtherscanPlugin(this.baseUrl);\n    }\n}\nconst skipKeys = [\"enableCcipRead\"];\nlet nextId = 1;\n/**\n *  The **EtherscanBaseProvider** is the super-class of\n *  [[EtherscanProvider]], which should generally be used instead.\n *\n *  Since the **EtherscanProvider** includes additional code for\n *  [[Contract]] access, in //rare cases// that contracts are not\n *  used, this class can reduce code size.\n *\n *  @_docloc: api/providers/thirdparty:Etherscan\n */\nexport class EtherscanProvider extends AbstractProvider {\n    /**\n     *  The connected network.\n     */\n    network;\n    /**\n     *  The API key or null if using the community provided bandwidth.\n     */\n    apiKey;\n    #plugin;\n    /**\n     *  Creates a new **EtherscanBaseProvider**.\n     */\n    constructor(_network, _apiKey) {\n        const apiKey = (_apiKey != null) ? _apiKey : null;\n        super();\n        const network = Network.from(_network);\n        this.#plugin = network.getPlugin(EtherscanPluginId);\n        defineProperties(this, { apiKey, network });\n    }\n    /**\n     *  Returns the base URL.\n     *\n     *  If an [[EtherscanPlugin]] is configured on the\n     *  [[EtherscanBaseProvider_network]], returns the plugin's\n     *  baseUrl.\n     *\n     *  Deprecated; for Etherscan v2 the base is no longer a simply\n     *  host, but instead a URL including a chainId parameter. Changing\n     *  this to return a URL prefix could break some libraries, so it\n     *  is left intact but will be removed in the future as it is unused.\n     */\n    getBaseUrl() {\n        if (this.#plugin) {\n            return this.#plugin.baseUrl;\n        }\n        switch (this.network.name) {\n            case \"mainnet\":\n                return \"https:/\\/api.etherscan.io\";\n            case \"goerli\":\n                return \"https:/\\/api-goerli.etherscan.io\";\n            case \"sepolia\":\n                return \"https:/\\/api-sepolia.etherscan.io\";\n            case \"holesky\":\n                return \"https:/\\/api-holesky.etherscan.io\";\n            case \"arbitrum\":\n                return \"https:/\\/api.arbiscan.io\";\n            case \"arbitrum-goerli\":\n                return \"https:/\\/api-goerli.arbiscan.io\";\n            case \"base\":\n                return \"https:/\\/api.basescan.org\";\n            case \"base-sepolia\":\n                return \"https:/\\/api-sepolia.basescan.org\";\n            case \"bnb\":\n                return \"https:/\\/api.bscscan.com\";\n            case \"bnbt\":\n                return \"https:/\\/api-testnet.bscscan.com\";\n            case \"matic\":\n                return \"https:/\\/api.polygonscan.com\";\n            case \"matic-amoy\":\n                return \"https:/\\/api-amoy.polygonscan.com\";\n            case \"matic-mumbai\":\n                return \"https:/\\/api-testnet.polygonscan.com\";\n            case \"optimism\":\n                return \"https:/\\/api-optimistic.etherscan.io\";\n            case \"optimism-goerli\":\n                return \"https:/\\/api-goerli-optimistic.etherscan.io\";\n            default:\n        }\n        assertArgument(false, \"unsupported network\", \"network\", this.network);\n    }\n    /**\n     *  Returns the URL for the %%module%% and %%params%%.\n     */\n    getUrl(module, params) {\n        let query = Object.keys(params).reduce((accum, key) => {\n            const value = params[key];\n            if (value != null) {\n                accum += `&${key}=${value}`;\n            }\n            return accum;\n        }, \"\");\n        if (this.apiKey) {\n            query += `&apikey=${this.apiKey}`;\n        }\n        return `https:/\\/api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${module}${query}`;\n    }\n    /**\n     *  Returns the URL for using POST requests.\n     */\n    getPostUrl() {\n        return `https:/\\/api.etherscan.io/v2/api?chainid=${this.network.chainId}`;\n    }\n    /**\n     *  Returns the parameters for using POST requests.\n     */\n    getPostData(module, params) {\n        params.module = module;\n        params.apikey = this.apiKey;\n        params.chainid = this.network.chainId;\n        return params;\n    }\n    async detectNetwork() {\n        return this.network;\n    }\n    /**\n     *  Resolves to the result of calling %%module%% with %%params%%.\n     *\n     *  If %%post%%, the request is made as a POST request.\n     */\n    async fetch(module, params, post) {\n        const id = nextId++;\n        const url = (post ? this.getPostUrl() : this.getUrl(module, params));\n        const payload = (post ? this.getPostData(module, params) : null);\n        this.emit(\"debug\", { action: \"sendRequest\", id, url, payload: payload });\n        const request = new FetchRequest(url);\n        request.setThrottleParams({ slotInterval: 1000 });\n        request.retryFunc = (req, resp, attempt) => {\n            if (this.isCommunityResource()) {\n                showThrottleMessage(\"Etherscan\");\n            }\n            return Promise.resolve(true);\n        };\n        request.processFunc = async (request, response) => {\n            const result = response.hasBody() ? JSON.parse(toUtf8String(response.body)) : {};\n            const throttle = ((typeof (result.result) === \"string\") ? result.result : \"\").toLowerCase().indexOf(\"rate limit\") >= 0;\n            if (module === \"proxy\") {\n                // This JSON response indicates we are being throttled\n                if (result && result.status == 0 && result.message == \"NOTOK\" && throttle) {\n                    this.emit(\"debug\", { action: \"receiveError\", id, reason: \"proxy-NOTOK\", error: result });\n                    response.throwThrottleError(result.result, THROTTLE);\n                }\n            }\n            else {\n                if (throttle) {\n                    this.emit(\"debug\", { action: \"receiveError\", id, reason: \"null result\", error: result.result });\n                    response.throwThrottleError(result.result, THROTTLE);\n                }\n            }\n            return response;\n        };\n        if (payload) {\n            request.setHeader(\"content-type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n            request.body = Object.keys(payload).map((k) => `${k}=${payload[k]}`).join(\"&\");\n        }\n        const response = await request.send();\n        try {\n            response.assertOk();\n        }\n        catch (error) {\n            this.emit(\"debug\", { action: \"receiveError\", id, error, reason: \"assertOk\" });\n            assert(false, \"response error\", \"SERVER_ERROR\", { request, response });\n        }\n        if (!response.hasBody()) {\n            this.emit(\"debug\", { action: \"receiveError\", id, error: \"missing body\", reason: \"null body\" });\n            assert(false, \"missing response\", \"SERVER_ERROR\", { request, response });\n        }\n        const result = JSON.parse(toUtf8String(response.body));\n        if (module === \"proxy\") {\n            if (result.jsonrpc != \"2.0\") {\n                this.emit(\"debug\", { action: \"receiveError\", id, result, reason: \"invalid JSON-RPC\" });\n                assert(false, \"invalid JSON-RPC response (missing jsonrpc='2.0')\", \"SERVER_ERROR\", { request, response, info: { result } });\n            }\n            if (result.error) {\n                this.emit(\"debug\", { action: \"receiveError\", id, result, reason: \"JSON-RPC error\" });\n                assert(false, \"error response\", \"SERVER_ERROR\", { request, response, info: { result } });\n            }\n            this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n            return result.result;\n        }\n        else {\n            // getLogs, getHistory have weird success responses\n            if (result.status == 0 && (result.message === \"No records found\" || result.message === \"No transactions found\")) {\n                this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n                return result.result;\n            }\n            if (result.status != 1 || (typeof (result.message) === \"string\" && !result.message.match(/^OK/))) {\n                this.emit(\"debug\", { action: \"receiveError\", id, result });\n                assert(false, \"error response\", \"SERVER_ERROR\", { request, response, info: { result } });\n            }\n            this.emit(\"debug\", { action: \"receiveRequest\", id, result });\n            return result.result;\n        }\n    }\n    /**\n     *  Returns %%transaction%% normalized for the Etherscan API.\n     */\n    _getTransactionPostData(transaction) {\n        const result = {};\n        for (let key in transaction) {\n            if (skipKeys.indexOf(key) >= 0) {\n                continue;\n            }\n            if (transaction[key] == null) {\n                continue;\n            }\n            let value = transaction[key];\n            if (key === \"type\" && value === 0) {\n                continue;\n            }\n            if (key === \"blockTag\" && value === \"latest\") {\n                continue;\n            }\n            // Quantity-types require no leading zero, unless 0\n            if ({ type: true, gasLimit: true, gasPrice: true, maxFeePerGs: true, maxPriorityFeePerGas: true, nonce: true, value: true }[key]) {\n                value = toQuantity(value);\n            }\n            else if (key === \"accessList\") {\n                value = \"[\" + accessListify(value).map((set) => {\n                    return `{address:\"${set.address}\",storageKeys:[\"${set.storageKeys.join('\",\"')}\"]}`;\n                }).join(\",\") + \"]\";\n            }\n            else if (key === \"blobVersionedHashes\") {\n                if (value.length === 0) {\n                    continue;\n                }\n                // @TODO: update this once the API supports blobs\n                assert(false, \"Etherscan API does not support blobVersionedHashes\", \"UNSUPPORTED_OPERATION\", {\n                    operation: \"_getTransactionPostData\",\n                    info: { transaction }\n                });\n            }\n            else {\n                value = hexlify(value);\n            }\n            result[key] = value;\n        }\n        return result;\n    }\n    /**\n     *  Throws the normalized Etherscan error.\n     */\n    _checkError(req, error, transaction) {\n        // Pull any message out if, possible\n        let message = \"\";\n        if (isError(error, \"SERVER_ERROR\")) {\n            // Check for an error emitted by a proxy call\n            try {\n                message = error.info.result.error.message;\n            }\n            catch (e) { }\n            if (!message) {\n                try {\n                    message = error.info.message;\n                }\n                catch (e) { }\n            }\n        }\n        if (req.method === \"estimateGas\") {\n            if (!message.match(/revert/i) && message.match(/insufficient funds/i)) {\n                assert(false, \"insufficient funds\", \"INSUFFICIENT_FUNDS\", {\n                    transaction: req.transaction\n                });\n            }\n        }\n        if (req.method === \"call\" || req.method === \"estimateGas\") {\n            if (message.match(/execution reverted/i)) {\n                let data = \"\";\n                try {\n                    data = error.info.result.error.data;\n                }\n                catch (error) { }\n                const e = AbiCoder.getBuiltinCallException(req.method, req.transaction, data);\n                e.info = { request: req, error };\n                throw e;\n            }\n        }\n        if (message) {\n            if (req.method === \"broadcastTransaction\") {\n                const transaction = Transaction.from(req.signedTransaction);\n                if (message.match(/replacement/i) && message.match(/underpriced/i)) {\n                    assert(false, \"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n                        transaction\n                    });\n                }\n                if (message.match(/insufficient funds/)) {\n                    assert(false, \"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n                        transaction\n                    });\n                }\n                if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {\n                    assert(false, \"nonce has already been used\", \"NONCE_EXPIRED\", {\n                        transaction\n                    });\n                }\n            }\n        }\n        // Something we could not process\n        throw error;\n    }\n    async _detectNetwork() {\n        return this.network;\n    }\n    async _perform(req) {\n        switch (req.method) {\n            case \"chainId\":\n                return this.network.chainId;\n            case \"getBlockNumber\":\n                return this.fetch(\"proxy\", { action: \"eth_blockNumber\" });\n            case \"getGasPrice\":\n                return this.fetch(\"proxy\", { action: \"eth_gasPrice\" });\n            case \"getPriorityFee\":\n                // This is temporary until Etherscan completes support\n                if (this.network.name === \"mainnet\") {\n                    return \"1000000000\";\n                }\n                else if (this.network.name === \"optimism\") {\n                    return \"1000000\";\n                }\n                else {\n                    throw new Error(\"fallback onto the AbstractProvider default\");\n                }\n            /* Working with Etherscan to get this added:\n            try {\n                const test = await this.fetch(\"proxy\", {\n                    action: \"eth_maxPriorityFeePerGas\"\n                });\n                console.log(test);\n                return test;\n            } catch (e) {\n                console.log(\"DEBUG\", e);\n                throw e;\n            }\n            */\n            /* This might be safe; but due to rounding neither myself\n               or Etherscan are necessarily comfortable with this. :)\n            try {\n                const result = await this.fetch(\"gastracker\", { action: \"gasoracle\" });\n                console.log(result);\n                const gasPrice = parseUnits(result.SafeGasPrice, \"gwei\");\n                const baseFee = parseUnits(result.suggestBaseFee, \"gwei\");\n                const priorityFee = gasPrice - baseFee;\n                if (priorityFee < 0) { throw new Error(\"negative priority fee; defer to abstract provider default\"); }\n                return priorityFee;\n            } catch (error) {\n                console.log(\"DEBUG\", error);\n                throw error;\n            }\n            */\n            case \"getBalance\":\n                // Returns base-10 result\n                return this.fetch(\"account\", {\n                    action: \"balance\",\n                    address: req.address,\n                    tag: req.blockTag\n                });\n            case \"getTransactionCount\":\n                return this.fetch(\"proxy\", {\n                    action: \"eth_getTransactionCount\",\n                    address: req.address,\n                    tag: req.blockTag\n                });\n            case \"getCode\":\n                return this.fetch(\"proxy\", {\n                    action: \"eth_getCode\",\n                    address: req.address,\n                    tag: req.blockTag\n                });\n            case \"getStorage\":\n                return this.fetch(\"proxy\", {\n                    action: \"eth_getStorageAt\",\n                    address: req.address,\n                    position: req.position,\n                    tag: req.blockTag\n                });\n            case \"broadcastTransaction\":\n                return this.fetch(\"proxy\", {\n                    action: \"eth_sendRawTransaction\",\n                    hex: req.signedTransaction\n                }, true).catch((error) => {\n                    return this._checkError(req, error, req.signedTransaction);\n                });\n            case \"getBlock\":\n                if (\"blockTag\" in req) {\n                    return this.fetch(\"proxy\", {\n                        action: \"eth_getBlockByNumber\",\n                        tag: req.blockTag,\n                        boolean: (req.includeTransactions ? \"true\" : \"false\")\n                    });\n                }\n                assert(false, \"getBlock by blockHash not supported by Etherscan\", \"UNSUPPORTED_OPERATION\", {\n                    operation: \"getBlock(blockHash)\"\n                });\n            case \"getTransaction\":\n                return this.fetch(\"proxy\", {\n                    action: \"eth_getTransactionByHash\",\n                    txhash: req.hash\n                });\n            case \"getTransactionReceipt\":\n                return this.fetch(\"proxy\", {\n                    action: \"eth_getTransactionReceipt\",\n                    txhash: req.hash\n                });\n            case \"call\": {\n                if (req.blockTag !== \"latest\") {\n                    throw new Error(\"EtherscanProvider does not support blockTag for call\");\n                }\n                const postData = this._getTransactionPostData(req.transaction);\n                postData.module = \"proxy\";\n                postData.action = \"eth_call\";\n                try {\n                    return await this.fetch(\"proxy\", postData, true);\n                }\n                catch (error) {\n                    return this._checkError(req, error, req.transaction);\n                }\n            }\n            case \"estimateGas\": {\n                const postData = this._getTransactionPostData(req.transaction);\n                postData.module = \"proxy\";\n                postData.action = \"eth_estimateGas\";\n                try {\n                    return await this.fetch(\"proxy\", postData, true);\n                }\n                catch (error) {\n                    return this._checkError(req, error, req.transaction);\n                }\n            }\n            /*\n                        case \"getLogs\": {\n                            // Needs to complain if more than one address is passed in\n                            const args: Record<string, any> = { action: \"getLogs\" }\n            \n                            if (params.filter.fromBlock) {\n                                args.fromBlock = checkLogTag(params.filter.fromBlock);\n                            }\n            \n                            if (params.filter.toBlock) {\n                                args.toBlock = checkLogTag(params.filter.toBlock);\n                            }\n            \n                            if (params.filter.address) {\n                                args.address = params.filter.address;\n                            }\n            \n                            // @TODO: We can handle slightly more complicated logs using the logs API\n                            if (params.filter.topics && params.filter.topics.length > 0) {\n                                if (params.filter.topics.length > 1) {\n                                    logger.throwError(\"unsupported topic count\", Logger.Errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });\n                                }\n                                if (params.filter.topics.length === 1) {\n                                    const topic0 = params.filter.topics[0];\n                                    if (typeof(topic0) !== \"string\" || topic0.length !== 66) {\n                                        logger.throwError(\"unsupported topic format\", Logger.Errors.UNSUPPORTED_OPERATION, { topic0: topic0 });\n                                    }\n                                    args.topic0 = topic0;\n                                }\n                            }\n            \n                            const logs: Array<any> = await this.fetch(\"logs\", args);\n            \n                            // Cache txHash => blockHash\n                            let blocks: { [tag: string]: string } = {};\n            \n                            // Add any missing blockHash to the logs\n                            for (let i = 0; i < logs.length; i++) {\n                                const log = logs[i];\n                                if (log.blockHash != null) { continue; }\n                                if (blocks[log.blockNumber] == null) {\n                                    const block = await this.getBlock(log.blockNumber);\n                                    if (block) {\n                                        blocks[log.blockNumber] = block.hash;\n                                    }\n                                }\n            \n                                log.blockHash = blocks[log.blockNumber];\n                            }\n            \n                            return logs;\n                        }\n            */\n            default:\n                break;\n        }\n        return super._perform(req);\n    }\n    async getNetwork() {\n        return this.network;\n    }\n    /**\n     *  Resolves to the current price of ether.\n     *\n     *  This returns ``0`` on any network other than ``mainnet``.\n     */\n    async getEtherPrice() {\n        if (this.network.name !== \"mainnet\") {\n            return 0.0;\n        }\n        return parseFloat((await this.fetch(\"stats\", { action: \"ethprice\" })).ethusd);\n    }\n    /**\n     *  Resolves to a [Contract]] for %%address%%, using the\n     *  Etherscan API to retreive the Contract ABI.\n     */\n    async getContract(_address) {\n        let address = this._getAddress(_address);\n        if (isPromise(address)) {\n            address = await address;\n        }\n        try {\n            const resp = await this.fetch(\"contract\", {\n                action: \"getabi\", address\n            });\n            const abi = JSON.parse(resp);\n            return new Contract(address, abi, this);\n        }\n        catch (error) {\n            return null;\n        }\n    }\n    isCommunityResource() {\n        return (this.apiKey == null);\n    }\n}\n//# sourceMappingURL=provider-etherscan.js.map/**\n *  A **FallbackProvider** provides resilience, security and performance\n *  in a way that is customizable and configurable.\n *\n *  @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { assert, assertArgument, getBigInt, getNumber, isError } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n    for (let i = array.length - 1; i > 0; i--) {\n        const j = Math.floor(Math.random() * (i + 1));\n        const tmp = array[i];\n        array[i] = array[j];\n        array[j] = tmp;\n    }\n}\nfunction stall(duration) {\n    return new Promise((resolve) => { setTimeout(resolve, duration); });\n}\nfunction getTime() { return (new Date()).getTime(); }\nfunction stringify(value) {\n    return JSON.stringify(value, (key, value) => {\n        if (typeof (value) === \"bigint\") {\n            return { type: \"bigint\", value: value.toString() };\n        }\n        return value;\n    });\n}\n;\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n    blockNumber: -2, requests: 0, lateResponses: 0, errorResponses: 0,\n    outOfSync: -1, unsupportedEvents: 0, rollingDuration: 0, score: 0,\n    _network: null, _updateNumber: null, _totalTime: 0,\n    _lastFatalError: null, _lastFatalErrorTimestamp: 0\n};\nasync function waitForSync(config, blockNumber) {\n    while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n        if (!config._updateNumber) {\n            config._updateNumber = (async () => {\n                try {\n                    const blockNumber = await config.provider.getBlockNumber();\n                    if (blockNumber > config.blockNumber) {\n                        config.blockNumber = blockNumber;\n                    }\n                }\n                catch (error) {\n                    config.blockNumber = -2;\n                    config._lastFatalError = error;\n                    config._lastFatalErrorTimestamp = getTime();\n                }\n                config._updateNumber = null;\n            })();\n        }\n        await config._updateNumber;\n        config.outOfSync++;\n        if (config._lastFatalError) {\n            break;\n        }\n    }\n}\nfunction _normalize(value) {\n    if (value == null) {\n        return \"null\";\n    }\n    if (Array.isArray(value)) {\n        return \"[\" + (value.map(_normalize)).join(\",\") + \"]\";\n    }\n    if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n        return _normalize(value.toJSON());\n    }\n    switch (typeof (value)) {\n        case \"boolean\":\n        case \"symbol\":\n            return value.toString();\n        case \"bigint\":\n        case \"number\":\n            return BigInt(value).toString();\n        case \"string\":\n            return JSON.stringify(value);\n        case \"object\": {\n            const keys = Object.keys(value);\n            keys.sort();\n            return \"{\" + keys.map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`).join(\",\") + \"}\";\n        }\n    }\n    console.log(\"Could not serialize\", value);\n    throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(method, value) {\n    if (\"error\" in value) {\n        const error = value.error;\n        let tag;\n        if (isError(error, \"CALL_EXCEPTION\")) {\n            tag = _normalize(Object.assign({}, error, {\n                shortMessage: undefined, reason: undefined, info: undefined\n            }));\n        }\n        else {\n            tag = _normalize(error);\n        }\n        return { tag, value: error };\n    }\n    const result = value.result;\n    return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n    const tally = new Map();\n    for (const { value, tag, weight } of results) {\n        const t = tally.get(tag) || { value, weight: 0 };\n        t.weight += weight;\n        tally.set(tag, t);\n    }\n    let best = null;\n    for (const r of tally.values()) {\n        if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n            best = r;\n        }\n    }\n    if (best) {\n        return best.value;\n    }\n    return undefined;\n}\nfunction getMedian(quorum, results) {\n    let resultWeight = 0;\n    const errorMap = new Map();\n    let bestError = null;\n    const values = [];\n    for (const { value, tag, weight } of results) {\n        if (value instanceof Error) {\n            const e = errorMap.get(tag) || { value, weight: 0 };\n            e.weight += weight;\n            errorMap.set(tag, e);\n            if (bestError == null || e.weight > bestError.weight) {\n                bestError = e;\n            }\n        }\n        else {\n            values.push(BigInt(value));\n            resultWeight += weight;\n        }\n    }\n    if (resultWeight < quorum) {\n        // We have quorum for an error\n        if (bestError && bestError.weight >= quorum) {\n            return bestError.value;\n        }\n        // We do not have quorum for a result\n        return undefined;\n    }\n    // Get the sorted values\n    values.sort((a, b) => ((a < b) ? -1 : (b > a) ? 1 : 0));\n    const mid = Math.floor(values.length / 2);\n    // Odd-length; take the middle value\n    if (values.length % 2) {\n        return values[mid];\n    }\n    // Even length; take the ceiling of the mean of the center two values\n    return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n    // If any value or error meets quorum, that is our preferred result\n    const result = checkQuorum(quorum, results);\n    if (result !== undefined) {\n        return result;\n    }\n    // Otherwise, do we have any result?\n    for (const r of results) {\n        if (r.value) {\n            return r.value;\n        }\n    }\n    // Nope!\n    return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n    if (quorum === 1) {\n        return getNumber(getMedian(quorum, results), \"%internal\");\n    }\n    const tally = new Map();\n    const add = (result, weight) => {\n        const t = tally.get(result) || { result, weight: 0 };\n        t.weight += weight;\n        tally.set(result, t);\n    };\n    for (const { weight, value } of results) {\n        const r = getNumber(value);\n        add(r - 1, weight);\n        add(r, weight);\n        add(r + 1, weight);\n    }\n    let bestWeight = 0;\n    let bestResult = undefined;\n    for (const { weight, result } of tally.values()) {\n        // Use this result, if this result meets quorum and has either:\n        // - a better weight\n        // - or equal weight, but the result is larger\n        if (weight >= quorum && (weight > bestWeight || (bestResult != null && weight === bestWeight && result > bestResult))) {\n            bestWeight = weight;\n            bestResult = result;\n        }\n    }\n    return bestResult;\n}\n/**\n *  A **FallbackProvider** manages several [[Providers]] providing\n *  resilience by switching between slow or misbehaving nodes, security\n *  by requiring multiple backends to aggree and performance by allowing\n *  faster backends to respond earlier.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n    /**\n     *  The number of backends that must agree on a value before it is\n     *  accpeted.\n     */\n    quorum;\n    /**\n     *  @_ignore:\n     */\n    eventQuorum;\n    /**\n     *  @_ignore:\n     */\n    eventWorkers;\n    #configs;\n    #height;\n    #initialSyncPromise;\n    /**\n     *  Creates a new **FallbackProvider** with %%providers%% connected to\n     *  %%network%%.\n     *\n     *  If a [[Provider]] is included in %%providers%%, defaults are used\n     *  for the configuration.\n     */\n    constructor(providers, network, options) {\n        super(network, options);\n        this.#configs = providers.map((p) => {\n            if (p instanceof AbstractProvider) {\n                return Object.assign({ provider: p }, defaultConfig, defaultState);\n            }\n            else {\n                return Object.assign({}, defaultConfig, p, defaultState);\n            }\n        });\n        this.#height = -2;\n        this.#initialSyncPromise = null;\n        if (options && options.quorum != null) {\n            this.quorum = options.quorum;\n        }\n        else {\n            this.quorum = Math.ceil(this.#configs.reduce((accum, config) => {\n                accum += config.weight;\n                return accum;\n            }, 0) / 2);\n        }\n        this.eventQuorum = 1;\n        this.eventWorkers = 1;\n        assertArgument(this.quorum <= this.#configs.reduce((a, c) => (a + c.weight), 0), \"quorum exceed provider weight\", \"quorum\", this.quorum);\n    }\n    get providerConfigs() {\n        return this.#configs.map((c) => {\n            const result = Object.assign({}, c);\n            for (const key in result) {\n                if (key[0] === \"_\") {\n                    delete result[key];\n                }\n            }\n            return result;\n        });\n    }\n    async _detectNetwork() {\n        return Network.from(getBigInt(await this._perform({ method: \"chainId\" })));\n    }\n    // @TODO: Add support to select providers to be the event subscriber\n    //_getSubscriber(sub: Subscription): Subscriber {\n    //    throw new Error(\"@TODO\");\n    //}\n    /**\n     *  Transforms a %%req%% into the correct method call on %%provider%%.\n     */\n    async _translatePerform(provider, req) {\n        switch (req.method) {\n            case \"broadcastTransaction\":\n                return await provider.broadcastTransaction(req.signedTransaction);\n            case \"call\":\n                return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n            case \"chainId\":\n                return (await provider.getNetwork()).chainId;\n            case \"estimateGas\":\n                return await provider.estimateGas(req.transaction);\n            case \"getBalance\":\n                return await provider.getBalance(req.address, req.blockTag);\n            case \"getBlock\": {\n                const block = (\"blockHash\" in req) ? req.blockHash : req.blockTag;\n                return await provider.getBlock(block, req.includeTransactions);\n            }\n            case \"getBlockNumber\":\n                return await provider.getBlockNumber();\n            case \"getCode\":\n                return await provider.getCode(req.address, req.blockTag);\n            case \"getGasPrice\":\n                return (await provider.getFeeData()).gasPrice;\n            case \"getPriorityFee\":\n                return (await provider.getFeeData()).maxPriorityFeePerGas;\n            case \"getLogs\":\n                return await provider.getLogs(req.filter);\n            case \"getStorage\":\n                return await provider.getStorage(req.address, req.position, req.blockTag);\n            case \"getTransaction\":\n                return await provider.getTransaction(req.hash);\n            case \"getTransactionCount\":\n                return await provider.getTransactionCount(req.address, req.blockTag);\n            case \"getTransactionReceipt\":\n                return await provider.getTransactionReceipt(req.hash);\n            case \"getTransactionResult\":\n                return await provider.getTransactionResult(req.hash);\n        }\n    }\n    // Grab the next (random) config that is not already part of\n    // the running set\n    #getNextConfig(running) {\n        // @TODO: Maybe do a check here to favour (heavily) providers that\n        //        do not require waitForSync and disfavour providers that\n        //        seem down-ish or are behaving slowly\n        const configs = Array.from(running).map((r) => r.config);\n        // Shuffle the states, sorted by priority\n        const allConfigs = this.#configs.slice();\n        shuffle(allConfigs);\n        allConfigs.sort((a, b) => (a.priority - b.priority));\n        for (const config of allConfigs) {\n            if (config._lastFatalError) {\n                continue;\n            }\n            if (configs.indexOf(config) === -1) {\n                return config;\n            }\n        }\n        return null;\n    }\n    // Adds a new runner (if available) to running.\n    #addRunner(running, req) {\n        const config = this.#getNextConfig(running);\n        // No runners available\n        if (config == null) {\n            return null;\n        }\n        // Create a new runner\n        const runner = {\n            config, result: null, didBump: false,\n            perform: null, staller: null\n        };\n        const now = getTime();\n        // Start performing this operation\n        runner.perform = (async () => {\n            try {\n                config.requests++;\n                const result = await this._translatePerform(config.provider, req);\n                runner.result = { result };\n            }\n            catch (error) {\n                config.errorResponses++;\n                runner.result = { error };\n            }\n            const dt = (getTime() - now);\n            config._totalTime += dt;\n            config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n            runner.perform = null;\n        })();\n        // Start a staller; when this times out, it's time to force\n        // kicking off another runner because we are taking too long\n        runner.staller = (async () => {\n            await stall(config.stallTimeout);\n            runner.staller = null;\n        })();\n        running.add(runner);\n        return runner;\n    }\n    // Initializes the blockNumber and network for each runner and\n    // blocks until initialized\n    async #initialSync() {\n        let initialSync = this.#initialSyncPromise;\n        if (!initialSync) {\n            const promises = [];\n            this.#configs.forEach((config) => {\n                promises.push((async () => {\n                    await waitForSync(config, 0);\n                    if (!config._lastFatalError) {\n                        config._network = await config.provider.getNetwork();\n                    }\n                })());\n            });\n            this.#initialSyncPromise = initialSync = (async () => {\n                // Wait for all providers to have a block number and network\n                await Promise.all(promises);\n                // Check all the networks match\n                let chainId = null;\n                for (const config of this.#configs) {\n                    if (config._lastFatalError) {\n                        continue;\n                    }\n                    const network = (config._network);\n                    if (chainId == null) {\n                        chainId = network.chainId;\n                    }\n                    else if (network.chainId !== chainId) {\n                        assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n                            operation: \"new FallbackProvider\"\n                        });\n                    }\n                }\n            })();\n        }\n        await initialSync;\n    }\n    async #checkQuorum(running, req) {\n        // Get all the result objects\n        const results = [];\n        for (const runner of running) {\n            if (runner.result != null) {\n                const { tag, value } = normalizeResult(req.method, runner.result);\n                results.push({ tag, value, weight: runner.config.weight });\n            }\n        }\n        // Are there enough results to event meet quorum?\n        if (results.reduce((a, r) => (a + r.weight), 0) < this.quorum) {\n            return undefined;\n        }\n        switch (req.method) {\n            case \"getBlockNumber\": {\n                // We need to get the bootstrap block height\n                if (this.#height === -2) {\n                    this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.filter((c) => (!c._lastFatalError)).map((c) => ({\n                        value: c.blockNumber,\n                        tag: getNumber(c.blockNumber).toString(),\n                        weight: c.weight\n                    })))));\n                }\n                // Find the mode across all the providers, allowing for\n                // a little drift between block heights\n                const mode = getFuzzyMode(this.quorum, results);\n                if (mode === undefined) {\n                    return undefined;\n                }\n                if (mode > this.#height) {\n                    this.#height = mode;\n                }\n                return this.#height;\n            }\n            case \"getGasPrice\":\n            case \"getPriorityFee\":\n            case \"estimateGas\":\n                return getMedian(this.quorum, results);\n            case \"getBlock\":\n                // Pending blocks are in the mempool and already\n                // quite untrustworthy; just grab anything\n                if (\"blockTag\" in req && req.blockTag === \"pending\") {\n                    return getAnyResult(this.quorum, results);\n                }\n                return checkQuorum(this.quorum, results);\n            case \"call\":\n            case \"chainId\":\n            case \"getBalance\":\n            case \"getTransactionCount\":\n            case \"getCode\":\n            case \"getStorage\":\n            case \"getTransaction\":\n            case \"getTransactionReceipt\":\n            case \"getLogs\":\n                return checkQuorum(this.quorum, results);\n            case \"broadcastTransaction\":\n                return getAnyResult(this.quorum, results);\n        }\n        assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n            operation: `_perform(${stringify(req.method)})`\n        });\n    }\n    async #waitForQuorum(running, req) {\n        if (running.size === 0) {\n            throw new Error(\"no runners?!\");\n        }\n        // Any promises that are interesting to watch for; an expired stall\n        // or a successful perform\n        const interesting = [];\n        let newRunners = 0;\n        for (const runner of running) {\n            // No responses, yet; keep an eye on it\n            if (runner.perform) {\n                interesting.push(runner.perform);\n            }\n            // Still stalling...\n            if (runner.staller) {\n                interesting.push(runner.staller);\n                continue;\n            }\n            // This runner has already triggered another runner\n            if (runner.didBump) {\n                continue;\n            }\n            // Got a response (result or error) or stalled; kick off another runner\n            runner.didBump = true;\n            newRunners++;\n        }\n        // Check if we have reached quorum on a result (or error)\n        const value = await this.#checkQuorum(running, req);\n        if (value !== undefined) {\n            if (value instanceof Error) {\n                throw value;\n            }\n            return value;\n        }\n        // Add any new runners, because a staller timed out or a result\n        // or error response came in.\n        for (let i = 0; i < newRunners; i++) {\n            this.#addRunner(running, req);\n        }\n        // All providers have returned, and we have no result\n        assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n            request: \"%sub-requests\",\n            info: { request: req, results: Array.from(running).map((r) => stringify(r.result)) }\n        });\n        // Wait for someone to either complete its perform or stall out\n        await Promise.race(interesting);\n        // This is recursive, but at worst case the depth is 2x the\n        // number of providers (each has a perform and a staller)\n        return await this.#waitForQuorum(running, req);\n    }\n    async _perform(req) {\n        // Broadcasting a transaction is rare (ish) and already incurs\n        // a cost on the user, so spamming is safe-ish. Just send it to\n        // every backend.\n        if (req.method === \"broadcastTransaction\") {\n            // Once any broadcast provides a positive result, use it. No\n            // need to wait for anyone else\n            const results = this.#configs.map((c) => null);\n            const broadcasts = this.#configs.map(async ({ provider, weight }, index) => {\n                try {\n                    const result = await provider._perform(req);\n                    results[index] = Object.assign(normalizeResult(req.method, { result }), { weight });\n                }\n                catch (error) {\n                    results[index] = Object.assign(normalizeResult(req.method, { error }), { weight });\n                }\n            });\n            // As each promise finishes...\n            while (true) {\n                // Check for a valid broadcast result\n                const done = results.filter((r) => (r != null));\n                for (const { value } of done) {\n                    if (!(value instanceof Error)) {\n                        return value;\n                    }\n                }\n                // Check for a legit broadcast error (one which we cannot\n                // recover from; some nodes may return the following red\n                // herring events:\n                // - alredy seend (UNKNOWN_ERROR)\n                // - NONCE_EXPIRED\n                // - REPLACEMENT_UNDERPRICED\n                const result = checkQuorum(this.quorum, results.filter((r) => (r != null)));\n                if (isError(result, \"INSUFFICIENT_FUNDS\")) {\n                    throw result;\n                }\n                // Kick off the next provider (if any)\n                const waiting = broadcasts.filter((b, i) => (results[i] == null));\n                if (waiting.length === 0) {\n                    break;\n                }\n                await Promise.race(waiting);\n            }\n            // Use standard quorum results; any result was returned above,\n            // so this will find any error that met quorum if any\n            const result = getAnyResult(this.quorum, results);\n            assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n                request: \"%sub-requests\",\n                info: { request: req, results: results.map(stringify) }\n            });\n            if (result instanceof Error) {\n                throw result;\n            }\n            return result;\n        }\n        await this.#initialSync();\n        // Bootstrap enough runners to meet quorum\n        const running = new Set();\n        let inflightQuorum = 0;\n        while (true) {\n            const runner = this.#addRunner(running, req);\n            if (runner == null) {\n                break;\n            }\n            inflightQuorum += runner.config.weight;\n            if (inflightQuorum >= this.quorum) {\n                break;\n            }\n        }\n        const result = await this.#waitForQuorum(running, req);\n        // Track requests sent to a provider that are still\n        // outstanding after quorum has been otherwise found\n        for (const runner of running) {\n            if (runner.perform && runner.result == null) {\n                runner.config.lateResponses++;\n            }\n        }\n        return result;\n    }\n    async destroy() {\n        for (const { provider } of this.#configs) {\n            provider.destroy();\n        }\n        super.destroy();\n    }\n}\n//# sourceMappingURL=provider-fallback.js.map/**\n *  [[link-infura]] provides a third-party service for connecting to\n *  various blockchains over JSON-RPC.\n *\n *  **Supported Networks**\n *\n *  - Ethereum Mainnet (``mainnet``)\n *  - Goerli Testnet (``goerli``)\n *  - Sepolia Testnet (``sepolia``)\n *  - Arbitrum (``arbitrum``)\n *  - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n *  - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n *  - Base (``base``)\n *  - Base Goerlia Testnet (``base-goerli``)\n *  - Base Sepolia Testnet (``base-sepolia``)\n *  - BNB Smart Chain Mainnet (``bnb``)\n *  - BNB Smart Chain Testnet (``bnbt``)\n *  - Linea (``linea``)\n *  - Linea Goerli Testnet (``linea-goerli``)\n *  - Linea Sepolia Testnet (``linea-sepolia``)\n *  - Optimism (``optimism``)\n *  - Optimism Goerli Testnet (``optimism-goerli``)\n *  - Optimism Sepolia Testnet (``optimism-sepolia``)\n *  - Polygon (``matic``)\n *  - Polygon Amoy Testnet (``matic-amoy``)\n *  - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n *  @_subsection: api/providers/thirdparty:INFURA  [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n    switch (name) {\n        case \"mainnet\":\n            return \"mainnet.infura.io\";\n        case \"goerli\":\n            return \"goerli.infura.io\";\n        case \"sepolia\":\n            return \"sepolia.infura.io\";\n        case \"arbitrum\":\n            return \"arbitrum-mainnet.infura.io\";\n        case \"arbitrum-goerli\":\n            return \"arbitrum-goerli.infura.io\";\n        case \"arbitrum-sepolia\":\n            return \"arbitrum-sepolia.infura.io\";\n        case \"base\":\n            return \"base-mainnet.infura.io\";\n        case \"base-goerlia\": // @TODO: Remove this typo in the future!\n        case \"base-goerli\":\n            return \"base-goerli.infura.io\";\n        case \"base-sepolia\":\n            return \"base-sepolia.infura.io\";\n        case \"bnb\":\n            return \"bsc-mainnet.infura.io\";\n        case \"bnbt\":\n            return \"bsc-testnet.infura.io\";\n        case \"linea\":\n            return \"linea-mainnet.infura.io\";\n        case \"linea-goerli\":\n            return \"linea-goerli.infura.io\";\n        case \"linea-sepolia\":\n            return \"linea-sepolia.infura.io\";\n        case \"matic\":\n            return \"polygon-mainnet.infura.io\";\n        case \"matic-amoy\":\n            return \"polygon-amoy.infura.io\";\n        case \"matic-mumbai\":\n            return \"polygon-mumbai.infura.io\";\n        case \"optimism\":\n            return \"optimism-mainnet.infura.io\";\n        case \"optimism-goerli\":\n            return \"optimism-goerli.infura.io\";\n        case \"optimism-sepolia\":\n            return \"optimism-sepolia.infura.io\";\n    }\n    assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n *  The **InfuraWebSocketProvider** connects to the [[link-infura]]\n *  WebSocket end-points.\n *\n *  By default, a highly-throttled API key is used, which is\n *  appropriate for quick prototypes and simple scripts. To\n *  gain access to an increased rate-limit, it is highly\n *  recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n    /**\n     *  The Project ID for the INFURA connection.\n     */\n    projectId;\n    /**\n     *  The Project Secret.\n     *\n     *  If null, no authenticated requests are made. This should not\n     *  be used outside of private contexts.\n     */\n    projectSecret;\n    /**\n     *  Creates a new **InfuraWebSocketProvider**.\n     */\n    constructor(network, projectId) {\n        const provider = new InfuraProvider(network, projectId);\n        const req = provider._getConnection();\n        assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n        const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n        super(url, provider._network);\n        defineProperties(this, {\n            projectId: provider.projectId,\n            projectSecret: provider.projectSecret\n        });\n    }\n    isCommunityResource() {\n        return (this.projectId === defaultProjectId);\n    }\n}\n/**\n *  The **InfuraProvider** connects to the [[link-infura]]\n *  JSON-RPC end-points.\n *\n *  By default, a highly-throttled API key is used, which is\n *  appropriate for quick prototypes and simple scripts. To\n *  gain access to an increased rate-limit, it is highly\n *  recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n    /**\n     *  The Project ID for the INFURA connection.\n     */\n    projectId;\n    /**\n     *  The Project Secret.\n     *\n     *  If null, no authenticated requests are made. This should not\n     *  be used outside of private contexts.\n     */\n    projectSecret;\n    /**\n     *  Creates a new **InfuraProvider**.\n     */\n    constructor(_network, projectId, projectSecret) {\n        if (_network == null) {\n            _network = \"mainnet\";\n        }\n        const network = Network.from(_network);\n        if (projectId == null) {\n            projectId = defaultProjectId;\n        }\n        if (projectSecret == null) {\n            projectSecret = null;\n        }\n        const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n        super(request, network, { staticNetwork: network });\n        defineProperties(this, { projectId, projectSecret });\n    }\n    _getProvider(chainId) {\n        try {\n            return new InfuraProvider(chainId, this.projectId, this.projectSecret);\n        }\n        catch (error) { }\n        return super._getProvider(chainId);\n    }\n    isCommunityResource() {\n        return (this.projectId === defaultProjectId);\n    }\n    /**\n     *  Creates a new **InfuraWebSocketProvider**.\n     */\n    static getWebSocketProvider(network, projectId) {\n        return new InfuraWebSocketProvider(network, projectId);\n    }\n    /**\n     *  Returns a prepared request for connecting to %%network%%\n     *  with %%projectId%% and %%projectSecret%%.\n     */\n    static getRequest(network, projectId, projectSecret) {\n        if (projectId == null) {\n            projectId = defaultProjectId;\n        }\n        if (projectSecret == null) {\n            projectSecret = null;\n        }\n        const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n        request.allowGzip = true;\n        if (projectSecret) {\n            request.setCredentials(\"\", projectSecret);\n        }\n        if (projectId === defaultProjectId) {\n            request.retryFunc = async (request, response, attempt) => {\n                showThrottleMessage(\"InfuraProvider\");\n                return true;\n            };\n        }\n        return request;\n    }\n}\n//# sourceMappingURL=provider-infura.js.mapimport { connect } from \"net\";\nimport { SocketProvider } from \"./provider-socket.js\";\n// @TODO: Is this sufficient? Is this robust? Will newlines occur between\n// all payloads and only between payloads?\nfunction splitBuffer(data) {\n    const messages = [];\n    let lastStart = 0;\n    while (true) {\n        const nl = data.indexOf(10, lastStart);\n        if (nl === -1) {\n            break;\n        }\n        messages.push(data.subarray(lastStart, nl).toString().trim());\n        lastStart = nl + 1;\n    }\n    return { messages, remaining: data.subarray(lastStart) };\n}\n/**\n *  An **IpcSocketProvider** connects over an IPC socket on the host\n *  which provides fast access to the node, but requires the node and\n *  the script run on the same machine.\n */\nexport class IpcSocketProvider extends SocketProvider {\n    #socket;\n    /**\n     *  The connected socket.\n     */\n    get socket() { return this.#socket; }\n    constructor(path, network, options) {\n        super(network, options);\n        this.#socket = connect(path);\n        this.socket.on(\"ready\", async () => {\n            try {\n                await this._start();\n            }\n            catch (error) {\n                console.log(\"failed to start IpcSocketProvider\", error);\n                // @TODO: Now what? Restart?\n            }\n        });\n        let response = Buffer.alloc(0);\n        this.socket.on(\"data\", (data) => {\n            response = Buffer.concat([response, data]);\n            const { messages, remaining } = splitBuffer(response);\n            messages.forEach((message) => {\n                this._processMessage(message);\n            });\n            response = remaining;\n        });\n        this.socket.on(\"end\", () => {\n            this.emit(\"close\");\n            this.socket.destroy();\n            this.socket.end();\n        });\n    }\n    destroy() {\n        this.socket.destroy();\n        this.socket.end();\n        super.destroy();\n    }\n    async _write(message) {\n        if (!message.endsWith(\"\\n\")) {\n            message += \"\\n\";\n        }\n        this.socket.write(message);\n    }\n}\n//# sourceMappingURL=provider-ipcsocket.js.map/**\n *  One of the most common ways to interact with the blockchain is\n *  by a node running a JSON-RPC interface which can be connected to,\n *  based on the transport, using:\n *\n *  - HTTP or HTTPS - [[JsonRpcProvider]]\n *  - WebSocket - [[WebSocketProvider]]\n *  - IPC - [[IpcSocketProvider]]\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider  [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\n// https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/ethereum/eth1.0-apis/assembled-spec/openrpc.json&uiSchema%5BappBar%5D%5Bui:splitView%5D=true&uiSchema%5BappBar%5D%5Bui:input%5D=false&uiSchema%5BappBar%5D%5Bui:examplesDropdown%5D=false\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress, resolveAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { accessListify, authorizationify } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, isError, makeError, assert, assertArgument, FetchRequest, resolveProperties } from \"../utils/index.js\";\nimport { AbstractProvider, UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nimport { Network } from \"./network.js\";\nimport { FilterIdEventSubscriber, FilterIdPendingSubscriber } from \"./subscriber-filterid.js\";\nimport { PollingEventSubscriber } from \"./subscriber-polling.js\";\nconst Primitive = \"bigint,boolean,function,number,string,symbol\".split(/,/g);\n//const Methods = \"getAddress,then\".split(/,/g);\nfunction deepCopy(value) {\n    if (value == null || Primitive.indexOf(typeof (value)) >= 0) {\n        return value;\n    }\n    // Keep any Addressable\n    if (typeof (value.getAddress) === \"function\") {\n        return value;\n    }\n    if (Array.isArray(value)) {\n        return (value.map(deepCopy));\n    }\n    if (typeof (value) === \"object\") {\n        return Object.keys(value).reduce((accum, key) => {\n            accum[key] = value[key];\n            return accum;\n        }, {});\n    }\n    throw new Error(`should not happen: ${value} (${typeof (value)})`);\n}\nfunction stall(duration) {\n    return new Promise((resolve) => { setTimeout(resolve, duration); });\n}\nfunction getLowerCase(value) {\n    if (value) {\n        return value.toLowerCase();\n    }\n    return value;\n}\nfunction isPollable(value) {\n    return (value && typeof (value.pollingInterval) === \"number\");\n}\nconst defaultOptions = {\n    polling: false,\n    staticNetwork: null,\n    batchStallTime: 10,\n    batchMaxSize: (1 << 20),\n    batchMaxCount: 100,\n    cacheTimeout: 250,\n    pollingInterval: 4000\n};\n// @TODO: Unchecked Signers\nexport class JsonRpcSigner extends AbstractSigner {\n    address;\n    constructor(provider, address) {\n        super(provider);\n        address = getAddress(address);\n        defineProperties(this, { address });\n    }\n    connect(provider) {\n        assert(false, \"cannot reconnect JsonRpcSigner\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"signer.connect\"\n        });\n    }\n    async getAddress() {\n        return this.address;\n    }\n    // JSON-RPC will automatially fill in nonce, etc. so we just check from\n    async populateTransaction(tx) {\n        return await this.populateCall(tx);\n    }\n    // Returns just the hash of the transaction after sent, which is what\n    // the bare JSON-RPC API does;\n    async sendUncheckedTransaction(_tx) {\n        const tx = deepCopy(_tx);\n        const promises = [];\n        // Make sure the from matches the sender\n        if (tx.from) {\n            const _from = tx.from;\n            promises.push((async () => {\n                const from = await resolveAddress(_from, this.provider);\n                assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), \"from address mismatch\", \"transaction\", _tx);\n                tx.from = from;\n            })());\n        }\n        else {\n            tx.from = this.address;\n        }\n        // The JSON-RPC for eth_sendTransaction uses 90000 gas; if the user\n        // wishes to use this, it is easy to specify explicitly, otherwise\n        // we look it up for them.\n        if (tx.gasLimit == null) {\n            promises.push((async () => {\n                tx.gasLimit = await this.provider.estimateGas({ ...tx, from: this.address });\n            })());\n        }\n        // The address may be an ENS name or Addressable\n        if (tx.to != null) {\n            const _to = tx.to;\n            promises.push((async () => {\n                tx.to = await resolveAddress(_to, this.provider);\n            })());\n        }\n        // Wait until all of our properties are filled in\n        if (promises.length) {\n            await Promise.all(promises);\n        }\n        const hexTx = this.provider.getRpcTransaction(tx);\n        return this.provider.send(\"eth_sendTransaction\", [hexTx]);\n    }\n    async sendTransaction(tx) {\n        // This cannot be mined any earlier than any recent block\n        const blockNumber = await this.provider.getBlockNumber();\n        // Send the transaction\n        const hash = await this.sendUncheckedTransaction(tx);\n        // Unfortunately, JSON-RPC only provides and opaque transaction hash\n        // for a response, and we need the actual transaction, so we poll\n        // for it; it should show up very quickly\n        return await (new Promise((resolve, reject) => {\n            const timeouts = [1000, 100];\n            let invalids = 0;\n            const checkTx = async () => {\n                try {\n                    // Try getting the transaction\n                    const tx = await this.provider.getTransaction(hash);\n                    if (tx != null) {\n                        resolve(tx.replaceableTransaction(blockNumber));\n                        return;\n                    }\n                }\n                catch (error) {\n                    // If we were cancelled: stop polling.\n                    // If the data is bad: the node returns bad transactions\n                    // If the network changed: calling again will also fail\n                    // If unsupported: likely destroyed\n                    if (isError(error, \"CANCELLED\") || isError(error, \"BAD_DATA\") ||\n                        isError(error, \"NETWORK_ERROR\") || isError(error, \"UNSUPPORTED_OPERATION\")) {\n                        if (error.info == null) {\n                            error.info = {};\n                        }\n                        error.info.sendTransactionHash = hash;\n                        reject(error);\n                        return;\n                    }\n                    // Stop-gap for misbehaving backends; see #4513\n                    if (isError(error, \"INVALID_ARGUMENT\")) {\n                        invalids++;\n                        if (error.info == null) {\n                            error.info = {};\n                        }\n                        error.info.sendTransactionHash = hash;\n                        if (invalids > 10) {\n                            reject(error);\n                            return;\n                        }\n                    }\n                    // Notify anyone that cares; but we will try again, since\n                    // it is likely an intermittent service error\n                    this.provider.emit(\"error\", makeError(\"failed to fetch transation after sending (will try again)\", \"UNKNOWN_ERROR\", { error }));\n                }\n                // Wait another 4 seconds\n                this.provider._setTimeout(() => { checkTx(); }, timeouts.pop() || 4000);\n            };\n            checkTx();\n        }));\n    }\n    async signTransaction(_tx) {\n        const tx = deepCopy(_tx);\n        // Make sure the from matches the sender\n        if (tx.from) {\n            const from = await resolveAddress(tx.from, this.provider);\n            assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), \"from address mismatch\", \"transaction\", _tx);\n            tx.from = from;\n        }\n        else {\n            tx.from = this.address;\n        }\n        const hexTx = this.provider.getRpcTransaction(tx);\n        return await this.provider.send(\"eth_signTransaction\", [hexTx]);\n    }\n    async signMessage(_message) {\n        const message = ((typeof (_message) === \"string\") ? toUtf8Bytes(_message) : _message);\n        return await this.provider.send(\"personal_sign\", [\n            hexlify(message), this.address.toLowerCase()\n        ]);\n    }\n    async signTypedData(domain, types, _value) {\n        const value = deepCopy(_value);\n        // Populate any ENS names (in-place)\n        const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => {\n            const address = await resolveAddress(value);\n            assertArgument(address != null, \"TypedData does not support null address\", \"value\", value);\n            return address;\n        });\n        return await this.provider.send(\"eth_signTypedData_v4\", [\n            this.address.toLowerCase(),\n            JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value))\n        ]);\n    }\n    async unlock(password) {\n        return this.provider.send(\"personal_unlockAccount\", [\n            this.address.toLowerCase(), password, null\n        ]);\n    }\n    // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign\n    async _legacySignMessage(_message) {\n        const message = ((typeof (_message) === \"string\") ? toUtf8Bytes(_message) : _message);\n        return await this.provider.send(\"eth_sign\", [\n            this.address.toLowerCase(), hexlify(message)\n        ]);\n    }\n}\n/**\n *  The JsonRpcApiProvider is an abstract class and **MUST** be\n *  sub-classed.\n *\n *  It provides the base for all JSON-RPC-based Provider interaction.\n *\n *  Sub-classing Notes:\n *  - a sub-class MUST override _send\n *  - a sub-class MUST call the `_start()` method once connected\n */\nexport class JsonRpcApiProvider extends AbstractProvider {\n    #options;\n    // The next ID to use for the JSON-RPC ID field\n    #nextId;\n    // Payloads are queued and triggered in batches using the drainTimer\n    #payloads;\n    #drainTimer;\n    #notReady;\n    #network;\n    #pendingDetectNetwork;\n    #scheduleDrain() {\n        if (this.#drainTimer) {\n            return;\n        }\n        // If we aren't using batching, no harm in sending it immediately\n        const stallTime = (this._getOption(\"batchMaxCount\") === 1) ? 0 : this._getOption(\"batchStallTime\");\n        this.#drainTimer = setTimeout(() => {\n            this.#drainTimer = null;\n            const payloads = this.#payloads;\n            this.#payloads = [];\n            while (payloads.length) {\n                // Create payload batches that satisfy our batch constraints\n                const batch = [(payloads.shift())];\n                while (payloads.length) {\n                    if (batch.length === this.#options.batchMaxCount) {\n                        break;\n                    }\n                    batch.push((payloads.shift()));\n                    const bytes = JSON.stringify(batch.map((p) => p.payload));\n                    if (bytes.length > this.#options.batchMaxSize) {\n                        payloads.unshift((batch.pop()));\n                        break;\n                    }\n                }\n                // Process the result to each payload\n                (async () => {\n                    const payload = ((batch.length === 1) ? batch[0].payload : batch.map((p) => p.payload));\n                    this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n                    try {\n                        const result = await this._send(payload);\n                        this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n                        // Process results in batch order\n                        for (const { resolve, reject, payload } of batch) {\n                            if (this.destroyed) {\n                                reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: payload.method }));\n                                continue;\n                            }\n                            // Find the matching result\n                            const resp = result.filter((r) => (r.id === payload.id))[0];\n                            // No result; the node failed us in unexpected ways\n                            if (resp == null) {\n                                const error = makeError(\"missing response for request\", \"BAD_DATA\", {\n                                    value: result, info: { payload }\n                                });\n                                this.emit(\"error\", error);\n                                reject(error);\n                                continue;\n                            }\n                            // The response is an error\n                            if (\"error\" in resp) {\n                                reject(this.getRpcError(payload, resp));\n                                continue;\n                            }\n                            // All good; send the result\n                            resolve(resp.result);\n                        }\n                    }\n                    catch (error) {\n                        this.emit(\"debug\", { action: \"receiveRpcError\", error });\n                        for (const { reject } of batch) {\n                            // @TODO: augment the error with the payload\n                            reject(error);\n                        }\n                    }\n                })();\n            }\n        }, stallTime);\n    }\n    constructor(network, options) {\n        super(network, options);\n        this.#nextId = 1;\n        this.#options = Object.assign({}, defaultOptions, options || {});\n        this.#payloads = [];\n        this.#drainTimer = null;\n        this.#network = null;\n        this.#pendingDetectNetwork = null;\n        {\n            let resolve = null;\n            const promise = new Promise((_resolve) => {\n                resolve = _resolve;\n            });\n            this.#notReady = { promise, resolve };\n        }\n        const staticNetwork = this._getOption(\"staticNetwork\");\n        if (typeof (staticNetwork) === \"boolean\") {\n            assertArgument(!staticNetwork || network !== \"any\", \"staticNetwork cannot be used on special network 'any'\", \"options\", options);\n            if (staticNetwork && network != null) {\n                this.#network = Network.from(network);\n            }\n        }\n        else if (staticNetwork) {\n            // Make sure any static network is compatbile with the provided netwrok\n            assertArgument(network == null || staticNetwork.matches(network), \"staticNetwork MUST match network object\", \"options\", options);\n            this.#network = staticNetwork;\n        }\n    }\n    /**\n     *  Returns the value associated with the option %%key%%.\n     *\n     *  Sub-classes can use this to inquire about configuration options.\n     */\n    _getOption(key) {\n        return this.#options[key];\n    }\n    /**\n     *  Gets the [[Network]] this provider has committed to. On each call, the network\n     *  is detected, and if it has changed, the call will reject.\n     */\n    get _network() {\n        assert(this.#network, \"network is not available yet\", \"NETWORK_ERROR\");\n        return this.#network;\n    }\n    /**\n     *  Resolves to the non-normalized value by performing %%req%%.\n     *\n     *  Sub-classes may override this to modify behavior of actions,\n     *  and should generally call ``super._perform`` as a fallback.\n     */\n    async _perform(req) {\n        // Legacy networks do not like the type field being passed along (which\n        // is fair), so we delete type if it is 0 and a non-EIP-1559 network\n        if (req.method === \"call\" || req.method === \"estimateGas\") {\n            let tx = req.transaction;\n            if (tx && tx.type != null && getBigInt(tx.type)) {\n                // If there are no EIP-1559 or newer properties, it might be pre-EIP-1559\n                if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {\n                    const feeData = await this.getFeeData();\n                    if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {\n                        // Network doesn't know about EIP-1559 (and hence type)\n                        req = Object.assign({}, req, {\n                            transaction: Object.assign({}, tx, { type: undefined })\n                        });\n                    }\n                }\n            }\n        }\n        const request = this.getRpcRequest(req);\n        if (request != null) {\n            return await this.send(request.method, request.args);\n        }\n        return super._perform(req);\n    }\n    /**\n     *  Sub-classes may override this; it detects the *actual* network that\n     *  we are **currently** connected to.\n     *\n     *  Keep in mind that [[send]] may only be used once [[ready]], otherwise the\n     *  _send primitive must be used instead.\n     */\n    async _detectNetwork() {\n        const network = this._getOption(\"staticNetwork\");\n        if (network) {\n            if (network === true) {\n                if (this.#network) {\n                    return this.#network;\n                }\n            }\n            else {\n                return network;\n            }\n        }\n        if (this.#pendingDetectNetwork) {\n            return await this.#pendingDetectNetwork;\n        }\n        // If we are ready, use ``send``, which enabled requests to be batched\n        if (this.ready) {\n            this.#pendingDetectNetwork = (async () => {\n                try {\n                    const result = Network.from(getBigInt(await this.send(\"eth_chainId\", [])));\n                    this.#pendingDetectNetwork = null;\n                    return result;\n                }\n                catch (error) {\n                    this.#pendingDetectNetwork = null;\n                    throw error;\n                }\n            })();\n            return await this.#pendingDetectNetwork;\n        }\n        // We are not ready yet; use the primitive _send\n        this.#pendingDetectNetwork = (async () => {\n            const payload = {\n                id: this.#nextId++, method: \"eth_chainId\", params: [], jsonrpc: \"2.0\"\n            };\n            this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n            let result;\n            try {\n                result = (await this._send(payload))[0];\n                this.#pendingDetectNetwork = null;\n            }\n            catch (error) {\n                this.#pendingDetectNetwork = null;\n                this.emit(\"debug\", { action: \"receiveRpcError\", error });\n                throw error;\n            }\n            this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n            if (\"result\" in result) {\n                return Network.from(getBigInt(result.result));\n            }\n            throw this.getRpcError(payload, result);\n        })();\n        return await this.#pendingDetectNetwork;\n    }\n    /**\n     *  Sub-classes **MUST** call this. Until [[_start]] has been called, no calls\n     *  will be passed to [[_send]] from [[send]]. If it is overridden, then\n     *  ``super._start()`` **MUST** be called.\n     *\n     *  Calling it multiple times is safe and has no effect.\n     */\n    _start() {\n        if (this.#notReady == null || this.#notReady.resolve == null) {\n            return;\n        }\n        this.#notReady.resolve();\n        this.#notReady = null;\n        (async () => {\n            // Bootstrap the network\n            while (this.#network == null && !this.destroyed) {\n                try {\n                    this.#network = await this._detectNetwork();\n                }\n                catch (error) {\n                    if (this.destroyed) {\n                        break;\n                    }\n                    console.log(\"JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)\");\n                    this.emit(\"error\", makeError(\"failed to bootstrap network detection\", \"NETWORK_ERROR\", { event: \"initial-network-discovery\", info: { error } }));\n                    await stall(1000);\n                }\n            }\n            // Start dispatching requests\n            this.#scheduleDrain();\n        })();\n    }\n    /**\n     *  Resolves once the [[_start]] has been called. This can be used in\n     *  sub-classes to defer sending data until the connection has been\n     *  established.\n     */\n    async _waitUntilReady() {\n        if (this.#notReady == null) {\n            return;\n        }\n        return await this.#notReady.promise;\n    }\n    /**\n     *  Return a Subscriber that will manage the %%sub%%.\n     *\n     *  Sub-classes may override this to modify the behavior of\n     *  subscription management.\n     */\n    _getSubscriber(sub) {\n        // Pending Filters aren't availble via polling\n        if (sub.type === \"pending\") {\n            return new FilterIdPendingSubscriber(this);\n        }\n        if (sub.type === \"event\") {\n            if (this._getOption(\"polling\")) {\n                return new PollingEventSubscriber(this, sub.filter);\n            }\n            return new FilterIdEventSubscriber(this, sub.filter);\n        }\n        // Orphaned Logs are handled automatically, by the filter, since\n        // logs with removed are emitted by it\n        if (sub.type === \"orphan\" && sub.filter.orphan === \"drop-log\") {\n            return new UnmanagedSubscriber(\"orphan\");\n        }\n        return super._getSubscriber(sub);\n    }\n    /**\n     *  Returns true only if the [[_start]] has been called.\n     */\n    get ready() { return this.#notReady == null; }\n    /**\n     *  Returns %%tx%% as a normalized JSON-RPC transaction request,\n     *  which has all values hexlified and any numeric values converted\n     *  to Quantity values.\n     */\n    getRpcTransaction(tx) {\n        const result = {};\n        // JSON-RPC now requires numeric values to be \"quantity\" values\n        [\"chainId\", \"gasLimit\", \"gasPrice\", \"type\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"value\"].forEach((key) => {\n            if (tx[key] == null) {\n                return;\n            }\n            let dstKey = key;\n            if (key === \"gasLimit\") {\n                dstKey = \"gas\";\n            }\n            result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`));\n        });\n        // Make sure addresses and data are lowercase\n        [\"from\", \"to\", \"data\"].forEach((key) => {\n            if (tx[key] == null) {\n                return;\n            }\n            result[key] = hexlify(tx[key]);\n        });\n        // Normalize the access list object\n        if (tx.accessList) {\n            result[\"accessList\"] = accessListify(tx.accessList);\n        }\n        if (tx.blobVersionedHashes) {\n            // @TODO: Remove this <any> case once EIP-4844 added to prepared tx\n            result[\"blobVersionedHashes\"] = tx.blobVersionedHashes.map(h => h.toLowerCase());\n        }\n        if (tx.authorizationList) {\n            result[\"authorizationList\"] = tx.authorizationList.map((_a) => {\n                const a = authorizationify(_a);\n                return {\n                    address: a.address,\n                    nonce: toQuantity(a.nonce),\n                    chainId: toQuantity(a.chainId),\n                    yParity: toQuantity(a.signature.yParity),\n                    r: toQuantity(a.signature.r),\n                    s: toQuantity(a.signature.s),\n                };\n            });\n        }\n        // @TODO: blobs should probably also be copied over, optionally\n        // accounting for the kzg property to backfill blobVersionedHashes\n        // using the commitment. Or should that be left as an exercise to\n        // the caller?\n        return result;\n    }\n    /**\n     *  Returns the request method and arguments required to perform\n     *  %%req%%.\n     */\n    getRpcRequest(req) {\n        switch (req.method) {\n            case \"chainId\":\n                return { method: \"eth_chainId\", args: [] };\n            case \"getBlockNumber\":\n                return { method: \"eth_blockNumber\", args: [] };\n            case \"getGasPrice\":\n                return { method: \"eth_gasPrice\", args: [] };\n            case \"getPriorityFee\":\n                return { method: \"eth_maxPriorityFeePerGas\", args: [] };\n            case \"getBalance\":\n                return {\n                    method: \"eth_getBalance\",\n                    args: [getLowerCase(req.address), req.blockTag]\n                };\n            case \"getTransactionCount\":\n                return {\n                    method: \"eth_getTransactionCount\",\n                    args: [getLowerCase(req.address), req.blockTag]\n                };\n            case \"getCode\":\n                return {\n                    method: \"eth_getCode\",\n                    args: [getLowerCase(req.address), req.blockTag]\n                };\n            case \"getStorage\":\n                return {\n                    method: \"eth_getStorageAt\",\n                    args: [\n                        getLowerCase(req.address),\n                        (\"0x\" + req.position.toString(16)),\n                        req.blockTag\n                    ]\n                };\n            case \"broadcastTransaction\":\n                return {\n                    method: \"eth_sendRawTransaction\",\n                    args: [req.signedTransaction]\n                };\n            case \"getBlock\":\n                if (\"blockTag\" in req) {\n                    return {\n                        method: \"eth_getBlockByNumber\",\n                        args: [req.blockTag, !!req.includeTransactions]\n                    };\n                }\n                else if (\"blockHash\" in req) {\n                    return {\n                        method: \"eth_getBlockByHash\",\n                        args: [req.blockHash, !!req.includeTransactions]\n                    };\n                }\n                break;\n            case \"getTransaction\":\n                return {\n                    method: \"eth_getTransactionByHash\",\n                    args: [req.hash]\n                };\n            case \"getTransactionReceipt\":\n                return {\n                    method: \"eth_getTransactionReceipt\",\n                    args: [req.hash]\n                };\n            case \"call\":\n                return {\n                    method: \"eth_call\",\n                    args: [this.getRpcTransaction(req.transaction), req.blockTag]\n                };\n            case \"estimateGas\": {\n                return {\n                    method: \"eth_estimateGas\",\n                    args: [this.getRpcTransaction(req.transaction)]\n                };\n            }\n            case \"getLogs\":\n                if (req.filter && req.filter.address != null) {\n                    if (Array.isArray(req.filter.address)) {\n                        req.filter.address = req.filter.address.map(getLowerCase);\n                    }\n                    else {\n                        req.filter.address = getLowerCase(req.filter.address);\n                    }\n                }\n                return { method: \"eth_getLogs\", args: [req.filter] };\n        }\n        return null;\n    }\n    /**\n     *  Returns an ethers-style Error for the given JSON-RPC error\n     *  %%payload%%, coalescing the various strings and error shapes\n     *  that different nodes return, coercing them into a machine-readable\n     *  standardized error.\n     */\n    getRpcError(payload, _error) {\n        const { method } = payload;\n        const { error } = _error;\n        if (method === \"eth_estimateGas\" && error.message) {\n            const msg = error.message;\n            if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) {\n                return makeError(\"insufficient funds\", \"INSUFFICIENT_FUNDS\", {\n                    transaction: (payload.params[0]),\n                    info: { payload, error }\n                });\n            }\n            else if (msg.match(/nonce/i) && msg.match(/too low/i)) {\n                return makeError(\"nonce has already been used\", \"NONCE_EXPIRED\", {\n                    transaction: (payload.params[0]),\n                    info: { payload, error }\n                });\n            }\n        }\n        if (method === \"eth_call\" || method === \"eth_estimateGas\") {\n            const result = spelunkData(error);\n            const e = AbiCoder.getBuiltinCallException((method === \"eth_call\") ? \"call\" : \"estimateGas\", (payload.params[0]), (result ? result.data : null));\n            e.info = { error, payload };\n            return e;\n        }\n        // Only estimateGas and call can return arbitrary contract-defined text, so now we\n        // we can process text safely.\n        const message = JSON.stringify(spelunkMessage(error));\n        if (typeof (error.message) === \"string\" && error.message.match(/user denied|ethers-user-denied/i)) {\n            const actionMap = {\n                eth_sign: \"signMessage\",\n                personal_sign: \"signMessage\",\n                eth_signTypedData_v4: \"signTypedData\",\n                eth_signTransaction: \"signTransaction\",\n                eth_sendTransaction: \"sendTransaction\",\n                eth_requestAccounts: \"requestAccess\",\n                wallet_requestAccounts: \"requestAccess\",\n            };\n            return makeError(`user rejected action`, \"ACTION_REJECTED\", {\n                action: (actionMap[method] || \"unknown\"),\n                reason: \"rejected\",\n                info: { payload, error }\n            });\n        }\n        if (method === \"eth_sendRawTransaction\" || method === \"eth_sendTransaction\") {\n            const transaction = (payload.params[0]);\n            if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {\n                return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n                    transaction, info: { error }\n                });\n            }\n            if (message.match(/nonce/i) && message.match(/too low/i)) {\n                return makeError(\"nonce has already been used\", \"NONCE_EXPIRED\", { transaction, info: { error } });\n            }\n            // \"replacement transaction underpriced\"\n            if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) {\n                return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", { transaction, info: { error } });\n            }\n            if (message.match(/only replay-protected/i)) {\n                return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n                    operation: method, info: { transaction, info: { error } }\n                });\n            }\n        }\n        let unsupported = !!message.match(/the method .* does not exist/i);\n        if (!unsupported) {\n            if (error && error.details && error.details.startsWith(\"Unauthorized method:\")) {\n                unsupported = true;\n            }\n        }\n        if (unsupported) {\n            return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n                operation: payload.method, info: { error, payload }\n            });\n        }\n        return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error, payload });\n    }\n    /**\n     *  Requests the %%method%% with %%params%% via the JSON-RPC protocol\n     *  over the underlying channel. This can be used to call methods\n     *  on the backend that do not have a high-level API within the Provider\n     *  API.\n     *\n     *  This method queues requests according to the batch constraints\n     *  in the options, assigns the request a unique ID.\n     *\n     *  **Do NOT override** this method in sub-classes; instead\n     *  override [[_send]] or force the options values in the\n     *  call to the constructor to modify this method's behavior.\n     */\n    send(method, params) {\n        // @TODO: cache chainId?? purge on switch_networks\n        // We have been destroyed; no operations are supported anymore\n        if (this.destroyed) {\n            return Promise.reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: method }));\n        }\n        const id = this.#nextId++;\n        const promise = new Promise((resolve, reject) => {\n            this.#payloads.push({\n                resolve, reject,\n                payload: { method, params, id, jsonrpc: \"2.0\" }\n            });\n        });\n        // If there is not a pending drainTimer, set one\n        this.#scheduleDrain();\n        return promise;\n    }\n    /**\n     *  Resolves to the [[Signer]] account for  %%address%% managed by\n     *  the client.\n     *\n     *  If the %%address%% is a number, it is used as an index in the\n     *  the accounts from [[listAccounts]].\n     *\n     *  This can only be used on clients which manage accounts (such as\n     *  Geth with imported account or MetaMask).\n     *\n     *  Throws if the account doesn't exist.\n     */\n    async getSigner(address) {\n        if (address == null) {\n            address = 0;\n        }\n        const accountsPromise = this.send(\"eth_accounts\", []);\n        // Account index\n        if (typeof (address) === \"number\") {\n            const accounts = (await accountsPromise);\n            if (address >= accounts.length) {\n                throw new Error(\"no such account\");\n            }\n            return new JsonRpcSigner(this, accounts[address]);\n        }\n        const { accounts } = await resolveProperties({\n            network: this.getNetwork(),\n            accounts: accountsPromise\n        });\n        // Account address\n        address = getAddress(address);\n        for (const account of accounts) {\n            if (getAddress(account) === address) {\n                return new JsonRpcSigner(this, address);\n            }\n        }\n        throw new Error(\"invalid account\");\n    }\n    async listAccounts() {\n        const accounts = await this.send(\"eth_accounts\", []);\n        return accounts.map((a) => new JsonRpcSigner(this, a));\n    }\n    destroy() {\n        // Stop processing requests\n        if (this.#drainTimer) {\n            clearTimeout(this.#drainTimer);\n            this.#drainTimer = null;\n        }\n        // Cancel all pending requests\n        for (const { payload, reject } of this.#payloads) {\n            reject(makeError(\"provider destroyed; cancelled request\", \"UNSUPPORTED_OPERATION\", { operation: payload.method }));\n        }\n        this.#payloads = [];\n        // Parent clean-up\n        super.destroy();\n    }\n}\n// @TODO: remove this in v7, it is not exported because this functionality\n// is exposed in the JsonRpcApiProvider by setting polling to true. It should\n// be safe to remove regardless, because it isn't reachable, but just in case.\n/**\n *  @_ignore:\n */\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n    #pollingInterval;\n    constructor(network, options) {\n        super(network, options);\n        let pollingInterval = this._getOption(\"pollingInterval\");\n        if (pollingInterval == null) {\n            pollingInterval = defaultOptions.pollingInterval;\n        }\n        this.#pollingInterval = pollingInterval;\n    }\n    _getSubscriber(sub) {\n        const subscriber = super._getSubscriber(sub);\n        if (isPollable(subscriber)) {\n            subscriber.pollingInterval = this.#pollingInterval;\n        }\n        return subscriber;\n    }\n    /**\n     *  The polling interval (default: 4000 ms)\n     */\n    get pollingInterval() { return this.#pollingInterval; }\n    set pollingInterval(value) {\n        if (!Number.isInteger(value) || value < 0) {\n            throw new Error(\"invalid interval\");\n        }\n        this.#pollingInterval = value;\n        this._forEachSubscriber((sub) => {\n            if (isPollable(sub)) {\n                sub.pollingInterval = this.#pollingInterval;\n            }\n        });\n    }\n}\n/**\n *  The JsonRpcProvider is one of the most common Providers,\n *  which performs all operations over HTTP (or HTTPS) requests.\n *\n *  Events are processed by polling the backend for the current block\n *  number; when it advances, all block-base events are then checked\n *  for updates.\n */\nexport class JsonRpcProvider extends JsonRpcApiPollingProvider {\n    #connect;\n    constructor(url, network, options) {\n        if (url == null) {\n            url = \"http:/\\/localhost:8545\";\n        }\n        super(network, options);\n        if (typeof (url) === \"string\") {\n            this.#connect = new FetchRequest(url);\n        }\n        else {\n            this.#connect = url.clone();\n        }\n    }\n    _getConnection() {\n        return this.#connect.clone();\n    }\n    async send(method, params) {\n        // All requests are over HTTP, so we can just start handling requests\n        // We do this here rather than the constructor so that we don't send any\n        // requests to the network (i.e. eth_chainId) until we absolutely have to.\n        await this._start();\n        return await super.send(method, params);\n    }\n    async _send(payload) {\n        // Configure a POST connection for the requested method\n        const request = this._getConnection();\n        request.body = JSON.stringify(payload);\n        request.setHeader(\"content-type\", \"application/json\");\n        const response = await request.send();\n        response.assertOk();\n        let resp = response.bodyJson;\n        if (!Array.isArray(resp)) {\n            resp = [resp];\n        }\n        return resp;\n    }\n}\nfunction spelunkData(value) {\n    if (value == null) {\n        return null;\n    }\n    // These *are* the droids we're looking for.\n    if (typeof (value.message) === \"string\" && value.message.match(/revert/i) && isHexString(value.data)) {\n        return { message: value.message, data: value.data };\n    }\n    // Spelunk further...\n    if (typeof (value) === \"object\") {\n        for (const key in value) {\n            const result = spelunkData(value[key]);\n            if (result) {\n                return result;\n            }\n        }\n        return null;\n    }\n    // Might be a JSON string we can further descend...\n    if (typeof (value) === \"string\") {\n        try {\n            return spelunkData(JSON.parse(value));\n        }\n        catch (error) { }\n    }\n    return null;\n}\nfunction _spelunkMessage(value, result) {\n    if (value == null) {\n        return;\n    }\n    // These *are* the droids we're looking for.\n    if (typeof (value.message) === \"string\") {\n        result.push(value.message);\n    }\n    // Spelunk further...\n    if (typeof (value) === \"object\") {\n        for (const key in value) {\n            _spelunkMessage(value[key], result);\n        }\n    }\n    // Might be a JSON string we can further descend...\n    if (typeof (value) === \"string\") {\n        try {\n            return _spelunkMessage(JSON.parse(value), result);\n        }\n        catch (error) { }\n    }\n}\nfunction spelunkMessage(value) {\n    const result = [];\n    _spelunkMessage(value, result);\n    return result;\n}\n//# sourceMappingURL=provider-jsonrpc.js.map/**\n *  [[link-pocket]] provides a third-party service for connecting to\n *  various blockchains over JSON-RPC.\n *\n *  **Supported Networks**\n *\n *  - Ethereum Mainnet (``mainnet``)\n *  - Goerli Testnet (``goerli``)\n *  - Polygon (``matic``)\n *  - Arbitrum (``arbitrum``)\n *\n *  @_subsection: api/providers/thirdparty:Pocket  [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n    switch (name) {\n        case \"mainnet\":\n            return \"eth-mainnet.gateway.pokt.network\";\n        case \"goerli\":\n            return \"eth-goerli.gateway.pokt.network\";\n        case \"matic\":\n            return \"poly-mainnet.gateway.pokt.network\";\n        case \"matic-mumbai\":\n            return \"polygon-mumbai-rpc.gateway.pokt.network\";\n    }\n    assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n *  The **PocketProvider** connects to the [[link-pocket]]\n *  JSON-RPC end-points.\n *\n *  By default, a highly-throttled API key is used, which is\n *  appropriate for quick prototypes and simple scripts. To\n *  gain access to an increased rate-limit, it is highly\n *  recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n    /**\n     *  The Application ID for the Pocket connection.\n     */\n    applicationId;\n    /**\n     *  The Application Secret for making authenticated requests\n     *  to the Pocket connection.\n     */\n    applicationSecret;\n    /**\n     *  Create a new **PocketProvider**.\n     *\n     *  By default connecting to ``mainnet`` with a highly throttled\n     *  API key.\n     */\n    constructor(_network, applicationId, applicationSecret) {\n        if (_network == null) {\n            _network = \"mainnet\";\n        }\n        const network = Network.from(_network);\n        if (applicationId == null) {\n            applicationId = defaultApplicationId;\n        }\n        if (applicationSecret == null) {\n            applicationSecret = null;\n        }\n        const options = { staticNetwork: network };\n        const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n        super(request, network, options);\n        defineProperties(this, { applicationId, applicationSecret });\n    }\n    _getProvider(chainId) {\n        try {\n            return new PocketProvider(chainId, this.applicationId, this.applicationSecret);\n        }\n        catch (error) { }\n        return super._getProvider(chainId);\n    }\n    /**\n     *  Returns a prepared request for connecting to %%network%% with\n     *  %%applicationId%%.\n     */\n    static getRequest(network, applicationId, applicationSecret) {\n        if (applicationId == null) {\n            applicationId = defaultApplicationId;\n        }\n        const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n        request.allowGzip = true;\n        if (applicationSecret) {\n            request.setCredentials(\"\", applicationSecret);\n        }\n        if (applicationId === defaultApplicationId) {\n            request.retryFunc = async (request, response, attempt) => {\n                showThrottleMessage(\"PocketProvider\");\n                return true;\n            };\n        }\n        return request;\n    }\n    isCommunityResource() {\n        return (this.applicationId === defaultApplicationId);\n    }\n}\n//# sourceMappingURL=provider-pocket.js.map/**\n *  [[link-quicknode]] provides a third-party service for connecting to\n *  various blockchains over JSON-RPC.\n *\n *  **Supported Networks**\n *\n *  - Ethereum Mainnet (``mainnet``)\n *  - Goerli Testnet (``goerli``)\n *  - Sepolia Testnet (``sepolia``)\n *  - Holesky Testnet (``holesky``)\n *  - Arbitrum (``arbitrum``)\n *  - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n *  - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)\n *  - Base Mainnet (``base``);\n *  - Base Goerli Testnet (``base-goerli``);\n *  - Base Sepolia Testnet (``base-sepolia``);\n *  - BNB Smart Chain Mainnet (``bnb``)\n *  - BNB Smart Chain Testnet (``bnbt``)\n *  - Optimism (``optimism``)\n *  - Optimism Goerli Testnet (``optimism-goerli``)\n *  - Optimism Sepolia Testnet (``optimism-sepolia``)\n *  - Polygon (``matic``)\n *  - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n *  @_subsection: api/providers/thirdparty:QuickNode  [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n    switch (name) {\n        case \"mainnet\":\n            return \"ethers.quiknode.pro\";\n        case \"goerli\":\n            return \"ethers.ethereum-goerli.quiknode.pro\";\n        case \"sepolia\":\n            return \"ethers.ethereum-sepolia.quiknode.pro\";\n        case \"holesky\":\n            return \"ethers.ethereum-holesky.quiknode.pro\";\n        case \"arbitrum\":\n            return \"ethers.arbitrum-mainnet.quiknode.pro\";\n        case \"arbitrum-goerli\":\n            return \"ethers.arbitrum-goerli.quiknode.pro\";\n        case \"arbitrum-sepolia\":\n            return \"ethers.arbitrum-sepolia.quiknode.pro\";\n        case \"base\":\n            return \"ethers.base-mainnet.quiknode.pro\";\n        case \"base-goerli\":\n            return \"ethers.base-goerli.quiknode.pro\";\n        case \"base-spolia\":\n            return \"ethers.base-sepolia.quiknode.pro\";\n        case \"bnb\":\n            return \"ethers.bsc.quiknode.pro\";\n        case \"bnbt\":\n            return \"ethers.bsc-testnet.quiknode.pro\";\n        case \"matic\":\n            return \"ethers.matic.quiknode.pro\";\n        case \"matic-mumbai\":\n            return \"ethers.matic-testnet.quiknode.pro\";\n        case \"optimism\":\n            return \"ethers.optimism.quiknode.pro\";\n        case \"optimism-goerli\":\n            return \"ethers.optimism-goerli.quiknode.pro\";\n        case \"optimism-sepolia\":\n            return \"ethers.optimism-sepolia.quiknode.pro\";\n        case \"xdai\":\n            return \"ethers.xdai.quiknode.pro\";\n    }\n    assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/*\n@TODO:\n  These networks are not currently present in the Network\n  default included networks. Research them and ensure they\n  are EVM compatible and work with ethers\n\n  http://ethers.matic-amoy.quiknode.pro\n\n  http://ethers.avalanche-mainnet.quiknode.pro\n  http://ethers.avalanche-testnet.quiknode.pro\n  http://ethers.blast-sepolia.quiknode.pro\n  http://ethers.celo-mainnet.quiknode.pro\n  http://ethers.fantom.quiknode.pro\n  http://ethers.imx-demo.quiknode.pro\n  http://ethers.imx-mainnet.quiknode.pro\n  http://ethers.imx-testnet.quiknode.pro\n  http://ethers.near-mainnet.quiknode.pro\n  http://ethers.near-testnet.quiknode.pro\n  http://ethers.nova-mainnet.quiknode.pro\n  http://ethers.scroll-mainnet.quiknode.pro\n  http://ethers.scroll-testnet.quiknode.pro\n  http://ethers.tron-mainnet.quiknode.pro\n  http://ethers.zkevm-mainnet.quiknode.pro\n  http://ethers.zkevm-testnet.quiknode.pro\n  http://ethers.zksync-mainnet.quiknode.pro\n  http://ethers.zksync-testnet.quiknode.pro\n*/\n/**\n *  The **QuickNodeProvider** connects to the [[link-quicknode]]\n *  JSON-RPC end-points.\n *\n *  By default, a highly-throttled API token is used, which is\n *  appropriate for quick prototypes and simple scripts. To\n *  gain access to an increased rate-limit, it is highly\n *  recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n    /**\n     *  The API token.\n     */\n    token;\n    /**\n     *  Creates a new **QuickNodeProvider**.\n     */\n    constructor(_network, token) {\n        if (_network == null) {\n            _network = \"mainnet\";\n        }\n        const network = Network.from(_network);\n        if (token == null) {\n            token = defaultToken;\n        }\n        const request = QuickNodeProvider.getRequest(network, token);\n        super(request, network, { staticNetwork: network });\n        defineProperties(this, { token });\n    }\n    _getProvider(chainId) {\n        try {\n            return new QuickNodeProvider(chainId, this.token);\n        }\n        catch (error) { }\n        return super._getProvider(chainId);\n    }\n    isCommunityResource() {\n        return (this.token === defaultToken);\n    }\n    /**\n     *  Returns a new request prepared for %%network%% and the\n     *  %%token%%.\n     */\n    static getRequest(network, token) {\n        if (token == null) {\n            token = defaultToken;\n        }\n        const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n        request.allowGzip = true;\n        //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n        if (token === defaultToken) {\n            request.retryFunc = async (request, response, attempt) => {\n                showThrottleMessage(\"QuickNodeProvider\");\n                return true;\n            };\n        }\n        return request;\n    }\n}\n//# sourceMappingURL=provider-quicknode.js.map/**\n *  Generic long-lived socket provider.\n *\n *  Sub-classing notes\n *  - a sub-class MUST call the `_start()` method once connected\n *  - a sub-class MUST override the `_write(string)` method\n *  - a sub-class MUST call `_processMessage(string)` for each message\n *\n *  @_subsection: api/providers/abstract-provider:Socket Providers  [about-socketProvider]\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\n/**\n *  A **SocketSubscriber** uses a socket transport to handle events and\n *  should use [[_emit]] to manage the events.\n */\nexport class SocketSubscriber {\n    #provider;\n    #filter;\n    /**\n     *  The filter.\n     */\n    get filter() { return JSON.parse(this.#filter); }\n    #filterId;\n    #paused;\n    #emitPromise;\n    /**\n     *  Creates a new **SocketSubscriber** attached to %%provider%% listening\n     *  to %%filter%%.\n     */\n    constructor(provider, filter) {\n        this.#provider = provider;\n        this.#filter = JSON.stringify(filter);\n        this.#filterId = null;\n        this.#paused = null;\n        this.#emitPromise = null;\n    }\n    start() {\n        this.#filterId = this.#provider.send(\"eth_subscribe\", this.filter).then((filterId) => {\n            ;\n            this.#provider._register(filterId, this);\n            return filterId;\n        });\n    }\n    stop() {\n        (this.#filterId).then((filterId) => {\n            if (this.#provider.destroyed) {\n                return;\n            }\n            this.#provider.send(\"eth_unsubscribe\", [filterId]);\n        });\n        this.#filterId = null;\n    }\n    // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n    //        and resume\n    pause(dropWhilePaused) {\n        assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n        this.#paused = !!dropWhilePaused;\n    }\n    resume() {\n        this.#paused = null;\n    }\n    /**\n     *  @_ignore:\n     */\n    _handleMessage(message) {\n        if (this.#filterId == null) {\n            return;\n        }\n        if (this.#paused === null) {\n            let emitPromise = this.#emitPromise;\n            if (emitPromise == null) {\n                emitPromise = this._emit(this.#provider, message);\n            }\n            else {\n                emitPromise = emitPromise.then(async () => {\n                    await this._emit(this.#provider, message);\n                });\n            }\n            this.#emitPromise = emitPromise.then(() => {\n                if (this.#emitPromise === emitPromise) {\n                    this.#emitPromise = null;\n                }\n            });\n        }\n    }\n    /**\n     *  Sub-classes **must** override this to emit the events on the\n     *  provider.\n     */\n    async _emit(provider, message) {\n        throw new Error(\"sub-classes must implemente this; _emit\");\n    }\n}\n/**\n *  A **SocketBlockSubscriber** listens for ``newHeads`` events and emits\n *  ``\"block\"`` events.\n */\nexport class SocketBlockSubscriber extends SocketSubscriber {\n    /**\n     *  @_ignore:\n     */\n    constructor(provider) {\n        super(provider, [\"newHeads\"]);\n    }\n    async _emit(provider, message) {\n        provider.emit(\"block\", parseInt(message.number));\n    }\n}\n/**\n *  A **SocketPendingSubscriber** listens for pending transacitons and emits\n *  ``\"pending\"`` events.\n */\nexport class SocketPendingSubscriber extends SocketSubscriber {\n    /**\n     *  @_ignore:\n     */\n    constructor(provider) {\n        super(provider, [\"newPendingTransactions\"]);\n    }\n    async _emit(provider, message) {\n        provider.emit(\"pending\", message);\n    }\n}\n/**\n *  A **SocketEventSubscriber** listens for event logs.\n */\nexport class SocketEventSubscriber extends SocketSubscriber {\n    #logFilter;\n    /**\n     *  The filter.\n     */\n    get logFilter() { return JSON.parse(this.#logFilter); }\n    /**\n     *  @_ignore:\n     */\n    constructor(provider, filter) {\n        super(provider, [\"logs\", filter]);\n        this.#logFilter = JSON.stringify(filter);\n    }\n    async _emit(provider, message) {\n        provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n    }\n}\n/**\n *  A **SocketProvider** is backed by a long-lived connection over a\n *  socket, which can subscribe and receive real-time messages over\n *  its communication channel.\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n    #callbacks;\n    // Maps each filterId to its subscriber\n    #subs;\n    // If any events come in before a subscriber has finished\n    // registering, queue them\n    #pending;\n    /**\n     *  Creates a new **SocketProvider** connected to %%network%%.\n     *\n     *  If unspecified, the network will be discovered.\n     */\n    constructor(network, _options) {\n        // Copy the options\n        const options = Object.assign({}, (_options != null) ? _options : {});\n        // Support for batches is generally not supported for\n        // connection-base providers; if this changes in the future\n        // the _send should be updated to reflect this\n        assertArgument(options.batchMaxCount == null || options.batchMaxCount === 1, \"sockets-based providers do not support batches\", \"options.batchMaxCount\", _options);\n        options.batchMaxCount = 1;\n        // Socket-based Providers (generally) cannot change their network,\n        // since they have a long-lived connection; but let people override\n        // this if they have just cause.\n        if (options.staticNetwork == null) {\n            options.staticNetwork = true;\n        }\n        super(network, options);\n        this.#callbacks = new Map();\n        this.#subs = new Map();\n        this.#pending = new Map();\n    }\n    // This value is only valid after _start has been called\n    /*\n    get _network(): Network {\n        if (this.#network == null) {\n            throw new Error(\"this shouldn't happen\");\n        }\n        return this.#network.clone();\n    }\n    */\n    _getSubscriber(sub) {\n        switch (sub.type) {\n            case \"close\":\n                return new UnmanagedSubscriber(\"close\");\n            case \"block\":\n                return new SocketBlockSubscriber(this);\n            case \"pending\":\n                return new SocketPendingSubscriber(this);\n            case \"event\":\n                return new SocketEventSubscriber(this, sub.filter);\n            case \"orphan\":\n                // Handled auto-matically within AbstractProvider\n                // when the log.removed = true\n                if (sub.filter.orphan === \"drop-log\") {\n                    return new UnmanagedSubscriber(\"drop-log\");\n                }\n        }\n        return super._getSubscriber(sub);\n    }\n    /**\n     *  Register a new subscriber. This is used internalled by Subscribers\n     *  and generally is unecessary unless extending capabilities.\n     */\n    _register(filterId, subscriber) {\n        this.#subs.set(filterId, subscriber);\n        const pending = this.#pending.get(filterId);\n        if (pending) {\n            for (const message of pending) {\n                subscriber._handleMessage(message);\n            }\n            this.#pending.delete(filterId);\n        }\n    }\n    async _send(payload) {\n        // WebSocket provider doesn't accept batches\n        assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n        // @TODO: stringify payloads here and store to prevent mutations\n        // Prepare a promise to respond to\n        const promise = new Promise((resolve, reject) => {\n            this.#callbacks.set(payload.id, { payload, resolve, reject });\n        });\n        // Wait until the socket is connected before writing to it\n        await this._waitUntilReady();\n        // Write the request to the socket\n        await this._write(JSON.stringify(payload));\n        return [await promise];\n    }\n    // Sub-classes must call this once they are connected\n    /*\n    async _start(): Promise<void> {\n        if (this.#ready) { return; }\n\n        for (const { payload } of this.#callbacks.values()) {\n            await this._write(JSON.stringify(payload));\n        }\n\n        this.#ready = (async function() {\n            await super._start();\n        })();\n    }\n    */\n    /**\n     *  Sub-classes **must** call this with messages received over their\n     *  transport to be processed and dispatched.\n     */\n    async _processMessage(message) {\n        const result = (JSON.parse(message));\n        if (result && typeof (result) === \"object\" && \"id\" in result) {\n            const callback = this.#callbacks.get(result.id);\n            if (callback == null) {\n                this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n                    reasonCode: \"UNKNOWN_ID\",\n                    result\n                }));\n                return;\n            }\n            this.#callbacks.delete(result.id);\n            callback.resolve(result);\n        }\n        else if (result && result.method === \"eth_subscription\") {\n            const filterId = result.params.subscription;\n            const subscriber = this.#subs.get(filterId);\n            if (subscriber) {\n                subscriber._handleMessage(result.params.result);\n            }\n            else {\n                let pending = this.#pending.get(filterId);\n                if (pending == null) {\n                    pending = [];\n                    this.#pending.set(filterId, pending);\n                }\n                pending.push(result.params.result);\n            }\n        }\n        else {\n            this.emit(\"error\", makeError(\"received unexpected message\", \"UNKNOWN_ERROR\", {\n                reasonCode: \"UNEXPECTED_MESSAGE\",\n                result\n            }));\n            return;\n        }\n    }\n    /**\n     *  Sub-classes **must** override this to send %%message%% over their\n     *  transport.\n     */\n    async _write(message) {\n        throw new Error(\"sub-classes must override this\");\n    }\n}\n//# sourceMappingURL=provider-socket.js.mapimport { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\n/**\n *  A JSON-RPC provider which is backed by a WebSocket.\n *\n *  WebSockets are often preferred because they retain a live connection\n *  to a server, which permits more instant access to events.\n *\n *  However, this incurs higher server infrasturture costs, so additional\n *  resources may be required to host your own WebSocket nodes and many\n *  third-party services charge additional fees for WebSocket endpoints.\n */\nexport class WebSocketProvider extends SocketProvider {\n    #connect;\n    #websocket;\n    get websocket() {\n        if (this.#websocket == null) {\n            throw new Error(\"websocket closed\");\n        }\n        return this.#websocket;\n    }\n    constructor(url, network, options) {\n        super(network, options);\n        if (typeof (url) === \"string\") {\n            this.#connect = () => { return new _WebSocket(url); };\n            this.#websocket = this.#connect();\n        }\n        else if (typeof (url) === \"function\") {\n            this.#connect = url;\n            this.#websocket = url();\n        }\n        else {\n            this.#connect = null;\n            this.#websocket = url;\n        }\n        this.websocket.onopen = async () => {\n            try {\n                await this._start();\n                this.resume();\n            }\n            catch (error) {\n                console.log(\"failed to start WebsocketProvider\", error);\n                // @TODO: now what? Attempt reconnect?\n            }\n        };\n        this.websocket.onmessage = (message) => {\n            this._processMessage(message.data);\n        };\n        /*\n                this.websocket.onclose = (event) => {\n                    // @TODO: What event.code should we reconnect on?\n                    const reconnect = false;\n                    if (reconnect) {\n                        this.pause(true);\n                        if (this.#connect) {\n                            this.#websocket = this.#connect();\n                            this.#websocket.onopen = ...\n                            // @TODO: this requires the super class to rebroadcast; move it there\n                        }\n                        this._reconnect();\n                    }\n                };\n        */\n    }\n    async _write(message) {\n        this.websocket.send(message);\n    }\n    async destroy() {\n        if (this.#websocket != null) {\n            this.#websocket.close();\n            this.#websocket = null;\n        }\n        super.destroy();\n    }\n}\n//# sourceMappingURL=provider-websocket.js.map//import { resolveAddress } from \"@ethersproject/address\";\nimport { defineProperties, getBigInt, getNumber, hexlify, isBytesLike, resolveProperties, assert, assertArgument, isError, makeError } from \"../utils/index.js\";\nimport { accessListify } from \"../transaction/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n    if (value == null) {\n        return null;\n    }\n    return value;\n}\nfunction toJson(value) {\n    if (value == null) {\n        return null;\n    }\n    return value.toString();\n}\n// @TODO? <T extends FeeData = { }> implements Required<T>\n/**\n *  A **FeeData** wraps all the fee-related values associated with\n *  the network.\n */\nexport class FeeData {\n    /**\n     *  The gas price for legacy networks.\n     */\n    gasPrice;\n    /**\n     *  The maximum fee to pay per gas.\n     *\n     *  The base fee per gas is defined by the network and based on\n     *  congestion, increasing the cost during times of heavy load\n     *  and lowering when less busy.\n     *\n     *  The actual fee per gas will be the base fee for the block\n     *  and the priority fee, up to the max fee per gas.\n     *\n     *  This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559))\n     */\n    maxFeePerGas;\n    /**\n     *  The additional amout to pay per gas to encourage a validator\n     *  to include the transaction.\n     *\n     *  The purpose of this is to compensate the validator for the\n     *  adjusted risk for including a given transaction.\n     *\n     *  This will be ``null`` on legacy networks (i.e. [pre-EIP-1559](link-eip-1559))\n     */\n    maxPriorityFeePerGas;\n    /**\n     *  Creates a new FeeData for %%gasPrice%%, %%maxFeePerGas%% and\n     *  %%maxPriorityFeePerGas%%.\n     */\n    constructor(gasPrice, maxFeePerGas, maxPriorityFeePerGas) {\n        defineProperties(this, {\n            gasPrice: getValue(gasPrice),\n            maxFeePerGas: getValue(maxFeePerGas),\n            maxPriorityFeePerGas: getValue(maxPriorityFeePerGas)\n        });\n    }\n    /**\n     *  Returns a JSON-friendly value.\n     */\n    toJSON() {\n        const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = this;\n        return {\n            _type: \"FeeData\",\n            gasPrice: toJson(gasPrice),\n            maxFeePerGas: toJson(maxFeePerGas),\n            maxPriorityFeePerGas: toJson(maxPriorityFeePerGas),\n        };\n    }\n}\n;\n/**\n *  Returns a copy of %%req%% with all properties coerced to their strict\n *  types.\n */\nexport function copyRequest(req) {\n    const result = {};\n    // These could be addresses, ENS names or Addressables\n    if (req.to) {\n        result.to = req.to;\n    }\n    if (req.from) {\n        result.from = req.from;\n    }\n    if (req.data) {\n        result.data = hexlify(req.data);\n    }\n    const bigIntKeys = \"chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value\".split(/,/);\n    for (const key of bigIntKeys) {\n        if (!(key in req) || req[key] == null) {\n            continue;\n        }\n        result[key] = getBigInt(req[key], `request.${key}`);\n    }\n    const numberKeys = \"type,nonce\".split(/,/);\n    for (const key of numberKeys) {\n        if (!(key in req) || req[key] == null) {\n            continue;\n        }\n        result[key] = getNumber(req[key], `request.${key}`);\n    }\n    if (req.accessList) {\n        result.accessList = accessListify(req.accessList);\n    }\n    if (req.authorizationList) {\n        result.authorizationList = req.authorizationList.slice();\n    }\n    if (\"blockTag\" in req) {\n        result.blockTag = req.blockTag;\n    }\n    if (\"enableCcipRead\" in req) {\n        result.enableCcipRead = !!req.enableCcipRead;\n    }\n    if (\"customData\" in req) {\n        result.customData = req.customData;\n    }\n    if (\"blobVersionedHashes\" in req && req.blobVersionedHashes) {\n        result.blobVersionedHashes = req.blobVersionedHashes.slice();\n    }\n    if (\"kzg\" in req) {\n        result.kzg = req.kzg;\n    }\n    if (\"blobs\" in req && req.blobs) {\n        result.blobs = req.blobs.map((b) => {\n            if (isBytesLike(b)) {\n                return hexlify(b);\n            }\n            return Object.assign({}, b);\n        });\n    }\n    return result;\n}\n/**\n *  A **Block** represents the data associated with a full block on\n *  Ethereum.\n */\nexport class Block {\n    /**\n     *  The provider connected to the block used to fetch additional details\n     *  if necessary.\n     */\n    provider;\n    /**\n     *  The block number, sometimes called the block height. This is a\n     *  sequential number that is one higher than the parent block.\n     */\n    number;\n    /**\n     *  The block hash.\n     *\n     *  This hash includes all properties, so can be safely used to identify\n     *  an exact set of block properties.\n     */\n    hash;\n    /**\n     *  The timestamp for this block, which is the number of seconds since\n     *  epoch that this block was included.\n     */\n    timestamp;\n    /**\n     *  The block hash of the parent block.\n     */\n    parentHash;\n    /**\n     *  The hash tree root of the parent beacon block for the given\n     *  execution block. See [[link-eip-4788]].\n     */\n    parentBeaconBlockRoot;\n    /**\n     *  The nonce.\n     *\n     *  On legacy networks, this is the random number inserted which\n     *  permitted the difficulty target to be reached.\n     */\n    nonce;\n    /**\n     *  The difficulty target.\n     *\n     *  On legacy networks, this is the proof-of-work target required\n     *  for a block to meet the protocol rules to be included.\n     *\n     *  On modern networks, this is a random number arrived at using\n     *  randao.  @TODO: Find links?\n     */\n    difficulty;\n    /**\n     *  The total gas limit for this block.\n     */\n    gasLimit;\n    /**\n     *  The total gas used in this block.\n     */\n    gasUsed;\n    /**\n     *  The root hash for the global state after applying changes\n     *  in this block.\n     */\n    stateRoot;\n    /**\n     *  The hash of the transaction receipts trie.\n     */\n    receiptsRoot;\n    /**\n     *  The total amount of blob gas consumed by the transactions\n     *  within the block. See [[link-eip-4844]].\n     */\n    blobGasUsed;\n    /**\n     *  The running total of blob gas consumed in excess of the\n     *  target, prior to the block. See [[link-eip-4844]].\n     */\n    excessBlobGas;\n    /**\n     *  The miner coinbase address, wihch receives any subsidies for\n     *  including this block.\n     */\n    miner;\n    /**\n     *  The latest RANDAO mix of the post beacon state of\n     *  the previous block.\n     */\n    prevRandao;\n    /**\n     *  Any extra data the validator wished to include.\n     */\n    extraData;\n    /**\n     *  The base fee per gas that all transactions in this block were\n     *  charged.\n     *\n     *  This adjusts after each block, depending on how congested the network\n     *  is.\n     */\n    baseFeePerGas;\n    #transactions;\n    /**\n     *  Create a new **Block** object.\n     *\n     *  This should generally not be necessary as the unless implementing a\n     *  low-level library.\n     */\n    constructor(block, provider) {\n        this.#transactions = block.transactions.map((tx) => {\n            if (typeof (tx) !== \"string\") {\n                return new TransactionResponse(tx, provider);\n            }\n            return tx;\n        });\n        defineProperties(this, {\n            provider,\n            hash: getValue(block.hash),\n            number: block.number,\n            timestamp: block.timestamp,\n            parentHash: block.parentHash,\n            parentBeaconBlockRoot: block.parentBeaconBlockRoot,\n            nonce: block.nonce,\n            difficulty: block.difficulty,\n            gasLimit: block.gasLimit,\n            gasUsed: block.gasUsed,\n            blobGasUsed: block.blobGasUsed,\n            excessBlobGas: block.excessBlobGas,\n            miner: block.miner,\n            prevRandao: getValue(block.prevRandao),\n            extraData: block.extraData,\n            baseFeePerGas: getValue(block.baseFeePerGas),\n            stateRoot: block.stateRoot,\n            receiptsRoot: block.receiptsRoot,\n        });\n    }\n    /**\n     *  Returns the list of transaction hashes, in the order\n     *  they were executed within the block.\n     */\n    get transactions() {\n        return this.#transactions.map((tx) => {\n            if (typeof (tx) === \"string\") {\n                return tx;\n            }\n            return tx.hash;\n        });\n    }\n    /**\n     *  Returns the complete transactions, in the order they\n     *  were executed within the block.\n     *\n     *  This is only available for blocks which prefetched\n     *  transactions, by passing ``true`` to %%prefetchTxs%%\n     *  into [[Provider-getBlock]].\n     */\n    get prefetchedTransactions() {\n        const txs = this.#transactions.slice();\n        // Doesn't matter...\n        if (txs.length === 0) {\n            return [];\n        }\n        // Make sure we prefetched the transactions\n        assert(typeof (txs[0]) === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"transactionResponses()\"\n        });\n        return txs;\n    }\n    /**\n     *  Returns a JSON-friendly value.\n     */\n    toJSON() {\n        const { baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash, miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot, stateRoot, receiptsRoot, timestamp, transactions } = this;\n        return {\n            _type: \"Block\",\n            baseFeePerGas: toJson(baseFeePerGas),\n            difficulty: toJson(difficulty),\n            extraData,\n            gasLimit: toJson(gasLimit),\n            gasUsed: toJson(gasUsed),\n            blobGasUsed: toJson(this.blobGasUsed),\n            excessBlobGas: toJson(this.excessBlobGas),\n            hash, miner, prevRandao, nonce, number, parentHash, timestamp,\n            parentBeaconBlockRoot, stateRoot, receiptsRoot,\n            transactions,\n        };\n    }\n    [Symbol.iterator]() {\n        let index = 0;\n        const txs = this.transactions;\n        return {\n            next: () => {\n                if (index < this.length) {\n                    return {\n                        value: txs[index++], done: false\n                    };\n                }\n                return { value: undefined, done: true };\n            }\n        };\n    }\n    /**\n     *  The number of transactions in this block.\n     */\n    get length() { return this.#transactions.length; }\n    /**\n     *  The [[link-js-date]] this block was included at.\n     */\n    get date() {\n        if (this.timestamp == null) {\n            return null;\n        }\n        return new Date(this.timestamp * 1000);\n    }\n    /**\n     *  Get the transaction at %%indexe%% within this block.\n     */\n    async getTransaction(indexOrHash) {\n        // Find the internal value by its index or hash\n        let tx = undefined;\n        if (typeof (indexOrHash) === \"number\") {\n            tx = this.#transactions[indexOrHash];\n        }\n        else {\n            const hash = indexOrHash.toLowerCase();\n            for (const v of this.#transactions) {\n                if (typeof (v) === \"string\") {\n                    if (v !== hash) {\n                        continue;\n                    }\n                    tx = v;\n                    break;\n                }\n                else {\n                    if (v.hash !== hash) {\n                        continue;\n                    }\n                    tx = v;\n                    break;\n                }\n            }\n        }\n        if (tx == null) {\n            throw new Error(\"no such tx\");\n        }\n        if (typeof (tx) === \"string\") {\n            return (await this.provider.getTransaction(tx));\n        }\n        else {\n            return tx;\n        }\n    }\n    /**\n     *  If a **Block** was fetched with a request to include the transactions\n     *  this will allow synchronous access to those transactions.\n     *\n     *  If the transactions were not prefetched, this will throw.\n     */\n    getPrefetchedTransaction(indexOrHash) {\n        const txs = this.prefetchedTransactions;\n        if (typeof (indexOrHash) === \"number\") {\n            return txs[indexOrHash];\n        }\n        indexOrHash = indexOrHash.toLowerCase();\n        for (const tx of txs) {\n            if (tx.hash === indexOrHash) {\n                return tx;\n            }\n        }\n        assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n    }\n    /**\n     *  Returns true if this block been mined. This provides a type guard\n     *  for all properties on a [[MinedBlock]].\n     */\n    isMined() { return !!this.hash; }\n    /**\n     *  Returns true if this block is an [[link-eip-2930]] block.\n     */\n    isLondon() {\n        return !!this.baseFeePerGas;\n    }\n    /**\n     *  @_ignore:\n     */\n    orphanedEvent() {\n        if (!this.isMined()) {\n            throw new Error(\"\");\n        }\n        return createOrphanedBlockFilter(this);\n    }\n}\n//////////////////////\n// Log\n/**\n *  A **Log** in Ethereum represents an event that has been included in a\n *  transaction using the ``LOG*`` opcodes, which are most commonly used by\n *  Solidity's emit for announcing events.\n */\nexport class Log {\n    /**\n     *  The provider connected to the log used to fetch additional details\n     *  if necessary.\n     */\n    provider;\n    /**\n     *  The transaction hash of the transaction this log occurred in. Use the\n     *  [[Log-getTransaction]] to get the [[TransactionResponse]].\n     */\n    transactionHash;\n    /**\n     *  The block hash of the block this log occurred in. Use the\n     *  [[Log-getBlock]] to get the [[Block]].\n     */\n    blockHash;\n    /**\n     *  The block number of the block this log occurred in. It is preferred\n     *  to use the [[Block-hash]] when fetching the related [[Block]],\n     *  since in the case of an orphaned block, the block at that height may\n     *  have changed.\n     */\n    blockNumber;\n    /**\n     *  If the **Log** represents a block that was removed due to an orphaned\n     *  block, this will be true.\n     *\n     *  This can only happen within an orphan event listener.\n     */\n    removed;\n    /**\n     *  The address of the contract that emitted this log.\n     */\n    address;\n    /**\n     *  The data included in this log when it was emitted.\n     */\n    data;\n    /**\n     *  The indexed topics included in this log when it was emitted.\n     *\n     *  All topics are included in the bloom filters, so they can be\n     *  efficiently filtered using the [[Provider-getLogs]] method.\n     */\n    topics;\n    /**\n     *  The index within the block this log occurred at. This is generally\n     *  not useful to developers, but can be used with the various roots\n     *  to proof inclusion within a block.\n     */\n    index;\n    /**\n     *  The index within the transaction of this log.\n     */\n    transactionIndex;\n    /**\n     *  @_ignore:\n     */\n    constructor(log, provider) {\n        this.provider = provider;\n        const topics = Object.freeze(log.topics.slice());\n        defineProperties(this, {\n            transactionHash: log.transactionHash,\n            blockHash: log.blockHash,\n            blockNumber: log.blockNumber,\n            removed: log.removed,\n            address: log.address,\n            data: log.data,\n            topics,\n            index: log.index,\n            transactionIndex: log.transactionIndex,\n        });\n    }\n    /**\n     *  Returns a JSON-compatible object.\n     */\n    toJSON() {\n        const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex } = this;\n        return {\n            _type: \"log\",\n            address, blockHash, blockNumber, data, index,\n            removed, topics, transactionHash, transactionIndex\n        };\n    }\n    /**\n     *  Returns the block that this log occurred in.\n     */\n    async getBlock() {\n        const block = await this.provider.getBlock(this.blockHash);\n        assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n        return block;\n    }\n    /**\n     *  Returns the transaction that this log occurred in.\n     */\n    async getTransaction() {\n        const tx = await this.provider.getTransaction(this.transactionHash);\n        assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n        return tx;\n    }\n    /**\n     *  Returns the transaction receipt fot the transaction that this\n     *  log occurred in.\n     */\n    async getTransactionReceipt() {\n        const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n        assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n        return receipt;\n    }\n    /**\n     *  @_ignore:\n     */\n    removedEvent() {\n        return createRemovedLogFilter(this);\n    }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n    byzantium: false;\n    status: null;\n    root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n    byzantium: true;\n    status: number;\n    root: null;\n}\n*/\n/**\n *  A **TransactionReceipt** includes additional information about a\n *  transaction that is only available after it has been mined.\n */\nexport class TransactionReceipt {\n    /**\n     *  The provider connected to the log used to fetch additional details\n     *  if necessary.\n     */\n    provider;\n    /**\n     *  The address the transaction was sent to.\n     */\n    to;\n    /**\n     *  The sender of the transaction.\n     */\n    from;\n    /**\n     *  The address of the contract if the transaction was directly\n     *  responsible for deploying one.\n     *\n     *  This is non-null **only** if the ``to`` is empty and the ``data``\n     *  was successfully executed as initcode.\n     */\n    contractAddress;\n    /**\n     *  The transaction hash.\n     */\n    hash;\n    /**\n     *  The index of this transaction within the block transactions.\n     */\n    index;\n    /**\n     *  The block hash of the [[Block]] this transaction was included in.\n     */\n    blockHash;\n    /**\n     *  The block number of the [[Block]] this transaction was included in.\n     */\n    blockNumber;\n    /**\n     *  The bloom filter bytes that represent all logs that occurred within\n     *  this transaction. This is generally not useful for most developers,\n     *  but can be used to validate the included logs.\n     */\n    logsBloom;\n    /**\n     *  The actual amount of gas used by this transaction.\n     *\n     *  When creating a transaction, the amount of gas that will be used can\n     *  only be approximated, but the sender must pay the gas fee for the\n     *  entire gas limit. After the transaction, the difference is refunded.\n     */\n    gasUsed;\n    /**\n     *  The gas used for BLObs. See [[link-eip-4844]].\n     */\n    blobGasUsed;\n    /**\n     *  The amount of gas used by all transactions within the block for this\n     *  and all transactions with a lower ``index``.\n     *\n     *  This is generally not useful for developers but can be used to\n     *  validate certain aspects of execution.\n     */\n    cumulativeGasUsed;\n    /**\n     *  The actual gas price used during execution.\n     *\n     *  Due to the complexity of [[link-eip-1559]] this value can only\n     *  be caluclated after the transaction has been mined, snce the base\n     *  fee is protocol-enforced.\n     */\n    gasPrice;\n    /**\n     *  The price paid per BLOB in gas. See [[link-eip-4844]].\n     */\n    blobGasPrice;\n    /**\n     *  The [[link-eip-2718]] transaction type.\n     */\n    type;\n    //readonly byzantium!: boolean;\n    /**\n     *  The status of this transaction, indicating success (i.e. ``1``) or\n     *  a revert (i.e. ``0``).\n     *\n     *  This is available in post-byzantium blocks, but some backends may\n     *  backfill this value.\n     */\n    status;\n    /**\n     *  The root hash of this transaction.\n     *\n     *  This is no present and was only included in pre-byzantium blocks, but\n     *  could be used to validate certain parts of the receipt.\n     */\n    root;\n    #logs;\n    /**\n     *  @_ignore:\n     */\n    constructor(tx, provider) {\n        this.#logs = Object.freeze(tx.logs.map((log) => {\n            return new Log(log, provider);\n        }));\n        let gasPrice = BN_0;\n        if (tx.effectiveGasPrice != null) {\n            gasPrice = tx.effectiveGasPrice;\n        }\n        else if (tx.gasPrice != null) {\n            gasPrice = tx.gasPrice;\n        }\n        defineProperties(this, {\n            provider,\n            to: tx.to,\n            from: tx.from,\n            contractAddress: tx.contractAddress,\n            hash: tx.hash,\n            index: tx.index,\n            blockHash: tx.blockHash,\n            blockNumber: tx.blockNumber,\n            logsBloom: tx.logsBloom,\n            gasUsed: tx.gasUsed,\n            cumulativeGasUsed: tx.cumulativeGasUsed,\n            blobGasUsed: tx.blobGasUsed,\n            gasPrice,\n            blobGasPrice: tx.blobGasPrice,\n            type: tx.type,\n            //byzantium: tx.byzantium,\n            status: tx.status,\n            root: tx.root\n        });\n    }\n    /**\n     *  The logs for this transaction.\n     */\n    get logs() { return this.#logs; }\n    /**\n     *  Returns a JSON-compatible representation.\n     */\n    toJSON() {\n        const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, \n        status, root } = this;\n        return {\n            _type: \"TransactionReceipt\",\n            blockHash, blockNumber,\n            //byzantium, \n            contractAddress,\n            cumulativeGasUsed: toJson(this.cumulativeGasUsed),\n            from,\n            gasPrice: toJson(this.gasPrice),\n            blobGasUsed: toJson(this.blobGasUsed),\n            blobGasPrice: toJson(this.blobGasPrice),\n            gasUsed: toJson(this.gasUsed),\n            hash, index, logs, logsBloom, root, status, to\n        };\n    }\n    /**\n     *  @_ignore:\n     */\n    get length() { return this.logs.length; }\n    [Symbol.iterator]() {\n        let index = 0;\n        return {\n            next: () => {\n                if (index < this.length) {\n                    return { value: this.logs[index++], done: false };\n                }\n                return { value: undefined, done: true };\n            }\n        };\n    }\n    /**\n     *  The total fee for this transaction, in wei.\n     */\n    get fee() {\n        return this.gasUsed * this.gasPrice;\n    }\n    /**\n     *  Resolves to the block this transaction occurred in.\n     */\n    async getBlock() {\n        const block = await this.provider.getBlock(this.blockHash);\n        if (block == null) {\n            throw new Error(\"TODO\");\n        }\n        return block;\n    }\n    /**\n     *  Resolves to the transaction this transaction occurred in.\n     */\n    async getTransaction() {\n        const tx = await this.provider.getTransaction(this.hash);\n        if (tx == null) {\n            throw new Error(\"TODO\");\n        }\n        return tx;\n    }\n    /**\n     *  Resolves to the return value of the execution of this transaction.\n     *\n     *  Support for this feature is limited, as it requires an archive node\n     *  with the ``debug_`` or ``trace_`` API enabled.\n     */\n    async getResult() {\n        return (await this.provider.getTransactionResult(this.hash));\n    }\n    /**\n     *  Resolves to the number of confirmations this transaction has.\n     */\n    async confirmations() {\n        return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n    }\n    /**\n     *  @_ignore:\n     */\n    removedEvent() {\n        return createRemovedTransactionFilter(this);\n    }\n    /**\n     *  @_ignore:\n     */\n    reorderedEvent(other) {\n        assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n        return createReorderedTransactionFilter(this, other);\n    }\n}\n/**\n *  A **TransactionResponse** includes all properties about a transaction\n *  that was sent to the network, which may or may not be included in a\n *  block.\n *\n *  The [[TransactionResponse-isMined]] can be used to check if the\n *  transaction has been mined as well as type guard that the otherwise\n *  possibly ``null`` properties are defined.\n */\nexport class TransactionResponse {\n    /**\n     *  The provider this is connected to, which will influence how its\n     *  methods will resolve its async inspection methods.\n     */\n    provider;\n    /**\n     *  The block number of the block that this transaction was included in.\n     *\n     *  This is ``null`` for pending transactions.\n     */\n    blockNumber;\n    /**\n     *  The blockHash of the block that this transaction was included in.\n     *\n     *  This is ``null`` for pending transactions.\n     */\n    blockHash;\n    /**\n     *  The index within the block that this transaction resides at.\n     */\n    index;\n    /**\n     *  The transaction hash.\n     */\n    hash;\n    /**\n     *  The [[link-eip-2718]] transaction envelope type. This is\n     *  ``0`` for legacy transactions types.\n     */\n    type;\n    /**\n     *  The receiver of this transaction.\n     *\n     *  If ``null``, then the transaction is an initcode transaction.\n     *  This means the result of executing the [[data]] will be deployed\n     *  as a new contract on chain (assuming it does not revert) and the\n     *  address may be computed using [[getCreateAddress]].\n     */\n    to;\n    /**\n     *  The sender of this transaction. It is implicitly computed\n     *  from the transaction pre-image hash (as the digest) and the\n     *  [[signature]] using ecrecover.\n     */\n    from;\n    /**\n     *  The nonce, which is used to prevent replay attacks and offer\n     *  a method to ensure transactions from a given sender are explicitly\n     *  ordered.\n     *\n     *  When sending a transaction, this must be equal to the number of\n     *  transactions ever sent by [[from]].\n     */\n    nonce;\n    /**\n     *  The maximum units of gas this transaction can consume. If execution\n     *  exceeds this, the entries transaction is reverted and the sender\n     *  is charged for the full amount, despite not state changes being made.\n     */\n    gasLimit;\n    /**\n     *  The gas price can have various values, depending on the network.\n     *\n     *  In modern networks, for transactions that are included this is\n     *  the //effective gas price// (the fee per gas that was actually\n     *  charged), while for transactions that have not been included yet\n     *  is the [[maxFeePerGas]].\n     *\n     *  For legacy transactions, or transactions on legacy networks, this\n     *  is the fee that will be charged per unit of gas the transaction\n     *  consumes.\n     */\n    gasPrice;\n    /**\n     *  The maximum priority fee (per unit of gas) to allow a\n     *  validator to charge the sender. This is inclusive of the\n     *  [[maxFeeFeePerGas]].\n     */\n    maxPriorityFeePerGas;\n    /**\n     *  The maximum fee (per unit of gas) to allow this transaction\n     *  to charge the sender.\n     */\n    maxFeePerGas;\n    /**\n     *  The [[link-eip-4844]] max fee per BLOb gas.\n     */\n    maxFeePerBlobGas;\n    /**\n     *  The data.\n     */\n    data;\n    /**\n     *  The value, in wei. Use [[formatEther]] to format this value\n     *  as ether.\n     */\n    value;\n    /**\n     *  The chain ID.\n     */\n    chainId;\n    /**\n     *  The signature.\n     */\n    signature;\n    /**\n     *  The [[link-eip-2930]] access list for transaction types that\n     *  support it, otherwise ``null``.\n     */\n    accessList;\n    /**\n     *  The [[link-eip-4844]] BLOb versioned hashes.\n     */\n    blobVersionedHashes;\n    /**\n     *  The [[link-eip-7702]] authorizations (if any).\n     */\n    authorizationList;\n    #startBlock;\n    /**\n     *  @_ignore:\n     */\n    constructor(tx, provider) {\n        this.provider = provider;\n        this.blockNumber = (tx.blockNumber != null) ? tx.blockNumber : null;\n        this.blockHash = (tx.blockHash != null) ? tx.blockHash : null;\n        this.hash = tx.hash;\n        this.index = tx.index;\n        this.type = tx.type;\n        this.from = tx.from;\n        this.to = tx.to || null;\n        this.gasLimit = tx.gasLimit;\n        this.nonce = tx.nonce;\n        this.data = tx.data;\n        this.value = tx.value;\n        this.gasPrice = tx.gasPrice;\n        this.maxPriorityFeePerGas = (tx.maxPriorityFeePerGas != null) ? tx.maxPriorityFeePerGas : null;\n        this.maxFeePerGas = (tx.maxFeePerGas != null) ? tx.maxFeePerGas : null;\n        this.maxFeePerBlobGas = (tx.maxFeePerBlobGas != null) ? tx.maxFeePerBlobGas : null;\n        this.chainId = tx.chainId;\n        this.signature = tx.signature;\n        this.accessList = (tx.accessList != null) ? tx.accessList : null;\n        this.blobVersionedHashes = (tx.blobVersionedHashes != null) ? tx.blobVersionedHashes : null;\n        this.authorizationList = (tx.authorizationList != null) ? tx.authorizationList : null;\n        this.#startBlock = -1;\n    }\n    /**\n     *  Returns a JSON-compatible representation of this transaction.\n     */\n    toJSON() {\n        const { blockNumber, blockHash, index, hash, type, to, from, nonce, data, signature, accessList, blobVersionedHashes } = this;\n        return {\n            _type: \"TransactionResponse\",\n            accessList, blockNumber, blockHash,\n            blobVersionedHashes,\n            chainId: toJson(this.chainId),\n            data, from,\n            gasLimit: toJson(this.gasLimit),\n            gasPrice: toJson(this.gasPrice),\n            hash,\n            maxFeePerGas: toJson(this.maxFeePerGas),\n            maxPriorityFeePerGas: toJson(this.maxPriorityFeePerGas),\n            maxFeePerBlobGas: toJson(this.maxFeePerBlobGas),\n            nonce, signature, to, index, type,\n            value: toJson(this.value),\n        };\n    }\n    /**\n     *  Resolves to the Block that this transaction was included in.\n     *\n     *  This will return null if the transaction has not been included yet.\n     */\n    async getBlock() {\n        let blockNumber = this.blockNumber;\n        if (blockNumber == null) {\n            const tx = await this.getTransaction();\n            if (tx) {\n                blockNumber = tx.blockNumber;\n            }\n        }\n        if (blockNumber == null) {\n            return null;\n        }\n        const block = this.provider.getBlock(blockNumber);\n        if (block == null) {\n            throw new Error(\"TODO\");\n        }\n        return block;\n    }\n    /**\n     *  Resolves to this transaction being re-requested from the\n     *  provider. This can be used if you have an unmined transaction\n     *  and wish to get an up-to-date populated instance.\n     */\n    async getTransaction() {\n        return this.provider.getTransaction(this.hash);\n    }\n    /**\n     *  Resolve to the number of confirmations this transaction has.\n     */\n    async confirmations() {\n        if (this.blockNumber == null) {\n            const { tx, blockNumber } = await resolveProperties({\n                tx: this.getTransaction(),\n                blockNumber: this.provider.getBlockNumber()\n            });\n            // Not mined yet...\n            if (tx == null || tx.blockNumber == null) {\n                return 0;\n            }\n            return blockNumber - tx.blockNumber + 1;\n        }\n        const blockNumber = await this.provider.getBlockNumber();\n        return blockNumber - this.blockNumber + 1;\n    }\n    /**\n     *  Resolves once this transaction has been mined and has\n     *  %%confirms%% blocks including it (default: ``1``) with an\n     *  optional %%timeout%%.\n     *\n     *  This can resolve to ``null`` only if %%confirms%% is ``0``\n     *  and the transaction has not been mined, otherwise this will\n     *  wait until enough confirmations have completed.\n     */\n    async wait(_confirms, _timeout) {\n        const confirms = (_confirms == null) ? 1 : _confirms;\n        const timeout = (_timeout == null) ? 0 : _timeout;\n        let startBlock = this.#startBlock;\n        let nextScan = -1;\n        let stopScanning = (startBlock === -1) ? true : false;\n        const checkReplacement = async () => {\n            // Get the current transaction count for this sender\n            if (stopScanning) {\n                return null;\n            }\n            const { blockNumber, nonce } = await resolveProperties({\n                blockNumber: this.provider.getBlockNumber(),\n                nonce: this.provider.getTransactionCount(this.from)\n            });\n            // No transaction or our nonce has not been mined yet; but we\n            // can start scanning later when we do start\n            if (nonce < this.nonce) {\n                startBlock = blockNumber;\n                return;\n            }\n            // We were mined; no replacement\n            if (stopScanning) {\n                return null;\n            }\n            const mined = await this.getTransaction();\n            if (mined && mined.blockNumber != null) {\n                return;\n            }\n            // We were replaced; start scanning for that transaction\n            // Starting to scan; look back a few extra blocks for safety\n            if (nextScan === -1) {\n                nextScan = startBlock - 3;\n                if (nextScan < this.#startBlock) {\n                    nextScan = this.#startBlock;\n                }\n            }\n            while (nextScan <= blockNumber) {\n                // Get the next block to scan\n                if (stopScanning) {\n                    return null;\n                }\n                const block = await this.provider.getBlock(nextScan, true);\n                // This should not happen; but we'll try again shortly\n                if (block == null) {\n                    return;\n                }\n                // We were mined; no replacement\n                for (const hash of block) {\n                    if (hash === this.hash) {\n                        return;\n                    }\n                }\n                // Search for the transaction that replaced us\n                for (let i = 0; i < block.length; i++) {\n                    const tx = await block.getTransaction(i);\n                    if (tx.from === this.from && tx.nonce === this.nonce) {\n                        // Get the receipt\n                        if (stopScanning) {\n                            return null;\n                        }\n                        const receipt = await this.provider.getTransactionReceipt(tx.hash);\n                        // This should not happen; but we'll try again shortly\n                        if (receipt == null) {\n                            return;\n                        }\n                        // We will retry this on the next block (this case could be optimized)\n                        if ((blockNumber - receipt.blockNumber + 1) < confirms) {\n                            return;\n                        }\n                        // The reason we were replaced\n                        let reason = \"replaced\";\n                        if (tx.data === this.data && tx.to === this.to && tx.value === this.value) {\n                            reason = \"repriced\";\n                        }\n                        else if (tx.data === \"0x\" && tx.from === tx.to && tx.value === BN_0) {\n                            reason = \"cancelled\";\n                        }\n                        assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n                            cancelled: (reason === \"replaced\" || reason === \"cancelled\"),\n                            reason,\n                            replacement: tx.replaceableTransaction(startBlock),\n                            hash: tx.hash,\n                            receipt\n                        });\n                    }\n                }\n                nextScan++;\n            }\n            return;\n        };\n        const checkReceipt = (receipt) => {\n            if (receipt == null || receipt.status !== 0) {\n                return receipt;\n            }\n            assert(false, \"transaction execution reverted\", \"CALL_EXCEPTION\", {\n                action: \"sendTransaction\",\n                data: null, reason: null, invocation: null, revert: null,\n                transaction: {\n                    to: receipt.to,\n                    from: receipt.from,\n                    data: \"\" // @TODO: in v7, split out sendTransaction properties\n                }, receipt\n            });\n        };\n        const receipt = await this.provider.getTransactionReceipt(this.hash);\n        if (confirms === 0) {\n            return checkReceipt(receipt);\n        }\n        if (receipt) {\n            if (confirms === 1 || (await receipt.confirmations()) >= confirms) {\n                return checkReceipt(receipt);\n            }\n        }\n        else {\n            // Check for a replacement; throws if a replacement was found\n            await checkReplacement();\n            // Allow null only when the confirms is 0\n            if (confirms === 0) {\n                return null;\n            }\n        }\n        const waiter = new Promise((resolve, reject) => {\n            // List of things to cancel when we have a result (one way or the other)\n            const cancellers = [];\n            const cancel = () => { cancellers.forEach((c) => c()); };\n            // On cancel, stop scanning for replacements\n            cancellers.push(() => { stopScanning = true; });\n            // Set up any timeout requested\n            if (timeout > 0) {\n                const timer = setTimeout(() => {\n                    cancel();\n                    reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n                }, timeout);\n                cancellers.push(() => { clearTimeout(timer); });\n            }\n            const txListener = async (receipt) => {\n                // Done; return it!\n                if ((await receipt.confirmations()) >= confirms) {\n                    cancel();\n                    try {\n                        resolve(checkReceipt(receipt));\n                    }\n                    catch (error) {\n                        reject(error);\n                    }\n                }\n            };\n            cancellers.push(() => { this.provider.off(this.hash, txListener); });\n            this.provider.on(this.hash, txListener);\n            // We support replacement detection; start checking\n            if (startBlock >= 0) {\n                const replaceListener = async () => {\n                    try {\n                        // Check for a replacement; this throws only if one is found\n                        await checkReplacement();\n                    }\n                    catch (error) {\n                        // We were replaced (with enough confirms); re-throw the error\n                        if (isError(error, \"TRANSACTION_REPLACED\")) {\n                            cancel();\n                            reject(error);\n                            return;\n                        }\n                    }\n                    // Rescheudle a check on the next block\n                    if (!stopScanning) {\n                        this.provider.once(\"block\", replaceListener);\n                    }\n                };\n                cancellers.push(() => { this.provider.off(\"block\", replaceListener); });\n                this.provider.once(\"block\", replaceListener);\n            }\n        });\n        return await waiter;\n    }\n    /**\n     *  Returns ``true`` if this transaction has been included.\n     *\n     *  This is effective only as of the time the TransactionResponse\n     *  was instantiated. To get up-to-date information, use\n     *  [[getTransaction]].\n     *\n     *  This provides a Type Guard that this transaction will have\n     *  non-null property values for properties that are null for\n     *  unmined transactions.\n     */\n    isMined() {\n        return (this.blockHash != null);\n    }\n    /**\n     *  Returns true if the transaction is a legacy (i.e. ``type == 0``)\n     *  transaction.\n     *\n     *  This provides a Type Guard that this transaction will have\n     *  the ``null``-ness for hardfork-specific properties set correctly.\n     */\n    isLegacy() {\n        return (this.type === 0);\n    }\n    /**\n     *  Returns true if the transaction is a Berlin (i.e. ``type == 1``)\n     *  transaction. See [[link-eip-2070]].\n     *\n     *  This provides a Type Guard that this transaction will have\n     *  the ``null``-ness for hardfork-specific properties set correctly.\n     */\n    isBerlin() {\n        return (this.type === 1);\n    }\n    /**\n     *  Returns true if the transaction is a London (i.e. ``type == 2``)\n     *  transaction. See [[link-eip-1559]].\n     *\n     *  This provides a Type Guard that this transaction will have\n     *  the ``null``-ness for hardfork-specific properties set correctly.\n     */\n    isLondon() {\n        return (this.type === 2);\n    }\n    /**\n     *  Returns true if hte transaction is a Cancun (i.e. ``type == 3``)\n     *  transaction. See [[link-eip-4844]].\n     */\n    isCancun() {\n        return (this.type === 3);\n    }\n    /**\n     *  Returns a filter which can be used to listen for orphan events\n     *  that evict this transaction.\n     */\n    removedEvent() {\n        assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n        return createRemovedTransactionFilter(this);\n    }\n    /**\n     *  Returns a filter which can be used to listen for orphan events\n     *  that re-order this event against %%other%%.\n     */\n    reorderedEvent(other) {\n        assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n        assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n        return createReorderedTransactionFilter(this, other);\n    }\n    /**\n     *  Returns a new TransactionResponse instance which has the ability to\n     *  detect (and throw an error) if the transaction is replaced, which\n     *  will begin scanning at %%startBlock%%.\n     *\n     *  This should generally not be used by developers and is intended\n     *  primarily for internal use. Setting an incorrect %%startBlock%% can\n     *  have devastating performance consequences if used incorrectly.\n     */\n    replaceableTransaction(startBlock) {\n        assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n        const tx = new TransactionResponse(this, this.provider);\n        tx.#startBlock = startBlock;\n        return tx;\n    }\n}\nfunction createOrphanedBlockFilter(block) {\n    return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n    return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n    return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n    return { orphan: \"drop-log\", log: {\n            transactionHash: log.transactionHash,\n            blockHash: log.blockHash,\n            blockNumber: log.blockNumber,\n            address: log.address,\n            data: log.data,\n            topics: Object.freeze(log.topics.slice()),\n            index: log.index\n        } };\n}\n//# sourceMappingURL=provider.js.mapimport { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\n/**\n *  A **NonceManager** wraps another [[Signer]] and automatically manages\n *  the nonce, ensuring serialized and sequential nonces are used during\n *  transaction.\n */\nexport class NonceManager extends AbstractSigner {\n    /**\n     *  The Signer being managed.\n     */\n    signer;\n    #noncePromise;\n    #delta;\n    /**\n     *  Creates a new **NonceManager** to manage %%signer%%.\n     */\n    constructor(signer) {\n        super(signer.provider);\n        defineProperties(this, { signer });\n        this.#noncePromise = null;\n        this.#delta = 0;\n    }\n    async getAddress() {\n        return this.signer.getAddress();\n    }\n    connect(provider) {\n        return new NonceManager(this.signer.connect(provider));\n    }\n    async getNonce(blockTag) {\n        if (blockTag === \"pending\") {\n            if (this.#noncePromise == null) {\n                this.#noncePromise = super.getNonce(\"pending\");\n            }\n            const delta = this.#delta;\n            return (await this.#noncePromise) + delta;\n        }\n        return super.getNonce(blockTag);\n    }\n    /**\n     *  Manually increment the nonce. This may be useful when managng\n     *  offline transactions.\n     */\n    increment() {\n        this.#delta++;\n    }\n    /**\n     *  Resets the nonce, causing the **NonceManager** to reload the current\n     *  nonce from the blockchain on the next transaction.\n     */\n    reset() {\n        this.#delta = 0;\n        this.#noncePromise = null;\n    }\n    async sendTransaction(tx) {\n        const noncePromise = this.getNonce(\"pending\");\n        this.increment();\n        tx = await this.signer.populateTransaction(tx);\n        tx.nonce = await noncePromise;\n        // @TODO: Maybe handle interesting/recoverable errors?\n        // Like don't increment if the tx was certainly not sent\n        return await this.signer.sendTransaction(tx);\n    }\n    signTransaction(tx) {\n        return this.signer.signTransaction(tx);\n    }\n    signMessage(message) {\n        return this.signer.signMessage(message);\n    }\n    signTypedData(domain, types, value) {\n        return this.signer.signTypedData(domain, types, value);\n    }\n}\n//# sourceMappingURL=signer-noncemanager.js.mapimport { isError } from \"../utils/index.js\";\nimport { PollingEventSubscriber } from \"./subscriber-polling.js\";\nfunction copy(obj) {\n    return JSON.parse(JSON.stringify(obj));\n}\n/**\n *  Some backends support subscribing to events using a Filter ID.\n *\n *  When subscribing with this technique, the node issues a unique\n *  //Filter ID//. At this point the node dedicates resources to\n *  the filter, so that periodic calls to follow up on the //Filter ID//\n *  will receive any events since the last call.\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdSubscriber {\n    #provider;\n    #filterIdPromise;\n    #poller;\n    #running;\n    #network;\n    #hault;\n    /**\n     *  Creates a new **FilterIdSubscriber** which will used [[_subscribe]]\n     *  and [[_emitResults]] to setup the subscription and provide the event\n     *  to the %%provider%%.\n     */\n    constructor(provider) {\n        this.#provider = provider;\n        this.#filterIdPromise = null;\n        this.#poller = this.#poll.bind(this);\n        this.#running = false;\n        this.#network = null;\n        this.#hault = false;\n    }\n    /**\n     *  Sub-classes **must** override this to begin the subscription.\n     */\n    _subscribe(provider) {\n        throw new Error(\"subclasses must override this\");\n    }\n    /**\n     *  Sub-classes **must** override this handle the events.\n     */\n    _emitResults(provider, result) {\n        throw new Error(\"subclasses must override this\");\n    }\n    /**\n     *  Sub-classes **must** override this handle recovery on errors.\n     */\n    _recover(provider) {\n        throw new Error(\"subclasses must override this\");\n    }\n    async #poll(blockNumber) {\n        try {\n            // Subscribe if necessary\n            if (this.#filterIdPromise == null) {\n                this.#filterIdPromise = this._subscribe(this.#provider);\n            }\n            // Get the Filter ID\n            let filterId = null;\n            try {\n                filterId = await this.#filterIdPromise;\n            }\n            catch (error) {\n                if (!isError(error, \"UNSUPPORTED_OPERATION\") || error.operation !== \"eth_newFilter\") {\n                    throw error;\n                }\n            }\n            // The backend does not support Filter ID; downgrade to\n            // polling\n            if (filterId == null) {\n                this.#filterIdPromise = null;\n                this.#provider._recoverSubscriber(this, this._recover(this.#provider));\n                return;\n            }\n            const network = await this.#provider.getNetwork();\n            if (!this.#network) {\n                this.#network = network;\n            }\n            if (this.#network.chainId !== network.chainId) {\n                throw new Error(\"chaid changed\");\n            }\n            if (this.#hault) {\n                return;\n            }\n            const result = await this.#provider.send(\"eth_getFilterChanges\", [filterId]);\n            await this._emitResults(this.#provider, result);\n        }\n        catch (error) {\n            console.log(\"@TODO\", error);\n        }\n        this.#provider.once(\"block\", this.#poller);\n    }\n    #teardown() {\n        const filterIdPromise = this.#filterIdPromise;\n        if (filterIdPromise) {\n            this.#filterIdPromise = null;\n            filterIdPromise.then((filterId) => {\n                if (this.#provider.destroyed) {\n                    return;\n                }\n                this.#provider.send(\"eth_uninstallFilter\", [filterId]);\n            });\n        }\n    }\n    start() {\n        if (this.#running) {\n            return;\n        }\n        this.#running = true;\n        this.#poll(-2);\n    }\n    stop() {\n        if (!this.#running) {\n            return;\n        }\n        this.#running = false;\n        this.#hault = true;\n        this.#teardown();\n        this.#provider.off(\"block\", this.#poller);\n    }\n    pause(dropWhilePaused) {\n        if (dropWhilePaused) {\n            this.#teardown();\n        }\n        this.#provider.off(\"block\", this.#poller);\n    }\n    resume() { this.start(); }\n}\n/**\n *  A **FilterIdSubscriber** for receiving contract events.\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdEventSubscriber extends FilterIdSubscriber {\n    #event;\n    /**\n     *  Creates a new **FilterIdEventSubscriber** attached to %%provider%%\n     *  listening for %%filter%%.\n     */\n    constructor(provider, filter) {\n        super(provider);\n        this.#event = copy(filter);\n    }\n    _recover(provider) {\n        return new PollingEventSubscriber(provider, this.#event);\n    }\n    async _subscribe(provider) {\n        const filterId = await provider.send(\"eth_newFilter\", [this.#event]);\n        return filterId;\n    }\n    async _emitResults(provider, results) {\n        for (const result of results) {\n            provider.emit(this.#event, provider._wrapLog(result, provider._network));\n        }\n    }\n}\n/**\n *  A **FilterIdSubscriber** for receiving pending transactions events.\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport class FilterIdPendingSubscriber extends FilterIdSubscriber {\n    async _subscribe(provider) {\n        return await provider.send(\"eth_newPendingTransactionFilter\", []);\n    }\n    async _emitResults(provider, results) {\n        for (const result of results) {\n            provider.emit(\"pending\", result);\n        }\n    }\n}\n//# sourceMappingURL=subscriber-filterid.js.mapimport { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n    return JSON.parse(JSON.stringify(obj));\n}\n/**\n *  Return the polling subscriber for common events.\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport function getPollingSubscriber(provider, event) {\n    if (event === \"block\") {\n        return new PollingBlockSubscriber(provider);\n    }\n    if (isHexString(event, 32)) {\n        return new PollingTransactionSubscriber(provider, event);\n    }\n    assert(false, \"unsupported polling event\", \"UNSUPPORTED_OPERATION\", {\n        operation: \"getPollingSubscriber\", info: { event }\n    });\n}\n// @TODO: refactor this\n/**\n *  A **PollingBlockSubscriber** polls at a regular interval for a change\n *  in the block number.\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport class PollingBlockSubscriber {\n    #provider;\n    #poller;\n    #interval;\n    // The most recent block we have scanned for events. The value -2\n    // indicates we still need to fetch an initial block number\n    #blockNumber;\n    /**\n     *  Create a new **PollingBlockSubscriber** attached to %%provider%%.\n     */\n    constructor(provider) {\n        this.#provider = provider;\n        this.#poller = null;\n        this.#interval = 4000;\n        this.#blockNumber = -2;\n    }\n    /**\n     *  The polling interval.\n     */\n    get pollingInterval() { return this.#interval; }\n    set pollingInterval(value) { this.#interval = value; }\n    async #poll() {\n        try {\n            const blockNumber = await this.#provider.getBlockNumber();\n            // Bootstrap poll to setup our initial block number\n            if (this.#blockNumber === -2) {\n                this.#blockNumber = blockNumber;\n                return;\n            }\n            // @TODO: Put a cap on the maximum number of events per loop?\n            if (blockNumber !== this.#blockNumber) {\n                for (let b = this.#blockNumber + 1; b <= blockNumber; b++) {\n                    // We have been stopped\n                    if (this.#poller == null) {\n                        return;\n                    }\n                    await this.#provider.emit(\"block\", b);\n                }\n                this.#blockNumber = blockNumber;\n            }\n        }\n        catch (error) {\n            // @TODO: Minor bump, add an \"error\" event to let subscribers\n            //        know things went awry.\n            //console.log(error);\n        }\n        // We have been stopped\n        if (this.#poller == null) {\n            return;\n        }\n        this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);\n    }\n    start() {\n        if (this.#poller) {\n            return;\n        }\n        this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval);\n        this.#poll();\n    }\n    stop() {\n        if (!this.#poller) {\n            return;\n        }\n        this.#provider._clearTimeout(this.#poller);\n        this.#poller = null;\n    }\n    pause(dropWhilePaused) {\n        this.stop();\n        if (dropWhilePaused) {\n            this.#blockNumber = -2;\n        }\n    }\n    resume() {\n        this.start();\n    }\n}\n/**\n *  An **OnBlockSubscriber** can be sub-classed, with a [[_poll]]\n *  implmentation which will be called on every new block.\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n    #provider;\n    #poll;\n    #running;\n    /**\n     *  Create a new **OnBlockSubscriber** attached to %%provider%%.\n     */\n    constructor(provider) {\n        this.#provider = provider;\n        this.#running = false;\n        this.#poll = (blockNumber) => {\n            this._poll(blockNumber, this.#provider);\n        };\n    }\n    /**\n     *  Called on every new block.\n     */\n    async _poll(blockNumber, provider) {\n        throw new Error(\"sub-classes must override this\");\n    }\n    start() {\n        if (this.#running) {\n            return;\n        }\n        this.#running = true;\n        this.#poll(-2);\n        this.#provider.on(\"block\", this.#poll);\n    }\n    stop() {\n        if (!this.#running) {\n            return;\n        }\n        this.#running = false;\n        this.#provider.off(\"block\", this.#poll);\n    }\n    pause(dropWhilePaused) { this.stop(); }\n    resume() { this.start(); }\n}\nexport class PollingBlockTagSubscriber extends OnBlockSubscriber {\n    #tag;\n    #lastBlock;\n    constructor(provider, tag) {\n        super(provider);\n        this.#tag = tag;\n        this.#lastBlock = -2;\n    }\n    pause(dropWhilePaused) {\n        if (dropWhilePaused) {\n            this.#lastBlock = -2;\n        }\n        super.pause(dropWhilePaused);\n    }\n    async _poll(blockNumber, provider) {\n        const block = await provider.getBlock(this.#tag);\n        if (block == null) {\n            return;\n        }\n        if (this.#lastBlock === -2) {\n            this.#lastBlock = block.number;\n        }\n        else if (block.number > this.#lastBlock) {\n            provider.emit(this.#tag, block.number);\n            this.#lastBlock = block.number;\n        }\n    }\n}\n/**\n *  @_ignore:\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport class PollingOrphanSubscriber extends OnBlockSubscriber {\n    #filter;\n    constructor(provider, filter) {\n        super(provider);\n        this.#filter = copy(filter);\n    }\n    async _poll(blockNumber, provider) {\n        throw new Error(\"@TODO\");\n        console.log(this.#filter);\n    }\n}\n/**\n *  A **PollingTransactionSubscriber** will poll for a given transaction\n *  hash for its receipt.\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n    #hash;\n    /**\n     *  Create a new **PollingTransactionSubscriber** attached to\n     *  %%provider%%, listening for %%hash%%.\n     */\n    constructor(provider, hash) {\n        super(provider);\n        this.#hash = hash;\n    }\n    async _poll(blockNumber, provider) {\n        const tx = await provider.getTransactionReceipt(this.#hash);\n        if (tx) {\n            provider.emit(this.#hash, tx);\n        }\n    }\n}\n/**\n *  A **PollingEventSubscriber** will poll for a given filter for its logs.\n *\n *  @_docloc: api/providers/abstract-provider\n */\nexport class PollingEventSubscriber {\n    #provider;\n    #filter;\n    #poller;\n    #running;\n    // The most recent block we have scanned for events. The value -2\n    // indicates we still need to fetch an initial block number\n    #blockNumber;\n    /**\n     *  Create a new **PollingTransactionSubscriber** attached to\n     *  %%provider%%, listening for %%filter%%.\n     */\n    constructor(provider, filter) {\n        this.#provider = provider;\n        this.#filter = copy(filter);\n        this.#poller = this.#poll.bind(this);\n        this.#running = false;\n        this.#blockNumber = -2;\n    }\n    async #poll(blockNumber) {\n        // The initial block hasn't been determined yet\n        if (this.#blockNumber === -2) {\n            return;\n        }\n        const filter = copy(this.#filter);\n        filter.fromBlock = this.#blockNumber + 1;\n        filter.toBlock = blockNumber;\n        const logs = await this.#provider.getLogs(filter);\n        // No logs could just mean the node has not indexed them yet,\n        // so we keep a sliding window of 60 blocks to keep scanning\n        if (logs.length === 0) {\n            if (this.#blockNumber < blockNumber - 60) {\n                this.#blockNumber = blockNumber - 60;\n            }\n            return;\n        }\n        for (const log of logs) {\n            this.#provider.emit(this.#filter, log);\n            // Only advance the block number when logs were found to\n            // account for networks (like BNB and Polygon) which may\n            // sacrifice event consistency for block event speed\n            this.#blockNumber = log.blockNumber;\n        }\n    }\n    start() {\n        if (this.#running) {\n            return;\n        }\n        this.#running = true;\n        if (this.#blockNumber === -2) {\n            this.#provider.getBlockNumber().then((blockNumber) => {\n                this.#blockNumber = blockNumber;\n            });\n        }\n        this.#provider.on(\"block\", this.#poller);\n    }\n    stop() {\n        if (!this.#running) {\n            return;\n        }\n        this.#running = false;\n        this.#provider.off(\"block\", this.#poller);\n    }\n    pause(dropWhilePaused) {\n        this.stop();\n        if (dropWhilePaused) {\n            this.#blockNumber = -2;\n        }\n    }\n    resume() {\n        this.start();\n    }\n}\n//# sourceMappingURL=subscriber-polling.js.mapexport { WebSocket } from \"ws\";\n//# sourceMappingURL=ws.js.mapimport { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n    return {\n        address: getAddress(addr),\n        storageKeys: storageKeys.map((storageKey, index) => {\n            assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n            return storageKey.toLowerCase();\n        })\n    };\n}\n/**\n *  Returns a [[AccessList]] from any ethers-supported access-list structure.\n */\nexport function accessListify(value) {\n    if (Array.isArray(value)) {\n        return value.map((set, index) => {\n            if (Array.isArray(set)) {\n                assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n                return accessSetify(set[0], set[1]);\n            }\n            assertArgument(set != null && typeof (set) === \"object\", \"invalid address-slot set\", \"value\", value);\n            return accessSetify(set.address, set.storageKeys);\n        });\n    }\n    assertArgument(value != null && typeof (value) === \"object\", \"invalid access list\", \"value\", value);\n    const result = Object.keys(value).map((addr) => {\n        const storageKeys = value[addr].reduce((accum, storageKey) => {\n            accum[storageKey] = true;\n            return accum;\n        }, {});\n        return accessSetify(addr, Object.keys(storageKeys).sort());\n    });\n    result.sort((a, b) => (a.address.localeCompare(b.address)));\n    return result;\n}\n//# sourceMappingURL=accesslist.js.mapimport { getAddress } from \"../address/index.js\";\nimport { keccak256, SigningKey } from \"../crypto/index.js\";\n/**\n *  Returns the address for the %%key%%.\n *\n *  The key may be any standard form of public key or a private key.\n */\nexport function computeAddress(key) {\n    let pubkey;\n    if (typeof (key) === \"string\") {\n        pubkey = SigningKey.computePublicKey(key, false);\n    }\n    else {\n        pubkey = key.publicKey;\n    }\n    return getAddress(keccak256(\"0x\" + pubkey.substring(4)).substring(26));\n}\n/**\n *  Returns the recovered address for the private key that was\n *  used to sign %%digest%% that resulted in %%signature%%.\n */\nexport function recoverAddress(digest, signature) {\n    return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n}\n//# sourceMappingURL=address.js.mapimport { getAddress } from \"../address/index.js\";\nimport { Signature } from \"../crypto/index.js\";\nimport { getBigInt } from \"../utils/index.js\";\nexport function authorizationify(auth) {\n    return {\n        address: getAddress(auth.address),\n        nonce: getBigInt((auth.nonce != null) ? auth.nonce : 0),\n        chainId: getBigInt((auth.chainId != null) ? auth.chainId : 0),\n        signature: Signature.from(auth.signature)\n    };\n}\n//# sourceMappingURL=authorization.js.map/**\n *  Each state-changing operation on Ethereum requires a transaction.\n *\n *  @_section api/transaction:Transactions  [about-transactions]\n */\nnull;\nexport { accessListify } from \"./accesslist.js\";\nexport { authorizationify } from \"./authorization.js\";\nexport { computeAddress, recoverAddress } from \"./address.js\";\nexport { Transaction } from \"./transaction.js\";\n//# sourceMappingURL=index.js.mapimport { getAddress } from \"../address/index.js\";\nimport { ZeroAddress } from \"../constants/addresses.js\";\nimport { keccak256, sha256, Signature, SigningKey } from \"../crypto/index.js\";\nimport { concat, decodeRlp, encodeRlp, getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, isBytesLike, isHexString, toBeArray, zeroPadValue } from \"../utils/index.js\";\nimport { accessListify } from \"./accesslist.js\";\nimport { authorizationify } from \"./authorization.js\";\nimport { recoverAddress } from \"./address.js\";\nconst BN_0 = BigInt(0);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst BN_MAX_UINT = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nconst BLOB_SIZE = 4096 * 32;\nfunction getKzgLibrary(kzg) {\n    const blobToKzgCommitment = (blob) => {\n        if (\"computeBlobProof\" in kzg) {\n            // micro-ecc-signer; check for computeBlobProof since this API\n            // expects a string while the kzg-wasm below expects a Unit8Array\n            if (\"blobToKzgCommitment\" in kzg && typeof (kzg.blobToKzgCommitment) === \"function\") {\n                return getBytes(kzg.blobToKzgCommitment(hexlify(blob)));\n            }\n        }\n        else if (\"blobToKzgCommitment\" in kzg && typeof (kzg.blobToKzgCommitment) === \"function\") {\n            // kzg-wasm <0.5.0; blobToKzgCommitment(Uint8Array) => Uint8Array\n            return getBytes(kzg.blobToKzgCommitment(blob));\n        }\n        // kzg-wasm >= 0.5.0; blobToKZGCommitment(string) => string\n        if (\"blobToKZGCommitment\" in kzg && typeof (kzg.blobToKZGCommitment) === \"function\") {\n            return getBytes(kzg.blobToKZGCommitment(hexlify(blob)));\n        }\n        assertArgument(false, \"unsupported KZG library\", \"kzg\", kzg);\n    };\n    const computeBlobKzgProof = (blob, commitment) => {\n        // micro-ecc-signer\n        if (\"computeBlobProof\" in kzg && typeof (kzg.computeBlobProof) === \"function\") {\n            return getBytes(kzg.computeBlobProof(hexlify(blob), hexlify(commitment)));\n        }\n        // kzg-wasm <0.5.0; computeBlobKzgProof(Uint8Array, Uint8Array) => Uint8Array\n        if (\"computeBlobKzgProof\" in kzg && typeof (kzg.computeBlobKzgProof) === \"function\") {\n            return kzg.computeBlobKzgProof(blob, commitment);\n        }\n        // kzg-wasm >= 0.5.0; computeBlobKZGProof(string, string) => string\n        if (\"computeBlobKZGProof\" in kzg && typeof (kzg.computeBlobKZGProof) === \"function\") {\n            return getBytes(kzg.computeBlobKZGProof(hexlify(blob), hexlify(commitment)));\n        }\n        assertArgument(false, \"unsupported KZG library\", \"kzg\", kzg);\n    };\n    return { blobToKzgCommitment, computeBlobKzgProof };\n}\nfunction getVersionedHash(version, hash) {\n    let versioned = version.toString(16);\n    while (versioned.length < 2) {\n        versioned = \"0\" + versioned;\n    }\n    versioned += sha256(hash).substring(4);\n    return \"0x\" + versioned;\n}\nfunction handleAddress(value) {\n    if (value === \"0x\") {\n        return null;\n    }\n    return getAddress(value);\n}\nfunction handleAccessList(value, param) {\n    try {\n        return accessListify(value);\n    }\n    catch (error) {\n        assertArgument(false, error.message, param, value);\n    }\n}\nfunction handleAuthorizationList(value, param) {\n    try {\n        if (!Array.isArray(value)) {\n            throw new Error(\"authorizationList: invalid array\");\n        }\n        const result = [];\n        for (let i = 0; i < value.length; i++) {\n            const auth = value[i];\n            if (!Array.isArray(auth)) {\n                throw new Error(`authorization[${i}]: invalid array`);\n            }\n            if (auth.length !== 6) {\n                throw new Error(`authorization[${i}]: wrong length`);\n            }\n            if (!auth[1]) {\n                throw new Error(`authorization[${i}]: null address`);\n            }\n            result.push({\n                address: handleAddress(auth[1]),\n                nonce: handleUint(auth[2], \"nonce\"),\n                chainId: handleUint(auth[0], \"chainId\"),\n                signature: Signature.from({\n                    yParity: handleNumber(auth[3], \"yParity\"),\n                    r: zeroPadValue(auth[4], 32),\n                    s: zeroPadValue(auth[5], 32)\n                })\n            });\n        }\n        return result;\n    }\n    catch (error) {\n        assertArgument(false, error.message, param, value);\n    }\n}\nfunction handleNumber(_value, param) {\n    if (_value === \"0x\") {\n        return 0;\n    }\n    return getNumber(_value, param);\n}\nfunction handleUint(_value, param) {\n    if (_value === \"0x\") {\n        return BN_0;\n    }\n    const value = getBigInt(_value, param);\n    assertArgument(value <= BN_MAX_UINT, \"value exceeds uint size\", param, value);\n    return value;\n}\nfunction formatNumber(_value, name) {\n    const value = getBigInt(_value, \"value\");\n    const result = toBeArray(value);\n    assertArgument(result.length <= 32, `value too large`, `tx.${name}`, value);\n    return result;\n}\nfunction formatAccessList(value) {\n    return accessListify(value).map((set) => [set.address, set.storageKeys]);\n}\nfunction formatAuthorizationList(value) {\n    return value.map((a) => {\n        return [\n            formatNumber(a.chainId, \"chainId\"),\n            a.address,\n            formatNumber(a.nonce, \"nonce\"),\n            formatNumber(a.signature.yParity, \"yParity\"),\n            a.signature.r,\n            a.signature.s\n        ];\n    });\n}\nfunction formatHashes(value, param) {\n    assertArgument(Array.isArray(value), `invalid ${param}`, \"value\", value);\n    for (let i = 0; i < value.length; i++) {\n        assertArgument(isHexString(value[i], 32), \"invalid ${ param } hash\", `value[${i}]`, value[i]);\n    }\n    return value;\n}\nfunction _parseLegacy(data) {\n    const fields = decodeRlp(data);\n    assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 6), \"invalid field count for legacy transaction\", \"data\", data);\n    const tx = {\n        type: 0,\n        nonce: handleNumber(fields[0], \"nonce\"),\n        gasPrice: handleUint(fields[1], \"gasPrice\"),\n        gasLimit: handleUint(fields[2], \"gasLimit\"),\n        to: handleAddress(fields[3]),\n        value: handleUint(fields[4], \"value\"),\n        data: hexlify(fields[5]),\n        chainId: BN_0\n    };\n    // Legacy unsigned transaction\n    if (fields.length === 6) {\n        return tx;\n    }\n    const v = handleUint(fields[6], \"v\");\n    const r = handleUint(fields[7], \"r\");\n    const s = handleUint(fields[8], \"s\");\n    if (r === BN_0 && s === BN_0) {\n        // EIP-155 unsigned transaction\n        tx.chainId = v;\n    }\n    else {\n        // Compute the EIP-155 chain ID (or 0 for legacy)\n        let chainId = (v - BN_35) / BN_2;\n        if (chainId < BN_0) {\n            chainId = BN_0;\n        }\n        tx.chainId = chainId;\n        // Signed Legacy Transaction\n        assertArgument(chainId !== BN_0 || (v === BN_27 || v === BN_28), \"non-canonical legacy v\", \"v\", fields[6]);\n        tx.signature = Signature.from({\n            r: zeroPadValue(fields[7], 32),\n            s: zeroPadValue(fields[8], 32),\n            v\n        });\n        //tx.hash = keccak256(data);\n    }\n    return tx;\n}\nfunction _serializeLegacy(tx, sig) {\n    const fields = [\n        formatNumber(tx.nonce, \"nonce\"),\n        formatNumber(tx.gasPrice || 0, \"gasPrice\"),\n        formatNumber(tx.gasLimit, \"gasLimit\"),\n        (tx.to || \"0x\"),\n        formatNumber(tx.value, \"value\"),\n        tx.data,\n    ];\n    let chainId = BN_0;\n    if (tx.chainId != BN_0) {\n        // A chainId was provided; if non-zero we'll use EIP-155\n        chainId = getBigInt(tx.chainId, \"tx.chainId\");\n        // We have a chainId in the tx and an EIP-155 v in the signature,\n        // make sure they agree with each other\n        assertArgument(!sig || sig.networkV == null || sig.legacyChainId === chainId, \"tx.chainId/sig.v mismatch\", \"sig\", sig);\n    }\n    else if (tx.signature) {\n        // No explicit chainId, but EIP-155 have a derived implicit chainId\n        const legacy = tx.signature.legacyChainId;\n        if (legacy != null) {\n            chainId = legacy;\n        }\n    }\n    // Requesting an unsigned transaction\n    if (!sig) {\n        // We have an EIP-155 transaction (chainId was specified and non-zero)\n        if (chainId !== BN_0) {\n            fields.push(toBeArray(chainId));\n            fields.push(\"0x\");\n            fields.push(\"0x\");\n        }\n        return encodeRlp(fields);\n    }\n    // @TODO: We should probably check that tx.signature, chainId, and sig\n    //        match but that logic could break existing code, so schedule\n    //        this for the next major bump.\n    // Compute the EIP-155 v\n    let v = BigInt(27 + sig.yParity);\n    if (chainId !== BN_0) {\n        v = Signature.getChainIdV(chainId, sig.v);\n    }\n    else if (BigInt(sig.v) !== v) {\n        assertArgument(false, \"tx.chainId/sig.v mismatch\", \"sig\", sig);\n    }\n    // Add the signature\n    fields.push(toBeArray(v));\n    fields.push(toBeArray(sig.r));\n    fields.push(toBeArray(sig.s));\n    return encodeRlp(fields);\n}\nfunction _parseEipSignature(tx, fields) {\n    let yParity;\n    try {\n        yParity = handleNumber(fields[0], \"yParity\");\n        if (yParity !== 0 && yParity !== 1) {\n            throw new Error(\"bad yParity\");\n        }\n    }\n    catch (error) {\n        assertArgument(false, \"invalid yParity\", \"yParity\", fields[0]);\n    }\n    const r = zeroPadValue(fields[1], 32);\n    const s = zeroPadValue(fields[2], 32);\n    const signature = Signature.from({ r, s, yParity });\n    tx.signature = signature;\n}\nfunction _parseEip1559(data) {\n    const fields = decodeRlp(getBytes(data).slice(1));\n    assertArgument(Array.isArray(fields) && (fields.length === 9 || fields.length === 12), \"invalid field count for transaction type: 2\", \"data\", hexlify(data));\n    const tx = {\n        type: 2,\n        chainId: handleUint(fields[0], \"chainId\"),\n        nonce: handleNumber(fields[1], \"nonce\"),\n        maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n        maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n        gasPrice: null,\n        gasLimit: handleUint(fields[4], \"gasLimit\"),\n        to: handleAddress(fields[5]),\n        value: handleUint(fields[6], \"value\"),\n        data: hexlify(fields[7]),\n        accessList: handleAccessList(fields[8], \"accessList\"),\n    };\n    // Unsigned EIP-1559 Transaction\n    if (fields.length === 9) {\n        return tx;\n    }\n    //tx.hash = keccak256(data);\n    _parseEipSignature(tx, fields.slice(9));\n    return tx;\n}\nfunction _serializeEip1559(tx, sig) {\n    const fields = [\n        formatNumber(tx.chainId, \"chainId\"),\n        formatNumber(tx.nonce, \"nonce\"),\n        formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n        formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n        formatNumber(tx.gasLimit, \"gasLimit\"),\n        (tx.to || \"0x\"),\n        formatNumber(tx.value, \"value\"),\n        tx.data,\n        formatAccessList(tx.accessList || [])\n    ];\n    if (sig) {\n        fields.push(formatNumber(sig.yParity, \"yParity\"));\n        fields.push(toBeArray(sig.r));\n        fields.push(toBeArray(sig.s));\n    }\n    return concat([\"0x02\", encodeRlp(fields)]);\n}\nfunction _parseEip2930(data) {\n    const fields = decodeRlp(getBytes(data).slice(1));\n    assertArgument(Array.isArray(fields) && (fields.length === 8 || fields.length === 11), \"invalid field count for transaction type: 1\", \"data\", hexlify(data));\n    const tx = {\n        type: 1,\n        chainId: handleUint(fields[0], \"chainId\"),\n        nonce: handleNumber(fields[1], \"nonce\"),\n        gasPrice: handleUint(fields[2], \"gasPrice\"),\n        gasLimit: handleUint(fields[3], \"gasLimit\"),\n        to: handleAddress(fields[4]),\n        value: handleUint(fields[5], \"value\"),\n        data: hexlify(fields[6]),\n        accessList: handleAccessList(fields[7], \"accessList\")\n    };\n    // Unsigned EIP-2930 Transaction\n    if (fields.length === 8) {\n        return tx;\n    }\n    //tx.hash = keccak256(data);\n    _parseEipSignature(tx, fields.slice(8));\n    return tx;\n}\nfunction _serializeEip2930(tx, sig) {\n    const fields = [\n        formatNumber(tx.chainId, \"chainId\"),\n        formatNumber(tx.nonce, \"nonce\"),\n        formatNumber(tx.gasPrice || 0, \"gasPrice\"),\n        formatNumber(tx.gasLimit, \"gasLimit\"),\n        (tx.to || \"0x\"),\n        formatNumber(tx.value, \"value\"),\n        tx.data,\n        formatAccessList(tx.accessList || [])\n    ];\n    if (sig) {\n        fields.push(formatNumber(sig.yParity, \"recoveryParam\"));\n        fields.push(toBeArray(sig.r));\n        fields.push(toBeArray(sig.s));\n    }\n    return concat([\"0x01\", encodeRlp(fields)]);\n}\nfunction _parseEip4844(data) {\n    let fields = decodeRlp(getBytes(data).slice(1));\n    let typeName = \"3\";\n    let blobs = null;\n    // Parse the network format\n    if (fields.length === 4 && Array.isArray(fields[0])) {\n        typeName = \"3 (network format)\";\n        const fBlobs = fields[1], fCommits = fields[2], fProofs = fields[3];\n        assertArgument(Array.isArray(fBlobs), \"invalid network format: blobs not an array\", \"fields[1]\", fBlobs);\n        assertArgument(Array.isArray(fCommits), \"invalid network format: commitments not an array\", \"fields[2]\", fCommits);\n        assertArgument(Array.isArray(fProofs), \"invalid network format: proofs not an array\", \"fields[3]\", fProofs);\n        assertArgument(fBlobs.length === fCommits.length, \"invalid network format: blobs/commitments length mismatch\", \"fields\", fields);\n        assertArgument(fBlobs.length === fProofs.length, \"invalid network format: blobs/proofs length mismatch\", \"fields\", fields);\n        blobs = [];\n        for (let i = 0; i < fields[1].length; i++) {\n            blobs.push({\n                data: fBlobs[i],\n                commitment: fCommits[i],\n                proof: fProofs[i],\n            });\n        }\n        fields = fields[0];\n    }\n    assertArgument(Array.isArray(fields) && (fields.length === 11 || fields.length === 14), `invalid field count for transaction type: ${typeName}`, \"data\", hexlify(data));\n    const tx = {\n        type: 3,\n        chainId: handleUint(fields[0], \"chainId\"),\n        nonce: handleNumber(fields[1], \"nonce\"),\n        maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n        maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n        gasPrice: null,\n        gasLimit: handleUint(fields[4], \"gasLimit\"),\n        to: handleAddress(fields[5]),\n        value: handleUint(fields[6], \"value\"),\n        data: hexlify(fields[7]),\n        accessList: handleAccessList(fields[8], \"accessList\"),\n        maxFeePerBlobGas: handleUint(fields[9], \"maxFeePerBlobGas\"),\n        blobVersionedHashes: fields[10]\n    };\n    if (blobs) {\n        tx.blobs = blobs;\n    }\n    assertArgument(tx.to != null, `invalid address for transaction type: ${typeName}`, \"data\", data);\n    assertArgument(Array.isArray(tx.blobVersionedHashes), \"invalid blobVersionedHashes: must be an array\", \"data\", data);\n    for (let i = 0; i < tx.blobVersionedHashes.length; i++) {\n        assertArgument(isHexString(tx.blobVersionedHashes[i], 32), `invalid blobVersionedHash at index ${i}: must be length 32`, \"data\", data);\n    }\n    // Unsigned EIP-4844 Transaction\n    if (fields.length === 11) {\n        return tx;\n    }\n    // @TODO: Do we need to do this? This is only called internally\n    // and used to verify hashes; it might save time to not do this\n    //tx.hash = keccak256(concat([ \"0x03\", encodeRlp(fields) ]));\n    _parseEipSignature(tx, fields.slice(11));\n    return tx;\n}\nfunction _serializeEip4844(tx, sig, blobs) {\n    const fields = [\n        formatNumber(tx.chainId, \"chainId\"),\n        formatNumber(tx.nonce, \"nonce\"),\n        formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n        formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n        formatNumber(tx.gasLimit, \"gasLimit\"),\n        (tx.to || ZeroAddress),\n        formatNumber(tx.value, \"value\"),\n        tx.data,\n        formatAccessList(tx.accessList || []),\n        formatNumber(tx.maxFeePerBlobGas || 0, \"maxFeePerBlobGas\"),\n        formatHashes(tx.blobVersionedHashes || [], \"blobVersionedHashes\")\n    ];\n    if (sig) {\n        fields.push(formatNumber(sig.yParity, \"yParity\"));\n        fields.push(toBeArray(sig.r));\n        fields.push(toBeArray(sig.s));\n        // We have blobs; return the network wrapped format\n        if (blobs) {\n            return concat([\n                \"0x03\",\n                encodeRlp([\n                    fields,\n                    blobs.map((b) => b.data),\n                    blobs.map((b) => b.commitment),\n                    blobs.map((b) => b.proof),\n                ])\n            ]);\n        }\n    }\n    return concat([\"0x03\", encodeRlp(fields)]);\n}\nfunction _parseEip7702(data) {\n    const fields = decodeRlp(getBytes(data).slice(1));\n    assertArgument(Array.isArray(fields) && (fields.length === 10 || fields.length === 13), \"invalid field count for transaction type: 4\", \"data\", hexlify(data));\n    const tx = {\n        type: 4,\n        chainId: handleUint(fields[0], \"chainId\"),\n        nonce: handleNumber(fields[1], \"nonce\"),\n        maxPriorityFeePerGas: handleUint(fields[2], \"maxPriorityFeePerGas\"),\n        maxFeePerGas: handleUint(fields[3], \"maxFeePerGas\"),\n        gasPrice: null,\n        gasLimit: handleUint(fields[4], \"gasLimit\"),\n        to: handleAddress(fields[5]),\n        value: handleUint(fields[6], \"value\"),\n        data: hexlify(fields[7]),\n        accessList: handleAccessList(fields[8], \"accessList\"),\n        authorizationList: handleAuthorizationList(fields[9], \"authorizationList\"),\n    };\n    // Unsigned EIP-7702 Transaction\n    if (fields.length === 10) {\n        return tx;\n    }\n    _parseEipSignature(tx, fields.slice(10));\n    return tx;\n}\nfunction _serializeEip7702(tx, sig) {\n    const fields = [\n        formatNumber(tx.chainId, \"chainId\"),\n        formatNumber(tx.nonce, \"nonce\"),\n        formatNumber(tx.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n        formatNumber(tx.maxFeePerGas || 0, \"maxFeePerGas\"),\n        formatNumber(tx.gasLimit, \"gasLimit\"),\n        (tx.to || \"0x\"),\n        formatNumber(tx.value, \"value\"),\n        tx.data,\n        formatAccessList(tx.accessList || []),\n        formatAuthorizationList(tx.authorizationList || [])\n    ];\n    if (sig) {\n        fields.push(formatNumber(sig.yParity, \"yParity\"));\n        fields.push(toBeArray(sig.r));\n        fields.push(toBeArray(sig.s));\n    }\n    return concat([\"0x04\", encodeRlp(fields)]);\n}\n/**\n *  A **Transaction** describes an operation to be executed on\n *  Ethereum by an Externally Owned Account (EOA). It includes\n *  who (the [[to]] address), what (the [[data]]) and how much (the\n *  [[value]] in ether) the operation should entail.\n *\n *  @example:\n *    tx = new Transaction()\n *    //_result:\n *\n *    tx.data = \"0x1234\";\n *    //_result:\n */\nexport class Transaction {\n    #type;\n    #to;\n    #data;\n    #nonce;\n    #gasLimit;\n    #gasPrice;\n    #maxPriorityFeePerGas;\n    #maxFeePerGas;\n    #value;\n    #chainId;\n    #sig;\n    #accessList;\n    #maxFeePerBlobGas;\n    #blobVersionedHashes;\n    #kzg;\n    #blobs;\n    #auths;\n    /**\n     *  The transaction type.\n     *\n     *  If null, the type will be automatically inferred based on\n     *  explicit properties.\n     */\n    get type() { return this.#type; }\n    set type(value) {\n        switch (value) {\n            case null:\n                this.#type = null;\n                break;\n            case 0:\n            case \"legacy\":\n                this.#type = 0;\n                break;\n            case 1:\n            case \"berlin\":\n            case \"eip-2930\":\n                this.#type = 1;\n                break;\n            case 2:\n            case \"london\":\n            case \"eip-1559\":\n                this.#type = 2;\n                break;\n            case 3:\n            case \"cancun\":\n            case \"eip-4844\":\n                this.#type = 3;\n                break;\n            case 4:\n            case \"pectra\":\n            case \"eip-7702\":\n                this.#type = 4;\n                break;\n            default:\n                assertArgument(false, \"unsupported transaction type\", \"type\", value);\n        }\n    }\n    /**\n     *  The name of the transaction type.\n     */\n    get typeName() {\n        switch (this.type) {\n            case 0: return \"legacy\";\n            case 1: return \"eip-2930\";\n            case 2: return \"eip-1559\";\n            case 3: return \"eip-4844\";\n            case 4: return \"eip-7702\";\n        }\n        return null;\n    }\n    /**\n     *  The ``to`` address for the transaction or ``null`` if the\n     *  transaction is an ``init`` transaction.\n     */\n    get to() {\n        const value = this.#to;\n        if (value == null && this.type === 3) {\n            return ZeroAddress;\n        }\n        return value;\n    }\n    set to(value) {\n        this.#to = (value == null) ? null : getAddress(value);\n    }\n    /**\n     *  The transaction nonce.\n     */\n    get nonce() { return this.#nonce; }\n    set nonce(value) { this.#nonce = getNumber(value, \"value\"); }\n    /**\n     *  The gas limit.\n     */\n    get gasLimit() { return this.#gasLimit; }\n    set gasLimit(value) { this.#gasLimit = getBigInt(value); }\n    /**\n     *  The gas price.\n     *\n     *  On legacy networks this defines the fee that will be paid. On\n     *  EIP-1559 networks, this should be ``null``.\n     */\n    get gasPrice() {\n        const value = this.#gasPrice;\n        if (value == null && (this.type === 0 || this.type === 1)) {\n            return BN_0;\n        }\n        return value;\n    }\n    set gasPrice(value) {\n        this.#gasPrice = (value == null) ? null : getBigInt(value, \"gasPrice\");\n    }\n    /**\n     *  The maximum priority fee per unit of gas to pay. On legacy\n     *  networks this should be ``null``.\n     */\n    get maxPriorityFeePerGas() {\n        const value = this.#maxPriorityFeePerGas;\n        if (value == null) {\n            if (this.type === 2 || this.type === 3) {\n                return BN_0;\n            }\n            return null;\n        }\n        return value;\n    }\n    set maxPriorityFeePerGas(value) {\n        this.#maxPriorityFeePerGas = (value == null) ? null : getBigInt(value, \"maxPriorityFeePerGas\");\n    }\n    /**\n     *  The maximum total fee per unit of gas to pay. On legacy\n     *  networks this should be ``null``.\n     */\n    get maxFeePerGas() {\n        const value = this.#maxFeePerGas;\n        if (value == null) {\n            if (this.type === 2 || this.type === 3) {\n                return BN_0;\n            }\n            return null;\n        }\n        return value;\n    }\n    set maxFeePerGas(value) {\n        this.#maxFeePerGas = (value == null) ? null : getBigInt(value, \"maxFeePerGas\");\n    }\n    /**\n     *  The transaction data. For ``init`` transactions this is the\n     *  deployment code.\n     */\n    get data() { return this.#data; }\n    set data(value) { this.#data = hexlify(value); }\n    /**\n     *  The amount of ether (in wei) to send in this transactions.\n     */\n    get value() { return this.#value; }\n    set value(value) {\n        this.#value = getBigInt(value, \"value\");\n    }\n    /**\n     *  The chain ID this transaction is valid on.\n     */\n    get chainId() { return this.#chainId; }\n    set chainId(value) { this.#chainId = getBigInt(value); }\n    /**\n     *  If signed, the signature for this transaction.\n     */\n    get signature() { return this.#sig || null; }\n    set signature(value) {\n        this.#sig = (value == null) ? null : Signature.from(value);\n    }\n    /**\n     *  The access list.\n     *\n     *  An access list permits discounted (but pre-paid) access to\n     *  bytecode and state variable access within contract execution.\n     */\n    get accessList() {\n        const value = this.#accessList || null;\n        if (value == null) {\n            if (this.type === 1 || this.type === 2 || this.type === 3) {\n                // @TODO: in v7, this should assign the value or become\n                // a live object itself, otherwise mutation is inconsistent\n                return [];\n            }\n            return null;\n        }\n        return value;\n    }\n    set accessList(value) {\n        this.#accessList = (value == null) ? null : accessListify(value);\n    }\n    get authorizationList() {\n        const value = this.#auths || null;\n        if (value == null) {\n            if (this.type === 4) {\n                // @TODO: in v7, this should become a live object itself,\n                // otherwise mutation is inconsistent\n                return [];\n            }\n        }\n        return value;\n    }\n    set authorizationList(auths) {\n        this.#auths = (auths == null) ? null : auths.map((a) => authorizationify(a));\n    }\n    /**\n     *  The max fee per blob gas for Cancun transactions.\n     */\n    get maxFeePerBlobGas() {\n        const value = this.#maxFeePerBlobGas;\n        if (value == null && this.type === 3) {\n            return BN_0;\n        }\n        return value;\n    }\n    set maxFeePerBlobGas(value) {\n        this.#maxFeePerBlobGas = (value == null) ? null : getBigInt(value, \"maxFeePerBlobGas\");\n    }\n    /**\n     *  The BLOb versioned hashes for Cancun transactions.\n     */\n    get blobVersionedHashes() {\n        // @TODO: Mutation is inconsistent; if unset, the returned value\n        // cannot mutate the object, if set it can\n        let value = this.#blobVersionedHashes;\n        if (value == null && this.type === 3) {\n            return [];\n        }\n        return value;\n    }\n    set blobVersionedHashes(value) {\n        if (value != null) {\n            assertArgument(Array.isArray(value), \"blobVersionedHashes must be an Array\", \"value\", value);\n            value = value.slice();\n            for (let i = 0; i < value.length; i++) {\n                assertArgument(isHexString(value[i], 32), \"invalid blobVersionedHash\", `value[${i}]`, value[i]);\n            }\n        }\n        this.#blobVersionedHashes = value;\n    }\n    /**\n     *  The BLObs for the Transaction, if any.\n     *\n     *  If ``blobs`` is non-``null``, then the [[seriailized]]\n     *  will return the network formatted sidecar, otherwise it\n     *  will return the standard [[link-eip-2718]] payload. The\n     *  [[unsignedSerialized]] is unaffected regardless.\n     *\n     *  When setting ``blobs``, either fully valid [[Blob]] objects\n     *  may be specified (i.e. correctly padded, with correct\n     *  committments and proofs) or a raw [[BytesLike]] may\n     *  be provided.\n     *\n     *  If raw [[BytesLike]] are provided, the [[kzg]] property **must**\n     *  be already set. The blob will be correctly padded and the\n     *  [[KzgLibrary]] will be used to compute the committment and\n     *  proof for the blob.\n     *\n     *  A BLOb is a sequence of field elements, each of which must\n     *  be within the BLS field modulo, so some additional processing\n     *  may be required to encode arbitrary data to ensure each 32 byte\n     *  field is within the valid range.\n     *\n     *  Setting this automatically populates [[blobVersionedHashes]],\n     *  overwriting any existing values. Setting this to ``null``\n     *  does **not** remove the [[blobVersionedHashes]], leaving them\n     *  present.\n     */\n    get blobs() {\n        if (this.#blobs == null) {\n            return null;\n        }\n        return this.#blobs.map((b) => Object.assign({}, b));\n    }\n    set blobs(_blobs) {\n        if (_blobs == null) {\n            this.#blobs = null;\n            return;\n        }\n        const blobs = [];\n        const versionedHashes = [];\n        for (let i = 0; i < _blobs.length; i++) {\n            const blob = _blobs[i];\n            if (isBytesLike(blob)) {\n                assert(this.#kzg, \"adding a raw blob requires a KZG library\", \"UNSUPPORTED_OPERATION\", {\n                    operation: \"set blobs()\"\n                });\n                let data = getBytes(blob);\n                assertArgument(data.length <= BLOB_SIZE, \"blob is too large\", `blobs[${i}]`, blob);\n                // Pad blob if necessary\n                if (data.length !== BLOB_SIZE) {\n                    const padded = new Uint8Array(BLOB_SIZE);\n                    padded.set(data);\n                    data = padded;\n                }\n                const commit = this.#kzg.blobToKzgCommitment(data);\n                const proof = hexlify(this.#kzg.computeBlobKzgProof(data, commit));\n                blobs.push({\n                    data: hexlify(data),\n                    commitment: hexlify(commit),\n                    proof\n                });\n                versionedHashes.push(getVersionedHash(1, commit));\n            }\n            else {\n                const commit = hexlify(blob.commitment);\n                blobs.push({\n                    data: hexlify(blob.data),\n                    commitment: commit,\n                    proof: hexlify(blob.proof)\n                });\n                versionedHashes.push(getVersionedHash(1, commit));\n            }\n        }\n        this.#blobs = blobs;\n        this.#blobVersionedHashes = versionedHashes;\n    }\n    get kzg() { return this.#kzg; }\n    set kzg(kzg) {\n        if (kzg == null) {\n            this.#kzg = null;\n        }\n        else {\n            this.#kzg = getKzgLibrary(kzg);\n        }\n    }\n    /**\n     *  Creates a new Transaction with default values.\n     */\n    constructor() {\n        this.#type = null;\n        this.#to = null;\n        this.#nonce = 0;\n        this.#gasLimit = BN_0;\n        this.#gasPrice = null;\n        this.#maxPriorityFeePerGas = null;\n        this.#maxFeePerGas = null;\n        this.#data = \"0x\";\n        this.#value = BN_0;\n        this.#chainId = BN_0;\n        this.#sig = null;\n        this.#accessList = null;\n        this.#maxFeePerBlobGas = null;\n        this.#blobVersionedHashes = null;\n        this.#kzg = null;\n        this.#blobs = null;\n        this.#auths = null;\n    }\n    /**\n     *  The transaction hash, if signed. Otherwise, ``null``.\n     */\n    get hash() {\n        if (this.signature == null) {\n            return null;\n        }\n        return keccak256(this.#getSerialized(true, false));\n    }\n    /**\n     *  The pre-image hash of this transaction.\n     *\n     *  This is the digest that a [[Signer]] must sign to authorize\n     *  this transaction.\n     */\n    get unsignedHash() {\n        return keccak256(this.unsignedSerialized);\n    }\n    /**\n     *  The sending address, if signed. Otherwise, ``null``.\n     */\n    get from() {\n        if (this.signature == null) {\n            return null;\n        }\n        return recoverAddress(this.unsignedHash, this.signature);\n    }\n    /**\n     *  The public key of the sender, if signed. Otherwise, ``null``.\n     */\n    get fromPublicKey() {\n        if (this.signature == null) {\n            return null;\n        }\n        return SigningKey.recoverPublicKey(this.unsignedHash, this.signature);\n    }\n    /**\n     *  Returns true if signed.\n     *\n     *  This provides a Type Guard that properties requiring a signed\n     *  transaction are non-null.\n     */\n    isSigned() {\n        return this.signature != null;\n    }\n    #getSerialized(signed, sidecar) {\n        assert(!signed || this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n        const sig = signed ? this.signature : null;\n        switch (this.inferType()) {\n            case 0:\n                return _serializeLegacy(this, sig);\n            case 1:\n                return _serializeEip2930(this, sig);\n            case 2:\n                return _serializeEip1559(this, sig);\n            case 3:\n                return _serializeEip4844(this, sig, sidecar ? this.blobs : null);\n            case 4:\n                return _serializeEip7702(this, sig);\n        }\n        assert(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n    }\n    /**\n     *  The serialized transaction.\n     *\n     *  This throws if the transaction is unsigned. For the pre-image,\n     *  use [[unsignedSerialized]].\n     */\n    get serialized() {\n        return this.#getSerialized(true, true);\n    }\n    /**\n     *  The transaction pre-image.\n     *\n     *  The hash of this is the digest which needs to be signed to\n     *  authorize this transaction.\n     */\n    get unsignedSerialized() {\n        return this.#getSerialized(false, false);\n    }\n    /**\n     *  Return the most \"likely\" type; currently the highest\n     *  supported transaction type.\n     */\n    inferType() {\n        const types = this.inferTypes();\n        // Prefer London (EIP-1559) over Cancun (BLOb)\n        if (types.indexOf(2) >= 0) {\n            return 2;\n        }\n        // Return the highest inferred type\n        return (types.pop());\n    }\n    /**\n     *  Validates the explicit properties and returns a list of compatible\n     *  transaction types.\n     */\n    inferTypes() {\n        // Checks that there are no conflicting properties set\n        const hasGasPrice = this.gasPrice != null;\n        const hasFee = (this.maxFeePerGas != null || this.maxPriorityFeePerGas != null);\n        const hasAccessList = (this.accessList != null);\n        const hasBlob = (this.#maxFeePerBlobGas != null || this.#blobVersionedHashes);\n        //if (hasGasPrice && hasFee) {\n        //    throw new Error(\"transaction cannot have gasPrice and maxFeePerGas\");\n        //}\n        if (this.maxFeePerGas != null && this.maxPriorityFeePerGas != null) {\n            assert(this.maxFeePerGas >= this.maxPriorityFeePerGas, \"priorityFee cannot be more than maxFee\", \"BAD_DATA\", { value: this });\n        }\n        //if (this.type === 2 && hasGasPrice) {\n        //    throw new Error(\"eip-1559 transaction cannot have gasPrice\");\n        //}\n        assert(!hasFee || (this.type !== 0 && this.type !== 1), \"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas\", \"BAD_DATA\", { value: this });\n        assert(this.type !== 0 || !hasAccessList, \"legacy transaction cannot have accessList\", \"BAD_DATA\", { value: this });\n        const types = [];\n        // Explicit type\n        if (this.type != null) {\n            types.push(this.type);\n        }\n        else {\n            if (this.authorizationList && this.authorizationList.length) {\n                types.push(4);\n            }\n            else if (hasFee) {\n                types.push(2);\n            }\n            else if (hasGasPrice) {\n                types.push(1);\n                if (!hasAccessList) {\n                    types.push(0);\n                }\n            }\n            else if (hasAccessList) {\n                types.push(1);\n                types.push(2);\n            }\n            else if (hasBlob && this.to) {\n                types.push(3);\n            }\n            else {\n                types.push(0);\n                types.push(1);\n                types.push(2);\n                types.push(3);\n            }\n        }\n        types.sort();\n        return types;\n    }\n    /**\n     *  Returns true if this transaction is a legacy transaction (i.e.\n     *  ``type === 0``).\n     *\n     *  This provides a Type Guard that the related properties are\n     *  non-null.\n     */\n    isLegacy() {\n        return (this.type === 0);\n    }\n    /**\n     *  Returns true if this transaction is berlin hardform transaction (i.e.\n     *  ``type === 1``).\n     *\n     *  This provides a Type Guard that the related properties are\n     *  non-null.\n     */\n    isBerlin() {\n        return (this.type === 1);\n    }\n    /**\n     *  Returns true if this transaction is london hardform transaction (i.e.\n     *  ``type === 2``).\n     *\n     *  This provides a Type Guard that the related properties are\n     *  non-null.\n     */\n    isLondon() {\n        return (this.type === 2);\n    }\n    /**\n     *  Returns true if this transaction is an [[link-eip-4844]] BLOB\n     *  transaction.\n     *\n     *  This provides a Type Guard that the related properties are\n     *  non-null.\n     */\n    isCancun() {\n        return (this.type === 3);\n    }\n    /**\n     *  Create a copy of this transaciton.\n     */\n    clone() {\n        return Transaction.from(this);\n    }\n    /**\n     *  Return a JSON-friendly object.\n     */\n    toJSON() {\n        const s = (v) => {\n            if (v == null) {\n                return null;\n            }\n            return v.toString();\n        };\n        return {\n            type: this.type,\n            to: this.to,\n            //            from: this.from,\n            data: this.data,\n            nonce: this.nonce,\n            gasLimit: s(this.gasLimit),\n            gasPrice: s(this.gasPrice),\n            maxPriorityFeePerGas: s(this.maxPriorityFeePerGas),\n            maxFeePerGas: s(this.maxFeePerGas),\n            value: s(this.value),\n            chainId: s(this.chainId),\n            sig: this.signature ? this.signature.toJSON() : null,\n            accessList: this.accessList\n        };\n    }\n    /**\n     *  Create a **Transaction** from a serialized transaction or a\n     *  Transaction-like object.\n     */\n    static from(tx) {\n        if (tx == null) {\n            return new Transaction();\n        }\n        if (typeof (tx) === \"string\") {\n            const payload = getBytes(tx);\n            if (payload[0] >= 0x7f) { // @TODO: > vs >= ??\n                return Transaction.from(_parseLegacy(payload));\n            }\n            switch (payload[0]) {\n                case 1: return Transaction.from(_parseEip2930(payload));\n                case 2: return Transaction.from(_parseEip1559(payload));\n                case 3: return Transaction.from(_parseEip4844(payload));\n                case 4: return Transaction.from(_parseEip7702(payload));\n            }\n            assert(false, \"unsupported transaction type\", \"UNSUPPORTED_OPERATION\", { operation: \"from\" });\n        }\n        const result = new Transaction();\n        if (tx.type != null) {\n            result.type = tx.type;\n        }\n        if (tx.to != null) {\n            result.to = tx.to;\n        }\n        if (tx.nonce != null) {\n            result.nonce = tx.nonce;\n        }\n        if (tx.gasLimit != null) {\n            result.gasLimit = tx.gasLimit;\n        }\n        if (tx.gasPrice != null) {\n            result.gasPrice = tx.gasPrice;\n        }\n        if (tx.maxPriorityFeePerGas != null) {\n            result.maxPriorityFeePerGas = tx.maxPriorityFeePerGas;\n        }\n        if (tx.maxFeePerGas != null) {\n            result.maxFeePerGas = tx.maxFeePerGas;\n        }\n        if (tx.maxFeePerBlobGas != null) {\n            result.maxFeePerBlobGas = tx.maxFeePerBlobGas;\n        }\n        if (tx.data != null) {\n            result.data = tx.data;\n        }\n        if (tx.value != null) {\n            result.value = tx.value;\n        }\n        if (tx.chainId != null) {\n            result.chainId = tx.chainId;\n        }\n        if (tx.signature != null) {\n            result.signature = Signature.from(tx.signature);\n        }\n        if (tx.accessList != null) {\n            result.accessList = tx.accessList;\n        }\n        if (tx.authorizationList != null) {\n            result.authorizationList = tx.authorizationList;\n        }\n        // This will get overwritten by blobs, if present\n        if (tx.blobVersionedHashes != null) {\n            result.blobVersionedHashes = tx.blobVersionedHashes;\n        }\n        // Make sure we assign the kzg before assigning blobs, which\n        // require the library in the event raw blob data is provided.\n        if (tx.kzg != null) {\n            result.kzg = tx.kzg;\n        }\n        if (tx.blobs != null) {\n            result.blobs = tx.blobs;\n        }\n        if (tx.hash != null) {\n            assertArgument(result.isSigned(), \"unsigned transaction cannot define '.hash'\", \"tx\", tx);\n            assertArgument(result.hash === tx.hash, \"hash mismatch\", \"tx\", tx);\n        }\n        if (tx.from != null) {\n            assertArgument(result.isSigned(), \"unsigned transaction cannot define '.from'\", \"tx\", tx);\n            assertArgument(result.from.toLowerCase() === (tx.from || \"\").toLowerCase(), \"from mismatch\", \"tx\", tx);\n        }\n        return result;\n    }\n}\n//# sourceMappingURL=transaction.js.map/**\n *  The [Base58 Encoding](link-base58) scheme allows a **numeric** value\n *  to be encoded as a compact string using a radix of 58 using only\n *  alpha-numeric characters. Confusingly similar characters are omitted\n *  (i.e. ``\"l0O\"``).\n *\n *  Note that Base58 encodes a **numeric** value, not arbitrary bytes,\n *  since any zero-bytes on the left would get removed. To mitigate this\n *  issue most schemes that use Base58 choose specific high-order values\n *  to ensure non-zero prefixes.\n *\n *  @_subsection: api/utils:Base58 Encoding [about-base58]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument } from \"./errors.js\";\nimport { toBigInt } from \"./maths.js\";\nconst Alphabet = \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";\nlet Lookup = null;\nfunction getAlpha(letter) {\n    if (Lookup == null) {\n        Lookup = {};\n        for (let i = 0; i < Alphabet.length; i++) {\n            Lookup[Alphabet[i]] = BigInt(i);\n        }\n    }\n    const result = Lookup[letter];\n    assertArgument(result != null, `invalid base58 value`, \"letter\", letter);\n    return result;\n}\nconst BN_0 = BigInt(0);\nconst BN_58 = BigInt(58);\n/**\n *  Encode %%value%% as a Base58-encoded string.\n */\nexport function encodeBase58(_value) {\n    const bytes = getBytes(_value);\n    let value = toBigInt(bytes);\n    let result = \"\";\n    while (value) {\n        result = Alphabet[Number(value % BN_58)] + result;\n        value /= BN_58;\n    }\n    // Account for leading padding zeros\n    for (let i = 0; i < bytes.length; i++) {\n        if (bytes[i]) {\n            break;\n        }\n        result = Alphabet[0] + result;\n    }\n    return result;\n}\n/**\n *  Decode the Base58-encoded %%value%%.\n */\nexport function decodeBase58(value) {\n    let result = BN_0;\n    for (let i = 0; i < value.length; i++) {\n        result *= BN_58;\n        result += getAlpha(value[i]);\n    }\n    return result;\n}\n//# sourceMappingURL=base58.js.map/**\n *  [Base64 encoding](link-wiki-base64) using 6-bit words to encode\n *  arbitrary bytes into a string using 65 printable symbols, the\n *  upper-case and lower-case alphabet, the digits ``0`` through ``9``,\n *  ``\"+\"`` and ``\"/\"`` with the ``\"=\"`` used for padding.\n *\n *  @_subsection: api/utils:Base64 Encoding  [about-base64]\n */\nimport { getBytes, getBytesCopy } from \"./data.js\";\n/**\n *  Decodes the base-64 encoded %%value%%.\n *\n *  @example:\n *    // The decoded value is always binary data...\n *    result = decodeBase64(\"SGVsbG8gV29ybGQhIQ==\")\n *    //_result:\n *\n *    // ...use toUtf8String to convert it to a string.\n *    toUtf8String(result)\n *    //_result:\n *\n *    // Decoding binary data\n *    decodeBase64(\"EjQ=\")\n *    //_result:\n */\nexport function decodeBase64(value) {\n    return getBytesCopy(Buffer.from(value, \"base64\"));\n}\n;\n/**\n *  Encodes %%data%% as a base-64 encoded string.\n *\n *  @example:\n *    // Encoding binary data as a hexstring\n *    encodeBase64(\"0x1234\")\n *    //_result:\n *\n *    // Encoding binary data as a Uint8Array\n *    encodeBase64(new Uint8Array([ 0x12, 0x34 ]))\n *    //_result:\n *\n *    // The input MUST be data...\n *    encodeBase64(\"Hello World!!\")\n *    //_error:\n *\n *    // ...use toUtf8Bytes for this.\n *    encodeBase64(toUtf8Bytes(\"Hello World!!\"))\n *    //_result:\n */\nexport function encodeBase64(data) {\n    return Buffer.from(getBytes(data)).toString(\"base64\");\n}\n//# sourceMappingURL=base64.js.map/**\n *  Some data helpers.\n *\n *\n *  @_subsection api/utils:Data Helpers  [about-data]\n */\nimport { assert, assertArgument } from \"./errors.js\";\nfunction _getBytes(value, name, copy) {\n    if (value instanceof Uint8Array) {\n        if (copy) {\n            return new Uint8Array(value);\n        }\n        return value;\n    }\n    if (typeof (value) === \"string\" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) {\n        const result = new Uint8Array((value.length - 2) / 2);\n        let offset = 2;\n        for (let i = 0; i < result.length; i++) {\n            result[i] = parseInt(value.substring(offset, offset + 2), 16);\n            offset += 2;\n        }\n        return result;\n    }\n    assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n *  Get a typed Uint8Array for %%value%%. If already a Uint8Array\n *  the original %%value%% is returned; if a copy is required use\n *  [[getBytesCopy]].\n *\n *  @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n    return _getBytes(value, name, false);\n}\n/**\n *  Get a typed Uint8Array for %%value%%, creating a copy if necessary\n *  to prevent any modifications of the returned value from being\n *  reflected elsewhere.\n *\n *  @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n    return _getBytes(value, name, true);\n}\n/**\n *  Returns true if %%value%% is a valid [[HexString]].\n *\n *  If %%length%% is ``true`` or a //number//, it also checks that\n *  %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n *  bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n    if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n        return false;\n    }\n    if (typeof (length) === \"number\" && value.length !== 2 + 2 * length) {\n        return false;\n    }\n    if (length === true && (value.length % 2) !== 0) {\n        return false;\n    }\n    return true;\n}\n/**\n *  Returns true if %%value%% is a valid representation of arbitrary\n *  data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n    return (isHexString(value, true) || (value instanceof Uint8Array));\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n *  Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(data) {\n    const bytes = getBytes(data);\n    let result = \"0x\";\n    for (let i = 0; i < bytes.length; i++) {\n        const v = bytes[i];\n        result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n    }\n    return result;\n}\n/**\n *  Returns a [[DataHexString]] by concatenating all values\n *  within %%data%%.\n */\nexport function concat(datas) {\n    return \"0x\" + datas.map((d) => hexlify(d).substring(2)).join(\"\");\n}\n/**\n *  Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n    if (isHexString(data, true)) {\n        return (data.length - 2) / 2;\n    }\n    return getBytes(data).length;\n}\n/**\n *  Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n *  offset to the %%end%% offset.\n *\n *  By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n    const bytes = getBytes(data);\n    if (end != null && end > bytes.length) {\n        assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n            buffer: bytes, length: bytes.length, offset: end\n        });\n    }\n    return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end));\n}\n/**\n *  Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n    let bytes = hexlify(data).substring(2);\n    while (bytes.startsWith(\"00\")) {\n        bytes = bytes.substring(2);\n    }\n    return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n    const bytes = getBytes(data);\n    assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n        buffer: new Uint8Array(bytes),\n        length: length,\n        offset: length + 1\n    });\n    const result = new Uint8Array(length);\n    result.fill(0);\n    if (left) {\n        result.set(bytes, length - bytes.length);\n    }\n    else {\n        result.set(bytes, 0);\n    }\n    return hexlify(result);\n}\n/**\n *  Return the [[DataHexString]] of %%data%% padded on the **left**\n *  to %%length%% bytes.\n *\n *  If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n *  thrown.\n *\n *  This pads data the same as **values** are in Solidity\n *  (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n    return zeroPad(data, length, true);\n}\n/**\n *  Return the [[DataHexString]] of %%data%% padded on the **right**\n *  to %%length%% bytes.\n *\n *  If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n *  thrown.\n *\n *  This pads data the same as **bytes** are in Solidity\n *  (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n    return zeroPad(data, length, false);\n}\n//# sourceMappingURL=data.js.map/**\n *  All errors in ethers include properties to ensure they are both\n *  human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``).\n *\n *  The [[isError]] function can be used to check the error ``code`` and\n *  provide a type guard for the properties present on that error interface.\n *\n *  @_section: api/utils/errors:Errors  [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value, seen) {\n    if (value == null) {\n        return \"null\";\n    }\n    if (seen == null) {\n        seen = new Set();\n    }\n    if (typeof (value) === \"object\") {\n        if (seen.has(value)) {\n            return \"[Circular]\";\n        }\n        seen.add(value);\n    }\n    if (Array.isArray(value)) {\n        return \"[ \" + (value.map((v) => stringify(v, seen))).join(\", \") + \" ]\";\n    }\n    if (value instanceof Uint8Array) {\n        const HEX = \"0123456789abcdef\";\n        let result = \"0x\";\n        for (let i = 0; i < value.length; i++) {\n            result += HEX[value[i] >> 4];\n            result += HEX[value[i] & 0xf];\n        }\n        return result;\n    }\n    if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n        return stringify(value.toJSON(), seen);\n    }\n    switch (typeof (value)) {\n        case \"boolean\":\n        case \"number\":\n        case \"symbol\":\n            return value.toString();\n        case \"bigint\":\n            return BigInt(value).toString();\n        case \"string\":\n            return JSON.stringify(value);\n        case \"object\": {\n            const keys = Object.keys(value);\n            keys.sort();\n            return \"{ \" + keys.map((k) => `${stringify(k, seen)}: ${stringify(value[k], seen)}`).join(\", \") + \" }\";\n        }\n    }\n    return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n *  Returns true if the %%error%% matches an error thrown by ethers\n *  that matches the error %%code%%.\n *\n *  In TypeScript environments, this can be used to check that %%error%%\n *  matches an EthersError type, which means the expected properties will\n *  be set.\n *\n *  @See [ErrorCodes](api:ErrorCode)\n *  @example\n *    try {\n *      // code....\n *    } catch (e) {\n *      if (isError(e, \"CALL_EXCEPTION\")) {\n *          // The Type Guard has validated this object\n *          console.log(e.data);\n *      }\n *    }\n */\nexport function isError(error, code) {\n    return (error && error.code === code);\n}\n/**\n *  Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n    return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n *  Returns a new Error configured to the format ethers emits errors, with\n *  the %%message%%, [[api:ErrorCode]] %%code%% and additional properties\n *  for the corresponding EthersError.\n *\n *  Each error in ethers includes the version of ethers, a\n *  machine-readable [[ErrorCode]], and depending on %%code%%, additional\n *  required properties. The error message will also include the %%message%%,\n *  ethers version, %%code%% and all additional properties, serialized.\n */\nexport function makeError(message, code, info) {\n    let shortMessage = message;\n    {\n        const details = [];\n        if (info) {\n            if (\"message\" in info || \"code\" in info || \"name\" in info) {\n                throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n            }\n            for (const key in info) {\n                if (key === \"shortMessage\") {\n                    continue;\n                }\n                const value = (info[key]);\n                //                try {\n                details.push(key + \"=\" + stringify(value));\n                //                } catch (error: any) {\n                //                console.log(\"MMM\", error.message);\n                //                    details.push(key + \"=[could not serialize object]\");\n                //                }\n            }\n        }\n        details.push(`code=${code}`);\n        details.push(`version=${version}`);\n        if (details.length) {\n            message += \" (\" + details.join(\", \") + \")\";\n        }\n    }\n    let error;\n    switch (code) {\n        case \"INVALID_ARGUMENT\":\n            error = new TypeError(message);\n            break;\n        case \"NUMERIC_FAULT\":\n        case \"BUFFER_OVERRUN\":\n            error = new RangeError(message);\n            break;\n        default:\n            error = new Error(message);\n    }\n    defineProperties(error, { code });\n    if (info) {\n        Object.assign(error, info);\n    }\n    if (error.shortMessage == null) {\n        defineProperties(error, { shortMessage });\n    }\n    return error;\n}\n/**\n *  Throws an EthersError with %%message%%, %%code%% and additional error\n *  %%info%% when %%check%% is falsish..\n *\n *  @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n    if (!check) {\n        throw makeError(message, code, info);\n    }\n}\n/**\n *  A simple helper to simply ensuring provided arguments match expected\n *  constraints, throwing if not.\n *\n *  In TypeScript environments, the %%check%% has been asserted true, so\n *  any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n    assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n    if (message == null) {\n        message = \"\";\n    }\n    if (message) {\n        message = \": \" + message;\n    }\n    assert(count >= expectedCount, \"missing argument\" + message, \"MISSING_ARGUMENT\", {\n        count: count,\n        expectedCount: expectedCount\n    });\n    assert(count <= expectedCount, \"too many arguments\" + message, \"UNEXPECTED_ARGUMENT\", {\n        count: count,\n        expectedCount: expectedCount\n    });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n    try {\n        // General test for normalize\n        /* c8 ignore start */\n        if (\"test\".normalize(form) !== \"test\") {\n            throw new Error(\"bad\");\n        }\n        ;\n        /* c8 ignore stop */\n        if (form === \"NFD\") {\n            const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n            const expected = String.fromCharCode(0x65, 0x0301);\n            /* c8 ignore start */\n            if (check !== expected) {\n                throw new Error(\"broken\");\n            }\n            /* c8 ignore stop */\n        }\n        accum.push(form);\n    }\n    catch (error) { }\n    return accum;\n}, []);\n/**\n *  Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n    assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n        operation: \"String.prototype.normalize\", info: { form }\n    });\n}\n/**\n *  Many classes use file-scoped values to guard the constructor,\n *  making it effectively private. This facilitates that pattern\n *  by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n *  throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n    if (className == null) {\n        className = \"\";\n    }\n    if (givenGuard !== guard) {\n        let method = className, operation = \"new\";\n        if (className) {\n            method += \".\";\n            operation += \" \" + className;\n        }\n        assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n            operation\n        });\n    }\n}\n//# sourceMappingURL=errors.js.map/**\n *  Events allow for applications to use the observer pattern, which\n *  allows subscribing and publishing events, outside the normal\n *  execution paths.\n *\n *  @_section api/utils/events:Events  [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n *  When an [[EventEmitterable]] triggers a [[Listener]], the\n *  callback always ahas one additional argument passed, which is\n *  an **EventPayload**.\n */\nexport class EventPayload {\n    /**\n     *  The event filter.\n     */\n    filter;\n    /**\n     *  The **EventEmitterable**.\n     */\n    emitter;\n    #listener;\n    /**\n     *  Create a new **EventPayload** for %%emitter%% with\n     *  the %%listener%% and for %%filter%%.\n     */\n    constructor(emitter, listener, filter) {\n        this.#listener = listener;\n        defineProperties(this, { emitter, filter });\n    }\n    /**\n     *  Unregister the triggered listener for future events.\n     */\n    async removeListener() {\n        if (this.#listener == null) {\n            return;\n        }\n        await this.emitter.off(this.filter, this.#listener);\n    }\n}\n//# sourceMappingURL=events.js.map/**\n *  Fetching content from the web is environment-specific, so Ethers\n *  provides an abstraction that each environment can implement to provide\n *  this service.\n *\n *  On [Node.js](link-node), the ``http`` and ``https`` libs are used to\n *  create a request object, register event listeners and process data\n *  and populate the [[FetchResponse]].\n *\n *  In a browser, the [DOM fetch](link-js-fetch) is used, and the resulting\n *  ``Promise`` is waited on to retrieve the payload.\n *\n *  The [[FetchRequest]] is responsible for handling many common situations,\n *  such as redirects, server throttling, authentication, etc.\n *\n *  It also handles common gateways, such as IPFS and data URIs.\n *\n *  @_section api/utils/fetching:Fetching Web Content  [about-fetch]\n */\nimport { decodeBase64, encodeBase64 } from \"./base64.js\";\nimport { hexlify } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nimport { defineProperties } from \"./properties.js\";\nimport { toUtf8Bytes, toUtf8String } from \"./utf8.js\";\nimport { createGetUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet defaultGetUrlFunc = createGetUrl();\nconst reData = new RegExp(\"^data:([^;:]*)?(;base64)?,(.*)$\", \"i\");\nconst reIpfs = new RegExp(\"^ipfs:/\\/(ipfs/)?(.*)$\", \"i\");\n// If locked, new Gateways cannot be added\nlet locked = false;\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs\nasync function dataGatewayFunc(url, signal) {\n    try {\n        const match = url.match(reData);\n        if (!match) {\n            throw new Error(\"invalid data\");\n        }\n        return new FetchResponse(200, \"OK\", {\n            \"content-type\": (match[1] || \"text/plain\"),\n        }, (match[2] ? decodeBase64(match[3]) : unpercent(match[3])));\n    }\n    catch (error) {\n        return new FetchResponse(599, \"BAD REQUEST (invalid data: URI)\", {}, null, new FetchRequest(url));\n    }\n}\n/**\n *  Returns a [[FetchGatewayFunc]] for fetching content from a standard\n *  IPFS gateway hosted at %%baseUrl%%.\n */\nfunction getIpfsGatewayFunc(baseUrl) {\n    async function gatewayIpfs(url, signal) {\n        try {\n            const match = url.match(reIpfs);\n            if (!match) {\n                throw new Error(\"invalid link\");\n            }\n            return new FetchRequest(`${baseUrl}${match[2]}`);\n        }\n        catch (error) {\n            return new FetchResponse(599, \"BAD REQUEST (invalid IPFS URI)\", {}, null, new FetchRequest(url));\n        }\n    }\n    return gatewayIpfs;\n}\nconst Gateways = {\n    \"data\": dataGatewayFunc,\n    \"ipfs\": getIpfsGatewayFunc(\"https:/\\/gateway.ipfs.io/ipfs/\")\n};\nconst fetchSignals = new WeakMap();\n/**\n *  @_ignore\n */\nexport class FetchCancelSignal {\n    #listeners;\n    #cancelled;\n    constructor(request) {\n        this.#listeners = [];\n        this.#cancelled = false;\n        fetchSignals.set(request, () => {\n            if (this.#cancelled) {\n                return;\n            }\n            this.#cancelled = true;\n            for (const listener of this.#listeners) {\n                setTimeout(() => { listener(); }, 0);\n            }\n            this.#listeners = [];\n        });\n    }\n    addListener(listener) {\n        assert(!this.#cancelled, \"singal already cancelled\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"fetchCancelSignal.addCancelListener\"\n        });\n        this.#listeners.push(listener);\n    }\n    get cancelled() { return this.#cancelled; }\n    checkSignal() {\n        assert(!this.cancelled, \"cancelled\", \"CANCELLED\", {});\n    }\n}\n// Check the signal, throwing if it is cancelled\nfunction checkSignal(signal) {\n    if (signal == null) {\n        throw new Error(\"missing signal; should not happen\");\n    }\n    signal.checkSignal();\n    return signal;\n}\n/**\n *  Represents a request for a resource using a URI.\n *\n *  By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``,\n *  and ``IPFS:``.\n *\n *  Additional schemes can be added globally using [[registerGateway]].\n *\n *  @example:\n *    req = new FetchRequest(\"https://www.ricmoo.com\")\n *    resp = await req.send()\n *    resp.body.length\n *    //_result:\n */\nexport class FetchRequest {\n    #allowInsecure;\n    #gzip;\n    #headers;\n    #method;\n    #timeout;\n    #url;\n    #body;\n    #bodyType;\n    #creds;\n    // Hooks\n    #preflight;\n    #process;\n    #retry;\n    #signal;\n    #throttle;\n    #getUrlFunc;\n    /**\n     *  The fetch URL to request.\n     */\n    get url() { return this.#url; }\n    set url(url) {\n        this.#url = String(url);\n    }\n    /**\n     *  The fetch body, if any, to send as the request body. //(default: null)//\n     *\n     *  When setting a body, the intrinsic ``Content-Type`` is automatically\n     *  set and will be used if **not overridden** by setting a custom\n     *  header.\n     *\n     *  If %%body%% is null, the body is cleared (along with the\n     *  intrinsic ``Content-Type``).\n     *\n     *  If %%body%% is a string, the intrinsic ``Content-Type`` is set to\n     *  ``text/plain``.\n     *\n     *  If %%body%% is a Uint8Array, the intrinsic ``Content-Type`` is set to\n     *  ``application/octet-stream``.\n     *\n     *  If %%body%% is any other object, the intrinsic ``Content-Type`` is\n     *  set to ``application/json``.\n     */\n    get body() {\n        if (this.#body == null) {\n            return null;\n        }\n        return new Uint8Array(this.#body);\n    }\n    set body(body) {\n        if (body == null) {\n            this.#body = undefined;\n            this.#bodyType = undefined;\n        }\n        else if (typeof (body) === \"string\") {\n            this.#body = toUtf8Bytes(body);\n            this.#bodyType = \"text/plain\";\n        }\n        else if (body instanceof Uint8Array) {\n            this.#body = body;\n            this.#bodyType = \"application/octet-stream\";\n        }\n        else if (typeof (body) === \"object\") {\n            this.#body = toUtf8Bytes(JSON.stringify(body));\n            this.#bodyType = \"application/json\";\n        }\n        else {\n            throw new Error(\"invalid body\");\n        }\n    }\n    /**\n     *  Returns true if the request has a body.\n     */\n    hasBody() {\n        return (this.#body != null);\n    }\n    /**\n     *  The HTTP method to use when requesting the URI. If no method\n     *  has been explicitly set, then ``GET`` is used if the body is\n     *  null and ``POST`` otherwise.\n     */\n    get method() {\n        if (this.#method) {\n            return this.#method;\n        }\n        if (this.hasBody()) {\n            return \"POST\";\n        }\n        return \"GET\";\n    }\n    set method(method) {\n        if (method == null) {\n            method = \"\";\n        }\n        this.#method = String(method).toUpperCase();\n    }\n    /**\n     *  The headers that will be used when requesting the URI. All\n     *  keys are lower-case.\n     *\n     *  This object is a copy, so any changes will **NOT** be reflected\n     *  in the ``FetchRequest``.\n     *\n     *  To set a header entry, use the ``setHeader`` method.\n     */\n    get headers() {\n        const headers = Object.assign({}, this.#headers);\n        if (this.#creds) {\n            headers[\"authorization\"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`;\n        }\n        ;\n        if (this.allowGzip) {\n            headers[\"accept-encoding\"] = \"gzip\";\n        }\n        if (headers[\"content-type\"] == null && this.#bodyType) {\n            headers[\"content-type\"] = this.#bodyType;\n        }\n        if (this.body) {\n            headers[\"content-length\"] = String(this.body.length);\n        }\n        return headers;\n    }\n    /**\n     *  Get the header for %%key%%, ignoring case.\n     */\n    getHeader(key) {\n        return this.headers[key.toLowerCase()];\n    }\n    /**\n     *  Set the header for %%key%% to %%value%%. All values are coerced\n     *  to a string.\n     */\n    setHeader(key, value) {\n        this.#headers[String(key).toLowerCase()] = String(value);\n    }\n    /**\n     *  Clear all headers, resetting all intrinsic headers.\n     */\n    clearHeaders() {\n        this.#headers = {};\n    }\n    [Symbol.iterator]() {\n        const headers = this.headers;\n        const keys = Object.keys(headers);\n        let index = 0;\n        return {\n            next: () => {\n                if (index < keys.length) {\n                    const key = keys[index++];\n                    return {\n                        value: [key, headers[key]], done: false\n                    };\n                }\n                return { value: undefined, done: true };\n            }\n        };\n    }\n    /**\n     *  The value that will be sent for the ``Authorization`` header.\n     *\n     *  To set the credentials, use the ``setCredentials`` method.\n     */\n    get credentials() {\n        return this.#creds || null;\n    }\n    /**\n     *  Sets an ``Authorization`` for %%username%% with %%password%%.\n     */\n    setCredentials(username, password) {\n        assertArgument(!username.match(/:/), \"invalid basic authentication username\", \"username\", \"[REDACTED]\");\n        this.#creds = `${username}:${password}`;\n    }\n    /**\n     *  Enable and request gzip-encoded responses. The response will\n     *  automatically be decompressed. //(default: true)//\n     */\n    get allowGzip() {\n        return this.#gzip;\n    }\n    set allowGzip(value) {\n        this.#gzip = !!value;\n    }\n    /**\n     *  Allow ``Authentication`` credentials to be sent over insecure\n     *  channels. //(default: false)//\n     */\n    get allowInsecureAuthentication() {\n        return !!this.#allowInsecure;\n    }\n    set allowInsecureAuthentication(value) {\n        this.#allowInsecure = !!value;\n    }\n    /**\n     *  The timeout (in milliseconds) to wait for a complete response.\n     *  //(default: 5 minutes)//\n     */\n    get timeout() { return this.#timeout; }\n    set timeout(timeout) {\n        assertArgument(timeout >= 0, \"timeout must be non-zero\", \"timeout\", timeout);\n        this.#timeout = timeout;\n    }\n    /**\n     *  This function is called prior to each request, for example\n     *  during a redirection or retry in case of server throttling.\n     *\n     *  This offers an opportunity to populate headers or update\n     *  content before sending a request.\n     */\n    get preflightFunc() {\n        return this.#preflight || null;\n    }\n    set preflightFunc(preflight) {\n        this.#preflight = preflight;\n    }\n    /**\n     *  This function is called after each response, offering an\n     *  opportunity to provide client-level throttling or updating\n     *  response data.\n     *\n     *  Any error thrown in this causes the ``send()`` to throw.\n     *\n     *  To schedule a retry attempt (assuming the maximum retry limit\n     *  has not been reached), use [[response.throwThrottleError]].\n     */\n    get processFunc() {\n        return this.#process || null;\n    }\n    set processFunc(process) {\n        this.#process = process;\n    }\n    /**\n     *  This function is called on each retry attempt.\n     */\n    get retryFunc() {\n        return this.#retry || null;\n    }\n    set retryFunc(retry) {\n        this.#retry = retry;\n    }\n    /**\n     *  This function is called to fetch content from HTTP and\n     *  HTTPS URLs and is platform specific (e.g. nodejs vs\n     *  browsers).\n     *\n     *  This is by default the currently registered global getUrl\n     *  function, which can be changed using [[registerGetUrl]].\n     *  If this has been set, setting is to ``null`` will cause\n     *  this FetchRequest (and any future clones) to revert back to\n     *  using the currently registered global getUrl function.\n     *\n     *  Setting this is generally not necessary, but may be useful\n     *  for developers that wish to intercept requests or to\n     *  configurege a proxy or other agent.\n     */\n    get getUrlFunc() {\n        return this.#getUrlFunc || defaultGetUrlFunc;\n    }\n    set getUrlFunc(value) {\n        this.#getUrlFunc = value;\n    }\n    /**\n     *  Create a new FetchRequest instance with default values.\n     *\n     *  Once created, each property may be set before issuing a\n     *  ``.send()`` to make the request.\n     */\n    constructor(url) {\n        this.#url = String(url);\n        this.#allowInsecure = false;\n        this.#gzip = true;\n        this.#headers = {};\n        this.#method = \"\";\n        this.#timeout = 300000;\n        this.#throttle = {\n            slotInterval: SLOT_INTERVAL,\n            maxAttempts: MAX_ATTEMPTS\n        };\n        this.#getUrlFunc = null;\n    }\n    toString() {\n        return `<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#body ? hexlify(this.#body) : \"null\"}>`;\n    }\n    /**\n     *  Update the throttle parameters used to determine maximum\n     *  attempts and exponential-backoff properties.\n     */\n    setThrottleParams(params) {\n        if (params.slotInterval != null) {\n            this.#throttle.slotInterval = params.slotInterval;\n        }\n        if (params.maxAttempts != null) {\n            this.#throttle.maxAttempts = params.maxAttempts;\n        }\n    }\n    async #send(attempt, expires, delay, _request, _response) {\n        if (attempt >= this.#throttle.maxAttempts) {\n            return _response.makeServerError(\"exceeded maximum retry limit\");\n        }\n        assert(getTime() <= expires, \"timeout\", \"TIMEOUT\", {\n            operation: \"request.send\", reason: \"timeout\", request: _request\n        });\n        if (delay > 0) {\n            await wait(delay);\n        }\n        let req = this.clone();\n        const scheme = (req.url.split(\":\")[0] || \"\").toLowerCase();\n        // Process any Gateways\n        if (scheme in Gateways) {\n            const result = await Gateways[scheme](req.url, checkSignal(_request.#signal));\n            if (result instanceof FetchResponse) {\n                let response = result;\n                if (this.processFunc) {\n                    checkSignal(_request.#signal);\n                    try {\n                        response = await this.processFunc(req, response);\n                    }\n                    catch (error) {\n                        // Something went wrong during processing; throw a 5xx server error\n                        if (error.throttle == null || typeof (error.stall) !== \"number\") {\n                            response.makeServerError(\"error in post-processing function\", error).assertOk();\n                        }\n                        // Ignore throttling\n                    }\n                }\n                return response;\n            }\n            req = result;\n        }\n        // We have a preflight function; update the request\n        if (this.preflightFunc) {\n            req = await this.preflightFunc(req);\n        }\n        const resp = await this.getUrlFunc(req, checkSignal(_request.#signal));\n        let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n        if (response.statusCode === 301 || response.statusCode === 302) {\n            // Redirect\n            try {\n                const location = response.headers.location || \"\";\n                return req.redirect(location).#send(attempt + 1, expires, 0, _request, response);\n            }\n            catch (error) { }\n            // Things won't get any better on another attempt; abort\n            return response;\n        }\n        else if (response.statusCode === 429) {\n            // Throttle\n            if (this.retryFunc == null || (await this.retryFunc(req, response, attempt))) {\n                const retryAfter = response.headers[\"retry-after\"];\n                let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));\n                if (typeof (retryAfter) === \"string\" && retryAfter.match(/^[1-9][0-9]*$/)) {\n                    delay = parseInt(retryAfter);\n                }\n                return req.clone().#send(attempt + 1, expires, delay, _request, response);\n            }\n        }\n        if (this.processFunc) {\n            checkSignal(_request.#signal);\n            try {\n                response = await this.processFunc(req, response);\n            }\n            catch (error) {\n                // Something went wrong during processing; throw a 5xx server error\n                if (error.throttle == null || typeof (error.stall) !== \"number\") {\n                    response.makeServerError(\"error in post-processing function\", error).assertOk();\n                }\n                // Throttle\n                let delay = this.#throttle.slotInterval * Math.trunc(Math.random() * Math.pow(2, attempt));\n                ;\n                if (error.stall >= 0) {\n                    delay = error.stall;\n                }\n                return req.clone().#send(attempt + 1, expires, delay, _request, response);\n            }\n        }\n        return response;\n    }\n    /**\n     *  Resolves to the response by sending the request.\n     */\n    send() {\n        assert(this.#signal == null, \"request already sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.send\" });\n        this.#signal = new FetchCancelSignal(this);\n        return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, \"\", {}, null, this));\n    }\n    /**\n     *  Cancels the inflight response, causing a ``CANCELLED``\n     *  error to be rejected from the [[send]].\n     */\n    cancel() {\n        assert(this.#signal != null, \"request has not been sent\", \"UNSUPPORTED_OPERATION\", { operation: \"fetchRequest.cancel\" });\n        const signal = fetchSignals.get(this);\n        if (!signal) {\n            throw new Error(\"missing signal; should not happen\");\n        }\n        signal();\n    }\n    /**\n     *  Returns a new [[FetchRequest]] that represents the redirection\n     *  to %%location%%.\n     */\n    redirect(location) {\n        // Redirection; for now we only support absolute locations\n        const current = this.url.split(\":\")[0].toLowerCase();\n        const target = location.split(\":\")[0].toLowerCase();\n        // Don't allow redirecting:\n        // - non-GET requests\n        // - downgrading the security (e.g. https => http)\n        // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n        assert(this.method === \"GET\" && (current !== \"https\" || target !== \"http\") && location.match(/^https?:/), `unsupported redirect`, \"UNSUPPORTED_OPERATION\", {\n            operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`\n        });\n        // Create a copy of this request, with a new URL\n        const req = new FetchRequest(location);\n        req.method = \"GET\";\n        req.allowGzip = this.allowGzip;\n        req.timeout = this.timeout;\n        req.#headers = Object.assign({}, this.#headers);\n        if (this.#body) {\n            req.#body = new Uint8Array(this.#body);\n        }\n        req.#bodyType = this.#bodyType;\n        // Do not forward credentials unless on the same domain; only absolute\n        //req.allowInsecure = false;\n        // paths are currently supported; may want a way to specify to forward?\n        //setStore(req.#props, \"creds\", getStore(this.#pros, \"creds\"));\n        return req;\n    }\n    /**\n     *  Create a new copy of this request.\n     */\n    clone() {\n        const clone = new FetchRequest(this.url);\n        // Preserve \"default method\" (i.e. null)\n        clone.#method = this.#method;\n        // Preserve \"default body\" with type, copying the Uint8Array is present\n        if (this.#body) {\n            clone.#body = this.#body;\n        }\n        clone.#bodyType = this.#bodyType;\n        // Preserve \"default headers\"\n        clone.#headers = Object.assign({}, this.#headers);\n        // Credentials is readonly, so we copy internally\n        clone.#creds = this.#creds;\n        if (this.allowGzip) {\n            clone.allowGzip = true;\n        }\n        clone.timeout = this.timeout;\n        if (this.allowInsecureAuthentication) {\n            clone.allowInsecureAuthentication = true;\n        }\n        clone.#preflight = this.#preflight;\n        clone.#process = this.#process;\n        clone.#retry = this.#retry;\n        clone.#throttle = Object.assign({}, this.#throttle);\n        clone.#getUrlFunc = this.#getUrlFunc;\n        return clone;\n    }\n    /**\n     *  Locks all static configuration for gateways and FetchGetUrlFunc\n     *  registration.\n     */\n    static lockConfig() {\n        locked = true;\n    }\n    /**\n     *  Get the current Gateway function for %%scheme%%.\n     */\n    static getGateway(scheme) {\n        return Gateways[scheme.toLowerCase()] || null;\n    }\n    /**\n     *  Use the %%func%% when fetching URIs using %%scheme%%.\n     *\n     *  This method affects all requests globally.\n     *\n     *  If [[lockConfig]] has been called, no change is made and this\n     *  throws.\n     */\n    static registerGateway(scheme, func) {\n        scheme = scheme.toLowerCase();\n        if (scheme === \"http\" || scheme === \"https\") {\n            throw new Error(`cannot intercept ${scheme}; use registerGetUrl`);\n        }\n        if (locked) {\n            throw new Error(\"gateways locked\");\n        }\n        Gateways[scheme] = func;\n    }\n    /**\n     *  Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests.\n     *\n     *  This method affects all requests globally.\n     *\n     *  If [[lockConfig]] has been called, no change is made and this\n     *  throws.\n     */\n    static registerGetUrl(getUrl) {\n        if (locked) {\n            throw new Error(\"gateways locked\");\n        }\n        defaultGetUrlFunc = getUrl;\n    }\n    /**\n     *  Creates a getUrl function that fetches content from HTTP and\n     *  HTTPS URLs.\n     *\n     *  The available %%options%% are dependent on the platform\n     *  implementation of the default getUrl function.\n     *\n     *  This is not generally something that is needed, but is useful\n     *  when trying to customize simple behaviour when fetching HTTP\n     *  content.\n     */\n    static createGetUrlFunc(options) {\n        return createGetUrl(options);\n    }\n    /**\n     *  Creates a function that can \"fetch\" data URIs.\n     *\n     *  Note that this is automatically done internally to support\n     *  data URIs, so it is not necessary to register it.\n     *\n     *  This is not generally something that is needed, but may\n     *  be useful in a wrapper to perfom custom data URI functionality.\n     */\n    static createDataGateway() {\n        return dataGatewayFunc;\n    }\n    /**\n     *  Creates a function that will fetch IPFS (unvalidated) from\n     *  a custom gateway baseUrl.\n     *\n     *  The default IPFS gateway used internally is\n     *  ``\"https:/\\/gateway.ipfs.io/ipfs/\"``.\n     */\n    static createIpfsGatewayFunc(baseUrl) {\n        return getIpfsGatewayFunc(baseUrl);\n    }\n}\n;\n/**\n *  The response for a FetchRequest.\n */\nexport class FetchResponse {\n    #statusCode;\n    #statusMessage;\n    #headers;\n    #body;\n    #request;\n    #error;\n    toString() {\n        return `<FetchResponse status=${this.statusCode} body=${this.#body ? hexlify(this.#body) : \"null\"}>`;\n    }\n    /**\n     *  The response status code.\n     */\n    get statusCode() { return this.#statusCode; }\n    /**\n     *  The response status message.\n     */\n    get statusMessage() { return this.#statusMessage; }\n    /**\n     *  The response headers. All keys are lower-case.\n     */\n    get headers() { return Object.assign({}, this.#headers); }\n    /**\n     *  The response body, or ``null`` if there was no body.\n     */\n    get body() {\n        return (this.#body == null) ? null : new Uint8Array(this.#body);\n    }\n    /**\n     *  The response body as a UTF-8 encoded string, or the empty\n     *  string (i.e. ``\"\"``) if there was no body.\n     *\n     *  An error is thrown if the body is invalid UTF-8 data.\n     */\n    get bodyText() {\n        try {\n            return (this.#body == null) ? \"\" : toUtf8String(this.#body);\n        }\n        catch (error) {\n            assert(false, \"response body is not valid UTF-8 data\", \"UNSUPPORTED_OPERATION\", {\n                operation: \"bodyText\", info: { response: this }\n            });\n        }\n    }\n    /**\n     *  The response body, decoded as JSON.\n     *\n     *  An error is thrown if the body is invalid JSON-encoded data\n     *  or if there was no body.\n     */\n    get bodyJson() {\n        try {\n            return JSON.parse(this.bodyText);\n        }\n        catch (error) {\n            assert(false, \"response body is not valid JSON\", \"UNSUPPORTED_OPERATION\", {\n                operation: \"bodyJson\", info: { response: this }\n            });\n        }\n    }\n    [Symbol.iterator]() {\n        const headers = this.headers;\n        const keys = Object.keys(headers);\n        let index = 0;\n        return {\n            next: () => {\n                if (index < keys.length) {\n                    const key = keys[index++];\n                    return {\n                        value: [key, headers[key]], done: false\n                    };\n                }\n                return { value: undefined, done: true };\n            }\n        };\n    }\n    constructor(statusCode, statusMessage, headers, body, request) {\n        this.#statusCode = statusCode;\n        this.#statusMessage = statusMessage;\n        this.#headers = Object.keys(headers).reduce((accum, k) => {\n            accum[k.toLowerCase()] = String(headers[k]);\n            return accum;\n        }, {});\n        this.#body = ((body == null) ? null : new Uint8Array(body));\n        this.#request = (request || null);\n        this.#error = { message: \"\" };\n    }\n    /**\n     *  Return a Response with matching headers and body, but with\n     *  an error status code (i.e. 599) and %%message%% with an\n     *  optional %%error%%.\n     */\n    makeServerError(message, error) {\n        let statusMessage;\n        if (!message) {\n            message = `${this.statusCode} ${this.statusMessage}`;\n            statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`;\n        }\n        else {\n            statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`;\n        }\n        const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined);\n        response.#error = { message, error };\n        return response;\n    }\n    /**\n     *  If called within a [request.processFunc](FetchRequest-processFunc)\n     *  call, causes the request to retry as if throttled for %%stall%%\n     *  milliseconds.\n     */\n    throwThrottleError(message, stall) {\n        if (stall == null) {\n            stall = -1;\n        }\n        else {\n            assertArgument(Number.isInteger(stall) && stall >= 0, \"invalid stall timeout\", \"stall\", stall);\n        }\n        const error = new Error(message || \"throttling requests\");\n        defineProperties(error, { stall, throttle: true });\n        throw error;\n    }\n    /**\n     *  Get the header value for %%key%%, ignoring case.\n     */\n    getHeader(key) {\n        return this.headers[key.toLowerCase()];\n    }\n    /**\n     *  Returns true if the response has a body.\n     */\n    hasBody() {\n        return (this.#body != null);\n    }\n    /**\n     *  The request made for this response.\n     */\n    get request() { return this.#request; }\n    /**\n     *  Returns true if this response was a success statusCode.\n     */\n    ok() {\n        return (this.#error.message === \"\" && this.statusCode >= 200 && this.statusCode < 300);\n    }\n    /**\n     *  Throws a ``SERVER_ERROR`` if this response is not ok.\n     */\n    assertOk() {\n        if (this.ok()) {\n            return;\n        }\n        let { message, error } = this.#error;\n        if (message === \"\") {\n            message = `server response ${this.statusCode} ${this.statusMessage}`;\n        }\n        let requestUrl = null;\n        if (this.request) {\n            requestUrl = this.request.url;\n        }\n        let responseBody = null;\n        try {\n            if (this.#body) {\n                responseBody = toUtf8String(this.#body);\n            }\n        }\n        catch (e) { }\n        assert(false, message, \"SERVER_ERROR\", {\n            request: (this.request || \"unknown request\"), response: this, error,\n            info: {\n                requestUrl, responseBody,\n                responseStatus: `${this.statusCode} ${this.statusMessage}`\n            }\n        });\n    }\n}\nfunction getTime() { return (new Date()).getTime(); }\nfunction unpercent(value) {\n    return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => {\n        return String.fromCharCode(parseInt(code, 16));\n    }));\n}\nfunction wait(delay) {\n    return new Promise((resolve) => setTimeout(resolve, delay));\n}\n//# sourceMappingURL=fetch.js.map/**\n *  The **FixedNumber** class permits using values with decimal places,\n *  using fixed-pont math.\n *\n *  Fixed-point math is still based on integers under-the-hood, but uses an\n *  internal offset to store fractional components below, and each operation\n *  corrects for this after each operation.\n *\n *  @_section: api/utils/fixed-point-math:Fixed-Point Maths  [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, getNumber, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n    Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n    let result = Zeros;\n    while (result.length < decimals) {\n        result += result;\n    }\n    return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n    const width = BigInt(format.width);\n    if (format.signed) {\n        const limit = (BN_1 << (width - BN_1));\n        assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n            operation: safeOp, fault: \"overflow\", value: val\n        });\n        if (val > BN_0) {\n            val = fromTwos(mask(val, width), width);\n        }\n        else {\n            val = -fromTwos(mask(-val, width), width);\n        }\n    }\n    else {\n        const limit = (BN_1 << width);\n        assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n            operation: safeOp, fault: \"overflow\", value: val\n        });\n        val = (((val % limit) + limit) % limit) & (limit - BN_1);\n    }\n    return val;\n}\nfunction getFormat(value) {\n    if (typeof (value) === \"number\") {\n        value = `fixed128x${value}`;\n    }\n    let signed = true;\n    let width = 128;\n    let decimals = 18;\n    if (typeof (value) === \"string\") {\n        // Parse the format string\n        if (value === \"fixed\") {\n            // defaults...\n        }\n        else if (value === \"ufixed\") {\n            signed = false;\n        }\n        else {\n            const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n            assertArgument(match, \"invalid fixed format\", \"format\", value);\n            signed = (match[1] !== \"u\");\n            width = parseInt(match[2]);\n            decimals = parseInt(match[3]);\n        }\n    }\n    else if (value) {\n        // Extract the values from the object\n        const v = value;\n        const check = (key, type, defaultValue) => {\n            if (v[key] == null) {\n                return defaultValue;\n            }\n            assertArgument(typeof (v[key]) === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n            return v[key];\n        };\n        signed = check(\"signed\", \"boolean\", signed);\n        width = check(\"width\", \"number\", width);\n        decimals = check(\"decimals\", \"number\", decimals);\n    }\n    assertArgument((width % 8) === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n    assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n    const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n    return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n    let negative = \"\";\n    if (val < BN_0) {\n        negative = \"-\";\n        val *= BN_N1;\n    }\n    let str = val.toString();\n    // No decimal point for whole values\n    if (decimals === 0) {\n        return (negative + str);\n    }\n    // Pad out to the whole component (including a whole digit)\n    while (str.length <= decimals) {\n        str = Zeros + str;\n    }\n    // Insert the decimal point\n    const index = str.length - decimals;\n    str = str.substring(0, index) + \".\" + str.substring(index);\n    // Trim the whole component (leaving at least one 0)\n    while (str[0] === \"0\" && str[1] !== \".\") {\n        str = str.substring(1);\n    }\n    // Trim the decimal component (leaving at least one 0)\n    while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n        str = str.substring(0, str.length - 1);\n    }\n    return (negative + str);\n}\n/**\n *  A FixedNumber represents a value over its [[FixedFormat]]\n *  arithmetic field.\n *\n *  A FixedNumber can be used to perform math, losslessly, on\n *  values which have decmial places.\n *\n *  A FixedNumber has a fixed bit-width to store values in, and stores all\n *  values internally by multiplying the value by 10 raised to the power of\n *  %%decimals%%.\n *\n *  If operations are performed that cause a value to grow too high (close to\n *  positive infinity) or too low (close to negative infinity), the value\n *  is said to //overflow//.\n *\n *  For example, an 8-bit signed value, with 0 decimals may only be within\n *  the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n *  ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n *  Many operation have a normal and //unsafe// variant. The normal variant\n *  will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n *  variant will silently allow overflow, corrupting its value value.\n *\n *  If operations are performed that cause a value to become too small\n *  (close to zero), the value loses precison and is said to //underflow//.\n *\n *  For example, a value with 1 decimal place may store a number as small\n *  as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n *  into 1 decimal place, so underflow occurs which means precision is lost\n *  and the value becomes ``0``.\n *\n *  Some operations have a normal and //signalling// variant. The normal\n *  variant will silently ignore underflow, while the //signalling// variant\n *  will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n    /**\n     *  The specific fixed-point arithmetic field for this value.\n     */\n    format;\n    #format;\n    // The actual value (accounting for decimals)\n    #val;\n    // A base-10 value to multiple values by to maintain the magnitude\n    #tens;\n    /**\n     *  This is a property so console.log shows a human-meaningful value.\n     *\n     *  @private\n     */\n    _value;\n    // Use this when changing this file to get some typing info,\n    // but then switch to any to mask the internal type\n    //constructor(guard: any, value: bigint, format: _FixedFormat) {\n    /**\n     *  @private\n     */\n    constructor(guard, value, format) {\n        assertPrivate(guard, _guard, \"FixedNumber\");\n        this.#val = value;\n        this.#format = format;\n        const _value = toString(value, format.decimals);\n        defineProperties(this, { format: format.name, _value });\n        this.#tens = getTens(format.decimals);\n    }\n    /**\n     *  If true, negative values are permitted, otherwise only\n     *  positive values and zero are allowed.\n     */\n    get signed() { return this.#format.signed; }\n    /**\n     *  The number of bits available to store the value.\n     */\n    get width() { return this.#format.width; }\n    /**\n     *  The number of decimal places in the fixed-point arithment field.\n     */\n    get decimals() { return this.#format.decimals; }\n    /**\n     *  The value as an integer, based on the smallest unit the\n     *  [[decimals]] allow.\n     */\n    get value() { return this.#val; }\n    #checkFormat(other) {\n        assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n    }\n    #checkValue(val, safeOp) {\n        /*\n                const width = BigInt(this.width);\n                if (this.signed) {\n                    const limit = (BN_1 << (width - BN_1));\n                    assert(safeOp == null || (val >= -limit  && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n                        operation: <string>safeOp, fault: \"overflow\", value: val\n                    });\n        \n                    if (val > BN_0) {\n                        val = fromTwos(mask(val, width), width);\n                    } else {\n                        val = -fromTwos(mask(-val, width), width);\n                    }\n        \n                } else {\n                    const masked = mask(val, width);\n                    assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n                        operation: <string>safeOp, fault: \"overflow\", value: val\n                    });\n                    val = masked;\n                }\n        */\n        val = checkValue(val, this.#format, safeOp);\n        return new FixedNumber(_guard, val, this.#format);\n    }\n    #add(o, safeOp) {\n        this.#checkFormat(o);\n        return this.#checkValue(this.#val + o.#val, safeOp);\n    }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%this%% added\n     *  to %%other%%, ignoring overflow.\n     */\n    addUnsafe(other) { return this.#add(other); }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%this%% added\n     *  to %%other%%. A [[NumericFaultError]] is thrown if overflow\n     *  occurs.\n     */\n    add(other) { return this.#add(other, \"add\"); }\n    #sub(o, safeOp) {\n        this.#checkFormat(o);\n        return this.#checkValue(this.#val - o.#val, safeOp);\n    }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n     *  from %%this%%, ignoring overflow.\n     */\n    subUnsafe(other) { return this.#sub(other); }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n     *  from %%this%%. A [[NumericFaultError]] is thrown if overflow\n     *  occurs.\n     */\n    sub(other) { return this.#sub(other, \"sub\"); }\n    #mul(o, safeOp) {\n        this.#checkFormat(o);\n        return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n    }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n     *  by %%other%%, ignoring overflow and underflow (precision loss).\n     */\n    mulUnsafe(other) { return this.#mul(other); }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n     *  by %%other%%. A [[NumericFaultError]] is thrown if overflow\n     *  occurs.\n     */\n    mul(other) { return this.#mul(other, \"mul\"); }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n     *  by %%other%%. A [[NumericFaultError]] is thrown if overflow\n     *  occurs or if underflow (precision loss) occurs.\n     */\n    mulSignal(other) {\n        this.#checkFormat(other);\n        const value = this.#val * other.#val;\n        assert((value % this.#tens) === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n            operation: \"mulSignal\", fault: \"underflow\", value: this\n        });\n        return this.#checkValue(value / this.#tens, \"mulSignal\");\n    }\n    #div(o, safeOp) {\n        assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n            operation: \"div\", fault: \"divide-by-zero\", value: this\n        });\n        this.#checkFormat(o);\n        return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n    }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%this%% divided\n     *  by %%other%%, ignoring underflow (precision loss). A\n     *  [[NumericFaultError]] is thrown if overflow occurs.\n     */\n    divUnsafe(other) { return this.#div(other); }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%this%% divided\n     *  by %%other%%, ignoring underflow (precision loss). A\n     *  [[NumericFaultError]] is thrown if overflow occurs.\n     */\n    div(other) { return this.#div(other, \"div\"); }\n    /**\n     *  Returns a new [[FixedNumber]] with the result of %%this%% divided\n     *  by %%other%%. A [[NumericFaultError]] is thrown if underflow\n     *  (precision loss) occurs.\n     */\n    divSignal(other) {\n        assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n            operation: \"div\", fault: \"divide-by-zero\", value: this\n        });\n        this.#checkFormat(other);\n        const value = (this.#val * this.#tens);\n        assert((value % other.#val) === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n            operation: \"divSignal\", fault: \"underflow\", value: this\n        });\n        return this.#checkValue(value / other.#val, \"divSignal\");\n    }\n    /**\n     *  Returns a comparison result between %%this%% and %%other%%.\n     *\n     *  This is suitable for use in sorting, where ``-1`` implies %%this%%\n     *  is smaller, ``1`` implies %%this%% is larger and ``0`` implies\n     *  both are equal.\n     */\n    cmp(other) {\n        let a = this.value, b = other.value;\n        // Coerce a and b to the same magnitude\n        const delta = this.decimals - other.decimals;\n        if (delta > 0) {\n            b *= getTens(delta);\n        }\n        else if (delta < 0) {\n            a *= getTens(-delta);\n        }\n        // Comnpare\n        if (a < b) {\n            return -1;\n        }\n        if (a > b) {\n            return 1;\n        }\n        return 0;\n    }\n    /**\n     *  Returns true if %%other%% is equal to %%this%%.\n     */\n    eq(other) { return this.cmp(other) === 0; }\n    /**\n     *  Returns true if %%other%% is less than to %%this%%.\n     */\n    lt(other) { return this.cmp(other) < 0; }\n    /**\n     *  Returns true if %%other%% is less than or equal to %%this%%.\n     */\n    lte(other) { return this.cmp(other) <= 0; }\n    /**\n     *  Returns true if %%other%% is greater than to %%this%%.\n     */\n    gt(other) { return this.cmp(other) > 0; }\n    /**\n     *  Returns true if %%other%% is greater than or equal to %%this%%.\n     */\n    gte(other) { return this.cmp(other) >= 0; }\n    /**\n     *  Returns a new [[FixedNumber]] which is the largest **integer**\n     *  that is less than or equal to %%this%%.\n     *\n     *  The decimal component of the result will always be ``0``.\n     */\n    floor() {\n        let val = this.#val;\n        if (this.#val < BN_0) {\n            val -= this.#tens - BN_1;\n        }\n        val = (this.#val / this.#tens) * this.#tens;\n        return this.#checkValue(val, \"floor\");\n    }\n    /**\n     *  Returns a new [[FixedNumber]] which is the smallest **integer**\n     *  that is greater than or equal to %%this%%.\n     *\n     *  The decimal component of the result will always be ``0``.\n     */\n    ceiling() {\n        let val = this.#val;\n        if (this.#val > BN_0) {\n            val += this.#tens - BN_1;\n        }\n        val = (this.#val / this.#tens) * this.#tens;\n        return this.#checkValue(val, \"ceiling\");\n    }\n    /**\n     *  Returns a new [[FixedNumber]] with the decimal component\n     *  rounded up on ties at %%decimals%% places.\n     */\n    round(decimals) {\n        if (decimals == null) {\n            decimals = 0;\n        }\n        // Not enough precision to not already be rounded\n        if (decimals >= this.decimals) {\n            return this;\n        }\n        const delta = this.decimals - decimals;\n        const bump = BN_5 * getTens(delta - 1);\n        let value = this.value + bump;\n        const tens = getTens(delta);\n        value = (value / tens) * tens;\n        checkValue(value, this.#format, \"round\");\n        return new FixedNumber(_guard, value, this.#format);\n    }\n    /**\n     *  Returns true if %%this%% is equal to ``0``.\n     */\n    isZero() { return (this.#val === BN_0); }\n    /**\n     *  Returns true if %%this%% is less than ``0``.\n     */\n    isNegative() { return (this.#val < BN_0); }\n    /**\n     *  Returns the string representation of %%this%%.\n     */\n    toString() { return this._value; }\n    /**\n     *  Returns a float approximation.\n     *\n     *  Due to IEEE 754 precission (or lack thereof), this function\n     *  can only return an approximation and most values will contain\n     *  rounding errors.\n     */\n    toUnsafeFloat() { return parseFloat(this.toString()); }\n    /**\n     *  Return a new [[FixedNumber]] with the same value but has had\n     *  its field set to %%format%%.\n     *\n     *  This will throw if the value cannot fit into %%format%%.\n     */\n    toFormat(format) {\n        return FixedNumber.fromString(this.toString(), format);\n    }\n    /**\n     *  Creates a new [[FixedNumber]] for %%value%% divided by\n     *  %%decimal%% places with %%format%%.\n     *\n     *  This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n     *  for %%decimals%%) cannot fit in %%format%%, either due to overflow\n     *  or underflow (precision loss).\n     */\n    static fromValue(_value, _decimals, _format) {\n        const decimals = (_decimals == null) ? 0 : getNumber(_decimals);\n        const format = getFormat(_format);\n        let value = getBigInt(_value, \"value\");\n        const delta = decimals - format.decimals;\n        if (delta > 0) {\n            const tens = getTens(delta);\n            assert((value % tens) === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n                operation: \"fromValue\", fault: \"underflow\", value: _value\n            });\n            value /= tens;\n        }\n        else if (delta < 0) {\n            value *= getTens(-delta);\n        }\n        checkValue(value, format, \"fromValue\");\n        return new FixedNumber(_guard, value, format);\n    }\n    /**\n     *  Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n     *\n     *  This will throw a [[NumericFaultError]] if %%value%% cannot fit\n     *  in %%format%%, either due to overflow or underflow (precision loss).\n     */\n    static fromString(_value, _format) {\n        const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n        assertArgument(match && (match[2].length + match[3].length) > 0, \"invalid FixedNumber string value\", \"value\", _value);\n        const format = getFormat(_format);\n        let whole = (match[2] || \"0\"), decimal = (match[3] || \"\");\n        // Pad out the decimals\n        while (decimal.length < format.decimals) {\n            decimal += Zeros;\n        }\n        // Check precision is safe\n        assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n            operation: \"fromString\", fault: \"underflow\", value: _value\n        });\n        // Remove extra padding\n        decimal = decimal.substring(0, format.decimals);\n        const value = BigInt(match[1] + whole + decimal);\n        checkValue(value, format, \"fromString\");\n        return new FixedNumber(_guard, value, format);\n    }\n    /**\n     *  Creates a new [[FixedNumber]] with the big-endian representation\n     *  %%value%% with %%format%%.\n     *\n     *  This will throw a [[NumericFaultError]] if %%value%% cannot fit\n     *  in %%format%% due to overflow.\n     */\n    static fromBytes(_value, _format) {\n        let value = toBigInt(getBytes(_value, \"value\"));\n        const format = getFormat(_format);\n        if (format.signed) {\n            value = fromTwos(value, format.width);\n        }\n        checkValue(value, format, \"fromBytes\");\n        return new FixedNumber(_guard, value, format);\n    }\n}\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.mapimport http from \"http\";\nimport https from \"https\";\nimport { gunzipSync } from \"zlib\";\nimport { assert, makeError } from \"./errors.js\";\nimport { getBytes } from \"./data.js\";\n/**\n *  @_ignore:\n */\nexport function createGetUrl(options) {\n    async function getUrl(req, signal) {\n        // Make sure we weren't cancelled before sending\n        assert(signal == null || !signal.cancelled, \"request cancelled before sending\", \"CANCELLED\");\n        const protocol = req.url.split(\":\")[0].toLowerCase();\n        assert(protocol === \"http\" || protocol === \"https\", `unsupported protocol ${protocol}`, \"UNSUPPORTED_OPERATION\", {\n            info: { protocol },\n            operation: \"request\"\n        });\n        assert(protocol === \"https\" || !req.credentials || req.allowInsecureAuthentication, \"insecure authorized connections unsupported\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"request\"\n        });\n        const method = req.method;\n        const headers = Object.assign({}, req.headers);\n        const reqOptions = { method, headers };\n        if (options) {\n            if (options.agent) {\n                reqOptions.agent = options.agent;\n            }\n        }\n        // Create a Node-specific AbortController, if available\n        let abort = null;\n        try {\n            abort = new AbortController();\n            reqOptions.abort = abort.signal;\n        }\n        catch (e) {\n            console.log(e);\n        }\n        const request = ((protocol === \"http\") ? http : https).request(req.url, reqOptions);\n        request.setTimeout(req.timeout);\n        const body = req.body;\n        if (body) {\n            request.write(Buffer.from(body));\n        }\n        request.end();\n        return new Promise((resolve, reject) => {\n            if (signal) {\n                signal.addListener(() => {\n                    if (abort) {\n                        abort.abort();\n                    }\n                    reject(makeError(\"request cancelled\", \"CANCELLED\"));\n                });\n            }\n            request.on(\"timeout\", () => {\n                reject(makeError(\"request timeout\", \"TIMEOUT\"));\n            });\n            request.once(\"response\", (resp) => {\n                const statusCode = resp.statusCode || 0;\n                const statusMessage = resp.statusMessage || \"\";\n                const headers = Object.keys(resp.headers || {}).reduce((accum, name) => {\n                    let value = resp.headers[name] || \"\";\n                    if (Array.isArray(value)) {\n                        value = value.join(\", \");\n                    }\n                    accum[name] = value;\n                    return accum;\n                }, {});\n                let body = null;\n                //resp.setEncoding(\"utf8\");\n                resp.on(\"data\", (chunk) => {\n                    if (signal) {\n                        try {\n                            signal.checkSignal();\n                        }\n                        catch (error) {\n                            return reject(error);\n                        }\n                    }\n                    if (body == null) {\n                        body = chunk;\n                    }\n                    else {\n                        const newBody = new Uint8Array(body.length + chunk.length);\n                        newBody.set(body, 0);\n                        newBody.set(chunk, body.length);\n                        body = newBody;\n                    }\n                });\n                resp.on(\"end\", () => {\n                    try {\n                        if (headers[\"content-encoding\"] === \"gzip\" && body) {\n                            body = getBytes(gunzipSync(body));\n                        }\n                        resolve({ statusCode, statusMessage, headers, body });\n                    }\n                    catch (error) {\n                        reject(makeError(\"bad response data\", \"SERVER_ERROR\", {\n                            request: req, info: { response: resp, error }\n                        }));\n                    }\n                });\n                resp.on(\"error\", (error) => {\n                    //@TODO: Should this just return nornal response with a server error?\n                    error.response = { statusCode, statusMessage, headers, body };\n                    reject(error);\n                });\n            });\n            request.on(\"error\", (error) => { reject(error); });\n        });\n    }\n    return getUrl;\n}\n// @TODO: remove in v7; provided for backwards compat\nconst defaultGetUrl = createGetUrl({});\n/**\n *  @_ignore:\n */\nexport async function getUrl(req, signal) {\n    return defaultGetUrl(req, signal);\n}\n//# sourceMappingURL=geturl.js.map/**\n *  There are many simple utilities required to interact with\n *  Ethereum and to simplify the library, without increasing\n *  the library dependencies for simple functions.\n *\n *  @_section api/utils:Utilities  [about-utils]\n */\nexport { decodeBase58, encodeBase58 } from \"./base58.js\";\nexport { decodeBase64, encodeBase64 } from \"./base64.js\";\nexport { getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, stripZerosLeft, zeroPadValue, zeroPadBytes } from \"./data.js\";\nexport { isCallException, isError, assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError } from \"./errors.js\";\nexport { EventPayload } from \"./events.js\";\nexport { FetchRequest, FetchResponse, FetchCancelSignal, } from \"./fetch.js\";\nexport { FixedNumber } from \"./fixednumber.js\";\nexport { fromTwos, toTwos, mask, getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity } from \"./maths.js\";\nexport { resolveProperties, defineProperties } from \"./properties.js\";\nexport { decodeRlp } from \"./rlp-decode.js\";\nexport { encodeRlp } from \"./rlp-encode.js\";\nexport { formatEther, parseEther, formatUnits, parseUnits } from \"./units.js\";\nexport { toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, } from \"./utf8.js\";\nexport { uuidV4 } from \"./uuid.js\";\n//# sourceMappingURL=index.js.map/**\n *  Some mathematic operations.\n *\n *  @_subsection: api/utils:Math Helpers  [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n *  Convert %%value%% from a twos-compliment representation of %%width%%\n *  bits to its value.\n *\n *  If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n    const value = getUint(_value, \"value\");\n    const width = BigInt(getNumber(_width, \"width\"));\n    assert((value >> width) === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n        operation: \"fromTwos\", fault: \"overflow\", value: _value\n    });\n    // Top bit set; treat as a negative value\n    if (value >> (width - BN_1)) {\n        const mask = (BN_1 << width) - BN_1;\n        return -(((~value) & mask) + BN_1);\n    }\n    return value;\n}\n/**\n *  Convert %%value%% to a twos-compliment representation of\n *  %%width%% bits.\n *\n *  The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n    let value = getBigInt(_value, \"value\");\n    const width = BigInt(getNumber(_width, \"width\"));\n    const limit = (BN_1 << (width - BN_1));\n    if (value < BN_0) {\n        value = -value;\n        assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n            operation: \"toTwos\", fault: \"overflow\", value: _value\n        });\n        const mask = (BN_1 << width) - BN_1;\n        return ((~value) & mask) + BN_1;\n    }\n    else {\n        assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n            operation: \"toTwos\", fault: \"overflow\", value: _value\n        });\n    }\n    return value;\n}\n/**\n *  Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n    const value = getUint(_value, \"value\");\n    const bits = BigInt(getNumber(_bits, \"bits\"));\n    return value & ((BN_1 << bits) - BN_1);\n}\n/**\n *  Gets a BigInt from %%value%%. If it is an invalid value for\n *  a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n    switch (typeof (value)) {\n        case \"bigint\": return value;\n        case \"number\":\n            assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n            assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n            return BigInt(value);\n        case \"string\":\n            try {\n                if (value === \"\") {\n                    throw new Error(\"empty string\");\n                }\n                if (value[0] === \"-\" && value[1] !== \"-\") {\n                    return -BigInt(value.substring(1));\n                }\n                return BigInt(value);\n            }\n            catch (e) {\n                assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n            }\n    }\n    assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\n/**\n *  Returns %%value%% as a bigint, validating it is valid as a bigint\n *  value and that it is positive.\n */\nexport function getUint(value, name) {\n    const result = getBigInt(value, name);\n    assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n        fault: \"overflow\", operation: \"getUint\", value\n    });\n    return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n    if (value instanceof Uint8Array) {\n        let result = \"0x0\";\n        for (const v of value) {\n            result += Nibbles[v >> 4];\n            result += Nibbles[v & 0x0f];\n        }\n        return BigInt(result);\n    }\n    return getBigInt(value);\n}\n/**\n *  Gets a //number// from %%value%%. If it is an invalid value for\n *  a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n    switch (typeof (value)) {\n        case \"bigint\":\n            assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n            return Number(value);\n        case \"number\":\n            assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n            assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n            return value;\n        case \"string\":\n            try {\n                if (value === \"\") {\n                    throw new Error(\"empty string\");\n                }\n                return getNumber(BigInt(value), name);\n            }\n            catch (e) {\n                assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n            }\n    }\n    assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n *  Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n *  is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n    return getNumber(toBigInt(value));\n}\n/**\n *  Converts %%value%% to a Big Endian hexstring, optionally padded to\n *  %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n    const value = getUint(_value, \"value\");\n    let result = value.toString(16);\n    if (_width == null) {\n        // Ensure the value is of even length\n        if (result.length % 2) {\n            result = \"0\" + result;\n        }\n    }\n    else {\n        const width = getNumber(_width, \"width\");\n        assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, \"NUMERIC_FAULT\", {\n            operation: \"toBeHex\",\n            fault: \"overflow\",\n            value: _value\n        });\n        // Pad the value to the required width\n        while (result.length < (width * 2)) {\n            result = \"0\" + result;\n        }\n    }\n    return \"0x\" + result;\n}\n/**\n *  Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n    const value = getUint(_value, \"value\");\n    if (value === BN_0) {\n        return new Uint8Array([]);\n    }\n    let hex = value.toString(16);\n    if (hex.length % 2) {\n        hex = \"0\" + hex;\n    }\n    const result = new Uint8Array(hex.length / 2);\n    for (let i = 0; i < result.length; i++) {\n        const offset = i * 2;\n        result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n    }\n    return result;\n}\n/**\n *  Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n *  A //Quantity// does not have and leading 0 values unless the value is\n *  the literal value `0x0`. This is most commonly used for JSSON-RPC\n *  numeric values.\n */\nexport function toQuantity(value) {\n    let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n    while (result.startsWith(\"0\")) {\n        result = result.substring(1);\n    }\n    if (result === \"\") {\n        result = \"0\";\n    }\n    return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map/**\n *  Property helper functions.\n *\n *  @_subsection api/utils:Properties  [about-properties]\n */\nfunction checkType(value, type, name) {\n    const types = type.split(\"|\").map(t => t.trim());\n    for (let i = 0; i < types.length; i++) {\n        switch (type) {\n            case \"any\":\n                return;\n            case \"bigint\":\n            case \"boolean\":\n            case \"number\":\n            case \"string\":\n                if (typeof (value) === type) {\n                    return;\n                }\n        }\n    }\n    const error = new Error(`invalid value for type ${type}`);\n    error.code = \"INVALID_ARGUMENT\";\n    error.argument = `value.${name}`;\n    error.value = value;\n    throw error;\n}\n/**\n *  Resolves to a new object that is a copy of %%value%%, but with all\n *  values resolved.\n */\nexport async function resolveProperties(value) {\n    const keys = Object.keys(value);\n    const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n    return results.reduce((accum, v, index) => {\n        accum[keys[index]] = v;\n        return accum;\n    }, {});\n}\n/**\n *  Assigns the %%values%% to %%target%% as read-only values.\n *\n *  It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n    for (let key in values) {\n        let value = values[key];\n        const type = (types ? types[key] : null);\n        if (type) {\n            checkType(value, type, key);\n        }\n        Object.defineProperty(target, key, { enumerable: true, value, writable: false });\n    }\n}\n//# sourceMappingURL=properties.js.map//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { hexlify } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nimport { getBytes } from \"./data.js\";\nfunction hexlifyByte(value) {\n    let result = value.toString(16);\n    while (result.length < 2) {\n        result = \"0\" + result;\n    }\n    return \"0x\" + result;\n}\nfunction unarrayifyInteger(data, offset, length) {\n    let result = 0;\n    for (let i = 0; i < length; i++) {\n        result = (result * 256) + data[offset + i];\n    }\n    return result;\n}\nfunction _decodeChildren(data, offset, childOffset, length) {\n    const result = [];\n    while (childOffset < offset + 1 + length) {\n        const decoded = _decode(data, childOffset);\n        result.push(decoded.result);\n        childOffset += decoded.consumed;\n        assert(childOffset <= offset + 1 + length, \"child data too short\", \"BUFFER_OVERRUN\", {\n            buffer: data, length, offset\n        });\n    }\n    return { consumed: (1 + length), result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n    assert(data.length !== 0, \"data too short\", \"BUFFER_OVERRUN\", {\n        buffer: data, length: 0, offset: 1\n    });\n    const checkOffset = (offset) => {\n        assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n            buffer: data, length: data.length, offset\n        });\n    };\n    // Array with extra length prefix\n    if (data[offset] >= 0xf8) {\n        const lengthLength = data[offset] - 0xf7;\n        checkOffset(offset + 1 + lengthLength);\n        const length = unarrayifyInteger(data, offset + 1, lengthLength);\n        checkOffset(offset + 1 + lengthLength + length);\n        return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n    }\n    else if (data[offset] >= 0xc0) {\n        const length = data[offset] - 0xc0;\n        checkOffset(offset + 1 + length);\n        return _decodeChildren(data, offset, offset + 1, length);\n    }\n    else if (data[offset] >= 0xb8) {\n        const lengthLength = data[offset] - 0xb7;\n        checkOffset(offset + 1 + lengthLength);\n        const length = unarrayifyInteger(data, offset + 1, lengthLength);\n        checkOffset(offset + 1 + lengthLength + length);\n        const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));\n        return { consumed: (1 + lengthLength + length), result: result };\n    }\n    else if (data[offset] >= 0x80) {\n        const length = data[offset] - 0x80;\n        checkOffset(offset + 1 + length);\n        const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n        return { consumed: (1 + length), result: result };\n    }\n    return { consumed: 1, result: hexlifyByte(data[offset]) };\n}\n/**\n *  Decodes %%data%% into the structured data it represents.\n */\nexport function decodeRlp(_data) {\n    const data = getBytes(_data, \"data\");\n    const decoded = _decode(data, 0);\n    assertArgument(decoded.consumed === data.length, \"unexpected junk after rlp payload\", \"data\", _data);\n    return decoded.result;\n}\n//# sourceMappingURL=rlp-decode.js.map//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { getBytes } from \"./data.js\";\nfunction arrayifyInteger(value) {\n    const result = [];\n    while (value) {\n        result.unshift(value & 0xff);\n        value >>= 8;\n    }\n    return result;\n}\nfunction _encode(object) {\n    if (Array.isArray(object)) {\n        let payload = [];\n        object.forEach(function (child) {\n            payload = payload.concat(_encode(child));\n        });\n        if (payload.length <= 55) {\n            payload.unshift(0xc0 + payload.length);\n            return payload;\n        }\n        const length = arrayifyInteger(payload.length);\n        length.unshift(0xf7 + length.length);\n        return length.concat(payload);\n    }\n    const data = Array.prototype.slice.call(getBytes(object, \"object\"));\n    if (data.length === 1 && data[0] <= 0x7f) {\n        return data;\n    }\n    else if (data.length <= 55) {\n        data.unshift(0x80 + data.length);\n        return data;\n    }\n    const length = arrayifyInteger(data.length);\n    length.unshift(0xb7 + length.length);\n    return length.concat(data);\n}\nconst nibbles = \"0123456789abcdef\";\n/**\n *  Encodes %%object%% as an RLP-encoded [[DataHexString]].\n */\nexport function encodeRlp(object) {\n    let result = \"0x\";\n    for (const v of _encode(object)) {\n        result += nibbles[v >> 4];\n        result += nibbles[v & 0xf];\n    }\n    return result;\n}\n//# sourceMappingURL=rlp-encode.js.map/**\n *  Most interactions with Ethereum requires integer values, which use\n *  the smallest magnitude unit.\n *\n *  For example, imagine dealing with dollars and cents. Since dollars\n *  are divisible, non-integer values are possible, such as ``$10.77``.\n *  By using the smallest indivisible unit (i.e. cents), the value can\n *  be kept as the integer ``1077``.\n *\n *  When receiving decimal input from the user (as a decimal string),\n *  the value should be converted to an integer and when showing a user\n *  a value, the integer value should be converted to a decimal string.\n *\n *  This creates a clear distinction, between values to be used by code\n *  (integers) and values used for display logic to users (decimals).\n *\n *  The native unit in Ethereum, //ether// is divisible to 18 decimal places,\n *  where each individual unit is called a //wei//.\n *\n *  @_subsection api/utils:Unit Conversion  [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n    \"wei\",\n    \"kwei\",\n    \"mwei\",\n    \"gwei\",\n    \"szabo\",\n    \"finney\",\n    \"ether\",\n];\n/**\n *  Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n *  places. The %%unit%% may be the number of decimal places or the name of\n *  a unit (e.g. ``\"gwei\"`` for 9 decimal places).\n *\n */\nexport function formatUnits(value, unit) {\n    let decimals = 18;\n    if (typeof (unit) === \"string\") {\n        const index = names.indexOf(unit);\n        assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n        decimals = 3 * index;\n    }\n    else if (unit != null) {\n        decimals = getNumber(unit, \"unit\");\n    }\n    return FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString();\n}\n/**\n *  Converts the //decimal string// %%value%% to a BigInt, assuming\n *  %%unit%% decimal places. The %%unit%% may the number of decimal places\n *  or the name of a unit (e.g. ``\"gwei\"`` for 9 decimal places).\n */\nexport function parseUnits(value, unit) {\n    assertArgument(typeof (value) === \"string\", \"value must be a string\", \"value\", value);\n    let decimals = 18;\n    if (typeof (unit) === \"string\") {\n        const index = names.indexOf(unit);\n        assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n        decimals = 3 * index;\n    }\n    else if (unit != null) {\n        decimals = getNumber(unit, \"unit\");\n    }\n    return FixedNumber.fromString(value, { decimals, width: 512 }).value;\n}\n/**\n *  Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatEther(wei) {\n    return formatUnits(wei, 18);\n}\n/**\n *  Converts the //decimal string// %%ether%% to a BigInt, using 18\n *  decimal places.\n */\nexport function parseEther(ether) {\n    return parseUnits(ether, 18);\n}\n//# sourceMappingURL=units.js.map/**\n *  Using strings in Ethereum (or any security-basd system) requires\n *  additional care. These utilities attempt to mitigate some of the\n *  safety issues as well as provide the ability to recover and analyse\n *  strings.\n *\n *  @_subsection api/utils:Strings and UTF-8  [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n    assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n    // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n    if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n        let i = 0;\n        for (let o = offset + 1; o < bytes.length; o++) {\n            if (bytes[o] >> 6 !== 0x02) {\n                break;\n            }\n            i++;\n        }\n        return i;\n    }\n    // This byte runs us past the end of the string, so just jump to the end\n    // (but the first byte was read already read and therefore skipped)\n    if (reason === \"OVERRUN\") {\n        return bytes.length - offset - 1;\n    }\n    // Nothing to skip\n    return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n    // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n    if (reason === \"OVERLONG\") {\n        assertArgument(typeof (badCodepoint) === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n        output.push(badCodepoint);\n        return 0;\n    }\n    // Put the replacement character into the output\n    output.push(0xfffd);\n    // Otherwise, process as if ignoring errors\n    return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n *  A handful of popular, built-in UTF-8 error handling strategies.\n *\n *  **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n *  non-canonical (overlong) codepoints (this is the default)\n *\n *  **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n *  and accepts non-canonical (overlong) codepoints\n *\n *  **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n *  UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n *  non-canonical (overlong) codepoints\n *\n *  @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n    error: errorFunc,\n    ignore: ignoreFunc,\n    replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n    if (onError == null) {\n        onError = Utf8ErrorFuncs.error;\n    }\n    const bytes = getBytes(_bytes, \"bytes\");\n    const result = [];\n    let i = 0;\n    // Invalid bytes are ignored\n    while (i < bytes.length) {\n        const c = bytes[i++];\n        // 0xxx xxxx\n        if (c >> 7 === 0) {\n            result.push(c);\n            continue;\n        }\n        // Multibyte; how many bytes left for this character?\n        let extraLength = null;\n        let overlongMask = null;\n        // 110x xxxx 10xx xxxx\n        if ((c & 0xe0) === 0xc0) {\n            extraLength = 1;\n            overlongMask = 0x7f;\n            // 1110 xxxx 10xx xxxx 10xx xxxx\n        }\n        else if ((c & 0xf0) === 0xe0) {\n            extraLength = 2;\n            overlongMask = 0x7ff;\n            // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n        }\n        else if ((c & 0xf8) === 0xf0) {\n            extraLength = 3;\n            overlongMask = 0xffff;\n        }\n        else {\n            if ((c & 0xc0) === 0x80) {\n                i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n            }\n            else {\n                i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n            }\n            continue;\n        }\n        // Do we have enough bytes in our data?\n        if (i - 1 + extraLength >= bytes.length) {\n            i += onError(\"OVERRUN\", i - 1, bytes, result);\n            continue;\n        }\n        // Remove the length prefix from the char\n        let res = c & ((1 << (8 - extraLength - 1)) - 1);\n        for (let j = 0; j < extraLength; j++) {\n            let nextChar = bytes[i];\n            // Invalid continuation byte\n            if ((nextChar & 0xc0) != 0x80) {\n                i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n                res = null;\n                break;\n            }\n            ;\n            res = (res << 6) | (nextChar & 0x3f);\n            i++;\n        }\n        // See above loop for invalid continuation byte\n        if (res === null) {\n            continue;\n        }\n        // Maximum code point\n        if (res > 0x10ffff) {\n            i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n            continue;\n        }\n        // Reserved for UTF-16 surrogate halves\n        if (res >= 0xd800 && res <= 0xdfff) {\n            i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n            continue;\n        }\n        // Check for overlong sequences (more bytes than needed)\n        if (res <= overlongMask) {\n            i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n            continue;\n        }\n        result.push(res);\n    }\n    return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n *  Returns the UTF-8 byte representation of %%str%%.\n *\n *  If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n    assertArgument(typeof (str) === \"string\", \"invalid string value\", \"str\", str);\n    if (form != null) {\n        assertNormalize(form);\n        str = str.normalize(form);\n    }\n    let result = [];\n    for (let i = 0; i < str.length; i++) {\n        const c = str.charCodeAt(i);\n        if (c < 0x80) {\n            result.push(c);\n        }\n        else if (c < 0x800) {\n            result.push((c >> 6) | 0xc0);\n            result.push((c & 0x3f) | 0x80);\n        }\n        else if ((c & 0xfc00) == 0xd800) {\n            i++;\n            const c2 = str.charCodeAt(i);\n            assertArgument(i < str.length && ((c2 & 0xfc00) === 0xdc00), \"invalid surrogate pair\", \"str\", str);\n            // Surrogate Pair\n            const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n            result.push((pair >> 18) | 0xf0);\n            result.push(((pair >> 12) & 0x3f) | 0x80);\n            result.push(((pair >> 6) & 0x3f) | 0x80);\n            result.push((pair & 0x3f) | 0x80);\n        }\n        else {\n            result.push((c >> 12) | 0xe0);\n            result.push(((c >> 6) & 0x3f) | 0x80);\n            result.push((c & 0x3f) | 0x80);\n        }\n    }\n    return new Uint8Array(result);\n}\n;\n//export \nfunction _toUtf8String(codePoints) {\n    return codePoints.map((codePoint) => {\n        if (codePoint <= 0xffff) {\n            return String.fromCharCode(codePoint);\n        }\n        codePoint -= 0x10000;\n        return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n    }).join(\"\");\n}\n/**\n *  Returns the string represented by the UTF-8 data %%bytes%%.\n *\n *  When %%onError%% function is specified, it is called on UTF-8\n *  errors allowing recovery using the [[Utf8ErrorFunc]] API.\n *  (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n    return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n *  Returns the UTF-8 code-points for %%str%%.\n *\n *  If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n    return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map/**\n *  Explain UUID and link to RFC here.\n *\n *  @_subsection: api/utils:UUID  [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n *  Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n *  @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n    const bytes = getBytes(randomBytes, \"randomBytes\");\n    // Section: 4.1.3:\n    // - time_hi_and_version[12:16] = 0b0100\n    bytes[6] = (bytes[6] & 0x0f) | 0x40;\n    // Section 4.4\n    // - clock_seq_hi_and_reserved[6] = 0b0\n    // - clock_seq_hi_and_reserved[7] = 0b1\n    bytes[8] = (bytes[8] & 0x3f) | 0x80;\n    const value = hexlify(bytes);\n    return [\n        value.substring(2, 10),\n        value.substring(10, 14),\n        value.substring(14, 18),\n        value.substring(18, 22),\n        value.substring(22, 34),\n    ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.mapimport { getAddress, resolveAddress } from \"../address/index.js\";\nimport { hashAuthorization, hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner, copyRequest } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from \"../utils/index.js\";\n/**\n *  The **BaseWallet** is a stream-lined implementation of a\n *  [[Signer]] that operates with a private key.\n *\n *  It is preferred to use the [[Wallet]] class, as it offers\n *  additional functionality and simplifies loading a variety\n *  of JSON formats, Mnemonic Phrases, etc.\n *\n *  This class may be of use for those attempting to implement\n *  a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n    /**\n     *  The wallet address.\n     */\n    address;\n    #signingKey;\n    /**\n     *  Creates a new BaseWallet for %%privateKey%%, optionally\n     *  connected to %%provider%%.\n     *\n     *  If %%provider%% is not specified, only offline methods can\n     *  be used.\n     */\n    constructor(privateKey, provider) {\n        super(provider);\n        assertArgument(privateKey && typeof (privateKey.sign) === \"function\", \"invalid private key\", \"privateKey\", \"[ REDACTED ]\");\n        this.#signingKey = privateKey;\n        const address = computeAddress(this.signingKey.publicKey);\n        defineProperties(this, { address });\n    }\n    // Store private values behind getters to reduce visibility\n    // in console.log\n    /**\n     *  The [[SigningKey]] used for signing payloads.\n     */\n    get signingKey() { return this.#signingKey; }\n    /**\n     *  The private key for this wallet.\n     */\n    get privateKey() { return this.signingKey.privateKey; }\n    async getAddress() { return this.address; }\n    connect(provider) {\n        return new BaseWallet(this.#signingKey, provider);\n    }\n    async signTransaction(tx) {\n        tx = copyRequest(tx);\n        // Replace any Addressable or ENS name with an address\n        const { to, from } = await resolveProperties({\n            to: (tx.to ? resolveAddress(tx.to, this) : undefined),\n            from: (tx.from ? resolveAddress(tx.from, this) : undefined)\n        });\n        if (to != null) {\n            tx.to = to;\n        }\n        if (from != null) {\n            tx.from = from;\n        }\n        if (tx.from != null) {\n            assertArgument(getAddress((tx.from)) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n            delete tx.from;\n        }\n        // Build the transaction\n        const btx = Transaction.from(tx);\n        btx.signature = this.signingKey.sign(btx.unsignedHash);\n        return btx.serialized;\n    }\n    async signMessage(message) {\n        return this.signMessageSync(message);\n    }\n    // @TODO: Add a secialized signTx and signTyped sync that enforces\n    // all parameters are known?\n    /**\n     *  Returns the signature for %%message%% signed with this wallet.\n     */\n    signMessageSync(message) {\n        return this.signingKey.sign(hashMessage(message)).serialized;\n    }\n    /**\n     *  Returns the Authorization for %%auth%%.\n     */\n    authorizeSync(auth) {\n        assertArgument(typeof (auth.address) === \"string\", \"invalid address for authorizeSync\", \"auth.address\", auth);\n        const signature = this.signingKey.sign(hashAuthorization(auth));\n        return Object.assign({}, {\n            address: getAddress(auth.address),\n            nonce: getBigInt(auth.nonce || 0),\n            chainId: getBigInt(auth.chainId || 0),\n        }, { signature });\n    }\n    /**\n     *  Resolves to the Authorization for %%auth%%.\n     */\n    async authorize(auth) {\n        auth = Object.assign({}, auth, {\n            address: await resolveAddress(auth.address, this)\n        });\n        return this.authorizeSync(await this.populateAuthorization(auth));\n    }\n    async signTypedData(domain, types, value) {\n        // Populate any ENS names\n        const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n            // @TODO: this should use resolveName; addresses don't\n            //        need a provider\n            assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n                operation: \"resolveName\",\n                info: { name }\n            });\n            const address = await this.provider.resolveName(name);\n            assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n                value: name\n            });\n            return address;\n        });\n        return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)).serialized;\n    }\n}\n//# sourceMappingURL=base-wallet.js.map/**\n *  Explain HD Wallets..\n *\n *  @_subsection: api/wallet:HD Wallets  [hd-wallets]\n */\nimport { computeHmac, randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { VoidSigner } from \"../providers/index.js\";\nimport { computeAddress } from \"../transaction/index.js\";\nimport { concat, dataSlice, decodeBase58, defineProperties, encodeBase58, getBytes, hexlify, isBytesLike, getNumber, toBeArray, toBigInt, toBeHex, assertPrivate, assert, assertArgument } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\n/**\n *  The default derivation path for Ethereum HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m/44'/60'/0'/0/0\";\n// \"Bitcoin seed\"\nconst MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\nconst N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\nconst Nibbles = \"0123456789abcdef\";\nfunction zpad(value, length) {\n    let result = \"\";\n    while (value) {\n        result = Nibbles[value % 16] + result;\n        value = Math.trunc(value / 16);\n    }\n    while (result.length < length * 2) {\n        result = \"0\" + result;\n    }\n    return \"0x\" + result;\n}\nfunction encodeBase58Check(_value) {\n    const value = getBytes(_value);\n    const check = dataSlice(sha256(sha256(value)), 0, 4);\n    const bytes = concat([value, check]);\n    return encodeBase58(bytes);\n}\nconst _guard = {};\nfunction ser_I(index, chainCode, publicKey, privateKey) {\n    const data = new Uint8Array(37);\n    if (index & HardenedBit) {\n        assert(privateKey != null, \"cannot derive child of neutered node\", \"UNSUPPORTED_OPERATION\", {\n            operation: \"deriveChild\"\n        });\n        // Data = 0x00 || ser_256(k_par)\n        data.set(getBytes(privateKey), 1);\n    }\n    else {\n        // Data = ser_p(point(k_par))\n        data.set(getBytes(publicKey));\n    }\n    // Data += ser_32(i)\n    for (let i = 24; i >= 0; i -= 8) {\n        data[33 + (i >> 3)] = ((index >> (24 - i)) & 0xff);\n    }\n    const I = getBytes(computeHmac(\"sha512\", chainCode, data));\n    return { IL: I.slice(0, 32), IR: I.slice(32) };\n}\nfunction derivePath(node, path) {\n    const components = path.split(\"/\");\n    assertArgument(components.length > 0, \"invalid path\", \"path\", path);\n    if (components[0] === \"m\") {\n        assertArgument(node.depth === 0, `cannot derive root path (i.e. path starting with \"m/\") for a node at non-zero depth ${node.depth}`, \"path\", path);\n        components.shift();\n    }\n    let result = node;\n    for (let i = 0; i < components.length; i++) {\n        const component = components[i];\n        if (component.match(/^[0-9]+'$/)) {\n            const index = parseInt(component.substring(0, component.length - 1));\n            assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n            result = result.deriveChild(HardenedBit + index);\n        }\n        else if (component.match(/^[0-9]+$/)) {\n            const index = parseInt(component);\n            assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n            result = result.deriveChild(index);\n        }\n        else {\n            assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n        }\n    }\n    return result;\n}\n/**\n *  An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n *  from an HD Node using the [[link-bip-32]] stantard.\n *\n *  An HD Node forms a hierarchal structure with each HD Node having a\n *  private key and the ability to derive child HD Nodes, defined by\n *  a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n    /**\n     *  The compressed public key.\n     */\n    publicKey;\n    /**\n     *  The fingerprint.\n     *\n     *  A fingerprint allows quick qay to detect parent and child nodes,\n     *  but developers should be prepared to deal with collisions as it\n     *  is only 4 bytes.\n     */\n    fingerprint;\n    /**\n     *  The parent fingerprint.\n     */\n    parentFingerprint;\n    /**\n     *  The mnemonic used to create this HD Node, if available.\n     *\n     *  Sources such as extended keys do not encode the mnemonic, in\n     *  which case this will be ``null``.\n     */\n    mnemonic;\n    /**\n     *  The chaincode, which is effectively a public key used\n     *  to derive children.\n     */\n    chainCode;\n    /**\n     *  The derivation path of this wallet.\n     *\n     *  Since extended keys do not provide full path details, this\n     *  may be ``null``, if instantiated from a source that does not\n     *  encode it.\n     */\n    path;\n    /**\n     *  The child index of this wallet. Values over ``2 *\\* 31`` indicate\n     *  the node is hardened.\n     */\n    index;\n    /**\n     *  The depth of this wallet, which is the number of components\n     *  in its path.\n     */\n    depth;\n    /**\n     *  @private\n     */\n    constructor(guard, signingKey, parentFingerprint, chainCode, path, index, depth, mnemonic, provider) {\n        super(signingKey, provider);\n        assertPrivate(guard, _guard, \"HDNodeWallet\");\n        defineProperties(this, { publicKey: signingKey.compressedPublicKey });\n        const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n        defineProperties(this, {\n            parentFingerprint, fingerprint,\n            chainCode, path, index, depth\n        });\n        defineProperties(this, { mnemonic });\n    }\n    connect(provider) {\n        return new HDNodeWallet(_guard, this.signingKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.mnemonic, provider);\n    }\n    #account() {\n        const account = { address: this.address, privateKey: this.privateKey };\n        const m = this.mnemonic;\n        if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n            account.mnemonic = {\n                path: this.path,\n                locale: \"en\",\n                entropy: m.entropy\n            };\n        }\n        return account;\n    }\n    /**\n     *  Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n     *  %%password%%.\n     *\n     *  If %%progressCallback%% is specified, it will receive periodic\n     *  updates as the encryption process progreses.\n     */\n    async encrypt(password, progressCallback) {\n        return await encryptKeystoreJson(this.#account(), password, { progressCallback });\n    }\n    /**\n     *  Returns a [JSON Keystore Wallet](json-wallets) encryped with\n     *  %%password%%.\n     *\n     *  It is preferred to use the [async version](encrypt) instead,\n     *  which allows a [[ProgressCallback]] to keep the user informed.\n     *\n     *  This method will block the event loop (freezing all UI) until\n     *  it is complete, which may be a non-trivial duration.\n     */\n    encryptSync(password) {\n        return encryptKeystoreJsonSync(this.#account(), password);\n    }\n    /**\n     *  The extended key.\n     *\n     *  This key will begin with the prefix ``xpriv`` and can be used to\n     *  reconstruct this HD Node to derive its children.\n     */\n    get extendedKey() {\n        // We only support the mainnet values for now, but if anyone needs\n        // testnet values, let me know. I believe current sentiment is that\n        // we should always use mainnet, and use BIP-44 to derive the network\n        //   - Mainnet: public=0x0488B21E, private=0x0488ADE4\n        //   - Testnet: public=0x043587CF, private=0x04358394\n        assert(this.depth < 256, \"Depth too deep\", \"UNSUPPORTED_OPERATION\", { operation: \"extendedKey\" });\n        return encodeBase58Check(concat([\n            \"0x0488ADE4\", zpad(this.depth, 1), this.parentFingerprint,\n            zpad(this.index, 4), this.chainCode,\n            concat([\"0x00\", this.privateKey])\n        ]));\n    }\n    /**\n     *  Returns true if this wallet has a path, providing a Type Guard\n     *  that the path is non-null.\n     */\n    hasPath() { return (this.path != null); }\n    /**\n     *  Returns a neutered HD Node, which removes the private details\n     *  of an HD Node.\n     *\n     *  A neutered node has no private key, but can be used to derive\n     *  child addresses and other public data about the HD Node.\n     */\n    neuter() {\n        return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, this.provider);\n    }\n    /**\n     *  Return the child for %%index%%.\n     */\n    deriveChild(_index) {\n        const index = getNumber(_index, \"index\");\n        assertArgument(index <= 0xffffffff, \"invalid index\", \"index\", index);\n        // Base path\n        let path = this.path;\n        if (path) {\n            path += \"/\" + (index & ~HardenedBit);\n            if (index & HardenedBit) {\n                path += \"'\";\n            }\n        }\n        const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, this.privateKey);\n        const ki = new SigningKey(toBeHex((toBigInt(IL) + BigInt(this.privateKey)) % N, 32));\n        return new HDNodeWallet(_guard, ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.mnemonic, this.provider);\n    }\n    /**\n     *  Return the HDNode for %%path%% from this node.\n     */\n    derivePath(path) {\n        return derivePath(this, path);\n    }\n    static #fromSeed(_seed, mnemonic) {\n        assertArgument(isBytesLike(_seed), \"invalid seed\", \"seed\", \"[REDACTED]\");\n        const seed = getBytes(_seed, \"seed\");\n        assertArgument(seed.length >= 16 && seed.length <= 64, \"invalid seed\", \"seed\", \"[REDACTED]\");\n        const I = getBytes(computeHmac(\"sha512\", MasterSecret, seed));\n        const signingKey = new SigningKey(hexlify(I.slice(0, 32)));\n        return new HDNodeWallet(_guard, signingKey, \"0x00000000\", hexlify(I.slice(32)), \"m\", 0, 0, mnemonic, null);\n    }\n    /**\n     *  Creates a new HD Node from %%extendedKey%%.\n     *\n     *  If the %%extendedKey%% will either have a prefix or ``xpub`` or\n     *  ``xpriv``, returning a neutered HD Node ([[HDNodeVoidWallet]])\n     *  or full HD Node ([[HDNodeWallet) respectively.\n     */\n    static fromExtendedKey(extendedKey) {\n        const bytes = toBeArray(decodeBase58(extendedKey)); // @TODO: redact\n        assertArgument(bytes.length === 82 || encodeBase58Check(bytes.slice(0, 78)) === extendedKey, \"invalid extended key\", \"extendedKey\", \"[ REDACTED ]\");\n        const depth = bytes[4];\n        const parentFingerprint = hexlify(bytes.slice(5, 9));\n        const index = parseInt(hexlify(bytes.slice(9, 13)).substring(2), 16);\n        const chainCode = hexlify(bytes.slice(13, 45));\n        const key = bytes.slice(45, 78);\n        switch (hexlify(bytes.slice(0, 4))) {\n            // Public Key\n            case \"0x0488b21e\":\n            case \"0x043587cf\": {\n                const publicKey = hexlify(key);\n                return new HDNodeVoidWallet(_guard, computeAddress(publicKey), publicKey, parentFingerprint, chainCode, null, index, depth, null);\n            }\n            // Private Key\n            case \"0x0488ade4\":\n            case \"0x04358394 \":\n                if (key[0] !== 0) {\n                    break;\n                }\n                return new HDNodeWallet(_guard, new SigningKey(key.slice(1)), parentFingerprint, chainCode, null, index, depth, null, null);\n        }\n        assertArgument(false, \"invalid extended key prefix\", \"extendedKey\", \"[ REDACTED ]\");\n    }\n    /**\n     *  Creates a new random HDNode.\n     */\n    static createRandom(password, path, wordlist) {\n        if (password == null) {\n            password = \"\";\n        }\n        if (path == null) {\n            path = defaultPath;\n        }\n        if (wordlist == null) {\n            wordlist = LangEn.wordlist();\n        }\n        const mnemonic = Mnemonic.fromEntropy(randomBytes(16), password, wordlist);\n        return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n    }\n    /**\n     *  Create an HD Node from %%mnemonic%%.\n     */\n    static fromMnemonic(mnemonic, path) {\n        if (!path) {\n            path = defaultPath;\n        }\n        return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n    }\n    /**\n     *  Creates an HD Node from a mnemonic %%phrase%%.\n     */\n    static fromPhrase(phrase, password, path, wordlist) {\n        if (password == null) {\n            password = \"\";\n        }\n        if (path == null) {\n            path = defaultPath;\n        }\n        if (wordlist == null) {\n            wordlist = LangEn.wordlist();\n        }\n        const mnemonic = Mnemonic.fromPhrase(phrase, password, wordlist);\n        return HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path);\n    }\n    /**\n     *  Creates an HD Node from a %%seed%%.\n     */\n    static fromSeed(seed) {\n        return HDNodeWallet.#fromSeed(seed, null);\n    }\n}\n/**\n *  A **HDNodeVoidWallet** cannot sign, but provides access to\n *  the children nodes of a [[link-bip-32]] HD wallet addresses.\n *\n *  The can be created by using an extended ``xpub`` key to\n *  [[HDNodeWallet_fromExtendedKey]] or by\n *  [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]].\n */\nexport class HDNodeVoidWallet extends VoidSigner {\n    /**\n     *  The compressed public key.\n     */\n    publicKey;\n    /**\n     *  The fingerprint.\n     *\n     *  A fingerprint allows quick qay to detect parent and child nodes,\n     *  but developers should be prepared to deal with collisions as it\n     *  is only 4 bytes.\n     */\n    fingerprint;\n    /**\n     *  The parent node fingerprint.\n     */\n    parentFingerprint;\n    /**\n     *  The chaincode, which is effectively a public key used\n     *  to derive children.\n     */\n    chainCode;\n    /**\n     *  The derivation path of this wallet.\n     *\n     *  Since extended keys do not provider full path details, this\n     *  may be ``null``, if instantiated from a source that does not\n     *  enocde it.\n     */\n    path;\n    /**\n     *  The child index of this wallet. Values over ``2 *\\* 31`` indicate\n     *  the node is hardened.\n     */\n    index;\n    /**\n     *  The depth of this wallet, which is the number of components\n     *  in its path.\n     */\n    depth;\n    /**\n     *  @private\n     */\n    constructor(guard, address, publicKey, parentFingerprint, chainCode, path, index, depth, provider) {\n        super(address, provider);\n        assertPrivate(guard, _guard, \"HDNodeVoidWallet\");\n        defineProperties(this, { publicKey });\n        const fingerprint = dataSlice(ripemd160(sha256(publicKey)), 0, 4);\n        defineProperties(this, {\n            publicKey, fingerprint, parentFingerprint, chainCode, path, index, depth\n        });\n    }\n    connect(provider) {\n        return new HDNodeVoidWallet(_guard, this.address, this.publicKey, this.parentFingerprint, this.chainCode, this.path, this.index, this.depth, provider);\n    }\n    /**\n     *  The extended key.\n     *\n     *  This key will begin with the prefix ``xpub`` and can be used to\n     *  reconstruct this neutered key to derive its children addresses.\n     */\n    get extendedKey() {\n        // We only support the mainnet values for now, but if anyone needs\n        // testnet values, let me know. I believe current sentiment is that\n        // we should always use mainnet, and use BIP-44 to derive the network\n        //   - Mainnet: public=0x0488B21E, private=0x0488ADE4\n        //   - Testnet: public=0x043587CF, private=0x04358394\n        assert(this.depth < 256, \"Depth too deep\", \"UNSUPPORTED_OPERATION\", { operation: \"extendedKey\" });\n        return encodeBase58Check(concat([\n            \"0x0488B21E\",\n            zpad(this.depth, 1),\n            this.parentFingerprint,\n            zpad(this.index, 4),\n            this.chainCode,\n            this.publicKey,\n        ]));\n    }\n    /**\n     *  Returns true if this wallet has a path, providing a Type Guard\n     *  that the path is non-null.\n     */\n    hasPath() { return (this.path != null); }\n    /**\n     *  Return the child for %%index%%.\n     */\n    deriveChild(_index) {\n        const index = getNumber(_index, \"index\");\n        assertArgument(index <= 0xffffffff, \"invalid index\", \"index\", index);\n        // Base path\n        let path = this.path;\n        if (path) {\n            path += \"/\" + (index & ~HardenedBit);\n            if (index & HardenedBit) {\n                path += \"'\";\n            }\n        }\n        const { IR, IL } = ser_I(index, this.chainCode, this.publicKey, null);\n        const Ki = SigningKey.addPoints(IL, this.publicKey, true);\n        const address = computeAddress(Ki);\n        return new HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, hexlify(IR), path, index, this.depth + 1, this.provider);\n    }\n    /**\n     *  Return the signer for %%path%% from this node.\n     */\n    derivePath(path) {\n        return derivePath(this, path);\n    }\n}\n/*\nexport class HDNodeWalletManager {\n    #root: HDNodeWallet;\n\n    constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n        if (password == null) { password = \"\"; }\n        if (path == null) { path = \"m/44'/60'/0'/0\"; }\n        if (locale == null) { locale = LangEn.wordlist(); }\n        this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n    }\n\n    getSigner(index?: number): HDNodeWallet {\n        return this.#root.deriveChild((index == null) ? 0: index);\n    }\n}\n*/\n/**\n *  Returns the [[link-bip-32]] path for the account at %%index%%.\n *\n *  This is the pattern used by wallets like Ledger.\n *\n *  There is also an [alternate pattern](getIndexedAccountPath) used by\n *  some software.\n */\nexport function getAccountPath(_index) {\n    const index = getNumber(_index, \"index\");\n    assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n    return `m/44'/60'/${index}'/0/0`;\n}\n/**\n *  Returns the path using an alternative pattern for deriving accounts,\n *  at %%index%%.\n *\n *  This derivation path uses the //index// component rather than the\n *  //account// component to derive sequential accounts.\n *\n *  This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n    const index = getNumber(_index, \"index\");\n    assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n    return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map/**\n *  When interacting with Ethereum, it is necessary to use a private\n *  key authenticate actions by signing a payload.\n *\n *  Wallets are the simplest way to expose the concept of an\n *  //Externally Owner Account// (EOA) as it wraps a private key\n *  and supports high-level methods to sign common types of interaction\n *  and send transactions.\n *\n *  The class most developers will want to use is [[Wallet]], which\n *  can load a private key directly or from any common wallet format.\n *\n *  The [[HDNodeWallet]] can be used when it is necessary to access\n *  low-level details of how an HD wallets are derived, exported\n *  or imported.\n *\n *  @_section: api/wallet:Wallets  [about-wallets]\n */\nexport { BaseWallet } from \"./base-wallet.js\";\nexport { defaultPath, getAccountPath, getIndexedAccountPath, HDNodeWallet, HDNodeVoidWallet, } from \"./hdwallet.js\";\nexport { isCrowdsaleJson, decryptCrowdsaleJson } from \"./json-crowdsale.js\";\nexport { isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync } from \"./json-keystore.js\";\nexport { Mnemonic } from \"./mnemonic.js\";\nexport { Wallet } from \"./wallet.js\";\n//# sourceMappingURL=index.js.map/**\n *  @_subsection: api/wallet:JSON Wallets  [json-wallets]\n */\nimport { CBC, pkcs7Strip } from \"aes-js\";\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n *  Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n    try {\n        const data = JSON.parse(json);\n        if (data.encseed) {\n            return true;\n        }\n    }\n    catch (error) { }\n    return false;\n}\n// See: https://github.com/ethereum/pyethsaletool\n/**\n *  Before Ethereum launched, it was necessary to create a wallet\n *  format for backers to use, which would be used to receive ether\n *  as a reward for contributing to the project.\n *\n *  The [[link-crowdsale]] format is now obsolete, but it is still\n *  useful to support and the additional code is fairly trivial as\n *  all the primitives required are used through core portions of\n *  the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n    const data = JSON.parse(json);\n    const password = getPassword(_password);\n    // Ethereum Address\n    const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n    // Encrypted Seed\n    const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n    assertArgument(encseed && (encseed.length % 16) === 0, \"invalid encseed\", \"json\", json);\n    const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n    const iv = encseed.slice(0, 16);\n    const encryptedSeed = encseed.slice(16);\n    // Decrypt the seed\n    const aesCbc = new CBC(key, iv);\n    const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n    // This wallet format is weird... Convert the binary encoded hex to a string.\n    let seedHex = \"\";\n    for (let i = 0; i < seed.length; i++) {\n        seedHex += String.fromCharCode(seed[i]);\n    }\n    return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map/**\n *  The JSON Wallet formats allow a simple way to store the private\n *  keys needed in Ethereum along with related information and allows\n *  for extensible forms of encryption.\n *\n *  These utilities facilitate decrypting and encrypting the most common\n *  JSON Wallet formats.\n *\n *  @_subsection: api/wallet:JSON Wallets  [json-wallets]\n */\nimport { CTR } from \"aes-js\";\nimport { getAddress } from \"../address/index.js\";\nimport { keccak256, pbkdf2, randomBytes, scrypt, scryptSync } from \"../crypto/index.js\";\nimport { computeAddress } from \"../transaction/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n *  Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n    try {\n        const data = JSON.parse(json);\n        const version = ((data.version != null) ? parseInt(data.version) : 0);\n        if (version === 3) {\n            return true;\n        }\n    }\n    catch (error) { }\n    return false;\n}\nfunction decrypt(data, key, ciphertext) {\n    const cipher = spelunk(data, \"crypto.cipher:string\");\n    if (cipher === \"aes-128-ctr\") {\n        const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n        const aesCtr = new CTR(key, iv);\n        return hexlify(aesCtr.decrypt(ciphertext));\n    }\n    assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n        operation: \"decrypt\"\n    });\n}\nfunction getAccount(data, _key) {\n    const key = getBytes(_key);\n    const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n    const computedMAC = hexlify(keccak256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n    assertArgument(computedMAC === spelunk(data, \"crypto.mac:string!\").toLowerCase(), \"incorrect password\", \"password\", \"[ REDACTED ]\");\n    const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n    const address = computeAddress(privateKey);\n    if (data.address) {\n        let check = data.address.toLowerCase();\n        if (!check.startsWith(\"0x\")) {\n            check = \"0x\" + check;\n        }\n        assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n    }\n    const account = { address, privateKey };\n    // Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase\n    const version = spelunk(data, \"x-ethers.version:string\");\n    if (version === \"0.1\") {\n        const mnemonicKey = key.slice(32, 64);\n        const mnemonicCiphertext = spelunk(data, \"x-ethers.mnemonicCiphertext:data!\");\n        const mnemonicIv = spelunk(data, \"x-ethers.mnemonicCounter:data!\");\n        const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n        account.mnemonic = {\n            path: (spelunk(data, \"x-ethers.path:string\") || defaultPath),\n            locale: (spelunk(data, \"x-ethers.locale:string\") || \"en\"),\n            entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext)))\n        };\n    }\n    return account;\n}\nfunction getDecryptKdfParams(data) {\n    const kdf = spelunk(data, \"crypto.kdf:string\");\n    if (kdf && typeof (kdf) === \"string\") {\n        if (kdf.toLowerCase() === \"scrypt\") {\n            const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n            const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n            const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n            const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n            // Make sure N is a power of 2\n            assertArgument(N > 0 && (N & (N - 1)) === 0, \"invalid kdf.N\", \"kdf.N\", N);\n            assertArgument(r > 0 && p > 0, \"invalid kdf\", \"kdf\", kdf);\n            const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n            assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n            return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n        }\n        else if (kdf.toLowerCase() === \"pbkdf2\") {\n            const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n            const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n            const algorithm = prf.split(\"-\").pop();\n            assertArgument(algorithm === \"sha256\" || algorithm === \"sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n            const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n            const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n            assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n            return { name: \"pbkdf2\", salt, count, dkLen, algorithm };\n        }\n    }\n    assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n *  Returns the account details for the JSON Keystore Wallet %%json%%\n *  using %%password%%.\n *\n *  It is preferred to use the [async version](decryptKeystoreJson)\n *  instead, which allows a [[ProgressCallback]] to keep the user informed\n *  as to the decryption status.\n *\n *  This method will block the event loop (freezing all UI) until decryption\n *  is complete, which can take quite some time, depending on the wallet\n *  paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n    const data = JSON.parse(json);\n    const password = getPassword(_password);\n    const params = getDecryptKdfParams(data);\n    if (params.name === \"pbkdf2\") {\n        const { salt, count, dkLen, algorithm } = params;\n        const key = pbkdf2(password, salt, count, dkLen, algorithm);\n        return getAccount(data, key);\n    }\n    assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", { params });\n    const { salt, N, r, p, dkLen } = params;\n    const key = scryptSync(password, salt, N, r, p, dkLen);\n    return getAccount(data, key);\n}\nfunction stall(duration) {\n    return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); });\n}\n/**\n *  Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n *  %%password%%.\n *\n *  If provided, %%progress%% will be called periodically during the\n *  decrpytion to provide feedback, and if the function returns\n *  ``false`` will halt decryption.\n *\n *  The %%progressCallback%% will **always** receive ``0`` before\n *  decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n    const data = JSON.parse(json);\n    const password = getPassword(_password);\n    const params = getDecryptKdfParams(data);\n    if (params.name === \"pbkdf2\") {\n        if (progress) {\n            progress(0);\n            await stall(0);\n        }\n        const { salt, count, dkLen, algorithm } = params;\n        const key = pbkdf2(password, salt, count, dkLen, algorithm);\n        if (progress) {\n            progress(1);\n            await stall(0);\n        }\n        return getAccount(data, key);\n    }\n    assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", { params });\n    const { salt, N, r, p, dkLen } = params;\n    const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n    return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n    // Check/generate the salt\n    const salt = (options.salt != null) ? getBytes(options.salt, \"options.salt\") : randomBytes(32);\n    // Override the scrypt password-based key derivation function parameters\n    let N = (1 << 17), r = 8, p = 1;\n    if (options.scrypt) {\n        if (options.scrypt.N) {\n            N = options.scrypt.N;\n        }\n        if (options.scrypt.r) {\n            r = options.scrypt.r;\n        }\n        if (options.scrypt.p) {\n            p = options.scrypt.p;\n        }\n    }\n    assertArgument(typeof (N) === \"number\" && N > 0 && Number.isSafeInteger(N) && (BigInt(N) & BigInt(N - 1)) === BigInt(0), \"invalid scrypt N parameter\", \"options.N\", N);\n    assertArgument(typeof (r) === \"number\" && r > 0 && Number.isSafeInteger(r), \"invalid scrypt r parameter\", \"options.r\", r);\n    assertArgument(typeof (p) === \"number\" && p > 0 && Number.isSafeInteger(p), \"invalid scrypt p parameter\", \"options.p\", p);\n    return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n    const privateKey = getBytes(account.privateKey, \"privateKey\");\n    // Override initialization vector\n    const iv = (options.iv != null) ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n    assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n    // Override the uuid\n    const uuidRandom = (options.uuid != null) ? getBytes(options.uuid, \"options.uuid\") : randomBytes(16);\n    assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n    // This will be used to encrypt the wallet (as per Web3 secret storage)\n    // - 32 bytes   As normal for the Web3 secret storage (derivedKey, macPrefix)\n    // - 32 bytes   AES key to encrypt mnemonic with (required here to be Ethers Wallet)\n    const derivedKey = key.slice(0, 16);\n    const macPrefix = key.slice(16, 32);\n    // Encrypt the private key\n    const aesCtr = new CTR(derivedKey, iv);\n    const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n    // Compute the message authentication code, used to check the password\n    const mac = keccak256(concat([macPrefix, ciphertext]));\n    // See: https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition\n    const data = {\n        address: account.address.substring(2).toLowerCase(),\n        id: uuidV4(uuidRandom),\n        version: 3,\n        Crypto: {\n            cipher: \"aes-128-ctr\",\n            cipherparams: {\n                iv: hexlify(iv).substring(2),\n            },\n            ciphertext: hexlify(ciphertext).substring(2),\n            kdf: \"scrypt\",\n            kdfparams: {\n                salt: hexlify(kdf.salt).substring(2),\n                n: kdf.N,\n                dklen: 32,\n                p: kdf.p,\n                r: kdf.r\n            },\n            mac: mac.substring(2)\n        }\n    };\n    // If we have a mnemonic, encrypt it into the JSON wallet\n    if (account.mnemonic) {\n        const client = (options.client != null) ? options.client : `ethers/${version}`;\n        const path = account.mnemonic.path || defaultPath;\n        const locale = account.mnemonic.locale || \"en\";\n        const mnemonicKey = key.slice(32, 64);\n        const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n        const mnemonicIv = randomBytes(16);\n        const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n        const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n        const now = new Date();\n        const timestamp = (now.getUTCFullYear() + \"-\" +\n            zpad(now.getUTCMonth() + 1, 2) + \"-\" +\n            zpad(now.getUTCDate(), 2) + \"T\" +\n            zpad(now.getUTCHours(), 2) + \"-\" +\n            zpad(now.getUTCMinutes(), 2) + \"-\" +\n            zpad(now.getUTCSeconds(), 2) + \".0Z\");\n        const gethFilename = (\"UTC--\" + timestamp + \"--\" + data.address);\n        data[\"x-ethers\"] = {\n            client, gethFilename, path, locale,\n            mnemonicCounter: hexlify(mnemonicIv).substring(2),\n            mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n            version: \"0.1\"\n        };\n    }\n    return JSON.stringify(data);\n}\n/**\n *  Return the JSON Keystore Wallet for %%account%% encrypted with\n *  %%password%%.\n *\n *  The %%options%% can be used to tune the password-based key\n *  derivation function parameters, explicitly set the random values\n *  used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n    if (options == null) {\n        options = {};\n    }\n    const passwordBytes = getPassword(password);\n    const kdf = getEncryptKdfParams(options);\n    const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n    return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n *  Resolved to the JSON Keystore Wallet for %%account%% encrypted\n *  with %%password%%.\n *\n *  The %%options%% can be used to tune the password-based key\n *  derivation function parameters, explicitly set the random values\n *  used and provide a [[ProgressCallback]] to receive periodic updates\n *  on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n    if (options == null) {\n        options = {};\n    }\n    const passwordBytes = getPassword(password);\n    const kdf = getEncryptKdfParams(options);\n    const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n    return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.mapimport { pbkdf2, sha256 } from \"../crypto/index.js\";\nimport { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n    return ((1 << bits) - 1) << (8 - bits) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n    return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n    assertNormalize(\"NFKD\");\n    if (wordlist == null) {\n        wordlist = LangEn.wordlist();\n    }\n    const words = wordlist.split(mnemonic);\n    assertArgument((words.length % 3) === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n    const entropy = new Uint8Array(Math.ceil(11 * words.length / 8));\n    let offset = 0;\n    for (let i = 0; i < words.length; i++) {\n        let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n        assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n        for (let bit = 0; bit < 11; bit++) {\n            if (index & (1 << (10 - bit))) {\n                entropy[offset >> 3] |= (1 << (7 - (offset % 8)));\n            }\n            offset++;\n        }\n    }\n    const entropyBits = 32 * words.length / 3;\n    const checksumBits = words.length / 3;\n    const checksumMask = getUpperMask(checksumBits);\n    const checksum = getBytes(sha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n    assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n    return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n    assertArgument((entropy.length % 4) === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n    if (wordlist == null) {\n        wordlist = LangEn.wordlist();\n    }\n    const indices = [0];\n    let remainingBits = 11;\n    for (let i = 0; i < entropy.length; i++) {\n        // Consume the whole byte (with still more to go)\n        if (remainingBits > 8) {\n            indices[indices.length - 1] <<= 8;\n            indices[indices.length - 1] |= entropy[i];\n            remainingBits -= 8;\n            // This byte will complete an 11-bit index\n        }\n        else {\n            indices[indices.length - 1] <<= remainingBits;\n            indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n            // Start the next word\n            indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n            remainingBits += 3;\n        }\n    }\n    // Compute the checksum bits\n    const checksumBits = entropy.length / 4;\n    const checksum = parseInt(sha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits);\n    // Shift the checksum into the word indices\n    indices[indices.length - 1] <<= checksumBits;\n    indices[indices.length - 1] |= (checksum >> (8 - checksumBits));\n    return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n *  A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n *  seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n    /**\n     *  The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n     *\n     *  Use the [[wordlist]] ``split`` method to get the individual words.\n     */\n    phrase;\n    /**\n     *  The password used for this mnemonic. If no password is used this\n     *  is the empty string (i.e. ``\"\"``) as per the specification.\n     */\n    password;\n    /**\n     *  The wordlist for this mnemonic.\n     */\n    wordlist;\n    /**\n     *  The underlying entropy which the mnemonic encodes.\n     */\n    entropy;\n    /**\n     *  @private\n     */\n    constructor(guard, entropy, phrase, password, wordlist) {\n        if (password == null) {\n            password = \"\";\n        }\n        if (wordlist == null) {\n            wordlist = LangEn.wordlist();\n        }\n        assertPrivate(guard, _guard, \"Mnemonic\");\n        defineProperties(this, { phrase, password, wordlist, entropy });\n    }\n    /**\n     *  Returns the seed for the mnemonic.\n     */\n    computeSeed() {\n        const salt = toUtf8Bytes(\"mnemonic\" + this.password, \"NFKD\");\n        return pbkdf2(toUtf8Bytes(this.phrase, \"NFKD\"), salt, 2048, 64, \"sha512\");\n    }\n    /**\n     *  Creates a new Mnemonic for the %%phrase%%.\n     *\n     *  The default %%password%% is the empty string and the default\n     *  wordlist is the [English wordlists](LangEn).\n     */\n    static fromPhrase(phrase, password, wordlist) {\n        // Normalize the case and space; throws if invalid\n        const entropy = mnemonicToEntropy(phrase, wordlist);\n        phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n        return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n    }\n    /**\n     *  Create a new **Mnemonic** from the %%entropy%%.\n     *\n     *  The default %%password%% is the empty string and the default\n     *  wordlist is the [English wordlists](LangEn).\n     */\n    static fromEntropy(_entropy, password, wordlist) {\n        const entropy = getBytes(_entropy, \"entropy\");\n        const phrase = entropyToMnemonic(entropy, wordlist);\n        return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n    }\n    /**\n     *  Returns the phrase for %%mnemonic%%.\n     */\n    static entropyToPhrase(_entropy, wordlist) {\n        const entropy = getBytes(_entropy, \"entropy\");\n        return entropyToMnemonic(entropy, wordlist);\n    }\n    /**\n     *  Returns the entropy for %%phrase%%.\n     */\n    static phraseToEntropy(phrase, wordlist) {\n        return mnemonicToEntropy(phrase, wordlist);\n    }\n    /**\n     *  Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n     *\n     *  This checks all the provided words belong to the %%wordlist%%,\n     *  that the length is valid and the checksum is correct.\n     */\n    static isValidMnemonic(phrase, wordlist) {\n        try {\n            mnemonicToEntropy(phrase, wordlist);\n            return true;\n        }\n        catch (error) { }\n        return false;\n    }\n}\n//# sourceMappingURL=mnemonic.js.map/**\n *  @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n    if (typeof (hexString) === \"string\" && !hexString.startsWith(\"0x\")) {\n        hexString = \"0x\" + hexString;\n    }\n    return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n    value = String(value);\n    while (value.length < length) {\n        value = '0' + value;\n    }\n    return value;\n}\nexport function getPassword(password) {\n    if (typeof (password) === 'string') {\n        return toUtf8Bytes(password, \"NFKC\");\n    }\n    return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n    const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n    assertArgument(match != null, \"invalid path\", \"path\", _path);\n    const path = match[1];\n    const type = match[3];\n    const reqd = (match[4] === \"!\");\n    let cur = object;\n    for (const comp of path.toLowerCase().split('.')) {\n        // Search for a child object with a case-insensitive matching key\n        if (Array.isArray(cur)) {\n            if (!comp.match(/^[0-9]+$/)) {\n                break;\n            }\n            cur = cur[parseInt(comp)];\n        }\n        else if (typeof (cur) === \"object\") {\n            let found = null;\n            for (const key in cur) {\n                if (key.toLowerCase() === comp) {\n                    found = cur[key];\n                    break;\n                }\n            }\n            cur = found;\n        }\n        else {\n            cur = null;\n        }\n        if (cur == null) {\n            break;\n        }\n    }\n    assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n    if (type && cur != null) {\n        if (type === \"int\") {\n            if (typeof (cur) === \"string\" && cur.match(/^-?[0-9]+$/)) {\n                return parseInt(cur);\n            }\n            else if (Number.isSafeInteger(cur)) {\n                return cur;\n            }\n        }\n        if (type === \"number\") {\n            if (typeof (cur) === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n                return parseFloat(cur);\n            }\n        }\n        if (type === \"data\") {\n            if (typeof (cur) === \"string\") {\n                return looseArrayify(cur);\n            }\n        }\n        if (type === \"array\" && Array.isArray(cur)) {\n            return cur;\n        }\n        if (type === typeof (cur)) {\n            return cur;\n        }\n        assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n    }\n    return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n    let currentChild = object;\n\n    for (const comp of path.toLowerCase().split('/')) {\n\n        // Search for a child object with a case-insensitive matching key\n        let matchingChild = null;\n        for (const key in currentChild) {\n             if (key.toLowerCase() === comp) {\n                 matchingChild = currentChild[key];\n                 break;\n             }\n        }\n\n        if (matchingChild === null) { return null; }\n\n        currentChild = matchingChild;\n    }\n\n    return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n    const value = follow(data, path);\n    if (value != null) { return value; }\n    return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n    JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n    const bytes = getBytes(randomBytes, \"randomBytes\");\n\n    // Section: 4.1.3:\n    // - time_hi_and_version[12:16] = 0b0100\n    bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n    // Section 4.4\n    // - clock_seq_hi_and_reserved[6] = 0b0\n    // - clock_seq_hi_and_reserved[7] = 0b1\n    bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n    const value = hexlify(bytes);\n\n    return [\n       value.substring(2, 10),\n       value.substring(10, 14),\n       value.substring(14, 18),\n       value.substring(18, 22),\n       value.substring(22, 34),\n    ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.mapimport { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nfunction stall(duration) {\n    return new Promise((resolve) => { setTimeout(() => { resolve(); }, duration); });\n}\n/**\n *  A **Wallet** manages a single private key which is used to sign\n *  transactions, messages and other common payloads.\n *\n *  This class is generally the main entry point for developers\n *  that wish to use a private key directly, as it can create\n *  instances from a large variety of common sources, including\n *  raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n *  wallets.\n */\nexport class Wallet extends BaseWallet {\n    /**\n     *  Create a new wallet for the private %%key%%, optionally connected\n     *  to %%provider%%.\n     */\n    constructor(key, provider) {\n        if (typeof (key) === \"string\" && !key.startsWith(\"0x\")) {\n            key = \"0x\" + key;\n        }\n        let signingKey = (typeof (key) === \"string\") ? new SigningKey(key) : key;\n        super(signingKey, provider);\n    }\n    connect(provider) {\n        return new Wallet(this.signingKey, provider);\n    }\n    /**\n     *  Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n     *  %%password%%.\n     *\n     *  If %%progressCallback%% is specified, it will receive periodic\n     *  updates as the encryption process progreses.\n     */\n    async encrypt(password, progressCallback) {\n        const account = { address: this.address, privateKey: this.privateKey };\n        return await encryptKeystoreJson(account, password, { progressCallback });\n    }\n    /**\n     *  Returns a [JSON Keystore Wallet](json-wallets) encryped with\n     *  %%password%%.\n     *\n     *  It is preferred to use the [async version](encrypt) instead,\n     *  which allows a [[ProgressCallback]] to keep the user informed.\n     *\n     *  This method will block the event loop (freezing all UI) until\n     *  it is complete, which may be a non-trivial duration.\n     */\n    encryptSync(password) {\n        const account = { address: this.address, privateKey: this.privateKey };\n        return encryptKeystoreJsonSync(account, password);\n    }\n    static #fromAccount(account) {\n        assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n        if (\"mnemonic\" in account && account.mnemonic && account.mnemonic.locale === \"en\") {\n            const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n            const wallet = HDNodeWallet.fromMnemonic(mnemonic, account.mnemonic.path);\n            if (wallet.address === account.address && wallet.privateKey === account.privateKey) {\n                return wallet;\n            }\n            console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n        }\n        const wallet = new Wallet(account.privateKey);\n        assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n        return wallet;\n    }\n    /**\n     *  Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n     *  with %%password%%.\n     *\n     *  If %%progress%% is provided, it is called periodically during\n     *  decryption so that any UI can be updated.\n     */\n    static async fromEncryptedJson(json, password, progress) {\n        let account = null;\n        if (isKeystoreJson(json)) {\n            account = await decryptKeystoreJson(json, password, progress);\n        }\n        else if (isCrowdsaleJson(json)) {\n            if (progress) {\n                progress(0);\n                await stall(0);\n            }\n            account = decryptCrowdsaleJson(json, password);\n            if (progress) {\n                progress(1);\n                await stall(0);\n            }\n        }\n        return Wallet.#fromAccount(account);\n    }\n    /**\n     *  Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n     *\n     *  The [[fromEncryptedJson]] method is preferred, as this method\n     *  will lock up and freeze the UI during decryption, which may take\n     *  some time.\n     */\n    static fromEncryptedJsonSync(json, password) {\n        let account = null;\n        if (isKeystoreJson(json)) {\n            account = decryptKeystoreJsonSync(json, password);\n        }\n        else if (isCrowdsaleJson(json)) {\n            account = decryptCrowdsaleJson(json, password);\n        }\n        else {\n            assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n        }\n        return Wallet.#fromAccount(account);\n    }\n    /**\n     *  Creates a new random [[HDNodeWallet]] using the available\n     *  [cryptographic random source](randomBytes).\n     *\n     *  If there is no crytographic random source, this will throw.\n     */\n    static createRandom(provider) {\n        const wallet = HDNodeWallet.createRandom();\n        if (provider) {\n            return wallet.connect(provider);\n        }\n        return wallet;\n    }\n    /**\n     *  Creates a [[HDNodeWallet]] for %%phrase%%.\n     */\n    static fromPhrase(phrase, provider) {\n        const wallet = HDNodeWallet.fromPhrase(phrase);\n        if (provider) {\n            return wallet.connect(provider);\n        }\n        return wallet;\n    }\n}\n//# sourceMappingURL=wallet.js.mapconst Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n *  @_ignore\n */\nexport function decodeBits(width, data) {\n    const maxValue = (1 << width) - 1;\n    const result = [];\n    let accum = 0, bits = 0, flood = 0;\n    for (let i = 0; i < data.length; i++) {\n        // Accumulate 6 bits of data\n        accum = ((accum << 6) | Base64.indexOf(data[i]));\n        bits += 6;\n        // While we have enough for a word...\n        while (bits >= width) {\n            // ...read the word\n            const value = (accum >> (bits - width));\n            accum &= (1 << (bits - width)) - 1;\n            bits -= width;\n            // A value of 0 indicates we exceeded maxValue, it\n            // floods over into the next value\n            if (value === 0) {\n                flood += maxValue;\n            }\n            else {\n                result.push(value + flood);\n                flood = 0;\n            }\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=bit-reader.js.mapimport { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n    let initial = 97;\n    return words.reduce((accum, word) => {\n        if (word === sep) {\n            initial++;\n        }\n        else if (word.match(Word)) {\n            accum.push(String.fromCharCode(initial) + word);\n        }\n        else {\n            initial = 97;\n            accum.push(word);\n        }\n        return accum;\n    }, []);\n}\n/**\n *  @_ignore\n */\nexport function decode(data, subs) {\n    // Replace all the substitutions with their expanded form\n    for (let i = subsChrs.length - 1; i >= 0; i--) {\n        data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n    }\n    // Get all tle clumps; each suffix, first-increment and second-increment\n    const clumps = [];\n    const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n        if (semi) {\n            for (let i = parseInt(semi); i >= 0; i--) {\n                clumps.push(\";\");\n            }\n        }\n        else {\n            clumps.push(item.toLowerCase());\n        }\n        return \"\";\n    });\n    /* c8 ignore start */\n    if (leftover) {\n        throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n    }\n    /* c8 ignore stop */\n    return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n *  @_ignore\n */\nexport function decodeOwl(data) {\n    assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n    return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.mapimport { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n *  @_ignore\n */\nexport function decodeOwlA(data, accents) {\n    let words = decodeOwl(data).join(\",\");\n    // Inject the accents\n    accents.split(/,/g).forEach((accent) => {\n        const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n        assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n        let posOffset = 0;\n        const positions = decodeBits(parseInt(match[3]), match[4]);\n        const charCode = parseInt(match[2]);\n        const regex = new RegExp(`([${match[1]}])`, \"g\");\n        words = words.replace(regex, (all, letter) => {\n            const rem = --positions[posOffset];\n            if (rem === 0) {\n                letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n                posOffset++;\n            }\n            return letter;\n        });\n    });\n    return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map/**\n *  A Wordlist is a set of 2048 words used to encode private keys\n *  (or other binary data) that is easier for humans to write down,\n *  transcribe and dictate.\n *\n *  The [[link-bip-39]] standard includes several checksum bits,\n *  depending on the size of the mnemonic phrase.\n *\n *  A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For\n *  most purposes 12 word mnemonics should be used, as including\n *  additional words increases the difficulty and potential for\n *  mistakes and does not offer any effective improvement on security.\n *\n *  There are a variety of [[link-bip39-wordlists]] for different\n *  languages, but for maximal compatibility, the\n *  [English Wordlist](LangEn) is recommended.\n *\n *  @_section: api/wordlists:Wordlists [about-wordlists]\n */\nexport { Wordlist } from \"./wordlist.js\";\nexport { LangEn } from \"./lang-en.js\";\nexport { WordlistOwl } from \"./wordlist-owl.js\";\nexport { WordlistOwlA } from \"./wordlist-owla.js\";\nexport { wordlists } from \"./wordlists.js\";\n//# sourceMappingURL=index.js.mapimport { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}<CilCul#D!_Ge)GrHnoKterieLa^L{#LkonLon-LvanLzaMbusNkom!R[rR{RmanRokoRvaTer#TohVl&Zal#Zili#Zu#3D&RanSe^StieTonZin#ZmocZ)k3CyklD]Ft-KinyLan%Og,fO]gTvaZon2AhobytAt*/E/aEdu+EskIk!Iz&Ok|Oud Ud2B-BrDl.D~H!(JkotJ|K<ysLe$R>R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNz<StopisT#2AlupaAp`]Ar aA)E/t!EmieI/otIrurgL`Le[Lub M_Mu,ObotO/olOd[O+,Om=Op Oro[OvRapotRl RtRupTiv(Ud.Utn!V!Vil#V(Y[Y$!Yt 0Bu+Gare)H_&HlaNkotRkusSter&Ta%TrusZin>Z(2O&2KolivUv!4It_N(0Dn(Ke)KrPot0Ak~AlIkRkot2Kli$a:L-oRe[T_Tum1E,1B!a}'#Cib_Fic Fla%KlKr{Mokr!PreseRbyS#T-tiv3Kob,zKt|O^P]mSkSp+jV`]Vo/2AhaOuhoUhopis1Es0BroByt-C@t}ut DnesH+dHo^H,JemJn?Kl`KolaKt<Kum@tLarLevaL.MaM.ntMluv M'Nut P`PisPln PosudPr'odPu$ Raz R(RtSahSl'St!-SudSy)TazT-Tk~Uf!Utn!Voz%Z`uZn!Z<%2Aho)AkAm!ikAv>AzeDolObn(OgerieOzdSn(T Z(2B@}'noD-HaH'#S SnoT(0Oj?Or>2Nam :9O]gOnomie0EktronIpsa0AilIseO%P!ie2Izo^O/aOpejOs2EjEn%K<)Kymo0Ike)0F<ie0Olu%1Eku%KurzePed?P]zeP<tT,kt:C#Jf#Kul)N!ikN)zieRmacieV< Zo+3De,%J{onN#3Al#Gu,ntLozofLtrNan%N)Xa%0Ord1An_IrtOtila2NdSf<T[lT#Ton2Ak%Es#On)2KarNk%3Zi#:LejeRant3N{i#O]g3Lot.2Azu,Ejt2LemLfi$aTi#2AfAmofonAnu+EpIlOgOtes#2Ma:D?DrLaL@#N[NopisRfaRpu&V,n3Bk(J#lJnoJtmanK)rLmaM!omR>R&S]Zky3St<ik2Ad'#AsivkyAvaEd!EnO^v>OhOup(T!Ub.U/o)0AtO)Yz0IsOjivoOut0Bl.Boj}DinyDl!Dno)D|Jn(KejLin#L#LubMo+N [No,%RalR^RizontRkoRliv>RmonRn.RoskopR$voSpo^St.T'(U[UfUp!Us#V<2Ad[An?Av(Az^Bo+kD.D]D(N-Ob#Oma^OtOu^Oz@St#Ub(Yz!2B@(B~D[KotMrS aSto)0Ozd2Bn(D,ntGie&M&Sterik:2Yl#3Ned2O&0Uze0Un a0F-%Fla%KasoOva%Sp-%Tern{Vali^Ve$<Zer%3Onie:Blko})Ho^Kmi+K(L'>N)rRmarkRoSanSnoT#V<Zyk3Din>D+Dn!_HlanKotL@L oMn(NomP?S{erV Zd>Zero3NakNdyNo/Sk,Sto)Trn?Zva3En|1Gurt5R):Bar{B_Bin{}&D{Did]HanJakJu)KaoKtusLam aLhotyLibrLn(Me,MkolivM&Ni[lNoeNt<Pal.P_aP olaP#P+Po)PrPu$aPy[,Ram_Rot#RtonSaTa]gTed,U%UzaVa+cZaj#Ze)Ziv(2EkolivEsi0Dlub@MpRami#3No2A%kAdivoAmApotAsi#AunEcEn[Ep!Es~IdImaIs&Ob*kO#nOpaOubUb'&Us!Uzk(0EnIt!Otr0IhaOt0Al?Ber>B#BlihaBylaC*rH=J@>KosKtejlLapsLe^LizeLoMandoMe)MikMn!aMo,MpasMun aN!N%ptNd?N>NfeseNgresN.NkursN)ktNzervaPan>PieP~Pr'#Rb_R-t<Rmid]RoptevRpusRu&RytoRz{S!>St#T_T+)T*lUk!Up_&Us-Uz]VbojZaZ<oh2Ab?A/Aj.Al|AsopisAv!aEd EjcarEs[Eve)Ik{ItikIzeKav>Me+cMivoOcanOkOni#Op OupaOv#T-Uh`]Up?Ut(Vin#Y/+Yp)Y$alYt2Dlan#FrJn(KlaLaj^Li/L#Lom{Ltu,NaPodivuRtRz<Til0Al aAsin#E$<2No]gS_.Ta,T?T#T'>V`]:B,d<})nDn(IkKom>M_aMpaN'#S?SoStu,Tin#V.3B#CkdyD@Dn?D'#Dv.G@^GieG,%H%Hk(H~KtvarNo/odNtil#P@#Pid]T`]T>TmoTokruhVhartV a%Vobok3B,}ot#DojedDsk(H'.Jav>L-M{#NieN#No+umStop`T.T|5Bi$aDivodGi#GopedKal aK{Mc|P!aPu/RdSosTrU^lUhU#Usk!V>3Tiv(1Cer&CiferMpSkSt,%0I%2RaRi#S.:DamD]Gi$rHagonJ{-J _J< aKakK'?Kr_aL[L.L|Lv?Min#Nd+NkoRn(SakrSkotSopu$T?Tri#Tur aZan>ZivoZl Zur#2Lo[0}anikD a%D'.LasaL*nNtol#TlaTo^TrZe,3G,%H~Hu+K.KrofonL@>Lim{rL(Mi#Nc'&Ni[rNom{Nul(S#StrX|2Ad(HaH'.OkS!Uv 1I/Ohem0BilCn(D_#Dl [HylaKroL-ulaM@t#Nar/aNoklN$rumNt|NzunSazSkytStTiva%T<#Ty#U/aUdr(Zai#Z-Zol2Am<Av@>KevTvolaZ{Zut(0T _1DrcF]nL!MieN?S{Ta%ZeumZi#nt3Sliv>0Da:B*r!}yt!Da%Dbyt-DhozDobroDpisHlasHn!Hodi+H,d Iv aJedn*Ji$oJm=K]n Kon>Krm LevoMaz!Mluv Nom{rOkoOpakO$roP`!PevnoPln P~Pos+dPr(oRod RubyRy/]S` S-!S+poSt!TolikV@-Vr/Vzd<yZv!3Be}!CkyDa+koDb!DuhGa%H{Ho^J@JprveKlidLib(Mil(MocO/o)On#PokojR(RvSmyslS*l`Tv<UronV.Zvyk+3Co)JakKamKdyKlKte,kTro5C+hHav?M.%RaR-S _Sn(UzeVinyVo)Zd,5DaD+G{T Tn(Trie3Mfa:0AlArv AvaDivEcEhn!Ejm=Ez aHajo[Iln?Jasn J-tK]p La$L-Li[LohaLu^NosOh! Oj-OutRaz>R&Ru[RysSahSluhaS)r!UvVazVin VodVyk+Yv!_Z<0AsElEn Hl` Ho)H,&It~0BojByt}odCiz Ebr!Esl!Evzd!EzvaH`%Hod J{JinudKazK*p LivLu#Ml#Oln(P`PisPl=P<Pu$ Pyk!Raz#S*d StupSunTokTudVahaVe)Vol!V,%tZ&k1I&Sajd1LasNiskoRa^Roz Ryz-2ApEn?Li#NoOuzl OvyRasaResRs-RuhUpantUr#Us 0Ejn.Iz|0AkE+)Ez L`.L*v!LuvaYl0Ehdy1Ak|As-E,%I%Il(Is|O,Oz?RavduRoti1B al}e$rGieL?LojT_0A^}~I#IvoLavaLep Ln L' N'aO[Ol Pa+cT@T,haTu^Ty/Voj 0Epl IskOpRh!Rl(RokRubyV<1A~ArEsLivn O%1Id1Do[:}!_Ci@tD*/H<-KtLan^L>LivoLu[Mf+tMls-N@#Ni#N&N|N$voNtof+Pri#Rke)RodieR)Ru#Ry[Se#Siv aSt_#T@tTro&V*kZnehtZ*r-3C#DagogJs-K]LotonNal)Ndr-NzeRiskopRoStr(Tar^T?Tro+jVn.Xeso3Ani$aHaJav?K+KnikL.Ln(Lul#Nze)Pe)S!_Sto+Tev&Vn?V'ar2A%n)Ak!Am@Ane)A$i#At Avid]AzE/Em@oEn)EsEtivoEv_Iv!N NoO/aOd.Om[OutUkYn2Bav Byt}odC Ctiv>D!D%n Deps!Dh+dDiv Dkl`Dman DnikDo[Dpo,D,zD$!aDvodDzimEzieHan#Hnut#H'<HromaHybIn)Ji$#Jm=Kaz K+sKojKrokKu)KynLedneLib-Lk~LohaLynomMaluMi~Ml#MocM$aMys+tNe/!N<#Nur(P`!P_Pis-Pla/Pros Ps!PudR`%R%RodRu/aRyvS` SedSilaSkokSlan>S*d SpoluS)vaSud-SypTahT#nT+skTom-T,vaTupaTvo,U#zUtoUzdroVahaVidlaVlakVozVr/V$!VykVzde/Zd,vZem-Zn!-Z<Zv!2Ac|Ah<yAkti#A+sAot>Ap<-AseAv^IncipKnoObud O%ntoOdejOfeseOh,Oj-tO]m Omi+Onik!Op`OrokOs[OtonOut-OvazS#v#St@Udk(UtV-Voh<y0An>OvodTruh0Actvo0Ber)}DlKav>Kl.Kr+LtMpaNcP@SaSin#St.T|Ty#3Rami^SkT_::C-}otDia%Dn?DonFtGbyKe)K'.M@oMp*/NdeRa/R aS'&StrTo+$Zan%Zid]3Ag|Ak%CeptDakt<Fer@tF+xJnokKlamaK<dKrutKt<Pu)%VizeVmaVolverZerva3Sk|Ziko5Boti#Dokm@H'#K+KokoMan{oP'odPu/aRejsSolStl.Tmi$rTopedTun^Ub@#U/oUpU,V.Vn?Zb<Z/odZd!Zezn!Zhod%Zin#ZjezdZ#zZ]haZmarZp`Zru/ZsahZtokZumZvod5Bri#}`]Kav?Kopis3BaBol'}l(D]P`]T.Z(:Di$aH!KoM>Mizd!Mo)N #Rdin#San#T_ Z[Z@?0Or0H|1B,n#CeseD`]Dim@tD]Hn!Jm=Ke,K)Kun^KvojeM@oNoRvisS` Sho,SkokSl!St,SuvSyp!T[T.Tk!T~Trv!VerZ&m2O^R~0FonLn?R#Rot-RupTua%1AfandrAliskoAnz@AutEptikIcaL`[L@?LoLuzO[O#nOroRip)RzUp.V(Vr&0Abi#Adid]An.A$Avn(Ed|Ep>EvaEz.IbI&Izn?OnOup-OvoU/UhaUn%Up#Za0A,gdE)&Il$voL*vaOgR`RkRt#Ut-Ysl0AdAhaOb0Bo)}aD'#KolP#TvaUbojUc Ud%UhlasUl`Um,kUp,vaUsedUtokUvis{0Al'&As _IsLavOd-Oj@>OluOnz<Orn(Ou$aR/aU$ 1An^AzD%NaN>Ovn!P@StUb1An?Ar(aAti#Av[EhnoEz#OdolaO+kOpaOrnoOup!Ra/ResRh~RomRu&Ud&Upn?VolYk0Bj-tBtropy}arD(KnoNd!N=Rik!aR'.0AhAl$voEtrAt[Az-Is+It-Obo^Odid]Or#Rab2Kav#KotN-N'>P!Pk(R'(S_T(:B+t#Bu+H*nJemnoJfunJgaJ Jn(Kti#Mh+MponNc|N>NkerPe)V@.Z!_3}ni#HdyKut.LefonMno)Nd@%Ni$aN<P])P&PrveRapieRmos#Xtil3}oSkopisTu+k1Ad+cAn.0Ap#Esk!UkotUpa0El1A+)Pin#PolRzoUhaU+c2Ad?Akt<AmpAsaAverzaEf E$Ez<Hav.Hl.O/uOj?Os#Ou[P%P _Pk(Ub>U/l Uhl?UsV!2DyH~H(Nd,Ri$aR&jZemsko0ArohOr[Rd(Rz2GrKev:0Oh(OzeR!R*s-RusYt'&0HoTiv(0Iv 3R` 1Edn!I$ M=0Az!_Lidn Lon Otv Roj 0I%I)Ov 0Yv`]0Av If<maIk~1Ad~L!n Ly~Out!Rav 1AnAz 0Ed~Il|Mrt N`n N=Oud Tl!Tr~0Ah|K!Lum O~Op@>R*s 1Al Oln Oz'#3D,v ElEn.L.N!:GonL/aL*nNaN^lNil#RanRhanyR|1ElkuHod0Ova0DroGe)%J%Lbl*dL{rhL _LmocLry[Nk'Ran^RzeS_#SkrzeSn?SpoduS)Ter.Ver#3B,%}rDeoh,D.D+LaN?S{Tal aZeZ #0Ezd0L`Us0Aj#AkAs>EvoHk(IvN'#Oup!1Uc|Uk0DaDiv(Doz&kD$voJ@skyJ&JskoLantL[L LnoSk'#Zid]Z'&0Ravo1Ab>A%tAhA)Ba}o+kH!StvaTu+0Ad T*p Tup0Ip4Bav Br!}|D!D,Fot H+d!H~Hod H,d Hub Jasn J{Jm=K]p Kon!L-!Maz!Mez Miz{Mys+tNe/!Nik!Nut P`!Pl! P,v Pu$ Raz R'n!Rv!Sl' SokoS)v Su~Syp!Tas Tes!Tr! Vi~Vol!Vrh_Zdob Zn!0AduBud }op D<Du/Dy/!E$upH+demKazLyk!NikOr-P*,TahT-::993Lofon::Br!Byd+t}|DarmoDus F*k!Hlt Hod H,^Hy~J!>J{Ji$ K+p!K*p Lep Mez Mot!Mys+tNe/!Nik!Pl! Poj Ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk\";\nconst checksum = \"0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a\";\nlet wordlist = null;\n/**\n *  The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangCz extends WordlistOwl {\n    /**\n     *  Creates a new instance of the Czech language Wordlist.\n     *\n     *  Using the constructor should be unnecessary, instead use the\n     *  [[wordlist]] singleton method.\n     *\n     *  @_ignore:\n     */\n    constructor() { super(\"cz\", words, checksum); }\n    /**\n     *  Returns a singleton instance of a ``LangCz``, creating it\n     *  if this is the first time being called.\n     */\n    static wordlist() {\n        if (wordlist == null) {\n            wordlist = new LangCz();\n        }\n        return wordlist;\n    }\n}\n//# sourceMappingURL=lang-cz.js.mapimport { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n *  The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n    /**\n     *  Creates a new instance of the English language Wordlist.\n     *\n     *  This should be unnecessary most of the time as the exported\n     *  [[langEn]] should suffice.\n     *\n     *  @_ignore:\n     */\n    constructor() { super(\"en\", words, checksum); }\n    /**\n     *  Returns a singleton instance of a ``LangEn``, creating it\n     *  if this is the first time being called.\n     */\n    static wordlist() {\n        if (wordlist == null) {\n            wordlist = new LangEn();\n        }\n        return wordlist;\n    }\n}\n//# sourceMappingURL=lang-en.js.mapimport { WordlistOwlA } from \"./wordlist-owla.js\";\nconst words = \"0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@Ce<C~Ei)ElgaEn#Ept I&L  NeOg!O<TivoToTrizTu Ud*U!&Us 0Ic#Mit*Opt Or'Ua`Ul#0Reo0Ect Ic~In Irm 0IlIt On@Os#Ot Reg R$UaU&U?aUja0OgoOr+0ReSl 0Ed_zE'Us)1Ac[nAmb_ArmaBaBumCaldeDeaEg_Ej Er%E%F?!GaGo&nIa&I,#Iv$MaMejaMib T TezaTivoToTu[Um'Z 0AbleAn)Apo]ArgoAs B Bi#E'IgoIs%dOrP oPl$0|oC@'C]D D,Em@Gu=Il=ImoIsOt T,aTiguoTojoUalUl Unc$Ad*EjoO1Ag A[#Eti#IoLic O&Or)OyoR,d!Rob Ues%U+1A&A`ArBit+BolBus#|ivoCoD!D?]DuoEaI&IesM.i-esOmaPaP.Reg=RozRugaTeTis%0AA&Al#C,<Egur EoE<rI,#I=Ist*NoOmb+P!oT?]T+Tu#Um*Un#0AjoAqueArEn#EoI>Le%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb_Lo<Lu]M,#Niz-t+Rc(&Rez(oRr R)zaSpedT+2AcalAle>AmpuAnc]ApaAr]I>Is)IvoOqueOzaUle%Up 0Cl.EgoE=EnEr#F[G +M->NeN%P_sR>Rue]SneTaU{d2Am^AnA+AseAveI,)ImaInica2B_Cc~|i'Ci`CoDigoDoF_G!He)JinJoL/ch/eg$Lg Lin/l LmoLum`Mba)M!Mi{Mo&Mpr-deNej}g-oc!Nsej}t PaPi(az.Rba%RchoR&nR.(r!S!SmosS%2AneoAt!E Ec!Ei&EmaIaIm,Ip%IsisOmoOnicaOque%U&Uz2Ad+Ar#At+BoBr*| aEl=En#Er{Es%EvaId Lebr/p/#Mb_Mpl*N-e%O%P.Pul( R$<R<RvaTis:M-z(R&T?3B!B?Ca{C*DoF,saFin*J LfinLga&Li#M^-<N%lP^)RechoR+%Sayu'SeoSf?eSnu&Sti'Sv$TalleT,!U{3AAb=AdemaAman)A`Ar$BujoCt En)E%EzFic?G'Lem/u*N!oRec#Rig*S>Se'Sf[zVaVi'5BleCeL^Ming}N Ra&Rm*R<SSis2Ag.Oga2|aDaE=E'LceOQueR Rez(o:0A'R$0H OUa&r0AdIc~Ific$I#rUc 1Ec#Icaz3EEmp=1Efan)Eg*Em,#Ev IpseI)Ix*Og$Ud*0Bu&It*Oc~Pa)Pe'PleoP_sa0A'C go|ufeC@EmigoE+Fa&F!moGa'Igm/aceOrmeRe&SayoS, T!oTr VaseV$1Oca0Uipo0Izo0Ca]C,aCol Crib*Cu&Enc@F!aFu!zoPa{PejoP@PosaPumaQuiT TeTi=Tufa0ApaEr'Ic-@1Ad*Alu En#It 1Ac#Am,Ce<CusaEn#Ig*Il$Ist*I#P!#Plic P.!T_mo:BricaBu]|a{C?C#rE`J/d/=L<Lt MaM?@Mo<Ra.Rmaci(olRsaSeTigaU`V^X3Br!o|/izORi(ozRt?Rv^Stin3AbleAnzaArB[Cc~|aDeoEb_ElE[Es%Gu[J JoL/e)L@lLt+NNc-g*Ni#Rma2A>Au%EchaOrO%U*UjoU^2B@CaGa%G.L$Lle#N&Rm(+Rtun(z SaTo2Aca<Ag?AnjaAseAudeE*E'EsaIoI#U%2EgoEn)ErzaGaM Nc~Nd(g.R@S?TbolTu+:Ce]FasI%JoL/!i/=Mb- Nch}g-<RajeRzaSoli`St ToV?an3Me=M*NN!}$N)Ran$R,)Rm,S#3Gan)M`s$R Ro2Aci OboOr@2LLfoLo<LpeM(&R?([TaTeoZ 2A{Afi>A'AsaAtisAveIe%Il=IpeIsI#O<rUaUe<UmoUpo2An)ApoArd@Er[IaI'I.I<It [Sa'St :B!B?Bl C!|aD/l Mac(i`ZZa`3B?]B[|oLa&L$Mbr(*Rma'RoeRv*3E=Er+Ga&Gi,eJoM'S#r@5Ci>G Gu!aJaMb_Ng}^Nr((mig('St?Yo5E>ElgaEr%E<EvoI{IrMa'Me&M?deM}d*RacanR#:1O'0EalIomaO=2Lesi/uUal4EgalUs~0Ag,AnIt P P!$P.!Pul<0CapazDiceEr)FielF^meG,$Ic$M,<MuneNa#Sec#S%n)T!esTimoTu*Ut?Vi!'3AIsOn@0L/o):BaliB.M.RabeRdinR[U]Zmin3FeRinga3Ne)5R`d(obaV,Ya5ErgaEvesEzGa&rGoGue)Ic$N>Ngl-$Nt Pit!R S#V,?Zg :7Lo5A]:B$C$C[DoD+nG #GrimaGu`I>M!Mi`Mp --ch-gos%NzaPizRgoRvaStimaTaTexT*U_lV Zo3AlCc~|eC#rErG~Gumb_Ja'Ngu-#NaOnOp &S~TalT[VeY,{3B!%dB+C^D!Di EnzoGaG!oMaMi)M.Mp$NceN&Ne-go)N}t!`Qui&SoS%T!aT$T+2AgaAmaAn#AveEg En Ev Or Ov!Uv@2BoC~CoCu[GicaG+MbrizM}jaTe5|aC*G J}-esPaSt+ToZ:Ce%|oD!aD_Du+Est+F@G@GoIzL{dLe%Ll/oMaMboMutN>N&Nej Ng-iquiNj N}<N%Na`PaQuin(R>Re(f?Rg,Ri&RmolR+nR)sRzoSaSc aSivoT T!@TizTrizXimoY^Z^ca3|aDal]D$Du]J?]J^L,/.M^i-^NsajeN)NuRca&R,gueRi#SS.TaT!To&T+Zc]3E&ElEmb+G/Lag+Lit Ll.M}-!}im}u#OpeR SaS!@S?SmoTadTo5|?aC~DaDe=HoJ LdeL!Li'M,#Mi- c-ed-j-#NoRad(d!Re'R*R+Rs(%lScaStr TivoV!V?Zo5|oD EbleE]Er)Est[G_J!L/e%L%N&Nec(alRoScu=SeoSgoSicaS=:C C~D IpeRanj(izRr SalTalTivoTu[lUseaValVeVi{d3C$Ct G Goc$G+OnRv$ToUt+V V!a3|oDoEb]E#NezNoTi&Vel5Bleza|eMin(i(m()TaTic@Va#Ve]V$5BeCaCleoD?=DoE[EveEzLoM!oTr@:Sis0E<IspoJe#R(!oS!v T,!V$0AA<Ea'H,%HoIoReTavoTub_Ul#Up Urr*0I IoIsea0S)0EnsaEr%Ic$Rec!0Ro1DoR0O1AEa{Fa#IvoLaMoOrVi&0Bligo0DaZa1A>C~E[In On!T TicaUes#1Ac~A&rAlBi%CaD,EjaGa'G@Gul=I,)Ig,Il]OQues%Uga0Ad@Cu+Ez'OT[0O'Ro1EjaU=1I&Ige'0En)0O':C#D_El]Gi`GoIsJ oLabr/>Le%Li&Lm/om/p NNalNi>Nt!-ue=PaPelP?]Que)R Rcel(edR*RoRpa&RqueR[foR)S SeoS~SoS%TaT$Tr@UsaU%VoYa<3A#nCa&C!a|oDalD*G IneL L{'Le/ig+LlejoLoLuc--s N.OnOrPi'Que'R(ch(d!Rez(f?Ri>Rl(mi<R+Rs.aSaScaSimoS%`Ta=T+leoZZu`3C |.EEd[Er`EzaJam/ Lo#Mi,%N}#rNz-aOjoP(a%S Sci`SoS%T.Zca2AcaAnA%AyaAzaEi#E'OmoUmaU[l2B_CoD!D$EmaEs@E%L,Lici/=LvoMa{Me=MoMp-!Rc~R%lSa{Se!SibleS)T,c@T+Zo2A&E>zEgun%Em$EnsaE<Ev$ImoIncipeIs~Iv OaOb Oce<Oduc#OezaOfe<rOg[maOleOmesaOn#Op$OximoUeba2Bli>|!oD^Eb=Er%Es#Lg/*Lm.LpoL<M-#NalNoPaP?(e:99Ed EjaEm Er!E<Ie#ImicaInceIt :Ba'B@BoC~DicalIzMaMp-ch}goPazPi&P#SgoSpaToYoZaZ.3Acc~Ali{dBa'Bo)Ca!Ce%|azoCog!C_oC#Cur<DD.&Duc*FlejoF^maF[nFug$Ga=G*G]G_<H,I'IrJ/a#LevoLieveLle'LojM Med$M}>rNd*N%P #Pet*Po<Pt?SSca)Si`Spe#S#Sum,T*oT^'T[#Un*VesVis%YZ 3CoEgoEn{EsgoFaGi&G^Nc.N.OQuezaSaTmoToZo5BleCeCi D DeoD?]ErJizoJoM!oMp!NN>N{PaP!oSaScaSt+T 5BiB^DoE{G*I&In/e%LoMboM^Ptu[TaTi`:Ba&B!B$BleC GazG[&L/&L!oL*Lm.L.Ls/#LudLv Mb-c~Ndi-e Ng_Ni{dN}#PoQueRdin()nSt_TanU`Xof.3Cc~CoC_#C%DGu*IsL=LvaMa`M?l-d-<rNalN^P  P@Qui(RieRm.Rv*S,%S~TaT,%V!oXoX#3D[Es%E)G=G'Lab/b L,c$L]Mbo=M$R,aS)maT$Tu 5B_C$D$LLap/{&Le{dLi&Lt Luc~Mbr-de}i&No+NrisaPaPl P^)R&Rp_s()oS)nTa'5AveB*Ce<D^Eg[E=E'Er)Fr*Je#L%nM P! Pl*P.!P_moRR>Re'Rg*S#T?:Ba>BiqueB]BuCoC#JoL L>L,#Ll/.Ma'Mb^Ng}quePaPe)P@P.Qu?l(deRe(if(je%RotR+R%TuajeU+ZaZ.3At+|oC]CnicaJa&J!Ji&L/efo'MaM^Mp=NazNd!N!NisN<Ori(api(>Rmi'Rnur(+rSisSo+StigoT!aX#Z3B$Bu+nEmpoEn{Er[E<G_J!/deMb_Mi&M}%OPi>PoR(.TanT!eTu=Za5Al]B?=C Ci'DoG/&M N}#P PeQueRaxR!oRm,%RneoRoRpe&R_R<RtugaSS>S!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv!<OT A3Ba'BeG,)Na0ArU $0IlOp@1A:CaC$Cu`G GoI`J?l/eLi&LleL^Lvu]Mp*oR(i R.So3Ci'C#rHicu=In)JezL/!oLozN-c!Nd-e'Ng N*N%NusRRa'RboRdeRed(j(<Rt!3AAjeBr C$CtimaDaDeoDr$EjoErnesG^LLl-ag_N}e&OlinRalRgoRtudS^Sp!aS%Tami`U&VazV!oV*Vo5LcanLum,Lv!RazT ToZ5E=Lg :::C!Te3GuaM('So9DoGaGur:F*}jaPa#Rza93N(+5MoR&\";\nconst accents = \"aeiou7695@@BZWWavwUJkO@Y-Kn))YEGq#E@O)cI@#ZkMHv$e*))M!!)D**$GW!oKm*Acoh^k&It-pi^SYW)$^n!G)bO!Wkzam(jS#X)Og*^l^RW!bQ#QygBKXfzE))hti!Qm)Cng%%c)mJiI*HJWbmYniCLwNdYyY%WKO^bnT$PuGOr!IvHu&G(GKbtBuhiW&!eO@XMeoYQeCa#!MrTJCq!OW&CHG(WCcW%%)$rfrIegu$)w!G)JGmWWw)MnD%SXXWIT^LWAZuVWB^W)eTL^x&$WGHW(nKWEMA)#$F$x$Waekqs,n7715)W*HM-$WAcCiu(a))VCZ)GG%(*CWWdW%$D!UCO$M\";\nconst checksum = \"0xf74fb7092aeacdfbf8959557de22098da512207fb9f109cb526994938cf40300\";\nlet wordlist = null;\n/**\n *  The [[link-bip39-es]] for [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangEs extends WordlistOwlA {\n    /**\n     *  Creates a new instance of the Spanish language Wordlist.\n     *\n     *  This should be unnecessary most of the time as the exported\n     *  [[langEs]] should suffice.\n     *\n     *  @_ignore:\n     */\n    constructor() { super(\"es\", words, accents, checksum); }\n    /**\n     *  Returns a singleton instance of a ``LangEs``, creating it\n     *  if this is the first time being called.\n     */\n    static wordlist() {\n        if (wordlist == null) {\n            wordlist = new LangEs();\n        }\n        return wordlist;\n    }\n}\n//# sourceMappingURL=lang-es.js.mapimport { WordlistOwlA } from \"./wordlist-owla.js\";\nconst words = \"0erreleontiteurinueiriet cegeanseali medenel q)eniluxaus ch0Ais}And$Diqu E`#Ol*Ord Ou%rOy RasifReuv Ri,Rog RuptS_-SoluS'@UsifYss=0A@m+AjouAr+nCab]Cep,Clam Cola@Cro~eCu}ErbeHatHe,Idu]I Omp&Qu *R$y?Te'TifT)l0Ep&EquatHesifJec%fJug Mett!M* Op,Or Ouc*Res<RoitUl&V be0R R$ef0Fai!Fec,Fi~eF!{Fub]0Ac Enc I#I,Raf Reab#Ru?1D Gu`#L>Mab#S/-0Ou,Us,1Arm Chim+Er&Geb!G)I_ I?ntLeg Lia.Lou Lum O'd*PagaTes<Veo#0A&'BiguB!Enag Ertu?Id$Ir=Orc O'Ovib#Phib+P#'Us/t0Aly<Apho!Ar~+Atom+C+nE/%rG#Gois<Gu#{Im=Nex N$-N)lOd(Om=+Ony?Orm=T_[Tido&X+{1Ai}Eri%fL/*Olog+Pa!`Pe]Por,Puy 0UariumUeduc0Bit!Bus&De'Doi<G_tLequ(Matu!Me?ntMoi!Mu!P_,Ra~ Riv Ro}S_icT +lTic#0PectPh=&P* S|tS v*S+t&Soc>S' TicotT!Tu-0El>O?RiumRo-Ta^T_%fT* Trap 0Ba(eB .Da-Dib#G' Ro!Tom[Tru~e0A]Anc Ari-En*Er<Eug#Ia&'I@I$I}O(eOu R`1I=Io?:D.Fou Ga.G)t&Igna@L/c Lc$Le(eLisa.Mb(Ncai!Nda.Nl+)Nn>eNqu>Rb>R`R$R^Rra.Ss(S%$Ta`#Te|T,+Udr>Vard 3Let&L>Lo&Nefi-R-|Rg Rl(eRmudaSa-Sog[Ta`Ur!3B $Cyc#Du#JouL/L(g)LlardNai!Olog+Ops+OtypeScuitS$Sto'iTu?Zar!2AfardAg)An~*Ess/tInd OndOqu Ous$2BardB(eI!I}Li@Nb$Nd*Nhe'Nif>NusRdu!R[T&Uc#Ue{Ug+Ul$Uqu(Ur<Usso#U%^Xe'2An~eAs>AveEbisE~eEuva.Ico]Iga@Ill/tIo~eI^O~u!Od Onz Ous<Oye'U?Us^Ut=Uy/t2Ff#Iss$L#%nRe|R(S% T( To*Vab#Vet&:B/$B(eChet&De|D!Fe(eIllouIss$Lcu]Lep(Lib!Lm Lomn+Lvai!Mara@M aMi$Mpag[N=Net$N$N%[NularPab#Por=Pri-Psu#P,Pu~eRab(eRb$eRes}RibouRna.Rot&R!|Rt$Sca@S>S^Ssu!U}U%$V=>V [Viar3D`#Intu!Les&Llu#Ndr>Ns' Ntr=Rc#Rebr=Ri<Rn Rve|S}2Agr(Ai<A#'Amb!An-Apit!Arb$As<'At$Auss$Av* Emi<En`#Equ>Er~ Ev=I_Iff!Ign$Im eIotLoru!OcolatOis*O<O)t&Ro?U&0Ga!Gog[M_,NemaNtr Rcu]R R^T [Toy_Tr$V`2A*$A?'Aqu As<Av>I_tIgn ImatIva.O~eOna.Opor&2B=tBraCas<Co% D Dif>Ff!Gn Hesi$Iff Inc L eLibriLl(eLma,L$elMbatMed+Mm/@MpactNc tNdui!Nf>N.]Nno,Ns$[NtactNvexePa(P+Ra`Rbe|Rda.Rni~eRpusR!ctR&.Smi^Stu?T$U@Upu!Ura.U&|Uvr*Yo&2AbeA(&Ava&Ay$Eatu!Edi,E?{Eu}Evet&Ib]I Ist=I,eOi!Oqu Ota#Uci=UelYp,2Bi^E`l*Il]eIs(eIv!Lm( L%v Mu]Pi@Ra%fR<'3Anu!C#L(d!Ni^:Ign M>Ng N<'Uph(3Batt!Bi,Bord Brid But/tC= Cemb!Ch* Cid Clar Cor Cri!Cup]Da#Duc%fEs<F_sifFi]Fray Gag Givr Glu%rGraf Jeun Li-Log M/d Me' Mol*Ni~ Nou N&l#Nud PartP_}Pha}Plac Po}R/g Rob Sast!S-n&S tSign Sobe*Ss( Str>Ta~ Tes,To' T!s<V/c V_*V( Vo*3Ab#Alog)Am/tC,Ff  G  Git=G[Lu M/~eM(u Oxy@Rec%fRig Scu,Spo}Ssip St/-V %rVi}5Ci#C&'G?IgtMa(eMici#Mp,Na&'Nj$Nn Pam(eRto*Ru!Sa.Se'Ss>Ta%$U/>Ub#U-'U,Y_2Ag$Ap Es}Ibb]Oitu!2P +P#xeRab#Rc*3Nas%e:0Lou*0Ar,HarpeHel#La* Lip<Lo!Lu<O#Onom+Or-Ou,Ra}Rem Riva(RouU?U!u`0If>Uqu 1Fac Fec%fFig+FortFray Fusi$0Ali}Ar 2Ec,1Abor Arg*Ectr$Eg/tEph/tEveIgib#I%s?O.Ucid Ud 0B=]Bell*Bry$Er|@Issi$M_ O%$Ouvo*P e'Ploy Por,Pri<Ulsi$0Cadr Ch eClaveCo~eDigu Dos}DroitDui!Erg+F/-F m Fou*Gag G(Glob Ig?Jamb JeuLev NemiNuye{Ri~*Roba.Seig[Tas}T_d!T>To' Trav Um  Vah*Viab#Voy Zy?0L+n0Aiss*Arg[At/tAu#Ic +I@m+I Ilog)I[Iso@ItapheO^ReuveRouv Uis/t0U !Uipe0Ig Osi$Re'Up%$0C=>Pad$Pe-P+g#Po*PritQuiv Say S_-S+uSor Ti?TomacTra@0Ag eA]An~eA%^E(d!Endo*Er[lH/olHi^Hn+Ir Off Oi#Onn/tO'd*R/.RoitU@0Phor+0Alu Asi$Enta`I@n-I,Olu%fOqu 1ActAg  Auc Cel]Cit/tClusifCu<Ecu,Emp#Erc H= Hor,I.n-I]Is,O%^Ped>Plor Po}Prim QuisT_sifTrai!Ul,:B#Bu#{Cet&Ci#Ctu!Ibl*Lai<Me{M`#R-'RfeluR(eRou~eSc( T=Tig)Uc$U%fVe'Vori3Bri#C$d D  L(M?M'Ndo*Od=Rm Ro-Rve'S%v=U`#Ut!Vr>3AscoCe]C%fDe#Gu!Latu!Leta.L>eL#ulLm LouLtr N/c N*O#R?Ssu!X 2A* Am?As^At&'E|E~eE'Exi$Oc$O!Uctu Ui@Uvi=2L+Nd +Ngib#Nta(eRc Rg $Rmu]Rtu[Ssi#Ud!Ug eU`]Ulu!Urmi2Agi#Ai<An~*App Aye'Ega&E( El$Em*E[s+E!Iab#Ic%$Iss$Ivo#OidOma.Ont=Ot,Uit2Gi%fI&Re'R+{R%fSi$T':Gn Lax+L +Mbad R/%rRd+nRn*Rrig)Zel#Z$3AntLa%[Lu#Ndar?N =N+NouN%lOlog+O?t!R/iumR?St)lY}3B>C]RafeV!2A-AiveIs}ObeOi!Or+{2Lfe'M?Nf]R.R`#Udr$Uff!UlotUp`#Urm/dUt&2Ad)lAffi%A(eAndApp(AtuitAv*EnatIffu!Il]Imp Ogn Ond Ot&OupeUg U% Uy e2EpardErr>I@Im|veIta!Sta%f3Mnas&Rostat:Bitu@Cho*L&Me|NgarN[t$RicotRm$+Rp$Sard3LiumMato?RbeRiss$Rm(eR$Si,U!{3B n BouLar/tStoi!V 5MardMma.Mo.[N['Nor N&{R@Riz$Rlo.Rm$eRrib#U#{Us<5BlotI#{Ma(Mb#Mi@Mo'R]3Dro?lG+[M[Pno<:2Yl#2Nor U/e4Lici&Lusi$0A.Bib I,M_<Mobi#Muab#PactP i=Plor Po}Prim Pu,0Carn C_d+Ci@ntCl( Colo!Dex Di-Duc%fEditEp%eExactF(iFlig Form Fusi$G  H= Hib Jec,Ju!No-ntOcu]Ond Scri!Sec&Sig[Soli&Sp* S%nctSul,TactT_<Ti?Trig)Tui%fU%#Vasi$V_,Vi,Voqu 3Oni^Rad>ReelRi,0O]2Oi!Res<:GuarIll*MbeNv>Rd(Ug U[Velot3Tab#T$UdiU[s<9Ind!N~ Ng]Ue'UissifUrn=Vi=Y|Ye{5Bi]Ge?ntNiorP$Ris&S%-Te{V_i#:Yak7M$oOs^:BelBi=Bo' C  Cto<Gu[I[Is}I% Mbe|Mel#MpeN-'Nga.N,[P(R.'R?Ur>VaboVo*3Ctu!G=G Gu?SsiveTt!V>Xi^Zard3As<B  B!C_-Cor[E.Ev!Gatu!Go,G)M Mi&M$a@Mpi@Neai!NgotOn-|Qui@S>eS,ThiumTi.Ttor=V!'5Gi^Inta(Is*MbricT +U UrdUt!UveY=5B+Ci@Cra%fE'Gub!Is/tM>eNai!NdiR$T,X){:Ch(eGas(G_taGi^Ig!Ill$In%_Ir+Is$Jor Lax Lefi-Lhe'Li-L#t&MmouthNda,Niab#Nqu/tN&|N)lRath$Rb!R~/dRdiRi%?R^'Rr$R&]Scot&SsifT +lT>eTra^Udi!Ussa@UveXim=3Ch/tC$nuDa`#Dec(Di,Du<Il#'L/.Lod+Mb!Moi!Nac N Nh*Ns$.NtorRc!diRi&R#Ssag Su!T=Teo!Tho@T>Ub#3Au]CrobeEt&Gn$Gr L+uLli$Mi^N-N =Nim=Nor Nu&Rac#Roi,Ssi#X&5Bi#D [El#{Ndi=Ni&'Nna+Not$eNst!Ntag[Nu?ntQ)'R-|Rsu!R% Te'TifU~eUf#Ul(Uss$Ut$Uv/t5L%p#Ni%$Ra`#Re[Rmu!Sc#SeumSic+nTa%$T T)l3Ria@R%l#S,eThi^:Ge'PpeRquoisRr Ta%$Ti$Tu!Ufra.U%^Vi!3Bu#{CtarFas&Ga%$Glig Goc>I.Rve{Ttoy Ur$eUtr$Veu3CheCkelTra&Ve|5B#CifCt'[Ir-'I<t&Ma@Mb!{Mm Rma%fTab#Tif>Toi!Urr*Uve|Va&'Vemb!Vi-5A.Anc I!Isib#M oP%=Q)Tri%f:0E*Jec%fLig Sc'S v Stac#T_*T' 0Casi$Cup E/Tob!Troy Tup]Ulai!0E'Or/t1F_}Fic>Fr*0Ive1Se|S`l$2Fac%fIv>0Bra.Ett!0Ct){Du]E!{Iri^1A#A^Er Ini$PortunPrim T Ti^1A.{An.Bi&D$n E`#G/eG)`Ifi-Ne?ntQ)T+0C`]Mo<Satu!0Ar+0Rag/Rs$T`Trag Vra.0A%$1Y@Y.[1O[:Isib#La-Lma!sLo'@Lp Na~eNdaNgol(Niqu N[|NoramaNt=$PayeP>Po,PyrusRadoxeR-l#Res<Rfum R]Ro#Rra(R<m Rtag Ru!Rv_*Ssi$S&^T [lT+n-Tr$V`l$Voi}Y Ysa.3Ig[Int!La.Lic/L#Lou<Lu~eNdu#Netr Nib#NsifN'+Pi&PlumRdrixRfor Rio@Rmu,Rp#xeRs`R&S Ta#TitTr*Up#2Ara$Ob+O^Ot$Ra<Ysi^0AnoCt'=E-Er!Euv!Lo&N-|Pet&Qu Rog)Sc(eSt$Vo,XelZza2AcardAf$dAis*An A^Astr$A&|E' ExusIa.OmbOng U+Uma.2Chet&Es+E&In&Ir>Iss$Iv!Lai!Lic>L#nLyg$eMma@Mp>Nct)lNd  NeyR%^Si%$S<d Stu!Tag Te|Ti$U-Ula(Um$Urp!Uss(Uvo*2A*+A%^Ec+{Edi!EfixeElu@EnomE<n-E&x&Evo*Imi%fIn-Is$Iv Ob#?O-d Odi.Of$dOg!sO+Oje,Olog)O?n Op!Osp eO&g O)s<Ov beU@n-U[|0Y~o<1BlicC $I}LpeLsarNai<Ni%fPit!Rif>Zz#3Rami@:99AsarE!l#Es%$Ietu@It,O%_t:C(eC$,D+{G$d(I@'Is(L_%rLl$.Mas}Pi@Sa.Tis}Vag V(Y$n 3Ac%fAg*Ali}Anim Cevo*Ci,Clam Col,Cru,Cu]Cyc]Dig Dou,Fai!F#xeForm Fra(Fu.G=+nGi$Gla.Gul>I, Je,Jou La%fLev L+fMar^Me@Mi<M$,Mpl*Mu NardNfortNif]N$c Ntr NvoiPl>Por,Pri<P%#Qu(S veS(e{Soud!SpectS,SultatTabl*T_*Ticu#Tomb Trac Uni$Uss*V/~eViv!Vol&Vulsif3Ches<De|E'Gi@Go]Nc Pos,Sib#S^T)lV=V>e5Che{M/-Mp!N-Nd(Se|S>Ta%fTorTu#U.U`#U#|U%[Y|?5B/BisCheEl#G){In Is<|S S%^3Th?:B]Bo,B!Co~eFariGes<Is*La@LiveL$Lu MediNc%$Ngl>Rcas?Rd(eT' Ug!nuUm$U,Uva.V/tV$n 1AlpelAnda#E]atEnarioEpt!HemaI_-Ind O!Ru%nUlp,1An-Cab#Ch Cou C!,Da%fDui!Ig['Jo'Lec%fMa(eMb]M_-M(=Na&'Nsib#N&n-Par Q)n-Re(R.ntR+{Rru!RumRvi-Sa?V*Vra.Xtup#3D =Ec#Eg Ff]G#Gn=L_-LiciumMp#Nc eNist!Ph$RopSmi^Tu 1I 3Ci=C#DiumIg[{LdatLe`Litu@Lub#Mb!M?`Mno]N@N.'N[t&No!Rc>R%rS+T%<Uc+{Udu!Uff#U#v UpapeUr-U%r Uv_*0Ac+{A%=Eci=H eIr=3Ab#A%$ErnumImulusIpu]RictUd+{Upe'Ylis&0Bli?BstratB%lBv_*C-sC!FfixeGg  Ive'Lfa&P bePpl>Rfa-Rica&R?n Rpri<Rs|tRv+Spect3LlabeMbo#Metr+Nap<NtaxeS&?:BacBl>C%#Il]L_tLism/L$n Mbo'Mi}Ngib#PisQu( Rd RifR%[S<TamiToua.UpeU!|X 3Mo(Mpo!lNa`#Nd!Ne'N*Nsi$Rm( R[Rrib#T(eX&2E?Eor+Erap+Orax0BiaE@Mi@Reli!Ro*SsuT/eT!Tub 5Bogg/L /tMa&Ni^N[|P$y?R~eRd!Rna@Rp`#R!ntR<Rt)TemU~ Urna.Us}X(e2Ac%$AficAgi^Ah*A(An~ Ava`Ef#Emp EsorEu`Ia.Ibun=Ico,Ilog+IompheIp]It' Ivi=Omb$eOncOpic=Oupe|2I#LipeMul&N[lRb(eTe'Toy Y|3Mp/Ph$Pi^R/:0Ues^9Ti?Tras$1Ani?If>I$I^Itai!Iv s3AniumBa(Tic/t0A.I[UelU!0I#Op+:Car?Cc(Gab$dG)Ill/tInc!Is<|Lab#Li<Ll$LveMpi!N`#Pe'R>Se{Ss=S&3C&'Det&Get=Hicu#InardLo-Nd!diN  Ng Ni?{Ntou<Rdu!R(Rn*RrouR}RtuSt$T /Tus&X/tX 3AducAn@Ctoi!D/.DeoG[t&G)'La(Lla.Naig!Ol$P eRe?ntRtuo<RusSa.Se'Si$S^{S)lT=Tes<Tico#Tr(eVa-Vipa!5Ca%$Gu I#Is(Itu!La`#Lc/L%g Lu?Ra-R&xT Ulo*Ya.Yel#:G$:3N$:Cht:3B!NithS&9Olog+\";\nconst accents = \"e7693&)U*o&)Ry^)*)W))))#X^))))@@)#Wf)m%)#!))AG)&IIAQIIIBIIHJNAgBIILIDJGo)))HIQIIIIA(IGgJHH(BIIxX#)Ou)@*IAAPIIIJHQJ)&QIQPYI(HYAQC%)!))QHJJ@)#)^f*^AXCJ))$%CP))%&m)u)@e^A#G#))W@!(IKK%!(I%))O@QA))@GG#e))))WHJIWh))my@IIBT^)!)HAYGETHI*))!QnUDG)))nBoKAC*HwyQh))$&)G&)UGO)G)))(BX#v**)%O,e7686)I))@)&)gdMP()))ud)p#L))I^FIHYdWG))D@DFV)QA)o%MyTh%*)Z)%)n(XANc^R)YS\";\nconst checksum = \"0x51deb7ae009149dc61a6bd18a918eb7ac78d2775726c68e598b92d002519b045\";\nlet wordlist = null;\n/**\n *  The [[link-bip39-fr]] for [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangFr extends WordlistOwlA {\n    /**\n     *  Creates a new instance of the French language Wordlist.\n     *\n     *  This should be unnecessary most of the time as the exported\n     *  [[langFr]] should suffice.\n     *\n     *  @_ignore:\n     */\n    constructor() { super(\"fr\", words, accents, checksum); }\n    /**\n     *  Returns a singleton instance of a ``LangFr``, creating it\n     *  if this is the first time being called.\n     */\n    static wordlist() {\n        if (wordlist == null) {\n            wordlist = new LangFr();\n        }\n        return wordlist;\n    }\n}\n//# sourceMappingURL=lang-fr.js.mapimport { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0torea noica!iosorolotaleratelanena%oiadoencotivomai t ca%a0A]Bagl'Bin#E.Is(Oli!Rasi_Rog#0Cade!C[$Cus#E <Hil,I@QuaReRil>Roba+U 0Ag'Deb{DomeEgu#Eri!IpeOtt&Ul&1Fabi,Fe|Fis(F-n Oris`O(R~$0AveEn.E_,Ganc'I!It&OnismoR>*Rume Uzzo4AbardaA Bat)Ber#BoBumeCeCol>E|<FaGeb-Ian.IbiIm[ Lag#Leg)Lie_Lo@/Lusi_Me$Oge$Pa}Pest!Ta,=Ter$T%c'T)veUn$Veo*Z&0Alga`Ani+A!=B{Br#EbaEr~E^s+I]Mas(M[daMir&Mon{O!P'Pli&U, 0A}r@Ag-feAlis+Arch?At-CaCel/Co-D&D!aEl*Ge*Gol&Gus I`Neg&Nid#NoNunc'OnimoT%ipoZi1At>Ertu-OdePari!Pe^ Pogg'P)@Pun Ri,1Ab~AchideAgos+Ald~Anc'Atu-AzzoBit)Chiv'D{Eni,G[ Gi<Gu IaMon?NeseRed#RingaRos S[>SoTef%eZil*0Ciu|Col EpsiEtt>Fal I$O/Pir#P)Sagg'SeSolu Sur@TaT[u T%eT-|0Av>EismoOm>O$TesaTiv&Tor$Tr{Tua,0Sil'Str?Tis+To$moTun$0Anz#E!V[i!Vi(Volge!3Io<O ZimoZur):Be,C}$Ci$CoDessaDi/+Gn#I+L]<L@Le=L/+Lza$Mbi$Ndi!RaondaRba)R}R{$RlumeRoc]Sil>S(Tos+Ttu U,VaVosa3C]FfaLg'LvaNdaNe_,Nig$Nzi=ReRli=Ta3Bi+CiDo<Fi@GaLanc?MboNo]*O*goPedePol&Rban.R-S]|Ses S$n$Son.SturiZzar)2An@At+2Ll{Nif>R@S]Tan>T^$Zzo*2Acc'AdipoA`An}Avu-E.l/Eve|EzzaIgl?Il/n.Ind&Oc]*O@Onzi=Ul*U$2Bbo<CaDi$Ffo<IoLboO$R*<R-s}S(/S+:De|Du]La`)L]*LesseLib)LmoLor?MbusaMe-+M%?Mmi$Mo/Mpa,NapaNde/NeNi$No|N^=PacePel*P{*Pogi)Ppe)P-Psu/RapaceR}ssaR@Ris`Rova=R!|R li=Sacc'S}+Ser`SoS(<S.l*Sua,Tas+Te=T-meU Vil*3Dibi,D-+Fa*Leb!Llul&NaNo<N.simoRam~Rc&R RumeRvel*So?SpoTo2E/Ia)Ic}Iede!Ime-I=IrurgoI+r-0AoClismoFr&G$Lind)O|*R}R)siTr>T+di$UffoVet+Vi,2Ass>In~O)2C]Dar@D%eE!n.G$meLl&Lm#Lo!Lpo(L^v#LzaMaMe+M`n@Mo@Mpu.rMu<Nci(Ndur!Nfer`Ngel&NiugeN<s(Nosce!NsumoN^nuoNveg$Per P'<Pp?Pr~poRazzaRda+R%#Rn%eRol/RpoR!@Rs?R.seSm>S+n.Ttu-V#2A.!Avat+E#Ede!Emo(Esci+E+Ice I=,IsiIt>OceO=}Os++Uc?,Us}2Ci!Cu*Gi$Ll#Po/R#!R(!R_Sci$S de:DoI$L`+Meri$Nie/N$(Nz&T#Van^Vve)3Bu|C[n'Ci(Cli$Col*C! D%#Fin{FormeG$Leg&Lfi$Lir'L+M[zaNot#Nt)Pos{Rapa+Riv&RogaScri|Ser Sider'Sume!Tersi_Vo 3Amet)Cemb!Ed)Fe(Ffu(Geri!Gi+,Luv'Nam>N=nziPin P*`Po*Rad&ReRo|RupoSag'Sc! Sf&Sge*Spos S+nzaSu`$ToVa$Vel Vide!Vor#5B*<C[.Ga=,G`LceM#M[~Min&N@*NoRmi!TeT !Vu Zzi=2AgoUi@2Bb'Bit&Ca,NaOmoPl%eRatu):0A$0Ces(CoLissiO$m?0E-I]/I,I r?Uc&2Emon?LiOismoReg'4Abor#Argi!Egan.Enc#E|Ev&F>I}MoSaU(0An#B,`Es(I)O^_Oz'<Pir>U*0Dem>Du)Erg?FasiO.}Tr&Zi`1A^.I*goI(d'O},Pu!0U#!0Ar'BaBo(EdeEmi+Ige!Met>OeOsi_Ran.0Ago$AmeAnimeAudi!CaEmp'Erc{Ib{Ig[.Is.!I OfagoOrt#O(Pan(P!s(S[zaSoTe(Tim&Ton?T)(Ult&0Il>N>Rus]To0ClideoRopa0A(Id[zaIt#Olu Viva:Bbr~Cc[daChi)L]Migl?Na,Nfa-NgoN+s`ReRfal/Ri$(R`]Sc?S (Sul*T%&ToVo*(3Bb!Co/DeG#LpaLt)Mmi=Nde!Nome$Rm[ R)R^,Ssu-S^_T+U@3AbaDuc?FaGur#LoNanzaNest-Ni!O!S},S>Ume2A]<Am[]EboEm`Ori@U[.Uo)2B>Cacc?Co(Der#Gl'La+Lc*!Lgo!Nd[.Net>N?N+=Rb{Rchet+Res+Rm~R='RoR.zzaRz&Sf#S(2A}s(A=Assi$A.l*Eccet+E=+Es]IgoOlli$OndeUga,Ut+2Ci/+Cs?Gg[.Lmi<L_Man.Me|Mo(NeNz'<O]RboRgo<Ro!SoTi,:Bb?$FfeLa.oLli=LoppoMbe)M`Ranz?RboRofa$Rzo<S@|Sol'Str>T Ud'ZeboZzel/3CoLa^=L(Mel*Mm#NeN{!N='No^poRgo2Epar@Iacc'Isa0Al*LdaNep)Oc&Oiel*Or$OveR#Ro<T++Udiz'Ur#Us 2Obu*U^<1Omo0BbaLfM{Mmo<Nf'N=Ver$2Aci,A@Af>AmmoAndeAtt&A_(Az?E}EggeIfo<Ig'InzaOt+Uppo2Adag$A'An Ard&FoId&::0Ern#0O=0Ent>Ill'O*RaR>Roge$2Ie<Na)Nor#4A!Le(Log>Lude!0Bal*Bevu Boc]Bu Ma<Mer(Mol#Pac]Pe PiegoPor P)n+0Al&Arc&At^_Can C[d'Chi$Cisi_Clu(Cont)C)c'CuboDagi<D?Do,Ed{Fat^Fil&Fli|Gagg'Geg$G,seGor@G)s(Nes]O@!Oltr&Ond#Sa$Se|SiemeSonn?Suli=Tas#Te)To=]Tu{Umidi!Vali@VeceV{1Erbo,Not>O.siP~1IdeLandaOn>Rig#Ror&0Ol#O poTer>Titu Tr%e0Al?Er&:::Bb)Birin C}Cer#Cri`Cu=D@veGoMpoNcet+N.r=R@(RgaRingeSt-T[zaTi$TtugaVag=Vo)3Ga,Gge)MboN.zzaNzaO<P!Si_Ss#S T.-,VaVig#3Be)DoEv{L/Matu-Mit&Mpi@Ne&NguaQui@RaR~S}TeTig'V!a5CandaDeG~Mb&Nd-Nge_QuaceR[zoToT.r?5CeCid#Ma}Mi$(NgoPoPpo*SingaS(T :Cab)Cchi=Ce)Cin#Da`G>Gl?G<.G)Iol~LafedeLg-@Lin.(Lsa$L Lumo!NaNc?N@r/Ngi&Nifes N=)Nov-NsardaN^deNubr'PpaR#=Rci!Ret+RmoRsup'Sche-Ssa?S^$Te-s(Tr>/T <Tu)Zur}3And)C}n>Ce=.DesimoDit&GaLassaLisLod?NingeNoN(/Rcur'R[daR*Schi$SeSse!S *Tal*To@T.!3Agol&CaCel'Che,C)boDol*E,Gl'!La$Li.MosaNe-,NiNo!Ri$R^l*Sce/SsivaS Sur&TezzaTig&T-T.n.4Emon>0Del*Dif~Du*Ga$G'LeLos(Nas.)N]Ndi=Ne+r'Ni,No $N(<Nt#Nvi(RaRde!Rs%#St)Tiv#TosegaT V[zaVim[ Zzo5C}CosaFfaGhe|G='La|Li<l*L^p*Mm?N Ove!Ra,SaS]*S~Te_,To:BabboF+Nomet)Rci(R%eRr#Sce!Str&Tu-,Ut~Vigl'3Bu*saC)siGa^_Goz'Mme$Ofi+Re|R_Ssu$Ttu$Ut-,VeV)t>3Cch?NfaTi@5Bi,Ci_DoMeMi=Rd>R`,RvegeseSt-$T&Tiz?Ttur$Vel/5C,oL/Me)O_Tri!Vo/Z?,:Si0Bedi!BligoElis]L'O*So, 0Cas'<Ch'Cid[.Cor!!Cult&RaUl#0Ier$Or&1Fer+Fri!Fusc#0Ge|GiNu$4AndeseFa|I#IvaOg-m`T!0Agg'Bel>B-EgaIss'<0Do(E!IceNi_)O!_,Ta1Er#In'<Pos 1A]*AfoDi<Ecchi$Ef%eFa$Gan>Igi<Izzon.MaMegg'Na^_O*g'R[@Ribi,T[s?T~Za+Zo0A!Cur&MosiPeda,Pi.SaSid&Ta]*Te0I.ReTago$TimoTob!1A,EstI$Ipa)Oc{UnqueVi&3Io:Cche|CeCif>Del/D)<EseGaGi=Lazzi=Les&Lli@LoLudeN@)N<l*O*O=zzoPr~Rabo/Rcel/Re!Rgo*RiRl#Ro/R^!Rv[zaRz?,Ssi_St%}Tac}To*g?TtumeVo<3Cc#Dal&Do=,Gg'Lo(N&Nd%eNi(/Nnu Nomb-Ns&N /PePi+Rbe<R]r(R@n#Rfor&Rgame=R'@Rmes(R$Rp,s(Rsua(Rtug'Rva(S#!Sis+SoS^fe)Ta*T^<Tu/n.Zzo3Ace!An+At^$Cci$CozzaEgaEt-Ffe)G?`Gol'G)LaLife)L*/Lo+Mpan.Ne+N=No*Ogg?OmboRamideRet>Ri.RolisiTo<Zz>2AceboAn&As`A+$E=r'2ChezzaDe)(DismoEs?Ggi&L[+Ligo$Ll%eLmoni.Lpet+L(Lt)=Lve!M%eMo@)N.Po*(Rfi@Ro(Rpo-R!R++SaSi^_Sses(Stul#Tass'Te!2AnzoAssiAt~Eclu(Ed~Efis(Egi#Elie_Eme!E$t&Epar#Es[zaE.s Eval(I`IncipeIv#Ob,`Ocu-Odur!OfumoOge|OlungaOmessaO$meOpos+O)gaO.(OvaUd[.Ug=Ur{0Iche1Bbl>D~Gil#G$LceL{Lsan.Nt&PazzoPil/Ro:99Ad)Al]saAsiE!/O+:C]l D@pp'D~,Dun#Ff~GazzoG'<G$Mar)MingoMoNdag'N l&P#Pi=Pp!(Satu-Schi#S[.Sseg=St!l*TaVvedu 3A,Cepi!Cin Clu+Cond{Cupe)Dd{Dime!Gal#Gist)Go/G!s(Laz'<M&Mo N=Pl~Prime!Put&SaSid[.Spon(S+u)TeTi=Tor~T^f~Voc#3Assun Badi!Bel,B!zzoCar~C]Ceve!C%l#Cor@C!du D>*Dur!Fas&F,s(For`Fug'G&Gett#Ghel*Lass#Lev#Ma<!MbalzoMed'Morch'Nasci+N})NforzoN$_Nom#Nsav{N c]Nunc?Nv[i!Par#Petu Pie$Port&P!saPuli!Sa+Sch'ServaSibi,SoSpe|S )Sult#S_l Tar@Teg$Tm>T)_Un'<VaVer(Vinci+Vol Zo`5BaBot>Bus Cc?CoDagg'De!D{!G{Ll'Mant>Mpe!Nz'Sol&SpoTan.Ton@Tu/Vesc'5BizzoBr~GaLli$Mi<Mo)(O*PeSs&St>:B#Bbi&Bot#Go`Las(Ldatu-Lgem`Liv&Lmo<Lo<Lt&Lu L_Pe!Pi@Por{Race$R}smoR S((Telli.Ti-Tol*Tur$Va=V'Zi#0Adigl'AlzoAnc#Ar-At.!Av&End&Irci&Locc#Occi#Rin&Ruffo<Uff&0Ab)(Ad[zaA/Ambi&Anda*Apo/Ar(A.n&Av#El En>Ett)HedaHie=IarpaI[zaInde!IppoI)ppoI_*Ler&Odel/Olp{Ompar Onfor Opri!Or+Os(<OzzeseRibaRoll&Ru^n'Uder?Ul !Uo/U)Us&0Ebit&Ogan&0C}tu-Con@Da$Gg'/G=l#G!g#Gu{Lci#Let^_L/Lvagg'Mafo)Mbr&MeMin#Mp!N(N^!Pol Qu[zaRa+Rb#Re$R'Rp[.R-gl'Rvi!S^=To/T^`=0Ace*Ald&Am#Arzo(At%#E-IdaIl#IngeOc#Oder&OgoOl^!Orz#Ra|Rutt#Ugg{Um&U(0Abel*Arb#Onfi&Orb'Rass#Uar@1Bi*C]meEr-G/G$!L[z'L/baMbo*Mpat>Mul#Nfon?Ngo*Nist)NoN.siNu(idePar'S`S ,Tu#2It+Ogatu-Ove$0Arr{Emor#En^ E-l@IlzoOnt&Ott#Uss#0Elli!Erv#O@0BbalzoBr'C]r(C?,Da,Ffi|G$Ld#L[<Li@L/zzoLoLubi,Lv[.Mat>M`NdaNe|Nnife)Pi!Ppe(P-Rge!Rpas(Rri(R(R.gg'R_l#Spi)S+T^,0AdaAl/Arge!A /Av[ Azzo/EcieEdi!Eg<!E/tu-E-nzaEs(!Ett-,Ezz#IaIgo*(Ill#I$(I-,L[di@Or^_O(RangaRec&Ron#RuzzoUn^$0Uil*0Ad%&O l#1Abi,Ac]AffaAgn&Amp#Ant'Arnu Ase-Atu E*EppaErzoI,|I`IrpeIva,Izzo(On#Or>RappoReg#Ridu*Rozz&Ru|Ucc&UfoUp[@0B[t)C](Do!Gger{GoL+$On&PerboPpor Rgel#R)g#Ssur)Tu-0Ag&EdeseEgl'El&Enu Ez?IluppoIs+Izze-Ol+Uot&:Bac]Bul#Cci&Citur$LeLis`$Mpo<Nni$RaRdi_Rg#RiffaRp&R+rugaS Tt>Ver=Vo/+Zza3CaCn>Lefo$Me-r'MpoMu N@<Ne)Ns'<N+]*O!`RmeR-zzoRze|SiSser#St#T)T ?3F&Gel/Mb)N P>Pog-foRagg'RoTan'To*Tuban.Z'Zzo<5Cc&L,r&L Mbo/MoNfoNsil/Paz'Po*g?PpaRbaRn&R)<R -S}$Ssi!S+tu-Ta$2Aboc]AcheaAfi/Aged?Alc'Amon Ans{Apa$Ar!As*]Att#AveEcc?Emol'Espo*Ibu Iche]Ifogl'Il*InceaIoIs.zzaItur#Ivel/OmbaO$OppoO|/Ov&Ucc#2Batu-Ff#Lipa$Mul Nis?Rb&Rchi$TaTe/:0Ic#0Cel*Ci(!0I!I^_1FaF%'0Ua,4IsseTim#0A$I,Orismo0Ci<|Ge!Ghe!seI]r$If%#I($I+r'Te0Vo0Upa1Aga$G[zaLo0AnzaA C{Ig$*U-'0Ensi,IlizzoOp?:Can.Ccin#Gabon@Gli#LangaLgoL>L,t+Lo)(Lut&L_/Mpa+Ng&N{(NoN+gg'Nve-Po!Ra$Rc#R?n.S}3Det+DovaDu Ge+,I]*Lc)Li=Llu LoceN#Ndemm?N RaceRba,Rgog=Rif~RoRru}Rt~,Sc~Ssil*S+,Te-$Tri=Tus 3Andan.B-n.C[daChingoCi=nzaDim&Gil?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'<SpoSsu Su-TaTel*T^`VandaVi@Zi&5CeGaLa^,Le!LpeRagi<5L}$::::Mpog=N=Pp#T.-Vor-3Fi)Lan.LoNze)Rbi$3Be|N]R]<T 5L/T>5Cche)Fo*LuPpa\";\nconst checksum = \"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620\";\nlet wordlist = null;\n/**\n *  The [[link-bip39-it]] for [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangIt extends WordlistOwl {\n    /**\n     *  Creates a new instance of the Italian language Wordlist.\n     *\n     *  This should be unnecessary most of the time as the exported\n     *  [[langIt]] should suffice.\n     *\n     *  @_ignore:\n     */\n    constructor() { super(\"it\", words, checksum); }\n    /**\n     *  Returns a singleton instance of a ``LangIt``, creating it\n     *  if this is the first time being called.\n     */\n    static wordlist() {\n        if (wordlist == null) {\n            wordlist = new LangIt();\n        }\n        return wordlist;\n    }\n}\n//# sourceMappingURL=lang-it.js.mapimport { id } from \"../hash/index.js\";\nimport { hexlify, assertArgument, toUtf8Bytes, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n    // 4-kana words\n    \"AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSAhSBCSBrSGQSEQSHBSVRShYShkSyQSuFSiBSdcSoESocSlmSMBSFBSFKSFNSFdSFcCByCaRCKcCSBCSRCCrCGbCEHCYXCpBCpQCIBCIHCeNCgBCgFCVECVcCmkCmwCZXCZFCdRClOClmClFCjDCjdCnXCwBCwXCcRCFQCFjGXhGNhGDEGDMGCDGCHGIFGgBGVXGVEGVRGmXGsXGdYGoSGbRGnXGwXGwDGWRGFNGFLGFOGFdGFkEABEBDEBFEXOEaBEKSENBENDEYXEIgEIkEgBEgQEgHEhFEudEuFEiBEiHEiFEZDEvBEsXEsFEdXEdREkFEbBEbRElFEPCEfkEFNYAEYAhYBNYQdYDXYSRYCEYYoYgQYgRYuRYmCYZTYdBYbEYlXYjQYRbYWRpKXpQopQnpSFpCXpIBpISphNpdBpdRpbRpcZpFBpFNpFDpFopFrLADLBuLXQLXcLaFLCXLEhLpBLpFLHXLeVLhILdHLdRLoDLbRLrXIABIBQIBCIBsIBoIBMIBRIXaIaRIKYIKRINBINuICDIGBIIDIIkIgRIxFIyQIiHIdRIbYIbRIlHIwRIMYIcRIRVITRIFBIFNIFQOABOAFOBQOaFONBONMOQFOSFOCDOGBOEQOpBOLXOIBOIFOgQOgFOyQOycOmXOsXOdIOkHOMEOMkOWWHBNHXNHXWHNXHDuHDRHSuHSRHHoHhkHmRHdRHkQHlcHlRHwBHWcgAEgAggAkgBNgBQgBEgXOgYcgLXgHjgyQgiBgsFgdagMYgWSgFQgFEVBTVXEVKBVKNVKDVKYVKRVNBVNYVDBVDxVSBVSRVCjVGNVLXVIFVhBVhcVsXVdRVbRVlRhBYhKYhDYhGShxWhmNhdahdkhbRhjohMXhTRxAXxXSxKBxNBxEQxeNxeQxhXxsFxdbxlHxjcxFBxFNxFQxFOxFoyNYyYoybcyMYuBQuBRuBruDMuCouHBudQukkuoBulVuMXuFEmCYmCRmpRmeDmiMmjdmTFmFQiADiBOiaRiKRiNBiNRiSFiGkiGFiERipRiLFiIFihYibHijBijEiMXiWBiFBiFCUBQUXFUaRUNDUNcUNRUNFUDBUSHUCDUGBUGFUEqULNULoUIRUeEUeYUgBUhFUuRUiFUsXUdFUkHUbBUjSUjYUwXUMDUcHURdUTBUrBUrXUrQZAFZXZZaRZKFZNBZQFZCXZGBZYdZpBZLDZIFZHXZHNZeQZVRZVFZmXZiBZvFZdFZkFZbHZbFZwXZcCZcRZRBvBQvBGvBLvBWvCovMYsAFsBDsaRsKFsNFsDrsSHsSFsCXsCRsEBsEHsEfspBsLBsLDsIgsIRseGsbRsFBsFQsFSdNBdSRdCVdGHdYDdHcdVbdySduDdsXdlRdwXdWYdWcdWRkBMkXOkaRkNIkNFkSFkCFkYBkpRkeNkgBkhVkmXksFklVkMBkWDkFNoBNoaQoaFoNBoNXoNaoNEoSRoEroYXoYCoYbopRopFomXojkowXorFbBEbEIbdBbjYlaRlDElMXlFDjKjjSRjGBjYBjYkjpRjLXjIBjOFjeVjbRjwBnXQnSHnpFnLXnINnMBnTRwXBwXNwXYwNFwQFwSBwGFwLXwLDweNwgBwuHwjDwnXMBXMpFMIBMeNMTHcaQcNBcDHcSFcCXcpBcLXcLDcgFcuFcnXcwXccDcTQcrFTQErXNrCHrpFrgFrbFrTHrFcWNYWNbWEHWMXWTR\",\n    // 5-kana words\n    \"ABGHABIJAEAVAYJQALZJAIaRAHNXAHdcAHbRAZJMAZJRAZTRAdVJAklmAbcNAjdRAMnRAMWYAWpRAWgRAFgBAFhBAFdcBNJBBNJDBQKBBQhcBQlmBDEJBYJkBYJTBpNBBpJFBIJBBIJDBIcABOKXBOEJBOVJBOiJBOZJBepBBeLXBeIFBegBBgGJBVJXBuocBiJRBUJQBlXVBlITBwNFBMYVBcqXBTlmBWNFBWiJBWnRBFGHBFwXXKGJXNJBXNZJXDTTXSHSXSVRXSlHXCJDXGQJXEhXXYQJXYbRXOfXXeNcXVJFXhQJXhEJXdTRXjdXXMhBXcQTXRGBXTEBXTnQXFCXXFOFXFgFaBaFaBNJaBCJaBpBaBwXaNJKaNJDaQIBaDpRaEPDaHMFamDJalEJaMZJaFaFaFNBaFQJaFLDaFVHKBCYKBEBKBHDKXaFKXGdKXEJKXpHKXIBKXZDKXwXKKwLKNacKNYJKNJoKNWcKDGdKDTRKChXKGaRKGhBKGbRKEBTKEaRKEPTKLMDKLWRKOHDKVJcKdBcKlIBKlOPKFSBKFEPKFpFNBNJNJBQNBGHNBEPNBHXNBgFNBVXNBZDNBsXNBwXNNaRNNJDNNJENNJkNDCJNDVDNGJRNJiDNZJNNsCJNJFNNFSBNFCXNFEPNFLXNFIFQJBFQCaRQJEQQLJDQLJFQIaRQOqXQHaFQHHQQVJXQVJDQhNJQmEIQZJFQsJXQJrFQWbRDJABDBYJDXNFDXCXDXLXDXZDDXsJDQqXDSJFDJCXDEPkDEqXDYmQDpSJDOCkDOGQDHEIDVJDDuDuDWEBDJFgSBNDSBSFSBGHSBIBSBTQSKVYSJQNSJQiSJCXSEqXSJYVSIiJSOMYSHAHSHaQSeCFSepQSegBSHdHSHrFShSJSJuHSJUFSkNRSrSrSWEBSFaHSJFQSFCXSFGDSFYXSFODSFgBSFVXSFhBSFxFSFkFSFbBSFMFCADdCJXBCXaFCXKFCXNFCXCXCXGBCXEJCXYBCXLDCXIBCXOPCXHXCXgBCXhBCXiBCXlDCXcHCJNBCJNFCDCJCDGBCDVXCDhBCDiDCDJdCCmNCpJFCIaRCOqXCHCHCHZJCViJCuCuCmddCJiFCdNBCdHhClEJCnUJCreSCWlgCWTRCFBFCFNBCFYBCFVFCFhFCFdSCFTBCFWDGBNBGBQFGJBCGBEqGBpBGBgQGNBEGNJYGNkOGNJRGDUFGJpQGHaBGJeNGJeEGVBlGVKjGiJDGvJHGsVJGkEBGMIJGWjNGFBFGFCXGFGBGFYXGFpBGFMFEASJEAWpEJNFECJVEIXSEIQJEOqXEOcFEeNcEHEJEHlFEJgFEhlmEmDJEmZJEiMBEUqXEoSREPBFEPXFEPKFEPSFEPEFEPpFEPLXEPIBEJPdEPcFEPTBEJnXEqlHEMpREFCXEFODEFcFYASJYJAFYBaBYBVXYXpFYDhBYCJBYJGFYYbRYeNcYJeVYiIJYZJcYvJgYvJRYJsXYsJFYMYMYreVpBNHpBEJpBwXpQxFpYEJpeNDpJeDpeSFpeCHpHUJpHbBpHcHpmUJpiiJpUJrpsJuplITpFaBpFQqpFGBpFEfpFYBpFpBpFLJpFIDpFgBpFVXpFyQpFuFpFlFpFjDpFnXpFwXpJFMpFTBLXCJLXEFLXhFLXUJLXbFLalmLNJBLSJQLCLCLGJBLLDJLHaFLeNFLeSHLeCXLepFLhaRLZsJLsJDLsJrLocaLlLlLMdbLFNBLFSBLFEHLFkFIBBFIBXFIBaQIBKXIBSFIBpHIBLXIBgBIBhBIBuHIBmXIBiFIBZXIBvFIBbFIBjQIBwXIBWFIKTRIQUJIDGFICjQIYSRIINXIJeCIVaRImEkIZJFIvJRIsJXIdCJIJoRIbBQIjYBIcqXITFVIreVIFKFIFSFIFCJIFGFIFLDIFIBIJFOIFgBIFVXIJFhIFxFIFmXIFdHIFbBIJFrIJFWOBGBOQfXOOKjOUqXOfXBOqXEOcqXORVJOFIBOFlDHBIOHXiFHNTRHCJXHIaRHHJDHHEJHVbRHZJYHbIBHRsJHRkDHWlmgBKFgBSBgBCDgBGHgBpBgBIBgBVJgBuBgBvFgKDTgQVXgDUJgGSJgOqXgmUMgZIJgTUJgWIEgFBFgFNBgFDJgFSFgFGBgFYXgJFOgFgQgFVXgFhBgFbHgJFWVJABVQKcVDgFVOfXVeDFVhaRVmGdViJYVMaRVFNHhBNDhBCXhBEqhBpFhBLXhNJBhSJRheVXhhKEhxlmhZIJhdBQhkIJhbMNhMUJhMZJxNJgxQUJxDEkxDdFxSJRxplmxeSBxeCXxeGFxeYXxepQxegBxWVcxFEQxFLXxFIBxFgBxFxDxFZtxFdcxFbBxFwXyDJXyDlcuASJuDJpuDIBuCpJuGSJuIJFueEFuZIJusJXudWEuoIBuWGJuFBcuFKEuFNFuFQFuFDJuFGJuFVJuFUtuFdHuFTBmBYJmNJYmQhkmLJDmLJomIdXmiJYmvJRmsJRmklmmMBymMuCmclmmcnQiJABiJBNiJBDiBSFiBCJiBEFiBYBiBpFiBLXiBTHiJNciDEfiCZJiECJiJEqiOkHiHKFieNDiHJQieQcieDHieSFieCXieGFieEFieIHiegFihUJixNoioNXiFaBiFKFiFNDiFEPiFYXitFOitFHiFgBiFVEiFmXiFitiFbBiFMFiFrFUCXQUIoQUIJcUHQJUeCEUHwXUUJDUUqXUdWcUcqXUrnQUFNDUFSHUFCFUFEfUFLXUtFOZBXOZXSBZXpFZXVXZEQJZEJkZpDJZOqXZeNHZeCDZUqXZFBQZFEHZFLXvBAFvBKFvBCXvBEPvBpHvBIDvBgFvBuHvQNJvFNFvFGBvFIBvJFcsXCDsXLXsXsXsXlFsXcHsQqXsJQFsEqXseIFsFEHsFjDdBxOdNpRdNJRdEJbdpJRdhZJdnSJdrjNdFNJdFQHdFhNkNJDkYaRkHNRkHSRkVbRkuMRkjSJkcqDoSJFoEiJoYZJoOfXohEBoMGQocqXbBAFbBXFbBaFbBNDbBGBbBLXbBTBbBWDbGJYbIJHbFQqbFpQlDgQlOrFlVJRjGEBjZJRnXvJnXbBnEfHnOPDngJRnxfXnUJWwXEJwNpJwDpBwEfXwrEBMDCJMDGHMDIJMLJDcQGDcQpHcqXccqNFcqCXcFCJRBSBRBGBRBEJRBpQTBNFTBQJTBpBTBVXTFABTFSBTFCFTFGBTFMDrXCJrXLDrDNJrEfHrFQJrFitWNjdWNTR\",\n    // 6-kana words\n    \"AKLJMANOPFASNJIAEJWXAYJNRAIIbRAIcdaAeEfDAgidRAdjNYAMYEJAMIbRAFNJBAFpJFBBIJYBDZJFBSiJhBGdEBBEJfXBEJqXBEJWRBpaUJBLXrXBIYJMBOcfXBeEfFBestXBjNJRBcDJOBFEqXXNvJRXDMBhXCJNYXOAWpXONJWXHDEBXeIaRXhYJDXZJSJXMDJOXcASJXFVJXaBQqXaBZJFasXdQaFSJQaFEfXaFpJHaFOqXKBNSRKXvJBKQJhXKEJQJKEJGFKINJBKIJjNKgJNSKVElmKVhEBKiJGFKlBgJKjnUJKwsJYKMFIJKFNJDKFIJFKFOfXNJBSFNJBCXNBpJFNJBvQNJBMBNJLJXNJOqXNJeCXNJeGFNdsJCNbTKFNwXUJQNFEPQDiJcQDMSJQSFpBQGMQJQJeOcQyCJEQUJEBQJFBrQFEJqDXDJFDJXpBDJXIMDGiJhDIJGRDJeYcDHrDJDVXgFDkAWpDkIgRDjDEqDMvJRDJFNFDJFIBSKclmSJQOFSJQVHSJQjDSJGJBSJGJFSECJoSHEJqSJHTBSJVJDSViJYSZJNBSJsJDSFSJFSFEfXSJFLXCBUJVCJXSBCJXpBCXVJXCJXsXCJXdFCJNJHCLIJgCHiJFCVNJMChCJhCUHEJCsJTRCJdYcCoQJCCFEfXCFIJgCFUJxCFstFGJBaQGJBIDGQJqXGYJNRGJHKFGeQqDGHEJFGJeLXGHIiJGHdBlGUJEBGkIJTGFQPDGJFEqEAGegEJIJBEJVJXEhQJTEiJNcEJZJFEJoEqEjDEqEPDsXEPGJBEPOqXEPeQFEfDiDEJfEFEfepQEfMiJEqXNBEqDIDEqeSFEqVJXEMvJRYXNJDYXEJHYKVJcYYJEBYJeEcYJUqXYFpJFYFstXpAZJMpBSJFpNBNFpeQPDpHLJDpHIJFpHgJFpeitFpHZJFpJFADpFSJFpJFCJpFOqXpFitBpJFZJLXIJFLIJgRLVNJWLVHJMLwNpJLFGJBLFLJDLFOqXLJFUJIBDJXIBGJBIJBYQIJBIBIBOqXIBcqDIEGJFILNJTIIJEBIOiJhIJeNBIJeIBIhiJIIWoTRIJFAHIJFpBIJFuHIFUtFIJFTHOSBYJOEcqXOHEJqOvBpFOkVJrObBVJOncqDOcNJkHhNJRHuHJuHdMhBgBUqXgBsJXgONJBgHNJDgHHJQgJeitgHsJXgJyNagyDJBgZJDrgsVJQgkEJNgkjSJgJFAHgFCJDgFZtMVJXNFVXQfXVJXDJVXoQJVQVJQVDEfXVDvJHVEqNFVeQfXVHpJFVHxfXVVJSRVVmaRVlIJOhCXVJhHjYkhxCJVhWVUJhWiJcxBNJIxeEqDxfXBFxcFEPxFSJFxFYJXyBDQJydaUJyFOPDuYCJYuLvJRuHLJXuZJLDuFOPDuFZJHuFcqXmKHJdmCQJcmOsVJiJAGFitLCFieOfXiestXiZJMEikNJQirXzFiFQqXiFIJFiFZJFiFvtFUHpJFUteIcUteOcUVCJkUhdHcUbEJEUJqXQUMNJhURjYkUFitFZDGJHZJIxDZJVJXZJFDJZJFpQvBNJBvBSJFvJxBrseQqDsVFVJdFLJDkEJNBkmNJYkFLJDoQJOPoGsJRoEAHBoEJfFbBQqDbBZJHbFVJXlFIJBjYIrXjeitcjjCEBjWMNBwXQfXwXOaFwDsJXwCJTRwrCZJMDNJQcDDJFcqDOPRYiJFTBsJXTQIJBTFEfXTFLJDrXEJFrEJXMrFZJFWEJdEWYTlm\",\n    // 7-kana words\n    \"ABCDEFACNJTRAMBDJdAcNJVXBLNJEBXSIdWRXErNJkXYDJMBXZJCJaXMNJaYKKVJKcKDEJqXKDcNJhKVJrNYKbgJVXKFVJSBNBYBwDNJeQfXNJeEqXNhGJWENJFiJRQlIJbEQJfXxDQqXcfXQFNDEJQFwXUJDYcnUJDJIBgQDIUJTRDJFEqDSJQSJFSJQIJFSOPeZtSJFZJHCJXQfXCTDEqFGJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC\",\n    // 8-kana words\n    \"BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD\",\n    // 9-kana words\n    \"QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD\",\n    // 10-kana words\n    \"IJBEJqXZJ\"\n];\n// Maps each character into its kana value (the index)\nconst mapping = \"~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt\";\nlet _wordlist = null;\nfunction hex(word) {\n    return hexlify(toUtf8Bytes(word));\n}\nconst KiYoKu = \"0xe3818de38284e3818f\";\nconst KyoKu = \"0xe3818de38283e3818f\";\nfunction toString(data) {\n    return toUtf8String(new Uint8Array(data));\n}\nfunction loadWords() {\n    if (_wordlist !== null) {\n        return _wordlist;\n    }\n    const wordlist = [];\n    // Transforms for normalizing (sort is a not quite UTF-8)\n    const transform = {};\n    // Delete the diacritic marks\n    transform[toString([227, 130, 154])] = false;\n    transform[toString([227, 130, 153])] = false;\n    // Some simple transforms that sort out most of the order\n    transform[toString([227, 130, 133])] = toString([227, 130, 134]);\n    transform[toString([227, 129, 163])] = toString([227, 129, 164]);\n    transform[toString([227, 130, 131])] = toString([227, 130, 132]);\n    transform[toString([227, 130, 135])] = toString([227, 130, 136]);\n    // Normalize words using the transform\n    function normalize(word) {\n        let result = \"\";\n        for (let i = 0; i < word.length; i++) {\n            let kana = word[i];\n            const target = transform[kana];\n            if (target === false) {\n                continue;\n            }\n            if (target) {\n                kana = target;\n            }\n            result += kana;\n        }\n        return result;\n    }\n    // Sort how the Japanese list is sorted\n    function sortJapanese(a, b) {\n        a = normalize(a);\n        b = normalize(b);\n        if (a < b) {\n            return -1;\n        }\n        if (a > b) {\n            return 1;\n        }\n        return 0;\n    }\n    // Load all the words\n    for (let length = 3; length <= 9; length++) {\n        const d = data[length - 3];\n        for (let offset = 0; offset < d.length; offset += length) {\n            const word = [];\n            for (let i = 0; i < length; i++) {\n                const k = mapping.indexOf(d[offset + i]);\n                word.push(227);\n                word.push((k & 0x40) ? 130 : 129);\n                word.push((k & 0x3f) + 128);\n            }\n            wordlist.push(toString(word));\n        }\n    }\n    wordlist.sort(sortJapanese);\n    // For some reason kyoku and kiyoku are flipped in node (!!).\n    // The order SHOULD be:\n    //   - kyoku\n    //   - kiyoku\n    // This should ignore \"if\", but that doesn't work here??\n    /* c8 ignore start */\n    if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {\n        const tmp = wordlist[442];\n        wordlist[442] = wordlist[443];\n        wordlist[443] = tmp;\n    }\n    /* c8 ignore stop */\n    // Verify the computed list matches the official list\n    /* istanbul ignore if */\n    const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n    /* c8 ignore start */\n    if (checksum !== \"0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600\") {\n        throw new Error(\"BIP39 Wordlist for ja (Japanese) FAILED\");\n    }\n    /* c8 ignore stop */\n    _wordlist = wordlist;\n    return wordlist;\n}\nlet wordlist = null;\n/**\n *  The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangJa extends Wordlist {\n    /**\n     *  Creates a new instance of the Japanese language Wordlist.\n     *\n     *  This should be unnecessary most of the time as the exported\n     *  [[langJa]] should suffice.\n     *\n     *  @_ignore:\n     */\n    constructor() { super(\"ja\"); }\n    getWord(index) {\n        const words = loadWords();\n        assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n        return words[index];\n    }\n    getWordIndex(word) {\n        return loadWords().indexOf(word);\n    }\n    split(phrase) {\n        //logger.assertNormalize();\n        return phrase.split(/(?:\\u3000| )+/g);\n    }\n    join(words) {\n        return words.join(\"\\u3000\");\n    }\n    /**\n     *  Returns a singleton instance of a ``LangJa``, creating it\n     *  if this is the first time being called.\n     */\n    static wordlist() {\n        if (wordlist == null) {\n            wordlist = new LangJa();\n        }\n        return wordlist;\n    }\n}\n//# sourceMappingURL=lang-ja.js.mapimport { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n    \"OYAa\",\n    \"ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl3MnAnATrAnAcrAnCZ3AnCl8AnDg8AnFboAnFl3AnHX4AnHbrAnHgrAnIl3AnJgvAnLXoAnLX4AnLbrAnLgrAnLhrAnMXoAnMgrAnOn3AnSbrAnSeoAnvLnAn3OnCTGgvCTSlvCTvAUCTvKnCTvNTCT3CZCT3GUCT3MTCT8HnCUCZrCULf8CULnvCU3HnCU3JUCY6NUCbDb8CbFZoCbLnrCboOTCboScCbrFnCbvLnCb8AgCb8HgCb$LnCkLfoClBn3CloDUDTHT8DTLl3DTSU8DTrAaDTrLXDTrLjDTrOYDTrOgDTvFXDTvFnDT3HUDT3LfDUCT9DUDT4DUFVoDUFV8DUFkoDUGgrDUJnrDULl8DUMT8DUMXrDUMX4DUMg8DUOUoDUOgvDUOg8DUSToDUSZ8DbDXoDbDgoDbGT8DbJn3DbLg3DbLn4DbMXrDbMg8DbOToDboJXGTClvGTDT8GTFZrGTLVoGTLlvGTLl3GTMg8GTOTvGTSlrGToCUGTrDgGTrJYGTrScGTtLnGTvAnGTvQgGUCZrGUDTvGUFZoGUHXrGULnvGUMT8GUoMgGXoLnGXrMXGXrMnGXvFnGYLnvGZOnvGZvOnGZ8LaGZ8LmGbAl3GbDYvGbDlrGbHX3GbJl4GbLV8GbLn3GbMn4GboJTGboRfGbvFUGb3GUGb4JnGgDX3GgFl$GgJlrGgLX6GgLZoGgLf8GgOXoGgrAgGgrJXGgrMYGgrScGgvATGgvOYGnAgoGnJgvGnLZoGnLg3GnLnrGnQn8GnSbrGnrMgHTClvHTDToHTFT3HTQT8HToJTHToJgHTrDUHTrMnHTvFYHTvRfHT8MnHT8SUHUAZ8HUBb4HUDTvHUoMYHXFl6HXJX6HXQlrHXrAUHXrMnHXrSbHXvFYHXvKXHX3LjHX3MeHYvQlHZrScHZvDbHbAcrHbFT3HbFl3HbJT8HbLTrHbMT8HbMXrHbMbrHbQb8HbSX3HboDbHboJTHbrFUHbrHgHbrJTHb8JTHb8MnHb8QgHgAlrHgDT3HgGgrHgHgrHgJTrHgJT8HgLX@HgLnrHgMT8HgMX8HgMboHgOnrHgQToHgRg3HgoHgHgrCbHgrFnHgrLVHgvAcHgvAfHnAloHnCTrHnCnvHnGTrHnGZ8HnGnvHnJT8HnLf8HnLkvHnMg8HnRTrITvFUITvFnJTAXrJTCV8JTFT3JTFT8JTFn4JTGgvJTHT8JTJT8JTJXvJTJl3JTJnvJTLX4JTLf8JTLhvJTMT8JTMXrJTMnrJTObrJTQT8JTSlvJT8DUJT8FkJT8MTJT8OXJT8OgJT8QUJT8RfJUHZoJXFT4JXFlrJXGZ8JXGnrJXLV8JXLgvJXMXoJXMX3JXNboJXPlvJXoJTJXoLkJXrAXJXrHUJXrJgJXvJTJXvOnJX4KnJYAl3JYJT8JYLhvJYQToJYrQXJY6NUJbAl3JbCZrJbDloJbGT8JbGgrJbJXvJbJboJbLf8JbLhrJbLl3JbMnvJbRg8JbSZ8JboDbJbrCZJbrSUJb3KnJb8LnJfRn8JgAXrJgCZrJgDTrJgGZrJgGZ8JgHToJgJT8JgJXoJgJgvJgLX4JgLZ3JgLZ8JgLn4JgMgrJgMn4JgOgvJgPX6JgRnvJgSToJgoCZJgoJbJgoMYJgrJXJgrJgJgrLjJg6MTJlCn3JlGgvJlJl8Jl4AnJl8FnJl8HgJnAToJnATrJnAbvJnDUoJnGnrJnJXrJnJXvJnLhvJnLnrJnLnvJnMToJnMT8JnMXvJnMX3JnMg8JnMlrJnMn4JnOX8JnST4JnSX3JnoAgJnoAnJnoJTJnoObJnrAbJnrAkJnrHnJnrJTJnrJYJnrOYJnrScJnvCUJnvFaJnvJgJnvJnJnvOYJnvQUJnvRUJn3FnJn3JTKnFl3KnLT6LTDlvLTMnoLTOn3LTRl3LTSb4LTSlrLToAnLToJgLTrAULTrAcLTrCULTrHgLTrMgLT3JnLULnrLUMX8LUoJgLVATrLVDTrLVLb8LVoJgLV8MgLV8RTLXDg3LXFlrLXrCnLXrLXLX3GTLX4GgLX4OYLZAXrLZAcrLZAgrLZAhrLZDXyLZDlrLZFbrLZFl3LZJX6LZJX8LZLc8LZLnrLZSU8LZoJTLZoJnLZrAgLZrAnLZrJYLZrLULZrMgLZrSkLZvAnLZvGULZvJeLZvOTLZ3FZLZ4JXLZ8STLZ8ScLaAT3LaAl3LaHT8LaJTrLaJT8LaJXrLaJgvLaJl4LaLVoLaMXrLaMXvLaMX8LbClvLbFToLbHlrLbJn4LbLZ3LbLhvLbMXrLbMnoLbvSULcLnrLc8HnLc8MTLdrMnLeAgoLeOgvLeOn3LfAl3LfLnvLfMl3LfOX8Lf8AnLf8JXLf8LXLgJTrLgJXrLgJl8LgMX8LgRZrLhCToLhrAbLhrFULhrJXLhvJYLjHTrLjHX4LjJX8LjLhrLjSX3LjSZ4LkFX4LkGZ8LkGgvLkJTrLkMXoLkSToLkSU8LkSZ8LkoOYLl3FfLl3MgLmAZrLmCbrLmGgrLmHboLmJnoLmJn3LmLfoLmLhrLmSToLnAX6LnAb6LnCZ3LnCb3LnDTvLnDb8LnFl3LnGnrLnHZvLnHgvLnITvLnJT8LnJX8LnJlvLnLf8LnLg6LnLhvLnLnoLnMXrLnMg8LnQlvLnSbrLnrAgLnrAnLnrDbLnrFkLnrJdLnrMULnrOYLnrSTLnvAnLnvDULnvHgLnvOYLnvOnLn3GgLn4DULn4JTLn4JnMTAZoMTAloMTDb8MTFT8MTJnoMTJnrMTLZrMTLhrMTLkvMTMX8MTRTrMToATMTrDnMTrOnMT3JnMT4MnMT8FUMT8FaMT8FlMT8GTMT8GbMT8GnMT8HnMT8JTMT8JbMT8OTMUCl8MUJTrMUJU8MUMX8MURTrMUSToMXAX6MXAb6MXCZoMXFXrMXHXrMXLgvMXOgoMXrAUMXrAnMXrHgMXrJYMXrJnMXrMTMXrMgMXrOYMXrSZMXrSgMXvDUMXvOTMX3JgMX3OTMX4JnMX8DbMX8FnMX8HbMX8HgMX8HnMX8LbMX8MnMX8OnMYAb8MYGboMYHTvMYHX4MYLTrMYLnvMYMToMYOgvMYRg3MYSTrMbAToMbAXrMbAl3MbAn8MbGZ8MbJT8MbJXrMbMXvMbMX8MbMnoMbrMUMb8AfMb8FbMb8FkMcJXoMeLnrMgFl3MgGTvMgGXoMgGgrMgGnrMgHT8MgHZrMgJnoMgLnrMgLnvMgMT8MgQUoMgrHnMgvAnMg8HgMg8JYMg8LfMloJnMl8ATMl8AXMl8JYMnAToMnAT4MnAZ8MnAl3MnAl4MnCl8MnHT8MnHg8MnJnoMnLZoMnLhrMnMXoMnMX3MnMnrMnOgvMnrFbMnrFfMnrFnMnrNTMnvJXNTMl8OTCT3OTFV8OTFn3OTHZvOTJXrOTOl3OT3ATOT3JUOT3LZOT3LeOT3MbOT8ATOT8AbOT8AgOT8MbOUCXvOUMX3OXHXvOXLl3OXrMUOXvDbOX6NUOX8JbOYFZoOYLbrOYLkoOYMg8OYSX3ObHTrObHT4ObJgrObLhrObMX3ObOX8Ob8FnOeAlrOeJT8OeJXrOeJnrOeLToOeMb8OgJXoOgLXoOgMnrOgOXrOgOloOgoAgOgoJbOgoMYOgoSTOg8AbOjLX4OjMnoOjSV8OnLVoOnrAgOn3DUPXQlrPXvFXPbvFTPdAT3PlFn3PnvFbQTLn4QToAgQToMTQULV8QURg8QUoJnQXCXvQbFbrQb8AaQb8AcQb8FbQb8MYQb8ScQeAlrQeLhrQjAn3QlFXoQloJgQloSnRTLnvRTrGURTrJTRUJZrRUoJlRUrQnRZrLmRZrMnRZrSnRZ8ATRZ8JbRZ8ScRbMT8RbST3RfGZrRfMX8RfMgrRfSZrRnAbrRnGT8RnvJgRnvLfRnvMTRn8AaSTClvSTJgrSTOXrSTRg3STRnvSToAcSToAfSToAnSToHnSToLjSToMTSTrAaSTrEUST3BYST8AgST8LmSUAZvSUAgrSUDT4SUDT8SUGgvSUJXoSUJXvSULTrSU8JTSU8LjSV8AnSV8JgSXFToSXLf8SYvAnSZrDUSZrMUSZrMnSZ8HgSZ8JTSZ8JgSZ8MYSZ8QUSaQUoSbCT3SbHToSbQYvSbSl4SboJnSbvFbSb8HbSb8JgSb8OTScGZrScHgrScJTvScMT8ScSToScoHbScrMTScvAnSeAZrSeAcrSeHboSeJUoSeLhrSeMT8SeMXrSe6JgSgHTrSkJnoSkLnvSk8CUSlFl3SlrSnSl8GnSmAboSmGT8SmJU8\",\n    \"ATLnDlATrAZoATrJX4ATrMT8ATrMX4ATrRTrATvDl8ATvJUoATvMl8AT3AToAT3MX8AT8CT3AT8DT8AT8HZrAT8HgoAUAgFnAUCTFnAXoMX8AXrAT8AXrGgvAXrJXvAXrOgoAXvLl3AZvAgoAZvFbrAZvJXoAZvJl8AZvJn3AZvMX8AZvSbrAZ8FZoAZ8LZ8AZ8MU8AZ8OTvAZ8SV8AZ8SX3AbAgFZAboJnoAbvGboAb8ATrAb8AZoAb8AgrAb8Al4Ab8Db8Ab8JnoAb8LX4Ab8LZrAb8LhrAb8MT8Ab8OUoAb8Qb8Ab8ST8AcrAUoAcrAc8AcrCZ3AcrFT3AcrFZrAcrJl4AcrJn3AcrMX3AcrOTvAc8AZ8Ac8MT8AfAcJXAgoFn4AgoGgvAgoGnrAgoLc8AgoMXoAgrLnrAkrSZ8AlFXCTAloHboAlrHbrAlrLhrAlrLkoAl3CZrAl3LUoAl3LZrAnrAl4AnrMT8An3HT4BT3IToBX4MnvBb!Ln$CTGXMnCToLZ4CTrHT8CT3JTrCT3RZrCT#GTvCU6GgvCU8Db8CU8GZrCU8HT8CboLl3CbrGgrCbrMU8Cb8DT3Cb8GnrCb8LX4Cb8MT8Cb8ObrCgrGgvCgrKX4Cl8FZoDTrAbvDTrDboDTrGT6DTrJgrDTrMX3DTrRZrDTrRg8DTvAVvDTvFZoDT3DT8DT3Ln3DT4HZrDT4MT8DT8AlrDT8MT8DUAkGbDUDbJnDYLnQlDbDUOYDbMTAnDbMXSnDboAT3DboFn4DboLnvDj6JTrGTCgFTGTGgFnGTJTMnGTLnPlGToJT8GTrCT3GTrLVoGTrLnvGTrMX3GTrMboGTvKl3GZClFnGZrDT3GZ8DTrGZ8FZ8GZ8MXvGZ8On8GZ8ST3GbCnQXGbMbFnGboFboGboJg3GboMXoGb3JTvGb3JboGb3Mn6Gb3Qb8GgDXLjGgMnAUGgrDloGgrHX4GgrSToGgvAXrGgvAZvGgvFbrGgvLl3GgvMnvGnDnLXGnrATrGnrMboGnuLl3HTATMnHTAgCnHTCTCTHTrGTvHTrHTvHTrJX8HTrLl8HTrMT8HTrMgoHTrOTrHTuOn3HTvAZrHTvDTvHTvGboHTvJU8HTvLl3HTvMXrHTvQb4HT4GT6HT4JT8HT4Jb#HT8Al3HT8GZrHT8GgrHT8HX4HT8Jb8HT8JnoHT8LTrHT8LgvHT8SToHT8SV8HUoJUoHUoJX8HUoLnrHXrLZoHXvAl3HX3LnrHX4FkvHX4LhrHX4MXoHX4OnoHZrAZ8HZrDb8HZrGZ8HZrJnrHZvGZ8HZvLnvHZ8JnvHZ8LhrHbCXJlHbMTAnHboJl4HbpLl3HbrJX8HbrLnrHbrMnvHbvRYrHgoSTrHgrFV8HgrGZ8HgrJXoHgrRnvHgvBb!HgvGTrHgvHX4HgvHn!HgvLTrHgvSU8HnDnLbHnFbJbHnvDn8Hn6GgvHn!BTvJTCTLnJTQgFnJTrAnvJTrLX4JTrOUoJTvFn3JTvLnrJTvNToJT3AgoJT3Jn4JT3LhvJT3ObrJT8AcrJT8Al3JT8JT8JT8JnoJT8LX4JT8LnrJT8MX3JT8Rg3JT8Sc8JUoBTvJU8AToJU8GZ8JU8GgvJU8JTrJU8JXrJU8JnrJU8LnvJU8ScvJXHnJlJXrGgvJXrJU8JXrLhrJXrMT8JXrMXrJXrQUoJXvCTvJXvGZ8JXvGgrJXvQT8JX8Ab8JX8DT8JX8GZ8JX8HZvJX8LnrJX8MT8JX8MXoJX8MnvJX8ST3JYGnCTJbAkGbJbCTAnJbLTAcJboDT3JboLb6JbrAnvJbrCn3JbrDl8JbrGboJbrIZoJbrJnvJbrMnvJbrQb4Jb8RZrJeAbAnJgJnFbJgScAnJgrATrJgvHZ8JgvMn4JlJlFbJlLiQXJlLjOnJlRbOlJlvNXoJlvRl3Jl4AcrJl8AUoJl8MnrJnFnMlJnHgGbJnoDT8JnoFV8JnoGgvJnoIT8JnoQToJnoRg3JnrCZ3JnrGgrJnrHTvJnrLf8JnrOX8JnvAT3JnvFZoJnvGT8JnvJl4JnvMT8JnvMX8JnvOXrJnvPX6JnvSX3JnvSZrJn3MT8Jn3MX8Jn3RTrLTATKnLTJnLTLTMXKnLTRTQlLToGb8LTrAZ8LTrCZ8LTrDb8LTrHT8LT3PX6LT4FZoLT$CTvLT$GgrLUvHX3LVoATrLVoAgoLVoJboLVoMX3LVoRg3LV8CZ3LV8FZoLV8GTvLXrDXoLXrFbrLXvAgvLXvFlrLXvLl3LXvRn6LX4Mb8LX8GT8LYCXMnLYrMnrLZoSTvLZrAZvLZrAloLZrFToLZrJXvLZrJboLZrJl4LZrLnrLZrMT8LZrOgvLZrRnvLZrST4LZvMX8LZvSlvLZ8AgoLZ8CT3LZ8JT8LZ8LV8LZ8LZoLZ8Lg8LZ8SV8LZ8SbrLZ$HT8LZ$Mn4La6CTvLbFbMnLbRYFTLbSnFZLboJT8LbrAT9LbrGb3LbrQb8LcrJX8LcrMXrLerHTvLerJbrLerNboLgrDb8LgrGZ8LgrHTrLgrMXrLgrSU8LgvJTrLgvLl3Lg6Ll3LhrLnrLhrMT8LhvAl4LiLnQXLkoAgrLkoJT8LkoJn4LlrSU8Ll3FZoLl3HTrLl3JX8Ll3JnoLl3LToLmLeFbLnDUFbLnLVAnLnrATrLnrAZoLnrAb8LnrAlrLnrGgvLnrJU8LnrLZrLnrLhrLnrMb8LnrOXrLnrSZ8LnvAb4LnvDTrLnvDl8LnvHTrLnvHbrLnvJT8LnvJU8LnvJbrLnvLhvLnvMX8LnvMb8LnvNnoLnvSU8Ln3Al3Ln4FZoLn4GT6Ln4JgvLn4LhrLn4MT8Ln4SToMToCZrMToJX8MToLX4MToLf8MToRg3MTrEloMTvGb6MT3BTrMT3Lb6MT8AcrMT8AgrMT8GZrMT8JnoMT8LnrMT8MX3MUOUAnMXAbFnMXoAloMXoJX8MXoLf8MXoLl8MXrAb8MXrDTvMXrGT8MXrGgrMXrHTrMXrLf8MXrMU8MXrOXvMXrQb8MXvGT8MXvHTrMXvLVoMX3AX3MX3Jn3MX3LhrMX3MX3MX4AlrMX4OboMX8GTvMX8GZrMX8GgrMX8JT8MX8JX8MX8LhrMX8MT8MYDUFbMYMgDbMbGnFfMbvLX4MbvLl3Mb8Mb8Mb8ST4MgGXCnMg8ATrMg8AgoMg8CZrMg8DTrMg8DboMg8HTrMg8JgrMg8LT8MloJXoMl8AhrMl8JT8MnLgAUMnoJXrMnoLX4MnoLhrMnoMT8MnrAl4MnrDb8MnrOTvMnrOgvMnrQb8MnrSU8MnvGgrMnvHZ8Mn3MToMn4DTrMn4LTrMn4Mg8NnBXAnOTFTFnOToAToOTrGgvOTrJX8OT3JXoOT6MTrOT8GgrOT8HTpOT8MToOUoHT8OUoJT8OUoLn3OXrAgoOXrDg8OXrMT8OXvSToOX6CTvOX8CZrOX8OgrOb6HgvOb8AToOb8MT8OcvLZ8OgvAlrOgvHTvOgvJTrOgvJnrOgvLZrOgvLn4OgvMT8OgvRTrOg8AZoOg8DbvOnrOXoOnvJn4OnvLhvOnvRTrOn3GgoOn3JnvOn6JbvOn8OTrPTGYFTPbBnFnPbGnDnPgDYQTPlrAnvPlrETvPlrLnvPlrMXvPlvFX4QTMTAnQTrJU8QYCnJlQYJlQlQbGTQbQb8JnrQb8LZoQb8LnvQb8MT8Qb8Ml8Qb8ST4QloAl4QloHZvQloJX8QloMn8QnJZOlRTrAZvRTrDTrRTvJn4RTvLhvRT4Jb8RZrAZrRZ8AkrRZ8JU8RZ8LV8RZ8LnvRbJlQXRg3GboRg3MnvRg8AZ8Rg8JboRg8Jl4RnLTCbRnvFl3RnvQb8SToAl4SToCZrSToFZoSToHXrSToJU8SToJgvSToJl4SToLhrSToMX3STrAlvSTrCT9STrCgrSTrGgrSTrHXrSTrHboSTrJnoSTrNboSTvLnrST4AZoST8Ab8ST8JT8SUoJn3SU6HZ#SU6JTvSU8Db8SU8HboSU8LgrSV8JT8SZrAcrSZrAl3SZrJT8SZrJnvSZrMT8SZvLUoSZ4FZoSZ8JnoSZ8RZrScoLnrScoMT8ScoMX8ScrAT4ScrAZ8ScrLZ8ScrLkvScvDb8ScvLf8ScvNToSgrFZrShvKnrSloHUoSloLnrSlrMXoSl8HgrSmrJUoSn3BX6\",\n    \"ATFlOn3ATLgrDYAT4MTAnAT8LTMnAYJnRTrAbGgJnrAbLV8LnAbvNTAnAeFbLg3AgOYMXoAlQbFboAnDboAfAnJgoJTBToDgAnBUJbAl3BboDUAnCTDlvLnCTFTrSnCYoQTLnDTwAbAnDUDTrSnDUHgHgrDX8LXFnDbJXAcrETvLTLnGTFTQbrGTMnGToGT3DUFbGUJlPX3GbQg8LnGboJbFnGb3GgAYGgAg8ScGgMbAXrGgvAbAnGnJTLnvGnvATFgHTDT6ATHTrDlJnHYLnMn8HZrSbJTHZ8LTFnHbFTJUoHgSeMT8HgrLjAnHgvAbAnHlFUrDlHnDgvAnHnHTFT3HnQTGnrJTAaMXvJTGbCn3JTOgrAnJXvAXMnJbMg8SnJbMnRg3Jb8LTMnJnAl3OnJnGYrQlJnJlQY3LTDlCn3LTJjLg3LTLgvFXLTMg3GTLV8HUOgLXFZLg3LXNXrMnLX8QXFnLX9AlMYLYLXPXrLZAbJU8LZDUJU8LZMXrSnLZ$AgFnLaPXrDULbFYrMnLbMn8LXLboJgJgLeFbLg3LgLZrSnLgOYAgoLhrRnJlLkCTrSnLkOnLhrLnFX%AYLnFZoJXLnHTvJbLnLloAbMTATLf8MTHgJn3MTMXrAXMT3MTFnMUITvFnMXFX%AYMXMXvFbMXrFTDbMYAcMX3MbLf8SnMb8JbFnMgMXrMTMgvAXFnMgvGgCmMnAloSnMnFnJTrOXvMXSnOX8HTMnObJT8ScObLZFl3ObMXCZoPTLgrQXPUFnoQXPU3RXJlPX3RkQXPbrJXQlPlrJbFnQUAhrDbQXGnCXvQYLnHlvQbLfLnvRTOgvJbRXJYrQlRYLnrQlRbLnrQlRlFT8JlRlFnrQXSTClCn3STHTrAnSTLZQlrSTMnGTrSToHgGbSTrGTDnSTvGXCnST3HgFbSU3HXAXSbAnJn3SbFT8LnScLfLnv\",\n    \"AT3JgJX8AT8FZoSnAT8JgFV8AT8LhrDbAZ8JT8DbAb8GgLhrAb8SkLnvAe8MT8SnAlMYJXLVAl3GYDTvAl3LfLnvBUDTvLl3CTOn3HTrCT3DUGgrCU8MT8AbCbFTrJUoCgrDb8MTDTLV8JX8DTLnLXQlDT8LZrSnDUQb8FZ8DUST4JnvDb8ScOUoDj6GbJl4GTLfCYMlGToAXvFnGboAXvLnGgAcrJn3GgvFnSToGnLf8JnvGn#HTDToHTLnFXJlHTvATFToHTvHTDToHTvMTAgoHT3STClvHT4AlFl6HT8HTDToHUoDgJTrHUoScMX3HbRZrMXoHboJg8LTHgDb8JTrHgMToLf8HgvLnLnoHnHn3HT4Hn6MgvAnJTJU8ScvJT3AaQT8JT8HTrAnJXrRg8AnJbAloMXoJbrATFToJbvMnoSnJgDb6GgvJgDb8MXoJgSX3JU8JguATFToJlPYLnQlJlQkDnLbJlQlFYJlJl8Lf8OTJnCTFnLbJnLTHXMnJnLXGXCnJnoFfRg3JnrMYRg3Jn3HgFl3KT8Dg8LnLTRlFnPTLTvPbLbvLVoSbrCZLXMY6HT3LXNU7DlrLXNXDTATLX8DX8LnLZDb8JU8LZMnoLhrLZSToJU8LZrLaLnrLZvJn3SnLZ8LhrSnLaJnoMT8LbFlrHTvLbrFTLnrLbvATLlvLb6OTFn3LcLnJZOlLeAT6Mn4LeJT3ObrLg6LXFlrLhrJg8LnLhvDlPX4LhvLfLnvLj6JTFT3LnFbrMXoLnQluCTvLnrQXCY6LnvLfLnvLnvMgLnvLnvSeLf8MTMbrJn3MT3JgST3MT8AnATrMT8LULnrMUMToCZrMUScvLf8MXoDT8SnMX6ATFToMX8AXMT8MX8FkMT8MX8HTrDUMX8ScoSnMYJT6CTvMgAcrMXoMg8SToAfMlvAXLg3MnFl3AnvOT3AnFl3OUoATHT8OU3RnLXrOXrOXrSnObPbvFn6Og8HgrSnOg8OX8DbPTvAgoJgPU3RYLnrPXrDnJZrPb8CTGgvPlrLTDlvPlvFUJnoQUvFXrQlQeMnoAl3QlrQlrSnRTFTrJUoSTDlLiLXSTFg6HT3STJgoMn4STrFTJTrSTrLZFl3ST4FnMXoSUrDlHUoScvHTvSnSfLkvMXo\",\n    \"AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg\",\n    \"HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb\",\n    \"AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl\"\n];\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*\";\nfunction getHangul(code) {\n    if (code >= 40) {\n        code = code + 168 - 40;\n    }\n    else if (code >= 19) {\n        code = code + 97 - 19;\n    }\n    return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]));\n}\nlet _wordlist = null;\nfunction loadWords() {\n    if (_wordlist != null) {\n        return _wordlist;\n    }\n    const wordlist = [];\n    data.forEach((data, length) => {\n        length += 4;\n        for (let i = 0; i < data.length; i += length) {\n            let word = \"\";\n            for (let j = 0; j < length; j++) {\n                word += getHangul(codes.indexOf(data[i + j]));\n            }\n            wordlist.push(word);\n        }\n    });\n    wordlist.sort();\n    // Verify the computed list matches the official list\n    /* istanbul ignore if */\n    const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n    /* c8 ignore start */\n    if (checksum !== \"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a\") {\n        throw new Error(\"BIP39 Wordlist for ko (Korean) FAILED\");\n    }\n    /* c8 ignore stop */\n    _wordlist = wordlist;\n    return wordlist;\n}\nlet wordlist = null;\n/**\n *  The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangKo extends Wordlist {\n    /**\n     *  Creates a new instance of the Korean language Wordlist.\n     *\n     *  This should be unnecessary most of the time as the exported\n     *  [[langKo]] should suffice.\n     *\n     *  @_ignore:\n     */\n    constructor() {\n        super(\"ko\");\n    }\n    getWord(index) {\n        const words = loadWords();\n        assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n        return words[index];\n    }\n    getWordIndex(word) {\n        return loadWords().indexOf(word);\n    }\n    /**\n     *  Returns a singleton instance of a ``LangKo``, creating it\n     *  if this is the first time being called.\n     */\n    static wordlist() {\n        if (wordlist == null) {\n            wordlist = new LangKo();\n        }\n        return wordlist;\n    }\n}\n//# sourceMappingURL=lang-ko.js.mapimport { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ R<g(Revi Rig Rup$S*$Solu$Sur=Ut[0Ab#Alm Amp Anh A,Ei.El( En ErvoEss E$naHa.IdezImaI}#Irr Lam LiveOlhidaOmod Opl Ord Um~ Us?0Ap.EgaEnt_Ep$Equ Er-%EsivoEusI<%ItivoJetivoJun$M' Or Qu''UboV(,Vog#0R}ave0As.Er'EtivoIn?Iv` Li$Lu-%R}.0Ach Arr As&/Enci Iliz Io)It#O+R! Res%Rup U d Ul]2O`h Ud Us.1AmedaArmeAstr Av<caB(gueB*oCat+De@EcrimEgr@Er.FaceF*e%GumHeioI Ica%I- Inh Ivi Mof^Oc Pis%T( TitudeUc* Ug UnoUsivoVo0Aci A=rA[loAss BasBi-%EixaEniz I=Is$,Iz!eOl?On$ O_,Ost+P  Pli Pola0Ag+maAlis Arqu@A$m@DaimeElExoG~ Im JoOm&@Ot#Sio,T(i|Uid!eUnci Zol1Ag?Alp Anh#EgoEli=Ert^Es Eti%I$Lau,Lic^OioOn.Os)R-dizRov 0Uec(0AmeAn]A+C^D-%E@Ej Eni$Es)Gilo,GolaMaQuivoRai&Reba%Risc Rob>um S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI<oIl I}e)Ir_Ixis)J~ Le@LizaLsaN&Nd{aN/N'Nque%Ra$Rb#R}es>+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:B<aB`oBideBoBri$CauCet^C/r_CiqueDast_De#Fez&IaqueIp'aIxo%J#JuLafrioLc~ Ld{aLibr Lm<%Lo)M^Mbis)MisaMomilaMp<]Mufl Navi&Nc` Ne)NguruN/$Nive%NoaNs#N.Nu=Pac/P`aP* Po.Pric/Pt?PuzRacolRb}oRde&Rec>imb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%G<aM-$N$Nz><d>cui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVilZ*]2A%+AvoEcheE=rEmeErEspoI^Im*&Io~oIseItic Os)UaUz{o2B<oEcaId#JoLat+Lm* Lp Ltu+Mpr'Nh#Pi=RativoRr&Rs R$Sp'S% T`o:MascoT 3Ba%rBi.BocheB~h C&queCim&CliveCo%C[.D&Dic#Duz'FesaFum G`oG+uGus.It#Ix La$rLeg#L*e L}gaM<daMit'Moli=Ntis)P-#Pil PoisP[ssaPur Riv>+m SafioSbo.Sc<,S-/Sfi#Sgas%Sigu&SlizeSmam SovaSpesaS)queSvi T&h T-$rT} Tri$UsaV(Vi=Vot#Z-a3Ag+maAle$Da)Fu,Gi.Lat#Lu-%M*u'Nast@Nh{oOceseRe$Sc[)Sf ceSp oSque%Ssip S)n%T?UrnoV(,Vi,rV~g Z(5Br?L|i=M?M*#NativoNz`>m-%Rs&SagemUr#U$r2EnagemIbleOg @2El EndeE$PloQues><%Vi=,:1Lod'O Olog@0Ific It&Uc#1Ei$Etiv 3E.1Ab| Eg(Ei$rEncoEv?Im* Ogi 0B goBol#Br~/Buti=EndaErg'Is,rPat@P-/P*#Polg P[goPurr Ul?0CaixeC-#Ch-%C}t_Deus Doss Faix Fei%FimGaj#G-/Glob Gom#G+x Gu@Jo La.Qu<$Raiz Rol#Rug SaioSe^S*oSop#T<$Te#Tid!eT|.Tr^T~/V(g Vi#Volv(XameX($Xof[Xu$1Id(me0Uip 0E$Gui=Ra)VaVil]0B<j B`$CamaColaCri)Cu)F*geFol F[g Fum#GrimaM&%P<$P`/PigaP}jaP[i)Pum Qu(daTacaT{aTic Tof#T[laTu=Vazi 0AnolIque)0F|i>opeu0Acu Ap| AsivoEntu&Id-%Olu'1Ag(oAl Am* A$Aus$Ces,Ci.Clam Ecu.EmploIb'Ig-%On( P<d'P`'P' Pl< Pos$P[s,P~s T(noT*$T+$:Bric B~o,Ce)Ci&DaDigaIxaL L)Mili Nd<goNf +N$cheRd#R`oR*h>of>p>tu+T@T|V|i)X*aZ-da3Ch#Ijo^I+n%L*oM**oNdaNoR>i#RrugemRv(S%j T&Ud&3ApoB_seC Ch{oGur#L{aL/LmeLtr RmezaSg^Ssu+TaV`aX?Xo2AcidezAm*goAn`aEch^O+Utu Uxo2C&C*/Foc GoGue%IceLg#Lhe$Rj Rmig>noR%ScoSsa2Aga)AldaAngoAscoA%rnoE'aEn%E.IezaI,Itu+On]Ustr U%'a2G'L<oLigemNd NgoNilR?Rio,Tebol:B i$B*e%DoIa$IolaIvo)LegaL/L*]Loc]Nh RagemRfoRg&oRimpoRoup>+faSodu$S$TaTil/Ve)Z`a3L#Le@LoM^M(Mi=N(o,NgivaNi&NomaN_Ologi>?Rm* S,S$r3Nas)Nc<aNg#Raf>*o2Aci&IcoseOb&Orio,2ElaIabaLfeLpe Rdu+Rje)R_S$,T{aV(n 2AcejoAdu&Afi%Al]AmpoAn^Atui$Ave$AxaEgoElh EveIloIs&/I.@Os,O%scoUd#Unhi=U)2AcheA+niAx*imEr[ I Inc/Is#LaLo,Ru:Bi.Rm}@S%V(3C.eRd Res@Si.3A$B(n D+.EnaNoPismoPnosePo%ca5JeLofo%MemNes$Nr#Rm}&Sped 5M|#:Te2E@O,2N|#RejaU<a4E,HaUdi=Um* Ustr 0AgemEd@$En,ErsivoIn-%It?Ort&Pac$Ped'Pl<%P|Pr-saPuneUniz 0Al?Ap$AtivoC-,Ch Cid'Clu'Col|Deci,D'e$Du$rEficazEr-%F<tilFes.F*i$Flam F|m&F+$rG('Ibi=Ici&ImigoJe.Oc-%O=_Ov?OxQuie$Scri$Se$Sist'Spe$rSt& S~$Tac$Tegr&Tim Toc#TrigaVa,rV(noVic$Voc 0Gur%2Ani<oOniz Re&Rit#0CaEn$Ol#Qu{o0Ali<o:N{oNg^N)R ac>dimR_SmimToV&iZida3Jum9An*]Elh^G?I>n&Rr Vem5BaDeuDocaIzLg?L/R#Ris)RoS)::B edaB|&C[C)n%Dril/G )GoaJeMb(M-.M* MpejoNchePid P,R<j>{>gu+S<]St_T(&Ti=V<daVou+Vr?X<%Z(3Ald!eB[G#G-d Gis)IgoIlo Itu+Mb[%MeNh?Ntil]OaSmaS%TivoT['oV VezaVi.3B(&Bi=D( G G{oMi.Mo{oMp?NdaNe N]gemQuidezS)gemSu+T|&V_XaX{a5C?Cu$rJis)MboNaNgeNt+RdeT#T(@Ucu+UsaUv 5ArCidezC_Ne)St[T?Va:CacoCe%Ch#CioD{aDr*]Gna)G[zaI|IsL<d_L]Lo%LucoMiloMo{oMu%N^Nc]Nda$NequimN/,Niv`aNobr NsaN%rNuse Pe#Qu* Rc?Resi>fimRgemR*/Rmi)Ro$RquiseR[coR%loRujoSco%Sm|+SsagemStig Tag&T(noT*&Tu.Xil 3D&]DidaDusaGaf}eIgaL<c@L/rMb_M|i&N*oNosNsagemNt&Rec(Rg~/S^Scl SmoSqui)St[T!eTeo_T+gemX(Xic<o3C_G&]Gr Lag[L- Lh M#N( N/caNist_N|@OloR<%RtiloStur 5Cid!eD(noD~ EdaErIn/I)Ldu+LezaL/L*e%LuscoN)n]Quec><goRcegoR=moR-aSaicoSque%S.daT`TimToTriz5DaI$La)Lh(L.Ndi&Ni=R&h>c/Sc~ SeuSic&:Ci}&D?JaMo_R*>r#Sc(TivaTu[zaV&]Veg Vio3Bl*aB~o,GativaGoci Gri$Rvo,TaUr&VascaVo{o3N N/TidezV` 5B[zaI%IvaMe M*&Rdes%R% T Tici TurnoV`oVil/Vo5Bl#DezM(&Pci&Tr'Vem:0Cec#Edec(JetivoRig#Scu_S%t+T(Tur 0Id-%Io,Orr(Ulis)Up#2Eg<%EnsivaEr-daIc*aUsc#0Iva4Ar@Eo,H Iv{a0B_Ele%Is,It'0D~#E_,Tem1Ci}&Er?On-%OrtunoOs$1ArBi.DemD*&F<a$GasmoG~/I-t&IgemIun=LaTo=xoV&/0Cil S^SoT-.0Imismo0S!@T}oTub_Vi=0El]Ul 1Id Ig- :Ca$Ci-%Co%Ctu D @Dr*/G GodeIn`Ir IsagemLav+Lest+Lhe)Li$Lm^Lpi.Nc^N`aNfle$NquecaN)n&PagaioP`^P'oRaf*>ci&Rd&RedeRtidaSmoSs#S%lTam T-%T* T_noUl^Us 3C~i D& Dest[D@t+D+G^I$r&IxeLeLic<oNcaNdur N{aN]scoNs?N%Rceb(Rfei$Rgun)Ri$Rmit'Rn>plexoRsi<>%nceRucaSc#SquisaS,aTisc 3AdaC#Ed!eGm-$Last+Lh#Lo.M-)Nc`NguimN]No%N.On{oPocaQue%R<h>esRue)Sc S$laT<gaVe%2An)Aque)At*aEbeuUmagemUvi&1Eu0DaE'aEtisaLeg^Lici Lu-%Lvil/M MbaNd( N.@P~o,R)Ssu'St&TeUp U,Vo 2A@Anc]A$AxeEceEd?Efei$Emi Ens Ep  Esil]E%x$Ev-'Ez Ima)IncesaIsmaIv#Oces,Odu$Ofe)Oibi=Oje$Ome%rOpag OsaO%$rOv?2Blic DimL Lm} Ls{aNh&N'PiloRezaX?:99Ad+Ant@Ar$AseEbr EdaEijoEn%Eri=Im}oInaIosque:B<^BiscoCh Ci} Di&I In]IoIvaJ^L#M&Ng(Nhu+P!u+P`PidezPosaQue%Rid!eS<%Scun/Sg Sp?S%'aSur Taz<aTo{a3AlezaAnim Av(Baix B`deBol C#C-%CheioCiboC|d Cru.Cu DeDim'D}daDuzidaEnvioF* Flet'Fog F[scoFugi G&@GimeG+In#I$rJei.LativoM?M-=M|,Nov#P oP`'Ple$Pol/P[saPudi Qu((S-]Sfri Sga.Sid'Solv(Spei$SsacaS)n%Sum'T&/T(T' Tom^T+.V` Vi,rVol)3Ac/CaGidezGo_,M NgueS^ScoS}/5B&oChe=D^DeioDov@E=rLe)M<oNc S#S{aS$TaT{oT*aT~ UcoUpaXo5B_Gi=Go,IvoMoPest[S,:B|Ci ColaCud'DioF'aGaGr^Ib_L^L{oLg#LivaLpic Lsic]L.Lv?Mb Mu+iN Nf}aNgueNid!ePa$Rd>g-$Rje)Tur Ud!eXof}eZ}&3C C~ DaD-$Di#Do,Du$rGm-$G[=Gun=IvaLe$LvagemM<&M-%N?N/rNsu&Nt#P #Rei>*g>+RvoTemb_T|3GiloLhue)Lic}eMetr@Mpat@M~ N&Nc(oNg~ NopseN$ni>-eRiTu#5B(<oB+C|_G_JaLdaLetr L%'oMbrioNa)Nd Neg Nh?NoP+noQue%Rr'R%ioSsegoTaqueT(r V#Z*/5Aviz BidaBm(,B,loBt+'Ca)Ces,CoDes%FixoG?G('Jei$Lfa$M'OrP(i|Plic Pos$Prim'Rd*>fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezM</Mb|imMpaNg-%N$P Pioc>dioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ C<oDoLipaPiRboRm>quesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oR<d>e)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi=\";\nconst checksum = \"0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac\";\nlet wordlist = null;\n/**\n *  The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangPt extends WordlistOwl {\n    /**\n     *  Creates a new instance of the Portuguese language Wordlist.\n     *\n     *  This should be unnecessary most of the time as the exported\n     *  [[langPt]] should suffice.\n     *\n     *  @_ignore:\n     */\n    constructor() { super(\"pt\", words, checksum); }\n    /**\n     *  Returns a singleton instance of a ``LangPt``, creating it\n     *  if this is the first time being called.\n     */\n    static wordlist() {\n        if (wordlist == null) {\n            wordlist = new LangPt();\n        }\n        return wordlist;\n    }\n}\n//# sourceMappingURL=lang-pt.js.mapimport { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = \"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN<di,AM=W5%QO&ka&ua,hM^tm=zV=JA=wR&+X]7P&NB#4J#5L|/b[dA}tJ<Do&6m&u2[U1&Kb.HM&mC=w0&MW<rY,Hq#6M}QG,13&wP}Jp]Ow%ue&Kg<HP<D9~4k~9T&I2_c6$9T#9/[C5~7O~4a=cs&O7=KK=An&l9$6U$8A&uD&QI|/Y&bg}Ux&F2#6b}E2&JN&kW&kp=U/&bb=Xl<Cj}k+~5J#6L&5z&9i}b4&Fo,ho(X0_g3~4O$Fz&QE<HN=Ww]6/%GF-Vw=tj&/D&PN#9g=YO}cL&Of&PI~5I&Ip=vU=IW#9G;0o-wU}ss&QR<BT&R9=tk$PY_dh&Pq-yh]7T,nj.Xu=EP&76=cI&Fs*Xg}z7$Gb&+I=DF,AF=cA}rL#7j=Dz&3y<Aa$52=PQ}b0(iY$Fa}oL&xV#6U=ec=WZ,xh%RY<dp#9N&Fl&44=WH*A7=sh&TB&8P=07;u+&PK}uh}J5#72)V/=xC,AB$k0&f6;1E|+5=1B,3v]6n&wR%b+&xx]7f=Ol}fl;+D^wG]7E;nB;uh^Ir&l5=JL,nS=cf=g5;u6|/Q$Gc=MH%Hg#5d%M6^86=U+$Gz,l/,ir^5y&Ba&/F-IY&FI&be%IZ#77&PW_Nu$kE(Yf&NX]7Z,Jy&FJ(Xo&Nz#/d=y7&MX<Ag}Z+;nE]Dt(iG#4D=13&Pj~4c%v8&Zo%OL&/X#4W<HR&ie~6J_1O(Y2=y5=Ad*cv_eB#6k&PX:BU#7A;uk&Ft&Fx_dD=U2;vB=U5=4F}+O&GN.HH:9s=b0%NV(jO&IH=JT}Z9=VZ<Af,Kx^4m&uJ%c6,6r;9m#+L}cf%Kh&F3~4H=vP}bu,Hz|++,1w]nv}k6;uu$jw*Kl*WX&uM[x7&Fr[m7$NO&QN]hu=JN}nR^8g#/h(ps|KC;vd}xz=V0}p6&FD$G1#7K<bG_4p~8g&cf;u4=tl}+k%5/}fz;uw<cA=u1}gU}VM=LJ=eX&+L&Pr#4U}p2:nC,2K]7H:jF&9x}uX#9O=MB<fz~8X~5m&4D&kN&u5%E/(h7(ZF&VG<de(qM|/e-Wt=3x(a+,/R]f/&ND$Ro&nU}0g=KA%kH&NK$Ke<dS}cB&IX~5g$TN]6m=Uv,Is&Py=Ef%Kz#+/%bi&+A<F4$OG&4C&FL#9V<Zk=2I_eE&6c]nw&kq$HG}y+&A8$P3}OH=XP]70%IS(AJ_gH%GZ&tY&AZ=vb~6y&/r=VI=Wv<Zi=fl=xf&eL}c8}OL=MJ=g8$F7=YT}9u=0+^xC}JH&nL^N0~4T]K2,Cy%OC#6s;vG(AC^xe^cG&MF}Br#9P;wD-7h$O/&xA}Fn^PC]6i]7G&8V$Qs;vl(TB~73~4l<mW&6V=2y&uY&+3)aP}XF;LP&kx$wU=t7;uy<FN&lz)7E=Oo*Y+;wI}9q}le;J6&Ri&4t&Qr#8B=cb&vG=J5|Ql(h5<Yy~4+}QD,Lx=wn%K/&RK=dO&Pw,Q9=co%4u;9u}g0@6a^4I%b0=zo|/c&tX=dQ=OS#+b=yz_AB&wB&Pm=W9$HP_gR=62=AO=ti=hI,oA&jr&dH=tm&b6$P2(x8=zi;nG~7F;05]0n[Ix&3m}rg=Xp=cd&uz]7t;97=cN;vV<jf&FF&F1=6Q&Ik*Kk&P4,2z=fQ]7D&3u,H0=d/}Uw<ZN<7R}Kv;0f$H7,MD]7n$F0#88~9Z%da=by;+T#/u=VF&fO&kr^kf<AB]sU,I5$Ng&Pz;0i&QD&vM=Yl:BM;nJ_xJ]U7&Kf&30,3f|Z9*dC)je_jA&Q4&Kp$NH(Yz#6S&Id%Ib=KX,AD=KV%dP}tW&Pk^+E_Ni=cq,3R}VZ(Si=b+}rv;0j}rZ]uA,/w(Sx&Jv$w9&4d&wE,NJ$Gy=J/]Ls#7k<ZQ<Y/&uj]Ov$PM;v3,2F&+u:up=On&3e,Jv;90=J+&Qm]6q}bK#+d~8Y(h2]hA;99&AS=I/}qB&dQ}yJ-VM}Vl&ui,iB&G3|Dc]7d=eQ%dX%JC_1L~4d^NP;vJ&/1)ZI#7N]9X[bQ&PL=0L(UZ,Lm&kc&IR}n7(iR<AQ<dg=33=vN}ft}au]7I,Ba=x9=dR~6R&Tq=Xi,3d$Nr&Bc}DI&ku&vf]Dn,/F&iD,Ll&Nw=0y&I7=Ls=/A&tU=Qe}Ua&uk&+F=g4=gh=Vj#+1&Qn}Uy*44#5F,Pc&Rz*Xn=oh=5W;0n_Nf(iE<Y7=vr=Zu]oz#5Z%mI=kN=Bv_Jp(T2;vt_Ml<FS&uI=L/&6P]64$M7}86<bo%QX(SI%IY&VK=Al&Ux;vv;ut*E/%uh<ZE|O3,M2(yc]yu=Wk&tp:Ex}hr,Cl&WE)+Z=8U}I2_4Q,hA_si=iw=OM=tM=yZ%Ia=U7;wT}b+;uo=Za}yS!5x}HD}fb#5O_dA;Nv%uB(yB;01(Sf}Fk;v7}Pt#8v<mZ#7L,/r&Pl~4w&f5=Ph$Fw_LF&8m,bL=yJ&BH}p/*Jn}tU~5Q;wB(h6]Df]8p^+B;E4&Wc=d+;Ea&bw$8C&FN,DM=Yf}mP~5w=fT#6V=mC=Fi=AV}jB&AN}lW}aH#/D)dZ;hl;vE}/7,CJ;31&w8,hj%u9_Js=jJ&4M~8k=TN&eC}nL&uc-wi&lX}dj=Mv=e2#6u=cr$uq$6G]8W}Jb:nm=Yg<b3(UA;vX&6n&xF=KT,jC,De&R8&oY=Zv&oB]7/=Z2&Oa}bf,hh(4h^tZ&72&Nx;D2&xL~5h~40)ZG)h+=OJ&RA]Bv$yB=Oq=df,AQ%Jn}OJ;11,3z&Tl&tj;v+^Hv,Dh(id=s+]7N&N3)9Q~8f,S4=uW=w4&uX,LX&3d]CJ&yp&8x<b2_do&lP=y/<cy_dG=Oi=7R(VH(lt_1T,Iq_AA;12^6T%k6#8K[B1{oO<AU[Bt;1b$9S&Ps<8T=St{bY,jB(Zp&63&Uv$9V,PM]6v&Af}zW[bW_oq}sm}nB&Kq&gC&ff_eq_2m&5F&TI}rf}Gf;Zr_z9;ER&jk}iz_sn<BN~+n&vo=Vi%97|ZR=Wc,WE&6t]6z%85(ly#84=KY)6m_5/=aX,N3}Tm&he&6K]tR_B2-I3;u/&hU&lH<AP=iB&IA=XL;/5&Nh=wv<BH#79=vS=zl<AA=0X_RG}Bw&9p$NW,AX&kP_Lp&/Z(Tc]Mu}hs#6I}5B&cI<bq&H9#6m=K9}vH(Y1(Y0#4B&w6,/9&gG<bE,/O=zb}I4_l8<B/;wL%Qo<HO[Mq=XX}0v&BP&F4(mG}0i}nm,EC=9u{I3,xG&/9=JY*DK&hR)BX=EI=cx=b/{6k}yX%A+&wa}Xb=la;wi^lL;0t}jo&Qb=xg=XB}iO<qo{bR=NV&8f=a0&Jy;0v=uK)HK;vN#6h&jB(h/%ud&NI%wY.X7=Pt}Cu-uL&Gs_hl%mH,tm]78=Lb^Q0#7Y=1u<Bt&+Q=Co_RH,w3;1e}ux<aU;ui}U3&Q5%bt]63&UQ|0l&uL}O7&3o,AV&dm|Nj(Xt*5+(Uu&Hh(p7(UF=VR=Bp^Jl&Hd[ix)9/=Iq]C8<67]66}mB%6f}bb}JI]8T$HA}db=YM&pa=2J}tS&Y0=PS&y4=cX$6E,hX,XP&nR;04,FQ&l0&Vm_Dv#5Y~8Z=Bi%MA]6x=JO:+p,Az&9q,Hj~6/}SD=K1:EJ}nA;Qo#/E]9R,Ie&6X%W3]61&v4=xX_MC=0q;06(Xq=fs}IG}Dv=0l}o7$iZ;9v&LH&DP-7a&OY,SZ,Kz,Cv&dh=fx|Nh,F/~7q=XF&w+;9n&Gw;0h}Z7<7O&JK(S7&LS<AD<ac=wo<Dt&zw%4B=4v#8P;9o~6p*vV=Tm,Or&I6=1q}nY=P0=gq&Bl&Uu,Ch%yb}UY=zh}dh}rl(T4_xk(YA#8R*xH,IN}Jn]7V}C4&Ty}j3]7p=cL=3h&wW%Qv<Z3=f0&RI&+S(ic_zq}oN&/Y=z1;Td=LW=0e=OI(Vc,+b^ju(UL;0r:Za%8v=Rp=zw&58&73&wK}qX]6y&8E)a2}WR=wP^ur&nQ<cH}Re=Aq&wk}Q0&+q=PP,Gc|/d^k5,Fw]8Y}Pg]p3=ju=ed}r5_yf&Cs]7z$/G<Cm&Jp&54_1G_gP_Ll}JZ;0u]k8_7k(Sg]65{9i=LN&Sx&WK,iW&fD&Lk{9a}Em-9c#8N&io=sy]8d&nT&IK(lx#7/$lW(Td<s8~49,3o<7Y=MW(T+_Jr&Wd,iL}Ct=xh&5V;v4&8n%Kx=iF&l2_0B{B+,If(J0,Lv;u8=Kx-vB=HC&vS=Z6&fU&vE^xK;3D=4h=MR#45:Jw;0d}iw=LU}I5=I0]gB*im,K9}GU,1k_4U&Tt=Vs(iX&lU(TF#7y,ZO}oA&m5#5P}PN}Uz=hM<B1&FB<aG,e6~7T<tP(UQ_ZT=wu&F8)aQ]iN,1r_Lo&/g:CD}84{J1_Ki&Na&3n$jz&FE=dc;uv;va}in}ll=fv(h1&3h}fp=Cy}BM(+E~8m}lo%v7=hC(T6$cj=BQ=Bw(DR,2j=Ks,NS|F+;00=fU=70}Mb(YU;+G&m7&hr=Sk%Co]t+(X5_Jw}0r}gC(AS-IP&QK<Z2#8Q$WC]WX}T2&pG_Ka,HC=R4&/N;Z+;ch(C7,D4$3p_Mk&B2$8D=n9%Ky#5z(CT&QJ#7B]DC]gW}nf~5M;Iw#80}Tc_1F#4Z-aC}Hl=ph=fz,/3=aW}JM}nn;DG;vm}wn,4P}T3;wx&RG$u+}zK=0b;+J_Ek{re<aZ=AS}yY#5D]7q,Cp}xN=VP*2C}GZ}aG~+m_Cs=OY#6r]6g<GS}LC(UB=3A=Bo}Jy<c4}Is;1P<AG}Op<Z1}ld}nS=1Z,yM&95&98=CJ(4t:2L$Hk=Zo}Vc;+I}np&N1}9y=iv}CO*7p=jL)px]tb^zh&GS&Vl%v/;vR=14=zJ&49|/f]hF}WG;03=8P}o/&Gg&rp;DB,Kv}Ji&Pb;aA^ll(4j%yt}+K$Ht#4y&hY]7Y<F1,eN}bG(Uh%6Z]t5%G7;+F_RE;it}tL=LS&Da=Xx(S+(4f=8G=yI}cJ}WP=37=jS}pX}hd)fp<A8=Jt~+o$HJ=M6}iX=g9}CS=dv=Cj(mP%Kd,xq|+9&LD(4/=Xm&QP=Lc}LX&fL;+K=Op(lu=Qs.qC:+e&L+=Jj#8w;SL]7S(b+#4I=c1&nG_Lf&uH;+R)ZV<bV%B/,TE&0H&Jq&Ah%OF&Ss(p2,Wv&I3=Wl}Vq;1L&lJ#9b_1H=8r=b8=JH(SZ=hD=J2#7U,/U#/X~6P,FU<eL=jx,mG=hG=CE&PU=Se(qX&LY=X6=y4&tk&QQ&tf=4g&xI}W+&mZ=Dc#7w}Lg;DA;wQ_Kb(cJ=hR%yX&Yb,hw{bX_4X;EP;1W_2M}Uc=b5(YF,CM&Tp^OJ{DD]6s=vF=Yo~8q}XH}Fu%P5(SJ=Qt;MO]s8<F3&B3&8T(Ul-BS*dw&dR<87}/8]62$PZ]Lx<Au}9Q]7c=ja=KR,Go,Us&v6(qk}pG&G2=ev^GM%w4&H4]7F&dv]J6}Ew:9w=sj-ZL}Ym$+h(Ut(Um~4n=Xs(U7%eE=Qc_JR<CA#6t<Fv|/I,IS,EG<F2(Xy$/n<Fa(h9}+9_2o&N4#7X<Zq|+f_Dp=dt&na,Ca=NJ)jY=8C=YG=s6&Q+<DO}D3=xB&R1(lw;Qn<bF(Cu|/B}HV=SS&n7,10&u0]Dm%A6^4Q=WR(TD=Xo<GH,Rj(l8)bP&n/=LM&CF,F5&ml=PJ;0k=LG=tq,Rh,D6@4i=1p&+9=YC%er_Mh;nI;0q=Fw]80=xq=FM$Gv;v6&nc;wK%H2&Kj;vs,AA=YP,66}bI(qR~5U=6q~4b$Ni=K5.X3$So&Iu(p+]8G=Cf=RY(TS_O3(iH&57=fE=Dg_Do#9z#7H;FK{qd_2k%JR}en&gh_z8;Rx}9p<cN_Ne,DO;LN_7o~/p=NF=5Y}gN<ce<C1,QE]Wv=3u<BC}GK]yq}DY&u/_hj=II(pz&rC,jV&+Z}ut=NQ;Cg-SR_ZS,+o=u/;Oy_RK_QF(Fx&xP}Wr&TA,Uh&g1=yr{ax[VF$Pg(YB;Ox=Vy;+W(Sp}XV%dd&33(l/]l4#4Y}OE=6c=bw(A7&9t%wd&N/&mo,JH&Qe)fm=Ao}fu=tH\";\nconst deltaData = \"FAZDC6BALcLZCA+GBARCW8wNCcDDZ8LVFBOqqDUiou+M42TFAyERXFb7EjhP+vmBFpFrUpfDV2F7eB+eCltCHJFWLFCED+pWTojEIHFXc3aFn4F68zqjEuKidS1QBVPDEhE7NA4mhMF7oThD49ot3FgtzHFCK0acW1x8DH1EmLoIlrWFBLE+y5+NA3Cx65wJHTaEZVaK1mWAmPGxgYCdxwOjTDIt/faOEhTl1vqNsKtJCOhJWuio2g07KLZEQsFBUpNtwEByBgxFslFheFbiEPvi61msDvApxCzB6rBCzox7joYA5UdDc+Cb4FSgIabpXFAj3bjkmFAxCZE+mD/SFf/0ELecYCt3nLoxC6WEZf2tKDB4oZvrEmqFkKk7BwILA7gtYBpsTq//D4jD0F0wEB9pyQ1BD5Ba0oYHDI+sbDFhvrHXdDHfgFEIJLi5r8qercNFBgFLC4bo5ERJtamWBDFy73KCEb6M8VpmEt330ygCTK58EIIFkYgF84gtGA9Uyh3m68iVrFbWFbcbqiCYHZ9J1jeRPbL8yswhMiDbhEhdNoSwFbZrLT740ABEqgCkO8J1BLd1VhKKR4sD1yUo0z+FF59Mvg71CFbyEhbHSFBKEIKyoQNgQppq9T0KAqePu0ZFGrXOHdKJqkoTFhYvpDNyuuznrN84thJbsCoO6Cu6Xlvntvy0QYuAExQEYtTUBf3CoCqwgGFZ4u1HJFzDVwEy3cjcpV4QvsPaBC3rCGyCF23o4K3pp2gberGgFEJEHo4nHICtyKH2ZqyxhN05KBBJIQlKh/Oujv/DH32VrlqFdIFC7Fz9Ct4kaqFME0UETLprnN9kfy+kFmtQBB0+5CFu0N9Ij8l/VvJDh2oq3hT6EzjTHKFN7ZjZwoTsAZ4Exsko6Fpa6WC+sduz8jyrLpegTv2h1EBeYpLpm2czQW0KoCcS0bCVXCmuWJDBjN1nQNLdF58SFJ0h7i3pC3oEOKy/FjBklL70XvBEEIWp2yZ04xObzAWDDJG7f+DbqBEA7LyiR95j7MDVdDViz2RE5vWlBMv5e4+VfhP3aXNPhvLSynb9O2x4uFBV+3jqu6d5pCG28/sETByvmu/+IJ0L3wb4rj9DNOLBF6XPIODr4L19U9RRofAG6Nxydi8Bki8BhGJbBAJKzbJxkZSlF9Q2Cu8oKqggB9hBArwLLqEBWEtFowy8XK8bEyw9snT+BeyFk1ZCSrdmgfEwFePTgCjELBEnIbjaDDPJm36rG9pztcEzT8dGk23SBhXBB1H4z+OWze0ooFzz8pDBYFvp9j9tvFByf9y4EFdVnz026CGR5qMr7fxMHN8UUdlyJAzlTBDRC28k+L4FB8078ljyD91tUj1ocnTs8vdEf7znbzm+GIjEZnoZE5rnLL700Xc7yHfz05nWxy03vBB9YGHYOWxgMQGBCR24CVYNE1hpfKxN0zKnfJDmmMgMmBWqNbjfSyFCBWSCGCgR8yFXiHyEj+VtD1FB3FpC1zI0kFbzifiKTLm9yq5zFmur+q8FHqjoOBWsBPiDbnCC2ErunV6cJ6TygXFYHYp7MKN9RUlSIS8/xBAGYLzeqUnBF4QbsTuUkUqGs6CaiDWKWjQK9EJkjpkTmNCPYXL\";\nconst _wordlist = {\n    zh_cn: null,\n    zh_tw: null\n};\nconst Checks = {\n    zh_cn: \"0x17bcc4d8547e5a7135e365d1ab443aaae95e76d8230c2782c67305d4f21497a1\",\n    zh_tw: \"0x51e720e90c7b87bec1d70eb6e74a21a449bd3ec9c020b01d3a40ed991b60ce5d\"\n};\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nconst style = \"~!@#$%^&*_-=[]{}|;:,.()<>?\";\nfunction loadWords(locale) {\n    if (_wordlist[locale] != null) {\n        return _wordlist[locale];\n    }\n    const wordlist = [];\n    let deltaOffset = 0;\n    for (let i = 0; i < 2048; i++) {\n        const s = style.indexOf(data[i * 3]);\n        const bytes = [\n            228 + (s >> 2),\n            128 + codes.indexOf(data[i * 3 + 1]),\n            128 + codes.indexOf(data[i * 3 + 2]),\n        ];\n        if (locale === \"zh_tw\") {\n            const common = s % 4;\n            for (let i = common; i < 3; i++) {\n                bytes[i] = codes.indexOf(deltaData[deltaOffset++]) + ((i == 0) ? 228 : 128);\n            }\n        }\n        wordlist.push(toUtf8String(new Uint8Array(bytes)));\n    }\n    // Verify the computed list matches the official list\n    const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n    /* c8 ignore start */\n    if (checksum !== Checks[locale]) {\n        throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`);\n    }\n    /* c8 ignore stop */\n    _wordlist[locale] = wordlist;\n    return wordlist;\n}\nconst wordlists = {};\n/**\n *  The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for\n *  [mnemonic phrases](link-bip-39).\n *\n *  @_docloc: api/wordlists\n */\nexport class LangZh extends Wordlist {\n    /**\n     *  Creates a new instance of the Chinese language Wordlist for\n     *  the %%dialect%%, either ``\"cn\"`` or ``\"tw\"`` for simplified\n     *  or traditional, respectively.\n     *\n     *  This should be unnecessary most of the time as the exported\n     *  [[langZhCn]] and [[langZhTw]] should suffice.\n     *\n     *  @_ignore:\n     */\n    constructor(dialect) { super(\"zh_\" + dialect); }\n    getWord(index) {\n        const words = loadWords(this.locale);\n        assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n        return words[index];\n    }\n    getWordIndex(word) {\n        return loadWords(this.locale).indexOf(word);\n    }\n    split(phrase) {\n        phrase = phrase.replace(/(?:\\u3000| )+/g, \"\");\n        return phrase.split(\"\");\n    }\n    /**\n     *  Returns a singleton instance of a ``LangZh`` for %%dialect%%,\n     *  creating it if this is the first time being called.\n     *\n     *  Use the %%dialect%% ``\"cn\"`` or ``\"tw\"`` for simplified or\n     *  traditional, respectively.\n     */\n    static wordlist(dialect) {\n        if (wordlists[dialect] == null) {\n            wordlists[dialect] = new LangZh(dialect);\n        }\n        return wordlists[dialect];\n    }\n}\n//# sourceMappingURL=lang-zh.js.map// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n *  An OWL format Wordlist is an encoding method that exploits\n *  the general locality of alphabetically sorted words to\n *  achieve a simple but effective means of compression.\n *\n *  This class is generally not useful to most developers as\n *  it is used mainly internally to keep Wordlists for languages\n *  based on ASCII-7 small.\n *\n *  If necessary, there are tools within the ``generation/`` folder\n *  to create the necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n    #data;\n    #checksum;\n    /**\n     *  Creates a new Wordlist for %%locale%% using the OWL %%data%%\n     *  and validated against the %%checksum%%.\n     */\n    constructor(locale, data, checksum) {\n        super(locale);\n        this.#data = data;\n        this.#checksum = checksum;\n        this.#words = null;\n    }\n    /**\n     *  The OWL-encoded data.\n     */\n    get _data() { return this.#data; }\n    /**\n     *  Decode all the words for the wordlist.\n     */\n    _decodeWords() {\n        return decodeOwl(this.#data);\n    }\n    #words;\n    #loadWords() {\n        if (this.#words == null) {\n            const words = this._decodeWords();\n            // Verify the computed list matches the official list\n            const checksum = id(words.join(\"\\n\") + \"\\n\");\n            /* c8 ignore start */\n            if (checksum !== this.#checksum) {\n                throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);\n            }\n            /* c8 ignore stop */\n            this.#words = words;\n        }\n        return this.#words;\n    }\n    getWord(index) {\n        const words = this.#loadWords();\n        assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n        return words[index];\n    }\n    getWordIndex(word) {\n        return this.#loadWords().indexOf(word);\n    }\n}\n//# sourceMappingURL=wordlist-owl.js.mapimport { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n *  An OWL-A format Wordlist extends the OWL format to add an\n *  overlay onto an OWL format Wordlist to support diacritic\n *  marks.\n *\n *  This class is generally not useful to most developers as\n *  it is used mainly internally to keep Wordlists for languages\n *  based on latin-1 small.\n *\n *  If necessary, there are tools within the ``generation/`` folder\n *  to create the necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n    #accent;\n    /**\n     *  Creates a new Wordlist for %%locale%% using the OWLA %%data%%\n     *  and %%accent%% data and validated against the %%checksum%%.\n     */\n    constructor(locale, data, accent, checksum) {\n        super(locale, data, checksum);\n        this.#accent = accent;\n    }\n    /**\n     *  The OWLA-encoded accent data.\n     */\n    get _accent() { return this.#accent; }\n    /**\n     *  Decode all the words for the wordlist.\n     */\n    _decodeWords() {\n        return decodeOwlA(this._data, this._accent);\n    }\n}\n//# sourceMappingURL=wordlist-owla.js.mapimport { defineProperties } from \"../utils/index.js\";\n/**\n *  A Wordlist represents a collection of language-specific\n *  words used to encode and devoce [[link-bip-39]] encoded data\n *  by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n    locale;\n    /**\n     *  Creates a new Wordlist instance.\n     *\n     *  Sub-classes MUST call this if they provide their own constructor,\n     *  passing in the locale string of the language.\n     *\n     *  Generally there is no need to create instances of a Wordlist,\n     *  since each language-specific Wordlist creates an instance and\n     *  there is no state kept internally, so they are safe to share.\n     */\n    constructor(locale) {\n        defineProperties(this, { locale });\n    }\n    /**\n     *  Sub-classes may override this to provide a language-specific\n     *  method for spliting %%phrase%% into individual words.\n     *\n     *  By default, %%phrase%% is split using any sequences of\n     *  white-space as defined by regular expressions (i.e. ``/\\s+/``).\n     */\n    split(phrase) {\n        return phrase.toLowerCase().split(/\\s+/g);\n    }\n    /**\n     *  Sub-classes may override this to provider a language-specific\n     *  method for joining %%words%% into a phrase.\n     *\n     *  By default, %%words%% are joined by a single space.\n     */\n    join(words) {\n        return words.join(\" \");\n    }\n}\n//# sourceMappingURL=wordlist.js.mapimport { LangCz } from \"./lang-cz.js\";\nimport { LangEn } from \"./lang-en.js\";\nimport { LangEs } from \"./lang-es.js\";\nimport { LangFr } from \"./lang-fr.js\";\nimport { LangJa } from \"./lang-ja.js\";\nimport { LangKo } from \"./lang-ko.js\";\nimport { LangIt } from \"./lang-it.js\";\nimport { LangPt } from \"./lang-pt.js\";\nimport { LangZh } from \"./lang-zh.js\";\n/**\n *  The available Wordlists by their\n *  [ISO 639-1 Language Code](link-wiki-iso639).\n *\n *  (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr),\n *  [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt),\n *  [zh_cn](LangZh), [zh_tw](LangZh))\n *\n *  The dist files (in the ``/dist`` folder) have had all languages\n *  except English stripped out, which reduces the library size by\n *  about 80kb. If required, they are available by importing the\n *  included ``wordlists-extra.min.js`` file.\n */\nexport const wordlists = {\n    cz: LangCz.wordlist(),\n    en: LangEn.wordlist(),\n    es: LangEs.wordlist(),\n    fr: LangFr.wordlist(),\n    it: LangIt.wordlist(),\n    pt: LangPt.wordlist(),\n    ja: LangJa.wordlist(),\n    ko: LangKo.wordlist(),\n    zh_cn: LangZh.wordlist(\"cn\"),\n    zh_tw: LangZh.wordlist(\"tw\"),\n};\n//# sourceMappingURL=wordlists.js.map/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { hmac } from '@noble/hashes/hmac';\nimport { concatBytes, randomBytes } from '@noble/hashes/utils';\nimport { weierstrass } from './abstract/weierstrass.js';\n// connects noble-curves to noble-hashes\nexport function getHash(hash) {\n    return {\n        hash,\n        hmac: (key, ...msgs) => hmac(hash, key, concatBytes(...msgs)),\n        randomBytes,\n    };\n}\nexport function createCurve(curveDef, defHash) {\n    const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) });\n    return Object.freeze({ ...create(defHash), create });\n}\n//# sourceMappingURL=_shortw_utils.js.map/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Abelian group utilities\nimport { validateField, nLength } from './modular.js';\nimport { validateObject } from './utils.js';\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\n// Elliptic curve multiplication of Point by scalar. Fragile.\n// Scalars should always be less than curve order: this should be checked inside of a curve itself.\n// Creates precomputation tables for fast multiplication:\n// - private scalar is split by fixed size windows of W bits\n// - every window point is collected from window's table & added to accumulator\n// - since windows are different, same point inside tables won't be accessed more than once per calc\n// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n// - +1 window is neccessary for wNAF\n// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow\n// windows to be in different memory locations\nexport function wNAF(c, bits) {\n    const constTimeNegate = (condition, item) => {\n        const neg = item.negate();\n        return condition ? neg : item;\n    };\n    const opts = (W) => {\n        const windows = Math.ceil(bits / W) + 1; // +1, because\n        const windowSize = 2 ** (W - 1); // -1 because we skip zero\n        return { windows, windowSize };\n    };\n    return {\n        constTimeNegate,\n        // non-const time multiplication ladder\n        unsafeLadder(elm, n) {\n            let p = c.ZERO;\n            let d = elm;\n            while (n > _0n) {\n                if (n & _1n)\n                    p = p.add(d);\n                d = d.double();\n                n >>= _1n;\n            }\n            return p;\n        },\n        /**\n         * Creates a wNAF precomputation window. Used for caching.\n         * Default window size is set by `utils.precompute()` and is equal to 8.\n         * Number of precomputed points depends on the curve size:\n         * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n         * - 𝑊 is the window size\n         * - 𝑛 is the bitlength of the curve order.\n         * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n         * @returns precomputed point tables flattened to a single array\n         */\n        precomputeWindow(elm, W) {\n            const { windows, windowSize } = opts(W);\n            const points = [];\n            let p = elm;\n            let base = p;\n            for (let window = 0; window < windows; window++) {\n                base = p;\n                points.push(base);\n                // =1, because we skip zero\n                for (let i = 1; i < windowSize; i++) {\n                    base = base.add(p);\n                    points.push(base);\n                }\n                p = base.double();\n            }\n            return points;\n        },\n        /**\n         * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n         * @param W window size\n         * @param precomputes precomputed tables\n         * @param n scalar (we don't check here, but should be less than curve order)\n         * @returns real and fake (for const-time) points\n         */\n        wNAF(W, precomputes, n) {\n            // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise\n            // But need to carefully remove other checks before wNAF. ORDER == bits here\n            const { windows, windowSize } = opts(W);\n            let p = c.ZERO;\n            let f = c.BASE;\n            const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc.\n            const maxNumber = 2 ** W;\n            const shiftBy = BigInt(W);\n            for (let window = 0; window < windows; window++) {\n                const offset = window * windowSize;\n                // Extract W bits.\n                let wbits = Number(n & mask);\n                // Shift number by W bits.\n                n >>= shiftBy;\n                // If the bits are bigger than max size, we'll split those.\n                // +224 => 256 - 32\n                if (wbits > windowSize) {\n                    wbits -= maxNumber;\n                    n += _1n;\n                }\n                // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n                // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n                // there is negate now: it is possible that negated element from low value\n                // would be the same as high element, which will create carry into next window.\n                // It's not obvious how this can fail, but still worth investigating later.\n                // Check if we're onto Zero point.\n                // Add random point inside current window to f.\n                const offset1 = offset;\n                const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero\n                const cond1 = window % 2 !== 0;\n                const cond2 = wbits < 0;\n                if (wbits === 0) {\n                    // The most important part for const-time getPublicKey\n                    f = f.add(constTimeNegate(cond1, precomputes[offset1]));\n                }\n                else {\n                    p = p.add(constTimeNegate(cond2, precomputes[offset2]));\n                }\n            }\n            // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ()\n            // Even if the variable is still unused, there are some checks which will\n            // throw an exception, so compiler needs to prove they won't happen, which is hard.\n            // At this point there is a way to F be infinity-point even if p is not,\n            // which makes it less const-time: around 1 bigint multiply.\n            return { p, f };\n        },\n        wNAFCached(P, precomputesMap, n, transform) {\n            // @ts-ignore\n            const W = P._WINDOW_SIZE || 1;\n            // Calculate precomputes on a first run, reuse them after\n            let comp = precomputesMap.get(P);\n            if (!comp) {\n                comp = this.precomputeWindow(P, W);\n                if (W !== 1) {\n                    precomputesMap.set(P, transform(comp));\n                }\n            }\n            return this.wNAF(W, comp, n);\n        },\n    };\n}\nexport function validateBasic(curve) {\n    validateField(curve.Fp);\n    validateObject(curve, {\n        n: 'bigint',\n        h: 'bigint',\n        Gx: 'field',\n        Gy: 'field',\n    }, {\n        nBitLength: 'isSafeInteger',\n        nByteLength: 'isSafeInteger',\n    });\n    // Set defaults\n    return Object.freeze({\n        ...nLength(curve.n, curve.nBitLength),\n        ...curve,\n        ...{ p: curve.Fp.ORDER },\n    });\n}\n//# sourceMappingURL=curve.js.mapimport { mod } from './modular.js';\nimport { bytesToNumberBE, concatBytes, utf8ToBytes, validateObject } from './utils.js';\nfunction validateDST(dst) {\n    if (dst instanceof Uint8Array)\n        return dst;\n    if (typeof dst === 'string')\n        return utf8ToBytes(dst);\n    throw new Error('DST must be Uint8Array or string');\n}\n// Octet Stream to Integer. \"spec\" implementation of os2ip is 2.5x slower vs bytesToNumberBE.\nconst os2ip = bytesToNumberBE;\n// Integer to Octet Stream (numberToBytesBE)\nfunction i2osp(value, length) {\n    if (value < 0 || value >= 1 << (8 * length)) {\n        throw new Error(`bad I2OSP call: value=${value} length=${length}`);\n    }\n    const res = Array.from({ length }).fill(0);\n    for (let i = length - 1; i >= 0; i--) {\n        res[i] = value & 0xff;\n        value >>>= 8;\n    }\n    return new Uint8Array(res);\n}\nfunction strxor(a, b) {\n    const arr = new Uint8Array(a.length);\n    for (let i = 0; i < a.length; i++) {\n        arr[i] = a[i] ^ b[i];\n    }\n    return arr;\n}\nfunction isBytes(item) {\n    if (!(item instanceof Uint8Array))\n        throw new Error('Uint8Array expected');\n}\nfunction isNum(item) {\n    if (!Number.isSafeInteger(item))\n        throw new Error('number expected');\n}\n// Produces a uniformly random byte string using a cryptographic hash function H that outputs b bits\n// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1\nexport function expand_message_xmd(msg, DST, lenInBytes, H) {\n    isBytes(msg);\n    isBytes(DST);\n    isNum(lenInBytes);\n    // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3\n    if (DST.length > 255)\n        DST = H(concatBytes(utf8ToBytes('H2C-OVERSIZE-DST-'), DST));\n    const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H;\n    const ell = Math.ceil(lenInBytes / b_in_bytes);\n    if (ell > 255)\n        throw new Error('Invalid xmd length');\n    const DST_prime = concatBytes(DST, i2osp(DST.length, 1));\n    const Z_pad = i2osp(0, r_in_bytes);\n    const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str\n    const b = new Array(ell);\n    const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime));\n    b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime));\n    for (let i = 1; i <= ell; i++) {\n        const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime];\n        b[i] = H(concatBytes(...args));\n    }\n    const pseudo_random_bytes = concatBytes(...b);\n    return pseudo_random_bytes.slice(0, lenInBytes);\n}\n// Produces a uniformly random byte string using an extendable-output function (XOF) H.\n// 1. The collision resistance of H MUST be at least k bits.\n// 2. H MUST be an XOF that has been proved indifferentiable from\n//    a random oracle under a reasonable cryptographic assumption.\n// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2\nexport function expand_message_xof(msg, DST, lenInBytes, k, H) {\n    isBytes(msg);\n    isBytes(DST);\n    isNum(lenInBytes);\n    // https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3\n    // DST = H('H2C-OVERSIZE-DST-' || a_very_long_DST, Math.ceil((lenInBytes * k) / 8));\n    if (DST.length > 255) {\n        const dkLen = Math.ceil((2 * k) / 8);\n        DST = H.create({ dkLen }).update(utf8ToBytes('H2C-OVERSIZE-DST-')).update(DST).digest();\n    }\n    if (lenInBytes > 65535 || DST.length > 255)\n        throw new Error('expand_message_xof: invalid lenInBytes');\n    return (H.create({ dkLen: lenInBytes })\n        .update(msg)\n        .update(i2osp(lenInBytes, 2))\n        // 2. DST_prime = DST || I2OSP(len(DST), 1)\n        .update(DST)\n        .update(i2osp(DST.length, 1))\n        .digest());\n}\n/**\n * Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F\n * https://www.rfc-editor.org/rfc/rfc9380#section-5.2\n * @param msg a byte string containing the message to hash\n * @param count the number of elements of F to output\n * @param options `{DST: string, p: bigint, m: number, k: number, expand: 'xmd' | 'xof', hash: H}`, see above\n * @returns [u_0, ..., u_(count - 1)], a list of field elements.\n */\nexport function hash_to_field(msg, count, options) {\n    validateObject(options, {\n        DST: 'stringOrUint8Array',\n        p: 'bigint',\n        m: 'isSafeInteger',\n        k: 'isSafeInteger',\n        hash: 'hash',\n    });\n    const { p, k, m, hash, expand, DST: _DST } = options;\n    isBytes(msg);\n    isNum(count);\n    const DST = validateDST(_DST);\n    const log2p = p.toString(2).length;\n    const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above\n    const len_in_bytes = count * m * L;\n    let prb; // pseudo_random_bytes\n    if (expand === 'xmd') {\n        prb = expand_message_xmd(msg, DST, len_in_bytes, hash);\n    }\n    else if (expand === 'xof') {\n        prb = expand_message_xof(msg, DST, len_in_bytes, k, hash);\n    }\n    else if (expand === '_internal_pass') {\n        // for internal tests only\n        prb = msg;\n    }\n    else {\n        throw new Error('expand must be \"xmd\" or \"xof\"');\n    }\n    const u = new Array(count);\n    for (let i = 0; i < count; i++) {\n        const e = new Array(m);\n        for (let j = 0; j < m; j++) {\n            const elm_offset = L * (j + i * m);\n            const tv = prb.subarray(elm_offset, elm_offset + L);\n            e[j] = mod(os2ip(tv), p);\n        }\n        u[i] = e;\n    }\n    return u;\n}\nexport function isogenyMap(field, map) {\n    // Make same order as in spec\n    const COEFF = map.map((i) => Array.from(i).reverse());\n    return (x, y) => {\n        const [xNum, xDen, yNum, yDen] = COEFF.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));\n        x = field.div(xNum, xDen); // xNum / xDen\n        y = field.mul(y, field.div(yNum, yDen)); // y * (yNum / yDev)\n        return { x, y };\n    };\n}\nexport function createHasher(Point, mapToCurve, def) {\n    if (typeof mapToCurve !== 'function')\n        throw new Error('mapToCurve() must be defined');\n    return {\n        // Encodes byte string to elliptic curve.\n        // hash_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3\n        hashToCurve(msg, options) {\n            const u = hash_to_field(msg, 2, { ...def, DST: def.DST, ...options });\n            const u0 = Point.fromAffine(mapToCurve(u[0]));\n            const u1 = Point.fromAffine(mapToCurve(u[1]));\n            const P = u0.add(u1).clearCofactor();\n            P.assertValidity();\n            return P;\n        },\n        // Encodes byte string to elliptic curve.\n        // encode_to_curve from https://www.rfc-editor.org/rfc/rfc9380#section-3\n        encodeToCurve(msg, options) {\n            const u = hash_to_field(msg, 1, { ...def, DST: def.encodeDST, ...options });\n            const P = Point.fromAffine(mapToCurve(u[0])).clearCofactor();\n            P.assertValidity();\n            return P;\n        },\n    };\n}\n//# sourceMappingURL=hash-to-curve.js.map/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Utilities for modular arithmetics and finite fields\nimport { bitMask, numberToBytesBE, numberToBytesLE, bytesToNumberBE, bytesToNumberLE, ensureBytes, validateObject, } from './utils.js';\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);\n// prettier-ignore\nconst _9n = BigInt(9), _16n = BigInt(16);\n// Calculates a modulo b\nexport function mod(a, b) {\n    const result = a % b;\n    return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\n// TODO: use field version && remove\nexport function pow(num, power, modulo) {\n    if (modulo <= _0n || power < _0n)\n        throw new Error('Expected power/modulo > 0');\n    if (modulo === _1n)\n        return _0n;\n    let res = _1n;\n    while (power > _0n) {\n        if (power & _1n)\n            res = (res * num) % modulo;\n        num = (num * num) % modulo;\n        power >>= _1n;\n    }\n    return res;\n}\n// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)\nexport function pow2(x, power, modulo) {\n    let res = x;\n    while (power-- > _0n) {\n        res *= res;\n        res %= modulo;\n    }\n    return res;\n}\n// Inverses number over modulo\nexport function invert(number, modulo) {\n    if (number === _0n || modulo <= _0n) {\n        throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);\n    }\n    // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/\n    // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n    let a = mod(number, modulo);\n    let b = modulo;\n    // prettier-ignore\n    let x = _0n, y = _1n, u = _1n, v = _0n;\n    while (a !== _0n) {\n        // JIT applies optimization if those two lines follow each other\n        const q = b / a;\n        const r = b % a;\n        const m = x - u * q;\n        const n = y - v * q;\n        // prettier-ignore\n        b = a, a = r, x = u, y = v, u = m, v = n;\n    }\n    const gcd = b;\n    if (gcd !== _1n)\n        throw new Error('invert: does not exist');\n    return mod(x, modulo);\n}\n/**\n * Tonelli-Shanks square root search algorithm.\n * 1. https://eprint.iacr.org/2012/685.pdf (page 12)\n * 2. Square Roots from 1; 24, 51, 10 to Dan Shanks\n * Will start an infinite loop if field order P is not prime.\n * @param P field order\n * @returns function that takes field Fp (created from P) and number n\n */\nexport function tonelliShanks(P) {\n    // Legendre constant: used to calculate Legendre symbol (a | p),\n    // which denotes the value of a^((p-1)/2) (mod p).\n    // (a | p) ≡ 1    if a is a square (mod p)\n    // (a | p) ≡ -1   if a is not a square (mod p)\n    // (a | p) ≡ 0    if a ≡ 0 (mod p)\n    const legendreC = (P - _1n) / _2n;\n    let Q, S, Z;\n    // Step 1: By factoring out powers of 2 from p - 1,\n    // find q and s such that p - 1 = q*(2^s) with q odd\n    for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++)\n        ;\n    // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq\n    for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++)\n        ;\n    // Fast-path\n    if (S === 1) {\n        const p1div4 = (P + _1n) / _4n;\n        return function tonelliFast(Fp, n) {\n            const root = Fp.pow(n, p1div4);\n            if (!Fp.eql(Fp.sqr(root), n))\n                throw new Error('Cannot find square root');\n            return root;\n        };\n    }\n    // Slow-path\n    const Q1div2 = (Q + _1n) / _2n;\n    return function tonelliSlow(Fp, n) {\n        // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1\n        if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))\n            throw new Error('Cannot find square root');\n        let r = S;\n        // TODO: will fail at Fp2/etc\n        let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b\n        let x = Fp.pow(n, Q1div2); // first guess at the square root\n        let b = Fp.pow(n, Q); // first guess at the fudge factor\n        while (!Fp.eql(b, Fp.ONE)) {\n            if (Fp.eql(b, Fp.ZERO))\n                return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0)\n            // Find m such b^(2^m)==1\n            let m = 1;\n            for (let t2 = Fp.sqr(b); m < r; m++) {\n                if (Fp.eql(t2, Fp.ONE))\n                    break;\n                t2 = Fp.sqr(t2); // t2 *= t2\n            }\n            // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow\n            const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1)\n            g = Fp.sqr(ge); // g = ge * ge\n            x = Fp.mul(x, ge); // x *= ge\n            b = Fp.mul(b, g); // b *= g\n            r = m;\n        }\n        return x;\n    };\n}\nexport function FpSqrt(P) {\n    // NOTE: different algorithms can give different roots, it is up to user to decide which one they want.\n    // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n    // P ≡ 3 (mod 4)\n    // √n = n^((P+1)/4)\n    if (P % _4n === _3n) {\n        // Not all roots possible!\n        // const ORDER =\n        //   0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn;\n        // const NUM = 72057594037927816n;\n        const p1div4 = (P + _1n) / _4n;\n        return function sqrt3mod4(Fp, n) {\n            const root = Fp.pow(n, p1div4);\n            // Throw if root**2 != n\n            if (!Fp.eql(Fp.sqr(root), n))\n                throw new Error('Cannot find square root');\n            return root;\n        };\n    }\n    // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10)\n    if (P % _8n === _5n) {\n        const c1 = (P - _5n) / _8n;\n        return function sqrt5mod8(Fp, n) {\n            const n2 = Fp.mul(n, _2n);\n            const v = Fp.pow(n2, c1);\n            const nv = Fp.mul(n, v);\n            const i = Fp.mul(Fp.mul(nv, _2n), v);\n            const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n            if (!Fp.eql(Fp.sqr(root), n))\n                throw new Error('Cannot find square root');\n            return root;\n        };\n    }\n    // P ≡ 9 (mod 16)\n    if (P % _16n === _9n) {\n        // NOTE: tonelli is too slow for bls-Fp2 calculations even on start\n        // Means we cannot use sqrt for constants at all!\n        //\n        // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); //  1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n        // const c2 = Fp.sqrt(c1);                //  2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n        // const c3 = Fp.sqrt(Fp.negate(c1));     //  3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n        // const c4 = (P + _7n) / _16n;           //  4. c4 = (q + 7) / 16        # Integer arithmetic\n        // sqrt = (x) => {\n        //   let tv1 = Fp.pow(x, c4);             //  1. tv1 = x^c4\n        //   let tv2 = Fp.mul(c1, tv1);           //  2. tv2 = c1 * tv1\n        //   const tv3 = Fp.mul(c2, tv1);         //  3. tv3 = c2 * tv1\n        //   let tv4 = Fp.mul(c3, tv1);           //  4. tv4 = c3 * tv1\n        //   const e1 = Fp.equals(Fp.square(tv2), x); //  5.  e1 = (tv2^2) == x\n        //   const e2 = Fp.equals(Fp.square(tv3), x); //  6.  e2 = (tv3^2) == x\n        //   tv1 = Fp.cmov(tv1, tv2, e1); //  7. tv1 = CMOV(tv1, tv2, e1)  # Select tv2 if (tv2^2) == x\n        //   tv2 = Fp.cmov(tv4, tv3, e2); //  8. tv2 = CMOV(tv4, tv3, e2)  # Select tv3 if (tv3^2) == x\n        //   const e3 = Fp.equals(Fp.square(tv2), x); //  9.  e3 = (tv2^2) == x\n        //   return Fp.cmov(tv1, tv2, e3); //  10.  z = CMOV(tv1, tv2, e3)  # Select the sqrt from tv1 and tv2\n        // }\n    }\n    // Other cases: Tonelli-Shanks algorithm\n    return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\nconst FIELD_FIELDS = [\n    'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n    'eql', 'add', 'sub', 'mul', 'pow', 'div',\n    'addN', 'subN', 'mulN', 'sqrN'\n];\nexport function validateField(field) {\n    const initial = {\n        ORDER: 'bigint',\n        MASK: 'bigint',\n        BYTES: 'isSafeInteger',\n        BITS: 'isSafeInteger',\n    };\n    const opts = FIELD_FIELDS.reduce((map, val) => {\n        map[val] = 'function';\n        return map;\n    }, initial);\n    return validateObject(field, opts);\n}\n// Generic field functions\n/**\n * Same as `pow` but for Fp: non-constant-time.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n */\nexport function FpPow(f, num, power) {\n    // Should have same speed as pow for bigints\n    // TODO: benchmark!\n    if (power < _0n)\n        throw new Error('Expected power > 0');\n    if (power === _0n)\n        return f.ONE;\n    if (power === _1n)\n        return num;\n    let p = f.ONE;\n    let d = num;\n    while (power > _0n) {\n        if (power & _1n)\n            p = f.mul(p, d);\n        d = f.sqr(d);\n        power >>= _1n;\n    }\n    return p;\n}\n/**\n * Efficiently invert an array of Field elements.\n * `inv(0)` will return `undefined` here: make sure to throw an error.\n */\nexport function FpInvertBatch(f, nums) {\n    const tmp = new Array(nums.length);\n    // Walk from first to last, multiply them by each other MOD p\n    const lastMultiplied = nums.reduce((acc, num, i) => {\n        if (f.is0(num))\n            return acc;\n        tmp[i] = acc;\n        return f.mul(acc, num);\n    }, f.ONE);\n    // Invert last element\n    const inverted = f.inv(lastMultiplied);\n    // Walk from last to first, multiply them by inverted each other MOD p\n    nums.reduceRight((acc, num, i) => {\n        if (f.is0(num))\n            return acc;\n        tmp[i] = f.mul(acc, tmp[i]);\n        return f.mul(acc, num);\n    }, inverted);\n    return tmp;\n}\nexport function FpDiv(f, lhs, rhs) {\n    return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs));\n}\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(f) {\n    const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic\n    return (x) => {\n        const p = f.pow(x, legendreConst);\n        return f.eql(p, f.ZERO) || f.eql(p, f.ONE);\n    };\n}\n// CURVE.n lengths\nexport function nLength(n, nBitLength) {\n    // Bit size, byte size of CURVE.n\n    const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n    const nByteLength = Math.ceil(_nBitLength / 8);\n    return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Initializes a finite field over prime. **Non-primes are not supported.**\n * Do not init in loop: slow. Very fragile: always run a benchmark on a change.\n * Major performance optimizations:\n * * a) denormalized operations like mulN instead of mul\n * * b) same object shape: never add or remove keys\n * * c) Object.freeze\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(ORDER, bitLen, isLE = false, redef = {}) {\n    if (ORDER <= _0n)\n        throw new Error(`Expected Field ORDER > 0, got ${ORDER}`);\n    const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n    if (BYTES > 2048)\n        throw new Error('Field lengths over 2048 bytes are not supported');\n    const sqrtP = FpSqrt(ORDER);\n    const f = Object.freeze({\n        ORDER,\n        BITS,\n        BYTES,\n        MASK: bitMask(BITS),\n        ZERO: _0n,\n        ONE: _1n,\n        create: (num) => mod(num, ORDER),\n        isValid: (num) => {\n            if (typeof num !== 'bigint')\n                throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);\n            return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n        },\n        is0: (num) => num === _0n,\n        isOdd: (num) => (num & _1n) === _1n,\n        neg: (num) => mod(-num, ORDER),\n        eql: (lhs, rhs) => lhs === rhs,\n        sqr: (num) => mod(num * num, ORDER),\n        add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n        sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n        mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n        pow: (num, power) => FpPow(f, num, power),\n        div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n        // Same as above, but doesn't normalize\n        sqrN: (num) => num * num,\n        addN: (lhs, rhs) => lhs + rhs,\n        subN: (lhs, rhs) => lhs - rhs,\n        mulN: (lhs, rhs) => lhs * rhs,\n        inv: (num) => invert(num, ORDER),\n        sqrt: redef.sqrt || ((n) => sqrtP(f, n)),\n        invertBatch: (lst) => FpInvertBatch(f, lst),\n        // TODO: do we really need constant cmov?\n        // We don't have const-time bigints anyway, so probably will be not very useful\n        cmov: (a, b, c) => (c ? b : a),\n        toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n        fromBytes: (bytes) => {\n            if (bytes.length !== BYTES)\n                throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);\n            return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n        },\n    });\n    return Object.freeze(f);\n}\nexport function FpSqrtOdd(Fp, elm) {\n    if (!Fp.isOdd)\n        throw new Error(`Field doesn't have isOdd`);\n    const root = Fp.sqrt(elm);\n    return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nexport function FpSqrtEven(Fp, elm) {\n    if (!Fp.isOdd)\n        throw new Error(`Field doesn't have isOdd`);\n    const root = Fp.sqrt(elm);\n    return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Same as mapKeyToField, but accepts less bytes (40 instead of 48 for 32-byte field).\n * Which makes it slightly more biased, less secure.\n * @deprecated use mapKeyToField instead\n */\nexport function hashToPrivateScalar(hash, groupOrder, isLE = false) {\n    hash = ensureBytes('privateHash', hash);\n    const hashLen = hash.length;\n    const minLen = nLength(groupOrder).nByteLength + 8;\n    if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n        throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);\n    const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n    return mod(num, groupOrder - _1n) + _1n;\n}\n/**\n * Returns total number of bytes consumed by the field element.\n * For example, 32 bytes for usual 256-bit weierstrass curve.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of field\n */\nexport function getFieldBytesLength(fieldOrder) {\n    if (typeof fieldOrder !== 'bigint')\n        throw new Error('field order must be bigint');\n    const bitLength = fieldOrder.toString(2).length;\n    return Math.ceil(bitLength / 8);\n}\n/**\n * Returns minimal amount of bytes that can be safely reduced\n * by field order.\n * Should be 2^-128 for 128-bit curve such as P256.\n * @param fieldOrder number of field elements, usually CURVE.n\n * @returns byte length of target hash\n */\nexport function getMinHashLength(fieldOrder) {\n    const length = getFieldBytesLength(fieldOrder);\n    return length + Math.ceil(length / 2);\n}\n/**\n * \"Constant-time\" private key generation utility.\n * Can take (n + n/2) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 48 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * FIPS 186-5, A.2 https://csrc.nist.gov/publications/detail/fips/186/5/final\n * RFC 9380, https://www.rfc-editor.org/rfc/rfc9380#section-5\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. secp256k1.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nexport function mapHashToField(key, fieldOrder, isLE = false) {\n    const len = key.length;\n    const fieldLen = getFieldBytesLength(fieldOrder);\n    const minLen = getMinHashLength(fieldOrder);\n    // No small numbers: need to understand bias story. No huge numbers: easier to detect JS timings.\n    if (len < 16 || len < minLen || len > 1024)\n        throw new Error(`expected ${minLen}-1024 bytes of input, got ${len}`);\n    const num = isLE ? bytesToNumberBE(key) : bytesToNumberLE(key);\n    // `mod(x, 11)` can sometimes produce 0. `mod(x, 10) + 1` is the same, but no 0\n    const reduced = mod(num, fieldOrder - _1n) + _1n;\n    return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);\n}\n//# sourceMappingURL=modular.js.map/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst u8a = (a) => a instanceof Uint8Array;\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n    if (!u8a(bytes))\n        throw new Error('Uint8Array expected');\n    // pre-caching improves the speed 6x\n    let hex = '';\n    for (let i = 0; i < bytes.length; i++) {\n        hex += hexes[bytes[i]];\n    }\n    return hex;\n}\nexport function numberToHexUnpadded(num) {\n    const hex = num.toString(16);\n    return hex.length & 1 ? `0${hex}` : hex;\n}\nexport function hexToNumber(hex) {\n    if (typeof hex !== 'string')\n        throw new Error('hex string expected, got ' + typeof hex);\n    // Big Endian\n    return BigInt(hex === '' ? '0' : `0x${hex}`);\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n    if (typeof hex !== 'string')\n        throw new Error('hex string expected, got ' + typeof hex);\n    const len = hex.length;\n    if (len % 2)\n        throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n    const array = new Uint8Array(len / 2);\n    for (let i = 0; i < array.length; i++) {\n        const j = i * 2;\n        const hexByte = hex.slice(j, j + 2);\n        const byte = Number.parseInt(hexByte, 16);\n        if (Number.isNaN(byte) || byte < 0)\n            throw new Error('Invalid byte sequence');\n        array[i] = byte;\n    }\n    return array;\n}\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes) {\n    return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes) {\n    if (!u8a(bytes))\n        throw new Error('Uint8Array expected');\n    return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\nexport function numberToBytesBE(n, len) {\n    return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n, len) {\n    return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n) {\n    return hexToBytes(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title, hex, expectedLength) {\n    let res;\n    if (typeof hex === 'string') {\n        try {\n            res = hexToBytes(hex);\n        }\n        catch (e) {\n            throw new Error(`${title} must be valid hex string, got \"${hex}\". Cause: ${e}`);\n        }\n    }\n    else if (u8a(hex)) {\n        // Uint8Array.from() instead of hash.slice() because node.js Buffer\n        // is instance of Uint8Array, and its slice() creates **mutable** copy\n        res = Uint8Array.from(hex);\n    }\n    else {\n        throw new Error(`${title} must be hex string or Uint8Array`);\n    }\n    const len = res.length;\n    if (typeof expectedLength === 'number' && len !== expectedLength)\n        throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);\n    return res;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n    const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n    let pad = 0; // walk through each item, ensure they have proper type\n    arrays.forEach((a) => {\n        if (!u8a(a))\n            throw new Error('Uint8Array expected');\n        r.set(a, pad);\n        pad += a.length;\n    });\n    return r;\n}\nexport function equalBytes(b1, b2) {\n    // We don't care about timing attacks here\n    if (b1.length !== b2.length)\n        return false;\n    for (let i = 0; i < b1.length; i++)\n        if (b1[i] !== b2[i])\n            return false;\n    return true;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n    if (typeof str !== 'string')\n        throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n    return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n */\nexport function bitLen(n) {\n    let len;\n    for (len = 0; n > _0n; n >>= _1n, len += 1)\n        ;\n    return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n, pos) {\n    return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nexport const bitSet = (n, pos, value) => {\n    return n | ((value ? _1n : _0n) << BigInt(pos));\n};\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n;\n// DRBG\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst u8fr = (arr) => Uint8Array.from(arr); // another shortcut\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n *   const drbg = createHmacDRBG<Key>(32, 32, hmac);\n *   drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n    if (typeof hashLen !== 'number' || hashLen < 2)\n        throw new Error('hashLen must be a number');\n    if (typeof qByteLen !== 'number' || qByteLen < 2)\n        throw new Error('qByteLen must be a number');\n    if (typeof hmacFn !== 'function')\n        throw new Error('hmacFn must be a function');\n    // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n    let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n    let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n    let i = 0; // Iterations counter, will throw when over 1000\n    const reset = () => {\n        v.fill(1);\n        k.fill(0);\n        i = 0;\n    };\n    const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n    const reseed = (seed = u8n()) => {\n        // HMAC-DRBG reseed() function. Steps D-G\n        k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n        v = h(); // v = hmac(k || v)\n        if (seed.length === 0)\n            return;\n        k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n        v = h(); // v = hmac(k || v)\n    };\n    const gen = () => {\n        // HMAC-DRBG generate() function\n        if (i++ >= 1000)\n            throw new Error('drbg: tried 1000 values');\n        let len = 0;\n        const out = [];\n        while (len < qByteLen) {\n            v = h();\n            const sl = v.slice();\n            out.push(sl);\n            len += v.length;\n        }\n        return concatBytes(...out);\n    };\n    const genUntil = (seed, pred) => {\n        reset();\n        reseed(seed); // Steps D-G\n        let res = undefined; // Step H: grind until k is in [1..n-1]\n        while (!(res = pred(gen())))\n            reseed();\n        reset();\n        return res;\n    };\n    return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n    bigint: (val) => typeof val === 'bigint',\n    function: (val) => typeof val === 'function',\n    boolean: (val) => typeof val === 'boolean',\n    string: (val) => typeof val === 'string',\n    stringOrUint8Array: (val) => typeof val === 'string' || val instanceof Uint8Array,\n    isSafeInteger: (val) => Number.isSafeInteger(val),\n    array: (val) => Array.isArray(val),\n    field: (val, object) => object.Fp.isValid(val),\n    hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record<K extends string | number | symbol, T> = { [P in K]: T; }\nexport function validateObject(object, validators, optValidators = {}) {\n    const checkField = (fieldName, type, isOptional) => {\n        const checkVal = validatorFns[type];\n        if (typeof checkVal !== 'function')\n            throw new Error(`Invalid validator \"${type}\", expected function`);\n        const val = object[fieldName];\n        if (isOptional && val === undefined)\n            return;\n        if (!checkVal(val, object)) {\n            throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`);\n        }\n    };\n    for (const [fieldName, type] of Object.entries(validators))\n        checkField(fieldName, type, false);\n    for (const [fieldName, type] of Object.entries(optValidators))\n        checkField(fieldName, type, true);\n    return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n//# sourceMappingURL=utils.js.map/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Short Weierstrass curve. The formula is: y² = x³ + ax + b\nimport * as mod from './modular.js';\nimport * as ut from './utils.js';\nimport { ensureBytes } from './utils.js';\nimport { wNAF, validateBasic } from './curve.js';\nfunction validatePointOpts(curve) {\n    const opts = validateBasic(curve);\n    ut.validateObject(opts, {\n        a: 'field',\n        b: 'field',\n    }, {\n        allowedPrivateKeyLengths: 'array',\n        wrapPrivateKey: 'boolean',\n        isTorsionFree: 'function',\n        clearCofactor: 'function',\n        allowInfinityPoint: 'boolean',\n        fromBytes: 'function',\n        toBytes: 'function',\n    });\n    const { endo, Fp, a } = opts;\n    if (endo) {\n        if (!Fp.eql(a, Fp.ZERO)) {\n            throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0');\n        }\n        if (typeof endo !== 'object' ||\n            typeof endo.beta !== 'bigint' ||\n            typeof endo.splitScalar !== 'function') {\n            throw new Error('Expected endomorphism with beta: bigint and splitScalar: function');\n        }\n    }\n    return Object.freeze({ ...opts });\n}\n// ASN.1 DER encoding utilities\nconst { bytesToNumberBE: b2n, hexToBytes: h2b } = ut;\nexport const DER = {\n    // asn.1 DER encoding utils\n    Err: class DERErr extends Error {\n        constructor(m = '') {\n            super(m);\n        }\n    },\n    _parseInt(data) {\n        const { Err: E } = DER;\n        if (data.length < 2 || data[0] !== 0x02)\n            throw new E('Invalid signature integer tag');\n        const len = data[1];\n        const res = data.subarray(2, len + 2);\n        if (!len || res.length !== len)\n            throw new E('Invalid signature integer: wrong length');\n        // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n        // since we always use positive integers here. It must always be empty:\n        // - add zero byte if exists\n        // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n        if (res[0] & 0b10000000)\n            throw new E('Invalid signature integer: negative');\n        if (res[0] === 0x00 && !(res[1] & 0b10000000))\n            throw new E('Invalid signature integer: unnecessary leading zero');\n        return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left\n    },\n    toSig(hex) {\n        // parse DER signature\n        const { Err: E } = DER;\n        const data = typeof hex === 'string' ? h2b(hex) : hex;\n        if (!(data instanceof Uint8Array))\n            throw new Error('ui8a expected');\n        let l = data.length;\n        if (l < 2 || data[0] != 0x30)\n            throw new E('Invalid signature tag');\n        if (data[1] !== l - 2)\n            throw new E('Invalid signature: incorrect length');\n        const { d: r, l: sBytes } = DER._parseInt(data.subarray(2));\n        const { d: s, l: rBytesLeft } = DER._parseInt(sBytes);\n        if (rBytesLeft.length)\n            throw new E('Invalid signature: left bytes after parsing');\n        return { r, s };\n    },\n    hexFromSig(sig) {\n        // Add leading zero if first byte has negative bit enabled. More details in '_parseInt'\n        const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s);\n        const h = (num) => {\n            const hex = num.toString(16);\n            return hex.length & 1 ? `0${hex}` : hex;\n        };\n        const s = slice(h(sig.s));\n        const r = slice(h(sig.r));\n        const shl = s.length / 2;\n        const rhl = r.length / 2;\n        const sl = h(shl);\n        const rl = h(rhl);\n        return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;\n    },\n};\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\nexport function weierstrassPoints(opts) {\n    const CURVE = validatePointOpts(opts);\n    const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ\n    const toBytes = CURVE.toBytes ||\n        ((_c, point, _isCompressed) => {\n            const a = point.toAffine();\n            return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y));\n        });\n    const fromBytes = CURVE.fromBytes ||\n        ((bytes) => {\n            // const head = bytes[0];\n            const tail = bytes.subarray(1);\n            // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported');\n            const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n            const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n            return { x, y };\n        });\n    /**\n     * y² = x³ + ax + b: Short weierstrass curve formula\n     * @returns y²\n     */\n    function weierstrassEquation(x) {\n        const { a, b } = CURVE;\n        const x2 = Fp.sqr(x); // x * x\n        const x3 = Fp.mul(x2, x); // x2 * x\n        return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b\n    }\n    // Validate whether the passed curve params are valid.\n    // We check if curve equation works for generator point.\n    // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381.\n    // ProjectivePoint class has not been initialized yet.\n    if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))\n        throw new Error('bad generator point: equation left != right');\n    // Valid group elements reside in range 1..n-1\n    function isWithinCurveOrder(num) {\n        return typeof num === 'bigint' && _0n < num && num < CURVE.n;\n    }\n    function assertGE(num) {\n        if (!isWithinCurveOrder(num))\n            throw new Error('Expected valid bigint: 0 < bigint < curve.n');\n    }\n    // Validates if priv key is valid and converts it to bigint.\n    // Supports options allowedPrivateKeyLengths and wrapPrivateKey.\n    function normPrivateKeyToScalar(key) {\n        const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE;\n        if (lengths && typeof key !== 'bigint') {\n            if (key instanceof Uint8Array)\n                key = ut.bytesToHex(key);\n            // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes\n            if (typeof key !== 'string' || !lengths.includes(key.length))\n                throw new Error('Invalid key');\n            key = key.padStart(nByteLength * 2, '0');\n        }\n        let num;\n        try {\n            num =\n                typeof key === 'bigint'\n                    ? key\n                    : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength));\n        }\n        catch (error) {\n            throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);\n        }\n        if (wrapPrivateKey)\n            num = mod.mod(num, n); // disabled by default, enabled for BLS\n        assertGE(num); // num in range [1..N-1]\n        return num;\n    }\n    const pointPrecomputes = new Map();\n    function assertPrjPoint(other) {\n        if (!(other instanceof Point))\n            throw new Error('ProjectivePoint expected');\n    }\n    /**\n     * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z)\n     * Default Point works in 2d / affine coordinates: (x, y)\n     * We're doing calculations in projective, because its operations don't require costly inversion.\n     */\n    class Point {\n        constructor(px, py, pz) {\n            this.px = px;\n            this.py = py;\n            this.pz = pz;\n            if (px == null || !Fp.isValid(px))\n                throw new Error('x required');\n            if (py == null || !Fp.isValid(py))\n                throw new Error('y required');\n            if (pz == null || !Fp.isValid(pz))\n                throw new Error('z required');\n        }\n        // Does not validate if the point is on-curve.\n        // Use fromHex instead, or call assertValidity() later.\n        static fromAffine(p) {\n            const { x, y } = p || {};\n            if (!p || !Fp.isValid(x) || !Fp.isValid(y))\n                throw new Error('invalid affine point');\n            if (p instanceof Point)\n                throw new Error('projective point not allowed');\n            const is0 = (i) => Fp.eql(i, Fp.ZERO);\n            // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0)\n            if (is0(x) && is0(y))\n                return Point.ZERO;\n            return new Point(x, y, Fp.ONE);\n        }\n        get x() {\n            return this.toAffine().x;\n        }\n        get y() {\n            return this.toAffine().y;\n        }\n        /**\n         * Takes a bunch of Projective Points but executes only one\n         * inversion on all of them. Inversion is very slow operation,\n         * so this improves performance massively.\n         * Optimization: converts a list of projective points to a list of identical points with Z=1.\n         */\n        static normalizeZ(points) {\n            const toInv = Fp.invertBatch(points.map((p) => p.pz));\n            return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n        }\n        /**\n         * Converts hash string or Uint8Array to Point.\n         * @param hex short/long ECDSA hex\n         */\n        static fromHex(hex) {\n            const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex)));\n            P.assertValidity();\n            return P;\n        }\n        // Multiplies generator point by privateKey.\n        static fromPrivateKey(privateKey) {\n            return Point.BASE.multiply(normPrivateKeyToScalar(privateKey));\n        }\n        // \"Private method\", don't use it directly\n        _setWindowSize(windowSize) {\n            this._WINDOW_SIZE = windowSize;\n            pointPrecomputes.delete(this);\n        }\n        // A point on curve is valid if it conforms to equation.\n        assertValidity() {\n            if (this.is0()) {\n                // (0, 1, 0) aka ZERO is invalid in most contexts.\n                // In BLS, ZERO can be serialized, so we allow it.\n                // (0, 0, 0) is wrong representation of ZERO and is always invalid.\n                if (CURVE.allowInfinityPoint && !Fp.is0(this.py))\n                    return;\n                throw new Error('bad point: ZERO');\n            }\n            // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n            const { x, y } = this.toAffine();\n            // Check if x, y are valid field elements\n            if (!Fp.isValid(x) || !Fp.isValid(y))\n                throw new Error('bad point: x or y not FE');\n            const left = Fp.sqr(y); // y²\n            const right = weierstrassEquation(x); // x³ + ax + b\n            if (!Fp.eql(left, right))\n                throw new Error('bad point: equation left != right');\n            if (!this.isTorsionFree())\n                throw new Error('bad point: not in prime-order subgroup');\n        }\n        hasEvenY() {\n            const { y } = this.toAffine();\n            if (Fp.isOdd)\n                return !Fp.isOdd(y);\n            throw new Error(\"Field doesn't support isOdd\");\n        }\n        /**\n         * Compare one point to another.\n         */\n        equals(other) {\n            assertPrjPoint(other);\n            const { px: X1, py: Y1, pz: Z1 } = this;\n            const { px: X2, py: Y2, pz: Z2 } = other;\n            const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n            const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n            return U1 && U2;\n        }\n        /**\n         * Flips point to one corresponding to (x, -y) in Affine coordinates.\n         */\n        negate() {\n            return new Point(this.px, Fp.neg(this.py), this.pz);\n        }\n        // Renes-Costello-Batina exception-free doubling formula.\n        // There is 30% faster Jacobian formula, but it is not complete.\n        // https://eprint.iacr.org/2015/1060, algorithm 3\n        // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n        double() {\n            const { a, b } = CURVE;\n            const b3 = Fp.mul(b, _3n);\n            const { px: X1, py: Y1, pz: Z1 } = this;\n            let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n            let t0 = Fp.mul(X1, X1); // step 1\n            let t1 = Fp.mul(Y1, Y1);\n            let t2 = Fp.mul(Z1, Z1);\n            let t3 = Fp.mul(X1, Y1);\n            t3 = Fp.add(t3, t3); // step 5\n            Z3 = Fp.mul(X1, Z1);\n            Z3 = Fp.add(Z3, Z3);\n            X3 = Fp.mul(a, Z3);\n            Y3 = Fp.mul(b3, t2);\n            Y3 = Fp.add(X3, Y3); // step 10\n            X3 = Fp.sub(t1, Y3);\n            Y3 = Fp.add(t1, Y3);\n            Y3 = Fp.mul(X3, Y3);\n            X3 = Fp.mul(t3, X3);\n            Z3 = Fp.mul(b3, Z3); // step 15\n            t2 = Fp.mul(a, t2);\n            t3 = Fp.sub(t0, t2);\n            t3 = Fp.mul(a, t3);\n            t3 = Fp.add(t3, Z3);\n            Z3 = Fp.add(t0, t0); // step 20\n            t0 = Fp.add(Z3, t0);\n            t0 = Fp.add(t0, t2);\n            t0 = Fp.mul(t0, t3);\n            Y3 = Fp.add(Y3, t0);\n            t2 = Fp.mul(Y1, Z1); // step 25\n            t2 = Fp.add(t2, t2);\n            t0 = Fp.mul(t2, t3);\n            X3 = Fp.sub(X3, t0);\n            Z3 = Fp.mul(t2, t1);\n            Z3 = Fp.add(Z3, Z3); // step 30\n            Z3 = Fp.add(Z3, Z3);\n            return new Point(X3, Y3, Z3);\n        }\n        // Renes-Costello-Batina exception-free addition formula.\n        // There is 30% faster Jacobian formula, but it is not complete.\n        // https://eprint.iacr.org/2015/1060, algorithm 1\n        // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n        add(other) {\n            assertPrjPoint(other);\n            const { px: X1, py: Y1, pz: Z1 } = this;\n            const { px: X2, py: Y2, pz: Z2 } = other;\n            let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n            const a = CURVE.a;\n            const b3 = Fp.mul(CURVE.b, _3n);\n            let t0 = Fp.mul(X1, X2); // step 1\n            let t1 = Fp.mul(Y1, Y2);\n            let t2 = Fp.mul(Z1, Z2);\n            let t3 = Fp.add(X1, Y1);\n            let t4 = Fp.add(X2, Y2); // step 5\n            t3 = Fp.mul(t3, t4);\n            t4 = Fp.add(t0, t1);\n            t3 = Fp.sub(t3, t4);\n            t4 = Fp.add(X1, Z1);\n            let t5 = Fp.add(X2, Z2); // step 10\n            t4 = Fp.mul(t4, t5);\n            t5 = Fp.add(t0, t2);\n            t4 = Fp.sub(t4, t5);\n            t5 = Fp.add(Y1, Z1);\n            X3 = Fp.add(Y2, Z2); // step 15\n            t5 = Fp.mul(t5, X3);\n            X3 = Fp.add(t1, t2);\n            t5 = Fp.sub(t5, X3);\n            Z3 = Fp.mul(a, t4);\n            X3 = Fp.mul(b3, t2); // step 20\n            Z3 = Fp.add(X3, Z3);\n            X3 = Fp.sub(t1, Z3);\n            Z3 = Fp.add(t1, Z3);\n            Y3 = Fp.mul(X3, Z3);\n            t1 = Fp.add(t0, t0); // step 25\n            t1 = Fp.add(t1, t0);\n            t2 = Fp.mul(a, t2);\n            t4 = Fp.mul(b3, t4);\n            t1 = Fp.add(t1, t2);\n            t2 = Fp.sub(t0, t2); // step 30\n            t2 = Fp.mul(a, t2);\n            t4 = Fp.add(t4, t2);\n            t0 = Fp.mul(t1, t4);\n            Y3 = Fp.add(Y3, t0);\n            t0 = Fp.mul(t5, t4); // step 35\n            X3 = Fp.mul(t3, X3);\n            X3 = Fp.sub(X3, t0);\n            t0 = Fp.mul(t3, t1);\n            Z3 = Fp.mul(t5, Z3);\n            Z3 = Fp.add(Z3, t0); // step 40\n            return new Point(X3, Y3, Z3);\n        }\n        subtract(other) {\n            return this.add(other.negate());\n        }\n        is0() {\n            return this.equals(Point.ZERO);\n        }\n        wNAF(n) {\n            return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => {\n                const toInv = Fp.invertBatch(comp.map((p) => p.pz));\n                return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n            });\n        }\n        /**\n         * Non-constant-time multiplication. Uses double-and-add algorithm.\n         * It's faster, but should only be used when you don't care about\n         * an exposed private key e.g. sig verification, which works over *public* keys.\n         */\n        multiplyUnsafe(n) {\n            const I = Point.ZERO;\n            if (n === _0n)\n                return I;\n            assertGE(n); // Will throw on 0\n            if (n === _1n)\n                return this;\n            const { endo } = CURVE;\n            if (!endo)\n                return wnaf.unsafeLadder(this, n);\n            // Apply endomorphism\n            let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n            let k1p = I;\n            let k2p = I;\n            let d = this;\n            while (k1 > _0n || k2 > _0n) {\n                if (k1 & _1n)\n                    k1p = k1p.add(d);\n                if (k2 & _1n)\n                    k2p = k2p.add(d);\n                d = d.double();\n                k1 >>= _1n;\n                k2 >>= _1n;\n            }\n            if (k1neg)\n                k1p = k1p.negate();\n            if (k2neg)\n                k2p = k2p.negate();\n            k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n            return k1p.add(k2p);\n        }\n        /**\n         * Constant time multiplication.\n         * Uses wNAF method. Windowed method may be 10% faster,\n         * but takes 2x longer to generate and consumes 2x memory.\n         * Uses precomputes when available.\n         * Uses endomorphism for Koblitz curves.\n         * @param scalar by which the point would be multiplied\n         * @returns New point\n         */\n        multiply(scalar) {\n            assertGE(scalar);\n            let n = scalar;\n            let point, fake; // Fake point is used to const-time mult\n            const { endo } = CURVE;\n            if (endo) {\n                const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n                let { p: k1p, f: f1p } = this.wNAF(k1);\n                let { p: k2p, f: f2p } = this.wNAF(k2);\n                k1p = wnaf.constTimeNegate(k1neg, k1p);\n                k2p = wnaf.constTimeNegate(k2neg, k2p);\n                k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n                point = k1p.add(k2p);\n                fake = f1p.add(f2p);\n            }\n            else {\n                const { p, f } = this.wNAF(n);\n                point = p;\n                fake = f;\n            }\n            // Normalize `z` for both points, but return only real one\n            return Point.normalizeZ([point, fake])[0];\n        }\n        /**\n         * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.\n         * Not using Strauss-Shamir trick: precomputation tables are faster.\n         * The trick could be useful if both P and Q are not G (not in our case).\n         * @returns non-zero affine point\n         */\n        multiplyAndAddUnsafe(Q, a, b) {\n            const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes\n            const mul = (P, a // Select faster multiply() method\n            ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a));\n            const sum = mul(this, a).add(mul(Q, b));\n            return sum.is0() ? undefined : sum;\n        }\n        // Converts Projective point to affine (x, y) coordinates.\n        // Can accept precomputed Z^-1 - for example, from invertBatch.\n        // (x, y, z) ∋ (x=x/z, y=y/z)\n        toAffine(iz) {\n            const { px: x, py: y, pz: z } = this;\n            const is0 = this.is0();\n            // If invZ was 0, we return zero point. However we still want to execute\n            // all operations, so we replace invZ with a random number, 1.\n            if (iz == null)\n                iz = is0 ? Fp.ONE : Fp.inv(z);\n            const ax = Fp.mul(x, iz);\n            const ay = Fp.mul(y, iz);\n            const zz = Fp.mul(z, iz);\n            if (is0)\n                return { x: Fp.ZERO, y: Fp.ZERO };\n            if (!Fp.eql(zz, Fp.ONE))\n                throw new Error('invZ was invalid');\n            return { x: ax, y: ay };\n        }\n        isTorsionFree() {\n            const { h: cofactor, isTorsionFree } = CURVE;\n            if (cofactor === _1n)\n                return true; // No subgroups, always torsion-free\n            if (isTorsionFree)\n                return isTorsionFree(Point, this);\n            throw new Error('isTorsionFree() has not been declared for the elliptic curve');\n        }\n        clearCofactor() {\n            const { h: cofactor, clearCofactor } = CURVE;\n            if (cofactor === _1n)\n                return this; // Fast-path\n            if (clearCofactor)\n                return clearCofactor(Point, this);\n            return this.multiplyUnsafe(CURVE.h);\n        }\n        toRawBytes(isCompressed = true) {\n            this.assertValidity();\n            return toBytes(Point, this, isCompressed);\n        }\n        toHex(isCompressed = true) {\n            return ut.bytesToHex(this.toRawBytes(isCompressed));\n        }\n    }\n    Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n    Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);\n    const _bits = CURVE.nBitLength;\n    const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits);\n    // Validate if generator point is on curve\n    return {\n        CURVE,\n        ProjectivePoint: Point,\n        normPrivateKeyToScalar,\n        weierstrassEquation,\n        isWithinCurveOrder,\n    };\n}\nfunction validateOpts(curve) {\n    const opts = validateBasic(curve);\n    ut.validateObject(opts, {\n        hash: 'hash',\n        hmac: 'function',\n        randomBytes: 'function',\n    }, {\n        bits2int: 'function',\n        bits2int_modN: 'function',\n        lowS: 'boolean',\n    });\n    return Object.freeze({ lowS: true, ...opts });\n}\nexport function weierstrass(curveDef) {\n    const CURVE = validateOpts(curveDef);\n    const { Fp, n: CURVE_ORDER } = CURVE;\n    const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32\n    const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32\n    function isValidFieldElement(num) {\n        return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE\n    }\n    function modN(a) {\n        return mod.mod(a, CURVE_ORDER);\n    }\n    function invN(a) {\n        return mod.invert(a, CURVE_ORDER);\n    }\n    const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({\n        ...CURVE,\n        toBytes(_c, point, isCompressed) {\n            const a = point.toAffine();\n            const x = Fp.toBytes(a.x);\n            const cat = ut.concatBytes;\n            if (isCompressed) {\n                return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x);\n            }\n            else {\n                return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y));\n            }\n        },\n        fromBytes(bytes) {\n            const len = bytes.length;\n            const head = bytes[0];\n            const tail = bytes.subarray(1);\n            // this.assertValidity() is done inside of fromHex\n            if (len === compressedLen && (head === 0x02 || head === 0x03)) {\n                const x = ut.bytesToNumberBE(tail);\n                if (!isValidFieldElement(x))\n                    throw new Error('Point is not on curve');\n                const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n                let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n                const isYOdd = (y & _1n) === _1n;\n                // ECDSA\n                const isHeadOdd = (head & 1) === 1;\n                if (isHeadOdd !== isYOdd)\n                    y = Fp.neg(y);\n                return { x, y };\n            }\n            else if (len === uncompressedLen && head === 0x04) {\n                const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n                const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n                return { x, y };\n            }\n            else {\n                throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`);\n            }\n        },\n    });\n    const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength));\n    function isBiggerThanHalfOrder(number) {\n        const HALF = CURVE_ORDER >> _1n;\n        return number > HALF;\n    }\n    function normalizeS(s) {\n        return isBiggerThanHalfOrder(s) ? modN(-s) : s;\n    }\n    // slice bytes num\n    const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to));\n    /**\n     * ECDSA signature with its (r, s) properties. Supports DER & compact representations.\n     */\n    class Signature {\n        constructor(r, s, recovery) {\n            this.r = r;\n            this.s = s;\n            this.recovery = recovery;\n            this.assertValidity();\n        }\n        // pair (bytes of r, bytes of s)\n        static fromCompact(hex) {\n            const l = CURVE.nByteLength;\n            hex = ensureBytes('compactSignature', hex, l * 2);\n            return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));\n        }\n        // DER encoded ECDSA signature\n        // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script\n        static fromDER(hex) {\n            const { r, s } = DER.toSig(ensureBytes('DER', hex));\n            return new Signature(r, s);\n        }\n        assertValidity() {\n            // can use assertGE here\n            if (!isWithinCurveOrder(this.r))\n                throw new Error('r must be 0 < r < CURVE.n');\n            if (!isWithinCurveOrder(this.s))\n                throw new Error('s must be 0 < s < CURVE.n');\n        }\n        addRecoveryBit(recovery) {\n            return new Signature(this.r, this.s, recovery);\n        }\n        recoverPublicKey(msgHash) {\n            const { r, s, recovery: rec } = this;\n            const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash\n            if (rec == null || ![0, 1, 2, 3].includes(rec))\n                throw new Error('recovery id invalid');\n            const radj = rec === 2 || rec === 3 ? r + CURVE.n : r;\n            if (radj >= Fp.ORDER)\n                throw new Error('recovery id 2 or 3 invalid');\n            const prefix = (rec & 1) === 0 ? '02' : '03';\n            const R = Point.fromHex(prefix + numToNByteStr(radj));\n            const ir = invN(radj); // r^-1\n            const u1 = modN(-h * ir); // -hr^-1\n            const u2 = modN(s * ir); // sr^-1\n            const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n            if (!Q)\n                throw new Error('point at infinify'); // unsafe is fine: no priv data leaked\n            Q.assertValidity();\n            return Q;\n        }\n        // Signatures should be low-s, to prevent malleability.\n        hasHighS() {\n            return isBiggerThanHalfOrder(this.s);\n        }\n        normalizeS() {\n            return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this;\n        }\n        // DER-encoded\n        toDERRawBytes() {\n            return ut.hexToBytes(this.toDERHex());\n        }\n        toDERHex() {\n            return DER.hexFromSig({ r: this.r, s: this.s });\n        }\n        // padded bytes of r, then padded bytes of s\n        toCompactRawBytes() {\n            return ut.hexToBytes(this.toCompactHex());\n        }\n        toCompactHex() {\n            return numToNByteStr(this.r) + numToNByteStr(this.s);\n        }\n    }\n    const utils = {\n        isValidPrivateKey(privateKey) {\n            try {\n                normPrivateKeyToScalar(privateKey);\n                return true;\n            }\n            catch (error) {\n                return false;\n            }\n        },\n        normPrivateKeyToScalar: normPrivateKeyToScalar,\n        /**\n         * Produces cryptographically secure private key from random of size\n         * (groupLen + ceil(groupLen / 2)) with modulo bias being negligible.\n         */\n        randomPrivateKey: () => {\n            const length = mod.getMinHashLength(CURVE.n);\n            return mod.mapHashToField(CURVE.randomBytes(length), CURVE.n);\n        },\n        /**\n         * Creates precompute table for an arbitrary EC point. Makes point \"cached\".\n         * Allows to massively speed-up `point.multiply(scalar)`.\n         * @returns cached point\n         * @example\n         * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));\n         * fast.multiply(privKey); // much faster ECDH now\n         */\n        precompute(windowSize = 8, point = Point.BASE) {\n            point._setWindowSize(windowSize);\n            point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here\n            return point;\n        },\n    };\n    /**\n     * Computes public key for a private key. Checks for validity of the private key.\n     * @param privateKey private key\n     * @param isCompressed whether to return compact (default), or full key\n     * @returns Public key, full when isCompressed=false; short when isCompressed=true\n     */\n    function getPublicKey(privateKey, isCompressed = true) {\n        return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);\n    }\n    /**\n     * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n     */\n    function isProbPub(item) {\n        const arr = item instanceof Uint8Array;\n        const str = typeof item === 'string';\n        const len = (arr || str) && item.length;\n        if (arr)\n            return len === compressedLen || len === uncompressedLen;\n        if (str)\n            return len === 2 * compressedLen || len === 2 * uncompressedLen;\n        if (item instanceof Point)\n            return true;\n        return false;\n    }\n    /**\n     * ECDH (Elliptic Curve Diffie Hellman).\n     * Computes shared public key from private key and public key.\n     * Checks: 1) private key validity 2) shared key is on-curve.\n     * Does NOT hash the result.\n     * @param privateA private key\n     * @param publicB different public key\n     * @param isCompressed whether to return compact (default), or full key\n     * @returns shared public key\n     */\n    function getSharedSecret(privateA, publicB, isCompressed = true) {\n        if (isProbPub(privateA))\n            throw new Error('first arg must be private key');\n        if (!isProbPub(publicB))\n            throw new Error('second arg must be public key');\n        const b = Point.fromHex(publicB); // check for being on-curve\n        return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);\n    }\n    // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n    // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n    // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n    // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n    const bits2int = CURVE.bits2int ||\n        function (bytes) {\n            // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n            // for some cases, since bytes.length * 8 is not actual bitLength.\n            const num = ut.bytesToNumberBE(bytes); // check for == u8 done here\n            const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits\n            return delta > 0 ? num >> BigInt(delta) : num;\n        };\n    const bits2int_modN = CURVE.bits2int_modN ||\n        function (bytes) {\n            return modN(bits2int(bytes)); // can't use bytesToNumberBE here\n        };\n    // NOTE: pads output with zero as per spec\n    const ORDER_MASK = ut.bitMask(CURVE.nBitLength);\n    /**\n     * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`.\n     */\n    function int2octets(num) {\n        if (typeof num !== 'bigint')\n            throw new Error('bigint expected');\n        if (!(_0n <= num && num < ORDER_MASK))\n            throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);\n        // works with order, can have different size than numToField!\n        return ut.numberToBytesBE(num, CURVE.nByteLength);\n    }\n    // Steps A, D of RFC6979 3.2\n    // Creates RFC6979 seed; converts msg/privKey to numbers.\n    // Used only in sign, not in verify.\n    // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521.\n    // Also it can be bigger for P224 + SHA256\n    function prepSig(msgHash, privateKey, opts = defaultSigOpts) {\n        if (['recovered', 'canonical'].some((k) => k in opts))\n            throw new Error('sign() legacy options not supported');\n        const { hash, randomBytes } = CURVE;\n        let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default\n        if (lowS == null)\n            lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash\n        msgHash = ensureBytes('msgHash', msgHash);\n        if (prehash)\n            msgHash = ensureBytes('prehashed msgHash', hash(msgHash));\n        // We can't later call bits2octets, since nested bits2int is broken for curves\n        // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n        // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n        const h1int = bits2int_modN(msgHash);\n        const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint\n        const seedArgs = [int2octets(d), int2octets(h1int)];\n        // extraEntropy. RFC6979 3.6: additional k' (optional).\n        if (ent != null) {\n            // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n            const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is\n            seedArgs.push(ensureBytes('extraEntropy', e)); // check for being bytes\n        }\n        const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2\n        const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n        // Converts signature params into point w r/s, checks result for validity.\n        function k2sig(kBytes) {\n            // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n            const k = bits2int(kBytes); // Cannot use fields methods, since it is group element\n            if (!isWithinCurveOrder(k))\n                return; // Important: all mod() calls here must be done over N\n            const ik = invN(k); // k^-1 mod n\n            const q = Point.BASE.multiply(k).toAffine(); // q = Gk\n            const r = modN(q.x); // r = q.x mod n\n            if (r === _0n)\n                return;\n            // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n            // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n            // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n            const s = modN(ik * modN(m + r * d)); // Not using blinding here\n            if (s === _0n)\n                return;\n            let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n            let normS = s;\n            if (lowS && isBiggerThanHalfOrder(s)) {\n                normS = normalizeS(s); // if lowS was passed, ensure s is always\n                recovery ^= 1; // // in the bottom half of N\n            }\n            return new Signature(r, normS, recovery); // use normS, not s\n        }\n        return { seed, k2sig };\n    }\n    const defaultSigOpts = { lowS: CURVE.lowS, prehash: false };\n    const defaultVerOpts = { lowS: CURVE.lowS, prehash: false };\n    /**\n     * Signs message hash with a private key.\n     * ```\n     * sign(m, d, k) where\n     *   (x, y) = G × k\n     *   r = x mod n\n     *   s = (m + dr)/k mod n\n     * ```\n     * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`.\n     * @param privKey private key\n     * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg.\n     * @returns signature with recovery param\n     */\n    function sign(msgHash, privKey, opts = defaultSigOpts) {\n        const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2.\n        const C = CURVE;\n        const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac);\n        return drbg(seed, k2sig); // Steps B, C, D, E, F, G\n    }\n    // Enable precomputes. Slows down first publicKey computation by 20ms.\n    Point.BASE._setWindowSize(8);\n    // utils.precompute(8, ProjectivePoint.BASE)\n    /**\n     * Verifies a signature against message hash and public key.\n     * Rejects lowS signatures by default: to override,\n     * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n     *\n     * ```\n     * verify(r, s, h, P) where\n     *   U1 = hs^-1 mod n\n     *   U2 = rs^-1 mod n\n     *   R = U1⋅G - U2⋅P\n     *   mod(R.x, n) == r\n     * ```\n     */\n    function verify(signature, msgHash, publicKey, opts = defaultVerOpts) {\n        const sg = signature;\n        msgHash = ensureBytes('msgHash', msgHash);\n        publicKey = ensureBytes('publicKey', publicKey);\n        if ('strict' in opts)\n            throw new Error('options.strict was renamed to lowS');\n        const { lowS, prehash } = opts;\n        let _sig = undefined;\n        let P;\n        try {\n            if (typeof sg === 'string' || sg instanceof Uint8Array) {\n                // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).\n                // Since DER can also be 2*nByteLength bytes, we check for it first.\n                try {\n                    _sig = Signature.fromDER(sg);\n                }\n                catch (derError) {\n                    if (!(derError instanceof DER.Err))\n                        throw derError;\n                    _sig = Signature.fromCompact(sg);\n                }\n            }\n            else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') {\n                const { r, s } = sg;\n                _sig = new Signature(r, s);\n            }\n            else {\n                throw new Error('PARSE');\n            }\n            P = Point.fromHex(publicKey);\n        }\n        catch (error) {\n            if (error.message === 'PARSE')\n                throw new Error(`signature must be Signature instance, Uint8Array or hex string`);\n            return false;\n        }\n        if (lowS && _sig.hasHighS())\n            return false;\n        if (prehash)\n            msgHash = CURVE.hash(msgHash);\n        const { r, s } = _sig;\n        const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element\n        const is = invN(s); // s^-1\n        const u1 = modN(h * is); // u1 = hs^-1 mod n\n        const u2 = modN(r * is); // u2 = rs^-1 mod n\n        const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P\n        if (!R)\n            return false;\n        const v = modN(R.x);\n        return v === r;\n    }\n    return {\n        CURVE,\n        getPublicKey,\n        getSharedSecret,\n        sign,\n        verify,\n        ProjectivePoint: Point,\n        Signature,\n        utils,\n    };\n}\n/**\n * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.\n * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.\n * b = True and y = sqrt(u / v) if (u / v) is square in F, and\n * b = False and y = sqrt(Z * (u / v)) otherwise.\n * @param Fp\n * @param Z\n * @returns\n */\nexport function SWUFpSqrtRatio(Fp, Z) {\n    // Generic implementation\n    const q = Fp.ORDER;\n    let l = _0n;\n    for (let o = q - _1n; o % _2n === _0n; o /= _2n)\n        l += _1n;\n    const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n    // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.\n    // 2n ** c1 == 2n << (c1-1)\n    const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);\n    const _2n_pow_c1 = _2n_pow_c1_1 * _2n;\n    const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1)  # Integer arithmetic\n    const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2            # Integer arithmetic\n    const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1                # Integer arithmetic\n    const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1)                  # Integer arithmetic\n    const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n    const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n    let sqrtRatio = (u, v) => {\n        let tv1 = c6; // 1. tv1 = c6\n        let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n        let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n        tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n        let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n        tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n        tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n        tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n        tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n        let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n        tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n        let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n        tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n        tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n        tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n        tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n        // 17. for i in (c1, c1 - 1, ..., 2):\n        for (let i = c1; i > _1n; i--) {\n            let tv5 = i - _2n; // 18.    tv5 = i - 2\n            tv5 = _2n << (tv5 - _1n); // 19.    tv5 = 2^tv5\n            let tvv5 = Fp.pow(tv4, tv5); // 20.    tv5 = tv4^tv5\n            const e1 = Fp.eql(tvv5, Fp.ONE); // 21.    e1 = tv5 == 1\n            tv2 = Fp.mul(tv3, tv1); // 22.    tv2 = tv3 * tv1\n            tv1 = Fp.mul(tv1, tv1); // 23.    tv1 = tv1 * tv1\n            tvv5 = Fp.mul(tv4, tv1); // 24.    tv5 = tv4 * tv1\n            tv3 = Fp.cmov(tv2, tv3, e1); // 25.    tv3 = CMOV(tv2, tv3, e1)\n            tv4 = Fp.cmov(tvv5, tv4, e1); // 26.    tv4 = CMOV(tv5, tv4, e1)\n        }\n        return { isValid: isQR, value: tv3 };\n    };\n    if (Fp.ORDER % _4n === _3n) {\n        // sqrt_ratio_3mod4(u, v)\n        const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4     # Integer arithmetic\n        const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n        sqrtRatio = (u, v) => {\n            let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n            const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n            tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n            let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n            y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n            const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n            const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n            const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n            let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n            return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n        };\n    }\n    // No curves uses that\n    // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n    return sqrtRatio;\n}\n/**\n * Simplified Shallue-van de Woestijne-Ulas Method\n * https://www.rfc-editor.org/rfc/rfc9380#section-6.6.2\n */\nexport function mapToCurveSimpleSWU(Fp, opts) {\n    mod.validateField(Fp);\n    if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z))\n        throw new Error('mapToCurveSimpleSWU: invalid opts');\n    const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z);\n    if (!Fp.isOdd)\n        throw new Error('Fp.isOdd is not implemented!');\n    // Input: u, an element of F.\n    // Output: (x, y), a point on E.\n    return (u) => {\n        // prettier-ignore\n        let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n        tv1 = Fp.sqr(u); // 1.  tv1 = u^2\n        tv1 = Fp.mul(tv1, opts.Z); // 2.  tv1 = Z * tv1\n        tv2 = Fp.sqr(tv1); // 3.  tv2 = tv1^2\n        tv2 = Fp.add(tv2, tv1); // 4.  tv2 = tv2 + tv1\n        tv3 = Fp.add(tv2, Fp.ONE); // 5.  tv3 = tv2 + 1\n        tv3 = Fp.mul(tv3, opts.B); // 6.  tv3 = B * tv3\n        tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7.  tv4 = CMOV(Z, -tv2, tv2 != 0)\n        tv4 = Fp.mul(tv4, opts.A); // 8.  tv4 = A * tv4\n        tv2 = Fp.sqr(tv3); // 9.  tv2 = tv3^2\n        tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n        tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6\n        tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n        tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n        tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n        tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6\n        tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n        x = Fp.mul(tv1, tv3); // 17.   x = tv1 * tv3\n        const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n        y = Fp.mul(tv1, u); // 19.   y = tv1 * u  -> Z * u^3 * y1\n        y = Fp.mul(y, value); // 20.   y = y * y1\n        x = Fp.cmov(x, tv3, isValid); // 21.   x = CMOV(x, tv3, is_gx1_square)\n        y = Fp.cmov(y, value, isValid); // 22.   y = CMOV(y, y1, is_gx1_square)\n        const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23.  e1 = sgn0(u) == sgn0(y)\n        y = Fp.cmov(Fp.neg(y), y, e1); // 24.   y = CMOV(-y, y, e1)\n        x = Fp.div(x, tv4); // 25.   x = x / tv4\n        return { x, y };\n    };\n}\n//# sourceMappingURL=weierstrass.js.map{\n  \"type\": \"module\",\n  \"sideEffects\": false\n}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha256 } from '@noble/hashes/sha256';\nimport { randomBytes } from '@noble/hashes/utils';\nimport { Field, mod, pow2 } from './abstract/modular.js';\nimport { mapToCurveSimpleSWU } from './abstract/weierstrass.js';\nimport { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js';\nimport { createHasher, isogenyMap } from './abstract/hash-to-curve.js';\nimport { createCurve } from './_shortw_utils.js';\nconst secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f');\nconst secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst divNearest = (a, b) => (a + b / _2n) / b;\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */\nfunction sqrtMod(y) {\n    const P = secp256k1P;\n    // prettier-ignore\n    const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n    // prettier-ignore\n    const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n    const b2 = (y * y * y) % P; // x^3, 11\n    const b3 = (b2 * b2 * y) % P; // x^7\n    const b6 = (pow2(b3, _3n, P) * b3) % P;\n    const b9 = (pow2(b6, _3n, P) * b3) % P;\n    const b11 = (pow2(b9, _2n, P) * b2) % P;\n    const b22 = (pow2(b11, _11n, P) * b11) % P;\n    const b44 = (pow2(b22, _22n, P) * b22) % P;\n    const b88 = (pow2(b44, _44n, P) * b44) % P;\n    const b176 = (pow2(b88, _88n, P) * b88) % P;\n    const b220 = (pow2(b176, _44n, P) * b44) % P;\n    const b223 = (pow2(b220, _3n, P) * b3) % P;\n    const t1 = (pow2(b223, _23n, P) * b22) % P;\n    const t2 = (pow2(t1, _6n, P) * b2) % P;\n    const root = pow2(t2, _2n, P);\n    if (!Fp.eql(Fp.sqr(root), y))\n        throw new Error('Cannot find square root');\n    return root;\n}\nconst Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });\nexport const secp256k1 = createCurve({\n    a: BigInt(0),\n    b: BigInt(7),\n    Fp,\n    n: secp256k1N,\n    // Base point (x, y) aka generator point\n    Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'),\n    Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'),\n    h: BigInt(1),\n    lowS: true,\n    /**\n     * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism.\n     * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.\n     * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.\n     * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066\n     */\n    endo: {\n        beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'),\n        splitScalar: (k) => {\n            const n = secp256k1N;\n            const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15');\n            const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3');\n            const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8');\n            const b2 = a1;\n            const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16)\n            const c1 = divNearest(b2 * k, n);\n            const c2 = divNearest(-b1 * k, n);\n            let k1 = mod(k - c1 * a1 - c2 * a2, n);\n            let k2 = mod(-c1 * b1 - c2 * b2, n);\n            const k1neg = k1 > POW_2_128;\n            const k2neg = k2 > POW_2_128;\n            if (k1neg)\n                k1 = n - k1;\n            if (k2neg)\n                k2 = n - k2;\n            if (k1 > POW_2_128 || k2 > POW_2_128) {\n                throw new Error('splitScalar: Endomorphism failed, k=' + k);\n            }\n            return { k1neg, k1, k2neg, k2 };\n        },\n    },\n}, sha256);\n// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code.\n// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\nconst _0n = BigInt(0);\nconst fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P;\nconst ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N;\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\nconst TAGGED_HASH_PREFIXES = {};\nfunction taggedHash(tag, ...messages) {\n    let tagP = TAGGED_HASH_PREFIXES[tag];\n    if (tagP === undefined) {\n        const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0)));\n        tagP = concatBytes(tagH, tagH);\n        TAGGED_HASH_PREFIXES[tag] = tagP;\n    }\n    return sha256(concatBytes(tagP, ...messages));\n}\n// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03\nconst pointToBytes = (point) => point.toRawBytes(true).slice(1);\nconst numTo32b = (n) => numberToBytesBE(n, 32);\nconst modP = (x) => mod(x, secp256k1P);\nconst modN = (x) => mod(x, secp256k1N);\nconst Point = secp256k1.ProjectivePoint;\nconst GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b);\n// Calculate point, scalar and bytes\nfunction schnorrGetExtPubKey(priv) {\n    let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey\n    let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside\n    const scalar = p.hasEvenY() ? d_ : modN(-d_);\n    return { scalar: scalar, bytes: pointToBytes(p) };\n}\n/**\n * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point.\n * @returns valid point checked for being on-curve\n */\nfunction lift_x(x) {\n    if (!fe(x))\n        throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p.\n    const xx = modP(x * x);\n    const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.\n    let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p.\n    if (y % _2n !== _0n)\n        y = modP(-y); // Return the unique point P such that x(P) = x and\n    const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise.\n    p.assertValidity();\n    return p;\n}\n/**\n * Create tagged hash, convert it to bigint, reduce modulo-n.\n */\nfunction challenge(...args) {\n    return modN(bytesToNumberBE(taggedHash('BIP0340/challenge', ...args)));\n}\n/**\n * Schnorr public key is just `x` coordinate of Point as per BIP340.\n */\nfunction schnorrGetPublicKey(privateKey) {\n    return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G)\n}\n/**\n * Creates Schnorr signature as per BIP340. Verifies itself before returning anything.\n * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous.\n */\nfunction schnorrSign(message, privateKey, auxRand = randomBytes(32)) {\n    const m = ensureBytes('message', message);\n    const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder\n    const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array\n    const t = numTo32b(d ^ bytesToNumberBE(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a)\n    const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m)\n    const k_ = modN(bytesToNumberBE(rand)); // Let k' = int(rand) mod n\n    if (k_ === _0n)\n        throw new Error('sign failed: k is zero'); // Fail if k' = 0.\n    const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G.\n    const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.\n    const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).\n    sig.set(rx, 0);\n    sig.set(numTo32b(modN(k + e * d)), 32);\n    // If Verify(bytes(P), m, sig) (see below) returns failure, abort\n    if (!schnorrVerify(sig, m, px))\n        throw new Error('sign: Invalid signature produced');\n    return sig;\n}\n/**\n * Verifies Schnorr signature.\n * Will swallow errors & return false except for initial type validation of arguments.\n */\nfunction schnorrVerify(signature, message, publicKey) {\n    const sig = ensureBytes('signature', signature, 64);\n    const m = ensureBytes('message', message);\n    const pub = ensureBytes('publicKey', publicKey, 32);\n    try {\n        const P = lift_x(bytesToNumberBE(pub)); // P = lift_x(int(pk)); fail if that fails\n        const r = bytesToNumberBE(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.\n        if (!fe(r))\n            return false;\n        const s = bytesToNumberBE(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.\n        if (!ge(s))\n            return false;\n        const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n\n        const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P\n        if (!R || !R.hasEvenY() || R.toAffine().x !== r)\n            return false; // -eP == (n-e)P\n        return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.\n    }\n    catch (error) {\n        return false;\n    }\n}\nexport const schnorr = /* @__PURE__ */ (() => ({\n    getPublicKey: schnorrGetPublicKey,\n    sign: schnorrSign,\n    verify: schnorrVerify,\n    utils: {\n        randomPrivateKey: secp256k1.utils.randomPrivateKey,\n        lift_x,\n        pointToBytes,\n        numberToBytesBE,\n        bytesToNumberBE,\n        taggedHash,\n        mod,\n    },\n}))();\nconst isoMap = /* @__PURE__ */ (() => isogenyMap(Fp, [\n    // xNum\n    [\n        '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7',\n        '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581',\n        '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262',\n        '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c',\n    ],\n    // xDen\n    [\n        '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b',\n        '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14',\n        '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n    ],\n    // yNum\n    [\n        '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c',\n        '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3',\n        '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931',\n        '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84',\n    ],\n    // yDen\n    [\n        '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b',\n        '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573',\n        '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f',\n        '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n    ],\n].map((i) => i.map((j) => BigInt(j)))))();\nconst mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, {\n    A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'),\n    B: BigInt('1771'),\n    Z: Fp.create(BigInt('-11')),\n}))();\nconst htf = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => {\n    const { x, y } = mapSWU(Fp.create(scalars[0]));\n    return isoMap(x, y);\n}, {\n    DST: 'secp256k1_XMD:SHA-256_SSWU_RO_',\n    encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_',\n    p: Fp.ORDER,\n    m: 1,\n    k: 128,\n    expand: 'xmd',\n    hash: sha256,\n}))();\nexport const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();\n//# sourceMappingURL=secp256k1.js.mapfunction number(n) {\n    if (!Number.isSafeInteger(n) || n < 0)\n        throw new Error(`Wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n    if (typeof b !== 'boolean')\n        throw new Error(`Expected boolean, not ${b}`);\n}\nfunction bytes(b, ...lengths) {\n    if (!(b instanceof Uint8Array))\n        throw new Error('Expected Uint8Array');\n    if (lengths.length > 0 && !lengths.includes(b.length))\n        throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n    if (typeof hash !== 'function' || typeof hash.create !== 'function')\n        throw new Error('Hash should be wrapped by utils.wrapConstructor');\n    number(hash.outputLen);\n    number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n    if (instance.destroyed)\n        throw new Error('Hash instance has been destroyed');\n    if (checkFinished && instance.finished)\n        throw new Error('Hash#digest() has already been called');\n}\nfunction output(out, instance) {\n    bytes(out);\n    const min = instance.outputLen;\n    if (out.length < min) {\n        throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n    }\n}\nexport { number, bool, bytes, hash, exists, output };\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\n//# sourceMappingURL=_assert.js.mapimport { exists, output } from './_assert.js';\nimport { Hash, createView, toBytes } from './utils.js';\n// Polyfill for Safari 14\nfunction setBigUint64(view, byteOffset, value, isLE) {\n    if (typeof view.setBigUint64 === 'function')\n        return view.setBigUint64(byteOffset, value, isLE);\n    const _32n = BigInt(32);\n    const _u32_max = BigInt(0xffffffff);\n    const wh = Number((value >> _32n) & _u32_max);\n    const wl = Number(value & _u32_max);\n    const h = isLE ? 4 : 0;\n    const l = isLE ? 0 : 4;\n    view.setUint32(byteOffset + h, wh, isLE);\n    view.setUint32(byteOffset + l, wl, isLE);\n}\n// Base SHA2 class (RFC 6234)\nexport class SHA2 extends Hash {\n    constructor(blockLen, outputLen, padOffset, isLE) {\n        super();\n        this.blockLen = blockLen;\n        this.outputLen = outputLen;\n        this.padOffset = padOffset;\n        this.isLE = isLE;\n        this.finished = false;\n        this.length = 0;\n        this.pos = 0;\n        this.destroyed = false;\n        this.buffer = new Uint8Array(blockLen);\n        this.view = createView(this.buffer);\n    }\n    update(data) {\n        exists(this);\n        const { view, buffer, blockLen } = this;\n        data = toBytes(data);\n        const len = data.length;\n        for (let pos = 0; pos < len;) {\n            const take = Math.min(blockLen - this.pos, len - pos);\n            // Fast path: we have at least one block in input, cast it to view and process\n            if (take === blockLen) {\n                const dataView = createView(data);\n                for (; blockLen <= len - pos; pos += blockLen)\n                    this.process(dataView, pos);\n                continue;\n            }\n            buffer.set(data.subarray(pos, pos + take), this.pos);\n            this.pos += take;\n            pos += take;\n            if (this.pos === blockLen) {\n                this.process(view, 0);\n                this.pos = 0;\n            }\n        }\n        this.length += data.length;\n        this.roundClean();\n        return this;\n    }\n    digestInto(out) {\n        exists(this);\n        output(out, this);\n        this.finished = true;\n        // Padding\n        // We can avoid allocation of buffer for padding completely if it\n        // was previously not allocated here. But it won't change performance.\n        const { buffer, view, blockLen, isLE } = this;\n        let { pos } = this;\n        // append the bit '1' to the message\n        buffer[pos++] = 0b10000000;\n        this.buffer.subarray(pos).fill(0);\n        // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again\n        if (this.padOffset > blockLen - pos) {\n            this.process(view, 0);\n            pos = 0;\n        }\n        // Pad until full block byte with zeros\n        for (let i = pos; i < blockLen; i++)\n            buffer[i] = 0;\n        // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n        // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n        // So we just write lowest 64 bits of that value.\n        setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n        this.process(view, 0);\n        const oview = createView(out);\n        const len = this.outputLen;\n        // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n        if (len % 4)\n            throw new Error('_sha2: outputLen should be aligned to 32bit');\n        const outLen = len / 4;\n        const state = this.get();\n        if (outLen > state.length)\n            throw new Error('_sha2: outputLen bigger than state');\n        for (let i = 0; i < outLen; i++)\n            oview.setUint32(4 * i, state[i], isLE);\n    }\n    digest() {\n        const { buffer, outputLen } = this;\n        this.digestInto(buffer);\n        const res = buffer.slice(0, outputLen);\n        this.destroy();\n        return res;\n    }\n    _cloneInto(to) {\n        to || (to = new this.constructor());\n        to.set(...this.get());\n        const { blockLen, buffer, length, finished, destroyed, pos } = this;\n        to.length = length;\n        to.pos = pos;\n        to.finished = finished;\n        to.destroyed = destroyed;\n        if (length % blockLen)\n            to.buffer.set(buffer);\n        return to;\n    }\n}\n//# sourceMappingURL=_sha2.js.mapconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n    if (le)\n        return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n    return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n    let Ah = new Uint32Array(lst.length);\n    let Al = new Uint32Array(lst.length);\n    for (let i = 0; i < lst.length; i++) {\n        const { h, l } = fromBig(lst[i], le);\n        [Ah[i], Al[i]] = [h, l];\n    }\n    return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n    const l = (Al >>> 0) + (Bl >>> 0);\n    return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, };\n// prettier-ignore\nconst u64 = {\n    fromBig, split, toBig,\n    shrSH, shrSL,\n    rotrSH, rotrSL, rotrBH, rotrBL,\n    rotr32H, rotr32L,\n    rotlSH, rotlSL, rotlBH, rotlBL,\n    add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// See utils.ts for details.\n// The file will throw on node.js 14 and earlier.\n// @ts-ignore\nimport * as nc from 'node:crypto';\nexport const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc ? nc.webcrypto : undefined;\n//# sourceMappingURL=cryptoNode.js.mapimport { hash as assertHash, bytes as assertBytes, exists as assertExists } from './_assert.js';\nimport { Hash, toBytes } from './utils.js';\n// HMAC (RFC 2104)\nexport class HMAC extends Hash {\n    constructor(hash, _key) {\n        super();\n        this.finished = false;\n        this.destroyed = false;\n        assertHash(hash);\n        const key = toBytes(_key);\n        this.iHash = hash.create();\n        if (typeof this.iHash.update !== 'function')\n            throw new Error('Expected instance of class which extends utils.Hash');\n        this.blockLen = this.iHash.blockLen;\n        this.outputLen = this.iHash.outputLen;\n        const blockLen = this.blockLen;\n        const pad = new Uint8Array(blockLen);\n        // blockLen can be bigger than outputLen\n        pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n        for (let i = 0; i < pad.length; i++)\n            pad[i] ^= 0x36;\n        this.iHash.update(pad);\n        // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n        this.oHash = hash.create();\n        // Undo internal XOR && apply outer XOR\n        for (let i = 0; i < pad.length; i++)\n            pad[i] ^= 0x36 ^ 0x5c;\n        this.oHash.update(pad);\n        pad.fill(0);\n    }\n    update(buf) {\n        assertExists(this);\n        this.iHash.update(buf);\n        return this;\n    }\n    digestInto(out) {\n        assertExists(this);\n        assertBytes(out, this.outputLen);\n        this.finished = true;\n        this.iHash.digestInto(out);\n        this.oHash.update(out);\n        this.oHash.digestInto(out);\n        this.destroy();\n    }\n    digest() {\n        const out = new Uint8Array(this.oHash.outputLen);\n        this.digestInto(out);\n        return out;\n    }\n    _cloneInto(to) {\n        // Create new instance without calling constructor since key already in state and we don't know it.\n        to || (to = Object.create(Object.getPrototypeOf(this), {}));\n        const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n        to = to;\n        to.finished = finished;\n        to.destroyed = destroyed;\n        to.blockLen = blockLen;\n        to.outputLen = outputLen;\n        to.oHash = oHash._cloneInto(to.oHash);\n        to.iHash = iHash._cloneInto(to.iHash);\n        return to;\n    }\n    destroy() {\n        this.destroyed = true;\n        this.oHash.destroy();\n        this.iHash.destroy();\n    }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n */\nexport const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map{\n  \"type\": \"module\",\n  \"sideEffects\": false,\n  \"browser\": {\n    \"node:crypto\": false\n  },\n  \"node\": {\n    \"./crypto\": \"./esm/cryptoNode.js\"\n  }\n}\nimport { hash as assertHash, number as assertNumber } from './_assert.js';\nimport { hmac } from './hmac.js';\nimport { createView, toBytes, checkOpts, asyncLoop } from './utils.js';\n// Common prologue and epilogue for sync/async functions\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n    assertHash(hash);\n    const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n    const { c, dkLen, asyncTick } = opts;\n    assertNumber(c);\n    assertNumber(dkLen);\n    assertNumber(asyncTick);\n    if (c < 1)\n        throw new Error('PBKDF2: iterations (c) should be >= 1');\n    const password = toBytes(_password);\n    const salt = toBytes(_salt);\n    // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n    const DK = new Uint8Array(dkLen);\n    // U1 = PRF(Password, Salt + INT_32_BE(i))\n    const PRF = hmac.create(hash, password);\n    const PRFSalt = PRF._cloneInto().update(salt);\n    return { c, dkLen, asyncTick, DK, PRF, PRFSalt };\n}\nfunction pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {\n    PRF.destroy();\n    PRFSalt.destroy();\n    if (prfW)\n        prfW.destroy();\n    u.fill(0);\n    return DK;\n}\n/**\n * PBKDF2-HMAC: RFC 2898 key derivation function\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated\n * @param salt - cryptographic salt\n * @param opts - {c, dkLen} where c is work factor and dkLen is output message size\n */\nexport function pbkdf2(hash, password, salt, opts) {\n    const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n    let prfW; // Working copy\n    const arr = new Uint8Array(4);\n    const view = createView(arr);\n    const u = new Uint8Array(PRF.outputLen);\n    // DK = T1 + T2 + ⋯ + Tdklen/hlen\n    for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n        // Ti = F(Password, Salt, c, i)\n        const Ti = DK.subarray(pos, pos + PRF.outputLen);\n        view.setInt32(0, ti, false);\n        // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n        // U1 = PRF(Password, Salt + INT_32_BE(i))\n        (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n        Ti.set(u.subarray(0, Ti.length));\n        for (let ui = 1; ui < c; ui++) {\n            // Uc = PRF(Password, Uc−1)\n            PRF._cloneInto(prfW).update(u).digestInto(u);\n            for (let i = 0; i < Ti.length; i++)\n                Ti[i] ^= u[i];\n        }\n    }\n    return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\nexport async function pbkdf2Async(hash, password, salt, opts) {\n    const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n    let prfW; // Working copy\n    const arr = new Uint8Array(4);\n    const view = createView(arr);\n    const u = new Uint8Array(PRF.outputLen);\n    // DK = T1 + T2 + ⋯ + Tdklen/hlen\n    for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n        // Ti = F(Password, Salt, c, i)\n        const Ti = DK.subarray(pos, pos + PRF.outputLen);\n        view.setInt32(0, ti, false);\n        // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n        // U1 = PRF(Password, Salt + INT_32_BE(i))\n        (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n        Ti.set(u.subarray(0, Ti.length));\n        await asyncLoop(c - 1, asyncTick, () => {\n            // Uc = PRF(Password, Uc−1)\n            PRF._cloneInto(prfW).update(u).digestInto(u);\n            for (let i = 0; i < Ti.length; i++)\n                Ti[i] ^= u[i];\n        });\n    }\n    return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\n//# sourceMappingURL=pbkdf2.js.mapimport { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\nconst Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]);\nconst Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i);\nconst Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16);\nlet idxL = [Id];\nlet idxR = [Pi];\nfor (let i = 0; i < 4; i++)\n    for (let j of [idxL, idxR])\n        j.push(j[i].map((k) => Rho[k]));\nconst shifts = /* @__PURE__ */ [\n    [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n    [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n    [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n    [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n    [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => new Uint8Array(i));\nconst shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst Kl = /* @__PURE__ */ new Uint32Array([\n    0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\nconst Kr = /* @__PURE__ */ new Uint32Array([\n    0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | (word >>> (32 - shift));\n// It's called f() in spec.\nfunction f(group, x, y, z) {\n    if (group === 0)\n        return x ^ y ^ z;\n    else if (group === 1)\n        return (x & y) | (~x & z);\n    else if (group === 2)\n        return (x | ~y) ^ z;\n    else if (group === 3)\n        return (x & z) | (y & ~z);\n    else\n        return x ^ (y | ~z);\n}\n// Temporary buffer, not used to store anything between runs\nconst BUF = /* @__PURE__ */ new Uint32Array(16);\nexport class RIPEMD160 extends SHA2 {\n    constructor() {\n        super(64, 20, 8, true);\n        this.h0 = 0x67452301 | 0;\n        this.h1 = 0xefcdab89 | 0;\n        this.h2 = 0x98badcfe | 0;\n        this.h3 = 0x10325476 | 0;\n        this.h4 = 0xc3d2e1f0 | 0;\n    }\n    get() {\n        const { h0, h1, h2, h3, h4 } = this;\n        return [h0, h1, h2, h3, h4];\n    }\n    set(h0, h1, h2, h3, h4) {\n        this.h0 = h0 | 0;\n        this.h1 = h1 | 0;\n        this.h2 = h2 | 0;\n        this.h3 = h3 | 0;\n        this.h4 = h4 | 0;\n    }\n    process(view, offset) {\n        for (let i = 0; i < 16; i++, offset += 4)\n            BUF[i] = view.getUint32(offset, true);\n        // prettier-ignore\n        let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n        // Instead of iterating 0 to 80, we split it into 5 groups\n        // And use the groups in constants, functions, etc. Much simpler\n        for (let group = 0; group < 5; group++) {\n            const rGroup = 4 - group;\n            const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore\n            const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n            const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore\n            for (let i = 0; i < 16; i++) {\n                const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0;\n                al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n            }\n            // 2 loops are 10% faster\n            for (let i = 0; i < 16; i++) {\n                const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0;\n                ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n            }\n        }\n        // Add the compressed chunk to the current hash value\n        this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n    }\n    roundClean() {\n        BUF.fill(0);\n    }\n    destroy() {\n        this.destroyed = true;\n        this.buffer.fill(0);\n        this.set(0, 0, 0, 0, 0);\n    }\n}\n/**\n * RIPEMD-160 - a hash function from 1990s.\n * @param message - msg that would be hashed\n */\nexport const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());\n//# sourceMappingURL=ripemd160.js.mapimport { number as assertNumber } from './_assert.js';\nimport { sha256 } from './sha256.js';\nimport { pbkdf2 } from './pbkdf2.js';\nimport { asyncLoop, checkOpts, u32 } from './utils.js';\n// RFC 7914 Scrypt KDF\n// Left rotate for uint32\nconst rotl = (a, b) => (a << b) | (a >>> (32 - b));\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n    // Based on https://cr.yp.to/salsa20.html\n    // Xor blocks\n    let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n    let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n    let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n    let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n    let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n    let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n    let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n    let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n    // Save state to temporary variables (salsa)\n    let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n    // Main loop (salsa)\n    for (let i = 0; i < 8; i += 2) {\n        x04 ^= rotl(x00 + x12 | 0, 7);\n        x08 ^= rotl(x04 + x00 | 0, 9);\n        x12 ^= rotl(x08 + x04 | 0, 13);\n        x00 ^= rotl(x12 + x08 | 0, 18);\n        x09 ^= rotl(x05 + x01 | 0, 7);\n        x13 ^= rotl(x09 + x05 | 0, 9);\n        x01 ^= rotl(x13 + x09 | 0, 13);\n        x05 ^= rotl(x01 + x13 | 0, 18);\n        x14 ^= rotl(x10 + x06 | 0, 7);\n        x02 ^= rotl(x14 + x10 | 0, 9);\n        x06 ^= rotl(x02 + x14 | 0, 13);\n        x10 ^= rotl(x06 + x02 | 0, 18);\n        x03 ^= rotl(x15 + x11 | 0, 7);\n        x07 ^= rotl(x03 + x15 | 0, 9);\n        x11 ^= rotl(x07 + x03 | 0, 13);\n        x15 ^= rotl(x11 + x07 | 0, 18);\n        x01 ^= rotl(x00 + x03 | 0, 7);\n        x02 ^= rotl(x01 + x00 | 0, 9);\n        x03 ^= rotl(x02 + x01 | 0, 13);\n        x00 ^= rotl(x03 + x02 | 0, 18);\n        x06 ^= rotl(x05 + x04 | 0, 7);\n        x07 ^= rotl(x06 + x05 | 0, 9);\n        x04 ^= rotl(x07 + x06 | 0, 13);\n        x05 ^= rotl(x04 + x07 | 0, 18);\n        x11 ^= rotl(x10 + x09 | 0, 7);\n        x08 ^= rotl(x11 + x10 | 0, 9);\n        x09 ^= rotl(x08 + x11 | 0, 13);\n        x10 ^= rotl(x09 + x08 | 0, 18);\n        x12 ^= rotl(x15 + x14 | 0, 7);\n        x13 ^= rotl(x12 + x15 | 0, 9);\n        x14 ^= rotl(x13 + x12 | 0, 13);\n        x15 ^= rotl(x14 + x13 | 0, 18);\n    }\n    // Write output (salsa)\n    out[oi++] = (y00 + x00) | 0;\n    out[oi++] = (y01 + x01) | 0;\n    out[oi++] = (y02 + x02) | 0;\n    out[oi++] = (y03 + x03) | 0;\n    out[oi++] = (y04 + x04) | 0;\n    out[oi++] = (y05 + x05) | 0;\n    out[oi++] = (y06 + x06) | 0;\n    out[oi++] = (y07 + x07) | 0;\n    out[oi++] = (y08 + x08) | 0;\n    out[oi++] = (y09 + x09) | 0;\n    out[oi++] = (y10 + x10) | 0;\n    out[oi++] = (y11 + x11) | 0;\n    out[oi++] = (y12 + x12) | 0;\n    out[oi++] = (y13 + x13) | 0;\n    out[oi++] = (y14 + x14) | 0;\n    out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n    // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks)\n    let head = oi + 0;\n    let tail = oi + 16 * r;\n    for (let i = 0; i < 16; i++)\n        out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n    for (let i = 0; i < r; i++, head += 16, ii += 16) {\n        // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd:  0bXXXXX1\n        XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n        if (i > 0)\n            tail += 16; // First iteration overwrites tmp value in tail\n        XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n    }\n}\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n    // Maxmem - 1GB+1KB by default\n    const opts = checkOpts({\n        dkLen: 32,\n        asyncTick: 10,\n        maxmem: 1024 ** 3 + 1024,\n    }, _opts);\n    const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n    assertNumber(N);\n    assertNumber(r);\n    assertNumber(p);\n    assertNumber(dkLen);\n    assertNumber(asyncTick);\n    assertNumber(maxmem);\n    if (onProgress !== undefined && typeof onProgress !== 'function')\n        throw new Error('progressCb should be function');\n    const blockSize = 128 * r;\n    const blockSize32 = blockSize / 4;\n    if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) {\n        // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function\n        // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future.\n        throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32');\n    }\n    if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) {\n        throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)');\n    }\n    if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) {\n        throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32');\n    }\n    const memUsed = blockSize * (N + p);\n    if (memUsed > maxmem) {\n        throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`);\n    }\n    // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n    // Since it has only one iteration there is no reason to use async variant\n    const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n    const B32 = u32(B);\n    // Re-used between parallel iterations. Array(iterations) of B\n    const V = u32(new Uint8Array(blockSize * N));\n    const tmp = u32(new Uint8Array(blockSize));\n    let blockMixCb = () => { };\n    if (onProgress) {\n        const totalBlockMix = 2 * N * p;\n        // Invoke callback if progress changes from 10.01 to 10.02\n        // Allows to draw smooth progress bar on up to 8K screen\n        const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n        let blockMixCnt = 0;\n        blockMixCb = () => {\n            blockMixCnt++;\n            if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix))\n                onProgress(blockMixCnt / totalBlockMix);\n        };\n    }\n    return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n    const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n    B.fill(0);\n    V.fill(0);\n    tmp.fill(0);\n    return res;\n}\n/**\n * Scrypt KDF from RFC 7914.\n * @param password - pass\n * @param salt - salt\n * @param opts - parameters\n * - `N` is cpu/mem work factor (power of 2 e.g. 2**18)\n * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance\n * - `p` is parallelization factor (1 is common)\n * - `dkLen` is output key length in bytes e.g. 32.\n * - `asyncTick` - (default: 10) max time in ms for which async function can block execution\n * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt\n * - `onProgress` - callback function that would be executed for progress report\n * @returns Derived key\n */\nexport function scrypt(password, salt, opts) {\n    const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n    for (let pi = 0; pi < p; pi++) {\n        const Pi = blockSize32 * pi;\n        for (let i = 0; i < blockSize32; i++)\n            V[i] = B32[Pi + i]; // V[0] = B[i]\n        for (let i = 0, pos = 0; i < N - 1; i++) {\n            BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n            blockMixCb();\n        }\n        BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n        blockMixCb();\n        for (let i = 0; i < N; i++) {\n            // First u32 of the last 64-byte block (u32 is LE)\n            const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n            for (let k = 0; k < blockSize32; k++)\n                tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n            BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n            blockMixCb();\n        }\n    }\n    return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914.\n */\nexport async function scryptAsync(password, salt, opts) {\n    const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n    for (let pi = 0; pi < p; pi++) {\n        const Pi = blockSize32 * pi;\n        for (let i = 0; i < blockSize32; i++)\n            V[i] = B32[Pi + i]; // V[0] = B[i]\n        let pos = 0;\n        await asyncLoop(N - 1, asyncTick, () => {\n            BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n            blockMixCb();\n        });\n        BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n        blockMixCb();\n        await asyncLoop(N, asyncTick, () => {\n            // First u32 of the last 64-byte block (u32 is LE)\n            const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n            for (let k = 0; k < blockSize32; k++)\n                tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n            BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n            blockMixCb();\n        });\n    }\n    return scryptOutput(password, dkLen, B, V, tmp);\n}\n//# sourceMappingURL=scrypt.js.mapimport { SHA2 } from './_sha2.js';\nimport { rotr, wrapConstructor } from './utils.js';\n// SHA2-256 need to try 2^128 hashes to execute birthday attack.\n// BTC network is doing 2^67 hashes/sec as per early 2023.\n// Choice: a ? b : c\nconst Chi = (a, b, c) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ new Uint32Array([\n    0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n    0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n    0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n    0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n    0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n    0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n    0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n    0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n// prettier-ignore\nconst IV = /* @__PURE__ */ new Uint32Array([\n    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nclass SHA256 extends SHA2 {\n    constructor() {\n        super(64, 32, 8, false);\n        // We cannot use array here since array allows indexing by variable\n        // which means optimizer/compiler cannot use registers.\n        this.A = IV[0] | 0;\n        this.B = IV[1] | 0;\n        this.C = IV[2] | 0;\n        this.D = IV[3] | 0;\n        this.E = IV[4] | 0;\n        this.F = IV[5] | 0;\n        this.G = IV[6] | 0;\n        this.H = IV[7] | 0;\n    }\n    get() {\n        const { A, B, C, D, E, F, G, H } = this;\n        return [A, B, C, D, E, F, G, H];\n    }\n    // prettier-ignore\n    set(A, B, C, D, E, F, G, H) {\n        this.A = A | 0;\n        this.B = B | 0;\n        this.C = C | 0;\n        this.D = D | 0;\n        this.E = E | 0;\n        this.F = F | 0;\n        this.G = G | 0;\n        this.H = H | 0;\n    }\n    process(view, offset) {\n        // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n        for (let i = 0; i < 16; i++, offset += 4)\n            SHA256_W[i] = view.getUint32(offset, false);\n        for (let i = 16; i < 64; i++) {\n            const W15 = SHA256_W[i - 15];\n            const W2 = SHA256_W[i - 2];\n            const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n            const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n            SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n        }\n        // Compression function main loop, 64 rounds\n        let { A, B, C, D, E, F, G, H } = this;\n        for (let i = 0; i < 64; i++) {\n            const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n            const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n            const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n            const T2 = (sigma0 + Maj(A, B, C)) | 0;\n            H = G;\n            G = F;\n            F = E;\n            E = (D + T1) | 0;\n            D = C;\n            C = B;\n            B = A;\n            A = (T1 + T2) | 0;\n        }\n        // Add the compressed chunk to the current hash value\n        A = (A + this.A) | 0;\n        B = (B + this.B) | 0;\n        C = (C + this.C) | 0;\n        D = (D + this.D) | 0;\n        E = (E + this.E) | 0;\n        F = (F + this.F) | 0;\n        G = (G + this.G) | 0;\n        H = (H + this.H) | 0;\n        this.set(A, B, C, D, E, F, G, H);\n    }\n    roundClean() {\n        SHA256_W.fill(0);\n    }\n    destroy() {\n        this.set(0, 0, 0, 0, 0, 0, 0, 0);\n        this.buffer.fill(0);\n    }\n}\n// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\nclass SHA224 extends SHA256 {\n    constructor() {\n        super();\n        this.A = 0xc1059ed8 | 0;\n        this.B = 0x367cd507 | 0;\n        this.C = 0x3070dd17 | 0;\n        this.D = 0xf70e5939 | 0;\n        this.E = 0xffc00b31 | 0;\n        this.F = 0x68581511 | 0;\n        this.G = 0x64f98fa7 | 0;\n        this.H = 0xbefa4fa4 | 0;\n        this.outputLen = 28;\n    }\n}\n/**\n * SHA2-256 hash function\n * @param message - data that would be hashed\n */\nexport const sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256());\nexport const sha224 = /* @__PURE__ */ wrapConstructor(() => new SHA224());\n//# sourceMappingURL=sha256.js.mapimport { bytes, exists, number, output } from './_assert.js';\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapXOFConstructorWithOpts, } from './utils.js';\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n    // Pi\n    [x, y] = [y, (2 * x + 3 * y) % 5];\n    SHA3_PI.push(2 * (5 * y + x));\n    // Rotational\n    SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n    // Iota\n    let t = _0n;\n    for (let j = 0; j < 7; j++) {\n        R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n        if (R & _2n)\n            t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n    }\n    _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n    const B = new Uint32Array(5 * 2);\n    // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n    for (let round = 24 - rounds; round < 24; round++) {\n        // Theta θ\n        for (let x = 0; x < 10; x++)\n            B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n        for (let x = 0; x < 10; x += 2) {\n            const idx1 = (x + 8) % 10;\n            const idx0 = (x + 2) % 10;\n            const B0 = B[idx0];\n            const B1 = B[idx0 + 1];\n            const Th = rotlH(B0, B1, 1) ^ B[idx1];\n            const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n            for (let y = 0; y < 50; y += 10) {\n                s[x + y] ^= Th;\n                s[x + y + 1] ^= Tl;\n            }\n        }\n        // Rho (ρ) and Pi (π)\n        let curH = s[2];\n        let curL = s[3];\n        for (let t = 0; t < 24; t++) {\n            const shift = SHA3_ROTL[t];\n            const Th = rotlH(curH, curL, shift);\n            const Tl = rotlL(curH, curL, shift);\n            const PI = SHA3_PI[t];\n            curH = s[PI];\n            curL = s[PI + 1];\n            s[PI] = Th;\n            s[PI + 1] = Tl;\n        }\n        // Chi (χ)\n        for (let y = 0; y < 50; y += 10) {\n            for (let x = 0; x < 10; x++)\n                B[x] = s[y + x];\n            for (let x = 0; x < 10; x++)\n                s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n        }\n        // Iota (ι)\n        s[0] ^= SHA3_IOTA_H[round];\n        s[1] ^= SHA3_IOTA_L[round];\n    }\n    B.fill(0);\n}\nexport class Keccak extends Hash {\n    // NOTE: we accept arguments in bytes instead of bits here.\n    constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n        super();\n        this.blockLen = blockLen;\n        this.suffix = suffix;\n        this.outputLen = outputLen;\n        this.enableXOF = enableXOF;\n        this.rounds = rounds;\n        this.pos = 0;\n        this.posOut = 0;\n        this.finished = false;\n        this.destroyed = false;\n        // Can be passed from user as dkLen\n        number(outputLen);\n        // 1600 = 5x5 matrix of 64bit.  1600 bits === 200 bytes\n        if (0 >= this.blockLen || this.blockLen >= 200)\n            throw new Error('Sha3 supports only keccak-f1600 function');\n        this.state = new Uint8Array(200);\n        this.state32 = u32(this.state);\n    }\n    keccak() {\n        keccakP(this.state32, this.rounds);\n        this.posOut = 0;\n        this.pos = 0;\n    }\n    update(data) {\n        exists(this);\n        const { blockLen, state } = this;\n        data = toBytes(data);\n        const len = data.length;\n        for (let pos = 0; pos < len;) {\n            const take = Math.min(blockLen - this.pos, len - pos);\n            for (let i = 0; i < take; i++)\n                state[this.pos++] ^= data[pos++];\n            if (this.pos === blockLen)\n                this.keccak();\n        }\n        return this;\n    }\n    finish() {\n        if (this.finished)\n            return;\n        this.finished = true;\n        const { state, suffix, pos, blockLen } = this;\n        // Do the padding\n        state[pos] ^= suffix;\n        if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n            this.keccak();\n        state[blockLen - 1] ^= 0x80;\n        this.keccak();\n    }\n    writeInto(out) {\n        exists(this, false);\n        bytes(out);\n        this.finish();\n        const bufferOut = this.state;\n        const { blockLen } = this;\n        for (let pos = 0, len = out.length; pos < len;) {\n            if (this.posOut >= blockLen)\n                this.keccak();\n            const take = Math.min(blockLen - this.posOut, len - pos);\n            out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n            this.posOut += take;\n            pos += take;\n        }\n        return out;\n    }\n    xofInto(out) {\n        // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n        if (!this.enableXOF)\n            throw new Error('XOF is not possible for this instance');\n        return this.writeInto(out);\n    }\n    xof(bytes) {\n        number(bytes);\n        return this.xofInto(new Uint8Array(bytes));\n    }\n    digestInto(out) {\n        output(out, this);\n        if (this.finished)\n            throw new Error('digest() was already called');\n        this.writeInto(out);\n        this.destroy();\n        return out;\n    }\n    digest() {\n        return this.digestInto(new Uint8Array(this.outputLen));\n    }\n    destroy() {\n        this.destroyed = true;\n        this.state.fill(0);\n    }\n    _cloneInto(to) {\n        const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n        to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n        to.state32.set(this.state32);\n        to.pos = this.pos;\n        to.posOut = this.posOut;\n        to.finished = this.finished;\n        to.rounds = rounds;\n        // Suffix can change in cSHAKE\n        to.suffix = suffix;\n        to.outputLen = outputLen;\n        to.enableXOF = enableXOF;\n        to.destroyed = this.destroyed;\n        return to;\n    }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8);\nexport const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8);\nexport const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8);\nexport const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8);\nexport const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8);\nexport const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8);\nexport const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n    throw new Error('Non little-endian hardware is not supported');\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n    if (!u8a(bytes))\n        throw new Error('Uint8Array expected');\n    // pre-caching improves the speed 6x\n    let hex = '';\n    for (let i = 0; i < bytes.length; i++) {\n        hex += hexes[bytes[i]];\n    }\n    return hex;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n    if (typeof hex !== 'string')\n        throw new Error('hex string expected, got ' + typeof hex);\n    const len = hex.length;\n    if (len % 2)\n        throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n    const array = new Uint8Array(len / 2);\n    for (let i = 0; i < array.length; i++) {\n        const j = i * 2;\n        const hexByte = hex.slice(j, j + 2);\n        const byte = Number.parseInt(hexByte, 16);\n        if (Number.isNaN(byte) || byte < 0)\n            throw new Error('Invalid byte sequence');\n        array[i] = byte;\n    }\n    return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n    let ts = Date.now();\n    for (let i = 0; i < iters; i++) {\n        cb(i);\n        // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n        const diff = Date.now() - ts;\n        if (diff >= 0 && diff < tick)\n            continue;\n        await nextTick();\n        ts += diff;\n    }\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n    if (typeof str !== 'string')\n        throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n    return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n    if (typeof data === 'string')\n        data = utf8ToBytes(data);\n    if (!u8a(data))\n        throw new Error(`expected Uint8Array, got ${typeof data}`);\n    return data;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n    const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n    let pad = 0; // walk through each item, ensure they have proper type\n    arrays.forEach((a) => {\n        if (!u8a(a))\n            throw new Error('Uint8Array expected');\n        r.set(a, pad);\n        pad += a.length;\n    });\n    return r;\n}\n// For runtime check if class implements interface\nexport class Hash {\n    // Safe version that clones internal state\n    clone() {\n        return this._cloneInto();\n    }\n}\nconst toStr = {}.toString;\nexport function checkOpts(defaults, opts) {\n    if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n        throw new Error('Options should be object or undefined');\n    const merged = Object.assign(defaults, opts);\n    return merged;\n}\nexport function wrapConstructor(hashCons) {\n    const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n    const tmp = hashCons();\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = () => hashCons();\n    return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n    const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n    const tmp = hashCons({});\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = (opts) => hashCons(opts);\n    return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n    const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n    const tmp = hashCons({});\n    hashC.outputLen = tmp.outputLen;\n    hashC.blockLen = tmp.blockLen;\n    hashC.create = (opts) => hashCons(opts);\n    return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n    if (crypto && typeof crypto.getRandomValues === 'function') {\n        return crypto.getRandomValues(new Uint8Array(bytesLength));\n    }\n    throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.mapmodule.exports = require('bare-events')\n{\n  \"name\": \"events-universal\",\n  \"version\": \"1.0.1\",\n  \"description\": \"Universal wrapper for the Node.js events module\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"bare\": \"./bare.js\",\n      \"react-native\": \"./react-native.js\",\n      \"default\": \"./default.js\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"default.js\",\n    \"bare.js\",\n    \"react-native.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"prettier . --check\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/events-universal.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/events-universal/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/events-universal#readme\",\n  \"dependencies\": {\n    \"bare-events\": \"^2.7.0\"\n  },\n  \"devDependencies\": {\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-holepunch\": \"^1.0.0\"\n  }\n}\nmodule.exports = class FixedFIFO {\n  constructor (hwm) {\n    if (!(hwm > 0) || ((hwm - 1) & hwm) !== 0) throw new Error('Max size for a FixedFIFO should be a power of two')\n    this.buffer = new Array(hwm)\n    this.mask = hwm - 1\n    this.top = 0\n    this.btm = 0\n    this.next = null\n  }\n\n  clear () {\n    this.top = this.btm = 0\n    this.next = null\n    this.buffer.fill(undefined)\n  }\n\n  push (data) {\n    if (this.buffer[this.top] !== undefined) return false\n    this.buffer[this.top] = data\n    this.top = (this.top + 1) & this.mask\n    return true\n  }\n\n  shift () {\n    const last = this.buffer[this.btm]\n    if (last === undefined) return undefined\n    this.buffer[this.btm] = undefined\n    this.btm = (this.btm + 1) & this.mask\n    return last\n  }\n\n  peek () {\n    return this.buffer[this.btm]\n  }\n\n  isEmpty () {\n    return this.buffer[this.btm] === undefined\n  }\n}\nconst FixedFIFO = require('./fixed-size')\n\nmodule.exports = class FastFIFO {\n  constructor (hwm) {\n    this.hwm = hwm || 16\n    this.head = new FixedFIFO(this.hwm)\n    this.tail = this.head\n    this.length = 0\n  }\n\n  clear () {\n    this.head = this.tail\n    this.head.clear()\n    this.length = 0\n  }\n\n  push (val) {\n    this.length++\n    if (!this.head.push(val)) {\n      const prev = this.head\n      this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length)\n      this.head.push(val)\n    }\n  }\n\n  shift () {\n    if (this.length !== 0) this.length--\n    const val = this.tail.shift()\n    if (val === undefined && this.tail.next) {\n      const next = this.tail.next\n      this.tail.next = null\n      this.tail = next\n      return this.tail.shift()\n    }\n\n    return val\n  }\n\n  peek () {\n    const val = this.tail.peek()\n    if (val === undefined && this.tail.next) return this.tail.next.peek()\n    return val\n  }\n\n  isEmpty () {\n    return this.length === 0\n  }\n}\n{\n  \"name\": \"fast-fifo\",\n  \"version\": \"1.3.2\",\n  \"description\": \"A fast fifo implementation similar to the one powering nextTick in Node.js core\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"./index.js\",\n    \"./fixed-size.js\"\n  ],\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"standard\": \"^17.1.0\",\n    \"brittle\": \"^3.3.2\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/fast-fifo.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/fast-fifo/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/fast-fifo\"\n}\nconst fs = require('fs')\nconst fsx = require('fs-native-extensions')\nconst onexit = require('resource-on-exit')\nconst ReadyResource = require('ready-resource')\n\nmodule.exports = class FDLock extends ReadyResource {\n  constructor(fd, opts = {}) {\n    const { wait = false } = opts\n\n    super()\n\n    this._fd = fd\n    this._wait = wait\n    this._locked = false\n\n    onexit.add(this, closeSync)\n  }\n\n  async _open() {\n    try {\n      await this._resume()\n    } catch (err) {\n      onexit.remove(this)\n      await close(this)\n      throw err\n    }\n  }\n\n  async _close() {\n    onexit.remove(this)\n    await close(this)\n  }\n\n  transfer() {\n    const fd = this._fd\n    if (fd === -1) throw new Error('Lock has already been transferred')\n    this._fd = -1\n    onexit.remove(this)\n    return fd\n  }\n\n  async suspend() {\n    if (!this.opened) await this.ready()\n    return this._suspend()\n  }\n\n  async _suspend() {\n    if (this._fd === -1 || this._locked === false) return\n    fsx.unlock(this._fd)\n    this._locked = false\n  }\n\n  async resume() {\n    if (!this.opened) await this.ready()\n    return this._resume()\n  }\n\n  async _resume() {\n    if (this._fd === -1 || this._locked === true) return\n    if (this._wait) await fsx.waitForLock(this._fd)\n    else if (!fsx.tryLock(this._fd)) {\n      throw new Error('File descriptor could not be locked')\n    }\n    this._locked = true\n  }\n}\n\nfunction close(lock) {\n  const fd = lock._fd\n  if (fd === -1) return\n  lock._fd = -1\n  return new Promise((resolve) => fs.close(fd, () => resolve()))\n}\n\nfunction closeSync(lock) {\n  const fd = lock._fd\n  if (fd === -1) return\n  lock._fd = -1\n  try {\n    fs.closeSync(fd)\n  } catch {}\n}\n{\n  \"name\": \"fd-lock\",\n  \"version\": \"2.1.1\",\n  \"description\": \"Stateful file descriptor locks for JavaScript\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": \"./index.js\"\n  },\n  \"imports\": {\n    \"fs\": {\n      \"bare\": \"bare-fs\",\n      \"default\": \"fs\"\n    }\n  },\n  \"files\": [\n    \"index.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"npm run lint && npm run test:bare && npm run test:node\",\n    \"test:bare\": \"bare test.js\",\n    \"test:node\": \"node test.js\",\n    \"lint\": \"prettier --check .\",\n    \"format\": \"prettier --write .\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/fd-lock.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/fd-lock/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/fd-lock#readme\",\n  \"dependencies\": {\n    \"bare-fs\": \"^4.5.0\",\n    \"fs-native-extensions\": \"^1.4.4\",\n    \"ready-resource\": \"^1.2.0\",\n    \"resource-on-exit\": \"^1.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"prettier\": \"^3.4.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\n\n/**\n * Module dependencies.\n */\n\nvar sep = require('path').sep || '/';\n\n/**\n * Module exports.\n */\n\nmodule.exports = fileUriToPath;\n\n/**\n * File URI to Path function.\n *\n * @param {String} uri\n * @return {String} path\n * @api public\n */\n\nfunction fileUriToPath (uri) {\n  if ('string' != typeof uri ||\n      uri.length <= 7 ||\n      'file://' != uri.substring(0, 7)) {\n    throw new TypeError('must pass in a file:// URI to convert to a file path');\n  }\n\n  var rest = decodeURI(uri.substring(7));\n  var firstSlash = rest.indexOf('/');\n  var host = rest.substring(0, firstSlash);\n  var path = rest.substring(firstSlash + 1);\n\n  // 2.  Scheme Definition\n  // As a special case, <host> can be the string \"localhost\" or the empty\n  // string; this is interpreted as \"the machine from which the URL is\n  // being interpreted\".\n  if ('localhost' == host) host = '';\n\n  if (host) {\n    host = sep + sep + host;\n  }\n\n  // 3.2  Drives, drive letters, mount points, file system root\n  // Drive letters are mapped into the top of a file URI in various ways,\n  // depending on the implementation; some applications substitute\n  // vertical bar (\"|\") for the colon after the drive letter, yielding\n  // \"file:///c|/tmp/test.txt\".  In some cases, the colon is left\n  // unchanged, as in \"file:///c:/tmp/test.txt\".  In other cases, the\n  // colon is simply omitted, as in \"file:///c/tmp/test.txt\".\n  path = path.replace(/^(.+)\\|/, '$1:');\n\n  // for Windows, we need to invert the path separators from what a URI uses\n  if (sep == '\\\\') {\n    path = path.replace(/\\//g, '\\\\');\n  }\n\n  if (/^.+\\:/.test(path)) {\n    // has Windows drive at beginning of path\n  } else {\n    // unix path…\n    path = sep + path;\n  }\n\n  return host + path;\n}\n{\n  \"name\": \"file-uri-to-path\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Convert a file: URI to a file path\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"directories\": {\n    \"test\": \"test\"\n  },\n  \"scripts\": {\n    \"test\": \"mocha --reporter spec\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/TooTallNate/file-uri-to-path.git\"\n  },\n  \"keywords\": [\n    \"file\",\n    \"uri\",\n    \"convert\",\n    \"path\"\n  ],\n  \"author\": \"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/TooTallNate/file-uri-to-path/issues\"\n  },\n  \"homepage\": \"https://github.com/TooTallNate/file-uri-to-path\",\n  \"devDependencies\": {\n    \"mocha\": \"3\"\n  }\n}\nexports.fullRoots = function (index, result) {\n  if (index & 1) throw new Error('You can only look up roots for depth(0) blocks')\n  if (!result) result = []\n\n  index /= 2\n\n  let offset = 0\n  let factor = 1\n\n  while (true) {\n    if (!index) return result\n    while (factor * 2 <= index) factor *= 2\n    result.push(offset + factor - 1)\n    offset = offset + 2 * factor\n    index -= factor\n    factor = 1\n  }\n}\n\nexports.futureRoots = function (index, result) {\n  if (index & 1) throw new Error('You can only look up future roots for depth(0) blocks')\n  if (!result) result = []\n\n  let factor = 1\n\n  // make first root\n  while (factor * 2 <= index) factor *= 2\n\n  // full factor of 2 - done\n  if (factor * 2 - 2 === index) return result\n\n  let pos = factor / 2 - 1\n\n  // while its not a full tree\n  while ((pos + factor / 2 - 1) !== index) {\n    pos += factor\n\n    // read too far, to to left child\n    while ((pos + factor / 2 - 1) > index) {\n      factor /= 2\n      pos -= factor / 2\n    }\n\n    // the \"gap\" is a future root\n    result.push(pos - factor / 2)\n  }\n\n  return result\n}\n\nexports.patch = function (from, to) {\n  if (from === 0 || from >= to) return []\n\n  const roots = exports.fullRoots(from)\n  const target = exports.fullRoots(to)\n\n  // first find the first root that is different\n\n  let i = 0\n  for (; i < target.length; i++) {\n    if (i >= roots.length || roots[i] !== target[i]) break\n  }\n\n  const patch = []\n\n  if (i < roots.length) {\n    // now we need to grow the newest root until it hits the diff one\n    let prev = roots.length - 1\n\n    const ite = exports.iterator(roots[prev--])\n\n    while (ite.index !== target[i]) {\n      ite.sibling()\n\n      if (prev >= 0 && ite.index === roots[prev]) {\n        prev--\n      } else {\n        patch.push(ite.index)\n      }\n\n      patch.push(ite.parent())\n    }\n\n    i++ // patched to next root, so inc\n  }\n\n  // include the rest\n\n  for (; i < target.length; i++) patch.push(target[i])\n\n  return patch\n}\n\nexports.depth = function (index) {\n  let depth = 0\n\n  index += 1\n  while (!(index & 1)) {\n    depth++\n    index = rightShift(index)\n  }\n\n  return depth\n}\n\nexports.sibling = function (index, depth) {\n  if (!depth) depth = exports.depth(index)\n  const offset = exports.offset(index, depth)\n\n  return exports.index(depth, offset & 1 ? offset - 1 : offset + 1)\n}\n\nexports.parent = function (index, depth) {\n  if (!depth) depth = exports.depth(index)\n  const offset = exports.offset(index, depth)\n\n  return exports.index(depth + 1, rightShift(offset))\n}\n\nexports.leftChild = function (index, depth) {\n  if (!(index & 1)) return -1\n  if (!depth) depth = exports.depth(index)\n  return exports.index(depth - 1, exports.offset(index, depth) * 2)\n}\n\nexports.rightChild = function (index, depth) {\n  if (!(index & 1)) return -1\n  if (!depth) depth = exports.depth(index)\n  return exports.index(depth - 1, 1 + (exports.offset(index, depth) * 2))\n}\n\nexports.children = function (index, depth) {\n  if (!(index & 1)) return null\n\n  if (!depth) depth = exports.depth(index)\n  const offset = exports.offset(index, depth) * 2\n\n  return [\n    exports.index(depth - 1, offset),\n    exports.index(depth - 1, offset + 1)\n  ]\n}\n\nexports.leftSpan = function (index, depth) {\n  if (!(index & 1)) return index\n  if (!depth) depth = exports.depth(index)\n  return exports.offset(index, depth) * twoPow(depth + 1)\n}\n\nexports.rightSpan = function (index, depth) {\n  if (!(index & 1)) return index\n  if (!depth) depth = exports.depth(index)\n  return (exports.offset(index, depth) + 1) * twoPow(depth + 1) - 2\n}\n\nexports.nextLeaf = function (index) {\n  let factor = 1\n  let r = index\n\n  while ((r & 1) === 1) {\n    r = (r - 1) / 2\n    factor *= 2\n  }\n\n  return index + factor + 1\n}\n\nexports.count = function (index, depth) {\n  if (!(index & 1)) return 1\n  if (!depth) depth = exports.depth(index)\n  return twoPow(depth + 1) - 1\n}\n\nexports.countLeaves = function (index) {\n  return (exports.count(index) + 1) / 2\n}\n\nexports.spans = function (index, depth) {\n  if (!(index & 1)) return [index, index]\n  if (!depth) depth = exports.depth(index)\n\n  const offset = exports.offset(index, depth)\n  const width = twoPow(depth + 1)\n\n  return [offset * width, (offset + 1) * width - 2]\n}\n\nexports.index = function (depth, offset) {\n  return (1 + 2 * offset) * twoPow(depth) - 1\n}\n\nexports.offset = function (index, depth) {\n  if (!(index & 1)) return index / 2\n  if (!depth) depth = exports.depth(index)\n\n  return ((index + 1) / twoPow(depth) - 1) / 2\n}\n\nexports.iterator = function (index) {\n  const ite = new Iterator()\n  ite.seek(index || 0)\n  return ite\n}\n\nfunction twoPow (n) {\n  return n < 31 ? 1 << n : ((1 << 30) * (1 << (n - 30)))\n}\n\nfunction rightShift (n) {\n  return (n - (n & 1)) / 2\n}\n\nfunction Iterator () {\n  this.index = 0\n  this.offset = 0\n  this.factor = 0\n}\n\nIterator.prototype.seek = function (index) {\n  this.index = index\n  if (this.index & 1) {\n    this.offset = exports.offset(index)\n    this.factor = twoPow(exports.depth(index) + 1)\n  } else {\n    this.offset = index / 2\n    this.factor = 2\n  }\n}\n\nIterator.prototype.isLeft = function () {\n  return (this.offset & 1) === 0\n}\n\nIterator.prototype.isRight = function () {\n  return (this.offset & 1) === 1\n}\n\nIterator.prototype.isRoot = function (length) {\n  const currentLength = 1 + (this.index + this.factor / 2 - 1) / 2\n  if (length < currentLength) return false\n\n  const factor = this.factor * 2\n  const index = (this.offset & 1)\n    ? this.index - this.factor / 2\n    : this.index + this.factor / 2\n\n  const parentLength = 1 + (index + factor / 2 - 1) / 2\n  return parentLength > length\n}\n\nIterator.prototype.contains = function (index) {\n  return index > this.index\n    ? index < (this.index + this.factor / 2)\n    : index < this.index\n      ? index > (this.index - this.factor / 2)\n      : true\n}\n\nIterator.prototype.prev = function () {\n  if (!this.offset) return this.index\n  this.offset--\n  this.index -= this.factor\n  return this.index\n}\n\nIterator.prototype.next = function () {\n  this.offset++\n  this.index += this.factor\n  return this.index\n}\n\nIterator.prototype.count = function () {\n  if (!(this.index & 1)) return 1\n  return this.factor - 1\n}\n\nIterator.prototype.countLeaves = function () {\n  return (this.count() + 1) / 2\n}\n\nIterator.prototype.sibling = function () {\n  return this.isLeft() ? this.next() : this.prev()\n}\n\nIterator.prototype.parent = function () {\n  if (this.offset & 1) {\n    this.index -= this.factor / 2\n    this.offset = (this.offset - 1) / 2\n  } else {\n    this.index += this.factor / 2\n    this.offset /= 2\n  }\n  this.factor *= 2\n  return this.index\n}\n\nIterator.prototype.leftSpan = function () {\n  this.index = this.index - this.factor / 2 + 1\n  this.offset = this.index / 2\n  this.factor = 2\n  return this.index\n}\n\nIterator.prototype.peekLeftSpan = function () {\n  return this.index - this.factor / 2 + 1\n}\n\nIterator.prototype.rightSpan = function () {\n  this.index = this.index + this.factor / 2 - 1\n  this.offset = this.index / 2\n  this.factor = 2\n  return this.index\n}\n\nIterator.prototype.peekRightSpan = function () {\n  return this.index + this.factor / 2 - 1\n}\n\nIterator.prototype.leftChild = function () {\n  if (this.factor === 2) return this.index\n  this.factor /= 2\n  this.index -= this.factor / 2\n  this.offset *= 2\n  return this.index\n}\n\nIterator.prototype.rightChild = function () {\n  if (this.factor === 2) return this.index\n  this.factor /= 2\n  this.index += this.factor / 2\n  this.offset = 2 * this.offset + 1\n  return this.index\n}\n\nIterator.prototype.nextTree = function () {\n  this.index = this.index + this.factor / 2 + 1\n  this.offset = this.index / 2\n  this.factor = 2\n  return this.index\n}\n\nIterator.prototype.prevTree = function () {\n  if (!this.offset) {\n    this.index = 0\n    this.factor = 2\n  } else {\n    this.index = this.index - this.factor / 2 - 1\n    this.offset = this.index / 2\n    this.factor = 2\n  }\n  return this.index\n}\n\nIterator.prototype.fullRoot = function (index) {\n  if (index <= this.index || (this.index & 1) > 0) return false\n  while (index > this.index + this.factor + this.factor / 2) {\n    this.index += this.factor / 2\n    this.factor *= 2\n    this.offset /= 2\n  }\n  return true\n}\n{\n  \"name\": \"flat-tree\",\n  \"version\": \"1.13.0\",\n  \"description\": \"A series of functions to map a binary tree to a list\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"standard\": \"^17.1.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/flat-tree.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/flat-tree/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/flat-tree\"\n}\nrequire.addon = require('require-addon')\n\nmodule.exports = require.addon('.', __filename)\nconst { isWindows } = require('which-runtime')\nconst binding = require('./binding')\n\nfunction onwork(err, result) {\n  if (err) this.reject(err)\n  else this.resolve(result)\n}\n\nexports.tryLock = function tryLock(fd, offset = 0, length = 0, opts = {}) {\n  if (typeof offset === 'object') {\n    opts = offset\n    offset = 0\n  }\n\n  if (typeof length === 'object') {\n    opts = length\n    length = 0\n  }\n\n  if (typeof opts !== 'object' || opts === null) {\n    opts = {}\n  }\n\n  try {\n    binding.tryLock(fd, offset, length, opts.shared !== true)\n  } catch (err) {\n    if (err.code === 'EAGAIN') return false\n    throw err\n  }\n\n  return true\n}\n\nexports.waitForLock = function waitForLock(\n  fd,\n  offset = 0,\n  length = 0,\n  opts = {}\n) {\n  if (typeof offset === 'object') {\n    opts = offset\n    offset = 0\n  }\n\n  if (typeof length === 'object') {\n    opts = length\n    length = 0\n  }\n\n  if (typeof opts !== 'object' || opts === null) {\n    opts = {}\n  }\n\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.waitForLock(\n      fd,\n      offset,\n      length,\n      opts.shared !== true,\n      req,\n      onwork\n    )\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n\nexports.tryDowngradeLock = function tryDowngradeLock(\n  fd,\n  offset = 0,\n  length = 0\n) {\n  try {\n    binding.tryDowngradeLock(fd, offset, length)\n  } catch (err) {\n    if (err.code === 'EAGAIN') return false\n    throw err\n  }\n\n  return true\n}\n\nexports.waitForDowngradeLock = function downgradeLock(\n  fd,\n  offset = 0,\n  length = 0\n) {\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.waitForDowngradeLock(fd, offset, length, req, onwork)\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n\nexports.tryUpgradeLock = function tryUpgradeLock(fd, offset = 0, length = 0) {\n  try {\n    binding.tryUpgradeLock(fd, offset, length)\n  } catch (err) {\n    if (err.code === 'EAGAIN') return false\n    throw err\n  }\n\n  return true\n}\n\nexports.waitForUpgradeLock = function upgradeLock(fd, offset = 0, length = 0) {\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.waitForUpgradeLock(fd, offset, length, req, onwork)\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n\nexports.unlock = function unlock(fd, offset = 0, length = 0) {\n  binding.unlock(fd, offset, length)\n}\n\nexports.trim = function trim(fd, offset, length) {\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.trim(fd, offset, length, req, onwork)\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n\nexports.sparse = function sparse(fd) {\n  // Short circuit on everything but Windows\n  if (!isWindows) return Promise.resolve()\n\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.sparse(fd, req, onwork)\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n\nexports.swap = function swap(from, to) {\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.swap(from, to, req, onwork)\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n\nexports.getAttr = function getAttr(fd, name) {\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.getAttr(fd, name, req, onwork)\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise.then((buffer) =>\n    buffer === null ? null : Buffer.from(buffer)\n  )\n}\n\nexports.setAttr = function setAttr(fd, name, value, encoding) {\n  if (typeof value === 'string') value = Buffer.from(value, encoding)\n\n  const req = {\n    value,\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.setAttr(\n      fd,\n      name,\n      value.buffer,\n      value.byteOffset,\n      value.byteLength,\n      req,\n      onwork\n    )\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n\nexports.removeAttr = function removeAttr(fd, name) {\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.removeAttr(fd, name, req, onwork)\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n\nexports.listAttrs = function listAttrs(fd) {\n  const req = {\n    handle: null,\n    resolve: null,\n    reject: null\n  }\n\n  const promise = new Promise((resolve, reject) => {\n    req.resolve = resolve\n    req.reject = reject\n  })\n\n  try {\n    req.handle = binding.listAttrs(fd, req, onwork)\n  } catch (err) {\n    return Promise.reject(err)\n  }\n\n  return promise\n}\n{\n  \"name\": \"fs-native-extensions\",\n  \"version\": \"1.4.5\",\n  \"description\": \"Native file system extensions for advanced file operations\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"macros.h\",\n    \"binding.c\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"include\",\n    \"src\",\n    \"prebuilds\"\n  ],\n  \"imports\": {\n    \"child_process\": {\n      \"bare\": \"bare-subprocess\",\n      \"default\": \"child_process\"\n    },\n    \"fs\": {\n      \"bare\": \"bare-fs\",\n      \"default\": \"fs\"\n    },\n    \"fs/*\": {\n      \"bare\": \"bare-fs/*\",\n      \"default\": \"fs/*\"\n    },\n    \"path\": {\n      \"bare\": \"bare-path\",\n      \"default\": \"path\"\n    }\n  },\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"npm run lint && npm run test:bare && npm run test:node\",\n    \"test:bare\": \"bare test.js\",\n    \"test:node\": \"node test.js\",\n    \"lint\": \"prettier . --check\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/fs-native-extensions.git\"\n  },\n  \"author\": \"Kasper Isager Dalsgarð <kasper@funktionel.co>\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/fs-native-extensions/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/fs-native-extensions#readme\",\n  \"dependencies\": {\n    \"require-addon\": \"^1.1.0\",\n    \"which-runtime\": \"^1.2.0\"\n  },\n  \"devDependencies\": {\n    \"bare-compat-napi\": \"^1.3.8\",\n    \"bare-fs\": \"^4.4.4\",\n    \"bare-path\": \"^3.0.0\",\n    \"bare-subprocess\": \"^4.0.5\",\n    \"brittle\": \"^3.1.1\",\n    \"cmake-bare\": \"^1.1.10\",\n    \"cmake-fetch\": \"^1.4.7\",\n    \"cmake-napi\": \"^1.0.5\",\n    \"cmake-npm\": \"^1.1.0\",\n    \"minimist\": \"^1.2.6\",\n    \"prettier\": \"^3.5.3\",\n    \"prettier-config-standard\": \"^7.0.0\",\n    \"test-tmp\": \"^1.2.1\"\n  }\n}\nvar hash = exports;\n\nhash.utils = require('./hash/utils');\nhash.common = require('./hash/common');\nhash.sha = require('./hash/sha');\nhash.ripemd = require('./hash/ripemd');\nhash.hmac = require('./hash/hmac');\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n  this.pending = null;\n  this.pendingTotal = 0;\n  this.blockSize = this.constructor.blockSize;\n  this.outSize = this.constructor.outSize;\n  this.hmacStrength = this.constructor.hmacStrength;\n  this.padLength = this.constructor.padLength / 8;\n  this.endian = 'big';\n\n  this._delta8 = this.blockSize / 8;\n  this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n  // Convert message to array, pad it, and join into 32bit blocks\n  msg = utils.toArray(msg, enc);\n  if (!this.pending)\n    this.pending = msg;\n  else\n    this.pending = this.pending.concat(msg);\n  this.pendingTotal += msg.length;\n\n  // Enough data, try updating\n  if (this.pending.length >= this._delta8) {\n    msg = this.pending;\n\n    // Process pending data in blocks\n    var r = msg.length % this._delta8;\n    this.pending = msg.slice(msg.length - r, msg.length);\n    if (this.pending.length === 0)\n      this.pending = null;\n\n    msg = utils.join32(msg, 0, msg.length - r, this.endian);\n    for (var i = 0; i < msg.length; i += this._delta32)\n      this._update(msg, i, i + this._delta32);\n  }\n\n  return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n  this.update(this._pad());\n  assert(this.pending === null);\n\n  return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n  var len = this.pendingTotal;\n  var bytes = this._delta8;\n  var k = bytes - ((len + this.padLength) % bytes);\n  var res = new Array(k + this.padLength);\n  res[0] = 0x80;\n  for (var i = 1; i < k; i++)\n    res[i] = 0;\n\n  // Append length\n  len <<= 3;\n  if (this.endian === 'big') {\n    for (var t = 8; t < this.padLength; t++)\n      res[i++] = 0;\n\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = (len >>> 24) & 0xff;\n    res[i++] = (len >>> 16) & 0xff;\n    res[i++] = (len >>> 8) & 0xff;\n    res[i++] = len & 0xff;\n  } else {\n    res[i++] = len & 0xff;\n    res[i++] = (len >>> 8) & 0xff;\n    res[i++] = (len >>> 16) & 0xff;\n    res[i++] = (len >>> 24) & 0xff;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n\n    for (t = 8; t < this.padLength; t++)\n      res[i++] = 0;\n  }\n\n  return res;\n};\n'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction Hmac(hash, key, enc) {\n  if (!(this instanceof Hmac))\n    return new Hmac(hash, key, enc);\n  this.Hash = hash;\n  this.blockSize = hash.blockSize / 8;\n  this.outSize = hash.outSize / 8;\n  this.inner = null;\n  this.outer = null;\n\n  this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n  // Shorten key, if needed\n  if (key.length > this.blockSize)\n    key = new this.Hash().update(key).digest();\n  assert(key.length <= this.blockSize);\n\n  // Add padding to key\n  for (var i = key.length; i < this.blockSize; i++)\n    key.push(0);\n\n  for (i = 0; i < key.length; i++)\n    key[i] ^= 0x36;\n  this.inner = new this.Hash().update(key);\n\n  // 0x36 ^ 0x5c = 0x6a\n  for (i = 0; i < key.length; i++)\n    key[i] ^= 0x6a;\n  this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n  this.inner.update(msg, enc);\n  return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n  this.outer.update(this.inner.digest());\n  return this.outer.digest(enc);\n};\n'use strict';\n\nvar utils = require('./utils');\nvar common = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n  if (!(this instanceof RIPEMD160))\n    return new RIPEMD160();\n\n  BlockHash.call(this);\n\n  this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n  this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n  var A = this.h[0];\n  var B = this.h[1];\n  var C = this.h[2];\n  var D = this.h[3];\n  var E = this.h[4];\n  var Ah = A;\n  var Bh = B;\n  var Ch = C;\n  var Dh = D;\n  var Eh = E;\n  for (var j = 0; j < 80; j++) {\n    var T = sum32(\n      rotl32(\n        sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n        s[j]),\n      E);\n    A = E;\n    E = D;\n    D = rotl32(C, 10);\n    C = B;\n    B = T;\n    T = sum32(\n      rotl32(\n        sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n        sh[j]),\n      Eh);\n    Ah = Eh;\n    Eh = Dh;\n    Dh = rotl32(Ch, 10);\n    Ch = Bh;\n    Bh = T;\n  }\n  T = sum32_3(this.h[1], C, Dh);\n  this.h[1] = sum32_3(this.h[2], D, Eh);\n  this.h[2] = sum32_3(this.h[3], E, Ah);\n  this.h[3] = sum32_3(this.h[4], A, Bh);\n  this.h[4] = sum32_3(this.h[0], B, Ch);\n  this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'little');\n  else\n    return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n  if (j <= 15)\n    return x ^ y ^ z;\n  else if (j <= 31)\n    return (x & y) | ((~x) & z);\n  else if (j <= 47)\n    return (x | (~y)) ^ z;\n  else if (j <= 63)\n    return (x & z) | (y & (~z));\n  else\n    return x ^ (y | (~z));\n}\n\nfunction K(j) {\n  if (j <= 15)\n    return 0x00000000;\n  else if (j <= 31)\n    return 0x5a827999;\n  else if (j <= 47)\n    return 0x6ed9eba1;\n  else if (j <= 63)\n    return 0x8f1bbcdc;\n  else\n    return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n  if (j <= 15)\n    return 0x50a28be6;\n  else if (j <= 31)\n    return 0x5c4dd124;\n  else if (j <= 47)\n    return 0x6d703ef3;\n  else if (j <= 63)\n    return 0x7a6d76e9;\n  else\n    return 0x00000000;\n}\n\nvar r = [\n  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n  7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n  3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n  1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n  4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n  5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n  6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n  15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n  8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n  12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n  11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n  7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n  11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n  11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n  9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n  8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n  9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n  9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n  15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n  8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n'use strict';\n\nexports.sha1 = require('./sha/1');\nexports.sha224 = require('./sha/224');\nexports.sha256 = require('./sha/256');\nexports.sha384 = require('./sha/384');\nexports.sha512 = require('./sha/512');\n'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\n\nvar sha1_K = [\n  0x5A827999, 0x6ED9EBA1,\n  0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA1() {\n  if (!(this instanceof SHA1))\n    return new SHA1();\n\n  BlockHash.call(this);\n  this.h = [\n    0x67452301, 0xefcdab89, 0x98badcfe,\n    0x10325476, 0xc3d2e1f0 ];\n  this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n  var W = this.W;\n\n  for (var i = 0; i < 16; i++)\n    W[i] = msg[start + i];\n\n  for(; i < W.length; i++)\n    W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n\n  var a = this.h[0];\n  var b = this.h[1];\n  var c = this.h[2];\n  var d = this.h[3];\n  var e = this.h[4];\n\n  for (i = 0; i < W.length; i++) {\n    var s = ~~(i / 20);\n    var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n    e = d;\n    d = c;\n    c = rotl32(b, 30);\n    b = a;\n    a = t;\n  }\n\n  this.h[0] = sum32(this.h[0], a);\n  this.h[1] = sum32(this.h[1], b);\n  this.h[2] = sum32(this.h[2], c);\n  this.h[3] = sum32(this.h[3], d);\n  this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n'use strict';\n\nvar utils = require('../utils');\nvar SHA256 = require('./256');\n\nfunction SHA224() {\n  if (!(this instanceof SHA224))\n    return new SHA224();\n\n  SHA256.call(this);\n  this.h = [\n    0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n    0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n  // Just truncate output\n  if (enc === 'hex')\n    return utils.toHex32(this.h.slice(0, 7), 'big');\n  else\n    return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n  0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n  0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n  0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n  0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n  0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n  0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n  0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n  0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n  0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n  0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n  0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n  0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n  0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n  0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n  0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n  0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n  if (!(this instanceof SHA256))\n    return new SHA256();\n\n  BlockHash.call(this);\n  this.h = [\n    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n    0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n  ];\n  this.k = sha256_K;\n  this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n  var W = this.W;\n\n  for (var i = 0; i < 16; i++)\n    W[i] = msg[start + i];\n  for (; i < W.length; i++)\n    W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n  var a = this.h[0];\n  var b = this.h[1];\n  var c = this.h[2];\n  var d = this.h[3];\n  var e = this.h[4];\n  var f = this.h[5];\n  var g = this.h[6];\n  var h = this.h[7];\n\n  assert(this.k.length === W.length);\n  for (i = 0; i < W.length; i++) {\n    var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n    var T2 = sum32(s0_256(a), maj32(a, b, c));\n    h = g;\n    g = f;\n    f = e;\n    e = sum32(d, T1);\n    d = c;\n    c = b;\n    b = a;\n    a = sum32(T1, T2);\n  }\n\n  this.h[0] = sum32(this.h[0], a);\n  this.h[1] = sum32(this.h[1], b);\n  this.h[2] = sum32(this.h[2], c);\n  this.h[3] = sum32(this.h[3], d);\n  this.h[4] = sum32(this.h[4], e);\n  this.h[5] = sum32(this.h[5], f);\n  this.h[6] = sum32(this.h[6], g);\n  this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n'use strict';\n\nvar utils = require('../utils');\n\nvar SHA512 = require('./512');\n\nfunction SHA384() {\n  if (!(this instanceof SHA384))\n    return new SHA384();\n\n  SHA512.call(this);\n  this.h = [\n    0xcbbb9d5d, 0xc1059ed8,\n    0x629a292a, 0x367cd507,\n    0x9159015a, 0x3070dd17,\n    0x152fecd8, 0xf70e5939,\n    0x67332667, 0xffc00b31,\n    0x8eb44a87, 0x68581511,\n    0xdb0c2e0d, 0x64f98fa7,\n    0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h.slice(0, 12), 'big');\n  else\n    return utils.split32(this.h.slice(0, 12), 'big');\n};\n'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar assert = require('minimalistic-assert');\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n  if (!(this instanceof SHA512))\n    return new SHA512();\n\n  BlockHash.call(this);\n  this.h = [\n    0x6a09e667, 0xf3bcc908,\n    0xbb67ae85, 0x84caa73b,\n    0x3c6ef372, 0xfe94f82b,\n    0xa54ff53a, 0x5f1d36f1,\n    0x510e527f, 0xade682d1,\n    0x9b05688c, 0x2b3e6c1f,\n    0x1f83d9ab, 0xfb41bd6b,\n    0x5be0cd19, 0x137e2179 ];\n  this.k = sha512_K;\n  this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n  var W = this.W;\n\n  // 32 x 32bit words\n  for (var i = 0; i < 32; i++)\n    W[i] = msg[start + i];\n  for (; i < W.length; i += 2) {\n    var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);  // i - 2\n    var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n    var c1_hi = W[i - 14];  // i - 7\n    var c1_lo = W[i - 13];\n    var c2_hi = g0_512_hi(W[i - 30], W[i - 29]);  // i - 15\n    var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n    var c3_hi = W[i - 32];  // i - 16\n    var c3_lo = W[i - 31];\n\n    W[i] = sum64_4_hi(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo);\n    W[i + 1] = sum64_4_lo(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo);\n  }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n  this._prepareBlock(msg, start);\n\n  var W = this.W;\n\n  var ah = this.h[0];\n  var al = this.h[1];\n  var bh = this.h[2];\n  var bl = this.h[3];\n  var ch = this.h[4];\n  var cl = this.h[5];\n  var dh = this.h[6];\n  var dl = this.h[7];\n  var eh = this.h[8];\n  var el = this.h[9];\n  var fh = this.h[10];\n  var fl = this.h[11];\n  var gh = this.h[12];\n  var gl = this.h[13];\n  var hh = this.h[14];\n  var hl = this.h[15];\n\n  assert(this.k.length === W.length);\n  for (var i = 0; i < W.length; i += 2) {\n    var c0_hi = hh;\n    var c0_lo = hl;\n    var c1_hi = s1_512_hi(eh, el);\n    var c1_lo = s1_512_lo(eh, el);\n    var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n    var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n    var c3_hi = this.k[i];\n    var c3_lo = this.k[i + 1];\n    var c4_hi = W[i];\n    var c4_lo = W[i + 1];\n\n    var T1_hi = sum64_5_hi(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo,\n      c4_hi, c4_lo);\n    var T1_lo = sum64_5_lo(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo,\n      c4_hi, c4_lo);\n\n    c0_hi = s0_512_hi(ah, al);\n    c0_lo = s0_512_lo(ah, al);\n    c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n    c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n    var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n    var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n    hh = gh;\n    hl = gl;\n\n    gh = fh;\n    gl = fl;\n\n    fh = eh;\n    fl = el;\n\n    eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n    el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n    dh = ch;\n    dl = cl;\n\n    ch = bh;\n    cl = bl;\n\n    bh = ah;\n    bl = al;\n\n    ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n    al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n  }\n\n  sum64(this.h, 0, ah, al);\n  sum64(this.h, 2, bh, bl);\n  sum64(this.h, 4, ch, cl);\n  sum64(this.h, 6, dh, dl);\n  sum64(this.h, 8, eh, el);\n  sum64(this.h, 10, fh, fl);\n  sum64(this.h, 12, gh, gl);\n  sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n  var r = (xh & yh) ^ ((~xh) & zh);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n  var r = (xl & yl) ^ ((~xl) & zl);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n  var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n  var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 28);\n  var c1_hi = rotr64_hi(xl, xh, 2);  // 34\n  var c2_hi = rotr64_hi(xl, xh, 7);  // 39\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 28);\n  var c1_lo = rotr64_lo(xl, xh, 2);  // 34\n  var c2_lo = rotr64_lo(xl, xh, 7);  // 39\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 14);\n  var c1_hi = rotr64_hi(xh, xl, 18);\n  var c2_hi = rotr64_hi(xl, xh, 9);  // 41\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 14);\n  var c1_lo = rotr64_lo(xh, xl, 18);\n  var c2_lo = rotr64_lo(xl, xh, 9);  // 41\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 1);\n  var c1_hi = rotr64_hi(xh, xl, 8);\n  var c2_hi = shr64_hi(xh, xl, 7);\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 1);\n  var c1_lo = rotr64_lo(xh, xl, 8);\n  var c2_lo = shr64_lo(xh, xl, 7);\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 19);\n  var c1_hi = rotr64_hi(xl, xh, 29);  // 61\n  var c2_hi = shr64_hi(xh, xl, 6);\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 19);\n  var c1_lo = rotr64_lo(xl, xh, 29);  // 61\n  var c2_lo = shr64_lo(xh, xl, 6);\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n  if (s === 0)\n    return ch32(x, y, z);\n  if (s === 1 || s === 3)\n    return p32(x, y, z);\n  if (s === 2)\n    return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n  return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n  return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n  return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n  return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n  return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n  return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n  return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction isSurrogatePair(msg, i) {\n  if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {\n    return false;\n  }\n  if (i < 0 || i + 1 >= msg.length) {\n    return false;\n  }\n  return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;\n}\n\nfunction toArray(msg, enc) {\n  if (Array.isArray(msg))\n    return msg.slice();\n  if (!msg)\n    return [];\n  var res = [];\n  if (typeof msg === 'string') {\n    if (!enc) {\n      // Inspired by stringToUtf8ByteArray() in closure-library by Google\n      // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143\n      // Apache License 2.0\n      // https://github.com/google/closure-library/blob/master/LICENSE\n      var p = 0;\n      for (var i = 0; i < msg.length; i++) {\n        var c = msg.charCodeAt(i);\n        if (c < 128) {\n          res[p++] = c;\n        } else if (c < 2048) {\n          res[p++] = (c >> 6) | 192;\n          res[p++] = (c & 63) | 128;\n        } else if (isSurrogatePair(msg, i)) {\n          c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);\n          res[p++] = (c >> 18) | 240;\n          res[p++] = ((c >> 12) & 63) | 128;\n          res[p++] = ((c >> 6) & 63) | 128;\n          res[p++] = (c & 63) | 128;\n        } else {\n          res[p++] = (c >> 12) | 224;\n          res[p++] = ((c >> 6) & 63) | 128;\n          res[p++] = (c & 63) | 128;\n        }\n      }\n    } else if (enc === 'hex') {\n      msg = msg.replace(/[^a-z0-9]+/ig, '');\n      if (msg.length % 2 !== 0)\n        msg = '0' + msg;\n      for (i = 0; i < msg.length; i += 2)\n        res.push(parseInt(msg[i] + msg[i + 1], 16));\n    }\n  } else {\n    for (i = 0; i < msg.length; i++)\n      res[i] = msg[i] | 0;\n  }\n  return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++)\n    res += zero2(msg[i].toString(16));\n  return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n  var res = (w >>> 24) |\n            ((w >>> 8) & 0xff00) |\n            ((w << 8) & 0xff0000) |\n            ((w & 0xff) << 24);\n  return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++) {\n    var w = msg[i];\n    if (endian === 'little')\n      w = htonl(w);\n    res += zero8(w.toString(16));\n  }\n  return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n  if (word.length === 1)\n    return '0' + word;\n  else\n    return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n  if (word.length === 7)\n    return '0' + word;\n  else if (word.length === 6)\n    return '00' + word;\n  else if (word.length === 5)\n    return '000' + word;\n  else if (word.length === 4)\n    return '0000' + word;\n  else if (word.length === 3)\n    return '00000' + word;\n  else if (word.length === 2)\n    return '000000' + word;\n  else if (word.length === 1)\n    return '0000000' + word;\n  else\n    return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n  var len = end - start;\n  assert(len % 4 === 0);\n  var res = new Array(len / 4);\n  for (var i = 0, k = start; i < res.length; i++, k += 4) {\n    var w;\n    if (endian === 'big')\n      w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n    else\n      w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n    res[i] = w >>> 0;\n  }\n  return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n  var res = new Array(msg.length * 4);\n  for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n    var m = msg[i];\n    if (endian === 'big') {\n      res[k] = m >>> 24;\n      res[k + 1] = (m >>> 16) & 0xff;\n      res[k + 2] = (m >>> 8) & 0xff;\n      res[k + 3] = m & 0xff;\n    } else {\n      res[k + 3] = m >>> 24;\n      res[k + 2] = (m >>> 16) & 0xff;\n      res[k + 1] = (m >>> 8) & 0xff;\n      res[k] = m & 0xff;\n    }\n  }\n  return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n  return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n  return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n  return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n  return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n  return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n  return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n  var bh = buf[pos];\n  var bl = buf[pos + 1];\n\n  var lo = (al + bl) >>> 0;\n  var hi = (lo < al ? 1 : 0) + ah + bh;\n  buf[pos] = hi >>> 0;\n  buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n  var lo = (al + bl) >>> 0;\n  var hi = (lo < al ? 1 : 0) + ah + bh;\n  return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n  var lo = al + bl;\n  return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n  var carry = 0;\n  var lo = al;\n  lo = (lo + bl) >>> 0;\n  carry += lo < al ? 1 : 0;\n  lo = (lo + cl) >>> 0;\n  carry += lo < cl ? 1 : 0;\n  lo = (lo + dl) >>> 0;\n  carry += lo < dl ? 1 : 0;\n\n  var hi = ah + bh + ch + dh + carry;\n  return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n  var lo = al + bl + cl + dl;\n  return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n  var carry = 0;\n  var lo = al;\n  lo = (lo + bl) >>> 0;\n  carry += lo < al ? 1 : 0;\n  lo = (lo + cl) >>> 0;\n  carry += lo < cl ? 1 : 0;\n  lo = (lo + dl) >>> 0;\n  carry += lo < dl ? 1 : 0;\n  lo = (lo + el) >>> 0;\n  carry += lo < el ? 1 : 0;\n\n  var hi = ah + bh + ch + dh + eh + carry;\n  return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n  var lo = al + bl + cl + dl + el;\n\n  return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n  var r = (al << (32 - num)) | (ah >>> num);\n  return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n  var r = (ah << (32 - num)) | (al >>> num);\n  return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n  return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n  var r = (ah << (32 - num)) | (al >>> num);\n  return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n{\n  \"name\": \"hash.js\",\n  \"version\": \"1.1.7\",\n  \"description\": \"Various hash functions that could be run by both browser and node\",\n  \"main\": \"lib/hash.js\",\n  \"typings\": \"lib/hash.d.ts\",\n  \"scripts\": {\n    \"test\": \"mocha --reporter=spec test/*-test.js && npm run lint\",\n    \"lint\": \"eslint lib/*.js lib/**/*.js lib/**/**/*.js test/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git@github.com:indutny/hash.js\"\n  },\n  \"keywords\": [\n    \"hash\",\n    \"sha256\",\n    \"sha224\",\n    \"hmac\"\n  ],\n  \"author\": \"Fedor Indutny <fedor@indutny.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/indutny/hash.js/issues\"\n  },\n  \"homepage\": \"https://github.com/indutny/hash.js\",\n  \"dependencies\": {\n    \"inherits\": \"^2.0.3\",\n    \"minimalistic-assert\": \"^1.0.1\"\n  },\n  \"devDependencies\": {\n    \"eslint\": \"^4.19.1\",\n    \"mocha\": \"^5.2.0\"\n  }\n}\n'use strict';\n\nvar hash = require('hash.js');\nvar utils = require('minimalistic-crypto-utils');\nvar assert = require('minimalistic-assert');\n\nfunction HmacDRBG(options) {\n  if (!(this instanceof HmacDRBG))\n    return new HmacDRBG(options);\n  this.hash = options.hash;\n  this.predResist = !!options.predResist;\n\n  this.outLen = this.hash.outSize;\n  this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n  this._reseed = null;\n  this.reseedInterval = null;\n  this.K = null;\n  this.V = null;\n\n  var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');\n  var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');\n  var pers = utils.toArray(options.pers, options.persEnc || 'hex');\n  assert(entropy.length >= (this.minEntropy / 8),\n         'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n  this._init(entropy, nonce, pers);\n}\nmodule.exports = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n  var seed = entropy.concat(nonce).concat(pers);\n\n  this.K = new Array(this.outLen / 8);\n  this.V = new Array(this.outLen / 8);\n  for (var i = 0; i < this.V.length; i++) {\n    this.K[i] = 0x00;\n    this.V[i] = 0x01;\n  }\n\n  this._update(seed);\n  this._reseed = 1;\n  this.reseedInterval = 0x1000000000000;  // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n  return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n  var kmac = this._hmac()\n                 .update(this.V)\n                 .update([ 0x00 ]);\n  if (seed)\n    kmac = kmac.update(seed);\n  this.K = kmac.digest();\n  this.V = this._hmac().update(this.V).digest();\n  if (!seed)\n    return;\n\n  this.K = this._hmac()\n               .update(this.V)\n               .update([ 0x01 ])\n               .update(seed)\n               .digest();\n  this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n  // Optional entropy enc\n  if (typeof entropyEnc !== 'string') {\n    addEnc = add;\n    add = entropyEnc;\n    entropyEnc = null;\n  }\n\n  entropy = utils.toArray(entropy, entropyEnc);\n  add = utils.toArray(add, addEnc);\n\n  assert(entropy.length >= (this.minEntropy / 8),\n         'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n  this._update(entropy.concat(add || []));\n  this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n  if (this._reseed > this.reseedInterval)\n    throw new Error('Reseed is required');\n\n  // Optional encoding\n  if (typeof enc !== 'string') {\n    addEnc = add;\n    add = enc;\n    enc = null;\n  }\n\n  // Optional additional data\n  if (add) {\n    add = utils.toArray(add, addEnc || 'hex');\n    this._update(add);\n  }\n\n  var temp = [];\n  while (temp.length < len) {\n    this.V = this._hmac().update(this.V).digest();\n    temp = temp.concat(this.V);\n  }\n\n  var res = temp.slice(0, len);\n  this._update(add);\n  this._reseed++;\n  return utils.encode(res, enc);\n};\n{\n  \"name\": \"hmac-drbg\",\n  \"version\": \"1.0.1\",\n  \"description\": \"Deterministic random bit generator (hmac)\",\n  \"main\": \"lib/hmac-drbg.js\",\n  \"scripts\": {\n    \"test\": \"mocha --reporter=spec test/*-test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+ssh://git@github.com/indutny/hmac-drbg.git\"\n  },\n  \"keywords\": [\n    \"hmac\",\n    \"drbg\",\n    \"prng\"\n  ],\n  \"author\": \"Fedor Indutny <fedor@indutny.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/indutny/hmac-drbg/issues\"\n  },\n  \"homepage\": \"https://github.com/indutny/hmac-drbg#readme\",\n  \"devDependencies\": {\n    \"mocha\": \"^3.2.0\"\n  },\n  \"dependencies\": {\n    \"hash.js\": \"^1.0.3\",\n    \"minimalistic-assert\": \"^1.0.0\",\n    \"minimalistic-crypto-utils\": \"^1.0.1\"\n  }\n}\nconst codecs = require('codecs')\nconst { Readable } = require('streamx')\nconst mutexify = require('mutexify/promise')\nconst b4a = require('b4a')\nconst safetyCatch = require('safety-catch')\nconst ReadyResource = require('ready-resource')\nconst debounce = require('debounceify')\nconst Rache = require('rache')\nconst rrp = require('resolve-reject-promise')\n\nconst { all: unslabAll } = require('unslab')\n\nconst RangeIterator = require('./iterators/range')\nconst HistoryIterator = require('./iterators/history')\nconst DiffIterator = require('./iterators/diff')\nconst LocalBlockIterator = require('./iterators/local')\nconst Extension = require('./lib/extension')\nconst { YoloIndex, Node, Header } = require('./lib/messages')\nconst { BLOCK_NOT_AVAILABLE, DECODING_ERROR } = require('hypercore-errors')\n\nconst T = 5\nconst MIN_KEYS = T - 1\nconst MAX_CHILDREN = MIN_KEYS * 2 + 1\n\nconst SEP = b4a.alloc(1)\nconst EMPTY = b4a.alloc(0)\n\nclass Key {\n  constructor (seq, value) {\n    this.seq = seq\n    this.value = value\n  }\n}\n\nclass Child {\n  constructor (seq, offset, value) {\n    this.seq = seq\n    this.offset = offset\n    this.value = value\n  }\n}\n\nclass Cache {\n  constructor (rache) {\n    this.keys = rache\n    this.length = 0\n  }\n\n  get (seq) {\n    return this.keys.get(seq) || null\n  }\n\n  set (seq, key) {\n    this.keys.set(seq, key)\n    if (seq >= this.length) this.length = seq + 1\n  }\n\n  gc (length) {\n    // if we need to \"work\" more than 128 ticks, just bust the cache...\n    if (this.length - length > 128) {\n      this.keys.clear()\n    } else {\n      for (let i = length; i < this.length; i++) {\n        this.keys.delete(i)\n      }\n    }\n\n    this.length = length\n  }\n\n  clear () {\n    this.keys.clear()\n  }\n}\n\nclass Pointers {\n  constructor (decoded) {\n    this.levels = decoded.levels.map(l => {\n      const children = []\n      const keys = []\n\n      for (let i = 0; i < l.keys.length; i++) {\n        keys.push(new Key(l.keys[i], null))\n      }\n\n      for (let i = 0; i < l.children.length; i += 2) {\n        children.push(new Child(l.children[i], l.children[i + 1], null))\n      }\n\n      return { keys, children }\n    })\n  }\n\n  get (i) {\n    return this.levels[i]\n  }\n\n  hasKey (seq) {\n    for (const lvl of this.levels) {\n      for (const key of lvl.keys) {\n        if (key.seq === seq) return true\n      }\n    }\n    return false\n  }\n}\n\nfunction inflate (entry) {\n  if (entry.inflated === null) {\n    entry.inflated = YoloIndex.decode(entry.index)\n    entry.index = null\n  }\n  return new Pointers(entry.inflated)\n}\n\nfunction deflate (index) {\n  const levels = index.map(l => {\n    const keys = []\n    const children = []\n\n    for (let i = 0; i < l.value.keys.length; i++) {\n      keys.push(l.value.keys[i].seq)\n    }\n\n    for (let i = 0; i < l.value.children.length; i++) {\n      children.push(l.value.children[i].seq, l.value.children[i].offset)\n    }\n\n    return { keys, children }\n  })\n\n  return YoloIndex.encode({ levels })\n}\n\nclass TreeNode {\n  constructor (block, keys, children, offset) {\n    this.block = block\n    this.offset = offset\n    this.keys = keys\n    this.children = children\n    this.changed = false\n\n    this.preload()\n  }\n\n  preload () {\n    if (this.block === null) return\n\n    const core = getBackingCore(this.block.tree.core)\n    if (!core) return\n\n    const bitfield = core.core.bitfield\n    const blocks = []\n\n    for (let i = 0; i < this.keys.length; i++) {\n      const k = this.keys[i]\n      if (k.value) continue\n      if (k.seq >= core.signedLength || (bitfield && bitfield.get(k.seq))) continue\n      blocks.push(k.seq)\n    }\n    for (let i = 0; i < this.children.length; i++) {\n      const c = this.children[i]\n      if (c.value) continue\n      if (c.seq >= core.signedLength || (bitfield && bitfield.get(c.seq))) continue\n      blocks.push(c.seq)\n    }\n\n    if (blocks.length) core.download({ blocks })\n  }\n\n  async insertKey (key, value, child, node, encoding, cas) {\n    let s = 0\n    let e = this.keys.length\n    let c\n\n    while (s < e) {\n      const mid = (s + e) >> 1\n      c = b4a.compare(key.value, await this.getKey(mid))\n\n      if (c === 0) {\n        if (cas) {\n          const prev = await this.getKeyNode(mid)\n          if (!(await cas(prev.final(encoding), node))) return true\n        }\n        if (!this.block.tree.tree.alwaysDuplicate) {\n          const prev = await this.getKeyNode(mid)\n          if (sameValue(prev.value, value)) return true\n        }\n        this.changed = true\n        this.keys[mid] = key\n        return true\n      }\n\n      if (c < 0) e = mid\n      else s = mid + 1\n    }\n\n    const i = c < 0 ? e : s\n    this.keys.splice(i, 0, key)\n    if (child) this.children.splice(i + 1, 0, new Child(0, 0, child))\n    this.changed = true\n\n    return this.keys.length < MAX_CHILDREN\n  }\n\n  removeKey (index) {\n    this.keys.splice(index, 1)\n    if (this.children.length) {\n      this.children[index + 1].seq = 0 // mark as freed\n      this.children.splice(index + 1, 1)\n    }\n    this.changed = true\n  }\n\n  async siblings (parent) {\n    for (let i = 0; i < parent.children.length; i++) {\n      if (parent.children[i].value === this) {\n        const [left, right] = await Promise.all([\n          i ? parent.getChildNode(i - 1) : null,\n          i < parent.children.length - 1 ? parent.getChildNode(i + 1) : null\n        ])\n        return { left, index: i, right }\n      }\n    }\n\n    throw new Error('Bad parent')\n  }\n\n  merge (node, median) {\n    this.changed = true\n    this.keys.push(median)\n    for (let i = 0; i < node.keys.length; i++) this.keys.push(node.keys[i])\n    for (let i = 0; i < node.children.length; i++) this.children.push(node.children[i])\n  }\n\n  async split () {\n    const len = this.keys.length >> 1\n    const right = TreeNode.create(this.block)\n\n    while (right.keys.length < len) right.keys.push(this.keys.pop())\n    right.keys.reverse()\n\n    await this.getKey(this.keys.length - 1) // make sure the median is loaded\n    const median = this.keys.pop()\n\n    if (this.children.length) {\n      while (right.children.length < len + 1) right.children.push(this.children.pop())\n      right.children.reverse()\n    }\n\n    this.changed = true\n\n    return {\n      left: this,\n      median,\n      right\n    }\n  }\n\n  getKeyNode (index) {\n    return this.block.tree.getBlock(this.keys[index].seq)\n  }\n\n  async getChildNode (index) {\n    const child = this.children[index]\n    if (child.value) return child.value\n    const block = child.seq === this.block.seq ? this.block : await this.block.tree.getBlock(child.seq)\n    return (child.value = block.getTreeNode(child.offset))\n  }\n\n  setKey (index, key) {\n    this.keys[index] = key\n    this.changed = true\n  }\n\n  async getKey (index) {\n    const key = this.keys[index]\n    if (key.value) return key.value\n    const k = key.seq === this.block.seq ? this.block.key : await this.block.tree.getKey(key.seq)\n    return (key.value = k)\n  }\n\n  indexChanges (index, seq) {\n    const offset = index.push(null) - 1\n    this.changed = false\n\n    for (const child of this.children) {\n      if (!child.value || !child.value.changed) continue\n      child.seq = seq\n      child.offset = child.value.indexChanges(index, seq)\n      index[child.offset] = child\n    }\n\n    return offset\n  }\n\n  updateChildren (seq, block) {\n    for (const child of this.children) {\n      if (!child.value || child.seq !== seq) continue\n      child.value.block = block\n      child.value.updateChildren(seq, block)\n    }\n  }\n\n  static create (block) {\n    const node = new TreeNode(block, [], [], 0)\n    node.changed = true\n    return node\n  }\n}\n\nclass BlockEntry {\n  constructor (seq, tree, entry) {\n    this.seq = seq\n    this.tree = tree\n    this.index = null\n    this.entry = entry\n    this.key = entry.key\n    this.value = entry.value\n  }\n\n  isTarget (key) {\n    return b4a.equals(this.key, key)\n  }\n\n  inflate () {\n    if (this.index === null) {\n      this.index = inflate(this.entry)\n    }\n  }\n\n  isDeletion () {\n    if (this.value !== null) return false\n\n    if (this.index === null) {\n      this.index = inflate(this.entry)\n    }\n\n    return !this.index.hasKey(this.seq)\n  }\n\n  final (encoding) {\n    return {\n      seq: this.seq,\n      key: encoding.key ? encoding.key.decode(this.key) : this.key,\n      value: this.value && (encoding.value ? encoding.value.decode(this.value) : this.value)\n    }\n  }\n\n  getTreeNode (offset) {\n    if (this.index === null) {\n      this.index = inflate(this.entry)\n    }\n    const entry = this.index.get(offset)\n    return new TreeNode(this, entry.keys, entry.children, offset)\n  }\n}\n\nclass CacheLock {\n  constructor () {\n    this.map = new Map()\n  }\n\n  enter (seq) {\n    const pending = this.map.get(seq)\n\n    if (!pending) {\n      this.map.set(seq, [])\n      return Promise.resolve()\n    }\n\n    const { resolve, promise } = rrp()\n    pending.push(resolve)\n    return promise\n  }\n\n  exit (seq) {\n    const pending = this.map.get(seq)\n    if (!pending.length) {\n      this.map.delete(seq)\n      return\n    }\n\n    pending.pop()()\n  }\n}\n\nclass BatchEntry extends BlockEntry {\n  constructor (seq, tree, key, value, index) {\n    super(seq, tree, { key, value, index: null, inflated: null })\n    this.pendingIndex = index\n  }\n\n  isTarget (key) {\n    return false\n  }\n\n  getTreeNode (offset) {\n    return this.pendingIndex[offset].value\n  }\n}\n\nclass Hyperbee extends ReadyResource {\n  constructor (core, opts = {}) {\n    super()\n    // this.feed is now deprecated, and will be this.core going forward\n    this.feed = core\n    this.core = core\n\n    this.keyEncoding = opts.keyEncoding ? codecs(opts.keyEncoding) : null\n    this.valueEncoding = opts.valueEncoding ? codecs(opts.valueEncoding) : null\n    this.extension = opts.extension !== false ? getExtension(this, opts) : null\n    this.metadata = opts.metadata || null\n    this.lock = opts.lock || mutexify()\n    this.sep = opts.sep || SEP\n    this.readonly = !!opts.readonly\n    this.prefix = opts.prefix || null\n\n    // In a future version, this should be false by default\n    this.alwaysDuplicate = opts.alwaysDuplicate !== false\n\n    this._unprefixedKeyEncoding = this.keyEncoding\n    this._sub = !!this.prefix\n    this._checkout = opts.checkout || 0\n    this._view = !!opts._view\n\n    this._onappendBound = this._view ? null : this._onappend.bind(this)\n    this._ontruncateBound = this._view ? null : this._ontruncate.bind(this)\n    this._watchers = this._onappendBound ? [] : null\n    this._entryWatchers = this._onappendBound ? [] : null\n    this._sessions = opts.sessions !== false\n\n    this._keyCache = null\n    this._nodeCache = null\n    this._cacheLock = new CacheLock()\n\n    this._batches = []\n\n    if (this._watchers) {\n      this.core.on('append', this._onappendBound)\n      this.core.on('truncate', this._ontruncateBound)\n    }\n\n    if (this.prefix && opts._sub) {\n      this.keyEncoding = prefixEncoding(this.prefix, this.keyEncoding)\n    }\n\n    this.ready().catch(safetyCatch)\n  }\n\n  async _open () {\n    if (this.core.opened === false) await this.core.ready()\n\n    // snapshot\n    if (this._checkout === -1) this._checkout = Math.max(1, this.core.length)\n\n    const baseCache = Rache.from(this.core.globalCache)\n    this._keyCache = new Cache(baseCache)\n    this._nodeCache = new Cache(Rache.from(baseCache))\n  }\n\n  get version () {\n    return Math.max(1, this._checkout || this.core.length)\n  }\n\n  get id () {\n    return this.core.id\n  }\n\n  get key () {\n    return this.core.key\n  }\n\n  get discoveryKey () {\n    return this.core.discoveryKey\n  }\n\n  get writable () {\n    return this.core.writable\n  }\n\n  get readable () {\n    return this.core.readable\n  }\n\n  replicate (isInitiator, opts) {\n    return this.core.replicate(isInitiator, opts)\n  }\n\n  update (opts) {\n    return this.core.update(opts)\n  }\n\n  peek (range, opts) {\n    return iteratorPeek(this.createRangeIterator(range, { ...opts, limit: 1 }))\n  }\n\n  createRangeIterator (range, opts = {}) {\n    // backwards compat range arg\n    opts = opts ? { ...opts, ...range } : range\n\n    const extension = (opts.extension === false && opts.limit !== 0) ? null : this.extension\n    const keyEncoding = opts.keyEncoding ? codecs(opts.keyEncoding) : this.keyEncoding\n\n    if (extension) {\n      const { onseq, onwait } = opts\n      let version = 0\n      let next = 0\n\n      opts = encRange(keyEncoding, {\n        ...opts,\n        sub: this._sub,\n        onseq (seq) {\n          if (!version) version = seq + 1\n          if (next) next--\n          if (onseq) onseq(seq)\n        },\n        onwait (seq) {\n          if (!next) {\n            next = Extension.BATCH_SIZE\n            extension.iterator(ite.snapshot(version))\n          }\n          if (onwait) onwait(seq)\n        }\n      })\n    } else {\n      opts = encRange(keyEncoding, { ...opts, sub: this._sub })\n    }\n\n    const ite = new RangeIterator(new Batch(this, this._makeSnapshot(), null, false, opts), null, opts)\n    return ite\n  }\n\n  createReadStream (range, opts) {\n    const signal = (opts && opts.signal) || null\n    return iteratorToStream(this.createRangeIterator(range, opts), signal)\n  }\n\n  createHistoryStream (opts) {\n    const session = (opts && opts.live) ? this.core.session() : this._makeSnapshot()\n    const signal = (opts && opts.signal) || null\n    return iteratorToStream(new HistoryIterator(new Batch(this, session, null, false, opts), opts), signal)\n  }\n\n  createDiffStream (right, range, opts) {\n    if (typeof right === 'number') right = this.checkout(Math.max(1, right), { reuseSession: true })\n\n    // backwards compat range arg\n    opts = opts ? { ...opts, ...range } : range\n\n    const signal = (opts && opts.signal) || null\n\n    const keyEncoding = opts && opts.keyEncoding ? codecs(opts.keyEncoding) : this.keyEncoding\n    if (keyEncoding) opts = encRange(keyEncoding, { ...opts, sub: this._sub })\n\n    let done\n    let closing\n    let ite\n\n    const left = this\n\n    const rs = new Readable({\n      signal,\n      eagerOpen: true,\n      async open (cb) {\n        try {\n          if (right.opened === false) await right.ready()\n          if (left.opened === false) await left.ready()\n        } catch (err) {\n          cb(err)\n          return\n        }\n\n        if (closing) {\n          cb(null)\n          return\n        }\n\n        if (left.core.closing || right.core.closing) {\n          cb(new Error('Bee closed'))\n          return\n        }\n\n        const snapshot = right.version > left.version\n          ? right._makeSnapshot()\n          : left._makeSnapshot()\n\n        done = cb\n        ite = new DiffIterator(\n          new Batch(left, snapshot, null, false, opts),\n          new Batch(right, snapshot, null, false, opts),\n          opts\n        )\n        ite.open().then(fin, fin)\n      },\n      read (cb) {\n        done = cb\n        ite.next().then(push, fin)\n      },\n      predestroy () {\n        if (!ite) {\n          closing = Promise.resolve()\n        } else {\n          closing = ite.close()\n          closing.catch(noop)\n        }\n      },\n      destroy (cb) {\n        done = cb\n        if (!closing) closing = ite.close()\n        closing.then(fin, fin)\n      }\n    })\n\n    return rs\n\n    function fin (err) {\n      done(err)\n    }\n\n    function push (val) {\n      rs.push(val)\n      done(null)\n    }\n  }\n\n  get (key, opts) {\n    const b = new Batch(this, this._makeSnapshot(), null, true, opts)\n    return b.get(key)\n  }\n\n  getBySeq (seq, opts) {\n    const b = new Batch(this, this._makeSnapshot(), null, true, opts)\n    return b.getBySeq(seq)\n  }\n\n  put (key, value, opts) {\n    const b = new Batch(this, this.core, null, true, opts)\n    return b.put(key, value, opts)\n  }\n\n  batch (opts) {\n    return new Batch(this, this.core, mutexify(), true, opts)\n  }\n\n  del (key, opts) {\n    const b = new Batch(this, this.core, null, true, opts)\n    return b.del(key, opts)\n  }\n\n  watch (range, opts) {\n    if (!this._watchers) throw new Error('Can only watch the main bee instance')\n    return new Watcher(this, range, opts)\n  }\n\n  async getAndWatch (key, opts) {\n    if (!this._watchers) throw new Error('Can only watch the main bee instance')\n\n    const watcher = new EntryWatcher(this, key, opts)\n    await watcher._debouncedUpdate()\n\n    if (this.closing) {\n      await watcher.close()\n      throw new Error('Bee closed')\n    }\n\n    return watcher\n  }\n\n  _onappend () {\n    for (const watcher of this._watchers) {\n      watcher._onappend()\n    }\n\n    for (const watcher of this._entryWatchers) {\n      watcher._onappend()\n    }\n  }\n\n  _ontruncate (length) {\n    for (const watcher of this._watchers) {\n      watcher._ontruncate()\n    }\n\n    for (const watcher of this._entryWatchers) {\n      watcher._ontruncate()\n    }\n\n    this._nodeCache.gc(length)\n    this._keyCache.gc(length)\n  }\n\n  _makeSnapshot () {\n    if (this._sessions === false) return this.core\n    // TODO: better if we could encapsulate this in hypercore in the future\n    return (this._checkout <= this.core.length || this._checkout <= 1) ? this.core.snapshot() : this.core.session({ snapshot: false })\n  }\n\n  async clearUnlinked (options = {}) {\n    await this.ready()\n\n    const { gte = 0, lt = this.version - 1, batchSize = 4096, wait = true } = options\n    const checkout = this.version\n\n    let prev = this.batch({ wait: false, checkout: gte })\n    let b = this.batch({ wait, checkout })\n\n    const iteBatch = this.batch({ wait: false, checkout })\n    const ite = new LocalBlockIterator(iteBatch, { gte, lt })\n    await ite.open()\n\n    let ticks = 0\n\n    while (true) {\n      const data = await ite.next()\n      if (!data) break\n\n      if (!(await isLinked(b, data))) {\n        if (b.core.closing || this.core.closing || this.closing) break\n        await this.core.clear(data.seq)\n      }\n\n      const prevNode = await prev.get(data.key, { finalize: false }).catch(toNull)\n\n      if (prevNode && !(await isLinked(b, prevNode))) {\n        if (b.core.closing || this.core.closing || this.closing) break\n        await this.core.clear(prevNode.seq)\n      }\n\n      if (ticks++ >= batchSize) {\n        ticks = 0\n        await prev.close()\n        await b.close()\n\n        prev = this.batch({ wait: false, checkout: gte })\n        b = this.batch({ wait, checkout })\n      }\n    }\n\n    if (b.core.closing || this.core.closing || this.closing) throw new Error('Core is closed')\n\n    await b.close()\n    await prev.close()\n    await ite.close()\n    await iteBatch.close()\n\n    return lt\n  }\n\n  checkout (version, opts = {}) {\n    if (version === 0) version = 1\n\n    // same as above, just checkout isn't set yet...\n    const snap = (opts.reuseSession || this._sessions === false)\n      ? this.core\n      : (version <= this.core.length || version <= 1) ? this.core.snapshot() : this.core.session({ snapshot: false })\n\n    return new Hyperbee(snap, {\n      _view: true,\n      _sub: false,\n      prefix: this.prefix,\n      sep: this.sep,\n      lock: this.lock,\n      checkout: version,\n      keyEncoding: opts.keyEncoding || this.keyEncoding,\n      valueEncoding: opts.valueEncoding || this.valueEncoding,\n      extension: this.extension !== null ? this.extension : false\n    })\n  }\n\n  snapshot (opts) {\n    return this.checkout((this.core.opened === false || this._checkout <= 0) ? -1 : Math.max(1, this.version), opts)\n  }\n\n  sub (prefix, opts = {}) {\n    let sep = opts.sep || this.sep\n    if (!b4a.isBuffer(sep)) sep = b4a.from(sep)\n\n    prefix = b4a.concat([this.prefix || EMPTY, b4a.from(prefix), sep])\n\n    const valueEncoding = codecs(opts.valueEncoding || this.valueEncoding)\n    const keyEncoding = codecs(opts.keyEncoding || this._unprefixedKeyEncoding)\n\n    return new Hyperbee(this.core, {\n      _view: true,\n      _sub: true,\n      prefix,\n      sep: this.sep,\n      lock: this.lock,\n      checkout: this._checkout,\n      valueEncoding,\n      keyEncoding,\n      extension: this.extension !== null ? this.extension : false,\n      metadata: this.metadata\n    })\n  }\n\n  async getHeader (opts) {\n    const blk = await this.core.get(0, opts)\n    try {\n      return blk && Header.decode(blk)\n    } catch {\n      throw DECODING_ERROR()\n    }\n  }\n\n  async _close () {\n    if (!this._view) {\n      if (this._keyCache) this._keyCache.clear()\n      if (this._nodeCache) this._nodeCache.clear()\n    }\n\n    if (this._watchers) {\n      this.core.off('append', this._onappendBound)\n      this.core.off('truncate', this._ontruncateBound)\n\n      while (this._watchers.length) {\n        await this._watchers[this._watchers.length - 1].close()\n      }\n    }\n\n    if (this._entryWatchers) {\n      while (this._entryWatchers.length) {\n        await this._entryWatchers[this._entryWatchers.length - 1].close()\n      }\n    }\n\n    while (this._batches.length) {\n      await this._batches[this._batches.length - 1].close()\n    }\n\n    return this.core.close()\n  }\n\n  static async isHyperbee (core, opts) {\n    await core.ready()\n\n    const blk0 = await core.get(0, opts)\n    if (blk0 === null) throw BLOCK_NOT_AVAILABLE()\n\n    try {\n      return Header.decode(blk0).protocol === 'hyperbee'\n    } catch (err) { // undecodable\n      return false\n    }\n  }\n}\n\nclass Batch {\n  constructor (tree, core, batchLock, cache, options = {}) {\n    this.tree = tree\n    // this.feed is now deprecated, and will be this.core going forward\n    this.feed = core\n    this.core = core\n    this.index = tree._batches.push(this) - 1\n    this.blocks = cache ? new Map() : null\n    this.autoFlush = !batchLock\n    this.maxBlocksCached = options.maxBlocksCached || 128\n    this.rootSeq = 0\n    this.root = null\n    this.length = 0\n    this.checkout = options.checkout === undefined ? -1 : options.checkout\n    this.options = options\n    this.locked = null\n    this.batchLock = batchLock\n    this.onseq = this.options.onseq || noop\n    this.appending = null\n    this.isSnapshot = this.core !== this.tree.core\n    this.shouldUpdate = this.options.update !== false\n    this.updating = null\n    this.encoding = {\n      key: options.keyEncoding ? codecs(options.keyEncoding) : tree.keyEncoding,\n      value: options.valueEncoding ? codecs(options.valueEncoding) : tree.valueEncoding\n    }\n  }\n\n  async ready () {\n    if (this.core.opened === false) await this.core.ready()\n    if (this.tree.opened === false) await this.tree.ready()\n  }\n\n  async lock () {\n    if (this.tree.readonly) throw new Error('Hyperbee is marked as read-only')\n    if (this.locked === null) this.locked = await this.tree.lock()\n  }\n\n  get version () {\n    if (this.checkout !== -1) return Math.max(1, this.checkout)\n    return Math.max(1, this.tree._checkout || (this.core.length + this.length))\n  }\n\n  async getRoot (ensureHeader) {\n    await this.ready()\n    if (ensureHeader) {\n      if (this.core.length === 0 && this.core.writable && !this.tree.readonly) {\n        await this.core.append(Header.encode({\n          protocol: 'hyperbee',\n          metadata: this.tree.metadata\n        }))\n      }\n    }\n    if (this.tree._checkout === 0 && this.checkout === -1 && this.shouldUpdate) {\n      if (this.updating === null) this.updating = this.core.update()\n      await this.updating\n    }\n    if (this.version < 2) return null\n    return (await this.getBlock(this.version - 1)).getTreeNode(0)\n  }\n\n  async getKey (seq) {\n    await this.tree._cacheLock.enter(seq)\n\n    try {\n      const k = this.core.fork === this.tree.core.fork ? this.tree._keyCache.get(seq) : null\n      if (k !== null) return k\n      const key = (await this._getBlock(seq)).key\n      if (this.core.fork === this.tree.core.fork) this.tree._keyCache.set(seq, key)\n      return key\n    } finally {\n      this.tree._cacheLock.exit(seq)\n    }\n  }\n\n  async _getNode (seq) {\n    const cached = (this.tree._nodeCache !== null && this.core.fork === this.tree.core.fork) ? this.tree._nodeCache.get(seq) : null\n    if (cached !== null) return cached\n    const entry = await this.core.get(seq, { ...this.options, valueEncoding: Node })\n    if (entry === null) throw BLOCK_NOT_AVAILABLE()\n    const wrap = copyEntry(entry)\n    if (this.core.fork === this.tree.core.fork && this.tree._nodeCache !== null) this.tree._nodeCache.set(seq, wrap)\n    return wrap\n  }\n\n  async getBlock (seq) {\n    if (this.rootSeq === 0) this.rootSeq = seq\n    await this.tree._cacheLock.enter(seq)\n\n    try {\n      return await this._getBlock(seq)\n    } finally {\n      this.tree._cacheLock.exit(seq)\n    }\n  }\n\n  async _getBlock (seq) {\n    let b = this.blocks && this.blocks.get(seq)\n    if (b) return b\n    this.onseq(seq)\n    const entry = await this._getNode(seq)\n    b = this.blocks && this.blocks.get(seq)\n    if (b) return b\n    b = new BlockEntry(seq, this, entry)\n    if (this.blocks && (this.blocks.size - this.length) < this.maxBlocksCached) this.blocks.set(seq, b)\n    return b\n  }\n\n  _onwait (key) {\n    this.options.onwait = null\n    this.tree.extension.get(this.rootSeq + 1, key)\n  }\n\n  _getEncoding (opts) {\n    if (!opts) return this.encoding\n    return {\n      key: opts.keyEncoding ? codecs(opts.keyEncoding) : this.encoding.key,\n      value: opts.valueEncoding ? codecs(opts.valueEncoding) : this.encoding.value\n    }\n  }\n\n  peek (range, opts) {\n    return iteratorPeek(this.createRangeIterator(range, { ...opts, limit: 1 }))\n  }\n\n  createRangeIterator (range, opts = {}) {\n    // backwards compat range arg\n    opts = opts ? { ...opts, ...range } : range\n\n    const encoding = this._getEncoding(opts)\n    return new RangeIterator(this, encoding, encRange(encoding.key, { ...opts, sub: this.tree._sub }))\n  }\n\n  createReadStream (range, opts) {\n    const signal = (opts && opts.signal) || null\n    return iteratorToStream(this.createRangeIterator(range, opts), signal)\n  }\n\n  async getBySeq (seq, opts) {\n    const encoding = this._getEncoding(opts)\n\n    try {\n      const block = (await this.getBlock(seq)).final(encoding)\n      return { key: block.key, value: block.value }\n    } finally {\n      await this._closeSnapshot()\n    }\n  }\n\n  async get (key, opts) {\n    const encoding = this._getEncoding(opts)\n    const finalize = opts ? opts.finalize !== false : true\n\n    try {\n      return await this._get(key, encoding, finalize)\n    } finally {\n      await this._closeSnapshot()\n    }\n  }\n\n  async _get (key, encoding, finalize) {\n    key = enc(encoding.key, key)\n\n    if (this.tree.extension !== null && this.options.extension !== false) {\n      this.options.onwait = this._onwait.bind(this, key)\n    }\n\n    let node = await this.getRoot(false)\n    if (!node) return null\n\n    while (true) {\n      if (node.block.isTarget(key)) {\n        return node.block.isDeletion() ? null : (finalize ? node.block.final(encoding) : node.block)\n      }\n\n      let s = 0\n      let e = node.keys.length\n      let c\n\n      while (s < e) {\n        const mid = (s + e) >> 1\n\n        c = b4a.compare(key, await node.getKey(mid))\n\n        if (c === 0) {\n          const block = await this.getBlock(node.keys[mid].seq)\n          return finalize ? block.final(encoding) : block\n        }\n\n        if (c < 0) e = mid\n        else s = mid + 1\n      }\n\n      if (!node.children.length) return null\n\n      const i = c < 0 ? e : s\n      node = await node.getChildNode(i)\n    }\n  }\n\n  async links (key, seq) {\n    let node = await this.getRoot(false)\n    if (!node) return false\n\n    if (node.block.seq === seq) return true\n\n    while (true) {\n      if (node.block.isTarget(key)) return false\n\n      let s = 0\n      let e = node.keys.length\n      let c\n\n      while (s < e) {\n        const mid = (s + e) >> 1\n\n        if (node.keys[mid].seq === seq) return true\n        c = b4a.compare(key, await node.getKey(mid))\n\n        if (c === 0) return false\n\n        if (c < 0) e = mid\n        else s = mid + 1\n      }\n\n      if (!node.children.length) return false\n\n      const i = c < 0 ? e : s\n      node = await node.getChildNode(i)\n      if (node.block.seq === seq) return true\n    }\n  }\n\n  async put (key, value, opts) {\n    const release = this.batchLock ? await this.batchLock() : null\n\n    const cas = (opts && opts.cas) || null\n    const encoding = this._getEncoding(opts)\n\n    if (!this.locked) await this.lock()\n    if (!release) return this._put(key, value, encoding, cas)\n\n    try {\n      return await this._put(key, value, encoding, cas)\n    } finally {\n      release()\n    }\n  }\n\n  async _put (key, value, encoding, cas) {\n    const newNode = {\n      seq: 0,\n      key,\n      value\n    }\n    key = enc(encoding.key, key)\n    value = enc(encoding.value, value)\n\n    const stack = []\n\n    let root\n    let node = root = await this.getRoot(true)\n    if (!node) node = root = TreeNode.create(null)\n\n    const seq = newNode.seq = this.core.length + this.length\n    const target = new Key(seq, key)\n\n    while (node.children.length) {\n      stack.push(node)\n      node.changed = true // changed, but compressible\n\n      let s = 0\n      let e = node.keys.length\n      let c\n\n      while (s < e) {\n        const mid = (s + e) >> 1\n        c = b4a.compare(target.value, await node.getKey(mid))\n\n        if (c === 0) {\n          if (cas) {\n            const prev = await node.getKeyNode(mid)\n            if (!(await cas(prev.final(encoding), newNode))) return this._unlockMaybe()\n          }\n          if (!this.tree.alwaysDuplicate) {\n            const prev = await node.getKeyNode(mid)\n            if (sameValue(prev.value, value)) return this._unlockMaybe()\n          }\n          node.setKey(mid, target)\n          return this._append(root, seq, key, value)\n        }\n\n        if (c < 0) e = mid\n        else s = mid + 1\n      }\n\n      const i = c < 0 ? e : s\n      node = await node.getChildNode(i)\n    }\n\n    let needsSplit = !(await node.insertKey(target, value, null, newNode, encoding, cas))\n    if (!node.changed) return this._unlockMaybe()\n\n    while (needsSplit) {\n      const parent = stack.pop()\n      const { median, right } = await node.split()\n\n      if (parent) {\n        needsSplit = !(await parent.insertKey(median, value, right, null, encoding, null))\n        node = parent\n      } else {\n        root = TreeNode.create(node.block)\n        root.changed = true\n        root.keys.push(median)\n        root.children.push(new Child(0, 0, node), new Child(0, 0, right))\n        needsSplit = false\n      }\n    }\n\n    return this._append(root, seq, key, value)\n  }\n\n  async del (key, opts) {\n    const release = this.batchLock ? await this.batchLock() : null\n    const cas = (opts && opts.cas) || null\n    const encoding = this._getEncoding(opts)\n\n    if (!this.locked) await this.lock()\n    if (!release) return this._del(key, encoding, cas)\n\n    try {\n      return await this._del(key, encoding, cas)\n    } finally {\n      release()\n    }\n  }\n\n  async _del (key, encoding, cas) {\n    const delNode = {\n      seq: 0,\n      key,\n      value: null\n    }\n\n    key = enc(encoding.key, key)\n\n    const stack = []\n\n    let node = await this.getRoot(true)\n    if (!node) return this._unlockMaybe()\n\n    const seq = delNode.seq = this.core.length + this.length\n\n    while (true) {\n      stack.push(node)\n\n      let s = 0\n      let e = node.keys.length\n      let c\n\n      while (s < e) {\n        const mid = (s + e) >> 1\n        c = b4a.compare(key, await node.getKey(mid))\n\n        if (c === 0) {\n          if (cas) {\n            const prev = await node.getKeyNode(mid)\n            if (!(await cas(prev.final(encoding), delNode))) return this._unlockMaybe()\n          }\n          if (node.children.length) await setKeyToNearestLeaf(node, mid, stack)\n          else node.removeKey(mid)\n          // we mark these as changed late, so we don't rewrite them if it is a 404\n          for (const node of stack) node.changed = true\n          return this._append(await rebalance(stack), seq, key, null)\n        }\n\n        if (c < 0) e = mid\n        else s = mid + 1\n      }\n\n      if (!node.children.length) return this._unlockMaybe()\n\n      const i = c < 0 ? e : s\n      node = await node.getChildNode(i)\n    }\n  }\n\n  async _closeSnapshot () {\n    if (this.isSnapshot) {\n      await this.core.close()\n      this._finalize()\n    }\n  }\n\n  async close () {\n    if (this.isSnapshot) return this._closeSnapshot()\n\n    this.root = null\n    if (this.blocks) this.blocks.clear()\n    this.length = 0\n    this._unlock()\n  }\n\n  destroy () { // compat, remove later\n    this.close().catch(noop)\n  }\n\n  toBlocks () {\n    if (this.appending) return this.appending\n\n    const batch = new Array(this.length)\n\n    for (let i = 0; i < this.length; i++) {\n      const seq = this.core.length + i\n      const { pendingIndex, key, value } = this.blocks.get(seq)\n\n      if (i < this.length - 1) {\n        pendingIndex[0] = null\n        let j = 0\n\n        while (j < pendingIndex.length) {\n          const idx = pendingIndex[j]\n          if (idx !== null && idx.seq === seq) {\n            idx.offset = j++\n            continue\n          }\n          if (j === pendingIndex.length - 1) pendingIndex.pop()\n          else pendingIndex[j] = pendingIndex.pop()\n        }\n      }\n\n      batch[i] = Node.encode({\n        key,\n        value,\n        index: deflate(pendingIndex)\n      })\n    }\n\n    this.appending = batch\n    return batch\n  }\n\n  flush () {\n    if (!this.length) return this.close()\n\n    const batch = this.toBlocks()\n\n    this.root = null\n    this.blocks.clear()\n    this.length = 0\n\n    return this._appendBatch(batch)\n  }\n\n  _unlockMaybe () {\n    if (this.autoFlush) this._unlock()\n  }\n\n  _unlock () {\n    const locked = this.locked\n    this.locked = null\n    if (locked !== null) locked()\n    this._finalize()\n  }\n\n  _finalize () {\n    // technically finalize can be called more than once, so here we just check if we already have been removed\n    if (this.index >= this.tree._batches.length || this.tree._batches[this.index] !== this) return\n    const top = this.tree._batches.pop()\n    if (top === this) return\n    top.index = this.index\n    this.tree._batches[top.index] = top\n  }\n\n  _append (root, seq, key, value) {\n    const index = []\n    root.indexChanges(index, seq)\n    index[0] = new Child(seq, 0, root)\n\n    if (!this.autoFlush) {\n      const block = new BatchEntry(seq, this, key, value, index)\n      root.block = block\n      this.root = root\n      this.length++\n      this.blocks.set(seq, block)\n\n      root.updateChildren(seq, block)\n      return\n    }\n\n    return this._appendBatch(Node.encode({\n      key,\n      value,\n      index: deflate(index)\n    }))\n  }\n\n  async _appendBatch (raw) {\n    try {\n      await this.core.append(raw)\n    } finally {\n      this._unlock()\n    }\n  }\n}\n\nclass EntryWatcher extends ReadyResource {\n  constructor (bee, key, opts = {}) {\n    super()\n\n    this.keyEncoding = opts.keyEncoding || bee.keyEncoding\n    this.valueEncoding = opts.valueEncoding || bee.valueEncoding\n\n    this.index = bee._entryWatchers.push(this) - 1\n    this.bee = bee\n\n    this.key = key\n    this.node = null\n\n    this._forceUpdate = false\n    this._debouncedUpdate = debounce(this._processUpdate.bind(this))\n  }\n\n  _close () {\n    const top = this.bee._entryWatchers.pop()\n    if (top !== this) {\n      top.index = this.index\n      this.bee._entryWatchers[top.index] = top\n    }\n  }\n\n  _onappend () {\n    this._debouncedUpdate()\n  }\n\n  _ontruncate () {\n    this._forceUpdate = true\n    this._debouncedUpdate()\n  }\n\n  async _processUpdate () {\n    const force = this._forceUpdate\n    this._forceUpdate = false\n\n    let newNode\n    try {\n      newNode = await this.bee.get(this.key, {\n        keyEncoding: this.keyEncoding,\n        valueEncoding: this.valueEncoding\n      })\n    } catch (e) {\n      if (e.code === 'SNAPSHOT_NOT_AVAILABLE') {\n        // There was a truncate event before the get resolved\n        // So this handler will run again anyway\n        return\n      } else if (this.bee.closing) {\n        this.close().catch(safetyCatch)\n        return\n      }\n      this.emit('error', e)\n      return\n    }\n\n    if (force || newNode?.seq !== this.node?.seq) {\n      this.node = newNode\n      this.emit('update')\n    }\n  }\n}\n\nclass Watcher extends ReadyResource {\n  constructor (bee, range, opts = {}) {\n    super()\n\n    this.keyEncoding = opts.keyEncoding || bee.keyEncoding\n    this.valueEncoding = opts.valueEncoding || bee.valueEncoding\n    this.index = bee._watchers.push(this) - 1\n    this.bee = bee\n    this.core = bee.core\n\n    this.latestDiff = 0\n    this.range = range\n    this.map = opts.map || defaultWatchMap\n\n    this.current = null\n    this.previous = null\n    this.currentMapped = null\n    this.previousMapped = null\n    this.stream = null\n\n    this._lock = mutexify()\n    this._flowing = false\n    this._resolveOnChange = null\n    this._differ = opts.differ || defaultDiffer\n    this._eager = !!opts.eager\n    this._onchange = opts.onchange || null\n\n    this.on('newListener', autoFlowOnUpdate)\n\n    this.ready().catch(safetyCatch)\n  }\n\n  async _consume () {\n    if (this._flowing) return\n    try {\n      for await (const _ of this) {} // eslint-disable-line\n    } catch {}\n  }\n\n  async _open () {\n    await this.bee.ready()\n\n    const opts = {\n      keyEncoding: this.keyEncoding,\n      valueEncoding: this.valueEncoding\n    }\n\n    // Point from which to start watching\n    this.current = this._eager ? this.bee.checkout(1, opts) : this.bee.snapshot(opts)\n    await this.current.ready()\n\n    if (this._onchange) {\n      if (this._eager) await this._onchange()\n      this._consume()\n    }\n  }\n\n  [Symbol.asyncIterator] () {\n    this._flowing = true\n    return this\n  }\n\n  _ontruncate () {\n    this._onappend()\n  }\n\n  _onappend () {\n    const resolve = this._resolveOnChange\n    this._resolveOnChange = null\n    if (resolve) resolve()\n  }\n\n  async _waitForChanges () {\n    if (this.current.version < this.bee.version || this.closing) return\n\n    await new Promise(resolve => {\n      this._resolveOnChange = resolve\n    })\n  }\n\n  async next () {\n    try {\n      return await this._next()\n    } catch (err) {\n      if (this.closing) return { value: undefined, done: true }\n      await this.close()\n      throw err\n    }\n  }\n\n  async _next () {\n    const release = await this._lock()\n\n    try {\n      if (this.closing) return { value: undefined, done: true }\n\n      if (!this.opened) await this.ready()\n\n      while (true) {\n        await this._waitForChanges()\n\n        if (this.closing) return { value: undefined, done: true }\n\n        await this._closePrevious()\n        this.previous = this.current.snapshot()\n\n        await this._closeCurrent()\n        this.current = this.bee.snapshot({\n          keyEncoding: this.keyEncoding,\n          valueEncoding: this.valueEncoding\n        })\n\n        await this.current.ready()\n        await this.previous.ready()\n\n        if (this.current.core.fork !== this.previous.core.fork) {\n          return await this._yield()\n        }\n\n        this.stream = this._differ(this.current, this.previous, this.range)\n\n        try {\n          for await (const data of this.stream) { // eslint-disable-line\n            return await this._yield()\n          }\n        } finally {\n          this.stream = null\n        }\n      }\n    } finally {\n      release()\n    }\n  }\n\n  async _yield () {\n    this.currentMapped = this.map(this.current)\n    this.previousMapped = this.map(this.previous)\n\n    if (this._onchange) {\n      try {\n        await this._onchange()\n      } catch (err) {\n        safetyCatch(err)\n      }\n    }\n\n    this.emit('update')\n    return { done: false, value: [this.currentMapped, this.previousMapped] }\n  }\n\n  async return () {\n    await this.close()\n    return { done: true }\n  }\n\n  async _close () {\n    const top = this.bee._watchers.pop()\n    if (top !== this) {\n      top.index = this.index\n      this.bee._watchers[top.index] = top\n    }\n\n    if (this.stream && !this.stream.destroying) {\n      this.stream.destroy()\n    }\n\n    this._onappend() // Continue execution being closed\n\n    await this._closeCurrent().catch(safetyCatch)\n    await this._closePrevious().catch(safetyCatch)\n\n    const release = await this._lock()\n    release()\n  }\n\n  destroy () {\n    return this.close()\n  }\n\n  async _closeCurrent () {\n    if (this.currentMapped) await this.currentMapped.close()\n    if (this.current) await this.current.close()\n    this.current = this.currentMapped = null\n  }\n\n  async _closePrevious () {\n    if (this.previousMapped) await this.previousMapped.close()\n    if (this.previous) await this.previous.close()\n    this.previous = this.previousMapped = null\n  }\n}\n\nfunction autoFlowOnUpdate (name) {\n  if (name === 'update') this._consume()\n}\n\nfunction defaultWatchMap (snapshot) {\n  return snapshot\n}\n\nasync function leafSize (node, goLeft) {\n  while (node.children.length) node = await node.getChildNode(goLeft ? 0 : node.children.length - 1)\n  return node.keys.length\n}\n\nasync function setKeyToNearestLeaf (node, index, stack) {\n  let [left, right] = await Promise.all([node.getChildNode(index), node.getChildNode(index + 1)])\n  const [ls, rs] = await Promise.all([leafSize(left, false), leafSize(right, true)])\n\n  if (ls < rs) { // if fewer leaves on the left\n    stack.push(right)\n    while (right.children.length) stack.push(right = right.children[0].value)\n    node.keys[index] = right.keys.shift()\n  } else { // if fewer leaves on the right\n    stack.push(left)\n    while (left.children.length) stack.push(left = left.children[left.children.length - 1].value)\n    node.keys[index] = left.keys.pop()\n  }\n}\n\nasync function rebalance (stack) {\n  const root = stack[0]\n\n  while (stack.length > 1) {\n    const node = stack.pop()\n    const parent = stack[stack.length - 1]\n\n    if (node.keys.length >= MIN_KEYS) return root\n\n    let { left, index, right } = await node.siblings(parent)\n\n    // maybe borrow from left sibling?\n    if (left && left.keys.length > MIN_KEYS) {\n      left.changed = true\n      node.keys.unshift(parent.keys[index - 1])\n      if (left.children.length) node.children.unshift(left.children.pop())\n      parent.keys[index - 1] = left.keys.pop()\n      return root\n    }\n\n    // maybe borrow from right sibling?\n    if (right && right.keys.length > MIN_KEYS) {\n      right.changed = true\n      node.keys.push(parent.keys[index])\n      if (right.children.length) node.children.push(right.children.shift())\n      parent.keys[index] = right.keys.shift()\n      return root\n    }\n\n    // merge node with another sibling\n    if (left) {\n      index--\n      right = node\n    } else {\n      left = node\n    }\n\n    left.merge(right, parent.keys[index])\n    parent.removeKey(index)\n  }\n\n  // check if the tree shrunk\n  if (!root.keys.length && root.children.length) return root.getChildNode(0)\n  return root\n}\n\nfunction iteratorToStream (ite, signal) {\n  let done\n  let closing\n\n  const rs = new Readable({\n    signal,\n    open (cb) {\n      done = cb\n      ite.open().then(fin, fin)\n    },\n    read (cb) {\n      done = cb\n      ite.next().then(push, fin)\n    },\n    predestroy () {\n      closing = ite.close()\n      closing.catch(noop)\n    },\n    destroy (cb) {\n      done = cb\n      if (!closing) closing = ite.close()\n      closing.then(fin, fin)\n    }\n  })\n\n  return rs\n\n  function fin (err) {\n    done(err)\n  }\n\n  function push (val) {\n    rs.push(val)\n    done(null)\n  }\n}\n\nasync function iteratorPeek (ite) {\n  try {\n    await ite.open()\n    return await ite.next()\n  } finally {\n    await ite.close()\n  }\n}\n\nfunction encRange (e, opts) {\n  if (!e) return opts\n\n  if (e.encodeRange) {\n    const r = e.encodeRange({ gt: opts.gt, gte: opts.gte, lt: opts.lt, lte: opts.lte })\n    opts.gt = r.gt\n    opts.gte = r.gte\n    opts.lt = r.lt\n    opts.lte = r.lte\n    return opts\n  }\n\n  if (opts.gt !== undefined) opts.gt = enc(e, opts.gt)\n  if (opts.gte !== undefined) opts.gte = enc(e, opts.gte)\n  if (opts.lt !== undefined) opts.lt = enc(e, opts.lt)\n  if (opts.lte !== undefined) opts.lte = enc(e, opts.lte)\n  if (opts.sub && !opts.gt && !opts.gte) opts.gt = enc(e, SEP)\n  if (opts.sub && !opts.lt && !opts.lte) opts.lt = bump(enc(e, EMPTY))\n\n  return opts\n}\n\nfunction bump (key) {\n  // key should have been copied by enc above before hitting this\n  key[key.length - 1]++\n  return key\n}\n\nfunction enc (e, v) {\n  if (v === undefined || v === null) return null\n  if (e !== null) return e.encode(v)\n  if (typeof v === 'string') return b4a.from(v)\n  return v\n}\n\nfunction prefixEncoding (prefix, keyEncoding) {\n  return {\n    encode (key) {\n      return b4a.concat([prefix, b4a.isBuffer(key) ? key : enc(keyEncoding, key)])\n    },\n    decode (key) {\n      const sliced = key.slice(prefix.length, key.length)\n      return keyEncoding ? keyEncoding.decode(sliced) : sliced\n    }\n  }\n}\n\nfunction copyEntry (entry) {\n  let key = entry.key\n  let value = entry.value\n  let index = entry.index\n\n  // key, value and index all refer to the same buffer (one hypercore block)\n  // If together they are larger than half the buffer's byteLength,\n  // this means that they got their own private slab (see Buffer.allocUnsafe docs)\n  // so no need to unslab\n  const size = key.byteLength + (value === null ? 0 : value.byteLength) + (index === null ? 0 : index.byteLength)\n  if (2 * size < key.buffer.byteLength) {\n    const [newKey, newValue, newIndex] = unslabAll([entry.key, entry.value, entry.index])\n    key = newKey\n    value = newValue\n    index = newIndex\n  }\n\n  return {\n    key,\n    value,\n    index,\n    inflated: null\n  }\n}\n\nfunction defaultDiffer (currentSnap, previousSnap, opts) {\n  return currentSnap.createDiffStream(previousSnap, opts)\n}\n\nfunction toNull () {\n  return null\n}\n\nfunction getBackingCore (core) {\n  if (core.core) return core\n  if (core.getBackingCore) return core.getBackingCore().session\n  return null\n}\n\nfunction sameValue (a, b) {\n  return a === b || (a !== null && b !== null && b4a.equals(a, b))\n}\n\nfunction noop () {}\n\nfunction getExtension (db, opts) {\n  if (opts.extension === false) return null\n  if (opts.extension && opts.extension !== true) return opts.extension\n  return Extension.register(db)\n}\n\nasync function isLinked (batch, block) {\n  const seq = block.seq\n  block.inflate()\n\n  const keys = [block.key]\n  const wait = batch.options.wait\n\n  for (const l of block.index.levels) {\n    if (!l.keys.length) continue\n    batch.options.wait = false\n    try {\n      keys.push(await batch.getKey(l.keys[0].seq))\n    } catch {}\n    batch.options.wait = wait\n  }\n\n  for (const k of keys) {\n    if (await batch.links(k, seq)) return true\n  }\n\n  if (batch.core.closing) throw new Error('Core is closed')\n\n  return false\n}\n\nmodule.exports = Hyperbee\nconst b4a = require('b4a')\n\nclass SubTree {\n  constructor (node, parent) {\n    this.node = node\n    this.parent = parent\n\n    this.isKey = node.children.length === 0\n    this.i = this.isKey ? 1 : 0\n    this.n = 0\n\n    const child = this.isKey ? null : this.node.children[0]\n    this.seq = child !== null ? child.seq : this.node.keys[0].seq\n    this.offset = child !== null ? child.offset : 0\n  }\n\n  next () {\n    this.i++\n    this.isKey = (this.i & 1) === 1\n    if (!this.isKey && !this.node.children.length) this.i++\n    return this.update()\n  }\n\n  async bisect (key, incl) {\n    let s = 0\n    let e = this.node.keys.length\n    let c\n\n    while (s < e) {\n      const mid = (s + e) >> 1\n      c = cmp(key, await this.node.getKey(mid))\n\n      if (c === 0) {\n        if (incl) this.i = mid * 2 + 1\n        else this.i = mid * 2 + (this.node.children.length ? 2 : 3)\n        return true\n      }\n\n      if (c < 0) e = mid\n      else s = mid + 1\n    }\n\n    const i = c < 0 ? e : s\n    this.i = 2 * i + (this.node.children.length ? 0 : 1)\n    return this.node.children.length === 0\n  }\n\n  update () {\n    this.isKey = (this.i & 1) === 1\n    this.n = this.i >> 1\n    if (this.n >= (this.isKey ? this.node.keys.length : this.node.children.length)) return false\n    const child = this.isKey ? null : this.node.children[this.n]\n    this.seq = child !== null ? child.seq : this.node.keys[this.n].seq\n    this.offset = child !== null ? child.offset : 0\n    return true\n  }\n\n  async key () {\n    return this.n < this.node.keys.length ? this.node.getKey(this.n) : (this.parent && this.parent.key())\n  }\n\n  async compare (tree) {\n    const [a, b] = await Promise.all([this.key(), tree.key()])\n    return cmp(a, b)\n  }\n}\n\nclass TreeIterator {\n  constructor (batch, opts) {\n    this.batch = batch\n    this.stack = []\n    this.lt = opts.lt || opts.lte || null\n    this.lte = !!opts.lte\n    this.gt = opts.gt || opts.gte || null\n    this.gte = !!opts.gte\n    this.seeking = !!this.gt\n    this.encoding = opts.encoding || batch.encoding\n  }\n\n  async open () {\n    const node = await this.batch.getRoot(false)\n    if (!node || !node.keys.length) return\n    const tree = new SubTree(node, null)\n    if (this.seeking && !(await this._seek(tree))) return\n    this.stack.push(tree)\n  }\n\n  async _seek (tree) {\n    const done = await tree.bisect(this.gt, this.gte)\n    const oob = !tree.update()\n    if (done || oob) {\n      this.seeking = false\n      if (oob) return false\n    }\n    return true\n  }\n\n  peek () {\n    if (!this.stack.length) return null\n    return this.stack[this.stack.length - 1]\n  }\n\n  skip () {\n    if (!this.stack.length) return\n    if (!this.stack[this.stack.length - 1].next()) this.stack.pop()\n  }\n\n  async nextKey () {\n    let n = null\n    while (this.stack.length && n === null) n = await this.next()\n    if (n === null) return null\n    if (!this.lt) return n.final(this.encoding)\n\n    const c = cmp(n.key, this.lt)\n    if (this.lte ? c <= 0 : c < 0) return n.final(this.encoding)\n    this.stack = []\n    return null\n  }\n\n  async next () {\n    if (!this.stack.length) return null\n\n    const top = this.stack[this.stack.length - 1]\n    const { isKey, n, seq } = top\n\n    if (!top.next()) {\n      this.stack.pop()\n    }\n\n    if (isKey) {\n      this.seeking = false\n      return this.batch.getBlock(seq)\n    }\n\n    const child = await top.node.getChildNode(n)\n    top.node.children[n] = null // unlink to save memory\n    const tree = new SubTree(child, top)\n    if (this.seeking && !(await this._seek(tree))) return null\n    this.stack.push(tree)\n\n    return null\n  }\n\n  close () {\n    return this.batch._closeSnapshot()\n  }\n}\n\nmodule.exports = class DiffIterator {\n  constructor (left, right, opts = {}) {\n    this.left = new TreeIterator(left, opts)\n    this.right = new TreeIterator(right, opts)\n    this.limit = typeof opts.limit === 'number' ? opts.limit : -1\n  }\n\n  async open () {\n    await Promise.all([this.left.open(), this.right.open()])\n  }\n\n  async next () {\n    if (this.limit === 0) return null\n    const res = await this._next()\n    if (!res || (res.left === null && res.right === null)) return null\n    this.limit--\n    return res\n  }\n\n  async _next () {\n    const a = this.left\n    const b = this.right\n\n    while (true) {\n      const [l, r] = await Promise.all([a.peek(), b.peek()])\n\n      if (!l && !r) return null\n      if (!l) return { left: null, right: await b.nextKey() }\n      if (!r) return { left: await a.nextKey(), right: null }\n\n      if (l.seq === r.seq && l.isKey === r.isKey && l.offset === r.offset) {\n        a.skip()\n        b.skip()\n        continue\n      }\n\n      const c = await l.compare(r)\n\n      if (l.isKey && !r.isKey) {\n        await b.next()\n        continue\n      }\n\n      if (!l.isKey && r.isKey) {\n        await a.next()\n        continue\n      }\n\n      if (l.isKey && r.isKey) {\n        if (c === 0) return { left: await a.nextKey(), right: await b.nextKey() }\n        if (c < 0) return { left: await a.nextKey(), right: null }\n        return { left: null, right: await b.nextKey() }\n      }\n\n      if (c === 0) await Promise.all([a.next(), b.next()])\n      else if (c < 0) await b.next()\n      else await a.next()\n    }\n  }\n\n  async close () {\n    await Promise.all([this.left.close(), this.right.close()])\n  }\n}\n\nfunction cmp (a, b) {\n  if (!a) return b ? 1 : 0\n  if (!b) return a ? -1 : 0\n  return b4a.compare(a, b)\n}\nmodule.exports = class HistoryIterator {\n  constructor (batch, opts = {}) {\n    this.batch = batch\n    this.options = opts\n    this.live = !!opts.live\n    this.gte = 0\n    this.lt = 0\n    this.reverse = !!opts.reverse\n    this.limit = typeof opts.limit === 'number' ? opts.limit : -1\n    this.encoding = opts.encoding || batch.encoding\n    if (this.live && this.reverse) {\n      throw new Error('Cannot have both live and reverse enabled')\n    }\n  }\n\n  async open () {\n    await this.batch.getRoot(false) // does the update dance\n    this.gte = gte(this.options, this.batch.version)\n    this.lt = this.live ? Infinity : lt(this.options, this.batch.version)\n  }\n\n  async next () {\n    if (this.limit === 0) return null\n    if (this.limit > 0) this.limit--\n\n    if (this.gte >= this.lt) return null\n\n    if (this.reverse) {\n      if (this.lt <= 1) return null\n      return final(await this.batch.getBlock(--this.lt), this.encoding)\n    }\n\n    return final(await this.batch.getBlock(this.gte++), this.encoding)\n  }\n\n  close () {\n    return this.batch._closeSnapshot()\n  }\n}\n\nfunction final (node, encoding) {\n  const type = node.isDeletion() ? 'del' : 'put'\n  return { type, ...node.final(encoding) }\n}\n\nfunction gte (opts, version) {\n  if (opts.gt) return (opts.gt < 0 ? (opts.gt + version) : opts.gt) + 1\n  const gte = opts.gte || opts.since || 1\n  return gte < 0 ? gte + version : gte\n}\n\nfunction lt (opts, version) {\n  if (opts.lte === 0 || opts.lt === 0 || opts.end === 0) return 0\n  if (opts.lte) return (opts.lte < 0 ? (opts.lte + version) : opts.lte) + 1\n  const lt = opts.lt || opts.end || version\n  return lt < 0 ? lt + version : lt\n}\nmodule.exports = class LocalBlocksIterator {\n  constructor (batch, opts = {}) {\n    this.batch = batch\n    this.options = opts\n    this.gte = 0\n    this.lt = 0\n    this.limit = typeof opts.limit === 'number' ? opts.limit : -1\n  }\n\n  async open () {\n    await this.batch.getRoot(false) // does the update dance\n    this.gte = gte(this.options, this.batch.version)\n    this.lt = lt(this.options, this.batch.version)\n  }\n\n  async next () {\n    if (this.limit === 0) return null\n    if (this.limit > 0) this.limit--\n\n    while (this.gte < this.lt) {\n      try {\n        return await this.batch.getBlock(this.gte++)\n      } catch {\n        continue\n      }\n    }\n\n    return null\n  }\n\n  close () {\n    return this.batch._closeSnapshot()\n  }\n}\n\nfunction gte (opts, version) {\n  if (opts.gt) return (opts.gt < 0 ? (opts.gt + version) : opts.gt) + 1\n  const gte = opts.gte || opts.since || 1\n  return gte < 0 ? gte + version : gte\n}\n\nfunction lt (opts, version) {\n  if (opts.lte === 0 || opts.lt === 0 || opts.end === 0) return 0\n  if (opts.lte) return (opts.lte < 0 ? (opts.lte + version) : opts.lte) + 1\n  const lt = opts.lt || opts.end || version\n  return lt < 0 ? lt + version : lt\n}\nconst b4a = require('b4a')\n\nmodule.exports = class RangeIterator {\n  constructor (batch, encoding, opts = {}) {\n    this.batch = batch\n    this.stack = []\n    this.opened = false\n    this.encoding = encoding || batch.encoding\n\n    this._limit = typeof opts.limit === 'number' ? opts.limit : -1\n    this._gIncl = !opts.gt\n    this._gKey = opts.gt || opts.gte || null\n    this._lIncl = !opts.lt\n    this._lKey = opts.lt || opts.lte || null\n    this._reverse = !!opts.reverse\n    this._version = 0\n    this._checkpoint = (opts.checkpoint && opts.checkpoint.length) ? opts.checkpoint : null\n    this._nexting = false\n  }\n\n  snapshot (version = this.batch.version) {\n    const checkpoint = []\n    for (const s of this.stack) {\n      let { node, i } = s\n      if (this._nexting && s === this.stack[this.stack.length - 1]) i = this._reverse ? i + 1 : i - 1\n      if (!node.block) continue\n      if (i < 0) continue\n      checkpoint.push(node.block.seq, node.offset, i)\n    }\n\n    return {\n      version,\n      gte: this._gIncl ? this._gKey : null,\n      gt: this._gIncl ? null : this._gKey,\n      lte: this._lIncl ? this._lKey : null,\n      lt: this._lIncl ? null : this._lKey,\n      limit: this._limit,\n      reverse: this._reverse,\n      ended: this.opened && !checkpoint.length,\n      checkpoint: this.opened ? checkpoint : []\n    }\n  }\n\n  async open () {\n    await this._open()\n    this.opened = true\n  }\n\n  async _open () {\n    if (this._checkpoint) {\n      for (let j = 0; j < this._checkpoint.length; j += 3) {\n        const seq = this._checkpoint[j]\n        const offset = this._checkpoint[j + 1]\n        const i = this._checkpoint[j + 2]\n        this.stack.push({\n          node: (await this.batch.getBlock(seq)).getTreeNode(offset),\n          i\n        })\n      }\n      return\n    }\n\n    this._nexting = true\n\n    let node = await this.batch.getRoot(false)\n    if (!node) {\n      this._nexting = false\n      return\n    }\n\n    const incl = this._reverse ? this._lIncl : this._gIncl\n    const start = this._reverse ? this._lKey : this._gKey\n\n    if (!start) {\n      this.stack.push({ node, i: this._reverse ? node.keys.length << 1 : 0 })\n      this._nexting = false\n      return\n    }\n\n    while (true) {\n      const entry = { node, i: this._reverse ? node.keys.length << 1 : 0 }\n\n      let s = 0\n      let e = node.keys.length\n      let c\n\n      while (s < e) {\n        const mid = (s + e) >> 1\n        c = b4a.compare(start, await node.getKey(mid))\n\n        if (c === 0) {\n          if (incl) entry.i = mid * 2 + 1\n          else entry.i = mid * 2 + (this._reverse ? 0 : 2)\n          this.stack.push(entry)\n          this._nexting = false\n          return\n        }\n\n        if (c < 0) e = mid\n        else s = mid + 1\n      }\n\n      const i = c < 0 ? e : s\n      entry.i = 2 * i + (this._reverse ? -1 : 1)\n\n      if (entry.i >= 0 && entry.i <= (node.keys.length << 1)) this.stack.push(entry)\n      if (!node.children.length) {\n        this._nexting = false\n        return\n      }\n\n      node = await node.getChildNode(i)\n    }\n  }\n\n  async next () {\n    // TODO: this nexting flag is only needed if someone asks for a snapshot during\n    // a lookup (ie the extension, pretty important...).\n    // A better solution would be to refactor this so top.i is incremented eagerly\n    // to get the current block instead of the way it is done now (++i vs i++)\n    this._nexting = true\n\n    const end = this._reverse ? this._gKey : this._lKey\n    const incl = this._reverse ? this._gIncl : this._lIncl\n\n    while (this.stack.length && (this._limit === -1 || this._limit > 0)) {\n      const top = this.stack[this.stack.length - 1]\n      const isKey = (top.i & 1) === 1\n      const n = this._reverse\n        ? (top.i < 0 ? top.node.keys.length : top.i-- >> 1)\n        : top.i++ >> 1\n\n      if (!isKey) {\n        if (!top.node.children.length) continue\n        const node = await top.node.getChildNode(n)\n        if (top.node.block.seq < this.batch.core.length) {\n          top.node.children[n].value = null // unlink it to save memory\n        }\n        this.stack.push({ i: this._reverse ? node.keys.length << 1 : 0, node })\n        continue\n      }\n\n      if (n >= top.node.keys.length) {\n        this.stack.pop()\n        continue\n      }\n\n      const key = top.node.keys[n]\n      const block = await this.batch.getBlock(key.seq)\n      if (end) {\n        const c = b4a.compare(block.key, end)\n        if (c === 0 ? !incl : (this._reverse ? c < 0 : c > 0)) {\n          this._limit = 0\n          break\n        }\n      }\n      if (this._limit > 0) this._limit--\n      this._nexting = false\n      return block.final(this.encoding)\n    }\n\n    this._nexting = false\n    return null\n  }\n\n  close () {\n    return this.batch._closeSnapshot()\n  }\n}\nconst { Extension } = require('./messages')\n\n// const MAX_ACTIVE = 32\nconst FLUSH_BATCH = 128\nconst MAX_PASSIVE_BATCH = 2048\nconst MAX_ACTIVE_BATCH = MAX_PASSIVE_BATCH + FLUSH_BATCH\n\nclass Batch {\n  constructor (outgoing, from) {\n    this.blocks = []\n    this.start = 0\n    this.end = 0\n    this.outgoing = outgoing\n    this.from = from\n  }\n\n  push (seq) {\n    const len = this.blocks.push(seq)\n    if (len === 1 || seq < this.start) this.start = seq\n    if (len === 1 || seq >= this.end) this.end = seq + 1\n    if (len >= FLUSH_BATCH) {\n      this.send()\n      this.clear()\n    }\n  }\n\n  send () {\n    if (!this.blocks.length) return\n    this.outgoing.send(Extension.encode({ cache: { blocks: this.blocks, start: this.start, end: this.end } }), this.from)\n  }\n\n  clear () {\n    this.start = this.end = 0\n    this.blocks = []\n  }\n}\n\nclass HyperbeeExtension {\n  constructor (db) {\n    this.encoding = null\n    this.outgoing = null\n    this.db = db\n    this.active = 0\n  }\n\n  get (version, key) {\n    this.outgoing.broadcast(Extension.encode({ get: { version, key } }))\n  }\n\n  iterator (snapshot) {\n    if (snapshot.ended) return\n    if (snapshot.limit === 0) return\n    if (snapshot.limit === -1) snapshot.limit = 0\n    this.outgoing.broadcast(Extension.encode({ iterator: snapshot }))\n  }\n\n  onmessage (buf, from) {\n    // TODO: handle max active extension messages\n    // this.active++\n\n    const message = decode(buf)\n    if (!message) return\n\n    if (message.cache) this.oncache(message.cache, from)\n    if (message.get) this.onget(message.get, from)\n    if (message.iterator) this.oniterator(message.iterator, from)\n  }\n\n  oncache (message, from) {\n    if (!message.blocks.length) return\n    this.db.core.download(message)\n  }\n\n  onget (message, from) {\n    if (!message.version || message.version > this.db.version) return\n\n    const b = new Batch(this.outgoing, from)\n    const db = this.db.checkout(message.version)\n\n    db.get(message.key, { extension: false, wait: false, update: false, onseq }).then(done, done)\n\n    function done () {\n      db.close().catch(noop)\n      b.send()\n    }\n\n    function onseq (seq) {\n      b.push(seq)\n    }\n  }\n\n  async oniterator (message, from) {\n    if (!message.version || message.version > this.db.version) return\n\n    const b = new Batch(this.outgoing, from)\n    const seqs = new Set()\n\n    let skip = message.checkpoint.length\n    let work = 0\n\n    const db = this.db.checkout(message.version)\n    const ite = db.createRangeIterator({\n      ...message,\n      wait: false,\n      extension: false,\n      update: false,\n      limit: message.limit === 0 ? -1 : message.limit,\n      onseq (seq) {\n        if (skip && skip--) return\n        if (seqs.has(seq)) return\n        work++\n        seqs.add(seq)\n        b.push(seq)\n      }\n    })\n\n    try {\n      await ite.open()\n      // eslint-disable-next-line no-unmodified-loop-condition\n      while (work < MAX_ACTIVE_BATCH) {\n        if (!(await ite.next())) break\n      }\n    } catch (_) {\n      // do nothing\n    } finally {\n      ite.close().catch(noop)\n      db.close().catch(noop)\n      b.send()\n    }\n  }\n\n  static register (db) {\n    const e = new this(db)\n    e.outgoing = db.core.registerExtension('hyperbee', e)\n    return e\n  }\n}\n\nHyperbeeExtension.BATCH_SIZE = MAX_PASSIVE_BATCH\n\nmodule.exports = HyperbeeExtension\n\nfunction decode (buf) {\n  try {\n    return Extension.decode(buf)\n  } catch (err) {\n    return null\n  }\n}\n\nfunction noop () {}\n// This file is auto generated by the protocol-buffers compiler\n\n/* eslint-disable quotes */\n/* eslint-disable indent */\n/* eslint-disable no-redeclare */\n/* eslint-disable camelcase */\n/* eslint-disable no-var */\n\n// Remember to `npm install --save protocol-buffers-encodings`\nvar encodings = require('protocol-buffers-encodings')\nvar b4a = require('b4a')\nvar varint = encodings.varint\nvar skip = encodings.skip\n\nvar YoloIndex = exports.YoloIndex = {\n  buffer: true,\n  encodingLength: null,\n  encode: null,\n  decode: null\n}\n\nvar Header = exports.Header = {\n  buffer: true,\n  encodingLength: null,\n  encode: null,\n  decode: null\n}\n\nvar Node = exports.Node = {\n  buffer: true,\n  encodingLength: null,\n  encode: null,\n  decode: null\n}\n\nvar Extension = exports.Extension = {\n  buffer: true,\n  encodingLength: null,\n  encode: null,\n  decode: null\n}\n\ndefineYoloIndex()\ndefineHeader()\ndefineNode()\ndefineExtension()\n\nfunction defineYoloIndex () {\n  var Level = YoloIndex.Level = {\n    buffer: true,\n    encodingLength: null,\n    encode: null,\n    decode: null\n  }\n\n  defineLevel()\n\n  function defineLevel () {\n    Level.encodingLength = encodingLength\n    Level.encode = encode\n    Level.decode = decode\n\n    function encodingLength (obj) {\n      var length = 0\n      if (defined(obj.keys)) {\n        var packedLen = 0\n        for (var i = 0; i < obj.keys.length; i++) {\n          if (!defined(obj.keys[i])) continue\n          var len = encodings.varint.encodingLength(obj.keys[i])\n          packedLen += len\n        }\n        if (packedLen) {\n          length += 1 + packedLen + varint.encodingLength(packedLen)\n        }\n      }\n      if (defined(obj.children)) {\n        var packedLen = 0\n        for (var i = 0; i < obj.children.length; i++) {\n          if (!defined(obj.children[i])) continue\n          var len = encodings.varint.encodingLength(obj.children[i])\n          packedLen += len\n        }\n        if (packedLen) {\n          length += 1 + packedLen + varint.encodingLength(packedLen)\n        }\n      }\n      return length\n    }\n\n    function encode (obj, buf, offset) {\n      if (!offset) offset = 0\n      if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n      var oldOffset = offset\n      if (defined(obj.keys)) {\n        var packedLen = 0\n        for (var i = 0; i < obj.keys.length; i++) {\n          if (!defined(obj.keys[i])) continue\n          packedLen += encodings.varint.encodingLength(obj.keys[i])\n        }\n        if (packedLen) {\n          buf[offset++] = 10\n          varint.encode(packedLen, buf, offset)\n          offset += varint.encode.bytes\n        }\n        for (var i = 0; i < obj.keys.length; i++) {\n          if (!defined(obj.keys[i])) continue\n          encodings.varint.encode(obj.keys[i], buf, offset)\n          offset += encodings.varint.encode.bytes\n        }\n      }\n      if (defined(obj.children)) {\n        var packedLen = 0\n        for (var i = 0; i < obj.children.length; i++) {\n          if (!defined(obj.children[i])) continue\n          packedLen += encodings.varint.encodingLength(obj.children[i])\n        }\n        if (packedLen) {\n          buf[offset++] = 18\n          varint.encode(packedLen, buf, offset)\n          offset += varint.encode.bytes\n        }\n        for (var i = 0; i < obj.children.length; i++) {\n          if (!defined(obj.children[i])) continue\n          encodings.varint.encode(obj.children[i], buf, offset)\n          offset += encodings.varint.encode.bytes\n        }\n      }\n      encode.bytes = offset - oldOffset\n      return buf\n    }\n\n    function decode (buf, offset, end) {\n      if (!offset) offset = 0\n      if (!end) end = buf.length\n      if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n      var oldOffset = offset\n      var obj = {\n        keys: [],\n        children: []\n      }\n      while (true) {\n        if (end <= offset) {\n          decode.bytes = offset - oldOffset\n          return obj\n        }\n        var prefix = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        var tag = prefix >> 3\n        switch (tag) {\n          case 1:\n          var packedEnd = varint.decode(buf, offset)\n          offset += varint.decode.bytes\n          packedEnd += offset\n          while (offset < packedEnd) {\n            obj.keys.push(encodings.varint.decode(buf, offset))\n            offset += encodings.varint.decode.bytes\n          }\n          break\n          case 2:\n          var packedEnd = varint.decode(buf, offset)\n          offset += varint.decode.bytes\n          packedEnd += offset\n          while (offset < packedEnd) {\n            obj.children.push(encodings.varint.decode(buf, offset))\n            offset += encodings.varint.decode.bytes\n          }\n          break\n          default:\n          offset = skip(prefix & 7, buf, offset)\n        }\n      }\n    }\n  }\n\n  YoloIndex.encodingLength = encodingLength\n  YoloIndex.encode = encode\n  YoloIndex.decode = decode\n\n  function encodingLength (obj) {\n    var length = 0\n    if (defined(obj.levels)) {\n      for (var i = 0; i < obj.levels.length; i++) {\n        if (!defined(obj.levels[i])) continue\n        var len = Level.encodingLength(obj.levels[i])\n        length += varint.encodingLength(len)\n        length += 1 + len\n      }\n    }\n    return length\n  }\n\n  function encode (obj, buf, offset) {\n    if (!offset) offset = 0\n    if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n    var oldOffset = offset\n    if (defined(obj.levels)) {\n      for (var i = 0; i < obj.levels.length; i++) {\n        if (!defined(obj.levels[i])) continue\n        buf[offset++] = 10\n        varint.encode(Level.encodingLength(obj.levels[i]), buf, offset)\n        offset += varint.encode.bytes\n        Level.encode(obj.levels[i], buf, offset)\n        offset += Level.encode.bytes\n      }\n    }\n    encode.bytes = offset - oldOffset\n    return buf\n  }\n\n  function decode (buf, offset, end) {\n    if (!offset) offset = 0\n    if (!end) end = buf.length\n    if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n    var oldOffset = offset\n    var obj = {\n      levels: []\n    }\n    while (true) {\n      if (end <= offset) {\n        decode.bytes = offset - oldOffset\n        return obj\n      }\n      var prefix = varint.decode(buf, offset)\n      offset += varint.decode.bytes\n      var tag = prefix >> 3\n      switch (tag) {\n        case 1:\n        var len = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        obj.levels.push(Level.decode(buf, offset, offset + len))\n        offset += Level.decode.bytes\n        break\n        default:\n        offset = skip(prefix & 7, buf, offset)\n      }\n    }\n  }\n}\n\nfunction defineHeader () {\n  var Metadata = Header.Metadata = {\n    buffer: true,\n    encodingLength: null,\n    encode: null,\n    decode: null\n  }\n\n  defineMetadata()\n\n  function defineMetadata () {\n    Metadata.encodingLength = encodingLength\n    Metadata.encode = encode\n    Metadata.decode = decode\n\n    function encodingLength (obj) {\n      var length = 0\n      if (defined(obj.contentFeed)) {\n        var len = encodings.bytes.encodingLength(obj.contentFeed)\n        length += 1 + len\n      }\n      if (defined(obj.userData)) {\n        var len = encodings.bytes.encodingLength(obj.userData)\n        length += 1 + len\n      }\n      return length\n    }\n\n    function encode (obj, buf, offset) {\n      if (!offset) offset = 0\n      if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n      var oldOffset = offset\n      if (defined(obj.contentFeed)) {\n        buf[offset++] = 10\n        encodings.bytes.encode(obj.contentFeed, buf, offset)\n        offset += encodings.bytes.encode.bytes\n      }\n      if (defined(obj.userData)) {\n        buf[offset++] = 18\n        encodings.bytes.encode(obj.userData, buf, offset)\n        offset += encodings.bytes.encode.bytes\n      }\n      encode.bytes = offset - oldOffset\n      return buf\n    }\n\n    function decode (buf, offset, end) {\n      if (!offset) offset = 0\n      if (!end) end = buf.length\n      if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n      var oldOffset = offset\n      var obj = {\n        contentFeed: null,\n        userData: null\n      }\n      while (true) {\n        if (end <= offset) {\n          decode.bytes = offset - oldOffset\n          return obj\n        }\n        var prefix = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        var tag = prefix >> 3\n        switch (tag) {\n          case 1:\n          obj.contentFeed = encodings.bytes.decode(buf, offset)\n          offset += encodings.bytes.decode.bytes\n          break\n          case 2:\n          obj.userData = encodings.bytes.decode(buf, offset)\n          offset += encodings.bytes.decode.bytes\n          break\n          default:\n          offset = skip(prefix & 7, buf, offset)\n        }\n      }\n    }\n  }\n\n  Header.encodingLength = encodingLength\n  Header.encode = encode\n  Header.decode = decode\n\n  function encodingLength (obj) {\n    var length = 0\n    if (!defined(obj.protocol)) throw new Error(\"protocol is required\")\n    var len = encodings.string.encodingLength(obj.protocol)\n    length += 1 + len\n    if (defined(obj.metadata)) {\n      var len = Metadata.encodingLength(obj.metadata)\n      length += varint.encodingLength(len)\n      length += 1 + len\n    }\n    return length\n  }\n\n  function encode (obj, buf, offset) {\n    if (!offset) offset = 0\n    if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n    var oldOffset = offset\n    if (!defined(obj.protocol)) throw new Error(\"protocol is required\")\n    buf[offset++] = 10\n    encodings.string.encode(obj.protocol, buf, offset)\n    offset += encodings.string.encode.bytes\n    if (defined(obj.metadata)) {\n      buf[offset++] = 18\n      varint.encode(Metadata.encodingLength(obj.metadata), buf, offset)\n      offset += varint.encode.bytes\n      Metadata.encode(obj.metadata, buf, offset)\n      offset += Metadata.encode.bytes\n    }\n    encode.bytes = offset - oldOffset\n    return buf\n  }\n\n  function decode (buf, offset, end) {\n    if (!offset) offset = 0\n    if (!end) end = buf.length\n    if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n    var oldOffset = offset\n    var obj = {\n      protocol: \"\",\n      metadata: null\n    }\n    var found0 = false\n    while (true) {\n      if (end <= offset) {\n        if (!found0) throw new Error(\"Decoded message is not valid\")\n        decode.bytes = offset - oldOffset\n        return obj\n      }\n      var prefix = varint.decode(buf, offset)\n      offset += varint.decode.bytes\n      var tag = prefix >> 3\n      switch (tag) {\n        case 1:\n        obj.protocol = encodings.string.decode(buf, offset)\n        offset += encodings.string.decode.bytes\n        found0 = true\n        break\n        case 2:\n        var len = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        obj.metadata = Metadata.decode(buf, offset, offset + len)\n        offset += Metadata.decode.bytes\n        break\n        default:\n        offset = skip(prefix & 7, buf, offset)\n      }\n    }\n  }\n}\n\nfunction defineNode () {\n  Node.encodingLength = encodingLength\n  Node.encode = encode\n  Node.decode = decode\n\n  function encodingLength (obj) {\n    var length = 0\n    if (!defined(obj.index)) throw new Error(\"index is required\")\n    var len = encodings.bytes.encodingLength(obj.index)\n    length += 1 + len\n    if (!defined(obj.key)) throw new Error(\"key is required\")\n    var len = encodings.bytes.encodingLength(obj.key)\n    length += 1 + len\n    if (defined(obj.value)) {\n      var len = encodings.bytes.encodingLength(obj.value)\n      length += 1 + len\n    }\n    return length\n  }\n\n  function encode (obj, buf, offset) {\n    if (!offset) offset = 0\n    if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n    var oldOffset = offset\n    if (!defined(obj.index)) throw new Error(\"index is required\")\n    buf[offset++] = 10\n    encodings.bytes.encode(obj.index, buf, offset)\n    offset += encodings.bytes.encode.bytes\n    if (!defined(obj.key)) throw new Error(\"key is required\")\n    buf[offset++] = 18\n    encodings.bytes.encode(obj.key, buf, offset)\n    offset += encodings.bytes.encode.bytes\n    if (defined(obj.value)) {\n      buf[offset++] = 26\n      encodings.bytes.encode(obj.value, buf, offset)\n      offset += encodings.bytes.encode.bytes\n    }\n    encode.bytes = offset - oldOffset\n    return buf\n  }\n\n  function decode (buf, offset, end) {\n    if (!offset) offset = 0\n    if (!end) end = buf.length\n    if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n    var oldOffset = offset\n    var obj = {\n      index: null,\n      key: null,\n      value: null\n    }\n    var found0 = false\n    var found1 = false\n    while (true) {\n      if (end <= offset) {\n        if (!found0 || !found1) throw new Error(\"Decoded message is not valid\")\n        decode.bytes = offset - oldOffset\n        return obj\n      }\n      var prefix = varint.decode(buf, offset)\n      offset += varint.decode.bytes\n      var tag = prefix >> 3\n      switch (tag) {\n        case 1:\n        obj.index = encodings.bytes.decode(buf, offset)\n        offset += encodings.bytes.decode.bytes\n        found0 = true\n        break\n        case 2:\n        obj.key = encodings.bytes.decode(buf, offset)\n        offset += encodings.bytes.decode.bytes\n        found1 = true\n        break\n        case 3:\n        obj.value = encodings.bytes.decode(buf, offset)\n        offset += encodings.bytes.decode.bytes\n        break\n        default:\n        offset = skip(prefix & 7, buf, offset)\n      }\n    }\n  }\n}\n\nfunction defineExtension () {\n  var Get = Extension.Get = {\n    buffer: true,\n    encodingLength: null,\n    encode: null,\n    decode: null\n  }\n\n  var Iterator = Extension.Iterator = {\n    buffer: true,\n    encodingLength: null,\n    encode: null,\n    decode: null\n  }\n\n  var Cache = Extension.Cache = {\n    buffer: true,\n    encodingLength: null,\n    encode: null,\n    decode: null\n  }\n\n  defineGet()\n  defineIterator()\n  defineCache()\n\n  function defineGet () {\n    Get.encodingLength = encodingLength\n    Get.encode = encode\n    Get.decode = decode\n\n    function encodingLength (obj) {\n      var length = 0\n      if (defined(obj.version)) {\n        var len = encodings.varint.encodingLength(obj.version)\n        length += 1 + len\n      }\n      if (defined(obj.key)) {\n        var len = encodings.bytes.encodingLength(obj.key)\n        length += 1 + len\n      }\n      return length\n    }\n\n    function encode (obj, buf, offset) {\n      if (!offset) offset = 0\n      if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n      var oldOffset = offset\n      if (defined(obj.version)) {\n        buf[offset++] = 8\n        encodings.varint.encode(obj.version, buf, offset)\n        offset += encodings.varint.encode.bytes\n      }\n      if (defined(obj.key)) {\n        buf[offset++] = 18\n        encodings.bytes.encode(obj.key, buf, offset)\n        offset += encodings.bytes.encode.bytes\n      }\n      encode.bytes = offset - oldOffset\n      return buf\n    }\n\n    function decode (buf, offset, end) {\n      if (!offset) offset = 0\n      if (!end) end = buf.length\n      if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n      var oldOffset = offset\n      var obj = {\n        version: 0,\n        key: null\n      }\n      while (true) {\n        if (end <= offset) {\n          decode.bytes = offset - oldOffset\n          return obj\n        }\n        var prefix = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        var tag = prefix >> 3\n        switch (tag) {\n          case 1:\n          obj.version = encodings.varint.decode(buf, offset)\n          offset += encodings.varint.decode.bytes\n          break\n          case 2:\n          obj.key = encodings.bytes.decode(buf, offset)\n          offset += encodings.bytes.decode.bytes\n          break\n          default:\n          offset = skip(prefix & 7, buf, offset)\n        }\n      }\n    }\n  }\n\n  function defineIterator () {\n    Iterator.encodingLength = encodingLength\n    Iterator.encode = encode\n    Iterator.decode = decode\n\n    function encodingLength (obj) {\n      var length = 0\n      if (defined(obj.version)) {\n        var len = encodings.varint.encodingLength(obj.version)\n        length += 1 + len\n      }\n      if (defined(obj.gte)) {\n        var len = encodings.bytes.encodingLength(obj.gte)\n        length += 1 + len\n      }\n      if (defined(obj.gt)) {\n        var len = encodings.bytes.encodingLength(obj.gt)\n        length += 1 + len\n      }\n      if (defined(obj.lte)) {\n        var len = encodings.bytes.encodingLength(obj.lte)\n        length += 1 + len\n      }\n      if (defined(obj.lt)) {\n        var len = encodings.bytes.encodingLength(obj.lt)\n        length += 1 + len\n      }\n      if (defined(obj.limit)) {\n        var len = encodings.varint.encodingLength(obj.limit)\n        length += 1 + len\n      }\n      if (defined(obj.reverse)) {\n        var len = encodings.bool.encodingLength(obj.reverse)\n        length += 1 + len\n      }\n      if (defined(obj.checkpoint)) {\n        var packedLen = 0\n        for (var i = 0; i < obj.checkpoint.length; i++) {\n          if (!defined(obj.checkpoint[i])) continue\n          var len = encodings.varint.encodingLength(obj.checkpoint[i])\n          packedLen += len\n        }\n        if (packedLen) {\n          length += 1 + packedLen + varint.encodingLength(packedLen)\n        }\n      }\n      return length\n    }\n\n    function encode (obj, buf, offset) {\n      if (!offset) offset = 0\n      if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n      var oldOffset = offset\n      if (defined(obj.version)) {\n        buf[offset++] = 8\n        encodings.varint.encode(obj.version, buf, offset)\n        offset += encodings.varint.encode.bytes\n      }\n      if (defined(obj.gte)) {\n        buf[offset++] = 18\n        encodings.bytes.encode(obj.gte, buf, offset)\n        offset += encodings.bytes.encode.bytes\n      }\n      if (defined(obj.gt)) {\n        buf[offset++] = 26\n        encodings.bytes.encode(obj.gt, buf, offset)\n        offset += encodings.bytes.encode.bytes\n      }\n      if (defined(obj.lte)) {\n        buf[offset++] = 34\n        encodings.bytes.encode(obj.lte, buf, offset)\n        offset += encodings.bytes.encode.bytes\n      }\n      if (defined(obj.lt)) {\n        buf[offset++] = 42\n        encodings.bytes.encode(obj.lt, buf, offset)\n        offset += encodings.bytes.encode.bytes\n      }\n      if (defined(obj.limit)) {\n        buf[offset++] = 48\n        encodings.varint.encode(obj.limit, buf, offset)\n        offset += encodings.varint.encode.bytes\n      }\n      if (defined(obj.reverse)) {\n        buf[offset++] = 56\n        encodings.bool.encode(obj.reverse, buf, offset)\n        offset += encodings.bool.encode.bytes\n      }\n      if (defined(obj.checkpoint)) {\n        var packedLen = 0\n        for (var i = 0; i < obj.checkpoint.length; i++) {\n          if (!defined(obj.checkpoint[i])) continue\n          packedLen += encodings.varint.encodingLength(obj.checkpoint[i])\n        }\n        if (packedLen) {\n          buf[offset++] = 66\n          varint.encode(packedLen, buf, offset)\n          offset += varint.encode.bytes\n        }\n        for (var i = 0; i < obj.checkpoint.length; i++) {\n          if (!defined(obj.checkpoint[i])) continue\n          encodings.varint.encode(obj.checkpoint[i], buf, offset)\n          offset += encodings.varint.encode.bytes\n        }\n      }\n      encode.bytes = offset - oldOffset\n      return buf\n    }\n\n    function decode (buf, offset, end) {\n      if (!offset) offset = 0\n      if (!end) end = buf.length\n      if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n      var oldOffset = offset\n      var obj = {\n        version: 0,\n        gte: null,\n        gt: null,\n        lte: null,\n        lt: null,\n        limit: 0,\n        reverse: false,\n        checkpoint: []\n      }\n      while (true) {\n        if (end <= offset) {\n          decode.bytes = offset - oldOffset\n          return obj\n        }\n        var prefix = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        var tag = prefix >> 3\n        switch (tag) {\n          case 1:\n          obj.version = encodings.varint.decode(buf, offset)\n          offset += encodings.varint.decode.bytes\n          break\n          case 2:\n          obj.gte = encodings.bytes.decode(buf, offset)\n          offset += encodings.bytes.decode.bytes\n          break\n          case 3:\n          obj.gt = encodings.bytes.decode(buf, offset)\n          offset += encodings.bytes.decode.bytes\n          break\n          case 4:\n          obj.lte = encodings.bytes.decode(buf, offset)\n          offset += encodings.bytes.decode.bytes\n          break\n          case 5:\n          obj.lt = encodings.bytes.decode(buf, offset)\n          offset += encodings.bytes.decode.bytes\n          break\n          case 6:\n          obj.limit = encodings.varint.decode(buf, offset)\n          offset += encodings.varint.decode.bytes\n          break\n          case 7:\n          obj.reverse = encodings.bool.decode(buf, offset)\n          offset += encodings.bool.decode.bytes\n          break\n          case 8:\n          var packedEnd = varint.decode(buf, offset)\n          offset += varint.decode.bytes\n          packedEnd += offset\n          while (offset < packedEnd) {\n            obj.checkpoint.push(encodings.varint.decode(buf, offset))\n            offset += encodings.varint.decode.bytes\n          }\n          break\n          default:\n          offset = skip(prefix & 7, buf, offset)\n        }\n      }\n    }\n  }\n\n  function defineCache () {\n    Cache.encodingLength = encodingLength\n    Cache.encode = encode\n    Cache.decode = decode\n\n    function encodingLength (obj) {\n      var length = 0\n      if (!defined(obj.start)) throw new Error(\"start is required\")\n      var len = encodings.varint.encodingLength(obj.start)\n      length += 1 + len\n      if (!defined(obj.end)) throw new Error(\"end is required\")\n      var len = encodings.varint.encodingLength(obj.end)\n      length += 1 + len\n      if (defined(obj.blocks)) {\n        var packedLen = 0\n        for (var i = 0; i < obj.blocks.length; i++) {\n          if (!defined(obj.blocks[i])) continue\n          var len = encodings.varint.encodingLength(obj.blocks[i])\n          packedLen += len\n        }\n        if (packedLen) {\n          length += 1 + packedLen + varint.encodingLength(packedLen)\n        }\n      }\n      return length\n    }\n\n    function encode (obj, buf, offset) {\n      if (!offset) offset = 0\n      if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n      var oldOffset = offset\n      if (!defined(obj.start)) throw new Error(\"start is required\")\n      buf[offset++] = 8\n      encodings.varint.encode(obj.start, buf, offset)\n      offset += encodings.varint.encode.bytes\n      if (!defined(obj.end)) throw new Error(\"end is required\")\n      buf[offset++] = 16\n      encodings.varint.encode(obj.end, buf, offset)\n      offset += encodings.varint.encode.bytes\n      if (defined(obj.blocks)) {\n        var packedLen = 0\n        for (var i = 0; i < obj.blocks.length; i++) {\n          if (!defined(obj.blocks[i])) continue\n          packedLen += encodings.varint.encodingLength(obj.blocks[i])\n        }\n        if (packedLen) {\n          buf[offset++] = 26\n          varint.encode(packedLen, buf, offset)\n          offset += varint.encode.bytes\n        }\n        for (var i = 0; i < obj.blocks.length; i++) {\n          if (!defined(obj.blocks[i])) continue\n          encodings.varint.encode(obj.blocks[i], buf, offset)\n          offset += encodings.varint.encode.bytes\n        }\n      }\n      encode.bytes = offset - oldOffset\n      return buf\n    }\n\n    function decode (buf, offset, end) {\n      if (!offset) offset = 0\n      if (!end) end = buf.length\n      if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n      var oldOffset = offset\n      var obj = {\n        start: 0,\n        end: 0,\n        blocks: []\n      }\n      var found0 = false\n      var found1 = false\n      while (true) {\n        if (end <= offset) {\n          if (!found0 || !found1) throw new Error(\"Decoded message is not valid\")\n          decode.bytes = offset - oldOffset\n          return obj\n        }\n        var prefix = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        var tag = prefix >> 3\n        switch (tag) {\n          case 1:\n          obj.start = encodings.varint.decode(buf, offset)\n          offset += encodings.varint.decode.bytes\n          found0 = true\n          break\n          case 2:\n          obj.end = encodings.varint.decode(buf, offset)\n          offset += encodings.varint.decode.bytes\n          found1 = true\n          break\n          case 3:\n          var packedEnd = varint.decode(buf, offset)\n          offset += varint.decode.bytes\n          packedEnd += offset\n          while (offset < packedEnd) {\n            obj.blocks.push(encodings.varint.decode(buf, offset))\n            offset += encodings.varint.decode.bytes\n          }\n          break\n          default:\n          offset = skip(prefix & 7, buf, offset)\n        }\n      }\n    }\n  }\n\n  Extension.encodingLength = encodingLength\n  Extension.encode = encode\n  Extension.decode = decode\n\n  function encodingLength (obj) {\n    var length = 0\n    if (defined(obj.cache)) {\n      var len = Cache.encodingLength(obj.cache)\n      length += varint.encodingLength(len)\n      length += 1 + len\n    }\n    if (defined(obj.get)) {\n      var len = Get.encodingLength(obj.get)\n      length += varint.encodingLength(len)\n      length += 1 + len\n    }\n    if (defined(obj.iterator)) {\n      var len = Iterator.encodingLength(obj.iterator)\n      length += varint.encodingLength(len)\n      length += 1 + len\n    }\n    return length\n  }\n\n  function encode (obj, buf, offset) {\n    if (!offset) offset = 0\n    if (!buf) buf = b4a.allocUnsafe(encodingLength(obj))\n    var oldOffset = offset\n    if (defined(obj.cache)) {\n      buf[offset++] = 10\n      varint.encode(Cache.encodingLength(obj.cache), buf, offset)\n      offset += varint.encode.bytes\n      Cache.encode(obj.cache, buf, offset)\n      offset += Cache.encode.bytes\n    }\n    if (defined(obj.get)) {\n      buf[offset++] = 18\n      varint.encode(Get.encodingLength(obj.get), buf, offset)\n      offset += varint.encode.bytes\n      Get.encode(obj.get, buf, offset)\n      offset += Get.encode.bytes\n    }\n    if (defined(obj.iterator)) {\n      buf[offset++] = 26\n      varint.encode(Iterator.encodingLength(obj.iterator), buf, offset)\n      offset += varint.encode.bytes\n      Iterator.encode(obj.iterator, buf, offset)\n      offset += Iterator.encode.bytes\n    }\n    encode.bytes = offset - oldOffset\n    return buf\n  }\n\n  function decode (buf, offset, end) {\n    if (!offset) offset = 0\n    if (!end) end = buf.length\n    if (!(end <= buf.length && offset <= buf.length)) throw new Error(\"Decoded message is not valid\")\n    var oldOffset = offset\n    var obj = {\n      cache: null,\n      get: null,\n      iterator: null\n    }\n    while (true) {\n      if (end <= offset) {\n        decode.bytes = offset - oldOffset\n        return obj\n      }\n      var prefix = varint.decode(buf, offset)\n      offset += varint.decode.bytes\n      var tag = prefix >> 3\n      switch (tag) {\n        case 1:\n        var len = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        obj.cache = Cache.decode(buf, offset, offset + len)\n        offset += Cache.decode.bytes\n        break\n        case 2:\n        var len = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        obj.get = Get.decode(buf, offset, offset + len)\n        offset += Get.decode.bytes\n        break\n        case 3:\n        var len = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        obj.iterator = Iterator.decode(buf, offset, offset + len)\n        offset += Iterator.decode.bytes\n        break\n        default:\n        offset = skip(prefix & 7, buf, offset)\n      }\n    }\n  }\n}\n\nfunction defined (val) {\n  return val !== null && val !== undefined && (typeof val !== 'number' || !isNaN(val))\n}\n{\n  \"name\": \"hyperbee\",\n  \"version\": \"2.26.5\",\n  \"description\": \"An append-only B-tree running on a Hypercore.\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"lib/**.js\",\n    \"iterators/**.js\"\n  ],\n  \"dependencies\": {\n    \"b4a\": \"^1.6.0\",\n    \"codecs\": \"^3.0.0\",\n    \"debounceify\": \"^1.0.0\",\n    \"hypercore-errors\": \"^1.0.0\",\n    \"mutexify\": \"^1.4.0\",\n    \"protocol-buffers-encodings\": \"^1.2.0\",\n    \"rache\": \"^1.0.0\",\n    \"ready-resource\": \"^1.0.0\",\n    \"resolve-reject-promise\": \"^1.1.0\",\n    \"safety-catch\": \"^1.0.2\",\n    \"streamx\": \"^2.12.4\",\n    \"unslab\": \"^1.2.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.0\",\n    \"hypercore\": \"^11.0.0\",\n    \"protocol-buffers\": \"^4.2.0\",\n    \"standard\": \"^17.0.0\",\n    \"sub-encoder\": \"^1.0.6\",\n    \"tree-to-string\": \"^1.1.1\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test/*.js\",\n    \"protobuf\": \"protocol-buffers schema.proto -o ./lib/messages.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/hyperbee.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/hyperbee/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/hyperbee\"\n}\nconst sodium = require('sodium-universal')\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\n\n// https://en.wikipedia.org/wiki/Merkle_tree#Second_preimage_attack\nconst LEAF_TYPE = b4a.from([0])\nconst PARENT_TYPE = b4a.from([1])\nconst ROOT_TYPE = b4a.from([2])\n\nconst HYPERCORE = b4a.from('hypercore')\n\nexports.keyPair = function (seed) {\n  // key pairs might stay around for a while, so better not to use a default slab to avoid retaining it completely\n  const slab = b4a.allocUnsafeSlow(sodium.crypto_sign_PUBLICKEYBYTES + sodium.crypto_sign_SECRETKEYBYTES)\n  const publicKey = slab.subarray(0, sodium.crypto_sign_PUBLICKEYBYTES)\n  const secretKey = slab.subarray(sodium.crypto_sign_PUBLICKEYBYTES)\n\n  if (seed) sodium.crypto_sign_seed_keypair(publicKey, secretKey, seed)\n  else sodium.crypto_sign_keypair(publicKey, secretKey)\n\n  return {\n    publicKey,\n    secretKey\n  }\n}\n\nexports.validateKeyPair = function (keyPair) {\n  const pk = b4a.allocUnsafe(sodium.crypto_sign_PUBLICKEYBYTES)\n  sodium.crypto_sign_ed25519_sk_to_pk(pk, keyPair.secretKey)\n  return b4a.equals(pk, keyPair.publicKey)\n}\n\nexports.sign = function (message, secretKey) {\n  // Dedicated slab for the signature, to avoid retaining unneeded mem and for security\n  const signature = b4a.allocUnsafeSlow(sodium.crypto_sign_BYTES)\n  sodium.crypto_sign_detached(signature, message, secretKey)\n  return signature\n}\n\nexports.verify = function (message, signature, publicKey) {\n  if (signature.byteLength !== sodium.crypto_sign_BYTES) return false\n  if (publicKey.byteLength !== sodium.crypto_sign_PUBLICKEYBYTES) return false\n  return sodium.crypto_sign_verify_detached(signature, message, publicKey)\n}\n\nexports.encrypt = function (message, publicKey) {\n  const ciphertext = b4a.alloc(message.byteLength + sodium.crypto_box_SEALBYTES)\n  sodium.crypto_box_seal(ciphertext, message, publicKey)\n  return ciphertext\n}\n\nexports.decrypt = function (ciphertext, keyPair) {\n  if (ciphertext.byteLength < sodium.crypto_box_SEALBYTES) return null\n\n  const plaintext = b4a.alloc(ciphertext.byteLength - sodium.crypto_box_SEALBYTES)\n\n  if (!sodium.crypto_box_seal_open(plaintext, ciphertext, keyPair.publicKey, keyPair.secretKey)) {\n    return null\n  }\n\n  return plaintext\n}\n\nexports.encryptionKeyPair = function (seed) {\n  const publicKey = b4a.alloc(sodium.crypto_box_PUBLICKEYBYTES)\n  const secretKey = b4a.alloc(sodium.crypto_box_SECRETKEYBYTES)\n\n  if (seed) {\n    sodium.crypto_box_seed_keypair(publicKey, secretKey, seed)\n  } else {\n    sodium.crypto_box_keypair(publicKey, secretKey)\n  }\n\n  return {\n    publicKey,\n    secretKey\n  }\n}\n\nexports.data = function (data) {\n  const out = b4a.allocUnsafe(32)\n\n  sodium.crypto_generichash_batch(out, [\n    LEAF_TYPE,\n    c.encode(c.uint64, data.byteLength),\n    data\n  ])\n\n  return out\n}\n\nexports.parent = function (a, b) {\n  if (a.index > b.index) {\n    const tmp = a\n    a = b\n    b = tmp\n  }\n\n  const out = b4a.allocUnsafe(32)\n\n  sodium.crypto_generichash_batch(out, [\n    PARENT_TYPE,\n    c.encode(c.uint64, a.size + b.size),\n    a.hash,\n    b.hash\n  ])\n\n  return out\n}\n\nexports.tree = function (roots, out) {\n  const buffers = new Array(3 * roots.length + 1)\n  let j = 0\n\n  buffers[j++] = ROOT_TYPE\n\n  for (let i = 0; i < roots.length; i++) {\n    const r = roots[i]\n    buffers[j++] = r.hash\n    buffers[j++] = c.encode(c.uint64, r.index)\n    buffers[j++] = c.encode(c.uint64, r.size)\n  }\n\n  if (!out) out = b4a.allocUnsafe(32)\n  sodium.crypto_generichash_batch(out, buffers)\n  return out\n}\n\nexports.hash = function (data, out) {\n  if (!out) out = b4a.allocUnsafe(32)\n  if (!Array.isArray(data)) data = [data]\n\n  sodium.crypto_generichash_batch(out, data)\n\n  return out\n}\n\nexports.randomBytes = function (n) {\n  const buf = b4a.allocUnsafe(n)\n  sodium.randombytes_buf(buf)\n  return buf\n}\n\nexports.discoveryKey = function (key) {\n  if (!key || key.byteLength !== 32) throw new Error('Must pass a 32 byte buffer')\n  // Discovery keys might stay around for a while, so better not to use slab memory (for better gc)\n  const digest = b4a.allocUnsafeSlow(32)\n  sodium.crypto_generichash(digest, HYPERCORE, key)\n  return digest\n}\n\nif (sodium.sodium_free) {\n  exports.free = function (secureBuf) {\n    if (secureBuf.secure) sodium.sodium_free(secureBuf)\n  }\n} else {\n  exports.free = function () {}\n}\n\nexports.namespace = function (name, count) {\n  const ids = typeof count === 'number' ? range(count) : count\n\n  // Namespaces are long-lived, so better to use a dedicated slab\n  const buf = b4a.allocUnsafeSlow(32 * ids.length)\n\n  const list = new Array(ids.length)\n\n  // ns is emhemeral, so default slab\n  const ns = b4a.allocUnsafe(33)\n  sodium.crypto_generichash(ns.subarray(0, 32), typeof name === 'string' ? b4a.from(name) : name)\n\n  for (let i = 0; i < list.length; i++) {\n    list[i] = buf.subarray(32 * i, 32 * i + 32)\n    ns[32] = ids[i]\n    sodium.crypto_generichash(list[i], ns)\n  }\n\n  return list\n}\n\nfunction range (count) {\n  const arr = new Array(count)\n  for (let i = 0; i < count; i++) arr[i] = i\n  return arr\n}\n{\n  \"name\": \"hypercore-crypto\",\n  \"version\": \"3.6.1\",\n  \"description\": \"The crypto primitives used in hypercore, extracted into a separate module\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {\n    \"b4a\": \"^1.6.6\",\n    \"compact-encoding\": \"^2.15.0\",\n    \"sodium-universal\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.5.0\",\n    \"standard\": \"^17.1.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/hypercore-crypto.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/hypercore-crypto/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/hypercore-crypto\"\n}\nconst IdEnc = require('hypercore-id-encoding')\n\nmodule.exports = class HypercoreError extends Error {\n  constructor (msg, code, fn = HypercoreError, discoveryKey = null) {\n    if (discoveryKey) msg = `${msg} (discovery key: ${IdEnc.normalize(discoveryKey)})`\n    super(`${code}: ${msg}`)\n\n    this.code = code\n    this.discoveryKey = discoveryKey\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, fn)\n    }\n  }\n\n  get name () {\n    return 'HypercoreError'\n  }\n\n  static ASSERTION (msg, discoveryKey = null) { // ERR_ASSERTION is picked up by safety-catch also\n    return new HypercoreError(msg, 'ERR_ASSERTION', HypercoreError.ASSERT, discoveryKey)\n  }\n\n  static BAD_ARGUMENT (msg, discoveryKey = null) {\n    return new HypercoreError(msg, 'BAD_ARGUMENT', HypercoreError.BAD_ARGUMENT, discoveryKey)\n  }\n\n  static STORAGE_EMPTY (msg, discoveryKey = null) {\n    return new HypercoreError(msg, 'STORAGE_EMPTY', HypercoreError.STORAGE_EMPTY, discoveryKey)\n  }\n\n  static STORAGE_CONFLICT (msg, discoveryKey = null) {\n    return new HypercoreError(msg, 'STORAGE_CONFLICT', HypercoreError.STORAGE_CONFLICT, discoveryKey)\n  }\n\n  static INVALID_SIGNATURE (msg, discoveryKey = null) {\n    return new HypercoreError(msg, 'INVALID_SIGNATURE', HypercoreError.INVALID_SIGNATURE, discoveryKey)\n  }\n\n  static INVALID_CAPABILITY (msg, discoveryKey = null) {\n    return new HypercoreError(msg, 'INVALID_CAPABILITY', HypercoreError.INVALID_CAPABILITY, discoveryKey)\n  }\n\n  static INVALID_CHECKSUM (msg = 'Invalid checksum', discoveryKey = null) {\n    return new HypercoreError(msg, 'INVALID_CHECKSUM', HypercoreError.INVALID_CHECKSUM, discoveryKey)\n  }\n\n  static INVALID_OPERATION (msg, discoveryKey = null) {\n    return new HypercoreError(msg, 'INVALID_OPERATION', HypercoreError.INVALID_OPERATION, discoveryKey)\n  }\n\n  static INVALID_PROOF (msg = 'Proof not verifiable', discoveryKey = null) {\n    return new HypercoreError(msg, 'INVALID_PROOF', HypercoreError.INVALID_PROOF, discoveryKey)\n  }\n\n  static BLOCK_NOT_AVAILABLE (msg = 'Block is not available', discoveryKey = null) {\n    return new HypercoreError(msg, 'BLOCK_NOT_AVAILABLE', HypercoreError.BLOCK_NOT_AVAILABLE, discoveryKey)\n  }\n\n  static SNAPSHOT_NOT_AVAILABLE (msg = 'Snapshot is not available', discoveryKey = null) {\n    return new HypercoreError(msg, 'SNAPSHOT_NOT_AVAILABLE', HypercoreError.SNAPSHOT_NOT_AVAILABLE, discoveryKey)\n  }\n\n  static REQUEST_CANCELLED (msg = 'Request was cancelled', discoveryKey = null) {\n    return new HypercoreError(msg, 'REQUEST_CANCELLED', HypercoreError.REQUEST_CANCELLED, discoveryKey)\n  }\n\n  static REQUEST_TIMEOUT (msg = 'Request timed out', discoveryKey = null) {\n    return new HypercoreError(msg, 'REQUEST_TIMEOUT', HypercoreError.REQUEST_TIMEOUT, discoveryKey)\n  }\n\n  static SESSION_NOT_WRITABLE (msg = 'Session is not writable', discoveryKey = null) {\n    return new HypercoreError(msg, 'SESSION_NOT_WRITABLE', HypercoreError.SESSION_NOT_WRITABLE, discoveryKey)\n  }\n\n  static SESSION_CLOSED (msg = 'Session is closed', discoveryKey = null) {\n    return new HypercoreError(msg, 'SESSION_CLOSED', HypercoreError.SESSION_CLOSED, discoveryKey)\n  }\n\n  static BATCH_UNFLUSHED (msg = 'Batch not yet flushed', discoveryKey = null) {\n    return new HypercoreError(msg, 'BATCH_UNFLUSHED', HypercoreError.BATCH_UNFLUSHED, discoveryKey)\n  }\n\n  static BATCH_ALREADY_EXISTS (msg = 'Batch already exists', discoveryKey = null) {\n    return new HypercoreError(msg, 'BATCH_ALREADY_EXISTS', HypercoreError.BATCH_ALREADY_EXISTS, discoveryKey)\n  }\n\n  static BATCH_ALREADY_FLUSHED (msg = 'Batch has already been flushed', discoveryKey = null) {\n    return new HypercoreError(msg, 'BATCH_ALREADY_FLUSHED', HypercoreError.BATCH_ALREADY_FLUSHED, discoveryKey)\n  }\n\n  static OPLOG_CORRUPT (msg = 'Oplog file appears corrupt or out of date', discoveryKey = null) {\n    return new HypercoreError(msg, 'OPLOG_CORRUPT', HypercoreError.OPLOG_CORRUPT, discoveryKey)\n  }\n\n  static OPLOG_HEADER_OVERFLOW (msg = 'Oplog header exceeds page size', discoveryKey = null) {\n    return new HypercoreError(msg, 'OPLOG_HEADER_OVERFLOW', HypercoreError.OPLOG_HEADER_OVERFLOW, discoveryKey)\n  }\n\n  static INVALID_OPLOG_VERSION (msg = 'Invalid header version', discoveryKey = null) {\n    return new HypercoreError(msg, 'INVALID_OPLOG_VERSION', HypercoreError.INVALID_OPLOG_VERSION, discoveryKey)\n  }\n\n  static WRITE_FAILED (msg = 'Write to storage failed', discoveryKey = null) {\n    return new HypercoreError(msg, 'WRITE_FAILED', HypercoreError.WRITE_FAILED, discoveryKey)\n  }\n\n  static DECODING_ERROR (msg = 'Decoding error', discoveryKey = null) {\n    return new HypercoreError(msg, 'DECODING_ERROR', HypercoreError.DECODING_ERROR, discoveryKey)\n  }\n\n  static SESSION_MOVED (msg = 'Session moved', discoveryKey = null) {\n    return new HypercoreError(msg, 'SESSION_MOVED', HypercoreError.SESSION_MOVED, discoveryKey)\n  }\n}\n{\n  \"name\": \"hypercore-errors\",\n  \"version\": \"1.5.0\",\n  \"description\": \"Hypercore errors\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/hypercore-errors.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/hypercore-errors/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/hypercore-errors#readme\",\n  \"devDependencies\": {\n    \"b4a\": \"^1.6.7\",\n    \"brittle\": \"^3.1.3\",\n    \"standard\": \"^17.0.0\"\n  },\n  \"dependencies\": {\n    \"hypercore-id-encoding\": \"^1.3.0\"\n  }\n}\nconst z32 = require('z32')\nconst b4a = require('b4a')\n\nmodule.exports = {\n  encode,\n  decode,\n  normalize,\n  isValid\n}\n\nfunction encode (key) {\n  if (!b4a.isBuffer(key)) throw new Error('Key must be a Buffer')\n  if (key.byteLength !== 32) throw new Error('Key must be 32-bytes long')\n  return z32.encode(key)\n}\n\nfunction decode (id) {\n  if (b4a.isBuffer(id)) {\n    if (id.byteLength !== 32) throw new Error('ID must be 32-bytes long')\n    return id\n  }\n  if (typeof id === 'string') {\n    if (id.startsWith('pear://')) id = id.slice(7).split('/')[0]\n    if (id.length === 52) return z32.decode(id)\n    if (id.length === 64) {\n      const buf = b4a.from(id, 'hex')\n      if (buf.byteLength === 32) return buf\n    }\n  }\n  throw new Error('Invalid Hypercore key')\n}\n\nfunction normalize (any) {\n  return encode(decode(any))\n}\n\nfunction isValid (any) {\n  try {\n    decode(any)\n    return true\n  } catch {\n    return false\n  }\n}\n{\n  \"name\": \"hypercore-id-encoding\",\n  \"version\": \"1.3.0\",\n  \"description\": \"Convert Hypercore keys to/from z-base32 or hex\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"files\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {\n    \"b4a\": \"^1.5.3\",\n    \"z32\": \"^1.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.1\",\n    \"hypercore\": \"^10.0.0\",\n    \"random-access-memory\": \"^6.0.0\",\n    \"standard\": \"^17.1.0\"\n  },\n  \"license\": \"Apache-2.0\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/hypercore-id-encoding.git\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/hypercore-id-encoding/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/hypercore-id-encoding#readme\"\n}\nconst RocksDB = require('rocksdb-native')\nconst rrp = require('resolve-reject-promise')\nconst ScopeLock = require('scope-lock')\nconst DeviceFile = require('device-file')\nconst path = require('path')\nconst fs = require('fs')\nconst View = require('./lib/view.js')\n\nconst VERSION = 1\nconst COLUMN_FAMILY = 'corestore'\n\nconst { store, core } = require('./lib/keys.js')\n\nconst { CorestoreRX, CorestoreTX, CoreTX, CoreRX } = require('./lib/tx.js')\n\nconst {\n  createCoreStream,\n  createAliasStream,\n  createDiscoveryKeyStream,\n  createBlockStream,\n  createBitfieldStream,\n  createUserDataStream,\n  createTreeNodeStream,\n  createLocalStream\n} = require('./lib/streams.js')\n\nconst EMPTY = new View()\n\nclass Atom {\n  constructor(db) {\n    this.db = db\n    this.view = new View()\n    this.flushedPromise = null\n    this.flushing = false\n    this.flushes = []\n  }\n\n  onflush(fn) {\n    this.flushes.push(fn)\n  }\n\n  flushed() {\n    if (!this.flushing) return Promise.resolve()\n    if (this.flushedPromise !== null) return this.flushedPromise.promise\n    this.flushedPromise = rrp()\n    return this.flushedPromise.promise\n  }\n\n  _resolve() {\n    const f = this.flushedPromise\n    this.flushedPromise = null\n    f.resolve()\n  }\n\n  async flush() {\n    if (this.flushing) throw new Error('Atom already flushing')\n    this.flushing = true\n\n    try {\n      await View.flush(this.view.changes, this.db)\n      this.view.reset()\n\n      const promises = []\n      const len = this.flushes.length // in case of reentry\n      for (let i = 0; i < len; i++) promises.push(this.flushes[i]())\n\n      await Promise.all(promises)\n    } finally {\n      this.flushing = false\n      if (this.flushedPromise !== null) this._resolve()\n    }\n  }\n}\n\nclass HypercoreStorage {\n  constructor(store, db, core, view, atom) {\n    this.store = store\n    this.db = db\n    this.core = core\n    this.view = view\n    this.atom = atom\n\n    this.view.readStart()\n  }\n\n  get readOnly() {\n    return this.store.readOnly\n  }\n\n  get dependencies() {\n    return this.core.dependencies\n  }\n\n  getDependencyLength() {\n    return this.core.dependencies.length\n      ? this.core.dependencies[this.core.dependencies.length - 1].length\n      : -1\n  }\n\n  getDependency(length) {\n    for (let i = this.core.dependencies.length - 1; i >= 0; i--) {\n      const dep = this.core.dependencies[i]\n      if (dep.length < length) return dep\n    }\n\n    return null\n  }\n\n  setDependencyHead(dep) {\n    const deps = this.core.dependencies\n\n    for (let i = deps.length - 1; i >= 0; i--) {\n      const d = deps[i]\n\n      if (d.dataPointer !== dep.dataPointer) continue\n\n      // check if nothing changed\n      if (d.length === dep.length && i === deps.length - 1) return\n\n      this.core = {\n        corePointer: this.core.corePointer,\n        dataPointer: this.core.dataPointer,\n        dependencies: deps.slice(0, i + 1)\n      }\n\n      this.core.dependencies[i] = {\n        dataPointer: dep.dataPointer,\n        length: dep.length\n      }\n    }\n\n    this.core.dependencies = [\n      {\n        dataPointer: dep.dataPointer,\n        length: dep.length\n      }\n    ]\n  }\n\n  // TODO: this might have to be async if the dependents have changed, but prop ok for now\n  updateDependencyLength(length, truncated) {\n    const deps = this.core.dependencies\n\n    const i = this.findDependencyIndex(length, truncated)\n    if (i === -1) throw new Error('Dependency not found')\n\n    this.core = {\n      corePointer: this.core.corePointer,\n      dataPointer: this.core.dataPointer,\n      dependencies: deps.slice(0, i + 1)\n    }\n\n    if (this.core.dependencies[i].length !== length) {\n      this.core.dependencies[i] = {\n        dataPointer: deps[i].dataPointer,\n        length\n      }\n    }\n  }\n\n  findDependencyIndex(length, truncated) {\n    const deps = this.core.dependencies\n\n    if (truncated) {\n      for (let i = 0; i < deps.length; i++) {\n        if (deps[i].length >= length) return i\n      }\n\n      return -1\n    }\n\n    for (let i = deps.length - 1; i >= 0; i--) {\n      if (deps[i].length <= length) return i\n    }\n\n    return -1\n  }\n\n  get snapshotted() {\n    return this.db._snapshot !== null\n  }\n\n  snapshot() {\n    return new HypercoreStorage(\n      this.store,\n      this.db.snapshot(),\n      this.core,\n      this.view.snapshot(),\n      this.atom\n    )\n  }\n\n  compact() {\n    return Promise.all([\n      this.db.compactRange(core.core(this.core.corePointer), core.core(this.core.corePointer)),\n      this.db.compactRange(core.data(this.core.dataPointer), core.data(this.core.dataPointer))\n    ])\n  }\n\n  atomize(atom) {\n    if (this.atom && this.atom !== atom) {\n      throw new Error('Cannot atomize and atomized session with a new atom')\n    }\n    return new HypercoreStorage(this.store, this.db.session(), this.core, atom.view, atom)\n  }\n\n  createAtom() {\n    return this.store.createAtom()\n  }\n\n  createBlockStream(opts) {\n    return createBlockStream(this.core, this.db, this.view, opts)\n  }\n\n  createTreeNodeStream(opts) {\n    return createTreeNodeStream(this.core, this.db, this.view, opts)\n  }\n\n  createBitfieldStream(opts) {\n    return createBitfieldStream(this.core, this.db, this.view, opts)\n  }\n\n  createUserDataStream(opts) {\n    return createUserDataStream(this.core, this.db, this.view, opts)\n  }\n\n  createLocalStream(opts) {\n    return createLocalStream(this.core, this.db, this.view, opts)\n  }\n\n  async resumeSession(name) {\n    const rx = this.read()\n    const existingSessionsPromise = rx.getSessions()\n\n    rx.tryFlush()\n    const existingSessions = await existingSessionsPromise\n\n    const sessions = existingSessions || []\n    const session = getBatch(sessions, name, false)\n\n    if (session === null) return null\n\n    const core = {\n      corePointer: this.core.corePointer,\n      dataPointer: session.dataPointer,\n      dependencies: []\n    }\n\n    const coreRx = new CoreRX(core, this.db, this.view)\n\n    const dependencyPromise = coreRx.getDependency()\n    coreRx.tryFlush()\n\n    const dependency = await dependencyPromise\n    if (dependency) core.dependencies = this._addDependency(dependency)\n\n    return new HypercoreStorage(\n      this.store,\n      this.db.session(),\n      core,\n      this.atom ? this.view : new View(),\n      this.atom\n    )\n  }\n\n  async createSession(name, head) {\n    const rx = this.read()\n\n    const existingSessionsPromise = rx.getSessions()\n    const existingHeadPromise = rx.getHead()\n\n    rx.tryFlush()\n\n    const [existingSessions, existingHead] = await Promise.all([\n      existingSessionsPromise,\n      existingHeadPromise\n    ])\n    if (head === null) head = existingHead\n\n    if (existingHead !== null && head.length > existingHead.length) {\n      throw new Error('Invalid head passed, ahead of core')\n    }\n\n    const sessions = existingSessions || []\n    const session = getBatch(sessions, name, true)\n    const fresh = session.dataPointer === -1\n\n    if (fresh) {\n      session.dataPointer = await this.store._allocData()\n    }\n\n    const tx = this.write()\n\n    tx.setSessions(sessions)\n\n    const length = head === null ? 0 : head.length\n    const core = {\n      corePointer: this.core.corePointer,\n      dataPointer: session.dataPointer,\n      dependencies: this._addDependency({\n        dataPointer: this.core.dataPointer,\n        length\n      })\n    }\n\n    const coreTx = new CoreTX(core, this.db, tx.view, tx.changes)\n\n    if (length > 0) coreTx.setHead(head)\n    coreTx.setDependency(core.dependencies[core.dependencies.length - 1])\n\n    if (!fresh) {\n      // nuke all existing state...\n      coreTx.deleteBlockRange(0, -1)\n      coreTx.deleteTreeNodeRange(0, -1)\n      coreTx.deleteBitfieldPageRange(0, -1)\n    }\n\n    await tx.flush()\n\n    return new HypercoreStorage(\n      this.store,\n      this.db.session(),\n      core,\n      this.atom ? this.view : new View(),\n      this.atom\n    )\n  }\n\n  async createAtomicSession(atom, head) {\n    const length = head === null ? 0 : head.length\n    const core = {\n      corePointer: this.core.corePointer,\n      dataPointer: this.core.dataPointer,\n      dependencies: this._addDependency(null)\n    }\n\n    const coreTx = new CoreTX(core, this.db, atom.view, [])\n\n    if (length > 0) coreTx.setHead(head)\n\n    await coreTx.flush()\n\n    return this.atomize(atom)\n  }\n\n  _addDependency(dep) {\n    const deps = []\n\n    for (let i = 0; i < this.core.dependencies.length; i++) {\n      const d = this.core.dependencies[i]\n\n      if (dep !== null && d.length > dep.length) {\n        if (d.dataPointer !== dep.dataPointer) {\n          deps.push({ dataPointer: d.dataPointer, length: dep.length })\n        }\n        return deps\n      }\n\n      deps.push(d)\n    }\n\n    if (\n      dep !== null &&\n      (deps.length === 0 || deps[deps.length - 1].dataPointer !== dep.dataPointer)\n    ) {\n      deps.push(dep)\n    }\n    return deps\n  }\n\n  read() {\n    return new CoreRX(this.core, this.db, this.view)\n  }\n\n  write() {\n    return new CoreTX(this.core, this.db, this.atom ? this.view : null, [])\n  }\n\n  close() {\n    if (this.view !== null) {\n      this.view.readStop()\n      this.view = null\n    }\n\n    return this.db.close()\n  }\n\n  static async export(ptr, db, { batches = false } = {}) {\n    const rx = new CoreRX(ptr, db, EMPTY)\n\n    const core = {\n      head: null,\n      auth: null,\n      sessions: [],\n      data: null\n    }\n\n    const sessionsPromise = rx.getSessions()\n    const headPromise = rx.getHead()\n    const authPromise = rx.getAuth()\n\n    rx.tryFlush()\n\n    const [sessions, head, auth] = await Promise.all([sessionsPromise, headPromise, authPromise])\n\n    core.head = head\n    core.auth = { ...auth, keyPair: null }\n    if (sessions) core.sessions = sessions.map((s) => s.name)\n\n    const data = []\n\n    data.push(exportData(ptr, db))\n\n    if (batches) {\n      for (const { dataPointer } of sessions) {\n        data.push(exportData({ dataPointer, dependencies: [] }, db))\n      }\n    }\n\n    core.data = await Promise.all(data)\n\n    return core\n  }\n}\n\nclass CorestoreStorage {\n  constructor(db, opts = {}) {\n    const storage = typeof db === 'string' ? db : null\n\n    this.bootstrap = storage !== null\n    this.path = storage !== null ? storage : path.join(db.path, '..')\n    this.readOnly = !!opts.readOnly\n    this.allowBackup = !!opts.allowBackup\n    this.deviceFile = null\n    this.wait = !!opts.wait\n\n    // tmp sync fix for simplicty since not super deployed yet\n    if (this.bootstrap && !this.readOnly) tmpFixStorage(this.path)\n\n    this.id = opts.id || null\n    this.view = null\n    this.enters = 0\n    this.lock = new ScopeLock()\n    this.flushing = null\n    this.version = 0\n    this.migrating = null\n\n    if ((this.bootstrap && !this.readOnly && !this.allowBackup) || this.wait) {\n      const corestoreFile = path.join(this.path, 'CORESTORE')\n\n      this.deviceFile = new DeviceFile(corestoreFile, {\n        lock: true,\n        wait: this.wait,\n        data: { id: this.id }\n      })\n    }\n\n    const dbPath = path.join(this.path, 'db')\n\n    this.rocks = storage === null ? db : new RocksDB(dbPath, { ...opts, lock: this.deviceFile })\n    this.db = createColumnFamily(this.rocks, opts)\n  }\n\n  get opened() {\n    return this.db.opened\n  }\n\n  get closed() {\n    return this.db.closed\n  }\n\n  async ready() {\n    if (this.version === 0) await this._migrateStore()\n    return this.db.ready()\n  }\n\n  compact() {\n    return this.db.compactRange()\n  }\n\n  async audit() {\n    for await (const { core } of this.createCoreStream()) {\n      const coreRx = new CoreRX(core, this.db, EMPTY)\n      const authPromise = coreRx.getAuth()\n\n      coreRx.tryFlush()\n\n      const auth = await authPromise\n\n      if (!auth.manifest || auth.manifest.version > 0) continue\n      if (auth.manifest.linked === null) continue\n\n      auth.manifest.linked = null\n      const coreTx = new CoreTX(core, this.db, null, [])\n      coreTx.setAuth(auth)\n      await coreTx.flush()\n    }\n  }\n\n  async deleteCore(ptr) {\n    const rx = new CoreRX(ptr, this.db, EMPTY)\n\n    const authPromise = rx.getAuth()\n    const sessionsPromise = rx.getSessions()\n\n    rx.tryFlush()\n\n    const auth = await authPromise\n    const sessions = await sessionsPromise\n\n    // no core stored here\n    if (!auth) return\n\n    const tx = this.db.write({ autoDestroy: true })\n\n    tx.tryDelete(store.core(auth.discoveryKey))\n\n    // clear core\n    const start = core.core(ptr.corePointer)\n    const end = core.core(ptr.corePointer + 1)\n    tx.tryDeleteRange(start, end)\n\n    if (sessions) {\n      for (const { dataPointer } of sessions) {\n        const start = core.data(dataPointer)\n        const end = core.data(dataPointer + 1)\n        tx.tryDeleteRange(start, end)\n      }\n    }\n\n    return tx.flush()\n  }\n\n  static isCoreStorage(db) {\n    return isCorestoreStorage(db)\n  }\n\n  static from(db) {\n    if (isCorestoreStorage(db)) return db\n    return new this(db)\n  }\n\n  async _flush() {\n    while (this.enters > 0) {\n      await this.lock.lock()\n      await this.lock.unlock()\n    }\n  }\n\n  // runs pre any other mutation and read\n  async _migrateStore() {\n    const view = await this._enter()\n\n    try {\n      if (this.version === VERSION) return\n\n      await this._preopen\n      await this.db.ready()\n\n      const rx = new CorestoreRX(this.db, view)\n      const headPromise = rx.getHead()\n\n      rx.tryFlush()\n      const head = await headPromise\n\n      const version = head === null ? 0 : head.version\n      if (version === VERSION) {\n        this.version = VERSION\n        return\n      }\n\n      const target = { version: VERSION, dryRun: false }\n\n      switch (version) {\n        case 0: {\n          await require('./migrations/0').store(this, target)\n          break\n        }\n        default: {\n          throw new Error(\n            'Unsupported version: ' + version + ' - you should probably upgrade your dependencies'\n          )\n        }\n      }\n\n      this.version = VERSION\n    } finally {\n      await this._exit()\n    }\n  }\n\n  // runs pre the core is returned to the user\n  async _migrateCore(core, discoveryKey, version, locked) {\n    const view = locked ? this.view : await this._enter()\n    try {\n      if (version === VERSION) return\n\n      const target = { version: VERSION, dryRun: false }\n\n      switch (version) {\n        case 0: {\n          await require('./migrations/0').core(core, target)\n          break\n        }\n        default: {\n          throw new Error(\n            'Unsupported version: ' + version + ' - you should probably upgrade your dependencies'\n          )\n        }\n      }\n\n      if (locked === false) return\n\n      // if its locked, then move the core state into the memview\n      // in case the core is reopened from the memview, pre flush\n\n      const rx = new CorestoreRX(this.db, EMPTY)\n      const tx = new CorestoreTX(view)\n\n      const corePromise = rx.getCore(discoveryKey)\n      rx.tryFlush()\n\n      tx.putCore(discoveryKey, await corePromise)\n      tx.apply()\n    } finally {\n      if (!locked) await this._exit()\n    }\n  }\n\n  async _enter() {\n    this.enters++\n    await this.lock.lock()\n    if (this.view === null) this.view = new View()\n    return this.view\n  }\n\n  async _exit() {\n    this.enters--\n\n    if (this.flushing === null) this.flushing = rrp()\n    const flushed = this.flushing.promise\n\n    if (this.enters === 0 || this.view.size() > 128) {\n      try {\n        await View.flush(this.view.changes, this.db)\n        this.flushing.resolve()\n      } catch (err) {\n        this.flushing.reject(err)\n      } finally {\n        this.flushing = null\n        this.view = null\n      }\n    }\n\n    this.lock.unlock()\n    return flushed\n  }\n\n  // when used with core catches this isnt transactional for simplicity, HOWEVER, its just a number\n  // so worth the tradeoff\n  async _allocData() {\n    let dataPointer = 0\n\n    const view = await this._enter()\n    const tx = new CorestoreTX(view)\n\n    try {\n      const head = await this._getHead(view)\n\n      dataPointer = head.allocated.datas++\n\n      tx.setHead(head)\n      tx.apply()\n    } finally {\n      await this._exit()\n    }\n\n    return dataPointer\n  }\n\n  // exposes here so migrations can easily access the head in an init state\n  async _getHead(view) {\n    const rx = new CorestoreRX(this.db, view)\n    const headPromise = rx.getHead()\n    rx.tryFlush()\n\n    const head = await headPromise\n    return head === null ? initStoreHead() : head\n  }\n\n  createAtom() {\n    return new Atom(this.db)\n  }\n\n  async flush() {\n    await this.rocks.flush()\n  }\n\n  async close() {\n    if (this.db.closed) return\n    await this._flush()\n    await this.db.close()\n    await this.rocks.close()\n    if (this.deviceFile) await this.deviceFile.close()\n  }\n\n  async clear() {\n    if (this.version === 0) await this._migrateStore()\n\n    const view = await this._enter()\n    const tx = new CorestoreTX(view)\n\n    tx.clear()\n    tx.apply()\n\n    await this._exit()\n  }\n\n  createCoreStream() {\n    // TODO: be nice to run the mgiration here also, but too much plumbing atm\n    return createCoreStream(this.db, EMPTY)\n  }\n\n  createAliasStream(namespace) {\n    // TODO: be nice to run the mgiration here also, but too much plumbing atm\n    return createAliasStream(this.db, EMPTY, namespace)\n  }\n\n  createDiscoveryKeyStream(namespace) {\n    return createDiscoveryKeyStream(this.db, EMPTY, namespace)\n  }\n\n  async getAlias(alias) {\n    if (this.version === 0) await this._migrateStore()\n\n    const rx = new CorestoreRX(this.db, EMPTY)\n    const discoveryKeyPromise = rx.getCoreByAlias(alias)\n    rx.tryFlush()\n    return discoveryKeyPromise\n  }\n\n  async getSeed() {\n    if (this.version === 0) await this._migrateStore()\n\n    const rx = new CorestoreRX(this.db, EMPTY)\n    const headPromise = rx.getHead()\n\n    rx.tryFlush()\n\n    const head = await headPromise\n    return head === null ? null : head.seed\n  }\n\n  async setSeed(seed, { overwrite = true } = {}) {\n    if (this.version === 0) await this._migrateStore()\n\n    const view = await this._enter()\n    const tx = new CorestoreTX(view)\n\n    try {\n      const rx = new CorestoreRX(this.db, view)\n      const headPromise = rx.getHead()\n\n      rx.tryFlush()\n\n      const head = (await headPromise) || initStoreHead()\n\n      if (head.seed === null || overwrite) head.seed = seed\n      tx.setHead(head)\n      tx.apply()\n\n      return head.seed\n    } finally {\n      await this._exit()\n    }\n  }\n\n  async getDefaultDiscoveryKey() {\n    if (this.version === 0) await this._migrateStore()\n\n    const rx = new CorestoreRX(this.db, EMPTY)\n    const headPromise = rx.getHead()\n\n    rx.tryFlush()\n\n    const head = await headPromise\n    return head === null ? null : head.defaultDiscoveryKey\n  }\n\n  async setDefaultDiscoveryKey(discoveryKey, { overwrite = true } = {}) {\n    if (this.version === 0) await this._migrateStore()\n\n    const view = await this._enter()\n    const tx = new CorestoreTX(view)\n\n    try {\n      const rx = new CorestoreRX(this.db, view)\n      const headPromise = rx.getHead()\n\n      rx.tryFlush()\n\n      const head = (await headPromise) || initStoreHead()\n\n      if (head.defaultDiscoveryKey === null || overwrite) head.defaultDiscoveryKey = discoveryKey\n      tx.setHead(head)\n      tx.apply()\n\n      return head.defaultDiscoveryKey\n    } finally {\n      await this._exit()\n    }\n  }\n\n  async hasCore(discoveryKey, { ifMigrated = false } = {}) {\n    if (this.version === 0) await this._migrateStore()\n\n    const rx = new CorestoreRX(this.db, EMPTY)\n    const promise = rx.getCore(discoveryKey)\n\n    rx.tryFlush()\n\n    const core = await promise\n\n    if (core === null) return false\n    if (core.version !== VERSION && ifMigrated) return false\n\n    return true\n  }\n\n  async getAuth(discoveryKey) {\n    if (this.version === 0) await this._migrateStore()\n\n    const rx = new CorestoreRX(this.db, EMPTY)\n    const corePromise = rx.getCore(discoveryKey)\n\n    rx.tryFlush()\n\n    const core = await corePromise\n    if (core === null) return null\n\n    const read = this.db.read({ autoDestroy: true })\n    const authPromise = CoreRX.getAuth(read, core)\n\n    read.tryFlush()\n\n    return authPromise\n  }\n\n  async getInfo(discoveryKey, opts) {\n    return (await this.getInfos([discoveryKey], opts))[0]\n  }\n\n  async getInfos(discoveryKeys, { auth = true, head = true, hints = true } = {}) {\n    if (this.version === 0) await this._migrateStore()\n\n    const rx = new CorestoreRX(this.db, EMPTY)\n    const corePromises = new Array(discoveryKeys.length)\n\n    for (let i = 0; i < discoveryKeys.length; i++) {\n      corePromises[i] = rx.getCore(discoveryKeys[i])\n    }\n\n    rx.tryFlush()\n\n    const cores = await Promise.all(corePromises)\n    const read = this.db.read({ autoDestroy: true })\n\n    const resultPromises = new Array(cores.length)\n\n    for (let i = 0; i < cores.length; i++) {\n      resultPromises[i] = cores[i]\n        ? getInfoFromBatch(read, cores[i], discoveryKeys[i], auth, head, hints)\n        : null\n    }\n\n    read.tryFlush()\n\n    return Promise.all(resultPromises)\n  }\n\n  async suspend() {\n    await this.db.suspend()\n    if (this.deviceFile) await this.deviceFile.suspend()\n  }\n\n  async resume() {\n    if (this.deviceFile) await this.deviceFile.resume()\n    await this.db.resume()\n  }\n\n  async resumeCore(discoveryKey) {\n    if (this.version === 0) await this._migrateStore()\n\n    if (!discoveryKey) {\n      discoveryKey = await this.getDefaultDiscoveryKey()\n      if (!discoveryKey) return null\n    }\n\n    const rx = new CorestoreRX(this.db, EMPTY)\n    const corePromise = rx.getCore(discoveryKey)\n\n    rx.tryFlush()\n    const core = await corePromise\n\n    if (core === null) return null\n    return this._resumeFromPointers(EMPTY, discoveryKey, false, core)\n  }\n\n  async export(discoveryKey, opts) {\n    const rx = new CorestoreRX(this.db, EMPTY)\n    const corePromise = rx.getCore(discoveryKey)\n\n    rx.tryFlush()\n    const core = await corePromise\n    if (core === null) return null\n\n    let { dataPointer, corePointer } = core\n\n    const ptr = { corePointer, dataPointer, dependencies: [] }\n\n    while (true) {\n      const rx = new CoreRX({ dataPointer, corePointer: 0, dependencies: [] }, this.db, EMPTY)\n      const dependencyPromise = rx.getDependency()\n      rx.tryFlush()\n      const dependency = await dependencyPromise\n      if (!dependency) break\n      ptr.dependencies.push(dependency)\n      dataPointer = dependency.dataPointer\n    }\n\n    const session = this.db.session()\n    try {\n      return await HypercoreStorage.export(ptr, session, opts)\n    } finally {\n      await session.close()\n    }\n  }\n\n  async _resumeFromPointers(view, discoveryKey, create, { version, corePointer, dataPointer }) {\n    const core = { corePointer, dataPointer, dependencies: [] }\n\n    while (true) {\n      const rx = new CoreRX({ dataPointer, corePointer: 0, dependencies: [] }, this.db, view)\n      const dependencyPromise = rx.getDependency()\n      rx.tryFlush()\n      const dependency = await dependencyPromise\n      if (!dependency) break\n      core.dependencies.push(dependency)\n      dataPointer = dependency.dataPointer\n    }\n\n    const result = new HypercoreStorage(this, this.db.session(), core, EMPTY, null)\n\n    if (version < VERSION) await this._migrateCore(result, discoveryKey, version, create)\n    return result\n  }\n\n  // not allowed to throw validation errors as its a shared tx!\n  async _create(\n    view,\n    { key, manifest, keyPair, encryptionKey, discoveryKey, alias, userData, core: ptrs }\n  ) {\n    const rx = new CorestoreRX(this.db, view)\n    const tx = new CorestoreTX(view)\n\n    const corePromise = rx.getCore(discoveryKey)\n    const headPromise = rx.getHead()\n\n    rx.tryFlush()\n\n    let [core, head] = await Promise.all([corePromise, headPromise])\n    if (core) return this._resumeFromPointers(view, discoveryKey, true, core)\n\n    if (head === null) head = initStoreHead()\n    if (head.defaultDiscoveryKey === null) head.defaultDiscoveryKey = discoveryKey\n\n    const corePointer = ptrs ? ptrs.corePointer : head.allocated.cores++\n    const dataPointer = ptrs ? ptrs.dataPointer : head.allocated.datas++\n\n    core = { version: VERSION, corePointer, dataPointer, alias }\n\n    tx.setHead(head)\n    tx.putCore(discoveryKey, core)\n    if (alias) tx.putCoreByAlias(alias, discoveryKey)\n\n    const ptr = { corePointer, dataPointer, dependencies: [] }\n    const ctx = new CoreTX(ptr, this.db, view, tx.changes)\n\n    ctx.setAuth({\n      key,\n      discoveryKey,\n      manifest,\n      keyPair,\n      encryptionKey\n    })\n\n    if (userData) {\n      for (const { key, value } of userData) {\n        ctx.putUserData(key, value)\n      }\n    }\n\n    tx.apply()\n\n    return new HypercoreStorage(this, this.db.session(), ptr, EMPTY, null)\n  }\n\n  async createCore(data) {\n    if (this.version === 0) await this._migrateStore()\n\n    const view = await this._enter()\n\n    try {\n      return await this._create(view, data)\n    } finally {\n      await this._exit()\n    }\n  }\n}\n\nmodule.exports = CorestoreStorage\n\nfunction initStoreHead() {\n  return {\n    version: 0, // cause we wanna run the migration\n    allocated: {\n      datas: 0,\n      cores: 0\n    },\n    seed: null,\n    defaultDiscoveryKey: null\n  }\n}\n\nfunction getBatch(sessions, name, alloc) {\n  for (let i = 0; i < sessions.length; i++) {\n    if (sessions[i].name === name) return sessions[i]\n  }\n\n  if (!alloc) return null\n\n  const result = { name, dataPointer: -1 }\n  sessions.push(result)\n  return result\n}\n\nfunction isCorestoreStorage(s) {\n  return typeof s === 'object' && !!s && typeof s.setDefaultDiscoveryKey === 'function'\n}\n\nfunction createColumnFamily(db, opts = {}) {\n  const {\n    tableCacheIndexAndFilterBlocks = true,\n    blockCache = true,\n    optimizeFiltersForMemory = false\n  } = opts\n\n  const col = new RocksDB.ColumnFamily(COLUMN_FAMILY, {\n    enableBlobFiles: true,\n    minBlobSize: 4096,\n    blobFileSize: 256 * 1024 * 1024,\n    enableBlobGarbageCollection: true,\n    tableBlockSize: 8192,\n    tableCacheIndexAndFilterBlocks,\n    tableFormatVersion: 6,\n    optimizeFiltersForMemory,\n    blockCache\n  })\n\n  return db.columnFamily(col)\n}\n\n// TODO: remove in like 3-6 mo\nfunction tmpFixStorage(p) {\n  // if CORESTORE file is written, new format\n  if (fs.existsSync(path.join(p, 'CORESTORE'))) return\n\n  let files = []\n\n  try {\n    files = fs.readdirSync(p)\n  } catch {}\n\n  const notRocks = new Set([\n    'CORESTORE',\n    'primary-key',\n    'cores',\n    'app-preferences',\n    'cache',\n    'preferences.json',\n    'db',\n    'clone',\n    'core',\n    'notifications'\n  ])\n\n  for (const f of files) {\n    if (notRocks.has(f)) continue\n\n    try {\n      fs.mkdirSync(path.join(p, 'db'))\n    } catch {}\n\n    fs.renameSync(path.join(p, f), path.join(p, 'db', f))\n  }\n}\n\nasync function exportData(ptr, db, opts) {\n  // just need dataPointer\n  const reads = [\n    toArray(createBlockStream(ptr, db, EMPTY, opts)),\n    toArray(createTreeNodeStream(ptr, db, EMPTY, opts)),\n    toArray(createBitfieldStream(ptr, db, EMPTY, opts))\n  ]\n\n  const [blocks, tree, bitfield] = await Promise.all(reads)\n\n  return {\n    blocks,\n    tree,\n    bitfield\n  }\n}\n\nasync function toArray(stream) {\n  const all = []\n  for await (const e of stream) all.push(e)\n  return all\n}\n\nfunction noop() {}\n\nasync function getInfoFromBatch(db, c, discoveryKey, getAuth, getHead, getHints) {\n  const authPromise = getAuth ? CoreRX.getAuth(db, c) : null\n  const headPromise = getHead ? CoreRX.getHead(db, c) : null\n  const hintsPromise = getHints ? CoreRX.getHints(db, c) : null\n\n  // ensure no uncaughts\n  if (authPromise) authPromise.catch(noop)\n  if (headPromise) headPromise.catch(noop)\n  if (hintsPromise) hintsPromise.catch(noop)\n\n  return {\n    discoveryKey,\n    core: c,\n    auth: await authPromise,\n    head: await headPromise,\n    hints: await hintsPromise\n  }\n}\nconst { Readable, getStreamError } = require('streamx')\nconst { core } = require('./keys')\n\nmodule.exports = class BlockStream extends Readable {\n  constructor(core, db, updates, start, end, reverse) {\n    super()\n\n    this.core = core\n    this.db = db\n    this.updates = updates\n    this.start = start\n    this.end = end\n    this.reverse = reverse === true\n\n    this._drained = true\n    this._consumed = 0\n    this._stream = null\n    this._oncloseBound = this._onclose.bind(this)\n    this._maybeDrainBound = this._maybeDrain.bind(this)\n\n    this._update()\n  }\n\n  _update() {\n    if (this._consumed > this.core.dependencies.length) return\n\n    const deps = this.core.dependencies\n    const index = this._findDependencyIndex(deps)\n\n    const curr = index < deps.length ? deps[index] : null\n    const prev = index > 0 && index - 1 < deps.length ? deps[index - 1] : null\n\n    const start = prev && prev.length > this.start ? prev.length : this.start\n    const end = curr && (this.end === -1 || curr.length < this.end) ? curr.length : this.end\n\n    const ptr = curr ? curr.dataPointer : this.core.dataPointer\n\n    this._makeStream(core.block(ptr, start), core.block(ptr, end))\n  }\n\n  _findDependencyIndex(deps) {\n    if (!this.reverse) return this._consumed++\n\n    let i = deps.length - this._consumed++\n    while (i > 0) {\n      if (deps[i - 1].length <= this.end) return i\n      i--\n      this._consumed++\n    }\n\n    return 0\n  }\n\n  _predestroy() {\n    if (this._stream !== null) this._stream.destroy()\n  }\n\n  _read(cb) {\n    this._drained = this._onreadable()\n    cb(null)\n  }\n\n  _maybeDrain() {\n    if (this._drained === true) return\n    this._drained = this._onreadable()\n  }\n\n  _onreadable() {\n    if (this._stream === null) {\n      this.push(null)\n      return true\n    }\n\n    let data = this._stream.read()\n\n    if (data === null) return false\n\n    do {\n      this.push(data)\n      data = this._stream.read()\n    } while (data !== null)\n\n    return true\n  }\n\n  _onclose() {\n    if (this.destroying) return\n\n    const err = getStreamError(this._stream)\n\n    if (err !== null) {\n      this.destroy(err)\n      return\n    }\n\n    // empty the current stream\n    if (this._onreadable() === true) this._drained = true\n\n    this._stream = null\n\n    this._update()\n    this._maybeDrain()\n  }\n\n  _makeStream(start, end) {\n    this._stream = this.updates.iterator(this.db, start, end, this.reverse)\n    this._stream.on('readable', this._maybeDrainBound)\n    this._stream.on('error', noop)\n    this._stream.on('close', this._oncloseBound)\n  }\n}\n\nfunction noop() {}\nconst { Readable } = require('streamx')\n\n// used for returned a stream that just errors (during read during teardown)\n\nmodule.exports = class CloseErrorStream extends Readable {\n  constructor(err) {\n    super()\n    this.error = err\n  }\n\n  _open(cb) {\n    cb(this.error)\n  }\n}\nconst { UINT, STRING } = require('index-encoder')\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\n\nconst TL_HEAD = 0\nconst TL_CORE_BY_DKEY = 1\nconst TL_CORE_BY_ALIAS = 2\nconst TL_CORE = 3\nconst TL_DATA = 4\n\nconst TL_END = TL_DATA + 1\n\nconst CORE_AUTH = 0\nconst CORE_SESSIONS = 1\n\nconst DATA_HEAD = 0\nconst DATA_DEPENDENCY = 1\nconst DATA_HINTS = 2\nconst DATA_BLOCK = 3\nconst DATA_TREE = 4\nconst DATA_BITFIELD = 5\nconst DATA_USER_DATA = 6\nconst DATA_LOCAL = 7\n\nconst slab = { buffer: b4a.allocUnsafe(65536), start: 0, end: 0 }\n\nconst store = {}\nconst core = {}\n\nstore.clear = function () {\n  const state = alloc()\n  let start = state.start\n  UINT.encode(state, 0)\n  const a = state.buffer.subarray(start, state.start)\n  start = state.start\n  UINT.encode(state, TL_END)\n  const b = state.buffer.subarray(start, state.start)\n  return [a, b]\n}\n\nstore.head = function () {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_HEAD)\n  return state.buffer.subarray(start, state.start)\n}\n\nstore.core = function (discoveryKey) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_CORE_BY_DKEY)\n  c.fixed32.encode(state, discoveryKey)\n  return state.buffer.subarray(start, state.start)\n}\n\nstore.coreStart = function () {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_CORE_BY_DKEY)\n  return state.buffer.subarray(start, state.start)\n}\n\nstore.coreEnd = function () {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_CORE_BY_DKEY + 1)\n  return state.buffer.subarray(start, state.start)\n}\n\nstore.coreByAlias = function ({ namespace, name }) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_CORE_BY_ALIAS)\n  c.fixed32.encode(state, namespace)\n  STRING.encode(state, name)\n  return state.buffer.subarray(start, state.start)\n}\n\nstore.coreByAliasStart = function (namespace) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_CORE_BY_ALIAS)\n  if (namespace) c.fixed32.encode(state, namespace)\n  return state.buffer.subarray(start, state.start)\n}\n\nstore.coreByAliasEnd = function (namespace) {\n  const state = alloc()\n  const start = state.start\n\n  if (namespace) {\n    UINT.encode(state, TL_CORE_BY_ALIAS)\n    c.fixed32.encode(state, namespace)\n    state.buffer[state.start++] = 0xff\n  } else {\n    UINT.encode(state, TL_CORE_BY_ALIAS + 1)\n  }\n\n  return state.buffer.subarray(start, state.start)\n}\n\nstore.alias = function (buffer) {\n  const state = { buffer, start: 0, end: buffer.byteLength }\n  UINT.decode(state) // ns\n  const namespace = c.fixed32.decode(state)\n  const name = STRING.decode(state)\n  return { namespace, name }\n}\n\nstore.discoveryKey = function (buffer) {\n  const state = { buffer, start: 0, end: buffer.byteLength }\n  UINT.decode(state) // ns\n  return c.fixed32.decode(state)\n}\n\ncore.core = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_CORE)\n  UINT.encode(state, ptr)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.data = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.auth = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_CORE)\n  UINT.encode(state, ptr)\n  UINT.encode(state, CORE_AUTH)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.sessions = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_CORE)\n  UINT.encode(state, ptr)\n  UINT.encode(state, CORE_SESSIONS)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.head = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_HEAD)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.dependency = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_DEPENDENCY)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.hints = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_HINTS)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.block = function (ptr, index) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_BLOCK)\n  UINT.encode(state, index)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.tree = function (ptr, index) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_TREE)\n  UINT.encode(state, index)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.bitfield = function (ptr, index, type) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_BITFIELD)\n  UINT.encode(state, index)\n  UINT.encode(state, type)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.userData = function (ptr, key) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_USER_DATA)\n  STRING.encode(state, key)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.userDataEnd = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_USER_DATA + 1)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.local = function (ptr, key) {\n  if (key.byteLength > 2048) {\n    throw new Error('local keys has an upper limit of 2048 bytes atm')\n  }\n\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_LOCAL)\n\n  state.buffer.set(key, state.start)\n  state.start += key.byteLength\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.localEnd = function (ptr) {\n  const state = alloc()\n  const start = state.start\n  UINT.encode(state, TL_DATA)\n  UINT.encode(state, ptr)\n  UINT.encode(state, DATA_LOCAL + 1)\n  return state.buffer.subarray(start, state.start)\n}\n\ncore.blockIndex = function (buffer) {\n  const state = { buffer, start: 0, end: buffer.byteLength }\n  UINT.decode(state) // ns\n  UINT.decode(state) // ptr\n  UINT.decode(state) // type\n  return UINT.decode(state)\n}\n\ncore.bitfieldIndexAndType = function (buffer) {\n  const state = { buffer, start: 0, end: buffer.byteLength }\n  UINT.decode(state) // ns\n  UINT.decode(state) // ptr\n  UINT.decode(state) // type\n  return [UINT.decode(state), UINT.decode(state)]\n}\n\ncore.userDataKey = function (buffer) {\n  const state = { buffer, start: 0, end: buffer.byteLength }\n  UINT.decode(state) // ns\n  UINT.decode(state) // ptr\n  UINT.decode(state) // type\n  return STRING.decode(state)\n}\n\ncore.localKey = function (buffer) {\n  const state = { buffer, start: 0, end: buffer.byteLength }\n  UINT.decode(state) // ns\n  UINT.decode(state) // ptr\n  UINT.decode(state) // type\n  return state.buffer.subarray(state.start, state.end)\n}\n\nmodule.exports = { store, core }\n\nfunction alloc() {\n  if (slab.buffer.byteLength - slab.start < 4096) {\n    slab.buffer = b4a.allocUnsafe(slab.buffer.byteLength)\n    slab.start = 0\n  }\n  return slab\n}\nconst b4a = require('b4a')\nconst BlockDependencyStream = require('./block-dependency-stream.js')\nconst { core, store } = require('./keys.js')\nconst schema = require('../spec/hyperschema')\n\nconst CORESTORE_CORE = schema.getEncoding('@corestore/core')\nconst CORE_TREE_NODE = schema.getEncoding('@core/tree-node')\nconst EMPTY = b4a.alloc(0)\n\nmodule.exports = {\n  createBlockStream,\n  createBitfieldStream,\n  createUserDataStream,\n  createCoreStream,\n  createAliasStream,\n  createDiscoveryKeyStream,\n  createTreeNodeStream,\n  createLocalStream\n}\n\nfunction createCoreStream(db, view) {\n  const start = store.coreStart()\n  const end = store.coreEnd()\n\n  const ite = view.iterator(db, start, end, false)\n\n  ite._readableState.map = mapCore\n  return ite\n}\n\nfunction createDiscoveryKeyStream(db, view, namespace) {\n  const start = namespace ? store.coreByAliasStart(namespace) : store.coreStart()\n  const end = namespace ? store.coreByAliasEnd(namespace) : store.coreEnd()\n\n  const ite = view.iterator(db, start, end, false)\n\n  ite._readableState.map = namespace ? mapNamespaceDiscoveryKeys : mapAllDiscoveryKeys\n  return ite\n}\n\nfunction createAliasStream(db, view, namespace) {\n  const start = store.coreByAliasStart(namespace)\n  const end = store.coreByAliasEnd(namespace)\n\n  const ite = view.iterator(db, start, end, false)\n\n  ite._readableState.map = mapAlias\n  return ite\n}\n\nfunction createBlockIterator(ptr, db, view, start, end, reverse) {\n  if (ptr.dependencies.length > 0) {\n    return new BlockDependencyStream(ptr, db, view, start, end, reverse)\n  }\n\n  const s = core.block(ptr.dataPointer, start)\n  const e = core.block(ptr.dataPointer, end === -1 ? Infinity : end)\n  return view.iterator(db, s, e, reverse)\n}\n\nfunction createBlockStream(\n  ptr,\n  db,\n  view,\n  { gt = -1, gte = gt + 1, lte = -1, lt = lte === -1 ? -1 : lte + 1, reverse = false } = {}\n) {\n  const ite = createBlockIterator(ptr, db, view, gte, lt, reverse)\n\n  ite._readableState.map = mapBlock\n  return ite\n}\n\nfunction createBitfieldStream(\n  ptr,\n  db,\n  view,\n  { gt = -1, gte = gt + 1, lte = -1, lt = lte === -1 ? -1 : lte + 1, reverse = false } = {}\n) {\n  const s = core.bitfield(ptr.dataPointer, gte, 0)\n  const e = core.bitfield(ptr.dataPointer, lt === -1 ? Infinity : lt, 0)\n  const ite = view.iterator(db, s, e, false)\n\n  ite._readableState.map = mapBitfield\n  return ite\n}\n\n// NOTE: this does not do dependency lookups atm\nfunction createTreeNodeStream(\n  ptr,\n  db,\n  view,\n  { gt = -1, gte = gt + 1, lte = -1, lt = lte === -1 ? -1 : lte + 1, reverse = false } = {}\n) {\n  const s = core.tree(ptr.dataPointer, gte, 0)\n  const e = core.tree(ptr.dataPointer, lt === -1 ? Infinity : lt, 0)\n  const ite = view.iterator(db, s, e, false)\n\n  ite._readableState.map = mapTreeNode\n  return ite\n}\n\nfunction createUserDataStream(\n  ptr,\n  db,\n  view,\n  { gt = null, gte = '', lte = null, lt = null, reverse = false } = {}\n) {\n  if (gt !== null || lte !== null) {\n    throw new Error('gt and lte not yet supported for user data streams')\n  }\n\n  const s = core.userData(ptr.dataPointer, gte)\n  const e = lt === null ? core.userDataEnd(ptr.dataPointer) : core.userData(ptr.dataPointer, lt)\n  const ite = view.iterator(db, s, e, false)\n\n  ite._readableState.map = mapUserData\n  return ite\n}\n\nfunction createLocalStream(\n  ptr,\n  db,\n  view,\n  { gt = null, gte = EMPTY, lte = null, lt = null, reverse = false } = {}\n) {\n  if (gt !== null || lte !== null) throw new Error('gt and lte not yet supported for local streams')\n\n  const s = core.local(ptr.dataPointer, gte)\n  const e = lt === null ? core.localEnd(ptr.dataPointer) : core.local(ptr.dataPointer, lt)\n  const ite = view.iterator(db, s, e, false)\n\n  ite._readableState.map = mapLocal\n  return ite\n}\n\nfunction mapBitfield(data) {\n  const [index, type] = core.bitfieldIndexAndType(data.key)\n  if (type !== 0) return null // ignore for now\n  return { index, page: data.value }\n}\n\nfunction mapLocal(data) {\n  const key = core.localKey(data.key)\n  return { key, value: data.value }\n}\n\nfunction mapUserData(data) {\n  const key = core.userDataKey(data.key)\n  return { key, value: data.value }\n}\n\nfunction mapCore(data) {\n  const discoveryKey = store.discoveryKey(data.key)\n  const core = CORESTORE_CORE.decode({\n    start: 0,\n    end: data.value.byteLength,\n    buffer: data.value\n  })\n  return { discoveryKey, core }\n}\n\nfunction mapAllDiscoveryKeys(data) {\n  return store.discoveryKey(data.key)\n}\n\nfunction mapNamespaceDiscoveryKeys(data) {\n  return data.value\n}\n\nfunction mapAlias(data) {\n  const alias = store.alias(data.key)\n  return { alias, discoveryKey: data.value }\n}\n\nfunction mapBlock(data) {\n  return { index: core.blockIndex(data.key), value: data.value }\n}\n\nfunction mapTreeNode(data) {\n  return CORE_TREE_NODE.decode({\n    start: 0,\n    end: data.value.byteLength,\n    buffer: data.value\n  })\n}\nconst schema = require('../spec/hyperschema')\nconst { store, core } = require('./keys.js')\nconst View = require('./view.js')\nconst b4a = require('b4a')\nconst flat = require('flat-tree')\n\nconst CORESTORE_HEAD = schema.getEncoding('@corestore/head')\nconst CORESTORE_CORE = schema.getEncoding('@corestore/core')\n\nconst CORE_AUTH = schema.getEncoding('@core/auth')\nconst CORE_SESSIONS = schema.getEncoding('@core/sessions')\nconst CORE_HEAD = schema.getEncoding('@core/head')\nconst CORE_TREE_NODE = schema.getEncoding('@core/tree-node')\nconst CORE_DEPENDENCY = schema.getEncoding('@core/dependency')\nconst CORE_HINTS = schema.getEncoding('@core/hints')\n\nclass CoreTX {\n  constructor(core, db, view, changes) {\n    if (db.snapshotted) throw new Error('Cannot open core tx on snapshot')\n    this.core = core\n    this.db = db\n    this.view = view\n    this.changes = changes\n  }\n\n  setAuth(auth) {\n    this.changes.push([core.auth(this.core.corePointer), encode(CORE_AUTH, auth), null])\n  }\n\n  setSessions(sessions) {\n    this.changes.push([core.sessions(this.core.corePointer), encode(CORE_SESSIONS, sessions), null])\n  }\n\n  setHead(head) {\n    this.changes.push([core.head(this.core.dataPointer), encode(CORE_HEAD, head), null])\n  }\n\n  deleteHead() {\n    this.changes.push([core.head(this.core.dataPointer), null, null])\n  }\n\n  setDependency(dep) {\n    this.changes.push([core.dependency(this.core.dataPointer), encode(CORE_DEPENDENCY, dep), null])\n  }\n\n  setHints(hints) {\n    this.changes.push([core.hints(this.core.dataPointer), encode(CORE_HINTS, hints), null])\n  }\n\n  putBlock(index, data) {\n    this.changes.push([core.block(this.core.dataPointer, index), data, null])\n  }\n\n  deleteBlock(index) {\n    this.changes.push([core.block(this.core.dataPointer, index), null, null])\n  }\n\n  deleteBlockRange(start, end) {\n    this.changes.push([\n      core.block(this.core.dataPointer, start),\n      null,\n      core.block(this.core.dataPointer, end === -1 ? Infinity : end)\n    ])\n  }\n\n  putBitfieldPage(index, data) {\n    this.changes.push([core.bitfield(this.core.dataPointer, index, 0), data, null])\n  }\n\n  deleteBitfieldPage(index) {\n    this.changes.push([core.bitfield(this.core.dataPointer, index, 0), null, null])\n  }\n\n  deleteBitfieldPageRange(start, end) {\n    this.changes.push([\n      core.bitfield(this.core.dataPointer, start, 0),\n      null,\n      core.bitfield(this.core.dataPointer, end === -1 ? Infinity : end, 0)\n    ])\n  }\n\n  putTreeNode(node) {\n    this.changes.push([\n      core.tree(this.core.dataPointer, node.index),\n      encode(CORE_TREE_NODE, node),\n      null\n    ])\n  }\n\n  deleteTreeNode(index) {\n    this.changes.push([core.tree(this.core.dataPointer, index), null, null])\n  }\n\n  deleteTreeNodeRange(start, end) {\n    this.changes.push([\n      core.tree(this.core.dataPointer, start),\n      null,\n      core.tree(this.core.dataPointer, end === -1 ? Infinity : end)\n    ])\n  }\n\n  putUserData(key, value) {\n    const buffer = typeof value === 'string' ? b4a.from(value) : value\n    this.changes.push([core.userData(this.core.dataPointer, key), buffer, null])\n  }\n\n  deleteUserData(key) {\n    this.changes.push([core.userData(this.core.dataPointer, key), null, null])\n  }\n\n  putLocal(key, value) {\n    this.changes.push([core.local(this.core.dataPointer, key), value, null])\n  }\n\n  deleteLocal(key) {\n    this.changes.push([core.local(this.core.dataPointer, key), null, null])\n  }\n\n  deleteLocalRange(start, end) {\n    this.changes.push([\n      core.local(this.core.dataPointer, start),\n      null,\n      end === null ? core.localEnd(this.core.dataPointer) : core.local(this.core.dataPointer, end)\n    ])\n  }\n\n  flush() {\n    const changes = this.changes\n    if (changes === null) return Promise.resolve(!this.view)\n\n    this.changes = null\n\n    if (this.view) {\n      this.view.apply(changes)\n      return Promise.resolve(false)\n    }\n\n    return View.flush(changes, this.db)\n  }\n}\n\nclass CoreRX {\n  constructor(core, db, view) {\n    this.core = core\n    this.read = db.read({ autoDestroy: true })\n    this.view = view\n\n    view.readStart()\n  }\n\n  static async getAuth(db, c) {\n    return await decode(CORE_AUTH, await db.get(core.auth(c.corePointer)))\n  }\n\n  async getAuth() {\n    return await decode(CORE_AUTH, await this.view.get(this.read, core.auth(this.core.corePointer)))\n  }\n\n  async getSessions() {\n    return await decode(\n      CORE_SESSIONS,\n      await this.view.get(this.read, core.sessions(this.core.corePointer))\n    )\n  }\n\n  static async getHead(db, c) {\n    return await decode(CORE_HEAD, await db.get(core.head(c.dataPointer)))\n  }\n\n  async getHead() {\n    return await decode(CORE_HEAD, await this.view.get(this.read, core.head(this.core.dataPointer)))\n  }\n\n  async getDependency() {\n    return await decode(\n      CORE_DEPENDENCY,\n      await this.view.get(this.read, core.dependency(this.core.dataPointer))\n    )\n  }\n\n  static async getHints(db, c) {\n    return await decode(CORE_HINTS, await db.get(core.hints(c.dataPointer)))\n  }\n\n  async getHints() {\n    return await decode(\n      CORE_HINTS,\n      await this.view.get(this.read, core.hints(this.core.dataPointer))\n    )\n  }\n\n  getBlock(index) {\n    const dep = findBlockDependency(this.core.dependencies, index)\n    const data = dep === null ? this.core.dataPointer : dep.dataPointer\n    return this.view.get(this.read, core.block(data, index))\n  }\n\n  getBitfieldPage(index) {\n    return this.view.get(this.read, core.bitfield(this.core.dataPointer, index, 0))\n  }\n\n  async getTreeNode(index) {\n    const dep = findTreeDependency(this.core.dependencies, index)\n    const data = dep === null ? this.core.dataPointer : dep.dataPointer\n    return decode(CORE_TREE_NODE, await this.view.get(this.read, core.tree(data, index)))\n  }\n\n  async hasTreeNode(index) {\n    return (await this.getTreeNode(index)) !== null\n  }\n\n  getUserData(key) {\n    return this.view.get(this.read, core.userData(this.core.dataPointer, key))\n  }\n\n  getLocal(key) {\n    return this.view.get(this.read, core.local(this.core.dataPointer, key))\n  }\n\n  tryFlush() {\n    this.read.tryFlush()\n    this._free()\n  }\n\n  destroy() {\n    this.read.destroy()\n    this._free()\n  }\n\n  _free() {\n    if (this.view === null) return\n    this.view.readStop()\n    this.view = null\n  }\n}\n\nclass CorestoreTX {\n  constructor(view) {\n    this.view = view\n    this.changes = []\n  }\n\n  setHead(head) {\n    this.changes.push([store.head(), encode(CORESTORE_HEAD, head), null])\n  }\n\n  putCore(discoveryKey, ptr) {\n    this.changes.push([store.core(discoveryKey), encode(CORESTORE_CORE, ptr), null])\n  }\n\n  putCoreByAlias(alias, discoveryKey) {\n    this.changes.push([store.coreByAlias(alias), discoveryKey, null])\n  }\n\n  clear() {\n    const [start, end] = store.clear()\n    this.changes.push([start, null, end])\n  }\n\n  apply() {\n    if (this.changes === null) return\n    this.view.apply(this.changes)\n    this.changes = null\n  }\n}\n\nclass CorestoreRX {\n  constructor(db, view) {\n    this.read = db.read({ autoDestroy: true })\n    this.view = view\n\n    view.readStart()\n  }\n\n  async getHead() {\n    return decode(CORESTORE_HEAD, await this.view.get(this.read, store.head()))\n  }\n\n  async getCore(discoveryKey) {\n    return decode(CORESTORE_CORE, await this.view.get(this.read, store.core(discoveryKey)))\n  }\n\n  getCoreByAlias(alias) {\n    return this.view.get(this.read, store.coreByAlias(alias))\n  }\n\n  tryFlush() {\n    this.read.tryFlush()\n    this._free()\n  }\n\n  destroy() {\n    this.read.destroy()\n    this._free()\n  }\n\n  _free() {\n    if (this.view === null) return\n    this.view.readStop()\n    this.view = null\n  }\n}\n\nmodule.exports = { CorestoreTX, CorestoreRX, CoreTX, CoreRX }\n\nfunction findBlockDependency(dependencies, index) {\n  for (let i = 0; i < dependencies.length; i++) {\n    const dep = dependencies[i]\n    if (index < dep.length) return dep\n  }\n\n  return null\n}\n\nfunction findTreeDependency(dependencies, index) {\n  for (let i = 0; i < dependencies.length; i++) {\n    const dep = dependencies[i]\n    if (flat.rightSpan(index) <= (dep.length - 1) * 2) return dep\n  }\n\n  return null\n}\n\nfunction decode(enc, buffer) {\n  if (buffer === null) return null\n  return enc.decode({ start: 0, end: buffer.byteLength, buffer })\n}\n\nfunction encode(enc, m) {\n  // TODO: use fancy slab for small messages\n  const state = { start: 0, end: 0, buffer: null }\n  enc.preencode(state, m)\n  state.buffer = b4a.allocUnsafe(state.end)\n  enc.encode(state, m)\n  return state.buffer\n}\nconst { Readable, getStreamError } = require('streamx')\nconst CloseErrorStream = require('./close-error-stream.js')\nconst b4a = require('b4a')\n\nclass OverlayStream extends Readable {\n  constructor(stream, start, end, reverse, changes, cleared) {\n    super()\n\n    this.start = start\n    this.end = end\n    this.reverse = reverse\n    this.changes = changes\n    this.cleared = cleared\n    this.change = 0\n    this.range = 0\n\n    this._stream = stream\n    this._drained = false\n\n    this._stream.on('readable', this._drainMaybe.bind(this))\n    this._stream.on('error', noop)\n    this._stream.on('close', this._onclose.bind(this))\n  }\n\n  _drainMaybe() {\n    if (this._drained === true) return\n    this._drained = this._onreadable()\n  }\n\n  _onclose() {\n    if (this.destroying) return\n\n    const err = getStreamError(this._stream)\n\n    if (err !== null) {\n      this.destroy(err)\n      return\n    }\n\n    while (this.change < this.changes.length) {\n      const c = this.changes[this.change++]\n      const key = c[0]\n      const value = c[1]\n\n      if (value !== null && this._inRange(key)) this.push({ key, value })\n    }\n\n    this.push(null)\n    this._stream = null\n  }\n\n  _onreadable() {\n    let data = this._stream.read()\n    if (data === null) return false\n\n    let drained = false\n\n    do {\n      if (this._push(data) === true) drained = true\n      data = this._stream.read()\n    } while (data !== null)\n\n    return drained\n  }\n\n  _read(cb) {\n    this._drained = this._onreadable()\n    cb(null)\n  }\n\n  _predestroy() {\n    this.stream.destroy()\n  }\n\n  _push(entry) {\n    const key = entry.key\n\n    while (this.range < this.cleared.length) {\n      const c = this.cleared[this.range]\n\n      // we moved past the range\n      if (this.reverse ? b4a.compare(key, c[0]) < 0 : b4a.compare(c[2], key) <= 0) {\n        this.range++\n        continue\n      }\n\n      // we didnt move past and are in, drop\n      if (b4a.compare(c[0], key) <= 0 && b4a.compare(key, c[2]) < 0) {\n        return false\n      }\n\n      break\n    }\n\n    let updated = false\n\n    while (this.change < this.changes.length) {\n      const c = this.changes[this.change]\n      const key = c[0]\n      const value = typeof c[1] === 'string' ? b4a.from(c[1]) : c[1]\n      const cmp = b4a.compare(key, entry.key)\n\n      // same value, if not deleted, return new one\n      if (cmp === 0) {\n        this.change++\n        if (value === null || this._inRange(key) === false) return updated\n        this.push({ key, value })\n        return true\n      }\n\n      // we moved past the change, push it\n      if (this.reverse ? cmp > 0 : cmp < 0) {\n        this.change++\n        if (value === null || this._inRange(key) === false) continue\n        this.push({ key, value })\n        updated = true\n        continue\n      }\n\n      this.push(entry)\n      return true\n    }\n\n    this.push(entry)\n    return true\n  }\n\n  _inRange(key) {\n    return b4a.compare(this.start, key) <= 0 && b4a.compare(key, this.end) < 0\n  }\n}\n\nclass Overlay {\n  constructor() {\n    this.indexed = 0\n    this.changes = null\n    this.cleared = null\n    this.reverse = false\n  }\n\n  update(view, reverse) {\n    if (view.indexed === this.indexed) return\n\n    const changes = view.map === null ? [] : [...view.map.values()]\n    const cleared = view.cleared === null ? [] : view.cleared.slice(0)\n\n    const cmp = reverse ? cmpChangeReverse : cmpChange\n\n    changes.sort(cmp)\n    cleared.sort(cmp)\n\n    this.indexed = view.indexed\n    this.changes = changes\n    this.cleared = cleared\n    this.reverse = reverse\n  }\n\n  createStream(stream, start, end, reverse) {\n    return new OverlayStream(\n      stream,\n      start,\n      end,\n      reverse,\n      this.reverse === reverse ? this.changes : reverseArray(this.changes),\n      this.reverse === reverse ? this.cleared : reverseArray(this.cleared)\n    )\n  }\n}\n\nclass View {\n  constructor() {\n    this.map = null\n    this.indexed = 0\n    this.changes = null\n    this.cleared = null\n    this.overlay = null\n    this.snap = null\n    this.readers = 0\n  }\n\n  snapshot() {\n    if (this._attached()) return this.snap.snapshot()\n\n    const snap = new View()\n\n    snap.map = this.map\n    snap.indexed = this.indexed\n    snap.changes = this.changes\n    snap.cleared = this.cleared\n\n    if (this._frozen()) return snap\n\n    this.readers++\n    snap.snap = this\n\n    return snap\n  }\n\n  readStart() {\n    if (this.snap !== null) this.readers++\n  }\n\n  readStop() {\n    if (this.snap !== null && --this.readers === 0) this.snap.readers--\n  }\n\n  size() {\n    return this.changes === null ? 0 : this.changes.length\n  }\n\n  updated() {\n    return this.changes === null\n  }\n\n  get(read, key) {\n    return this.changes === null ? read.get(key) : this._indexAndGet(read, key)\n  }\n\n  reset() {\n    this.indexed = 0\n    this.snap = this.map = this.changes = this.cleared = this.overlay = null\n  }\n\n  iterator(db, start, end, reverse) {\n    if (dbClosing(db)) return new CloseErrorStream(new Error('RocksDB session is closed'))\n\n    const stream = db.iterator({ gte: start, lt: end, reverse })\n    if (this.changes === null) return stream\n\n    this._index()\n\n    if (this.overlay === null) this.overlay = new Overlay()\n    this.overlay.update(this, reverse)\n    return this.overlay.createStream(stream, start, end, reverse)\n  }\n\n  _indexAndGet(read, key) {\n    this._index()\n    const change = this.map.get(b4a.toString(key, 'hex'))\n\n    if (change === undefined) {\n      return this.cleared === null ? read.get(key) : this._readAndMaybeDrop(read, key)\n    }\n\n    return Promise.resolve(change[1])\n  }\n\n  async _readAndMaybeDrop(read, key) {\n    const cleared = this.cleared // in case its cleared\n    const value = await read.get(key)\n    if (value === null) return null\n\n    for (let i = 0; i < cleared.length; i++) {\n      const c = cleared[i]\n      // check if in range\n      if (b4a.compare(c[0], key) <= 0 && b4a.compare(key, c[2]) < 0) return null\n    }\n\n    return value\n  }\n\n  _attached() {\n    return this.snap !== null && this.changes === this.snap.changes\n  }\n\n  _frozen() {\n    return this.changes === null || (this.snap !== null && this.changes !== this.snap.changes)\n  }\n\n  _index() {\n    // if we are a snap and we are still attached (ie no mutations), simply copy the refs\n    if (this._attached()) {\n      this.snap._index()\n      this.map = this.snap.map\n      this.cleared = this.snap.cleared\n      this.indexed = this.snap.indexed\n      return\n    }\n\n    if (this.map === null) this.map = new Map()\n    if (this.changes.length === this.indexed) return\n\n    while (this.indexed < this.changes.length) {\n      const c = this.changes[this.indexed++]\n\n      if (c[2] === null) this.map.set(b4a.toString(c[0], 'hex'), c)\n      else this._indexRange(c)\n    }\n  }\n\n  _indexRange(range) {\n    const s = b4a.toString(range[0], 'hex')\n    const e = b4a.toString(range[2], 'hex')\n\n    for (const [key, c] of this.map) {\n      if (s <= key && key < e) this.map.set(key, [c[0], null, null])\n    }\n\n    if (this.cleared === null) this.cleared = []\n    this.cleared.push(range)\n  }\n\n  apply(changes) {\n    if (this.snap !== null) throw new Error('Illegal to push changes to a snapshot')\n\n    if (this.readers !== 0 && this.changes !== null) {\n      this.changes = this.changes.slice(0)\n      this.cleared = this.cleared === null ? null : this.cleared.slice(0)\n      this.map = this.map === null ? null : new Map([...this.map])\n    }\n\n    if (this.changes === null) {\n      this.changes = changes\n      return\n    }\n\n    for (let i = 0; i < changes.length; i++) {\n      this.changes.push(changes[i])\n    }\n  }\n\n  static async flush(changes, db) {\n    if (changes === null) return true\n\n    const w = db.write({ autoDestroy: true })\n\n    for (const [start, value, end] of changes) {\n      if (end !== null) w.tryDeleteRange(start, end)\n      else if (value !== null) w.tryPut(start, value)\n      else w.tryDelete(start)\n    }\n\n    await w.flush()\n\n    return true\n  }\n}\n\nmodule.exports = View\n\nfunction cmpChange(a, b) {\n  const c = b4a.compare(a[0], b[0])\n  return c === 0 ? b4a.compare(a[2], b[2]) : c\n}\n\nfunction cmpChangeReverse(a, b) {\n  return cmpChange(b, a)\n}\n\nfunction noop() {}\n\nfunction reverseArray(list) {\n  const r = new Array(list.length)\n  for (let i = 0; i < list.length; i++) r[r.length - 1 - i] = list[i]\n  return r\n}\n\n// TODO: expose from rocks instead\nfunction dbClosing(db) {\n  return db._state.closing || db._index === -1\n}\nconst fs = require('fs')\nconst path = require('path')\nconst { Readable } = require('streamx')\nconst b4a = require('b4a')\nconst flat = require('flat-tree')\nconst crypto = require('hypercore-crypto')\nconst c = require('compact-encoding')\nconst m = require('./messages.js')\nconst View = require('../../lib/view.js')\nconst { CorestoreTX, CoreTX, CorestoreRX } = require('../../lib/tx.js')\n\nconst EMPTY_NODE = b4a.alloc(40)\nconst EMPTY_PAGE = b4a.alloc(4096)\n\nlet TREE_01_SKIP = null\nlet TREE_04_SKIP = null\nlet TREE_16_SKIP = null\n\nclass CoreListStream extends Readable {\n  constructor (storage) {\n    super()\n\n    this.storage = storage\n    this.stack = []\n  }\n\n  async _open (cb) {\n    for (const a of await readdir(path.join(this.storage, 'cores'))) {\n      for (const b of await readdir(path.join(this.storage, 'cores', a))) {\n        for (const dkey of await readdir(path.join(this.storage, 'cores', a, b))) {\n          this.stack.push(path.join(this.storage, 'cores', a, b, dkey))\n        }\n      }\n    }\n\n    cb(null)\n  }\n\n  async _read (cb) {\n    while (true) {\n      const next = this.stack.pop()\n      if (!next) {\n        this.push(null)\n        break\n      }\n\n      const oplog = path.join(next, 'oplog')\n      const result = await readOplog(oplog)\n      if (!result) continue\n\n      this.push(result)\n      break\n    }\n\n    cb(null)\n  }\n}\n\nfunction decodeOplogHeader (state) {\n  c.uint32.decode(state) // cksum, ignore for now\n\n  const l = c.uint32.decode(state)\n  const length = l >> 2\n  const headerBit = l & 1\n  const partialBit = l & 2\n\n  if (state.end - state.start < length) return null\n\n  const end = state.start + length\n  const result = { header: headerBit, partial: partialBit !== 0, byteLength: length + 8, message: null }\n\n  try {\n    result.message = m.oplog.header.decode({ start: state.start, end, buffer: state.buffer })\n  } catch {\n    return null\n  }\n\n  state.start = end\n  return result\n}\n\nfunction decodeOplogEntry (state) {\n  if (state.end - state.start < 8) return null\n\n  c.uint32.decode(state) // cksum, ignore for now\n\n  const l = c.uint32.decode(state)\n  const length = l >>> 2\n  const headerBit = l & 1\n  const partialBit = l & 2\n\n  if (state.end - state.start < length) return null\n\n  const end = state.start + length\n\n  const result = { header: headerBit, partial: partialBit !== 0, byteLength: length + 8, message: null }\n\n  try {\n    result.message = m.oplog.entry.decode({ start: state.start, end, buffer: state.buffer })\n  } catch {\n    return null\n  }\n\n  state.start = end\n\n  return result\n}\n\nmodule.exports = { store, core }\n\nasync function store (storage, { version, dryRun = true, gc = true }) {\n  const stream = new CoreListStream(storage.path)\n  const view = new View()\n\n  const tx = new CorestoreTX(view)\n  const head = await storage._getHead(view)\n  const primaryKeyFile = path.join(storage.path, 'primary-key')\n\n  const primaryKey = await readFile(primaryKeyFile)\n\n  if (!head.seed) head.seed = primaryKey\n\n  for await (const data of stream) {\n    const key = data.header.key\n    const discoveryKey = crypto.discoveryKey(data.header.key)\n    const files = getFiles(data.path)\n\n    if (head.defaultDiscoveryKey === null) head.defaultDiscoveryKey = discoveryKey\n\n    const core = {\n      version: 0, // need later migration\n      corePointer: head.allocated.cores++,\n      dataPointer: head.allocated.datas++,\n      alias: null\n    }\n\n    const ptr = { version: 0, corePointer: core.corePointer, dataPointer: core.dataPointer, dependencies: [] }\n    const ctx = new CoreTX(ptr, storage.db, view, [])\n    const userData = new Map()\n    const treeNodes = new Map()\n\n    const auth = {\n      key,\n      discoveryKey,\n      manifest: data.header.manifest,\n      keyPair: data.header.keyPair,\n      encryptionKey: null\n    }\n\n    const tree = {\n      length: 0,\n      fork: 0,\n      rootHash: null,\n      signature: null\n    }\n\n    if (data.header.tree && data.header.tree.length) {\n      tree.length = data.header.tree.length\n      tree.fork = data.header.tree.fork\n      tree.rootHash = data.header.tree.rootHash\n      tree.signature = data.header.tree.signature\n    }\n\n    for (const { key, value } of data.header.userData) {\n      userData.set(key, value)\n    }\n\n    for (const e of data.entries) {\n      if (e.userData) userData.set(e.userData.key, e.userData.value)\n\n      if (e.treeNodes) {\n        for (const node of e.treeNodes) {\n          treeNodes.set(node.index, node)\n          ctx.putTreeNode(node)\n        }\n      }\n\n      if (e.treeUpgrade) {\n        if (e.treeUpgrade.ancestors !== tree.length) {\n          throw new Error('Unflushed truncations not migrate-able atm')\n        }\n\n        tree.length = e.treeUpgrade.length\n        tree.fork = e.treeUpgrade.fork\n        tree.rootHash = null\n        tree.signature = e.treeUpgrade.signature\n      }\n    }\n\n    if (userData.has('corestore/name') && userData.has('corestore/namespace')) {\n      core.alias = {\n        name: b4a.toString(userData.get('corestore/name')),\n        namespace: userData.get('corestore/namespace')\n      }\n      userData.delete('corestore/name')\n      userData.delete('corestore/namespace')\n    }\n\n    for (const [key, value] of userData) {\n      ctx.putUserData(key, value)\n    }\n\n    ctx.setAuth(auth)\n\n    const getTreeNode = (index) => (treeNodes.get(index) || getTreeNodeFromFile(files.tree, index))\n\n    if (tree.length) {\n      if (tree.rootHash === null) tree.rootHash = crypto.tree(await getRoots(tree.length, getTreeNode))\n      ctx.setHead(tree)\n    }\n\n    tx.putCore(discoveryKey, core)\n    if (core.alias) tx.putCoreByAlias(core.alias, discoveryKey)\n\n    await ctx.flush()\n  }\n\n  head.version = version\n  tx.setHead(head)\n  tx.apply()\n\n  if (dryRun) return\n\n  await View.flush(view.changes, storage.db)\n\n  if (gc) await rm(primaryKeyFile)\n}\n\nclass BlockSlicer {\n  constructor (filename) {\n    this.stream = fs.createReadStream(filename)\n    this.closed = new Promise(resolve => this.stream.once('close', resolve))\n    this.offset = 0\n    this.overflow = null\n  }\n\n  async take (offset, size) {\n    let buffer = null\n    if (offset < this.offset) throw new Error('overread')\n\n    while (true) {\n      let data = null\n\n      if (this.overflow) {\n        data = this.overflow\n        this.overflow = null\n      } else {\n        data = this.stream.read()\n\n        if (!data) {\n          await new Promise(resolve => this.stream.once('readable', resolve))\n          continue\n        }\n      }\n\n      let chunk = null\n\n      if (this.offset === offset || buffer) {\n        chunk = data\n      } else if (this.offset + data.byteLength > offset) {\n        chunk = data.subarray(offset - this.offset)\n      }\n\n      this.offset += data.byteLength\n      if (!chunk) continue\n\n      if (buffer) buffer = b4a.concat([buffer, chunk])\n      else buffer = chunk\n\n      if (buffer.byteLength < size) continue\n\n      const result = buffer.subarray(0, size)\n      this.overflow = size === buffer.byteLength ? null : buffer.subarray(result.byteLength)\n      this.offset -= (this.overflow ? this.overflow.byteLength : 0)\n      return result\n    }\n  }\n\n  close () {\n    this.stream.on('error', noop)\n    this.stream.destroy()\n    return this.closed\n  }\n}\n\nclass TreeSlicer {\n  constructor () {\n    this.buffer = null\n    this.offset = 0\n  }\n\n  get size () {\n    return this.buffer === null ? 0 : this.buffer.byteLength\n  }\n\n  push (data) {\n    if (this.buffer === null) this.buffer = data\n    else this.buffer = b4a.concat([this.buffer, data])\n    this.offset += data.byteLength\n  }\n\n  skip () {\n    let skipped = 0\n\n    if (TREE_01_SKIP === null) {\n      TREE_16_SKIP = b4a.alloc(16 * 40 * 100)\n      TREE_04_SKIP = TREE_16_SKIP.subarray(0, 4 * 40 * 100)\n      TREE_01_SKIP = TREE_16_SKIP.subarray(0, 1 * 40 * 100)\n    }\n\n    while (true) {\n      if (this.buffer.byteLength >= TREE_16_SKIP.byteLength) {\n        if (b4a.equals(this.buffer.subarray(0, TREE_16_SKIP.byteLength), TREE_16_SKIP)) {\n          this.buffer = this.buffer.subarray(TREE_16_SKIP.byteLength)\n          skipped += 1600\n          continue\n        }\n      }\n\n      if (this.buffer.byteLength >= TREE_04_SKIP.byteLength) {\n        if (b4a.equals(this.buffer.subarray(0, TREE_04_SKIP.byteLength), TREE_04_SKIP)) {\n          this.buffer = this.buffer.subarray(TREE_04_SKIP.byteLength)\n          skipped += 400\n          continue\n        }\n      }\n\n      if (this.buffer.byteLength >= TREE_01_SKIP.byteLength) {\n        if (b4a.equals(this.buffer.subarray(0, TREE_01_SKIP.byteLength), TREE_01_SKIP)) {\n          this.buffer = this.buffer.subarray(TREE_01_SKIP.byteLength)\n          skipped += 100\n          continue\n        }\n      }\n      break\n    }\n\n    return skipped\n  }\n\n  take () {\n    const len = 40\n\n    if (len <= this.size) {\n      const chunk = this.buffer.subarray(0, len)\n      this.buffer = this.buffer.subarray(len)\n      return chunk\n    }\n\n    return null\n  }\n}\n\nasync function core (core, { version, dryRun = true, gc = true }) {\n  if (dryRun) return // dryRun mode not supported atm\n\n  const rx = core.read()\n\n  const promises = [rx.getAuth(), rx.getHead()]\n  rx.tryFlush()\n\n  const [auth, head] = await Promise.all(promises)\n\n  if (!auth) return\n\n  const dk = b4a.toString(auth.discoveryKey, 'hex')\n  const files = getFiles(path.join(core.store.path, 'cores', dk.slice(0, 2), dk.slice(2, 4), dk))\n\n  if (head === null || head.length === 0) {\n    await commitCoreMigration(auth, core, version)\n    if (gc) await runGC()\n    return // no data\n  }\n\n  const oplog = await readOplog(files.oplog)\n  if (!oplog) {\n    const writable = !!auth.keyPair\n\n    if (writable) {\n      throw new Error('No oplog available writable core for ' + files.oplog + ', length = ' + (head ? head.length : 0))\n    }\n\n    // if not writable, just nuke it to recover, some bad state happened here, prop corruption from earlier versions\n    const w = core.write()\n\n    w.deleteBlockRange(0, -1)\n    w.deleteTreeNodeRange(0, -1)\n    w.deleteBitfieldPageRange(0, -1)\n    w.deleteHead()\n\n    await w.flush()\n\n    await commitCoreMigration(auth, core, version)\n    if (gc) await runGC()\n    return // no data\n  }\n\n  const treeData = new TreeSlicer()\n\n  let treeIndex = 0\n\n  if (await exists(files.tree)) {\n    for await (const data of fs.createReadStream(files.tree)) {\n      treeData.push(data)\n\n      let write = null\n\n      while (true) {\n        const skip = treeData.skip()\n        treeIndex += skip\n\n        const buf = treeData.take()\n        if (buf === null) break\n\n        const index = treeIndex++\n        if (b4a.equals(buf, EMPTY_NODE)) continue\n\n        if (write === null) write = core.write()\n        write.putTreeNode(decodeTreeNode(index, buf))\n      }\n\n      if (write !== null) await write.flush()\n    }\n  }\n\n  const buf = []\n  if (await exists(files.bitfield)) {\n    for await (const data of fs.createReadStream(files.bitfield)) {\n      buf.push(data)\n    }\n  }\n\n  let bitfield = b4a.concat(buf)\n  if (bitfield.byteLength & 4095) bitfield = b4a.concat([bitfield, b4a.alloc(4096 - (bitfield.byteLength & 4095))])\n\n  const pages = new Map()\n  const headerBits = new Map()\n\n  const roots = await getRootsFromStorage(core, head.length)\n\n  for (const e of oplog.entries) {\n    if (!e.bitfield) continue\n\n    for (let i = 0; i < e.bitfield.length; i++) {\n      headerBits.set(i + e.bitfield.start, !e.bitfield.drop)\n    }\n  }\n\n  let batch = []\n\n  const cache = new Map()\n  const blocks = new BlockSlicer(files.data)\n\n  for (const index of allBits(bitfield)) {\n    if (headerBits.get(index) === false) continue\n    if (index >= head.length) continue\n\n    setBitInPage(index)\n\n    batch.push(index)\n    if (batch.length < 1024) continue\n\n    await writeBlocksBatch()\n    continue\n  }\n\n  if (batch.length) await writeBlocksBatch()\n\n  await blocks.close()\n\n  const w = core.write()\n\n  for (const [index, bit] of headerBits) {\n    if (!bit) continue\n    if (index >= head.length) continue\n\n    setBitInPage(index)\n\n    const blk = await getBlockFromFile(files.data, core, index, roots, cache)\n    w.putBlock(index, blk)\n  }\n\n  for (const [index, page] of pages) {\n    w.putBitfieldPage(index, b4a.from(page.buffer, page.byteOffset, page.byteLength))\n  }\n\n  await w.flush()\n\n  let contiguousLength = 0\n  for await (const data of core.createBlockStream()) {\n    if (data.index === contiguousLength) contiguousLength++\n    else break\n  }\n\n  if (contiguousLength) {\n    const w = core.write()\n    w.setHints({ contiguousLength })\n    await w.flush()\n  }\n\n  await commitCoreMigration(auth, core, version)\n\n  if (gc) await runGC()\n\n  async function runGC () {\n    await rm(files.path)\n    await rmdir(path.join(files.path, '..'))\n    await rmdir(path.join(files.path, '../..'))\n    await rmdir(path.join(core.store.path, 'cores'))\n  }\n\n  function setBitInPage (index) {\n    const n = index & 32767\n    const p = (index - n) / 32768\n\n    let page = pages.get(p)\n\n    if (!page) {\n      page = new Uint32Array(1024)\n      pages.set(p, page)\n    }\n\n    const o = n & 31\n    const b = (n - o) / 32\n    const v = 1 << o\n\n    page[b] |= v\n  }\n\n  async function writeBlocksBatch () {\n    const read = core.read()\n    const promises = []\n    for (const index of batch) promises.push(getByteRangeFromStorage(read, 2 * index, roots, cache))\n    read.tryFlush()\n\n    const r = await Promise.all(promises)\n    const tx = core.write()\n\n    for (let i = 0; i < r.length; i++) {\n      const index = batch[i]\n      const [offset, size] = r[i]\n\n      const blk = await blocks.take(offset, size)\n      tx.putBlock(index, blk)\n    }\n\n    batch = []\n    if (cache.size > 16384) cache.clear()\n\n    await tx.flush()\n  }\n}\n\nasync function commitCoreMigration (auth, core, version) {\n  const view = new View()\n  const rx = new CorestoreRX(core.db, view)\n\n  const storeCorePromise = rx.getCore(auth.discoveryKey)\n  rx.tryFlush()\n\n  const storeCore = await storeCorePromise\n\n  storeCore.version = version\n\n  const tx = new CorestoreTX(view)\n\n  tx.putCore(auth.discoveryKey, storeCore)\n  tx.apply()\n\n  await View.flush(view.changes, core.db)\n}\n\nasync function getBlockFromFile (file, core, index, roots, cache) {\n  const rx = core.read()\n  const promise = getByteRangeFromStorage(rx, 2 * index, roots, cache)\n  rx.tryFlush()\n  const [offset, size] = await promise\n\n  return new Promise(function (resolve) {\n    readAll(file, size, offset, function (err, buf) {\n      if (err) return resolve(null)\n      resolve(buf)\n    })\n  })\n}\n\nfunction getFiles (dir) {\n  return {\n    path: dir,\n    oplog: path.join(dir, 'oplog'),\n    data: path.join(dir, 'data'),\n    tree: path.join(dir, 'tree'),\n    bitfield: path.join(dir, 'bitfield')\n  }\n}\n\nasync function getRootsFromStorage (core, length) {\n  const all = []\n  const rx = core.read()\n  for (const index of flat.fullRoots(2 * length)) {\n    all.push(rx.getTreeNode(index))\n  }\n  rx.tryFlush()\n  return Promise.all(all)\n}\n\nasync function getRoots (length, getTreeNode) {\n  const all = []\n  for (const index of flat.fullRoots(2 * length)) {\n    all.push(await getTreeNode(index))\n  }\n  return all\n}\n\nfunction getCached (read, cache, index) {\n  if (cache.has(index)) return cache.get(index)\n  const p = read.getTreeNode(index)\n  cache.set(index, p)\n  return p\n}\n\nasync function getByteRangeFromStorage (read, index, roots, cache) {\n  const promises = [getCached(read, cache, index), getByteOffsetFromStorage(read, index, roots, cache)]\n  const [node, offset] = await Promise.all(promises)\n  if (!node) throw new Error('Node not found during migration: ' + index)\n  return [offset, node.size]\n}\n\nasync function getByteOffsetFromStorage (rx, index, roots, cache) {\n  if (index === 0) return 0\n  if ((index & 1) === 1) index = flat.leftSpan(index)\n\n  let head = 0\n  let offset = 0\n\n  for (const node of roots) { // all async ticks happen once we find the root so safe\n    head += 2 * ((node.index - head) + 1)\n\n    if (index >= head) {\n      offset += node.size\n      continue\n    }\n\n    const ite = flat.iterator(node.index)\n    const promises = []\n\n    while (ite.index !== index) {\n      if (index < ite.index) {\n        ite.leftChild()\n      } else {\n        promises.push(getCached(rx, cache, ite.leftChild()))\n        ite.sibling()\n      }\n    }\n\n    const nodes = await Promise.all(promises)\n    for (const node of nodes) offset += node.size\n\n    return offset\n  }\n\n  throw new Error('Failed to find offset')\n}\n\nfunction decodeTreeNode (index, buf) {\n  return { index, size: c.decode(c.uint64, buf), hash: buf.subarray(8) }\n}\n\nasync function getTreeNodeFromFile (file, index) {\n  return new Promise(function (resolve) {\n    readAll(file, 40, index * 40, function (err, buf) {\n      if (err) return resolve(null)\n      resolve(decodeTreeNode(index, buf))\n    })\n  })\n}\n\nfunction readAll (filename, length, pos, cb) {\n  const buf = b4a.alloc(length)\n\n  fs.open(filename, 'r', function (err, fd) {\n    if (err) return cb(err)\n\n    let offset = 0\n\n    fs.read(fd, buf, offset, buf.byteLength, pos, function loop (err, read) {\n      if (err) return done(err)\n      if (read === 0) return done(new Error('Partial read'))\n      offset += read\n      if (offset === buf.byteLength) return done(null, buf)\n      fs.read(fd, offset, buf.byteLength - offset, buf, pos + offset, loop)\n    })\n\n    function done (err, value) {\n      fs.close(fd, () => cb(err, value))\n    }\n  })\n}\n\nasync function readdir (dir) {\n  try {\n    return await fs.promises.readdir(dir)\n  } catch {\n    return []\n  }\n}\n\nasync function exists (file) {\n  try {\n    await fs.promises.stat(file)\n    return true\n  } catch {\n    return false\n  }\n}\n\nasync function readFile (file) {\n  try {\n    return await fs.promises.readFile(file)\n  } catch {\n    return null\n  }\n}\n\nasync function rm (dir) {\n  try {\n    await fs.promises.rm(dir, { recursive: true })\n  } catch {}\n}\n\nasync function rmdir (dir) {\n  try {\n    await fs.promises.rmdir(dir)\n  } catch {}\n}\n\nfunction * allBits (buffer) {\n  for (let i = 0; i < buffer.byteLength; i += EMPTY_PAGE.byteLength) {\n    const page = buffer.subarray(i, i + EMPTY_NODE.byteLength)\n    if (b4a.equals(page, EMPTY_PAGE)) continue\n\n    const view = new Uint32Array(page.buffer, page.byteOffset, EMPTY_PAGE.byteLength / 4)\n\n    for (let j = 0; j < view.length; j++) {\n      const n = view[j]\n      if (n === 0) continue\n\n      for (let k = 0; k < 32; k++) {\n        const m = 1 << k\n        if (n & m) yield i * 8 + j * 32 + k\n      }\n    }\n  }\n}\n\nfunction readOplog (oplog) {\n  return new Promise(function (resolve) {\n    fs.readFile(oplog, function (err, buffer) {\n      if (err) return resolve(null)\n\n      const state = { start: 0, end: buffer.byteLength, buffer }\n      const headers = [1, 0]\n\n      const h1 = decodeOplogHeader(state)\n      state.start = 4096\n\n      const h2 = decodeOplogHeader(state)\n      state.start = 4096 * 2\n\n      if (!h1 && !h2) return resolve(null)\n\n      if (h1 && !h2) {\n        headers[0] = h1.header\n        headers[1] = h1.header\n      } else if (!h1 && h2) {\n        headers[0] = (h2.header + 1) & 1\n        headers[1] = h2.header\n      } else {\n        headers[0] = h1.header\n        headers[1] = h2.header\n      }\n\n      const header = (headers[0] + headers[1]) & 1\n      const result = { path: path.dirname(oplog), header: null, entries: [] }\n      const decoded = []\n\n      result.header = header ? h2.message : h1.message\n\n      if (result.header.external) {\n        fs.readFile(path.join(oplog, '../header'), function (err, buffer) {\n          if (err) return resolve(null)\n          const start = result.header.external.start\n          const end = start + result.header.external.length\n          result.header = m.oplog.header.decode({ buffer, start, end })\n          finish()\n        })\n        return\n      }\n\n      finish()\n\n      function finish () {\n        while (true) {\n          const entry = decodeOplogEntry(state)\n          if (!entry) break\n          if (entry.header !== header) break\n\n          decoded.push(entry)\n        }\n\n        while (decoded.length > 0 && decoded[decoded.length - 1].partial) decoded.pop()\n\n        for (const e of decoded) {\n          result.entries.push(e.message)\n        }\n\n        resolve(result)\n      }\n    })\n  })\n}\n\nfunction noop () {}\n// needed here for compat, copied from old hypercore, do not change this\n\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\n\nconst EMPTY = b4a.alloc(0)\nconst DEFAULT_NAMESPACE = b4a.from('4144eea531e483d54e0c14f4ca68e0644f355343ff6fcb0f005200e12cd747cb', 'hex')\n\nconst hashes = {\n  preencode (state, m) {\n    state.end++ // small uint\n  },\n  encode (state, m) {\n    if (m === 'blake2b') {\n      c.uint.encode(state, 0)\n      return\n    }\n\n    throw new Error('Unknown hash: ' + m)\n  },\n  decode (state) {\n    const n = c.uint.decode(state)\n    if (n === 0) return 'blake2b'\n    throw new Error('Unknown hash id: ' + n)\n  }\n}\n\nconst signatures = {\n  preencode (state, m) {\n    state.end++ // small uint\n  },\n  encode (state, m) {\n    if (m === 'ed25519') {\n      c.uint.encode(state, 0)\n      return\n    }\n\n    throw new Error('Unknown signature: ' + m)\n  },\n  decode (state) {\n    const n = c.uint.decode(state)\n    if (n === 0) return 'ed25519'\n    throw new Error('Unknown signature id: ' + n)\n  }\n}\n\nconst signer = {\n  preencode (state, m) {\n    signatures.preencode(state, m.signature)\n    c.fixed32.preencode(state, m.namespace)\n    c.fixed32.preencode(state, m.publicKey)\n  },\n  encode (state, m) {\n    signatures.encode(state, m.signature)\n    c.fixed32.encode(state, m.namespace)\n    c.fixed32.encode(state, m.publicKey)\n  },\n  decode (state) {\n    return {\n      signature: signatures.decode(state),\n      namespace: c.fixed32.decode(state),\n      publicKey: c.fixed32.decode(state)\n    }\n  }\n}\n\nconst signerArray = c.array(signer)\n\nconst prologue = {\n  preencode (state, p) {\n    c.fixed32.preencode(state, p.hash)\n    c.uint.preencode(state, p.length)\n  },\n  encode (state, p) {\n    c.fixed32.encode(state, p.hash)\n    c.uint.encode(state, p.length)\n  },\n  decode (state) {\n    return {\n      hash: c.fixed32.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst manifestv0 = {\n  preencode (state, m) {\n    hashes.preencode(state, m.hash)\n    state.end++ // type\n\n    if (m.prologue && m.signers.length === 0) {\n      c.fixed32.preencode(state, m.prologue.hash)\n      return\n    }\n\n    if (m.quorum === 1 && m.signers.length === 1 && !m.allowPatch) {\n      signer.preencode(state, m.signers[0])\n    } else {\n      state.end++ // flags\n      c.uint.preencode(state, m.quorum)\n      signerArray.preencode(state, m.signers)\n    }\n  },\n  encode (state, m) {\n    hashes.encode(state, m.hash)\n\n    if (m.prologue && m.signers.length === 0) {\n      c.uint.encode(state, 0)\n      c.fixed32.encode(state, m.prologue.hash)\n      return\n    }\n\n    if (m.quorum === 1 && m.signers.length === 1 && !m.allowPatch) {\n      c.uint.encode(state, 1)\n      signer.encode(state, m.signers[0])\n    } else {\n      c.uint.encode(state, 2)\n      c.uint.encode(state, m.allowPatch ? 1 : 0)\n      c.uint.encode(state, m.quorum)\n      signerArray.encode(state, m.signers)\n    }\n  },\n  decode (state) {\n    const hash = hashes.decode(state)\n    const type = c.uint.decode(state)\n\n    if (type > 2) throw new Error('Unknown type: ' + type)\n\n    if (type === 0) {\n      return {\n        version: 0,\n        hash,\n        allowPatch: false,\n        quorum: 0,\n        signers: [],\n        prologue: {\n          hash: c.fixed32.decode(state),\n          length: 0\n        }\n      }\n    }\n\n    if (type === 1) {\n      return {\n        version: 0,\n        hash,\n        allowPatch: false,\n        quorum: 1,\n        signers: [signer.decode(state)],\n        prologue: null\n      }\n    }\n\n    const flags = c.uint.decode(state)\n\n    return {\n      version: 0,\n      hash,\n      allowPatch: (flags & 1) !== 0,\n      quorum: c.uint.decode(state),\n      signers: signerArray.decode(state),\n      prologue: null\n    }\n  }\n}\n\nconst manifest = exports.manifest = {\n  preencode (state, m) {\n    state.end++ // version\n    if (m.version === 0) return manifestv0.preencode(state, m)\n\n    state.end++ // flags\n    hashes.preencode(state, m.hash)\n\n    c.uint.preencode(state, m.quorum)\n    signerArray.preencode(state, m.signers)\n    if (m.prologue) prologue.preencode(state, m.prologue)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.version)\n    if (m.version === 0) return manifestv0.encode(state, m)\n\n    c.uint.encode(state, (m.allowPatch ? 1 : 0) | (m.prologue ? 2 : 0) | (m.unencrypted ? 4 : 0))\n    hashes.encode(state, m.hash)\n\n    c.uint.encode(state, m.quorum)\n    signerArray.encode(state, m.signers)\n    if (m.prologue) prologue.encode(state, m.prologue)\n  },\n  decode (state) {\n    const v = c.uint.decode(state)\n    if (v === 0) return manifestv0.decode(state)\n    if (v !== 1) throw new Error('Unknown version: ' + v)\n\n    const flags = c.uint.decode(state)\n    const hash = hashes.decode(state)\n    const quorum = c.uint.decode(state)\n    const signers = signerArray.decode(state)\n    const unencrypted = (flags & 4) !== 0\n\n    return {\n      version: 1,\n      hash,\n      allowPatch: (flags & 1) !== 0,\n      quorum,\n      signers,\n      prologue: (flags & 2) === 0 ? null : prologue.decode(state),\n      unencrypted\n    }\n  }\n}\n\nconst node = {\n  preencode (state, n) {\n    c.uint.preencode(state, n.index)\n    c.uint.preencode(state, n.size)\n    c.fixed32.preencode(state, n.hash)\n  },\n  encode (state, n) {\n    c.uint.encode(state, n.index)\n    c.uint.encode(state, n.size)\n    c.fixed32.encode(state, n.hash)\n  },\n  decode (state) {\n    return {\n      index: c.uint.decode(state),\n      size: c.uint.decode(state),\n      hash: c.fixed32.decode(state)\n    }\n  }\n}\n\nconst nodeArray = c.array(node)\n\nconst wire = exports.wire = {}\n\nwire.handshake = {\n  preencode (state, m) {\n    c.uint.preencode(state, 1)\n    c.fixed32.preencode(state, m.capability)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.seeks ? 1 : 0)\n    c.fixed32.encode(state, m.capability)\n  },\n  decode (state) {\n    const flags = c.uint.decode(state)\n    return {\n      seeks: (flags & 1) !== 0,\n      capability: c.fixed32.decode(state)\n    }\n  }\n}\n\nconst requestBlock = {\n  preencode (state, b) {\n    c.uint.preencode(state, b.index)\n    c.uint.preencode(state, b.nodes)\n  },\n  encode (state, b) {\n    c.uint.encode(state, b.index)\n    c.uint.encode(state, b.nodes)\n  },\n  decode (state) {\n    return {\n      index: c.uint.decode(state),\n      nodes: c.uint.decode(state)\n    }\n  }\n}\n\nconst requestSeek = {\n  preencode (state, s) {\n    c.uint.preencode(state, s.bytes)\n    c.uint.preencode(state, s.padding)\n  },\n  encode (state, s) {\n    c.uint.encode(state, s.bytes)\n    c.uint.encode(state, s.padding)\n  },\n  decode (state) {\n    return {\n      bytes: c.uint.decode(state),\n      padding: c.uint.decode(state)\n    }\n  }\n}\n\nconst requestUpgrade = {\n  preencode (state, u) {\n    c.uint.preencode(state, u.start)\n    c.uint.preencode(state, u.length)\n  },\n  encode (state, u) {\n    c.uint.encode(state, u.start)\n    c.uint.encode(state, u.length)\n  },\n  decode (state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nwire.request = {\n  preencode (state, m) {\n    state.end++ // flags\n    c.uint.preencode(state, m.id)\n    c.uint.preencode(state, m.fork)\n\n    if (m.block) requestBlock.preencode(state, m.block)\n    if (m.hash) requestBlock.preencode(state, m.hash)\n    if (m.seek) requestSeek.preencode(state, m.seek)\n    if (m.upgrade) requestUpgrade.preencode(state, m.upgrade)\n    if (m.priority) c.uint.preencode(state, m.priority)\n  },\n  encode (state, m) {\n    const flags = (m.block ? 1 : 0) | (m.hash ? 2 : 0) | (m.seek ? 4 : 0) | (m.upgrade ? 8 : 0) | (m.manifest ? 16 : 0) | (m.priority ? 32 : 0)\n\n    c.uint.encode(state, flags)\n    c.uint.encode(state, m.id)\n    c.uint.encode(state, m.fork)\n\n    if (m.block) requestBlock.encode(state, m.block)\n    if (m.hash) requestBlock.encode(state, m.hash)\n    if (m.seek) requestSeek.encode(state, m.seek)\n    if (m.upgrade) requestUpgrade.encode(state, m.upgrade)\n    if (m.priority) c.uint.encode(state, m.priority)\n  },\n  decode (state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      id: c.uint.decode(state),\n      fork: c.uint.decode(state),\n      block: flags & 1 ? requestBlock.decode(state) : null,\n      hash: flags & 2 ? requestBlock.decode(state) : null,\n      seek: flags & 4 ? requestSeek.decode(state) : null,\n      upgrade: flags & 8 ? requestUpgrade.decode(state) : null,\n      manifest: (flags & 16) !== 0,\n      priority: flags & 32 ? c.uint.decode(state) : 0\n    }\n  }\n}\n\nwire.cancel = {\n  preencode (state, m) {\n    c.uint.preencode(state, m.request)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.request)\n  },\n  decode (state, m) {\n    return {\n      request: c.uint.decode(state)\n    }\n  }\n}\n\nconst dataUpgrade = {\n  preencode (state, u) {\n    c.uint.preencode(state, u.start)\n    c.uint.preencode(state, u.length)\n    nodeArray.preencode(state, u.nodes)\n    nodeArray.preencode(state, u.additionalNodes)\n    c.buffer.preencode(state, u.signature)\n  },\n  encode (state, u) {\n    c.uint.encode(state, u.start)\n    c.uint.encode(state, u.length)\n    nodeArray.encode(state, u.nodes)\n    nodeArray.encode(state, u.additionalNodes)\n    c.buffer.encode(state, u.signature)\n  },\n  decode (state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state),\n      nodes: nodeArray.decode(state),\n      additionalNodes: nodeArray.decode(state),\n      signature: c.buffer.decode(state)\n    }\n  }\n}\n\nconst dataSeek = {\n  preencode (state, s) {\n    c.uint.preencode(state, s.bytes)\n    nodeArray.preencode(state, s.nodes)\n  },\n  encode (state, s) {\n    c.uint.encode(state, s.bytes)\n    nodeArray.encode(state, s.nodes)\n  },\n  decode (state) {\n    return {\n      bytes: c.uint.decode(state),\n      nodes: nodeArray.decode(state)\n    }\n  }\n}\n\nconst dataBlock = {\n  preencode (state, b) {\n    c.uint.preencode(state, b.index)\n    c.buffer.preencode(state, b.value)\n    nodeArray.preencode(state, b.nodes)\n  },\n  encode (state, b) {\n    c.uint.encode(state, b.index)\n    c.buffer.encode(state, b.value)\n    nodeArray.encode(state, b.nodes)\n  },\n  decode (state) {\n    return {\n      index: c.uint.decode(state),\n      value: c.buffer.decode(state) || EMPTY,\n      nodes: nodeArray.decode(state)\n    }\n  }\n}\n\nconst dataHash = {\n  preencode (state, b) {\n    c.uint.preencode(state, b.index)\n    nodeArray.preencode(state, b.nodes)\n  },\n  encode (state, b) {\n    c.uint.encode(state, b.index)\n    nodeArray.encode(state, b.nodes)\n  },\n  decode (state) {\n    return {\n      index: c.uint.decode(state),\n      nodes: nodeArray.decode(state)\n    }\n  }\n}\n\nwire.data = {\n  preencode (state, m) {\n    state.end++ // flags\n    c.uint.preencode(state, m.request)\n    c.uint.preencode(state, m.fork)\n\n    if (m.block) dataBlock.preencode(state, m.block)\n    if (m.hash) dataHash.preencode(state, m.hash)\n    if (m.seek) dataSeek.preencode(state, m.seek)\n    if (m.upgrade) dataUpgrade.preencode(state, m.upgrade)\n    if (m.manifest) manifest.preencode(state, m.manifest)\n  },\n  encode (state, m) {\n    const flags = (m.block ? 1 : 0) | (m.hash ? 2 : 0) | (m.seek ? 4 : 0) | (m.upgrade ? 8 : 0) | (m.manifest ? 16 : 0)\n\n    c.uint.encode(state, flags)\n    c.uint.encode(state, m.request)\n    c.uint.encode(state, m.fork)\n\n    if (m.block) dataBlock.encode(state, m.block)\n    if (m.hash) dataHash.encode(state, m.hash)\n    if (m.seek) dataSeek.encode(state, m.seek)\n    if (m.upgrade) dataUpgrade.encode(state, m.upgrade)\n    if (m.manifest) manifest.encode(state, m.manifest)\n  },\n  decode (state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      request: c.uint.decode(state),\n      fork: c.uint.decode(state),\n      block: flags & 1 ? dataBlock.decode(state) : null,\n      hash: flags & 2 ? dataHash.decode(state) : null,\n      seek: flags & 4 ? dataSeek.decode(state) : null,\n      upgrade: flags & 8 ? dataUpgrade.decode(state) : null,\n      manifest: flags & 16 ? manifest.decode(state) : null\n    }\n  }\n}\n\nwire.noData = {\n  preencode (state, m) {\n    c.uint.preencode(state, m.request)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.request)\n  },\n  decode (state, m) {\n    return {\n      request: c.uint.decode(state)\n    }\n  }\n}\n\nwire.want = {\n  preencode (state, m) {\n    c.uint.preencode(state, m.start)\n    c.uint.preencode(state, m.length)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.start)\n    c.uint.encode(state, m.length)\n  },\n  decode (state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nwire.unwant = {\n  preencode (state, m) {\n    c.uint.preencode(state, m.start)\n    c.uint.preencode(state, m.length)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.start)\n    c.uint.encode(state, m.length)\n  },\n  decode (state, m) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nwire.range = {\n  preencode (state, m) {\n    state.end++ // flags\n    c.uint.preencode(state, m.start)\n    if (m.length !== 1) c.uint.preencode(state, m.length)\n  },\n  encode (state, m) {\n    c.uint.encode(state, (m.drop ? 1 : 0) | (m.length === 1 ? 2 : 0))\n    c.uint.encode(state, m.start)\n    if (m.length !== 1) c.uint.encode(state, m.length)\n  },\n  decode (state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      drop: (flags & 1) !== 0,\n      start: c.uint.decode(state),\n      length: (flags & 2) !== 0 ? 1 : c.uint.decode(state)\n    }\n  }\n}\n\nwire.bitfield = {\n  preencode (state, m) {\n    c.uint.preencode(state, m.start)\n    c.uint32array.preencode(state, m.bitfield)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.start)\n    c.uint32array.encode(state, m.bitfield)\n  },\n  decode (state, m) {\n    return {\n      start: c.uint.decode(state),\n      bitfield: c.uint32array.decode(state)\n    }\n  }\n}\n\nwire.sync = {\n  preencode (state, m) {\n    state.end++ // flags\n    c.uint.preencode(state, m.fork)\n    c.uint.preencode(state, m.length)\n    c.uint.preencode(state, m.remoteLength)\n  },\n  encode (state, m) {\n    c.uint.encode(state, (m.canUpgrade ? 1 : 0) | (m.uploading ? 2 : 0) | (m.downloading ? 4 : 0) | (m.hasManifest ? 8 : 0))\n    c.uint.encode(state, m.fork)\n    c.uint.encode(state, m.length)\n    c.uint.encode(state, m.remoteLength)\n  },\n  decode (state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      fork: c.uint.decode(state),\n      length: c.uint.decode(state),\n      remoteLength: c.uint.decode(state),\n      canUpgrade: (flags & 1) !== 0,\n      uploading: (flags & 2) !== 0,\n      downloading: (flags & 4) !== 0,\n      hasManifest: (flags & 8) !== 0\n    }\n  }\n}\n\nwire.reorgHint = {\n  preencode (state, m) {\n    c.uint.preencode(state, m.from)\n    c.uint.preencode(state, m.to)\n    c.uint.preencode(state, m.ancestors)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.from)\n    c.uint.encode(state, m.to)\n    c.uint.encode(state, m.ancestors)\n  },\n  decode (state) {\n    return {\n      from: c.uint.encode(state),\n      to: c.uint.encode(state),\n      ancestors: c.uint.encode(state)\n    }\n  }\n}\n\nwire.extension = {\n  preencode (state, m) {\n    c.string.preencode(state, m.name)\n    c.raw.preencode(state, m.message)\n  },\n  encode (state, m) {\n    c.string.encode(state, m.name)\n    c.raw.encode(state, m.message)\n  },\n  decode (state) {\n    return {\n      name: c.string.decode(state),\n      message: c.raw.decode(state)\n    }\n  }\n}\n\nconst keyValue = {\n  preencode (state, p) {\n    c.string.preencode(state, p.key)\n    c.buffer.preencode(state, p.value)\n  },\n  encode (state, p) {\n    c.string.encode(state, p.key)\n    c.buffer.encode(state, p.value)\n  },\n  decode (state) {\n    return {\n      key: c.string.decode(state),\n      value: c.buffer.decode(state)\n    }\n  }\n}\n\nconst treeUpgrade = {\n  preencode (state, u) {\n    c.uint.preencode(state, u.fork)\n    c.uint.preencode(state, u.ancestors)\n    c.uint.preencode(state, u.length)\n    c.buffer.preencode(state, u.signature)\n  },\n  encode (state, u) {\n    c.uint.encode(state, u.fork)\n    c.uint.encode(state, u.ancestors)\n    c.uint.encode(state, u.length)\n    c.buffer.encode(state, u.signature)\n  },\n  decode (state) {\n    return {\n      fork: c.uint.decode(state),\n      ancestors: c.uint.decode(state),\n      length: c.uint.decode(state),\n      signature: c.buffer.decode(state)\n    }\n  }\n}\n\nconst bitfieldUpdate = { // TODO: can maybe be folded into a HAVE later on with the most recent spec\n  preencode (state, b) {\n    state.end++ // flags\n    c.uint.preencode(state, b.start)\n    c.uint.preencode(state, b.length)\n  },\n  encode (state, b) {\n    state.buffer[state.start++] = b.drop ? 1 : 0\n    c.uint.encode(state, b.start)\n    c.uint.encode(state, b.length)\n  },\n  decode (state) {\n    const flags = c.uint.decode(state)\n    return {\n      drop: (flags & 1) !== 0,\n      start: c.uint.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst oplog = exports.oplog = {}\n\noplog.entry = {\n  preencode (state, m) {\n    state.end++ // flags\n    if (m.userData) keyValue.preencode(state, m.userData)\n    if (m.treeNodes) nodeArray.preencode(state, m.treeNodes)\n    if (m.treeUpgrade) treeUpgrade.preencode(state, m.treeUpgrade)\n    if (m.bitfield) bitfieldUpdate.preencode(state, m.bitfield)\n  },\n  encode (state, m) {\n    const s = state.start++\n    let flags = 0\n\n    if (m.userData) {\n      flags |= 1\n      keyValue.encode(state, m.userData)\n    }\n    if (m.treeNodes) {\n      flags |= 2\n      nodeArray.encode(state, m.treeNodes)\n    }\n    if (m.treeUpgrade) {\n      flags |= 4\n      treeUpgrade.encode(state, m.treeUpgrade)\n    }\n    if (m.bitfield) {\n      flags |= 8\n      bitfieldUpdate.encode(state, m.bitfield)\n    }\n\n    state.buffer[s] = flags\n  },\n  decode (state) {\n    const flags = c.uint.decode(state)\n    return {\n      userData: (flags & 1) !== 0 ? keyValue.decode(state) : null,\n      treeNodes: (flags & 2) !== 0 ? nodeArray.decode(state) : null,\n      treeUpgrade: (flags & 4) !== 0 ? treeUpgrade.decode(state) : null,\n      bitfield: (flags & 8) !== 0 ? bitfieldUpdate.decode(state) : null\n    }\n  }\n}\n\nconst keyPair = {\n  preencode (state, kp) {\n    c.buffer.preencode(state, kp.publicKey)\n    c.buffer.preencode(state, kp.secretKey)\n  },\n  encode (state, kp) {\n    c.buffer.encode(state, kp.publicKey)\n    c.buffer.encode(state, kp.secretKey)\n  },\n  decode (state) {\n    return {\n      publicKey: c.buffer.decode(state),\n      secretKey: c.buffer.decode(state)\n    }\n  }\n}\n\nconst reorgHint = {\n  preencode (state, r) {\n    c.uint.preencode(state, r.from)\n    c.uint.preencode(state, r.to)\n    c.uint.preencode(state, r.ancestors)\n  },\n  encode (state, r) {\n    c.uint.encode(state, r.from)\n    c.uint.encode(state, r.to)\n    c.uint.encode(state, r.ancestors)\n  },\n  decode (state) {\n    return {\n      from: c.uint.decode(state),\n      to: c.uint.decode(state),\n      ancestors: c.uint.decode(state)\n    }\n  }\n}\n\nconst reorgHintArray = c.array(reorgHint)\n\nconst hints = {\n  preencode (state, h) {\n    reorgHintArray.preencode(state, h.reorgs)\n    c.uint.preencode(state, h.contiguousLength)\n  },\n  encode (state, h) {\n    reorgHintArray.encode(state, h.reorgs)\n    c.uint.encode(state, h.contiguousLength)\n  },\n  decode (state) {\n    return {\n      reorgs: reorgHintArray.decode(state),\n      contiguousLength: state.start < state.end ? c.uint.decode(state) : 0\n    }\n  }\n}\n\nconst treeHeader = {\n  preencode (state, t) {\n    c.uint.preencode(state, t.fork)\n    c.uint.preencode(state, t.length)\n    c.buffer.preencode(state, t.rootHash)\n    c.buffer.preencode(state, t.signature)\n  },\n  encode (state, t) {\n    c.uint.encode(state, t.fork)\n    c.uint.encode(state, t.length)\n    c.buffer.encode(state, t.rootHash)\n    c.buffer.encode(state, t.signature)\n  },\n  decode (state) {\n    return {\n      fork: c.uint.decode(state),\n      length: c.uint.decode(state),\n      rootHash: c.buffer.decode(state),\n      signature: c.buffer.decode(state)\n    }\n  }\n}\n\nconst types = {\n  preencode (state, t) {\n    c.string.preencode(state, t.tree)\n    c.string.preencode(state, t.bitfield)\n    c.string.preencode(state, t.signer)\n  },\n  encode (state, t) {\n    c.string.encode(state, t.tree)\n    c.string.encode(state, t.bitfield)\n    c.string.encode(state, t.signer)\n  },\n  decode (state) {\n    return {\n      tree: c.string.decode(state),\n      bitfield: c.string.decode(state),\n      signer: c.string.decode(state)\n    }\n  }\n}\n\nconst externalHeader = {\n  preencode (state, m) {\n    c.uint.preencode(state, m.start)\n    c.uint.preencode(state, m.length)\n  },\n  encode (state, m) {\n    c.uint.encode(state, m.start)\n    c.uint.encode(state, m.length)\n  },\n  decode (state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst keyValueArray = c.array(keyValue)\n\noplog.header = {\n  preencode (state, h) {\n    state.end += 2 // version + flags\n    if (h.external) {\n      externalHeader.preencode(state, h.external)\n      return\n    }\n    c.fixed32.preencode(state, h.key)\n    if (h.manifest) manifest.preencode(state, h.manifest)\n    if (h.keyPair) keyPair.preencode(state, h.keyPair)\n    keyValueArray.preencode(state, h.userData)\n    treeHeader.preencode(state, h.tree)\n    hints.preencode(state, h.hints)\n  },\n  encode (state, h) {\n    c.uint.encode(state, 1)\n    if (h.external) {\n      c.uint.encode(state, 1) // ONLY set the first big for clarity\n      externalHeader.encode(state, h.external)\n      return\n    }\n    c.uint.encode(state, (h.manifest ? 2 : 0) | (h.keyPair ? 4 : 0))\n    c.fixed32.encode(state, h.key)\n    if (h.manifest) manifest.encode(state, h.manifest)\n    if (h.keyPair) keyPair.encode(state, h.keyPair)\n    keyValueArray.encode(state, h.userData)\n    treeHeader.encode(state, h.tree)\n    hints.encode(state, h.hints)\n  },\n  decode (state) {\n    const version = c.uint.decode(state)\n\n    if (version > 1) {\n      throw new Error('Invalid header version. Expected <= 1, got ' + version)\n    }\n\n    if (version === 0) {\n      const old = {\n        types: types.decode(state),\n        userData: keyValueArray.decode(state),\n        tree: treeHeader.decode(state),\n        signer: keyPair.decode(state),\n        hints: hints.decode(state)\n      }\n\n      return {\n        external: null,\n        key: old.signer.publicKey,\n        manifest: {\n          version: 0,\n          hash: old.types.tree,\n          allowPatch: false,\n          quorum: 1,\n          signers: [{\n            signature: old.types.signer,\n            namespace: DEFAULT_NAMESPACE,\n            publicKey: old.signer.publicKey\n          }],\n          prologue: null\n        },\n        keyPair: old.signer.secretKey ? old.signer : null,\n        userData: old.userData,\n        tree: old.tree,\n        hints: old.hints\n      }\n    }\n\n    const flags = c.uint.decode(state)\n\n    if (flags & 1) {\n      return {\n        external: externalHeader.decode(state),\n        key: null,\n        manifest: null,\n        keyPair: null,\n        userData: null,\n        tree: null,\n        hints: null\n      }\n    }\n\n    return {\n      external: null,\n      key: c.fixed32.decode(state),\n      manifest: (flags & 2) !== 0 ? manifest.decode(state) : null,\n      keyPair: (flags & 4) !== 0 ? keyPair.decode(state) : null,\n      userData: keyValueArray.decode(state),\n      tree: treeHeader.decode(state),\n      hints: hints.decode(state)\n    }\n  }\n}\n\nconst uintArray = c.array(c.uint)\n\nconst multisigInput = {\n  preencode (state, inp) {\n    c.uint.preencode(state, inp.signer)\n    c.fixed64.preencode(state, inp.signature)\n    c.uint.preencode(state, inp.patch)\n  },\n  encode (state, inp) {\n    c.uint.encode(state, inp.signer)\n    c.fixed64.encode(state, inp.signature)\n    c.uint.encode(state, inp.patch)\n  },\n  decode (state) {\n    return {\n      signer: c.uint.decode(state),\n      signature: c.fixed64.decode(state),\n      patch: c.uint.decode(state)\n    }\n  }\n}\n\nconst patchEncodingv0 = {\n  preencode (state, n) {\n    c.uint.preencode(state, n.start)\n    c.uint.preencode(state, n.length)\n    uintArray.preencode(state, n.nodes)\n  },\n  encode (state, n) {\n    c.uint.encode(state, n.start)\n    c.uint.encode(state, n.length)\n    uintArray.encode(state, n.nodes)\n  },\n  decode (state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state),\n      nodes: uintArray.decode(state)\n    }\n  }\n}\n\nconst multisigInputv0 = {\n  preencode (state, n) {\n    state.end++\n    c.uint.preencode(state, n.signer)\n    c.fixed64.preencode(state, n.signature)\n    if (n.patch) patchEncodingv0.preencode(state, n.patch)\n  },\n  encode (state, n) {\n    c.uint.encode(state, n.patch ? 1 : 0)\n    c.uint.encode(state, n.signer)\n    c.fixed64.encode(state, n.signature)\n    if (n.patch) patchEncodingv0.encode(state, n.patch)\n  },\n  decode (state) {\n    const flags = c.uint.decode(state)\n    return {\n      signer: c.uint.decode(state),\n      signature: c.fixed64.decode(state),\n      patch: (flags & 1) ? patchEncodingv0.decode(state) : null\n    }\n  }\n}\n\nconst multisigInputArrayv0 = c.array(multisigInputv0)\nconst multisigInputArray = c.array(multisigInput)\n\nconst compactNode = {\n  preencode (state, n) {\n    c.uint.preencode(state, n.index)\n    c.uint.preencode(state, n.size)\n    c.fixed32.preencode(state, n.hash)\n  },\n  encode (state, n) {\n    c.uint.encode(state, n.index)\n    c.uint.encode(state, n.size)\n    c.fixed32.encode(state, n.hash)\n  },\n  decode (state) {\n    return {\n      index: c.uint.decode(state),\n      size: c.uint.decode(state),\n      hash: c.fixed32.decode(state)\n    }\n  }\n}\n\nconst compactNodeArray = c.array(compactNode)\n\nexports.multiSignaturev0 = {\n  preencode (state, s) {\n    multisigInputArrayv0.preencode(state, s.proofs)\n    compactNodeArray.preencode(state, s.patch)\n  },\n  encode (state, s) {\n    multisigInputArrayv0.encode(state, s.proofs)\n    compactNodeArray.encode(state, s.patch)\n  },\n  decode (state) {\n    return {\n      proofs: multisigInputArrayv0.decode(state),\n      patch: compactNodeArray.decode(state)\n    }\n  }\n}\n\nexports.multiSignature = {\n  preencode (state, s) {\n    multisigInputArray.preencode(state, s.proofs)\n    compactNodeArray.preencode(state, s.patch)\n  },\n  encode (state, s) {\n    multisigInputArray.encode(state, s.proofs)\n    compactNodeArray.encode(state, s.patch)\n  },\n  decode (state) {\n    return {\n      proofs: multisigInputArray.decode(state),\n      patch: compactNodeArray.decode(state)\n    }\n  }\n}\n{\n  \"name\": \"hypercore-storage\",\n  \"version\": \"2.4.1\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"lib/*.js\",\n    \"spec/hyperschema/*.js\",\n    \"migrations/0/*.js\"\n  ],\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"lint\": \"prettier --check . && lunte\",\n    \"test\": \"node test/all.js\",\n    \"test:bare\": \"bare test/all.js\",\n    \"test:generate\": \"brittle -r test/all.js test/*.js\"\n  },\n  \"author\": \"Holepunch Inc.\",\n  \"license\": \"Apache-2.0\",\n  \"description\": \"Storage engine for Hypercore\",\n  \"imports\": {\n    \"fs\": {\n      \"bare\": \"bare-fs\",\n      \"default\": \"fs\"\n    },\n    \"path\": {\n      \"bare\": \"bare-path\",\n      \"default\": \"path\"\n    }\n  },\n  \"dependencies\": {\n    \"b4a\": \"^1.6.7\",\n    \"bare-fs\": \"^4.0.1\",\n    \"bare-path\": \"^3.0.0\",\n    \"compact-encoding\": \"^2.16.0\",\n    \"device-file\": \"^2.1.2\",\n    \"flat-tree\": \"^1.12.1\",\n    \"hypercore-crypto\": \"^3.4.2\",\n    \"hyperschema\": \"^1.7.0\",\n    \"index-encoder\": \"^3.3.2\",\n    \"resolve-reject-promise\": \"^1.0.0\",\n    \"rocksdb-native\": \"^3.11.0\",\n    \"scope-lock\": \"^1.2.4\",\n    \"streamx\": \"^2.21.1\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.7.0\",\n    \"lunte\": \"^1.2.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"test-tmp\": \"^1.3.1\"\n  }\n}\n// This file is autogenerated by the hyperschema compiler\n// Schema Version: 1\n/* eslint-disable camelcase */\n/* eslint-disable quotes */\n/* eslint-disable space-before-function-paren */\n\nconst { c } = require('hyperschema/runtime')\n\nconst VERSION = 1\n\n// eslint-disable-next-line no-unused-vars\nlet version = VERSION\n\n// @corestore/allocated\nconst encoding0 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.cores)\n    c.uint.preencode(state, m.datas)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.cores)\n    c.uint.encode(state, m.datas)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = c.uint.decode(state)\n\n    return {\n      cores: r0,\n      datas: r1\n    }\n  }\n}\n\n// @corestore/head\nconst encoding1 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.version)\n    state.end++ // max flag is 4 so always one byte\n\n    if (m.allocated) encoding0.preencode(state, m.allocated)\n    if (m.seed) c.fixed32.preencode(state, m.seed)\n    if (m.defaultDiscoveryKey) c.fixed32.preencode(state, m.defaultDiscoveryKey)\n  },\n  encode(state, m) {\n    const flags =\n      (m.allocated ? 1 : 0) |\n      (m.seed ? 2 : 0) |\n      (m.defaultDiscoveryKey ? 4 : 0)\n\n    c.uint.encode(state, m.version)\n    c.uint.encode(state, flags)\n\n    if (m.allocated) encoding0.encode(state, m.allocated)\n    if (m.seed) c.fixed32.encode(state, m.seed)\n    if (m.defaultDiscoveryKey) c.fixed32.encode(state, m.defaultDiscoveryKey)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      version: r0,\n      allocated: (flags & 1) !== 0 ? encoding0.decode(state) : null,\n      seed: (flags & 2) !== 0 ? c.fixed32.decode(state) : null,\n      defaultDiscoveryKey: (flags & 4) !== 0 ? c.fixed32.decode(state) : null\n    }\n  }\n}\n\n// @corestore/alias\nconst encoding2 = {\n  preencode(state, m) {\n    c.string.preencode(state, m.name)\n    c.fixed32.preencode(state, m.namespace)\n  },\n  encode(state, m) {\n    c.string.encode(state, m.name)\n    c.fixed32.encode(state, m.namespace)\n  },\n  decode(state) {\n    const r0 = c.string.decode(state)\n    const r1 = c.fixed32.decode(state)\n\n    return {\n      name: r0,\n      namespace: r1\n    }\n  }\n}\n\n// @corestore/core\nconst encoding3 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.version)\n    c.uint.preencode(state, m.corePointer)\n    c.uint.preencode(state, m.dataPointer)\n    state.end++ // max flag is 1 so always one byte\n\n    if (m.alias) encoding2.preencode(state, m.alias)\n  },\n  encode(state, m) {\n    const flags = m.alias ? 1 : 0\n\n    c.uint.encode(state, m.version)\n    c.uint.encode(state, m.corePointer)\n    c.uint.encode(state, m.dataPointer)\n    c.uint.encode(state, flags)\n\n    if (m.alias) encoding2.encode(state, m.alias)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = c.uint.decode(state)\n    const r2 = c.uint.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      version: r0,\n      corePointer: r1,\n      dataPointer: r2,\n      alias: (flags & 1) !== 0 ? encoding2.decode(state) : null\n    }\n  }\n}\n\nconst encoding4_enum = {\n  blake2b: 'blake2b'\n}\n\n// @core/hashes enum\nconst encoding4 = {\n  preencode (state, m) {\n    state.end++ // max enum is 0 so always one byte\n  },\n  encode (state, m) {\n    switch (m) {\n      case 'blake2b':\n        c.uint.encode(state, 0)\n        break\n      default:\n        throw new Error('Unknown enum')\n    }\n  },\n  decode (state) {\n    switch (c.uint.decode(state)) {\n      case 0:\n        return 'blake2b'\n      default: return null\n    }\n  }\n}\n\nconst encoding5_enum = {\n  ed25519: 'ed25519'\n}\n\n// @core/signatures enum\nconst encoding5 = {\n  preencode (state, m) {\n    state.end++ // max enum is 0 so always one byte\n  },\n  encode (state, m) {\n    switch (m) {\n      case 'ed25519':\n        c.uint.encode(state, 0)\n        break\n      default:\n        throw new Error('Unknown enum')\n    }\n  },\n  decode (state) {\n    switch (c.uint.decode(state)) {\n      case 0:\n        return 'ed25519'\n      default: return null\n    }\n  }\n}\n\n// @core/tree-node\nconst encoding6 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.index)\n    c.uint.preencode(state, m.size)\n    c.fixed32.preencode(state, m.hash)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.index)\n    c.uint.encode(state, m.size)\n    c.fixed32.encode(state, m.hash)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = c.uint.decode(state)\n    const r2 = c.fixed32.decode(state)\n\n    return {\n      index: r0,\n      size: r1,\n      hash: r2\n    }\n  }\n}\n\n// @core/signer\nconst encoding7 = {\n  preencode(state, m) {\n    encoding5.preencode(state, m.signature)\n    c.fixed32.preencode(state, m.namespace)\n    c.fixed32.preencode(state, m.publicKey)\n  },\n  encode(state, m) {\n    encoding5.encode(state, m.signature)\n    c.fixed32.encode(state, m.namespace)\n    c.fixed32.encode(state, m.publicKey)\n  },\n  decode(state) {\n    const r0 = encoding5.decode(state)\n    const r1 = c.fixed32.decode(state)\n    const r2 = c.fixed32.decode(state)\n\n    return {\n      signature: r0,\n      namespace: r1,\n      publicKey: r2\n    }\n  }\n}\n\n// @core/prologue\nconst encoding8 = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.hash)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.fixed32.encode(state, m.hash)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    const r0 = c.fixed32.decode(state)\n    const r1 = c.uint.decode(state)\n\n    return {\n      hash: r0,\n      length: r1\n    }\n  }\n}\n\n// @core/manifest.signers\nconst encoding9_4 = c.array(encoding7)\n// @core/manifest.linked\nconst encoding9_6 = c.array(c.fixed32)\n\n// @core/manifest\nconst encoding9 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.version)\n    state.end++ // max flag is 8 so always one byte\n    encoding4.preencode(state, m.hash)\n    c.uint.preencode(state, m.quorum)\n    encoding9_4.preencode(state, m.signers)\n\n    if (m.prologue) encoding8.preencode(state, m.prologue)\n    if (m.linked) encoding9_6.preencode(state, m.linked)\n    if (m.userData) c.buffer.preencode(state, m.userData)\n  },\n  encode(state, m) {\n    const flags =\n      (m.allowPatch ? 1 : 0) |\n      (m.prologue ? 2 : 0) |\n      (m.linked ? 4 : 0) |\n      (m.userData ? 8 : 0)\n\n    c.uint.encode(state, m.version)\n    c.uint.encode(state, flags)\n    encoding4.encode(state, m.hash)\n    c.uint.encode(state, m.quorum)\n    encoding9_4.encode(state, m.signers)\n\n    if (m.prologue) encoding8.encode(state, m.prologue)\n    if (m.linked) encoding9_6.encode(state, m.linked)\n    if (m.userData) c.buffer.encode(state, m.userData)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      version: r0,\n      hash: encoding4.decode(state),\n      quorum: c.uint.decode(state),\n      allowPatch: (flags & 1) !== 0,\n      signers: encoding9_4.decode(state),\n      prologue: (flags & 2) !== 0 ? encoding8.decode(state) : null,\n      linked: (flags & 4) !== 0 ? encoding9_6.decode(state) : null,\n      userData: (flags & 8) !== 0 ? c.buffer.decode(state) : null\n    }\n  }\n}\n\n// @core/keyPair\nconst encoding10 = {\n  preencode(state, m) {\n    c.buffer.preencode(state, m.publicKey)\n    c.buffer.preencode(state, m.secretKey)\n  },\n  encode(state, m) {\n    c.buffer.encode(state, m.publicKey)\n    c.buffer.encode(state, m.secretKey)\n  },\n  decode(state) {\n    const r0 = c.buffer.decode(state)\n    const r1 = c.buffer.decode(state)\n\n    return {\n      publicKey: r0,\n      secretKey: r1\n    }\n  }\n}\n\n// @core/auth.manifest\nconst encoding11_2 = c.frame(encoding9)\n\n// @core/auth\nconst encoding11 = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.key)\n    c.fixed32.preencode(state, m.discoveryKey)\n    state.end++ // max flag is 4 so always one byte\n\n    if (m.manifest) encoding11_2.preencode(state, m.manifest)\n    if (m.keyPair) encoding10.preencode(state, m.keyPair)\n    if (m.encryptionKey) c.buffer.preencode(state, m.encryptionKey)\n  },\n  encode(state, m) {\n    const flags =\n      (m.manifest ? 1 : 0) |\n      (m.keyPair ? 2 : 0) |\n      (m.encryptionKey ? 4 : 0)\n\n    c.fixed32.encode(state, m.key)\n    c.fixed32.encode(state, m.discoveryKey)\n    c.uint.encode(state, flags)\n\n    if (m.manifest) encoding11_2.encode(state, m.manifest)\n    if (m.keyPair) encoding10.encode(state, m.keyPair)\n    if (m.encryptionKey) c.buffer.encode(state, m.encryptionKey)\n  },\n  decode(state) {\n    const r0 = c.fixed32.decode(state)\n    const r1 = c.fixed32.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      key: r0,\n      discoveryKey: r1,\n      manifest: (flags & 1) !== 0 ? encoding11_2.decode(state) : null,\n      keyPair: (flags & 2) !== 0 ? encoding10.decode(state) : null,\n      encryptionKey: (flags & 4) !== 0 ? c.buffer.decode(state) : null\n    }\n  }\n}\n\n// @core/head\nconst encoding12 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.fork)\n    c.uint.preencode(state, m.length)\n    c.fixed32.preencode(state, m.rootHash)\n    c.buffer.preencode(state, m.signature)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.fork)\n    c.uint.encode(state, m.length)\n    c.fixed32.encode(state, m.rootHash)\n    c.buffer.encode(state, m.signature)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = c.uint.decode(state)\n    const r2 = c.fixed32.decode(state)\n    const r3 = c.buffer.decode(state)\n\n    return {\n      fork: r0,\n      length: r1,\n      rootHash: r2,\n      signature: r3\n    }\n  }\n}\n\n// @core/hints\nconst encoding13 = {\n  preencode(state, m) {\n    state.end++ // max flag is 2 so always one byte\n\n    if (m.contiguousLength) c.uint.preencode(state, m.contiguousLength)\n    if (m.remoteContiguousLength) c.uint.preencode(state, m.remoteContiguousLength)\n  },\n  encode(state, m) {\n    const flags =\n      (m.contiguousLength ? 1 : 0) |\n      (m.remoteContiguousLength ? 2 : 0)\n\n    c.uint.encode(state, flags)\n\n    if (m.contiguousLength) c.uint.encode(state, m.contiguousLength)\n    if (m.remoteContiguousLength) c.uint.encode(state, m.remoteContiguousLength)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      contiguousLength: (flags & 1) !== 0 ? c.uint.decode(state) : 0,\n      remoteContiguousLength: (flags & 2) !== 0 ? c.uint.decode(state) : 0\n    }\n  }\n}\n\n// @core/session\nconst encoding14 = {\n  preencode(state, m) {\n    c.string.preencode(state, m.name)\n    c.uint.preencode(state, m.dataPointer)\n  },\n  encode(state, m) {\n    c.string.encode(state, m.name)\n    c.uint.encode(state, m.dataPointer)\n  },\n  decode(state) {\n    const r0 = c.string.decode(state)\n    const r1 = c.uint.decode(state)\n\n    return {\n      name: r0,\n      dataPointer: r1\n    }\n  }\n}\n\n// @core/sessions\nconst encoding15 = c.array(encoding14)\n\n// @core/dependency\nconst encoding16 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.dataPointer)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.dataPointer)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = c.uint.decode(state)\n\n    return {\n      dataPointer: r0,\n      length: r1\n    }\n  }\n}\n\nfunction setVersion(v) {\n  version = v\n}\n\nfunction encode(name, value, v = VERSION) {\n  version = v\n  return c.encode(getEncoding(name), value)\n}\n\nfunction decode(name, buffer, v = VERSION) {\n  version = v\n  return c.decode(getEncoding(name), buffer)\n}\n\nfunction getEnum(name) {\n  switch (name) {\n    case '@core/hashes':\n      return encoding4_enum\n    case '@core/signatures':\n      return encoding5_enum\n    default:\n      throw new Error('Enum not found ' + name)\n  }\n}\n\nfunction getEncoding(name) {\n  switch (name) {\n    case '@corestore/allocated':\n      return encoding0\n    case '@corestore/head':\n      return encoding1\n    case '@corestore/alias':\n      return encoding2\n    case '@corestore/core':\n      return encoding3\n    case '@core/hashes':\n      return encoding4\n    case '@core/signatures':\n      return encoding5\n    case '@core/tree-node':\n      return encoding6\n    case '@core/signer':\n      return encoding7\n    case '@core/prologue':\n      return encoding8\n    case '@core/manifest':\n      return encoding9\n    case '@core/keyPair':\n      return encoding10\n    case '@core/auth':\n      return encoding11\n    case '@core/head':\n      return encoding12\n    case '@core/hints':\n      return encoding13\n    case '@core/session':\n      return encoding14\n    case '@core/sessions':\n      return encoding15\n    case '@core/dependency':\n      return encoding16\n    default:\n      throw new Error('Encoder not found ' + name)\n  }\n}\n\nfunction getStruct(name, v = VERSION) {\n  const enc = getEncoding(name)\n  return {\n    preencode(state, m) {\n      version = v\n      enc.preencode(state, m)\n    },\n    encode(state, m) {\n      version = v\n      enc.encode(state, m)\n    },\n    decode(state) {\n      version = v\n      return enc.decode(state)\n    }\n  }\n}\n\nconst resolveStruct = getStruct // compat\n\nmodule.exports = {\n  resolveStruct,\n  getStruct,\n  getEnum,\n  getEncoding,\n  encode,\n  decode,\n  setVersion,\n  version\n}\nconst { EventEmitter } = require('events')\nconst isOptions = require('is-options')\nconst crypto = require('hypercore-crypto')\nconst CoreStorage = require('hypercore-storage')\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\nconst NoiseSecretStream = require('@hyperswarm/secret-stream')\nconst Protomux = require('protomux')\nconst id = require('hypercore-id-encoding')\nconst safetyCatch = require('safety-catch')\nconst unslab = require('unslab')\n\nconst inspect = require('./lib/inspect')\nconst Core = require('./lib/core')\nconst Info = require('./lib/info')\nconst Download = require('./lib/download')\nconst DefaultEncryption = require('./lib/default-encryption')\nconst caps = require('./lib/caps')\nconst Replicator = require('./lib/replicator')\nconst { manifestHash, createManifest } = require('./lib/verifier')\nconst { ReadStream, WriteStream, ByteStream } = require('./lib/streams')\nconst { MerkleTree } = require('./lib/merkle-tree')\nconst {\n  ASSERTION,\n  BAD_ARGUMENT,\n  SESSION_CLOSED,\n  SESSION_MOVED,\n  SESSION_NOT_WRITABLE,\n  SNAPSHOT_NOT_AVAILABLE,\n  DECODING_ERROR\n} = require('hypercore-errors')\n\n// Hypercore actually does not have any notion of max/min block sizes\n// but we enforce 15mb to ensure smooth replication (each block is transmitted atomically)\nconst MAX_SUGGESTED_BLOCK_SIZE = 15 * 1024 * 1024\n\nclass Hypercore extends EventEmitter {\n  constructor(storage, key, opts) {\n    super()\n\n    if (isOptions(storage) && !storage.db) {\n      opts = storage\n      storage = null\n      key = opts.key || null\n    } else if (isOptions(key)) {\n      opts = key\n      key = opts.key || null\n    }\n\n    if (key && typeof key === 'string') key = id.decode(key)\n    if (!opts) opts = {}\n\n    if (!storage) storage = opts.storage\n\n    this.core = null\n    this.state = null\n    this.encryption = null\n    this.extensions = new Map()\n\n    this.valueEncoding = null\n    this.encodeBatch = null\n    this.activeRequests = []\n    this.sessions = null\n    this.ongc = null\n\n    this.keyPair = opts.keyPair || null\n    this.readable = true\n    this.writable = false\n    this.exclusive = false\n    this.opened = false\n    this.closed = false\n    this.weak = !!opts.weak\n    this.snapshotted = !!opts.snapshot\n    this.onseq = opts.onseq || null\n    this.onwait = opts.onwait || null\n    this.wait = opts.wait !== false\n    this.timeout = opts.timeout || 0\n    this.preload = null\n    this.closing = null\n    this.opening = null\n\n    this._readonly = opts.writable === false\n    this._preappend = preappend.bind(this)\n    this._snapshot = null\n    this._findingPeers = 0\n    this._active = opts.weak ? !!opts.active : opts.active !== false\n\n    this._sessionIndex = -1\n    this._stateIndex = -1 // maintained by session state\n    this._monitorIndex = -1 // maintained by replication state\n\n    this.opening = this._open(storage, key, opts)\n    this.opening.catch(safetyCatch)\n\n    this.on('newListener', maybeAddMonitor)\n  }\n\n  [Symbol.for('nodejs.util.inspect.custom')](depth, opts) {\n    return inspect(this, depth, opts)\n  }\n\n  static MAX_SUGGESTED_BLOCK_SIZE = MAX_SUGGESTED_BLOCK_SIZE\n\n  static DefaultEncryption = DefaultEncryption\n\n  static key(manifest, { compat, version, namespace } = {}) {\n    if (b4a.isBuffer(manifest)) {\n      manifest = { version, signers: [{ publicKey: manifest, namespace }] }\n    }\n    return compat ? manifest.signers[0].publicKey : manifestHash(createManifest(manifest))\n  }\n\n  static discoveryKey(key) {\n    return crypto.discoveryKey(key)\n  }\n\n  static blockEncryptionKey(key, encryptionKey) {\n    return DefaultEncryption.blockEncryptionKey(key, encryptionKey)\n  }\n\n  static getProtocolMuxer(stream) {\n    return stream.noiseStream.userData\n  }\n\n  static createCore(storage, opts) {\n    return new Core(Hypercore.defaultStorage(storage), { autoClose: false, ...opts })\n  }\n\n  static createProtocolStream(isInitiator, opts = {}) {\n    let outerStream = Protomux.isProtomux(isInitiator)\n      ? isInitiator.stream\n      : isStream(isInitiator)\n        ? isInitiator\n        : opts.stream\n\n    let noiseStream = null\n\n    if (outerStream) {\n      noiseStream = outerStream.noiseStream\n    } else {\n      noiseStream = new NoiseSecretStream(isInitiator, null, opts)\n      outerStream = noiseStream.rawStream\n    }\n    if (!noiseStream) throw BAD_ARGUMENT('Invalid stream', this.discoveryKey)\n\n    if (!noiseStream.userData) {\n      const protocol = Protomux.from(noiseStream)\n\n      if (opts.keepAlive !== false && noiseStream.keepAlive === 0) {\n        noiseStream.setKeepAlive(5000)\n      }\n      noiseStream.userData = protocol\n    }\n\n    if (opts.ondiscoverykey) {\n      noiseStream.userData.pair({ protocol: 'hypercore/alpha' }, opts.ondiscoverykey)\n    }\n\n    return outerStream\n  }\n\n  static defaultStorage(storage, opts = {}) {\n    if (CoreStorage.isCoreStorage(storage)) return storage\n\n    const directory = storage\n    return new CoreStorage(directory, opts)\n  }\n\n  static clearRequests(session, err) {\n    return Replicator.clearRequests(session, err)\n  }\n\n  snapshot(opts) {\n    return this.session({ ...opts, snapshot: true })\n  }\n\n  compact() {\n    return this.core.compact()\n  }\n\n  session(opts = {}) {\n    if (this.closing) {\n      // This makes the closing logic a lot easier. If this turns out to be a problem\n      // in practice, open an issue and we'll try to make a solution for it.\n      throw SESSION_CLOSED('Cannot make sessions on a closing core', this.discoveryKey)\n    }\n    if (opts.checkout !== undefined && !opts.name && !opts.atom) {\n      throw ASSERTION('Checkouts are only supported on atoms or named sessions', this.discoveryKey)\n    }\n\n    const wait = opts.wait === false ? false : this.wait\n    const writable = opts.writable === undefined ? !this._readonly : opts.writable === true\n    const onwait = opts.onwait === undefined ? this.onwait : opts.onwait\n    const onseq = opts.onseq === undefined ? this.onseq : opts.onseq\n    const timeout = opts.timeout === undefined ? this.timeout : opts.timeout\n    const weak = opts.weak === undefined ? this.weak : opts.weak\n    const Clz = opts.class || Hypercore\n    const s = new Clz(null, this.key, {\n      ...opts,\n      wait,\n      onwait,\n      onseq,\n      timeout,\n      writable,\n      weak,\n      parent: this\n    })\n\n    return s\n  }\n\n  async setEncryptionKey(key, opts) {\n    if (!this.opened) await this.opening\n    const encryption = this._getEncryptionProvider({ key, block: !!(opts && opts.block) })\n    return this.setEncryption(encryption)\n  }\n\n  async setEncryption(encryption) {\n    if (!this.opened) await this.opening\n\n    if (encryption === null) {\n      this.encryption = encryption\n      return\n    }\n\n    if (!isEncryptionProvider(encryption)) {\n      throw ASSERTION('Provider does not satisfy HypercoreEncryption interface', this.discoveryKey)\n    }\n\n    this.encryption = encryption\n  }\n\n  setKeyPair(keyPair) {\n    this.keyPair = keyPair\n  }\n\n  setActive(bool) {\n    const active = !!bool\n    if (active === this._active || this.closing) return\n    this._active = active\n    if (!this.opened) return\n    this.core.replicator.updateActivity(this._active ? 1 : -1)\n  }\n\n  async _open(storage, key, opts) {\n    const preload = opts.preload || (opts.parent && opts.parent.preload)\n\n    if (preload) {\n      this.sessions = [] // in case someone looks at it like with peers\n      this.preload = preload\n      opts = { ...opts, ...(await this.preload) }\n      this.preload = null\n    }\n\n    const parent = opts.parent || null\n    const core = opts.core || (parent && parent.core)\n    const sessions = opts.sessions || (parent && parent.sessions)\n    const ongc = opts.ongc || (parent && parent.ongc)\n\n    if (core) this.core = core\n    if (ongc) this.ongc = ongc\n    if (sessions) this.sessions = sessions\n\n    if (this.sessions === null) this.sessions = []\n    this._sessionIndex = this.sessions.push(this) - 1\n\n    if (this.core === null) initOnce(this, storage, key, opts)\n    if (this._monitorIndex === -2) this.core.addMonitor(this)\n\n    try {\n      await this._openSession(opts)\n    } catch (err) {\n      if (this.core.autoClose && this.core.hasSession() === false) await this.core.close()\n\n      if (this.exclusive) this.core.unlockExclusive()\n\n      this.core.removeMonitor(this)\n      this._removeSession()\n\n      if (this.state !== null) this.state.removeSession(this)\n\n      this.closed = true\n      this.emit('close')\n      throw err\n    }\n\n    this.emit('ready')\n\n    // if we are a weak session the core might have closed...\n    if (this.core.closing) this.close().catch(safetyCatch)\n  }\n\n  _removeSession() {\n    if (this._sessionIndex === -1) return\n    const head = this.sessions.pop()\n    if (head !== this) this.sessions[(head._sessionIndex = this._sessionIndex)] = head\n    this._sessionIndex = -1\n    if (this.ongc !== null) this.ongc(this)\n  }\n\n  async _openSession(opts) {\n    if (this.core.opened === false) await this.core.ready()\n\n    if (this.keyPair === null) this.keyPair = opts.keyPair || this.core.header.keyPair\n\n    const parent = opts.parent || null\n    if (parent && parent.encryption) this.encryption = parent.encryption\n\n    const e = getEncryptionOption(opts)\n    if (!this.encryption) this.encryption = this._getEncryptionProvider(e)\n\n    this.writable = this._isWritable()\n\n    if (opts.valueEncoding) {\n      this.valueEncoding = c.from(opts.valueEncoding)\n    }\n    if (opts.encodeBatch) {\n      this.encodeBatch = opts.encodeBatch\n    }\n\n    if (parent) {\n      if (parent._stateIndex === -1) await parent.ready()\n      if (!this.keyPair) this.keyPair = parent.keyPair\n\n      const ps = parent.state\n\n      if (ps) {\n        const shouldSnapshot = this.snapshotted && !ps.isSnapshot()\n        this.state = shouldSnapshot ? await ps.snapshot() : ps.ref()\n      }\n\n      if (this.snapshotted && this.core && !this._snapshot) {\n        this._updateSnapshot()\n      }\n    }\n\n    if (opts.exclusive && opts.writable !== false) {\n      this.exclusive = true\n      await this.core.lockExclusive()\n    }\n\n    const parentState = parent ? parent.state : this.core.state\n    const checkout = opts.checkout === undefined ? -1 : opts.checkout\n    const state = this.state\n\n    if (opts.atom) {\n      this.state = await parentState.createSession(null, false, opts.atom)\n      if (state) state.unref()\n    } else if (opts.name) {\n      // todo: need to make named sessions safe before ready\n      // atm we always copy the state in passCapabilities\n      this.state = await parentState.createSession(opts.name, !!opts.overwrite, null)\n      if (state) state.unref() // ref'ed above in setup session\n    }\n\n    if (this.state && checkout !== -1) {\n      if (!opts.name && !opts.atom) {\n        throw ASSERTION('Checkouts must be named or atomized', this.discoveryKey)\n      }\n      if (checkout > this.state.length) {\n        throw ASSERTION(\n          `Invalid checkout ${checkout} for ${opts.name}, length is ${this.state.length}`,\n          this.discoveryKey\n        )\n      }\n      if (this.state.prologue && checkout < this.state.prologue.length) {\n        throw ASSERTION(\n          `Invalid checkout ${checkout} for ${opts.name}, prologue length is ${this.state.prologue.length}`,\n          this.discoveryKey\n        )\n      }\n      if (checkout < this.state.length) await this.state.truncate(checkout, this.fork)\n    }\n\n    if (this.state === null) {\n      this.state = this.core.state.ref()\n    }\n\n    this.writable = this._isWritable()\n\n    if (this.snapshotted && this.core) this._updateSnapshot()\n\n    this.state.addSession(this)\n    // TODO: we need to rework the core reference flow, as the state and session do not always agree now due to moveTo\n    this.core = this.state.core // in case it was wrong...\n\n    if (opts.userData) {\n      const tx = this.state.storage.write()\n      for (const [key, value] of Object.entries(opts.userData)) {\n        tx.putUserData(key, value)\n      }\n      await tx.flush()\n    }\n\n    if (opts.manifest && !this.core.header.manifest) {\n      await this.core.setManifest(createManifest(opts.manifest))\n    }\n\n    this.core.replicator.updateActivity(this._active ? 1 : 0)\n\n    this.opened = true\n  }\n\n  get replicator() {\n    return this.core === null ? null : this.core.replicator\n  }\n\n  _getSnapshot() {\n    return {\n      length: this.state.length,\n      byteLength: this.state.byteLength,\n      fork: this.state.fork\n    }\n  }\n\n  _updateSnapshot() {\n    const prev = this._snapshot\n    const next = (this._snapshot = this._getSnapshot())\n\n    if (!prev) return true\n    return prev.length !== next.length || prev.fork !== next.fork\n  }\n\n  _isWritable() {\n    if (this._readonly) return false\n    if (this.state && !this.state.isDefault()) return true\n    return !!(this.keyPair && this.keyPair.secretKey)\n  }\n\n  close({ error } = {}) {\n    if (this.closing) return this.closing\n\n    this.closing = this._close(error || null)\n    return this.closing\n  }\n\n  clearRequests(activeRequests, error) {\n    if (!activeRequests.length) return\n    if (this.core) this.core.replicator.clearRequests(activeRequests, error)\n  }\n\n  async _close(error) {\n    if (this.opened === false) {\n      try {\n        await this.opening\n      } catch (err) {\n        if (!this.closed) throw err\n      }\n    }\n\n    if (this.closed === true) return\n\n    this.core.removeMonitor(this)\n    this.state.removeSession(this)\n    this._removeSession()\n\n    this.readable = false\n    this.writable = false\n    this.opened = false\n\n    const gc = []\n    for (const ext of this.extensions.values()) {\n      if (ext.session === this) gc.push(ext)\n    }\n    for (const ext of gc) ext.destroy()\n\n    this.core.replicator.findingPeers -= this._findingPeers\n    this.core.replicator.clearRequests(this.activeRequests, error)\n    this.core.replicator.updateActivity(this._active ? -1 : 0)\n\n    this._findingPeers = 0\n\n    this.state.unref()\n\n    if (this.exclusive) this.core.unlockExclusive()\n\n    if (this.core.hasSession()) {\n      // emit \"fake\" close as this is a session\n      this.closed = true\n      this.emit('close')\n      return\n    }\n\n    if (this.core.autoClose) await this.core.close()\n\n    this.closed = true\n    this.emit('close')\n  }\n\n  async commit(session, opts) {\n    await this.ready()\n    await session.ready()\n\n    return this.state.commit(session.state, { keyPair: this.keyPair, ...opts })\n  }\n\n  replicate(isInitiator, opts = {}) {\n    // Only limitation here is that ondiscoverykey doesn't work atm when passing a muxer directly,\n    // because it doesn't really make a lot of sense.\n    if (Protomux.isProtomux(isInitiator)) return this._attachToMuxer(isInitiator)\n\n    // if same stream is passed twice, ignore the 2nd one before we make sessions etc\n    if (isStream(isInitiator) && this._isAttached(isInitiator)) return isInitiator\n\n    const protocolStream = Hypercore.createProtocolStream(isInitiator, opts)\n    const noiseStream = protocolStream.noiseStream\n    const protocol = noiseStream.userData\n\n    this._attachToMuxer(protocol)\n\n    return protocolStream\n  }\n\n  _isAttached(stream) {\n    return (\n      stream.userData &&\n      this.core &&\n      this.core.replicator &&\n      this.core.replicator.attached(stream.userData)\n    )\n  }\n\n  _attachToMuxer(mux) {\n    if (this.opened) {\n      this.core.replicator.attachTo(mux)\n    } else {\n      this.opening.then(() => this.core.replicator.attachTo(mux), mux.destroy.bind(mux))\n    }\n\n    return mux\n  }\n\n  get id() {\n    return this.core === null ? null : this.core.id\n  }\n\n  get key() {\n    return this.core === null ? null : this.core.key\n  }\n\n  get discoveryKey() {\n    return this.core === null ? null : this.core.discoveryKey\n  }\n\n  get manifest() {\n    return this.core === null ? null : this.core.manifest\n  }\n\n  get length() {\n    if (this._snapshot) return this._snapshot.length\n    return this.opened === false ? 0 : this.state.length\n  }\n\n  get signedLength() {\n    return this.opened === false ? 0 : this.state.signedLength()\n  }\n\n  /**\n   * Deprecated. Use `const { byteLength } = await core.info()`.\n   */\n  get byteLength() {\n    if (this.opened === false) return 0\n    if (this._snapshot) return this._snapshot.byteLength\n    return this.state.byteLength - this.state.length * this.padding\n  }\n\n  get remoteContiguousLength() {\n    if (this.opened === false) return 0\n    return Math.min(this.core.state.length, this.core.header.hints.remoteContiguousLength)\n  }\n\n  get contiguousLength() {\n    if (this.opened === false) return 0\n    return Math.min(this.core.state.length, this.core.header.hints.contiguousLength)\n  }\n\n  get contiguousByteLength() {\n    return 0\n  }\n\n  get fork() {\n    if (this.opened === false) return 0\n    return this.state.fork\n  }\n\n  get padding() {\n    if (this.encryption && this.key && this.manifest) {\n      return this.encryption.padding(this.core, this.length)\n    }\n\n    return 0\n  }\n\n  get peers() {\n    return this.opened === false ? [] : this.core.replicator.peers\n  }\n\n  get globalCache() {\n    return this.opened === false ? null : this.core.globalCache\n  }\n\n  ready() {\n    return this.opening\n  }\n\n  async setUserData(key, value) {\n    if (this.opened === false) await this.opening\n    const existing = await this.getUserData(key)\n    if (existing && b4a.isBuffer(value) && b4a.equals(existing, value)) return\n    await this.state.setUserData(key, value)\n  }\n\n  async getUserData(key) {\n    if (this.opened === false) await this.opening\n    const batch = this.state.storage.read()\n    const p = batch.getUserData(key)\n    batch.tryFlush()\n    return p\n  }\n\n  transferSession(core) {\n    // todo: validate we can move\n\n    if (this.weak === false) {\n      this.core.activeSessions--\n      core.activeSessions++\n    }\n\n    if (this._monitorIndex >= 0) {\n      this.core.removeMonitor(this)\n      core.addMonitor(this)\n    }\n\n    const old = this.core\n\n    this.core = core\n\n    old.replicator.clearRequests(this.activeRequests, SESSION_MOVED())\n\n    this.emit('migrate', this.key)\n  }\n\n  findingPeers() {\n    this._findingPeers++\n    if (this.core !== null && !this.closing) this.core.replicator.findingPeers++\n\n    let once = true\n\n    return () => {\n      if (this.closing || !once) return\n      once = false\n      this._findingPeers--\n      if (this.core !== null && --this.core.replicator.findingPeers === 0) {\n        this.core.replicator.updateAll()\n      }\n    }\n  }\n\n  async info(opts) {\n    if (this.opened === false) await this.opening\n\n    return Info.from(this, opts)\n  }\n\n  async update(opts) {\n    if (this.opened === false) await this.opening\n    if (this.closing !== null) return false\n    if (this.snapshotted) return false\n\n    if (this.writable && (!opts || opts.force !== true)) return false\n\n    const remoteWait = this._shouldWait(opts, this.core.replicator.findingPeers > 0)\n\n    let upgraded = false\n\n    if (await this.core.replicator.applyPendingReorg()) {\n      upgraded = true\n    }\n\n    if (!upgraded && remoteWait) {\n      const activeRequests = (opts && opts.activeRequests) || this.activeRequests\n      const req = this.core.replicator.addUpgrade(activeRequests)\n\n      try {\n        upgraded = await req.promise\n      } catch (err) {\n        if (isSessionMoved(err)) return this.update(opts)\n        throw err\n      }\n    }\n\n    if (!upgraded) return false\n    return true\n  }\n\n  async seek(bytes, opts) {\n    if (this.opened === false) await this.opening\n    if (!isValidIndex(bytes)) throw ASSERTION('seek is invalid', this.discoveryKey)\n\n    const activeRequests = (opts && opts.activeRequests) || this.activeRequests\n\n    if (this.encryption && !this.core.manifest) {\n      const req = this.replicator.addUpgrade(activeRequests)\n      try {\n        await req.promise\n      } catch (err) {\n        if (isSessionMoved(err)) return this.seek(bytes, opts)\n        throw err\n      }\n    }\n\n    const s = MerkleTree.seek(this.state, bytes, this.padding)\n\n    const offset = await s.update()\n    if (offset) return offset\n\n    if (this.closing !== null) {\n      throw SESSION_CLOSED('cannot seek on a closed session', this.discoveryKey)\n    }\n\n    if (!this._shouldWait(opts, this.wait)) return null\n\n    const req = this.core.replicator.addSeek(activeRequests, s)\n\n    const timeout = opts && opts.timeout !== undefined ? opts.timeout : this.timeout\n    if (timeout) req.context.setTimeout(req, timeout)\n\n    try {\n      return await req.promise\n    } catch (err) {\n      if (isSessionMoved(err)) return this.seek(bytes, opts)\n      throw err\n    }\n  }\n\n  async has(start, end = start + 1) {\n    if (this.opened === false) await this.opening\n    if (!isValidIndex(start) || !isValidIndex(end)) {\n      throw ASSERTION('has range is invalid', this.discoveryKey)\n    }\n\n    if (this.state.isDefault()) {\n      if (end === start + 1) return this.core.bitfield.get(start)\n\n      const i = this.core.bitfield.firstUnset(start)\n      return i === -1 || i >= end\n    }\n\n    if (end === start + 1) {\n      const rx = this.state.storage.read()\n      const block = rx.getBlock(start)\n      rx.tryFlush()\n\n      return (await block) !== null\n    }\n\n    let count = 0\n\n    const stream = this.state.storage.createBlockStream({ gte: start, lt: end })\n    for await (const block of stream) {\n      if (block === null) return false\n      count++\n    }\n\n    return count === end - start\n  }\n\n  async get(index, opts) {\n    if (this.opened === false) await this.opening\n    if (!isValidIndex(index)) throw ASSERTION('block index is invalid', this.discoveryKey)\n\n    if (this.closing !== null) {\n      throw SESSION_CLOSED('cannot get on a closed session', this.discoveryKey)\n    }\n\n    const encoding =\n      (opts && opts.valueEncoding && c.from(opts.valueEncoding)) || this.valueEncoding\n\n    if (this.onseq !== null) this.onseq(index, this)\n\n    const req = this._get(index, opts)\n\n    let block = await req\n    if (!block) return null\n\n    if (opts && opts.raw) return block\n\n    if (this.encryption && (!opts || opts.decrypt !== false)) {\n      // Copy the block as it might be shared with other sessions.\n      block = b4a.from(block)\n\n      await this.encryption.decrypt(index, block, this.core)\n    }\n\n    return this._decode(encoding, block, index)\n  }\n\n  async clear(start, end = start + 1, opts) {\n    if (this.opened === false) await this.opening\n    if (this.closing !== null) {\n      throw SESSION_CLOSED('cannot clear on a closed session', this.discoveryKey)\n    }\n\n    if (typeof end === 'object') {\n      opts = end\n      end = start + 1\n    }\n\n    if (!isValidIndex(start) || !isValidIndex(end)) {\n      throw ASSERTION('clear range is invalid', this.discoveryKey)\n    }\n\n    const cleared = opts && opts.diff ? { blocks: 0 } : null\n\n    if (start >= end) return cleared\n    if (start >= this.length) return cleared\n\n    await this.state.clear(start, end, cleared)\n\n    return cleared\n  }\n\n  async purge() {\n    await this._closeAllSessions(null)\n    await this.core.purge()\n  }\n\n  async _get(index, opts) {\n    const block = await readBlock(this.state.storage.read(), index)\n\n    if (block !== null) return block\n\n    if (this.closing !== null) {\n      throw SESSION_CLOSED('cannot get on a closed session', this.discoveryKey)\n    }\n\n    // snapshot should check if core has block\n    if (this._snapshot !== null) {\n      checkSnapshot(this, index)\n      const coreBlock = await readBlock(this.core.state.storage.read(), index)\n\n      checkSnapshot(this, index)\n      if (coreBlock !== null) return coreBlock\n    }\n\n    // lets check the bitfield to see if we got it during the above async calls\n    // this is the last resort before replication, so always safe.\n    if (this.core.bitfield.get(index)) {\n      const coreBlock = await readBlock(this.state.storage.read(), index)\n      // TODO: this should not be needed, only needed atm in case we are doing a moveTo during this (we should fix)\n      if (coreBlock !== null) return coreBlock\n    }\n\n    if (!this._shouldWait(opts, this.wait)) return null\n\n    if (opts && opts.onwait) opts.onwait(index, this)\n    if (this.onwait) this.onwait(index, this)\n\n    const activeRequests = (opts && opts.activeRequests) || this.activeRequests\n\n    const req = this.core.replicator.addBlock(activeRequests, index)\n    req.snapshot = index < this.length\n\n    const timeout = opts && opts.timeout !== undefined ? opts.timeout : this.timeout\n    if (timeout) req.context.setTimeout(req, timeout)\n\n    let replicatedBlock = null\n\n    try {\n      replicatedBlock = await req.promise\n    } catch (err) {\n      if (isSessionMoved(err)) return this._get(index, opts)\n      throw err\n    }\n\n    if (this._snapshot !== null) checkSnapshot(this, index)\n    return maybeUnslab(replicatedBlock)\n  }\n\n  _shouldWait(opts, defaultValue) {\n    if (opts) {\n      if (opts.wait === false) return false\n      if (opts.wait === true) return true\n    }\n    return defaultValue\n  }\n\n  createReadStream(opts) {\n    return new ReadStream(this, opts)\n  }\n\n  createWriteStream() {\n    return new WriteStream(this)\n  }\n\n  createByteStream(opts) {\n    return new ByteStream(this, opts)\n  }\n\n  download(range) {\n    return new Download(this, range)\n  }\n\n  // TODO: get rid of this / deprecate it?\n  undownload(range) {\n    range.destroy(null)\n  }\n\n  // TODO: get rid of this / deprecate it?\n  cancel(request) {\n    // Do nothing for now\n  }\n\n  async truncate(newLength = 0, opts = {}) {\n    if (this.opened === false) await this.opening\n\n    const {\n      fork = this.state.fork + 1,\n      keyPair = this.keyPair,\n      signature = null\n    } = typeof opts === 'number' ? { fork: opts } : opts\n\n    const isDefault = this.state === this.core.state\n    const writable = !this._readonly && !!(signature || (keyPair && keyPair.secretKey))\n    if (isDefault && writable === false && (newLength > 0 || fork !== this.state.fork)) {\n      throw SESSION_NOT_WRITABLE('cannot append to a non-writable core', this.discoveryKey)\n    }\n\n    await this.state.truncate(newLength, fork, { keyPair, signature })\n\n    // TODO: Should propagate from an event triggered by the oplog\n    if (this.state === this.core.state) this.core.replicator.updateAll()\n  }\n\n  async append(blocks, opts = {}) {\n    if (this.opened === false) await this.opening\n\n    const isDefault = this.state === this.core.state\n    const defaultKeyPair = this.state.name === null ? this.keyPair : null\n\n    const { keyPair = defaultKeyPair, signature = null, maxLength, postappend = null } = opts\n    const writable =\n      !isDefault || !!signature || !!(keyPair && keyPair.secretKey) || opts.writable === true\n\n    if (this._readonly || writable === false) {\n      throw SESSION_NOT_WRITABLE('cannot append to a readonly core', this.discoveryKey)\n    }\n\n    blocks = Array.isArray(blocks) ? blocks : [blocks]\n\n    const preappend = this.encryption && this._preappend\n\n    const buffers = this.encodeBatch !== null ? this.encodeBatch(blocks) : new Array(blocks.length)\n\n    if (this.encodeBatch === null) {\n      for (let i = 0; i < blocks.length; i++) {\n        buffers[i] = this._encode(this.valueEncoding, blocks[i])\n      }\n    }\n    for (const b of buffers) {\n      if (b.byteLength > MAX_SUGGESTED_BLOCK_SIZE) {\n        throw BAD_ARGUMENT(\n          'Appended block exceeds the maximum suggested block size',\n          this.discoveryKey\n        )\n      }\n    }\n\n    return this.state.append(buffers, { keyPair, signature, preappend, postappend, maxLength })\n  }\n\n  async signable(length = -1, fork = -1) {\n    if (this.opened === false) await this.opening\n    if (length === -1) length = this.length\n    if (fork === -1) fork = this.fork\n\n    return caps.treeSignable(this.key, await this.treeHash(length), length, fork)\n  }\n\n  async treeHash(length = -1) {\n    if (this.opened === false) await this.opening\n    if (length === -1) length = this.length\n\n    const roots = await MerkleTree.getRoots(this.state, length)\n    return crypto.tree(roots)\n  }\n\n  async missingNodes(index) {\n    if (this.opened === false) await this.opening\n    return await MerkleTree.missingNodes(this.core.state, 2 * index, this.core.state.length)\n  }\n\n  async proof(opts) {\n    if (this.opened === false) await this.opening\n    const rx = this.state.storage.read()\n    const proofPromise = MerkleTree.proof(this.state, rx, opts)\n    const blockPromise = opts && opts.block ? rx.getBlock(opts.block.index) : null\n    rx.tryFlush()\n    const [proof, block] = await Promise.all([proofPromise, blockPromise])\n    const settled = await proof.settle()\n    if (block) settled.block.value = block\n    return settled\n  }\n\n  async applyProof(proof, from) {\n    if (this.opened === false) await this.opening\n    return this.core.verify(proof, from)\n  }\n\n  async verifyFullyRemote(proof) {\n    if (this.opened === false) await this.opening\n    const batch = await MerkleTree.verifyFullyRemote(this.state, proof)\n    await this.core._verifyBatchUpgrade(batch, proof.manifest)\n    return batch\n  }\n\n  registerExtension(name, handlers = {}) {\n    if (this.extensions.has(name)) {\n      const ext = this.extensions.get(name)\n      ext.handlers = handlers\n      ext.encoding = c.from(handlers.encoding || c.buffer)\n      ext.session = this\n      return ext\n    }\n\n    const ext = {\n      name,\n      handlers,\n      encoding: c.from(handlers.encoding || c.buffer),\n      session: this,\n      send(message, peer) {\n        const buffer = c.encode(this.encoding, message)\n        peer.extension(name, buffer)\n      },\n      broadcast(message) {\n        const buffer = c.encode(this.encoding, message)\n        for (const peer of this.session.peers) {\n          peer.extension(name, buffer)\n        }\n      },\n      destroy() {\n        for (const peer of this.session.peers) {\n          if (peer.extensions.get(name) === ext) peer.extensions.delete(name)\n        }\n        this.session.extensions.delete(name)\n      },\n      _onmessage(state, peer) {\n        const m = this.encoding.decode(state)\n        if (this.handlers.onmessage) this.handlers.onmessage(m, peer)\n      }\n    }\n\n    this.extensions.set(name, ext)\n\n    if (this.core === null) this._monitorIndex = -2\n    else this.core.addMonitor(this)\n\n    for (const peer of this.peers) {\n      peer.extensions.set(name, ext)\n    }\n\n    return ext\n  }\n\n  _encode(enc, val) {\n    const state = { start: this.padding, end: this.padding, buffer: null }\n\n    if (b4a.isBuffer(val)) {\n      if (state.start === 0) return val\n      state.end += val.byteLength\n    } else if (enc) {\n      enc.preencode(state, val)\n    } else {\n      val = b4a.from(val)\n      if (state.start === 0) return val\n      state.end += val.byteLength\n    }\n\n    state.buffer = b4a.allocUnsafe(state.end)\n\n    if (enc) enc.encode(state, val)\n    else state.buffer.set(val, state.start)\n\n    return state.buffer\n  }\n\n  _decode(enc, block, index) {\n    if (this.encryption) block = block.subarray(this.encryption.padding(this.core, index))\n    try {\n      if (enc) return c.decode(enc, block)\n    } catch (err) {\n      throw DECODING_ERROR(err.message, this.discoveryKey)\n    }\n    return block\n  }\n\n  _getEncryptionProvider(e) {\n    if (isEncryptionProvider(e)) return e\n    if (!e || !e.key) return null\n    return new DefaultEncryption(e.key, this.key, { block: e.block, compat: this.core.compat })\n  }\n}\n\nmodule.exports = Hypercore\n\nfunction isStream(s) {\n  return typeof s === 'object' && s && typeof s.pipe === 'function'\n}\n\nasync function preappend(blocks) {\n  const offset = this.state.length\n  const fork = this.state.encryptionFork\n\n  for (let i = 0; i < blocks.length; i++) {\n    await this.encryption.encrypt(offset + i, blocks[i], fork, this.core)\n  }\n}\n\nfunction isValidIndex(index) {\n  return index === 0 || index > 0\n}\n\nfunction maybeUnslab(block) {\n  // Unslab only when it takes up less then half the slab\n  return block !== null && 2 * block.byteLength < block.buffer.byteLength ? unslab(block) : block\n}\n\nfunction checkSnapshot(snapshot, index) {\n  if (index >= snapshot.state.snapshotCompatLength) {\n    throw SNAPSHOT_NOT_AVAILABLE(\n      `snapshot at index ${index} not available (max compat length ${snapshot.state.snapshotCompatLength})`,\n      snapshot.discoveryKey\n    )\n  }\n}\n\nfunction readBlock(rx, index) {\n  const promise = rx.getBlock(index)\n  rx.tryFlush()\n  return promise\n}\n\nfunction initOnce(session, storage, key, opts) {\n  if (storage === null) storage = opts.storage || null\n  if (key === null) key = opts.key || null\n\n  session.core = new Core(Hypercore.defaultStorage(storage), {\n    preopen: opts.preopen,\n    eagerUpgrade: opts.eagerUpgrade !== false,\n    notDownloadingLinger: opts.notDownloadingLinger,\n    allowFork: opts.allowFork !== false,\n    allowPush: !!opts.allowPush,\n    alwaysLatestBlock: !!opts.allowLatestBlock,\n    inflightRange: opts.inflightRange,\n    compat: opts.compat === true,\n    force: opts.force,\n    createIfMissing: opts.createIfMissing,\n    discoveryKey: opts.discoveryKey,\n    overwrite: opts.overwrite,\n    key,\n    keyPair: opts.keyPair,\n    legacy: opts.legacy,\n    manifest: opts.manifest,\n    globalCache: opts.globalCache || null // session is a temp option, not to be relied on unless you know what you are doing (no semver guarantees)\n  })\n}\n\nfunction maybeAddMonitor(name) {\n  if (name === 'append' || name === 'truncate') return\n  if (this._monitorIndex >= 0 || this.closing) return\n\n  if (this.core === null) {\n    this._monitorIndex = -2\n  } else {\n    this.core.addMonitor(this)\n  }\n}\n\nfunction isSessionMoved(err) {\n  return err.code === 'SESSION_MOVED'\n}\n\nfunction getEncryptionOption(opts) {\n  // old style, supported for now but will go away\n  if (opts.encryptionKey) return { key: opts.encryptionKey, block: !!opts.isBlockKey }\n  if (!opts.encryption) return null\n  return b4a.isBuffer(opts.encryption) ? { key: opts.encryption } : opts.encryption\n}\n\nfunction isEncryptionProvider(e) {\n  return e && isFunction(e.padding) && isFunction(e.encrypt) && isFunction(e.decrypt)\n}\n\nfunction isFunction(fn) {\n  return !!fn && typeof fn === 'function'\n}\nconst crypto = require('hypercore-crypto')\nconst flat = require('flat-tree')\nconst b4a = require('b4a')\nconst { MerkleTree } = require('./merkle-tree')\n\nmodule.exports = async function auditCore(\n  core,\n  { tree = true, blocks = true, bitfield = true, dryRun = false } = {}\n) {\n  const length = core.state.length\n  const stats = {\n    treeNodes: 0,\n    blocks: 0,\n    bits: 0,\n    droppedTreeNodes: 0,\n    droppedBlocks: 0,\n    droppedBits: 0,\n    corrupt: false\n  }\n\n  // audit the tree\n  if (tree) {\n    let tx = null\n\n    const roots = await MerkleTree.getRootsFromStorage(core.state.storage, length)\n    const stack = []\n\n    for (const r of roots) {\n      if (r === null) {\n        if (!dryRun) {\n          const storage = core.state.storage\n          await storage.store.deleteCore(storage.core)\n          return null\n        }\n\n        stats.corrupt = true\n      }\n\n      stack.push(r)\n    }\n\n    stats.treeNodes += roots.length\n\n    while (stack.length > 0) {\n      const node = stack.pop()\n\n      if ((node.index & 1) === 0) continue\n\n      const [left, right] = flat.children(node.index)\n\n      const rx = core.state.storage.read()\n      const leftNodePromise = rx.getTreeNode(left)\n      const rightNodePromise = rx.getTreeNode(right)\n\n      rx.tryFlush()\n\n      const [leftNode, rightNode] = await Promise.all([leftNodePromise, rightNodePromise])\n\n      if (isBadTree(node, leftNode, rightNode)) {\n        if (!tx && !stats.corrupt) tx = core.state.storage.write()\n        const [l, r] = flat.spans(node.index)\n        tx.deleteTreeNodeRange(l, r + 1)\n        stats.droppedTreeNodes++\n        continue\n      }\n\n      if (!leftNode) continue\n\n      stats.treeNodes += 2\n      stack.push(leftNode, rightNode)\n    }\n\n    if (tx && !dryRun) await tx.flush()\n  }\n\n  // audit the blocks\n  if (blocks) {\n    let tx = null\n\n    for await (const block of core.state.storage.createBlockStream()) {\n      if (!core.bitfield.get(block.index)) {\n        if (!tx && !stats.corrupt) tx = core.state.storage.write()\n        tx.deleteBlock(block.index)\n        stats.droppedBlocks++\n      }\n\n      const rx = core.state.storage.read()\n      const treeNodePromise = rx.getTreeNode(2 * block.index)\n\n      rx.tryFlush()\n\n      const treeNode = await treeNodePromise\n\n      if (isBadBlock(treeNode, block.value)) {\n        if (!tx && !stats.corrupt) tx = core.state.storage.write()\n        tx.deleteBlock(block.index)\n        stats.droppedBlocks++\n        continue\n      }\n\n      stats.blocks++\n    }\n\n    if (tx && !dryRun) await tx.flush()\n  }\n\n  if (bitfield) {\n    let tx = null\n\n    for (const index of allBits(core.bitfield)) {\n      const rx = core.state.storage.read()\n      const blockPromise = rx.getBlock(index)\n\n      rx.tryFlush()\n\n      const block = await blockPromise\n      if (!block) {\n        stats.droppedBits++\n        if (dryRun) continue\n\n        if (!tx && !stats.corrupt) tx = core.state.storage.write()\n\n        core.bitfield.set(index, false)\n\n        const page = core.bitfield.getBitfield(index)\n        if (page.bitfield) tx.putBitfieldPage(page.index, page.bitfield)\n        else tx.deleteBitfieldPage(page.index)\n        continue\n      }\n\n      stats.bits++\n    }\n\n    if (tx && !dryRun) await tx.flush()\n  }\n\n  return stats\n}\n\nfunction isBadBlock(node, block) {\n  if (!node) return true\n  const hash = crypto.data(block)\n  return !b4a.equals(hash, node.hash) || node.size !== block.byteLength\n}\n\nfunction isBadTree(parent, left, right) {\n  if (!left && !right) return false\n  if (!left || !right) return true\n  const hash = crypto.parent(left, right)\n  return !b4a.equals(hash, parent.hash) || parent.size !== left.size + right.size\n}\n\nfunction* allBits(bitfield) {\n  let i = 0\n  if (bitfield.get(0)) yield 0\n  while (true) {\n    i = bitfield.findFirst(true, i + 1)\n    if (i === -1) break\n    yield i\n  }\n}\nconst b4a = require('b4a')\nconst quickbit = require('./compat').quickbit\n\nmodule.exports = class BitInterlude {\n  constructor() {\n    this.ranges = []\n  }\n\n  contiguousLength(from) {\n    for (const r of this.ranges) {\n      if (r.start > from) break\n      if (!r.value && r.start <= from) return r.start\n    }\n\n    // TODO: be smarter\n    while (this.get(from) === true) from++\n    return from\n  }\n\n  get(index) {\n    let start = 0\n    let end = this.ranges.length\n\n    while (start < end) {\n      const mid = (start + end) >> 1\n      const r = this.ranges[mid]\n\n      if (index < r.start) {\n        end = mid\n        continue\n      }\n\n      if (index >= r.end) {\n        if (mid === start) break\n        start = mid\n        continue\n      }\n\n      return r.value\n    }\n\n    return false\n  }\n\n  setRange(start, end, value) {\n    if (start === end) return\n\n    let r = null\n\n    for (let i = 0; i < this.ranges.length; i++) {\n      r = this.ranges[i]\n\n      // if already inside, stop\n      if (r.start <= start && end <= r.end) {\n        if (value === r.value) return\n\n        const ranges = mergeRanges(r, { start, end, value })\n        this.ranges.splice(i, 1, ...ranges)\n\n        return\n      }\n\n      // we wanna overun the interval\n      if (start > r.end) {\n        continue\n      }\n\n      // we overran but this interval is ending after us, move it back\n      if (end >= r.start && end <= r.end) {\n        r.start = r.value === value ? start : end\n        if (r.value !== value) this.ranges.splice(i, 0, { start, end, value })\n        return\n      }\n\n      // we overran but our start is contained in this interval, move start back\n      if (start >= r.start && start <= r.end) {\n        if (r.value !== value) {\n          r.end = start // Crop current comparison\n\n          // If there's a next range\n          if (this.ranges.length - 1 > i) {\n            const next = this.ranges[i + 1]\n            // If the same, go next\n            if (next.value === value) continue\n            // Else we overlap so update next range\n            if (next.start < end) next.start = end\n          }\n\n          this.ranges.splice(++i, 0, { start, end, value })\n          return\n        }\n\n        start = r.start\n      }\n\n      let remove = 0\n\n      for (let j = i; j < this.ranges.length; j++) {\n        const n = this.ranges[j]\n        if (n.start > end || n.value !== value) break\n        if (n.start <= end && n.end > end) end = n.end\n        remove++\n      }\n\n      this.ranges.splice(i, remove, { start, end, value })\n      return\n    }\n\n    if (r !== null) {\n      if (start <= r.end && end > r.end) {\n        r.end = end\n        return\n      }\n\n      // we never\n      if (r.end > start) return\n    }\n\n    this.ranges.push({ start, end, value })\n  }\n\n  flush(tx, bitfield) {\n    if (!this.ranges.length) return []\n\n    let index = this.ranges[0].start\n    const final = this.ranges[this.ranges.length - 1].end\n\n    let i = 0\n\n    while (index < final) {\n      const page = bitfield.getBitfield(index) // read only\n      const pageIndex = page ? page.index : bitfield.getPageIndex(index)\n\n      const buf = b4a.allocUnsafe(bitfield.getPageByteLength())\n\n      if (page) {\n        const src = page.bitfield // Uint32Array\n        buf.set(b4a.from(src.buffer, src.byteOffset, src.byteLength), 0)\n      } else {\n        b4a.fill(buf, 0)\n      }\n\n      const last = (pageIndex + 1) * (buf.byteLength << 3)\n      const offset = pageIndex * (buf.byteLength << 3)\n\n      let hasValue = false\n\n      while (i < this.ranges.length) {\n        const { start, end, value } = this.ranges[i]\n\n        if (!hasValue && value) hasValue = true\n\n        const from = start < index ? index : start\n        const to = end < last ? end : last\n\n        quickbit.fill(buf, value, from - offset, to - offset)\n\n        index = to\n\n        if (to === last) break\n\n        i++\n      }\n\n      if (page || hasValue) tx.putBitfieldPage(pageIndex, buf)\n    }\n\n    return this.ranges\n  }\n}\n\nfunction mergeRanges(a, b) {\n  const ranges = []\n  if (a.start < b.start) ranges.push({ start: a.start, end: b.start, value: a.value })\n  ranges.push({ start: b.start, end: b.end, value: b.value })\n  if (b.end < a.end) ranges.push({ start: b.end, end: a.end, value: a.value })\n\n  return ranges\n}\nconst BigSparseArray = require('big-sparse-array')\nconst b4a = require('b4a')\nconst quickbit = require('./compat').quickbit\n\nconst BITS_PER_PAGE = 32768\nconst BYTES_PER_PAGE = BITS_PER_PAGE / 8\nconst WORDS_PER_PAGE = BYTES_PER_PAGE / 4\nconst BITS_PER_SEGMENT = 2097152\nconst BYTES_PER_SEGMENT = BITS_PER_SEGMENT / 8\nconst WORDS_PER_SEGMENT = BYTES_PER_SEGMENT / 4\nconst INITIAL_WORDS_PER_SEGMENT = 1024\nconst PAGES_PER_SEGMENT = BITS_PER_SEGMENT / BITS_PER_PAGE\nconst SEGMENT_GROWTH_FACTOR = 4\n\nclass BitfieldPage {\n  constructor(index, segment) {\n    this.index = index\n    this.offset = index * BYTES_PER_PAGE - segment.offset\n    this.bitfield = null\n    this.segment = segment\n\n    segment.add(this)\n  }\n\n  get tree() {\n    return this.segment.tree\n  }\n\n  get(index, dirty) {\n    return quickbit.get(this.bitfield, index)\n  }\n\n  set(index, val) {\n    if (quickbit.set(this.bitfield, index, val)) {\n      this.tree.update(this.offset * 8 + index)\n    }\n  }\n\n  setRange(start, end, val) {\n    quickbit.fill(this.bitfield, val, start, end)\n\n    let i = Math.floor(start / 128)\n    const n = i + Math.ceil((end - start) / 128)\n\n    while (i <= n) this.tree.update(this.offset * 8 + i++ * 128)\n  }\n\n  findFirst(val, position) {\n    return quickbit.findFirst(this.bitfield, val, position)\n  }\n\n  findLast(val, position) {\n    return quickbit.findLast(this.bitfield, val, position)\n  }\n\n  count(start, length, val) {\n    const end = start + length\n\n    let i = start\n    let c = 0\n\n    while (length > 0) {\n      const l = this.findFirst(val, i)\n      if (l === -1 || l >= end) return c\n\n      const h = this.findFirst(!val, l + 1)\n      if (h === -1 || h >= end) return c + end - l\n\n      c += h - l\n      length -= h - i\n      i = h\n    }\n\n    return c\n  }\n}\n\nclass BitfieldSegment {\n  constructor(index, bitfield) {\n    this.index = index\n    this.offset = index * BYTES_PER_SEGMENT\n    this.tree = quickbit.Index.from(bitfield, BYTES_PER_SEGMENT)\n    this.pages = new Array(PAGES_PER_SEGMENT)\n  }\n\n  get bitfield() {\n    return this.tree.field\n  }\n\n  add(page) {\n    const i = page.index - this.index * PAGES_PER_SEGMENT\n    this.pages[i] = page\n\n    const start = i * WORDS_PER_PAGE\n    const end = start + WORDS_PER_PAGE\n\n    if (end >= this.bitfield.length) this.reallocate(end)\n\n    page.bitfield = this.bitfield.subarray(start, end)\n  }\n\n  reallocate(length) {\n    let target = this.bitfield.length\n    while (target < length) target *= SEGMENT_GROWTH_FACTOR\n\n    const bitfield = new Uint32Array(target)\n    bitfield.set(this.bitfield)\n\n    this.tree = quickbit.Index.from(bitfield, BYTES_PER_SEGMENT)\n\n    for (let i = 0; i < this.pages.length; i++) {\n      const page = this.pages[i]\n      if (!page) continue\n\n      const start = i * WORDS_PER_PAGE\n      const end = start + WORDS_PER_PAGE\n\n      page.bitfield = bitfield.subarray(start, end)\n    }\n  }\n\n  findFirst(val, position) {\n    position = this.tree.skipFirst(!val, position)\n\n    let j = position & (BITS_PER_PAGE - 1)\n    let i = (position - j) / BITS_PER_PAGE\n\n    if (i >= PAGES_PER_SEGMENT) return -1\n\n    while (i < this.pages.length) {\n      const p = this.pages[i]\n\n      let index = -1\n\n      if (p) index = p.findFirst(val, j)\n      else if (!val) index = j\n\n      if (index !== -1) return i * BITS_PER_PAGE + index\n\n      j = 0\n      i++\n    }\n\n    return -1\n  }\n\n  findLast(val, position) {\n    position = this.tree.skipLast(!val, position)\n\n    let j = position & (BITS_PER_PAGE - 1)\n    let i = (position - j) / BITS_PER_PAGE\n\n    if (i >= PAGES_PER_SEGMENT) return -1\n\n    while (i >= 0) {\n      const p = this.pages[i]\n\n      let index = -1\n\n      if (p) index = p.findLast(val, j)\n      else if (!val) index = j\n\n      if (index !== -1) return i * BITS_PER_PAGE + index\n\n      j = BITS_PER_PAGE - 1\n      i--\n    }\n\n    return -1\n  }\n}\n\nmodule.exports = class Bitfield {\n  static BITS_PER_PAGE = BITS_PER_PAGE\n  static BYTES_PER_PAGE = BYTES_PER_PAGE\n\n  constructor(buffer) {\n    this.resumed = !!(buffer && buffer.byteLength >= 0)\n\n    this._pages = new BigSparseArray()\n    this._segments = new BigSparseArray()\n\n    const view = this.resumed\n      ? new Uint32Array(buffer.buffer, buffer.byteOffset, Math.floor(buffer.byteLength / 4))\n      : new Uint32Array(INITIAL_WORDS_PER_SEGMENT)\n\n    for (let i = 0; i < view.length; i += WORDS_PER_SEGMENT) {\n      let bitfield = view.subarray(i, i + WORDS_PER_SEGMENT)\n      let length = WORDS_PER_SEGMENT\n\n      if (i === 0) {\n        length = INITIAL_WORDS_PER_SEGMENT\n        while (length < bitfield.length) length *= SEGMENT_GROWTH_FACTOR\n      }\n\n      if (bitfield.length !== length) {\n        const copy = new Uint32Array(length)\n        copy.set(bitfield, 0)\n        bitfield = copy\n      }\n\n      const segment = new BitfieldSegment(i / WORDS_PER_SEGMENT, bitfield)\n      this._segments.set(segment.index, segment)\n\n      for (let j = 0; j < bitfield.length; j += WORDS_PER_PAGE) {\n        const page = new BitfieldPage((i + j) / WORDS_PER_PAGE, segment)\n        this._pages.set(page.index, page)\n      }\n    }\n  }\n\n  static from(bitfield) {\n    return new Bitfield(bitfield.toBuffer(bitfield._pages.maxLength * BITS_PER_PAGE))\n  }\n\n  toBuffer(length) {\n    const pages = Math.ceil(length / BITS_PER_PAGE)\n    const buffer = b4a.allocUnsafe(pages * BYTES_PER_PAGE)\n\n    for (let i = 0; i < pages; i++) {\n      const page = this._pages.get(i)\n      const offset = i * BYTES_PER_PAGE\n\n      if (page) {\n        const buf = b4a.from(\n          page.bitfield.buffer,\n          page.bitfield.byteOffset,\n          page.bitfield.byteLength\n        )\n\n        buffer.set(buf, offset)\n      } else {\n        buffer.fill(0, offset, offset + BYTES_PER_PAGE)\n      }\n    }\n\n    return buffer\n  }\n\n  getBitfield(index) {\n    const i = this.getPageIndex(index)\n\n    const p = this._pages.get(i)\n    return p || null\n  }\n\n  merge(bitfield, length) {\n    let i = 0\n\n    while (i < length) {\n      const start = bitfield.firstSet(i)\n      if (start === -1) break\n\n      i = bitfield.firstUnset(start)\n\n      if (i === -1 || i > length) i = length\n\n      this.setRange(start, i, true)\n\n      if (i >= length) break\n    }\n  }\n\n  get(index) {\n    const j = index & (BITS_PER_PAGE - 1)\n    const i = (index - j) / BITS_PER_PAGE\n\n    const p = this._pages.get(i)\n\n    return p ? p.get(j) : false\n  }\n\n  getPageByteLength() {\n    return BYTES_PER_PAGE\n  }\n\n  getPageIndex(index) {\n    const j = index & (BITS_PER_PAGE - 1)\n    return (index - j) / BITS_PER_PAGE\n  }\n\n  getPage(index, create) {\n    const i = this.getPageIndex(index)\n\n    let p = this._pages.get(i)\n\n    if (p) return p\n\n    if (!create) return null\n\n    const k = Math.floor(i / PAGES_PER_SEGMENT)\n    const s =\n      this._segments.get(k) ||\n      this._segments.set(\n        k,\n        new BitfieldSegment(\n          k,\n          new Uint32Array(k === 0 ? INITIAL_WORDS_PER_SEGMENT : WORDS_PER_SEGMENT)\n        )\n      )\n\n    p = this._pages.set(i, new BitfieldPage(i, s))\n\n    return p\n  }\n\n  set(index, val) {\n    const j = index & (BITS_PER_PAGE - 1)\n    const i = (index - j) / BITS_PER_PAGE\n\n    let p = this._pages.get(i)\n\n    if (!p && val) {\n      const k = Math.floor(i / PAGES_PER_SEGMENT)\n      const s =\n        this._segments.get(k) ||\n        this._segments.set(\n          k,\n          new BitfieldSegment(\n            k,\n            new Uint32Array(k === 0 ? INITIAL_WORDS_PER_SEGMENT : WORDS_PER_SEGMENT)\n          )\n        )\n\n      p = this._pages.set(i, new BitfieldPage(i, s))\n    }\n\n    if (p) p.set(j, val)\n  }\n\n  setRange(start, end, val) {\n    let j = start & (BITS_PER_PAGE - 1)\n    let i = (start - j) / BITS_PER_PAGE\n\n    while (start < end) {\n      let p = this._pages.get(i)\n\n      if (!p && val) {\n        const k = Math.floor(i / PAGES_PER_SEGMENT)\n        const s =\n          this._segments.get(k) ||\n          this._segments.set(\n            k,\n            new BitfieldSegment(\n              k,\n              new Uint32Array(k === 0 ? INITIAL_WORDS_PER_SEGMENT : WORDS_PER_SEGMENT)\n            )\n          )\n\n        p = this._pages.set(i, new BitfieldPage(i, s))\n      }\n\n      const offset = i * BITS_PER_PAGE\n      const last = Math.min(end - offset, BITS_PER_PAGE)\n      const range = last - j\n\n      if (p) p.setRange(j, last, val)\n\n      j = 0\n      i++\n      start += range\n    }\n  }\n\n  findFirst(val, position) {\n    let j = position & (BITS_PER_SEGMENT - 1)\n    let i = (position - j) / BITS_PER_SEGMENT\n\n    while (i < this._segments.maxLength) {\n      const s = this._segments.get(i)\n\n      let index = -1\n\n      if (s) index = s.findFirst(val, j)\n      else if (!val) index = j\n\n      if (index !== -1) return i * BITS_PER_SEGMENT + index\n\n      j = 0\n      i++\n    }\n\n    return val ? -1 : this._segments.maxLength * BITS_PER_SEGMENT\n  }\n\n  firstSet(position) {\n    return this.findFirst(true, position)\n  }\n\n  firstUnset(position) {\n    return this.findFirst(false, position)\n  }\n\n  findLast(val, position) {\n    let j = position & (BITS_PER_SEGMENT - 1)\n    let i = (position - j) / BITS_PER_SEGMENT\n\n    while (i >= 0) {\n      const s = this._segments.get(i)\n\n      let index = -1\n\n      if (s) index = s.findLast(val, j)\n      else if (!val) index = j\n\n      if (index !== -1) return i * BITS_PER_SEGMENT + index\n\n      j = BITS_PER_SEGMENT - 1\n      i--\n    }\n\n    return -1\n  }\n\n  lastSet(position) {\n    return this.findLast(true, position)\n  }\n\n  lastUnset(position) {\n    return this.findLast(false, position)\n  }\n\n  hasUnset(start, length) {\n    const end = start + length\n\n    let j = start & (BITS_PER_SEGMENT - 1)\n    let i = (start - j) / BITS_PER_SEGMENT\n\n    while (i < this._segments.maxLength) {\n      const s = this._segments.get(i)\n      const index = s ? s.findFirst(false, j) : j\n      if (index !== -1) return i * BITS_PER_SEGMENT + index < end\n\n      j = 0\n      i++\n\n      if (i * BITS_PER_SEGMENT >= end) return false\n    }\n\n    return true\n  }\n\n  hasSet(start, length) {\n    const end = start + length\n\n    let j = start & (BITS_PER_SEGMENT - 1)\n    let i = (start - j) / BITS_PER_SEGMENT\n\n    while (i < this._segments.maxLength) {\n      const s = this._segments.get(i)\n\n      let index = -1\n\n      if (s) index = s.findFirst(true, j)\n\n      if (index !== -1) return i * BITS_PER_SEGMENT + index < end\n\n      j = 0\n      i++\n\n      if (i * BITS_PER_SEGMENT >= end) return false\n    }\n\n    return false\n  }\n\n  count(start, length, val) {\n    let j = start & (BITS_PER_PAGE - 1)\n    let i = (start - j) / BITS_PER_PAGE\n    let c = 0\n\n    while (length > 0) {\n      const p = this._pages.get(i)\n\n      const end = Math.min(j + length, BITS_PER_PAGE)\n      const range = end - j\n\n      if (p) c += p.count(j, range, val)\n      else if (!val) c += range\n\n      j = 0\n      i++\n      length -= range\n    }\n\n    return c\n  }\n\n  countSet(start, length) {\n    return this.count(start, length, true)\n  }\n\n  countUnset(start, length) {\n    return this.count(start, length, false)\n  }\n\n  *want(start, length) {\n    if (start & 31) {\n      const d = start & 31\n      start -= d\n      length += d\n    }\n\n    let j = start & (BITS_PER_SEGMENT - 1)\n    let i = (start - j) / BITS_PER_SEGMENT\n\n    while (length > 0) {\n      const s = this._segments.get(i)\n\n      if (s) {\n        let end = Math.min(j + length, BITS_PER_SEGMENT)\n        if (end & 31) end += 32 - (end & 31)\n\n        yield {\n          start: i * BITS_PER_SEGMENT + j,\n          bitfield: s.bitfield.subarray(j / 32, end / 32)\n        }\n      }\n\n      j = 0\n      i++\n      length -= BITS_PER_SEGMENT\n    }\n  }\n\n  clear(tx) {\n    return tx.deleteBitfieldPageRange(0, -1)\n  }\n\n  onupdate(ranges) {\n    for (const { start, end, value } of ranges) {\n      this.setRange(start, end, value)\n    }\n  }\n\n  static async open(storage, length) {\n    if (length === 0) return new Bitfield(storage, null)\n\n    const pages = Math.ceil(length / BITS_PER_PAGE)\n    const buffer = b4a.alloc(pages * BYTES_PER_PAGE)\n    const stream = storage.createBitfieldStream({ lt: pages })\n\n    for await (const { index, page } of stream) {\n      buffer.set(page, index * BYTES_PER_PAGE)\n    }\n\n    return new Bitfield(buffer)\n  }\n}\nconst crypto = require('hypercore-crypto')\nconst sodium = require('sodium-universal')\nconst b4a = require('b4a')\nconst c = require('compact-encoding')\n\n// TODO: rename this to \"crypto\" and move everything hashing related etc in here\n// Also lets move the tree stuff from hypercore-crypto here\n\nconst [\n  TREE,\n  REPLICATE_INITIATOR,\n  REPLICATE_RESPONDER,\n  MANIFEST,\n  DEFAULT_NAMESPACE,\n  DEFAULT_ENCRYPTION\n] = crypto.namespace('hypercore', 6)\n\nexports.MANIFEST = MANIFEST\nexports.DEFAULT_NAMESPACE = DEFAULT_NAMESPACE\nexports.DEFAULT_ENCRYPTION = DEFAULT_ENCRYPTION\n\nexports.replicate = function (isInitiator, key, handshakeHash) {\n  const out = b4a.allocUnsafe(32)\n  sodium.crypto_generichash_batch(\n    out,\n    [isInitiator ? REPLICATE_INITIATOR : REPLICATE_RESPONDER, key],\n    handshakeHash\n  )\n  return out\n}\n\nexports.treeSignable = function (manifestHash, treeHash, length, fork) {\n  const state = { start: 0, end: 112, buffer: b4a.allocUnsafe(112) }\n  c.fixed32.encode(state, TREE)\n  c.fixed32.encode(state, manifestHash)\n  c.fixed32.encode(state, treeHash)\n  c.uint64.encode(state, length)\n  c.uint64.encode(state, fork)\n  return state.buffer\n}\n\nexports.treeSignableCompat = function (hash, length, fork, noHeader) {\n  const end = noHeader ? 48 : 80\n  const state = { start: 0, end, buffer: b4a.allocUnsafe(end) }\n  if (!noHeader) c.fixed32.encode(state, TREE) // ultra legacy mode, kill in future major\n  c.fixed32.encode(state, hash)\n  c.uint64.encode(state, length)\n  c.uint64.encode(state, fork)\n  return state.buffer\n}\n// Export the appropriate version of `quickbit-universal` as the plain import\n// may resolve to an older version in some environments\nlet quickbit = require('quickbit-universal')\nif (\n  typeof quickbit.findFirst !== 'function' ||\n  typeof quickbit.findLast !== 'function' ||\n  typeof quickbit.clear !== 'function'\n) {\n  // This should always load the fallback from the locally installed version\n  quickbit = require('quickbit-universal/fallback')\n}\nexports.quickbit = quickbit\nconst crypto = require('hypercore-crypto')\nconst flat = require('flat-tree')\nconst b4a = require('b4a')\nconst quickbit = require('quickbit-universal')\nconst Bitfield = require('./bitfield')\n\nconst MAX_BATCH_USED = 4 * 1024 * 1024\nconst MIN_BATCH_USED = 512 * 1024\n\n// just in its own file as its a bit involved\n\nmodule.exports = copyPrologue\n\nasync function copyPrologue(src, dst) {\n  const prologue = dst.header.manifest.prologue\n\n  if (src.length < prologue.length || prologue.length === 0) return\n\n  const stack = []\n  const roots = flat.fullRoots(prologue.length * 2)\n  const batch = { roots, first: true, last: false, contig: 0, used: 0, tree: [], blocks: [] }\n\n  for (let i = 0; i < roots.length; i++) {\n    const node = roots[i]\n    batch.tree.push(node)\n    stack.push(node)\n  }\n\n  let lastPage = -1\n  let lastBlock = -1\n\n  for await (const data of src.storage.createBlockStream({\n    gte: 0,\n    lt: prologue.length,\n    reverse: true\n  })) {\n    if (walkTree(stack, data.index * 2, batch) === false) {\n      throw new Error('Missing block or tree node for ' + data.index)\n    }\n\n    batch.contig = data.index + 1 === lastBlock ? batch.contig + 1 : 1\n    lastBlock = data.index\n\n    const page = getBitfieldPage(data.index)\n    batch.blocks.push(data)\n\n    if (lastPage !== page) batch.used += 4096\n    batch.used += Math.max(data.value.byteLength, 128) // 128 is just a sanity number to avoid mega batches\n\n    // always safe to partially flush so we do that ondemand to reduce memory usage...\n    if ((batch.used >= MIN_BATCH_USED && page !== lastPage) || batch.used >= MAX_BATCH_USED) {\n      await flushBatch(prologue, src, dst, batch)\n    }\n\n    lastPage = page\n  }\n\n  if (lastBlock !== 0) batch.contig = 0\n\n  batch.last = true\n  await flushBatch(prologue, src, dst, batch)\n}\n\nasync function flushBatch(prologue, src, dst, batch) {\n  const nodePromises = []\n\n  const srcReader = src.storage.read()\n  for (const index of batch.tree) {\n    nodePromises.push(srcReader.getTreeNode(index))\n  }\n  srcReader.tryFlush()\n\n  const nodes = await Promise.all(nodePromises)\n\n  const pagePromises = []\n  const dstReader = dst.storage.read()\n\n  const headPromise = batch.first ? dstReader.getHead() : null\n  if (headPromise) headPromise.catch(noop)\n\n  let lastPage = -1\n  for (const { index } of batch.blocks) {\n    const page = getBitfieldPage(index)\n    if (page === lastPage) continue\n    lastPage = page\n    pagePromises.push(dstReader.getBitfieldPage(page))\n  }\n\n  dstReader.tryFlush()\n\n  const pages = await Promise.all(pagePromises)\n  const head = headPromise === null ? null : await headPromise\n  const userData = []\n\n  // reads done!\n\n  if (batch.first) {\n    const roots = nodes.slice(0, batch.roots.length)\n\n    for (const node of roots) {\n      if (!node) throw new Error('Missing nodes for prologue hash')\n    }\n\n    const treeHash = crypto.tree(roots)\n    if (!b4a.equals(treeHash, prologue.hash)) throw new Error('Prologue does not match source')\n  }\n\n  if (batch.first) {\n    for await (const data of src.storage.createUserDataStream()) userData.push(data)\n  }\n\n  for (let i = 0; i < pages.length; i++) {\n    if (!pages[i]) pages[i] = b4a.alloc(4096)\n  }\n\n  const tx = dst.storage.write()\n\n  for (const node of nodes) tx.putTreeNode(node)\n\n  lastPage = -1\n  let pageIndex = -1\n\n  for (const { index, value } of batch.blocks) {\n    const page = getBitfieldPage(index)\n\n    if (page !== lastPage) {\n      lastPage = page\n      pageIndex++\n      // queue the page now, we mutate it below but its the same ref\n      tx.putBitfieldPage(pageIndex, pages[pageIndex])\n    }\n\n    const pageBuffer = pages[pageIndex]\n    quickbit.set(pageBuffer, getBitfieldOffset(index), true)\n    tx.putBlock(index, value)\n  }\n\n  for (const { key, value } of userData) {\n    tx.putUserData(key, value)\n  }\n\n  let upgraded = batch.first && !head\n  if (upgraded) {\n    tx.setHead(prologueToTree(prologue))\n  }\n\n  await tx.flush()\n\n  if (upgraded) {\n    const roots = nodes.slice(0, batch.roots.length)\n    dst.state.setRoots(roots)\n    dst.header.tree = prologueToTree(prologue)\n  }\n\n  if (userData.length > 0) {\n    dst.header.userData = userData.concat(dst.header.userData)\n  }\n\n  if (batch.contig) {\n    // TODO: we need to persist this somehow\n    dst.header.hints.contiguousLength = batch.contig\n  }\n\n  let start = 0\n  let length = 0\n\n  // update in memory bitfield\n  for (const { index } of batch.blocks) {\n    if (start === 0 || start - 1 === index) {\n      length++\n    } else {\n      if (length > 0) signalReplicator(dst, upgraded, start, length)\n      upgraded = false\n      length = 1\n    }\n\n    start = index\n    dst.bitfield.set(index, true)\n  }\n\n  if (length > 0) signalReplicator(dst, upgraded, start, length)\n\n  // unlink\n  batch.tree = []\n  batch.blocks = []\n  batch.first = false\n  batch.used = 0\n}\n\nfunction signalReplicator(core, upgraded, start, length) {\n  if (upgraded) {\n    core.replicator.cork()\n    core.replicator.onhave(start, length, false)\n    core.replicator.onupgrade()\n    core.replicator.uncork()\n  } else {\n    core.replicator.onhave(start, length, false)\n  }\n}\n\nfunction prologueToTree(prologue) {\n  return {\n    fork: 0,\n    length: prologue.length,\n    rootHash: prologue.hash,\n    signature: null\n  }\n}\n\nfunction getBitfieldPage(index) {\n  return Math.floor(index / Bitfield.BITS_PER_PAGE)\n}\n\nfunction getBitfieldOffset(index) {\n  return index & (Bitfield.BITS_PER_PAGE - 1)\n}\n\nfunction walkTree(stack, target, batch) {\n  while (stack.length > 0) {\n    const node = stack.pop()\n\n    if ((node & 1) === 0) {\n      if (node === target) return true\n      continue\n    }\n\n    const ite = flat.iterator(node)\n    if (!ite.contains(target)) continue\n\n    while ((ite.index & 1) !== 0) {\n      const left = ite.leftChild()\n      const right = ite.sibling() // is right child\n\n      batch.tree.push(left, right)\n\n      if (ite.contains(target)) stack.push(left)\n      else ite.sibling()\n    }\n\n    if (ite.index === target) return true\n  }\n\n  return false\n}\n\nfunction noop() {}\nconst crypto = require('hypercore-crypto')\nconst b4a = require('b4a')\nconst unslab = require('unslab')\nconst z32 = require('z32')\nconst Mutex = require('./mutex')\nconst { MerkleTree, ReorgBatch } = require('./merkle-tree')\nconst BitInterlude = require('./bit-interlude')\nconst Bitfield = require('./bitfield')\nconst RemoteBitfield = require('./remote-bitfield')\nconst {\n  BAD_ARGUMENT,\n  STORAGE_EMPTY,\n  STORAGE_CONFLICT,\n  INVALID_SIGNATURE,\n  INVALID_CHECKSUM\n} = require('hypercore-errors')\nconst Verifier = require('./verifier')\nconst audit = require('./audit')\nconst copyPrologue = require('./copy-prologue')\nconst SessionState = require('./session-state')\nconst Replicator = require('./replicator')\n\nmodule.exports = class Core {\n  constructor(db, opts = {}) {\n    this.db = db\n    this.storage = null\n    this.replicator = new Replicator(this, opts)\n    this.sessionStates = []\n    this.monitors = []\n    this.activeSessions = 0\n    this.gc = 0 // corestore uses this to main a gc strike pool\n\n    this.id = opts.key ? z32.encode(opts.key) : null\n    this.key = opts.key || null\n    this.discoveryKey = opts.discoveryKey || (opts.key && crypto.discoveryKey(opts.key)) || null\n    this.manifest = null\n    this.opening = null\n    this.closing = null\n    this.exclusive = null\n\n    this.preupdate = null\n    this.header = null\n    this.compat = false\n    this.bitfield = null\n    this.verifier = null\n    this.truncating = 0\n    this.updating = false\n    this.skipBitfield = null\n    this.globalCache = opts.globalCache || null\n    this.autoClose = opts.autoClose !== false\n    this.onidle = noop\n\n    this.state = null\n    this.opened = false\n    this.destroyed = false\n    this.closed = false\n\n    this.hintsChanged = false\n\n    this._bitfield = null\n    this._verifies = null\n    this._verifiesFlushed = null\n    this._legacy = !!opts.legacy\n\n    this.opening = this._open(opts)\n    this.opening.catch(noop)\n  }\n\n  ready() {\n    return this.opening\n  }\n\n  addMonitor(s) {\n    if (s._monitorIndex >= 0) return\n    s._monitorIndex = this.monitors.push(s) - 1\n  }\n\n  removeMonitor(s) {\n    if (s._monitorIndex < 0) return\n    const head = this.monitors.pop()\n    if (head !== s) this.monitors[(head._monitorIndex = s._monitorIndex)] = head\n    s._monitorIndex = -1\n  }\n\n  emitManifest() {\n    for (let i = this.monitors.length - 1; i >= 0; i--) {\n      this.monitors[i].emit('manifest')\n    }\n  }\n\n  createUserDataStream(opts, session = this.state) {\n    return session.storage.createUserDataStream(opts)\n  }\n\n  allSessions() {\n    const sessions = []\n    for (const state of this.sessionStates) {\n      if (state.sessions.length) sessions.push(...state.sessions)\n    }\n    return sessions\n  }\n\n  hasSession() {\n    return this.activeSessions !== 0\n  }\n\n  compact() {\n    const compacting = []\n    for (const s of this.sessionStates) {\n      compacting.push(s.storage.compact())\n    }\n    return Promise.all(compacting)\n  }\n\n  checkIfIdle() {\n    if (!this.opened || this.destroyed === true || this.hasSession() === true) return\n    if (this.replicator.idle() === false) return\n    if (this.state === null || this.state.mutex.idle() === false) return\n    this.onidle()\n  }\n\n  async lockExclusive() {\n    if (this.exclusive === null) this.exclusive = new Mutex()\n    await this.exclusive.lock()\n  }\n\n  unlockExclusive() {\n    if (this.exclusive !== null) this.exclusive.unlock()\n  }\n\n  async _open(opts) {\n    try {\n      await this._tryOpen(opts)\n    } catch (err) {\n      this.onidle()\n      throw err\n    }\n\n    this.opened = true\n  }\n\n  async _tryOpen(opts) {\n    if (opts.preopen) await opts.preopen // just a hook to allow exclusive access here...\n\n    let storage = await this.db.resumeCore(this.discoveryKey)\n\n    let overwrite = opts.overwrite === true\n\n    const force = opts.force === true\n    const createIfMissing = opts.createIfMissing !== false\n    // kill this flag soon\n    const legacy = !!opts.legacy\n\n    // default to true for now if no manifest is provided\n    let compat = opts.compat === true || (opts.compat !== false && !opts.manifest)\n\n    let header = storage ? parseHeader(await getCoreInfo(storage)) : null\n\n    const hadManifest = !!header && !!header.manifest && !!header.key\n    const hadKeyPair = !!header && !!header.keyPair\n\n    if (force && opts.key && header && !b4a.equals(header.key, opts.key)) {\n      overwrite = true\n    }\n\n    if (!header && opts.discoveryKey && !(opts.key || opts.manifest)) {\n      throw STORAGE_EMPTY('No Hypercore is stored here', this.discoveryKey)\n    }\n\n    if (!header || overwrite) {\n      if (!createIfMissing) {\n        throw STORAGE_EMPTY('No Hypercore is stored here', this.discoveryKey)\n      }\n\n      if (compat) {\n        if (opts.key && opts.keyPair && !b4a.equals(opts.key, opts.keyPair.publicKey)) {\n          throw BAD_ARGUMENT('Key must match publicKey when in compat mode', this.discoveryKey)\n        }\n      }\n\n      const keyPair = opts.keyPair || (opts.key ? null : crypto.keyPair())\n\n      const defaultManifest =\n        !opts.manifest &&\n        (!!opts.compat || !opts.key || !!(keyPair && b4a.equals(opts.key, keyPair.publicKey)))\n      const manifest = defaultManifest\n        ? Verifier.defaultSignerManifest(opts.key || keyPair.publicKey)\n        : Verifier.createManifest(opts.manifest)\n\n      header = {\n        key: opts.key || (compat ? manifest.signers[0].publicKey : Verifier.manifestHash(manifest)),\n        manifest,\n        keyPair: keyPair\n          ? { publicKey: keyPair.publicKey, secretKey: keyPair.secretKey || null }\n          : null,\n        frozen: false,\n        tree: {\n          fork: 0,\n          length: 0,\n          rootHash: null,\n          signature: null\n        },\n        hints: {\n          reorgs: [],\n          contiguousLength: 0,\n          remoteContiguousLength: 0\n        }\n      }\n\n      const discoveryKey = opts.discoveryKey || crypto.discoveryKey(header.key)\n\n      storage = await this.db.createCore({\n        key: header.key,\n        manifest,\n        keyPair,\n        frozen: false,\n        discoveryKey,\n        userData: opts.userData || [],\n        alias: opts.alias || null\n      })\n    }\n\n    // unslab the long lived buffers to avoid keeping the slab alive\n    header.key = unslab(header.key)\n\n    if (header.tree) {\n      header.tree.rootHash = unslab(header.tree.rootHash)\n      header.tree.signature = unslab(header.tree.signature)\n    }\n\n    if (header.keyPair) {\n      header.keyPair.publicKey = unslab(header.keyPair.publicKey)\n      header.keyPair.secretKey = unslab(header.keyPair.secretKey)\n    }\n\n    if (header.keyPair) {\n      header.keyPair.publicKey = unslab(header.keyPair.publicKey)\n      header.keyPair.secretKey = unslab(header.keyPair.secretKey)\n    }\n\n    if (opts.manifest) {\n      // if we provide a manifest and no key, verify that the stored key is the same\n      if (\n        !opts.key &&\n        !Verifier.isValidManifest(header.key, Verifier.createManifest(opts.manifest))\n      ) {\n        throw STORAGE_CONFLICT('Manifest does not hash to provided key', this.discoveryKey)\n      }\n\n      if (!header.manifest) header.manifest = opts.manifest\n    }\n\n    if (opts.key && !b4a.equals(header.key, opts.key)) {\n      throw STORAGE_CONFLICT('Another Hypercore is stored here', this.discoveryKey)\n    }\n\n    // if we signalled compat, but already now this core isn't disable it\n    if (compat && header.manifest && !Verifier.isCompat(header.key, header.manifest)) {\n      compat = false\n    } else if (!compat && header.manifest && Verifier.isCompat(header.key, header.manifest)) {\n      compat = true\n    }\n\n    const prologue = header.manifest ? header.manifest.prologue : null\n\n    const bitfield = await Bitfield.open(storage, header.tree.length)\n\n    const treeInfo = {\n      fork: header.tree.fork,\n      length: header.tree.length,\n      signature: header.tree.signature,\n      roots: header.tree.length\n        ? await MerkleTree.getRootsFromStorage(storage, header.tree.length)\n        : [],\n      prologue\n    }\n\n    if (overwrite) {\n      const tx = storage.write()\n      tx.deleteTreeNodeRange(0, -1)\n      tx.deleteBlockRange(0, -1)\n      bitfield.clear(tx)\n      await tx.flush()\n    }\n\n    const len = bitfield.findFirst(false, header.hints.contiguousLength)\n    if (header.hints.contiguousLength !== len && !storage.readOnly) {\n      header.hints.contiguousLength = len\n      const tx = storage.write()\n      tx.setHints(header.hints)\n      await tx.flush()\n    }\n\n    // to unslab\n    if (header.manifest) {\n      header.manifest = Verifier.createManifest(header.manifest)\n      if (!hadManifest || (header.keyPair && !hadKeyPair)) {\n        const tx = storage.write()\n        tx.setAuth({\n          key: header.key,\n          discoveryKey: crypto.discoveryKey(header.key),\n          manifest: header.manifest,\n          keyPair: header.keyPair\n        })\n        await tx.flush()\n      }\n    }\n\n    const verifier = header.manifest\n      ? new Verifier(header.key, header.manifest, { crypto, legacy })\n      : null\n\n    this.storage = storage\n    this.header = header\n    this.compat = compat\n    this.bitfield = bitfield\n    this.verifier = verifier\n    this.state = new SessionState(this, null, storage, treeInfo, null)\n\n    if (this.key === null) this.key = this.header.key\n    if (this.discoveryKey === null) this.discoveryKey = crypto.discoveryKey(this.key)\n    if (this.id === null) this.id = z32.encode(this.key)\n    if (this.manifest === null) this.manifest = this.header.manifest\n  }\n\n  async audit(opts) {\n    await this.state.mutex.lock()\n\n    try {\n      return await audit(this, opts)\n    } finally {\n      this.state._unlock()\n    }\n  }\n\n  async setManifest(manifest) {\n    await this.state.mutex.lock()\n\n    try {\n      if (manifest && this.header.manifest === null) {\n        if (!Verifier.isValidManifest(this.header.key, manifest)) {\n          throw INVALID_CHECKSUM('Manifest hash does not match', this.discoveryKey)\n        }\n\n        const tx = this.state.createWriteBatch()\n        this._setManifest(tx, Verifier.createManifest(manifest), null)\n        await this.state.flush()\n      }\n    } finally {\n      this.state._unlock()\n    }\n  }\n\n  _setManifest(tx, manifest, keyPair) {\n    if (!manifest && b4a.equals(keyPair.publicKey, this.header.key)) {\n      manifest = Verifier.defaultSignerManifest(this.header.key)\n    }\n    if (!manifest) return\n\n    const verifier = new Verifier(this.header.key, manifest, { legacy: this._legacy })\n\n    if (verifier.prologue) this.state.prologue = Object.assign({}, verifier.prologue)\n\n    this.manifest = this.header.manifest = manifest\n\n    tx.setAuth({\n      key: this.header.key,\n      discoveryKey: this.discoveryKey,\n      manifest,\n      keyPair: this.header.keyPair\n      // TODO: encryptionKey?\n    })\n\n    this.compat = verifier.compat\n    this.verifier = verifier\n\n    this.replicator.onupgrade()\n    this.emitManifest()\n  }\n\n  async copyPrologue(src) {\n    await this.state.mutex.lock()\n\n    try {\n      await src.mutex.lock()\n    } catch (err) {\n      this.state.mutex.unlock()\n      throw err\n    }\n\n    try {\n      await copyPrologue(src, this)\n    } finally {\n      src.mutex.unlock()\n      this.state.mutex.unlock()\n      this.checkIfIdle()\n    }\n  }\n\n  flushed() {\n    return this.state.flushed()\n  }\n\n  async _validateCommit(state, treeLength) {\n    if (this.state.length > state.length) {\n      return false // TODO: partial commit and truncation possible in the future\n    }\n\n    if (this.state.length > treeLength) {\n      for (const root of this.state.roots) {\n        const batchRoot = await MerkleTree.get(state, root.index)\n        if (batchRoot.size !== root.size || !b4a.equals(batchRoot.hash, root.hash)) {\n          return false\n        }\n      }\n    }\n\n    if (this.verifier === null) {\n      return false // easier to assert than upsert\n    }\n\n    return true\n  }\n\n  _verifyBatchUpgrade(batch, manifest) {\n    if (!this.header.manifest) {\n      // compat, drop at some point\n      if (!manifest) manifest = Verifier.defaultSignerManifest(this.header.key)\n\n      if (\n        !manifest ||\n        !(\n          Verifier.isValidManifest(this.header.key, manifest) ||\n          Verifier.isCompat(this.header.key, manifest)\n        )\n      ) {\n        throw INVALID_SIGNATURE('Proof contains an invalid manifest', this.discoveryKey) // TODO: proper error type\n      }\n    }\n\n    const verifier =\n      this.verifier ||\n      new Verifier(this.header.key, Verifier.createManifest(manifest), { legacy: this._legacy })\n\n    if (!verifier.verify(batch, batch.signature)) {\n      throw INVALID_SIGNATURE('Proof contains an invalid signature', this.discoveryKey)\n    }\n\n    return manifest\n  }\n\n  async _verifyExclusive({ batch, bitfield, value, manifest }) {\n    manifest = this._verifyBatchUpgrade(batch, manifest)\n\n    if (\n      !(await this.state._verifyBlock(\n        batch,\n        bitfield,\n        value,\n        this.header.manifest ? null : manifest\n      ))\n    ) {\n      return false\n    }\n\n    if (!batch.upgraded && bitfield) {\n      this.replicator.onhave(bitfield.start, bitfield.length, bitfield.drop)\n    }\n\n    return true\n  }\n\n  async _verifyShared() {\n    if (!this._verifies.length) return false\n\n    await this.state.mutex.lock()\n\n    const tx = this.state.createWriteBatch()\n\n    const verifies = this._verifies\n    this._verifies = null\n    this._verified = null\n\n    try {\n      for (const { batch, bitfield, value } of verifies) {\n        if (!batch.commitable()) continue\n\n        if (bitfield) {\n          tx.putBlock(bitfield.start, value)\n        }\n      }\n\n      const bits = new BitInterlude()\n\n      for (let i = 0; i < verifies.length; i++) {\n        const { batch, bitfield, manifest } = verifies[i]\n\n        if (!batch.commitable()) {\n          verifies[i] = null // signal that we cannot commit this one\n          continue\n        }\n\n        if (bitfield) {\n          bits.setRange(bitfield.start, bitfield.start + 1, true)\n        }\n\n        // if we got a manifest AND its strictly a non compat one, lets store it\n        if (manifest && this.header.manifest === null) {\n          if (!Verifier.isValidManifest(this.header.key, manifest)) {\n            throw INVALID_CHECKSUM('Manifest hash does not match', this.discoveryKey)\n          }\n          this._setManifest(tx, manifest, null)\n        }\n\n        if (batch.commitable()) batch.commit(tx)\n      }\n\n      const ranges = bits.flush(tx, this.bitfield)\n\n      await this.state.flush()\n\n      for (const { start, end, value } of ranges) {\n        this._setBitfieldRanges(start, end, value)\n      }\n\n      for (let i = 0; i < verifies.length; i++) {\n        const bitfield = verifies[i] && verifies[i].bitfield\n        if (bitfield) {\n          this.updateContiguousLength(bitfield)\n          this.replicator.onhave(bitfield.start, bitfield.length, bitfield.drop)\n        }\n      }\n\n      if (this.hintsChanged) await this.flushHints()\n    } finally {\n      this.state._clearActiveBatch()\n      this.state.mutex.unlock()\n    }\n\n    return verifies[0] !== null\n  }\n\n  async flushHints() {\n    if (!this.hintsChanged) return\n    this.hintsChanged = false // we unset this immediately as a \"debounce\"\n\n    const tx = this.state.storage.write()\n\n    tx.setHints({\n      contiguousLength: this.header.hints.contiguousLength,\n      remoteContiguousLength: this.header.hints.remoteContiguousLength\n    })\n\n    await tx.flush()\n  }\n\n  async checkConflict(proof, from) {\n    if (this.state.length < proof.upgrade.length || proof.fork !== this.state.fork) {\n      // out of date this proof - ignore for now\n      return false\n    }\n\n    // sanity check -> no manifest, no way to verify\n    if (!this.header.manifest) {\n      return false\n    }\n\n    const batch = MerkleTree.verifyFullyRemote(this.state, proof)\n\n    try {\n      this._verifyBatchUpgrade(batch, proof.manifest)\n    } catch {\n      return true\n    }\n\n    const roots = await MerkleTree.getRootsFromStorage(this.storage, proof.upgrade.length)\n    const remoteTreeHash = crypto.tree(proof.upgrade.nodes)\n    const localTreeHash = crypto.tree(roots)\n\n    try {\n      const rx = this.state.storage.read()\n      const treeProofPromise = MerkleTree.proof(this.state, rx, {\n        block: null,\n        hash: null,\n        seek: null,\n        upgrade: {\n          start: 0,\n          length: proof.upgrade.length\n        }\n      })\n\n      rx.tryFlush()\n\n      const treeProof = await treeProofPromise\n\n      const verifyBatch = MerkleTree.verifyFullyRemote(this.state, await treeProof.settle())\n      this._verifyBatchUpgrade(verifyBatch, this.header.manifest)\n    } catch {\n      return true\n    }\n\n    // both proofs are valid, now check if they forked\n    if (b4a.equals(localTreeHash, remoteTreeHash)) return false\n\n    await this.state.mutex.lock()\n\n    try {\n      const tx = this.state.createWriteBatch()\n\n      this.header.frozen = true\n\n      tx.setAuth({\n        key: this.header.key,\n        discoveryKey: this.discoveryKey,\n        manifest: this.header.manifest,\n        keyPair: this.header.keyPair,\n        frozen: true\n      })\n\n      await this.state.flush()\n    } finally {\n      this.state.mutex.unlock()\n    }\n\n    // tmp log so we can see these\n    const id = b4a.toString(this.discoveryKey, 'hex')\n    console.log(\n      '[hypercore] conflict detected in ' +\n        id +\n        ' (writable=' +\n        !!this.header.keyPair +\n        ',quorum=' +\n        this.header.manifest.quorum +\n        ')'\n    )\n    await this._onconflict(proof)\n    return true\n  }\n\n  async verifyReorg(proof) {\n    const batch = new ReorgBatch(this.state)\n    await MerkleTree.reorg(this.state, proof, batch)\n    const manifest = this._verifyBatchUpgrade(batch, proof.manifest)\n\n    if (manifest && !this.header.manifest) {\n      await this.state.mutex.lock()\n      try {\n        if (manifest && this.header.manifest === null) {\n          const tx = this.state.createWriteBatch()\n          this._setManifest(tx, Verifier.createManifest(manifest), null)\n          await this.state.flush()\n        }\n      } finally {\n        this.state._unlock()\n      }\n    }\n\n    return batch\n  }\n\n  async verify(proof, from) {\n    // We cannot apply \"other forks\" atm.\n    // We should probably still try and they are likely super similar for non upgrades\n    // but this is easy atm (and the above layer will just retry)\n    if (proof.fork !== this.state.fork) return false\n\n    const batch = await MerkleTree.verify(this.state, proof)\n\n    if (batch.upgraded && batch.length <= this.state.length) {\n      await batch.downgrade()\n    }\n\n    if (!batch.commitable()) {\n      return false\n    }\n\n    const value = (proof.block && proof.block.value) || null\n    const op = {\n      batch,\n      bitfield: value && { drop: false, start: proof.block.index, length: 1 },\n      value,\n      manifest: proof.manifest,\n      from\n    }\n\n    if (batch.upgraded) {\n      return this._verifyExclusive(op)\n    }\n\n    if (this._verifies !== null) {\n      const verifies = this._verifies\n      const i = verifies.push(op)\n      await this._verified\n      return verifies[i] !== null\n    }\n\n    this._verifies = [op]\n    this._verified = this._verifyShared()\n\n    return this._verified\n  }\n\n  async reorg(batch) {\n    if (!batch.commitable()) return false\n\n    this.truncating++\n\n    try {\n      await this.state.reorg(batch)\n    } finally {\n      this.truncating--\n    }\n\n    return true\n  }\n\n  openSkipBitfield() {\n    if (this.skipBitfield !== null) return this.skipBitfield\n    this.skipBitfield = new RemoteBitfield()\n    const buf = this.bitfield.toBuffer(this.state.length)\n    const bitfield = new Uint32Array(buf.buffer, buf.byteOffset, buf.byteLength / 4)\n    this.skipBitfield.insert(0, bitfield)\n    return this.skipBitfield\n  }\n\n  _setBitfieldRanges(start, end, value) {\n    this.bitfield.setRange(start, end, value)\n    if (this.skipBitfield !== null) this.skipBitfield.setRange(start, end, value)\n  }\n\n  close() {\n    if (!this.closing) this.closing = this._close()\n    return this.closing\n  }\n\n  updateContiguousLength(bitfield) {\n    const contig = updateContigBatch(this.header.hints.contiguousLength, bitfield, this.bitfield)\n\n    if (contig.length !== -1 && contig.length !== this.header.hints.contiguousLength) {\n      this.header.hints.contiguousLength = contig.length\n      this.hintsChanged = true\n    }\n  }\n\n  updateRemoteContiguousLength(length) {\n    this.header.hints.remoteContiguousLength = length\n    this.hintsChanged = true\n\n    for (let i = this.monitors.length - 1; i >= 0; i--) {\n      this.monitors[i].emit('remote-contiguous-length', length)\n    }\n  }\n\n  onappend(tree, bitfield) {\n    this.header.tree = tree\n\n    if (!bitfield) {\n      this.replicator.onupgrade()\n      return\n    }\n\n    this.replicator.cork()\n\n    const { start, length, drop } = bitfield\n\n    this._setBitfieldRanges(start, start + length, true)\n    this.updateContiguousLength({ start, length, drop: false })\n\n    this.replicator.onupgrade()\n    this.replicator.onhave(start, length, drop)\n    this.replicator.uncork()\n  }\n\n  ontruncate(tree, { start, length }) {\n    if (tree) this.header.tree = tree\n\n    this.replicator.cork()\n\n    this.replicator.ontruncate(start, length)\n    this.replicator.onhave(start, length, true)\n    this.replicator.onupgrade()\n    this.replicator.uncork()\n\n    for (const sessionState of this.sessionStates) {\n      if (start < sessionState.snapshotCompatLength) sessionState.snapshotCompatLength = start\n    }\n\n    this._setBitfieldRanges(start, start + length, false)\n    this.updateContiguousLength({ start, length, drop: true })\n  }\n\n  async _onconflict(proof) {\n    await this.replicator.onconflict()\n\n    for (let i = this.monitors.length - 1; i >= 0; i--) {\n      const s = this.monitors[i]\n      s.emit('conflict', proof.upgrade.length, proof.fork, proof)\n    }\n\n    const err = new Error('Two conflicting signatures exist for length ' + proof.upgrade.length)\n    await this.closeAllSessions(err)\n  }\n\n  async closeAllSessions(err) {\n    // this.sessions modifies itself when a session closes\n    // This way we ensure we indeed iterate over all sessions\n    const sessions = this.allSessions()\n\n    const all = []\n    for (const s of sessions) all.push(s.close({ error: err, force: false })) // force false or else infinite recursion\n    await Promise.allSettled(all)\n  }\n\n  async destroy() {\n    if (this.destroyed === true) return\n    this.destroyed = true\n\n    if (this.hasSession() === true) throw new Error('Cannot destroy while sessions are open')\n\n    const weakSessions = this.allSessions()\n\n    if (this.replicator) this.replicator.destroy()\n    if (this.state) await this.state.close()\n\n    // close all pending weak sessions...\n    for (const s of weakSessions) s.close().catch(noop)\n  }\n\n  async _close() {\n    if (this.opened === false) await this.opening\n    if (this.hasSession() === true) throw new Error('Cannot close while sessions are open')\n\n    if (this.replicator) await this.replicator.close()\n\n    await this.destroy()\n    if (this.autoClose) await this.storage.store.close()\n\n    this.closed = true\n  }\n}\n\nfunction updateContigBatch(start, upd, bitfield) {\n  const end = upd.start + upd.length\n\n  let c = start\n\n  if (upd.drop) {\n    // If we dropped a block in the current contig range, \"downgrade\" it\n    if (c > upd.start) {\n      c = upd.start\n    }\n  } else {\n    if (c <= end && c >= upd.start) {\n      c = end\n      while (bitfield.get(c)) c++\n    }\n  }\n\n  if (c === start) {\n    return {\n      length: -1\n    }\n  }\n\n  if (c > start) {\n    return {\n      length: c\n    }\n  }\n\n  return {\n    length: c\n  }\n}\n\nfunction getDefaultTree() {\n  return {\n    fork: 0,\n    length: 0,\n    rootHash: null,\n    signature: null\n  }\n}\n\nfunction parseHeader(info) {\n  if (!info) return null\n\n  return {\n    key: info.key,\n    manifest: info.manifest,\n    external: null,\n    keyPair: info.keyPair,\n    tree: info.head || getDefaultTree(),\n    hints: {\n      reorgs: [],\n      contiguousLength: info.hints ? info.hints.contiguousLength : 0,\n      remoteContiguousLength: info.hints ? info.hints.remoteContiguousLength : 0\n    }\n  }\n}\n\nfunction noop() {}\n\nasync function getCoreInfo(storage) {\n  const r = storage.read()\n\n  const auth = r.getAuth()\n  const head = r.getHead()\n  const hints = r.getHints()\n\n  r.tryFlush()\n\n  const [authInfo, headInfo, hintsInfo] = await Promise.all([auth, head, hints])\n  return {\n    ...authInfo,\n    head: headInfo,\n    hints: hintsInfo\n  }\n}\nconst sodium = require('sodium-universal')\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\nconst { DEFAULT_ENCRYPTION } = require('./caps')\n\nconst nonce = b4a.alloc(sodium.crypto_stream_NONCEBYTES)\n\nmodule.exports = class DefaultEncryption {\n  static PADDING = 8\n\n  constructor(encryptionKey, hypercoreKey, opts = {}) {\n    this.key = encryptionKey\n    this.compat = opts.compat === true\n\n    const keys = DefaultEncryption.deriveKeys(encryptionKey, hypercoreKey, opts)\n\n    this.blockKey = keys.block\n    this.blindingKey = keys.blinding\n  }\n\n  static deriveKeys(encryptionKey, hypercoreKey, { block = false, compat = false } = {}) {\n    const subKeys = b4a.alloc(2 * sodium.crypto_stream_KEYBYTES)\n\n    const blockKey = block ? encryptionKey : subKeys.subarray(0, sodium.crypto_stream_KEYBYTES)\n    const blindingKey = subKeys.subarray(sodium.crypto_stream_KEYBYTES)\n\n    if (!block) {\n      if (compat) {\n        sodium.crypto_generichash_batch(blockKey, [encryptionKey], hypercoreKey)\n      } else {\n        sodium.crypto_generichash_batch(blockKey, [DEFAULT_ENCRYPTION, hypercoreKey, encryptionKey])\n      }\n    }\n\n    sodium.crypto_generichash(blindingKey, blockKey)\n\n    return {\n      blinding: blindingKey,\n      block: blockKey\n    }\n  }\n\n  static blockEncryptionKey(hypercoreKey, encryptionKey) {\n    const blockKey = b4a.alloc(sodium.crypto_stream_KEYBYTES)\n    sodium.crypto_generichash_batch(blockKey, [DEFAULT_ENCRYPTION, hypercoreKey, encryptionKey])\n    return blockKey\n  }\n\n  static encrypt(index, block, fork, blockKey, blindingKey) {\n    const padding = block.subarray(0, DefaultEncryption.PADDING)\n    block = block.subarray(DefaultEncryption.PADDING)\n\n    c.uint64.encode({ start: 0, end: 8, buffer: padding }, fork)\n    c.uint64.encode({ start: 0, end: 8, buffer: nonce }, index)\n\n    // Zero out any previous padding.\n    nonce.fill(0, 8, 8 + padding.byteLength)\n\n    // Blind the fork ID, possibly risking reusing the nonce on a reorg of the\n    // Hypercore. This is fine as the blinding is best-effort and the latest\n    // fork ID shared on replication anyway.\n    sodium.crypto_stream_xor(padding, padding, nonce, blindingKey)\n\n    nonce.set(padding, 8)\n\n    // The combination of a (blinded) fork ID and a block index is unique for a\n    // given Hypercore and is therefore a valid nonce for encrypting the block.\n    sodium.crypto_stream_xor(block, block, nonce, blockKey)\n  }\n\n  static decrypt(index, block, blockKey) {\n    const padding = block.subarray(0, DefaultEncryption.PADDING)\n    block = block.subarray(DefaultEncryption.PADDING)\n\n    c.uint64.encode({ start: 0, end: 8, buffer: nonce }, index)\n\n    nonce.set(padding, 8)\n\n    // Decrypt the block using the blinded fork ID.\n    sodium.crypto_stream_xor(block, block, nonce, blockKey)\n  }\n\n  encrypt(index, block, fork, core) {\n    if (core.compat !== this.compat) this._reload(core)\n    return DefaultEncryption.encrypt(index, block, fork, this.blockKey, this.blindingKey)\n  }\n\n  decrypt(index, block, core) {\n    if (core.compat !== this.compat) this._reload(core)\n    return DefaultEncryption.decrypt(index, block, this.blockKey)\n  }\n\n  padding() {\n    return DefaultEncryption.PADDING\n  }\n\n  _reload(core) {\n    const block = b4a.equals(this.key, this.blockKey)\n    const keys = DefaultEncryption.deriveKeys(this.key, core.key, { block, compat: core.compat })\n\n    this.blockKey = keys.blockKey\n    this.blindingKey = keys.blindingKey\n  }\n}\nmodule.exports = class Download {\n  constructor(session, range) {\n    this.session = session\n    this.range = range\n    this.request = null\n    this.opened = false\n    this.opening = this._open()\n    this.opening.catch(noop)\n  }\n\n  ready() {\n    return this.opening\n  }\n\n  async _open() {\n    if (this.session.opened === false) await this.session.opening\n    this._download()\n    this.opened = true\n  }\n\n  async done() {\n    await this.ready()\n\n    try {\n      return await this.request.promise\n    } catch (err) {\n      if (isSessionMoved(err)) return this._download()\n      throw err\n    }\n  }\n\n  _download() {\n    const activeRequests = (this.range && this.range.activeRequests) || this.session.activeRequests\n    this.request = this.session.core.replicator.addRange(activeRequests, this.range)\n    this.request.promise.catch(noop)\n    return this.request.promise\n  }\n\n  /**\n   * Deprecated. Use `range.done()`.\n   */\n  downloaded() {\n    return this.done()\n  }\n\n  destroy() {\n    this._destroyBackground().catch(noop)\n  }\n\n  async _destroyBackground() {\n    if (this.opened === false) await this.ready()\n    if (this.request.context) this.request.context.detach(this.request)\n  }\n}\n\nfunction noop() {}\n\nfunction isSessionMoved(err) {\n  return err.code === 'SESSION_MOVED'\n}\nconst TICKS = 16\n\nmodule.exports = class HotswapQueue {\n  constructor() {\n    this.priorities = [[], [], []]\n  }\n\n  *pick(peer) {\n    for (let i = 0; i < this.priorities.length; i++) {\n      // try first one more than second one etc etc\n      let ticks = (this.priorities.length - i) * TICKS\n      const queue = this.priorities[i]\n\n      for (let j = 0; j < queue.length; j++) {\n        const r = j + Math.floor(Math.random() * queue.length - j)\n        const a = queue[j]\n        const b = queue[r]\n\n        if (r !== j) {\n          queue[(b.hotswap.index = j)] = b\n          queue[(a.hotswap.index = r)] = a\n        }\n\n        if (hasInflight(b, peer)) continue\n\n        yield b\n\n        if (--ticks <= 0) break\n      }\n    }\n  }\n\n  add(block) {\n    if (block.hotswap !== null) this.remove(block)\n    if (block.inflight.length === 0 || block.inflight.length >= 3) return\n\n    // TODO: also use other stuff to determine queue prio\n    const queue = this.priorities[block.inflight.length - 1]\n\n    const index = queue.push(block) - 1\n    block.hotswap = { ref: this, queue, index }\n  }\n\n  remove(block) {\n    const hotswap = block.hotswap\n    if (hotswap === null) return\n\n    block.hotswap = null\n    const head = hotswap.queue.pop()\n    if (head === block) return\n    hotswap.queue[(head.hotswap.index = hotswap.index)] = head\n  }\n}\n\nfunction hasInflight(block, peer) {\n  for (let j = 0; j < block.inflight.length; j++) {\n    if (block.inflight[j].peer === peer) return true\n  }\n  return false\n}\nmodule.exports = class Info {\n  constructor(opts = {}) {\n    this.key = opts.key\n    this.discoveryKey = opts.discoveryKey\n    this.length = opts.length || 0\n    this.contiguousLength = opts.contiguousLength || 0\n    this.byteLength = opts.byteLength || 0\n    this.fork = opts.fork || 0\n    this.padding = opts.padding || 0\n    this.storage = opts.storage || null\n  }\n\n  static async from(session, opts = {}) {\n    return new Info({\n      key: session.key,\n      discoveryKey: session.discoveryKey,\n      length: session.length,\n      contiguousLength: session.contiguousLength,\n      byteLength: session.byteLength,\n      fork: session.fork,\n      padding: session.padding,\n      storage: opts.storage ? await this.storage(session) : null\n    })\n  }\n\n  static async storage(session) {\n    const { oplog, tree, blocks, bitfield } = session.core\n    try {\n      return {\n        oplog: await Info.bytesUsed(oplog.storage),\n        tree: await Info.bytesUsed(tree.storage),\n        blocks: await Info.bytesUsed(blocks.storage),\n        bitfield: await Info.bytesUsed(bitfield.storage)\n      }\n    } catch {\n      return null\n    }\n  }\n\n  static bytesUsed(file) {\n    return new Promise((resolve, reject) => {\n      file.stat((err, st) => {\n        if (err) {\n          resolve(0) // prob just file not found (TODO, improve)\n        } else if (typeof st.blocks !== 'number') {\n          reject(new Error('cannot determine bytes used'))\n        } else {\n          resolve(st.blocks * 512)\n        }\n      })\n    })\n  }\n}\nconst b4a = require('b4a')\n\nmodule.exports = function (core, depth, opts) {\n  let indent = ''\n  if (typeof opts.indentationLvl === 'number') {\n    while (indent.length < opts.indentationLvl) indent += ' '\n  }\n\n  let peers = ''\n  const min = Math.min(core.peers.length, 5)\n\n  for (let i = 0; i < min; i++) {\n    const peer = core.peers[i]\n\n    peers += `${indent}    Peer(\\n`\n    peers += `${indent}      remotePublicKey: ${opts.stylize(toHex(peer.remotePublicKey), 'string')}\\n`\n    peers += `${indent}      remoteLength: ${opts.stylize(peer.remoteLength, 'number')}\\n`\n    peers += `${indent}      remoteFork: ${opts.stylize(peer.remoteFork, 'number')}\\n`\n    peers += `${indent}      remoteCanUpgrade: ${opts.stylize(peer.remoteCanUpgrade, 'boolean')}\\n`\n    peers += `${indent}    )\\n`\n  }\n\n  if (core.peers.length > 5) {\n    peers += `${indent}  ... and ${core.peers.length - 5} more\\n`\n  }\n\n  if (peers) peers = `[\\n${peers}${indent}  ]`\n  else peers = `[ ${opts.stylize(0, 'number')} ]`\n\n  return (\n    `${core.constructor.name}(\\n` +\n    `${indent}  id: ${opts.stylize(core.id, 'string')}\\n` +\n    `${indent}  key: ${opts.stylize(toHex(core.key), 'string')}\\n` +\n    `${indent}  discoveryKey: ${opts.stylize(toHex(core.discoveryKey), 'string')}\\n` +\n    `${indent}  opened: ${opts.stylize(core.opened, 'boolean')}\\n` +\n    `${indent}  closed: ${opts.stylize(core.closed, 'boolean')}\\n` +\n    `${indent}  snapshotted: ${opts.stylize(core.snapshotted, 'boolean')}\\n` +\n    `${indent}  writable: ${opts.stylize(core.writable, 'boolean')}\\n` +\n    `${indent}  length: ${opts.stylize(core.length, 'number')}\\n` +\n    `${indent}  fork: ${opts.stylize(core.fork, 'number')}\\n` +\n    `${indent}  sessions: [ ${opts.stylize(core.sessions.length, 'number')} ]\\n` +\n    `${indent}  activeRequests: [ ${opts.stylize(core.activeRequests.length, 'number')} ]\\n` +\n    `${indent}  peers: ${peers}\\n` +\n    `${indent})`\n  )\n}\n\nfunction toHex(buf) {\n  return buf && b4a.toString(buf, 'hex')\n}\nconst flat = require('flat-tree')\nconst crypto = require('hypercore-crypto')\nconst b4a = require('b4a')\nconst unslab = require('unslab')\nconst caps = require('./caps')\nconst {\n  INVALID_PROOF,\n  INVALID_CHECKSUM,\n  INVALID_OPERATION,\n  BAD_ARGUMENT,\n  ASSERTION\n} = require('hypercore-errors')\n\nclass NodeQueue {\n  constructor(nodes, extra = null) {\n    this.i = 0\n    this.nodes = nodes\n    this.extra = extra\n    this.length = nodes.length + (this.extra === null ? 0 : 1)\n  }\n\n  shift(index) {\n    if (this.extra !== null && this.extra.index === index) {\n      const node = this.extra\n      this.extra = null\n      this.length--\n      return node\n    }\n\n    if (this.i >= this.nodes.length) {\n      throw INVALID_OPERATION('Expected node ' + index + ', got (nil)')\n    }\n\n    const node = this.nodes[this.i++]\n    if (node.index !== index) {\n      throw INVALID_OPERATION('Expected node ' + index + ', got node ' + node.index)\n    }\n\n    this.length--\n    return node\n  }\n}\n\nclass MerkleTreeBatch {\n  constructor(session) {\n    this.fork = session.fork\n    this.roots = [...session.roots]\n    this.length = session.length\n    this.signature = session.signature\n    this.ancestors = session.length\n    this.byteLength = session.byteLength\n    this.prologue = session.prologue\n    this.hashCached = null\n\n    this.committed = false\n    this.truncated = false\n    this.treeLength = session.length\n    this.treeFork = session.fork\n    this.storage = session.storage\n    this.session = session\n    this.nodes = []\n    this.upgraded = false\n  }\n\n  checkout(length, additionalRoots) {\n    const roots = []\n    let r = 0\n\n    const head = 2 * length - 2\n    const gaps = new Set()\n    const all = new Map()\n\n    // additional roots is so the original roots can be passed (we mutate the array in appendRoot)\n    if (additionalRoots) {\n      for (const node of additionalRoots) all.set(node.index, node)\n    }\n\n    for (const node of this.nodes) all.set(node.index, node)\n\n    for (const index of flat.fullRoots(head + 2)) {\n      const left = flat.leftSpan(index)\n      if (left !== 0) gaps.add(left - 1)\n\n      if (r < this.roots.length && this.roots[r].index === index) {\n        roots.push(this.roots[r++])\n        continue\n      }\n      const node = all.get(index)\n      if (!node) throw new BAD_ARGUMENT('root missing for given length')\n      roots.push(node)\n    }\n\n    this.roots = roots\n    this.length = length\n    this.byteLength = totalSize(roots)\n    this.hashCached = null\n    this.signature = null\n\n    for (let i = 0; i < this.nodes.length; i++) {\n      const index = this.nodes[i].index\n      if (index <= head && !gaps.has(index)) continue\n      const last = this.nodes.pop()\n      if (i < this.nodes.length) this.nodes[i--] = last\n    }\n  }\n\n  prune(length) {\n    if (length === 0) return\n\n    const head = 2 * length - 2\n    const gaps = new Set()\n\n    // TODO: make a function for this in flat-tree\n    for (const index of flat.fullRoots(head + 2)) {\n      const left = flat.leftSpan(index)\n      if (left !== 0) gaps.add(left - 1)\n    }\n\n    for (let i = 0; i < this.nodes.length; i++) {\n      const index = this.nodes[i].index\n      if (index > head || gaps.has(index)) continue\n      const last = this.nodes.pop()\n      if (i < this.nodes.length) this.nodes[i--] = last\n    }\n  }\n\n  clone() {\n    const b = new MerkleTreeBatch(this.session)\n\n    b.fork = this.fork\n    b.roots = [...this.roots]\n    b.length = this.length\n    b.byteLength = this.byteLength\n    b.signature = this.signature\n    b.treeLength = this.treeLength\n    b.treeFork = this.treeFork\n    b.tree = this.tree\n    b.nodes = [...this.nodes]\n    b.upgraded = this.upgraded\n\n    return b\n  }\n\n  hash() {\n    if (this.hashCached === null) this.hashCached = unslab(crypto.tree(this.roots))\n    return this.hashCached\n  }\n\n  signable(manifestHash) {\n    return caps.treeSignable(manifestHash, this.hash(), this.length, this.fork)\n  }\n\n  signableCompat(noHeader) {\n    return caps.treeSignableCompat(this.hash(), this.length, this.fork, noHeader)\n  }\n\n  get(index) {\n    if (index >= this.length * 2) {\n      return null\n    }\n\n    for (const n of this.nodes) {\n      if (n.index === index) return n\n    }\n\n    return getTreeNodeFromStorage(this.session.storage, index)\n  }\n\n  // deprecated, use sssion proof instead\n  proof(batch, { block, hash, seek, upgrade }) {\n    return generateProof(this.session, batch, block, hash, seek, upgrade)\n  }\n\n  verifyUpgrade(proof) {\n    const unverified = verifyTree(proof, this.nodes)\n\n    if (!proof.upgrade) throw INVALID_OPERATION('Expected upgrade proof')\n\n    return verifyUpgrade(proof, unverified, this)\n  }\n\n  addNodesUnsafe(nodes) {\n    for (let i = 0; i < nodes.length; i++) {\n      this.nodes.push(nodes[i])\n    }\n  }\n\n  append(buf) {\n    const head = this.length * 2\n    const ite = flat.iterator(head)\n    const node = blockNode(head, buf)\n\n    this.appendRoot(node, ite)\n  }\n\n  appendRoot(node, ite) {\n    node = unslabNode(node)\n    this.hashCached = null\n    this.upgraded = true\n    this.length += ite.factor / 2\n    this.byteLength += node.size\n    this.roots.push(node)\n    this.nodes.push(node)\n\n    while (this.roots.length > 1) {\n      const a = this.roots[this.roots.length - 1]\n      const b = this.roots[this.roots.length - 2]\n\n      // TODO: just have a peek sibling instead? (pretty sure it's always the left sib as well)\n      if (ite.sibling() !== b.index) {\n        ite.sibling() // unset so it always points to last root\n        break\n      }\n\n      const node = unslabNode(parentNode(ite.parent(), a, b))\n      this.nodes.push(node)\n      this.roots.pop()\n      this.roots.pop()\n      this.roots.push(node)\n    }\n  }\n\n  commitable() {\n    return (\n      this.treeFork === this.session.fork &&\n      (this.upgraded\n        ? this.treeLength === this.session.length\n        : this.treeLength <= this.session.length)\n    )\n  }\n\n  commit(tx) {\n    if (tx === undefined) throw INVALID_OPERATION('No database batch was passed')\n    if (!this.commitable()) {\n      throw INVALID_OPERATION('Tree was modified during batch, refusing to commit')\n    }\n\n    if (this.upgraded) this._commitUpgrade(tx)\n\n    for (let i = 0; i < this.nodes.length; i++) {\n      const node = this.nodes[i]\n      tx.putTreeNode(node)\n    }\n\n    this.committed = true\n\n    return this\n  }\n\n  _commitUpgrade(tx) {\n    // TODO: If easy to detect, we should refuse an trunc+append here without a fork id\n    // change. Will only happen on user error so mostly to prevent that.\n\n    if (this.ancestors < this.treeLength) {\n      tx.deleteTreeNodeRange(this.ancestors * 2, this.treeLength * 2)\n\n      if (this.ancestors > 0) {\n        const head = this.ancestors * 2\n        const ite = flat.iterator(head - 2)\n\n        while (true) {\n          if (ite.contains(head) && ite.index < head) {\n            tx.deleteTreeNode(ite.index)\n          }\n          if (ite.offset === 0) break\n          ite.parent()\n        }\n\n        this.truncated = true\n      }\n    }\n  }\n\n  seek(bytes, padding) {\n    return new ByteSeeker(this, this, bytes, padding)\n  }\n\n  byteRange(index) {\n    const rx = this.storage.read()\n    const range = getByteRange(this, index, rx)\n    rx.tryFlush()\n\n    return range\n  }\n\n  byteOffset(index) {\n    if (index === 2 * this.length) return this.byteLength\n\n    const rx = this.storage.read()\n    const offset = getByteOffset(this, index, rx)\n    rx.tryFlush()\n\n    return offset\n  }\n\n  async downgrade() {\n    if (!this.upgraded) return true\n\n    const rx = this.storage.read()\n    const nodePromises = []\n\n    for (const r of this.roots) {\n      nodePromises.push(rx.getTreeNode(r.index))\n    }\n\n    rx.tryFlush()\n\n    const nodes = await Promise.all(nodePromises)\n\n    for (let i = 0; i < this.roots.length; i++) {\n      const root = this.roots[i]\n      const node = nodes[i]\n\n      if (!node) return false\n      if (!b4a.equals(node.hash, root.hash)) return false\n    }\n\n    this.upgraded = false\n    return true\n  }\n\n  async restore(length) {\n    if (length === this.length) return this\n\n    const roots = unslabNodes(await MerkleTree.getRootsFromStorage(this.storage, length))\n\n    this.roots = roots\n    this.length = length\n    this.byteLength = totalSize(roots)\n    this.ancestors = length\n\n    for (const node of roots) this.byteLength += node.size\n\n    return this\n  }\n}\n\nclass ReorgBatch extends MerkleTreeBatch {\n  constructor(session) {\n    super(session)\n\n    this.roots = []\n    this.length = 0\n    this.byteLength = 0\n    this.diff = null\n    this.ancestors = 0\n    // We set upgraded because reorgs are signed so hit will\n    // hit the same code paths (like the treeLength check in commit)\n    this.upgraded = true\n    this.want = {\n      nodes: 0,\n      start: 0,\n      end: 0\n    }\n  }\n\n  get finished() {\n    return this.want === null\n  }\n\n  update(proof) {\n    if (this.want === null) return true\n\n    const nodes = []\n    const root = verifyTree(proof, nodes)\n\n    if (root === null || !b4a.equals(root.hash, this.diff.hash)) return false\n\n    this.nodes.push(...nodes)\n    return this._update(nodes)\n  }\n\n  async _update(nodes) {\n    const n = new Map()\n    for (const node of nodes) n.set(node.index, node)\n\n    let diff = null\n    const ite = flat.iterator(this.diff.index)\n    const startingDiff = this.diff\n\n    while ((ite.index & 1) !== 0) {\n      const left = n.get(ite.leftChild())\n      if (!left) break\n\n      const existing = await getTreeNodeFromStorage(this.session.storage, left.index)\n      if (!existing || !b4a.equals(existing.hash, left.hash)) {\n        diff = left\n      } else {\n        diff = n.get(ite.sibling())\n      }\n    }\n\n    if ((this.diff.index & 1) === 0) return true\n    if (diff === null) return false\n    if (startingDiff !== this.diff) return false\n\n    return this._updateDiffRoot(diff)\n  }\n\n  _updateDiffRoot(diff) {\n    if (this.want === null) return true\n\n    const spans = flat.spans(diff.index)\n    const start = spans[0] / 2\n    const end = Math.min(this.treeLength, spans[1] / 2 + 1)\n    const len = end - start\n\n    this.ancestors = start\n    this.diff = diff\n\n    if ((diff.index & 1) === 0 || this.want.start >= this.treeLength || len <= 0) {\n      this.want = null\n      return true\n    }\n\n    this.want.start = start\n    this.want.end = end\n    this.want.nodes = log2(spans[1] - spans[0] + 2) - 1\n\n    return false\n  }\n}\n\nclass ByteSeeker {\n  constructor(session, bytes, padding = 0) {\n    this.session = session\n    this.bytes = bytes\n    this.padding = padding\n\n    const size = session.byteLength - session.length * padding\n\n    this.start = bytes >= size ? session.length : 0\n    this.end = bytes < size ? session.length : 0\n  }\n\n  async _seek(bytes) {\n    if (!bytes) return [0, 0]\n\n    for (const node of this.session.roots) {\n      // all async ticks happen once we find the root so safe\n      const size = getUnpaddedSize(node, this.padding, null)\n\n      if (bytes === size) return [flat.rightSpan(node.index) + 2, 0]\n      if (bytes > size) {\n        bytes -= size\n        continue\n      }\n\n      const ite = flat.iterator(node.index)\n\n      while ((ite.index & 1) !== 0) {\n        const l = await getTreeNodeFromStorage(this.session.storage, ite.leftChild())\n\n        if (l) {\n          const size = getUnpaddedSize(l, this.padding, ite)\n\n          if (size === bytes) return [ite.rightSpan() + 2, 0]\n          if (size > bytes) continue\n          bytes -= size\n          ite.sibling()\n        } else {\n          ite.parent()\n          return [ite.index, bytes]\n        }\n      }\n\n      return [ite.index, bytes]\n    }\n\n    return null\n  }\n\n  async update() {\n    // TODO: combine _seek and this, much simpler\n    const res = await this._seek(this.bytes)\n    if (!res) return null\n    if ((res[0] & 1) === 0) return [res[0] / 2, res[1]]\n\n    const span = flat.spans(res[0])\n    this.start = span[0] / 2\n    this.end = span[1] / 2 + 1\n\n    return null\n  }\n}\n\nclass TreeProof {\n  constructor(session, block, hash, seek, upgrade) {\n    this.fork = session.fork\n    this.signature = session.signature\n\n    this.block = block\n    this.hash = hash\n    this.seek = seek\n    this.upgrade = upgrade\n\n    this.pending = {\n      node: null,\n      seek: null,\n      upgrade: null,\n      additionalUpgrade: null\n    }\n  }\n\n  async settle() {\n    const result = {\n      fork: this.fork,\n      block: null,\n      hash: null,\n      seek: null,\n      upgrade: null,\n      manifest: null\n    }\n\n    const [pNode, pSeek, pUpgrade, pAdditional] = await settleProof(this.pending)\n\n    if (this.block) {\n      if (pNode === null) throw INVALID_OPERATION('Invalid block request')\n      result.block = {\n        index: this.block.index,\n        value: null, // populated upstream, alloc it here for simplicity\n        nodes: pNode\n      }\n    } else if (this.hash) {\n      if (pNode === null) throw INVALID_OPERATION('Invalid block request')\n      result.hash = {\n        index: this.hash.index,\n        nodes: pNode\n      }\n    }\n\n    if (this.seek && pSeek !== null) {\n      result.seek = {\n        bytes: this.seek.bytes,\n        nodes: pSeek\n      }\n    }\n\n    if (this.upgrade) {\n      result.upgrade = {\n        start: this.upgrade.start,\n        length: this.upgrade.length,\n        nodes: pUpgrade,\n        additionalNodes: pAdditional || [],\n        signature: this.signature\n      }\n    }\n\n    return result\n  }\n}\n\nclass MerkleTree {\n  static hash(s) {\n    return unslab(crypto.tree(s.roots))\n  }\n\n  static signable(s, namespace) {\n    return caps.treeSignable(namespace, MerkleTree.hash(s), s.length, s.fork)\n  }\n\n  static size(roots) {\n    return totalSize(roots)\n  }\n\n  static span(roots) {\n    return totalSpan(roots)\n  }\n\n  static getRoots(session, length) {\n    return MerkleTree.getRootsFromStorage(session.storage, length)\n  }\n\n  static getRootsFromStorage(storage, length) {\n    const indexes = flat.fullRoots(2 * length)\n    const roots = new Array(indexes.length)\n    const rx = storage.read()\n\n    for (let i = 0; i < indexes.length; i++) {\n      roots[i] = getTreeNodeOrError(rx, indexes[i])\n    }\n\n    rx.tryFlush()\n\n    return Promise.all(roots)\n  }\n\n  static async upgradeable(session, length) {\n    const indexes = flat.fullRoots(2 * length)\n    const roots = new Array(indexes.length)\n    const rx = session.storage.read()\n\n    for (let i = 0; i < indexes.length; i++) {\n      roots[i] = rx.getTreeNode(indexes[i])\n    }\n\n    rx.tryFlush()\n\n    for (const node of await Promise.all(roots)) {\n      if (node === null) return false\n    }\n\n    return true\n  }\n\n  static seek(session, bytes, padding) {\n    return new ByteSeeker(session, bytes, padding)\n  }\n\n  static get(session, index) {\n    return getTreeNodeFromStorage(session.storage, index)\n  }\n\n  static async truncate(session, length, batch, fork = batch.fork) {\n    const head = length * 2\n    const fullRoots = flat.fullRoots(head)\n\n    for (let i = 0; i < fullRoots.length; i++) {\n      const root = fullRoots[i]\n      if (i < batch.roots.length && batch.roots[i].index === root) continue\n\n      while (batch.roots.length > i) batch.roots.pop()\n      batch.roots.push(unslabNode(await getTreeNodeFromStorageOrError(session.storage, root)))\n    }\n\n    while (batch.roots.length > fullRoots.length) {\n      batch.roots.pop()\n    }\n\n    batch.fork = fork\n    batch.length = length\n    batch.ancestors = length\n    batch.byteLength = totalSize(batch.roots)\n    batch.upgraded = true\n\n    return batch\n  }\n\n  static async reorg(session, proof, batch) {\n    let unverified = null\n\n    if (proof.block || proof.hash || proof.seek) {\n      unverified = verifyTree(proof, batch.nodes)\n    }\n\n    if (!verifyUpgrade(proof, unverified, batch)) {\n      throw INVALID_PROOF('Fork proof not verifiable')\n    }\n\n    for (const root of batch.roots) {\n      const existing = await getTreeNodeFromStorage(session.storage, root.index)\n      if (existing && b4a.equals(existing.hash, root.hash)) continue\n      batch._updateDiffRoot(root)\n      break\n    }\n\n    if (batch.diff !== null) {\n      await batch._update(batch.nodes)\n    } else {\n      batch.want = null\n      batch.ancestors = batch.length\n    }\n\n    return batch\n  }\n\n  static verifyFullyRemote(session, proof) {\n    // TODO: impl this less hackishly\n    const batch = new MerkleTreeBatch(session)\n\n    batch.fork = proof.fork\n    batch.roots = []\n    batch.length = 0\n    batch.ancestors = 0\n    batch.byteLength = 0\n\n    let unverified = verifyTree(proof, batch.nodes)\n\n    if (proof.upgrade) {\n      if (verifyUpgrade(proof, unverified, batch)) {\n        unverified = null\n      }\n    }\n\n    return batch\n  }\n\n  static async verify(session, proof) {\n    const batch = new MerkleTreeBatch(session)\n\n    let unverified = verifyTree(proof, batch.nodes)\n\n    if (proof.upgrade) {\n      if (verifyUpgrade(proof, unverified, batch)) {\n        unverified = null\n      }\n    }\n\n    if (unverified) {\n      const verified = await getTreeNodeFromStorageOrError(session.storage, unverified.index)\n      if (!b4a.equals(verified.hash, unverified.hash)) {\n        throw INVALID_CHECKSUM('Invalid checksum at node ' + unverified.index)\n      }\n    }\n\n    return batch\n  }\n\n  static proof(session, rx, { block, hash, seek, upgrade }) {\n    return generateProof(session, rx, block, hash, seek, upgrade)\n  }\n\n  static maxMissingNodes(index, length) {\n    const head = 2 * length\n    const ite = flat.iterator(index)\n\n    // See iterator.rightSpan()\n    const iteRightSpan = ite.index + ite.factor / 2 - 1\n    // If the index is not in the current tree, we do not know how many missing nodes there are...\n    if (iteRightSpan >= head) return 0\n\n    for (const r of flat.fullRoots(head)) {\n      if (r === index) return 0\n    }\n\n    // need missing nodes not inclusive of index\n    ite.parent()\n\n    let cnt = 0\n    while (!ite.contains(head)) {\n      cnt++\n      ite.parent()\n    }\n\n    return cnt\n  }\n\n  static async missingNodes(session, index, length) {\n    const head = 2 * length\n    const ite = flat.iterator(index)\n\n    // See iterator.rightSpan()\n    const iteRightSpan = ite.index + ite.factor / 2 - 1\n    // If the index is not in the current tree, we do not know how many missing nodes there are...\n    if (iteRightSpan >= head) return 0\n\n    let cnt = 0\n    // TODO: we could prop use a read batch here and do this in blocks of X for perf\n    while (!ite.contains(head) && !(await hasTreeNode(session.storage, ite.index))) {\n      cnt++\n      if (cnt >= 1024) {\n        throw ASSERTION('Bad arguments to missingNodes index=' + index + ' at length=' + length)\n      }\n      ite.parent()\n    }\n\n    return cnt\n  }\n\n  static byteOffset(session, index) {\n    return getByteOffsetSession(session, index, null)\n  }\n\n  static byteRange(session, index) {\n    const rx = session.storage.read()\n    const offset = getByteOffsetSession(session, index, rx)\n    const size = getNodeSize(index, rx)\n    rx.tryFlush()\n    return Promise.all([offset, size])\n  }\n}\n\nmodule.exports = {\n  MerkleTreeBatch,\n  ReorgBatch,\n  MerkleTree\n}\n\nasync function getNodeSize(index, rx) {\n  return (await getTreeNodeOrError(rx, index)).size\n}\n\nasync function getByteOffsetSession(session, index, rx) {\n  if (index === 2 * session.length) return session.byteLength\n\n  const treeNodes =\n    rx === null\n      ? await getByteOffsetBatchFlush(session.roots, index, session.storage.read())\n      : await getByteOffsetBatch(session.roots, index, rx)\n\n  let offset = 0\n  for (const node of treeNodes) offset += node.size\n\n  return offset\n}\n\nasync function getByteOffset(tree, index, rx) {\n  if (index === 2 * tree.length) return tree.byteLength\n\n  const treeNodes = await getByteOffsetBatch(tree.roots, index, rx)\n\n  let offset = 0\n  for (const node of treeNodes) offset += node.size\n\n  return offset\n}\n\nfunction getByteOffsetBatchFlush(roots, index, rx) {\n  const treeNodes = getByteOffsetBatch(roots, index, rx)\n  rx.tryFlush()\n  return treeNodes\n}\n\nfunction getByteOffsetBatch(roots, index, rx) {\n  if ((index & 1) === 1) index = flat.leftSpan(index)\n\n  let head = 0\n  let cnt = 0\n\n  const promises = []\n\n  for (const node of roots) {\n    // all async ticks happen once we find the root so safe\n    head += 2 * (node.index - head + 1)\n\n    if (index >= head) {\n      promises.push(node.size)\n      continue\n    }\n\n    const ite = flat.iterator(node.index)\n\n    while (ite.index !== index) {\n      if (++cnt >= 1024) throw ASSERTION('Bad getByteOffsetSession index=' + index)\n\n      if (index < ite.index) {\n        ite.leftChild()\n      } else {\n        promises.push(getTreeNodeOrError(rx, ite.leftChild()))\n        ite.sibling()\n      }\n    }\n\n    return Promise.all(promises)\n  }\n\n  throw ASSERTION('Failed to find offset')\n}\n\nfunction getByteRange(tree, index, rx) {\n  const head = 2 * tree.length\n  if (((index & 1) === 0 ? index : flat.rightSpan(index)) >= head) {\n    throw BAD_ARGUMENT('Index is out of bounds')\n  }\n\n  const offset = getByteOffset(tree, index, rx)\n  const size = getNodeSize(index, rx)\n\n  return Promise.all([offset, size])\n}\n\n// All the methods needed for proof verification\n\nfunction verifyTree({ block, hash, seek }, nodes) {\n  const untrustedNode = block\n    ? { index: 2 * block.index, value: block.value, nodes: block.nodes }\n    : hash\n      ? { index: hash.index, value: null, nodes: hash.nodes }\n      : null\n\n  if (untrustedNode === null && (!seek || !seek.nodes.length)) return null\n\n  let root = null\n\n  if (seek && seek.nodes.length) {\n    const ite = flat.iterator(seek.nodes[0].index)\n    const q = new NodeQueue(seek.nodes)\n\n    root = q.shift(ite.index)\n    nodes.push(root)\n\n    while (q.length > 0) {\n      const node = q.shift(ite.sibling())\n\n      root = parentNode(ite.parent(), root, node)\n      nodes.push(node)\n      nodes.push(root)\n    }\n  }\n\n  if (untrustedNode === null) return root\n\n  const ite = flat.iterator(untrustedNode.index)\n  const blockHash = untrustedNode.value && blockNode(ite.index, untrustedNode.value)\n\n  const q = new NodeQueue(untrustedNode.nodes, root)\n\n  root = blockHash || q.shift(ite.index)\n  nodes.push(root)\n\n  while (q.length > 0) {\n    const node = q.shift(ite.sibling())\n\n    root = parentNode(ite.parent(), root, node)\n    nodes.push(node)\n    nodes.push(root)\n  }\n\n  return root\n}\n\nfunction verifyUpgrade({ fork, upgrade }, blockRoot, batch) {\n  const prologue = batch.prologue\n\n  if (prologue) {\n    const { start, length } = upgrade\n    if (start < prologue.length && (start !== 0 || length < prologue.length)) {\n      throw INVALID_PROOF('Upgrade does not satisfy prologue')\n    }\n  }\n\n  const q = new NodeQueue(upgrade.nodes, blockRoot)\n\n  let grow = batch.roots.length > 0\n  let i = 0\n\n  const to = 2 * (upgrade.start + upgrade.length)\n  const ite = flat.iterator(0)\n\n  for (; ite.fullRoot(to); ite.nextTree()) {\n    if (i < batch.roots.length && batch.roots[i].index === ite.index) {\n      i++\n      continue\n    }\n\n    if (grow) {\n      grow = false\n      const root = ite.index\n      if (i < batch.roots.length) {\n        ite.seek(batch.roots[batch.roots.length - 1].index)\n        while (ite.index !== root) {\n          batch.appendRoot(q.shift(ite.sibling()), ite)\n        }\n        continue\n      }\n    }\n\n    batch.appendRoot(q.shift(ite.index), ite)\n  }\n\n  if (prologue && batch.length === prologue.length) {\n    if (!b4a.equals(prologue.hash, batch.hash())) {\n      throw INVALID_PROOF('Invalid hash')\n    }\n  }\n\n  const extra = upgrade.additionalNodes\n\n  ite.seek(batch.roots[batch.roots.length - 1].index)\n  i = 0\n\n  while (i < extra.length && extra[i].index === ite.sibling()) {\n    batch.appendRoot(extra[i++], ite)\n  }\n\n  while (i < extra.length) {\n    const node = extra[i++]\n\n    while (node.index !== ite.index) {\n      if (ite.factor === 2) throw INVALID_OPERATION('Unexpected node: ' + node.index)\n      ite.leftChild()\n    }\n\n    batch.appendRoot(node, ite)\n    ite.sibling()\n  }\n\n  batch.signature = unslab(upgrade.signature)\n  batch.fork = fork\n\n  return q.extra === null\n}\n\nasync function seekFromHead(session, head, bytes, padding) {\n  const roots = flat.fullRoots(head)\n\n  for (let i = 0; i < roots.length; i++) {\n    const root = roots[i]\n    const node = await getTreeNodeFromStorage(session.storage, root)\n    const size = getUnpaddedSize(node, padding, null)\n\n    if (bytes === size) return root\n    if (bytes > size) {\n      bytes -= size\n      continue\n    }\n\n    return seekTrustedTree(session, root, bytes, padding)\n  }\n\n  return head\n}\n\n// trust that bytes are within the root tree and find the block at bytes\n\nasync function seekTrustedTree(session, root, bytes, padding) {\n  if (!bytes) return root\n\n  const ite = flat.iterator(root)\n  let cnt = 0\n\n  while ((ite.index & 1) !== 0) {\n    if (++cnt >= 1024) throw ASSERTION('Bad seekTrusted bytes=' + bytes + ', paddding=' + padding)\n    const l = await getTreeNodeFromStorage(session.storage, ite.leftChild())\n\n    if (l) {\n      const size = getUnpaddedSize(l, padding, ite)\n      if (size === bytes) return ite.index\n      if (size > bytes) continue\n      bytes -= size\n      ite.sibling()\n    } else {\n      ite.parent()\n      return ite.index\n    }\n  }\n\n  return ite.index\n}\n\n// try to find the block at bytes without trusting that is *is* within the root passed\n\nasync function seekUntrustedTree(session, root, bytes, padding) {\n  const offset =\n    (await getByteOffsetSession(session, root, null)) -\n    (padding ? (padding * flat.leftSpan(root)) / 2 : 0)\n\n  if (offset > bytes) throw INVALID_OPERATION('Invalid seek')\n  if (offset === bytes) return root\n\n  bytes -= offset\n\n  const node = await getTreeNodeFromStorageOrError(session.storage, root)\n\n  if (getUnpaddedSize(node, padding, null) <= bytes) throw INVALID_OPERATION('Invalid seek')\n\n  return seekTrustedTree(session, root, bytes, padding)\n}\n\n// Below is proof production, ie, construct proofs to verify a request\n// Note, that all these methods are sync as we can statically infer which nodes\n// are needed for the remote to verify given they arguments they passed us\n\nfunction seekProof(session, rx, seekRoot, root, p) {\n  const ite = flat.iterator(seekRoot)\n  let cnt = 0\n\n  p.seek = []\n  p.seek.push(getTreeNodeOrError(rx, ite.index))\n\n  while (ite.index !== root) {\n    if (++cnt >= 1024) throw ASSERTION('Bad seekProof seekRoot=' + seekRoot + ', root=' + root)\n    ite.sibling()\n    p.seek.push(getTreeNodeOrError(rx, ite.index))\n    ite.parent()\n  }\n}\n\nfunction blockAndSeekProof(session, rx, node, seek, seekRoot, root, p) {\n  if (!node) return seekProof(session, rx, seekRoot, root, p)\n\n  const ite = flat.iterator(node.index)\n  let cnt = 0\n\n  p.node = []\n  if (!node.value) p.node.push(getTreeNodeOrError(rx, ite.index))\n\n  while (ite.index !== root) {\n    if (++cnt >= 1024) {\n      throw ASSERTION('Bad blockAndSeekProof seekRoot=' + seekRoot + ', root=' + root)\n    }\n    ite.sibling()\n\n    if (seek && ite.contains(seekRoot) && ite.index !== seekRoot) {\n      seekProof(session, rx, seekRoot, ite.index, p)\n    } else {\n      p.node.push(getTreeNodeOrError(rx, ite.index))\n    }\n\n    ite.parent()\n  }\n}\n\nfunction upgradeProof(session, rx, node, seek, from, to, subTree, p) {\n  if (from === 0) p.upgrade = []\n\n  for (const ite = flat.iterator(0); ite.fullRoot(to); ite.nextTree()) {\n    // check if they already have the node\n    if (ite.index + ite.factor / 2 < from) continue\n\n    // connect existing tree\n    if (p.upgrade === null && ite.contains(from - 2)) {\n      p.upgrade = []\n\n      const root = ite.index\n      const target = from - 2\n      let cnt = 0\n\n      ite.seek(target)\n\n      while (ite.index !== root) {\n        if (++cnt >= 1024) throw ASSERTION('Bad upgradeProof target=' + target + ', root=' + root)\n\n        ite.sibling()\n        if (ite.index > target) {\n          if (p.node === null && p.seek === null && ite.contains(subTree)) {\n            blockAndSeekProof(session, rx, node, seek, subTree, ite.index, p)\n          } else {\n            p.upgrade.push(getTreeNodeOrError(rx, ite.index))\n          }\n        }\n        ite.parent()\n      }\n\n      continue\n    }\n\n    if (p.upgrade === null) {\n      p.upgrade = []\n    }\n\n    // if the subtree included is a child of this tree, include that one\n    // instead of a dup node\n    if (p.node === null && p.seek === null && ite.contains(subTree)) {\n      blockAndSeekProof(session, rx, node, seek, subTree, ite.index, p)\n      continue\n    }\n\n    // add root (can be optimised since the root might be in tree.roots)\n    p.upgrade.push(getTreeNodeOrError(rx, ite.index))\n  }\n}\n\nfunction additionalUpgradeProof(session, rx, from, to, p) {\n  if (from === 0) p.additionalUpgrade = []\n\n  for (const ite = flat.iterator(0); ite.fullRoot(to); ite.nextTree()) {\n    // check if they already have the node\n    if (ite.index + ite.factor / 2 < from) continue\n\n    // connect existing tree\n    if (p.additionalUpgrade === null && ite.contains(from - 2)) {\n      p.additionalUpgrade = []\n\n      const root = ite.index\n      const target = from - 2\n      let cnt = 0\n\n      ite.seek(target)\n\n      while (ite.index !== root) {\n        if (++cnt >= 1024) {\n          throw ASSERTION(\n            'Bad arguments to additionalUpgradeProof root=' + root + ' target=' + target\n          )\n        }\n        ite.sibling()\n        if (ite.index > target) {\n          p.additionalUpgrade.push(getTreeNodeOrError(rx, ite.index))\n        }\n        ite.parent()\n      }\n\n      continue\n    }\n\n    if (p.additionalUpgrade === null) {\n      p.additionalUpgrade = []\n    }\n\n    // add root (can be optimised since the root is in tree.roots)\n    p.additionalUpgrade.push(getTreeNodeOrError(rx, ite.index))\n  }\n}\n\nfunction nodesToRoot(index, nodes, head) {\n  const ite = flat.iterator(index)\n\n  for (let i = 0; i < nodes; i++) {\n    ite.parent()\n    if (ite.contains(head)) throw INVALID_OPERATION('Nodes is out of bounds')\n  }\n\n  return ite.index\n}\n\nfunction totalSize(nodes) {\n  let s = 0\n  for (const node of nodes) s += node.size\n  return s\n}\n\nfunction totalSpan(nodes) {\n  let s = 0\n  for (const node of nodes) s += 2 * (node.index - s + 1)\n  return s\n}\n\nfunction blockNode(index, value) {\n  return { index, size: value.byteLength, hash: crypto.data(value) }\n}\n\nfunction parentNode(index, a, b) {\n  return { index, size: a.size + b.size, hash: crypto.parent(a, b) }\n}\n\nfunction log2(n) {\n  let res = 1\n\n  while (n > 2) {\n    n /= 2\n    res++\n  }\n\n  return res\n}\n\nfunction normalizeIndexed(block, hash) {\n  if (block) {\n    return {\n      value: true,\n      index: block.index * 2,\n      nodes: block.nodes,\n      lastIndex: block.index\n    }\n  }\n  if (hash) {\n    return {\n      value: false,\n      index: hash.index,\n      nodes: hash.nodes,\n      lastIndex: flat.rightSpan(hash.index) / 2\n    }\n  }\n  return null\n}\n\nasync function getTreeNodeOrError(rx, index) {\n  const node = await rx.getTreeNode(index)\n  if (node === null) {\n    throw INVALID_OPERATION('Expected tree node ' + index + ' from storage, got (nil)')\n  }\n  return node\n}\n\nfunction getTreeNodeFromStorageOrError(storage, index) {\n  const rx = storage.read()\n  const p = getTreeNodeOrError(rx, index)\n  rx.tryFlush()\n  return p\n}\n\nfunction getTreeNodeFromStorage(storage, index) {\n  const rx = storage.read()\n  const node = rx.getTreeNode(index)\n  rx.tryFlush()\n  return node\n}\n\nfunction hasTreeNode(storage, index) {\n  const rx = storage.read()\n  const has = rx.hasTreeNode(index)\n  rx.tryFlush()\n  return has\n}\n\nasync function settleProof(p) {\n  const result = [\n    p.node && Promise.all(p.node),\n    p.seek && Promise.all(p.seek),\n    p.upgrade && Promise.all(p.upgrade),\n    p.additionalUpgrade && Promise.all(p.additionalUpgrade)\n  ]\n\n  try {\n    return await Promise.all(result)\n  } catch (err) {\n    if (p.node) await Promise.allSettled(p.node)\n    if (p.seek) await Promise.allSettled(p.seek)\n    if (p.upgrade) await Promise.allSettled(p.upgrade)\n    if (p.additionalUpgrade) await Promise.allSettled(p.additionalUpgrade)\n    throw err\n  }\n}\n\n// tree can be either the merkle tree or a merkle tree batch\nasync function generateProof(session, rx, block, hash, seek, upgrade) {\n  // Important that this does not throw inbetween making the promise arrays\n  // and finalise being called, otherwise there will be lingering promises in the background\n\n  if (session.prologue && upgrade) {\n    upgrade.start = upgrade.start < session.prologue.length ? 0 : upgrade.start\n    upgrade.length =\n      upgrade.start < session.prologue.length ? session.prologue.length : upgrade.length\n  }\n\n  const head = 2 * session.length\n  const from = upgrade ? upgrade.start * 2 : 0\n  const to = upgrade ? from + upgrade.length * 2 : head\n  const node = normalizeIndexed(block, hash)\n\n  // can't do anything as we have no data...\n  if (head === 0) return new TreeProof(session, null, null, null, null)\n\n  if (from >= to || to > head) {\n    throw INVALID_OPERATION('Invalid upgrade')\n  }\n  if (seek && upgrade && node !== null && node.index >= from) {\n    throw INVALID_OPERATION('Cannot both do a seek and block/hash request when upgrading')\n  }\n\n  let subTree = head\n\n  const p = new TreeProof(session, block, hash, seek, upgrade)\n\n  if (node !== null && (!upgrade || node.lastIndex < upgrade.start)) {\n    subTree = nodesToRoot(node.index, node.nodes, to)\n    const seekRoot = seek\n      ? await seekUntrustedTree(session, subTree, seek.bytes, seek.padding)\n      : head\n    blockAndSeekProof(session, rx, node, seek, seekRoot, subTree, p.pending)\n  } else if ((node || seek) && upgrade) {\n    subTree = seek ? await seekFromHead(session, to, seek.bytes, seek.padding) : node.index\n  }\n\n  if (upgrade) {\n    upgradeProof(session, rx, node, seek, from, to, subTree, p.pending)\n    if (head > to) additionalUpgradeProof(session, rx, to, head, p.pending)\n  }\n\n  return p\n}\n\nfunction getUnpaddedSize(node, padding, ite) {\n  return padding === 0\n    ? node.size\n    : node.size - padding * (ite ? ite.countLeaves() : flat.countLeaves(node.index))\n}\n\nfunction unslabNodes(nodes) {\n  for (const node of nodes) unslabNode(node)\n  return nodes\n}\n\nfunction unslabNode(node) {\n  if (node === null) return node\n  node.hash = unslab(node.hash)\n  return node\n}\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\nconst { DEFAULT_NAMESPACE } = require('./caps')\nconst { INVALID_OPLOG_VERSION } = require('hypercore-errors')\nconst unslab = require('unslab')\n\nconst EMPTY = b4a.alloc(0)\n\nconst MANIFEST_PATCH = 0b00000001\nconst MANIFEST_PROLOGUE = 0b00000010\nconst MANIFEST_LINKED = 0b00000100\nconst MANIFEST_USER_DATA = 0b00001000\n\nconst hashes = {\n  preencode(state, m) {\n    state.end++ // small uint\n  },\n  encode(state, m) {\n    if (m === 'blake2b') {\n      c.uint.encode(state, 0)\n      return\n    }\n\n    throw new Error('Unknown hash: ' + m)\n  },\n  decode(state) {\n    const n = c.uint.decode(state)\n    if (n === 0) return 'blake2b'\n    throw new Error('Unknown hash id: ' + n)\n  }\n}\n\nconst signatures = {\n  preencode(state, m) {\n    state.end++ // small uint\n  },\n  encode(state, m) {\n    if (m === 'ed25519') {\n      c.uint.encode(state, 0)\n      return\n    }\n\n    throw new Error('Unknown signature: ' + m)\n  },\n  decode(state) {\n    const n = c.uint.decode(state)\n    if (n === 0) return 'ed25519'\n    throw new Error('Unknown signature id: ' + n)\n  }\n}\n\nconst signer = {\n  preencode(state, m) {\n    signatures.preencode(state, m.signature)\n    c.fixed32.preencode(state, m.namespace)\n    c.fixed32.preencode(state, m.publicKey)\n  },\n  encode(state, m) {\n    signatures.encode(state, m.signature)\n    c.fixed32.encode(state, m.namespace)\n    c.fixed32.encode(state, m.publicKey)\n  },\n  decode(state) {\n    return {\n      signature: signatures.decode(state),\n      namespace: c.fixed32.decode(state),\n      publicKey: c.fixed32.decode(state)\n    }\n  }\n}\n\nconst signerArray = c.array(signer)\n\nconst prologue = {\n  preencode(state, p) {\n    c.fixed32.preencode(state, p.hash)\n    c.uint.preencode(state, p.length)\n  },\n  encode(state, p) {\n    c.fixed32.encode(state, p.hash)\n    c.uint.encode(state, p.length)\n  },\n  decode(state) {\n    return {\n      hash: c.fixed32.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst manifestv0 = {\n  preencode(state, m) {\n    hashes.preencode(state, m.hash)\n    state.end++ // type\n\n    if (m.prologue && m.signers.length === 0) {\n      c.fixed32.preencode(state, m.prologue.hash)\n      return\n    }\n\n    if (m.quorum === 1 && m.signers.length === 1 && !m.allowPatch) {\n      signer.preencode(state, m.signers[0])\n    } else {\n      state.end++ // flags\n      c.uint.preencode(state, m.quorum)\n      signerArray.preencode(state, m.signers)\n    }\n  },\n  encode(state, m) {\n    hashes.encode(state, m.hash)\n\n    if (m.prologue && m.signers.length === 0) {\n      c.uint.encode(state, 0)\n      c.fixed32.encode(state, m.prologue.hash)\n      return\n    }\n\n    if (m.quorum === 1 && m.signers.length === 1 && !m.allowPatch) {\n      c.uint.encode(state, 1)\n      signer.encode(state, m.signers[0])\n    } else {\n      c.uint.encode(state, 2)\n      c.uint.encode(state, m.allowPatch ? 1 : 0)\n      c.uint.encode(state, m.quorum)\n      signerArray.encode(state, m.signers)\n    }\n  },\n  decode(state) {\n    const hash = hashes.decode(state)\n    const type = c.uint.decode(state)\n\n    if (type > 2) throw new Error('Unknown type: ' + type)\n\n    if (type === 0) {\n      return {\n        version: 0,\n        hash,\n        allowPatch: false,\n        quorum: 0,\n        signers: [],\n        prologue: {\n          hash: c.fixed32.decode(state),\n          length: 0\n        },\n        linked: null,\n        userData: null\n      }\n    }\n\n    if (type === 1) {\n      return {\n        version: 0,\n        hash,\n        allowPatch: false,\n        quorum: 1,\n        signers: [signer.decode(state)],\n        prologue: null,\n        linked: null,\n        userData: null\n      }\n    }\n\n    const flags = c.uint.decode(state)\n\n    return {\n      version: 0,\n      hash,\n      allowPatch: (flags & 1) !== 0,\n      quorum: c.uint.decode(state),\n      signers: signerArray.decode(state),\n      prologue: null,\n      linked: null,\n      userData: null\n    }\n  }\n}\n\nconst fixed32Array = c.array(c.fixed32)\n\nconst manifest = (exports.manifest = {\n  preencode(state, m) {\n    state.end++ // version\n\n    if (m.version === 0) return manifestv0.preencode(state, m)\n\n    state.end++ // flags\n    hashes.preencode(state, m.hash)\n\n    c.uint.preencode(state, m.quorum)\n    signerArray.preencode(state, m.signers)\n\n    if (m.prologue) prologue.preencode(state, m.prologue)\n    if (m.linked) fixed32Array.preencode(state, m.linked)\n    if (m.userData) c.buffer.preencode(state, m.userData)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.version)\n\n    if (m.version === 0) return manifestv0.encode(state, m)\n\n    let flags = 0\n    if (m.allowPatch) flags |= MANIFEST_PATCH\n    if (m.prologue) flags |= MANIFEST_PROLOGUE\n    if (m.linked) flags |= MANIFEST_LINKED\n    if (m.userData) flags |= MANIFEST_USER_DATA\n\n    c.uint.encode(state, flags)\n    hashes.encode(state, m.hash)\n\n    c.uint.encode(state, m.quorum)\n    signerArray.encode(state, m.signers)\n\n    if (m.prologue) prologue.encode(state, m.prologue)\n    if (m.linked) fixed32Array.encode(state, m.linked)\n    if (m.userData) c.buffer.encode(state, m.userData)\n  },\n  decode(state) {\n    const version = c.uint.decode(state)\n\n    if (version === 0) return manifestv0.decode(state)\n    if (version > 2) throw new Error('Unknown version: ' + version)\n\n    const flags = c.uint.decode(state)\n    const hash = hashes.decode(state)\n    const quorum = c.uint.decode(state)\n    const signers = signerArray.decode(state)\n\n    const hasPatch = (flags & MANIFEST_PATCH) !== 0\n    const hasPrologue = (flags & MANIFEST_PROLOGUE) !== 0\n    const hasLinked = (flags & MANIFEST_LINKED) !== 0\n    const hasUserData = (flags & MANIFEST_USER_DATA) !== 0\n\n    return {\n      version,\n      hash,\n      allowPatch: hasPatch,\n      quorum,\n      signers,\n      prologue: hasPrologue ? prologue.decode(state) : null,\n      linked: hasLinked ? fixed32Array.decode(state) : null,\n      userData: hasUserData ? c.buffer.decode(state) : null\n    }\n  }\n})\n\nconst node = {\n  preencode(state, n) {\n    c.uint.preencode(state, n.index)\n    c.uint.preencode(state, n.size)\n    c.fixed32.preencode(state, n.hash)\n  },\n  encode(state, n) {\n    c.uint.encode(state, n.index)\n    c.uint.encode(state, n.size)\n    c.fixed32.encode(state, n.hash)\n  },\n  decode(state) {\n    return {\n      index: c.uint.decode(state),\n      size: c.uint.decode(state),\n      hash: c.fixed32.decode(state)\n    }\n  }\n}\n\nconst nodeArray = c.array(node)\n\nconst wire = (exports.wire = {})\n\nwire.handshake = {\n  preencode(state, m) {\n    c.uint.preencode(state, 1)\n    c.fixed32.preencode(state, m.capability)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.seeks ? 1 : 0)\n    c.fixed32.encode(state, m.capability)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n    return {\n      seeks: (flags & 1) !== 0,\n      capability: unslab(c.fixed32.decode(state))\n    }\n  }\n}\n\nconst requestBlock = {\n  preencode(state, b) {\n    c.uint.preencode(state, b.index)\n    c.uint.preencode(state, b.nodes)\n  },\n  encode(state, b) {\n    c.uint.encode(state, b.index)\n    c.uint.encode(state, b.nodes)\n  },\n  decode(state) {\n    return {\n      index: c.uint.decode(state),\n      nodes: c.uint.decode(state)\n    }\n  }\n}\n\nconst requestSeek = {\n  preencode(state, s) {\n    c.uint.preencode(state, s.bytes)\n    c.uint.preencode(state, s.padding)\n  },\n  encode(state, s) {\n    c.uint.encode(state, s.bytes)\n    c.uint.encode(state, s.padding)\n  },\n  decode(state) {\n    return {\n      bytes: c.uint.decode(state),\n      padding: c.uint.decode(state)\n    }\n  }\n}\n\nconst requestUpgrade = {\n  preencode(state, u) {\n    c.uint.preencode(state, u.start)\n    c.uint.preencode(state, u.length)\n  },\n  encode(state, u) {\n    c.uint.encode(state, u.start)\n    c.uint.encode(state, u.length)\n  },\n  decode(state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nwire.request = {\n  preencode(state, m) {\n    state.end++ // flags\n    c.uint.preencode(state, m.id)\n    c.uint.preencode(state, m.fork)\n\n    if (m.block) requestBlock.preencode(state, m.block)\n    if (m.hash) requestBlock.preencode(state, m.hash)\n    if (m.seek) requestSeek.preencode(state, m.seek)\n    if (m.upgrade) requestUpgrade.preencode(state, m.upgrade)\n    if (m.priority) c.uint.preencode(state, m.priority)\n  },\n  encode(state, m) {\n    const flags =\n      (m.block ? 1 : 0) |\n      (m.hash ? 2 : 0) |\n      (m.seek ? 4 : 0) |\n      (m.upgrade ? 8 : 0) |\n      (m.manifest ? 16 : 0) |\n      (m.priority ? 32 : 0)\n\n    c.uint.encode(state, flags)\n    c.uint.encode(state, m.id)\n    c.uint.encode(state, m.fork)\n\n    if (m.block) requestBlock.encode(state, m.block)\n    if (m.hash) requestBlock.encode(state, m.hash)\n    if (m.seek) requestSeek.encode(state, m.seek)\n    if (m.upgrade) requestUpgrade.encode(state, m.upgrade)\n    if (m.priority) c.uint.encode(state, m.priority)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      id: c.uint.decode(state),\n      fork: c.uint.decode(state),\n      block: flags & 1 ? requestBlock.decode(state) : null,\n      hash: flags & 2 ? requestBlock.decode(state) : null,\n      seek: flags & 4 ? requestSeek.decode(state) : null,\n      upgrade: flags & 8 ? requestUpgrade.decode(state) : null,\n      manifest: (flags & 16) !== 0,\n      priority: flags & 32 ? c.uint.decode(state) : 0\n    }\n  }\n}\n\nwire.cancel = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.request)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.request)\n  },\n  decode(state, m) {\n    return {\n      request: c.uint.decode(state)\n    }\n  }\n}\n\nconst dataUpgrade = {\n  preencode(state, u) {\n    c.uint.preencode(state, u.start)\n    c.uint.preencode(state, u.length)\n    nodeArray.preencode(state, u.nodes)\n    nodeArray.preencode(state, u.additionalNodes)\n    c.buffer.preencode(state, u.signature)\n  },\n  encode(state, u) {\n    c.uint.encode(state, u.start)\n    c.uint.encode(state, u.length)\n    nodeArray.encode(state, u.nodes)\n    nodeArray.encode(state, u.additionalNodes)\n    c.buffer.encode(state, u.signature)\n  },\n  decode(state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state),\n      nodes: nodeArray.decode(state),\n      additionalNodes: nodeArray.decode(state),\n      signature: c.buffer.decode(state)\n    }\n  }\n}\n\nconst dataSeek = {\n  preencode(state, s) {\n    c.uint.preencode(state, s.bytes)\n    nodeArray.preencode(state, s.nodes)\n  },\n  encode(state, s) {\n    c.uint.encode(state, s.bytes)\n    nodeArray.encode(state, s.nodes)\n  },\n  decode(state) {\n    return {\n      bytes: c.uint.decode(state),\n      nodes: nodeArray.decode(state)\n    }\n  }\n}\n\nconst dataBlock = {\n  preencode(state, b) {\n    c.uint.preencode(state, b.index)\n    c.buffer.preencode(state, b.value)\n    nodeArray.preencode(state, b.nodes)\n  },\n  encode(state, b) {\n    c.uint.encode(state, b.index)\n    c.buffer.encode(state, b.value)\n    nodeArray.encode(state, b.nodes)\n  },\n  decode(state) {\n    return {\n      index: c.uint.decode(state),\n      value: c.buffer.decode(state) || EMPTY,\n      nodes: nodeArray.decode(state)\n    }\n  }\n}\n\nconst dataHash = {\n  preencode(state, b) {\n    c.uint.preencode(state, b.index)\n    nodeArray.preencode(state, b.nodes)\n  },\n  encode(state, b) {\n    c.uint.encode(state, b.index)\n    nodeArray.encode(state, b.nodes)\n  },\n  decode(state) {\n    return {\n      index: c.uint.decode(state),\n      nodes: nodeArray.decode(state)\n    }\n  }\n}\n\nwire.data = {\n  preencode(state, m) {\n    state.end++ // flags\n    c.uint.preencode(state, m.request)\n    c.uint.preencode(state, m.fork)\n\n    if (m.block) dataBlock.preencode(state, m.block)\n    if (m.hash) dataHash.preencode(state, m.hash)\n    if (m.seek) dataSeek.preencode(state, m.seek)\n    if (m.upgrade) dataUpgrade.preencode(state, m.upgrade)\n    if (m.manifest) manifest.preencode(state, m.manifest)\n  },\n  encode(state, m) {\n    const flags =\n      (m.block ? 1 : 0) |\n      (m.hash ? 2 : 0) |\n      (m.seek ? 4 : 0) |\n      (m.upgrade ? 8 : 0) |\n      (m.manifest ? 16 : 0)\n\n    c.uint.encode(state, flags)\n    c.uint.encode(state, m.request)\n    c.uint.encode(state, m.fork)\n\n    if (m.block) dataBlock.encode(state, m.block)\n    if (m.hash) dataHash.encode(state, m.hash)\n    if (m.seek) dataSeek.encode(state, m.seek)\n    if (m.upgrade) dataUpgrade.encode(state, m.upgrade)\n    if (m.manifest) manifest.encode(state, m.manifest)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      request: c.uint.decode(state),\n      fork: c.uint.decode(state),\n      block: flags & 1 ? dataBlock.decode(state) : null,\n      hash: flags & 2 ? dataHash.decode(state) : null,\n      seek: flags & 4 ? dataSeek.decode(state) : null,\n      upgrade: flags & 8 ? dataUpgrade.decode(state) : null,\n      manifest: flags & 16 ? manifest.decode(state) : null\n    }\n  }\n}\n\nwire.noData = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.request)\n    c.uint.preencode(state, m.reason ? 1 : 0)\n    if (m.reason) c.uint.preencode(state, m.reason)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.request)\n    c.uint.encode(state, m.reason ? 1 : 0)\n    if (m.reason) c.uint.encode(state, m.reason)\n  },\n  decode(state, m) {\n    const request = c.uint.decode(state)\n    const flags = state.start < state.end ? c.uint.decode(state) : 0\n    return {\n      request,\n      reason: flags & 1 ? c.uint.decode(state) : 0\n    }\n  }\n}\n\n// TODO: we should move to having these have a handle like in data, easier since they\n// allocate state in practice\nwire.want = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.start)\n    c.uint.preencode(state, m.length)\n\n    const flags = m.any ? 1 : 0\n    if (flags !== 0) c.uint.preencode(state, flags)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.start)\n    c.uint.encode(state, m.length)\n\n    const flags = m.any ? 1 : 0\n    if (flags !== 0) c.uint.encode(state, flags)\n  },\n  decode(state) {\n    const start = c.uint.decode(state)\n    const length = c.uint.decode(state)\n    const flags = state.start < state.end ? c.uint.decode(state) : 0\n\n    return {\n      start,\n      length,\n      any: (flags & 1) !== 0\n    }\n  }\n}\n\nwire.unwant = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.start)\n    c.uint.preencode(state, m.length)\n\n    const flags = m.any ? 1 : 0\n    if (flags !== 0) c.uint.preencode(state, flags)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.start)\n    c.uint.encode(state, m.length)\n\n    const flags = m.any ? 1 : 0\n    if (flags !== 0) c.uint.encode(state, flags)\n  },\n  decode(state, m) {\n    const start = c.uint.decode(state)\n    const length = c.uint.decode(state)\n    const flags = state.start < state.end ? c.uint.decode(state) : 0\n\n    return {\n      start,\n      length,\n      any: (flags & 1) !== 0\n    }\n  }\n}\n\nwire.range = {\n  preencode(state, m) {\n    state.end++ // flags\n    c.uint.preencode(state, m.start)\n    if (m.length !== 1) c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.uint.encode(state, (m.drop ? 1 : 0) | (m.length === 1 ? 2 : 0))\n    c.uint.encode(state, m.start)\n    if (m.length !== 1) c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      drop: (flags & 1) !== 0,\n      start: c.uint.decode(state),\n      length: (flags & 2) !== 0 ? 1 : c.uint.decode(state)\n    }\n  }\n}\n\nwire.bitfield = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.start)\n    c.uint32array.preencode(state, m.bitfield)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.start)\n    c.uint32array.encode(state, m.bitfield)\n  },\n  decode(state, m) {\n    return {\n      start: c.uint.decode(state),\n      bitfield: c.uint32array.decode(state)\n    }\n  }\n}\n\nwire.sync = {\n  preencode(state, m) {\n    state.end++ // flags\n    c.uint.preencode(state, m.fork)\n    c.uint.preencode(state, m.length)\n    c.uint.preencode(state, m.remoteLength)\n  },\n  encode(state, m) {\n    c.uint.encode(\n      state,\n      (m.canUpgrade ? 1 : 0) |\n        (m.uploading ? 2 : 0) |\n        (m.downloading ? 4 : 0) |\n        (m.hasManifest ? 8 : 0) |\n        (m.allowPush ? 16 : 0)\n    )\n    c.uint.encode(state, m.fork)\n    c.uint.encode(state, m.length)\n    c.uint.encode(state, m.remoteLength)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      fork: c.uint.decode(state),\n      length: c.uint.decode(state),\n      remoteLength: c.uint.decode(state),\n      canUpgrade: (flags & 1) !== 0,\n      uploading: (flags & 2) !== 0,\n      downloading: (flags & 4) !== 0,\n      hasManifest: (flags & 8) !== 0,\n      allowPush: (flags & 16) !== 0\n    }\n  }\n}\n\nwire.reorgHint = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.from)\n    c.uint.preencode(state, m.to)\n    c.uint.preencode(state, m.ancestors)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.from)\n    c.uint.encode(state, m.to)\n    c.uint.encode(state, m.ancestors)\n  },\n  decode(state) {\n    return {\n      from: c.uint.encode(state),\n      to: c.uint.encode(state),\n      ancestors: c.uint.encode(state)\n    }\n  }\n}\n\nwire.extension = {\n  preencode(state, m) {\n    c.string.preencode(state, m.name)\n    c.raw.preencode(state, m.message)\n  },\n  encode(state, m) {\n    c.string.encode(state, m.name)\n    c.raw.encode(state, m.message)\n  },\n  decode(state) {\n    return {\n      name: c.string.decode(state),\n      message: c.raw.decode(state)\n    }\n  }\n}\n\nconst keyValue = {\n  preencode(state, p) {\n    c.string.preencode(state, p.key)\n    c.buffer.preencode(state, p.value)\n  },\n  encode(state, p) {\n    c.string.encode(state, p.key)\n    c.buffer.encode(state, p.value)\n  },\n  decode(state) {\n    return {\n      key: c.string.decode(state),\n      value: c.buffer.decode(state)\n    }\n  }\n}\n\nconst treeUpgrade = {\n  preencode(state, u) {\n    c.uint.preencode(state, u.fork)\n    c.uint.preencode(state, u.ancestors)\n    c.uint.preencode(state, u.length)\n    c.buffer.preencode(state, u.signature)\n  },\n  encode(state, u) {\n    c.uint.encode(state, u.fork)\n    c.uint.encode(state, u.ancestors)\n    c.uint.encode(state, u.length)\n    c.buffer.encode(state, u.signature)\n  },\n  decode(state) {\n    return {\n      fork: c.uint.decode(state),\n      ancestors: c.uint.decode(state),\n      length: c.uint.decode(state),\n      signature: c.buffer.decode(state)\n    }\n  }\n}\n\nconst bitfieldUpdate = {\n  // TODO: can maybe be folded into a HAVE later on with the most recent spec\n  preencode(state, b) {\n    state.end++ // flags\n    c.uint.preencode(state, b.start)\n    c.uint.preencode(state, b.length)\n  },\n  encode(state, b) {\n    state.buffer[state.start++] = b.drop ? 1 : 0\n    c.uint.encode(state, b.start)\n    c.uint.encode(state, b.length)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n    return {\n      drop: (flags & 1) !== 0,\n      start: c.uint.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst oplog = (exports.oplog = {})\n\noplog.entry = {\n  preencode(state, m) {\n    state.end++ // flags\n    if (m.userData) keyValue.preencode(state, m.userData)\n    if (m.treeNodes) nodeArray.preencode(state, m.treeNodes)\n    if (m.treeUpgrade) treeUpgrade.preencode(state, m.treeUpgrade)\n    if (m.bitfield) bitfieldUpdate.preencode(state, m.bitfield)\n  },\n  encode(state, m) {\n    const s = state.start++\n    let flags = 0\n\n    if (m.userData) {\n      flags |= 1\n      keyValue.encode(state, m.userData)\n    }\n    if (m.treeNodes) {\n      flags |= 2\n      nodeArray.encode(state, m.treeNodes)\n    }\n    if (m.treeUpgrade) {\n      flags |= 4\n      treeUpgrade.encode(state, m.treeUpgrade)\n    }\n    if (m.bitfield) {\n      flags |= 8\n      bitfieldUpdate.encode(state, m.bitfield)\n    }\n\n    state.buffer[s] = flags\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n    return {\n      userData: (flags & 1) !== 0 ? keyValue.decode(state) : null,\n      treeNodes: (flags & 2) !== 0 ? nodeArray.decode(state) : null,\n      treeUpgrade: (flags & 4) !== 0 ? treeUpgrade.decode(state) : null,\n      bitfield: (flags & 8) !== 0 ? bitfieldUpdate.decode(state) : null\n    }\n  }\n}\n\nconst keyPair = {\n  preencode(state, kp) {\n    c.buffer.preencode(state, kp.publicKey)\n    c.buffer.preencode(state, kp.secretKey)\n  },\n  encode(state, kp) {\n    c.buffer.encode(state, kp.publicKey)\n    c.buffer.encode(state, kp.secretKey)\n  },\n  decode(state) {\n    return {\n      publicKey: c.buffer.decode(state),\n      secretKey: c.buffer.decode(state)\n    }\n  }\n}\n\nconst reorgHint = {\n  preencode(state, r) {\n    c.uint.preencode(state, r.from)\n    c.uint.preencode(state, r.to)\n    c.uint.preencode(state, r.ancestors)\n  },\n  encode(state, r) {\n    c.uint.encode(state, r.from)\n    c.uint.encode(state, r.to)\n    c.uint.encode(state, r.ancestors)\n  },\n  decode(state) {\n    return {\n      from: c.uint.decode(state),\n      to: c.uint.decode(state),\n      ancestors: c.uint.decode(state)\n    }\n  }\n}\n\nconst reorgHintArray = c.array(reorgHint)\n\nconst hints = {\n  preencode(state, h) {\n    reorgHintArray.preencode(state, h.reorgs)\n    c.uint.preencode(state, h.contiguousLength)\n  },\n  encode(state, h) {\n    reorgHintArray.encode(state, h.reorgs)\n    c.uint.encode(state, h.contiguousLength)\n  },\n  decode(state) {\n    return {\n      reorgs: reorgHintArray.decode(state),\n      contiguousLength: state.start < state.end ? c.uint.decode(state) : 0\n    }\n  }\n}\n\nconst treeHeader = {\n  preencode(state, t) {\n    c.uint.preencode(state, t.fork)\n    c.uint.preencode(state, t.length)\n    c.buffer.preencode(state, t.rootHash)\n    c.buffer.preencode(state, t.signature)\n  },\n  encode(state, t) {\n    c.uint.encode(state, t.fork)\n    c.uint.encode(state, t.length)\n    c.buffer.encode(state, t.rootHash)\n    c.buffer.encode(state, t.signature)\n  },\n  decode(state) {\n    return {\n      fork: c.uint.decode(state),\n      length: c.uint.decode(state),\n      rootHash: c.buffer.decode(state),\n      signature: c.buffer.decode(state)\n    }\n  }\n}\n\nconst types = {\n  preencode(state, t) {\n    c.string.preencode(state, t.tree)\n    c.string.preencode(state, t.bitfield)\n    c.string.preencode(state, t.signer)\n  },\n  encode(state, t) {\n    c.string.encode(state, t.tree)\n    c.string.encode(state, t.bitfield)\n    c.string.encode(state, t.signer)\n  },\n  decode(state) {\n    return {\n      tree: c.string.decode(state),\n      bitfield: c.string.decode(state),\n      signer: c.string.decode(state)\n    }\n  }\n}\n\nconst externalHeader = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.start)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.uint.encode(state, m.start)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state)\n    }\n  }\n}\n\nconst keyValueArray = c.array(keyValue)\n\noplog.header = {\n  preencode(state, h) {\n    state.end += 2 // version + flags\n    if (h.external) {\n      externalHeader.preencode(state, h.external)\n      return\n    }\n    c.fixed32.preencode(state, h.key)\n    if (h.manifest) manifest.preencode(state, h.manifest)\n    if (h.keyPair) keyPair.preencode(state, h.keyPair)\n    keyValueArray.preencode(state, h.userData)\n    treeHeader.preencode(state, h.tree)\n    hints.preencode(state, h.hints)\n  },\n  encode(state, h) {\n    c.uint.encode(state, 1)\n    if (h.external) {\n      c.uint.encode(state, 1) // ONLY set the first big for clarity\n      externalHeader.encode(state, h.external)\n      return\n    }\n    c.uint.encode(state, (h.manifest ? 2 : 0) | (h.keyPair ? 4 : 0))\n    c.fixed32.encode(state, h.key)\n    if (h.manifest) manifest.encode(state, h.manifest)\n    if (h.keyPair) keyPair.encode(state, h.keyPair)\n    keyValueArray.encode(state, h.userData)\n    treeHeader.encode(state, h.tree)\n    hints.encode(state, h.hints)\n  },\n  decode(state) {\n    const version = c.uint.decode(state)\n\n    if (version > 1) {\n      throw INVALID_OPLOG_VERSION('Invalid header version. Expected <= 1, got ' + version)\n    }\n\n    if (version === 0) {\n      const old = {\n        types: types.decode(state),\n        userData: keyValueArray.decode(state),\n        tree: treeHeader.decode(state),\n        signer: keyPair.decode(state),\n        hints: hints.decode(state)\n      }\n\n      return {\n        external: null,\n        key: old.signer.publicKey,\n        manifest: {\n          version: 0,\n          hash: old.types.tree,\n          allowPatch: false,\n          quorum: 1,\n          signers: [\n            {\n              signature: old.types.signer,\n              namespace: DEFAULT_NAMESPACE,\n              publicKey: old.signer.publicKey\n            }\n          ],\n          prologue: null,\n          linked: null,\n          userData: null\n        },\n        keyPair: old.signer.secretKey ? old.signer : null,\n        userData: old.userData,\n        tree: old.tree,\n        hints: old.hints\n      }\n    }\n\n    const flags = c.uint.decode(state)\n\n    if (flags & 1) {\n      return {\n        external: externalHeader.decode(state),\n        key: null,\n        manifest: null,\n        keyPair: null,\n        userData: null,\n        tree: null,\n        hints: null\n      }\n    }\n\n    return {\n      external: null,\n      key: c.fixed32.decode(state),\n      manifest: (flags & 2) !== 0 ? manifest.decode(state) : null,\n      keyPair: (flags & 4) !== 0 ? keyPair.decode(state) : null,\n      userData: keyValueArray.decode(state),\n      tree: treeHeader.decode(state),\n      hints: hints.decode(state)\n    }\n  }\n}\n\nconst uintArray = c.array(c.uint)\n\nconst multisigInput = {\n  preencode(state, inp) {\n    c.uint.preencode(state, inp.signer)\n    c.fixed64.preencode(state, inp.signature)\n    c.uint.preencode(state, inp.patch)\n  },\n  encode(state, inp) {\n    c.uint.encode(state, inp.signer)\n    c.fixed64.encode(state, inp.signature)\n    c.uint.encode(state, inp.patch)\n  },\n  decode(state) {\n    return {\n      signer: c.uint.decode(state),\n      signature: c.fixed64.decode(state),\n      patch: c.uint.decode(state)\n    }\n  }\n}\n\nconst patchEncodingv0 = {\n  preencode(state, n) {\n    c.uint.preencode(state, n.start)\n    c.uint.preencode(state, n.length)\n    uintArray.preencode(state, n.nodes)\n  },\n  encode(state, n) {\n    c.uint.encode(state, n.start)\n    c.uint.encode(state, n.length)\n    uintArray.encode(state, n.nodes)\n  },\n  decode(state) {\n    return {\n      start: c.uint.decode(state),\n      length: c.uint.decode(state),\n      nodes: uintArray.decode(state)\n    }\n  }\n}\n\nconst multisigInputv0 = {\n  preencode(state, n) {\n    state.end++\n    c.uint.preencode(state, n.signer)\n    c.fixed64.preencode(state, n.signature)\n    if (n.patch) patchEncodingv0.preencode(state, n.patch)\n  },\n  encode(state, n) {\n    c.uint.encode(state, n.patch ? 1 : 0)\n    c.uint.encode(state, n.signer)\n    c.fixed64.encode(state, n.signature)\n    if (n.patch) patchEncodingv0.encode(state, n.patch)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n    return {\n      signer: c.uint.decode(state),\n      signature: c.fixed64.decode(state),\n      patch: flags & 1 ? patchEncodingv0.decode(state) : null\n    }\n  }\n}\n\nconst multisigInputArrayv0 = c.array(multisigInputv0)\nconst multisigInputArray = c.array(multisigInput)\n\nconst compactNode = {\n  preencode(state, n) {\n    c.uint.preencode(state, n.index)\n    c.uint.preencode(state, n.size)\n    c.fixed32.preencode(state, n.hash)\n  },\n  encode(state, n) {\n    c.uint.encode(state, n.index)\n    c.uint.encode(state, n.size)\n    c.fixed32.encode(state, n.hash)\n  },\n  decode(state) {\n    return {\n      index: c.uint.decode(state),\n      size: c.uint.decode(state),\n      hash: c.fixed32.decode(state)\n    }\n  }\n}\n\nconst compactNodeArray = c.array(compactNode)\n\nexports.multiSignaturev0 = {\n  preencode(state, s) {\n    multisigInputArrayv0.preencode(state, s.proofs)\n    compactNodeArray.preencode(state, s.patch)\n  },\n  encode(state, s) {\n    multisigInputArrayv0.encode(state, s.proofs)\n    compactNodeArray.encode(state, s.patch)\n  },\n  decode(state) {\n    return {\n      proofs: multisigInputArrayv0.decode(state),\n      patch: compactNodeArray.decode(state)\n    }\n  }\n}\n\nexports.multiSignature = {\n  preencode(state, s) {\n    multisigInputArray.preencode(state, s.proofs)\n    compactNodeArray.preencode(state, s.patch)\n  },\n  encode(state, s) {\n    multisigInputArray.encode(state, s.proofs)\n    compactNodeArray.encode(state, s.patch)\n  },\n  decode(state) {\n    return {\n      proofs: multisigInputArray.decode(state),\n      patch: compactNodeArray.decode(state)\n    }\n  }\n}\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\nconst flat = require('flat-tree')\nconst { MerkleTree } = require('./merkle-tree')\nconst { multiSignature, multiSignaturev0 } = require('./messages')\n\nmodule.exports = {\n  assemblev0,\n  assemble,\n  inflatev0,\n  inflate,\n  partialSignature,\n  signableLength\n}\n\nfunction inflatev0(data) {\n  return c.decode(multiSignaturev0, data)\n}\n\nfunction inflate(data) {\n  return c.decode(multiSignature, data)\n}\n\nasync function partialSignature(\n  core,\n  signer,\n  from,\n  to = core.state.length,\n  signature = core.state.signature\n) {\n  if (from > core.state.length) return null\n  const nodes = to <= from ? null : await upgradeNodes(core, from, to)\n\n  if (signature.byteLength !== 64) {\n    signature = c.decode(multiSignature, signature).proofs[0].signature\n  }\n\n  return {\n    signer,\n    signature,\n    patch: nodes ? to - from : 0,\n    nodes\n  }\n}\n\nasync function upgradeNodes(core, from, to) {\n  const rx = core.state.storage.read()\n  let p = null\n  try {\n    p = await MerkleTree.proof(core.state, rx, { upgrade: { start: from, length: to - from } })\n  } catch (err) {\n    rx.destroy()\n    throw err\n  }\n  rx.tryFlush()\n  return (await p.settle()).upgrade.nodes\n}\n\nfunction signableLength(lengths, quorum) {\n  if (quorum <= 0) quorum = 1\n  if (quorum > lengths.length) return 0\n\n  return lengths.sort(cmp)[quorum - 1]\n}\n\nfunction cmp(a, b) {\n  return b - a\n}\n\nfunction assemblev0(inputs) {\n  const proofs = []\n  const patch = []\n\n  for (const u of inputs) {\n    proofs.push(compressProof(u, patch))\n  }\n\n  return c.encode(multiSignaturev0, { proofs, patch })\n}\n\nfunction assemble(inputs) {\n  const proofs = []\n  const patch = []\n  const seen = new Set()\n\n  for (const u of inputs) {\n    if (u.nodes) {\n      for (const node of u.nodes) {\n        if (seen.has(node.index)) continue\n        seen.add(node.index)\n        patch.push(node)\n      }\n    }\n\n    proofs.push({\n      signer: u.signer,\n      signature: u.signature,\n      patch: u.patch\n    })\n  }\n\n  return c.encode(multiSignature, { proofs, patch })\n}\n\nfunction compareNode(a, b) {\n  if (a.index !== b.index) return false\n  if (a.size !== b.size) return false\n  return b4a.equals(a.hash, b.hash)\n}\n\nfunction compressProof(proof, nodes) {\n  return {\n    signer: proof.signer,\n    signature: proof.signature,\n    patch: proof.patch ? compressUpgrade(proof, nodes) : null\n  }\n}\n\nfunction compressUpgrade(p, nodes) {\n  const u = {\n    start: flat.rightSpan(p.nodes[p.nodes.length - 1].index) / 2 + 1,\n    length: p.patch,\n    nodes: []\n  }\n\n  for (const node of p.nodes) {\n    let present = false\n    for (let i = 0; i < nodes.length; i++) {\n      if (!compareNode(nodes[i], node)) continue\n\n      u.nodes.push(i)\n      present = true\n      break\n    }\n\n    if (present) continue\n    u.nodes.push(nodes.push(node) - 1)\n  }\n\n  return u\n}\nmodule.exports = class Mutex {\n  constructor() {\n    this.locked = false\n    this.destroyed = false\n\n    this._destroying = null\n    this._destroyError = null\n    this._queue = []\n    this._enqueue = (resolve, reject) => this._queue.push([resolve, reject])\n  }\n\n  idle() {\n    return this._queue.length === 0 && this.locked === false\n  }\n\n  lock() {\n    if (this.destroyed) {\n      return Promise.reject(this._destroyError || new Error('Mutex has been destroyed'))\n    }\n    if (this.locked) return new Promise(this._enqueue)\n    this.locked = true\n    return Promise.resolve()\n  }\n\n  unlock() {\n    if (!this._queue.length) {\n      this.locked = false\n      return\n    }\n    this._queue.shift()[0]()\n  }\n\n  destroy(err) {\n    if (!this._destroying) {\n      this._destroying = this.locked ? this.lock().catch(() => {}) : Promise.resolve()\n    }\n\n    this.destroyed = true\n    if (err) this._destroyError = err\n\n    if (err) {\n      while (this._queue.length) this._queue.shift()[1](err)\n    }\n\n    return this._destroying\n  }\n}\nconst FIFO = require('fast-fifo')\n\nmodule.exports = class ReceiverQueue {\n  constructor() {\n    this.queue = new FIFO()\n    this.priority = []\n    this.requests = new Map()\n    this.length = 0\n  }\n\n  push(req) {\n    // TODO: use a heap at some point if we wanna support multiple prios\n    if (req.priority > 0) this.priority.push(req)\n    else this.queue.push(req)\n\n    this.requests.set(req.id, req)\n    this.length++\n  }\n\n  shift() {\n    while (this.priority.length > 0) {\n      const msg = this.priority.pop()\n      const req = this._processRequest(msg)\n      if (req !== null) return req\n    }\n\n    while (this.queue.length > 0) {\n      const msg = this.queue.shift()\n      const req = this._processRequest(msg)\n      if (req !== null) return req\n    }\n\n    return null\n  }\n\n  _processRequest(req) {\n    if (req.block || req.hash || req.seek || req.upgrade || req.manifest) {\n      this.requests.delete(req.id)\n      this.length--\n      return req\n    }\n\n    return null\n  }\n\n  clear() {\n    this.queue.clear()\n    this.priority = []\n    this.length = 0\n    this.requests.clear()\n  }\n\n  delete(id) {\n    const req = this.requests.get(id)\n    if (!req) return\n\n    req.block = null\n    req.hash = null\n    req.seek = null\n    req.upgrade = null\n    req.manifest = false\n\n    this.requests.delete(id)\n    this.length--\n\n    if (this.length === 0) {\n      this.queue.clear()\n      this.priority = []\n    }\n  }\n}\nconst BigSparseArray = require('big-sparse-array')\nconst quickbit = require('./compat').quickbit\n\nconst BITS_PER_PAGE = 32768\nconst BYTES_PER_PAGE = BITS_PER_PAGE / 8\nconst WORDS_PER_PAGE = BYTES_PER_PAGE / 4\nconst BITS_PER_SEGMENT = 2097152\nconst BYTES_PER_SEGMENT = BITS_PER_SEGMENT / 8\nconst PAGES_PER_SEGMENT = BITS_PER_SEGMENT / BITS_PER_PAGE\n\nclass RemoteBitfieldPage {\n  constructor(index, bitfield, segment) {\n    this.index = index\n    this.offset = index * BYTES_PER_PAGE - segment.offset\n    this.bitfield = bitfield\n    this.segment = segment\n\n    segment.add(this)\n  }\n\n  get tree() {\n    return this.segment.tree\n  }\n\n  get(index) {\n    return quickbit.get(this.bitfield, index)\n  }\n\n  set(index, val) {\n    if (quickbit.set(this.bitfield, index, val)) {\n      this.tree.update(this.offset * 8 + index)\n    }\n  }\n\n  setRange(start, end, val) {\n    quickbit.fill(this.bitfield, val, start, end)\n\n    let i = Math.floor(start / 128)\n    const n = i + Math.ceil((end - start) / 128)\n\n    while (i <= n) this.tree.update(this.offset * 8 + i++ * 128)\n  }\n\n  findFirst(val, position) {\n    return quickbit.findFirst(this.bitfield, val, position)\n  }\n\n  findLast(val, position) {\n    return quickbit.findLast(this.bitfield, val, position)\n  }\n\n  insert(start, bitfield) {\n    this.bitfield.set(bitfield, start / 32)\n    this.segment.refresh()\n  }\n\n  clear(start, bitfield) {\n    quickbit.clear(this.bitfield, { field: bitfield, offset: start })\n  }\n}\n\nclass RemoteBitfieldSegment {\n  constructor(index) {\n    this.index = index\n    this.offset = index * BYTES_PER_SEGMENT\n    this.tree = quickbit.Index.from([], BYTES_PER_SEGMENT)\n    this.pages = new Array(PAGES_PER_SEGMENT)\n    this.pagesLength = 0\n  }\n\n  get chunks() {\n    return this.tree.chunks\n  }\n\n  refresh() {\n    this.tree = quickbit.Index.from(this.tree.chunks, BYTES_PER_SEGMENT)\n  }\n\n  add(page) {\n    const pageIndex = page.index - this.index * PAGES_PER_SEGMENT\n    if (pageIndex >= this.pagesLength) this.pagesLength = pageIndex + 1\n\n    this.pages[pageIndex] = page\n\n    const chunk = { field: page.bitfield, offset: page.offset }\n\n    this.chunks.push(chunk)\n\n    for (let i = this.chunks.length - 2; i >= 0; i--) {\n      const prev = this.chunks[i]\n      if (prev.offset <= chunk.offset) break\n      this.chunks[i] = chunk\n      this.chunks[i + 1] = prev\n    }\n  }\n\n  findFirst(val, position) {\n    position = this.tree.skipFirst(!val, position)\n\n    let j = position & (BITS_PER_PAGE - 1)\n    let i = (position - j) / BITS_PER_PAGE\n\n    if (i >= PAGES_PER_SEGMENT) return -1\n\n    while (i < this.pagesLength) {\n      const p = this.pages[i]\n\n      let index = -1\n\n      if (p) index = p.findFirst(val, j)\n      else if (!val) index = j\n\n      if (index !== -1) return i * BITS_PER_PAGE + index\n\n      j = 0\n      i++\n    }\n\n    return val || this.pagesLength === PAGES_PER_SEGMENT ? -1 : this.pagesLength * BITS_PER_PAGE\n  }\n\n  findLast(val, position) {\n    position = this.tree.skipLast(!val, position)\n\n    let j = position & (BITS_PER_PAGE - 1)\n    let i = (position - j) / BITS_PER_PAGE\n\n    if (i >= PAGES_PER_SEGMENT) return -1\n\n    while (i >= 0) {\n      const p = this.pages[i]\n\n      let index = -1\n\n      if (p) index = p.findLast(val, j)\n      else if (!val) index = j\n\n      if (index !== -1) return i * BITS_PER_PAGE + index\n\n      j = BITS_PER_PAGE - 1\n      i--\n    }\n\n    return -1\n  }\n}\n\nmodule.exports = class RemoteBitfield {\n  static BITS_PER_PAGE = BITS_PER_PAGE\n  static BITS_PER_SEGMENT = BITS_PER_SEGMENT\n\n  constructor() {\n    this._pages = new BigSparseArray()\n    this._segments = new BigSparseArray()\n    this._maxSegments = 0\n  }\n\n  getBitfield(index) {\n    const j = index & (BITS_PER_PAGE - 1)\n    const i = (index - j) / BITS_PER_PAGE\n\n    const p = this._pages.get(i)\n    return p || null\n  }\n\n  get(index) {\n    const j = index & (BITS_PER_PAGE - 1)\n    const i = (index - j) / BITS_PER_PAGE\n\n    const p = this._pages.get(i)\n\n    return p ? p.get(j) : false\n  }\n\n  set(index, val) {\n    const j = index & (BITS_PER_PAGE - 1)\n    const i = (index - j) / BITS_PER_PAGE\n\n    let p = this._pages.get(i)\n\n    if (!p && val) {\n      const k = Math.floor(i / PAGES_PER_SEGMENT)\n      const s = this._segments.get(k) || this._segments.set(k, new RemoteBitfieldSegment(k))\n      if (this._maxSegments <= k) this._maxSegments = k + 1\n\n      p = this._pages.set(i, new RemoteBitfieldPage(i, new Uint32Array(WORDS_PER_PAGE), s))\n    }\n\n    if (p) p.set(j, val)\n  }\n\n  setRange(start, end, val) {\n    let j = start & (BITS_PER_PAGE - 1)\n    let i = (start - j) / BITS_PER_PAGE\n\n    while (start < end) {\n      let p = this._pages.get(i)\n\n      if (!p && val) {\n        const k = Math.floor(i / PAGES_PER_SEGMENT)\n        const s = this._segments.get(k) || this._segments.set(k, new RemoteBitfieldSegment(k))\n        if (this._maxSegments <= k) this._maxSegments = k + 1\n\n        p = this._pages.set(i, new RemoteBitfieldPage(i, new Uint32Array(WORDS_PER_PAGE), s))\n      }\n\n      const offset = i * BITS_PER_PAGE\n      const last = Math.min(end - offset, BITS_PER_PAGE)\n      const range = last - j\n\n      if (p) p.setRange(j, last, val)\n\n      j = 0\n      i++\n      start += range\n    }\n  }\n\n  findFirst(val, position) {\n    let j = position & (BITS_PER_SEGMENT - 1)\n    let i = (position - j) / BITS_PER_SEGMENT\n\n    while (i < this._maxSegments) {\n      const s = this._segments.get(i)\n\n      let index = -1\n\n      if (s) index = s.findFirst(val, j)\n      else if (!val) index = j\n\n      if (index !== -1) return i * BITS_PER_SEGMENT + index\n\n      j = 0\n      i++\n    }\n\n    // For the val === false case, we always return at least\n    // the 'position', also if nothing was found\n    return val ? -1 : Math.max(position, this._maxSegments * BITS_PER_SEGMENT)\n  }\n\n  firstSet(position) {\n    return this.findFirst(true, position)\n  }\n\n  firstUnset(position) {\n    return this.findFirst(false, position)\n  }\n\n  findLast(val, position) {\n    let j = position & (BITS_PER_SEGMENT - 1)\n    let i = (position - j) / BITS_PER_SEGMENT\n\n    while (i >= 0) {\n      const s = this._segments.get(i)\n\n      let index = -1\n\n      if (s) index = s.findLast(val, j)\n      else if (!val) index = j\n\n      if (index !== -1) return i * BITS_PER_SEGMENT + index\n\n      j = BITS_PER_SEGMENT - 1\n      i--\n    }\n\n    return -1\n  }\n\n  lastSet(position) {\n    return this.findLast(true, position)\n  }\n\n  lastUnset(position) {\n    return this.findLast(false, position)\n  }\n\n  insert(start, bitfield) {\n    if (start % 32 !== 0) return false\n\n    let length = bitfield.byteLength * 8\n\n    let j = start & (BITS_PER_PAGE - 1)\n    let i = (start - j) / BITS_PER_PAGE\n\n    while (length > 0) {\n      let p = this._pages.get(i)\n\n      if (!p) {\n        const k = Math.floor(i / PAGES_PER_SEGMENT)\n        const s = this._segments.get(k) || this._segments.set(k, new RemoteBitfieldSegment(k))\n        if (this._maxSegments <= k) this._maxSegments = k + 1\n\n        p = this._pages.set(i, new RemoteBitfieldPage(i, new Uint32Array(WORDS_PER_PAGE), s))\n      }\n\n      const end = Math.min(j + length, BITS_PER_PAGE)\n      const range = end - j\n\n      p.insert(j, bitfield.subarray(0, range / 32))\n\n      bitfield = bitfield.subarray(range / 32)\n\n      j = 0\n      i++\n      length -= range\n    }\n\n    return true\n  }\n\n  clear(start, bitfield) {\n    if (start % 32 !== 0) return false\n\n    let length = bitfield.byteLength * 8\n\n    let j = start & (BITS_PER_PAGE - 1)\n    let i = (start - j) / BITS_PER_PAGE\n\n    while (length > 0) {\n      let p = this._pages.get(i)\n\n      if (!p) {\n        const k = Math.floor(i / PAGES_PER_SEGMENT)\n        const s = this._segments.get(k) || this._segments.set(k, new RemoteBitfieldSegment(k))\n        if (this._maxSegments <= k) this._maxSegments = k + 1\n\n        p = this._pages.set(i, new RemoteBitfieldPage(i, new Uint32Array(WORDS_PER_PAGE), s))\n      }\n\n      const end = Math.min(j + length, BITS_PER_PAGE)\n      const range = end - j\n\n      p.clear(j, bitfield.subarray(0, range / 32))\n\n      bitfield = bitfield.subarray(range / 32)\n\n      j = 0\n      i++\n      length -= range\n    }\n\n    return true\n  }\n}\n/* DEV DOCS\n  Every hypercore has one Replicator object managing its connections to other peers.\n  There is one Peer object per peer connected to the Hypercore.\n  Hypercores do not know about other hypercores, so when a peer is connected to multiple cores, there exists one Peer object per core.\n\n  Hypercore indicates block should be downloaded through methods like Replicator.addRange or Replicator.addBlock\n  Hypercore calls Replicator.updateActivity every time a hypercore session opens/closes\n  Replicator.updateActivity ensures the Hypercore is downloading blocks as expected\n  Replicator keeps track of:\n    - Which blocks need to be downloaded (Replicator._blocks)\n    - Which blocks currently have inflight requests (Replicator._inflight)\n\n  Blocks are requested from remote peers by Peer objects. The flow is:\n    - The replicator's updatePeer method gets called\n    - The replicator detects whether the Peer can accept more requests (for example by checking if it's maxed out on inflight blocks)\n    - The replicator then tells the Peer what to request (e.g. Peer_requestRange or Peer._requestBlock methods)\n\n  The Peer object is responsible for tracking\n    - Which blocks does the Peer have available (tracked in remoteBitfield)\n    - Which blocks are you actively looking for from this peer (tracked in missingBlocks)\n    - How many blocks are currently inflight (tracked in inflight)\n  The Peer uses this information to decide which blocks to request from the peer in response to _requestRange requests and the like.\n*/\n\nconst b4a = require('b4a')\nconst safetyCatch = require('safety-catch')\nconst RandomIterator = require('random-array-iterator')\nconst flatTree = require('flat-tree')\nconst Mutex = require('./mutex')\nconst ReceiverQueue = require('./receiver-queue')\nconst HotswapQueue = require('./hotswap-queue')\nconst RemoteBitfield = require('./remote-bitfield')\nconst { MerkleTree } = require('./merkle-tree')\nconst { LocalWants, RemoteWants, WANT_BATCH } = require('./wants')\nconst {\n  REQUEST_CANCELLED,\n  REQUEST_TIMEOUT,\n  INVALID_CAPABILITY,\n  SNAPSHOT_NOT_AVAILABLE,\n  ASSERTION\n} = require('hypercore-errors')\nconst m = require('./messages')\nconst caps = require('./caps')\n\nconst DEFAULT_MAX_INFLIGHT = [16, 512]\nconst SCALE_LATENCY = 50\nconst NOT_DOWNLOADING_SLACK = (20000 + Math.random() * 20000) | 0\nconst MAX_PEERS_UPGRADE = 3\nconst LAST_BLOCKS = 256\n\nconst MAX_RANGES = 64\n\nconst NOT_AVAILABLE = 1\nconst INVALID_REQUEST = 2\nconst MAX_INVALID_REQUESTS = 64\nconst MAX_BACKOFFS = MAX_INVALID_REQUESTS / 2\n\nconst PRIORITY = {\n  NORMAL: 0,\n  HIGH: 1,\n  VERY_HIGH: 2,\n  CANCELLED: 255 // reserved to mark cancellation\n}\n\nclass Attachable {\n  constructor(replicator) {\n    this.replicator = replicator\n    this.resolved = false\n    this.processing = false\n    this.refs = []\n    this.wants = null\n  }\n\n  addWant(w) {\n    if (this.wants === null) this.wants = new Set()\n    this.wants.add(w)\n  }\n\n  removeWant(w) {\n    if (this.wants === null) return\n    this.wants.delete(w)\n  }\n\n  attach(session) {\n    const r = {\n      context: this,\n      session,\n      sindex: 0,\n      rindex: 0,\n      snapshot: true,\n      resolve: null,\n      reject: null,\n      promise: null,\n      timeout: null\n    }\n\n    r.sindex = session.push(r) - 1\n    r.rindex = this.refs.push(r) - 1\n    r.promise = new Promise((resolve, reject) => {\n      r.resolve = resolve\n      r.reject = reject\n    })\n\n    return r\n  }\n\n  detach(r, err = null) {\n    if (r.context !== this) return false\n\n    this._detach(r)\n    this._cancel(r, err)\n    this.gc()\n\n    return true\n  }\n\n  _detach(r) {\n    const rh = this.refs.pop()\n    const sh = r.session.pop()\n\n    if (r.rindex < this.refs.length) this.refs[(rh.rindex = r.rindex)] = rh\n    if (r.sindex < r.session.length) r.session[(sh.sindex = r.sindex)] = sh\n\n    destroyRequestTimeout(r)\n    r.context = null\n\n    return r\n  }\n\n  gc() {\n    if (this.refs.length > 0 || this.processing) return\n    this._unref()\n\n    if (this.wants === null) return\n\n    const wants = this.wants\n    this.wants = null\n\n    let update = null\n\n    for (const w of wants) {\n      if (w.any) {\n        const removed = w.wants.removeAnyRange(w.start, w.length, this)\n        if (!removed) continue\n        if (update === null) update = new Set()\n        update.add(w.wants.peer)\n        // TODO: should also use a free list for simplicity\n        w.wants.peer.wireUnwant.send(removed)\n        continue\n      }\n\n      if (w.wants.removeBatch(w.start, this)) {\n        if (update === null) update = new Set()\n        update.add(w.wants.peer)\n      }\n    }\n\n    if (update === null) return\n    for (const peer of update) {\n      this.replicator.updatePeer(peer)\n    }\n  }\n\n  processed() {\n    this.processing = false\n    this.gc()\n  }\n\n  _cancel(r, err) {\n    r.reject(err || REQUEST_CANCELLED())\n  }\n\n  _unref() {\n    // overwrite me\n  }\n\n  resolve(val) {\n    this.resolved = true\n    while (this.refs.length > 0) {\n      this._detach(this.refs[this.refs.length - 1]).resolve(val)\n    }\n    this.gc()\n  }\n\n  reject(err) {\n    this.resolved = true\n    while (this.refs.length > 0) {\n      this._detach(this.refs[this.refs.length - 1]).reject(err)\n    }\n    this.gc()\n  }\n\n  setTimeout(r, ms) {\n    destroyRequestTimeout(r)\n    r.timeout = setTimeout(onrequesttimeout, ms, r)\n  }\n}\n\nclass BlockRequest extends Attachable {\n  constructor(replicator, tracker, index, priority) {\n    super(replicator)\n\n    this.index = index\n    this.priority = priority\n    this.inflight = []\n    this.queued = false\n    this.hotswap = null\n    this.tracker = tracker\n  }\n\n  _unref() {\n    if (this.resolved) return\n    this.queued = false\n\n    for (const req of this.inflight) {\n      req.peer._cancelRequest(req)\n    }\n\n    this.tracker.remove(this.index)\n    removeHotswap(this)\n  }\n}\n\nclass RangeBatchRequest extends Attachable {\n  constructor(replicator, batch) {\n    super(replicator)\n\n    this.batch = batch\n    this.index = 0\n  }\n}\n\nclass RangeRequest extends Attachable {\n  constructor(replicator, ranges, start, end, linear, ifAvailable, blocks) {\n    super(replicator)\n\n    this.start = start\n    this.end = end\n    this.linear = linear\n    this.ifAvailable = ifAvailable\n    this.blocks = blocks\n    this.ranges = ranges\n    this.batches = []\n\n    ranges.push(this)\n\n    if (this.end === -1) {\n      this.replicator._alwaysLatestBlock++\n    }\n\n    // As passed by the user, immut\n    this.userStart = start\n    this.userEnd = end\n  }\n\n  addBatch(batch) {\n    for (let i = 0; i < this.batches.length; i++) {\n      const b = this.batches[i]\n      if (b.batch === batch) return false\n    }\n    const b = new RangeBatchRequest(this.replicator, batch)\n    b.index = this.batches.length\n    this.batches.push(b)\n    return true\n  }\n\n  removeBatch(batch) {\n    const head = this.batches.pop()\n\n    if (head !== batch) {\n      head.index = batch.index\n      this.batches[head.index] = head\n    }\n\n    batch.gc()\n  }\n\n  _unref() {\n    const rangeIndex = this.ranges.indexOf(this)\n    if (rangeIndex === -1) return\n\n    const h = this.ranges.pop()\n    if (h !== this) {\n      this.ranges[rangeIndex] = h\n    }\n\n    if (this.end === -1) {\n      this.replicator._alwaysLatestBlock--\n    }\n\n    while (this.batches.length) {\n      this.batches.pop().gc()\n    }\n  }\n\n  _cancel(r) {\n    r.resolve(false)\n  }\n}\n\nclass UpgradeRequest extends Attachable {\n  constructor(replicator, fork, length) {\n    super(replicator)\n\n    this.fork = fork\n    this.length = length\n    this.inflight = []\n  }\n\n  _unref() {\n    if (this.resolved) return\n    if (this.replicator.eagerUpgrade === true || this.inflight.length > 0) return\n    this.replicator._upgrade = null\n  }\n\n  _cancel(r) {\n    r.resolve(false)\n  }\n}\n\nclass SeekRequest extends Attachable {\n  constructor(replicator, seeks, seeker) {\n    super(replicator)\n\n    this.seeker = seeker\n    this.inflight = []\n    this.seeks = seeks\n  }\n\n  _unref() {\n    if (this.resolved) return\n    if (this.inflight.length > 0) return\n    const i = this.seeks.indexOf(this)\n    if (i === -1) return\n    const h = this.seeks.pop()\n    if (i < this.seeks.length) this.seeks[i] = h\n  }\n}\n\nclass ForkRequest extends Attachable {\n  constructor(replicator, fork) {\n    super(replicator)\n    this.fork = fork\n    this.inflight = []\n    this.batch = null\n  }\n}\n\nclass InflightTracker {\n  constructor() {\n    this._requests = []\n    this._free = []\n    this._active = 0\n  }\n\n  get idle() {\n    return this._active === 0\n  }\n\n  *[Symbol.iterator]() {\n    for (const req of this._requests) {\n      if (req !== null) yield req\n    }\n  }\n\n  add(req) {\n    const id = this._free.length ? this._free.pop() : this._requests.push(null)\n    req.id = id\n    this._requests[id - 1] = req\n    this._active++\n    return req\n  }\n\n  get(id) {\n    return id <= this._requests.length ? this._requests[id - 1] : null\n  }\n\n  remove(id, roundtrip) {\n    if (id > this._requests.length) return\n    if (this._requests[id - 1]) this._active--\n    this._requests[id - 1] = null\n    if (roundtrip === true) this._free.push(id)\n  }\n\n  reusable(id) {\n    this._free.push(id)\n  }\n}\n\nclass BlockTracker {\n  constructor(replicator) {\n    this._replicator = replicator\n    this._map = new Map()\n  }\n\n  [Symbol.iterator]() {\n    return this._map.values()\n  }\n\n  isEmpty() {\n    return this._map.size === 0\n  }\n\n  has(index) {\n    return this._map.has(index)\n  }\n\n  get(index) {\n    return this._map.get(index) || null\n  }\n\n  add(index, priority) {\n    let b = this._map.get(index)\n    if (b) return b\n\n    b = new BlockRequest(this._replicator, this, index, priority)\n    this._map.set(index, b)\n\n    return b\n  }\n\n  remove(index) {\n    const b = this.get(index)\n    this._map.delete(index)\n    return b\n  }\n}\n\nclass RoundtripQueue {\n  constructor() {\n    this.queue = []\n    this.tick = 0\n  }\n\n  clear() {\n    const ids = new Array(this.queue.length)\n    for (let i = 0; i < ids.length; i++) {\n      ids[i] = this.queue[i][1]\n    }\n\n    this.queue = []\n\n    return ids\n  }\n\n  add(id) {\n    this.queue.push([++this.tick, id])\n  }\n\n  flush(tick) {\n    let flushed = null\n\n    for (let i = 0; i < this.queue.length; i++) {\n      if (this.queue[i][0] > tick) break\n      if (flushed === null) flushed = []\n      flushed.push(this.queue[i][1])\n    }\n\n    if (flushed !== null) this.queue.splice(0, flushed.length)\n    return flushed\n  }\n}\n\nclass ProofRequest {\n  constructor(msg, proof, block, manifest) {\n    this.msg = msg\n    this.proof = proof\n    this.block = block\n    this.manifest = manifest\n  }\n\n  async fulfill() {\n    if (this.proof === null) return null\n\n    const [proof, block] = await Promise.all([this.proof.settle(), this.block])\n\n    if (this.manifest) proof.manifest = this.manifest\n    if (!block && proof.block) return null\n\n    if (block) proof.block.value = block\n    return proof\n  }\n}\n\nclass Peer {\n  constructor(replicator, protomux, channel, inflightRange) {\n    this.core = replicator.core\n    this.replicator = replicator\n    this.stream = protomux.stream\n    this.protomux = protomux\n    this.remotePublicKey = this.stream.remotePublicKey\n    this.remoteSupportsSeeks = false\n    this.inflightRange = inflightRange\n    this.fullyDownloadedSignaled = 0\n\n    this.paused = false\n    this.removed = false\n\n    this.channel = channel\n    this.channel.userData = this\n\n    this.wireSync = this.channel.messages[0]\n    this.wireRequest = this.channel.messages[1]\n    this.wireCancel = this.channel.messages[2]\n    this.wireData = this.channel.messages[3]\n    this.wireNoData = this.channel.messages[4]\n    this.wireWant = this.channel.messages[5]\n    this.wireUnwant = this.channel.messages[6]\n    this.wireBitfield = this.channel.messages[7]\n    this.wireRange = this.channel.messages[8]\n    this.wireExtension = this.channel.messages[9]\n\n    // Same stats as replicator, but for this specific peer\n    this.stats = {\n      wireSync: { tx: 0, rx: 0 },\n      wireRequest: { tx: 0, rx: 0 },\n      wireCancel: { tx: 0, rx: 0 },\n      wireData: { tx: 0, rx: 0 },\n      wireWant: { tx: 0, rx: 0 },\n      wireUnwant: { tx: 0, rx: 0 },\n      wireBitfield: { tx: 0, rx: 0 },\n      wireRange: { tx: 0, rx: 0 },\n      wireExtension: { tx: 0, rx: 0 },\n      hotswaps: 0,\n      invalidData: 0,\n      invalidRequests: 0,\n      backoffs: 0\n    }\n\n    this.receiverQueue = new ReceiverQueue()\n    this.receiverBusy = false\n\n    // most often not used, so made on demand\n    this.roundtripQueue = null\n\n    this.inflight = 0\n    this.dataProcessing = 0\n\n    this.canUpgrade = true\n\n    this.needsSync = false\n    this.syncsProcessing = 0\n    this.lastUpgradableLength = 0\n    this.lastUpgradableFork = 0\n\n    this._remoteContiguousLength = 0\n\n    // TODO: tweak pipelining so that data sent BEFORE remoteOpened is not cap verified!\n    // we might wanna tweak that with some crypto, ie use the cap to encrypt it...\n    // or just be aware of that, to only push non leaky data\n\n    this.remoteOpened = false\n    this.remoteBitfield = new RemoteBitfield()\n    this.missingBlocks = new RemoteBitfield()\n\n    this.pushedLength = 0\n\n    this.remoteFork = 0\n    this.remoteLength = 0\n    this.remoteCanUpgrade = false\n    this.remoteUploading = true\n    this.remoteDownloading = true\n    this.remoteSynced = false\n    this.remoteHasManifest = false\n    this.remoteAllowPush = false\n    this.remoteRequests = new Map()\n\n    this.segmentsWanted = new Set()\n    this.broadcastedNonSparse = false\n\n    this.wants = new LocalWants(this)\n    this.remoteWants = new RemoteWants(this)\n\n    this.lengthAcked = 0\n\n    this.extensions = new Map()\n    this.lastExtensionSent = ''\n    this.lastExtensionRecv = ''\n\n    replicator._ifAvailable++\n    replicator._active++\n  }\n\n  get remoteContiguousLength() {\n    return this.remoteBitfield.findFirst(false, this._remoteContiguousLength)\n  }\n\n  getMaxInflight() {\n    const stream = this.stream.rawStream\n    if (!stream.udx) return Math.min(this.inflightRange[1], this.inflightRange[0] * 3)\n\n    const scale =\n      stream.rtt <= SCALE_LATENCY\n        ? 1\n        : (stream.rtt / SCALE_LATENCY) * Math.min(1, 2 / this.replicator.peers.length)\n    return Math.max(\n      this.inflightRange[0],\n      Math.round(Math.min(this.inflightRange[1], this.inflightRange[0] * scale))\n    )\n  }\n\n  getMaxHotswapInflight() {\n    const inf = this.getMaxInflight()\n    return Math.max(16, inf / 2)\n  }\n\n  signalUpgrade() {\n    if (this._shouldUpdateCanUpgrade() === true) this._updateCanUpgradeAndSync()\n    else this.sendSync()\n  }\n\n  _markInflight(index) {\n    this.missingBlocks.set(index, false)\n  }\n\n  broadcastRange(start, length, drop) {\n    if (!this.isActive()) return\n\n    if (drop) this._unclearLocalRange(start, length)\n    else this._clearLocalRange(start, length)\n\n    const fullyContig = this.core.header.hints.contiguousLength === this.core.state.length\n\n    if (start + LAST_BLOCKS < this.core.state.length && !drop && !fullyContig) {\n      if (!this.remoteWants.hasRange(start, length)) return\n    }\n\n    let force = false\n    if (fullyContig && !drop) {\n      start = 0\n      length = this.core.state.length\n\n      // Always send the broadcast when we switch from sparse to fully contiguous, so remote knows too\n      if (this.fullyDownloadedSignaled < length) {\n        this.fullyDownloadedSignaled = length\n        force = true\n      }\n    }\n\n    // TODO: consider also adding early-returns on the drop===true case\n    if (!force && !drop) {\n      // No need to broadcast if the remote already has this range\n\n      if (this._remoteContiguousLength >= start + length) return\n\n      if (length === 1) {\n        if (this.remoteBitfield.get(start)) return\n      } else {\n        if (this.remoteBitfield.firstUnset(start) >= start + length) return\n      }\n    }\n\n    this.wireRange.send({\n      drop,\n      start,\n      length\n    })\n    incrementTx(this.stats.wireRange, this.replicator.stats.wireRange)\n  }\n\n  extension(name, message) {\n    this.wireExtension.send({ name: name === this.lastExtensionSent ? '' : name, message })\n    incrementTx(this.stats.wireExtension, this.replicator.stats.wireExtension)\n    this.lastExtensionSent = name\n  }\n\n  onextension(message) {\n    const name = message.name || this.lastExtensionRecv\n    this.lastExtensionRecv = name\n    const ext = this.extensions.get(name)\n    if (ext) {\n      ext._onmessage({ start: 0, end: message.message.byteLength, buffer: message.message }, this)\n    }\n  }\n\n  sendSync() {\n    if (this.syncsProcessing !== 0) {\n      this.needsSync = true\n      return\n    }\n\n    if (this.core.state.fork !== this.remoteFork) {\n      this.canUpgrade = false\n    }\n\n    this.needsSync = false\n\n    this.wireSync.send({\n      fork: this.core.state.fork,\n      length: this.core.state.length,\n      remoteLength: this.core.state.fork === this.remoteFork ? this.remoteLength : 0,\n      canUpgrade: this.canUpgrade,\n      uploading: true,\n      downloading: this.replicator.isDownloading(),\n      hasManifest: !!this.core.header.manifest && this.core.compat === false,\n      allowPush: this.replicator.isAllowingPush()\n    })\n    incrementTx(this.stats.wireSync, this.replicator.stats.wireSync)\n  }\n\n  onopen({ seeks, capability }) {\n    const expected = caps.replicate(\n      this.stream.isInitiator === false,\n      this.core.key,\n      this.stream.handshakeHash\n    )\n\n    if (b4a.equals(capability, expected) !== true) {\n      // TODO: change this to a rejection instead, less leakage\n      throw INVALID_CAPABILITY('Remote sent an invalid replication capability')\n    }\n\n    if (this.remoteOpened === true) return\n    this.remoteOpened = true\n    this.remoteSupportsSeeks = seeks\n\n    this.protomux.cork()\n\n    this.sendSync()\n\n    const contig = Math.min(this.core.state.length, this.core.header.hints.contiguousLength)\n    if (contig > 0) {\n      this.broadcastRange(0, contig, false)\n\n      if (contig === this.core.state.length) {\n        this.broadcastedNonSparse = true\n      }\n    }\n\n    this.replicator._ifAvailable--\n    this.replicator._addPeer(this)\n\n    this.protomux.uncork()\n\n    this.core.checkIfIdle()\n  }\n\n  onclose(isRemote) {\n    // we might have signalled to the remote that we are done (ie not downloading) and the remote might agree on that\n    // if that happens, the channel might be closed by the remote. if so just renegotiate it.\n    // TODO: add a CLOSE_REASON to mux to we can make this cleaner...\n    const reopen =\n      isRemote === true &&\n      this.remoteOpened === true &&\n      this.remoteDownloading === false &&\n      this.remoteUploading === true &&\n      this.replicator.downloading === true\n\n    if (this.remoteOpened === false) {\n      this.replicator._ifAvailable--\n      this.replicator.updateAll()\n      return\n    }\n\n    this.remoteOpened = false\n    this.removed = true\n    this.remoteRequests.clear() // cancel all\n    this.receiverQueue.clear()\n\n    if (this.roundtripQueue !== null) {\n      for (const id of this.roundtripQueue.clear()) this.replicator._inflight.reusable(id)\n    }\n\n    this.replicator._removePeer(this)\n\n    if (reopen) {\n      this.replicator._makePeer(this.protomux)\n    }\n  }\n\n  closeIfIdle() {\n    if (this.remoteDownloading === false && this.replicator.isDownloading() === false) {\n      // idling, shut it down...\n      this.channel.close()\n      return true\n    }\n\n    return false\n  }\n\n  async onsync(msg) {\n    const {\n      fork,\n      length,\n      remoteLength,\n      canUpgrade,\n      uploading,\n      downloading,\n      hasManifest,\n      allowPush\n    } = msg\n\n    const lengthChanged = length !== this.remoteLength\n    const sameFork = fork === this.core.state.fork\n\n    this.remoteSynced = true\n    this.remoteFork = fork\n    this.remoteLength = length\n    this.remoteCanUpgrade = canUpgrade\n    this.remoteUploading = uploading\n    this.remoteDownloading = downloading\n    this.remoteHasManifest = hasManifest\n    this.remoteAllowPush = allowPush\n\n    if (this.closeIfIdle()) return\n\n    this.lengthAcked = sameFork ? remoteLength : 0\n    this.syncsProcessing++\n\n    this.replicator._updateFork(this)\n\n    if (this.remoteLength > this.core.state.length && this.lengthAcked === this.core.state.length) {\n      if (this.replicator._addUpgradeMaybe() !== null) this._update()\n    }\n\n    const upgrade =\n      lengthChanged === false || sameFork === false\n        ? this.canUpgrade && sameFork\n        : await this._canUpgrade(length, fork)\n\n    if (length === this.remoteLength && fork === this.core.state.fork) {\n      this.canUpgrade = upgrade\n      if (upgrade) {\n        this.lastUpgradableFork = fork\n        this.lastUpgradableLength = length\n      }\n    }\n\n    if (--this.syncsProcessing !== 0) return // ie not latest\n\n    if (\n      this.needsSync === true ||\n      (this.core.state.fork === this.remoteFork && this.core.state.length > this.remoteLength)\n    ) {\n      this.signalUpgrade()\n    }\n\n    this._update()\n  }\n\n  _shouldUpdateCanUpgrade() {\n    return (\n      this.core.state.fork === this.remoteFork &&\n      this.core.state.length > this.remoteLength &&\n      this.canUpgrade === false &&\n      this.syncsProcessing === 0\n    )\n  }\n\n  async _updateCanUpgradeAndSync() {\n    const { length, fork } = this.core.state\n\n    const remoteLength = this.remoteLength\n    const remoteFork = this.remoteFork\n    const canUpgrade = await this._canUpgrade(this.remoteLength, this.remoteFork)\n\n    if (\n      this.syncsProcessing > 0 ||\n      length !== this.core.state.length ||\n      fork !== this.core.state.fork\n    ) {\n      return\n    }\n    if (remoteLength !== this.remoteLength || remoteFork !== this.remoteFork) {\n      return\n    }\n    if (canUpgrade === this.canUpgrade) {\n      return\n    }\n\n    this.canUpgrade = canUpgrade\n    if (canUpgrade) {\n      this.lastUpgradableLength = this.remoteLength\n      this.lastUpgradableFork = this.remoteFork\n    }\n\n    this.sendSync()\n  }\n\n  // Safe to call in the background - never fails\n  async _canUpgrade(remoteLength, remoteFork) {\n    if (remoteFork !== this.core.state.fork) return false\n\n    if (remoteLength === 0) return true\n    if (remoteLength >= this.core.state.length) return false\n\n    try {\n      // Rely on caching to make sure this is cheap...\n      const canUpgrade = await MerkleTree.upgradeable(this.core.state, remoteLength)\n\n      if (remoteFork !== this.core.state.fork) return false\n\n      return canUpgrade\n    } catch {\n      return false\n    }\n  }\n\n  async _getProof(batch, msg, pushing) {\n    let block = null\n\n    if (msg.block) {\n      const index = msg.block.index\n\n      if (!pushing && (msg.fork !== this.core.state.fork || !this.core.bitfield.get(index))) {\n        return new ProofRequest(msg, null, null, null)\n      }\n\n      block = batch.getBlock(index)\n      block.catch(noop)\n    }\n\n    const manifest = msg.manifest && !this.core.compat ? this.core.header.manifest : null\n\n    try {\n      const proof = await MerkleTree.proof(this.core.state, batch, msg)\n      return new ProofRequest(msg, proof, block, manifest)\n    } catch (err) {\n      batch.destroy()\n\n      this.replicator._oninvalidrequest(err, msg, this)\n\n      if (this.stats.invalidRequests >= MAX_INVALID_REQUESTS) throw err\n\n      await backoff(this.stats.invalidRequests)\n      return null\n    }\n  }\n\n  async onrequest(msg) {\n    const size = this.remoteRequests.size\n    this.remoteRequests.set(msg.id, msg)\n\n    // if size didnt change -> id overwrite -> old one is deleted, cancel current and re-add\n    if (size === this.remoteRequests.size) {\n      this._cancel(msg.id)\n      this.remoteRequests.set(msg.id, msg)\n    }\n\n    if (!this.protomux.drained || this.receiverQueue.length) {\n      this.receiverQueue.push(msg)\n      return\n    }\n\n    if (this.replicator.destroyed) return\n\n    await this._handleRequest(msg)\n  }\n\n  oncancel(msg) {\n    this._cancel(msg.request)\n  }\n\n  _cancel(id) {\n    this.remoteRequests.delete(id)\n    this.receiverQueue.delete(id)\n  }\n\n  ondrain() {\n    return this._handleRequests()\n  }\n\n  async _handleRequests() {\n    if (this.receiverBusy || this.replicator.destroyed) return\n    this.receiverBusy = true\n    this.protomux.cork()\n\n    while (\n      this.remoteOpened &&\n      this.protomux.drained &&\n      this.receiverQueue.length > 0 &&\n      !this.removed\n    ) {\n      const msg = this.receiverQueue.shift()\n      await this._handleRequest(msg)\n    }\n\n    this.protomux.uncork()\n    this.receiverBusy = false\n  }\n\n  async push(index) {\n    if (!this.remoteAllowPush) return\n    if (!this.remoteDownloading) return\n    if (this.core.state.fork !== this.remoteFork) return\n    if (this.remoteBitfield.get(index)) return\n\n    const msg = {\n      id: 0,\n      fork: this.core.state.fork,\n      block: null,\n      hash: null,\n      seek: null,\n      upgrade: null,\n      manifest: this.remoteLength === 0,\n      priority: 0\n    }\n\n    const remoteLength = Math.max(this.remoteLength, this.pushedLength)\n\n    msg.block = {\n      index,\n      nodes: MerkleTree.maxMissingNodes(2 * index, remoteLength)\n    }\n\n    if (index >= remoteLength) {\n      msg.upgrade = {\n        start: remoteLength,\n        length: this.core.state.length - remoteLength\n      }\n    }\n\n    let req = null\n    const batch = this.core.storage.read()\n    try {\n      req = await this._getProof(batch, msg, true)\n    } catch (err) {\n      this.replicator._oninvalidrequest(err, msg, this)\n      return\n    }\n\n    if (req === null) return\n    batch.tryFlush()\n\n    await this._fulfillRequest(req, true)\n  }\n\n  async _handleRequest(msg) {\n    const batch = this.core.storage.read()\n\n    // TODO: could still be answerable if (index, fork) is an ancestor of the current fork\n    const req =\n      msg.fork === this.core.state.fork\n        ? await this._getProof(batch, msg, false)\n        : new ProofRequest(msg, null, null, null)\n\n    if (req === null) {\n      this.wireNoData.send({ request: msg.id, reason: INVALID_REQUEST })\n      return\n    }\n\n    batch.tryFlush()\n\n    await this._fulfillRequest(req, false)\n  }\n\n  async _fulfillRequest(req, pushing) {\n    const proof = await req.fulfill()\n\n    if (!pushing) {\n      // if cancelled do not reply\n      if (this.remoteRequests.get(req.msg.id) !== req.msg) {\n        return\n      }\n\n      // sync from now on, so safe to delete from the map\n      this.remoteRequests.delete(req.msg.id)\n    } else if (!this.remoteAllowPush) {\n      // if pushing but remote disabled it, just drop it\n      return\n    }\n\n    if (!this.isActive() && proof.block !== null) {\n      return\n    }\n\n    if (proof === null) {\n      if (req.msg.manifest && this.core.header.manifest) {\n        const manifest = this.core.header.manifest\n        this.wireData.send({\n          request: req.msg.id,\n          fork: this.core.state.fork,\n          block: null,\n          hash: null,\n          seek: null,\n          upgrade: null,\n          manifest\n        })\n        incrementTx(this.stats.wireData, this.replicator.stats.wireData)\n        return\n      }\n\n      this.wireNoData.send({ request: req.msg.id, reason: NOT_AVAILABLE })\n      return\n    }\n\n    if (proof.block !== null) {\n      this.replicator._onupload(proof.block.index, proof.block.value.byteLength, this)\n    }\n\n    if (proof.upgrade) {\n      const remoteLength = proof.upgrade.start + proof.upgrade.length\n      if (remoteLength > this.pushedLength) this.pushedLength = remoteLength\n    }\n\n    this.wireData.send({\n      request: req.msg.id,\n      fork: req.msg.fork,\n      block: proof.block,\n      hash: proof.hash,\n      seek: proof.seek,\n      upgrade: proof.upgrade,\n      manifest: proof.manifest\n    })\n    incrementTx(this.stats.wireData, this.replicator.stats.wireData)\n  }\n\n  _cancelRequest(req) {\n    if (req.priority === PRIORITY.CANCELLED) return\n    // mark as cancelled also and avoid re-entry\n    req.priority = PRIORITY.CANCELLED\n\n    this.inflight--\n    this.replicator._requestDone(req.id, false)\n\n    // clear inflight state\n    if (isBlockRequest(req)) this.replicator._unmarkInflight(req.block.index)\n    if (isUpgradeRequest(req)) this.replicator._clearInflightUpgrade(req)\n\n    if (this.roundtripQueue === null) this.roundtripQueue = new RoundtripQueue()\n    this.roundtripQueue.add(req.id)\n    this.wireCancel.send({ request: req.id })\n    incrementTx(this.stats.wireCancel, this.replicator.stats.wireCancel)\n  }\n\n  _checkIfConflict() {\n    this.paused = true\n\n    const length = Math.min(this.core.state.length, this.remoteLength)\n    if (length === 0) return // pause and ignore\n\n    this.wireRequest.send({\n      id: 0, // TODO: use an more explicit id for this eventually...\n      fork: this.remoteFork,\n      block: null,\n      hash: null,\n      seek: null,\n      upgrade: {\n        start: 0,\n        length\n      }\n    })\n\n    incrementTx(this.stats.wireRequest, this.replicator.stats.wireRequest)\n  }\n\n  _unmarkInflightBlockRequest(req, data) {\n    if (isBlockRequest(req)) this.replicator._unmarkInflight(req.block.index)\n    else if (data.block && !req) this.replicator._unmarkInflight(data.block.index)\n  }\n\n  async ondata(data) {\n    if (data.request !== 0) return this._handleData(data)\n\n    await this.replicator._pushLock.lock()\n    try {\n      await this._handleData(data)\n    } finally {\n      this.replicator._pushLock.unlock()\n    }\n  }\n\n  async _handleData(data) {\n    // always allow a fork conflict proof to be sent\n    if (data.request === 0 && data.upgrade && data.upgrade.start === 0) {\n      if (await this.core.checkConflict(data, this)) return\n      this.paused = false\n    }\n\n    const req = data.request > 0 ? this.replicator._inflight.get(data.request) : null\n    const reorg = data.fork > this.core.state.fork\n\n    // no push atm, TODO: check if this satisfies another pending request\n    // allow reorg pushes tho as those are not written to storage so we'll take all the help we can get\n    if (req === null && reorg === false && !this.replicator.allowPush) {\n      return\n    }\n\n    if (req === null && reorg === false && data.block) {\n      // mark this as inflight to avoid parallel requests\n      this.replicator._markInflight(data.block.index)\n    }\n\n    if (req !== null) {\n      if (req.peer !== this) return\n      this._onrequestroundtrip(req)\n    }\n\n    try {\n      if (reorg === true) return await this.replicator._onreorgdata(this, req, data)\n    } catch (err) {\n      safetyCatch(err)\n      this._unmarkInflightBlockRequest(req, data)\n\n      this.paused = true\n      this.replicator._oninvaliddata(err, req, data, this)\n      return\n    }\n\n    this.dataProcessing++\n    if (isBlockRequest(req)) this.replicator._markProcessing(req.block.index)\n\n    try {\n      if (!this.replicator._matchingRequest(req, data) || !(await this.core.verify(data, this))) {\n        this.replicator._onnodata(this, req, 0)\n        return\n      }\n    } catch (err) {\n      safetyCatch(err)\n      this._unmarkInflightBlockRequest(req, data)\n\n      if (err.code === 'WRITE_FAILED') {\n        // For example, we don't want to keep pulling data when storage is full\n        // TODO: notify the user somehow\n        this.paused = true\n        return\n      }\n\n      if (this.core.closed && !isCriticalError(err)) return\n\n      if (err.code !== 'INVALID_OPERATION') {\n        // might be a fork, verify\n        this._checkIfConflict()\n      }\n\n      // if push mode, we MIGHT get an occasional bad message\n      // no need to mega bail for that. TODO: rate limit instead as a general thing\n      if (!this.replicator.allowPush) {\n        this.paused = true\n      }\n\n      this.replicator._onnodata(this, req, 0)\n      this.replicator._oninvaliddata(err, req, data, this)\n      return\n    } finally {\n      if (isBlockRequest(req)) this.replicator._markProcessed(req.block.index)\n      this.dataProcessing--\n    }\n\n    this.replicator._ondata(this, req, data)\n\n    if (this._shouldUpdateCanUpgrade() === true) {\n      this._updateCanUpgradeAndSync()\n    }\n  }\n\n  onnodata({ request, reason }) {\n    const req = request > 0 ? this.replicator._inflight.get(request) : null\n\n    if (req === null || req.peer !== this) {\n      this.replicator.updateAll()\n      return\n    }\n\n    this._onrequestroundtrip(req)\n    this.replicator._onnodata(this, req, reason)\n  }\n\n  _onrequestroundtrip(req) {\n    if (req.priority === PRIORITY.CANCELLED) return\n    // to avoid re-entry we also just mark it as cancelled\n    req.priority = PRIORITY.CANCELLED\n\n    this.inflight--\n    this.replicator._requestDone(req.id, true)\n    if (this.roundtripQueue === null) return\n    const flushed = this.roundtripQueue.flush(req.rt)\n    if (flushed === null) return\n    for (const id of flushed) this.replicator._inflight.reusable(id)\n  }\n\n  onwant(range) {\n    if (!this.remoteWants.add(range)) return\n    this.replicator._onwant(this, range.start, range.length, range.any)\n  }\n\n  onunwant(range) {\n    this.remoteWants.remove(range)\n  }\n\n  onbitfield({ start, bitfield }) {\n    if (start < this._remoteContiguousLength) this._remoteContiguousLength = start // bitfield is always the truth\n    this.remoteBitfield.insert(start, bitfield)\n    this.missingBlocks.insert(start, bitfield)\n    this._clearLocalRange(start, bitfield.byteLength * 8)\n    this._update()\n  }\n\n  _clearLocalRange(start, length) {\n    const bitfield = this.core.skipBitfield === null ? this.core.bitfield : this.core.skipBitfield\n\n    if (length === 1) {\n      this.missingBlocks.set(start, this._remoteHasBlock(start) && !bitfield.get(start))\n      return\n    }\n\n    const contig = Math.min(this.core.state.length, this.core.header.hints.contiguousLength)\n\n    if (start + length < contig) {\n      this.missingBlocks.setRange(start, contig, false)\n      return\n    }\n\n    const rem = start & 32767\n    if (rem > 0) {\n      start -= rem\n      length += rem\n    }\n\n    const end = start + Math.min(length, this.core.state.length)\n    while (start < end) {\n      const local = bitfield.getBitfield(start)\n\n      if (local && local.bitfield) {\n        this.missingBlocks.clear(start, local.bitfield)\n      }\n\n      start += 32768\n    }\n  }\n\n  _resetMissingBlock(index) {\n    const bitfield = this.core.skipBitfield === null ? this.core.bitfield : this.core.skipBitfield\n    this.missingBlocks.set(index, this._remoteHasBlock(index) && !bitfield.get(index))\n  }\n\n  _unclearLocalRange(start, length) {\n    if (length === 1) {\n      this._resetMissingBlock(start)\n      return\n    }\n\n    const rem = start & (RemoteBitfield.BITS_PER_SEGMENT - 1)\n    if (rem > 0) {\n      start -= rem\n      length += rem\n    }\n\n    const fixedStart = start\n\n    const end = start + Math.min(length, this.remoteLength)\n    while (start < end) {\n      const remote = this.remoteBitfield.getBitfield(start)\n      if (remote && remote.bitfield) {\n        this.missingBlocks.insert(start, remote.bitfield)\n      }\n\n      start += RemoteBitfield.BITS_PER_SEGMENT\n    }\n\n    this._clearLocalRange(fixedStart, length)\n  }\n\n  async onrange({ drop, start, length }) {\n    const has = drop === false\n\n    if (drop === true && start < this._remoteContiguousLength) {\n      this._remoteContiguousLength = start\n    }\n\n    if (start === 0 && drop === false) {\n      if (length > this._remoteContiguousLength) {\n        this._remoteContiguousLength = length\n        if (\n          this.remoteFork === this.core.state.fork &&\n          length > this.core.header.hints.remoteContiguousLength\n        ) {\n          this.core.updateRemoteContiguousLength(length)\n        }\n      }\n    } else if (length === 1) {\n      const bitfield = this.core.skipBitfield === null ? this.core.bitfield : this.core.skipBitfield\n      this.remoteBitfield.set(start, has)\n      this.missingBlocks.set(start, has && !bitfield.get(start))\n    } else {\n      const rangeStart = this.remoteBitfield.findFirst(!has, start)\n      const rangeEnd = length + start\n\n      if (rangeStart !== -1 && rangeStart < rangeEnd) {\n        this.remoteBitfield.setRange(rangeStart, rangeEnd, has)\n        this.missingBlocks.setRange(rangeStart, rangeEnd, has)\n        if (has) this._clearLocalRange(rangeStart, rangeEnd - rangeStart)\n      }\n    }\n\n    if (this.core.hintsChanged) await this.core.flushHints()\n    if (drop === false) this._update()\n  }\n\n  onreorghint() {\n    // TODO\n  }\n\n  _update() {\n    // TODO: if this is in a batch or similar it would be better to defer it\n    // we could do that with nextTick/microtick mb? (combined with a property on the session to signal read buffer mb)\n    this.replicator.updatePeer(this)\n  }\n\n  async _onconflict() {\n    this.protomux.cork()\n    if (this.remoteLength > 0 && this.core.state.fork === this.remoteFork) {\n      await this.onrequest({\n        id: 0,\n        fork: this.core.state.fork,\n        block: null,\n        hash: null,\n        seek: null,\n        upgrade: {\n          start: 0,\n          length: Math.min(this.core.state.length, this.remoteLength)\n        }\n      })\n    }\n    this.channel.close()\n    this.protomux.uncork()\n  }\n\n  _makeRequest(needsUpgrade, priority, minLength) {\n    if (needsUpgrade === true && this.replicator._shouldUpgrade(this) === false) {\n      return null\n    }\n\n    // ensure that the remote has signalled they have the length we request\n    if (this.remoteLength < minLength) {\n      return null\n    }\n\n    if (needsUpgrade === false && this.replicator._autoUpgrade(this) === true) {\n      needsUpgrade = true\n    }\n\n    return {\n      peer: this,\n      rt: this.roundtripQueue === null ? 0 : this.roundtripQueue.tick,\n      id: 0,\n      fork: this.remoteFork,\n      block: null,\n      hash: null,\n      seek: null,\n      upgrade:\n        needsUpgrade === false\n          ? null\n          : { start: this.core.state.length, length: this.remoteLength - this.core.state.length },\n      // remote manifest check can be removed eventually...\n      manifest: this.core.header.manifest === null && this.remoteHasManifest === true,\n      priority,\n      timestamp: Date.now(),\n      elapsed: 0\n    }\n  }\n\n  _requestManifest() {\n    const req = this._makeRequest(false, 0, 0)\n    this._send(req)\n  }\n\n  _includeLastBlock() {\n    if (this.replicator._alwaysLatestBlock === 0) return null\n\n    const index = this.remoteLength - 1\n\n    // only valid if its an OOB get\n    if (index < this.core.state.length) return null\n\n    // do the normal checks\n    if (!this._remoteHasBlock(index)) return null\n    if (!this._canRequest(index)) return null\n\n    // atm we only ever do one upgrade request in parallel, if that changes\n    // then we should add some check here for inflights to avoid over requesting\n    const b = this.replicator._blocks.add(index, PRIORITY.NORMAL)\n    return b\n  }\n\n  _requestUpgrade(u) {\n    const req = this._makeRequest(true, 0, 0)\n    if (req === null) return false\n\n    const b = this._includeLastBlock()\n\n    if (b) this._sendBlockRequest(req, b)\n    else this._send(req)\n\n    return true\n  }\n\n  _requestSeek(s) {\n    // if replicator is updating the seeks etc, bail and wait for it to drain\n    if (this.replicator._updatesPending > 0) return false\n\n    const { length, fork } = this.core.state\n\n    if (fork !== this.remoteFork) return false\n\n    if (s.seeker.start >= length) {\n      const req = this._makeRequest(true, 0, 0)\n\n      // We need an upgrade for the seek, if non can be provided, skip\n      if (req === null) return false\n\n      req.seek = this.remoteSupportsSeeks\n        ? { bytes: s.seeker.bytes, padding: s.seeker.padding }\n        : null\n\n      s.inflight.push(req)\n      this._send(req)\n\n      return true\n    }\n\n    const len = s.seeker.end - s.seeker.start\n    const off = s.seeker.start + Math.floor(Math.random() * len)\n\n    for (let i = 0; i < len; i++) {\n      let index = off + i\n      if (index > s.seeker.end) index -= len\n\n      if (this._remoteHasBlock(index) === false) continue\n      if (this.core.bitfield.get(index) === true) continue\n      if (!this._canRequest(index)) continue\n\n      // Check if this block is currently inflight - if so pick another\n      const b = this.replicator._blocks.get(index)\n      if (b !== null && b.inflight.length > 0) continue\n\n      // Block is not inflight, but we only want the hash, check if that is inflight\n      const h = this.replicator._hashes.add(index, PRIORITY.NORMAL)\n      if (h.inflight.length > 0) continue\n\n      const req = this._makeRequest(false, h.priority, index + 1)\n      if (req === null) continue\n\n      const nodes = flatTree.depth(s.seeker.start + s.seeker.end - 1)\n\n      req.hash = { index: 2 * index, nodes }\n      req.seek = this.remoteSupportsSeeks\n        ? { bytes: s.seeker.bytes, padding: s.seeker.padding }\n        : null\n\n      s.inflight.push(req)\n      h.inflight.push(req)\n      this._send(req)\n\n      return true\n    }\n\n    this._maybeWantAnyRange(s.seeker.start, len, s)\n    return false\n  }\n\n  _canRequest(index) {\n    if (!(index >= 0)) throw ASSERTION('bad index to _canRequest: ' + index)\n\n    if (this.remoteLength >= this.core.state.length) {\n      return true\n    }\n\n    if (index < this.lastUpgradableLength && this.lastUpgradableFork === this.core.state.fork) {\n      return true\n    }\n\n    if (this.canUpgrade && this.syncsProcessing === 0) {\n      return true\n    }\n\n    return false\n  }\n\n  _remoteHasBlock(index) {\n    return index < this._remoteContiguousLength || this.remoteBitfield.get(index) === true\n  }\n\n  _sendBlockRequest(req, b) {\n    req.block = { index: b.index, nodes: 0 }\n    this.replicator._markInflight(b.index)\n\n    b.inflight.push(req)\n    this.replicator.hotswaps.add(b)\n    this._send(req)\n  }\n\n  _requestBlock(b) {\n    const { length, fork } = this.core.state\n\n    if (this._remoteHasBlock(b.index) === false || fork !== this.remoteFork) {\n      if (!this.core.bitfield.get(b.index)) this._maybeWant(b.index, b)\n      return false\n    }\n\n    if (!this._canRequest(b.index)) return false\n\n    const req = this._makeRequest(b.index >= length, b.priority, b.index + 1)\n    if (req === null) return false\n\n    this._sendBlockRequest(req, b)\n\n    return true\n  }\n\n  _maybeWant(index, handle) {\n    if (index < this.remoteContiguousLength) return\n\n    const res = this.wants.add(index, handle)\n    if (!res) return\n\n    const batch = res.want && res.unwant\n    if (batch) this.protomux.cork()\n\n    if (res.unwant) {\n      this.wireUnwant.send(res.unwant)\n      incrementTx(this.stats.wireUnwant, this.replicator.stats.wireUnwant)\n    }\n    if (res.want) {\n      this.wireWant.send(res.want)\n      incrementTx(this.stats.wireWant, this.replicator.stats.wireWant)\n    }\n\n    if (batch) this.protomux.uncork()\n  }\n\n  _maybeWantAnyRange(start, length, handle) {\n    if (handle.wants) {\n      for (const w of handle.wants) {\n        if ((w.start !== start || w.length !== length) && w.any) {\n          const req = this.wants.removeAnyRange(w.start, w.length, handle)\n          if (req) this.wireUnwant.send(req)\n        }\n      }\n    }\n\n    if (start + length <= this.remoteContiguousLength) return\n\n    const req = this.wants.addAnyRange(start, length, handle)\n    if (req) this.wireWant.send(req)\n  }\n\n  _requestRangeBlock(index, length) {\n    if (this.core.bitfield.get(index) === true || !this._canRequest(index)) return false\n\n    const b = this.replicator._blocks.add(index, PRIORITY.NORMAL)\n    if (b.inflight.length > 0) {\n      this.missingBlocks.set(index, false) // in case we missed some states just set them ondemand, nbd\n      return false\n    }\n\n    const req = this._makeRequest(index >= length, b.priority, index + 1)\n\n    // If the request cannot be satisfied, dealloc the block request if no one is subscribed to it\n    if (req === null) {\n      b.gc()\n      return false\n    }\n\n    this._sendBlockRequest(req, b)\n\n    // Don't think this will ever happen, as the pending queue is drained before the range queue\n    // but doesn't hurt to check this explicitly here also.\n    if (b.queued) b.queued = false\n    return true\n  }\n\n  _findNext(i) {\n    if (i < this._remoteContiguousLength) {\n      if (this.core.skipBitfield === null) this.replicator._openSkipBitfield()\n      i = this.core.skipBitfield.findFirst(false, i)\n      if (i < this._remoteContiguousLength && i > -1) return i\n      i = this._remoteContiguousLength\n    }\n\n    return this.missingBlocks.findFirst(true, i)\n  }\n\n  _addRangeBatch(r, offset, end) {\n    while (offset < end) {\n      const next = this.core.bitfield.findFirst(false, offset)\n      if (next === -1 || next >= end) return false\n\n      const b = (next - (next & (WANT_BATCH - 1))) / WANT_BATCH\n\n      if (r.addBatch(b)) return true\n\n      offset = (b + 1) * WANT_BATCH\n    }\n\n    return false\n  }\n\n  _populateRangeBatches(r) {\n    for (let i = r.batches.length - 1; i >= 0; i--) {\n      const b = r.batches[i]\n      const minStart = b.batch * WANT_BATCH\n      const maxEnd = minStart + WANT_BATCH\n\n      const start = Math.max(r.start, minStart)\n      const end = Math.min(r.end === -1 ? maxEnd : r.end, maxEnd)\n\n      if (start < end && this.core.bitfield.hasUnset(start, end - start)) continue\n\n      r.removeBatch(b)\n    }\n\n    while (r.batches.length < 3) {\n      const end = r.end === -1 ? this.core.state.length : r.end\n      if (end <= r.start) return\n\n      const len = end - r.start\n      const off = r.start + (r.linear ? 0 : Math.floor(Math.random() * len))\n\n      if (!this._addRangeBatch(r, off, end) && !this._addRangeBatch(r, r.start, end)) break\n    }\n  }\n\n  _requestRangeBatch(start, end, length) {\n    let tries = this.inflight\n\n    do {\n      start = this._findNext(start)\n      if (start === -1 || start >= end) break\n\n      if (this._requestRangeBlock(start, length)) return true\n      start++\n    } while (tries-- > 0)\n\n    return false\n  }\n\n  _getValidEnd(maxEnd) {\n    // if we can upgrade the remote, or the remote is ahead, then all the remotes blocks are valid\n    // otherwise truncate to the last length the remote has acked for us\n    const maxLocalLength =\n      this.canUpgrade || this.remoteLength >= this.core.state.length\n        ? this.core.state.length\n        : this.core.state.fork === this.lastUpgradableFork\n          ? Math.min(this.lastUpgradableLength, this.core.state.length)\n          : 0\n\n    return Math.min(\n      maxLocalLength,\n      Math.min(maxEnd === -1 ? this.remoteLength : maxEnd, this.remoteLength)\n    )\n  }\n\n  _requestRange(r) {\n    if (this.syncsProcessing > 0) return false\n\n    const { length, fork } = this.core.state\n\n    if (r.blocks) {\n      for (let i = r.start; i < r.end; i++) {\n        const index = r.blocks[i]\n        const has = index < this._remoteContiguousLength || this.missingBlocks.get(index) === true\n        if (has === true && this._requestRangeBlock(index, length)) return true\n        this._maybeWant(index, r)\n      }\n\n      return false\n    }\n\n    this._populateRangeBatches(r)\n\n    const end = this._getValidEnd(r.end)\n\n    if (end <= r.start || fork !== this.remoteFork) return false\n\n    for (let i = 0; i < r.batches.length; i++) {\n      const b = r.batches[i]\n\n      const batchStart = Math.max(b.batch * WANT_BATCH, r.start)\n      const batchEnd = Math.min((b.batch + 1) * WANT_BATCH, end)\n      const len = batchEnd - batchStart\n      const off = batchStart + (r.linear ? 0 : Math.floor(Math.random() * len))\n\n      if (\n        this._requestRangeBatch(off, end, length) ||\n        this._requestRangeBatch(batchStart, off, length)\n      ) {\n        return true\n      }\n\n      this._maybeWant(batchStart, b)\n    }\n\n    // Here we should consider making an OOB request (ie if the remote says they have a newer block)\n    // but the upgrade code already does that, so no big deal for now\n\n    return false\n  }\n\n  _requestForkProof(f) {\n    if (!this.remoteLength) return\n\n    const req = this._makeRequest(false, 0, 0)\n\n    req.upgrade = { start: 0, length: this.remoteLength }\n    req.manifest = !this.core.header.manifest\n\n    f.inflight.push(req)\n    this._send(req)\n  }\n\n  _requestForkRange(f) {\n    if (f.fork !== this.remoteFork || f.batch.want === null) return false\n\n    const end = Math.min(f.batch.want.end, this.remoteLength)\n    if (end < f.batch.want.start) return false\n\n    const len = end - f.batch.want.start\n    const off = f.batch.want.start + Math.floor(Math.random() * len)\n\n    for (let i = 0; i < len; i++) {\n      let index = off + i\n      if (index >= end) index -= len\n\n      if (this._remoteHasBlock(index) === false) continue\n\n      const req = this._makeRequest(false, 0, 0)\n\n      req.hash = { index: 2 * index, nodes: f.batch.want.nodes }\n\n      f.inflight.push(req)\n      this._send(req)\n\n      return true\n    }\n\n    this._maybeWantAnyRange(f.batch.want.start, len, f)\n    return false\n  }\n\n  isActive() {\n    if (this.paused || this.removed || this.core.header.frozen) return false\n    return true\n  }\n\n  async _send(req) {\n    const fork = this.core.state.fork\n\n    this.inflight++\n    this.replicator._inflight.add(req)\n\n    if (req.upgrade !== null && req.fork === fork) {\n      const u = this.replicator._addUpgrade()\n      u.inflight.push(req)\n    }\n\n    try {\n      if (req.block !== null && req.fork === fork) {\n        req.block.nodes = await MerkleTree.missingNodes(\n          this.core.state,\n          2 * req.block.index,\n          this.core.state.length\n        )\n        if (req.priority === PRIORITY.CANCELLED) return\n      }\n      if (req.hash !== null && req.fork === fork && req.hash.nodes === 0) {\n        req.hash.nodes = await MerkleTree.missingNodes(\n          this.core.state,\n          req.hash.index,\n          this.core.state.length\n        )\n        if (req.priority === PRIORITY.CANCELLED) return\n\n        // nodes === 0, we already have it, bail\n        if (req.hash.nodes === 0 && (req.hash.index & 1) === 0) {\n          this.inflight--\n          this.replicator._resolveHashLocally(this, req)\n          return\n        }\n      }\n    } catch (err) {\n      this.stream.destroy(err)\n      return\n    }\n\n    this.wireRequest.send(req)\n    incrementTx(this.stats.wireRequest, this.replicator.stats.wireRequest)\n  }\n}\n\nmodule.exports = class Replicator {\n  static Peer = Peer // hack to be able to access Peer from outside this module\n\n  constructor(\n    core,\n    {\n      notDownloadingLinger = NOT_DOWNLOADING_SLACK,\n      eagerUpgrade = true,\n      allowFork = true,\n      allowPush = false,\n      alwaysLatestBlock = false,\n      inflightRange = null\n    } = {}\n  ) {\n    this.core = core\n    this.eagerUpgrade = eagerUpgrade\n    this.allowFork = allowFork\n    this.allowPush = allowPush\n    this.ondownloading = null // optional external hook for monitoring downloading status\n    this.peers = []\n    this.findingPeers = 0 // updatable from the outside\n    this.destroyed = false\n    this.downloading = false\n    this.activeSessions = 0\n\n    this.hotswaps = new HotswapQueue()\n    this.inflightRange = inflightRange || DEFAULT_MAX_INFLIGHT\n\n    // Note: nodata and unwant not currently tracked\n    // tx = transmitted, rx = received\n    this.stats = {\n      wireSync: { tx: 0, rx: 0 },\n      wireRequest: { tx: 0, rx: 0 },\n      wireCancel: { tx: 0, rx: 0 },\n      wireData: { tx: 0, rx: 0 },\n      wireWant: { tx: 0, rx: 0 },\n      wireUnwant: { tx: 0, rx: 0 },\n      wireBitfield: { tx: 0, rx: 0 },\n      wireRange: { tx: 0, rx: 0 },\n      wireExtension: { tx: 0, rx: 0 },\n      hotswaps: 0,\n      invalidData: 0,\n      invalidRequests: 0,\n      backoffs: 0\n    }\n\n    this._attached = new Set()\n    this._inflight = new InflightTracker()\n    this._blocks = new BlockTracker(this)\n    this._hashes = new BlockTracker(this)\n\n    this._alwaysLatestBlock = alwaysLatestBlock ? 1 : 0\n    this._queued = []\n\n    this._seeks = []\n    this._upgrade = null\n    this._reorgs = []\n    this._ranges = []\n\n    this._pushLock = new Mutex()\n    this._hadPeers = false\n    this._active = 0\n    this._ifAvailable = 0\n    this._updatesPending = 0\n    this._applyingReorg = null\n    this._manifestPeer = null\n    this._notDownloadingLinger = notDownloadingLinger\n    this._notDownloadingTimer = null\n\n    const self = this\n    this._onstreamclose = onstreamclose\n\n    function onstreamclose() {\n      self.detachFrom(this.userData)\n    }\n  }\n\n  setInflightRange(min, max) {\n    this.inflightRange = [min, max]\n  }\n\n  updateActivity(inc, session) {\n    this.activeSessions += inc\n    this.setDownloading(this.activeSessions !== 0, session)\n  }\n\n  isDownloading() {\n    return this.downloading || !this._inflight.idle\n  }\n\n  async push(index) {\n    const all = []\n    for (const peer of this.peers) {\n      all.push(peer.push(index))\n    }\n    await Promise.all(all)\n  }\n\n  setAllowPush(allowPush) {\n    if (allowPush === this.allowPush) return\n    this.allowPush = allowPush\n    for (const peer of this.peers) peer.sendSync()\n  }\n\n  isAllowingPush() {\n    if (!this.allowPush) return false\n    if (this._notDownloadingTimer) return false\n    return this.downloading\n  }\n\n  setDownloading(downloading) {\n    const allowPush = this.isAllowingPush()\n    const linger = this._notDownloadingLinger\n\n    if (this._notDownloadingTimer) {\n      clearTimeout(this._notDownloadingTimer)\n      this._notDownloadingTimer = null\n    }\n\n    if (this.destroyed) return\n\n    if (downloading || linger === 0) {\n      if (!this._setDownloadingNow(downloading)) this.signalAllowPush(allowPush)\n      return\n    }\n\n    this._notDownloadingTimer = setTimeout(setNotDownloadingLater, linger, this)\n    if (this._notDownloadingTimer.unref) this._notDownloadingTimer.unref()\n    this.signalAllowPush(allowPush)\n  }\n\n  signalAllowPush(allowPush) {\n    if (allowPush === this.isAllowingPush()) return\n    for (const peer of this.peers) peer.signalUpgrade()\n  }\n\n  _setDownloadingNow(downloading) {\n    this._notDownloadingTimer = null\n\n    if (this.downloading === downloading) return false\n    this.downloading = downloading\n\n    if (!downloading && this.isDownloading()) return false\n\n    for (const peer of this.peers) peer.signalUpgrade()\n\n    if (downloading) {\n      // restart channel if needed...\n      for (const protomux of this._attached) {\n        if (!protomux.stream.handshakeHash) continue\n        if (protomux.opened({ protocol: 'hypercore/alpha', id: this.core.discoveryKey })) continue\n        this._makePeer(protomux, true)\n      }\n    } else {\n      for (const peer of this.peers) peer.closeIfIdle()\n    }\n\n    if (this.ondownloading !== null && downloading) this.ondownloading()\n    return true\n  }\n\n  cork() {\n    for (const peer of this.peers) peer.protomux.cork()\n  }\n\n  uncork() {\n    for (const peer of this.peers) peer.protomux.uncork()\n  }\n\n  // Called externally when a range of new blocks has been processed/removed\n  onhave(start, length, drop = false) {\n    for (const peer of this.peers) peer.broadcastRange(start, length, drop)\n  }\n\n  // Called externally when a truncation upgrade has been processed\n  ontruncate(newLength, truncated) {\n    const notify = []\n\n    for (const blk of this._blocks) {\n      if (blk.index < newLength) continue\n      notify.push(blk)\n    }\n\n    for (const blk of notify) {\n      for (const r of blk.refs) {\n        if (r.snapshot === false) continue\n        blk.detach(r, SNAPSHOT_NOT_AVAILABLE())\n      }\n    }\n\n    for (const peer of this.peers) {\n      peer.fullyDownloadedSignaled = Math.min(newLength, peer.fullyDownloadedSignaled)\n      peer._unclearLocalRange(newLength, truncated)\n    }\n  }\n\n  // Called externally when a upgrade has been processed\n  onupgrade() {\n    for (const peer of this.peers) peer.signalUpgrade()\n    if (this._blocks.isEmpty() === false) this._resolveBlocksLocally()\n    if (this._upgrade !== null) this._resolveUpgradeRequest(null)\n    if (!this._blocks.isEmpty() || this._ranges.length !== 0 || this._seeks.length !== 0) {\n      this._updateNonPrimary(true)\n    }\n  }\n\n  // Called externally when a conflict has been detected and verified\n  async onconflict() {\n    const all = []\n    for (const peer of this.peers) {\n      all.push(peer._onconflict())\n    }\n    await Promise.allSettled(all)\n  }\n\n  async applyPendingReorg() {\n    if (this._applyingReorg !== null) {\n      await this._applyingReorg\n      return true\n    }\n\n    for (let i = this._reorgs.length - 1; i >= 0; i--) {\n      const f = this._reorgs[i]\n      if (f.batch !== null && f.batch.finished) {\n        await this._applyReorg(f)\n        return true\n      }\n    }\n\n    return false\n  }\n\n  addUpgrade(session) {\n    if (this._upgrade !== null) {\n      const ref = this._upgrade.attach(session)\n      this._checkUpgradeIfAvailable()\n      return ref\n    }\n\n    const ref = this._addUpgrade().attach(session)\n\n    this.updateAll()\n\n    return ref\n  }\n\n  addBlock(session, index) {\n    const b = this._blocks.add(index, PRIORITY.HIGH)\n    const ref = b.attach(session)\n\n    this._queueBlock(b)\n    this.updateAll()\n\n    return ref\n  }\n\n  addSeek(session, seeker) {\n    const s = new SeekRequest(this, this._seeks, seeker)\n    const ref = s.attach(session)\n\n    this._seeks.push(s)\n    this.updateAll()\n\n    return ref\n  }\n\n  addRange(\n    session,\n    {\n      start = 0,\n      end = -1,\n      length = toLength(start, end),\n      blocks = null,\n      linear = false,\n      ifAvailable = false\n    } = {}\n  ) {\n    if (blocks !== null) {\n      // if using blocks, start, end just acts as frames around the blocks array\n      start = 0\n      end = length = blocks.length\n    }\n\n    const r = new RangeRequest(\n      this,\n      this._ranges,\n      start,\n      length === -1 ? -1 : start + length,\n      linear,\n      ifAvailable,\n      blocks\n    )\n\n    const ref = r.attach(session)\n\n    // Trigger this to see if this is already resolved...\n    // Also auto compresses the range based on local bitfield\n    clampRange(this.core, r)\n\n    if (r.end !== -1 && r.start >= r.end) {\n      this._resolveRangeRequest(r)\n      return ref\n    }\n\n    this.updateAll()\n\n    return ref\n  }\n\n  cancel(ref) {\n    ref.context.detach(ref, null)\n  }\n\n  static clearRequests(session, err) {\n    if (session.length === 0) return\n\n    const updated = new Set()\n\n    while (session.length > 0) {\n      const ref = session[session.length - 1]\n      updated.add(ref.context.replicator)\n      ref.context.detach(ref, err)\n    }\n\n    for (const replicator of updated) {\n      replicator.updateAll()\n    }\n  }\n\n  clearRequests(session, err = null) {\n    let cleared = false\n    while (session.length > 0) {\n      const ref = session[session.length - 1]\n      ref.context.detach(ref, err)\n      cleared = true\n    }\n\n    if (cleared) this.updateAll()\n  }\n\n  _matchingRequest(req, data) {\n    if (this.allowPush) {\n      return true\n    }\n    if (data.block !== null && (req.block === null || req.block.index !== data.block.index)) {\n      return false\n    }\n    if (data.hash !== null && (req.hash === null || req.hash.index !== data.hash.index)) {\n      return false\n    }\n    if (data.seek !== null && (req.seek === null || req.seek.bytes !== data.seek.bytes)) {\n      return false\n    }\n    if (data.upgrade !== null && req.upgrade === null) {\n      return false\n    }\n    return req.fork === data.fork\n  }\n\n  _addUpgradeMaybe() {\n    return this.eagerUpgrade === true ? this._addUpgrade() : this._upgrade\n  }\n\n  // TODO: this function is OVER called atm, at each updatePeer/updateAll\n  // instead its more efficient to only call it when the conditions in here change - ie on sync/add/remove peer\n  // Do this when we have more tests.\n  _checkUpgradeIfAvailable() {\n    if (this._ifAvailable > 0 && this.peers.length < MAX_PEERS_UPGRADE) return\n    if (this._upgrade === null || this._upgrade.refs.length === 0) return\n    if (this._hadPeers === false && this.findingPeers > 0) return\n\n    const maxPeers = Math.min(this.peers.length, MAX_PEERS_UPGRADE)\n\n    // check if a peer can upgrade us\n\n    for (let i = 0; i < maxPeers; i++) {\n      const peer = this.peers[i]\n\n      if (peer.remoteSynced === false) return\n\n      if (this.core.state.length === 0 && peer.remoteLength > 0) return\n\n      if (peer.remoteLength <= this._upgrade.length || peer.remoteFork !== this._upgrade.fork) {\n        continue\n      }\n\n      if (peer.syncsProcessing > 0) return\n\n      if (peer.lengthAcked !== this.core.state.length && peer.remoteFork === this.core.state.fork) {\n        return\n      }\n\n      if (peer.remoteCanUpgrade === true) return\n    }\n\n    // check if reorgs in progress...\n\n    if (this._applyingReorg !== null) return\n\n    // TODO: we prob should NOT wait for inflight reorgs here, seems better to just resolve the upgrade\n    // and then apply the reorg on the next call in case it's slow - needs some testing in practice\n\n    for (let i = 0; i < this._reorgs.length; i++) {\n      const r = this._reorgs[i]\n      if (r.inflight.length > 0) return\n    }\n\n    // if something is inflight, wait for that first\n    if (this._upgrade.inflight.length > 0) return\n\n    // nothing to do, indicate no update avail\n\n    const u = this._upgrade\n    this._upgrade = null\n    u.resolve(false)\n  }\n\n  _addUpgrade() {\n    if (this._upgrade !== null) return this._upgrade\n\n    // TODO: needs a reorg: true/false flag to indicate if the user requested a reorg\n    this._upgrade = new UpgradeRequest(this, this.core.state.fork, this.core.state.length)\n\n    return this._upgrade\n  }\n\n  _addReorg(fork, peer) {\n    if (this.allowFork === false) return null\n\n    // TODO: eager gc old reorgs from the same peer\n    // not super important because they'll get gc'ed when the request finishes\n    // but just spam the remote can do ...\n\n    for (const f of this._reorgs) {\n      if (f.fork > fork && f.batch !== null) return null\n      if (f.fork === fork) return f\n    }\n\n    const f = new ForkRequest(this, fork)\n\n    this._reorgs.push(f)\n\n    // maintain sorted by fork\n    let i = this._reorgs.length - 1\n    while (i > 0 && this._reorgs[i - 1].fork > fork) {\n      this._reorgs[i] = this._reorgs[i - 1]\n      this._reorgs[--i] = f\n    }\n\n    return f\n  }\n\n  _shouldUpgrade(peer) {\n    if (this._upgrade !== null && this._upgrade.inflight.length > 0) return false\n    return (\n      peer.remoteCanUpgrade === true &&\n      peer.remoteLength > this.core.state.length &&\n      peer.lengthAcked === this.core.state.length\n    )\n  }\n\n  _autoUpgrade(peer) {\n    return (\n      this._upgrade !== null &&\n      peer.remoteFork === this.core.state.fork &&\n      this._shouldUpgrade(peer)\n    )\n  }\n\n  _addPeer(peer) {\n    this._hadPeers = true\n    this.peers.push(peer)\n    this.updatePeer(peer)\n    this._onpeerupdate(true, peer)\n  }\n\n  _requestDone(id, roundtrip) {\n    this._inflight.remove(id, roundtrip)\n    if (this.isDownloading() === true) return\n    for (const peer of this.peers) peer.signalUpgrade()\n  }\n\n  _removePeer(peer) {\n    this.peers.splice(this.peers.indexOf(peer), 1)\n    peer.wants.destroy()\n\n    if (this._manifestPeer === peer) this._manifestPeer = null\n\n    for (const req of this._inflight) {\n      if (req.peer !== peer) continue\n      this._inflight.remove(req.id, true)\n      this._clearRequest(peer, req)\n    }\n\n    this._onpeerupdate(false, peer)\n    this.updateAll()\n  }\n\n  _queueBlock(b) {\n    if (b.inflight.length > 0 || b.queued === true) return\n    b.queued = true\n    this._queued.push(b)\n  }\n\n  _resolveHashLocally(peer, req) {\n    this._requestDone(req.id, false)\n    this._resolveBlockRequest(this._hashes, req.hash.index / 2, null, req)\n    this.updatePeer(peer)\n  }\n\n  // Runs in the background - not allowed to throw\n  async _resolveBlocksLocally() {\n    // TODO: check if fork compat etc. Requires that we pass down truncation info\n\n    const clear = []\n    const blocks = []\n\n    const reader = this.core.storage.read()\n    for (const b of this._blocks) {\n      if (this.core.bitfield.get(b.index) === false) continue\n      blocks.push(this._resolveLocalBlock(b, reader, clear))\n    }\n    reader.tryFlush()\n\n    await Promise.all(blocks)\n\n    if (!clear.length) return\n\n    // Currently the block tracker does not support deletes during iteration, so we make\n    // sure to clear them afterwards.\n    for (const b of clear) {\n      this._blocks.remove(b.index)\n      removeHotswap(b)\n    }\n  }\n\n  async _resolveLocalBlock(b, reader, resolved) {\n    try {\n      b.resolve(await reader.getBlock(b.index))\n    } catch (err) {\n      b.reject(err)\n      return\n    }\n\n    resolved.push(b)\n  }\n\n  _resolveBlockRequest(tracker, index, value, req) {\n    const b = tracker.remove(index)\n    if (b === null) return false\n\n    removeInflight(b.inflight, req)\n    removeHotswap(b)\n    b.queued = false\n\n    b.resolve(value)\n\n    if (b.inflight.length > 0) {\n      // if anything is still inflight, cancel it\n      for (let i = b.inflight.length - 1; i >= 0; i--) {\n        const req = b.inflight[i]\n        req.peer._cancelRequest(req)\n      }\n    }\n\n    return true\n  }\n\n  _resolveUpgradeRequest(req) {\n    if (req !== null) removeInflight(this._upgrade.inflight, req)\n\n    if (\n      this.core.state.length === this._upgrade.length &&\n      this.core.state.fork === this._upgrade.fork\n    ) {\n      return false\n    }\n\n    const u = this._upgrade\n    this._upgrade = null\n    u.resolve(true)\n\n    return true\n  }\n\n  _resolveRangeRequest(req) {\n    req.resolve(true)\n    req.gc()\n  }\n\n  _clearInflightBlock(tracker, req) {\n    const isBlock = tracker === this._blocks\n    const index = isBlock === true ? req.block.index : req.hash.index / 2\n    const b = tracker.get(index)\n\n    if (b === null || removeInflight(b.inflight, req) === false) return\n\n    if (removeHotswap(b) === true && b.inflight.length > 0) {\n      this.hotswaps.add(b)\n    }\n\n    if (b.refs.length > 0 && isBlock === true) {\n      this._queueBlock(b)\n      return\n    }\n\n    b.gc()\n  }\n\n  _clearInflightUpgrade(req) {\n    if (this._upgrade === null || removeInflight(this._upgrade.inflight, req) === false) return\n    this._upgrade.gc()\n  }\n\n  _clearInflightSeeks(req) {\n    for (const s of this._seeks) {\n      if (removeInflight(s.inflight, req) === false) continue\n      s.gc()\n    }\n  }\n\n  _clearInflightReorgs(req) {\n    for (const r of this._reorgs) {\n      removeInflight(r.inflight, req)\n    }\n  }\n\n  _clearOldReorgs(fork) {\n    for (let i = 0; i < this._reorgs.length; i++) {\n      const f = this._reorgs[i]\n      if (f.fork >= fork) continue\n      if (i === this._reorgs.length - 1) this._reorgs.pop()\n      else this._reorgs[i] = this._reorgs.pop()\n      i--\n    }\n  }\n\n  // \"slow\" updates here - async but not allowed to ever throw\n  async _updateNonPrimary(updateAll) {\n    // Check if running, if so skip it and the running one will issue another update for us (debounce)\n    while (++this._updatesPending === 1) {\n      let len = Math.min(MAX_RANGES, this._ranges.length)\n\n      for (let i = 0; i < len; i++) {\n        const r = this._ranges[i]\n\n        clampRange(this.core, r)\n\n        if (r.end !== -1 && r.start >= r.end) {\n          this._resolveRangeRequest(r)\n          i--\n          if (len > this._ranges.length) len--\n          if (this._ranges.length === MAX_RANGES) updateAll = true\n        }\n      }\n\n      for (let i = 0; i < this._seeks.length; i++) {\n        const s = this._seeks[i]\n\n        let err = null\n        let res = null\n\n        try {\n          res = await s.seeker.update()\n        } catch (error) {\n          err = error\n        }\n\n        if (!res && !err) continue\n\n        if (i < this._seeks.length - 1) this._seeks[i] = this._seeks.pop()\n        else this._seeks.pop()\n\n        i--\n\n        if (err) s.reject(err)\n        else s.resolve(res)\n      }\n\n      // No additional updates scheduled - break\n      if (--this._updatesPending === 0) break\n      // Debounce the additional updates - continue\n      this._updatesPending = 0\n    }\n\n    if (this._inflight.idle || updateAll) this.updateAll()\n  }\n\n  _maybeResolveIfAvailableRanges() {\n    if (this._ifAvailable > 0 || !this._inflight.idle || !this._ranges.length) return\n\n    for (let i = 0; i < this.peers.length; i++) {\n      if (this.peers[i].dataProcessing > 0) return\n    }\n\n    for (let i = 0; i < this._ranges.length; i++) {\n      const r = this._ranges[i]\n\n      if (r.ifAvailable) {\n        this._resolveRangeRequest(r)\n        i--\n      }\n    }\n  }\n\n  _clearRequest(peer, req) {\n    if (req.block !== null) {\n      this._clearInflightBlock(this._blocks, req)\n      this._unmarkInflight(req.block.index)\n    }\n\n    if (req.hash !== null) {\n      this._clearInflightBlock(this._hashes, req)\n    }\n\n    if (req.upgrade !== null && this._upgrade !== null) {\n      this._clearInflightUpgrade(req)\n    }\n\n    if (this._seeks.length > 0) {\n      this._clearInflightSeeks(req)\n    }\n\n    if (this._reorgs.length > 0) {\n      this._clearInflightReorgs(req)\n    }\n  }\n\n  _onnodata(peer, req, reason) {\n    if (reason === INVALID_REQUEST) {\n      peer.stats.backoffs++\n      this.stats.backoffs++\n\n      if (peer.stats.backoffs >= MAX_BACKOFFS) {\n        peer.paused = true\n      }\n    }\n\n    if (req) {\n      this._clearRequest(peer, req)\n    }\n\n    this.updateAll()\n  }\n\n  _openSkipBitfield() {\n    // technically the skip bitfield gets bits cleared if .clear() is called\n    // also which might be in inflight also, but that just results in that section being overcalled shortly\n    // worst case, so ok for now\n\n    const bitfield = this.core.openSkipBitfield()\n\n    for (const req of this._inflight) {\n      if (req.block) bitfield.set(req.block.index, true) // skip\n    }\n  }\n\n  _markProcessing(index) {\n    const b = this._blocks.get(index)\n    if (b) {\n      b.processing = true\n      return\n    }\n\n    const h = this._hashes.get(index)\n    if (h) h.processing = true\n  }\n\n  _markProcessed(index) {\n    const b = this._blocks.get(index)\n    if (b) return b.processed()\n\n    const h = this._hashes.get(index)\n    if (h) h.processed()\n  }\n\n  _markInflight(index) {\n    if (this.core.skipBitfield !== null) this.core.skipBitfield.set(index, true)\n    for (const peer of this.peers) peer._markInflight(index)\n  }\n\n  _unmarkInflight(index) {\n    if (this.core.skipBitfield !== null) {\n      this.core.skipBitfield.set(index, this.core.bitfield.get(index))\n    }\n    for (const peer of this.peers) peer._resetMissingBlock(index)\n  }\n\n  _ondata(peer, req, data) {\n    if (req) {\n      req.elapsed = Date.now() - req.timestamp\n    }\n\n    if (data.block !== null) {\n      this._resolveBlockRequest(this._blocks, data.block.index, data.block.value, req)\n      this._ondownload(data.block.index, data.block.value.byteLength, peer, req)\n    }\n\n    if (data.hash !== null && (data.hash.index & 1) === 0) {\n      this._resolveBlockRequest(this._hashes, data.hash.index / 2, null, req)\n    }\n\n    if (this._upgrade !== null) {\n      this._resolveUpgradeRequest(req)\n    }\n\n    if (this._seeks.length > 0) {\n      this._clearInflightSeeks(req)\n    }\n\n    if (this._reorgs.length > 0) {\n      this._clearInflightReorgs(req)\n    }\n\n    if (this._manifestPeer === peer && this.core.header.manifest !== null) {\n      this._manifestPeer = null\n    }\n\n    if (this._seeks.length > 0 || this._ranges.length > 0) {\n      this._updateNonPrimary(this._seeks.length > 0)\n    }\n\n    this.updatePeer(peer)\n  }\n\n  _onwant(peer, start, length, any) {\n    if (!peer.isActive()) return\n\n    const contig = Math.min(this.core.state.length, this.core.header.hints.contiguousLength)\n\n    if (start + length < contig || this.core.state.length === contig || (any && start < contig)) {\n      peer.wireRange.send({\n        drop: false,\n        start: 0,\n        length: contig\n      })\n      incrementTx(peer.stats.wireRange, this.stats.wireRange)\n      return\n    }\n\n    length = Math.min(length, this.core.state.length - start)\n\n    if (any) {\n      const bit = this.core.bitfield.firstSet(start)\n      if (bit > -1 && bit < start + length) {\n        peer.wireRange.send({\n          drop: false,\n          start: bit,\n          length: 1\n        })\n      }\n      return\n    }\n\n    for (const msg of this.core.bitfield.want(start, length)) {\n      peer.wireBitfield.send(msg)\n      incrementTx(peer.stats.wireBitfield, this.stats.wireBitfield)\n    }\n  }\n\n  async _onreorgdata(peer, req, data) {\n    const newBatch = data.upgrade && (await this.core.verifyReorg(data))\n    const f = this._addReorg(data.fork, peer)\n\n    if (f === null) {\n      this.updateAll()\n      return\n    }\n\n    removeInflight(f.inflight, req)\n\n    if (f.batch) {\n      await f.batch.update(data)\n    } else if (data.upgrade) {\n      f.batch = newBatch\n\n      // Remove \"older\" reorgs in progress as we just verified this one.\n      this._clearOldReorgs(f.fork)\n    }\n\n    if (f.batch && f.batch.finished) {\n      if (this._addUpgradeMaybe() !== null) {\n        await this._applyReorg(f)\n      }\n    }\n\n    this.updateAll()\n  }\n\n  // Never throws, allowed to run in the background\n  async _applyReorg(f) {\n    // TODO: more optimal here to check if potentially a better reorg\n    // is available, ie higher fork, and request that one first.\n    // This will request that one after this finishes, which is fine, but we\n    // should investigate the complexity in going the other way\n\n    const u = this._upgrade\n    const old = this._reorgs\n\n    this._reorgs = [] // clear all as the nodes are against the old tree - easier\n    this._applyingReorg = this.core.reorg(f.batch, null) // TODO: null should be the first/last peer?\n\n    try {\n      await this._applyingReorg\n    } catch (err) {\n      this._upgrade = null\n      u.reject(err)\n    }\n\n    this._applyingReorg = null\n\n    if (this._upgrade !== null) {\n      this._resolveUpgradeRequest(null)\n    }\n\n    for (const peer of this.peers) this._updateFork(peer)\n\n    // TODO: all the remaining is a tmp workaround until we have a flag/way for ANY_FORK\n    for (const r of this._ranges) {\n      r.start = r.userStart\n      r.end = r.userEnd\n    }\n\n    for (const f of old) f.resolve()\n    f.resolve()\n\n    this.updateAll()\n  }\n\n  _maybeUpdate() {\n    return this._upgrade !== null && this._upgrade.inflight.length === 0\n  }\n\n  _maybeRequestManifest() {\n    return this.core.header.manifest === null && this._manifestPeer === null\n  }\n\n  _updateFork(peer) {\n    if (\n      this._applyingReorg !== null ||\n      this.allowFork === false ||\n      peer.remoteFork <= this.core.state.fork\n    ) {\n      return false\n    }\n\n    const f = this._addReorg(peer.remoteFork, peer)\n\n    // TODO: one per peer is better\n    if (f !== null && f.batch === null && f.inflight.length === 0) {\n      return peer._requestForkProof(f)\n    }\n\n    return false\n  }\n\n  _updateHotswap(peer) {\n    const maxHotswaps = peer.getMaxHotswapInflight()\n    if (!peer.isActive() || peer.inflight >= maxHotswaps) return\n\n    for (const b of this.hotswaps.pick(peer)) {\n      if (peer._requestBlock(b) === false) continue\n      peer.stats.hotswaps++\n      peer.replicator.stats.hotswaps++\n      if (peer.inflight >= maxHotswaps) break\n    }\n  }\n\n  _updatePeer(peer) {\n    if (!peer.isActive() || peer.inflight >= peer.getMaxInflight() || !peer.remoteUploading) {\n      return false\n    }\n\n    // Eagerly request the manifest even if the remote length is 0. If not 0 we'll get as part of the upgrade request...\n    if (\n      this._maybeRequestManifest() === true &&\n      peer.remoteLength === 0 &&\n      peer.remoteHasManifest === true\n    ) {\n      this._manifestPeer = peer\n      peer._requestManifest()\n    }\n\n    for (const s of this._seeks) {\n      if (s.inflight.length > 0) continue // TODO: one per peer is better\n      if (peer._requestSeek(s) === true) {\n        return true\n      }\n    }\n\n    // Implied that any block in the queue should be requested, no matter how many inflights\n    const blks = new RandomIterator(this._queued)\n\n    for (const b of blks) {\n      if (b.queued === false || peer._requestBlock(b) === true) {\n        b.queued = false\n        blks.dequeue()\n        return true\n      }\n    }\n\n    return false\n  }\n\n  _updatePeerNonPrimary(peer) {\n    if (!peer.isActive() || peer.inflight >= peer.getMaxInflight() || !peer.remoteUploading) {\n      return false\n    }\n\n    const ranges = new RandomIterator(this._ranges)\n    let tried = 0\n\n    for (const r of ranges) {\n      if (peer._requestRange(r) === true) {\n        return true\n      }\n      if (++tried >= MAX_RANGES) break\n    }\n\n    // Iterate from newest fork to oldest fork...\n    for (let i = this._reorgs.length - 1; i >= 0; i--) {\n      const f = this._reorgs[i]\n      if (f.batch !== null && f.inflight.length === 0 && peer._requestForkRange(f) === true) {\n        return true\n      }\n    }\n\n    if (this._maybeUpdate() === true && peer._requestUpgrade(this._upgrade) === true) {\n      return true\n    }\n\n    return false\n  }\n\n  updatePeer(peer) {\n    // Quick shortcut to wait for flushing reorgs - not needed but less waisted requests\n    if (this._applyingReorg !== null) return\n\n    while (this._updatePeer(peer) === true);\n    while (this._updatePeerNonPrimary(peer) === true);\n\n    if (this.peers.length > 1 && this._blocks.isEmpty() === false) {\n      this._updateHotswap(peer)\n    }\n\n    this._checkUpgradeIfAvailable()\n    this._maybeResolveIfAvailableRanges()\n  }\n\n  updateAll() {\n    // Quick shortcut to wait for flushing reorgs - not needed but less waisted requests\n    if (this._applyingReorg !== null) return\n\n    const peers = new RandomIterator(this.peers)\n\n    for (const peer of peers) {\n      if (this._updatePeer(peer) === true) {\n        peers.requeue()\n      }\n    }\n\n    // Check if we can skip the non primary check fully\n    if (this._maybeUpdate() === false && this._ranges.length === 0 && this._reorgs.length === 0) {\n      this._checkUpgradeIfAvailable()\n      return\n    }\n\n    for (const peer of peers.restart()) {\n      if (this._updatePeerNonPrimary(peer) === true) {\n        peers.requeue()\n      }\n    }\n\n    this._checkUpgradeIfAvailable()\n    this._maybeResolveIfAvailableRanges()\n  }\n\n  onpeerdestroy() {\n    if (--this._active === 0) this.core.checkIfIdle()\n  }\n\n  attached(protomux) {\n    return this._attached.has(protomux)\n  }\n\n  attachTo(protomux) {\n    if (this.core.closed) return\n\n    const makePeer = this._makePeer.bind(this, protomux)\n\n    this._attached.add(protomux)\n    protomux.pair({ protocol: 'hypercore/alpha', id: this.core.discoveryKey }, makePeer)\n    protomux.stream.setMaxListeners(0)\n    protomux.stream.on('close', this._onstreamclose)\n\n    this._ifAvailable++\n    this._active++\n\n    protomux.stream.opened.then((opened) => {\n      this._ifAvailable--\n      this._active--\n\n      if (opened && !this.destroyed) makePeer()\n      this._checkUpgradeIfAvailable()\n\n      this.core.checkIfIdle()\n    })\n  }\n\n  detachFrom(protomux) {\n    if (this._attached.delete(protomux)) {\n      protomux.stream.removeListener('close', this._onstreamclose)\n      protomux.unpair({ protocol: 'hypercore/alpha', id: this.core.discoveryKey })\n    }\n  }\n\n  idle() {\n    return this.peers.length === 0 && this._active === 0\n  }\n\n  close() {\n    const waiting = []\n\n    for (const peer of this.peers) {\n      waiting.push(peer.channel.fullyClosed())\n    }\n\n    this.destroy()\n    return Promise.all(waiting)\n  }\n\n  destroy() {\n    if (this.destroyed) return\n    this.destroyed = true\n\n    if (this._notDownloadingTimer) {\n      clearTimeout(this._notDownloadingTimer)\n      this._notDownloadingTimer = null\n    }\n\n    while (this.peers.length) {\n      const peer = this.peers[this.peers.length - 1]\n      this.detachFrom(peer.protomux)\n      peer.channel.close() // peer is removed from array in onclose\n    }\n\n    for (const protomux of this._attached) {\n      this.detachFrom(protomux)\n    }\n  }\n\n  _makePeer(protomux) {\n    const replicator = this\n    if (protomux.opened({ protocol: 'hypercore/alpha', id: this.core.discoveryKey })) {\n      return onnochannel()\n    }\n\n    const channel = protomux.createChannel({\n      userData: null,\n      protocol: 'hypercore/alpha',\n      aliases: ['hypercore'],\n      id: this.core.discoveryKey,\n      handshake: m.wire.handshake,\n      messages: [\n        { encoding: m.wire.sync, onmessage: onwiresync },\n        { encoding: m.wire.request, onmessage: onwirerequest },\n        { encoding: m.wire.cancel, onmessage: onwirecancel },\n        { encoding: m.wire.data, onmessage: onwiredata },\n        { encoding: m.wire.noData, onmessage: onwirenodata },\n        { encoding: m.wire.want, onmessage: onwirewant },\n        { encoding: m.wire.unwant, onmessage: onwireunwant },\n        { encoding: m.wire.bitfield, onmessage: onwirebitfield },\n        { encoding: m.wire.range, onmessage: onwirerange },\n        { encoding: m.wire.extension, onmessage: onwireextension }\n      ],\n      onopen: onwireopen,\n      onclose: onwireclose,\n      ondrain: onwiredrain,\n      ondestroy: onwiredestroy\n    })\n\n    if (channel === null) return onnochannel()\n\n    const peer = new Peer(replicator, protomux, channel, this.inflightRange)\n    const stream = protomux.stream\n\n    peer.channel.open({\n      seeks: true,\n      capability: caps.replicate(stream.isInitiator, this.core.key, stream.handshakeHash)\n    })\n\n    return true\n\n    function onnochannel() {\n      return false\n    }\n  }\n\n  _onpeerupdate(added, peer) {\n    const name = added ? 'peer-add' : 'peer-remove'\n    const sessions = this.core.monitors\n\n    for (let i = sessions.length - 1; i >= 0; i--) {\n      sessions[i].emit(name, peer)\n\n      if (added) {\n        for (const ext of sessions[i].extensions.values()) {\n          peer.extensions.set(ext.name, ext)\n        }\n      }\n    }\n  }\n\n  _ondownload(index, byteLength, from, req) {\n    const sessions = this.core.monitors\n\n    for (let i = sessions.length - 1; i >= 0; i--) {\n      const s = sessions[i]\n      s.emit('download', index, byteLength - s.padding, from, req)\n    }\n  }\n\n  _onupload(index, byteLength, from) {\n    const sessions = this.core.monitors\n\n    for (let i = sessions.length - 1; i >= 0; i--) {\n      const s = sessions[i]\n      s.emit('upload', index, byteLength - s.padding, from)\n    }\n  }\n\n  _oninvaliddata(err, req, res, from) {\n    const sessions = this.core.monitors\n\n    this.stats.invalidData++\n    from.stats.invalidData++\n    for (let i = 0; i < sessions.length; i++) {\n      sessions[i].emit('verification-error', err, req, res, from)\n    }\n  }\n\n  _oninvalidrequest(err, req, from) {\n    const sessions = this.core.monitors\n\n    from.stats.invalidRequests++\n    this.stats.invalidRequests++\n    for (let i = 0; i < sessions.length; i++) {\n      sessions[i].emit('invalid-request', err, req, from)\n    }\n  }\n}\n\nfunction removeHotswap(block) {\n  if (block.hotswap === null) return false\n  block.hotswap.ref.remove(block)\n  return true\n}\n\nfunction removeInflight(inf, req) {\n  const i = inf.indexOf(req)\n  if (i === -1) return false\n  if (i < inf.length - 1) inf[i] = inf.pop()\n  else inf.pop()\n  return true\n}\n\nfunction toLength(start, end) {\n  return end === -1 ? -1 : end < start ? 0 : end - start\n}\n\nfunction clampRange(core, r) {\n  if (r.blocks === null) {\n    const start = core.bitfield.firstUnset(r.start)\n\n    if (r.end === -1) r.start = start === -1 ? core.state.length : start\n    else if (start === -1 || start >= r.end) r.start = r.end\n    else {\n      r.start = start\n\n      const end = core.bitfield.lastUnset(r.end - 1)\n\n      if (end === -1 || start >= end + 1) r.end = r.start\n      else r.end = end + 1\n    }\n  } else {\n    while (r.start < r.end && core.bitfield.get(r.blocks[r.start])) r.start++\n    while (r.start < r.end && core.bitfield.get(r.blocks[r.end - 1])) r.end--\n  }\n}\n\nfunction onrequesttimeout(req) {\n  if (req.context) req.context.detach(req, REQUEST_TIMEOUT())\n}\n\nfunction destroyRequestTimeout(req) {\n  if (req.timeout !== null) {\n    clearTimeout(req.timeout)\n    req.timeout = null\n  }\n}\n\nfunction isCriticalError(err) {\n  // TODO: expose .critical or similar on the hypercore errors that are critical (if all not are)\n  return err.name === 'HypercoreError'\n}\n\nfunction onwireopen(m, c) {\n  return c.userData.onopen(m)\n}\n\nfunction onwireclose(isRemote, c) {\n  return c.userData.onclose(isRemote)\n}\n\nfunction onwiredestroy(c) {\n  c.userData.replicator.onpeerdestroy()\n}\n\nfunction onwiredrain(c) {\n  return c.userData.ondrain()\n}\n\nfunction onwiresync(m, c) {\n  incrementRx(c.userData.stats.wireSync, c.userData.replicator.stats.wireSync)\n  return c.userData.onsync(m)\n}\n\nfunction onwirerequest(m, c) {\n  incrementRx(c.userData.stats.wireRequest, c.userData.replicator.stats.wireRequest)\n  return c.userData.onrequest(m)\n}\n\nfunction onwirecancel(m, c) {\n  incrementRx(c.userData.stats.wireCancel, c.userData.replicator.stats.wireCancel)\n  return c.userData.oncancel(m)\n}\n\nfunction onwiredata(m, c) {\n  incrementRx(c.userData.stats.wireData, c.userData.replicator.stats.wireData)\n  return c.userData.ondata(m)\n}\n\nfunction onwirenodata(m, c) {\n  return c.userData.onnodata(m)\n}\n\nfunction onwirewant(m, c) {\n  incrementRx(c.userData.stats.wireWant, c.userData.replicator.stats.wireWant)\n  return c.userData.onwant(m)\n}\n\nfunction onwireunwant(m, c) {\n  return c.userData.onunwant(m)\n}\n\nfunction onwirebitfield(m, c) {\n  incrementRx(c.userData.stats.wireBitfield, c.userData.replicator.stats.wireBitfield)\n  return c.userData.onbitfield(m)\n}\n\nfunction onwirerange(m, c) {\n  incrementRx(c.userData.stats.wireRange, c.userData.replicator.stats.wireRange)\n  return c.userData.onrange(m)\n}\n\nfunction onwireextension(m, c) {\n  incrementRx(c.userData.stats.wireExtension, c.userData.replicator.stats.wireExtension)\n  return c.userData.onextension(m)\n}\n\nfunction setNotDownloadingLater(repl, session) {\n  repl._setDownloadingNow(false, session)\n}\n\nfunction isBlockRequest(req) {\n  return req !== null && req.block !== null\n}\n\nfunction isUpgradeRequest(req) {\n  return req !== null && req.upgrade !== null\n}\n\nfunction incrementTx(stats1, stats2) {\n  stats1.tx++\n  stats2.tx++\n}\n\nfunction incrementRx(stats1, stats2) {\n  stats1.rx++\n  stats2.rx++\n}\n\nfunction noop() {}\n\nfunction backoff(times) {\n  const sleep = times < 2 ? 200 : times < 5 ? 500 : times < 40 ? 1000 : 5000\n  return new Promise((resolve) => setTimeout(resolve, sleep))\n}\nconst crypto = require('hypercore-crypto')\nconst b4a = require('b4a')\nconst assert = require('nanoassert')\nconst flat = require('flat-tree')\nconst quickbit = require('quickbit-universal')\n\nconst { INVALID_OPERATION, INVALID_SIGNATURE } = require('hypercore-errors')\n\nconst Mutex = require('./mutex')\nconst Bitfield = require('./bitfield')\nconst { MerkleTree, MerkleTreeBatch } = require('./merkle-tree')\n\nmodule.exports = class SessionState {\n  constructor(core, parent, storage, treeInfo, name) {\n    this.core = core\n    this.index = this.core.sessionStates.push(this) - 1\n\n    this.storage = storage\n    this.name = name\n    this.sessions = []\n\n    // small hack to close old storages as late as possible.\n    // TODO: add a read lock so we can avoid that\n    this.lingers = null\n\n    this.parent = parent\n    this.atomized = null\n    this.mutex = new Mutex()\n\n    // merkle state\n    this.roots = treeInfo.roots.length ? treeInfo.roots : []\n    this.fork = treeInfo.fork || 0\n    this.length = MerkleTree.span(this.roots) / 2\n    this.byteLength = MerkleTree.size(this.roots)\n    this.prologue = treeInfo.prologue || null\n    this.signature = treeInfo.signature || null\n\n    this.snapshotCompatLength = this.isSnapshot()\n      ? Math.min(this.length, this.core.state.length)\n      : -1\n    this.lastTruncation = null\n\n    this.active = 0\n\n    this._activeTx = null\n    this._pendingBitfield = null\n\n    this.ref()\n  }\n\n  isSnapshot() {\n    return this.storage.snapshotted\n  }\n\n  isDefault() {\n    return this.core.state === this || this.isAtomicDefault()\n  }\n\n  isAtomicDefault() {\n    return !!this.storage.atom && !!this.parent && this.parent.isDefault()\n  }\n\n  createTreeBatch() {\n    return new MerkleTreeBatch(this)\n  }\n\n  addSession(s) {\n    if (s._stateIndex !== -1) return\n    s._stateIndex = this.sessions.push(s) - 1\n    if (s.weak === false) this.core.activeSessions++\n  }\n\n  removeSession(s) {\n    if (s._stateIndex === -1) return\n    const head = this.sessions.pop()\n    if (head !== s) this.sessions[(head._stateIndex = s._stateIndex)] = head\n    s._stateIndex = -1\n    if (s.weak === false) this.core.activeSessions--\n    this.core.checkIfIdle()\n  }\n\n  flushedLength() {\n    if (this.isDefault() || this.isSnapshot()) return this.length\n    const deps = this.storage.dependencies\n    if (deps.length) return deps[deps.length - 1].length\n    return 0\n  }\n\n  signedLength() {\n    const l = Math.min(this.flushedLength(), this.core.state.length)\n    return this.isSnapshot() && l > this.snapshotCompatLength ? this.snapshotCompatLength : l\n  }\n\n  unref() {\n    if (--this.active > 0) return\n    this.close().catch(noop) // technically async, but only for the last db session\n  }\n\n  ref() {\n    this.active++\n    return this\n  }\n\n  hash() {\n    return MerkleTree.hash(this)\n  }\n\n  setRoots(roots) {\n    this.roots = roots\n    this.length = MerkleTree.span(roots) / 2\n    this.byteLength = MerkleTree.size(roots)\n  }\n\n  get encryptionFork() {\n    return this.core.header.tree.fork\n  }\n\n  async updateSnapshotStorage(storage) {\n    if (!this.atomized || !this.atomized.flushing) return this.treeInfo()\n    await this.atomized.flushed()\n\n    let rx = storage.read()\n    const headPromise = rx.getHead()\n    const authPromise = rx.getAuth()\n    const depPromise = rx.getDependency()\n\n    rx.tryFlush()\n    const [head, auth, dep] = await Promise.all([headPromise, authPromise, depPromise])\n\n    storage.setDependencyHead(dep)\n\n    const fork = head ? head.fork : 0\n    const length = head ? head.length : 0\n\n    rx = storage.read()\n    const rootPromises = []\n    for (const r of flat.fullRoots(length * 2)) {\n      rootPromises.push(rx.getTreeNode(r))\n    }\n\n    rx.tryFlush()\n\n    const roots = await Promise.all(rootPromises)\n\n    // dbl check if we are hitting an regression from earler\n    for (const root of roots) {\n      if (root === null) {\n        throw new Error(\n          'Bad snapshot from atomized session, id = ' +\n            this.core.id +\n            ' length = ' +\n            length +\n            ' fork = ' +\n            fork\n        )\n      }\n    }\n\n    return {\n      fork,\n      roots,\n      length,\n      prologue: auth.manifest && auth.manifest.prologue,\n      signature: head && head.signature\n    }\n  }\n\n  treeInfo() {\n    return {\n      fork: this.fork,\n      roots: this.roots.slice(),\n      length: this.length,\n      prologue: this.prologue,\n      signature: this.signature\n    }\n  }\n\n  async close() {\n    if (this.index === -1) return\n\n    this.active = 0\n    this.mutex.destroy(new Error('Closed')).catch(noop)\n    if (this.parent && this.parent.atomized) this.parent.atomized = null\n\n    const closing = this.storage.close()\n\n    const head = this.core.sessionStates.pop()\n    if (head !== this) this.core.sessionStates[(head.index = this.index)] = head\n\n    this.index = -1\n    this.core.checkIfIdle()\n\n    if (this.lingers !== null) {\n      for (const storage of this.lingers) await storage.close()\n    }\n\n    return closing\n  }\n\n  async snapshot() {\n    const storage = this.storage.snapshot()\n    const treeInfo = await this.updateSnapshotStorage(storage)\n\n    const s = new SessionState(this.core, null, storage, treeInfo, this.name)\n\n    return s\n  }\n\n  updateDependency(tx, length) {\n    const dependency = updateDependency(this, length, false)\n    if (dependency) tx.setDependency(dependency)\n    return dependency\n  }\n\n  _clearActiveBatch() {\n    this._activeTx = null\n  }\n\n  createWriteBatch() {\n    assert(!this._activeTx && !this.storage.snapshotted)\n\n    this._activeTx = this.storage.write()\n    return this._activeTx\n  }\n\n  _unlock() {\n    this._clearActiveBatch()\n    this.mutex.unlock()\n    this.core.checkIfIdle()\n  }\n\n  async flush() {\n    const tx = this._activeTx\n    this._activeTx = null\n\n    try {\n      if (!(await tx.flush())) return false\n    } finally {\n      this._clearActiveBatch()\n    }\n\n    this.lastTruncation = null\n    return true\n  }\n\n  _precommit() {\n    this.commiting = true\n  }\n\n  async _commit() {\n    await this.mutex.lock()\n\n    try {\n      const bitfield = this._pendingBitfield\n      this._pendingBitfield = null\n      this.lastTruncation = null\n      await this.parent._oncommit(this, bitfield)\n    } finally {\n      this.commiting = false\n      this.mutex.unlock()\n    }\n  }\n\n  async _oncommit(src, bitfield) {\n    await this.mutex.lock()\n\n    try {\n      const currLength = this.length\n\n      // load dependency into memory\n      const rx = this.storage.read()\n      const dependencyPromise = rx.getDependency()\n\n      rx.tryFlush()\n\n      const dependency = await dependencyPromise\n\n      this.fork = src.fork\n      this.length = src.length\n      this.byteLength = src.byteLength\n      this.roots = src.roots.slice()\n      this.signature = src.signature\n\n      const tree = {\n        fork: this.fork,\n        length: this.length,\n        rootHash: this.hash(),\n        signature: this.signature\n      }\n\n      if (dependency) this.storage.setDependencyHead(dependency)\n\n      const b = bitfield\n\n      if (b && b.truncated && b.start < currLength) {\n        this.ontruncate(tree, b.start, currLength, true)\n        if (!b || b.appends === 0) return\n      }\n\n      const append = b ? { start: b.start, length: b.appends, drop: false } : null\n\n      this.onappend(tree, append, true)\n\n      if (this.core.hintsChanged && this.isDefault()) await this.core.flushHints()\n    } finally {\n      this.mutex.unlock()\n      this.core.checkIfIdle()\n    }\n  }\n\n  async setUserData(key, value) {\n    await this.mutex.lock()\n\n    try {\n      const tx = this.createWriteBatch()\n      tx.putUserData(key, value)\n\n      return await this.flush()\n    } finally {\n      this._unlock()\n    }\n  }\n\n  async _verifyBlock(batch, bitfield, value, manifest, from) {\n    await this.mutex.lock()\n\n    try {\n      if (batch.upgraded && batch.length <= this.length) {\n        await batch.downgrade()\n      }\n\n      if (!batch.commitable()) {\n        return false\n      }\n\n      if (this.core.preupdate !== null) {\n        await this.core.preupdate(batch, this.core.header.key)\n      }\n\n      const tx = this.createWriteBatch()\n      this.updating = true\n\n      if (bitfield) {\n        tx.putBlock(bitfield.start, value)\n      }\n\n      if (bitfield && this.isDefault()) {\n        await storeBitfieldRange(this.storage, tx, bitfield.start, bitfield.start + 1, true)\n      }\n\n      if (manifest) this.core._setManifest(tx, manifest, null)\n\n      assert(batch.commitable(), 'Should still be commitable')\n      batch.commit(tx)\n\n      const head = {\n        fork: batch.fork,\n        length: batch.length,\n        rootHash: batch.hash(),\n        signature: batch.signature\n      }\n\n      if (batch.upgraded) tx.setHead(head)\n\n      const flushed = await this.flush()\n\n      if (batch.upgraded) {\n        this.roots = batch.roots\n        this.length = batch.length\n        this.byteLength = batch.byteLength\n        this.fork = batch.fork\n        this.signature = batch.signature\n\n        this.onappend(head, bitfield, flushed)\n      }\n\n      if (this.core.hintsChanged && this.isDefault()) await this.core.flushHints()\n    } finally {\n      this._clearActiveBatch()\n      this.updating = false\n      this.mutex.unlock()\n    }\n\n    return true\n  }\n\n  async truncate(length, fork, { signature, keyPair } = {}) {\n    if (!keyPair && this.isDefault()) keyPair = this.core.header.keyPair\n\n    await this.mutex.lock()\n\n    try {\n      if (this.prologue && length < this.prologue.length) {\n        throw INVALID_OPERATION('Truncation breaks prologue', this.core.discoveryKey)\n      }\n      if (length > this.length) {\n        throw INVALID_OPERATION(\n          'Not a truncation, ' + length + ' must be less or equal to ' + this.length,\n          this.core.discoveryKey\n        )\n      }\n\n      const batch = this.createTreeBatch()\n      await MerkleTree.truncate(this, length, batch, fork)\n\n      if (!signature && keyPair && length > 0) signature = this.core.verifier.sign(batch, keyPair)\n      if (signature) batch.signature = signature\n\n      const tx = this.createWriteBatch()\n\n      // upsert compat manifest\n      if (this.core.verifier === null && keyPair) this.core._setManifest(tx, null, keyPair)\n\n      const { dependency, tree, roots } = await this._truncate(tx, batch)\n\n      for (const sessionState of this.core.sessionStates) {\n        if (\n          sessionState.isSnapshot() &&\n          sessionState.name === this.name &&\n          length < sessionState.snapshotCompatLength\n        ) {\n          sessionState.snapshotCompatLength = length\n        }\n      }\n\n      const flushed = await this.flush()\n\n      this.fork = tree.fork\n      this.length = tree.length\n      this.byteLength = MerkleTree.size(roots)\n      this.roots = roots\n      this.signature = tree.signature\n\n      if (dependency) this.storage.setDependencyHead(dependency)\n\n      this.ontruncate(tree, tree.length, batch.treeLength, flushed)\n\n      if (this.core.hintsChanged && this.isDefault()) await this.core.flushHints()\n    } finally {\n      this._unlock()\n    }\n  }\n\n  async reorg(batch) {\n    await this.mutex.lock()\n\n    const storage = this.createWriteBatch()\n\n    try {\n      if (!batch.commitable()) return false\n\n      const { dependency, tree } = await this._truncate(storage, batch)\n\n      const flushed = await this.flush()\n\n      this.fork = batch.fork\n      this.length = batch.length\n      this.byteLength = batch.byteLength\n      this.roots = batch.roots\n      this.signature = batch.signature\n\n      if (dependency) this.storage.setDependencyHead(dependency)\n\n      this.ontruncate(tree, batch.ancestors, batch.treeLength, flushed)\n\n      if (this.core.hintsChanged && this.isDefault()) await this.core.flushHints()\n    } finally {\n      this._unlock()\n    }\n  }\n\n  async _truncate(storage, batch) {\n    storage.deleteBlockRange(batch.ancestors, batch.treeLength)\n\n    assert(batch.commitable(), 'Batch must be commitable')\n\n    const tree = {\n      fork: batch.fork,\n      length: batch.length,\n      rootHash: batch.hash(),\n      signature: batch.signature\n    }\n\n    storage.setHead(tree)\n    batch.commit(storage)\n\n    const truncated = batch.length < this.flushedLength()\n    const dependency = truncated ? updateDependency(this, batch.length, true) : null\n\n    if (dependency) storage.setDependency(dependency)\n\n    if (this.isDefault()) {\n      await storeBitfieldRange(this.storage, storage, batch.ancestors, batch.treeLength, false)\n      if (batch.ancestors < this.core.header.hints.contiguousLength) {\n        this.core.header.hints.remoteContiguousLength = Math.min(\n          batch.length,\n          this.core.header.hints.remoteContiguousLength\n        )\n        storage.setHints({\n          contiguousLength: batch.ancestors,\n          remoteContiguousLength: this.core.header.hints.remoteContiguousLength\n        })\n      }\n    }\n\n    return { dependency, tree, roots: batch.roots }\n  }\n\n  async clear(start, end, cleared) {\n    await this.mutex.lock()\n\n    try {\n      const tx = this.createWriteBatch()\n\n      const ite = flat.iterator(start * 2)\n      while (!isRootIndex(ite.index, this.roots)) {\n        const a = ite.index\n        const b = ite.sibling()\n        ite.parent()\n\n        const [left, right] = flat.spans(b)\n        const s = left / 2\n        const e = right / 2 + 1\n        const has = s <= start && e <= end ? false : this.core.bitfield.hasSet(s, e - s)\n        if (has) break\n\n        tx.deleteTreeNode(a)\n        tx.deleteTreeNode(b)\n      }\n\n      if (this.isDefault()) {\n        await storeBitfieldRange(this.storage, tx, start, end, false)\n        if (start < this.core.header.hints.contiguousLength) {\n          tx.setHints({\n            contiguousLength: start,\n            remoteContiguousLength: this.core.header.hints.remoteContiguousLength\n          })\n        }\n      }\n\n      if (end - start === 1) tx.deleteBlock(start)\n      else tx.deleteBlockRange(start, end)\n\n      const dependency = start < this.flushedLength() ? updateDependency(this, start, true) : null\n\n      const flushed = await this.flush()\n\n      if (dependency) this.storage.setDependencyHead(dependency)\n\n      // todo: atomic event handle\n      if (this.isDefault() && flushed) {\n        const length = end - start\n\n        this.core.updateContiguousLength({ start, length, drop: true })\n        this.core._setBitfieldRanges(start, end, false)\n        this.core.replicator.onhave(start, length, true)\n\n        if (this.core.hintsChanged) await this.core.flushHints()\n      }\n    } finally {\n      this._unlock()\n    }\n  }\n\n  async append(values, { signature, keyPair, preappend, postappend, maxLength = -1 } = {}) {\n    if (!keyPair && this.isDefault()) keyPair = this.core.header.keyPair\n\n    await this.mutex.lock()\n\n    try {\n      if (maxLength >= 0 && this.length + values.length > maxLength) {\n        return { length: this.length, byteLength: this.byteLength }\n      }\n\n      const tx = this.createWriteBatch()\n\n      // upsert compat manifest\n      if (this.core.verifier === null && keyPair) this.core._setManifest(tx, null, keyPair)\n\n      if (preappend) await preappend(values)\n\n      if (!values.length) {\n        await this.flush()\n        return { length: this.length, byteLength: this.byteLength }\n      }\n\n      const batch = this.createTreeBatch()\n      for (const val of values) batch.append(val)\n\n      // only multisig can have prologue so signature is always present\n      if (this.prologue && batch.length < this.prologue.length) {\n        throw INVALID_OPERATION('Append is not consistent with prologue', this.core.discoveryKey)\n      }\n\n      if (!signature && keyPair) signature = this.core.verifier.sign(batch, keyPair)\n      if (signature) batch.signature = signature\n\n      batch.commit(tx)\n\n      const tree = {\n        fork: batch.fork,\n        length: batch.length,\n        rootHash: batch.hash(),\n        signature: batch.signature\n      }\n\n      tx.setHead(tree)\n\n      if (this.isDefault()) {\n        await storeBitfieldRange(this.storage, tx, batch.ancestors, batch.length, true)\n        if (this.length === this.core.header.hints.contiguousLength) {\n          tx.setHints({\n            contiguousLength: this.length + values.length,\n            remoteContiguousLength: this.core.header.hints.remoteContiguousLength\n          })\n        }\n      }\n\n      for (let i = 0; i < values.length; i++) {\n        tx.putBlock(this.length + i, values[i])\n      }\n\n      const bitfield = {\n        drop: false,\n        start: batch.ancestors,\n        length: values.length\n      }\n\n      const flushed = await this.flush()\n\n      this.fork = batch.fork\n      this.roots = batch.roots\n      this.length = batch.length\n      this.byteLength = batch.byteLength\n      this.signature = batch.signature\n\n      if (postappend) await postappend(values)\n\n      this.onappend(tree, bitfield, flushed)\n\n      if (this.core.hintsChanged && this.isDefault()) await this.core.flushHints()\n\n      return { length: this.length, byteLength: this.byteLength }\n    } finally {\n      this._unlock()\n    }\n  }\n\n  onappend(tree, bitfield, flushed) {\n    if (!flushed) this._updateBitfield(bitfield)\n    else if (this.isDefault()) this.core.onappend(tree, bitfield)\n\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      this.sessions[i].emit('append')\n    }\n  }\n\n  ontruncate(tree, to, from, flushed) {\n    const bitfield = { start: to, length: from - to, drop: true }\n\n    this.lastTruncation = { from, to }\n\n    if (!flushed) this._updateBitfield(bitfield)\n    else if (this.isDefault()) this.core.ontruncate(tree, bitfield)\n\n    for (const sessionState of this.core.sessionStates) {\n      if (\n        sessionState.isSnapshot() &&\n        sessionState.name === this.name &&\n        to < sessionState.snapshotCompatLength\n      ) {\n        sessionState.snapshotCompatLength = to\n      }\n    }\n\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      this.sessions[i].emit('truncate', to, tree.fork)\n    }\n  }\n\n  _updateBitfield(bitfield, flushed) {\n    if (!bitfield) return\n\n    const p = this._pendingBitfield\n    const b = bitfield\n\n    if (b.drop) {\n      // truncation must be from end\n      if (p && b.start + b.length !== p.start + p.appends) {\n        throw INVALID_OPERATION('Atomic truncations must be contiguous', this.core.discoveryKey)\n      }\n\n      // actual truncation\n      if (p === null || b.start < p.start) {\n        this._pendingBitfield = { truncated: true, start: b.start, appends: 0 }\n        return\n      }\n\n      // just clearing batch data\n      p.appends = b.start - p.start\n\n      // we cleared the current batch\n      if (p.appends === 0) this._pendingBitfield = null\n\n      return\n    }\n\n    if (p === null) {\n      this._pendingBitfield = { truncated: false, start: b.start, appends: b.length }\n      return\n    }\n\n    if (b.start !== p.start + p.appends) {\n      throw INVALID_OPERATION('Atomic operations must be contiguous', this.core.discoveryKey)\n    }\n\n    p.appends += b.length\n  }\n\n  async catchup(length) {\n    assert(!this.isDefault(), 'Cannot catchup signed state') // TODO: make this check better\n\n    await this.mutex.lock()\n\n    try {\n      const origLength = this.length\n\n      let sharedLength = 0\n      for (let i = this.storage.dependencies.length - 1; i >= 0; i--) {\n        const dep = this.storage.dependencies[i]\n        if (dep.dataPointer === this.core.state.storage.core.dataPointer) {\n          sharedLength = dep.length\n          break\n        }\n      }\n\n      const tx = this.createWriteBatch()\n      const rx = this.core.state.storage.read()\n      const rootPromises = []\n\n      for (const root of flat.fullRoots(length * 2)) {\n        rootPromises.push(rx.getTreeNode(root))\n      }\n\n      rx.tryFlush()\n\n      const roots = await Promise.all(rootPromises)\n      const truncating = sharedLength < origLength\n\n      for (const node of roots) {\n        if (node === null) {\n          throw INVALID_OPERATION(\n            'Invalid catchup length, tree nodes not available',\n            this.core.discoveryKey\n          )\n        }\n      }\n\n      const fork = truncating ? this.fork + 1 : this.fork\n\n      // overwrite it atm, TODO: keep what we can connect to the tree\n      tx.deleteBlockRange(0, -1)\n      tx.deleteTreeNodeRange(0, -1)\n      tx.deleteBitfieldPageRange(0, -1)\n\n      const tree = {\n        fork,\n        length,\n        rootHash: crypto.tree(roots),\n        signature: null\n      }\n\n      tx.setHead(tree)\n\n      // prop a better way to do this\n      const dep = updateDependency(this, sharedLength, true)\n      dep.length = length\n\n      tx.setDependency(dep)\n\n      const flushed = await this.flush()\n\n      this.storage.setDependencyHead(dep)\n\n      this.fork = tree.fork\n      this.roots = roots\n      this.length = tree.length\n      this.byteLength = MerkleTree.size(roots)\n\n      if (truncating) this.ontruncate(tree, sharedLength, origLength, flushed)\n      if (sharedLength < length) this.onappend(tree, null, flushed)\n\n      if (this.core.hintsChanged && this.isDefault()) await this.core.flushHints()\n    } finally {\n      this.mutex.unlock()\n    }\n  }\n\n  async _overwrite(source, fork, length, treeLength, signature) {\n    const blockPromises = []\n    const treePromises = []\n    const rootPromises = []\n\n    const rx = source.storage.read()\n\n    for (const root of flat.fullRoots(length * 2)) {\n      rootPromises.push(rx.getTreeNode(root))\n    }\n\n    for (const index of flat.patch(treeLength * 2, length * 2)) {\n      treePromises.push(rx.getTreeNode(index))\n    }\n\n    for (let i = treeLength; i < length; i++) {\n      treePromises.push(rx.getTreeNode(i * 2))\n      treePromises.push(rx.getTreeNode(i * 2 + 1))\n      blockPromises.push(rx.getBlock(i))\n    }\n\n    rx.tryFlush()\n\n    const blocks = await Promise.all(blockPromises)\n    const nodes = await Promise.all(treePromises)\n    const roots = await Promise.all(rootPromises)\n\n    if (this.core.destroyed) throw new Error('Core destroyed')\n\n    if (signature) {\n      const batch = this.createTreeBatch()\n      batch.roots = roots\n      batch.length = length\n\n      if (!this.core.verifier.verify(batch, signature)) {\n        throw INVALID_SIGNATURE(\n          'Signature is not valid over committed tree',\n          this.core.discoveryKey\n        )\n      }\n    }\n\n    const tx = this.createWriteBatch()\n\n    // truncate existing tree\n    if (treeLength < this.length) {\n      tx.deleteBlockRange(treeLength, this.length)\n    }\n\n    for (const root of roots) tx.putTreeNode(root)\n\n    // no nodes will be copied in shallow mode\n    for (const node of nodes) {\n      if (node !== null) tx.putTreeNode(node)\n    }\n\n    for (let i = 0; i < blocks.length; i++) {\n      assert(blocks[i] !== null, 'has block')\n      tx.putBlock(i + treeLength, blocks[i])\n    }\n\n    const totalLength = Math.max(length, this.length)\n\n    if (totalLength > treeLength) {\n      const firstPage = getBitfieldPage(treeLength)\n      const lastPage = getBitfieldPage(totalLength - 1)\n\n      const srx = this.storage.read()\n      const bitfieldPagePromise = srx.getBitfieldPage(firstPage)\n      srx.tryFlush()\n\n      const bitfieldPage = await bitfieldPagePromise\n\n      let index = treeLength\n\n      for (let i = firstPage; i <= lastPage; i++) {\n        const page = b4a.alloc(Bitfield.BYTES_PER_PAGE)\n        tx.putBitfieldPage(i, page)\n\n        // copy existing bits in\n        if (i === firstPage && bitfieldPage) page.set(bitfieldPage)\n\n        if (index < length) {\n          index = fillBitfieldPage(page, index, length, i, true)\n          if (index < length) continue\n        }\n\n        if (index < this.length) {\n          index = fillBitfieldPage(page, index, this.length, i, false)\n        }\n      }\n    }\n\n    const tree = {\n      fork,\n      length,\n      rootHash: crypto.tree(roots),\n      signature\n    }\n\n    const upgraded = treeLength < this.length || this.length < length || tree.fork !== this.fork\n\n    if (upgraded) tx.setHead(tree)\n\n    const flushed = await this.flush()\n\n    this.fork = tree.fork\n    this.roots = roots\n    this.length = length\n    this.byteLength = MerkleTree.size(roots)\n    this.signature = signature\n\n    return { tree, flushed }\n  }\n\n  async commit(state, { signature, keyPair, length = state.length, treeLength = -1 } = {}) {\n    assert(\n      this.isDefault() || (this.parent && this.parent.isDefault()),\n      'Can only commit into default state'\n    )\n\n    let srcLocked = false\n    await this.mutex.lock()\n\n    try {\n      await state.mutex.lock()\n      srcLocked = true\n\n      if (treeLength === -1) treeLength = state.flushedLength()\n\n      if (!(await this.core._validateCommit(state, treeLength))) return null\n      if (this.length > length) return null\n\n      if (this.length < length && !signature) {\n        if (!keyPair) keyPair = this.core.header.keyPair\n        const batch = state.createTreeBatch()\n        if (length !== batch.length) await batch.restore(length)\n        signature = this.core.verifier.sign(batch, keyPair)\n      }\n\n      const { tree, flushed } = await this._overwrite(\n        state,\n        this.fork,\n        length,\n        treeLength,\n        signature\n      )\n\n      // gc blocks from source\n      if (treeLength < length) {\n        const tx = state.createWriteBatch()\n\n        tx.deleteBlockRange(treeLength, length)\n        const dependency = state.updateDependency(tx, length)\n\n        await state.flush(tx)\n\n        if (dependency) state.storage.setDependencyHead(dependency)\n      }\n\n      const bitfield = { start: treeLength, length: length - treeLength, drop: false }\n      this.onappend(tree, bitfield, flushed)\n\n      return {\n        length: this.length,\n        byteLength: this.byteLength\n      }\n    } finally {\n      this.updating = false\n      this.mutex.unlock()\n\n      if (srcLocked) {\n        state.mutex.unlock()\n        state._clearActiveBatch()\n      }\n\n      this.core.checkIfIdle()\n    }\n  }\n\n  async _getTreeHeadAt(length) {\n    if (length === null) return this.treeInfo()\n\n    const head = getDefaultTree()\n\n    head.length = length\n\n    const roots = await MerkleTree.getRootsFromStorage(this.storage, length)\n    const rootHash = crypto.tree(roots)\n\n    head.fork = this.fork\n    head.rootHash = rootHash\n\n    if (length === this.length) head.signature = this.signature\n\n    return head\n  }\n\n  _moveToCore(core, truncated, appended) {\n    const head = this.core.sessionStates.pop()\n    if (head !== this) this.core.sessionStates[(head.index = this.index)] = head\n\n    this.core = core\n    this.index = this.core.sessionStates.push(this) - 1\n\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      const s = this.sessions[i]\n      const manifest = s.manifest\n      s.transferSession(this.core)\n      if (!manifest && s.manifest) s.emit('manifest')\n      if (truncated) s.emit('truncate', truncated.to, truncated.fork)\n      if (appended) s.emit('append')\n    }\n  }\n\n  async moveTo(core, length) {\n    const state = core.state\n\n    await this.mutex.lock()\n\n    try {\n      // if (state.storage && (await state.storage.resumeSession(this.name)) !== null) {\n      //   throw STORAGE_CONFLICT('Batch has already been created')\n      // }\n\n      const treeLength = this.length\n\n      let truncated = null\n      let appended = false\n\n      if (!this.isSnapshot()) {\n        if (this.lingers === null) this.lingers = []\n        this.lingers.push(this.storage)\n\n        const resumed = await state.storage.resumeSession(this.name)\n\n        const truncation = length < this.length ? await truncateAndFlush(this, length) : null\n        const treeInfo = truncation\n          ? truncation.tree\n          : resumed\n            ? null\n            : await state._getTreeHeadAt(this.length)\n\n        const fork = truncation ? this.fork + 1 : this.fork\n\n        // todo: validate treeInfo\n\n        let storage = null\n\n        if (resumed) {\n          storage = resumed\n        } else {\n          treeInfo.fork = fork\n          storage = await state.storage.createSession(this.name, treeInfo)\n        }\n\n        const roots = await MerkleTree.getRootsFromStorage(storage, length)\n\n        this.storage = storage\n        this.prologue = state.prologue\n        this.fork = fork\n        this.length = length\n        this.byteLength = MerkleTree.size(roots)\n        this.roots = roots\n\n        if (truncation) {\n          const { dependency } = truncation\n\n          if (dependency) this.storage.setDependencyHead(dependency)\n          truncated = { to: treeLength, fork }\n        }\n\n        if (this.length > treeLength) {\n          appended = true\n        }\n      }\n\n      for (let i = this.core.sessionStates.length - 1; i >= 0; i--) {\n        const state = this.core.sessionStates[i]\n        if (state === this) continue\n        if (state.name === this.name) state._moveToCore(core.core)\n      }\n\n      this._moveToCore(core.core, truncated, appended)\n    } finally {\n      this.mutex.unlock()\n    }\n  }\n\n  async createSession(name, overwrite, atom) {\n    let storage = null\n    let treeInfo = null\n\n    if (!atom && !overwrite && this.storage) {\n      storage = await this.storage.resumeSession(name)\n\n      if (storage !== null) treeInfo = (await getCoreHead(storage)) || getDefaultTree()\n    }\n\n    const length = treeInfo ? treeInfo.length : this.length\n\n    if (storage === null) {\n      treeInfo = await this._getTreeHeadAt(length)\n\n      if (atom) {\n        storage = await this.storage.createAtomicSession(atom, treeInfo)\n      } else {\n        storage = await this.storage.createSession(name, treeInfo)\n      }\n    }\n\n    if (this.atomized && atom) {\n      throw new Error('Session already atomized')\n    }\n\n    const head = {\n      fork: this.fork,\n      roots:\n        length === this.length\n          ? this.roots.slice()\n          : await MerkleTree.getRootsFromStorage(storage, length),\n      length,\n      prologue: this.prologue,\n      signature: length === this.length ? this.signature : null\n    }\n\n    const state = new SessionState(\n      this.core,\n      atom ? this : null,\n      storage,\n      head,\n      atom ? this.name : name\n    )\n\n    if (atom) {\n      this.atomized = atom\n      atom.onflush(state._commit.bind(state))\n    }\n\n    return state\n  }\n}\n\nfunction noop() {}\n\nfunction getBitfieldPage(index) {\n  return Math.floor(index / Bitfield.BITS_PER_PAGE)\n}\n\nfunction fillBitfieldPage(page, start, end, pageIndex, value) {\n  const offset = pageIndex * Bitfield.BITS_PER_PAGE\n  const max = offset + Bitfield.BITS_PER_PAGE\n\n  const index = max < end ? max : end\n\n  const from = start - offset\n  const to = index - offset\n\n  quickbit.fill(page, value, from, to)\n\n  return index\n}\n\nasync function storeBitfieldRange(storage, tx, from, to, value) {\n  if (from >= to) return\n\n  const firstPage = getBitfieldPage(from)\n  const lastPage = getBitfieldPage(to - 1)\n\n  let index = from\n\n  const rx = storage.read()\n\n  const promises = []\n  for (let i = firstPage; i <= lastPage; i++) {\n    promises.push(rx.getBitfieldPage(i))\n  }\n\n  rx.tryFlush()\n\n  const pages = await Promise.all(promises)\n  const cnt = lastPage - firstPage + 1\n\n  for (let i = 0; i < cnt; i++) {\n    const pageIndex = i + firstPage\n    if (!pages[i]) pages[i] = b4a.alloc(Bitfield.BYTES_PER_PAGE)\n\n    index = fillBitfieldPage(pages[i], index, to, pageIndex, value)\n    tx.putBitfieldPage(pageIndex, pages[i])\n  }\n}\n\nasync function truncateAndFlush(s, length) {\n  const batch = s.createTreeBatch()\n  await MerkleTree.truncate(s, length, batch, s.fork)\n  const tx = s.createWriteBatch()\n\n  const info = await s._truncate(tx, batch)\n  const flushed = await s.flush()\n\n  return {\n    tree: info.tree,\n    roots: info.roots,\n    dependency: info.dependency,\n    flushed\n  }\n}\n\nfunction updateDependency(state, length, truncated) {\n  const i = state.storage.findDependencyIndex(length, truncated)\n  if (i === -1) return null // skip default state and overlays of default\n\n  return {\n    dataPointer: state.storage.dependencies[i].dataPointer,\n    length\n  }\n}\n\nfunction getDefaultTree() {\n  return {\n    fork: 0,\n    length: 0,\n    rootHash: null,\n    signature: null\n  }\n}\n\nfunction getCoreHead(storage) {\n  const b = storage.read()\n  const p = b.getHead()\n  b.tryFlush()\n  return p\n}\n\nfunction isRootIndex(index, roots) {\n  for (const node of roots) {\n    if (node.index === index) return true\n  }\n\n  return false\n}\nconst { Writable, Readable } = require('streamx')\n\nclass ReadStream extends Readable {\n  constructor(core, opts = {}) {\n    super()\n\n    this.core = core\n    this.start = opts.start || 0\n    this.end = typeof opts.end === 'number' ? opts.end : -1\n    this.snapshot = !opts.live && opts.snapshot !== false\n    this.live = this.end === -1 ? !!opts.live : false\n    this.wait = typeof opts.wait === 'boolean' ? opts.wait : this.core.wait\n    this.timeout = opts.timeout || core.timeout\n  }\n\n  _open(cb) {\n    this._openP().then(cb, cb)\n  }\n\n  _read(cb) {\n    this._readP().then(cb, cb)\n  }\n\n  async _openP() {\n    if (this.end === -1) await this.core.update()\n    else await this.core.ready()\n    if (this.snapshot && this.end === -1) this.end = this.core.length\n  }\n\n  async _readP() {\n    const end = this.live ? -1 : this.end === -1 ? this.core.length : this.end\n    if (end >= 0 && this.start >= end) {\n      this.push(null)\n      return\n    }\n\n    this.push(await this.core.get(this.start++, { wait: this.wait, timeout: this.timeout }))\n  }\n}\n\nexports.ReadStream = ReadStream\n\nclass WriteStream extends Writable {\n  constructor(core) {\n    super()\n    this.core = core\n  }\n\n  _writev(batch, cb) {\n    this._writevP(batch).then(cb, cb)\n  }\n\n  async _writevP(batch) {\n    await this.core.append(batch)\n  }\n}\n\nexports.WriteStream = WriteStream\n\nclass ByteStream extends Readable {\n  constructor(core, opts = {}) {\n    super()\n\n    this._core = core\n    this._index = 0\n    this._range = null\n\n    this._byteOffset = opts.byteOffset || 0\n    this._byteLength = typeof opts.byteLength === 'number' ? opts.byteLength : -1\n    this._prefetch = typeof opts.prefetch === 'number' ? opts.prefetch : 32\n\n    this._applyOffset = this._byteOffset > 0\n  }\n\n  _open(cb) {\n    this._openp().then(cb, cb)\n  }\n\n  _read(cb) {\n    this._readp().then(cb, cb)\n  }\n\n  async _openp() {\n    if (this._byteLength === -1) {\n      await this._core.update()\n      this._byteLength = Math.max(this._core.byteLength - this._byteOffset, 0)\n    }\n  }\n\n  async _readp() {\n    let data = null\n\n    if (this._byteLength === 0) {\n      this.push(null)\n      return\n    }\n\n    let relativeOffset = 0\n\n    if (this._applyOffset) {\n      this._applyOffset = false\n\n      const [block, byteOffset] = await this._core.seek(this._byteOffset)\n\n      this._index = block\n      relativeOffset = byteOffset\n    }\n\n    this._predownload(this._index + 1)\n    data = await this._core.get(this._index++, { valueEncoding: 'binary' })\n\n    if (relativeOffset > 0) data = data.subarray(relativeOffset)\n\n    if (data.byteLength > this._byteLength) data = data.subarray(0, this._byteLength)\n    this._byteLength -= data.byteLength\n\n    this.push(data)\n    if (this._byteLength === 0) this.push(null)\n  }\n\n  _predownload(index) {\n    if (this._range) this._range.destroy()\n    this._range = this._core.download({ start: index, end: index + this._prefetch, linear: true })\n  }\n\n  _destroy(cb) {\n    if (this._range) this._range.destroy()\n    cb(null)\n  }\n}\n\nexports.ByteStream = ByteStream\nconst crypto = require('hypercore-crypto')\nconst b4a = require('b4a')\nconst c = require('compact-encoding')\nconst flat = require('flat-tree')\nconst { BAD_ARGUMENT } = require('hypercore-errors')\nconst unslab = require('unslab')\n\nconst m = require('./messages')\nconst multisig = require('./multisig')\nconst caps = require('./caps')\n\nclass Signer {\n  constructor(\n    manifestHash,\n    version,\n    index,\n    { signature = 'ed25519', publicKey, namespace = caps.DEFAULT_NAMESPACE } = {}\n  ) {\n    if (!publicKey) throw BAD_ARGUMENT('public key is required for a signer')\n    if (signature !== 'ed25519') throw BAD_ARGUMENT('Only Ed25519 signatures are supported')\n\n    this.manifestHash = manifestHash\n    this.version = version\n    this.signer = index\n    this.signature = signature\n    this.publicKey = publicKey\n    this.namespace = namespace\n  }\n\n  _ctx() {\n    return this.version === 0 ? this.namespace : this.manifestHash\n  }\n\n  verify(batch, signature) {\n    return crypto.verify(batch.signable(this._ctx()), signature, this.publicKey)\n  }\n\n  sign(batch, keyPair) {\n    return crypto.sign(batch.signable(this._ctx()), keyPair.secretKey)\n  }\n}\n\nclass CompatSigner extends Signer {\n  constructor(index, signer, legacy) {\n    super(null, 0, index, signer)\n    this.legacy = legacy\n  }\n\n  verify(batch, signature) {\n    return crypto.verify(batch.signableCompat(this.legacy), signature, this.publicKey)\n  }\n\n  sign(batch, keyPair) {\n    return crypto.sign(batch.signableCompat(this.legacy), keyPair.secretKey)\n  }\n}\n\nmodule.exports = class Verifier {\n  constructor(\n    manifestHash,\n    manifest,\n    { compat = isCompat(manifestHash, manifest), legacy = false } = {}\n  ) {\n    const self = this\n\n    this.manifestHash = manifestHash\n    this.compat = compat || manifest === null\n    this.version = this.compat ? 0 : typeof manifest.version === 'number' ? manifest.version : 1\n    this.hash = manifest.hash || 'blake2b'\n    this.allowPatch = !this.compat && !!manifest.allowPatch\n    this.quorum = this.compat ? 1 : defaultQuorum(manifest)\n\n    this.signers = manifest.signers ? manifest.signers.map(createSigner) : []\n    this.prologue = this.compat ? null : manifest.prologue || null\n\n    function createSigner(signer, index) {\n      return self.compat\n        ? new CompatSigner(index, signer, legacy)\n        : new Signer(manifestHash, self.version, index, signer)\n    }\n  }\n\n  _verifyCompat(batch, signature) {\n    if (!signature) return false\n\n    if (this.compat || (!this.allowPatch && this.signers.length === 1)) {\n      return !!signature && this.signers[0].verify(batch, signature)\n    }\n\n    return this._verifyMulti(batch, signature)\n  }\n\n  _inflate(signature) {\n    if (this.version >= 1) return multisig.inflate(signature)\n    const { proofs, patch } = multisig.inflatev0(signature)\n\n    return {\n      proofs: proofs.map(proofToVersion1),\n      patch\n    }\n  }\n\n  _verifyMulti(batch, signature) {\n    if (!signature || this.quorum === 0) return false\n\n    const { proofs, patch } = this._inflate(signature)\n    if (proofs.length < this.quorum) return false\n\n    const tried = new Uint8Array(this.signers.length)\n    const nodes = this.allowPatch && patch.length ? toMap(patch) : null\n\n    for (let i = 0; i < this.quorum; i++) {\n      const inp = proofs[i]\n\n      let tree = batch\n\n      if (inp.patch && this.allowPatch) {\n        tree = batch.clone()\n\n        const upgrade = generateUpgrade(nodes, batch.length, inp.patch)\n        const proof = {\n          fork: tree.fork,\n          block: null,\n          hash: null,\n          seek: null,\n          upgrade,\n          manifest: null\n        }\n\n        try {\n          if (!tree.verifyUpgrade(proof)) return false\n        } catch {\n          return false\n        }\n      }\n\n      if (inp.signer >= this.signers.length || tried[inp.signer]) return false\n      tried[inp.signer] = 1\n\n      const s = this.signers[inp.signer]\n      if (!s.verify(tree, inp.signature)) return false\n    }\n\n    return true\n  }\n\n  verify(batch, signature) {\n    if (this.version === 0) {\n      return this._verifyCompat(batch, signature)\n    }\n\n    if (this.prologue !== null && batch.length <= this.prologue.length) {\n      return batch.length === this.prologue.length && b4a.equals(batch.hash(), this.prologue.hash)\n    }\n\n    return this._verifyMulti(batch, signature)\n  }\n\n  // TODO: better api for this that is more ... multisig-ey\n  sign(batch, keyPair) {\n    if (!keyPair || !keyPair.secretKey) throw BAD_ARGUMENT('No key pair was passed')\n\n    for (const s of this.signers) {\n      if (b4a.equals(s.publicKey, keyPair.publicKey)) {\n        const signature = s.sign(batch, keyPair)\n        if (this.signers.length !== 1 || this.version === 0) return signature\n        return this.assemble([{ signer: 0, signature, patch: 0, nodes: null }])\n      }\n    }\n\n    throw BAD_ARGUMENT('Public key is not a declared signer')\n  }\n\n  assemble(inputs) {\n    return this.version === 0 ? multisig.assemblev0(inputs) : multisig.assemble(inputs)\n  }\n\n  static manifestHash(manifest) {\n    return manifestHash(manifest)\n  }\n\n  static encodeManifest(manifest) {\n    return c.encode(m.manifest, manifest)\n  }\n\n  static decodeManifest(manifest) {\n    return c.decode(m.manifest, manifest)\n  }\n\n  static defaultSignerManifest(publicKey) {\n    return {\n      version: 1,\n      hash: 'blake2b',\n      allowPatch: false,\n      quorum: 1,\n      signers: [\n        {\n          signature: 'ed25519',\n          namespace: caps.DEFAULT_NAMESPACE,\n          publicKey\n        }\n      ],\n      prologue: null,\n      linked: null,\n      userData: null\n    }\n  }\n\n  static fromManifest(manifest, opts) {\n    const m = this.createManifest(manifest)\n    return new this(manifestHash(m), m, opts)\n  }\n\n  static createManifest(inp) {\n    if (!inp) return null\n\n    const manifest = {\n      version: getManifestVersion(inp), // defaults to v1\n      hash: 'blake2b',\n      allowPatch: !!inp.allowPatch,\n      quorum: defaultQuorum(inp),\n      signers: inp.signers ? inp.signers.map(parseSigner) : [],\n      prologue: null,\n      linked: null,\n      userData: inp.userData || null\n    }\n\n    if (inp.hash && inp.hash !== 'blake2b') throw BAD_ARGUMENT('Only Blake2b hashes are supported')\n\n    if (inp.prologue) {\n      if (\n        !(b4a.isBuffer(inp.prologue.hash) && inp.prologue.hash.byteLength === 32) ||\n        !(inp.prologue.length >= 0)\n      ) {\n        throw BAD_ARGUMENT('Invalid prologue')\n      }\n\n      manifest.prologue = inp.prologue\n      manifest.prologue.hash = unslab(manifest.prologue.hash)\n    }\n\n    if (manifest.userData !== null && manifest.version < 2) {\n      throw BAD_ARGUMENT('Invalid field: userData')\n    }\n\n    if (inp.linked && inp.linked.length) {\n      if (manifest.version < 2) throw BAD_ARGUMENT('Invalid field: linked')\n\n      for (const key of inp.linked) {\n        if (!(b4a.isBuffer(key) && key.byteLength === 32)) {\n          throw BAD_ARGUMENT('Invalid key')\n        }\n      }\n\n      manifest.linked = inp.linked\n    }\n\n    return manifest\n  }\n\n  static isValidManifest(key, manifest) {\n    return b4a.equals(key, manifestHash(manifest))\n  }\n\n  static isCompat(key, manifest) {\n    return isCompat(key, manifest)\n  }\n\n  static sign(manifest, batch, keyPair, opts) {\n    return Verifier.fromManifest(manifest, opts).sign(batch, keyPair)\n  }\n}\n\nfunction toMap(nodes) {\n  const m = new Map()\n  for (const node of nodes) m.set(node.index, node)\n  return m\n}\n\nfunction isCompat(key, manifest) {\n  return !!(\n    manifest &&\n    manifest.signers.length === 1 &&\n    b4a.equals(key, manifest.signers[0].publicKey)\n  )\n}\n\nfunction defaultQuorum(man) {\n  if (typeof man.quorum === 'number') return man.quorum\n  if (!man.signers || !man.signers.length) return 0\n  return (man.signers.length >> 1) + 1\n}\n\nfunction generateUpgrade(patch, start, length) {\n  const upgrade = { start, length, nodes: null, additionalNodes: [], signature: null }\n\n  const from = start * 2\n  const to = from + length * 2\n\n  for (const ite = flat.iterator(0); ite.fullRoot(to); ite.nextTree()) {\n    if (ite.index + ite.factor / 2 < from) continue\n\n    if (upgrade.nodes === null && ite.contains(from - 2)) {\n      upgrade.nodes = []\n\n      const root = ite.index\n      const target = from - 2\n\n      ite.seek(target)\n\n      while (ite.index !== root) {\n        ite.sibling()\n        if (ite.index > target) upgrade.nodes.push(patch.get(ite.index))\n        ite.parent()\n      }\n\n      continue\n    }\n\n    if (upgrade.nodes === null) upgrade.nodes = []\n    upgrade.nodes.push(patch.get(ite.index))\n  }\n\n  if (upgrade.nodes === null) upgrade.nodes = []\n  return upgrade\n}\n\nfunction parseSigner(signer) {\n  validateSigner(signer)\n  return {\n    signature: 'ed25519',\n    namespace: unslab(signer.namespace || caps.DEFAULT_NAMESPACE),\n    publicKey: unslab(signer.publicKey)\n  }\n}\n\nfunction validateSigner(signer) {\n  if (!signer || !signer.publicKey) throw BAD_ARGUMENT('Signer missing public key')\n  if (signer.signature && signer.signature !== 'ed25519') {\n    throw BAD_ARGUMENT('Only Ed25519 signatures are supported')\n  }\n}\n\nfunction manifestHash(manifest) {\n  const state = { start: 0, end: 32, buffer: null }\n  m.manifest.preencode(state, manifest)\n  state.buffer = b4a.allocUnsafe(state.end)\n  c.raw.encode(state, caps.MANIFEST)\n  m.manifest.encode(state, manifest)\n  return crypto.hash(state.buffer)\n}\n\nfunction proofToVersion1(proof) {\n  return {\n    signer: proof.signer,\n    signature: proof.signature,\n    patch: proof.patch ? proof.patch.length : 0\n  }\n}\n\nfunction getManifestVersion(inp) {\n  if (typeof inp.version === 'number') return inp.version\n  if (inp.linked && inp.linked.length) return 2\n  if (inp.userData) return 2\n  return 1\n}\nconst COMPAT = true // should be flipped once this is widely deployed\nconst BATCH_UINTS = COMPAT ? 65536 : 128\nconst BATCH_BYTES = BATCH_UINTS * 4\nconst BATCH = BATCH_BYTES * 8 // in bits\nconst MAX_REMOTE_BATCHES = 4\nconst MAX_RANGE = 8 * 256 * 1024\nconst MIN_RANGE = 32 // 4bit ints\nconst MAX = 512\nconst MAX_ANY = 16\n\nclass LocalWants {\n  constructor(peer) {\n    this.destroyed = false\n    this.peer = peer\n    this.wants = new Map()\n    this.free = new Set()\n    this.any = null\n  }\n\n  add(index, handle) {\n    const b = (index - (index & (BATCH - 1))) / BATCH\n    return this.addBatch(b, handle)\n  }\n\n  addAnyRange(start, length, handle) {\n    if (this.destroyed) return null\n    if (this.any === null) this.any = []\n\n    if (COMPAT) {\n      let r = start & (BATCH - 1)\n      start -= r\n      length += r\n      r = length & (BATCH - 1)\n      if (r) length = length - r + BATCH\n    }\n\n    for (let i = 0; i < this.any.length; i++) {\n      const w = this.any[i]\n      if (w.start === start && w.length === length) {\n        w.handles.add(handle)\n        handle.addWant(w)\n        return null\n      }\n    }\n\n    const w = { wants: this, start, length, any: true, handles: new Set([handle]) }\n    this.any.push(w)\n    handle.addWant(w)\n\n    return { start, length, any: !COMPAT }\n  }\n\n  removeAnyRange(start, length, handle) {\n    if (this.any === null) return null\n\n    for (let i = 0; i < this.any.length; i++) {\n      const w = this.any[i]\n      if (w.start !== start || w.length !== length) continue\n\n      w.handles.delete(handle)\n      handle.removeWant(w)\n      if (w.handles.size > 0) return null\n\n      const head = this.any.pop()\n      if (head !== w) this.any[i] = head\n      return { start, length, any: !COMPAT }\n    }\n\n    return null\n  }\n\n  addBatch(index, handle) {\n    if (this.destroyed) return null\n    let w = this.wants.get(index)\n\n    if (w) {\n      const size = w.handles.size\n      w.handles.add(handle)\n      if (w.handles.size !== size) {\n        handle.addWant(w)\n      }\n      return null\n    }\n\n    // start here is the batch number for simplicity....\n    w = { wants: this, start: index, length: 0, any: false, handles: new Set([handle]) }\n\n    if (this.free.has(index)) {\n      this.free.delete(index)\n      this.wants.set(index, w)\n      handle.addWant(w)\n      return null\n    }\n\n    let unwant = null\n    if (this.wants.size + this.free.size === MAX) {\n      if (this.free.size === 0) {\n        return null\n      }\n      unwant = this._unwant()\n    }\n\n    this.wants.set(index, w)\n    handle.addWant(w)\n\n    return {\n      want: { start: index * BATCH, length: BATCH, any: false },\n      unwant\n    }\n  }\n\n  remove(index, handle) {\n    const b = (index - (index & (BATCH - 1))) / BATCH\n    return this.removeBatch(b, handle)\n  }\n\n  removeBatch(index, handle) {\n    if (this.destroyed) return false\n\n    const w = this.wants.get(index)\n    if (!w) {\n      return false\n    }\n\n    w.handles.delete(handle)\n    handle.removeWant(w)\n\n    if (w.handles.size === 0) {\n      this.free.add(index)\n      this.wants.delete(index)\n      return this.free.size === 1 && this.wants.size === MAX - 1\n    }\n\n    return false\n  }\n\n  destroy() {\n    if (this.destroyed) return\n    this.destroyed = true\n\n    for (const w of this.wants.values()) {\n      for (const handle of w.handles) {\n        handle.removeWant(w)\n      }\n    }\n\n    this.wants.clear()\n  }\n\n  _unwant() {\n    for (const index of this.free) {\n      this.free.delete(index)\n      return { start: index * BATCH, length: BATCH, any: false }\n    }\n    return null\n  }\n}\n\nclass RemoteWants {\n  constructor() {\n    this.any = null\n    this.all = false\n    this.size = 0\n    this.batches = []\n  }\n\n  hasAny(start, length) {\n    for (let i = 0; i < this.any.length; i++) {\n      const a = this.any[i]\n      const e = start + length\n      const end = a.start + a.length\n\n      if (a.start <= start && start < end) return true\n      if (a.start < e && e <= end) return true\n    }\n\n    return this.all\n  }\n\n  hasRange(start, length) {\n    if (this.any !== null && this.hasAny(start, length)) return true\n    if (length === 1) return this.has(start)\n\n    let smallest = -1\n\n    for (let i = 0; i < this.batches.length; i++) {\n      const b = this.batches[i]\n      if (b.length < smallest || smallest === -1) smallest = b.length\n    }\n\n    if (smallest === -1) return this.all\n\n    const r = start & (smallest - 1)\n    const end = start + length\n\n    let max = 3\n\n    for (let i = start - r; i < end; i += smallest) {\n      if (max-- === 0) return true // just to save work\n      if (this.has(i)) return true\n    }\n\n    return this.all\n  }\n\n  has(index) {\n    for (let i = 0; i < this.batches.length; i++) {\n      const b = this.batches[i]\n      const block = (index - (index & (b.length - 1))) / b.length\n      if (b.ranges.has(block)) return true\n    }\n\n    return this.all\n  }\n\n  add(range) {\n    if (range.any) {\n      if (this.any === null) this.any = []\n      if (this.any.length < MAX_ANY) this.any.push(range)\n      else this.all = true\n      return true\n    }\n\n    if (range.length > MAX_RANGE) return false\n\n    if (!validateBatchRange(range)) {\n      this.all = true\n      return true\n    }\n\n    if (this.size >= MAX) {\n      this.all = true\n      return true\n    }\n\n    for (let i = 0; i < this.batches.length; i++) {\n      const b = this.batches[i]\n      if (b.length === range.length) {\n        b.ranges.add(range.start / range.length)\n        this.size++\n        return true\n      }\n    }\n\n    if (this.batches.length >= MAX_REMOTE_BATCHES) {\n      this.all = true\n      return true\n    }\n\n    this.batches.push({\n      length: range.length,\n      ranges: new Set([range.start / range.length])\n    })\n    this.size++\n\n    return true\n  }\n\n  remove(range) {\n    if (range.any) {\n      if (this.any === null) return false\n\n      for (let i = 0; i < this.any.length; i++) {\n        const a = this.any[i]\n\n        if (a.start === range.start && a.length === range.length) {\n          const head = this.any.pop()\n          if (head !== a) this.any[i] = head\n          return true\n        }\n      }\n\n      return false\n    }\n\n    if (!validateBatchRange(range)) return false\n\n    for (let i = 0; i < this.batches.length; i++) {\n      const b = this.batches[i]\n      if (b.length !== range.length) continue\n\n      const size = b.ranges.size\n      b.ranges.delete(range.start / range.length)\n      if (b.ranges.size !== size) this.size--\n\n      if (b.ranges.size === 0) {\n        const head = this.batches.pop()\n        if (head !== b) this.batches[i] = head\n      }\n\n      return true\n    }\n\n    return false\n  }\n}\n\nexports.LocalWants = LocalWants\nexports.RemoteWants = RemoteWants\nexports.WANT_BATCH = BATCH\n\nfunction validateBatchRange(range) {\n  if (range.length > MAX_RANGE || range.length < MIN_RANGE) {\n    return false\n  }\n  // check if power of two\n  if ((range.length & (range.length - 1)) !== 0) {\n    return false\n  }\n  // start must be a multiple of the length\n  if (range.start & (range.length - 1)) {\n    return false\n  }\n\n  return true\n}\n{\n  \"name\": \"hypercore\",\n  \"version\": \"11.23.1\",\n  \"description\": \"Hypercore is a secure, distributed append-only log\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"lint\": \"prettier --check . && lunte\",\n    \"test\": \"brittle test/all.js\",\n    \"test:bare\": \"bare test/all.js\",\n    \"test:generate\": \"brittle -r test/all.js test/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/hypercore.git\"\n  },\n  \"contributors\": [\n    {\n      \"name\": \"Mathias Buus\",\n      \"email\": \"mathiasbuus@gmail.com\",\n      \"url\": \"https://mafinto.sh\"\n    },\n    {\n      \"name\": \"Andrew Osheroff\",\n      \"email\": \"andrewosh@gmail.com\",\n      \"url\": \"https://andrewosh.com\"\n    }\n  ],\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/hypercore/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/hypercore#readme\",\n  \"files\": [\n    \"index.js\",\n    \"errors.js\",\n    \"messages.js\",\n    \"lib/**.js\"\n  ],\n  \"imports\": {\n    \"events\": {\n      \"bare\": \"bare-events\",\n      \"default\": \"events\"\n    }\n  },\n  \"dependencies\": {\n    \"@hyperswarm/secret-stream\": \"^6.0.0\",\n    \"b4a\": \"^1.1.0\",\n    \"bare-events\": \"^2.2.0\",\n    \"big-sparse-array\": \"^1.0.3\",\n    \"compact-encoding\": \"^2.11.0\",\n    \"fast-fifo\": \"^1.3.0\",\n    \"flat-tree\": \"^1.9.0\",\n    \"hypercore-crypto\": \"^3.2.1\",\n    \"hypercore-errors\": \"^1.5.0\",\n    \"hypercore-id-encoding\": \"^1.2.0\",\n    \"hypercore-storage\": \"^2.0.0\",\n    \"is-options\": \"^1.0.1\",\n    \"nanoassert\": \"^2.0.0\",\n    \"protomux\": \"^3.5.0\",\n    \"quickbit-universal\": \"^2.2.0\",\n    \"random-array-iterator\": \"^1.0.0\",\n    \"safety-catch\": \"^1.0.1\",\n    \"sodium-universal\": \"^5.0.1\",\n    \"streamx\": \"^2.12.4\",\n    \"unslab\": \"^1.3.0\",\n    \"z32\": \"^1.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.0.0\",\n    \"debugging-stream\": \"^3.1.0\",\n    \"hyperswarm\": \"^4.3.6\",\n    \"lunte\": \"^1.3.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"rache\": \"^1.0.0\",\n    \"range-parser\": \"^1.2.1\",\n    \"resolve-reject-promise\": \"^1.1.0\",\n    \"speedometer\": \"^1.1.0\",\n    \"test-tmp\": \"^1.0.2\",\n    \"tiny-byte-size\": \"^1.1.0\",\n    \"udx-native\": \"^1.6.1\",\n    \"uncaughts\": \"^1.1.0\"\n  }\n}\n{\n  \"name\": \"hyperschema\",\n  \"version\": \"1.19.0\",\n  \"description\": \"Create registries of declarative compact-encoding schemas\",\n  \"files\": [\n    \"lib/*.js\",\n    \"builder.mjs\",\n    \"builder.cjs\",\n    \"runtime.mjs\",\n    \"runtime.cjs\",\n    \"primitives.mjs\",\n    \"primitives.cjs\"\n  ],\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"import\": \"./builder.mjs\",\n      \"default\": \"./builder.cjs\"\n    },\n    \"./runtime\": {\n      \"import\": \"./runtime.mjs\",\n      \"default\": \"./runtime.cjs\"\n    },\n    \"./primitives\": {\n      \"import\": \"./primitives.mjs\",\n      \"default\": \"./primitives.cjs\"\n    }\n  },\n  \"imports\": {\n    \"fs\": {\n      \"bare\": \"bare-fs\",\n      \"default\": \"fs\"\n    },\n    \"path\": {\n      \"bare\": \"bare-path\",\n      \"default\": \"path\"\n    }\n  },\n  \"scripts\": {\n    \"format\": \"prettier . --write\",\n    \"test\": \"prettier . --check && brittle test/index.js\",\n    \"test:bare\": \"prettier . --check && bare test/index.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/hyperschema.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/hyperschema/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/hyperschema#readme\",\n  \"dependencies\": {\n    \"bare-fs\": \"^4.0.1\",\n    \"compact-encoding\": \"^2.15.0\",\n    \"generate-object-property\": \"^2.0.0\",\n    \"generate-string\": \"^1.0.1\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.7.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"test-tmp\": \"^1.3.0\"\n  }\n}\nmodule.exports = {\n  c: require('compact-encoding')\n}\nconst b4a = require('b4a')\n\nconst EMPTY = b4a.alloc(0)\nconst MAX = b4a.from([0xff])\nconst BUFFER = {}\n\nBUFFER.preencode = function (state, buf) {\n  if (buf === null) buf = EMPTY\n\n  let i = 0\n  let extra = 3\n\n  while ((i = b4a.indexOf(buf, 0x00, i)) > -1) {\n    i++\n    extra++\n  }\n\n  state.end += buf.byteLength + extra\n}\n\nBUFFER.encode = function (state, buf) {\n  if (buf === null) buf = EMPTY\n\n  state.buffer[state.start++] = 0x00\n\n  let prev = 0\n  let i = 0\n\n  while ((i = b4a.indexOf(buf, 0x00, i)) > -1) {\n    const slice = buf.subarray(prev, ++i)\n\n    state.buffer.set(slice, state.start)\n    state.start += slice.byteLength\n    state.buffer[state.start++] = 0x02\n    prev = i\n  }\n\n  const slice = buf.subarray(prev)\n\n  state.buffer.set(slice, state.start)\n  state.start += slice.byteLength\n\n  state.buffer[state.start++] = 0x00\n  state.buffer[state.start++] = 0x01\n}\n\nBUFFER.decode = function (state) {\n  if (state.start >= state.end) throw new Error('Out of bounds')\n  if (state.buffer[state.start++] !== 0x00) throw new Error('Invalid start of string')\n\n  let escaped = null\n\n  let prev = state.start\n  let i = state.start\n\n  while ((i = b4a.indexOf(state.buffer, 0x00, i)) > -1) {\n    const next = ++i < state.end ? state.buffer[i] : 0x00\n\n    i++\n\n    if (next === 0x01) {\n      break\n    }\n\n    if (next === 0x02) {\n      if (escaped === null) escaped = []\n      escaped.push(state.buffer.subarray(prev, i - 1))\n      prev = i\n      continue\n    }\n\n    throw new Error('Unknown value in terminator')\n  }\n\n  if (i === -1) {\n    throw new Error('No terminator found')\n  }\n\n  state.start = i\n  const last = state.buffer.subarray(prev, i - 2)\n  if (escaped === null) return last\n\n  escaped.push(last)\n  return b4a.concat(escaped)\n}\n\n// TODO: can be optimised a lot\n\nconst STRING = {}\n\nSTRING.preencode = function (state, str) {\n  BUFFER.preencode(state, b4a.from(str || ''))\n}\n\nSTRING.encode = function (state, str) {\n  BUFFER.encode(state, b4a.from(str || ''))\n}\n\nSTRING.decode = function (state, str) {\n  return b4a.toString(BUFFER.decode(state))\n}\n\nconst UINT = {}\n\nUINT.preencode = function (state, n) {\n  state.end += n <= 0xfb ? 1 : n <= 0xffff ? 3 : n <= 0xffffffff ? 5 : (n === Infinity ? 1 : 9)\n}\n\nUINT.encode = function (state, n) {\n  if (n === Infinity) {\n    state.buffer[state.start++] = 0xff\n    return\n  }\n\n  if (n <= 0xfb) {\n    state.buffer[state.start++] = n\n    return\n  }\n\n  if (n <= 0xffff) {\n    state.buffer[state.start++] = 0xfc\n    state.buffer[state.start++] = n >>> 8\n    state.buffer[state.start++] = n\n    return\n  }\n\n  if (n <= 0xffffffff) {\n    state.buffer[state.start++] = 0xfd\n    encodeUint32(state, n)\n    return\n  }\n\n  if (Number.isSafeInteger(n)) {\n    state.buffer[state.start++] = 0xfe\n\n    const r = Math.floor(n / 0x100000000)\n    encodeUint32(state, r)\n    encodeUint32(state, n)\n    return\n  }\n\n  throw new Error('Invalid number ' + n)\n}\n\nUINT.decode = function (state) {\n  if (state.start >= state.end) throw new Error('Out of bounds')\n\n  const a = state.buffer[state.start++]\n\n  if (a <= 0xfb) return a\n\n  if (a === 0xfc) {\n    if (state.end - state.start < 2) throw new Error('Out of bounds')\n    return (\n      state.buffer[state.start++] * 0x100 +\n      state.buffer[state.start++]\n    )\n  }\n\n  if (a === 0xfd) {\n    return decodeUint32(state)\n  }\n\n  if (a === 0xfe) {\n    return (\n      decodeUint32(state) * 0x100000000 +\n      decodeUint32(state)\n    )\n  }\n\n  return Infinity\n}\n\nconst BOOL = {}\n\nBOOL.preencode = (state, b) => UINT.preencode(state, b ? 1 : 0)\nBOOL.encode = (state, b) => UINT.encode(state, b ? 1 : 0)\nBOOL.decode = (state, b) => !!UINT.decode(state)\n\nmodule.exports = class IndexEncoder {\n  constructor (encodings, { prefix = -1 } = {}) {\n    this.encodings = encodings\n    this.prefix = prefix\n  }\n\n  static BUFFER = BUFFER\n  static STRING = STRING\n  static UINT = UINT\n  static BOOL = BOOL\n\n  static lookup (c) {\n    switch (c) {\n      case 'uint': return UINT\n      case 'uint8': return UINT\n      case 'uint16': return UINT\n      case 'uint24': return UINT\n      case 'uint32': return UINT\n      case 'uint40': return UINT\n      case 'uint48': return UINT\n      case 'uint56': return UINT\n      case 'uint64': return UINT\n      case 'string': return STRING\n      case 'utf8': return STRING\n      case 'ascii': return STRING\n      case 'hex': return STRING\n      case 'base64': return STRING\n      case 'fixed32': return BUFFER\n      case 'fixed64': return BUFFER\n      case 'buffer': return BUFFER\n      case 'bool': return BOOL\n    }\n\n    throw new Error('Unknown type')\n  }\n\n  encode (keys) {\n    return this._encode(keys, false)\n  }\n\n  _encode (keys, terminate) {\n    if (b4a.isBuffer(keys)) return keys\n\n    const state = { start: 0, end: 0, buffer: null }\n\n    if (this.prefix !== -1) UINT.preencode(state, this.prefix)\n    for (let i = 0; i < keys.length; i++) {\n      this.encodings[i].preencode(state, keys[i])\n    }\n\n    if (terminate && keys.length < this.encodings.length) {\n      state.end++\n    }\n\n    state.buffer = b4a.allocUnsafe(state.end)\n\n    if (this.prefix !== -1) UINT.encode(state, this.prefix)\n    for (let i = 0; i < keys.length; i++) {\n      this.encodings[i].encode(state, keys[i])\n    }\n\n    if (terminate && keys.length < this.encodings.length) {\n      state.buffer[state.start++] = MAX[0]\n    }\n\n    return state.buffer\n  }\n\n  decode (buffer) {\n    const state = { start: 0, end: buffer.byteLength, buffer }\n    const result = []\n\n    if (this.prefix !== -1) UINT.decode(state)\n    for (const enc of this.encodings) {\n      const key = state.start < state.end ? enc.decode(state) : (enc === UINT ? 0 : null)\n      result.push(key)\n    }\n\n    return result\n  }\n\n  encodeRange ({ gt, gte, lt, lte }) {\n    const range = {\n      gt: gt && this._encode(gt, true),\n      gte: gte && this._encode(gte, false),\n      lt: lt && this._encode(lt, false),\n      lte: lte && this._encode(lte, true)\n    }\n\n    if (this.prefix !== -1) {\n      if (!gt && !gte) range.gte = encodeUint(this.prefix)\n      if (!lt && !lte) range.lt = encodeUint(this.prefix + 1)\n    }\n\n    return range\n  }\n}\n\nfunction encodeUint (n) {\n  const state = { start: 0, end: 0, buffer: null }\n  UINT.preencode(state, n)\n  state.buffer = b4a.allocUnsafe(state.end)\n  UINT.encode(state, n)\n  return state.buffer\n}\n\nfunction encodeUint32 (state, n) {\n  state.buffer[state.start++] = n >>> 24\n  state.buffer[state.start++] = n >>> 16\n  state.buffer[state.start++] = n >>> 8\n  state.buffer[state.start++] = n\n}\n\nfunction decodeUint32 (state, n) {\n  if (state.end - state.start < 4) throw new Error('Out of bounds')\n  return (\n    state.buffer[state.start++] * 0x1000000 +\n    state.buffer[state.start++] * 0x10000 +\n    state.buffer[state.start++] * 0x100 +\n    state.buffer[state.start++]\n  )\n}\n{\n  \"name\": \"index-encoder\",\n  \"version\": \"3.4.0\",\n  \"description\": \"Encode multiple values into sorted keys\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.4\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.2.1\",\n    \"hyperbee\": \"^2.10.5\",\n    \"hypercore\": \"^10.9.2\",\n    \"random-access-memory\": \"^6.2.0\",\n    \"standard\": \"^17.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/index-encoder.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/index-encoder/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/index-encoder\"\n}\ntry {\n  var util = require('util');\n  /* istanbul ignore next */\n  if (typeof util.inherits !== 'function') throw '';\n  module.exports = util.inherits;\n} catch (e) {\n  /* istanbul ignore next */\n  module.exports = require('./inherits_browser.js');\n}\nif (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    if (superCtor) {\n      ctor.super_ = superCtor\n      ctor.prototype = Object.create(superCtor.prototype, {\n        constructor: {\n          value: ctor,\n          enumerable: false,\n          writable: true,\n          configurable: true\n        }\n      })\n    }\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    if (superCtor) {\n      ctor.super_ = superCtor\n      var TempCtor = function () {}\n      TempCtor.prototype = superCtor.prototype\n      ctor.prototype = new TempCtor()\n      ctor.prototype.constructor = ctor\n    }\n  }\n}\n{\n  \"name\": \"inherits\",\n  \"description\": \"Browser-friendly inheritance fully compatible with standard node.js inherits()\",\n  \"version\": \"2.0.4\",\n  \"keywords\": [\n    \"inheritance\",\n    \"class\",\n    \"klass\",\n    \"oop\",\n    \"object-oriented\",\n    \"inherits\",\n    \"browser\",\n    \"browserify\"\n  ],\n  \"main\": \"./inherits.js\",\n  \"browser\": \"./inherits_browser.js\",\n  \"repository\": \"git://github.com/isaacs/inherits\",\n  \"license\": \"ISC\",\n  \"scripts\": {\n    \"test\": \"tap\"\n  },\n  \"devDependencies\": {\n    \"tap\": \"^14.2.4\"\n  },\n  \"files\": [\n    \"inherits.js\",\n    \"inherits_browser.js\"\n  ]\n}\nconst b4a = require('b4a')\n\nmodule.exports = function isOptions (opts) {\n  return typeof opts === 'object' && opts && !b4a.isBuffer(opts)\n}\n{\n  \"name\": \"is-options\",\n  \"version\": \"1.0.2\",\n  \"description\": \"Easily check if input is an options map\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"b4a\": \"^1.1.1\"\n  },\n  \"devDependencies\": {\n    \"standard\": \"^11.0.1\",\n    \"tape\": \"^4.9.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && tape test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/is-options.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/is-options/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/is-options\"\n}\nconst c = require('compact-encoding')\nconst b4a = require('b4a')\n\nconst KeyChain = require('./lib/keychain')\nconst { sign, verify, hash } = require('./lib/crypto')\n\nconst {\n  ProofEncoding,\n  AttestedData,\n  AttestedDevice,\n  ReceiptEncoding\n} = require('./lib/encoding')\n\nconst PROOF_VERSION = 1\nconst KEET_TYPE = 5338\n\nconst NS_PROFILE_DISC_ENC = hash(b4a.from('profile discovery'))\n\nmodule.exports = class IdentityKey {\n  constructor (keyChain) {\n    this.keyChain = keyChain\n\n    this.identityKeyPair = this.keyChain.get(identityKeyPath(0))\n    this.profileDiscoveryKeyPair = this.keyChain.get(discoveryCorePath(0))\n  }\n\n  static generateMnemonic () {\n    return KeyChain.generateMnemonic()\n  }\n\n  static deriveSeed (mnemonic) {\n    return KeyChain.deriveSeed(mnemonic)\n  }\n\n  get identityPublicKey () {\n    return this.identityKeyPair.publicKey\n  }\n\n  get profileDiscoveryPublicKey () {\n    return this.profileDiscoveryKeyPair.publicKey\n  }\n\n  getProfileDiscoveryEncryptionKey () {\n    return this.keyChain.getSymmetricKey(encryptionKeyPath(NS_PROFILE_DISC_ENC))\n  }\n\n  getEncryptionKey (profileKey) {\n    return this.keyChain.getSymmetricKey(encryptionKeyPath(profileKey))\n  }\n\n  bootstrap (device) {\n    return IdentityKey.bootstrap({ identity: this.identityKeyPair }, device)\n  }\n\n  clear () {\n    this.keyChain.clear()\n    this.identityKeyPair.secretKey.fill(0)\n    this.profileDiscoveryKeyPair.secretKey.fill(0)\n  }\n\n  static async bootstrap ({ identity, seed, mnemonic }, device) {\n    if (!identity) {\n      const identityPath = identityKeyPath(0) // accountIndex unused for now\n      identity = await KeyChain.from({ seed, mnemonic }, identityPath)\n    }\n\n    const proof = {\n      version: PROOF_VERSION,\n      epoch: Date.now(),\n      identity: identity.publicKey,\n      chain: []\n    }\n\n    return IdentityKey.attestDevice(device, identity, proof)\n  }\n\n  static attestDevice (publicKey, parent, proof) {\n    if (!proof) return IdentityKey.bootstrap({ identity: parent }, publicKey)\n\n    if (b4a.isBuffer(proof)) {\n      proof = c.decode(ProofEncoding, proof)\n    }\n\n    if (proof.version === 0) {\n      throw new Error('Version 0 proofs are not supported')\n    }\n\n    const signable = c.encode(AttestedDevice, {\n      epoch: proof.epoch,\n      identity: proof.identity,\n      device: publicKey\n    })\n\n    const signature = sign(signable, parent)\n\n    proof.chain.push({ publicKey, signature })\n\n    return c.encode(ProofEncoding, proof)\n  }\n\n  static attestData (attestedData, keyPair, proof) {\n    if (attestedData === null) throw new Error('Data is not attestable')\n\n    if (b4a.isBuffer(proof)) {\n      proof = c.decode(ProofEncoding, proof)\n    }\n\n    if (proof && proof.version === 0) {\n      throw new Error('Version 0 proofs are not supported')\n    }\n\n    if (!proof) {\n      proof = {\n        version: PROOF_VERSION,\n        epoch: Date.now(),\n        identity: keyPair.publicKey,\n        chain: []\n      }\n    }\n\n    const signable = c.encode(AttestedData, {\n      epoch: proof.epoch,\n      identity: proof.identity,\n      data: hash(attestedData)\n    })\n\n    proof.data = { signature: sign(signable, keyPair) }\n\n    return c.encode(ProofEncoding, proof)\n  }\n\n  static async from ({ seed, mnemonic }) {\n    const keyChain = await KeyChain.from({ seed, mnemonic })\n\n    return new IdentityKey(keyChain)\n  }\n\n  static verify (proof, attestedData, opts = {}) {\n    if (b4a.isBuffer(proof)) {\n      proof = c.decode(ProofEncoding, proof)\n    }\n\n    if (!validateProof(proof, attestedData, opts)) {\n      return null\n    }\n\n    const { epoch, identity, chain } = proof\n\n    const candidate = getLastKey(chain) || identity\n\n    if (opts.expectedDevice) {\n      if (!b4a.equals(candidate, opts.expectedDevice)) return null\n    }\n\n    let parent = identity\n\n    // verify chain\n    for (let i = 0; i < chain.length; i++) {\n      const { publicKey, signature } = chain[i]\n\n      const signable = c.encode(AttestedDevice, {\n        epoch,\n        identity,\n        device: publicKey\n      })\n\n      if (!verify(signable, signature, parent)) {\n        return null\n      }\n\n      parent = publicKey\n    }\n\n    if (proof.data) {\n      const signable = c.encode(AttestedData, {\n        epoch,\n        identity,\n        data: hash(attestedData)\n      })\n\n      if (!verify(signable, proof.data.signature, parent)) {\n        return null\n      }\n    }\n\n    const receipt = c.encode(ReceiptEncoding, { epoch })\n\n    return {\n      receipt,\n      identityPublicKey: identity,\n      devicePublicKey: candidate\n    }\n  }\n}\n\nfunction validateProof (proof, attestedData, opts = {}) {\n  // version 0 is ignored\n  if (proof.version === 0) return false\n\n  // validate version\n  if (proof.version > PROOF_VERSION) return false\n\n  // verify epoch\n  if (opts.receipt) {\n    const { epoch } = c.decode(ReceiptEncoding, opts.receipt)\n    if (proof.epoch < epoch) return false\n  }\n\n  // verify identity\n  if (opts.expectedIdentity) {\n    if (!b4a.equals(proof.identity, opts.expectedIdentity)) return false\n  }\n\n  return validateAttestedData(proof.data, attestedData)\n}\n\nfunction validateAttestedData (data, attestedData) {\n  if (!data && attestedData) return false\n  return true\n}\n\nfunction getLastKey (chain) {\n  if (!chain.length) return null\n\n  const last = chain[chain.length - 1]\n  return last.publicKey\n}\n\n// slip48 derivations:\n// https://github.com/satoshilabs/slips/blob/master/slip-0048.md\n\nfunction keyPath (accountIndex, index) {\n  // https://github.com/bitcoin/bips/blob/master/bip-0043.mediawiki\n  const purpose = 48 // SLIP-48 wallet\n  const role = 0 // owner\n\n  return [purpose, KEET_TYPE, role, accountIndex, index]\n}\n\n// identityKey -> m/48'/keet'/0'/0'\n\nfunction identityKeyPath (accountIndex) {\n  return keyPath(accountIndex, 0)\n}\n\n// identityKey -> m/48'/keet'/0'/1'\n\nfunction discoveryCorePath (accountIndex) {\n  return keyPath(accountIndex, 1)\n}\n\n// slip21 derivations\n// https://github.com/satoshilabs/slips/blob/master/slip-0021.md\n\nfunction symmetricPath (...path) {\n  const purpose = 'SLIP-0021' // SLIP-21 wallet\n  const namespace = 'keet-identity-key' // keet\n\n  return [purpose, namespace, ...path]\n}\n\n// encryptionKey  -> m/SLIP-10/keet-identity-key/account/\"encryption key\"\n\nfunction encryptionKeyPath (profileKey) {\n  return symmetricPath(b4a.toString(profileKey, 'hex'), 'encryption key')\n}\nconst sodium = require('sodium-universal')\nconst b4a = require('b4a')\n\nmodule.exports = {\n  sign,\n  verify,\n  hash: blake2b\n}\n\nfunction sign (signable, keyPair) {\n  const signature = b4a.alloc(sodium.crypto_sign_BYTES)\n  sodium.crypto_sign_detached(signature, signable, keyPair.secretKey)\n\n  return signature\n}\n\nfunction verify (signable, signature, publicKey) {\n  return sodium.crypto_sign_verify_detached(signature, signable, publicKey)\n}\n\nfunction blake2b (data, output = b4a.alloc(32)) {\n  sodium.crypto_generichash(output, data)\n  return output\n}\nconst c = require('compact-encoding')\n\nconst ATTESTED_DEVICE = 0\nconst ATTESTED_DATA = 1\n\nconst Epoch = {\n  preencode (state, e) {\n    c.uint64.preencode(state, Math.floor(e / 1000))\n  },\n  encode (state, e) {\n    c.uint64.encode(state, Math.floor(e / 1000))\n  },\n  decode (state) {\n    return c.uint64.decode(state) * 1000\n  }\n}\n\nconst AttestedDevice = {\n  preencode (state, a) {\n    c.uint8.preencode(state, ATTESTED_DEVICE)\n    Epoch.preencode(state, a.epoch)\n    c.fixed32.preencode(state, a.identity)\n    c.fixed32.preencode(state, a.device)\n  },\n  encode (state, a) {\n    c.uint8.encode(state, ATTESTED_DEVICE)\n    Epoch.encode(state, a.epoch)\n    c.fixed32.encode(state, a.identity)\n    c.fixed32.encode(state, a.device)\n  },\n  decode (state) {\n    throw new Error('Signed data should only be encoded')\n  }\n}\n\nconst AttestedData = {\n  preencode (state, a) {\n    c.uint8.preencode(state, ATTESTED_DATA)\n    Epoch.preencode(state, a.epoch)\n    c.fixed32.preencode(state, a.identity)\n    c.fixed32.preencode(state, a.data)\n  },\n  encode (state, a) {\n    c.uint8.encode(state, ATTESTED_DATA)\n    Epoch.encode(state, a.epoch)\n    c.fixed32.encode(state, a.identity)\n    c.fixed32.encode(state, a.data)\n  },\n  decode (state) {\n    throw new Error('Signed data should only be encoded')\n  }\n}\n\nconst DeviceAttestation = {\n  preencode (state, a) {\n    c.fixed32.preencode(state, a.publicKey)\n    c.fixed64.preencode(state, a.signature)\n  },\n  encode (state, a) {\n    c.fixed32.encode(state, a.publicKey)\n    c.fixed64.encode(state, a.signature)\n  },\n  decode (state) {\n    return {\n      publicKey: c.fixed32.decode(state),\n      signature: c.fixed64.decode(state)\n    }\n  }\n}\n\nconst DeviceAttestationArray = c.array(DeviceAttestation)\n\nconst DataAttestation = {\n  preencode (state, a) {\n    c.fixed64.preencode(state, a.signature)\n  },\n  encode (state, a) {\n    c.fixed64.encode(state, a.signature)\n  },\n  decode (state) {\n    return {\n      signature: c.fixed64.decode(state)\n    }\n  }\n}\n\nconst ProofEncoding = {\n  preencode (state, proof) {\n    c.uint.preencode(state, proof.version)\n    Epoch.preencode(state, proof.epoch)\n    c.fixed32.preencode(state, proof.identity)\n    DeviceAttestationArray.preencode(state, proof.chain)\n\n    let flags = 0\n    if (proof.data) flags |= 1\n    c.uint.preencode(state, flags)\n\n    if (proof.data) DataAttestation.preencode(state, proof.data)\n  },\n  encode (state, proof) {\n    c.uint.encode(state, proof.version)\n    Epoch.encode(state, proof.epoch)\n    c.fixed32.encode(state, proof.identity)\n    DeviceAttestationArray.encode(state, proof.chain)\n\n    let flags = 0\n    if (proof.data) flags |= 1\n    c.uint.encode(state, flags)\n\n    if (proof.data) DataAttestation.encode(state, proof.data)\n  },\n  decode (state) {\n    const version = c.uint.decode(state)\n\n    // ignore v0 proofs\n    if (version === 0) {\n      return {\n        version: 0,\n        epoch: 0,\n        identity: null,\n        chain: [],\n        data: null\n      }\n    }\n\n    const epoch = Epoch.decode(state)\n    const identity = c.fixed32.decode(state)\n    const chain = DeviceAttestationArray.decode(state)\n\n    const flags = c.uint.decode(state)\n    const data = flags & 1 ? DataAttestation.decode(state) : null\n\n    return {\n      version,\n      epoch,\n      identity,\n      chain,\n      data\n    }\n  }\n}\n\nconst ReceiptEncoding = {\n  preencode (state, receipt) {\n    Epoch.preencode(state, receipt.epoch)\n  },\n  encode (state, receipt) {\n    Epoch.encode(state, receipt.epoch)\n  },\n  decode (state) {\n    return {\n      epoch: Epoch.decode(state)\n    }\n  }\n}\n\nmodule.exports = {\n  ATTESTED_DEVICE,\n  ATTESTED_DATA,\n  AttestedDevice,\n  AttestedData,\n  ProofEncoding,\n  ReceiptEncoding\n}\nconst sodium = require('sodium-universal')\nconst c = require('compact-encoding')\nconst assert = require('nanoassert')\nconst b4a = require('b4a')\nconst { HMAC } = require('sodium-hmac')\nconst bip39 = require('bip39-mnemonic')\n\nconst { sign } = require('./crypto')\n\nconst MASTER_CHAIN_CODE = b4a.from('ed25519 seed')\nconst MASTER_SYMMETRIC_CODE = b4a.from('Symmetric key seed')\n\nconst HARDENED_OFFSET = 0x80000000\n\nclass KeyChain {\n  constructor (seed) {\n    this.seed = seed\n\n    this._buffer = b4a.alloc(64)\n\n    this.chainKey = this._buffer.subarray(0, 32)\n    this.chainCode = this._buffer.subarray(32)\n\n    this.publicKey = b4a.alloc(sodium.crypto_sign_PUBLICKEYBYTES)\n    this.secretKey = b4a.alloc(sodium.crypto_sign_SECRETKEYBYTES)\n\n    this._initialise()\n  }\n\n  static generateMnemonic () {\n    return bip39.generateMnemonic()\n  }\n\n  static deriveSeed (mnemonic) {\n    return bip39.mnemonicToSeed(mnemonic)\n  }\n\n  static async from ({ mnemonic, seed }, path) {\n    assert(mnemonic || seed, 'No mnemonic or seed was passed.')\n\n    if (!seed) seed = await KeyChain.deriveSeed(mnemonic)\n\n    const key = new KeyChain(seed)\n\n    if (!path) return key\n\n    return key.get(path)\n  }\n\n  getSymmetricKey (path) {\n    const buffer = b4a.alloc(64)\n\n    const chainKey = buffer.subarray(0, 32)\n    const key = buffer.subarray(32)\n\n    HMAC.sha512(this.seed, MASTER_SYMMETRIC_CODE, buffer)\n\n    for (const step of path) {\n      const label = b4a.alloc(step.length + 1)\n      b4a.write(label, step, 1, 'utf8')\n\n      HMAC.sha512(label, chainKey, buffer)\n    }\n\n    return key\n  }\n\n  get isKeychain () {\n    return true\n  }\n\n  _initialise () {\n    HMAC.sha512(this.seed, MASTER_CHAIN_CODE, this._buffer)\n    sodium.crypto_sign_seed_keypair(this.publicKey, this.secretKey, this.chainKey)\n  }\n\n  clear () {\n    this.secretKey.fill(0)\n    this.chainKey.fill(0)\n    this.chainCode.fill(0)\n  }\n\n  get (path) {\n    return this.derive(path)\n  }\n\n  sign (signable) {\n    return sign(signable, this)\n  }\n\n  derive (path) {\n    const buffer = b4a.from(this._buffer)\n\n    const chainKey = buffer.subarray(0, 32)\n    const chainCode = buffer.subarray(32)\n\n    for (const step of path) {\n      const index = ensureHardened(step) // hardened indices are >= 2^31\n      HMAC.sha512(encodeDerivationData(chainKey, index), chainCode, buffer)\n    }\n\n    return createKeyPair(chainKey)\n  }\n}\n\nmodule.exports = KeyChain\n\nfunction createKeyPair (seed) {\n  if (!seed) throw new Error('No seed provided')\n\n  const publicKey = b4a.alloc(sodium.crypto_sign_PUBLICKEYBYTES)\n  const secretKey = b4a.alloc(sodium.crypto_sign_SECRETKEYBYTES)\n\n  sodium.crypto_sign_seed_keypair(publicKey, secretKey, seed)\n\n  return {\n    publicKey,\n    secretKey\n  }\n}\n\nfunction encodeDerivationData (key, step) {\n  const state = { buffer: b4a.alloc(37), start: 0, end: 37 }\n\n  c.uint8.encode(state, 0)\n  c.fixed32.encode(state, key)\n  state.buffer.writeUInt32BE(step, state.start)\n\n  state.buffer[33] |= 0x80\n\n  return state.buffer\n}\n\nfunction ensureHardened (n) {\n  if (n >= HARDENED_OFFSET) return n\n  return n + HARDENED_OFFSET\n}\n{\n  \"name\": \"keet-identity-key\",\n  \"version\": \"3.1.0\",\n  \"description\": \"Hierarchical Deterministic Keys for Keet Identities\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"standard && brittle test/*.js\"\n  },\n  \"author\": \"Holepunch Inc.\",\n  \"license\": \"Apache-2.0\",\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"hypercore-crypto\": \"^3.4.0\",\n    \"standard\": \"^17.1.0\"\n  },\n  \"dependencies\": {\n    \"bip39-mnemonic\": \"^2.2.0\",\n    \"b4a\": \"^1.6.4\",\n    \"compact-encoding\": \"^2.13.0\",\n    \"nanoassert\": \"^2.0.0\",\n    \"sodium-hmac\": \"^2.0.1\",\n    \"sodium-universal\": \"^5.0.1\"\n  },\n  \"files\": [\n    \"lib/*\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/keet-identity-key.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/keet-identity-key/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/keet-identity-key#readme\"\n}\n\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WalletPolicy = exports.DefaultWalletPolicy = exports.PsbtV2 = exports.AppClient = void 0;\nconst appClient_1 = __importDefault(require(\"./lib/appClient\"));\nexports.AppClient = appClient_1.default;\nconst policy_1 = require(\"./lib/policy\");\nObject.defineProperty(exports, \"DefaultWalletPolicy\", { enumerable: true, get: function () { return policy_1.DefaultWalletPolicy; } });\nObject.defineProperty(exports, \"WalletPolicy\", { enumerable: true, get: function () { return policy_1.WalletPolicy; } });\nconst psbtv2_1 = require(\"./lib/psbtv2\");\nObject.defineProperty(exports, \"PsbtV2\", { enumerable: true, get: function () { return psbtv2_1.PsbtV2; } });\nexports.default = appClient_1.default;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsZ0VBQXdDO0FBU3RDLG9CQVRLLG1CQUFTLENBU0w7QUFSWCx5Q0FJc0I7QUFPcEIsb0dBVEEsNEJBQW1CLE9BU0E7QUFDbkIsNkZBVEEscUJBQVksT0FTQTtBQVBkLHlDQUFzQztBQUlwQyx1RkFKTyxlQUFNLE9BSVA7QUFNUixrQkFBZSxtQkFBUyxDQUFDIn0=\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AppClient = exports.PartialSignature = void 0;\nconst bip32_1 = require(\"./bip32\");\nconst clientCommands_1 = require(\"./clientCommands\");\nconst merkelizedPsbt_1 = require(\"./merkelizedPsbt\");\nconst merkle_1 = require(\"./merkle\");\nconst psbtv2_1 = require(\"./psbtv2\");\nconst varint_1 = require(\"./varint\");\nconst CLA_BTC = 0xe1;\nconst CLA_FRAMEWORK = 0xf8;\nconst CURRENT_PROTOCOL_VERSION = 1; // supported from version 2.1.0 of the app\nvar BitcoinIns;\n(function (BitcoinIns) {\n    BitcoinIns[BitcoinIns[\"GET_PUBKEY\"] = 0] = \"GET_PUBKEY\";\n    BitcoinIns[BitcoinIns[\"REGISTER_WALLET\"] = 2] = \"REGISTER_WALLET\";\n    BitcoinIns[BitcoinIns[\"GET_WALLET_ADDRESS\"] = 3] = \"GET_WALLET_ADDRESS\";\n    BitcoinIns[BitcoinIns[\"SIGN_PSBT\"] = 4] = \"SIGN_PSBT\";\n    BitcoinIns[BitcoinIns[\"GET_MASTER_FINGERPRINT\"] = 5] = \"GET_MASTER_FINGERPRINT\";\n    BitcoinIns[BitcoinIns[\"SIGN_MESSAGE\"] = 16] = \"SIGN_MESSAGE\";\n})(BitcoinIns || (BitcoinIns = {}));\nvar FrameworkIns;\n(function (FrameworkIns) {\n    FrameworkIns[FrameworkIns[\"CONTINUE_INTERRUPTED\"] = 1] = \"CONTINUE_INTERRUPTED\";\n})(FrameworkIns || (FrameworkIns = {}));\n/**\n * This class represents a partial signature produced by the app during signing.\n * It always contains the `signature` and the corresponding `pubkey` whose private key\n * was used for signing; in the case of taproot script paths, it also contains the\n * tapleaf hash.\n */\nclass PartialSignature {\n    constructor(pubkey, signature, tapleafHash) {\n        this.pubkey = pubkey;\n        this.signature = signature;\n        this.tapleafHash = tapleafHash;\n    }\n}\nexports.PartialSignature = PartialSignature;\n/**\n * Creates an instance of `PartialSignature` from the returned raw augmented pubkey and signature.\n * @param pubkeyAugm the public key, concatenated with the tapleaf hash in the case of taproot script path spend.\n * @param signature the signature\n * @returns an instance of `PartialSignature`.\n */\nfunction makePartialSignature(pubkeyAugm, signature) {\n    if (pubkeyAugm.length == 64) {\n        // tapscript spend: concatenation of 32-bytes x-only pubkey and 32-bytes tapleaf_hash\n        return new PartialSignature(pubkeyAugm.slice(0, 32), signature, pubkeyAugm.slice(32, 64));\n    }\n    else if (pubkeyAugm.length == 32 || pubkeyAugm.length == 33) {\n        // legacy, segwit or taproot keypath spend: pubkeyAugm is just the pubkey\n        return new PartialSignature(pubkeyAugm, signature);\n    }\n    else {\n        throw new Error(`Invalid length for pubkeyAugm: ${pubkeyAugm.length} bytes.`);\n    }\n}\n/**\n * Checks whether a descriptor template contains an `a:` fragment.\n */\nfunction containsA(descriptorTemplate) {\n    const matches = descriptorTemplate.match(/[asctdvjnlu]+:/g) || [];\n    return matches.some(match => match.includes('a'));\n}\n/**\n * This class encapsulates the APDU protocol documented at\n * https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md\n */\nclass AppClient {\n    constructor(transport) {\n        this.transport = transport;\n    }\n    async makeRequest(ins, data, cci) {\n        let response = await this.transport.send(CLA_BTC, ins, 0, CURRENT_PROTOCOL_VERSION, data, [0x9000, 0xe000]);\n        while (response.readUInt16BE(response.length - 2) === 0xe000) {\n            if (!cci) {\n                throw new Error('Unexpected SW_INTERRUPTED_EXECUTION');\n            }\n            const hwRequest = response.slice(0, -2);\n            const commandResponse = cci.execute(hwRequest);\n            response = await this.transport.send(CLA_FRAMEWORK, FrameworkIns.CONTINUE_INTERRUPTED, 0, 0, commandResponse, [0x9000, 0xe000]);\n        }\n        return response.slice(0, -2); // drop the status word (can only be 0x9000 at this point)\n    }\n    /**\n     * Returns an object containing the currently running app's name, version and the device status flags.\n     *\n     * @returns an object with app name, version and device status flags.\n     */\n    async getAppAndVersion() {\n        const r = await this.transport.send(0xb0, 0x01, 0x00, 0x00);\n        let i = 0;\n        const format = r[i++];\n        if (format !== 1)\n            throw new Error(\"Unexpected response\");\n        const nameLength = r[i++];\n        const name = r.slice(i, (i += nameLength)).toString(\"ascii\");\n        const versionLength = r[i++];\n        const version = r.slice(i, (i += versionLength)).toString(\"ascii\");\n        const flagLength = r[i++];\n        const flags = r.slice(i, (i += flagLength));\n        return {\n            name,\n            version,\n            flags,\n        };\n    }\n    ;\n    /**\n     * Requests the BIP-32 extended pubkey to the hardware wallet.\n     * If `display` is `false`, only standard paths will be accepted; an error is returned if an unusual path is\n     * requested.\n     * If `display` is `true`, the requested path is shown on screen for user verification; unusual paths can be\n     * requested, and a warning is shown to the user in that case.\n     *\n     * @param path the requested BIP-32 path as a string\n     * @param display `false` to silently retrieve a pubkey for a standard path, `true` to display the path on screen\n     * @returns the base58-encoded serialized extended pubkey (xpub)\n     */\n    async getExtendedPubkey(path, display = false) {\n        const pathElements = (0, bip32_1.pathStringToArray)(path);\n        if (pathElements.length > 6) {\n            throw new Error('Path too long. At most 6 levels allowed.');\n        }\n        const response = await this.makeRequest(BitcoinIns.GET_PUBKEY, Buffer.concat([\n            Buffer.from(display ? [1] : [0]),\n            (0, bip32_1.pathElementsToBuffer)(pathElements),\n        ]));\n        return response.toString('ascii');\n    }\n    /**\n     * Registers a `WalletPolicy`, after interactive verification from the user.\n     * On success, after user's approval, this function returns the id (which is the same that can be computed with\n     * `walletPolicy.getid()`), followed by the 32-byte hmac. The client should store the hmac to use it for future\n     * requests to `getWalletAddress` or `signPsbt` using this `WalletPolicy`.\n     *\n     * @param walletPolicy the `WalletPolicy` to register\n     * @returns a pair of two 32-byte arrays: the id of the Wallet Policy, followed by the policy hmac\n     */\n    async registerWallet(walletPolicy) {\n        await this.validatePolicy(walletPolicy);\n        const clientInterpreter = new clientCommands_1.ClientCommandInterpreter();\n        clientInterpreter.addKnownWalletPolicy(walletPolicy);\n        const serializedWalletPolicy = walletPolicy.serialize();\n        const response = await this.makeRequest(BitcoinIns.REGISTER_WALLET, Buffer.concat([\n            (0, varint_1.createVarint)(serializedWalletPolicy.length),\n            serializedWalletPolicy,\n        ]), clientInterpreter);\n        if (response.length != 64) {\n            throw Error(`Invalid response length. Expected 64 bytes, got ${response.length}`);\n        }\n        return [response.subarray(0, 32), response.subarray(32)];\n    }\n    /**\n     * Returns the address of `walletPolicy` for the given `change` and `addressIndex`.\n     *\n     * @param walletPolicy the `WalletPolicy` to use\n     * @param walletHMAC the 32-byte hmac returned during wallet registration for a registered policy; otherwise\n     * `null` for a standard policy\n     * @param change `0` for a normal receive address, `1` for a change address\n     * @param addressIndex the address index to retrieve\n     * @param display `True` to show the address on screen, `False` to retrieve it silently\n     * @returns the address, as an ascii string.\n     */\n    async getWalletAddress(walletPolicy, walletHMAC, change, addressIndex, display) {\n        if (change !== 0 && change !== 1)\n            throw new Error('Change can only be 0 or 1');\n        if (addressIndex < 0 || !Number.isInteger(addressIndex))\n            throw new Error('Invalid address index');\n        if (walletHMAC != null && walletHMAC.length != 32) {\n            throw new Error('Invalid HMAC length');\n        }\n        await this.validatePolicy(walletPolicy);\n        const clientInterpreter = new clientCommands_1.ClientCommandInterpreter();\n        clientInterpreter.addKnownWalletPolicy(walletPolicy);\n        const addressIndexBuffer = Buffer.alloc(4);\n        addressIndexBuffer.writeUInt32BE(addressIndex, 0);\n        const response = await this.makeRequest(BitcoinIns.GET_WALLET_ADDRESS, Buffer.concat([\n            Buffer.from(display ? [1] : [0]),\n            walletPolicy.getId(),\n            walletHMAC || Buffer.alloc(32, 0),\n            Buffer.from([change]),\n            addressIndexBuffer,\n        ]), clientInterpreter);\n        return response.toString('ascii');\n    }\n    /**\n     * Signs a psbt using a (standard or registered) `WalletPolicy`. This is an interactive command, as user validation\n     * is necessary using the device's secure screen.\n     * On success, a map of input indexes and signatures is returned.\n     * @param psbt a base64-encoded string, or a psbt in a binary Buffer. Using the `PsbtV2` type is deprecated.\n     * @param walletPolicy the `WalletPolicy` to use for signing\n     * @param walletHMAC the 32-byte hmac obtained during wallet policy registration, or `null` for a standard policy\n     * @param progressCallback optionally, a callback that will be called every time a signature is produced during\n     * the signing process. The callback does not receive any argument, but can be used to track progress.\n     * @returns an array of of tuples with 2 elements containing:\n     *    - the index of the input being signed;\n     *    - an instance of PartialSignature\n     */\n    async signPsbt(psbt, walletPolicy, walletHMAC, progressCallback) {\n        await this.validatePolicy(walletPolicy);\n        if (typeof psbt === 'string') {\n            psbt = Buffer.from(psbt, \"base64\");\n        }\n        if (Buffer.isBuffer(psbt)) {\n            const psbtObj = new psbtv2_1.PsbtV2();\n            psbtObj.deserialize(psbt);\n            psbt = psbtObj;\n        }\n        const merkelizedPsbt = new merkelizedPsbt_1.MerkelizedPsbt(psbt);\n        if (walletHMAC != null && walletHMAC.length != 32) {\n            throw new Error('Invalid HMAC length');\n        }\n        const clientInterpreter = new clientCommands_1.ClientCommandInterpreter(progressCallback);\n        // prepare ClientCommandInterpreter\n        clientInterpreter.addKnownWalletPolicy(walletPolicy);\n        clientInterpreter.addKnownMapping(merkelizedPsbt.globalMerkleMap);\n        for (const map of merkelizedPsbt.inputMerkleMaps) {\n            clientInterpreter.addKnownMapping(map);\n        }\n        for (const map of merkelizedPsbt.outputMerkleMaps) {\n            clientInterpreter.addKnownMapping(map);\n        }\n        clientInterpreter.addKnownList(merkelizedPsbt.inputMapCommitments);\n        const inputMapsRoot = new merkle_1.Merkle(merkelizedPsbt.inputMapCommitments.map((m) => (0, merkle_1.hashLeaf)(m))).getRoot();\n        clientInterpreter.addKnownList(merkelizedPsbt.outputMapCommitments);\n        const outputMapsRoot = new merkle_1.Merkle(merkelizedPsbt.outputMapCommitments.map((m) => (0, merkle_1.hashLeaf)(m))).getRoot();\n        await this.makeRequest(BitcoinIns.SIGN_PSBT, Buffer.concat([\n            merkelizedPsbt.getGlobalKeysValuesRoot(),\n            (0, varint_1.createVarint)(merkelizedPsbt.getGlobalInputCount()),\n            inputMapsRoot,\n            (0, varint_1.createVarint)(merkelizedPsbt.getGlobalOutputCount()),\n            outputMapsRoot,\n            walletPolicy.getId(),\n            walletHMAC || Buffer.alloc(32, 0),\n        ]), clientInterpreter);\n        const yielded = clientInterpreter.getYielded();\n        const ret = [];\n        for (const inputAndSig of yielded) {\n            // inputAndSig contains:\n            // <inputIndex : varint> <pubkeyLen : 1 byte> <pubkey : pubkeyLen bytes (32 or 33)> <signature : variable length>\n            const [inputIndex, inputIndexLen] = (0, varint_1.parseVarint)(inputAndSig, 0);\n            const pubkeyAugmLen = inputAndSig[inputIndexLen];\n            const pubkeyAugm = inputAndSig.subarray(inputIndexLen + 1, inputIndexLen + 1 + pubkeyAugmLen);\n            const signature = inputAndSig.subarray(inputIndexLen + 1 + pubkeyAugmLen);\n            const partialSig = makePartialSignature(pubkeyAugm, signature);\n            ret.push([Number(inputIndex), partialSig]);\n        }\n        return ret;\n    }\n    /**\n     * Returns the fingerprint of the master public key, as per BIP-32 standard.\n     * @returns the master key fingerprint as a string of 8 hexadecimal digits.\n     */\n    async getMasterFingerprint() {\n        const fpr = await this.makeRequest(BitcoinIns.GET_MASTER_FINGERPRINT, Buffer.from([]));\n        return fpr.toString(\"hex\");\n    }\n    /**\n     * Signs a message using the legacy Bitcoin Message Signing standard. The signed message is\n     * the double-sha256 hash of the concatenation of:\n     * - \"\\x18Bitcoin Signed Message:\\n\";\n     * - the length of `message`, encoded as a Bitcoin-style variable length integer;\n     * - `message`.\n     *\n     * @param message the serialized message to sign\n     * @param path the BIP-32 path of the key used to sign the message\n     * @returns base64-encoded signature of the message.\n     */\n    async signMessage(message, path) {\n        const pathElements = (0, bip32_1.pathStringToArray)(path);\n        const clientInterpreter = new clientCommands_1.ClientCommandInterpreter();\n        // prepare ClientCommandInterpreter\n        const nChunks = Math.ceil(message.length / 64);\n        const chunks = [];\n        for (let i = 0; i < nChunks; i++) {\n            chunks.push(message.subarray(64 * i, 64 * i + 64));\n        }\n        clientInterpreter.addKnownList(chunks);\n        const chunksRoot = new merkle_1.Merkle(chunks.map((m) => (0, merkle_1.hashLeaf)(m))).getRoot();\n        const result = await this.makeRequest(BitcoinIns.SIGN_MESSAGE, Buffer.concat([\n            (0, bip32_1.pathElementsToBuffer)(pathElements),\n            (0, varint_1.createVarint)(message.length),\n            chunksRoot,\n        ]), clientInterpreter);\n        return result.toString('base64');\n    }\n    /* Performs any additional checks on the policy before using it.*/\n    async validatePolicy(walletPolicy) {\n        if (containsA(walletPolicy.descriptorTemplate)) {\n            const appAndVer = await this.getAppAndVersion();\n            if ([\"2.1.0\", \"2.1.1\"].includes(appAndVer.version)) {\n                // Versions 2.1.0 and 2.1.1 produced incorrect scripts for policies containing\n                // the `a:` fragment.\n                throw new Error(\"Please update your Ledger Bitcoin app.\");\n            }\n        }\n    }\n}\nexports.AppClient = AppClient;\nexports.default = AppClient;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwQ2xpZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9hcHBDbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsbUNBQWtFO0FBQ2xFLHFEQUE0RDtBQUM1RCxxREFBa0Q7QUFDbEQscUNBQTRDO0FBRTVDLHFDQUFrQztBQUNsQyxxQ0FBcUQ7QUFFckQsTUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDO0FBQ3JCLE1BQU0sYUFBYSxHQUFHLElBQUksQ0FBQztBQUUzQixNQUFNLHdCQUF3QixHQUFHLENBQUMsQ0FBQyxDQUFDLDBDQUEwQztBQUU5RSxJQUFLLFVBT0o7QUFQRCxXQUFLLFVBQVU7SUFDYix1REFBaUIsQ0FBQTtJQUNqQixpRUFBc0IsQ0FBQTtJQUN0Qix1RUFBeUIsQ0FBQTtJQUN6QixxREFBZ0IsQ0FBQTtJQUNoQiwrRUFBNkIsQ0FBQTtJQUM3Qiw0REFBbUIsQ0FBQTtBQUNyQixDQUFDLEVBUEksVUFBVSxLQUFWLFVBQVUsUUFPZDtBQUVELElBQUssWUFFSjtBQUZELFdBQUssWUFBWTtJQUNmLCtFQUEyQixDQUFBO0FBQzdCLENBQUMsRUFGSSxZQUFZLEtBQVosWUFBWSxRQUVoQjtBQUVEOzs7OztHQUtHO0FBQ0gsTUFBYSxnQkFBZ0I7SUFLM0IsWUFBWSxNQUFjLEVBQUUsU0FBaUIsRUFBRSxXQUFvQjtRQUNqRSxJQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQztRQUNyQixJQUFJLENBQUMsU0FBUyxHQUFHLFNBQVMsQ0FBQztRQUMzQixJQUFJLENBQUMsV0FBVyxHQUFHLFdBQVcsQ0FBQztJQUNqQyxDQUFDO0NBQ0Y7QUFWRCw0Q0FVQztBQUVEOzs7OztHQUtHO0FBQ0gsU0FBUyxvQkFBb0IsQ0FBQyxVQUFrQixFQUFFLFNBQWlCO0lBQ2pFLElBQUksVUFBVSxDQUFDLE1BQU0sSUFBSSxFQUFFLEVBQUU7UUFDM0IscUZBQXFGO1FBQ3JGLE9BQU8sSUFBSSxnQkFBZ0IsQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsRUFBRSxTQUFTLEVBQUUsVUFBVSxDQUFDLEtBQUssQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQztLQUMzRjtTQUFNLElBQUksVUFBVSxDQUFDLE1BQU0sSUFBSSxFQUFFLElBQUksVUFBVSxDQUFDLE1BQU0sSUFBSSxFQUFFLEVBQUU7UUFDN0QseUVBQXlFO1FBQ3pFLE9BQU8sSUFBSSxnQkFBZ0IsQ0FBQyxVQUFVLEVBQUUsU0FBUyxDQUFDLENBQUM7S0FDcEQ7U0FBTTtRQUNMLE1BQU0sSUFBSSxLQUFLLENBQUMsa0NBQWtDLFVBQVUsQ0FBQyxNQUFNLFNBQVMsQ0FBQyxDQUFDO0tBQy9FO0FBQ0gsQ0FBQztBQUVEOztHQUVHO0FBQ0gsU0FBUyxTQUFTLENBQUMsa0JBQTBCO0lBQzNDLE1BQU0sT0FBTyxHQUFHLGtCQUFrQixDQUFDLEtBQUssQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLEVBQUUsQ0FBQztJQUNsRSxPQUFPLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFDcEQsQ0FBQztBQUVEOzs7R0FHRztBQUNILE1BQWEsU0FBUztJQUdwQixZQUFZLFNBQW9CO1FBQzlCLElBQUksQ0FBQyxTQUFTLEdBQUcsU0FBUyxDQUFDO0lBQzdCLENBQUM7SUFFTyxLQUFLLENBQUMsV0FBVyxDQUN2QixHQUFlLEVBQ2YsSUFBWSxFQUNaLEdBQThCO1FBRTlCLElBQUksUUFBUSxHQUFXLE1BQU0sSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQzlDLE9BQU8sRUFDUCxHQUFHLEVBQ0gsQ0FBQyxFQUNELHdCQUF3QixFQUN4QixJQUFJLEVBQ0osQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLENBQ2pCLENBQUM7UUFDRixPQUFPLFFBQVEsQ0FBQyxZQUFZLENBQUMsUUFBUSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsS0FBSyxNQUFNLEVBQUU7WUFDNUQsSUFBSSxDQUFDLEdBQUcsRUFBRTtnQkFDUixNQUFNLElBQUksS0FBSyxDQUFDLHFDQUFxQyxDQUFDLENBQUM7YUFDeEQ7WUFFRCxNQUFNLFNBQVMsR0FBRyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQ3hDLE1BQU0sZUFBZSxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7WUFFL0MsUUFBUSxHQUFHLE1BQU0sSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQ2xDLGFBQWEsRUFDYixZQUFZLENBQUMsb0JBQW9CLEVBQ2pDLENBQUMsRUFDRCxDQUFDLEVBQ0QsZUFBZSxFQUNmLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxDQUNqQixDQUFDO1NBQ0g7UUFDRCxPQUFPLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQywwREFBMEQ7SUFDMUYsQ0FBQztJQUVEOzs7O09BSUc7SUFDSSxLQUFLLENBQUMsZ0JBQWdCO1FBSzNCLE1BQU0sQ0FBQyxHQUFHLE1BQU0sSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7UUFDNUQsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ1YsTUFBTSxNQUFNLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDdEIsSUFBSSxNQUFNLEtBQUssQ0FBQztZQUFFLE1BQU0sSUFBSSxLQUFLLENBQUMscUJBQXFCLENBQUMsQ0FBQTtRQUV4RCxNQUFNLFVBQVUsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUMxQixNQUFNLElBQUksR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsSUFBSSxVQUFVLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUM3RCxNQUFNLGFBQWEsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUM3QixNQUFNLE9BQU8sR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsSUFBSSxhQUFhLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUNuRSxNQUFNLFVBQVUsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUMxQixNQUFNLEtBQUssR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsSUFBSSxVQUFVLENBQUMsQ0FBQyxDQUFDO1FBQzVDLE9BQU87WUFDTCxJQUFJO1lBQ0osT0FBTztZQUNQLEtBQUs7U0FDTixDQUFDO0lBQ0osQ0FBQztJQUFBLENBQUM7SUFFRjs7Ozs7Ozs7OztPQVVHO0lBQ0gsS0FBSyxDQUFDLGlCQUFpQixDQUNyQixJQUFZLEVBQ1osVUFBbUIsS0FBSztRQUV4QixNQUFNLFlBQVksR0FBRyxJQUFBLHlCQUFpQixFQUFDLElBQUksQ0FBQyxDQUFDO1FBQzdDLElBQUksWUFBWSxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUU7WUFDM0IsTUFBTSxJQUFJLEtBQUssQ0FBQywwQ0FBMEMsQ0FBQyxDQUFDO1NBQzdEO1FBQ0QsTUFBTSxRQUFRLEdBQUcsTUFBTSxJQUFJLENBQUMsV0FBVyxDQUNyQyxVQUFVLENBQUMsVUFBVSxFQUNyQixNQUFNLENBQUMsTUFBTSxDQUFDO1lBQ1osTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDaEMsSUFBQSw0QkFBb0IsRUFBQyxZQUFZLENBQUM7U0FDbkMsQ0FBQyxDQUNILENBQUM7UUFDRixPQUFPLFFBQVEsQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDcEMsQ0FBQztJQUVEOzs7Ozs7OztPQVFHO0lBQ0gsS0FBSyxDQUFDLGNBQWMsQ0FDbEIsWUFBMEI7UUFHMUIsTUFBTSxJQUFJLENBQUMsY0FBYyxDQUFDLFlBQVksQ0FBQyxDQUFDO1FBRXhDLE1BQU0saUJBQWlCLEdBQUcsSUFBSSx5Q0FBd0IsRUFBRSxDQUFDO1FBRXpELGlCQUFpQixDQUFDLG9CQUFvQixDQUFDLFlBQVksQ0FBQyxDQUFDO1FBRXJELE1BQU0sc0JBQXNCLEdBQUcsWUFBWSxDQUFDLFNBQVMsRUFBRSxDQUFDO1FBQ3hELE1BQU0sUUFBUSxHQUFHLE1BQU0sSUFBSSxDQUFDLFdBQVcsQ0FDckMsVUFBVSxDQUFDLGVBQWUsRUFDMUIsTUFBTSxDQUFDLE1BQU0sQ0FBQztZQUNaLElBQUEscUJBQVksRUFBQyxzQkFBc0IsQ0FBQyxNQUFNLENBQUM7WUFDM0Msc0JBQXNCO1NBQ3ZCLENBQUMsRUFDRixpQkFBaUIsQ0FDbEIsQ0FBQztRQUVGLElBQUksUUFBUSxDQUFDLE1BQU0sSUFBSSxFQUFFLEVBQUU7WUFDekIsTUFBTSxLQUFLLENBQ1QsbURBQW1ELFFBQVEsQ0FBQyxNQUFNLEVBQUUsQ0FDckUsQ0FBQztTQUNIO1FBRUQsT0FBTyxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxFQUFFLFFBQVEsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztJQUMzRCxDQUFDO0lBRUQ7Ozs7Ozs7Ozs7T0FVRztJQUNILEtBQUssQ0FBQyxnQkFBZ0IsQ0FDcEIsWUFBMEIsRUFDMUIsVUFBeUIsRUFDekIsTUFBYyxFQUNkLFlBQW9CLEVBQ3BCLE9BQWdCO1FBRWhCLElBQUksTUFBTSxLQUFLLENBQUMsSUFBSSxNQUFNLEtBQUssQ0FBQztZQUM5QixNQUFNLElBQUksS0FBSyxDQUFDLDJCQUEyQixDQUFDLENBQUM7UUFDL0MsSUFBSSxZQUFZLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxZQUFZLENBQUM7WUFDckQsTUFBTSxJQUFJLEtBQUssQ0FBQyx1QkFBdUIsQ0FBQyxDQUFDO1FBRTNDLElBQUksVUFBVSxJQUFJLElBQUksSUFBSSxVQUFVLENBQUMsTUFBTSxJQUFJLEVBQUUsRUFBRTtZQUNqRCxNQUFNLElBQUksS0FBSyxDQUFDLHFCQUFxQixDQUFDLENBQUM7U0FDeEM7UUFFRCxNQUFNLElBQUksQ0FBQyxjQUFjLENBQUMsWUFBWSxDQUFDLENBQUM7UUFFeEMsTUFBTSxpQkFBaUIsR0FBRyxJQUFJLHlDQUF3QixFQUFFLENBQUM7UUFFekQsaUJBQWlCLENBQUMsb0JBQW9CLENBQUMsWUFBWSxDQUFDLENBQUM7UUFFckQsTUFBTSxrQkFBa0IsR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzNDLGtCQUFrQixDQUFDLGFBQWEsQ0FBQyxZQUFZLEVBQUUsQ0FBQyxDQUFDLENBQUM7UUFFbEQsTUFBTSxRQUFRLEdBQUcsTUFBTSxJQUFJLENBQUMsV0FBVyxDQUNyQyxVQUFVLENBQUMsa0JBQWtCLEVBQzdCLE1BQU0sQ0FBQyxNQUFNLENBQUM7WUFDWixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztZQUNoQyxZQUFZLENBQUMsS0FBSyxFQUFFO1lBQ3BCLFVBQVUsSUFBSSxNQUFNLENBQUMsS0FBSyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUM7WUFDakMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1lBQ3JCLGtCQUFrQjtTQUNuQixDQUFDLEVBQ0YsaUJBQWlCLENBQ2xCLENBQUM7UUFFRixPQUFPLFFBQVEsQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDcEMsQ0FBQztJQUVEOzs7Ozs7Ozs7Ozs7T0FZRztJQUNILEtBQUssQ0FBQyxRQUFRLENBQ1osSUFBOEIsRUFDOUIsWUFBMEIsRUFDMUIsVUFBeUIsRUFDekIsZ0JBQTZCO1FBRTdCLE1BQU0sSUFBSSxDQUFDLGNBQWMsQ0FBQyxZQUFZLENBQUMsQ0FBQztRQUV4QyxJQUFJLE9BQU8sSUFBSSxLQUFLLFFBQVEsRUFBRTtZQUM1QixJQUFJLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsUUFBUSxDQUFDLENBQUM7U0FDcEM7UUFFRCxJQUFJLE1BQU0sQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEVBQUU7WUFDekIsTUFBTSxPQUFPLEdBQUcsSUFBSSxlQUFNLEVBQUUsQ0FBQTtZQUM1QixPQUFPLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQzFCLElBQUksR0FBRyxPQUFPLENBQUM7U0FDaEI7UUFFRCxNQUFNLGNBQWMsR0FBRyxJQUFJLCtCQUFjLENBQUMsSUFBSSxDQUFDLENBQUM7UUFFaEQsSUFBSSxVQUFVLElBQUksSUFBSSxJQUFJLFVBQVUsQ0FBQyxNQUFNLElBQUksRUFBRSxFQUFFO1lBQ2pELE1BQU0sSUFBSSxLQUFLLENBQUMscUJBQXFCLENBQUMsQ0FBQztTQUN4QztRQUVELE1BQU0saUJBQWlCLEdBQUcsSUFBSSx5Q0FBd0IsQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO1FBRXpFLG1DQUFtQztRQUNuQyxpQkFBaUIsQ0FBQyxvQkFBb0IsQ0FBQyxZQUFZLENBQUMsQ0FBQztRQUVyRCxpQkFBaUIsQ0FBQyxlQUFlLENBQUMsY0FBYyxDQUFDLGVBQWUsQ0FBQyxDQUFDO1FBQ2xFLEtBQUssTUFBTSxHQUFHLElBQUksY0FBYyxDQUFDLGVBQWUsRUFBRTtZQUNoRCxpQkFBaUIsQ0FBQyxlQUFlLENBQUMsR0FBRyxDQUFDLENBQUM7U0FDeEM7UUFDRCxLQUFLLE1BQU0sR0FBRyxJQUFJLGNBQWMsQ0FBQyxnQkFBZ0IsRUFBRTtZQUNqRCxpQkFBaUIsQ0FBQyxlQUFlLENBQUMsR0FBRyxDQUFDLENBQUM7U0FDeEM7UUFFRCxpQkFBaUIsQ0FBQyxZQUFZLENBQUMsY0FBYyxDQUFDLG1CQUFtQixDQUFDLENBQUM7UUFDbkUsTUFBTSxhQUFhLEdBQUcsSUFBSSxlQUFNLENBQzlCLGNBQWMsQ0FBQyxtQkFBbUIsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLElBQUEsaUJBQVEsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUMzRCxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBQ1osaUJBQWlCLENBQUMsWUFBWSxDQUFDLGNBQWMsQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO1FBQ3BFLE1BQU0sY0FBYyxHQUFHLElBQUksZUFBTSxDQUMvQixjQUFjLENBQUMsb0JBQW9CLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxJQUFBLGlCQUFRLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FDNUQsQ0FBQyxPQUFPLEVBQUUsQ0FBQztRQUVaLE1BQU0sSUFBSSxDQUFDLFdBQVcsQ0FDcEIsVUFBVSxDQUFDLFNBQVMsRUFDcEIsTUFBTSxDQUFDLE1BQU0sQ0FBQztZQUNaLGNBQWMsQ0FBQyx1QkFBdUIsRUFBRTtZQUN4QyxJQUFBLHFCQUFZLEVBQUMsY0FBYyxDQUFDLG1CQUFtQixFQUFFLENBQUM7WUFDbEQsYUFBYTtZQUNiLElBQUEscUJBQVksRUFBQyxjQUFjLENBQUMsb0JBQW9CLEVBQUUsQ0FBQztZQUNuRCxjQUFjO1lBQ2QsWUFBWSxDQUFDLEtBQUssRUFBRTtZQUNwQixVQUFVLElBQUksTUFBTSxDQUFDLEtBQUssQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDO1NBQ2xDLENBQUMsRUFDRixpQkFBaUIsQ0FDbEIsQ0FBQztRQUVGLE1BQU0sT0FBTyxHQUFHLGlCQUFpQixDQUFDLFVBQVUsRUFBRSxDQUFDO1FBRS9DLE1BQU0sR0FBRyxHQUFpQyxFQUFFLENBQUM7UUFDN0MsS0FBSyxNQUFNLFdBQVcsSUFBSSxPQUFPLEVBQUU7WUFDakMsd0JBQXdCO1lBQ3hCLGlIQUFpSDtZQUNqSCxNQUFNLENBQUMsVUFBVSxFQUFFLGFBQWEsQ0FBQyxHQUFHLElBQUEsb0JBQVcsRUFBQyxXQUFXLEVBQUUsQ0FBQyxDQUFDLENBQUM7WUFDaEUsTUFBTSxhQUFhLEdBQUcsV0FBVyxDQUFDLGFBQWEsQ0FBQyxDQUFDO1lBQ2pELE1BQU0sVUFBVSxHQUFHLFdBQVcsQ0FBQyxRQUFRLENBQUMsYUFBYSxHQUFHLENBQUMsRUFBRSxhQUFhLEdBQUcsQ0FBQyxHQUFHLGFBQWEsQ0FBQyxDQUFDO1lBQzlGLE1BQU0sU0FBUyxHQUFHLFdBQVcsQ0FBQyxRQUFRLENBQUMsYUFBYSxHQUFHLENBQUMsR0FBRyxhQUFhLENBQUMsQ0FBQTtZQUV6RSxNQUFNLFVBQVUsR0FBRyxvQkFBb0IsQ0FBQyxVQUFVLEVBQUUsU0FBUyxDQUFDLENBQUM7WUFFL0QsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDLE1BQU0sQ0FBQyxVQUFVLENBQUMsRUFBRSxVQUFVLENBQUMsQ0FBQyxDQUFDO1NBQzVDO1FBQ0QsT0FBTyxHQUFHLENBQUM7SUFDYixDQUFDO0lBRUQ7OztPQUdHO0lBQ0gsS0FBSyxDQUFDLG9CQUFvQjtRQUN4QixNQUFNLEdBQUcsR0FBRyxNQUFNLElBQUksQ0FBQyxXQUFXLENBQUMsVUFBVSxDQUFDLHNCQUFzQixFQUFFLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztRQUN2RixPQUFPLEdBQUcsQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDN0IsQ0FBQztJQUVEOzs7Ozs7Ozs7O09BVUc7SUFDSCxLQUFLLENBQUMsV0FBVyxDQUNmLE9BQWUsRUFDZixJQUFZO1FBRVosTUFBTSxZQUFZLEdBQUcsSUFBQSx5QkFBaUIsRUFBQyxJQUFJLENBQUMsQ0FBQztRQUU3QyxNQUFNLGlCQUFpQixHQUFHLElBQUkseUNBQXdCLEVBQUUsQ0FBQztRQUV6RCxtQ0FBbUM7UUFDbkMsTUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxHQUFHLEVBQUUsQ0FBQyxDQUFDO1FBQy9DLE1BQU0sTUFBTSxHQUFhLEVBQUUsQ0FBQztRQUM1QixLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsT0FBTyxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQ2hDLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxFQUFFLEVBQUUsR0FBRyxDQUFDLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQztTQUNwRDtRQUVELGlCQUFpQixDQUFDLFlBQVksQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUN2QyxNQUFNLFVBQVUsR0FBRyxJQUFJLGVBQU0sQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxJQUFBLGlCQUFRLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBRXhFLE1BQU0sTUFBTSxHQUFHLE1BQU0sSUFBSSxDQUFDLFdBQVcsQ0FDbkMsVUFBVSxDQUFDLFlBQVksRUFDdkIsTUFBTSxDQUFDLE1BQU0sQ0FBQztZQUNaLElBQUEsNEJBQW9CLEVBQUMsWUFBWSxDQUFDO1lBQ2xDLElBQUEscUJBQVksRUFBQyxPQUFPLENBQUMsTUFBTSxDQUFDO1lBQzVCLFVBQVU7U0FDWCxDQUFDLEVBQ0YsaUJBQWlCLENBQ2xCLENBQUM7UUFFRixPQUFPLE1BQU0sQ0FBQyxRQUFRLENBQUMsUUFBUSxDQUFDLENBQUM7SUFDbkMsQ0FBQztJQUVELGtFQUFrRTtJQUMxRCxLQUFLLENBQUMsY0FBYyxDQUFDLFlBQTBCO1FBQ3JELElBQUksU0FBUyxDQUFDLFlBQVksQ0FBQyxrQkFBa0IsQ0FBQyxFQUFFO1lBQzlDLE1BQU0sU0FBUyxHQUFHLE1BQU0sSUFBSSxDQUFDLGdCQUFnQixFQUFFLENBQUM7WUFDaEQsSUFBSSxDQUFDLE9BQU8sRUFBRSxPQUFPLENBQUMsQ0FBQyxRQUFRLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxFQUFFO2dCQUNsRCw4RUFBOEU7Z0JBQzlFLHFCQUFxQjtnQkFDckIsTUFBTSxJQUFJLEtBQUssQ0FBQyx3Q0FBd0MsQ0FBQyxDQUFBO2FBQzFEO1NBQ0Y7SUFDSCxDQUFDO0NBQ0Y7QUFuVkQsOEJBbVZDO0FBRUQsa0JBQWUsU0FBUyxDQUFDIn0=\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hardenedPathOf = exports.getXpubComponents = exports.pubkeyFromXpub = exports.pathStringToArray = exports.pathArrayToString = exports.bip32asBuffer = exports.pathElementsToBuffer = void 0;\nconst bip32_path_1 = __importDefault(require(\"bip32-path\")); // TODO: get rid of this dependency\nconst bs58check_1 = __importDefault(require(\"bs58check\"));\nfunction pathElementsToBuffer(paths) {\n    const buffer = Buffer.alloc(1 + paths.length * 4);\n    buffer[0] = paths.length;\n    paths.forEach((element, index) => {\n        buffer.writeUInt32BE(element, 1 + 4 * index);\n    });\n    return buffer;\n}\nexports.pathElementsToBuffer = pathElementsToBuffer;\nfunction bip32asBuffer(path) {\n    const pathElements = !path ? [] : pathStringToArray(path);\n    return pathElementsToBuffer(pathElements);\n}\nexports.bip32asBuffer = bip32asBuffer;\nfunction pathArrayToString(pathElements) {\n    // bippath doesn't handle an empty path.\n    if (pathElements.length == 0) {\n        return \"m\";\n    }\n    return bip32_path_1.default.fromPathArray(pathElements).toString();\n}\nexports.pathArrayToString = pathArrayToString;\nfunction pathStringToArray(path) {\n    // bippath doesn't handle an empty path.\n    if (path == \"m\" || path == \"\") {\n        return [];\n    }\n    return bip32_path_1.default.fromString(path).toPathArray();\n}\nexports.pathStringToArray = pathStringToArray;\nfunction pubkeyFromXpub(xpub) {\n    const xpubBuf = bs58check_1.default.decode(xpub);\n    return xpubBuf.slice(xpubBuf.length - 33);\n}\nexports.pubkeyFromXpub = pubkeyFromXpub;\nfunction getXpubComponents(xpub) {\n    const xpubBuf = bs58check_1.default.decode(xpub);\n    return {\n        chaincode: xpubBuf.slice(13, 13 + 32),\n        pubkey: xpubBuf.slice(xpubBuf.length - 33),\n        version: xpubBuf.readUInt32BE(0),\n    };\n}\nexports.getXpubComponents = getXpubComponents;\nfunction hardenedPathOf(pathElements) {\n    for (let i = pathElements.length - 1; i >= 0; i--) {\n        if (pathElements[i] >= 0x80000000) {\n            return pathElements.slice(0, i + 1);\n        }\n    }\n    return [];\n}\nexports.hardenedPathOf = hardenedPathOf;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmlwMzIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2JpcDMyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLDREQUFpQyxDQUFDLG1DQUFtQztBQUNyRSwwREFBa0M7QUFFbEMsU0FBZ0Isb0JBQW9CLENBQUMsS0FBd0I7SUFDM0QsTUFBTSxNQUFNLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLEdBQUcsS0FBSyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQztJQUNsRCxNQUFNLENBQUMsQ0FBQyxDQUFDLEdBQUcsS0FBSyxDQUFDLE1BQU0sQ0FBQztJQUN6QixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUMsT0FBTyxFQUFFLEtBQUssRUFBRSxFQUFFO1FBQy9CLE1BQU0sQ0FBQyxhQUFhLENBQUMsT0FBTyxFQUFFLENBQUMsR0FBRyxDQUFDLEdBQUcsS0FBSyxDQUFDLENBQUM7SUFDL0MsQ0FBQyxDQUFDLENBQUM7SUFDSCxPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDO0FBUEQsb0RBT0M7QUFFRCxTQUFnQixhQUFhLENBQUMsSUFBWTtJQUN4QyxNQUFNLFlBQVksR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUMxRCxPQUFPLG9CQUFvQixDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQzVDLENBQUM7QUFIRCxzQ0FHQztBQUVELFNBQWdCLGlCQUFpQixDQUFDLFlBQStCO0lBQy9ELHdDQUF3QztJQUN4QyxJQUFJLFlBQVksQ0FBQyxNQUFNLElBQUksQ0FBQyxFQUFFO1FBQzVCLE9BQU8sR0FBRyxDQUFDO0tBQ1o7SUFDRCxPQUFPLG9CQUFPLENBQUMsYUFBYSxDQUFDLFlBQVksQ0FBQyxDQUFDLFFBQVEsRUFBRSxDQUFDO0FBQ3hELENBQUM7QUFORCw4Q0FNQztBQUVELFNBQWdCLGlCQUFpQixDQUFDLElBQVk7SUFDNUMsd0NBQXdDO0lBQ3hDLElBQUksSUFBSSxJQUFJLEdBQUcsSUFBSSxJQUFJLElBQUksRUFBRSxFQUFFO1FBQzdCLE9BQU8sRUFBRSxDQUFDO0tBQ1g7SUFDRCxPQUFPLG9CQUFPLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDO0FBQ2hELENBQUM7QUFORCw4Q0FNQztBQUVELFNBQWdCLGNBQWMsQ0FBQyxJQUFZO0lBQ3pDLE1BQU0sT0FBTyxHQUFHLG1CQUFTLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3ZDLE9BQU8sT0FBTyxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsTUFBTSxHQUFHLEVBQUUsQ0FBQyxDQUFDO0FBQzVDLENBQUM7QUFIRCx3Q0FHQztBQUVELFNBQWdCLGlCQUFpQixDQUFDLElBQVk7SUFLNUMsTUFBTSxPQUFPLEdBQVcsbUJBQVMsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDL0MsT0FBTztRQUNMLFNBQVMsRUFBRSxPQUFPLENBQUMsS0FBSyxDQUFDLEVBQUUsRUFBRSxFQUFFLEdBQUcsRUFBRSxDQUFDO1FBQ3JDLE1BQU0sRUFBRSxPQUFPLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxNQUFNLEdBQUcsRUFBRSxDQUFDO1FBQzFDLE9BQU8sRUFBRSxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQztLQUNqQyxDQUFDO0FBQ0osQ0FBQztBQVhELDhDQVdDO0FBRUQsU0FBZ0IsY0FBYyxDQUM1QixZQUErQjtJQUUvQixLQUFLLElBQUksQ0FBQyxHQUFHLFlBQVksQ0FBQyxNQUFNLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7UUFDakQsSUFBSSxZQUFZLENBQUMsQ0FBQyxDQUFDLElBQUksVUFBVSxFQUFFO1lBQ2pDLE9BQU8sWUFBWSxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO1NBQ3JDO0tBQ0Y7SUFDRCxPQUFPLEVBQUUsQ0FBQztBQUNaLENBQUM7QUFURCx3Q0FTQyJ9\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BufferReader = exports.BufferWriter = exports.unsafeFrom64bitLE = exports.unsafeTo64bitLE = void 0;\nconst varint_1 = require(\"./varint\");\nfunction unsafeTo64bitLE(n) {\n    // we want to represent the input as a 8-bytes array\n    if (n > Number.MAX_SAFE_INTEGER) {\n        throw new Error(\"Can't convert numbers > MAX_SAFE_INT\");\n    }\n    const byteArray = Buffer.alloc(8, 0);\n    for (let index = 0; index < byteArray.length; index++) {\n        const byte = n & 0xff;\n        byteArray[index] = byte;\n        n = (n - byte) / 256;\n    }\n    return byteArray;\n}\nexports.unsafeTo64bitLE = unsafeTo64bitLE;\nfunction unsafeFrom64bitLE(byteArray) {\n    let value = 0;\n    if (byteArray.length != 8) {\n        throw new Error('Expected Bufffer of lenght 8');\n    }\n    if (byteArray[7] != 0) {\n        throw new Error(\"Can't encode numbers > MAX_SAFE_INT\");\n    }\n    if (byteArray[6] > 0x1f) {\n        throw new Error(\"Can't encode numbers > MAX_SAFE_INT\");\n    }\n    for (let i = byteArray.length - 1; i >= 0; i--) {\n        value = value * 256 + byteArray[i];\n    }\n    return value;\n}\nexports.unsafeFrom64bitLE = unsafeFrom64bitLE;\nclass BufferWriter {\n    constructor() {\n        this.bufs = [];\n    }\n    write(alloc, fn) {\n        const b = Buffer.alloc(alloc);\n        fn(b);\n        this.bufs.push(b);\n    }\n    writeUInt8(i) {\n        this.write(1, (b) => b.writeUInt8(i, 0));\n    }\n    writeInt32(i) {\n        this.write(4, (b) => b.writeInt32LE(i, 0));\n    }\n    writeUInt32(i) {\n        this.write(4, (b) => b.writeUInt32LE(i, 0));\n    }\n    writeUInt64(i) {\n        const bytes = unsafeTo64bitLE(i);\n        this.writeSlice(bytes);\n    }\n    writeVarInt(i) {\n        this.bufs.push((0, varint_1.createVarint)(i));\n    }\n    writeSlice(slice) {\n        this.bufs.push(Buffer.from(slice));\n    }\n    writeVarSlice(slice) {\n        this.writeVarInt(slice.length);\n        this.writeSlice(slice);\n    }\n    buffer() {\n        return Buffer.concat(this.bufs);\n    }\n}\nexports.BufferWriter = BufferWriter;\nclass BufferReader {\n    constructor(buffer, offset = 0) {\n        this.buffer = buffer;\n        this.offset = offset;\n    }\n    available() {\n        return this.buffer.length - this.offset;\n    }\n    readUInt8() {\n        const result = this.buffer.readUInt8(this.offset);\n        this.offset++;\n        return result;\n    }\n    readInt32() {\n        const result = this.buffer.readInt32LE(this.offset);\n        this.offset += 4;\n        return result;\n    }\n    readUInt32() {\n        const result = this.buffer.readUInt32LE(this.offset);\n        this.offset += 4;\n        return result;\n    }\n    readUInt64() {\n        const buf = this.readSlice(8);\n        return unsafeFrom64bitLE(buf);\n    }\n    readVarInt() {\n        const [vi, vi_size] = (0, varint_1.parseVarint)(this.buffer, this.offset);\n        this.offset += vi_size;\n        return vi;\n    }\n    readSlice(n) {\n        if (this.buffer.length < this.offset + n) {\n            throw new Error('Cannot read slice out of bounds');\n        }\n        const result = this.buffer.slice(this.offset, this.offset + n);\n        this.offset += n;\n        return result;\n    }\n    readVarSlice() {\n        const n = (0, varint_1.sanitizeBigintToNumber)(this.readVarInt());\n        return this.readSlice(n);\n    }\n    readVector() {\n        const count = this.readVarInt();\n        const vector = [];\n        for (let i = 0; i < count; i++)\n            vector.push(this.readVarSlice());\n        return vector;\n    }\n}\nexports.BufferReader = BufferReader;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVmZmVydG9vbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2J1ZmZlcnRvb2xzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFDQUE2RTtBQUU3RSxTQUFnQixlQUFlLENBQUMsQ0FBUztJQUN2QyxvREFBb0Q7SUFDcEQsSUFBSSxDQUFDLEdBQUcsTUFBTSxDQUFDLGdCQUFnQixFQUFFO1FBQy9CLE1BQU0sSUFBSSxLQUFLLENBQUMsc0NBQXNDLENBQUMsQ0FBQztLQUN6RDtJQUNELE1BQU0sU0FBUyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0lBQ3JDLEtBQUssSUFBSSxLQUFLLEdBQUcsQ0FBQyxFQUFFLEtBQUssR0FBRyxTQUFTLENBQUMsTUFBTSxFQUFFLEtBQUssRUFBRSxFQUFFO1FBQ3JELE1BQU0sSUFBSSxHQUFHLENBQUMsR0FBRyxJQUFJLENBQUM7UUFDdEIsU0FBUyxDQUFDLEtBQUssQ0FBQyxHQUFHLElBQUksQ0FBQztRQUN4QixDQUFDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsSUFBSSxDQUFDLEdBQUcsR0FBRyxDQUFDO0tBQ3RCO0lBQ0QsT0FBTyxTQUFTLENBQUM7QUFDbkIsQ0FBQztBQVpELDBDQVlDO0FBRUQsU0FBZ0IsaUJBQWlCLENBQUMsU0FBaUI7SUFDakQsSUFBSSxLQUFLLEdBQUcsQ0FBQyxDQUFDO0lBQ2QsSUFBSSxTQUFTLENBQUMsTUFBTSxJQUFJLENBQUMsRUFBRTtRQUN6QixNQUFNLElBQUksS0FBSyxDQUFDLDhCQUE4QixDQUFDLENBQUM7S0FDakQ7SUFDRCxJQUFJLFNBQVMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUU7UUFDckIsTUFBTSxJQUFJLEtBQUssQ0FBQyxxQ0FBcUMsQ0FBQyxDQUFDO0tBQ3hEO0lBQ0QsSUFBSSxTQUFTLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxFQUFFO1FBQ3ZCLE1BQU0sSUFBSSxLQUFLLENBQUMscUNBQXFDLENBQUMsQ0FBQztLQUN4RDtJQUNELEtBQUssSUFBSSxDQUFDLEdBQUcsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUM5QyxLQUFLLEdBQUcsS0FBSyxHQUFHLEdBQUcsR0FBRyxTQUFTLENBQUMsQ0FBQyxDQUFDLENBQUM7S0FDcEM7SUFDRCxPQUFPLEtBQUssQ0FBQztBQUNmLENBQUM7QUFmRCw4Q0FlQztBQUVELE1BQWEsWUFBWTtJQUF6QjtRQUNVLFNBQUksR0FBYSxFQUFFLENBQUM7SUF5QzlCLENBQUM7SUF2Q0MsS0FBSyxDQUFDLEtBQWEsRUFBRSxFQUF1QjtRQUMxQyxNQUFNLENBQUMsR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQzlCLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUNOLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ3BCLENBQUM7SUFFRCxVQUFVLENBQUMsQ0FBUztRQUNsQixJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUMzQyxDQUFDO0lBRUQsVUFBVSxDQUFDLENBQVM7UUFDbEIsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxZQUFZLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDN0MsQ0FBQztJQUVELFdBQVcsQ0FBQyxDQUFTO1FBQ25CLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsYUFBYSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzlDLENBQUM7SUFFRCxXQUFXLENBQUMsQ0FBUztRQUNuQixNQUFNLEtBQUssR0FBRyxlQUFlLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDakMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUN6QixDQUFDO0lBRUQsV0FBVyxDQUFDLENBQVM7UUFDbkIsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBQSxxQkFBWSxFQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDbEMsQ0FBQztJQUVELFVBQVUsQ0FBQyxLQUFhO1FBQ3RCLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQztJQUNyQyxDQUFDO0lBRUQsYUFBYSxDQUFDLEtBQWE7UUFDekIsSUFBSSxDQUFDLFdBQVcsQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDL0IsSUFBSSxDQUFDLFVBQVUsQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUN6QixDQUFDO0lBRUQsTUFBTTtRQUNKLE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDbEMsQ0FBQztDQUNGO0FBMUNELG9DQTBDQztBQUVELE1BQWEsWUFBWTtJQUN2QixZQUE0QixNQUFjLEVBQVMsU0FBaUIsQ0FBQztRQUF6QyxXQUFNLEdBQU4sTUFBTSxDQUFRO1FBQVMsV0FBTSxHQUFOLE1BQU0sQ0FBWTtJQUFHLENBQUM7SUFFekUsU0FBUztRQUNQLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQztJQUMxQyxDQUFDO0lBRUQsU0FBUztRQUNQLE1BQU0sTUFBTSxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUNsRCxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUM7UUFDZCxPQUFPLE1BQU0sQ0FBQztJQUNoQixDQUFDO0lBRUQsU0FBUztRQUNQLE1BQU0sTUFBTSxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUNwRCxJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQztRQUNqQixPQUFPLE1BQU0sQ0FBQztJQUNoQixDQUFDO0lBRUQsVUFBVTtRQUNSLE1BQU0sTUFBTSxHQUFHLElBQUksQ0FBQyxNQUFNLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUNyRCxJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQztRQUNqQixPQUFPLE1BQU0sQ0FBQztJQUNoQixDQUFDO0lBRUQsVUFBVTtRQUNSLE1BQU0sR0FBRyxHQUFHLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDOUIsT0FBTyxpQkFBaUIsQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUNoQyxDQUFDO0lBRUQsVUFBVTtRQUNSLE1BQU0sQ0FBQyxFQUFFLEVBQUUsT0FBTyxDQUFDLEdBQUcsSUFBQSxvQkFBVyxFQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQzVELElBQUksQ0FBQyxNQUFNLElBQUksT0FBTyxDQUFDO1FBQ3ZCLE9BQU8sRUFBRSxDQUFDO0lBQ1osQ0FBQztJQUVELFNBQVMsQ0FBQyxDQUFTO1FBQ2pCLElBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUU7WUFDeEMsTUFBTSxJQUFJLEtBQUssQ0FBQyxpQ0FBaUMsQ0FBQyxDQUFDO1NBQ3BEO1FBQ0QsTUFBTSxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRSxJQUFJLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxDQUFDO1FBQy9ELElBQUksQ0FBQyxNQUFNLElBQUksQ0FBQyxDQUFDO1FBQ2pCLE9BQU8sTUFBTSxDQUFDO0lBQ2hCLENBQUM7SUFFRCxZQUFZO1FBQ1YsTUFBTSxDQUFDLEdBQUcsSUFBQSwrQkFBc0IsRUFBQyxJQUFJLENBQUMsVUFBVSxFQUFFLENBQUMsQ0FBQztRQUNwRCxPQUFPLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDM0IsQ0FBQztJQUVELFVBQVU7UUFDUixNQUFNLEtBQUssR0FBRyxJQUFJLENBQUMsVUFBVSxFQUFFLENBQUM7UUFDaEMsTUFBTSxNQUFNLEdBQWEsRUFBRSxDQUFDO1FBQzVCLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxLQUFLLEVBQUUsQ0FBQyxFQUFFO1lBQUUsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsWUFBWSxFQUFFLENBQUMsQ0FBQztRQUNqRSxPQUFPLE1BQU0sQ0FBQztJQUNoQixDQUFDO0NBQ0Y7QUF4REQsb0NBd0RDIn0=\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClientCommandInterpreter = exports.GetMoreElementsCommand = exports.GetMerkleLeafIndexCommand = exports.GetMerkleLeafProofCommand = exports.GetPreimageCommand = exports.YieldCommand = void 0;\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\nconst buffertools_1 = require(\"./buffertools\");\nconst merkle_1 = require(\"./merkle\");\nconst varint_1 = require(\"./varint\");\nvar ClientCommandCode;\n(function (ClientCommandCode) {\n    ClientCommandCode[ClientCommandCode[\"YIELD\"] = 16] = \"YIELD\";\n    ClientCommandCode[ClientCommandCode[\"GET_PREIMAGE\"] = 64] = \"GET_PREIMAGE\";\n    ClientCommandCode[ClientCommandCode[\"GET_MERKLE_LEAF_PROOF\"] = 65] = \"GET_MERKLE_LEAF_PROOF\";\n    ClientCommandCode[ClientCommandCode[\"GET_MERKLE_LEAF_INDEX\"] = 66] = \"GET_MERKLE_LEAF_INDEX\";\n    ClientCommandCode[ClientCommandCode[\"GET_MORE_ELEMENTS\"] = 160] = \"GET_MORE_ELEMENTS\";\n})(ClientCommandCode || (ClientCommandCode = {}));\nclass ClientCommand {\n}\nclass YieldCommand extends ClientCommand {\n    constructor(results, progressCallback) {\n        super();\n        this.progressCallback = progressCallback;\n        this.code = ClientCommandCode.YIELD;\n        this.results = results;\n    }\n    execute(request) {\n        this.results.push(Buffer.from(request.subarray(1)));\n        if (this.progressCallback) {\n            this.progressCallback();\n        }\n        return Buffer.from('');\n    }\n}\nexports.YieldCommand = YieldCommand;\nclass GetPreimageCommand extends ClientCommand {\n    constructor(known_preimages, queue) {\n        super();\n        this.code = ClientCommandCode.GET_PREIMAGE;\n        this.known_preimages = known_preimages;\n        this.queue = queue;\n    }\n    execute(request) {\n        const req = Buffer.from(request.subarray(1));\n        // we expect no more data to read\n        if (req.length != 1 + 32) {\n            throw new Error('Invalid request, unexpected trailing data');\n        }\n        if (req[0] != 0) {\n            throw new Error('Unsupported request, the first byte should be 0');\n        }\n        // read the hash\n        const hash = Buffer.alloc(32);\n        for (let i = 0; i < 32; i++) {\n            hash[i] = req[1 + i];\n        }\n        const req_hash_hex = hash.toString('hex');\n        const known_preimage = this.known_preimages.get(req_hash_hex);\n        if (known_preimage != undefined) {\n            const preimage_len_varint = (0, varint_1.createVarint)(known_preimage.length);\n            // We can send at most 255 - len(preimage_len_out) - 1 bytes in a single message;\n            // the rest will be stored in the queue for GET_MORE_ELEMENTS\n            const max_payload_size = 255 - preimage_len_varint.length - 1;\n            const payload_size = Math.min(max_payload_size, known_preimage.length);\n            if (payload_size < known_preimage.length) {\n                for (let i = payload_size; i < known_preimage.length; i++) {\n                    this.queue.push(Buffer.from([known_preimage[i]]));\n                }\n            }\n            return Buffer.concat([\n                preimage_len_varint,\n                Buffer.from([payload_size]),\n                Buffer.from(known_preimage.subarray(0, payload_size)),\n            ]);\n        }\n        throw Error(`Requested unknown preimage for: ${req_hash_hex}`);\n    }\n}\nexports.GetPreimageCommand = GetPreimageCommand;\nclass GetMerkleLeafProofCommand extends ClientCommand {\n    constructor(known_trees, queue) {\n        super();\n        this.code = ClientCommandCode.GET_MERKLE_LEAF_PROOF;\n        this.known_trees = known_trees;\n        this.queue = queue;\n    }\n    execute(request) {\n        const req = Buffer.from(request.subarray(1));\n        if (req.length < 32 + 1 + 1) {\n            throw new Error('Invalid request, expected at least 34 bytes');\n        }\n        const reqBuf = new buffertools_1.BufferReader(req);\n        const hash = reqBuf.readSlice(32);\n        const hash_hex = hash.toString('hex');\n        let tree_size;\n        let leaf_index;\n        try {\n            tree_size = (0, varint_1.sanitizeBigintToNumber)(reqBuf.readVarInt());\n            leaf_index = (0, varint_1.sanitizeBigintToNumber)(reqBuf.readVarInt());\n        }\n        catch (e) {\n            throw new Error(\"Invalid request, couldn't parse tree_size or leaf_index\");\n        }\n        const mt = this.known_trees.get(hash_hex);\n        if (!mt) {\n            throw Error(`Requested Merkle leaf proof for unknown tree: ${hash_hex}`);\n        }\n        if (leaf_index >= tree_size || mt.size() != tree_size) {\n            throw Error('Invalid index or tree size.');\n        }\n        if (this.queue.length != 0) {\n            throw Error('This command should not execute when the queue is not empty.');\n        }\n        const proof = mt.getProof(leaf_index);\n        const n_response_elements = Math.min(Math.floor((255 - 32 - 1 - 1) / 32), proof.length);\n        const n_leftover_elements = proof.length - n_response_elements;\n        // Add to the queue any proof elements that do not fit the response\n        if (n_leftover_elements > 0) {\n            this.queue.push(...proof.slice(-n_leftover_elements));\n        }\n        return Buffer.concat([\n            mt.getLeafHash(leaf_index),\n            Buffer.from([proof.length]),\n            Buffer.from([n_response_elements]),\n            ...proof.slice(0, n_response_elements),\n        ]);\n    }\n}\nexports.GetMerkleLeafProofCommand = GetMerkleLeafProofCommand;\nclass GetMerkleLeafIndexCommand extends ClientCommand {\n    constructor(known_trees) {\n        super();\n        this.code = ClientCommandCode.GET_MERKLE_LEAF_INDEX;\n        this.known_trees = known_trees;\n    }\n    execute(request) {\n        const req = Buffer.from(request.subarray(1));\n        if (req.length != 32 + 32) {\n            throw new Error('Invalid request, unexpected trailing data');\n        }\n        // read the root hash\n        const root_hash = Buffer.alloc(32);\n        for (let i = 0; i < 32; i++) {\n            root_hash[i] = req.readUInt8(i);\n        }\n        const root_hash_hex = root_hash.toString('hex');\n        // read the leaf hash\n        const leef_hash = Buffer.alloc(32);\n        for (let i = 0; i < 32; i++) {\n            leef_hash[i] = req.readUInt8(32 + i);\n        }\n        const leef_hash_hex = leef_hash.toString('hex');\n        const mt = this.known_trees.get(root_hash_hex);\n        if (!mt) {\n            throw Error(`Requested Merkle leaf index for unknown root: ${root_hash_hex}`);\n        }\n        let leaf_index = 0;\n        let found = 0;\n        for (let i = 0; i < mt.size(); i++) {\n            if (mt.getLeafHash(i).toString('hex') == leef_hash_hex) {\n                found = 1;\n                leaf_index = i;\n                break;\n            }\n        }\n        return Buffer.concat([Buffer.from([found]), (0, varint_1.createVarint)(leaf_index)]);\n    }\n}\nexports.GetMerkleLeafIndexCommand = GetMerkleLeafIndexCommand;\nclass GetMoreElementsCommand extends ClientCommand {\n    constructor(queue) {\n        super();\n        this.code = ClientCommandCode.GET_MORE_ELEMENTS;\n        this.queue = queue;\n    }\n    execute(request) {\n        if (request.length != 1) {\n            throw new Error('Invalid request, unexpected trailing data');\n        }\n        if (this.queue.length === 0) {\n            throw new Error('No elements to get');\n        }\n        // all elements should have the same length\n        const element_len = this.queue[0].length;\n        if (this.queue.some((el) => el.length != element_len)) {\n            throw new Error('The queue contains elements with different byte length, which is not expected');\n        }\n        const max_elements = Math.floor(253 / element_len);\n        const n_returned_elements = Math.min(max_elements, this.queue.length);\n        const returned_elements = this.queue.splice(0, n_returned_elements);\n        return Buffer.concat([\n            Buffer.from([n_returned_elements]),\n            Buffer.from([element_len]),\n            ...returned_elements,\n        ]);\n    }\n}\nexports.GetMoreElementsCommand = GetMoreElementsCommand;\n/**\n * This class will dispatch a client command coming from the hardware device to\n * the appropriate client command implementation. Those client commands\n * typically requests data from a merkle tree or merkelized maps.\n *\n * A ClientCommandInterpreter is prepared by adding the merkle trees and\n * merkelized maps it should be able to serve to the hardware device. This class\n * doesn't know anything about the semantics of the data it holds, it just\n * serves merkle data. It doesn't even know in what context it is being\n * executed, ie SignPsbt, getWalletAddress, etc.\n *\n * If the command yelds results to the client, as signPsbt does, the yielded\n * data will be accessible after the command completed by calling getYielded(),\n * which will return the yields in the same order as they came in.\n */\nclass ClientCommandInterpreter {\n    constructor(progressCallback) {\n        this.roots = new Map();\n        this.preimages = new Map();\n        this.yielded = [];\n        this.queue = [];\n        this.commands = new Map();\n        const commands = [\n            new YieldCommand(this.yielded, progressCallback),\n            new GetPreimageCommand(this.preimages, this.queue),\n            new GetMerkleLeafIndexCommand(this.roots),\n            new GetMerkleLeafProofCommand(this.roots, this.queue),\n            new GetMoreElementsCommand(this.queue),\n        ];\n        for (const cmd of commands) {\n            if (this.commands.has(cmd.code)) {\n                throw new Error(`Multiple commands with code ${cmd.code}`);\n            }\n            this.commands.set(cmd.code, cmd);\n        }\n    }\n    getYielded() {\n        return this.yielded;\n    }\n    addKnownPreimage(preimage) {\n        this.preimages.set(bitcoinjs_lib_1.crypto.sha256(preimage).toString('hex'), preimage);\n    }\n    addKnownList(elements) {\n        for (const el of elements) {\n            const preimage = Buffer.concat([Buffer.from([0]), el]);\n            this.addKnownPreimage(preimage);\n        }\n        const mt = new merkle_1.Merkle(elements.map((el) => (0, merkle_1.hashLeaf)(el)));\n        this.roots.set(mt.getRoot().toString('hex'), mt);\n    }\n    addKnownMapping(mm) {\n        this.addKnownList(mm.keys);\n        this.addKnownList(mm.values);\n    }\n    addKnownWalletPolicy(wp) {\n        this.addKnownPreimage(wp.serialize());\n        this.addKnownList(wp.keys.map((k) => Buffer.from(k, 'ascii')));\n        this.addKnownPreimage(Buffer.from(wp.descriptorTemplate));\n    }\n    execute(request) {\n        if (request.length == 0) {\n            throw new Error('Unexpected empty command');\n        }\n        const cmdCode = request[0];\n        const cmd = this.commands.get(cmdCode);\n        if (!cmd) {\n            throw new Error(`Unexpected command code ${cmdCode}`);\n        }\n        return cmd.execute(request);\n    }\n}\nexports.ClientCommandInterpreter = ClientCommandInterpreter;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpZW50Q29tbWFuZHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2NsaWVudENvbW1hbmRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlEQUF1QztBQUV2QywrQ0FBNkM7QUFDN0MscUNBQTRDO0FBRzVDLHFDQUFnRTtBQUVoRSxJQUFLLGlCQU1KO0FBTkQsV0FBSyxpQkFBaUI7SUFDcEIsNERBQVksQ0FBQTtJQUNaLDBFQUFtQixDQUFBO0lBQ25CLDRGQUE0QixDQUFBO0lBQzVCLDRGQUE0QixDQUFBO0lBQzVCLHFGQUF3QixDQUFBO0FBQzFCLENBQUMsRUFOSSxpQkFBaUIsS0FBakIsaUJBQWlCLFFBTXJCO0FBRUQsTUFBZSxhQUFhO0NBRzNCO0FBRUQsTUFBYSxZQUFhLFNBQVEsYUFBYTtJQUs3QyxZQUNFLE9BQWlCLEVBQ0EsZ0JBQTZCO1FBRTlDLEtBQUssRUFBRSxDQUFDO1FBRlMscUJBQWdCLEdBQWhCLGdCQUFnQixDQUFhO1FBSnZDLFNBQUksR0FBRyxpQkFBaUIsQ0FBQyxLQUFLLENBQUM7UUFPdEMsSUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7SUFDekIsQ0FBQztJQUVELE9BQU8sQ0FBQyxPQUFlO1FBQ3JCLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDcEQsSUFBSSxJQUFJLENBQUMsZ0JBQWdCLEVBQUU7WUFDekIsSUFBSSxDQUFDLGdCQUFnQixFQUFFLENBQUM7U0FDekI7UUFDRCxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDekIsQ0FBQztDQUNGO0FBcEJELG9DQW9CQztBQUVELE1BQWEsa0JBQW1CLFNBQVEsYUFBYTtJQU1uRCxZQUFZLGVBQTRDLEVBQUUsS0FBZTtRQUN2RSxLQUFLLEVBQUUsQ0FBQztRQUhELFNBQUksR0FBRyxpQkFBaUIsQ0FBQyxZQUFZLENBQUM7UUFJN0MsSUFBSSxDQUFDLGVBQWUsR0FBRyxlQUFlLENBQUM7UUFDdkMsSUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7SUFDckIsQ0FBQztJQUVELE9BQU8sQ0FBQyxPQUFlO1FBQ3JCLE1BQU0sR0FBRyxHQUFHLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBRTdDLGlDQUFpQztRQUNqQyxJQUFJLEdBQUcsQ0FBQyxNQUFNLElBQUksQ0FBQyxHQUFHLEVBQUUsRUFBRTtZQUN4QixNQUFNLElBQUksS0FBSyxDQUFDLDJDQUEyQyxDQUFDLENBQUM7U0FDOUQ7UUFFRCxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUU7WUFDZixNQUFNLElBQUksS0FBSyxDQUFDLGlEQUFpRCxDQUFDLENBQUM7U0FDcEU7UUFFRCxnQkFBZ0I7UUFDaEIsTUFBTSxJQUFJLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUM5QixLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQzNCLElBQUksQ0FBQyxDQUFDLENBQUMsR0FBRyxHQUFHLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO1NBQ3RCO1FBQ0QsTUFBTSxZQUFZLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUUxQyxNQUFNLGNBQWMsR0FBRyxJQUFJLENBQUMsZUFBZSxDQUFDLEdBQUcsQ0FBQyxZQUFZLENBQUMsQ0FBQztRQUM5RCxJQUFJLGNBQWMsSUFBSSxTQUFTLEVBQUU7WUFDL0IsTUFBTSxtQkFBbUIsR0FBRyxJQUFBLHFCQUFZLEVBQUMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1lBRWhFLGlGQUFpRjtZQUNqRiw2REFBNkQ7WUFDN0QsTUFBTSxnQkFBZ0IsR0FBRyxHQUFHLEdBQUcsbUJBQW1CLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQztZQUU5RCxNQUFNLFlBQVksR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLGdCQUFnQixFQUFFLGNBQWMsQ0FBQyxNQUFNLENBQUMsQ0FBQztZQUV2RSxJQUFJLFlBQVksR0FBRyxjQUFjLENBQUMsTUFBTSxFQUFFO2dCQUN4QyxLQUFLLElBQUksQ0FBQyxHQUFHLFlBQVksRUFBRSxDQUFDLEdBQUcsY0FBYyxDQUFDLE1BQU0sRUFBRSxDQUFDLEVBQUUsRUFBRTtvQkFDekQsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLGNBQWMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDbkQ7YUFDRjtZQUVELE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FBQztnQkFDbkIsbUJBQW1CO2dCQUNuQixNQUFNLENBQUMsSUFBSSxDQUFDLENBQUMsWUFBWSxDQUFDLENBQUM7Z0JBQzNCLE1BQU0sQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLFFBQVEsQ0FBQyxDQUFDLEVBQUUsWUFBWSxDQUFDLENBQUM7YUFDdEQsQ0FBQyxDQUFDO1NBQ0o7UUFFRCxNQUFNLEtBQUssQ0FBQyxtQ0FBbUMsWUFBWSxFQUFFLENBQUMsQ0FBQztJQUNqRSxDQUFDO0NBQ0Y7QUF4REQsZ0RBd0RDO0FBRUQsTUFBYSx5QkFBMEIsU0FBUSxhQUFhO0lBTTFELFlBQVksV0FBd0MsRUFBRSxLQUFlO1FBQ25FLEtBQUssRUFBRSxDQUFDO1FBSEQsU0FBSSxHQUFHLGlCQUFpQixDQUFDLHFCQUFxQixDQUFDO1FBSXRELElBQUksQ0FBQyxXQUFXLEdBQUcsV0FBVyxDQUFDO1FBQy9CLElBQUksQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFDO0lBQ3JCLENBQUM7SUFFRCxPQUFPLENBQUMsT0FBZTtRQUNyQixNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUU3QyxJQUFJLEdBQUcsQ0FBQyxNQUFNLEdBQUcsRUFBRSxHQUFHLENBQUMsR0FBRyxDQUFDLEVBQUU7WUFDM0IsTUFBTSxJQUFJLEtBQUssQ0FBQyw2Q0FBNkMsQ0FBQyxDQUFDO1NBQ2hFO1FBRUQsTUFBTSxNQUFNLEdBQUcsSUFBSSwwQkFBWSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ3JDLE1BQU0sSUFBSSxHQUFHLE1BQU0sQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDbEMsTUFBTSxRQUFRLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUV0QyxJQUFJLFNBQWlCLENBQUM7UUFDdEIsSUFBSSxVQUFrQixDQUFDO1FBQ3ZCLElBQUk7WUFDRixTQUFTLEdBQUcsSUFBQSwrQkFBc0IsRUFBQyxNQUFNLENBQUMsVUFBVSxFQUFFLENBQUMsQ0FBQztZQUN4RCxVQUFVLEdBQUcsSUFBQSwrQkFBc0IsRUFBQyxNQUFNLENBQUMsVUFBVSxFQUFFLENBQUMsQ0FBQztTQUMxRDtRQUFDLE9BQU8sQ0FBQyxFQUFFO1lBQ1YsTUFBTSxJQUFJLEtBQUssQ0FDYix5REFBeUQsQ0FDMUQsQ0FBQztTQUNIO1FBRUQsTUFBTSxFQUFFLEdBQUcsSUFBSSxDQUFDLFdBQVcsQ0FBQyxHQUFHLENBQUMsUUFBUSxDQUFDLENBQUM7UUFDMUMsSUFBSSxDQUFDLEVBQUUsRUFBRTtZQUNQLE1BQU0sS0FBSyxDQUFDLGlEQUFpRCxRQUFRLEVBQUUsQ0FBQyxDQUFDO1NBQzFFO1FBRUQsSUFBSSxVQUFVLElBQUksU0FBUyxJQUFJLEVBQUUsQ0FBQyxJQUFJLEVBQUUsSUFBSSxTQUFTLEVBQUU7WUFDckQsTUFBTSxLQUFLLENBQUMsNkJBQTZCLENBQUMsQ0FBQztTQUM1QztRQUVELElBQUksSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLElBQUksQ0FBQyxFQUFFO1lBQzFCLE1BQU0sS0FBSyxDQUNULDhEQUE4RCxDQUMvRCxDQUFDO1NBQ0g7UUFFRCxNQUFNLEtBQUssR0FBRyxFQUFFLENBQUMsUUFBUSxDQUFDLFVBQVUsQ0FBQyxDQUFDO1FBRXRDLE1BQU0sbUJBQW1CLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FDbEMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLEdBQUcsR0FBRyxFQUFFLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxFQUNuQyxLQUFLLENBQUMsTUFBTSxDQUNiLENBQUM7UUFDRixNQUFNLG1CQUFtQixHQUFHLEtBQUssQ0FBQyxNQUFNLEdBQUcsbUJBQW1CLENBQUM7UUFFL0QsbUVBQW1FO1FBQ25FLElBQUksbUJBQW1CLEdBQUcsQ0FBQyxFQUFFO1lBQzNCLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFDLG1CQUFtQixDQUFDLENBQUMsQ0FBQztTQUN2RDtRQUVELE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FBQztZQUNuQixFQUFFLENBQUMsV0FBVyxDQUFDLFVBQVUsQ0FBQztZQUMxQixNQUFNLENBQUMsSUFBSSxDQUFDLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1lBQzNCLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDO1lBQ2xDLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUUsbUJBQW1CLENBQUM7U0FDdkMsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztDQUNGO0FBckVELDhEQXFFQztBQUVELE1BQWEseUJBQTBCLFNBQVEsYUFBYTtJQUsxRCxZQUFZLFdBQXdDO1FBQ2xELEtBQUssRUFBRSxDQUFDO1FBSEQsU0FBSSxHQUFHLGlCQUFpQixDQUFDLHFCQUFxQixDQUFDO1FBSXRELElBQUksQ0FBQyxXQUFXLEdBQUcsV0FBVyxDQUFDO0lBQ2pDLENBQUM7SUFFRCxPQUFPLENBQUMsT0FBZTtRQUNyQixNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUU3QyxJQUFJLEdBQUcsQ0FBQyxNQUFNLElBQUksRUFBRSxHQUFHLEVBQUUsRUFBRTtZQUN6QixNQUFNLElBQUksS0FBSyxDQUFDLDJDQUEyQyxDQUFDLENBQUM7U0FDOUQ7UUFFRCxxQkFBcUI7UUFDckIsTUFBTSxTQUFTLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUNuQyxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQzNCLFNBQVMsQ0FBQyxDQUFDLENBQUMsR0FBRyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxDQUFDO1NBQ2pDO1FBQ0QsTUFBTSxhQUFhLEdBQUcsU0FBUyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUVoRCxxQkFBcUI7UUFDckIsTUFBTSxTQUFTLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUNuQyxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQzNCLFNBQVMsQ0FBQyxDQUFDLENBQUMsR0FBRyxHQUFHLENBQUMsU0FBUyxDQUFDLEVBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQztTQUN0QztRQUNELE1BQU0sYUFBYSxHQUFHLFNBQVMsQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUM7UUFFaEQsTUFBTSxFQUFFLEdBQUcsSUFBSSxDQUFDLFdBQVcsQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDLENBQUM7UUFDL0MsSUFBSSxDQUFDLEVBQUUsRUFBRTtZQUNQLE1BQU0sS0FBSyxDQUNULGlEQUFpRCxhQUFhLEVBQUUsQ0FDakUsQ0FBQztTQUNIO1FBRUQsSUFBSSxVQUFVLEdBQUcsQ0FBQyxDQUFDO1FBQ25CLElBQUksS0FBSyxHQUFHLENBQUMsQ0FBQztRQUNkLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxFQUFFLENBQUMsSUFBSSxFQUFFLEVBQUUsQ0FBQyxFQUFFLEVBQUU7WUFDbEMsSUFBSSxFQUFFLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsSUFBSSxhQUFhLEVBQUU7Z0JBQ3RELEtBQUssR0FBRyxDQUFDLENBQUM7Z0JBQ1YsVUFBVSxHQUFHLENBQUMsQ0FBQztnQkFDZixNQUFNO2FBQ1A7U0FDRjtRQUNELE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLElBQUEscUJBQVksRUFBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDekUsQ0FBQztDQUNGO0FBakRELDhEQWlEQztBQUVELE1BQWEsc0JBQXVCLFNBQVEsYUFBYTtJQUt2RCxZQUFZLEtBQWU7UUFDekIsS0FBSyxFQUFFLENBQUM7UUFIRCxTQUFJLEdBQUcsaUJBQWlCLENBQUMsaUJBQWlCLENBQUM7UUFJbEQsSUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7SUFDckIsQ0FBQztJQUVELE9BQU8sQ0FBQyxPQUFlO1FBQ3JCLElBQUksT0FBTyxDQUFDLE1BQU0sSUFBSSxDQUFDLEVBQUU7WUFDdkIsTUFBTSxJQUFJLEtBQUssQ0FBQywyQ0FBMkMsQ0FBQyxDQUFDO1NBQzlEO1FBRUQsSUFBSSxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sS0FBSyxDQUFDLEVBQUU7WUFDM0IsTUFBTSxJQUFJLEtBQUssQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO1NBQ3ZDO1FBRUQsMkNBQTJDO1FBQzNDLE1BQU0sV0FBVyxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDO1FBQ3pDLElBQUksSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFNLElBQUksV0FBVyxDQUFDLEVBQUU7WUFDckQsTUFBTSxJQUFJLEtBQUssQ0FDYiwrRUFBK0UsQ0FDaEYsQ0FBQztTQUNIO1FBRUQsTUFBTSxZQUFZLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxHQUFHLEdBQUcsV0FBVyxDQUFDLENBQUM7UUFDbkQsTUFBTSxtQkFBbUIsR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLFlBQVksRUFBRSxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBRXRFLE1BQU0saUJBQWlCLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyxFQUFFLG1CQUFtQixDQUFDLENBQUM7UUFFcEUsT0FBTyxNQUFNLENBQUMsTUFBTSxDQUFDO1lBQ25CLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDO1lBQ2xDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxXQUFXLENBQUMsQ0FBQztZQUMxQixHQUFHLGlCQUFpQjtTQUNyQixDQUFDLENBQUM7SUFDTCxDQUFDO0NBQ0Y7QUF0Q0Qsd0RBc0NDO0FBRUQ7Ozs7Ozs7Ozs7Ozs7O0dBY0c7QUFDSCxNQUFhLHdCQUF3QjtJQVVuQyxZQUFZLGdCQUE2QjtRQVR4QixVQUFLLEdBQXdCLElBQUksR0FBRyxFQUFFLENBQUM7UUFDdkMsY0FBUyxHQUF3QixJQUFJLEdBQUcsRUFBRSxDQUFDO1FBRXBELFlBQU8sR0FBYSxFQUFFLENBQUM7UUFFdkIsVUFBSyxHQUFhLEVBQUUsQ0FBQztRQUVaLGFBQVEsR0FBMEMsSUFBSSxHQUFHLEVBQUUsQ0FBQztRQUczRSxNQUFNLFFBQVEsR0FBRztZQUNmLElBQUksWUFBWSxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUUsZ0JBQWdCLENBQUM7WUFDaEQsSUFBSSxrQkFBa0IsQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLElBQUksQ0FBQyxLQUFLLENBQUM7WUFDbEQsSUFBSSx5QkFBeUIsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDO1lBQ3pDLElBQUkseUJBQXlCLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsS0FBSyxDQUFDO1lBQ3JELElBQUksc0JBQXNCLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQztTQUN2QyxDQUFDO1FBRUYsS0FBSyxNQUFNLEdBQUcsSUFBSSxRQUFRLEVBQUU7WUFDMUIsSUFBSSxJQUFJLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUU7Z0JBQy9CLE1BQU0sSUFBSSxLQUFLLENBQUMsK0JBQStCLEdBQUcsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDO2FBQzVEO1lBQ0QsSUFBSSxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxHQUFHLENBQUMsQ0FBQztTQUNsQztJQUNILENBQUM7SUFFRCxVQUFVO1FBQ1IsT0FBTyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQ3RCLENBQUM7SUFFRCxnQkFBZ0IsQ0FBQyxRQUFnQjtRQUMvQixJQUFJLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxzQkFBTSxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLEVBQUUsUUFBUSxDQUFDLENBQUM7SUFDeEUsQ0FBQztJQUVELFlBQVksQ0FBQyxRQUEyQjtRQUN0QyxLQUFLLE1BQU0sRUFBRSxJQUFJLFFBQVEsRUFBRTtZQUN6QixNQUFNLFFBQVEsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQztZQUN2RCxJQUFJLENBQUMsZ0JBQWdCLENBQUMsUUFBUSxDQUFDLENBQUM7U0FDakM7UUFDRCxNQUFNLEVBQUUsR0FBRyxJQUFJLGVBQU0sQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxFQUFFLEVBQUUsQ0FBQyxJQUFBLGlCQUFRLEVBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzFELElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUM7SUFDbkQsQ0FBQztJQUVELGVBQWUsQ0FBQyxFQUFhO1FBQzNCLElBQUksQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQzNCLElBQUksQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQy9CLENBQUM7SUFFRCxvQkFBb0IsQ0FBQyxFQUFnQjtRQUNuQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsRUFBRSxDQUFDLFNBQVMsRUFBRSxDQUFDLENBQUM7UUFDdEMsSUFBSSxDQUFDLFlBQVksQ0FDZixFQUFFLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsT0FBTyxDQUFDLENBQUMsQ0FDNUMsQ0FBQztRQUNGLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDLENBQUM7SUFDNUQsQ0FBQztJQUVELE9BQU8sQ0FBQyxPQUFlO1FBQ3JCLElBQUksT0FBTyxDQUFDLE1BQU0sSUFBSSxDQUFDLEVBQUU7WUFDdkIsTUFBTSxJQUFJLEtBQUssQ0FBQywwQkFBMEIsQ0FBQyxDQUFDO1NBQzdDO1FBRUQsTUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzNCLE1BQU0sR0FBRyxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ3ZDLElBQUksQ0FBQyxHQUFHLEVBQUU7WUFDUixNQUFNLElBQUksS0FBSyxDQUFDLDJCQUEyQixPQUFPLEVBQUUsQ0FBQyxDQUFDO1NBQ3ZEO1FBRUQsT0FBTyxHQUFHLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQzlCLENBQUM7Q0FDRjtBQXRFRCw0REFzRUMifQ==\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MerkelizedPsbt = void 0;\nconst merkleMap_1 = require(\"./merkleMap\");\nconst psbtv2_1 = require(\"./psbtv2\");\n/**\n * This class merkelizes a PSBTv2, by merkelizing the different\n * maps of the psbt. This is used during the transaction signing process,\n * where the hardware app can request specific parts of the psbt from the\n * client code and be sure that the response data actually belong to the psbt.\n * The reason for this is the limited amount of memory available to the app,\n * so it can't always store the full psbt in memory.\n *\n * The signing process is documented at\n * https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/bitcoin.md#sign_psbt\n */\nclass MerkelizedPsbt extends psbtv2_1.PsbtV2 {\n    constructor(psbt) {\n        super();\n        this.inputMerkleMaps = [];\n        this.outputMerkleMaps = [];\n        psbt.copy(this);\n        this.globalMerkleMap = MerkelizedPsbt.createMerkleMap(this.globalMap);\n        for (let i = 0; i < this.getGlobalInputCount(); i++) {\n            this.inputMerkleMaps.push(MerkelizedPsbt.createMerkleMap(this.inputMaps[i]));\n        }\n        this.inputMapCommitments = [...this.inputMerkleMaps.values()].map((v) => v.commitment());\n        for (let i = 0; i < this.getGlobalOutputCount(); i++) {\n            this.outputMerkleMaps.push(MerkelizedPsbt.createMerkleMap(this.outputMaps[i]));\n        }\n        this.outputMapCommitments = [...this.outputMerkleMaps.values()].map((v) => v.commitment());\n    }\n    // These public functions are for MerkelizedPsbt.\n    getGlobalSize() {\n        return this.globalMap.size;\n    }\n    getGlobalKeysValuesRoot() {\n        return this.globalMerkleMap.commitment();\n    }\n    static createMerkleMap(map) {\n        const sortedKeysStrings = [...map.keys()].sort();\n        const values = sortedKeysStrings.map((k) => {\n            const v = map.get(k);\n            if (!v) {\n                throw new Error('No value for key ' + k);\n            }\n            return v;\n        });\n        const sortedKeys = sortedKeysStrings.map((k) => Buffer.from(k, 'hex'));\n        return new merkleMap_1.MerkleMap(sortedKeys, values);\n    }\n}\nexports.MerkelizedPsbt = MerkelizedPsbt;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVya2VsaXplZFBzYnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL21lcmtlbGl6ZWRQc2J0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDJDQUF3QztBQUN4QyxxQ0FBa0M7QUFFbEM7Ozs7Ozs7Ozs7R0FVRztBQUNILE1BQWEsY0FBZSxTQUFRLGVBQU07SUFNeEMsWUFBWSxJQUFZO1FBQ3RCLEtBQUssRUFBRSxDQUFDO1FBTEgsb0JBQWUsR0FBZ0IsRUFBRSxDQUFDO1FBQ2xDLHFCQUFnQixHQUFnQixFQUFFLENBQUM7UUFLeEMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUNoQixJQUFJLENBQUMsZUFBZSxHQUFHLGNBQWMsQ0FBQyxlQUFlLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBRXRFLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxJQUFJLENBQUMsbUJBQW1CLEVBQUUsRUFBRSxDQUFDLEVBQUUsRUFBRTtZQUNuRCxJQUFJLENBQUMsZUFBZSxDQUFDLElBQUksQ0FDdkIsY0FBYyxDQUFDLGVBQWUsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQ2xELENBQUM7U0FDSDtRQUNELElBQUksQ0FBQyxtQkFBbUIsR0FBRyxDQUFDLEdBQUcsSUFBSSxDQUFDLGVBQWUsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQ3RFLENBQUMsQ0FBQyxVQUFVLEVBQUUsQ0FDZixDQUFDO1FBRUYsS0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLElBQUksQ0FBQyxvQkFBb0IsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQ3BELElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxJQUFJLENBQ3hCLGNBQWMsQ0FBQyxlQUFlLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUNuRCxDQUFDO1NBQ0g7UUFDRCxJQUFJLENBQUMsb0JBQW9CLEdBQUcsQ0FBQyxHQUFHLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQ3hFLENBQUMsQ0FBQyxVQUFVLEVBQUUsQ0FDZixDQUFDO0lBQ0osQ0FBQztJQUNELGlEQUFpRDtJQUNqRCxhQUFhO1FBQ1gsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQztJQUM3QixDQUFDO0lBQ0QsdUJBQXVCO1FBQ3JCLE9BQU8sSUFBSSxDQUFDLGVBQWUsQ0FBQyxVQUFVLEVBQUUsQ0FBQztJQUMzQyxDQUFDO0lBRU8sTUFBTSxDQUFDLGVBQWUsQ0FBQyxHQUFnQztRQUM3RCxNQUFNLGlCQUFpQixHQUFHLENBQUMsR0FBRyxHQUFHLENBQUMsSUFBSSxFQUFFLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUNqRCxNQUFNLE1BQU0sR0FBRyxpQkFBaUIsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRTtZQUN6QyxNQUFNLENBQUMsR0FBRyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQ3JCLElBQUksQ0FBQyxDQUFDLEVBQUU7Z0JBQ04sTUFBTSxJQUFJLEtBQUssQ0FBQyxtQkFBbUIsR0FBRyxDQUFDLENBQUMsQ0FBQzthQUMxQztZQUNELE9BQU8sQ0FBQyxDQUFDO1FBQ1gsQ0FBQyxDQUFDLENBQUM7UUFDSCxNQUFNLFVBQVUsR0FBRyxpQkFBaUIsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEtBQUssQ0FBQyxDQUFDLENBQUM7UUFFdkUsT0FBTyxJQUFJLHFCQUFTLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxDQUFDO0lBQzNDLENBQUM7Q0FDRjtBQWxERCx3Q0FrREMifQ==\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hashLeaf = exports.Merkle = void 0;\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\n/**\n * This class implements the merkle tree used by Ledger Bitcoin app v2+,\n * which is documented at\n * https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/merkle.md\n */\nclass Merkle {\n    constructor(leaves, hasher = bitcoinjs_lib_1.crypto.sha256) {\n        this.leaves = leaves;\n        this.h = hasher;\n        const nodes = this.calculateRoot(leaves);\n        this.rootNode = nodes.root;\n        this.leafNodes = nodes.leaves;\n    }\n    getRoot() {\n        return this.rootNode.hash;\n    }\n    size() {\n        return this.leaves.length;\n    }\n    getLeaves() {\n        return this.leaves;\n    }\n    getLeafHash(index) {\n        return this.leafNodes[index].hash;\n    }\n    getProof(index) {\n        if (index >= this.leaves.length)\n            throw Error('Index out of bounds');\n        return proveNode(this.leafNodes[index]);\n    }\n    calculateRoot(leaves) {\n        const n = leaves.length;\n        if (n == 0) {\n            return {\n                root: new Node(undefined, undefined, Buffer.alloc(32, 0)),\n                leaves: [],\n            };\n        }\n        if (n == 1) {\n            const newNode = new Node(undefined, undefined, leaves[0]);\n            return { root: newNode, leaves: [newNode] };\n        }\n        const leftCount = highestPowerOf2LessThan(n);\n        const leftBranch = this.calculateRoot(leaves.slice(0, leftCount));\n        const rightBranch = this.calculateRoot(leaves.slice(leftCount));\n        const leftChild = leftBranch.root;\n        const rightChild = rightBranch.root;\n        const hash = this.hashNode(leftChild.hash, rightChild.hash);\n        const node = new Node(leftChild, rightChild, hash);\n        leftChild.parent = node;\n        rightChild.parent = node;\n        return { root: node, leaves: leftBranch.leaves.concat(rightBranch.leaves) };\n    }\n    hashNode(left, right) {\n        return this.h(Buffer.concat([Buffer.from([1]), left, right]));\n    }\n}\nexports.Merkle = Merkle;\nfunction hashLeaf(buf, hashFunction = bitcoinjs_lib_1.crypto.sha256) {\n    return hashConcat(Buffer.from([0]), buf, hashFunction);\n}\nexports.hashLeaf = hashLeaf;\nfunction hashConcat(bufA, bufB, hashFunction) {\n    return hashFunction(Buffer.concat([bufA, bufB]));\n}\nclass Node {\n    constructor(left, right, hash) {\n        this.leftChild = left;\n        this.rightChild = right;\n        this.hash = hash;\n    }\n    isLeaf() {\n        return this.leftChild == undefined;\n    }\n}\nfunction proveNode(node) {\n    if (!node.parent) {\n        return [];\n    }\n    if (node.parent.leftChild == node) {\n        if (!node.parent.rightChild) {\n            throw new Error('Expected right child to exist');\n        }\n        return [node.parent.rightChild.hash, ...proveNode(node.parent)];\n    }\n    else {\n        if (!node.parent.leftChild) {\n            throw new Error('Expected left child to exist');\n        }\n        return [node.parent.leftChild.hash, ...proveNode(node.parent)];\n    }\n}\nfunction highestPowerOf2LessThan(n) {\n    if (n < 2) {\n        throw Error('Expected n >= 2');\n    }\n    if (isPowerOf2(n)) {\n        return n / 2;\n    }\n    return 1 << Math.floor(Math.log2(n));\n}\nfunction isPowerOf2(n) {\n    return (n & (n - 1)) == 0;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVya2xlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9tZXJrbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaURBQXVDO0FBRXZDOzs7O0dBSUc7QUFDSCxNQUFhLE1BQU07SUFLakIsWUFDRSxNQUFnQixFQUNoQixTQUFrQyxzQkFBTSxDQUFDLE1BQU07UUFFL0MsSUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7UUFDckIsSUFBSSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUM7UUFDaEIsTUFBTSxLQUFLLEdBQUcsSUFBSSxDQUFDLGFBQWEsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUN6QyxJQUFJLENBQUMsUUFBUSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUM7UUFDM0IsSUFBSSxDQUFDLFNBQVMsR0FBRyxLQUFLLENBQUMsTUFBTSxDQUFDO0lBQ2hDLENBQUM7SUFDRCxPQUFPO1FBQ0wsT0FBTyxJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQztJQUM1QixDQUFDO0lBQ0QsSUFBSTtRQUNGLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUM7SUFDNUIsQ0FBQztJQUNELFNBQVM7UUFDUCxPQUFPLElBQUksQ0FBQyxNQUFNLENBQUM7SUFDckIsQ0FBQztJQUNELFdBQVcsQ0FBQyxLQUFhO1FBQ3ZCLE9BQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxJQUFJLENBQUM7SUFDcEMsQ0FBQztJQUNELFFBQVEsQ0FBQyxLQUFhO1FBQ3BCLElBQUksS0FBSyxJQUFJLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTTtZQUFFLE1BQU0sS0FBSyxDQUFDLHFCQUFxQixDQUFDLENBQUM7UUFDcEUsT0FBTyxTQUFTLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDO0lBQzFDLENBQUM7SUFFRCxhQUFhLENBQUMsTUFBZ0I7UUFJNUIsTUFBTSxDQUFDLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQztRQUN4QixJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUU7WUFDVixPQUFPO2dCQUNMLElBQUksRUFBRSxJQUFJLElBQUksQ0FBQyxTQUFTLEVBQUUsU0FBUyxFQUFFLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDO2dCQUN6RCxNQUFNLEVBQUUsRUFBRTthQUNYLENBQUM7U0FDSDtRQUNELElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRTtZQUNWLE1BQU0sT0FBTyxHQUFHLElBQUksSUFBSSxDQUFDLFNBQVMsRUFBRSxTQUFTLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDMUQsT0FBTyxFQUFFLElBQUksRUFBRSxPQUFPLEVBQUUsTUFBTSxFQUFFLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQztTQUM3QztRQUNELE1BQU0sU0FBUyxHQUFHLHVCQUF1QixDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzdDLE1BQU0sVUFBVSxHQUFHLElBQUksQ0FBQyxhQUFhLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUUsU0FBUyxDQUFDLENBQUMsQ0FBQztRQUNsRSxNQUFNLFdBQVcsR0FBRyxJQUFJLENBQUMsYUFBYSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQztRQUNoRSxNQUFNLFNBQVMsR0FBRyxVQUFVLENBQUMsSUFBSSxDQUFDO1FBQ2xDLE1BQU0sVUFBVSxHQUFHLFdBQVcsQ0FBQyxJQUFJLENBQUM7UUFDcEMsTUFBTSxJQUFJLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxTQUFTLENBQUMsSUFBSSxFQUFFLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUM1RCxNQUFNLElBQUksR0FBRyxJQUFJLElBQUksQ0FBQyxTQUFTLEVBQUUsVUFBVSxFQUFFLElBQUksQ0FBQyxDQUFDO1FBQ25ELFNBQVMsQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDO1FBQ3hCLFVBQVUsQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDO1FBQ3pCLE9BQU8sRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxVQUFVLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQztJQUM5RSxDQUFDO0lBRUQsUUFBUSxDQUFDLElBQVksRUFBRSxLQUFhO1FBQ2xDLE9BQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsSUFBSSxFQUFFLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUNoRSxDQUFDO0NBQ0Y7QUE5REQsd0JBOERDO0FBRUQsU0FBZ0IsUUFBUSxDQUN0QixHQUFXLEVBQ1gsZUFBd0Msc0JBQU0sQ0FBQyxNQUFNO0lBRXJELE9BQU8sVUFBVSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsRUFBRSxZQUFZLENBQUMsQ0FBQztBQUN6RCxDQUFDO0FBTEQsNEJBS0M7QUFFRCxTQUFTLFVBQVUsQ0FDakIsSUFBWSxFQUNaLElBQVksRUFDWixZQUFxQztJQUVyQyxPQUFPLFlBQVksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNuRCxDQUFDO0FBRUQsTUFBTSxJQUFJO0lBS1IsWUFBWSxJQUFzQixFQUFFLEtBQXVCLEVBQUUsSUFBWTtRQUN2RSxJQUFJLENBQUMsU0FBUyxHQUFHLElBQUksQ0FBQztRQUN0QixJQUFJLENBQUMsVUFBVSxHQUFHLEtBQUssQ0FBQztRQUN4QixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUNuQixDQUFDO0lBQ0QsTUFBTTtRQUNKLE9BQU8sSUFBSSxDQUFDLFNBQVMsSUFBSSxTQUFTLENBQUM7SUFDckMsQ0FBQztDQUNGO0FBRUQsU0FBUyxTQUFTLENBQUMsSUFBVTtJQUMzQixJQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sRUFBRTtRQUNoQixPQUFPLEVBQUUsQ0FBQztLQUNYO0lBQ0QsSUFBSSxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsSUFBSSxJQUFJLEVBQUU7UUFDakMsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsVUFBVSxFQUFFO1lBQzNCLE1BQU0sSUFBSSxLQUFLLENBQUMsK0JBQStCLENBQUMsQ0FBQztTQUNsRDtRQUNELE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxJQUFJLEVBQUUsR0FBRyxTQUFTLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7S0FDakU7U0FBTTtRQUNMLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLFNBQVMsRUFBRTtZQUMxQixNQUFNLElBQUksS0FBSyxDQUFDLDhCQUE4QixDQUFDLENBQUM7U0FDakQ7UUFDRCxPQUFPLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsSUFBSSxFQUFFLEdBQUcsU0FBUyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO0tBQ2hFO0FBQ0gsQ0FBQztBQUVELFNBQVMsdUJBQXVCLENBQUMsQ0FBUztJQUN4QyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUU7UUFDVCxNQUFNLEtBQUssQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO0tBQ2hDO0lBQ0QsSUFBSSxVQUFVLENBQUMsQ0FBQyxDQUFDLEVBQUU7UUFDakIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0tBQ2Q7SUFDRCxPQUFPLENBQUMsSUFBSSxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN2QyxDQUFDO0FBRUQsU0FBUyxVQUFVLENBQUMsQ0FBUztJQUMzQixPQUFPLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzVCLENBQUMifQ==\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MerkleMap = void 0;\nconst merkle_1 = require(\"./merkle\");\nconst varint_1 = require(\"./varint\");\n/**\n * This implements \"Merkelized Maps\", documented at\n * https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/merkle.md#merkleized-maps\n *\n * A merkelized map consist of two merkle trees, one for the keys of\n * a map and one for the values of the same map, thus the two merkle\n * trees have the same shape. The commitment is the number elements\n * in the map followed by the keys' merkle root followed by the\n * values' merkle root.\n */\nclass MerkleMap {\n    /**\n     * @param keys Sorted list of (unhashed) keys\n     * @param values values, in corresponding order as the keys, and of equal length\n     */\n    constructor(keys, values) {\n        if (keys.length != values.length) {\n            throw new Error('keys and values should have the same length');\n        }\n        // Sanity check: verify that keys are actually sorted and with no duplicates\n        for (let i = 0; i < keys.length - 1; i++) {\n            if (keys[i].toString('hex') >= keys[i + 1].toString('hex')) {\n                throw new Error('keys must be in strictly increasing order');\n            }\n        }\n        this.keys = keys;\n        this.keysTree = new merkle_1.Merkle(keys.map((k) => (0, merkle_1.hashLeaf)(k)));\n        this.values = values;\n        this.valuesTree = new merkle_1.Merkle(values.map((v) => (0, merkle_1.hashLeaf)(v)));\n    }\n    commitment() {\n        // returns a buffer between 65 and 73 (included) bytes long\n        return Buffer.concat([\n            (0, varint_1.createVarint)(this.keys.length),\n            this.keysTree.getRoot(),\n            this.valuesTree.getRoot(),\n        ]);\n    }\n}\nexports.MerkleMap = MerkleMap;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVya2xlTWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9tZXJrbGVNYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEscUNBQTRDO0FBQzVDLHFDQUF3QztBQUV4Qzs7Ozs7Ozs7O0dBU0c7QUFDSCxNQUFhLFNBQVM7SUFLcEI7OztPQUdHO0lBQ0gsWUFBWSxJQUF1QixFQUFFLE1BQXlCO1FBQzVELElBQUksSUFBSSxDQUFDLE1BQU0sSUFBSSxNQUFNLENBQUMsTUFBTSxFQUFFO1lBQ2hDLE1BQU0sSUFBSSxLQUFLLENBQUMsNkNBQTZDLENBQUMsQ0FBQztTQUNoRTtRQUVELDRFQUE0RTtRQUM1RSxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7WUFDeEMsSUFBSSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxJQUFJLElBQUksQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxFQUFFO2dCQUMxRCxNQUFNLElBQUksS0FBSyxDQUFDLDJDQUEyQyxDQUFDLENBQUM7YUFDOUQ7U0FDRjtRQUVELElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO1FBQ2pCLElBQUksQ0FBQyxRQUFRLEdBQUcsSUFBSSxlQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBQSxpQkFBUSxFQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUN6RCxJQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQztRQUNyQixJQUFJLENBQUMsVUFBVSxHQUFHLElBQUksZUFBTSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLElBQUEsaUJBQVEsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDL0QsQ0FBQztJQUVELFVBQVU7UUFDUiwyREFBMkQ7UUFDM0QsT0FBTyxNQUFNLENBQUMsTUFBTSxDQUFDO1lBQ25CLElBQUEscUJBQVksRUFBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQztZQUM5QixJQUFJLENBQUMsUUFBUSxDQUFDLE9BQU8sRUFBRTtZQUN2QixJQUFJLENBQUMsVUFBVSxDQUFDLE9BQU8sRUFBRTtTQUMxQixDQUFDLENBQUM7SUFDTCxDQUFDO0NBQ0Y7QUFuQ0QsOEJBbUNDIn0=\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultWalletPolicy = exports.WalletPolicy = void 0;\nconst bitcoinjs_lib_1 = require(\"bitcoinjs-lib\");\nconst buffertools_1 = require(\"./buffertools\");\nconst merkle_1 = require(\"./merkle\");\nconst WALLET_POLICY_V2 = 2;\n/**\n * The Bitcon hardware app uses a descriptors-like thing to describe\n * how to construct output scripts from keys. A \"Wallet Policy\" consists\n * of a \"Descriptor Template\" and a list of \"keys\". A key is basically\n * a serialized BIP32 extended public key with some added derivation path\n * information. This is documented at\n * https://github.com/LedgerHQ/app-bitcoin-new/blob/master/doc/wallet.md\n */\nclass WalletPolicy {\n    /**\n     * Creates and instance of a wallet policy.\n     * @param name an ascii string, up to 16 bytes long; it must be an empty string for default wallet policies\n     * @param descriptorTemplate the wallet policy template\n     * @param keys and array of the keys, with the key derivation information\n     */\n    constructor(name, descriptorTemplate, keys) {\n        this.name = name;\n        this.descriptorTemplate = descriptorTemplate;\n        this.keys = keys;\n    }\n    /**\n     * Returns the unique 32-bytes id of this wallet policy.\n     */\n    getId() {\n        return bitcoinjs_lib_1.crypto.sha256(this.serialize());\n    }\n    /**\n     * Serializes the wallet policy for transmission via the hardware wallet protocol.\n     * @returns the serialized wallet policy\n     */\n    serialize() {\n        const keyBuffers = this.keys.map((k) => {\n            return Buffer.from(k, 'ascii');\n        });\n        const m = new merkle_1.Merkle(keyBuffers.map((k) => (0, merkle_1.hashLeaf)(k)));\n        const buf = new buffertools_1.BufferWriter();\n        buf.writeUInt8(WALLET_POLICY_V2); // wallet version\n        // length of wallet name, and wallet name\n        buf.writeVarSlice(Buffer.from(this.name, 'ascii'));\n        // length of descriptor template\n        buf.writeVarInt(this.descriptorTemplate.length);\n        // sha256 hash of descriptor template\n        buf.writeSlice(bitcoinjs_lib_1.crypto.sha256(Buffer.from(this.descriptorTemplate)));\n        // number of keys\n        buf.writeVarInt(this.keys.length);\n        // root of Merkle tree of keys\n        buf.writeSlice(m.getRoot());\n        return buf.buffer();\n    }\n}\nexports.WalletPolicy = WalletPolicy;\n/**\n * Simplified class to handle default wallet policies that can be used without policy registration.\n */\nclass DefaultWalletPolicy extends WalletPolicy {\n    constructor(descriptorTemplate, key) {\n        super('', descriptorTemplate, [key]);\n    }\n}\nexports.DefaultWalletPolicy = DefaultWalletPolicy;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9saWN5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9wb2xpY3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaURBQXVDO0FBRXZDLCtDQUE2QztBQUM3QyxxQ0FBNEM7QUFFNUMsTUFBTSxnQkFBZ0IsR0FBRyxDQUFDLENBQUM7QUFFM0I7Ozs7Ozs7R0FPRztBQUNILE1BQWEsWUFBWTtJQUl2Qjs7Ozs7T0FLRztJQUNILFlBQ0UsSUFBWSxFQUNaLGtCQUEwQixFQUMxQixJQUF1QjtRQUV2QixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztRQUNqQixJQUFJLENBQUMsa0JBQWtCLEdBQUcsa0JBQWtCLENBQUM7UUFDN0MsSUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7SUFDbkIsQ0FBQztJQUVEOztPQUVHO0lBQ0gsS0FBSztRQUNILE9BQU8sc0JBQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxDQUFDLENBQUM7SUFDekMsQ0FBQztJQUVEOzs7T0FHRztJQUNILFNBQVM7UUFDUCxNQUFNLFVBQVUsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFO1lBQ3JDLE9BQU8sTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsT0FBTyxDQUFDLENBQUM7UUFDakMsQ0FBQyxDQUFDLENBQUM7UUFDSCxNQUFNLENBQUMsR0FBRyxJQUFJLGVBQU0sQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxJQUFBLGlCQUFRLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBRXpELE1BQU0sR0FBRyxHQUFHLElBQUksMEJBQVksRUFBRSxDQUFDO1FBQy9CLEdBQUcsQ0FBQyxVQUFVLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxDQUFDLGlCQUFpQjtRQUVuRCx5Q0FBeUM7UUFDekMsR0FBRyxDQUFDLGFBQWEsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLENBQUMsQ0FBQztRQUVuRCxnQ0FBZ0M7UUFDaEMsR0FBRyxDQUFDLFdBQVcsQ0FBQyxJQUFJLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDaEQscUNBQXFDO1FBQ3JDLEdBQUcsQ0FBQyxVQUFVLENBQUMsc0JBQU0sQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsa0JBQWtCLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFFcEUsaUJBQWlCO1FBQ2pCLEdBQUcsQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUNsQyw4QkFBOEI7UUFDOUIsR0FBRyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQztRQUM1QixPQUFPLEdBQUcsQ0FBQyxNQUFNLEVBQUUsQ0FBQztJQUN0QixDQUFDO0NBQ0Y7QUF0REQsb0NBc0RDO0FBUUQ7O0dBRUc7QUFDSCxNQUFhLG1CQUFvQixTQUFRLFlBQVk7SUFDbkQsWUFBWSxrQkFBNkMsRUFBRSxHQUFXO1FBQ3BFLEtBQUssQ0FBQyxFQUFFLEVBQUUsa0JBQWtCLEVBQUUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO0lBQ3ZDLENBQUM7Q0FDRjtBQUpELGtEQUlDIn0=\"use strict\";\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PsbtV2 = exports.NoSuchEntry = exports.psbtOut = exports.psbtIn = exports.psbtGlobal = void 0;\nconst bjs = __importStar(require(\"bitcoinjs-lib\"));\nconst buffertools_1 = require(\"./buffertools\");\nconst varint_1 = require(\"./varint\");\nvar psbtGlobal;\n(function (psbtGlobal) {\n    psbtGlobal[psbtGlobal[\"UNSIGNED_TX\"] = 0] = \"UNSIGNED_TX\";\n    psbtGlobal[psbtGlobal[\"XPUB\"] = 1] = \"XPUB\";\n    psbtGlobal[psbtGlobal[\"TX_VERSION\"] = 2] = \"TX_VERSION\";\n    psbtGlobal[psbtGlobal[\"FALLBACK_LOCKTIME\"] = 3] = \"FALLBACK_LOCKTIME\";\n    psbtGlobal[psbtGlobal[\"INPUT_COUNT\"] = 4] = \"INPUT_COUNT\";\n    psbtGlobal[psbtGlobal[\"OUTPUT_COUNT\"] = 5] = \"OUTPUT_COUNT\";\n    psbtGlobal[psbtGlobal[\"TX_MODIFIABLE\"] = 6] = \"TX_MODIFIABLE\";\n    psbtGlobal[psbtGlobal[\"VERSION\"] = 251] = \"VERSION\";\n})(psbtGlobal = exports.psbtGlobal || (exports.psbtGlobal = {}));\nvar psbtIn;\n(function (psbtIn) {\n    psbtIn[psbtIn[\"NON_WITNESS_UTXO\"] = 0] = \"NON_WITNESS_UTXO\";\n    psbtIn[psbtIn[\"WITNESS_UTXO\"] = 1] = \"WITNESS_UTXO\";\n    psbtIn[psbtIn[\"PARTIAL_SIG\"] = 2] = \"PARTIAL_SIG\";\n    psbtIn[psbtIn[\"SIGHASH_TYPE\"] = 3] = \"SIGHASH_TYPE\";\n    psbtIn[psbtIn[\"REDEEM_SCRIPT\"] = 4] = \"REDEEM_SCRIPT\";\n    psbtIn[psbtIn[\"WITNESS_SCRIPT\"] = 5] = \"WITNESS_SCRIPT\";\n    psbtIn[psbtIn[\"BIP32_DERIVATION\"] = 6] = \"BIP32_DERIVATION\";\n    psbtIn[psbtIn[\"FINAL_SCRIPTSIG\"] = 7] = \"FINAL_SCRIPTSIG\";\n    psbtIn[psbtIn[\"FINAL_SCRIPTWITNESS\"] = 8] = \"FINAL_SCRIPTWITNESS\";\n    psbtIn[psbtIn[\"PREVIOUS_TXID\"] = 14] = \"PREVIOUS_TXID\";\n    psbtIn[psbtIn[\"OUTPUT_INDEX\"] = 15] = \"OUTPUT_INDEX\";\n    psbtIn[psbtIn[\"SEQUENCE\"] = 16] = \"SEQUENCE\";\n    psbtIn[psbtIn[\"TAP_KEY_SIG\"] = 19] = \"TAP_KEY_SIG\";\n    psbtIn[psbtIn[\"TAP_BIP32_DERIVATION\"] = 22] = \"TAP_BIP32_DERIVATION\";\n})(psbtIn = exports.psbtIn || (exports.psbtIn = {}));\nvar psbtOut;\n(function (psbtOut) {\n    psbtOut[psbtOut[\"REDEEM_SCRIPT\"] = 0] = \"REDEEM_SCRIPT\";\n    psbtOut[psbtOut[\"WITNESS_SCRIPT\"] = 1] = \"WITNESS_SCRIPT\";\n    psbtOut[psbtOut[\"BIP_32_DERIVATION\"] = 2] = \"BIP_32_DERIVATION\";\n    psbtOut[psbtOut[\"AMOUNT\"] = 3] = \"AMOUNT\";\n    psbtOut[psbtOut[\"SCRIPT\"] = 4] = \"SCRIPT\";\n    psbtOut[psbtOut[\"TAP_BIP32_DERIVATION\"] = 7] = \"TAP_BIP32_DERIVATION\";\n})(psbtOut = exports.psbtOut || (exports.psbtOut = {}));\nconst PSBT_MAGIC_BYTES = Buffer.from([0x70, 0x73, 0x62, 0x74, 0xff]);\nclass NoSuchEntry extends Error {\n}\nexports.NoSuchEntry = NoSuchEntry;\n/**\n * Implements Partially Signed Bitcoin Transaction version 2, BIP370, as\n * documented at https://github.com/bitcoin/bips/blob/master/bip-0370.mediawiki\n * and https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki\n *\n * A psbt is a data structure that can carry all relevant information about a\n * transaction through all stages of the signing process. From constructing an\n * unsigned transaction to extracting the final serialized transaction ready for\n * broadcast.\n *\n * This implementation is limited to what's needed in ledgerjs to carry out its\n * duties, which means that support for features like multisig or taproot script\n * path spending are not implemented. Specifically, it supports p2pkh,\n * p2wpkhWrappedInP2sh, p2wpkh and p2tr key path spending.\n *\n * This class is made purposefully dumb, so it's easy to add support for\n * complemantary fields as needed in the future.\n */\nclass PsbtV2 {\n    constructor() {\n        this.globalMap = new Map();\n        this.inputMaps = [];\n        this.outputMaps = [];\n    }\n    setGlobalTxVersion(version) {\n        this.setGlobal(psbtGlobal.TX_VERSION, uint32LE(version));\n    }\n    getGlobalTxVersion() {\n        return this.getGlobal(psbtGlobal.TX_VERSION).readUInt32LE(0);\n    }\n    setGlobalFallbackLocktime(locktime) {\n        this.setGlobal(psbtGlobal.FALLBACK_LOCKTIME, uint32LE(locktime));\n    }\n    getGlobalFallbackLocktime() {\n        var _a;\n        return (_a = this.getGlobalOptional(psbtGlobal.FALLBACK_LOCKTIME)) === null || _a === void 0 ? void 0 : _a.readUInt32LE(0);\n    }\n    setGlobalInputCount(inputCount) {\n        this.setGlobal(psbtGlobal.INPUT_COUNT, varint(inputCount));\n    }\n    getGlobalInputCount() {\n        return fromVarint(this.getGlobal(psbtGlobal.INPUT_COUNT));\n    }\n    setGlobalOutputCount(outputCount) {\n        this.setGlobal(psbtGlobal.OUTPUT_COUNT, varint(outputCount));\n    }\n    getGlobalOutputCount() {\n        return fromVarint(this.getGlobal(psbtGlobal.OUTPUT_COUNT));\n    }\n    setGlobalTxModifiable(byte) {\n        this.setGlobal(psbtGlobal.TX_MODIFIABLE, byte);\n    }\n    getGlobalTxModifiable() {\n        return this.getGlobalOptional(psbtGlobal.TX_MODIFIABLE);\n    }\n    setGlobalPsbtVersion(psbtVersion) {\n        this.setGlobal(psbtGlobal.VERSION, uint32LE(psbtVersion));\n    }\n    getGlobalPsbtVersion() {\n        return this.getGlobal(psbtGlobal.VERSION).readUInt32LE(0);\n    }\n    setInputNonWitnessUtxo(inputIndex, transaction) {\n        this.setInput(inputIndex, psbtIn.NON_WITNESS_UTXO, b(), transaction);\n    }\n    getInputNonWitnessUtxo(inputIndex) {\n        return this.getInputOptional(inputIndex, psbtIn.NON_WITNESS_UTXO, b());\n    }\n    setInputWitnessUtxo(inputIndex, amount, scriptPubKey) {\n        const buf = new buffertools_1.BufferWriter();\n        buf.writeSlice(uint64LE(amount));\n        buf.writeVarSlice(scriptPubKey);\n        this.setInput(inputIndex, psbtIn.WITNESS_UTXO, b(), buf.buffer());\n    }\n    getInputWitnessUtxo(inputIndex) {\n        const utxo = this.getInputOptional(inputIndex, psbtIn.WITNESS_UTXO, b());\n        if (!utxo)\n            return undefined;\n        const buf = new buffertools_1.BufferReader(utxo);\n        return {\n            amount: (0, buffertools_1.unsafeFrom64bitLE)(buf.readSlice(8)),\n            scriptPubKey: buf.readVarSlice()\n        };\n    }\n    setInputPartialSig(inputIndex, pubkey, signature) {\n        this.setInput(inputIndex, psbtIn.PARTIAL_SIG, pubkey, signature);\n    }\n    getInputPartialSig(inputIndex, pubkey) {\n        return this.getInputOptional(inputIndex, psbtIn.PARTIAL_SIG, pubkey);\n    }\n    setInputSighashType(inputIndex, sigHashtype) {\n        this.setInput(inputIndex, psbtIn.SIGHASH_TYPE, b(), uint32LE(sigHashtype));\n    }\n    getInputSighashType(inputIndex) {\n        const result = this.getInputOptional(inputIndex, psbtIn.SIGHASH_TYPE, b());\n        if (!result)\n            return undefined;\n        return result.readUInt32LE(0);\n    }\n    setInputRedeemScript(inputIndex, redeemScript) {\n        this.setInput(inputIndex, psbtIn.REDEEM_SCRIPT, b(), redeemScript);\n    }\n    getInputRedeemScript(inputIndex) {\n        return this.getInputOptional(inputIndex, psbtIn.REDEEM_SCRIPT, b());\n    }\n    setInputWitnessScript(inputIndex, witnessScript) {\n        this.setInput(inputIndex, psbtIn.WITNESS_SCRIPT, b(), witnessScript);\n    }\n    getInputWitnessScript(inputIndex) {\n        return this.getInputOptional(inputIndex, psbtIn.WITNESS_SCRIPT, b());\n    }\n    setInputBip32Derivation(inputIndex, pubkey, masterFingerprint, path) {\n        if (pubkey.length != 33)\n            throw new Error('Invalid pubkey length: ' + pubkey.length);\n        this.setInput(inputIndex, psbtIn.BIP32_DERIVATION, pubkey, this.encodeBip32Derivation(masterFingerprint, path));\n    }\n    getInputBip32Derivation(inputIndex, pubkey) {\n        const buf = this.getInputOptional(inputIndex, psbtIn.BIP32_DERIVATION, pubkey);\n        if (!buf)\n            return undefined;\n        return this.decodeBip32Derivation(buf);\n    }\n    setInputFinalScriptsig(inputIndex, scriptSig) {\n        this.setInput(inputIndex, psbtIn.FINAL_SCRIPTSIG, b(), scriptSig);\n    }\n    getInputFinalScriptsig(inputIndex) {\n        return this.getInputOptional(inputIndex, psbtIn.FINAL_SCRIPTSIG, b());\n    }\n    setInputFinalScriptwitness(inputIndex, scriptWitness) {\n        this.setInput(inputIndex, psbtIn.FINAL_SCRIPTWITNESS, b(), scriptWitness);\n    }\n    getInputFinalScriptwitness(inputIndex) {\n        return this.getInput(inputIndex, psbtIn.FINAL_SCRIPTWITNESS, b());\n    }\n    setInputPreviousTxId(inputIndex, txid) {\n        this.setInput(inputIndex, psbtIn.PREVIOUS_TXID, b(), txid);\n    }\n    getInputPreviousTxid(inputIndex) {\n        return this.getInput(inputIndex, psbtIn.PREVIOUS_TXID, b());\n    }\n    setInputOutputIndex(inputIndex, outputIndex) {\n        this.setInput(inputIndex, psbtIn.OUTPUT_INDEX, b(), uint32LE(outputIndex));\n    }\n    getInputOutputIndex(inputIndex) {\n        return this.getInput(inputIndex, psbtIn.OUTPUT_INDEX, b()).readUInt32LE(0);\n    }\n    setInputSequence(inputIndex, sequence) {\n        this.setInput(inputIndex, psbtIn.SEQUENCE, b(), uint32LE(sequence));\n    }\n    getInputSequence(inputIndex) {\n        var _a, _b;\n        return ((_b = (_a = this.getInputOptional(inputIndex, psbtIn.SEQUENCE, b())) === null || _a === void 0 ? void 0 : _a.readUInt32LE(0)) !== null && _b !== void 0 ? _b : 0xffffffff);\n    }\n    setInputTapKeySig(inputIndex, sig) {\n        this.setInput(inputIndex, psbtIn.TAP_KEY_SIG, b(), sig);\n    }\n    getInputTapKeySig(inputIndex) {\n        return this.getInputOptional(inputIndex, psbtIn.TAP_KEY_SIG, b());\n    }\n    setInputTapBip32Derivation(inputIndex, pubkey, hashes, masterFingerprint, path) {\n        if (pubkey.length != 32)\n            throw new Error('Invalid pubkey length: ' + pubkey.length);\n        const buf = this.encodeTapBip32Derivation(hashes, masterFingerprint, path);\n        this.setInput(inputIndex, psbtIn.TAP_BIP32_DERIVATION, pubkey, buf);\n    }\n    getInputTapBip32Derivation(inputIndex, pubkey) {\n        const buf = this.getInput(inputIndex, psbtIn.TAP_BIP32_DERIVATION, pubkey);\n        return this.decodeTapBip32Derivation(buf);\n    }\n    getInputKeyDatas(inputIndex, keyType) {\n        return this.getKeyDatas(this.inputMaps[inputIndex], keyType);\n    }\n    setOutputRedeemScript(outputIndex, redeemScript) {\n        this.setOutput(outputIndex, psbtOut.REDEEM_SCRIPT, b(), redeemScript);\n    }\n    getOutputRedeemScript(outputIndex) {\n        return this.getOutput(outputIndex, psbtOut.REDEEM_SCRIPT, b());\n    }\n    setOutputBip32Derivation(outputIndex, pubkey, masterFingerprint, path) {\n        this.setOutput(outputIndex, psbtOut.BIP_32_DERIVATION, pubkey, this.encodeBip32Derivation(masterFingerprint, path));\n    }\n    getOutputBip32Derivation(outputIndex, pubkey) {\n        const buf = this.getOutput(outputIndex, psbtOut.BIP_32_DERIVATION, pubkey);\n        return this.decodeBip32Derivation(buf);\n    }\n    setOutputAmount(outputIndex, amount) {\n        this.setOutput(outputIndex, psbtOut.AMOUNT, b(), uint64LE(amount));\n    }\n    getOutputAmount(outputIndex) {\n        const buf = this.getOutput(outputIndex, psbtOut.AMOUNT, b());\n        return (0, buffertools_1.unsafeFrom64bitLE)(buf);\n    }\n    setOutputScript(outputIndex, scriptPubKey) {\n        this.setOutput(outputIndex, psbtOut.SCRIPT, b(), scriptPubKey);\n    }\n    getOutputScript(outputIndex) {\n        return this.getOutput(outputIndex, psbtOut.SCRIPT, b());\n    }\n    setOutputTapBip32Derivation(outputIndex, pubkey, hashes, fingerprint, path) {\n        const buf = this.encodeTapBip32Derivation(hashes, fingerprint, path);\n        this.setOutput(outputIndex, psbtOut.TAP_BIP32_DERIVATION, pubkey, buf);\n    }\n    getOutputTapBip32Derivation(outputIndex, pubkey) {\n        const buf = this.getOutput(outputIndex, psbtOut.TAP_BIP32_DERIVATION, pubkey);\n        return this.decodeTapBip32Derivation(buf);\n    }\n    deleteInputEntries(inputIndex, keyTypes) {\n        const map = this.inputMaps[inputIndex];\n        map.forEach((_v, k, m) => {\n            if (this.isKeyType(k, keyTypes)) {\n                m.delete(k);\n            }\n        });\n    }\n    copy(to) {\n        this.copyMap(this.globalMap, to.globalMap);\n        this.copyMaps(this.inputMaps, to.inputMaps);\n        this.copyMaps(this.outputMaps, to.outputMaps);\n    }\n    copyMaps(from, to) {\n        from.forEach((m, index) => {\n            const to_index = new Map();\n            this.copyMap(m, to_index);\n            to[index] = to_index;\n        });\n    }\n    copyMap(from, to) {\n        from.forEach((v, k) => to.set(k, Buffer.from(v)));\n    }\n    serialize() {\n        const buf = new buffertools_1.BufferWriter();\n        buf.writeSlice(Buffer.from([0x70, 0x73, 0x62, 0x74, 0xff]));\n        serializeMap(buf, this.globalMap);\n        this.inputMaps.forEach((map) => {\n            serializeMap(buf, map);\n        });\n        this.outputMaps.forEach((map) => {\n            serializeMap(buf, map);\n        });\n        return buf.buffer();\n    }\n    deserialize(psbt) {\n        const buf = new buffertools_1.BufferReader(psbt);\n        if (!buf.readSlice(5).equals(PSBT_MAGIC_BYTES)) {\n            throw new Error('Invalid magic bytes');\n        }\n        while (this.readKeyPair(this.globalMap, buf))\n            ;\n        let psbtVersion;\n        try {\n            psbtVersion = this.getGlobalPsbtVersion();\n        }\n        catch (_a) {\n            psbtVersion = 0;\n        }\n        if (psbtVersion !== 0 && psbtVersion !== 2)\n            throw new Error(\"Only PSBTs of version 0 or 2 are supported\");\n        let nInputs;\n        let nOutputs;\n        if (psbtVersion == 0) {\n            // if PSBTv0, we parse the PSBT_GLOBAL_UNSIGNED_TX field\n            const txRaw = this.getGlobal(psbtGlobal.UNSIGNED_TX);\n            const tx = bjs.Transaction.fromBuffer(txRaw);\n            nInputs = tx.ins.length;\n            nOutputs = tx.outs.length;\n        }\n        else {\n            // if PSBTv2, we already have the counts\n            nInputs = this.getGlobalInputCount();\n            nOutputs = this.getGlobalOutputCount();\n        }\n        for (let i = 0; i < nInputs; i++) {\n            this.inputMaps[i] = new Map();\n            while (this.readKeyPair(this.inputMaps[i], buf))\n                ;\n        }\n        for (let i = 0; i < nOutputs; i++) {\n            this.outputMaps[i] = new Map();\n            while (this.readKeyPair(this.outputMaps[i], buf))\n                ;\n        }\n        this.normalizeToV2();\n    }\n    normalizeToV2() {\n        var _a;\n        // if the psbt is a PsbtV0, convert it to PsbtV2 instead.\n        // throw an error for any version other than 0 or 2,\n        const psbtVersion = (_a = this.getGlobalOptional(psbtGlobal.VERSION)) === null || _a === void 0 ? void 0 : _a.readInt32LE(0);\n        if (psbtVersion === 2)\n            return;\n        else if (psbtVersion !== undefined) {\n            throw new Error('Invalid or unsupported value for PSBT_GLOBAL_VERSION');\n        }\n        // Convert PsbtV0 to PsbtV2 by parsing the PSBT_GLOBAL_UNSIGNED_TX field\n        // and filling in the corresponding fields.\n        const txRaw = this.getGlobal(psbtGlobal.UNSIGNED_TX);\n        const tx = bjs.Transaction.fromBuffer(txRaw);\n        this.setGlobalPsbtVersion(2);\n        this.setGlobalTxVersion(tx.version);\n        this.setGlobalFallbackLocktime(tx.locktime);\n        this.setGlobalInputCount(tx.ins.length);\n        this.setGlobalOutputCount(tx.outs.length);\n        for (let i = 0; i < tx.ins.length; i++) {\n            this.setInputPreviousTxId(i, tx.ins[i].hash);\n            this.setInputOutputIndex(i, tx.ins[i].index);\n            this.setInputSequence(i, tx.ins[i].sequence);\n        }\n        for (let i = 0; i < tx.outs.length; i++) {\n            this.setOutputAmount(i, tx.outs[i].value);\n            this.setOutputScript(i, tx.outs[i].script);\n        }\n        // PSBT_GLOBAL_UNSIGNED_TX must be removed in a valid PSBTv2\n        this.globalMap.delete(psbtGlobal.UNSIGNED_TX.toString(16).padStart(2, '0'));\n    }\n    /**\n     * Imports a BitcoinJS (bitcoinjs-lib) Psbt object.\n     * https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/ts_src/psbt.ts\n     *\n     * Prepares the fields required for signing a Psbt on a Ledger\n     * device. It should be used exclusively before calling\n     * `appClient.signPsbt()` and not as a general Psbt conversion method.\n     *\n     * Note: This method supports all the policies that the Ledger is able to\n     * sign, with the exception of taproot: tr(@0).\n     */\n    fromBitcoinJS(psbtBJS) {\n        function isTaprootInput(input) {\n            let isP2TR;\n            try {\n                bjs.payments.p2tr({ output: input.witnessUtxo.script });\n                isP2TR = true;\n            }\n            catch (err) {\n                isP2TR = false;\n            }\n            return (input &&\n                !!(input.tapInternalKey ||\n                    input.tapMerkleRoot ||\n                    (input.tapLeafScript && input.tapLeafScript.length) ||\n                    (input.tapBip32Derivation && input.tapBip32Derivation.length) ||\n                    isP2TR));\n        }\n        this.setGlobalPsbtVersion(2);\n        this.setGlobalTxVersion(psbtBJS.version);\n        this.setGlobalInputCount(psbtBJS.data.inputs.length);\n        this.setGlobalOutputCount(psbtBJS.txOutputs.length);\n        if (psbtBJS.locktime !== undefined)\n            this.setGlobalFallbackLocktime(psbtBJS.locktime);\n        psbtBJS.data.inputs.forEach((input, index) => {\n            if (isTaprootInput(input))\n                throw new Error(`Taproot inputs not supported`);\n            this.setInputPreviousTxId(index, psbtBJS.txInputs[index].hash);\n            if (psbtBJS.txInputs[index].sequence !== undefined)\n                this.setInputSequence(index, psbtBJS.txInputs[index].sequence);\n            this.setInputOutputIndex(index, psbtBJS.txInputs[index].index);\n            if (input.sighashType !== undefined)\n                this.setInputSighashType(index, input.sighashType);\n            if (input.nonWitnessUtxo)\n                this.setInputNonWitnessUtxo(index, input.nonWitnessUtxo);\n            if (input.witnessUtxo) {\n                this.setInputWitnessUtxo(index, input.witnessUtxo.value, input.witnessUtxo.script);\n            }\n            if (input.witnessScript)\n                this.setInputWitnessScript(index, input.witnessScript);\n            if (input.redeemScript)\n                this.setInputRedeemScript(index, input.redeemScript);\n            psbtBJS.data.inputs[index].bip32Derivation.forEach(derivation => {\n                if (!/^m\\//i.test(derivation.path))\n                    throw new Error(`Invalid input bip32 derivation`);\n                const pathArray = derivation.path\n                    .replace(/m\\//i, '')\n                    .split('/')\n                    .map(level => level.match(/['h]/i) ? parseInt(level) + 0x80000000 : Number(level));\n                this.setInputBip32Derivation(index, derivation.pubkey, derivation.masterFingerprint, pathArray);\n            });\n        });\n        psbtBJS.txOutputs.forEach((output, index) => {\n            this.setOutputAmount(index, output.value);\n            this.setOutputScript(index, output.script);\n        });\n        return this;\n    }\n    readKeyPair(map, buf) {\n        const keyLen = (0, varint_1.sanitizeBigintToNumber)(buf.readVarInt());\n        if (keyLen == 0) {\n            return false;\n        }\n        const keyType = buf.readUInt8();\n        const keyData = buf.readSlice(keyLen - 1);\n        const value = buf.readVarSlice();\n        set(map, keyType, keyData, value);\n        return true;\n    }\n    getKeyDatas(map, keyType) {\n        const result = [];\n        map.forEach((_v, k) => {\n            if (this.isKeyType(k, [keyType])) {\n                result.push(Buffer.from(k.substring(2), 'hex'));\n            }\n        });\n        return result;\n    }\n    isKeyType(hexKey, keyTypes) {\n        const keyType = Buffer.from(hexKey.substring(0, 2), 'hex').readUInt8(0);\n        return keyTypes.some((k) => k == keyType);\n    }\n    setGlobal(keyType, value) {\n        const key = new Key(keyType, Buffer.from([]));\n        this.globalMap.set(key.toString(), value);\n    }\n    getGlobal(keyType) {\n        return get(this.globalMap, keyType, b(), false);\n    }\n    getGlobalOptional(keyType) {\n        return get(this.globalMap, keyType, b(), true);\n    }\n    setInput(index, keyType, keyData, value) {\n        set(this.getMap(index, this.inputMaps), keyType, keyData, value);\n    }\n    getInput(index, keyType, keyData) {\n        return get(this.inputMaps[index], keyType, keyData, false);\n    }\n    getInputOptional(index, keyType, keyData) {\n        return get(this.inputMaps[index], keyType, keyData, true);\n    }\n    setOutput(index, keyType, keyData, value) {\n        set(this.getMap(index, this.outputMaps), keyType, keyData, value);\n    }\n    getOutput(index, keyType, keyData) {\n        return get(this.outputMaps[index], keyType, keyData, false);\n    }\n    getMap(index, maps) {\n        if (maps[index]) {\n            return maps[index];\n        }\n        return (maps[index] = new Map());\n    }\n    encodeBip32Derivation(masterFingerprint, path) {\n        const buf = new buffertools_1.BufferWriter();\n        this.writeBip32Derivation(buf, masterFingerprint, path);\n        return buf.buffer();\n    }\n    decodeBip32Derivation(buffer) {\n        const buf = new buffertools_1.BufferReader(buffer);\n        return this.readBip32Derivation(buf);\n    }\n    writeBip32Derivation(buf, masterFingerprint, path) {\n        buf.writeSlice(masterFingerprint);\n        path.forEach((element) => {\n            buf.writeUInt32(element);\n        });\n    }\n    readBip32Derivation(buf) {\n        const masterFingerprint = buf.readSlice(4);\n        const path = [];\n        while (buf.offset < buf.buffer.length) {\n            path.push(buf.readUInt32());\n        }\n        return { masterFingerprint, path };\n    }\n    encodeTapBip32Derivation(hashes, masterFingerprint, path) {\n        const buf = new buffertools_1.BufferWriter();\n        buf.writeVarInt(hashes.length);\n        hashes.forEach((h) => {\n            buf.writeSlice(h);\n        });\n        this.writeBip32Derivation(buf, masterFingerprint, path);\n        return buf.buffer();\n    }\n    decodeTapBip32Derivation(buffer) {\n        const buf = new buffertools_1.BufferReader(buffer);\n        const hashCount = (0, varint_1.sanitizeBigintToNumber)(buf.readVarInt());\n        const hashes = [];\n        for (let i = 0; i < hashCount; i++) {\n            hashes.push(buf.readSlice(32));\n        }\n        const deriv = this.readBip32Derivation(buf);\n        return Object.assign({ hashes }, deriv);\n    }\n}\nexports.PsbtV2 = PsbtV2;\nfunction get(map, keyType, keyData, acceptUndefined) {\n    if (!map)\n        throw Error('No such map');\n    const key = new Key(keyType, keyData);\n    const value = map.get(key.toString());\n    if (!value) {\n        if (acceptUndefined) {\n            return undefined;\n        }\n        throw new NoSuchEntry(key.toString());\n    }\n    // Make sure to return a copy, to protect the underlying data.\n    return Buffer.from(value);\n}\nclass Key {\n    constructor(keyType, keyData) {\n        this.keyType = keyType;\n        this.keyData = keyData;\n    }\n    toString() {\n        const buf = new buffertools_1.BufferWriter();\n        this.toBuffer(buf);\n        return buf.buffer().toString('hex');\n    }\n    serialize(buf) {\n        buf.writeVarInt(1 + this.keyData.length);\n        this.toBuffer(buf);\n    }\n    toBuffer(buf) {\n        buf.writeUInt8(this.keyType);\n        buf.writeSlice(this.keyData);\n    }\n}\nclass KeyPair {\n    constructor(key, value) {\n        this.key = key;\n        this.value = value;\n    }\n    serialize(buf) {\n        this.key.serialize(buf);\n        buf.writeVarSlice(this.value);\n    }\n}\nfunction createKey(buf) {\n    return new Key(buf.readUInt8(0), buf.slice(1));\n}\nfunction serializeMap(buf, map) {\n    // serialize in lexicographical order of keys\n    for (let [key, value] of [...map].sort(([k1], [k2]) => k1.localeCompare(k2))) {\n        const keyPair = new KeyPair(createKey(Buffer.from(key, 'hex')), value);\n        keyPair.serialize(buf);\n    }\n    buf.writeUInt8(0);\n}\nfunction b() {\n    return Buffer.from([]);\n}\nfunction set(map, keyType, keyData, value) {\n    const key = new Key(keyType, keyData);\n    map.set(key.toString(), value);\n}\nfunction uint32LE(n) {\n    const buf = Buffer.alloc(4);\n    buf.writeUInt32LE(n, 0);\n    return buf;\n}\nfunction uint64LE(n) {\n    return (0, buffertools_1.unsafeTo64bitLE)(n);\n}\nfunction varint(n) {\n    const buf = new buffertools_1.BufferWriter();\n    buf.writeVarInt(n);\n    return buf.buffer();\n}\nfunction fromVarint(buf) {\n    return (0, varint_1.sanitizeBigintToNumber)(new buffertools_1.BufferReader(buf).readVarInt());\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHNidHYyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9wc2J0djIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDZEQUE2RDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFN0QsbURBQXFDO0FBRXJDLCtDQUt1QjtBQUN2QixxQ0FBa0Q7QUFFbEQsSUFBWSxVQVNYO0FBVEQsV0FBWSxVQUFVO0lBQ3BCLHlEQUFrQixDQUFBO0lBQ2xCLDJDQUFXLENBQUE7SUFDWCx1REFBaUIsQ0FBQTtJQUNqQixxRUFBd0IsQ0FBQTtJQUN4Qix5REFBa0IsQ0FBQTtJQUNsQiwyREFBbUIsQ0FBQTtJQUNuQiw2REFBb0IsQ0FBQTtJQUNwQixtREFBYyxDQUFBO0FBQ2hCLENBQUMsRUFUVyxVQUFVLEdBQVYsa0JBQVUsS0FBVixrQkFBVSxRQVNyQjtBQUNELElBQVksTUFlWDtBQWZELFdBQVksTUFBTTtJQUNoQiwyREFBdUIsQ0FBQTtJQUN2QixtREFBbUIsQ0FBQTtJQUNuQixpREFBa0IsQ0FBQTtJQUNsQixtREFBbUIsQ0FBQTtJQUNuQixxREFBb0IsQ0FBQTtJQUNwQix1REFBcUIsQ0FBQTtJQUNyQiwyREFBdUIsQ0FBQTtJQUN2Qix5REFBc0IsQ0FBQTtJQUN0QixpRUFBMEIsQ0FBQTtJQUMxQixzREFBb0IsQ0FBQTtJQUNwQixvREFBbUIsQ0FBQTtJQUNuQiw0Q0FBZSxDQUFBO0lBQ2Ysa0RBQWtCLENBQUE7SUFDbEIsb0VBQTJCLENBQUE7QUFDN0IsQ0FBQyxFQWZXLE1BQU0sR0FBTixjQUFNLEtBQU4sY0FBTSxRQWVqQjtBQUNELElBQVksT0FPWDtBQVBELFdBQVksT0FBTztJQUNqQix1REFBb0IsQ0FBQTtJQUNwQix5REFBcUIsQ0FBQTtJQUNyQiwrREFBd0IsQ0FBQTtJQUN4Qix5Q0FBYSxDQUFBO0lBQ2IseUNBQWEsQ0FBQTtJQUNiLHFFQUEyQixDQUFBO0FBQzdCLENBQUMsRUFQVyxPQUFPLEdBQVAsZUFBTyxLQUFQLGVBQU8sUUFPbEI7QUFFRCxNQUFNLGdCQUFnQixHQUFHLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUMsQ0FBQztBQUVyRSxNQUFhLFdBQVksU0FBUSxLQUFLO0NBQUc7QUFBekMsa0NBQXlDO0FBRXpDOzs7Ozs7Ozs7Ozs7Ozs7OztHQWlCRztBQUNILE1BQWEsTUFBTTtJQUFuQjtRQUNZLGNBQVMsR0FBd0IsSUFBSSxHQUFHLEVBQUUsQ0FBQztRQUMzQyxjQUFTLEdBQTBCLEVBQUUsQ0FBQztRQUN0QyxlQUFVLEdBQTBCLEVBQUUsQ0FBQztJQThrQm5ELENBQUM7SUE1a0JDLGtCQUFrQixDQUFDLE9BQWU7UUFDaEMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsVUFBVSxFQUFFLFFBQVEsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDO0lBQzNELENBQUM7SUFDRCxrQkFBa0I7UUFDaEIsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQyxVQUFVLENBQUMsQ0FBQyxZQUFZLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDL0QsQ0FBQztJQUNELHlCQUF5QixDQUFDLFFBQWdCO1FBQ3hDLElBQUksQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLGlCQUFpQixFQUFFLFFBQVEsQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDO0lBQ25FLENBQUM7SUFDRCx5QkFBeUI7O1FBQ3ZCLE9BQU8sTUFBQSxJQUFJLENBQUMsaUJBQWlCLENBQUMsVUFBVSxDQUFDLGlCQUFpQixDQUFDLDBDQUFFLFlBQVksQ0FDdkUsQ0FBQyxDQUNGLENBQUM7SUFDSixDQUFDO0lBQ0QsbUJBQW1CLENBQUMsVUFBa0I7UUFDcEMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsV0FBVyxFQUFFLE1BQU0sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO0lBQzdELENBQUM7SUFDRCxtQkFBbUI7UUFDakIsT0FBTyxVQUFVLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQztJQUM1RCxDQUFDO0lBQ0Qsb0JBQW9CLENBQUMsV0FBbUI7UUFDdEMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsWUFBWSxFQUFFLE1BQU0sQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDO0lBQy9ELENBQUM7SUFDRCxvQkFBb0I7UUFDbEIsT0FBTyxVQUFVLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQztJQUM3RCxDQUFDO0lBQ0QscUJBQXFCLENBQUMsSUFBWTtRQUNoQyxJQUFJLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQyxhQUFhLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDakQsQ0FBQztJQUNELHFCQUFxQjtRQUNuQixPQUFPLElBQUksQ0FBQyxpQkFBaUIsQ0FBQyxVQUFVLENBQUMsYUFBYSxDQUFDLENBQUM7SUFDMUQsQ0FBQztJQUNELG9CQUFvQixDQUFDLFdBQW1CO1FBQ3RDLElBQUksQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLE9BQU8sRUFBRSxRQUFRLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQztJQUM1RCxDQUFDO0lBQ0Qsb0JBQW9CO1FBQ2xCLE9BQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzVELENBQUM7SUFFRCxzQkFBc0IsQ0FBQyxVQUFrQixFQUFFLFdBQW1CO1FBQzVELElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxnQkFBZ0IsRUFBRSxDQUFDLEVBQUUsRUFBRSxXQUFXLENBQUMsQ0FBQztJQUN2RSxDQUFDO0lBQ0Qsc0JBQXNCLENBQUMsVUFBa0I7UUFDdkMsT0FBTyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxnQkFBZ0IsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBQ3pFLENBQUM7SUFDRCxtQkFBbUIsQ0FDakIsVUFBa0IsRUFDbEIsTUFBYyxFQUNkLFlBQW9CO1FBRXBCLE1BQU0sR0FBRyxHQUFHLElBQUksMEJBQVksRUFBRSxDQUFDO1FBQy9CLEdBQUcsQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7UUFDakMsR0FBRyxDQUFDLGFBQWEsQ0FBQyxZQUFZLENBQUMsQ0FBQztRQUNoQyxJQUFJLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsWUFBWSxFQUFFLENBQUMsRUFBRSxFQUFFLEdBQUcsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDO0lBQ3BFLENBQUM7SUFDRCxtQkFBbUIsQ0FDakIsVUFBa0I7UUFFbEIsTUFBTSxJQUFJLEdBQUcsSUFBSSxDQUFDLGdCQUFnQixDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsWUFBWSxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDekUsSUFBSSxDQUFDLElBQUk7WUFBRSxPQUFPLFNBQVMsQ0FBQztRQUM1QixNQUFNLEdBQUcsR0FBRyxJQUFJLDBCQUFZLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDbkMsT0FBTztZQUNMLE1BQU0sRUFBRSxJQUFBLCtCQUFpQixFQUFDLEdBQUcsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDM0MsWUFBWSxFQUFFLEdBQUcsQ0FBQyxZQUFZLEVBQUU7U0FDakMsQ0FBQztJQUNKLENBQUM7SUFDRCxrQkFBa0IsQ0FBQyxVQUFrQixFQUFFLE1BQWMsRUFBRSxTQUFpQjtRQUN0RSxJQUFJLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsV0FBVyxFQUFFLE1BQU0sRUFBRSxTQUFTLENBQUMsQ0FBQztJQUNuRSxDQUFDO0lBQ0Qsa0JBQWtCLENBQUMsVUFBa0IsRUFBRSxNQUFjO1FBQ25ELE9BQU8sSUFBSSxDQUFDLGdCQUFnQixDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsV0FBVyxFQUFFLE1BQU0sQ0FBQyxDQUFDO0lBQ3ZFLENBQUM7SUFDRCxtQkFBbUIsQ0FBQyxVQUFrQixFQUFFLFdBQW1CO1FBQ3pELElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxZQUFZLEVBQUUsQ0FBQyxFQUFFLEVBQUUsUUFBUSxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7SUFDN0UsQ0FBQztJQUNELG1CQUFtQixDQUFDLFVBQWtCO1FBQ3BDLE1BQU0sTUFBTSxHQUFHLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxVQUFVLEVBQUUsTUFBTSxDQUFDLFlBQVksRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDO1FBQzNFLElBQUksQ0FBQyxNQUFNO1lBQUUsT0FBTyxTQUFTLENBQUM7UUFDOUIsT0FBTyxNQUFNLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ2hDLENBQUM7SUFDRCxvQkFBb0IsQ0FBQyxVQUFrQixFQUFFLFlBQW9CO1FBQzNELElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxhQUFhLEVBQUUsQ0FBQyxFQUFFLEVBQUUsWUFBWSxDQUFDLENBQUM7SUFDckUsQ0FBQztJQUNELG9CQUFvQixDQUFDLFVBQWtCO1FBQ3JDLE9BQU8sSUFBSSxDQUFDLGdCQUFnQixDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsYUFBYSxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDdEUsQ0FBQztJQUNELHFCQUFxQixDQUFDLFVBQWtCLEVBQUUsYUFBcUI7UUFDN0QsSUFBSSxDQUFDLFFBQVEsQ0FBQyxVQUFVLEVBQUUsTUFBTSxDQUFDLGNBQWMsRUFBRSxDQUFDLEVBQUUsRUFBRSxhQUFhLENBQUMsQ0FBQztJQUN2RSxDQUFDO0lBQ0QscUJBQXFCLENBQUMsVUFBa0I7UUFDdEMsT0FBTyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxjQUFjLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUN2RSxDQUFDO0lBQ0QsdUJBQXVCLENBQ3JCLFVBQWtCLEVBQ2xCLE1BQWMsRUFDZCxpQkFBeUIsRUFDekIsSUFBdUI7UUFFdkIsSUFBSSxNQUFNLENBQUMsTUFBTSxJQUFJLEVBQUU7WUFDckIsTUFBTSxJQUFJLEtBQUssQ0FBQyx5QkFBeUIsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDN0QsSUFBSSxDQUFDLFFBQVEsQ0FDWCxVQUFVLEVBQ1YsTUFBTSxDQUFDLGdCQUFnQixFQUN2QixNQUFNLEVBQ04sSUFBSSxDQUFDLHFCQUFxQixDQUFDLGlCQUFpQixFQUFFLElBQUksQ0FBQyxDQUNwRCxDQUFDO0lBQ0osQ0FBQztJQUNELHVCQUF1QixDQUNyQixVQUFrQixFQUNsQixNQUFjO1FBSWQsTUFBTSxHQUFHLEdBQUcsSUFBSSxDQUFDLGdCQUFnQixDQUMvQixVQUFVLEVBQ1YsTUFBTSxDQUFDLGdCQUFnQixFQUN2QixNQUFNLENBQ1AsQ0FBQztRQUNGLElBQUksQ0FBQyxHQUFHO1lBQUUsT0FBTyxTQUFTLENBQUM7UUFDM0IsT0FBTyxJQUFJLENBQUMscUJBQXFCLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDekMsQ0FBQztJQUNELHNCQUFzQixDQUFDLFVBQWtCLEVBQUUsU0FBaUI7UUFDMUQsSUFBSSxDQUFDLFFBQVEsQ0FBQyxVQUFVLEVBQUUsTUFBTSxDQUFDLGVBQWUsRUFBRSxDQUFDLEVBQUUsRUFBRSxTQUFTLENBQUMsQ0FBQztJQUNwRSxDQUFDO0lBQ0Qsc0JBQXNCLENBQUMsVUFBa0I7UUFDdkMsT0FBTyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxlQUFlLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUN4RSxDQUFDO0lBQ0QsMEJBQTBCLENBQUMsVUFBa0IsRUFBRSxhQUFxQjtRQUNsRSxJQUFJLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsbUJBQW1CLEVBQUUsQ0FBQyxFQUFFLEVBQUUsYUFBYSxDQUFDLENBQUM7SUFDNUUsQ0FBQztJQUNELDBCQUEwQixDQUFDLFVBQWtCO1FBQzNDLE9BQU8sSUFBSSxDQUFDLFFBQVEsQ0FBQyxVQUFVLEVBQUUsTUFBTSxDQUFDLG1CQUFtQixFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDcEUsQ0FBQztJQUNELG9CQUFvQixDQUFDLFVBQWtCLEVBQUUsSUFBWTtRQUNuRCxJQUFJLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsYUFBYSxFQUFFLENBQUMsRUFBRSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQzdELENBQUM7SUFDRCxvQkFBb0IsQ0FBQyxVQUFrQjtRQUNyQyxPQUFPLElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxhQUFhLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUM5RCxDQUFDO0lBQ0QsbUJBQW1CLENBQUMsVUFBa0IsRUFBRSxXQUFtQjtRQUN6RCxJQUFJLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsWUFBWSxFQUFFLENBQUMsRUFBRSxFQUFFLFFBQVEsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDO0lBQzdFLENBQUM7SUFDRCxtQkFBbUIsQ0FBQyxVQUFrQjtRQUNwQyxPQUFPLElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxZQUFZLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxZQUFZLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDN0UsQ0FBQztJQUNELGdCQUFnQixDQUFDLFVBQWtCLEVBQUUsUUFBZ0I7UUFDbkQsSUFBSSxDQUFDLFFBQVEsQ0FBQyxVQUFVLEVBQUUsTUFBTSxDQUFDLFFBQVEsRUFBRSxDQUFDLEVBQUUsRUFBRSxRQUFRLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQztJQUN0RSxDQUFDO0lBQ0QsZ0JBQWdCLENBQUMsVUFBa0I7O1FBQ2pDLE9BQU8sQ0FDTCxNQUFBLE1BQUEsSUFBSSxDQUFDLGdCQUFnQixDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsUUFBUSxFQUFFLENBQUMsRUFBRSxDQUFDLDBDQUFFLFlBQVksQ0FDbkUsQ0FBQyxDQUNGLG1DQUFJLFVBQVUsQ0FDaEIsQ0FBQztJQUNKLENBQUM7SUFDRCxpQkFBaUIsQ0FBQyxVQUFrQixFQUFFLEdBQVc7UUFDL0MsSUFBSSxDQUFDLFFBQVEsQ0FBQyxVQUFVLEVBQUUsTUFBTSxDQUFDLFdBQVcsRUFBRSxDQUFDLEVBQUUsRUFBRSxHQUFHLENBQUMsQ0FBQztJQUMxRCxDQUFDO0lBQ0QsaUJBQWlCLENBQUMsVUFBa0I7UUFDbEMsT0FBTyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxXQUFXLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUNwRSxDQUFDO0lBQ0QsMEJBQTBCLENBQ3hCLFVBQWtCLEVBQ2xCLE1BQWMsRUFDZCxNQUF5QixFQUN6QixpQkFBeUIsRUFDekIsSUFBdUI7UUFFdkIsSUFBSSxNQUFNLENBQUMsTUFBTSxJQUFJLEVBQUU7WUFDckIsTUFBTSxJQUFJLEtBQUssQ0FBQyx5QkFBeUIsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDN0QsTUFBTSxHQUFHLEdBQUcsSUFBSSxDQUFDLHdCQUF3QixDQUFDLE1BQU0sRUFBRSxpQkFBaUIsRUFBRSxJQUFJLENBQUMsQ0FBQztRQUMzRSxJQUFJLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsb0JBQW9CLEVBQUUsTUFBTSxFQUFFLEdBQUcsQ0FBQyxDQUFDO0lBQ3RFLENBQUM7SUFDRCwwQkFBMEIsQ0FDeEIsVUFBa0IsRUFDbEIsTUFBYztRQU1kLE1BQU0sR0FBRyxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQyxvQkFBb0IsRUFBRSxNQUFNLENBQUMsQ0FBQztRQUMzRSxPQUFPLElBQUksQ0FBQyx3QkFBd0IsQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUM1QyxDQUFDO0lBQ0QsZ0JBQWdCLENBQUMsVUFBa0IsRUFBRSxPQUFnQjtRQUNuRCxPQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsRUFBRSxPQUFPLENBQUMsQ0FBQztJQUMvRCxDQUFDO0lBRUQscUJBQXFCLENBQUMsV0FBbUIsRUFBRSxZQUFvQjtRQUM3RCxJQUFJLENBQUMsU0FBUyxDQUFDLFdBQVcsRUFBRSxPQUFPLENBQUMsYUFBYSxFQUFFLENBQUMsRUFBRSxFQUFFLFlBQVksQ0FBQyxDQUFDO0lBQ3hFLENBQUM7SUFDRCxxQkFBcUIsQ0FBQyxXQUFtQjtRQUN2QyxPQUFPLElBQUksQ0FBQyxTQUFTLENBQUMsV0FBVyxFQUFFLE9BQU8sQ0FBQyxhQUFhLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUNqRSxDQUFDO0lBQ0Qsd0JBQXdCLENBQ3RCLFdBQW1CLEVBQ25CLE1BQWMsRUFDZCxpQkFBeUIsRUFDekIsSUFBdUI7UUFFdkIsSUFBSSxDQUFDLFNBQVMsQ0FDWixXQUFXLEVBQ1gsT0FBTyxDQUFDLGlCQUFpQixFQUN6QixNQUFNLEVBQ04sSUFBSSxDQUFDLHFCQUFxQixDQUFDLGlCQUFpQixFQUFFLElBQUksQ0FBQyxDQUNwRCxDQUFDO0lBQ0osQ0FBQztJQUNELHdCQUF3QixDQUN0QixXQUFtQixFQUNuQixNQUFjO1FBRWQsTUFBTSxHQUFHLEdBQUcsSUFBSSxDQUFDLFNBQVMsQ0FBQyxXQUFXLEVBQUUsT0FBTyxDQUFDLGlCQUFpQixFQUFFLE1BQU0sQ0FBQyxDQUFDO1FBQzNFLE9BQU8sSUFBSSxDQUFDLHFCQUFxQixDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQ3pDLENBQUM7SUFDRCxlQUFlLENBQUMsV0FBbUIsRUFBRSxNQUFjO1FBQ2pELElBQUksQ0FBQyxTQUFTLENBQUMsV0FBVyxFQUFFLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxFQUFFLEVBQUUsUUFBUSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7SUFDckUsQ0FBQztJQUNELGVBQWUsQ0FBQyxXQUFtQjtRQUNqQyxNQUFNLEdBQUcsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLFdBQVcsRUFBRSxPQUFPLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDN0QsT0FBTyxJQUFBLCtCQUFpQixFQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQ2hDLENBQUM7SUFDRCxlQUFlLENBQUMsV0FBbUIsRUFBRSxZQUFvQjtRQUN2RCxJQUFJLENBQUMsU0FBUyxDQUFDLFdBQVcsRUFBRSxPQUFPLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFLFlBQVksQ0FBQyxDQUFDO0lBQ2pFLENBQUM7SUFDRCxlQUFlLENBQUMsV0FBbUI7UUFDakMsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLFdBQVcsRUFBRSxPQUFPLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDMUQsQ0FBQztJQUNELDJCQUEyQixDQUN6QixXQUFtQixFQUNuQixNQUFjLEVBQ2QsTUFBeUIsRUFDekIsV0FBbUIsRUFDbkIsSUFBdUI7UUFFdkIsTUFBTSxHQUFHLEdBQUcsSUFBSSxDQUFDLHdCQUF3QixDQUFDLE1BQU0sRUFBRSxXQUFXLEVBQUUsSUFBSSxDQUFDLENBQUM7UUFDckUsSUFBSSxDQUFDLFNBQVMsQ0FBQyxXQUFXLEVBQUUsT0FBTyxDQUFDLG9CQUFvQixFQUFFLE1BQU0sRUFBRSxHQUFHLENBQUMsQ0FBQztJQUN6RSxDQUFDO0lBQ0QsMkJBQTJCLENBQ3pCLFdBQW1CLEVBQ25CLE1BQWM7UUFNZCxNQUFNLEdBQUcsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUN4QixXQUFXLEVBQ1gsT0FBTyxDQUFDLG9CQUFvQixFQUM1QixNQUFNLENBQ1AsQ0FBQztRQUNGLE9BQU8sSUFBSSxDQUFDLHdCQUF3QixDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQzVDLENBQUM7SUFFRCxrQkFBa0IsQ0FBQyxVQUFrQixFQUFFLFFBQTJCO1FBQ2hFLE1BQU0sR0FBRyxHQUFHLElBQUksQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLENBQUM7UUFDdkMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7WUFDdkIsSUFBSSxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUMsRUFBRSxRQUFRLENBQUMsRUFBRTtnQkFDL0IsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQzthQUNiO1FBQ0gsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDO0lBRUQsSUFBSSxDQUFDLEVBQVU7UUFDYixJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsRUFBRSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQzNDLElBQUksQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxFQUFFLENBQUMsU0FBUyxDQUFDLENBQUM7UUFDNUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsVUFBVSxFQUFFLEVBQUUsQ0FBQyxVQUFVLENBQUMsQ0FBQztJQUNoRCxDQUFDO0lBQ0QsUUFBUSxDQUNOLElBQTRDLEVBQzVDLEVBQXlCO1FBRXpCLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsS0FBSyxFQUFFLEVBQUU7WUFDeEIsTUFBTSxRQUFRLEdBQUcsSUFBSSxHQUFHLEVBQUUsQ0FBQztZQUMzQixJQUFJLENBQUMsT0FBTyxDQUFDLENBQUMsRUFBRSxRQUFRLENBQUMsQ0FBQztZQUMxQixFQUFFLENBQUMsS0FBSyxDQUFDLEdBQUcsUUFBUSxDQUFDO1FBQ3ZCLENBQUMsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUNELE9BQU8sQ0FBQyxJQUFpQyxFQUFFLEVBQXVCO1FBQ2hFLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUNwRCxDQUFDO0lBQ0QsU0FBUztRQUNQLE1BQU0sR0FBRyxHQUFHLElBQUksMEJBQVksRUFBRSxDQUFDO1FBQy9CLEdBQUcsQ0FBQyxVQUFVLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLElBQUksRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDNUQsWUFBWSxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUM7UUFDbEMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQyxHQUFHLEVBQUUsRUFBRTtZQUM3QixZQUFZLENBQUMsR0FBRyxFQUFFLEdBQUcsQ0FBQyxDQUFDO1FBQ3pCLENBQUMsQ0FBQyxDQUFDO1FBQ0gsSUFBSSxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxHQUFHLEVBQUUsRUFBRTtZQUM5QixZQUFZLENBQUMsR0FBRyxFQUFFLEdBQUcsQ0FBQyxDQUFDO1FBQ3pCLENBQUMsQ0FBQyxDQUFDO1FBQ0gsT0FBTyxHQUFHLENBQUMsTUFBTSxFQUFFLENBQUM7SUFDdEIsQ0FBQztJQUNELFdBQVcsQ0FBQyxJQUFZO1FBQ3RCLE1BQU0sR0FBRyxHQUFHLElBQUksMEJBQVksQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUNuQyxJQUFJLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsZ0JBQWdCLENBQUMsRUFBRTtZQUM5QyxNQUFNLElBQUksS0FBSyxDQUFDLHFCQUFxQixDQUFDLENBQUM7U0FDeEM7UUFDRCxPQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxHQUFHLENBQUM7WUFBQyxDQUFDO1FBRTlDLElBQUksV0FBbUIsQ0FBQztRQUN4QixJQUFJO1lBQ0YsV0FBVyxHQUFHLElBQUksQ0FBQyxvQkFBb0IsRUFBRSxDQUFDO1NBQzNDO1FBQUMsV0FBTTtZQUNOLFdBQVcsR0FBRyxDQUFDLENBQUM7U0FDakI7UUFFRCxJQUFJLFdBQVcsS0FBSyxDQUFDLElBQUksV0FBVyxLQUFLLENBQUM7WUFBRSxNQUFNLElBQUksS0FBSyxDQUFDLDRDQUE0QyxDQUFDLENBQUM7UUFFMUcsSUFBSSxPQUFlLENBQUM7UUFDcEIsSUFBSSxRQUFnQixDQUFDO1FBQ3JCLElBQUksV0FBVyxJQUFJLENBQUMsRUFBRTtZQUNwQix3REFBd0Q7WUFDeEQsTUFBTSxLQUFLLEdBQUcsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsV0FBVyxDQUFDLENBQUM7WUFDckQsTUFBTSxFQUFFLEdBQUcsR0FBRyxDQUFDLFdBQVcsQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDLENBQUM7WUFDN0MsT0FBTyxHQUFHLEVBQUUsQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDO1lBQ3hCLFFBQVEsR0FBRyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQTtTQUMxQjthQUFNO1lBQ0wsd0NBQXdDO1lBQ3hDLE9BQU8sR0FBRyxJQUFJLENBQUMsbUJBQW1CLEVBQUUsQ0FBQztZQUNyQyxRQUFRLEdBQUcsSUFBSSxDQUFDLG9CQUFvQixFQUFFLENBQUM7U0FDeEM7UUFFRCxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsT0FBTyxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQ2hDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxHQUFHLEVBQUUsQ0FBQztZQUM5QixPQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7Z0JBQUMsQ0FBQztTQUNsRDtRQUNELEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxRQUFRLEVBQUUsQ0FBQyxFQUFFLEVBQUU7WUFDakMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsR0FBRyxJQUFJLEdBQUcsRUFBRSxDQUFDO1lBQy9CLE9BQU8sSUFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztnQkFBQyxDQUFDO1NBQ25EO1FBRUQsSUFBSSxDQUFDLGFBQWEsRUFBRSxDQUFDO0lBQ3ZCLENBQUM7SUFDRCxhQUFhOztRQUNYLHlEQUF5RDtRQUN6RCxvREFBb0Q7UUFDcEQsTUFBTSxXQUFXLEdBQUcsTUFBQSxJQUFJLENBQUMsaUJBQWlCLENBQUMsVUFBVSxDQUFDLE9BQU8sQ0FBQywwQ0FBRSxXQUFXLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDL0UsSUFBSSxXQUFXLEtBQUssQ0FBQztZQUFFLE9BQU87YUFDekIsSUFBSSxXQUFXLEtBQUssU0FBUyxFQUFFO1lBQ2xDLE1BQU0sSUFBSSxLQUFLLENBQUMsc0RBQXNELENBQUMsQ0FBQztTQUN6RTtRQUVELHdFQUF3RTtRQUN4RSwyQ0FBMkM7UUFDM0MsTUFBTSxLQUFLLEdBQUcsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsV0FBVyxDQUFDLENBQUM7UUFDckQsTUFBTSxFQUFFLEdBQUcsR0FBRyxDQUFDLFdBQVcsQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDLENBQUM7UUFFN0MsSUFBSSxDQUFDLG9CQUFvQixDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzdCLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxFQUFFLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDcEMsSUFBSSxDQUFDLHlCQUF5QixDQUFDLEVBQUUsQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUM1QyxJQUFJLENBQUMsbUJBQW1CLENBQUMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUN4QyxJQUFJLENBQUMsb0JBQW9CLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUUxQyxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxDQUFDLEdBQUcsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxFQUFFLEVBQUU7WUFDdEMsSUFBSSxDQUFDLG9CQUFvQixDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQzdDLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUM3QyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLENBQUM7U0FDOUM7UUFFRCxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQyxFQUFFLEVBQUU7WUFDdkMsSUFBSSxDQUFDLGVBQWUsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUMxQyxJQUFJLENBQUMsZUFBZSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1NBQzVDO1FBRUQsNERBQTREO1FBQzVELElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxXQUFXLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDLENBQUMsQ0FBQztJQUM5RSxDQUFDO0lBQ0Q7Ozs7Ozs7Ozs7T0FVRztJQUNILGFBQWEsQ0FBQyxPQUFpQjtRQUM3QixTQUFTLGNBQWMsQ0FBQyxLQUFLO1lBQzNCLElBQUksTUFBTSxDQUFDO1lBQ1gsSUFBSTtnQkFDRixHQUFHLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxFQUFFLE1BQU0sRUFBRSxLQUFLLENBQUMsV0FBVyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7Z0JBQ3hELE1BQU0sR0FBRyxJQUFJLENBQUM7YUFDZjtZQUFDLE9BQU8sR0FBRyxFQUFFO2dCQUNaLE1BQU0sR0FBRyxLQUFLLENBQUM7YUFDaEI7WUFDRCxPQUFPLENBQ0wsS0FBSztnQkFDTCxDQUFDLENBQUMsQ0FDQSxLQUFLLENBQUMsY0FBYztvQkFDcEIsS0FBSyxDQUFDLGFBQWE7b0JBQ25CLENBQUMsS0FBSyxDQUFDLGFBQWEsSUFBSSxLQUFLLENBQUMsYUFBYSxDQUFDLE1BQU0sQ0FBQztvQkFDbkQsQ0FBQyxLQUFLLENBQUMsa0JBQWtCLElBQUksS0FBSyxDQUFDLGtCQUFrQixDQUFDLE1BQU0sQ0FBQztvQkFDN0QsTUFBTSxDQUNQLENBQ0YsQ0FBQztRQUNKLENBQUM7UUFDRCxJQUFJLENBQUMsb0JBQW9CLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDN0IsSUFBSSxDQUFDLGtCQUFrQixDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUN6QyxJQUFJLENBQUMsbUJBQW1CLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDckQsSUFBSSxDQUFDLG9CQUFvQixDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDcEQsSUFBSSxPQUFPLENBQUMsUUFBUSxLQUFLLFNBQVM7WUFDaEMsSUFBSSxDQUFDLHlCQUF5QixDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUNuRCxPQUFPLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsQ0FBQyxLQUFLLEVBQUUsS0FBSyxFQUFFLEVBQUU7WUFDM0MsSUFBSSxjQUFjLENBQUMsS0FBSyxDQUFDO2dCQUN2QixNQUFNLElBQUksS0FBSyxDQUFDLDhCQUE4QixDQUFDLENBQUM7WUFDbEQsSUFBSSxDQUFDLG9CQUFvQixDQUFDLEtBQUssRUFBRSxPQUFPLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQy9ELElBQUksT0FBTyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQyxRQUFRLEtBQUssU0FBUztnQkFDaEQsSUFBSSxDQUFDLGdCQUFnQixDQUFDLEtBQUssRUFBRSxPQUFPLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDLFFBQVEsQ0FBQyxDQUFDO1lBQ2pFLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUMvRCxJQUFJLEtBQUssQ0FBQyxXQUFXLEtBQUssU0FBUztnQkFDakMsSUFBSSxDQUFDLG1CQUFtQixDQUFDLEtBQUssRUFBRSxLQUFLLENBQUMsV0FBVyxDQUFDLENBQUM7WUFDckQsSUFBSSxLQUFLLENBQUMsY0FBYztnQkFDdEIsSUFBSSxDQUFDLHNCQUFzQixDQUFDLEtBQUssRUFBRSxLQUFLLENBQUMsY0FBYyxDQUFDLENBQUM7WUFDM0QsSUFBSSxLQUFLLENBQUMsV0FBVyxFQUFFO2dCQUNyQixJQUFJLENBQUMsbUJBQW1CLENBQ3RCLEtBQUssRUFDTCxLQUFLLENBQUMsV0FBVyxDQUFDLEtBQUssRUFDdkIsS0FBSyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQ3pCLENBQUM7YUFDSDtZQUNELElBQUksS0FBSyxDQUFDLGFBQWE7Z0JBQ3JCLElBQUksQ0FBQyxxQkFBcUIsQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLGFBQWEsQ0FBQyxDQUFDO1lBQ3pELElBQUksS0FBSyxDQUFDLFlBQVk7Z0JBQ3BCLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLFlBQVksQ0FBQyxDQUFDO1lBQ3ZELE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLGVBQWUsQ0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLEVBQUU7Z0JBQzlELElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUM7b0JBQ2hDLE1BQU0sSUFBSSxLQUFLLENBQUMsZ0NBQWdDLENBQUMsQ0FBQztnQkFDcEQsTUFBTSxTQUFTLEdBQUcsVUFBVSxDQUFDLElBQUk7cUJBQzlCLE9BQU8sQ0FBQyxNQUFNLEVBQUUsRUFBRSxDQUFDO3FCQUNuQixLQUFLLENBQUMsR0FBRyxDQUFDO3FCQUNWLEdBQUcsQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUNYLEtBQUssQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsR0FBRyxVQUFVLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FDcEUsQ0FBQztnQkFDSixJQUFJLENBQUMsdUJBQXVCLENBQzFCLEtBQUssRUFDTCxVQUFVLENBQUMsTUFBTSxFQUNqQixVQUFVLENBQUMsaUJBQWlCLEVBQzVCLFNBQVMsQ0FDVixDQUFDO1lBQ0osQ0FBQyxDQUFDLENBQUM7UUFDTCxDQUFDLENBQUMsQ0FBQztRQUNILE9BQU8sQ0FBQyxTQUFTLENBQUMsT0FBTyxDQUFDLENBQUMsTUFBTSxFQUFFLEtBQUssRUFBRSxFQUFFO1lBQzFDLElBQUksQ0FBQyxlQUFlLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUMxQyxJQUFJLENBQUMsZUFBZSxDQUFDLEtBQUssRUFBRSxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDN0MsQ0FBQyxDQUFDLENBQUM7UUFDSCxPQUFPLElBQUksQ0FBQztJQUNkLENBQUM7SUFDTyxXQUFXLENBQUMsR0FBd0IsRUFBRSxHQUFpQjtRQUM3RCxNQUFNLE1BQU0sR0FBRyxJQUFBLCtCQUFzQixFQUFDLEdBQUcsQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDO1FBQ3hELElBQUksTUFBTSxJQUFJLENBQUMsRUFBRTtZQUNmLE9BQU8sS0FBSyxDQUFDO1NBQ2Q7UUFDRCxNQUFNLE9BQU8sR0FBRyxHQUFHLENBQUMsU0FBUyxFQUFFLENBQUM7UUFDaEMsTUFBTSxPQUFPLEdBQUcsR0FBRyxDQUFDLFNBQVMsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDLENBQUM7UUFDMUMsTUFBTSxLQUFLLEdBQUcsR0FBRyxDQUFDLFlBQVksRUFBRSxDQUFDO1FBQ2pDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRSxLQUFLLENBQUMsQ0FBQztRQUVsQyxPQUFPLElBQUksQ0FBQztJQUNkLENBQUM7SUFDTyxXQUFXLENBQ2pCLEdBQWdDLEVBQ2hDLE9BQWdCO1FBRWhCLE1BQU0sTUFBTSxHQUFhLEVBQUUsQ0FBQztRQUM1QixHQUFHLENBQUMsT0FBTyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQ3BCLElBQUksSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxFQUFFO2dCQUNoQyxNQUFNLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsRUFBRSxLQUFLLENBQUMsQ0FBQyxDQUFDO2FBQ2pEO1FBQ0gsQ0FBQyxDQUFDLENBQUM7UUFDSCxPQUFPLE1BQU0sQ0FBQztJQUNoQixDQUFDO0lBQ08sU0FBUyxDQUFDLE1BQWMsRUFBRSxRQUE0QjtRQUM1RCxNQUFNLE9BQU8sR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEtBQUssQ0FBQyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUN4RSxPQUFPLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQztJQUM1QyxDQUFDO0lBQ08sU0FBUyxDQUFDLE9BQWdCLEVBQUUsS0FBYTtRQUMvQyxNQUFNLEdBQUcsR0FBRyxJQUFJLEdBQUcsQ0FBQyxPQUFPLEVBQUUsTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO1FBQzlDLElBQUksQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxRQUFRLEVBQUUsRUFBRSxLQUFLLENBQUMsQ0FBQztJQUM1QyxDQUFDO0lBQ08sU0FBUyxDQUFDLE9BQWdCO1FBQ2hDLE9BQU8sR0FBRyxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsT0FBTyxFQUFFLENBQUMsRUFBRSxFQUFFLEtBQUssQ0FBRSxDQUFDO0lBQ25ELENBQUM7SUFDTyxpQkFBaUIsQ0FBQyxPQUFnQjtRQUN4QyxPQUFPLEdBQUcsQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLE9BQU8sRUFBRSxDQUFDLEVBQUUsRUFBRSxJQUFJLENBQUMsQ0FBQztJQUNqRCxDQUFDO0lBQ08sUUFBUSxDQUNkLEtBQWEsRUFDYixPQUFnQixFQUNoQixPQUFlLEVBQ2YsS0FBYTtRQUViLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsU0FBUyxDQUFDLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRSxLQUFLLENBQUMsQ0FBQztJQUNuRSxDQUFDO0lBQ08sUUFBUSxDQUFDLEtBQWEsRUFBRSxPQUFnQixFQUFFLE9BQWU7UUFDL0QsT0FBTyxHQUFHLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsRUFBRSxPQUFPLEVBQUUsT0FBTyxFQUFFLEtBQUssQ0FBRSxDQUFDO0lBQzlELENBQUM7SUFDTyxnQkFBZ0IsQ0FDdEIsS0FBYSxFQUNiLE9BQWdCLEVBQ2hCLE9BQWU7UUFFZixPQUFPLEdBQUcsQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDNUQsQ0FBQztJQUNPLFNBQVMsQ0FDZixLQUFhLEVBQ2IsT0FBZ0IsRUFDaEIsT0FBZSxFQUNmLEtBQWE7UUFFYixHQUFHLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLFVBQVUsQ0FBQyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsS0FBSyxDQUFDLENBQUM7SUFDcEUsQ0FBQztJQUNPLFNBQVMsQ0FBQyxLQUFhLEVBQUUsT0FBZ0IsRUFBRSxPQUFlO1FBQ2hFLE9BQU8sR0FBRyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRSxLQUFLLENBQUUsQ0FBQztJQUMvRCxDQUFDO0lBQ08sTUFBTSxDQUNaLEtBQWEsRUFDYixJQUEyQjtRQUUzQixJQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsRUFBRTtZQUNmLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO1NBQ3BCO1FBQ0QsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxJQUFJLEdBQUcsRUFBRSxDQUFDLENBQUM7SUFDbkMsQ0FBQztJQUNPLHFCQUFxQixDQUMzQixpQkFBeUIsRUFDekIsSUFBdUI7UUFFdkIsTUFBTSxHQUFHLEdBQUcsSUFBSSwwQkFBWSxFQUFFLENBQUM7UUFDL0IsSUFBSSxDQUFDLG9CQUFvQixDQUFDLEdBQUcsRUFBRSxpQkFBaUIsRUFBRSxJQUFJLENBQUMsQ0FBQztRQUN4RCxPQUFPLEdBQUcsQ0FBQyxNQUFNLEVBQUUsQ0FBQztJQUN0QixDQUFDO0lBQ08scUJBQXFCLENBQUMsTUFBYztRQUkxQyxNQUFNLEdBQUcsR0FBRyxJQUFJLDBCQUFZLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDckMsT0FBTyxJQUFJLENBQUMsbUJBQW1CLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDdkMsQ0FBQztJQUNPLG9CQUFvQixDQUMxQixHQUFpQixFQUNqQixpQkFBeUIsRUFDekIsSUFBdUI7UUFFdkIsR0FBRyxDQUFDLFVBQVUsQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO1FBQ2xDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxPQUFPLEVBQUUsRUFBRTtZQUN2QixHQUFHLENBQUMsV0FBVyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQzNCLENBQUMsQ0FBQyxDQUFDO0lBQ0wsQ0FBQztJQUNPLG1CQUFtQixDQUFDLEdBQWlCO1FBSTNDLE1BQU0saUJBQWlCLEdBQUcsR0FBRyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUMzQyxNQUFNLElBQUksR0FBYSxFQUFFLENBQUM7UUFDMUIsT0FBTyxHQUFHLENBQUMsTUFBTSxHQUFHLEdBQUcsQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFO1lBQ3JDLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUM7U0FDN0I7UUFDRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsSUFBSSxFQUFFLENBQUM7SUFDckMsQ0FBQztJQUNPLHdCQUF3QixDQUM5QixNQUF5QixFQUN6QixpQkFBeUIsRUFDekIsSUFBdUI7UUFFdkIsTUFBTSxHQUFHLEdBQUcsSUFBSSwwQkFBWSxFQUFFLENBQUM7UUFDL0IsR0FBRyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDL0IsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFO1lBQ25CLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDcEIsQ0FBQyxDQUFDLENBQUM7UUFDSCxJQUFJLENBQUMsb0JBQW9CLENBQUMsR0FBRyxFQUFFLGlCQUFpQixFQUFFLElBQUksQ0FBQyxDQUFDO1FBQ3hELE9BQU8sR0FBRyxDQUFDLE1BQU0sRUFBRSxDQUFDO0lBQ3RCLENBQUM7SUFDTyx3QkFBd0IsQ0FBQyxNQUFjO1FBSzdDLE1BQU0sR0FBRyxHQUFHLElBQUksMEJBQVksQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUNyQyxNQUFNLFNBQVMsR0FBRyxJQUFBLCtCQUFzQixFQUFDLEdBQUcsQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDO1FBQzNELE1BQU0sTUFBTSxHQUFhLEVBQUUsQ0FBQztRQUM1QixLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsU0FBUyxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQ2xDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO1NBQ2hDO1FBQ0QsTUFBTSxLQUFLLEdBQUcsSUFBSSxDQUFDLG1CQUFtQixDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQzVDLHVCQUFTLE1BQU0sSUFBSyxLQUFLLEVBQUc7SUFDOUIsQ0FBQztDQUNGO0FBamxCRCx3QkFpbEJDO0FBQ0QsU0FBUyxHQUFHLENBQ1YsR0FBZ0MsRUFDaEMsT0FBZ0IsRUFDaEIsT0FBZSxFQUNmLGVBQXdCO0lBRXhCLElBQUksQ0FBQyxHQUFHO1FBQUUsTUFBTSxLQUFLLENBQUMsYUFBYSxDQUFDLENBQUM7SUFDckMsTUFBTSxHQUFHLEdBQUcsSUFBSSxHQUFHLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQ3RDLE1BQU0sS0FBSyxHQUFHLEdBQUcsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUM7SUFDdEMsSUFBSSxDQUFDLEtBQUssRUFBRTtRQUNWLElBQUksZUFBZSxFQUFFO1lBQ25CLE9BQU8sU0FBUyxDQUFDO1NBQ2xCO1FBQ0QsTUFBTSxJQUFJLFdBQVcsQ0FBQyxHQUFHLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQztLQUN2QztJQUNELDhEQUE4RDtJQUM5RCxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDNUIsQ0FBQztBQUdELE1BQU0sR0FBRztJQUdQLFlBQVksT0FBZ0IsRUFBRSxPQUFlO1FBQzNDLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDO1FBQ3ZCLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDO0lBQ3pCLENBQUM7SUFDRCxRQUFRO1FBQ04sTUFBTSxHQUFHLEdBQUcsSUFBSSwwQkFBWSxFQUFFLENBQUM7UUFDL0IsSUFBSSxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUNuQixPQUFPLEdBQUcsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDdEMsQ0FBQztJQUNELFNBQVMsQ0FBQyxHQUFpQjtRQUN6QixHQUFHLENBQUMsV0FBVyxDQUFDLENBQUMsR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQ3pDLElBQUksQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDckIsQ0FBQztJQUNPLFFBQVEsQ0FBQyxHQUFpQjtRQUNoQyxHQUFHLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUM3QixHQUFHLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUMvQixDQUFDO0NBQ0Y7QUFDRCxNQUFNLE9BQU87SUFHWCxZQUFZLEdBQVEsRUFBRSxLQUFhO1FBQ2pDLElBQUksQ0FBQyxHQUFHLEdBQUcsR0FBRyxDQUFDO1FBQ2YsSUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7SUFDckIsQ0FBQztJQUNELFNBQVMsQ0FBQyxHQUFpQjtRQUN6QixJQUFJLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUN4QixHQUFHLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUNoQyxDQUFDO0NBQ0Y7QUFDRCxTQUFTLFNBQVMsQ0FBQyxHQUFXO0lBQzVCLE9BQU8sSUFBSSxHQUFHLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDakQsQ0FBQztBQUNELFNBQVMsWUFBWSxDQUFDLEdBQWlCLEVBQUUsR0FBZ0M7SUFDdkUsNkNBQTZDO0lBQzdDLEtBQUssSUFBSSxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsSUFBSSxDQUFDLEdBQUcsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxFQUFFLENBQUMsYUFBYSxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQUU7UUFDNUUsTUFBTSxPQUFPLEdBQUcsSUFBSSxPQUFPLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFDLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFDdkUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsQ0FBQztLQUN4QjtJQUNELEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDcEIsQ0FBQztBQUVELFNBQVMsQ0FBQztJQUNSLE9BQU8sTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUN6QixDQUFDO0FBQ0QsU0FBUyxHQUFHLENBQ1YsR0FBd0IsRUFDeEIsT0FBZ0IsRUFDaEIsT0FBZSxFQUNmLEtBQWE7SUFFYixNQUFNLEdBQUcsR0FBRyxJQUFJLEdBQUcsQ0FBQyxPQUFPLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDdEMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsUUFBUSxFQUFFLEVBQUUsS0FBSyxDQUFDLENBQUM7QUFDakMsQ0FBQztBQUNELFNBQVMsUUFBUSxDQUFDLENBQVM7SUFDekIsTUFBTSxHQUFHLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUM1QixHQUFHLENBQUMsYUFBYSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztJQUN4QixPQUFPLEdBQUcsQ0FBQztBQUNiLENBQUM7QUFDRCxTQUFTLFFBQVEsQ0FBQyxDQUFTO0lBQ3pCLE9BQU8sSUFBQSw2QkFBZSxFQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzVCLENBQUM7QUFDRCxTQUFTLE1BQU0sQ0FBQyxDQUFTO0lBQ3ZCLE1BQU0sR0FBRyxHQUFHLElBQUksMEJBQVksRUFBRSxDQUFDO0lBQy9CLEdBQUcsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDbkIsT0FBTyxHQUFHLENBQUMsTUFBTSxFQUFFLENBQUM7QUFDdEIsQ0FBQztBQUNELFNBQVMsVUFBVSxDQUFDLEdBQVc7SUFDN0IsT0FBTyxJQUFBLCtCQUFzQixFQUFDLElBQUksMEJBQVksQ0FBQyxHQUFHLENBQUMsQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDO0FBQ3BFLENBQUMifQ==\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createVarint = exports.parseVarint = exports.sanitizeBigintToNumber = void 0;\nfunction bigintToSmallEndian(value, length, buffer, offset) {\n    for (let i = 0; i < length; i++) {\n        if (buffer[i + offset] == undefined) {\n            throw Error('Buffer too small');\n        }\n        buffer[i + offset] = Number(value % BigInt(256));\n        value = value >> BigInt(8);\n    }\n}\nfunction smallEndianToBigint(buffer, offset, length) {\n    let result = BigInt(0);\n    for (let i = 0; i < length; i++) {\n        if (buffer[i + offset] == undefined) {\n            throw Error('Buffer too small');\n        }\n        result += BigInt(buffer[i + offset]) << BigInt(i * 8);\n    }\n    return result;\n}\n/**\n * Converts a `bigint` to a `number` if it non-negative and at most MAX_SAFE_INTEGER; throws `RangeError` otherwise.\n * Used when converting a Bitcoin-style varint to a `number`, since varints could be larger than what the `Number`\n * class can represent without loss of precision.\n *\n * @param n the number to convert\n * @returns `n` as a `number`\n */\nfunction sanitizeBigintToNumber(n) {\n    if (n < 0)\n        throw RangeError('Negative bigint is not a valid varint');\n    if (n > Number.MAX_SAFE_INTEGER)\n        throw RangeError('Too large for a Number');\n    return Number(n);\n}\nexports.sanitizeBigintToNumber = sanitizeBigintToNumber;\nfunction getVarintSize(value) {\n    if (typeof value == 'number') {\n        value = sanitizeBigintToNumber(value);\n    }\n    if (value < BigInt(0)) {\n        throw new RangeError('Negative numbers are not supported');\n    }\n    if (value >= BigInt(1) << BigInt(64)) {\n        throw new RangeError('Too large for a Bitcoin-style varint');\n    }\n    if (value < BigInt(0xfd))\n        return 1;\n    else if (value <= BigInt(0xffff))\n        return 3;\n    else if (value <= BigInt(0xffffffff))\n        return 5;\n    else\n        return 9;\n}\n/**\n * Parses a Bitcoin-style variable length integer from a buffer, starting at the given `offset`. Returns a pair\n * containing the parsed `BigInt`, and its length in bytes from the buffer.\n *\n * @param data the `Buffer` from which the variable-length integer is read\n * @param offset a non-negative offset to read from\n * @returns a pair where the first element is the parsed BigInt, and the second element is the length in bytes parsed\n * from the buffer.\n *\n * @throws `RangeError` if offset is negative.\n * @throws `Error` if the buffer's end is reached withut parsing being completed.\n */\nfunction parseVarint(data, offset) {\n    if (offset < 0) {\n        throw RangeError(\"Negative offset is invalid\");\n    }\n    if (data[offset] == undefined) {\n        throw Error('Buffer too small');\n    }\n    if (data[offset] < 0xfd) {\n        return [BigInt(data[offset]), 1];\n    }\n    else {\n        let size;\n        if (data[offset] === 0xfd)\n            size = 2;\n        else if (data[offset] === 0xfe)\n            size = 4;\n        else\n            size = 8;\n        return [smallEndianToBigint(data, offset + 1, size), size + 1];\n    }\n}\nexports.parseVarint = parseVarint;\nfunction createVarint(value) {\n    if (typeof value == 'number') {\n        value = sanitizeBigintToNumber(value);\n    }\n    const size = getVarintSize(value);\n    value = BigInt(value);\n    const buffer = Buffer.alloc(size);\n    if (size == 1) {\n        buffer[0] = Number(value);\n    }\n    else {\n        if (size == 3)\n            buffer[0] = 0xfd;\n        else if (size === 5)\n            buffer[0] = 0xfe;\n        else\n            buffer[0] = 0xff;\n        bigintToSmallEndian(value, size - 1, buffer, 1);\n    }\n    return buffer;\n}\nexports.createVarint = createVarint;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFyaW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi92YXJpbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsU0FBUyxtQkFBbUIsQ0FDMUIsS0FBYSxFQUNiLE1BQWMsRUFDZCxNQUFjLEVBQ2QsTUFBYztJQUVkLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxNQUFNLEVBQUUsQ0FBQyxFQUFFLEVBQUU7UUFDL0IsSUFBSSxNQUFNLENBQUMsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxJQUFJLFNBQVMsRUFBRTtZQUNuQyxNQUFNLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1NBQ2pDO1FBQ0QsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsR0FBRyxNQUFNLENBQUMsS0FBSyxHQUFHLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO1FBQ2pELEtBQUssR0FBRyxLQUFLLElBQUksTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO0tBQzVCO0FBQ0gsQ0FBQztBQUVELFNBQVMsbUJBQW1CLENBQzFCLE1BQWMsRUFDZCxNQUFjLEVBQ2QsTUFBYztJQUVkLElBQUksTUFBTSxHQUFHLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUN2QixLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQy9CLElBQUksTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsSUFBSSxTQUFTLEVBQUU7WUFDbkMsTUFBTSxLQUFLLENBQUMsa0JBQWtCLENBQUMsQ0FBQztTQUNqQztRQUNELE1BQU0sSUFBSSxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxNQUFNLENBQUMsQ0FBQyxJQUFJLE1BQU0sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7S0FDdkQ7SUFDRCxPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDO0FBRUQ7Ozs7Ozs7R0FPRztBQUNGLFNBQWdCLHNCQUFzQixDQUFDLENBQWtCO0lBQ3hELElBQUksQ0FBQyxHQUFHLENBQUM7UUFBRSxNQUFNLFVBQVUsQ0FBQyx1Q0FBdUMsQ0FBQyxDQUFDO0lBQ3JFLElBQUksQ0FBQyxHQUFHLE1BQU0sQ0FBQyxnQkFBZ0I7UUFBRSxNQUFNLFVBQVUsQ0FBQyx3QkFBd0IsQ0FBQyxDQUFDO0lBRTVFLE9BQU8sTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25CLENBQUM7QUFMQSx3REFLQTtBQUVELFNBQVMsYUFBYSxDQUFDLEtBQXNCO0lBQzNDLElBQUksT0FBTyxLQUFLLElBQUksUUFBUSxFQUFFO1FBQzVCLEtBQUssR0FBRyxzQkFBc0IsQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUN2QztJQUVELElBQUksS0FBSyxHQUFHLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRTtRQUNyQixNQUFNLElBQUksVUFBVSxDQUFDLG9DQUFvQyxDQUFDLENBQUM7S0FDNUQ7SUFFRCxJQUFJLEtBQUssSUFBSSxNQUFNLENBQUMsQ0FBQyxDQUFDLElBQUksTUFBTSxDQUFDLEVBQUUsQ0FBQyxFQUFFO1FBQ3BDLE1BQU0sSUFBSSxVQUFVLENBQUMsc0NBQXNDLENBQUMsQ0FBQztLQUM5RDtJQUVELElBQUksS0FBSyxHQUFHLE1BQU0sQ0FBQyxJQUFJLENBQUM7UUFBRSxPQUFPLENBQUMsQ0FBQztTQUM5QixJQUFJLEtBQUssSUFBSSxNQUFNLENBQUMsTUFBTSxDQUFDO1FBQUUsT0FBTyxDQUFDLENBQUM7U0FDdEMsSUFBSSxLQUFLLElBQUksTUFBTSxDQUFDLFVBQVUsQ0FBQztRQUFFLE9BQU8sQ0FBQyxDQUFDOztRQUMxQyxPQUFPLENBQUMsQ0FBQztBQUNoQixDQUFDO0FBRUQ7Ozs7Ozs7Ozs7O0dBV0c7QUFDSCxTQUFnQixXQUFXLENBQ3pCLElBQVksRUFDWixNQUFjO0lBRWQsSUFBSSxNQUFNLEdBQUcsQ0FBQyxFQUFFO1FBQ2QsTUFBTSxVQUFVLENBQUMsNEJBQTRCLENBQUMsQ0FBQztLQUNoRDtJQUNELElBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLFNBQVMsRUFBRTtRQUM3QixNQUFNLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0tBQ2pDO0lBRUQsSUFBSSxJQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsSUFBSSxFQUFFO1FBQ3ZCLE9BQU8sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7S0FDbEM7U0FBTTtRQUNMLElBQUksSUFBWSxDQUFDO1FBQ2pCLElBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLElBQUk7WUFBRSxJQUFJLEdBQUcsQ0FBQyxDQUFDO2FBQy9CLElBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLElBQUk7WUFBRSxJQUFJLEdBQUcsQ0FBQyxDQUFDOztZQUNwQyxJQUFJLEdBQUcsQ0FBQyxDQUFDO1FBRWQsT0FBTyxDQUFDLG1CQUFtQixDQUFDLElBQUksRUFBRSxNQUFNLEdBQUcsQ0FBQyxFQUFFLElBQUksQ0FBQyxFQUFFLElBQUksR0FBRyxDQUFDLENBQUMsQ0FBQztLQUNoRTtBQUNILENBQUM7QUFyQkQsa0NBcUJDO0FBRUQsU0FBZ0IsWUFBWSxDQUFDLEtBQXNCO0lBQ2pELElBQUksT0FBTyxLQUFLLElBQUksUUFBUSxFQUFFO1FBQzVCLEtBQUssR0FBRyxzQkFBc0IsQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUN2QztJQUVELE1BQU0sSUFBSSxHQUFHLGFBQWEsQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUVsQyxLQUFLLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBRXRCLE1BQU0sTUFBTSxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDbEMsSUFBSSxJQUFJLElBQUksQ0FBQyxFQUFFO1FBQ2IsTUFBTSxDQUFDLENBQUMsQ0FBQyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUMzQjtTQUFNO1FBQ0wsSUFBSSxJQUFJLElBQUksQ0FBQztZQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsR0FBRyxJQUFJLENBQUM7YUFDM0IsSUFBSSxJQUFJLEtBQUssQ0FBQztZQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsR0FBRyxJQUFJLENBQUM7O1lBQ2pDLE1BQU0sQ0FBQyxDQUFDLENBQUMsR0FBRyxJQUFJLENBQUM7UUFFdEIsbUJBQW1CLENBQUMsS0FBSyxFQUFFLElBQUksR0FBRyxDQUFDLEVBQUUsTUFBTSxFQUFFLENBQUMsQ0FBQyxDQUFDO0tBQ2pEO0lBQ0QsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQztBQXBCRCxvQ0FvQkMifQ=={\n  \"name\": \"ledger-bitcoin\",\n  \"version\": \"0.2.3\",\n  \"description\": \"Ledger Hardware Wallet Bitcoin Application Client\",\n  \"main\": \"build/main/index.js\",\n  \"typings\": \"build/main/index.d.ts\",\n  \"repository\": \"https://github.com/LedgerHQ/app-bitcoin-new\",\n  \"license\": \"Apache-2.0\",\n  \"keywords\": [\n    \"Ledger\",\n    \"LedgerWallet\",\n    \"btc\",\n    \"Bitcoin\",\n    \"NanoS\",\n    \"NanoX\",\n    \"Hardware Wallet\"\n  ],\n  \"scripts\": {\n    \"build\": \"tsc -p tsconfig.json\",\n    \"fix\": \"run-s fix:*\",\n    \"fix:prettier\": \"prettier \\\"src/**/*.ts\\\" --write\",\n    \"fix:lint\": \"eslint src --ext .ts --fix\",\n    \"test\": \"jest --detectOpenHandles --verbose\",\n    \"doc\": \"run-s doc:html && open-cli build/docs/index.html\",\n    \"doc:html\": \"typedoc src/ --exclude **/*.test.ts --target ES6 --mode file --out build/docs\",\n    \"doc:json\": \"typedoc src/ --exclude **/*.test.ts --target ES6 --mode file --json build/docs/typedoc.json\"\n  },\n  \"engines\": {\n    \"node\": \">=14\"\n  },\n  \"dependencies\": {\n    \"@bitcoinerlab/descriptors\": \"^1.0.2\",\n    \"@bitcoinerlab/secp256k1\": \"^1.0.5\",\n    \"@ledgerhq/hw-transport\": \"^6.20.0\",\n    \"bip32-path\": \"^0.4.2\",\n    \"bitcoinjs-lib\": \"^6.1.3\"\n  },\n  \"devDependencies\": {\n    \"@ledgerhq/hw-transport-node-speculos-http\": \"^6.24.1\",\n    \"@ledgerhq/logs\": \"^6.10.0\",\n    \"@types/jest\": \"^27.4.0\",\n    \"@types/node\": \"^17.0.10\",\n    \"@typescript-eslint/eslint-plugin\": \"^4.0.1\",\n    \"@typescript-eslint/parser\": \"^4.0.1\",\n    \"codecov\": \"^3.5.0\",\n    \"cspell\": \"^4.1.0\",\n    \"eslint\": \"^7.8.0\",\n    \"eslint-config-prettier\": \"^6.11.0\",\n    \"eslint-plugin-eslint-comments\": \"^3.2.0\",\n    \"eslint-plugin-functional\": \"^3.0.2\",\n    \"eslint-plugin-import\": \"^2.22.0\",\n    \"eslint-plugin-jest\": \"^26.1.1\",\n    \"jest\": \"^27.5.1\",\n    \"npm-run-all\": \"^4.1.5\",\n    \"open-cli\": \"^6.0.1\",\n    \"prettier\": \"^2.1.1\",\n    \"standard-version\": \"^9.0.0\",\n    \"ts-jest\": \"^27.1.3\",\n    \"ts-node\": \"^9.0.0\",\n    \"typedoc\": \"^0.19.0\",\n    \"typescript\": \"^4.5.5\"\n  },\n  \"files\": [\n    \"build/main\",\n    \"!**/*.spec.*\",\n    \"!**/*.test.*\",\n    \"!**/*.json\",\n    \"!**/__tests__/*\",\n    \"CHANGELOG.md\",\n    \"README.md\"\n  ],\n  \"prettier\": {\n    \"singleQuote\": true\n  }\n}\n/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n    nativeCreate = getNative(Object, 'create');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\nmodule.exports = memoize;\n{\n  \"name\": \"lodash.memoize\",\n  \"version\": \"4.1.2\",\n  \"description\": \"The lodash method `_.memoize` exported as a module.\",\n  \"homepage\": \"https://lodash.com/\",\n  \"icon\": \"https://lodash.com/icon.svg\",\n  \"license\": \"MIT\",\n  \"keywords\": \"lodash-modularized, memoize\",\n  \"author\": \"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)\",\n  \"contributors\": [\n    \"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)\",\n    \"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)\",\n    \"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)\"\n  ],\n  \"repository\": \"lodash/lodash\",\n  \"scripts\": { \"test\": \"echo \\\"See https://travis-ci.org/lodash/lodash-cli for testing details.\\\"\" }\n}\n/**\n * @module LRUCache\n */\nconst defaultPerf = (typeof performance === 'object' &&\n    performance &&\n    typeof performance.now === 'function') ?\n    performance\n    : Date;\nconst warned = new Set();\n/* c8 ignore start */\nconst PROCESS = (typeof process === 'object' && !!process ?\n    process\n    : {});\n/* c8 ignore start */\nconst emitWarning = (msg, type, code, fn) => {\n    typeof PROCESS.emitWarning === 'function' ?\n        PROCESS.emitWarning(msg, type, code, fn)\n        : console.error(`[${code}] ${type}: ${msg}`);\n};\nlet AC = globalThis.AbortController;\nlet AS = globalThis.AbortSignal;\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n    //@ts-ignore\n    AS = class AbortSignal {\n        onabort;\n        _onabort = [];\n        reason;\n        aborted = false;\n        addEventListener(_, fn) {\n            this._onabort.push(fn);\n        }\n    };\n    //@ts-ignore\n    AC = class AbortController {\n        constructor() {\n            warnACPolyfill();\n        }\n        signal = new AS();\n        abort(reason) {\n            if (this.signal.aborted)\n                return;\n            //@ts-ignore\n            this.signal.reason = reason;\n            //@ts-ignore\n            this.signal.aborted = true;\n            //@ts-ignore\n            for (const fn of this.signal._onabort) {\n                fn(reason);\n            }\n            this.signal.onabort?.(reason);\n        }\n    };\n    let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';\n    const warnACPolyfill = () => {\n        if (!printACPolyfillWarning)\n            return;\n        printACPolyfillWarning = false;\n        emitWarning('AbortController is not defined. If using lru-cache in ' +\n            'node 14, load an AbortController polyfill from the ' +\n            '`node-abort-controller` package. A minimal polyfill is ' +\n            'provided for use by LRUCache.fetch(), but it should not be ' +\n            'relied upon in other contexts (eg, passing it to other APIs that ' +\n            'use AbortController/AbortSignal might have undesirable effects). ' +\n            'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);\n    };\n}\n/* c8 ignore stop */\nconst shouldWarn = (code) => !warned.has(code);\nconst TYPE = Symbol('type');\nconst isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values.  Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max) => !isPosInt(max) ? null\n    : max <= Math.pow(2, 8) ? Uint8Array\n        : max <= Math.pow(2, 16) ? Uint16Array\n            : max <= Math.pow(2, 32) ? Uint32Array\n                : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n                    : null;\n/* c8 ignore stop */\nclass ZeroArray extends Array {\n    constructor(size) {\n        super(size);\n        this.fill(0);\n    }\n}\nclass Stack {\n    heap;\n    length;\n    // private constructor\n    static #constructing = false;\n    static create(max) {\n        const HeapCls = getUintArray(max);\n        if (!HeapCls)\n            return [];\n        Stack.#constructing = true;\n        const s = new Stack(max, HeapCls);\n        Stack.#constructing = false;\n        return s;\n    }\n    constructor(max, HeapCls) {\n        /* c8 ignore start */\n        if (!Stack.#constructing) {\n            throw new TypeError('instantiate Stack using Stack.create(n)');\n        }\n        /* c8 ignore stop */\n        this.heap = new HeapCls(max);\n        this.length = 0;\n    }\n    push(n) {\n        this.heap[this.length++] = n;\n    }\n    pop() {\n        return this.heap[--this.length];\n    }\n}\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n    // options that cannot be changed without disaster\n    #max;\n    #maxSize;\n    #dispose;\n    #onInsert;\n    #disposeAfter;\n    #fetchMethod;\n    #memoMethod;\n    #perf;\n    /**\n     * {@link LRUCache.OptionsBase.perf}\n     */\n    get perf() {\n        return this.#perf;\n    }\n    /**\n     * {@link LRUCache.OptionsBase.ttl}\n     */\n    ttl;\n    /**\n     * {@link LRUCache.OptionsBase.ttlResolution}\n     */\n    ttlResolution;\n    /**\n     * {@link LRUCache.OptionsBase.ttlAutopurge}\n     */\n    ttlAutopurge;\n    /**\n     * {@link LRUCache.OptionsBase.updateAgeOnGet}\n     */\n    updateAgeOnGet;\n    /**\n     * {@link LRUCache.OptionsBase.updateAgeOnHas}\n     */\n    updateAgeOnHas;\n    /**\n     * {@link LRUCache.OptionsBase.allowStale}\n     */\n    allowStale;\n    /**\n     * {@link LRUCache.OptionsBase.noDisposeOnSet}\n     */\n    noDisposeOnSet;\n    /**\n     * {@link LRUCache.OptionsBase.noUpdateTTL}\n     */\n    noUpdateTTL;\n    /**\n     * {@link LRUCache.OptionsBase.maxEntrySize}\n     */\n    maxEntrySize;\n    /**\n     * {@link LRUCache.OptionsBase.sizeCalculation}\n     */\n    sizeCalculation;\n    /**\n     * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n     */\n    noDeleteOnFetchRejection;\n    /**\n     * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n     */\n    noDeleteOnStaleGet;\n    /**\n     * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n     */\n    allowStaleOnFetchAbort;\n    /**\n     * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n     */\n    allowStaleOnFetchRejection;\n    /**\n     * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n     */\n    ignoreFetchAbort;\n    // computed properties\n    #size;\n    #calculatedSize;\n    #keyMap;\n    #keyList;\n    #valList;\n    #next;\n    #prev;\n    #head;\n    #tail;\n    #free;\n    #disposed;\n    #sizes;\n    #starts;\n    #ttls;\n    #hasDispose;\n    #hasFetchMethod;\n    #hasDisposeAfter;\n    #hasOnInsert;\n    /**\n     * Do not call this method unless you need to inspect the\n     * inner workings of the cache.  If anything returned by this\n     * object is modified in any way, strange breakage may occur.\n     *\n     * These fields are private for a reason!\n     *\n     * @internal\n     */\n    static unsafeExposeInternals(c) {\n        return {\n            // properties\n            starts: c.#starts,\n            ttls: c.#ttls,\n            sizes: c.#sizes,\n            keyMap: c.#keyMap,\n            keyList: c.#keyList,\n            valList: c.#valList,\n            next: c.#next,\n            prev: c.#prev,\n            get head() {\n                return c.#head;\n            },\n            get tail() {\n                return c.#tail;\n            },\n            free: c.#free,\n            // methods\n            isBackgroundFetch: (p) => c.#isBackgroundFetch(p),\n            backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),\n            moveToTail: (index) => c.#moveToTail(index),\n            indexes: (options) => c.#indexes(options),\n            rindexes: (options) => c.#rindexes(options),\n            isStale: (index) => c.#isStale(index),\n        };\n    }\n    // Protected read-only members\n    /**\n     * {@link LRUCache.OptionsBase.max} (read-only)\n     */\n    get max() {\n        return this.#max;\n    }\n    /**\n     * {@link LRUCache.OptionsBase.maxSize} (read-only)\n     */\n    get maxSize() {\n        return this.#maxSize;\n    }\n    /**\n     * The total computed size of items in the cache (read-only)\n     */\n    get calculatedSize() {\n        return this.#calculatedSize;\n    }\n    /**\n     * The number of items stored in the cache (read-only)\n     */\n    get size() {\n        return this.#size;\n    }\n    /**\n     * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n     */\n    get fetchMethod() {\n        return this.#fetchMethod;\n    }\n    get memoMethod() {\n        return this.#memoMethod;\n    }\n    /**\n     * {@link LRUCache.OptionsBase.dispose} (read-only)\n     */\n    get dispose() {\n        return this.#dispose;\n    }\n    /**\n     * {@link LRUCache.OptionsBase.onInsert} (read-only)\n     */\n    get onInsert() {\n        return this.#onInsert;\n    }\n    /**\n     * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n     */\n    get disposeAfter() {\n        return this.#disposeAfter;\n    }\n    constructor(options) {\n        const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, perf, } = options;\n        if (perf !== undefined) {\n            if (typeof perf?.now !== 'function') {\n                throw new TypeError('perf option must have a now() method if specified');\n            }\n        }\n        this.#perf = perf ?? defaultPerf;\n        if (max !== 0 && !isPosInt(max)) {\n            throw new TypeError('max option must be a nonnegative integer');\n        }\n        const UintArray = max ? getUintArray(max) : Array;\n        if (!UintArray) {\n            throw new Error('invalid max value: ' + max);\n        }\n        this.#max = max;\n        this.#maxSize = maxSize;\n        this.maxEntrySize = maxEntrySize || this.#maxSize;\n        this.sizeCalculation = sizeCalculation;\n        if (this.sizeCalculation) {\n            if (!this.#maxSize && !this.maxEntrySize) {\n                throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');\n            }\n            if (typeof this.sizeCalculation !== 'function') {\n                throw new TypeError('sizeCalculation set to non-function');\n            }\n        }\n        if (memoMethod !== undefined &&\n            typeof memoMethod !== 'function') {\n            throw new TypeError('memoMethod must be a function if defined');\n        }\n        this.#memoMethod = memoMethod;\n        if (fetchMethod !== undefined &&\n            typeof fetchMethod !== 'function') {\n            throw new TypeError('fetchMethod must be a function if specified');\n        }\n        this.#fetchMethod = fetchMethod;\n        this.#hasFetchMethod = !!fetchMethod;\n        this.#keyMap = new Map();\n        this.#keyList = new Array(max).fill(undefined);\n        this.#valList = new Array(max).fill(undefined);\n        this.#next = new UintArray(max);\n        this.#prev = new UintArray(max);\n        this.#head = 0;\n        this.#tail = 0;\n        this.#free = Stack.create(max);\n        this.#size = 0;\n        this.#calculatedSize = 0;\n        if (typeof dispose === 'function') {\n            this.#dispose = dispose;\n        }\n        if (typeof onInsert === 'function') {\n            this.#onInsert = onInsert;\n        }\n        if (typeof disposeAfter === 'function') {\n            this.#disposeAfter = disposeAfter;\n            this.#disposed = [];\n        }\n        else {\n            this.#disposeAfter = undefined;\n            this.#disposed = undefined;\n        }\n        this.#hasDispose = !!this.#dispose;\n        this.#hasOnInsert = !!this.#onInsert;\n        this.#hasDisposeAfter = !!this.#disposeAfter;\n        this.noDisposeOnSet = !!noDisposeOnSet;\n        this.noUpdateTTL = !!noUpdateTTL;\n        this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;\n        this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;\n        this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;\n        this.ignoreFetchAbort = !!ignoreFetchAbort;\n        // NB: maxEntrySize is set to maxSize if it's set\n        if (this.maxEntrySize !== 0) {\n            if (this.#maxSize !== 0) {\n                if (!isPosInt(this.#maxSize)) {\n                    throw new TypeError('maxSize must be a positive integer if specified');\n                }\n            }\n            if (!isPosInt(this.maxEntrySize)) {\n                throw new TypeError('maxEntrySize must be a positive integer if specified');\n            }\n            this.#initializeSizeTracking();\n        }\n        this.allowStale = !!allowStale;\n        this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;\n        this.updateAgeOnGet = !!updateAgeOnGet;\n        this.updateAgeOnHas = !!updateAgeOnHas;\n        this.ttlResolution =\n            isPosInt(ttlResolution) || ttlResolution === 0 ?\n                ttlResolution\n                : 1;\n        this.ttlAutopurge = !!ttlAutopurge;\n        this.ttl = ttl || 0;\n        if (this.ttl) {\n            if (!isPosInt(this.ttl)) {\n                throw new TypeError('ttl must be a positive integer if specified');\n            }\n            this.#initializeTTLTracking();\n        }\n        // do not allow completely unbounded caches\n        if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n            throw new TypeError('At least one of max, maxSize, or ttl is required');\n        }\n        if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n            const code = 'LRU_CACHE_UNBOUNDED';\n            if (shouldWarn(code)) {\n                warned.add(code);\n                const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n                    'result in unbounded memory consumption.';\n                emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);\n            }\n        }\n    }\n    /**\n     * Return the number of ms left in the item's TTL. If item is not in cache,\n     * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n     */\n    getRemainingTTL(key) {\n        return this.#keyMap.has(key) ? Infinity : 0;\n    }\n    #initializeTTLTracking() {\n        const ttls = new ZeroArray(this.#max);\n        const starts = new ZeroArray(this.#max);\n        this.#ttls = ttls;\n        this.#starts = starts;\n        this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n            starts[index] = ttl !== 0 ? start : 0;\n            ttls[index] = ttl;\n            if (ttl !== 0 && this.ttlAutopurge) {\n                const t = setTimeout(() => {\n                    if (this.#isStale(index)) {\n                        this.#delete(this.#keyList[index], 'expire');\n                    }\n                }, ttl + 1);\n                // unref() not supported on all platforms\n                /* c8 ignore start */\n                if (t.unref) {\n                    t.unref();\n                }\n                /* c8 ignore stop */\n            }\n        };\n        this.#updateItemAge = index => {\n            starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0;\n        };\n        this.#statusTTL = (status, index) => {\n            if (ttls[index]) {\n                const ttl = ttls[index];\n                const start = starts[index];\n                /* c8 ignore next */\n                if (!ttl || !start)\n                    return;\n                status.ttl = ttl;\n                status.start = start;\n                status.now = cachedNow || getNow();\n                const age = status.now - start;\n                status.remainingTTL = ttl - age;\n            }\n        };\n        // debounce calls to perf.now() to 1s so we're not hitting\n        // that costly call repeatedly.\n        let cachedNow = 0;\n        const getNow = () => {\n            const n = this.#perf.now();\n            if (this.ttlResolution > 0) {\n                cachedNow = n;\n                const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);\n                // not available on all platforms\n                /* c8 ignore start */\n                if (t.unref) {\n                    t.unref();\n                }\n                /* c8 ignore stop */\n            }\n            return n;\n        };\n        this.getRemainingTTL = key => {\n            const index = this.#keyMap.get(key);\n            if (index === undefined) {\n                return 0;\n            }\n            const ttl = ttls[index];\n            const start = starts[index];\n            if (!ttl || !start) {\n                return Infinity;\n            }\n            const age = (cachedNow || getNow()) - start;\n            return ttl - age;\n        };\n        this.#isStale = index => {\n            const s = starts[index];\n            const t = ttls[index];\n            return !!t && !!s && (cachedNow || getNow()) - s > t;\n        };\n    }\n    // conditionally set private methods related to TTL\n    #updateItemAge = () => { };\n    #statusTTL = () => { };\n    #setItemTTL = () => { };\n    /* c8 ignore stop */\n    #isStale = () => false;\n    #initializeSizeTracking() {\n        const sizes = new ZeroArray(this.#max);\n        this.#calculatedSize = 0;\n        this.#sizes = sizes;\n        this.#removeItemSize = index => {\n            this.#calculatedSize -= sizes[index];\n            sizes[index] = 0;\n        };\n        this.#requireSize = (k, v, size, sizeCalculation) => {\n            // provisionally accept background fetches.\n            // actual value size will be checked when they return.\n            if (this.#isBackgroundFetch(v)) {\n                return 0;\n            }\n            if (!isPosInt(size)) {\n                if (sizeCalculation) {\n                    if (typeof sizeCalculation !== 'function') {\n                        throw new TypeError('sizeCalculation must be a function');\n                    }\n                    size = sizeCalculation(v, k);\n                    if (!isPosInt(size)) {\n                        throw new TypeError('sizeCalculation return invalid (expect positive integer)');\n                    }\n                }\n                else {\n                    throw new TypeError('invalid size value (must be positive integer). ' +\n                        'When maxSize or maxEntrySize is used, sizeCalculation ' +\n                        'or size must be set.');\n                }\n            }\n            return size;\n        };\n        this.#addItemSize = (index, size, status) => {\n            sizes[index] = size;\n            if (this.#maxSize) {\n                const maxSize = this.#maxSize - sizes[index];\n                while (this.#calculatedSize > maxSize) {\n                    this.#evict(true);\n                }\n            }\n            this.#calculatedSize += sizes[index];\n            if (status) {\n                status.entrySize = size;\n                status.totalCalculatedSize = this.#calculatedSize;\n            }\n        };\n    }\n    #removeItemSize = _i => { };\n    #addItemSize = (_i, _s, _st) => { };\n    #requireSize = (_k, _v, size, sizeCalculation) => {\n        if (size || sizeCalculation) {\n            throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');\n        }\n        return 0;\n    };\n    *#indexes({ allowStale = this.allowStale } = {}) {\n        if (this.#size) {\n            for (let i = this.#tail; true;) {\n                if (!this.#isValidIndex(i)) {\n                    break;\n                }\n                if (allowStale || !this.#isStale(i)) {\n                    yield i;\n                }\n                if (i === this.#head) {\n                    break;\n                }\n                else {\n                    i = this.#prev[i];\n                }\n            }\n        }\n    }\n    *#rindexes({ allowStale = this.allowStale } = {}) {\n        if (this.#size) {\n            for (let i = this.#head; true;) {\n                if (!this.#isValidIndex(i)) {\n                    break;\n                }\n                if (allowStale || !this.#isStale(i)) {\n                    yield i;\n                }\n                if (i === this.#tail) {\n                    break;\n                }\n                else {\n                    i = this.#next[i];\n                }\n            }\n        }\n    }\n    #isValidIndex(index) {\n        return (index !== undefined &&\n            this.#keyMap.get(this.#keyList[index]) === index);\n    }\n    /**\n     * Return a generator yielding `[key, value]` pairs,\n     * in order from most recently used to least recently used.\n     */\n    *entries() {\n        for (const i of this.#indexes()) {\n            if (this.#valList[i] !== undefined &&\n                this.#keyList[i] !== undefined &&\n                !this.#isBackgroundFetch(this.#valList[i])) {\n                yield [this.#keyList[i], this.#valList[i]];\n            }\n        }\n    }\n    /**\n     * Inverse order version of {@link LRUCache.entries}\n     *\n     * Return a generator yielding `[key, value]` pairs,\n     * in order from least recently used to most recently used.\n     */\n    *rentries() {\n        for (const i of this.#rindexes()) {\n            if (this.#valList[i] !== undefined &&\n                this.#keyList[i] !== undefined &&\n                !this.#isBackgroundFetch(this.#valList[i])) {\n                yield [this.#keyList[i], this.#valList[i]];\n            }\n        }\n    }\n    /**\n     * Return a generator yielding the keys in the cache,\n     * in order from most recently used to least recently used.\n     */\n    *keys() {\n        for (const i of this.#indexes()) {\n            const k = this.#keyList[i];\n            if (k !== undefined &&\n                !this.#isBackgroundFetch(this.#valList[i])) {\n                yield k;\n            }\n        }\n    }\n    /**\n     * Inverse order version of {@link LRUCache.keys}\n     *\n     * Return a generator yielding the keys in the cache,\n     * in order from least recently used to most recently used.\n     */\n    *rkeys() {\n        for (const i of this.#rindexes()) {\n            const k = this.#keyList[i];\n            if (k !== undefined &&\n                !this.#isBackgroundFetch(this.#valList[i])) {\n                yield k;\n            }\n        }\n    }\n    /**\n     * Return a generator yielding the values in the cache,\n     * in order from most recently used to least recently used.\n     */\n    *values() {\n        for (const i of this.#indexes()) {\n            const v = this.#valList[i];\n            if (v !== undefined &&\n                !this.#isBackgroundFetch(this.#valList[i])) {\n                yield this.#valList[i];\n            }\n        }\n    }\n    /**\n     * Inverse order version of {@link LRUCache.values}\n     *\n     * Return a generator yielding the values in the cache,\n     * in order from least recently used to most recently used.\n     */\n    *rvalues() {\n        for (const i of this.#rindexes()) {\n            const v = this.#valList[i];\n            if (v !== undefined &&\n                !this.#isBackgroundFetch(this.#valList[i])) {\n                yield this.#valList[i];\n            }\n        }\n    }\n    /**\n     * Iterating over the cache itself yields the same results as\n     * {@link LRUCache.entries}\n     */\n    [Symbol.iterator]() {\n        return this.entries();\n    }\n    /**\n     * A String value that is used in the creation of the default string\n     * description of an object. Called by the built-in method\n     * `Object.prototype.toString`.\n     */\n    [Symbol.toStringTag] = 'LRUCache';\n    /**\n     * Find a value for which the supplied fn method returns a truthy value,\n     * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n     */\n    find(fn, getOptions = {}) {\n        for (const i of this.#indexes()) {\n            const v = this.#valList[i];\n            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n            if (value === undefined)\n                continue;\n            if (fn(value, this.#keyList[i], this)) {\n                return this.get(this.#keyList[i], getOptions);\n            }\n        }\n    }\n    /**\n     * Call the supplied function on each item in the cache, in order from most\n     * recently used to least recently used.\n     *\n     * `fn` is called as `fn(value, key, cache)`.\n     *\n     * If `thisp` is provided, function will be called in the `this`-context of\n     * the provided object, or the cache if no `thisp` object is provided.\n     *\n     * Does not update age or recenty of use, or iterate over stale values.\n     */\n    forEach(fn, thisp = this) {\n        for (const i of this.#indexes()) {\n            const v = this.#valList[i];\n            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n            if (value === undefined)\n                continue;\n            fn.call(thisp, value, this.#keyList[i], this);\n        }\n    }\n    /**\n     * The same as {@link LRUCache.forEach} but items are iterated over in\n     * reverse order.  (ie, less recently used items are iterated over first.)\n     */\n    rforEach(fn, thisp = this) {\n        for (const i of this.#rindexes()) {\n            const v = this.#valList[i];\n            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n            if (value === undefined)\n                continue;\n            fn.call(thisp, value, this.#keyList[i], this);\n        }\n    }\n    /**\n     * Delete any stale entries. Returns true if anything was removed,\n     * false otherwise.\n     */\n    purgeStale() {\n        let deleted = false;\n        for (const i of this.#rindexes({ allowStale: true })) {\n            if (this.#isStale(i)) {\n                this.#delete(this.#keyList[i], 'expire');\n                deleted = true;\n            }\n        }\n        return deleted;\n    }\n    /**\n     * Get the extended info about a given entry, to get its value, size, and\n     * TTL info simultaneously. Returns `undefined` if the key is not present.\n     *\n     * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n     * serialization, the `start` value is always the current timestamp, and the\n     * `ttl` is a calculated remaining time to live (negative if expired).\n     *\n     * Always returns stale values, if their info is found in the cache, so be\n     * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n     * if relevant.\n     */\n    info(key) {\n        const i = this.#keyMap.get(key);\n        if (i === undefined)\n            return undefined;\n        const v = this.#valList[i];\n        /* c8 ignore start - this isn't tested for the info function,\n         * but it's the same logic as found in other places. */\n        const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n        if (value === undefined)\n            return undefined;\n        /* c8 ignore end */\n        const entry = { value };\n        if (this.#ttls && this.#starts) {\n            const ttl = this.#ttls[i];\n            const start = this.#starts[i];\n            if (ttl && start) {\n                const remain = ttl - (this.#perf.now() - start);\n                entry.ttl = remain;\n                entry.start = Date.now();\n            }\n        }\n        if (this.#sizes) {\n            entry.size = this.#sizes[i];\n        }\n        return entry;\n    }\n    /**\n     * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n     * passed to {@link LRUCache#load}.\n     *\n     * The `start` fields are calculated relative to a portable `Date.now()`\n     * timestamp, even if `performance.now()` is available.\n     *\n     * Stale entries are always included in the `dump`, even if\n     * {@link LRUCache.OptionsBase.allowStale} is false.\n     *\n     * Note: this returns an actual array, not a generator, so it can be more\n     * easily passed around.\n     */\n    dump() {\n        const arr = [];\n        for (const i of this.#indexes({ allowStale: true })) {\n            const key = this.#keyList[i];\n            const v = this.#valList[i];\n            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n            if (value === undefined || key === undefined)\n                continue;\n            const entry = { value };\n            if (this.#ttls && this.#starts) {\n                entry.ttl = this.#ttls[i];\n                // always dump the start relative to a portable timestamp\n                // it's ok for this to be a bit slow, it's a rare operation.\n                const age = this.#perf.now() - this.#starts[i];\n                entry.start = Math.floor(Date.now() - age);\n            }\n            if (this.#sizes) {\n                entry.size = this.#sizes[i];\n            }\n            arr.unshift([key, entry]);\n        }\n        return arr;\n    }\n    /**\n     * Reset the cache and load in the items in entries in the order listed.\n     *\n     * The shape of the resulting cache may be different if the same options are\n     * not used in both caches.\n     *\n     * The `start` fields are assumed to be calculated relative to a portable\n     * `Date.now()` timestamp, even if `performance.now()` is available.\n     */\n    load(arr) {\n        this.clear();\n        for (const [key, entry] of arr) {\n            if (entry.start) {\n                // entry.start is a portable timestamp, but we may be using\n                // node's performance.now(), so calculate the offset, so that\n                // we get the intended remaining TTL, no matter how long it's\n                // been on ice.\n                //\n                // it's ok for this to be a bit slow, it's a rare operation.\n                const age = Date.now() - entry.start;\n                entry.start = this.#perf.now() - age;\n            }\n            this.set(key, entry.value, entry);\n        }\n    }\n    /**\n     * Add a value to the cache.\n     *\n     * Note: if `undefined` is specified as a value, this is an alias for\n     * {@link LRUCache#delete}\n     *\n     * Fields on the {@link LRUCache.SetOptions} options param will override\n     * their corresponding values in the constructor options for the scope\n     * of this single `set()` operation.\n     *\n     * If `start` is provided, then that will set the effective start\n     * time for the TTL calculation. Note that this must be a previous\n     * value of `performance.now()` if supported, or a previous value of\n     * `Date.now()` if not.\n     *\n     * Options object may also include `size`, which will prevent\n     * calling the `sizeCalculation` function and just use the specified\n     * number if it is a positive integer, and `noDisposeOnSet` which\n     * will prevent calling a `dispose` function in the case of\n     * overwrites.\n     *\n     * If the `size` (or return value of `sizeCalculation`) for a given\n     * entry is greater than `maxEntrySize`, then the item will not be\n     * added to the cache.\n     *\n     * Will update the recency of the entry.\n     *\n     * If the value is `undefined`, then this is an alias for\n     * `cache.delete(key)`. `undefined` is never stored in the cache.\n     */\n    set(k, v, setOptions = {}) {\n        if (v === undefined) {\n            this.delete(k);\n            return this;\n        }\n        const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;\n        let { noUpdateTTL = this.noUpdateTTL } = setOptions;\n        const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);\n        // if the item doesn't fit, don't do anything\n        // NB: maxEntrySize set to maxSize by default\n        if (this.maxEntrySize && size > this.maxEntrySize) {\n            if (status) {\n                status.set = 'miss';\n                status.maxEntrySizeExceeded = true;\n            }\n            // have to delete, in case something is there already.\n            this.#delete(k, 'set');\n            return this;\n        }\n        let index = this.#size === 0 ? undefined : this.#keyMap.get(k);\n        if (index === undefined) {\n            // addition\n            index = (this.#size === 0 ? this.#tail\n                : this.#free.length !== 0 ? this.#free.pop()\n                    : this.#size === this.#max ? this.#evict(false)\n                        : this.#size);\n            this.#keyList[index] = k;\n            this.#valList[index] = v;\n            this.#keyMap.set(k, index);\n            this.#next[this.#tail] = index;\n            this.#prev[index] = this.#tail;\n            this.#tail = index;\n            this.#size++;\n            this.#addItemSize(index, size, status);\n            if (status)\n                status.set = 'add';\n            noUpdateTTL = false;\n            if (this.#hasOnInsert) {\n                this.#onInsert?.(v, k, 'add');\n            }\n        }\n        else {\n            // update\n            this.#moveToTail(index);\n            const oldVal = this.#valList[index];\n            if (v !== oldVal) {\n                if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n                    oldVal.__abortController.abort(new Error('replaced'));\n                    const { __staleWhileFetching: s } = oldVal;\n                    if (s !== undefined && !noDisposeOnSet) {\n                        if (this.#hasDispose) {\n                            this.#dispose?.(s, k, 'set');\n                        }\n                        if (this.#hasDisposeAfter) {\n                            this.#disposed?.push([s, k, 'set']);\n                        }\n                    }\n                }\n                else if (!noDisposeOnSet) {\n                    if (this.#hasDispose) {\n                        this.#dispose?.(oldVal, k, 'set');\n                    }\n                    if (this.#hasDisposeAfter) {\n                        this.#disposed?.push([oldVal, k, 'set']);\n                    }\n                }\n                this.#removeItemSize(index);\n                this.#addItemSize(index, size, status);\n                this.#valList[index] = v;\n                if (status) {\n                    status.set = 'replace';\n                    const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ?\n                        oldVal.__staleWhileFetching\n                        : oldVal;\n                    if (oldValue !== undefined)\n                        status.oldValue = oldValue;\n                }\n            }\n            else if (status) {\n                status.set = 'update';\n            }\n            if (this.#hasOnInsert) {\n                this.onInsert?.(v, k, v === oldVal ? 'update' : 'replace');\n            }\n        }\n        if (ttl !== 0 && !this.#ttls) {\n            this.#initializeTTLTracking();\n        }\n        if (this.#ttls) {\n            if (!noUpdateTTL) {\n                this.#setItemTTL(index, ttl, start);\n            }\n            if (status)\n                this.#statusTTL(status, index);\n        }\n        if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n            const dt = this.#disposed;\n            let task;\n            while ((task = dt?.shift())) {\n                this.#disposeAfter?.(...task);\n            }\n        }\n        return this;\n    }\n    /**\n     * Evict the least recently used item, returning its value or\n     * `undefined` if cache is empty.\n     */\n    pop() {\n        try {\n            while (this.#size) {\n                const val = this.#valList[this.#head];\n                this.#evict(true);\n                if (this.#isBackgroundFetch(val)) {\n                    if (val.__staleWhileFetching) {\n                        return val.__staleWhileFetching;\n                    }\n                }\n                else if (val !== undefined) {\n                    return val;\n                }\n            }\n        }\n        finally {\n            if (this.#hasDisposeAfter && this.#disposed) {\n                const dt = this.#disposed;\n                let task;\n                while ((task = dt?.shift())) {\n                    this.#disposeAfter?.(...task);\n                }\n            }\n        }\n    }\n    #evict(free) {\n        const head = this.#head;\n        const k = this.#keyList[head];\n        const v = this.#valList[head];\n        if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n            v.__abortController.abort(new Error('evicted'));\n        }\n        else if (this.#hasDispose || this.#hasDisposeAfter) {\n            if (this.#hasDispose) {\n                this.#dispose?.(v, k, 'evict');\n            }\n            if (this.#hasDisposeAfter) {\n                this.#disposed?.push([v, k, 'evict']);\n            }\n        }\n        this.#removeItemSize(head);\n        // if we aren't about to use the index, then null these out\n        if (free) {\n            this.#keyList[head] = undefined;\n            this.#valList[head] = undefined;\n            this.#free.push(head);\n        }\n        if (this.#size === 1) {\n            this.#head = this.#tail = 0;\n            this.#free.length = 0;\n        }\n        else {\n            this.#head = this.#next[head];\n        }\n        this.#keyMap.delete(k);\n        this.#size--;\n        return head;\n    }\n    /**\n     * Check if a key is in the cache, without updating the recency of use.\n     * Will return false if the item is stale, even though it is technically\n     * in the cache.\n     *\n     * Check if a key is in the cache, without updating the recency of\n     * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n     * to `true` in either the options or the constructor.\n     *\n     * Will return `false` if the item is stale, even though it is technically in\n     * the cache. The difference can be determined (if it matters) by using a\n     * `status` argument, and inspecting the `has` field.\n     *\n     * Will not update item age unless\n     * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n     */\n    has(k, hasOptions = {}) {\n        const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;\n        const index = this.#keyMap.get(k);\n        if (index !== undefined) {\n            const v = this.#valList[index];\n            if (this.#isBackgroundFetch(v) &&\n                v.__staleWhileFetching === undefined) {\n                return false;\n            }\n            if (!this.#isStale(index)) {\n                if (updateAgeOnHas) {\n                    this.#updateItemAge(index);\n                }\n                if (status) {\n                    status.has = 'hit';\n                    this.#statusTTL(status, index);\n                }\n                return true;\n            }\n            else if (status) {\n                status.has = 'stale';\n                this.#statusTTL(status, index);\n            }\n        }\n        else if (status) {\n            status.has = 'miss';\n        }\n        return false;\n    }\n    /**\n     * Like {@link LRUCache#get} but doesn't update recency or delete stale\n     * items.\n     *\n     * Returns `undefined` if the item is stale, unless\n     * {@link LRUCache.OptionsBase.allowStale} is set.\n     */\n    peek(k, peekOptions = {}) {\n        const { allowStale = this.allowStale } = peekOptions;\n        const index = this.#keyMap.get(k);\n        if (index === undefined ||\n            (!allowStale && this.#isStale(index))) {\n            return;\n        }\n        const v = this.#valList[index];\n        // either stale and allowed, or forcing a refresh of non-stale value\n        return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;\n    }\n    #backgroundFetch(k, index, options, context) {\n        const v = index === undefined ? undefined : this.#valList[index];\n        if (this.#isBackgroundFetch(v)) {\n            return v;\n        }\n        const ac = new AC();\n        const { signal } = options;\n        // when/if our AC signals, then stop listening to theirs.\n        signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n            signal: ac.signal,\n        });\n        const fetchOpts = {\n            signal: ac.signal,\n            options,\n            context,\n        };\n        const cb = (v, updateCache = false) => {\n            const { aborted } = ac.signal;\n            const ignoreAbort = options.ignoreFetchAbort && v !== undefined;\n            if (options.status) {\n                if (aborted && !updateCache) {\n                    options.status.fetchAborted = true;\n                    options.status.fetchError = ac.signal.reason;\n                    if (ignoreAbort)\n                        options.status.fetchAbortIgnored = true;\n                }\n                else {\n                    options.status.fetchResolved = true;\n                }\n            }\n            if (aborted && !ignoreAbort && !updateCache) {\n                return fetchFail(ac.signal.reason);\n            }\n            // either we didn't abort, and are still here, or we did, and ignored\n            const bf = p;\n            // if nothing else has been written there but we're set to update the\n            // cache and ignore the abort, or if it's still pending on this specific\n            // background request, then write it to the cache.\n            const vl = this.#valList[index];\n            if (vl === p || ignoreAbort && updateCache && vl === undefined) {\n                if (v === undefined) {\n                    if (bf.__staleWhileFetching !== undefined) {\n                        this.#valList[index] = bf.__staleWhileFetching;\n                    }\n                    else {\n                        this.#delete(k, 'fetch');\n                    }\n                }\n                else {\n                    if (options.status)\n                        options.status.fetchUpdated = true;\n                    this.set(k, v, fetchOpts.options);\n                }\n            }\n            return v;\n        };\n        const eb = (er) => {\n            if (options.status) {\n                options.status.fetchRejected = true;\n                options.status.fetchError = er;\n            }\n            return fetchFail(er);\n        };\n        const fetchFail = (er) => {\n            const { aborted } = ac.signal;\n            const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;\n            const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;\n            const noDelete = allowStale || options.noDeleteOnFetchRejection;\n            const bf = p;\n            if (this.#valList[index] === p) {\n                // if we allow stale on fetch rejections, then we need to ensure that\n                // the stale value is not removed from the cache when the fetch fails.\n                const del = !noDelete || bf.__staleWhileFetching === undefined;\n                if (del) {\n                    this.#delete(k, 'fetch');\n                }\n                else if (!allowStaleAborted) {\n                    // still replace the *promise* with the stale value,\n                    // since we are done with the promise at this point.\n                    // leave it untouched if we're still waiting for an\n                    // aborted background fetch that hasn't yet returned.\n                    this.#valList[index] = bf.__staleWhileFetching;\n                }\n            }\n            if (allowStale) {\n                if (options.status && bf.__staleWhileFetching !== undefined) {\n                    options.status.returnedStale = true;\n                }\n                return bf.__staleWhileFetching;\n            }\n            else if (bf.__returned === bf) {\n                throw er;\n            }\n        };\n        const pcall = (res, rej) => {\n            const fmp = this.#fetchMethod?.(k, v, fetchOpts);\n            if (fmp && fmp instanceof Promise) {\n                fmp.then(v => res(v === undefined ? undefined : v), rej);\n            }\n            // ignored, we go until we finish, regardless.\n            // defer check until we are actually aborting,\n            // so fetchMethod can override.\n            ac.signal.addEventListener('abort', () => {\n                if (!options.ignoreFetchAbort ||\n                    options.allowStaleOnFetchAbort) {\n                    res(undefined);\n                    // when it eventually resolves, update the cache.\n                    if (options.allowStaleOnFetchAbort) {\n                        res = v => cb(v, true);\n                    }\n                }\n            });\n        };\n        if (options.status)\n            options.status.fetchDispatched = true;\n        const p = new Promise(pcall).then(cb, eb);\n        const bf = Object.assign(p, {\n            __abortController: ac,\n            __staleWhileFetching: v,\n            __returned: undefined,\n        });\n        if (index === undefined) {\n            // internal, don't expose status.\n            this.set(k, bf, { ...fetchOpts.options, status: undefined });\n            index = this.#keyMap.get(k);\n        }\n        else {\n            this.#valList[index] = bf;\n        }\n        return bf;\n    }\n    #isBackgroundFetch(p) {\n        if (!this.#hasFetchMethod)\n            return false;\n        const b = p;\n        return (!!b &&\n            b instanceof Promise &&\n            b.hasOwnProperty('__staleWhileFetching') &&\n            b.__abortController instanceof AC);\n    }\n    async fetch(k, fetchOptions = {}) {\n        const { \n        // get options\n        allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, \n        // set options\n        ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, \n        // fetch exclusive options\n        noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;\n        if (!this.#hasFetchMethod) {\n            if (status)\n                status.fetch = 'get';\n            return this.get(k, {\n                allowStale,\n                updateAgeOnGet,\n                noDeleteOnStaleGet,\n                status,\n            });\n        }\n        const options = {\n            allowStale,\n            updateAgeOnGet,\n            noDeleteOnStaleGet,\n            ttl,\n            noDisposeOnSet,\n            size,\n            sizeCalculation,\n            noUpdateTTL,\n            noDeleteOnFetchRejection,\n            allowStaleOnFetchRejection,\n            allowStaleOnFetchAbort,\n            ignoreFetchAbort,\n            status,\n            signal,\n        };\n        let index = this.#keyMap.get(k);\n        if (index === undefined) {\n            if (status)\n                status.fetch = 'miss';\n            const p = this.#backgroundFetch(k, index, options, context);\n            return (p.__returned = p);\n        }\n        else {\n            // in cache, maybe already fetching\n            const v = this.#valList[index];\n            if (this.#isBackgroundFetch(v)) {\n                const stale = allowStale && v.__staleWhileFetching !== undefined;\n                if (status) {\n                    status.fetch = 'inflight';\n                    if (stale)\n                        status.returnedStale = true;\n                }\n                return stale ? v.__staleWhileFetching : (v.__returned = v);\n            }\n            // if we force a refresh, that means do NOT serve the cached value,\n            // unless we are already in the process of refreshing the cache.\n            const isStale = this.#isStale(index);\n            if (!forceRefresh && !isStale) {\n                if (status)\n                    status.fetch = 'hit';\n                this.#moveToTail(index);\n                if (updateAgeOnGet) {\n                    this.#updateItemAge(index);\n                }\n                if (status)\n                    this.#statusTTL(status, index);\n                return v;\n            }\n            // ok, it is stale or a forced refresh, and not already fetching.\n            // refresh the cache.\n            const p = this.#backgroundFetch(k, index, options, context);\n            const hasStale = p.__staleWhileFetching !== undefined;\n            const staleVal = hasStale && allowStale;\n            if (status) {\n                status.fetch = isStale ? 'stale' : 'refresh';\n                if (staleVal && isStale)\n                    status.returnedStale = true;\n            }\n            return staleVal ? p.__staleWhileFetching : (p.__returned = p);\n        }\n    }\n    async forceFetch(k, fetchOptions = {}) {\n        const v = await this.fetch(k, fetchOptions);\n        if (v === undefined)\n            throw new Error('fetch() returned undefined');\n        return v;\n    }\n    memo(k, memoOptions = {}) {\n        const memoMethod = this.#memoMethod;\n        if (!memoMethod) {\n            throw new Error('no memoMethod provided to constructor');\n        }\n        const { context, forceRefresh, ...options } = memoOptions;\n        const v = this.get(k, options);\n        if (!forceRefresh && v !== undefined)\n            return v;\n        const vv = memoMethod(k, v, {\n            options,\n            context,\n        });\n        this.set(k, vv, options);\n        return vv;\n    }\n    /**\n     * Return a value from the cache. Will update the recency of the cache\n     * entry found.\n     *\n     * If the key is not found, get() will return `undefined`.\n     */\n    get(k, getOptions = {}) {\n        const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;\n        const index = this.#keyMap.get(k);\n        if (index !== undefined) {\n            const value = this.#valList[index];\n            const fetching = this.#isBackgroundFetch(value);\n            if (status)\n                this.#statusTTL(status, index);\n            if (this.#isStale(index)) {\n                if (status)\n                    status.get = 'stale';\n                // delete only if not an in-flight background fetch\n                if (!fetching) {\n                    if (!noDeleteOnStaleGet) {\n                        this.#delete(k, 'expire');\n                    }\n                    if (status && allowStale)\n                        status.returnedStale = true;\n                    return allowStale ? value : undefined;\n                }\n                else {\n                    if (status &&\n                        allowStale &&\n                        value.__staleWhileFetching !== undefined) {\n                        status.returnedStale = true;\n                    }\n                    return allowStale ? value.__staleWhileFetching : undefined;\n                }\n            }\n            else {\n                if (status)\n                    status.get = 'hit';\n                // if we're currently fetching it, we don't actually have it yet\n                // it's not stale, which means this isn't a staleWhileRefetching.\n                // If it's not stale, and fetching, AND has a __staleWhileFetching\n                // value, then that means the user fetched with {forceRefresh:true},\n                // so it's safe to return that value.\n                if (fetching) {\n                    return value.__staleWhileFetching;\n                }\n                this.#moveToTail(index);\n                if (updateAgeOnGet) {\n                    this.#updateItemAge(index);\n                }\n                return value;\n            }\n        }\n        else if (status) {\n            status.get = 'miss';\n        }\n    }\n    #connect(p, n) {\n        this.#prev[n] = p;\n        this.#next[p] = n;\n    }\n    #moveToTail(index) {\n        // if tail already, nothing to do\n        // if head, move head to next[index]\n        // else\n        //   move next[prev[index]] to next[index] (head has no prev)\n        //   move prev[next[index]] to prev[index]\n        // prev[index] = tail\n        // next[tail] = index\n        // tail = index\n        if (index !== this.#tail) {\n            if (index === this.#head) {\n                this.#head = this.#next[index];\n            }\n            else {\n                this.#connect(this.#prev[index], this.#next[index]);\n            }\n            this.#connect(this.#tail, index);\n            this.#tail = index;\n        }\n    }\n    /**\n     * Deletes a key out of the cache.\n     *\n     * Returns true if the key was deleted, false otherwise.\n     */\n    delete(k) {\n        return this.#delete(k, 'delete');\n    }\n    #delete(k, reason) {\n        let deleted = false;\n        if (this.#size !== 0) {\n            const index = this.#keyMap.get(k);\n            if (index !== undefined) {\n                deleted = true;\n                if (this.#size === 1) {\n                    this.#clear(reason);\n                }\n                else {\n                    this.#removeItemSize(index);\n                    const v = this.#valList[index];\n                    if (this.#isBackgroundFetch(v)) {\n                        v.__abortController.abort(new Error('deleted'));\n                    }\n                    else if (this.#hasDispose || this.#hasDisposeAfter) {\n                        if (this.#hasDispose) {\n                            this.#dispose?.(v, k, reason);\n                        }\n                        if (this.#hasDisposeAfter) {\n                            this.#disposed?.push([v, k, reason]);\n                        }\n                    }\n                    this.#keyMap.delete(k);\n                    this.#keyList[index] = undefined;\n                    this.#valList[index] = undefined;\n                    if (index === this.#tail) {\n                        this.#tail = this.#prev[index];\n                    }\n                    else if (index === this.#head) {\n                        this.#head = this.#next[index];\n                    }\n                    else {\n                        const pi = this.#prev[index];\n                        this.#next[pi] = this.#next[index];\n                        const ni = this.#next[index];\n                        this.#prev[ni] = this.#prev[index];\n                    }\n                    this.#size--;\n                    this.#free.push(index);\n                }\n            }\n        }\n        if (this.#hasDisposeAfter && this.#disposed?.length) {\n            const dt = this.#disposed;\n            let task;\n            while ((task = dt?.shift())) {\n                this.#disposeAfter?.(...task);\n            }\n        }\n        return deleted;\n    }\n    /**\n     * Clear the cache entirely, throwing away all values.\n     */\n    clear() {\n        return this.#clear('delete');\n    }\n    #clear(reason) {\n        for (const index of this.#rindexes({ allowStale: true })) {\n            const v = this.#valList[index];\n            if (this.#isBackgroundFetch(v)) {\n                v.__abortController.abort(new Error('deleted'));\n            }\n            else {\n                const k = this.#keyList[index];\n                if (this.#hasDispose) {\n                    this.#dispose?.(v, k, reason);\n                }\n                if (this.#hasDisposeAfter) {\n                    this.#disposed?.push([v, k, reason]);\n                }\n            }\n        }\n        this.#keyMap.clear();\n        this.#valList.fill(undefined);\n        this.#keyList.fill(undefined);\n        if (this.#ttls && this.#starts) {\n            this.#ttls.fill(0);\n            this.#starts.fill(0);\n        }\n        if (this.#sizes) {\n            this.#sizes.fill(0);\n        }\n        this.#head = 0;\n        this.#tail = 0;\n        this.#free.length = 0;\n        this.#calculatedSize = 0;\n        this.#size = 0;\n        if (this.#hasDisposeAfter && this.#disposed) {\n            const dt = this.#disposed;\n            let task;\n            while ((task = dt?.shift())) {\n                this.#disposeAfter?.(...task);\n            }\n        }\n    }\n}\n//# sourceMappingURL=index.js.map{\n  \"type\": \"module\"\n}\nmodule.exports = assert;\n\nfunction assert(val, msg) {\n  if (!val)\n    throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n  if (l != r)\n    throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n{\n  \"name\": \"minimalistic-assert\",\n  \"version\": \"1.0.1\",\n  \"description\": \"minimalistic-assert ===\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/calvinmetcalf/minimalistic-assert.git\"\n  },\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"bugs\": {\n    \"url\": \"https://github.com/calvinmetcalf/minimalistic-assert/issues\"\n  },\n  \"homepage\": \"https://github.com/calvinmetcalf/minimalistic-assert\"\n}\n'use strict';\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n  if (Array.isArray(msg))\n    return msg.slice();\n  if (!msg)\n    return [];\n  var res = [];\n  if (typeof msg !== 'string') {\n    for (var i = 0; i < msg.length; i++)\n      res[i] = msg[i] | 0;\n    return res;\n  }\n  if (enc === 'hex') {\n    msg = msg.replace(/[^a-z0-9]+/ig, '');\n    if (msg.length % 2 !== 0)\n      msg = '0' + msg;\n    for (var i = 0; i < msg.length; i += 2)\n      res.push(parseInt(msg[i] + msg[i + 1], 16));\n  } else {\n    for (var i = 0; i < msg.length; i++) {\n      var c = msg.charCodeAt(i);\n      var hi = c >> 8;\n      var lo = c & 0xff;\n      if (hi)\n        res.push(hi, lo);\n      else\n        res.push(lo);\n    }\n  }\n  return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n  if (word.length === 1)\n    return '0' + word;\n  else\n    return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++)\n    res += zero2(msg[i].toString(16));\n  return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n  if (enc === 'hex')\n    return toHex(arr);\n  else\n    return arr;\n};\n{\n  \"name\": \"minimalistic-crypto-utils\",\n  \"version\": \"1.0.1\",\n  \"description\": \"Minimalistic tools for JS crypto modules\",\n  \"main\": \"lib/utils.js\",\n  \"scripts\": {\n    \"test\": \"mocha --reporter=spec test/*-test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+ssh://git@github.com/indutny/minimalistic-crypto-utils.git\"\n  },\n  \"keywords\": [\n    \"minimalistic\",\n    \"utils\",\n    \"crypto\"\n  ],\n  \"author\": \"Fedor Indutny <fedor@indutny.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/indutny/minimalistic-crypto-utils/issues\"\n  },\n  \"homepage\": \"https://github.com/indutny/minimalistic-crypto-utils#readme\",\n  \"devDependencies\": {\n    \"mocha\": \"^3.2.0\"\n  }\n}\nvar queueTick = require('queue-tick')\n\nvar mutexify = function () {\n  var queue = []\n  var used = null\n\n  var call = function () {\n    used(release)\n  }\n\n  var acquire = function (fn) {\n    if (used) return queue.push(fn)\n    used = fn\n    acquire.locked = true\n    queueTick(call)\n    return 0\n  }\n\n  acquire.locked = false\n\n  var release = function (fn, err, value) {\n    used = null\n    acquire.locked = false\n    if (queue.length) acquire(queue.shift())\n    if (fn) fn(err, value)\n  }\n\n  return acquire\n}\n\nmodule.exports = mutexify\n{\n  \"name\": \"mutexify\",\n  \"version\": \"1.4.0\",\n  \"description\": \"mutex lock for javascript\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"queue-tick\": \"^1.0.0\"\n  },\n  \"devDependencies\": {\n    \"standard\": \"^14.3.3\",\n    \"tape\": \"^3.0.2\"\n  },\n  \"scripts\": {\n    \"test\": \"tape test.js\",\n    \"posttest\": \"npm run lint\",\n    \"lint\": \"standard\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/mutexify.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/mutexify/issues\"\n  },\n  \"keywords\": [\n    \"mutex\",\n    \"lock\"\n  ],\n  \"homepage\": \"https://github.com/mafintosh/mutexify\"\n}\nvar mutexify = require('.')\n\nvar mutexifyPromise = function () {\n  var lock = mutexify()\n\n  var acquire = function () {\n    return new Promise(lock)\n  }\n\n  Object.defineProperty(acquire, 'locked', {\n    get: function () { return lock.locked },\n    enumerable: true\n  })\n\n  return acquire\n}\n\nmodule.exports = mutexifyPromise\nmodule.exports = assert\n\nclass AssertionError extends Error {}\nAssertionError.prototype.name = 'AssertionError'\n\n/**\n * Minimal assert function\n * @param  {any} t Value to check if falsy\n * @param  {string=} m Optional assertion error message\n * @throws {AssertionError}\n */\nfunction assert (t, m) {\n  if (!t) {\n    var err = new AssertionError(m)\n    if (Error.captureStackTrace) Error.captureStackTrace(err, assert)\n    throw err\n  }\n}\n{\n  \"name\": \"nanoassert\",\n  \"version\": \"2.0.0\",\n  \"description\": \"Nanoscale assertion module\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"tape\": \"^4.9.1\"\n  },\n  \"scripts\": {\n    \"test\": \"tape test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/emilbayes/nanoassert.git\"\n  },\n  \"keywords\": [\n    \"assert\",\n    \"unassert\",\n    \"power-assert\",\n    \"tiny\",\n    \"nano\",\n    \"pico\"\n  ],\n  \"author\": \"Emil Bay <github@tixz.dk>\",\n  \"license\": \"ISC\",\n  \"bugs\": {\n    \"url\": \"https://github.com/emilbayes/nanoassert/issues\"\n  },\n  \"homepage\": \"https://github.com/emilbayes/nanoassert#readme\"\n}\nconst runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line\nif (typeof runtimeRequire.addon === 'function') { // if the platform supports native resolving prefer that\n  module.exports = runtimeRequire.addon.bind(runtimeRequire)\n} else { // else use the runtime version here\n  module.exports = require('./node-gyp-build.js')\n}\nvar fs = require('fs')\nvar path = require('path')\nvar os = require('os')\n\n// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'\nvar runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line\n\nvar vars = (process.config && process.config.variables) || {}\nvar prebuildsOnly = !!process.env.PREBUILDS_ONLY\nvar abi = process.versions.modules // TODO: support old node where this is undef\nvar runtime = isElectron() ? 'electron' : (isNwjs() ? 'node-webkit' : 'node')\n\nvar arch = process.env.npm_config_arch || os.arch()\nvar platform = process.env.npm_config_platform || os.platform()\nvar libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc')\nvar armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || ''\nvar uv = (process.versions.uv || '').split('.')[0]\n\nmodule.exports = load\n\nfunction load (dir) {\n  return runtimeRequire(load.resolve(dir))\n}\n\nload.resolve = load.path = function (dir) {\n  dir = path.resolve(dir || '.')\n\n  try {\n    var name = runtimeRequire(path.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_')\n    if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']\n  } catch (err) {}\n\n  if (!prebuildsOnly) {\n    var release = getFirst(path.join(dir, 'build/Release'), matchBuild)\n    if (release) return release\n\n    var debug = getFirst(path.join(dir, 'build/Debug'), matchBuild)\n    if (debug) return debug\n  }\n\n  var prebuild = resolve(dir)\n  if (prebuild) return prebuild\n\n  var nearby = resolve(path.dirname(process.execPath))\n  if (nearby) return nearby\n\n  var target = [\n    'platform=' + platform,\n    'arch=' + arch,\n    'runtime=' + runtime,\n    'abi=' + abi,\n    'uv=' + uv,\n    armv ? 'armv=' + armv : '',\n    'libc=' + libc,\n    'node=' + process.versions.node,\n    process.versions.electron ? 'electron=' + process.versions.electron : '',\n    typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line\n  ].filter(Boolean).join(' ')\n\n  throw new Error('No native build was found for ' + target + '\\n    loaded from: ' + dir + '\\n')\n\n  function resolve (dir) {\n    // Find matching \"prebuilds/<platform>-<arch>\" directory\n    var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple)\n    var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]\n    if (!tuple) return\n\n    // Find most specific flavor first\n    var prebuilds = path.join(dir, 'prebuilds', tuple.name)\n    var parsed = readdirSync(prebuilds).map(parseTags)\n    var candidates = parsed.filter(matchTags(runtime, abi))\n    var winner = candidates.sort(compareTags(runtime))[0]\n    if (winner) return path.join(prebuilds, winner.file)\n  }\n}\n\nfunction readdirSync (dir) {\n  try {\n    return fs.readdirSync(dir)\n  } catch (err) {\n    return []\n  }\n}\n\nfunction getFirst (dir, filter) {\n  var files = readdirSync(dir).filter(filter)\n  return files[0] && path.join(dir, files[0])\n}\n\nfunction matchBuild (name) {\n  return /\\.node$/.test(name)\n}\n\nfunction parseTuple (name) {\n  // Example: darwin-x64+arm64\n  var arr = name.split('-')\n  if (arr.length !== 2) return\n\n  var platform = arr[0]\n  var architectures = arr[1].split('+')\n\n  if (!platform) return\n  if (!architectures.length) return\n  if (!architectures.every(Boolean)) return\n\n  return { name, platform, architectures }\n}\n\nfunction matchTuple (platform, arch) {\n  return function (tuple) {\n    if (tuple == null) return false\n    if (tuple.platform !== platform) return false\n    return tuple.architectures.includes(arch)\n  }\n}\n\nfunction compareTuples (a, b) {\n  // Prefer single-arch prebuilds over multi-arch\n  return a.architectures.length - b.architectures.length\n}\n\nfunction parseTags (file) {\n  var arr = file.split('.')\n  var extension = arr.pop()\n  var tags = { file: file, specificity: 0 }\n\n  if (extension !== 'node') return\n\n  for (var i = 0; i < arr.length; i++) {\n    var tag = arr[i]\n\n    if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') {\n      tags.runtime = tag\n    } else if (tag === 'napi') {\n      tags.napi = true\n    } else if (tag.slice(0, 3) === 'abi') {\n      tags.abi = tag.slice(3)\n    } else if (tag.slice(0, 2) === 'uv') {\n      tags.uv = tag.slice(2)\n    } else if (tag.slice(0, 4) === 'armv') {\n      tags.armv = tag.slice(4)\n    } else if (tag === 'glibc' || tag === 'musl') {\n      tags.libc = tag\n    } else {\n      continue\n    }\n\n    tags.specificity++\n  }\n\n  return tags\n}\n\nfunction matchTags (runtime, abi) {\n  return function (tags) {\n    if (tags == null) return false\n    if (tags.runtime && tags.runtime !== runtime && !runtimeAgnostic(tags)) return false\n    if (tags.abi && tags.abi !== abi && !tags.napi) return false\n    if (tags.uv && tags.uv !== uv) return false\n    if (tags.armv && tags.armv !== armv) return false\n    if (tags.libc && tags.libc !== libc) return false\n\n    return true\n  }\n}\n\nfunction runtimeAgnostic (tags) {\n  return tags.runtime === 'node' && tags.napi\n}\n\nfunction compareTags (runtime) {\n  // Precedence: non-agnostic runtime, abi over napi, then by specificity.\n  return function (a, b) {\n    if (a.runtime !== b.runtime) {\n      return a.runtime === runtime ? -1 : 1\n    } else if (a.abi !== b.abi) {\n      return a.abi ? -1 : 1\n    } else if (a.specificity !== b.specificity) {\n      return a.specificity > b.specificity ? -1 : 1\n    } else {\n      return 0\n    }\n  }\n}\n\nfunction isNwjs () {\n  return !!(process.versions && process.versions.nw)\n}\n\nfunction isElectron () {\n  if (process.versions && process.versions.electron) return true\n  if (process.env.ELECTRON_RUN_AS_NODE) return true\n  return typeof window !== 'undefined' && window.process && window.process.type === 'renderer'\n}\n\nfunction isAlpine (platform) {\n  return platform === 'linux' && fs.existsSync('/etc/alpine-release')\n}\n\n// Exposed for unit tests\n// TODO: move to lib\nload.parseTags = parseTags\nload.matchTags = matchTags\nload.compareTags = compareTags\nload.parseTuple = parseTuple\nload.matchTuple = matchTuple\nload.compareTuples = compareTuples\n{\n  \"name\": \"node-gyp-build\",\n  \"version\": \"4.8.4\",\n  \"description\": \"Build tool and bindings loader for node-gyp that supports prebuilds\",\n  \"main\": \"index.js\",\n  \"imports\": {\n    \"fs\": {\n      \"bare\": \"builtin:fs\",\n      \"default\": \"fs\"\n    },\n    \"path\": {\n      \"bare\": \"builtin:path\",\n      \"default\": \"path\"\n    },\n    \"os\": {\n      \"bare\": \"builtin:os\",\n      \"default\": \"os\"\n    }\n  },\n  \"devDependencies\": {\n    \"array-shuffle\": \"^1.0.1\",\n    \"standard\": \"^14.0.0\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && node test\"\n  },\n  \"bin\": {\n    \"node-gyp-build\": \"./bin.js\",\n    \"node-gyp-build-optional\": \"./optional.js\",\n    \"node-gyp-build-test\": \"./build-test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/prebuild/node-gyp-build.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/prebuild/node-gyp-build/issues\"\n  },\n  \"homepage\": \"https://github.com/prebuild/node-gyp-build\"\n}\n/* eslint-disable camelcase */\nconst sodium = require('sodium-universal')\nconst assert = require('nanoassert')\nconst b4a = require('b4a')\n\nconst DHLEN = sodium.crypto_scalarmult_ed25519_BYTES\nconst PKLEN = sodium.crypto_scalarmult_ed25519_BYTES\nconst SCALARLEN = sodium.crypto_scalarmult_ed25519_BYTES\nconst SKLEN = sodium.crypto_sign_SECRETKEYBYTES\nconst ALG = 'Ed25519'\n\nmodule.exports = {\n  DHLEN,\n  PKLEN,\n  SCALARLEN,\n  SKLEN,\n  ALG,\n  name: ALG,\n  generateKeyPair,\n  dh\n}\n\nfunction generateKeyPair (privKey) {\n  if (privKey) return generateSeedKeyPair(privKey.subarray(0, 32))\n\n  const keyPair = {}\n  keyPair.secretKey = b4a.alloc(SKLEN)\n  keyPair.publicKey = b4a.alloc(PKLEN)\n\n  sodium.crypto_sign_keypair(keyPair.publicKey, keyPair.secretKey)\n  return keyPair\n}\n\nfunction generateSeedKeyPair (seed) {\n  const keyPair = {}\n  keyPair.secretKey = b4a.alloc(SKLEN)\n  keyPair.publicKey = b4a.alloc(PKLEN)\n\n  sodium.crypto_sign_seed_keypair(keyPair.publicKey, keyPair.secretKey, seed)\n  return keyPair\n}\n\nfunction dh (publicKey, { scalar, secretKey }) {\n  // tweaked keys expose scalar directly\n  if (!scalar) {\n    assert(secretKey.byteLength === SKLEN)\n\n    // libsodium stores seed not actual scalar\n    const sk = b4a.alloc(64)\n    sodium.crypto_hash_sha512(sk, secretKey.subarray(0, 32))\n    sk[0] &= 248\n    sk[31] &= 127\n    sk[31] |= 64\n\n    scalar = sk.subarray(0, 32)\n  }\n\n  assert(scalar.byteLength === SCALARLEN)\n  assert(publicKey.byteLength === PKLEN)\n\n  const output = b4a.alloc(DHLEN)\n\n  // we clamp if necessary above\n  sodium.crypto_scalarmult_ed25519_noclamp(\n    output,\n    scalar,\n    publicKey\n  )\n\n  return output\n}\n{\n  \"name\": \"noise-curve-ed\",\n  \"version\": \"2.1.0\",\n  \"description\": \"Ed25519 elliptic curve operations for [`noise-handshake`](https://github.com/chm-diederichs/noise-handshake)\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"npx standard && tape test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/chm-diederichs/noise-curve-ed.git\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"bugs\": {\n    \"url\": \"https://github.com/chm-diederichs/noise-curve-ed/issues\"\n  },\n  \"homepage\": \"https://github.com/chm-diederichs/noise-curve-ed#readme\",\n  \"dependencies\": {\n    \"b4a\": \"^1.1.0\",\n    \"nanoassert\": \"^2.0.0\",\n    \"sodium-universal\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"noise-handshake\": \"^3.0.0\",\n    \"standard\": \"^16.0.3\",\n    \"tape\": \"^5.2.2\"\n  }\n}\nconst sodium = require('sodium-universal')\nconst b4a = require('b4a')\n\nmodule.exports = class CipherState {\n  constructor (key) {\n    this.key = key || null\n    this.nonce = 0\n    this.CIPHER_ALG = 'ChaChaPoly'\n  }\n\n  initialiseKey (key) {\n    this.key = key\n    this.nonce = 0\n  }\n\n  setNonce (nonce) {\n    this.nonce = nonce\n  }\n\n  encrypt (plaintext, ad) {\n    if (!this.hasKey) return plaintext\n    if (!ad) ad = b4a.alloc(0)\n\n    const ciphertext = encryptWithAD(this.key, this.nonce, ad, plaintext)\n    if (ciphertext.length > 65535) throw new Error(`ciphertext length of ${ciphertext.length} exceeds maximum Noise message length of 65535`)\n    this.nonce++\n\n    return ciphertext\n  }\n\n  decrypt (ciphertext, ad) {\n    if (!this.hasKey) return ciphertext\n    if (!ad) ad = b4a.alloc(0)\n    if (ciphertext.length > 65535) throw new Error(`ciphertext length of ${ciphertext.length} exceeds maximum Noise message length of 65535`)\n\n    const plaintext = decryptWithAD(this.key, this.nonce, ad, ciphertext)\n    this.nonce++\n\n    return plaintext\n  }\n\n  get hasKey () {\n    return this.key !== null\n  }\n\n  _clear () {\n    sodium.sodium_memzero(this.key)\n    this.key = null\n    this.nonce = null\n  }\n\n  static get MACBYTES () {\n    return 16\n  }\n\n  static get NONCEBYTES () {\n    return 8\n  }\n\n  static get KEYBYTES () {\n    return 32\n  }\n}\n\nfunction encryptWithAD (key, counter, additionalData, plaintext) {\n  // for our purposes, additionalData will always be a pubkey so we encode from hex\n  if (!b4a.isBuffer(additionalData)) additionalData = b4a.from(additionalData, 'hex')\n  if (!b4a.isBuffer(plaintext)) plaintext = b4a.from(plaintext, 'hex')\n\n  const nonce = b4a.alloc(sodium.crypto_aead_chacha20poly1305_ietf_NPUBBYTES)\n  const view = new DataView(nonce.buffer, nonce.byteOffset, nonce.byteLength)\n  view.setUint32(4, counter, true)\n\n  const ciphertext = b4a.alloc(plaintext.byteLength + sodium.crypto_aead_chacha20poly1305_ietf_ABYTES)\n\n  sodium.crypto_aead_chacha20poly1305_ietf_encrypt(ciphertext, plaintext, additionalData, null, nonce, key)\n  return ciphertext\n}\n\nfunction decryptWithAD (key, counter, additionalData, ciphertext) {\n  // for our purposes, additionalData will always be a pubkey so we encode from hex\n  if (!b4a.isBuffer(additionalData)) additionalData = b4a.from(additionalData, 'hex')\n  if (!b4a.isBuffer(ciphertext)) ciphertext = b4a.from(ciphertext, 'hex')\n\n  const nonce = b4a.alloc(sodium.crypto_aead_chacha20poly1305_ietf_NPUBBYTES)\n  const view = new DataView(nonce.buffer, nonce.byteOffset, nonce.byteLength)\n  view.setUint32(4, counter, true)\n\n  const plaintext = b4a.alloc(ciphertext.byteLength - sodium.crypto_aead_chacha20poly1305_ietf_ABYTES)\n\n  sodium.crypto_aead_chacha20poly1305_ietf_decrypt(plaintext, null, ciphertext, additionalData, nonce, key)\n  return plaintext\n}\n/* eslint-disable camelcase */\nconst {\n  crypto_kx_SEEDBYTES,\n  crypto_kx_keypair,\n  crypto_kx_seed_keypair,\n  crypto_scalarmult_BYTES,\n  crypto_scalarmult_SCALARBYTES,\n  crypto_scalarmult,\n  crypto_scalarmult_base\n} = require('sodium-universal')\n\nconst assert = require('nanoassert')\nconst b4a = require('b4a')\n\nconst DHLEN = crypto_scalarmult_BYTES\nconst PKLEN = crypto_scalarmult_BYTES\nconst SKLEN = crypto_scalarmult_SCALARBYTES\nconst SEEDLEN = crypto_kx_SEEDBYTES\nconst ALG = '25519'\n\nmodule.exports = {\n  DHLEN,\n  PKLEN,\n  SKLEN,\n  SEEDLEN,\n  ALG,\n  generateKeyPair,\n  generateSeedKeyPair,\n  dh\n}\n\nfunction generateKeyPair (privKey) {\n  const keyPair = {}\n\n  keyPair.secretKey = privKey || b4a.alloc(SKLEN)\n  keyPair.publicKey = b4a.alloc(PKLEN)\n\n  if (privKey) {\n    crypto_scalarmult_base(keyPair.publicKey, keyPair.secretKey)\n  } else {\n    crypto_kx_keypair(keyPair.publicKey, keyPair.secretKey)\n  }\n\n  return keyPair\n}\n\nfunction generateSeedKeyPair (seed) {\n  assert(seed.byteLength === SKLEN)\n\n  const keyPair = {}\n  keyPair.secretKey = b4a.alloc(SKLEN)\n  keyPair.publicKey = b4a.alloc(PKLEN)\n\n  crypto_kx_seed_keypair(keyPair.publicKey, keyPair.secretKey, seed)\n  return keyPair\n}\n\nfunction dh (publicKey, { secretKey }) {\n  assert(secretKey.byteLength === SKLEN)\n  assert(publicKey.byteLength === PKLEN)\n\n  const output = b4a.alloc(DHLEN)\n\n  crypto_scalarmult(\n    output,\n    secretKey,\n    publicKey\n  )\n\n  return output\n}\nconst hmacBlake2b = require('./hmac')\nconst b4a = require('b4a')\n\nconst HASHLEN = 64\n\nmodule.exports = {\n  hkdf,\n  HASHLEN\n}\n\n// HMAC-based Extract-and-Expand KDF\n// https://www.ietf.org/rfc/rfc5869.txt\n\nfunction hkdf (salt, inputKeyMaterial, info = '', length = 2 * HASHLEN) {\n  const pseudoRandomKey = hkdfExtract(salt, inputKeyMaterial)\n  return hkdfExpand(pseudoRandomKey, info, length)\n}\n\nfunction hkdfExtract (salt, inputKeyMaterial) {\n  const hmac = b4a.alloc(HASHLEN)\n  return hmacDigest(hmac, salt, inputKeyMaterial)\n}\n\nfunction hkdfExpand (key, info, length) {\n  // Put in dedicated slab to avoid keeping shared slab from being gc'ed\n  const buffer = b4a.allocUnsafeSlow(length)\n\n  const infoBuf = b4a.from(info)\n  let prev = infoBuf\n\n  const result = []\n  for (let i = 0; i < length; i += HASHLEN) {\n    const pos = b4a.from([(i / HASHLEN) + 1])\n\n    const out = buffer.subarray(i, i + HASHLEN)\n    result.push(out)\n\n    prev = hmacDigest(out, key, [prev, infoBuf, pos])\n  }\n\n  return result\n}\n\nfunction hmacDigest (out, key, input) {\n  hmacBlake2b(out, input, key)\n  return out\n}\n/* eslint-disable camelcase */\nconst b4a = require('b4a')\nconst { sodium_memzero, crypto_generichash, crypto_generichash_batch } = require('sodium-universal')\n\nconst HASHLEN = 64\nconst BLOCKLEN = 128\nconst scratch = b4a.alloc(BLOCKLEN * 3)\nconst HMACKey = scratch.subarray(BLOCKLEN * 0, BLOCKLEN * 1)\nconst OuterKeyPad = scratch.subarray(BLOCKLEN * 1, BLOCKLEN * 2)\nconst InnerKeyPad = scratch.subarray(BLOCKLEN * 2, BLOCKLEN * 3)\n\n// Post-fill is done in the cases where someone caught an exception that\n// happened before we were able to clear data at the end\n\nmodule.exports = function hmac (out, batch, key) {\n  if (key.byteLength > BLOCKLEN) {\n    crypto_generichash(HMACKey.subarray(0, HASHLEN), key)\n    sodium_memzero(HMACKey.subarray(HASHLEN))\n  } else {\n    // Covers key <= BLOCKLEN\n    HMACKey.set(key)\n    sodium_memzero(HMACKey.subarray(key.byteLength))\n  }\n\n  for (let i = 0; i < HMACKey.byteLength; i++) {\n    OuterKeyPad[i] = 0x5c ^ HMACKey[i]\n    InnerKeyPad[i] = 0x36 ^ HMACKey[i]\n  }\n  sodium_memzero(HMACKey)\n\n  crypto_generichash_batch(out, [InnerKeyPad].concat(batch))\n  sodium_memzero(InnerKeyPad)\n  crypto_generichash_batch(out, [OuterKeyPad, out])\n  sodium_memzero(OuterKeyPad)\n}\n\nmodule.exports.BYTES = HASHLEN\nmodule.exports.KEYBYTES = BLOCKLEN\nconst assert = require('nanoassert')\nconst b4a = require('b4a')\n\nconst SymmetricState = require('./symmetric-state')\nconst { HASHLEN } = require('./hkdf')\n\nconst PRESHARE_IS = Symbol('initiator static key preshared')\nconst PRESHARE_RS = Symbol('responder static key preshared')\n\nconst TOK_PSK = Symbol('psk')\n\nconst TOK_S = Symbol('s')\nconst TOK_E = Symbol('e')\n\nconst TOK_ES = Symbol('es')\nconst TOK_SE = Symbol('se')\nconst TOK_EE = Symbol('ee')\nconst TOK_SS = Symbol('ss')\n\nconst HANDSHAKES = Object.freeze({\n  NN: [\n    [TOK_E],\n    [TOK_E, TOK_EE]\n  ],\n  NNpsk0: [\n    [TOK_PSK, TOK_E],\n    [TOK_E, TOK_EE]\n  ],\n  XX: [\n    [TOK_E],\n    [TOK_E, TOK_EE, TOK_S, TOK_ES],\n    [TOK_S, TOK_SE]\n  ],\n  XXpsk0: [\n    [TOK_PSK, TOK_E],\n    [TOK_E, TOK_EE, TOK_S, TOK_ES],\n    [TOK_S, TOK_SE]\n  ],\n  IK: [\n    PRESHARE_RS,\n    [TOK_E, TOK_ES, TOK_S, TOK_SS],\n    [TOK_E, TOK_EE, TOK_SE]\n  ],\n  XK: [\n    PRESHARE_RS,\n    [TOK_E, TOK_ES],\n    [TOK_E, TOK_EE],\n    [TOK_S, TOK_SE]\n  ]\n})\n\nclass Writer {\n  constructor () {\n    this.size = 0\n    this.buffers = []\n  }\n\n  push (b) {\n    this.size += b.byteLength\n    this.buffers.push(b)\n  }\n\n  end () {\n    const all = b4a.alloc(this.size)\n    let offset = 0\n    for (const b of this.buffers) {\n      all.set(b, offset)\n      offset += b.byteLength\n    }\n    return all\n  }\n}\n\nclass Reader {\n  constructor (buf) {\n    this.offset = 0\n    this.buffer = buf\n  }\n\n  shift (n) {\n    const start = this.offset\n    const end = this.offset += n\n    if (end > this.buffer.byteLength) throw new Error('Insufficient bytes')\n    return this.buffer.subarray(start, end)\n  }\n\n  end () {\n    return this.shift(this.buffer.byteLength - this.offset)\n  }\n}\n\nmodule.exports = class NoiseState extends SymmetricState {\n  constructor (pattern, initiator, staticKeypair, opts = {}) {\n    super(opts)\n\n    this.s = staticKeypair || this.curve.generateKeyPair()\n    this.e = null\n\n    this.psk = null\n    if (opts && opts.psk) this.psk = opts.psk\n\n    this.re = null\n    this.rs = null\n\n    this.pattern = pattern\n    this.handshake = HANDSHAKES[this.pattern].slice()\n\n    this.isPskHandshake = !!this.psk && hasPskToken(this.handshake)\n\n    this.protocol = b4a.from([\n      'Noise',\n      this.pattern,\n      this.DH_ALG,\n      this.CIPHER_ALG,\n      'BLAKE2b'\n    ].join('_'))\n\n    this.initiator = initiator\n    this.complete = false\n\n    this.rx = null\n    this.tx = null\n    this.hash = null\n  }\n\n  initialise (prologue, remoteStatic) {\n    if (this.protocol.byteLength <= HASHLEN) this.digest.set(this.protocol)\n    else this.mixHash(this.protocol)\n\n    this.chainingKey = b4a.from(this.digest)\n\n    this.mixHash(prologue)\n\n    while (!Array.isArray(this.handshake[0])) {\n      const message = this.handshake.shift()\n\n      // handshake steps should be as arrays, only\n      // preshare tokens are provided otherwise\n      assert(message === PRESHARE_RS || message === PRESHARE_IS,\n        'Unexpected pattern')\n\n      const takeRemoteKey = this.initiator\n        ? message === PRESHARE_RS\n        : message === PRESHARE_IS\n\n      if (takeRemoteKey) this.rs = remoteStatic\n\n      const key = takeRemoteKey ? this.rs : this.s.publicKey\n      assert(key != null, 'Remote pubkey required')\n\n      this.mixHash(key)\n    }\n  }\n\n  final () {\n    const [k1, k2] = this.split()\n\n    this.tx = this.initiator ? k1 : k2\n    this.rx = this.initiator ? k2 : k1\n\n    this.complete = true\n    this.hash = this.getHandshakeHash()\n\n    this._clear()\n  }\n\n  recv (buf) {\n    const r = new Reader(buf)\n\n    for (const pattern of this.handshake.shift()) {\n      switch (pattern) {\n        case TOK_PSK :\n          this.mixKeyAndHash(this.psk)\n          break\n\n        case TOK_E :\n          this.re = r.shift(this.curve.PKLEN)\n          this.mixHash(this.re)\n          if (this.isPskHandshake) this.mixKeyNormal(this.re)\n          break\n\n        case TOK_S : {\n          const klen = this.hasKey ? this.curve.PKLEN + 16 : this.curve.PKLEN\n          this.rs = this.decryptAndHash(r.shift(klen))\n          break\n        }\n\n        case TOK_EE :\n        case TOK_ES :\n        case TOK_SE :\n        case TOK_SS : {\n          const useStatic = keyPattern(pattern, this.initiator)\n\n          const localKey = useStatic.local ? this.s : this.e\n          const remoteKey = useStatic.remote ? this.rs : this.re\n\n          this.mixKey(remoteKey, localKey)\n          break\n        }\n\n        default :\n          throw new Error('Unexpected message')\n      }\n    }\n\n    const payload = this.decryptAndHash(r.end())\n\n    if (!this.handshake.length) this.final()\n    return payload\n  }\n\n  send (payload = b4a.alloc(0)) {\n    const w = new Writer()\n\n    for (const pattern of this.handshake.shift()) {\n      switch (pattern) {\n        case TOK_PSK :\n          this.mixKeyAndHash(this.psk)\n          break\n\n        case TOK_E :\n          if (this.e === null) this.e = this.curve.generateKeyPair()\n          this.mixHash(this.e.publicKey)\n          if (this.isPskHandshake) this.mixKeyNormal(this.e.publicKey)\n          w.push(this.e.publicKey)\n          break\n\n        case TOK_S :\n          w.push(this.encryptAndHash(this.s.publicKey))\n          break\n\n        case TOK_ES :\n        case TOK_SE :\n        case TOK_EE :\n        case TOK_SS : {\n          const useStatic = keyPattern(pattern, this.initiator)\n\n          const localKey = useStatic.local ? this.s : this.e\n          const remoteKey = useStatic.remote ? this.rs : this.re\n\n          this.mixKey(remoteKey, localKey)\n          break\n        }\n\n        default :\n          throw new Error('Unexpected message')\n      }\n    }\n\n    w.push(this.encryptAndHash(payload))\n    const response = w.end()\n\n    if (!this.handshake.length) this.final()\n    return response\n  }\n\n  _clear () {\n    super._clear()\n\n    this.e.secretKey.fill(0)\n    this.e.publicKey.fill(0)\n\n    this.re.fill(0)\n\n    this.e = null\n    this.re = null\n  }\n}\n\nfunction keyPattern (pattern, initiator) {\n  const ret = {\n    local: false,\n    remote: false\n  }\n\n  switch (pattern) {\n    case TOK_EE:\n      return ret\n\n    case TOK_ES:\n      ret.local ^= !initiator\n      ret.remote ^= initiator\n      return ret\n\n    case TOK_SE:\n      ret.local ^= initiator\n      ret.remote ^= !initiator\n      return ret\n\n    case TOK_SS:\n      ret.local ^= 1\n      ret.remote ^= 1\n      return ret\n  }\n}\n\nfunction hasPskToken (handshake) {\n  return handshake.some(x => {\n    return Array.isArray(x) && x.indexOf(TOK_PSK) !== -1\n  })\n}\n{\n  \"name\": \"noise-handshake\",\n  \"version\": \"4.2.0\",\n  \"description\": \"Noise protocol handshake\",\n  \"main\": \"noise.js\",\n  \"files\": [\n    \"*.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"standard && brittle test/*.js\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/noise-handshake.git\"\n  },\n  \"dependencies\": {\n    \"b4a\": \"^1.1.0\",\n    \"nanoassert\": \"^2.0.0\",\n    \"sodium-universal\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"noise-protocol\": \"chm-diederichs/noise-protocol.git#xx-ephemeral-key\",\n    \"standard\": \"^16.0.3\"\n  }\n}\nconst sodium = require('sodium-universal')\nconst assert = require('nanoassert')\nconst b4a = require('b4a')\nconst CipherState = require('./cipher')\nconst curve = require('./dh')\nconst { HASHLEN, hkdf } = require('./hkdf')\n\nmodule.exports = class SymmetricState extends CipherState {\n  constructor (opts = {}) {\n    super()\n\n    this.curve = opts.curve || curve\n    this.digest = b4a.alloc(HASHLEN)\n    this.chainingKey = null\n    this.offset = 0\n\n    this.DH_ALG = this.curve.ALG\n  }\n\n  mixHash (data) {\n    accumulateDigest(this.digest, data)\n  }\n\n  mixKeyAndHash (key) {\n    const [ck, tempH, tempK] = hkdf(this.chainingKey, key, '', 3 * HASHLEN)\n    this.chainingKey = ck\n    this.mixHash(tempH)\n    this.initialiseKey(tempK.subarray(0, 32))\n  }\n\n  mixKeyNormal (key) {\n    const [ck, tempK] = hkdf(this.chainingKey, key)\n    this.chainingKey = ck\n    this.initialiseKey(tempK.subarray(0, 32))\n  }\n\n  mixKey (remoteKey, localKey) {\n    const dh = this.curve.dh(remoteKey, localKey)\n    const hkdfResult = hkdf(this.chainingKey, dh)\n    this.chainingKey = hkdfResult[0]\n    this.initialiseKey(hkdfResult[1].subarray(0, 32))\n  }\n\n  encryptAndHash (plaintext) {\n    const ciphertext = this.encrypt(plaintext, this.digest)\n    accumulateDigest(this.digest, ciphertext)\n    return ciphertext\n  }\n\n  decryptAndHash (ciphertext) {\n    const plaintext = this.decrypt(ciphertext, this.digest)\n    accumulateDigest(this.digest, ciphertext)\n    return plaintext\n  }\n\n  getHandshakeHash (out) {\n    if (!out) return this.getHandshakeHash(b4a.alloc(HASHLEN))\n    assert(out.byteLength === HASHLEN, `output must be ${HASHLEN} bytes`)\n\n    out.set(this.digest)\n    return out\n  }\n\n  split () {\n    const res = hkdf(this.chainingKey, b4a.alloc(0))\n    return res.map(k => k.subarray(0, 32))\n  }\n\n  _clear () {\n    super._clear()\n\n    sodium.sodium_memzero(this.digest)\n    sodium.sodium_memzero(this.chainingKey)\n\n    this.digest = null\n    this.chainingKey = null\n    this.offset = null\n\n    this.curve = null\n  }\n\n  static get alg () {\n    return CipherState.alg + '_BLAKE2b'\n  }\n}\n\nfunction accumulateDigest (digest, input) {\n  const toHash = b4a.concat([digest, input])\n  sodium.crypto_generichash(digest, toHash)\n}\nimport Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tvalidateConcurrency(concurrency);\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst resumeNext = () => {\n\t\t// Process the next queued function if we're under the concurrency limit\n\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\tactiveCount++;\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst next = () => {\n\t\tactiveCount--;\n\t\tresumeNext();\n\t};\n\n\tconst run = async (function_, resolve, arguments_) => {\n\t\t// Execute the function and capture the result promise\n\t\tconst result = (async () => function_(...arguments_))();\n\n\t\t// Resolve immediately with the promise (don't wait for completion)\n\t\tresolve(result);\n\n\t\t// Wait for the function to complete (success or failure)\n\t\t// We catch errors here to prevent unhandled rejections,\n\t\t// but the original promise rejection is preserved for the caller\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\t// Decrement active count and process next queued function\n\t\tnext();\n\t};\n\n\tconst enqueue = (function_, resolve, arguments_) => {\n\t\t// Queue the internal resolve function instead of the run function\n\t\t// to preserve the asynchronous execution context.\n\t\tnew Promise(internalResolve => { // eslint-disable-line promise/param-names\n\t\t\tqueue.enqueue(internalResolve);\n\t\t}).then(run.bind(undefined, function_, resolve, arguments_)); // eslint-disable-line promise/prefer-await-to-then\n\n\t\t// Start processing immediately if we haven't reached the concurrency limit\n\t\tif (activeCount < concurrency) {\n\t\t\tresumeNext();\n\t\t}\n\t};\n\n\tconst generator = (function_, ...arguments_) => new Promise(resolve => {\n\t\tenqueue(function_, resolve, arguments_);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue() {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t\tconcurrency: {\n\t\t\tget: () => concurrency,\n\n\t\t\tset(newConcurrency) {\n\t\t\t\tvalidateConcurrency(newConcurrency);\n\t\t\t\tconcurrency = newConcurrency;\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t// eslint-disable-next-line no-unmodified-loop-condition\n\t\t\t\t\twhile (activeCount < concurrency && queue.size > 0) {\n\t\t\t\t\t\tresumeNext();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t},\n\t\tmap: {\n\t\t\tasync value(array, function_) {\n\t\t\t\tconst promises = array.map((value, index) => this(function_, value, index));\n\t\t\t\treturn Promise.all(promises);\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n\nexport function limitFunction(function_, options) {\n\tconst {concurrency} = options;\n\tconst limit = pLimit(concurrency);\n\n\treturn (...arguments_) => limit(() => function_(...arguments_));\n}\n\nfunction validateConcurrency(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n}\n{\n\t\"name\": \"p-limit\",\n\t\"version\": \"7.1.1\",\n\t\"description\": \"Run multiple promise-returning & async functions with limited concurrency\",\n\t\"license\": \"MIT\",\n\t\"repository\": \"sindresorhus/p-limit\",\n\t\"funding\": \"https://github.com/sponsors/sindresorhus\",\n\t\"author\": {\n\t\t\"name\": \"Sindre Sorhus\",\n\t\t\"email\": \"sindresorhus@gmail.com\",\n\t\t\"url\": \"https://sindresorhus.com\"\n\t},\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\"types\": \"./index.d.ts\",\n\t\t\"default\": \"./index.js\"\n\t},\n\t\"sideEffects\": false,\n\t\"engines\": {\n\t\t\"node\": \">=20\"\n\t},\n\t\"scripts\": {\n\t\t\"test\": \"xo && ava && tsd\",\n\t\t\"benchmark\": \"node benchmark.js\"\n\t},\n\t\"files\": [\n\t\t\"index.js\",\n\t\t\"index.d.ts\"\n\t],\n\t\"keywords\": [\n\t\t\"promise\",\n\t\t\"limit\",\n\t\t\"limited\",\n\t\t\"concurrency\",\n\t\t\"throttle\",\n\t\t\"throat\",\n\t\t\"rate\",\n\t\t\"batch\",\n\t\t\"ratelimit\",\n\t\t\"task\",\n\t\t\"queue\",\n\t\t\"async\",\n\t\t\"await\",\n\t\t\"promises\",\n\t\t\"bluebird\"\n\t],\n\t\"dependencies\": {\n\t\t\"yocto-queue\": \"^1.2.1\"\n\t},\n\t\"devDependencies\": {\n\t\t\"ava\": \"^6.4.1\",\n\t\t\"delay\": \"^6.0.0\",\n\t\t\"in-range\": \"^3.0.0\",\n\t\t\"random-int\": \"^3.0.0\",\n\t\t\"time-span\": \"^5.1.0\",\n\t\t\"tsd\": \"^0.33.0\",\n\t\t\"xo\": \"^1.2.1\"\n\t}\n}\nvar varint = require('varint')\nvar svarint = require('signed-varint')\nvar b4a = require('b4a')\n\nexports.make = encoder\n\nexports.name = function (enc) {\n  var keys = Object.keys(exports)\n  for (var i = 0; i < keys.length; i++) {\n    if (exports[keys[i]] === enc) return keys[i]\n  }\n  return null\n}\n\nexports.skip = function (type, buffer, offset) {\n  switch (type) {\n    case 0:\n      varint.decode(buffer, offset)\n      return offset + varint.decode.bytes\n\n    case 1:\n      return offset + 8\n\n    case 2:\n      var len = varint.decode(buffer, offset)\n      return offset + varint.decode.bytes + len\n\n    case 3:\n    case 4:\n      throw new Error('Groups are not supported')\n\n    case 5:\n      return offset + 4\n  }\n\n  throw new Error('Unknown wire type: ' + type)\n}\n\nexports.bytes = encoder(2,\n  function encode (val, buffer, offset) {\n    var oldOffset = offset\n    var len = bufferLength(val)\n\n    varint.encode(len, buffer, offset)\n    offset += varint.encode.bytes\n\n    if (b4a.isBuffer(val)) b4a.copy(val, buffer, offset)\n    else b4a.write(buffer, val, offset, len)\n    offset += len\n\n    encode.bytes = offset - oldOffset\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var oldOffset = offset\n\n    var len = varint.decode(buffer, offset)\n    offset += varint.decode.bytes\n\n    var val = buffer.subarray(offset, offset + len)\n    offset += val.length\n\n    decode.bytes = offset - oldOffset\n    return val\n  },\n  function encodingLength (val) {\n    var len = bufferLength(val)\n    return varint.encodingLength(len) + len\n  }\n)\n\nexports.string = encoder(2,\n  function encode (val, buffer, offset) {\n    var oldOffset = offset\n    var len = b4a.byteLength(val)\n\n    varint.encode(len, buffer, offset, 'utf-8')\n    offset += varint.encode.bytes\n\n    b4a.write(buffer, val, offset, len)\n    offset += len\n\n    encode.bytes = offset - oldOffset\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var oldOffset = offset\n\n    var len = varint.decode(buffer, offset)\n    offset += varint.decode.bytes\n\n    var val = b4a.toString(buffer, 'utf-8', offset, offset + len)\n    offset += len\n\n    decode.bytes = offset - oldOffset\n    return val\n  },\n  function encodingLength (val) {\n    var len = b4a.byteLength(val)\n    return varint.encodingLength(len) + len\n  }\n)\n\nexports.bool = encoder(0,\n  function encode (val, buffer, offset) {\n    buffer[offset] = val ? 1 : 0\n    encode.bytes = 1\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var bool = buffer[offset] > 0\n    decode.bytes = 1\n    return bool\n  },\n  function encodingLength () {\n    return 1\n  }\n)\n\nexports.int32 = encoder(0,\n  function encode (val, buffer, offset) {\n    varint.encode(val < 0 ? val + 4294967296 : val, buffer, offset)\n    encode.bytes = varint.encode.bytes\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var val = varint.decode(buffer, offset)\n    decode.bytes = varint.decode.bytes\n    return val > 2147483647 ? val - 4294967296 : val\n  },\n  function encodingLength (val) {\n    return varint.encodingLength(val < 0 ? val + 4294967296 : val)\n  }\n)\n\nexports.int64 = encoder(0,\n  function encode (val, buffer, offset) {\n    if (val < 0) {\n      var last = offset + 9\n      varint.encode(val * -1, buffer, offset)\n      offset += varint.encode.bytes - 1\n      buffer[offset] = buffer[offset] | 0x80\n      while (offset < last - 1) {\n        offset++\n        buffer[offset] = 0xff\n      }\n      buffer[last] = 0x01\n      encode.bytes = 10\n    } else {\n      varint.encode(val, buffer, offset)\n      encode.bytes = varint.encode.bytes\n    }\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var val = varint.decode(buffer, offset)\n    if (val >= Math.pow(2, 63)) {\n      var limit = 9\n      while (buffer[offset + limit - 1] === 0xff) limit--\n      limit = limit || 9\n      var subset = b4a.allocUnsafe(limit)\n      b4a.copy(buffer, subset, 0, offset, offset + limit)\n      subset[limit - 1] = subset[limit - 1] & 0x7f\n      val = -1 * varint.decode(subset, 0)\n      decode.bytes = 10\n    } else {\n      decode.bytes = varint.decode.bytes\n    }\n    return val\n  },\n  function encodingLength (val) {\n    return val < 0 ? 10 : varint.encodingLength(val)\n  }\n)\n\nexports.sint32 =\nexports.sint64 = encoder(0,\n  svarint.encode,\n  svarint.decode,\n  svarint.encodingLength\n)\n\nexports.uint32 =\nexports.uint64 =\nexports.enum =\nexports.varint = encoder(0,\n  varint.encode,\n  varint.decode,\n  varint.encodingLength\n)\n\n// we cannot represent these in javascript so we just use buffers\nexports.fixed64 =\nexports.sfixed64 = encoder(1,\n  function encode (val, buffer, offset) {\n    b4a.copy(val, buffer, offset)\n    encode.bytes = 8\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var val = buffer.subarray(offset, offset + 8)\n    decode.bytes = 8\n    return val\n  },\n  function encodingLength () {\n    return 8\n  }\n)\n\nexports.double = encoder(1,\n  function encode (val, buffer, offset) {\n    b4a.writeDoubleLE(buffer, val, offset)\n    encode.bytes = 8\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var val = b4a.readDoubleLE(buffer, offset)\n    decode.bytes = 8\n    return val\n  },\n  function encodingLength () {\n    return 8\n  }\n)\n\nexports.fixed32 = encoder(5,\n  function encode (val, buffer, offset) {\n    b4a.writeUInt32LE(buffer, val, offset)\n    encode.bytes = 4\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var val = b4a.readUInt32LE(buffer, offset)\n    decode.bytes = 4\n    return val\n  },\n  function encodingLength () {\n    return 4\n  }\n)\n\nexports.sfixed32 = encoder(5,\n  function encode (val, buffer, offset) {\n    b4a.writeInt32LE(buffer, val, offset)\n    encode.bytes = 4\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var val = b4a.readInt32LE(buffer, offset)\n    decode.bytes = 4\n    return val\n  },\n  function encodingLength () {\n    return 4\n  }\n)\n\nexports.float = encoder(5,\n  function encode (val, buffer, offset) {\n    b4a.writeFloatLE(buffer, val, offset)\n    encode.bytes = 4\n    return buffer\n  },\n  function decode (buffer, offset) {\n    var val = b4a.readFloatLE(buffer, offset)\n    decode.bytes = 4\n    return val\n  },\n  function encodingLength () {\n    return 4\n  }\n)\n\nfunction encoder (type, encode, decode, encodingLength) {\n  encode.bytes = decode.bytes = 0\n\n  return {\n    type: type,\n    encode: encode,\n    decode: decode,\n    encodingLength: encodingLength\n  }\n}\n\nfunction bufferLength (val) {\n  return b4a.isBuffer(val) ? val.length : b4a.byteLength(val)\n}\n{\n  \"name\": \"protocol-buffers-encodings\",\n  \"version\": \"1.2.0\",\n  \"description\": \"Base encodings for protocol-buffers\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.0\",\n    \"signed-varint\": \"^2.0.1\",\n    \"varint\": \"5.0.0\"\n  },\n  \"devDependencies\": {\n    \"standard\": \"^14.3.4\",\n    \"tape\": \"^5.0.1\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && tape test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/protocol-buffers-encodings.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/protocol-buffers-encodings/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/protocol-buffers-encodings\"\n}\nconst crypto = require('hypercore-crypto')\nconst Protomux = require('protomux')\nconst b4a = require('b4a')\nconst schema = require('./spec/hyperschema')\n\nconst [NS_INITATOR, NS_RESPONDER] = crypto.namespace('wakeup', 2)\n\nconst Handshake = schema.getEncoding('@wakeup/handshake')\nconst Announce = schema.getEncoding('@wakeup/announce')\nconst Lookup = schema.getEncoding('@wakeup/lookup')\nconst Info = schema.getEncoding('@wakeup/info')\n\nmodule.exports = class WakeupSwarm {\n  constructor(onwakeup = noop, { gcTickTime = 2000 } = {}) {\n    this.gcTickTime = gcTickTime\n\n    this.topics = new Map()\n    this.topicsGC = new Set()\n    this.muxers = new Set()\n    this.stats = {\n      sessionsOpened: 0,\n      sessionsClosed: 0,\n      topicsAdded: 0,\n      topicsGcd: 0,\n      peersAdded: 0,\n      peersRemoved: 0,\n      wireAnnounce: { rx: 0, tx: 0 },\n      wireLookup: { rx: 0, tx: 0 },\n      wireInfo: { rx: 0, tx: 0 }\n    }\n\n    this.onwakeup = onwakeup\n\n    this._gcInterval = null\n    this._gcBound = this._gc.bind(this)\n  }\n\n  session(capability, handlers = {}) {\n    const id = handlers.discoveryKey || crypto.discoveryKey(capability)\n    const active = handlers.active !== false\n    const hex = b4a.toString(id, 'hex')\n\n    let w = this.topics.get(hex)\n\n    if (w) return w.addSession(handlers)\n\n    w = new WakeupTopic(this, id, capability, active)\n\n    this.topics.set(hex, w)\n\n    for (const muxer of this.muxers) {\n      w._onopen(muxer, true)\n    }\n\n    return w.addSession(handlers)\n  }\n\n  getSessions(capability, handlers = {}) {\n    const id = handlers.discoveryKey || crypto.discoveryKey(capability)\n    const hex = b4a.toString(id, 'hex')\n    const w = this.topics.get(hex)\n    return w ? w.sessions : []\n  }\n\n  hasStream(stream, capability, handlers = {}) {\n    if (!capability) {\n      const noiseStream = stream.noiseStream || stream\n      return this.muxers.has(getMuxer(noiseStream))\n    }\n\n    const id = handlers.discoveryKey || crypto.discoveryKey(capability)\n    const hex = b4a.toString(id, 'hex')\n    const t = this.topics.get(hex)\n\n    return t ? t.peersByStream.has(stream) : false\n  }\n\n  addStream(stream) {\n    const noiseStream = stream.noiseStream || stream\n\n    if (!noiseStream.connected) {\n      noiseStream.once('open', this.addStream.bind(this, noiseStream))\n      return\n    }\n\n    const muxer = getMuxer(noiseStream)\n    muxer.pair({ protocol: 'wakeup' }, (id) => this._onpair(id, muxer))\n\n    this.muxers.add(muxer)\n    noiseStream.on('close', () => this.muxers.delete(muxer))\n\n    for (const w of this.topics.values()) {\n      if (!w.isActive) continue\n      w._onopen(muxer, true)\n    }\n  }\n\n  _onActive(w) {\n    for (const m of this.muxers) {\n      w._onopen(m, false)\n    }\n  }\n\n  _addGC(topic) {\n    if (topic.destroyed) return\n    this.topicsGC.add(topic)\n    if (this._gcInterval === null) {\n      this._gcInterval = setInterval(this._gcBound, this.gcTickTime)\n    }\n  }\n\n  _removeGC(topic) {\n    this.topicsGC.delete(topic)\n    if (this.topicsGC.size === 0 && this._gcInterval) {\n      clearInterval(this._gcInterval)\n      this._gcInterval = null\n    }\n  }\n\n  _gc() {\n    const destroy = []\n    for (const w of this.topicsGC) {\n      w.idleTicks++\n      if (w.idleTicks >= 5) destroy.push(w)\n    }\n    for (const w of destroy) w.teardown()\n  }\n\n  destroy() {\n    if (this._gcInterval) clearInterval(this._gcInterval)\n    this._gcInterval = null\n\n    for (const w of this.topics.values()) w.teardown()\n  }\n\n  async _onpair(id, stream) {\n    const hex = b4a.toString(id, 'hex')\n    const w = this.topics.get(hex)\n    if (!w || !w.sessions.length) return this.onwakeup(id, stream)\n    w._onopen(getMuxer(stream), false)\n  }\n\n  registerMetrics(promClient) {\n    const self = this\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_sessions_opened',\n      help: 'The amount of sessions opened by protomux wakeup',\n      collect() {\n        this.set(self.stats.sessionsOpened)\n      }\n    })\n\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_sessions_closed',\n      help: 'The amount of sessions closed by protomux wakeup',\n      collect() {\n        this.set(self.stats.sessionsClosed)\n      }\n    })\n\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_topics_added',\n      help: 'The amount of topics added to protomux wakeup',\n      collect() {\n        this.set(self.stats.topicsAdded)\n      }\n    })\n\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_topics_gcd',\n      help: 'The amount of topics that got garbage collected by protomux wakeup',\n      collect() {\n        this.set(self.stats.topicsGcd)\n      }\n    })\n\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_peers_added',\n      help: 'The amount of peers added by protomux wakeup, across all topics',\n      collect() {\n        this.set(self.stats.peersAdded)\n      }\n    })\n\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_peers_removed',\n      help: 'The amount of peers removed by protomux wakeup, across all topics',\n      collect() {\n        this.set(self.stats.peersRemoved)\n      }\n    })\n\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_wire_announce_rx',\n      help: 'The amount of wire announce messages received by protomux wakeup',\n      collect() {\n        this.set(self.stats.wireAnnounce.rx)\n      }\n    })\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_wire_announce_tx',\n      help: 'The amount of wire announce messages transmitted by protomux wakeup',\n      collect() {\n        this.set(self.stats.wireAnnounce.tx)\n      }\n    })\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_wire_lookup_rx',\n      help: 'The amount of wire lookup messages received by protomux wakeup',\n      collect() {\n        this.set(self.stats.wireLookup.rx)\n      }\n    })\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_wire_lookup_tx',\n      help: 'The amount of wire lookup messages transmitted by protomux wakeup',\n      collect() {\n        this.set(self.stats.wireLookup.tx)\n      }\n    })\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_wire_info_rx',\n      help: 'The amount of wire info messages received by protomux wakeup',\n      collect() {\n        this.set(self.stats.wireInfo.rx)\n      }\n    })\n    new promClient.Gauge({\n      // eslint-disable-line no-new\n      name: 'protomux_wakeup_wire_info_tx',\n      help: 'The amount of wire info messages transmitted by protomux wakeup',\n      collect() {\n        this.set(self.stats.wireInfo.rx)\n      }\n    })\n  }\n}\n\nclass WakeupPeer {\n  constructor(topic) {\n    this.index = 0\n    this.userData = null // for the user\n    this.clock = 0 // for the user, v useful to reduce traffic\n    this.pending = true\n    this.removed = false\n    this.topic = topic\n    this.channel = null\n    this.stream = null\n    this.wireLookup = null\n    this.wireAnnounce = null\n    this.wireInfo = null\n    this.active = false\n  }\n\n  unlink(list) {\n    // note that since we pop here we can iterate in reverse safely in case a peer is removed in the same tick\n    const head = list.pop()\n    if (head === this) return\n    head.index = this.index\n    list[head.index] = head\n  }\n}\n\nclass WakeupSession {\n  constructor(topic, handlers) {\n    this.index = 0\n    this.topic = topic\n    this.handlers = handlers\n    this.isActive = handlers.active !== false\n    this.destroyed = false\n  }\n\n  get peers() {\n    return this.topic.peers\n  }\n\n  hasStream(stream) {\n    return !!this.getPeer(stream)\n  }\n\n  addStream(stream) {\n    this.topic.addStream(stream)\n  }\n\n  getPeer(stream) {\n    return this.topic.peersByStream.get(stream) || null\n  }\n\n  broadcastLookup(req) {\n    for (const peer of this.topic.pendingPeers) {\n      this.lookup(peer, req)\n    }\n    for (const peer of this.topic.peers) {\n      this.lookup(peer, req)\n    }\n  }\n\n  lookupByStream(stream, req) {\n    const peer = this.topic.peersByStream.get(stream)\n    if (peer) this.lookup(peer, req)\n  }\n\n  lookup(peer, req) {\n    peer.topic.state.stats.wireLookup.tx++\n    peer.wireLookup.send(req || { hash: null })\n  }\n\n  announceByStream(stream, wakeup) {\n    const peer = this.topic.peersByStream.get(stream)\n    if (peer && !peer.pending) this.announce(peer, wakeup)\n  }\n\n  announce(peer, wakeup) {\n    peer.topic.state.stats.wireAnnounce.tx++\n    peer.wireAnnounce.send(wakeup)\n  }\n\n  active() {\n    this.isActive = true\n    this.topic._bumpActivity()\n  }\n\n  inactive() {\n    this.isActive = false\n    this.topic._bumpActivity()\n  }\n\n  destroy() {\n    if (this.destroyed) return\n    this.destroyed = true\n    this.topic.removeSession(this)\n  }\n}\n\nclass WakeupTopic {\n  constructor(state, id, capability, active) {\n    this.state = state\n    this.sessions = []\n    this.id = id\n    this.capability = capability\n    this.peers = []\n    this.pendingPeers = []\n    this.peersByStream = new Map()\n    this.activePeers = 0\n    this.isActive = active\n    this.idleTicks = 0\n    this.gcing = false\n    this.destroyed = false\n\n    this.state.stats.topicsAdded++\n  }\n\n  addSession(handlers) {\n    this.state.stats.sessionsOpened++\n    const session = new WakeupSession(this, handlers)\n    session.index = this.sessions.length\n    this.sessions.push(session)\n    this._bumpActivity()\n    this._checkGC()\n    return session\n  }\n\n  removeSession(session) {\n    if (this.sessions.length <= session.index) return\n    if (this.sessions[session.index] !== session) return\n\n    this.state.stats.sessionsClosed++\n\n    // same as with the peer, this allows us to iterate while removing if iterating backwards\n    const head = this.sessions.pop()\n    if (head !== session) {\n      head.index = session.index\n      this.sessions[head.index] = head\n    }\n\n    this._bumpActivity()\n    this._checkGC()\n  }\n\n  _bumpActivity() {\n    let isActive = false\n\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      if (this.sessions[i].isActive) {\n        isActive = true\n        break\n      }\n    }\n\n    if (isActive) this.active()\n    else this.inactive()\n  }\n\n  active() {\n    if (this.isActive) return\n    this.idleTicks = 0\n    this.isActive = true\n    this._updateActive(true)\n  }\n\n  inactive() {\n    if (!this.isActive) return\n    this.isActive = false\n    this._updateActive(false)\n  }\n\n  _updateActive(active) {\n    const info = { active }\n\n    for (const peer of this.pendingPeers) {\n      peer.topic.state.stats.wireInfo.tx++\n      peer.wireInfo.send(info)\n    }\n    for (const peer of this.peers) {\n      peer.topic.state.stats.wireInfo.tx++\n      peer.wireInfo.send(info)\n    }\n\n    this._checkGC()\n\n    if (active) this.state._onActive(this)\n  }\n\n  teardown() {\n    if (this.destroyed) return\n    this.destroyed = true\n\n    this.state.stats.topicsGcd++\n\n    for (let i = this.peers.length - 1; i >= 0; i--) {\n      this.peers[i].channel.close()\n    }\n\n    for (let i = this.pendingPeers.length - 1; i >= 0; i--) {\n      this.pendingPeers[i].channel.close()\n    }\n\n    const hex = b4a.toString(this.id, 'hex')\n\n    this.gcing = false\n    this.state.topics.delete(hex)\n    this.state._removeGC(this)\n\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      this.state.stats.sessionsClosed++\n      const session = this.sessions[i]\n      if (session.handlers.ondestroy) session.handlers.ondestroy(session)\n    }\n  }\n\n  addStream(stream) {\n    this._onopen(getMuxer(stream), false)\n  }\n\n  _proveCapabilityTo(stream) {\n    return this._makeCapability(stream.isInitiator, stream.handshakeHash)\n  }\n\n  _makeCapability(isInitiator, handshakeHash) {\n    return crypto.hash([isInitiator ? NS_INITATOR : NS_RESPONDER, this.capability, handshakeHash])\n  }\n\n  _addPeer(peer, open) {\n    if (\n      !b4a.equals(\n        open.capability,\n        this._makeCapability(!peer.stream.isInitiator, peer.stream.handshakeHash)\n      )\n    ) {\n      peer.channel.close()\n      return\n    }\n\n    if (peer.pending) {\n      peer.unlink(this.pendingPeers)\n    }\n\n    peer.active = open.active\n    peer.pending = false\n    peer.index = this.peers.push(peer) - 1\n\n    if (peer.active) {\n      this.activePeers++\n      this._checkGC()\n    }\n\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      const session = this.sessions[i]\n      const handlers = session.handlers\n\n      if (handlers.onpeeradd) handlers.onpeeradd(peer, session)\n      if (peer.active && handlers.onpeeractive) handlers.onpeeractive(peer, session)\n    }\n  }\n\n  _checkGC() {\n    const shouldGC = this.activePeers === 0 && this.sessions.length === 0\n\n    if (shouldGC) {\n      if (!this.gcing) {\n        this.gcing = true\n        this.state._addGC(this)\n      }\n    } else {\n      if (this.gcing) {\n        this.gcing = false\n        this.state._removeGC(this)\n      }\n    }\n  }\n\n  _removePeer(peer) {\n    this.state.stats.peersRemoved++\n    peer.removed = true\n    this.peersByStream.delete(peer.stream)\n\n    if (peer.pending) {\n      peer.unlink(this.pendingPeers)\n      return\n    }\n\n    const active = peer.active\n\n    if (active) {\n      peer.active = false\n      this.activePeers--\n      this._checkGC()\n    }\n\n    peer.unlink(this.peers)\n\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      const session = this.sessions[i]\n      const handlers = session.handlers\n\n      if (active && handlers.onpeerinactive) handlers.onpeerinactive(peer, session)\n      if (handlers.onpeerremove) handlers.onpeerremove(peer, session)\n    }\n  }\n\n  _onannounce(wakeup, peer) {\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      const session = this.sessions[i]\n      const handlers = session.handlers\n\n      if (handlers.onannounce) handlers.onannounce(wakeup, peer, session)\n    }\n  }\n\n  _onlookup(req, peer) {\n    for (let i = this.sessions.length - 1; i >= 0; i--) {\n      const session = this.sessions[i]\n      const handlers = session.handlers\n\n      if (handlers.onlookup) handlers.onlookup(req, peer, session)\n    }\n  }\n\n  _oninfo(info, peer) {\n    if (info.active) {\n      if (!peer.active) {\n        peer.active = true\n        this.activePeers++\n        this._checkGC()\n\n        for (let i = this.sessions.length - 1; i >= 0; i--) {\n          const session = this.sessions[i]\n          const handlers = session.handlers\n\n          if (handlers.onpeeractive) handlers.onpeeractive(peer, session)\n        }\n      }\n    } else {\n      if (peer.active) {\n        peer.active = false\n        this.activePeers--\n        this._checkGC()\n\n        for (let i = this.sessions.length - 1; i >= 0; i--) {\n          const session = this.sessions[i]\n          const handlers = session.handlers\n\n          if (handlers.onpeerinactive) handlers.onpeerinactive(peer, session)\n        }\n      }\n    }\n  }\n\n  _onopen(muxer, unique) {\n    if (!unique && this.peersByStream.has(muxer.stream)) return\n\n    const peer = new WakeupPeer(this)\n    const ch = muxer.createChannel({\n      userData: peer,\n      protocol: 'wakeup',\n      id: this.id,\n      handshake: Handshake,\n      messages: [\n        { encoding: Lookup, onmessage: onlookup },\n        { encoding: Announce, onmessage: onannounce },\n        { encoding: Info, onmessage: onchannelinfo }\n      ],\n      onopen: onchannelopen,\n      onclose: onchannelclose\n    })\n\n    if (!ch) return\n\n    this.state.stats.peersAdded++\n\n    peer.channel = ch\n    peer.stream = muxer.stream\n\n    peer.wireLookup = ch.messages[0]\n    peer.wireAnnounce = ch.messages[1]\n    peer.wireInfo = ch.messages[2]\n\n    peer.index = this.pendingPeers.push(peer) - 1\n    this.peersByStream.set(muxer.stream, peer)\n\n    ch.open({\n      version: 0,\n      capability: this._proveCapabilityTo(muxer.stream),\n      active: this.isActive\n    })\n  }\n}\n\nfunction onchannelopen(open, channel) {\n  const peer = channel.userData\n  peer.topic._addPeer(peer, open)\n}\n\nfunction onchannelclose(close, channel) {\n  const peer = channel.userData\n  peer.topic._removePeer(peer)\n}\n\nfunction onlookup(req, channel) {\n  const peer = channel.userData\n  peer.topic.state.stats.wireLookup.rx++\n  peer.topic._onlookup(req, peer)\n}\n\nfunction onannounce(wakeup, channel) {\n  const peer = channel.userData\n  peer.topic.state.stats.wireAnnounce.rx++\n  peer.topic._onannounce(wakeup, peer)\n}\n\nfunction onchannelinfo(info, channel) {\n  const peer = channel.userData\n  peer.topic.state.stats.wireInfo.rx++\n  peer.topic._oninfo(info, peer)\n}\n\nfunction getMuxer(stream) {\n  if (Protomux.isProtomux(stream)) return stream\n  if (stream.noiseStream.userData) return stream.noiseStream.userData\n  const mux = Protomux.from(stream.noiseStream)\n  stream.noiseStream.userData = mux\n  return mux\n}\n\nfunction noop() {}\n{\n  \"name\": \"protomux-wakeup\",\n  \"version\": \"2.9.0\",\n  \"description\": \"Wakeup protocol over protomux\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.7\",\n    \"hypercore-crypto\": \"^3.5.0\",\n    \"hyperschema\": \"^1.10.4\",\n    \"protomux\": \"^3.10.1\"\n  },\n  \"devDependencies\": {\n    \"@hyperswarm/secret-stream\": \"^6.8.1\",\n    \"brittle\": \"^3.17.1\",\n    \"lunte\": \"^1.0.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\",\n    \"prom-client\": \"^15.1.3\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"spec/hyperschema/*.js\"\n  ],\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"test\": \"prettier --check . && lunte && brittle test/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/protomux-wakeup.git\"\n  },\n  \"author\": \"Holepunch Inc.\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/protomux-wakeup/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/protomux-wakeup\"\n}\n// This file is autogenerated by the hyperschema compiler\n// Schema Version: 1\n/* eslint-disable camelcase */\n/* eslint-disable quotes */\n\nconst VERSION = 1\nconst { c } = require('hyperschema/runtime')\n\n// eslint-disable-next-line no-unused-vars\nlet version = VERSION\n\n// @wakeup/info\nconst encoding0 = {\n  preencode(state, m) {\n    state.end++ // max flag is 1 so always one byte\n  },\n  encode(state, m) {\n    const flags = m.active ? 1 : 0\n\n    c.uint.encode(state, flags)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      active: (flags & 1) !== 0\n    }\n  }\n}\n\n// @wakeup/handshake\nconst encoding1 = {\n  preencode(state, m) {\n    c.uint.preencode(state, m.version)\n    c.fixed32.preencode(state, m.capability)\n    state.end++ // max flag is 1 so always one byte\n  },\n  encode(state, m) {\n    const flags = m.active ? 1 : 0\n\n    c.uint.encode(state, m.version)\n    c.fixed32.encode(state, m.capability)\n    c.uint.encode(state, flags)\n  },\n  decode(state) {\n    const r0 = c.uint.decode(state)\n    const r1 = c.fixed32.decode(state)\n    const flags = c.uint.decode(state)\n\n    return {\n      version: r0,\n      capability: r1,\n      active: (flags & 1) !== 0\n    }\n  }\n}\n\n// @wakeup/writer\nconst encoding2 = {\n  preencode(state, m) {\n    c.fixed32.preencode(state, m.key)\n    c.uint.preencode(state, m.length)\n  },\n  encode(state, m) {\n    c.fixed32.encode(state, m.key)\n    c.uint.encode(state, m.length)\n  },\n  decode(state) {\n    const r0 = c.fixed32.decode(state)\n    const r1 = c.uint.decode(state)\n\n    return {\n      key: r0,\n      length: r1\n    }\n  }\n}\n\n// @wakeup/announce\nconst encoding3 = c.array(encoding2)\n\n// @wakeup/lookup\nconst encoding4 = {\n  preencode(state, m) {\n    state.end++ // max flag is 1 so always one byte\n\n    if (m.hash) c.fixed32.preencode(state, m.hash)\n  },\n  encode(state, m) {\n    const flags = m.hash ? 1 : 0\n\n    c.uint.encode(state, flags)\n\n    if (m.hash) c.fixed32.encode(state, m.hash)\n  },\n  decode(state) {\n    const flags = c.uint.decode(state)\n\n    return {\n      hash: (flags & 1) !== 0 ? c.fixed32.decode(state) : null\n    }\n  }\n}\n\nfunction setVersion(v) {\n  version = v\n}\n\nfunction encode(name, value, v = VERSION) {\n  version = v\n  return c.encode(getEncoding(name), value)\n}\n\nfunction decode(name, buffer, v = VERSION) {\n  version = v\n  return c.decode(getEncoding(name), buffer)\n}\n\nfunction getEnum(name) {\n  switch (name) {\n    default:\n      throw new Error('Enum not found ' + name)\n  }\n}\n\nfunction getEncoding(name) {\n  switch (name) {\n    case '@wakeup/info':\n      return encoding0\n    case '@wakeup/handshake':\n      return encoding1\n    case '@wakeup/writer':\n      return encoding2\n    case '@wakeup/announce':\n      return encoding3\n    case '@wakeup/lookup':\n      return encoding4\n    default:\n      throw new Error('Encoder not found ' + name)\n  }\n}\n\nfunction getStruct(name, v = VERSION) {\n  const enc = getEncoding(name)\n  return {\n    preencode(state, m) {\n      version = v\n      enc.preencode(state, m)\n    },\n    encode(state, m) {\n      version = v\n      enc.encode(state, m)\n    },\n    decode(state) {\n      version = v\n      return enc.decode(state)\n    }\n  }\n}\n\nconst resolveStruct = getStruct // compat\n\nmodule.exports = {\n  resolveStruct,\n  getStruct,\n  getEnum,\n  getEncoding,\n  encode,\n  decode,\n  setVersion,\n  version\n}\nconst b4a = require('b4a')\nconst c = require('compact-encoding')\nconst queueTick = require('queue-tick')\nconst safetyCatch = require('safety-catch')\nconst unslab = require('unslab')\n\nconst MAX_BUFFERED = 32768\nconst MAX_BACKLOG = Infinity // TODO: impl \"open\" backpressure\nconst MAX_BATCH = 8 * 1024 * 1024\n\nclass Channel {\n  constructor (mux, info, userData, protocol, aliases, id, handshake, messages, onopen, onclose, ondestroy, ondrain) {\n    this.userData = userData\n    this.protocol = protocol\n    this.aliases = aliases\n    this.id = id\n    this.handshake = null\n    this.messages = []\n\n    this.opened = false\n    this.closed = false\n    this.destroyed = false\n\n    this.onopen = onopen\n    this.onclose = onclose\n    this.ondestroy = ondestroy\n    this.ondrain = ondrain\n\n    this._handshake = handshake\n    this._mux = mux\n    this._info = info\n    this._localId = 0\n    this._remoteId = 0\n    this._active = 0\n    this._extensions = null\n\n    this._decBound = this._dec.bind(this)\n    this._decAndDestroyBound = this._decAndDestroy.bind(this)\n\n    this._openedPromise = null\n    this._openedResolve = null\n\n    this._destroyedPromise = null\n    this._destroyedResolve = null\n\n    for (const m of messages) this.addMessage(m)\n  }\n\n  get drained () {\n    return this._mux.drained\n  }\n\n  fullyOpened () {\n    if (this.opened) return Promise.resolve(true)\n    if (this.closed) return Promise.resolve(false)\n    if (this._openedPromise) return this._openedPromise\n\n    this._openedPromise = new Promise((resolve) => { this._openedResolve = resolve })\n    return this._openedPromise\n  }\n\n  fullyClosed () {\n    if (this.destroyed) return Promise.resolve()\n    if (this._destroyedPromise) return this._destroyedPromise\n\n    this._destroyedPromise = new Promise((resolve) => { this._destroyedResolve = resolve })\n    return this._destroyedPromise\n  }\n\n  open (handshake) {\n    const id = this._mux._free.length > 0\n      ? this._mux._free.pop()\n      : this._mux._local.push(null) - 1\n\n    this._info.opened++\n    this._info.lastChannel = this\n    this._localId = id + 1\n    this._mux._local[id] = this\n\n    if (this._remoteId === 0) {\n      this._info.outgoing.push(this._localId)\n    }\n\n    const state = { buffer: null, start: 2, end: 2 }\n\n    c.uint.preencode(state, this._localId)\n    c.string.preencode(state, this.protocol)\n    c.buffer.preencode(state, this.id)\n    if (this._handshake) this._handshake.preencode(state, handshake)\n\n    state.buffer = this._mux._alloc(state.end)\n\n    state.buffer[0] = 0\n    state.buffer[1] = 1\n    c.uint.encode(state, this._localId)\n    c.string.encode(state, this.protocol)\n    c.buffer.encode(state, this.id)\n    if (this._handshake) this._handshake.encode(state, handshake)\n\n    this._mux._write0(state.buffer)\n  }\n\n  _dec () {\n    if (--this._active === 0 && this.closed === true) this._destroy()\n  }\n\n  _decAndDestroy (err) {\n    this._dec()\n    this._mux._safeDestroy(err)\n  }\n\n  _fullyOpenSoon () {\n    this._mux._remote[this._remoteId - 1].session = this\n    queueTick(this._fullyOpen.bind(this))\n  }\n\n  _fullyOpen () {\n    if (this.opened === true || this.closed === true) return\n\n    const remote = this._mux._remote[this._remoteId - 1]\n\n    this.opened = true\n    this.handshake = this._handshake ? this._handshake.decode(remote.state) : null\n    this._track(this.onopen(this.handshake, this))\n\n    remote.session = this\n    remote.state = null\n    if (remote.pending !== null) this._drain(remote)\n\n    this._resolveOpen(true)\n  }\n\n  _resolveOpen (opened) {\n    if (this._openedResolve !== null) {\n      this._openedResolve(opened)\n      this._openedResolve = this._openedPromise = null\n    }\n  }\n\n  _resolveDestroyed () {\n    if (this._destroyedResolve !== null) {\n      this._destroyedResolve()\n      this._destroyedResolve = this._destroyedPromise = null\n    }\n  }\n\n  _drain (remote) {\n    for (let i = 0; i < remote.pending.length; i++) {\n      const p = remote.pending[i]\n      this._mux._buffered -= byteSize(p.state)\n      this._recv(p.type, p.state)\n    }\n\n    remote.pending = null\n    this._mux._resumeMaybe()\n  }\n\n  _track (p) {\n    if (isPromise(p) === true) {\n      this._active++\n      return p.then(this._decBound, this._decAndDestroyBound)\n    }\n\n    return null\n  }\n\n  _close (isRemote) {\n    if (this.closed === true) return\n    this.closed = true\n\n    this._info.opened--\n    if (this._info.lastChannel === this) this._info.lastChannel = null\n\n    if (this._remoteId > 0) {\n      this._mux._remote[this._remoteId - 1] = null\n      this._remoteId = 0\n      // If remote has acked, we can reuse the local id now\n      // otherwise, we need to wait for the \"ack\" to arrive\n      this._mux._free.push(this._localId - 1)\n    }\n\n    this._mux._local[this._localId - 1] = null\n    this._localId = 0\n\n    this._mux._gc(this._info)\n    this._track(this.onclose(isRemote, this))\n\n    if (this._active === 0) this._destroy()\n\n    this._resolveOpen(false)\n  }\n\n  _destroy () {\n    if (this.destroyed === true) return\n    this.destroyed = true\n    this._track(this.ondestroy(this))\n    this._resolveDestroyed()\n  }\n\n  _recv (type, state) {\n    if (type < this.messages.length) {\n      const m = this.messages[type]\n      const p = m.recv(state, this)\n      if (m.autoBatch === true) return p\n    }\n    return null\n  }\n\n  cork () {\n    this._mux.cork()\n  }\n\n  uncork () {\n    this._mux.uncork()\n  }\n\n  close () {\n    if (this.closed === true) return\n\n    const state = { buffer: null, start: 2, end: 2 }\n\n    c.uint.preencode(state, this._localId)\n\n    state.buffer = this._mux._alloc(state.end)\n\n    state.buffer[0] = 0\n    state.buffer[1] = 3\n    c.uint.encode(state, this._localId)\n\n    this._close(false)\n    this._mux._write0(state.buffer)\n  }\n\n  addMessage (opts) {\n    if (!opts) return this._skipMessage()\n\n    const type = this.messages.length\n    const autoBatch = opts.autoBatch !== false\n    const encoding = opts.encoding || c.raw\n    const onmessage = opts.onmessage || noop\n\n    const s = this\n    const typeLen = encodingLength(c.uint, type)\n\n    const m = {\n      type,\n      autoBatch,\n      encoding,\n      onmessage,\n      recv (state, session) {\n        return session._track(m.onmessage(encoding.decode(state), session))\n      },\n      send (m, session = s) {\n        if (session.closed === true) return false\n\n        const mux = session._mux\n        const state = { buffer: null, start: 0, end: typeLen }\n\n        if (mux._batch !== null) {\n          encoding.preencode(state, m)\n          state.buffer = mux._alloc(state.end)\n\n          c.uint.encode(state, type)\n          encoding.encode(state, m)\n\n          mux._pushBatch(session._localId, state.buffer)\n          return true\n        }\n\n        c.uint.preencode(state, session._localId)\n        encoding.preencode(state, m)\n\n        state.buffer = mux._alloc(state.end)\n\n        c.uint.encode(state, session._localId)\n        c.uint.encode(state, type)\n        encoding.encode(state, m)\n\n        mux.drained = mux.stream.write(state.buffer)\n\n        return mux.drained\n      }\n    }\n\n    this.messages.push(m)\n\n    return m\n  }\n\n  _skipMessage () {\n    const type = this.messages.length\n    const m = {\n      type,\n      encoding: c.raw,\n      onmessage: noop,\n      recv (state, session) {},\n      send (m, session) {}\n    }\n\n    this.messages.push(m)\n    return m\n  }\n}\n\nmodule.exports = class Protomux {\n  constructor (stream, { alloc } = {}) {\n    if (stream.userData === null) stream.userData = this\n\n    this.isProtomux = true\n    this.stream = stream\n    this.corked = 0\n    this.drained = true\n\n    this._alloc = alloc || (typeof stream.alloc === 'function' ? stream.alloc.bind(stream) : b4a.allocUnsafe)\n    this._safeDestroyBound = this._safeDestroy.bind(this)\n    this._uncorkBound = this.uncork.bind(this)\n\n    this._remoteBacklog = 0\n    this._buffered = 0\n    this._paused = false\n    this._remote = []\n    this._local = []\n    this._free = []\n    this._batch = null\n    this._batchState = null\n\n    this._infos = new Map()\n    this._notify = new Map()\n\n    this.stream.on('data', this._ondata.bind(this))\n    this.stream.on('drain', this._ondrain.bind(this))\n    this.stream.on('end', this._onend.bind(this))\n    this.stream.on('error', noop) // we handle this in \"close\"\n    this.stream.on('close', this._shutdown.bind(this))\n  }\n\n  static from (stream, opts) {\n    if (stream.userData && stream.userData.isProtomux) return stream.userData\n    if (stream.isProtomux) return stream\n    return new this(stream, opts)\n  }\n\n  static isProtomux (mux) {\n    return typeof mux === 'object' && mux.isProtomux === true\n  }\n\n  * [Symbol.iterator] () {\n    for (const session of this._local) {\n      if (session !== null) yield session\n    }\n  }\n\n  isIdle () {\n    return this._local.length === this._free.length\n  }\n\n  cork () {\n    if (++this.corked === 1) {\n      this._batch = []\n      this._batchState = { buffer: null, start: 0, end: 1 }\n    }\n  }\n\n  uncork () {\n    if (--this.corked === 0) {\n      this._sendBatch(this._batch, this._batchState)\n      this._batch = null\n      this._batchState = null\n    }\n  }\n\n  getLastChannel ({ protocol, id = null }) {\n    const key = toKey(protocol, id)\n    const info = this._infos.get(key)\n    if (info) return info.lastChannel\n    return null\n  }\n\n  pair ({ protocol, id = null }, notify) {\n    this._notify.set(toKey(protocol, id), notify)\n  }\n\n  unpair ({ protocol, id = null }) {\n    this._notify.delete(toKey(protocol, id))\n  }\n\n  opened ({ protocol, id = null }) {\n    const key = toKey(protocol, id)\n    const info = this._infos.get(key)\n    return info ? info.opened > 0 : false\n  }\n\n  createChannel ({ userData = null, protocol, aliases = [], id = null, unique = true, handshake = null, messages = [], onopen = noop, onclose = noop, ondestroy = noop, ondrain = noop }) {\n    if (this.stream.destroyed) return null\n\n    const info = this._get(protocol, id, aliases)\n    if (unique && info.opened > 0) return null\n\n    if (info.incoming.length === 0) {\n      return new Channel(this, info, userData, protocol, aliases, id, handshake, messages, onopen, onclose, ondestroy, ondrain)\n    }\n\n    this._remoteBacklog--\n\n    const remoteId = info.incoming.shift()\n    const r = this._remote[remoteId - 1]\n    if (r === null) return null\n\n    const session = new Channel(this, info, userData, protocol, aliases, id, handshake, messages, onopen, onclose, ondestroy, ondrain)\n\n    session._remoteId = remoteId\n    session._fullyOpenSoon()\n\n    return session\n  }\n\n  _pushBatch (localId, buffer) {\n    if (this._batchState.end >= MAX_BATCH) {\n      this._sendBatch(this._batch, this._batchState)\n      this._batch = []\n      this._batchState = { buffer: null, start: 0, end: 1 }\n    }\n\n    if (this._batch.length === 0 || this._batch[this._batch.length - 1].localId !== localId) {\n      this._batchState.end++\n      c.uint.preencode(this._batchState, localId)\n    }\n    c.buffer.preencode(this._batchState, buffer)\n    this._batch.push({ localId, buffer })\n  }\n\n  _sendBatch (batch, state) {\n    if (batch.length === 0) return\n\n    let prev = batch[0].localId\n\n    state.buffer = this._alloc(state.end)\n    state.buffer[state.start++] = 0\n    state.buffer[state.start++] = 0\n\n    c.uint.encode(state, prev)\n\n    for (let i = 0; i < batch.length; i++) {\n      const b = batch[i]\n      if (prev !== b.localId) {\n        state.buffer[state.start++] = 0\n        c.uint.encode(state, (prev = b.localId))\n      }\n      c.buffer.encode(state, b.buffer)\n    }\n\n    this.drained = this.stream.write(state.buffer)\n  }\n\n  _get (protocol, id, aliases = []) {\n    const key = toKey(protocol, id)\n\n    let info = this._infos.get(key)\n    if (info) return info\n\n    info = { key, protocol, aliases: [], id, pairing: 0, opened: 0, incoming: [], outgoing: [], lastChannel: null }\n    this._infos.set(key, info)\n\n    for (const alias of aliases) {\n      const key = toKey(alias, id)\n      info.aliases.push(key)\n\n      this._infos.set(key, info)\n    }\n\n    return info\n  }\n\n  _gc (info) {\n    if (info.opened === 0 && info.outgoing.length === 0 && info.incoming.length === 0) {\n      this._infos.delete(info.key)\n\n      for (const alias of info.aliases) this._infos.delete(alias)\n    }\n  }\n\n  _ondata (buffer) {\n    if (buffer.byteLength === 0) return // ignore empty frames...\n    try {\n      const state = { buffer, start: 0, end: buffer.byteLength }\n      this._decode(c.uint.decode(state), state)\n    } catch (err) {\n      this._safeDestroy(err)\n    }\n  }\n\n  _ondrain () {\n    this.drained = true\n\n    for (const s of this._local) {\n      if (s !== null) s._track(s.ondrain(s))\n    }\n  }\n\n  _onend () { // TODO: support half open mode for the users who wants that here\n    this.stream.end()\n  }\n\n  _decode (remoteId, state) {\n    const type = c.uint.decode(state)\n\n    if (remoteId === 0) {\n      return this._oncontrolsession(type, state)\n    }\n\n    const r = remoteId <= this._remote.length ? this._remote[remoteId - 1] : null\n\n    // if the channel is closed ignore - could just be a pipeline message...\n    if (r === null) return null\n\n    if (r.pending !== null) {\n      this._bufferMessage(r, type, state)\n      return null\n    }\n\n    return r.session._recv(type, state)\n  }\n\n  _oncontrolsession (type, state) {\n    switch (type) {\n      case 0:\n        this._onbatch(state)\n        break\n\n      case 1:\n        // return the promise back up as this has sideeffects so we can batch reply\n        return this._onopensession(state)\n\n      case 2:\n        this._onrejectsession(state)\n        break\n\n      case 3:\n        this._onclosesession(state)\n        break\n    }\n\n    return null\n  }\n\n  _bufferMessage (r, type, { buffer, start, end }) {\n    const state = { buffer, start, end } // copy\n    r.pending.push({ type, state })\n    this._buffered += byteSize(state)\n    this._pauseMaybe()\n  }\n\n  _pauseMaybe () {\n    if (this._paused === true || this._buffered <= MAX_BUFFERED) return\n    this._paused = true\n    this.stream.pause()\n  }\n\n  _resumeMaybe () {\n    if (this._paused === false || this._buffered > MAX_BUFFERED) return\n    this._paused = false\n    this.stream.resume()\n  }\n\n  _onbatch (state) {\n    const end = state.end\n    let remoteId = c.uint.decode(state)\n\n    let waiting = null\n\n    while (state.end > state.start) {\n      const len = c.uint.decode(state)\n      if (len === 0) {\n        remoteId = c.uint.decode(state)\n        continue\n      }\n      state.end = state.start + len\n      // if batch contains more than one message, cork it so we reply back with a batch\n      if (end !== state.end && waiting === null) {\n        waiting = []\n        this.cork()\n      }\n      const p = this._decode(remoteId, state)\n      if (waiting !== null && p !== null) waiting.push(p)\n      state.start = state.end\n      state.end = end\n    }\n\n    if (waiting !== null) {\n      // the waiting promises are not allowed to throw but we destroy the stream in case we are wrong\n      Promise.all(waiting).then(this._uncorkBound, this._safeDestroyBound)\n    }\n  }\n\n  _onopensession (state) {\n    const remoteId = c.uint.decode(state)\n    const protocol = c.string.decode(state)\n    const id = unslab(c.buffer.decode(state))\n\n    // remote tried to open the control session - auto reject for now\n    // as we can use as an explicit control protocol declaration if we need to\n    if (remoteId === 0) {\n      this._rejectSession(0)\n      return null\n    }\n\n    const rid = remoteId - 1\n    const info = this._get(protocol, id)\n\n    // allow the remote to grow the ids by one\n    if (this._remote.length === rid) {\n      this._remote.push(null)\n    }\n\n    if (rid >= this._remote.length || this._remote[rid] !== null) {\n      throw new Error('Invalid open message')\n    }\n\n    if (info.outgoing.length > 0) {\n      const localId = info.outgoing.shift()\n      const session = this._local[localId - 1]\n\n      if (session === null) { // we already closed the channel - ignore\n        this._free.push(localId - 1)\n        return null\n      }\n\n      this._remote[rid] = { state, pending: null, session: null }\n\n      session._remoteId = remoteId\n      session._fullyOpen()\n      return null\n    }\n\n    const copyState = { buffer: state.buffer, start: state.start, end: state.end }\n    this._remote[rid] = { state: copyState, pending: [], session: null }\n\n    if (++this._remoteBacklog > MAX_BACKLOG) {\n      throw new Error('Remote exceeded backlog')\n    }\n\n    info.pairing++\n    info.incoming.push(remoteId)\n\n    return this._requestSession(protocol, id, info).catch(this._safeDestroyBound)\n  }\n\n  _onrejectsession (state) {\n    const localId = c.uint.decode(state)\n\n    // TODO: can be done smarter...\n    for (const info of this._infos.values()) {\n      const i = info.outgoing.indexOf(localId)\n      if (i === -1) continue\n\n      info.outgoing.splice(i, 1)\n\n      const session = this._local[localId - 1]\n\n      this._free.push(localId - 1)\n      if (session !== null) session._close(true)\n\n      this._gc(info)\n      return\n    }\n\n    throw new Error('Invalid reject message')\n  }\n\n  _onclosesession (state) {\n    const remoteId = c.uint.decode(state)\n\n    if (remoteId === 0) return // ignore\n\n    const rid = remoteId - 1\n    const r = rid < this._remote.length ? this._remote[rid] : null\n\n    if (r === null) return\n\n    if (r.session !== null) r.session._close(true)\n  }\n\n  async _requestSession (protocol, id, info) {\n    const notify = this._notify.get(toKey(protocol, id)) || this._notify.get(toKey(protocol, null))\n\n    if (notify) await notify(id)\n\n    if (--info.pairing > 0) return\n\n    while (info.incoming.length > 0) {\n      this._rejectSession(info, info.incoming.shift())\n    }\n\n    this._gc(info)\n  }\n\n  _rejectSession (info, remoteId) {\n    if (remoteId > 0) {\n      const r = this._remote[remoteId - 1]\n\n      if (r.pending !== null) {\n        for (let i = 0; i < r.pending.length; i++) {\n          this._buffered -= byteSize(r.pending[i].state)\n        }\n      }\n\n      this._remote[remoteId - 1] = null\n      this._resumeMaybe()\n    }\n\n    const state = { buffer: null, start: 2, end: 2 }\n\n    c.uint.preencode(state, remoteId)\n\n    state.buffer = this._alloc(state.end)\n\n    state.buffer[0] = 0\n    state.buffer[1] = 2\n    c.uint.encode(state, remoteId)\n\n    this._write0(state.buffer)\n  }\n\n  _write0 (buffer) {\n    if (this._batch !== null) {\n      this._pushBatch(0, buffer.subarray(1))\n      return\n    }\n\n    this.drained = this.stream.write(buffer)\n  }\n\n  destroy (err) {\n    this.stream.destroy(err)\n  }\n\n  _safeDestroy (err) {\n    safetyCatch(err)\n    this.stream.destroy(err)\n  }\n\n  _shutdown () {\n    for (const s of this._local) {\n      if (s !== null) s._close(true)\n    }\n  }\n}\n\nfunction noop () {}\n\nfunction toKey (protocol, id) {\n  return protocol + '##' + (id ? b4a.toString(id, 'hex') : '')\n}\n\nfunction byteSize (state) {\n  return 512 + (state.end - state.start)\n}\n\nfunction isPromise (p) {\n  return !!(p && typeof p.then === 'function')\n}\n\nfunction encodingLength (enc, val) {\n  const state = { buffer: null, start: 0, end: 0 }\n  enc.preencode(state, val)\n  return state.end\n}\n{\n  \"name\": \"protomux\",\n  \"version\": \"3.10.1\",\n  \"description\": \"Multiplex multiple message oriented protocols over a stream\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {\n    \"b4a\": \"^1.3.1\",\n    \"compact-encoding\": \"^2.5.1\",\n    \"queue-tick\": \"^1.0.0\",\n    \"safety-catch\": \"^1.0.1\",\n    \"unslab\": \"^1.3.0\"\n  },\n  \"devDependencies\": {\n    \"@hyperswarm/secret-stream\": \"^6.0.0\",\n    \"brittle\": \"^3.0.0\",\n    \"standard\": \"^16.0.4\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/protomux.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/protomux/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/protomux\"\n}\n{\n  \"name\": \"queue-tick\",\n  \"version\": \"1.0.1\",\n  \"description\": \"Next tick shim that prefers process.nextTick over queueMicrotask for compat\",\n  \"main\": \"./process-next-tick.js\",\n  \"browser\": \"./queue-microtask.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"standard\": \"^16.0.3\",\n    \"tape\": \"^5.3.1\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && tape test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/queue-tick.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/queue-tick/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/queue-tick\"\n}\nmodule.exports = (typeof process !== 'undefined' && typeof process.nextTick === 'function')\n  ? process.nextTick.bind(process)\n  : require('./queue-microtask')\nmodule.exports = typeof queueMicrotask === 'function' ? queueMicrotask : (fn) => Promise.resolve().then(fn)\nrequire.addon = require('require-addon')\n\nmodule.exports = require.addon('.', __filename)\nconst binding = require('./binding')\n\nexports.get = function get(field, bit) {\n  const n = field.byteLength * 8\n\n  if (bit < 0) bit += n\n  if (bit < 0 || bit >= n) return false\n\n  return binding.quickbit_napi_get(toBuffer(field), bit) !== 0\n}\n\nexports.set = function set(field, bit, value = true) {\n  const n = field.byteLength * 8\n\n  if (bit < 0) bit += n\n  if (bit < 0 || bit >= n) return false\n\n  return binding.quickbit_napi_set(toBuffer(field), bit, value ? 1 : 0) !== 0\n}\n\nexports.fill = function fill(\n  field,\n  value,\n  start = 0,\n  end = field.byteLength * 8\n) {\n  const n = field.byteLength * 8\n\n  if (start < 0) start += n\n  if (end < 0) end += n\n  if (start < 0 || start >= field.byteLength * 8 || start >= end) return field\n\n  binding.quickbit_napi_fill(toBuffer(field), value ? 1 : 0, start, end)\n  return field\n}\n\nexports.clear = function clear(field, ...chunks) {\n  binding.quickbit_napi_clear(toBuffer(field), chunks.map(toBufferChunk))\n}\n\nexports.findFirst = function findFirst(field, value, position = 0) {\n  const n = field.byteLength * 8\n\n  if (position < 0) position += n\n  if (position < 0) position = 0\n  if (position >= n) return -1\n\n  return binding.quickbit_napi_find_first(\n    toBuffer(field),\n    value ? 1 : 0,\n    position\n  )\n}\n\nexports.findLast = function findLast(\n  field,\n  value,\n  position = field.byteLength * 8 - 1\n) {\n  const n = field.byteLength * 8\n\n  if (position < 0) position += n\n  if (position < 0) return -1\n  if (position >= n) position = n - 1\n\n  return binding.quickbit_napi_find_last(\n    toBuffer(field),\n    value ? 1 : 0,\n    position\n  )\n}\n\nfunction toBuffer(field) {\n  if (field.BYTES_PER_ELEMENT === 1) return field\n  return new Uint8Array(field.buffer, field.byteOffset, field.byteLength)\n}\n\nfunction toBufferChunk(chunk) {\n  return { field: toBuffer(chunk.field), offset: chunk.offset }\n}\n\nclass Index {\n  static from(fieldOrChunks, byteLength = -1) {\n    if (Array.isArray(fieldOrChunks)) {\n      return new SparseIndex(fieldOrChunks, byteLength)\n    } else {\n      return new DenseIndex(fieldOrChunks, byteLength)\n    }\n  }\n\n  constructor(byteLength) {\n    this._byteLength = byteLength\n    this.handle = Buffer.allocUnsafe(binding.sizeof_quickbit_index_t)\n  }\n\n  get byteLength() {\n    return this._byteLength\n  }\n\n  skipFirst(value, position = 0) {\n    const n = this.byteLength * 8\n\n    if (position < 0) position += n\n    if (position < 0) position = 0\n    if (position >= n) return n - 1\n\n    return binding.quickbit_napi_skip_first(\n      this.handle,\n      this.byteLength,\n      value ? 1 : 0,\n      position\n    )\n  }\n\n  skipLast(value, position = this.byteLength * 8 - 1) {\n    const n = this.byteLength * 8\n\n    if (position < 0) position += n\n    if (position < 0) return 0\n    if (position >= n) position = n - 1\n\n    return binding.quickbit_napi_skip_last(\n      this.handle,\n      this.byteLength,\n      value ? 1 : 0,\n      position\n    )\n  }\n}\n\nexports.Index = Index\n\nclass DenseIndex extends Index {\n  constructor(field, byteLength) {\n    super(byteLength)\n    this.field = field\n\n    binding.quickbit_napi_index_init(this.handle, toBuffer(this.field))\n  }\n\n  get byteLength() {\n    if (this._byteLength !== -1) return this._byteLength\n    return this.field.byteLength\n  }\n\n  update(bit) {\n    const n = this.byteLength * 8\n\n    if (bit < 0) bit += n\n    if (bit < 0 || bit >= n) return false\n\n    return (\n      binding.quickbit_napi_index_update(\n        this.handle,\n        toBuffer(this.field),\n        bit\n      ) !== 0\n    )\n  }\n}\n\nfunction selectChunk(chunks, offset) {\n  for (let i = 0; i < chunks.length; i++) {\n    const next = chunks[i]\n\n    const start = next.offset\n    const end = next.offset + next.field.byteLength\n\n    if (offset >= start && offset + 16 <= end) {\n      return next\n    }\n  }\n\n  return null\n}\n\nclass SparseIndex extends Index {\n  constructor(chunks, byteLength) {\n    super(byteLength)\n    this.chunks = chunks\n\n    binding.quickbit_napi_index_init_sparse(\n      this.handle,\n      this.chunks.map(toBufferChunk)\n    )\n  }\n\n  get byteLength() {\n    if (this._byteLength !== -1) return this._byteLength\n    const last = this.chunks[this.chunks.length - 1]\n    return last ? last.offset + last.field.byteLength : 0\n  }\n\n  update(bit) {\n    const n = this.byteLength * 8\n\n    if (bit < 0) bit += n\n    if (bit < 0 || bit >= n) return false\n\n    const j = Math.floor(bit / 128)\n\n    const offset = j * 16\n\n    const chunk = selectChunk(this.chunks, offset)\n\n    if (chunk === null) return false\n\n    return (\n      binding.quickbit_napi_index_update_sparse(\n        this.handle,\n        toBuffer(chunk.field),\n        chunk.offset,\n        bit\n      ) !== 0\n    )\n  }\n}\n{\n  \"name\": \"quickbit-native\",\n  \"version\": \"2.4.8\",\n  \"description\": \"libquickbit JavaScript bindings for Node.js\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"macros.h\",\n    \"binding.cc\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"test\": \"npm run lint && npm run test:bare && npm run test:node\",\n    \"test:bare\": \"bare test.mjs\",\n    \"test:node\": \"node test.mjs\",\n    \"lint\": \"prettier . --check\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/quickbit-native.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/quickbit-native/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/quickbit-native#readme\",\n  \"dependencies\": {\n    \"require-addon\": \"^1.1.0\"\n  },\n  \"devDependencies\": {\n    \"b4a\": \"^1.6.7\",\n    \"bare-compat-napi\": \"^1.3.2\",\n    \"brittle\": \"^3.1.0\",\n    \"cmake-bare\": \"^1.1.7\",\n    \"cmake-fetch\": \"^1.1.0\",\n    \"cmake-napi\": \"^1.0.2\",\n    \"prettier\": \"^3.5.3\",\n    \"prettier-config-standard\": \"^7.0.0\"\n  }\n}\nconst simdle = require('simdle-universal')\n\nconst INDEX_LEN = (16 /* root */ + 128 * 16 /* children */) * 2\n\nconst get = exports.get = function get (field, bit) {\n  const n = field.byteLength * 8\n\n  if (bit < 0) bit += n\n  if (bit < 0 || bit >= n) return false\n\n  const m = field.BYTES_PER_ELEMENT * 8\n\n  const offset = bit & (m - 1)\n  const i = (bit - offset) / m\n\n  return (field[i] & (1 << offset)) !== 0\n}\n\nconst set = exports.set = function set (field, bit, value = true) {\n  const n = field.byteLength * 8\n\n  if (bit < 0) bit += n\n  if (bit < 0 || bit >= n) return false\n\n  const m = field.BYTES_PER_ELEMENT * 8\n\n  const offset = bit & (m - 1)\n  const i = (bit - offset) / m\n  const mask = 1 << offset\n\n  if (value) {\n    if ((field[i] & mask) !== 0) return false\n  } else {\n    if ((field[i] & mask) === 0) return false\n  }\n\n  field[i] ^= mask\n\n  return true\n}\n\nexports.fill = function fill (field, value, start = 0, end = field.byteLength * 8) {\n  const n = field.byteLength * 8\n\n  if (start < 0) start += n\n  if (end < 0) end += n\n  if (start < 0 || start >= field.byteLength * 8 || start >= end) return field\n\n  const m = field.BYTES_PER_ELEMENT * 8\n\n  let i, j\n\n  {\n    const offset = start & (m - 1)\n    i = (start - offset) / m\n\n    if (offset !== 0) {\n      let shift = m - offset\n      if (end - start < shift) shift = end - start\n\n      const mask = ((1 << shift) - 1) << offset\n\n      if (value) field[i] |= mask\n      else field[i] &= ~mask\n\n      i++\n    }\n  }\n\n  {\n    const offset = end & (m - 1)\n    j = (end - offset) / m\n\n    if (offset !== 0 && j >= i) {\n      const mask = (1 << offset) - 1\n\n      if (value) field[j] |= mask\n      else field[j] &= ~mask\n    }\n  }\n\n  if (i < j) field.fill(value ? (2 ** m) - 1 : 0, i, j)\n\n  return field\n}\n\nexports.clear = function clear (field, ...chunks) {\n  const n = field.byteLength\n\n  for (const chunk of chunks) {\n    if (chunk.offset >= n) continue\n\n    const m = chunk.field.byteLength\n\n    let i = chunk.offset\n    let j = 0\n\n    while (((i & 15) !== 0 || (j & 15) !== 0) && i < n && j < m) {\n      field[i] = field[i] & ~chunk.field[j]\n      i++\n      j++\n    }\n\n    if (i + 15 < n && j + 15 < m) {\n      const len = Math.min(n - (n & 15) - i, m - (m & 15) - j)\n\n      simdle.clear(field.subarray(i, i + len), chunk.field.subarray(j, j + len), field.subarray(i, i + len))\n    }\n\n    while (i < n && j < m) {\n      field[i] = field[i] & ~chunk.field[j]\n      i++\n      j++\n    }\n  }\n}\n\nfunction bitOffset (bit, offset) {\n  return !bit ? offset : (INDEX_LEN * 8 / 2) + offset\n}\n\nfunction byteOffset (bit, offset) {\n  return !bit ? offset : (INDEX_LEN / 2) + offset\n}\n\nexports.findFirst = function findFirst (field, value, position = 0) {\n  const n = field.byteLength * 8\n\n  if (position < 0) position += n\n  if (position < 0) position = 0\n  if (position >= n) return -1\n\n  value = !!value\n\n  for (let i = position; i < n; i++) {\n    if (get(field, i) === value) return i\n  }\n\n  return -1\n}\n\nexports.findLast = function findLast (field, value, position = field.byteLength * 8 - 1) {\n  const n = field.byteLength * 8\n\n  if (position < 0) position += n\n  if (position < 0) return -1\n  if (position >= n) position = n - 1\n\n  value = !!value\n\n  for (let i = position; i >= 0; i--) {\n    if (get(field, i) === value) return i\n  }\n\n  return -1\n}\n\nconst Index = exports.Index = class Index {\n  static from (fieldOrChunks, byteLength = -1) {\n    if (Array.isArray(fieldOrChunks)) {\n      return new SparseIndex(fieldOrChunks, byteLength)\n    } else {\n      return new DenseIndex(fieldOrChunks, byteLength)\n    }\n  }\n\n  constructor (byteLength) {\n    this._byteLength = byteLength\n    this.handle = new Uint32Array(INDEX_LEN / 4)\n  }\n\n  get byteLength () {\n    return this._byteLength\n  }\n\n  skipFirst (value, position = 0) {\n    const n = this.byteLength * 8\n\n    if (position < 0) position += n\n    if (position < 0) position = 0\n    if (position >= n) return n - 1\n\n    let i = Math.floor(position / 16384)\n\n    if (i > 127) return position\n\n    while (i <= 127 && get(this.handle, bitOffset(value, i))) {\n      i++\n    }\n\n    if (i === 128) return n - 1\n\n    let k = i * 16384\n    let j = 0\n\n    if (position > k) j = Math.floor((position - k) / 128)\n\n    while (j <= 127 && get(this.handle, bitOffset(value, i * 128 + j + 128))) {\n      j++\n      k += 128\n    }\n\n    if (j === 128 && i !== 127) return this.skipFirst(value, (i + 1) * 16384)\n\n    if (k > position) position = k\n\n    return position < n ? position : n - 1\n  }\n\n  skipLast (value, position = this.byteLength * 8 - 1) {\n    const n = this.byteLength * 8\n\n    if (position < 0) position += n\n    if (position < 0) return 0\n    if (position >= n) position = n - 1\n\n    let i = Math.floor(position / 16384)\n\n    if (i > 127) return position\n\n    while (i >= 0 && get(this.handle, bitOffset(value, i))) {\n      i--\n    }\n\n    if (i === -1) return 0\n\n    let k = ((i + 1) * 16384) - 1\n    let j = 127\n\n    if (position < k) j = 128 - Math.ceil((k - position) / 128)\n\n    while (j >= 0 && get(this.handle, bitOffset(value, i * 128 + j + 128))) {\n      j--\n      k -= 128\n    }\n\n    if (j === -1 && i !== 0) return this.skipLast(value, i * 16384 - 1)\n\n    if (k < position) position = k\n\n    return position\n  }\n}\n\nclass DenseIndex extends Index {\n  constructor (field, byteLength) {\n    super(byteLength)\n    this.field = field\n\n    const m = field.BYTES_PER_ELEMENT\n\n    for (let i = 0; i < 128; i++) {\n      for (let j = 0; j < 128; j++) {\n        const offset = (i * 128 + j) * 16\n        let allz = true\n        let allo = false\n\n        if (offset + 16 <= this.field.byteLength) {\n          const vec = this.field.subarray(offset / m, (offset + 16) / m)\n\n          allz = simdle.allz(vec)\n          allo = simdle.allo(vec)\n        }\n\n        const k = i * 128 + 128 + j\n\n        set(this.handle, bitOffset(false, k), allz)\n        set(this.handle, bitOffset(true, k), allo)\n      }\n\n      {\n        const offset = byteOffset(false, i * 16 + 16) / 4\n        const allo = simdle.allo(this.handle.subarray(offset, offset + 4))\n\n        set(this.handle, bitOffset(false, i), allo)\n      }\n\n      {\n        const offset = byteOffset(true, i * 16 + 16) / 4\n        const allo = simdle.allo(this.handle.subarray(offset, offset + 4))\n\n        set(this.handle, bitOffset(true, i), allo)\n      }\n    }\n  }\n\n  get byteLength () {\n    if (this._byteLength !== -1) return this._byteLength\n    return this.field.byteLength\n  }\n\n  update (bit) {\n    const n = this.byteLength * 8\n\n    if (bit < 0) bit += n\n    if (bit < 0 || bit >= n) return false\n\n    const m = this.field.BYTES_PER_ELEMENT\n\n    const i = Math.floor(bit / 16384)\n    const j = Math.floor(bit / 128)\n\n    const offset = (j * 16) / m\n    const vec = this.field.subarray(offset, offset + (16 / m))\n\n    const allz = simdle.allz(vec)\n    const allo = simdle.allo(vec)\n\n    let changed = false\n\n    if (set(this.handle, bitOffset(false, 128 + j), allz)) {\n      changed = true\n\n      const offset = byteOffset(false, i * 16 + 16) / 4\n      const allo = simdle.allo(this.handle.subarray(offset, offset + 4))\n\n      set(this.handle, bitOffset(false, i), allo)\n    }\n\n    if (set(this.handle, bitOffset(true, 128 + j), allo)) {\n      changed = true\n\n      const offset = byteOffset(true, i * 16 + 16) / 4\n      const allo = simdle.allo(this.handle.subarray(offset, offset + 4))\n\n      set(this.handle, bitOffset(true, i), allo)\n    }\n\n    return changed\n  }\n}\n\nfunction selectChunk (chunks, offset) {\n  for (let i = 0; i < chunks.length; i++) {\n    const next = chunks[i]\n\n    const start = next.offset\n    const end = next.offset + next.field.byteLength\n\n    if (offset >= start && offset + 16 <= end) {\n      return next\n    }\n  }\n\n  return null\n}\n\nclass SparseIndex extends Index {\n  constructor (chunks, byteLength) {\n    super(byteLength)\n    this.chunks = chunks\n\n    for (let i = 0; i < 128; i++) {\n      for (let j = 0; j < 128; j++) {\n        const offset = (i * 128 + j) * 16\n        let allz = true\n        let allo = false\n\n        const chunk = selectChunk(this.chunks, offset)\n\n        if (chunk !== null) {\n          const m = chunk.field.BYTES_PER_ELEMENT\n\n          const vec = chunk.field.subarray((offset - chunk.offset) / m, (offset - chunk.offset + 16) / m)\n\n          allz = simdle.allz(vec)\n          allo = simdle.allo(vec)\n        }\n\n        const k = i * 128 + 128 + j\n\n        set(this.handle, bitOffset(false, k), allz)\n        set(this.handle, bitOffset(true, k), allo)\n      }\n\n      {\n        const offset = byteOffset(false, i * 16 + 16) / 4\n        const allo = simdle.allo(this.handle.subarray(offset, offset + 4))\n\n        set(this.handle, bitOffset(false, i), allo)\n      }\n\n      {\n        const offset = byteOffset(true, i * 16 + 16) / 4\n        const allo = simdle.allo(this.handle.subarray(offset, offset + 4))\n\n        set(this.handle, bitOffset(true, i), allo)\n      }\n    }\n  }\n\n  get byteLength () {\n    if (this._byteLength !== -1) return this._byteLength\n    const last = this.chunks[this.chunks.length - 1]\n    return last ? last.offset + last.field.byteLength : 0\n  }\n\n  update (bit) {\n    const n = this.byteLength * 8\n\n    if (bit < 0) bit += n\n    if (bit < 0 || bit >= n) return false\n\n    const i = Math.floor(bit / 16384)\n    const j = Math.floor(bit / 128)\n\n    const offset = j * 16\n\n    const chunk = selectChunk(this.chunks, offset)\n\n    if (chunk === null) return false\n\n    const m = chunk.field.BYTES_PER_ELEMENT\n\n    const vec = chunk.field.subarray((offset - chunk.offset) / m, (offset - chunk.offset + 16) / m)\n\n    const allz = simdle.allz(vec)\n    const allo = simdle.allo(vec)\n\n    let changed = false\n\n    if (set(this.handle, bitOffset(false, 128 + j), allz)) {\n      changed = true\n\n      const offset = byteOffset(false, i * 16 + 16) / 4\n      const allo = simdle.allo(this.handle.subarray(offset, offset + 4))\n\n      set(this.handle, bitOffset(false, i), allo)\n    }\n\n    if (set(this.handle, bitOffset(true, 128 + j), allo)) {\n      changed = true\n\n      const offset = byteOffset(true, i * 16 + 16) / 4\n      const allo = simdle.allo(this.handle.subarray(offset, offset + 4))\n\n      set(this.handle, bitOffset(true, i), allo)\n    }\n\n    return changed\n  }\n}\nconst fallback = require('./fallback')\n\ntry {\n  const native = require('quickbit-native')\n\n  // These functions are faster in JavaScript\n  exports.get = fallback.get\n  exports.set = fallback.set\n  exports.fill = fallback.fill\n\n  // These functions are faster in C\n  exports.clear = native.clear\n  exports.findFirst = native.findFirst\n  exports.findLast = native.findLast\n  exports.Index = native.Index\n} catch {\n  module.exports = fallback\n}\n{\n  \"name\": \"quickbit-universal\",\n  \"version\": \"2.2.0\",\n  \"description\": \"Universal wrapper for libquickbit with a JavaScript fallback\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"fallback.js\",\n    \"index.js\"\n  ],\n  \"browser\": {\n    \"./index.js\": \"./fallback.js\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.mjs\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/quickbit-universal.git\"\n  },\n  \"author\": \"Kasper Isager Dalsgarð <kasper@funktionel.co>\",\n  \"license\": \"ISC\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/quickbit-universal/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/quickbit-universal#readme\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.0\",\n    \"simdle-universal\": \"^1.1.0\"\n  },\n  \"optionalDependencies\": {\n    \"quickbit-native\": \"^2.2.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.0\",\n    \"standard\": \"^17.0.0\"\n  }\n}\nclass CacheEntry {\n  constructor (key, index, map) {\n    this.key = key\n    this.index = index\n    this.map = map\n  }\n}\n\nclass CacheValue {\n  constructor (entry, value) {\n    this.entry = entry\n    this.value = value\n  }\n}\n\nclass Rache {\n  constructor ({ maxSize = 65536, parent = null } = {}) {\n    this.maxSize = parent?.maxSize || maxSize\n\n    this._array = parent?._array || []\n    this._map = new Map()\n  }\n\n  static from (cache) {\n    return cache ? new this({ parent: cache }) : new this()\n  }\n\n  get globalSize () {\n    return this._array.length\n  }\n\n  get size () {\n    return this._map.size\n  }\n\n  sub () {\n    return new Rache({ parent: this })\n  }\n\n  set (key, value) { // ~constant time\n    const existing = this._map.get(key)\n    if (existing !== undefined) {\n      existing.value = value\n      return\n    }\n\n    if (this._array.length >= this.maxSize) this._gc()\n\n    const entry = new CacheEntry(key, this._array.length, this._map)\n    this._array.push(entry)\n    const cacheValue = new CacheValue(entry, value)\n    this._map.set(key, cacheValue)\n  }\n\n  delete (key) {\n    const existing = this._map.get(key)\n    if (existing === undefined) return false\n\n    this._delete(existing.entry.index)\n    return true\n  }\n\n  get (key) {\n    const existing = this._map.get(key)\n    return existing === undefined ? undefined : existing.value\n  }\n\n  * [Symbol.iterator] () {\n    for (const [key, { value }] of this._map) {\n      yield [key, value]\n    }\n  }\n\n  keys () {\n    return this._map.keys()\n  }\n\n  * values () {\n    for (const { value } of this._map.values()) {\n      yield value\n    }\n  }\n\n  clear () {\n    // The entries in map linger on in _array,\n    // so on top of clearing the map, we also kill the ref,\n    // so that any gc running later on the old map won't interfere\n    // (in case a new entry was added with the same key as a cleared entry)\n\n    this._map.clear()\n    this._map = new Map()\n  }\n\n  destroy () {\n    this._map = null\n    this._array = null\n  }\n\n  _gc () {\n    this._delete(Math.floor(Math.random() * this._array.length))\n  }\n\n  _delete (index) { // ~constant time\n    if (index >= this._array.length) throw new Error('Cannot delete unused index (logic bug?)')\n\n    const head = this._array.pop()\n    let removed = head\n\n    if (index < this._array.length) {\n      removed = this._array[index]\n      head.index = index\n      this._array[index] = head\n    }\n\n    removed.map.delete(removed.key)\n  }\n}\n\nmodule.exports = Rache\n{\n  \"name\": \"rache\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Random-eviction cache\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js --coverage\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/rache.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/rache/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/rache#readme\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"brittle\": \"^3.5.2\",\n    \"standard\": \"^17.1.0\"\n  }\n}\nmodule.exports = class RandomArrayIterator {\n  constructor (values) {\n    this.values = values\n    this.start = 0\n    this.length = this.values.length\n  }\n\n  next () {\n    if (this.length === 0) {\n      if (this.start === 0) return { done: true, value: undefined }\n      this.length = this.start\n      this.start = 0\n    }\n\n    const i = this.start + ((Math.random() * this.length) | 0)\n    const j = this.start + --this.length\n    const value = this.values[i]\n\n    this.values[i] = this.values[j]\n    this.values[j] = value\n\n    return { done: false, value }\n  }\n\n  dequeue () {\n    this.values[this.start + this.length] = this.values[this.values.length - 1]\n    this.values.pop()\n  }\n\n  requeue () {\n    const i = this.start + this.length\n    const value = this.values[i]\n    this.values[i] = this.values[this.start]\n    this.values[this.start++] = value\n  }\n\n  restart () {\n    this.start = 0\n    this.length = this.values.length\n    return this\n  }\n\n  [Symbol.iterator] () {\n    return this\n  }\n}\n{\n  \"name\": \"random-array-iterator\",\n  \"version\": \"1.0.0\",\n  \"description\": \"An iterator to iterate an array in random order with controls to requeue or dequeue elements during the iteration\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"standard\": \"^16.0.3\",\n    \"tape\": \"^5.0.1\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && tape test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/random-array-iterator.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/random-array-iterator/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/random-array-iterator\"\n}\nmodule.exports = require('crypto').randomBytes\n{\n  \"name\": \"randombytes\",\n  \"version\": \"2.1.0\",\n  \"description\": \"random bytes from browserify stand alone\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"standard && node test.js | tspec\",\n    \"phantom\": \"zuul --phantom -- test.js\",\n    \"local\": \"zuul --local --no-coverage -- test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git@github.com:crypto-browserify/randombytes.git\"\n  },\n  \"keywords\": [\n    \"crypto\",\n    \"random\"\n  ],\n  \"author\": \"\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/crypto-browserify/randombytes/issues\"\n  },\n  \"homepage\": \"https://github.com/crypto-browserify/randombytes\",\n  \"browser\": \"browser.js\",\n  \"devDependencies\": {\n    \"phantomjs\": \"^1.9.9\",\n    \"standard\": \"^10.0.2\",\n    \"tap-spec\": \"^2.1.2\",\n    \"tape\": \"^4.6.3\",\n    \"zuul\": \"^3.7.2\"\n  },\n  \"dependencies\": {\n    \"safe-buffer\": \"^5.1.0\"\n  }\n}\nconst EventEmitter = require('events')\n\nmodule.exports = class ReadyResource extends EventEmitter {\n  constructor () {\n    super()\n\n    this.opening = null\n    this.closing = null\n\n    this.opened = false\n    this.closed = false\n  }\n\n  ready () {\n    if (this.opening !== null) return this.opening\n    this.opening = open(this)\n    return this.opening\n  }\n\n  close () {\n    if (this.closing !== null) return this.closing\n    this.closing = close(this)\n    return this.closing\n  }\n\n  async _open () {\n    // add impl here\n  }\n\n  async _close () {\n    // add impl here\n  }\n}\n\nasync function open (self) {\n  // open after close\n  if (self.closing !== null) return\n\n  try {\n    await self._open()\n  } catch (err) {\n    self.close() // safe to run in bg\n    throw err\n  }\n\n  self.opened = true\n  self.emit('ready')\n}\n\nasync function close (self) {\n  try {\n    if (self.opened === false && self.opening !== null) await self.opening\n  } catch {\n    // ignore errors on closing\n  }\n  if (self.opened === true || self.opening === null) await self._close()\n  self.closed = true\n  self.emit('close')\n}\n{\n  \"name\": \"ready-resource\",\n  \"version\": \"1.2.0\",\n  \"description\": \"Modern single resource management\",\n  \"main\": \"index.js\",\n  \"imports\": {\n    \"events\": {\n      \"bare\": \"bare-events\",\n      \"default\": \"events\"\n    }\n  },\n  \"types\": \"index.d.ts\",\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\"\n  ],\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.0\",\n    \"standard\": \"^17.0.0\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/ready-resource.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/ready-resource/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/ready-resource\",\n  \"dependencies\": {\n    \"bare-events\": \"^2.2.0\"\n  }\n}\nmodule.exports = class RefCounter {\n  constructor() {\n    this.count = 0\n\n    this._onidle = null\n    this._idle = null\n  }\n\n  isIdle() {\n    return this.count === 0\n  }\n\n  idle() {\n    if (this.count === 0) return Promise.resolve()\n    if (this._idle !== null) return this._idle\n\n    this._idle = new Promise((resolve) => {\n      this._onidle = resolve\n    })\n\n    return this._idle\n  }\n\n  inc() {\n    this.count++\n  }\n\n  dec() {\n    if (--this.count > 0) return\n\n    if (this._onidle !== null) {\n      const resolve = this._onidle\n      this._idle = null\n      this._onidle = null\n      resolve()\n    }\n  }\n}\n{\n  \"name\": \"refcounter\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Simple refcounter\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/refcounter.git\"\n  },\n  \"author\": \"Holepunch Inc\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/refcounter/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/refcounter\"\n}\nmodule.exports = require.addon.bind(require)\n{\n  \"name\": \"require-addon\",\n  \"version\": \"1.2.0\",\n  \"description\": \"Import native addons across JavaScript runtimes\",\n  \"exports\": {\n    \"./package\": \"./package.json\",\n    \".\": {\n      \"bare\": \"./lib/bare.js\",\n      \"node\": \"./lib/node.js\",\n      \"default\": \"./lib/default.js\"\n    }\n  },\n  \"imports\": {\n    \"fs\": {\n      \"bare\": \"bare-fs\",\n      \"default\": \"fs\"\n    },\n    \"path\": {\n      \"bare\": \"bare-path\",\n      \"default\": \"path\"\n    },\n    \"url\": {\n      \"bare\": \"bare-url\",\n      \"default\": \"url\"\n    }\n  },\n  \"files\": [\n    \"lib\"\n  ],\n  \"scripts\": {\n    \"test\": \"npm run lint && npm run test:bare && npm run test:node\",\n    \"test:bare\": \"bare test.js\",\n    \"test:node\": \"node test.js\",\n    \"lint\": \"prettier --check .\",\n    \"format\": \"prettier --write .\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/require-addon.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/require-addon/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/require-addon#readme\",\n  \"engines\": {\n    \"bare\": \">=1.10.0\"\n  },\n  \"dependencies\": {\n    \"bare-addon-resolve\": \"^1.3.0\"\n  },\n  \"devDependencies\": {\n    \"bare-bundle\": \"^1.8.1\",\n    \"bare-bundle-evaluate\": \"^1.1.0\",\n    \"bare-fs\": \"^4.0.0\",\n    \"bare-path\": \"^3.0.0\",\n    \"bare-url\": \"^2.1.0\",\n    \"brittle\": \"^3.7.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\nlet tmpResolve = null\nlet tmpReject = null\n\nif (Promise.withResolvers) {\n  module.exports = Promise.withResolvers.bind(Promise)\n} else {\n  module.exports = function resolveRejectPromise () {\n    const promise = new Promise(setTmp)\n    const result = { promise, resolve: tmpResolve, reject: tmpReject }\n    tmpResolve = tmpReject = null\n    return result\n  }\n}\n\nfunction setTmp (resolve, reject) {\n  tmpResolve = resolve\n  tmpReject = reject\n}\n{\n  \"name\": \"resolve-reject-promise\",\n  \"version\": \"1.1.0\",\n  \"description\": \"Create an inverted promise with no function allocs\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"standard\"\n  },\n  \"devDependencies\": {\n    \"standard\": \"^17.1.2\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/resolve-reject-promise.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/resolve-reject-promise/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/resolve-reject-promise\"\n}\nconst resources = new Map()\n\nexports.add = function(resource, teardown) {\n  resources.set(resource, teardown)\n}\n\nexports.remove = function(resource) {\n  resources.delete(resource)\n}\n\nif (global.Bare) global.Bare.on('exit', run)\nelse global.process.on('exit', run)\n\nfunction run() {\n  for (const [resource, teardown] of resources) {\n    teardown(resource)\n  }\n}\n{\n  \"name\": \"resource-on-exit\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Register sync teardown handlers for a resource\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/bare-teardown.git\"\n  },\n  \"author\": \"Holepunch Inc.\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/bare-teardown/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/bare-teardown\"\n}\nrequire.addon = require('require-addon')\n\nmodule.exports = require.addon('.', __filename)\nconst ColumnFamily = require('./lib/column-family')\nconst Iterator = require('./lib/iterator')\nconst Snapshot = require('./lib/snapshot')\nconst State = require('./lib/state')\nconst { BloomFilterPolicy, RibbonFilterPolicy } = require('./lib/filter-policy')\nconst constants = require('./lib/constants')\n\nclass RocksDB {\n  constructor(path, opts = {}) {\n    const {\n      columnFamily,\n      state = new State(this, path, opts),\n      snapshot = null,\n      keyEncoding = null,\n      valueEncoding = null\n    } = opts\n\n    this._state = state\n    this._snapshot = snapshot\n    this._columnFamily = state.getColumnFamily(columnFamily)\n    this._keyEncoding = keyEncoding\n    this._valueEncoding = valueEncoding\n    this._index = -1\n\n    this._state.addSession(this)\n  }\n\n  get opened() {\n    return this._state.opened\n  }\n\n  get closed() {\n    return this.isRoot() ? this._state.closed : this._index === -1\n  }\n\n  get path() {\n    return this._state.path\n  }\n\n  get snapshotted() {\n    return this._snapshot !== null\n  }\n\n  get defaultColumnFamily() {\n    return this._columnFamily\n  }\n\n  session({\n    columnFamily = this._columnFamily,\n    snapshot = this._snapshot !== null,\n    keyEncoding = this._keyEncoding,\n    valueEncoding = this._valueEncoding\n  } = {}) {\n    maybeClosed(this)\n\n    return new RocksDB(null, {\n      state: this._state,\n      columnFamily,\n      snapshot: snapshot ? this._snapshot || new Snapshot(this._state) : null,\n      keyEncoding,\n      valueEncoding\n    })\n  }\n\n  columnFamily(name, opts) {\n    return this.session({ ...opts, columnFamily: name })\n  }\n\n  snapshot() {\n    return this.session({ snapshot: true })\n  }\n\n  isRoot() {\n    return this === this._state.db\n  }\n\n  ready() {\n    return this._state.ready()\n  }\n\n  async close({ force } = {}) {\n    if (!this._state.opened) await this._state.ready()\n\n    if (this._index !== -1) this._state.removeSession(this)\n\n    if (force) {\n      while (this._state.sessions.length > 0) {\n        await this._state.sessions[this._state.sessions.length - 1].close()\n      }\n    }\n\n    return this.isRoot() ? this._state.close() : Promise.resolve()\n  }\n\n  suspend() {\n    maybeClosed(this)\n\n    return this._state.suspend()\n  }\n\n  resume() {\n    maybeClosed(this)\n\n    return this._state.resume()\n  }\n\n  isIdle() {\n    return this._state.handles.isIdle()\n  }\n\n  idle() {\n    return this._state.handles.idle()\n  }\n\n  iterator(range, opts) {\n    maybeClosed(this)\n\n    return new Iterator(this, { ...range, ...opts })\n  }\n\n  async *keys(range, opts) {\n    for await (const { key } of this.iterator(range, {\n      ...opts,\n      values: false\n    })) {\n      yield key\n    }\n  }\n\n  async peek(range, opts) {\n    for await (const value of this.iterator({ ...range, ...opts, limit: 1 })) {\n      return value\n    }\n\n    return null\n  }\n\n  read(opts) {\n    maybeClosed(this)\n\n    return this._state.createReadBatch(this, opts)\n  }\n\n  write(opts) {\n    maybeClosed(this)\n\n    return this._state.createWriteBatch(this, opts)\n  }\n\n  flush(opts) {\n    maybeClosed(this)\n\n    return this._state.flush(this, opts)\n  }\n\n  async get(key, opts) {\n    const batch = this.read({ ...opts, capacity: 1, autoDestroy: true })\n    const value = batch.get(key)\n    batch.tryFlush()\n    return value\n  }\n\n  async put(key, value, opts) {\n    const batch = this.write({ ...opts, capacity: 1, autoDestroy: true })\n    batch.tryPut(key, value)\n    await batch.flush()\n  }\n\n  async delete(key, opts) {\n    const batch = this.write({ ...opts, capacity: 1, autoDestroy: true })\n    batch.tryDelete(key)\n    await batch.flush()\n  }\n\n  async deleteRange(start, end, opts) {\n    const batch = this.write({ ...opts, capacity: 1, autoDestroy: true })\n    batch.tryDeleteRange(start, end)\n    await batch.flush()\n  }\n\n  async compactRange(start = null, end = null, opts = {}) {\n    if (typeof end === 'object' && end !== null) {\n      opts = end\n      end = null\n    } else if (typeof start === 'object' && start !== null) {\n      opts = start\n      start = null\n      end = null\n    }\n\n    await this._state.compactRange(this, start, end, opts)\n  }\n\n  async approximateSize(start, end, opts = {}) {\n    return this._state.approximateSize(this, start, end, opts)\n  }\n\n  _ref() {\n    if (this._snapshot) this._snapshot.ref()\n    this._state.handles.inc()\n  }\n\n  _unref() {\n    if (this._snapshot) this._snapshot.unref()\n    this._state.handles.dec()\n  }\n}\n\nmodule.exports = exports = RocksDB\n\nexports.constants = constants\n\nexports.ColumnFamily = ColumnFamily\nexports.BloomFilterPolicy = BloomFilterPolicy\nexports.RibbonFilterPolicy = RibbonFilterPolicy\n\nfunction maybeClosed(db) {\n  if (db._state.closing || db._index === -1) throw new Error('RocksDB session is closed')\n}\nconst c = require('compact-encoding')\nconst binding = require('../binding')\n\nconst empty = Buffer.alloc(0)\nconst resolved = Promise.resolve()\n\nclass RocksDBBatch {\n  constructor(db, opts = {}) {\n    const { capacity = 8, autoDestroy = false } = opts\n\n    db._ref()\n\n    this._db = db\n    this._destroyed = false\n    this._capacity = capacity\n    this._operations = []\n    this._promises = []\n\n    this._enqueuePromise = this._enqueuePromise.bind(this)\n\n    this._request = null\n    this._resolve = null\n    this._reject = null\n\n    this._handle = null\n    this._buffer = null\n    this._autoDestroy = autoDestroy\n\n    if (db._state.opened === true) this.ready()\n  }\n\n  _reuse(db, opts = {}) {\n    const { autoDestroy = false } = opts\n\n    db._ref()\n\n    this._db = db\n    this._destroyed = false\n    this._autoDestroy = autoDestroy\n  }\n\n  _onfinished(err) {\n    const resolve = this._resolve\n    const reject = this._reject\n\n    if (this._request) this._db._state.io.dec()\n\n    this._operations = []\n    this._promises = []\n    this._request = null\n    this._resolve = null\n    this._reject = null\n\n    if (this._autoDestroy === true) this.destroy()\n\n    if (reject !== null && err) reject(err)\n    else if (resolve !== null) resolve()\n  }\n\n  _resize() {\n    if (this._operations.length <= this._capacity) return false\n\n    while (this._operations.length > this._capacity) {\n      this._capacity *= 2\n    }\n\n    return true\n  }\n\n  async ready() {\n    if (this._handle !== null) return\n\n    if (this._db._state.opened === false) await this._db._state.ready()\n\n    this._init()\n  }\n\n  destroy() {\n    if (this._request) throw new Error('Request in progress')\n    if (this._destroyed) return\n\n    this._destroyed = true\n\n    if (this._promises.length) this._abort()\n\n    this._db._unref()\n    this._onfree()\n  }\n\n  _onfree() {\n    this._db._state.freeBatch(this, false)\n    this._db = null\n  }\n\n  _abort() {\n    for (let i = 0; i < this._promises.length; i++) {\n      const promise = this._promises[i]\n      if (promise !== null) promise.reject(new Error('Batch is destroyed'))\n    }\n\n    this._onfinished(new Error('Batch is destroyed'))\n  }\n\n  async flush() {\n    if (this._request) throw new Error('Request in progress')\n    if (this._destroyed) throw new Error('Batch is destroyed')\n\n    this._request = new Promise((resolve, reject) => {\n      this._resolve = resolve\n      this._reject = reject\n    })\n\n    this._flush()\n\n    return this._request\n  }\n\n  tryFlush() {\n    if (this._request) throw new Error('Request in progress')\n    if (this._destroyed) throw new Error('Batch is destroyed')\n\n    this._request = resolved\n\n    this._flush()\n  }\n\n  async _flush() {\n    if (this._handle === null) await this.ready()\n\n    this._db._state.io.inc()\n\n    if (this._db._state.resumed !== null) {\n      const resumed = await this._db._state.resumed.promise\n\n      if (!resumed) {\n        if (this._destroyed) {\n          this._db._state.io.dec()\n        } else {\n          this._destroyed = true\n          this._abort()\n          this._db._unref()\n        }\n      }\n    }\n  }\n\n  _enqueuePromise(resolve, reject) {\n    this._promises.push({ resolve, reject })\n  }\n\n  _encodeKey(k) {\n    if (this._db._keyEncoding) return c.encode(this._db._keyEncoding, k)\n    if (typeof k === 'string') return Buffer.from(k)\n    return k\n  }\n\n  _encodeValue(v) {\n    if (this._db._valueEncoding) return c.encode(this._db._valueEncoding, v)\n    if (v === null) return empty\n    if (typeof v === 'string') return Buffer.from(v)\n    return v\n  }\n\n  _decodeValue(b) {\n    if (this._db._valueEncoding) return c.decode(this._db._valueEncoding, b)\n    return b\n  }\n}\n\nexports.ReadBatch = class RocksDBReadBatch extends RocksDBBatch {\n  constructor(db, opts = {}) {\n    super(db, opts)\n\n    const { asyncIO = false, fillCache = true } = opts\n\n    this._asyncIO = asyncIO\n    this._fillCache = fillCache\n  }\n\n  _init() {\n    this._handle = binding.readInit()\n    this._buffer = binding.readBuffer(this._handle, this._capacity)\n  }\n\n  _resize() {\n    if (super._resize() && this._handle !== null) {\n      this._buffer = binding.readBuffer(this._handle, this._capacity)\n    }\n  }\n\n  async _flush() {\n    await super._flush()\n\n    if (this._destroyed) return\n\n    try {\n      binding.read(\n        this._db._state._handle,\n        this._handle,\n        this._operations,\n        this._db._snapshot ? this._db._snapshot._handle : undefined,\n        this._asyncIO,\n        this._fillCache,\n        this,\n        this._onread\n      )\n    } catch (err) {\n      this._db._state.io.dec()\n      throw err\n    }\n  }\n\n  _onread(errs, values) {\n    let applied = true\n\n    for (let i = 0, n = this._promises.length; i < n; i++) {\n      const err = errs[i]\n      if (err) applied = false\n\n      const promise = this._promises[i]\n      if (promise === null) continue\n\n      if (err) promise.reject(new Error(err))\n      else promise.resolve(values[i] ? this._decodeValue(Buffer.from(values[i])) : null)\n    }\n\n    this._onfinished(applied ? null : new Error('Batch was not applied'))\n  }\n\n  get(key) {\n    if (this._request) throw new Error('Request already in progress')\n\n    const promise = new Promise(this._enqueuePromise)\n\n    this._operations.push(new RocksDBGet(this._encodeKey(key), this._db._columnFamily))\n\n    this._resize()\n\n    return promise\n  }\n}\n\nexports.WriteBatch = class RocksDBWriteBatch extends RocksDBBatch {\n  _init() {\n    this._handle = binding.writeInit()\n    this._buffer = binding.writeBuffer(this._handle, this._capacity)\n  }\n\n  _resize() {\n    if (super._resize() && this._handle !== null) {\n      this._buffer = binding.writeBuffer(this._handle, this._capacity)\n    }\n  }\n\n  _onfree() {\n    this._db._state.freeBatch(this, true)\n  }\n\n  async _flush() {\n    await super._flush()\n\n    if (this._destroyed) return\n\n    try {\n      binding.write(this._db._state._handle, this._handle, this._operations, this, this._onwrite)\n    } catch (err) {\n      this._db._state.io.dec()\n      throw err\n    }\n  }\n\n  _onwrite(err) {\n    const applied = !err\n\n    for (let i = 0, n = this._promises.length; i < n; i++) {\n      const promise = this._promises[i]\n      if (promise === null) continue\n\n      if (err) promise.reject(new Error(err))\n      else promise.resolve()\n    }\n\n    this._onfinished(applied ? null : new Error('Batch was not applied'))\n  }\n\n  put(key, value) {\n    if (this._request) throw new Error('Request already in progress')\n\n    const promise = new Promise(this._enqueuePromise)\n\n    this._operations.push(\n      new RocksDBPut(this._encodeKey(key), this._encodeValue(value), this._db._columnFamily)\n    )\n\n    this._resize()\n\n    return promise\n  }\n\n  tryPut(key, value) {\n    if (this._request) throw new Error('Request already in progress')\n\n    this._operations.push(\n      new RocksDBPut(this._encodeKey(key), this._encodeValue(value), this._db._columnFamily)\n    )\n\n    this._promises.push(null)\n\n    this._resize()\n  }\n\n  delete(key) {\n    if (this._request) throw new Error('Request already in progress')\n\n    const promise = new Promise(this._enqueuePromise)\n\n    this._operations.push(new RocksDBDelete(this._encodeKey(key), this._db._columnFamily))\n\n    this._resize()\n\n    return promise\n  }\n\n  tryDelete(key) {\n    if (this._request) throw new Error('Request already in progress')\n\n    this._operations.push(new RocksDBDelete(this._encodeKey(key), this._db._columnFamily))\n\n    this._promises.push(null)\n\n    this._resize()\n  }\n\n  deleteRange(start, end) {\n    if (this._request) throw new Error('Request already in progress')\n\n    const promise = new Promise(this._enqueuePromise)\n\n    this._operations.push(\n      new RocksDBDeleteRange(this._encodeKey(start), this._encodeKey(end), this._db._columnFamily)\n    )\n\n    this._resize()\n\n    return promise\n  }\n\n  tryDeleteRange(start, end) {\n    if (this._request) throw new Error('Request already in progress')\n\n    this._operations.push(\n      new RocksDBDeleteRange(this._encodeKey(start), this._encodeKey(end), this._db._columnFamily)\n    )\n\n    this._promises.push(null)\n\n    this._resize()\n  }\n}\n\nclass RocksDBGet {\n  constructor(key, columnFamily) {\n    this.key = key\n    this.columnFamily = columnFamily._handle\n  }\n\n  get type() {\n    return binding.GET\n  }\n}\n\nclass RocksDBPut {\n  constructor(key, value, columnFamily) {\n    this.key = key\n    this.value = value\n    this.columnFamily = columnFamily._handle\n  }\n\n  get type() {\n    return binding.PUT\n  }\n}\n\nclass RocksDBDelete {\n  constructor(key, columnFamily) {\n    this.key = key\n    this.columnFamily = columnFamily._handle\n  }\n\n  get type() {\n    return binding.DELETE\n  }\n}\n\nclass RocksDBDeleteRange {\n  constructor(start, end, columnFamily) {\n    this.start = start\n    this.end = end\n    this.columnFamily = columnFamily._handle\n  }\n\n  get type() {\n    return binding.DELETE_RANGE\n  }\n}\nconst binding = require('../binding')\nconst constants = require('./constants')\nconst { BloomFilterPolicy } = require('./filter-policy')\n\nclass RocksDBColumnFamily {\n  constructor(name, opts = {}) {\n    const {\n      // Blob options\n      enableBlobFiles = false,\n      minBlobSize = 0,\n      blobFileSize = 0,\n      enableBlobGarbageCollection = true,\n      // Block table options\n      tableBlockSize = 8192,\n      tableCacheIndexAndFilterBlocks = true,\n      tableFormatVersion = 6,\n      optimizeFiltersForMemory = false,\n      blockCache = true,\n      filterPolicy = new BloomFilterPolicy(10),\n      topLevelIndexPinningTier = constants.pinningTier.ALL,\n      partitionPinningTier = constants.pinningTier.ALL,\n      unpartitionedPinningTier = constants.pinningTier.ALL,\n      optimizeFiltersForHits = false,\n      numLevels = 7,\n      maxWriteBufferNumber = 2,\n      blobGarbageCollectionAgeCutOff = 0.25,\n      blobGarbageCollectionForceThreshold = 1.0\n    } = opts\n\n    this._name = name\n    this._flushing = null\n    this._options = {\n      enableBlobFiles,\n      minBlobSize,\n      blobFileSize,\n      enableBlobGarbageCollection,\n      tableBlockSize,\n      tableCacheIndexAndFilterBlocks,\n      tableFormatVersion,\n      optimizeFiltersForMemory,\n      blockCache,\n      filterPolicy,\n      topLevelIndexPinningTier,\n      partitionPinningTier,\n      unpartitionedPinningTier,\n      optimizeFiltersForHits,\n      numLevels,\n      maxWriteBufferNumber\n    }\n\n    const filterPolicyArguments = [0, 0, 0]\n\n    if (filterPolicy !== null) {\n      filterPolicyArguments[0] = filterPolicy.type\n\n      switch (filterPolicy.type) {\n        case 1: // Bloom filter policy\n          filterPolicyArguments[1] = filterPolicy.bitsPerKey\n          break\n        case 2: // Ribbon filter policy\n          filterPolicyArguments[1] = filterPolicy.bloomEquivalentBitsPerKey\n          filterPolicyArguments[2] = filterPolicy.bloomBeforeLevel\n\n          break\n      }\n    }\n\n    this._handle = binding.columnFamilyInit(\n      name,\n      enableBlobFiles,\n      minBlobSize,\n      blobFileSize,\n      enableBlobGarbageCollection,\n      tableBlockSize,\n      tableCacheIndexAndFilterBlocks,\n      tableFormatVersion,\n      optimizeFiltersForMemory,\n      blockCache === false,\n      ...filterPolicyArguments,\n      topLevelIndexPinningTier,\n      partitionPinningTier,\n      unpartitionedPinningTier,\n      optimizeFiltersForHits,\n      numLevels,\n      maxWriteBufferNumber,\n      blobGarbageCollectionAgeCutOff,\n      blobGarbageCollectionForceThreshold\n    )\n  }\n\n  cloneSettings(name) {\n    return new RocksDBColumnFamily(name, this._options)\n  }\n\n  get name() {\n    return this._name\n  }\n\n  destroy() {\n    if (this._handle === null) return\n\n    binding.columnFamilyDestroy(this._handle)\n\n    this._handle = null\n  }\n}\n\nmodule.exports = RocksDBColumnFamily\nmodule.exports = {\n  pinningTier: {\n    NONE: 0,\n    FLUSHED_AND_SIMILAR: 1,\n    ALL: 2\n  },\n  garbageCollectionPolicy: {\n    DEFAULT: 0,\n    FORCE: 1,\n    DISABLE: 2\n  },\n  bottommostLevelCompaction: {\n    NONE: 0,\n    SKIP: 1,\n    FORCE: 2\n  }\n}\nexports.BloomFilterPolicy = class RocksDBBloomFilterPolicy {\n  get type() {\n    return 1\n  }\n\n  constructor(bitsPerKey) {\n    this.bitsPerKey = bitsPerKey\n  }\n}\n\nexports.RibbonFilterPolicy = class RocksDBRibbonFilterPolicy {\n  get type() {\n    return 2\n  }\n\n  constructor(bloomEquivalentBitsPerKey, bloomBeforeLevel = 0) {\n    this.bloomEquivalentBitsPerKey = bloomEquivalentBitsPerKey\n    this.bloomBeforeLevel = bloomBeforeLevel\n  }\n}\nconst { Readable } = require('streamx')\nconst c = require('compact-encoding')\nconst binding = require('../binding')\n\nconst empty = Buffer.alloc(0)\n\nmodule.exports = class RocksDBIterator extends Readable {\n  constructor(db, opts = {}) {\n    const {\n      gt = null,\n      gte = null,\n      lt = null,\n      lte = null,\n      reverse = false,\n      values = true,\n      limit = Infinity,\n      capacity = 8\n    } = opts\n\n    super()\n\n    db._ref()\n\n    this._db = db\n\n    this._gt = gt ? this._encodeKey(gt) : empty\n    this._gte = gte ? this._encodeKey(gte) : empty\n    this._lt = lt ? this._encodeKey(lt) : empty\n    this._lte = lte ? this._encodeKey(lte) : empty\n\n    this._reverse = reverse\n    this._values = values\n    this._limit = limit < 0 ? Infinity : limit\n    this._capacity = capacity\n    this._opened = false\n\n    this._pendingOpen = null\n    this._pendingRead = null\n    this._pendingDestroy = null\n\n    this._buffer = null\n    this._handle = null\n\n    if (this._db._state.opened === true) this.ready()\n  }\n\n  _onopen(err) {\n    const cb = this._pendingOpen\n    this._pendingOpen = null\n    this._opened = true\n    this._db._state.io.dec()\n    cb(err)\n  }\n\n  _onread(err, keys, values) {\n    const cb = this._pendingRead\n    this._pendingRead = null\n    this._db._state.io.dec()\n    if (err) return cb(err)\n\n    const n = keys.length\n\n    this._limit -= n\n\n    for (let i = 0; i < n; i++) {\n      this.push({\n        key: this._decodeKey(Buffer.from(keys[i])),\n        value: this._values ? this._decodeValue(Buffer.from(values[i])) : null\n      })\n    }\n\n    if (n < this._capacity) this.push(null)\n\n    cb(null)\n  }\n\n  _onclose(err) {\n    const cb = this._pendingDestroy\n    this._pendingDestroy = null\n    this._db._state.io.dec()\n    this._db._unref()\n    cb(err)\n  }\n\n  _resize() {\n    if (this._handle !== null) {\n      this._buffer = binding.iteratorBuffer(this._handle, this._capacity)\n    }\n  }\n\n  async ready() {\n    if (this._handle !== null) return\n\n    if (this._db._state.opened === false) await this._db._state.ready()\n\n    this._init()\n  }\n\n  _init() {\n    this._handle = binding.iteratorInit()\n    this._buffer = binding.iteratorBuffer(this._handle, this._capacity)\n  }\n\n  async _open(cb) {\n    await this.ready()\n\n    this._db._state.io.inc()\n\n    if (this._db._state.resumed !== null) {\n      const resumed = await this._db._state.resumed.promise\n\n      if (!resumed) {\n        this._db._state.io.dec()\n\n        return cb(new Error('RocksDB session is closed'))\n      }\n    }\n\n    this._pendingOpen = cb\n\n    try {\n      binding.iteratorOpen(\n        this._db._state._handle,\n        this._handle,\n        this._db._columnFamily._handle,\n        this._gt,\n        this._gte,\n        this._lt,\n        this._lte,\n        this._reverse,\n        !this._values, // Keys only\n        this._db._snapshot ? this._db._snapshot._handle : undefined,\n        this,\n        this._onopen,\n        this._onclose,\n        this._onread\n      )\n    } catch (err) {\n      this._db._state.io.dec()\n\n      cb(err)\n    }\n  }\n\n  async _read(cb) {\n    this._db._state.io.inc()\n\n    if (this._db._state.resumed !== null) {\n      const resumed = await this._db._state.resumed.promise\n\n      if (!resumed) {\n        this._db._state.io.dec()\n\n        return cb(new Error('RocksDB session is closed'))\n      }\n    }\n\n    this._pendingRead = cb\n\n    try {\n      binding.iteratorRead(this._handle, Math.min(this._capacity, this._limit))\n    } catch (err) {\n      this._db._state.io.dec()\n\n      cb(err)\n    }\n  }\n\n  async _destroy(cb) {\n    await this.ready()\n\n    this._db._state.io.inc()\n\n    if (this._opened === false) {\n      this._db._state.io.dec()\n      this._db._unref()\n\n      return cb(null)\n    }\n\n    this._pendingDestroy = cb\n\n    try {\n      binding.iteratorClose(this._handle)\n    } catch (err) {\n      this._db._state.io.dec()\n      this._db._unref()\n\n      cb(err)\n    }\n  }\n\n  _encodeKey(k) {\n    if (this._db._keyEncoding !== null) return c.encode(this._db._keyEncoding, k)\n    if (typeof k === 'string') return Buffer.from(k)\n    return k\n  }\n\n  _decodeKey(b) {\n    if (this._db._keyEncoding !== null) return c.decode(this._db._keyEncoding, b)\n    return b\n  }\n\n  _decodeValue(b) {\n    if (this._db._valueEncoding !== null) return c.decode(this._db._valueEncoding, b)\n    return b\n  }\n}\nconst binding = require('../binding')\n\nmodule.exports = class RocksDBSnapshot {\n  constructor(state) {\n    this._state = state\n\n    this._handle = null\n    this._refs = 0\n\n    if (state.deferSnapshotInit === false) this._init()\n  }\n\n  _init() {\n    this._handle = binding.snapshotCreate(this._state._handle)\n  }\n\n  ref() {\n    this._refs++\n  }\n\n  unref() {\n    if (--this._refs > 0) return\n\n    if (this._handle === null) return\n\n    binding.snapshotDestroy(this._handle)\n\n    this._handle = null\n  }\n}\nconst ReadyResource = require('ready-resource')\nconst RefCounter = require('refcounter')\nconst rrp = require('resolve-reject-promise')\nconst SignalPromise = require('signal-promise')\nconst c = require('compact-encoding')\nconst { ReadBatch, WriteBatch } = require('./batch')\nconst ColumnFamily = require('./column-family')\nconst binding = require('../binding')\nconst constants = require('./constants')\n\nconst MAX_BATCH_REUSE = 64\nconst empty = Buffer.alloc(0)\n\nmodule.exports = class RocksDBState extends ReadyResource {\n  constructor(db, path, opts) {\n    super()\n\n    const {\n      columnFamily = new ColumnFamily('default', opts),\n      columnFamilies = [],\n      readOnly = false,\n      createIfMissing = true,\n      createMissingColumnFamilies = true,\n      maxBackgroundJobs = 6,\n      bytesPerSync = 1048576,\n      maxOpenFiles = -1,\n      useDirectReads = false,\n      avoidUnnecessaryBlockingIO = false,\n      skipStatsUpdateOnOpen = false,\n      useDirectIOForFlushAndCompaction = false,\n      maxFileOpeningThreads = 16,\n      lock = null\n    } = opts\n\n    this.path = path\n    this.db = db\n    this.handles = new RefCounter()\n    this.io = new RefCounter()\n    this.sessions = []\n    this.columnFamilies = [columnFamily]\n    this.deferSnapshotInit = true\n    this.resumed = null\n\n    this._suspended = false\n    this._suspending = false\n    this._updating = false\n    this._updatingSignal = new SignalPromise()\n    this._columnsFlushed = false\n    this._lock = lock\n    this._readBatches = []\n    this._writeBatches = []\n\n    for (const columnFamily of columnFamilies) {\n      this.columnFamilies.push(\n        typeof columnFamily === 'string' ? new ColumnFamily(columnFamily, opts) : columnFamily\n      )\n    }\n\n    this._handle = binding.init(\n      readOnly,\n      createIfMissing,\n      createMissingColumnFamilies,\n      maxBackgroundJobs,\n      bytesPerSync,\n      maxOpenFiles,\n      useDirectReads,\n      avoidUnnecessaryBlockingIO,\n      skipStatsUpdateOnOpen,\n      useDirectIOForFlushAndCompaction,\n      maxFileOpeningThreads\n    )\n  }\n\n  createReadBatch(db, opts) {\n    if (this._readBatches.length === 0) return new ReadBatch(db, opts)\n    const batch = this._readBatches.pop()\n    batch._reuse(db, opts)\n    return batch\n  }\n\n  createWriteBatch(db, opts) {\n    if (this._writeBatches.length === 0) return new WriteBatch(db, opts)\n    const batch = this._writeBatches.pop()\n    batch._reuse(db, opts)\n    return batch\n  }\n\n  freeBatch(batch, writable) {\n    if (batch._capacity > 16) return\n    const queue = writable ? this._writeBatches : this._readBatches\n    if (queue.length >= MAX_BATCH_REUSE) return\n    queue.push(batch)\n  }\n\n  addSession(db) {\n    db._index = this.sessions.push(db) - 1\n    if (db._snapshot) db._snapshot.ref()\n  }\n\n  removeSession(db) {\n    const head = this.sessions.pop()\n    if (head !== db) this.sessions[(head._index = db._index)] = head\n    db._index = -1\n    if (db._snapshot) db._snapshot.unref()\n  }\n\n  upsertColumnFamily(c) {\n    if (typeof c === 'string') {\n      let col = this.getColumnFamilyByName(c)\n      if (col) return col\n      col = this.columnFamilies[0].cloneSettings(c)\n      this.columnFamilies.push(col)\n      return col\n    }\n\n    if (this.columnFamilies.includes(c)) return c\n    this.columnFamilies.push(c)\n    return c\n  }\n\n  getColumnFamily(c) {\n    if (!c) return this.columnFamilies[0]\n    if (!this._columnsFlushed) return this.upsertColumnFamily(c)\n\n    if (typeof c !== 'string') return c\n\n    const col = this.getColumnFamilyByName(c)\n    if (col === null) throw new Error('Unknown column family')\n    return col\n  }\n\n  getColumnFamilyByName(name) {\n    for (const col of this.columnFamilies) {\n      if (col.name === name) return col\n    }\n    return null\n  }\n\n  async _open() {\n    await Promise.resolve() // Allow column families to populate if on-demand\n\n    if (this._lock) await this._lock.ready()\n\n    const req = { resolve: null, reject: null, handle: null }\n\n    const promise = new Promise((resolve, reject) => {\n      req.resolve = resolve\n      req.reject = reject\n    })\n\n    this._columnsFlushed = true\n\n    const lock = this._lock === null ? -1 : this._lock.transfer()\n\n    req.handle = binding.open(\n      this._handle,\n      this,\n      this.path,\n      this.columnFamilies.map((c) => c._handle),\n      lock,\n      req,\n      onopen\n    )\n\n    await promise\n\n    this.deferSnapshotInit = false\n\n    for (const session of this.sessions) {\n      if (session._snapshot) session._snapshot._init()\n    }\n\n    function onopen(err) {\n      if (err) req.reject(new Error(err))\n      else req.resolve()\n    }\n  }\n\n  async _close() {\n    while (this._updating) await this._updatingSignal.wait()\n    if (this.resumed) this.resumed.resolve(false)\n\n    while (!this.io.isIdle()) await this.io.idle()\n    while (!this.handles.isIdle()) await this.handles.idle()\n\n    while (this.sessions.length > 0) {\n      await this.sessions[this.sessions.length - 1].close()\n    }\n\n    for (const columnFamily of this.columnFamilies) columnFamily.destroy()\n\n    const req = { resolve: null, reject: null, handle: null }\n\n    const promise = new Promise((resolve, reject) => {\n      req.resolve = resolve\n      req.reject = reject\n    })\n\n    req.handle = binding.close(this._handle, req, onclose)\n\n    try {\n      await promise\n    } finally {\n      if (this._lock) await this._lock.close()\n    }\n\n    function onclose(err) {\n      if (err) req.reject(new Error(err))\n      else req.resolve()\n    }\n  }\n\n  async flush(db, opts) {\n    if (this.opened === false) await this.ready()\n\n    this.io.inc()\n\n    if (this.resumed !== null) {\n      const resumed = await this.resumed.promise\n\n      if (!resumed) {\n        this.io.dec()\n\n        throw new Error('RocksDB session is closed')\n      }\n    }\n\n    const req = { resolve: null, reject: null, handle: null }\n\n    const promise = new Promise((resolve, reject) => {\n      req.resolve = resolve\n      req.reject = reject\n    })\n\n    try {\n      req.handle = binding.flush(this._handle, db._columnFamily._handle, req, onflush)\n\n      await promise\n    } finally {\n      this.io.dec()\n    }\n\n    function onflush(err) {\n      if (err) req.reject(new Error(err))\n      else req.resolve()\n    }\n  }\n\n  suspend() {\n    this._suspending = true\n    return this.update()\n  }\n\n  resume() {\n    this._suspending = false\n    return this.update()\n  }\n\n  async update() {\n    while (this._updating) await this._updatingSignal.wait()\n    if (this._suspending === this._suspended || this.closing) return\n    this._updating = true\n    try {\n      if (this._suspending) await this._suspend()\n      else await this._resume()\n    } finally {\n      this._updating = false\n      this._updatingSignal.notify()\n    }\n  }\n\n  async _suspend() {\n    if (this._suspended === true) return\n\n    while (!this.io.isIdle()) await this.io.idle()\n\n    this.io.inc()\n    this.resumed = rrp()\n\n    const req = { resolve: null, reject: null, handle: null }\n\n    const promise = new Promise((resolve, reject) => {\n      req.resolve = resolve\n      req.reject = reject\n    })\n\n    try {\n      req.handle = binding.suspend(this._handle, req, onsuspend)\n\n      await promise\n\n      this._suspended = true\n    } finally {\n      this.io.dec()\n    }\n\n    function onsuspend(err) {\n      if (err) req.reject(new Error(err))\n      else req.resolve()\n    }\n  }\n\n  async _resume() {\n    if (this._suspended === false) return\n\n    const req = { resolve: null, reject: null, handle: null }\n\n    const promise = new Promise((resolve, reject) => {\n      req.resolve = resolve\n      req.reject = reject\n    })\n\n    req.handle = binding.resume(this._handle, req, onresume)\n\n    await promise\n\n    this._suspended = false\n\n    const resumed = this.resumed\n    this.resumed = null\n    resumed.resolve(true)\n\n    function onresume(err) {\n      if (err) req.reject(new Error(err))\n      else req.resolve()\n    }\n  }\n\n  async compactRange(db, start, end, opts) {\n    if (this.opened === false) await this.ready()\n\n    this.io.inc()\n\n    const {\n      exclusive = false,\n      blobGarbageCollectionPolicy = constants.garbageCollectionPolicy.DEFAULT,\n      blobGarbageCollectionAgeCutoff = 0.25,\n      bottommostLevelCompaction = constants.bottommostLevelCompaction.NONE\n    } = opts\n\n    start = this._encodeKey(start)\n    end = this._encodeKey(end)\n\n    const req = { resolve: null, reject: null, handle: null, start, end }\n\n    const promise = new Promise((resolve, reject) => {\n      req.resolve = resolve\n      req.reject = reject\n    })\n\n    try {\n      req.handle = binding.compactRange(\n        this._handle,\n        db._columnFamily._handle,\n        start,\n        end,\n        exclusive,\n        blobGarbageCollectionPolicy,\n        blobGarbageCollectionAgeCutoff,\n        bottommostLevelCompaction,\n        req,\n        oncompactrange\n      )\n\n      await promise\n    } finally {\n      this.io.dec()\n    }\n\n    function oncompactrange(err) {\n      if (err) req.reject(new Error(err))\n      else req.resolve()\n    }\n  }\n\n  async approximateSize(db, start, end, opts) {\n    if (this.opened === false) await this.ready()\n\n    this.io.inc()\n\n    const { includeMemtables = false, includeFiles = true, filesSizeErrorMargin = -1 } = opts\n\n    start = this._encodeKey(start)\n    end = this._encodeKey(end)\n\n    const req = { resolve: null, reject: null, handle: null, start, end }\n\n    const promise = new Promise((resolve, reject) => {\n      req.resolve = resolve\n      req.reject = reject\n    })\n\n    try {\n      req.handle = binding.approximateSize(\n        this._handle,\n        db._columnFamily._handle,\n        start,\n        end,\n        includeMemtables,\n        includeFiles,\n        filesSizeErrorMargin,\n        req,\n        onapproximatesize\n      )\n\n      return await promise\n    } finally {\n      this.io.dec()\n    }\n\n    function onapproximatesize(err, result) {\n      if (err) req.reject(new Error(err))\n      else req.resolve(result)\n    }\n  }\n\n  _encodeKey(k) {\n    if (this.db._keyEncoding) return c.encode(this.db._keyEncoding, k)\n    if (typeof k === 'string') return Buffer.from(k)\n    if (k === null) return empty\n    return k\n  }\n}\n{\n  \"name\": \"rocksdb-native\",\n  \"version\": \"3.12.0\",\n  \"description\": \"librocksdb bindings for JavaScript\",\n  \"exports\": {\n    \".\": \"./index.js\",\n    \"./package\": \"./package.json\"\n  },\n  \"imports\": {\n    \"crypto\": {\n      \"bare\": \"bare-crypto\",\n      \"default\": \"crypto\"\n    },\n    \"fs\": {\n      \"bare\": \"bare-fs\",\n      \"default\": \"fs\"\n    },\n    \"path\": {\n      \"bare\": \"bare-path\",\n      \"default\": \"path\"\n    }\n  },\n  \"files\": [\n    \"index.js\",\n    \"binding.cc\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"lib\",\n    \"prebuilds\",\n    \"!prebuilds/android-*/**/*.node\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"lint\": \"prettier --check . && lunte\",\n    \"test\": \"npm run test:node && npm run test:bare\",\n    \"test:bare\": \"brittle-bare test.js\",\n    \"test:node\": \"brittle-node test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/rocksdb-native.git\"\n  },\n  \"author\": \"Holepunch Inc\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/rocksdb-native/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/rocksdb-native\",\n  \"engines\": {\n    \"bare\": \">=1.16.0\"\n  },\n  \"dependencies\": {\n    \"compact-encoding\": \"^2.15.0\",\n    \"ready-resource\": \"^1.0.0\",\n    \"refcounter\": \"^1.0.0\",\n    \"require-addon\": \"^1.0.2\",\n    \"resolve-reject-promise\": \"^1.1.0\",\n    \"signal-promise\": \"^1.0.3\",\n    \"streamx\": \"^2.16.1\"\n  },\n  \"devDependencies\": {\n    \"bare-compat-napi\": \"^1.3.0\",\n    \"bare-crypto\": \"^1.12.0\",\n    \"bare-fs\": \"^4.5.0\",\n    \"bare-path\": \"^3.0.0\",\n    \"brittle\": \"^3.5.0\",\n    \"cmake-bare\": \"^1.1.14\",\n    \"cmake-fetch\": \"^1.0.1\",\n    \"cmake-napi\": \"^1.0.6\",\n    \"fd-lock\": \"^2.0.0\",\n    \"lunte\": \"^1.3.0\",\n    \"paparam\": \"^1.9.0\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^2.0.0\"\n  }\n}\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n  for (var key in src) {\n    dst[key] = src[key]\n  }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n  module.exports = buffer\n} else {\n  // Copy properties from require('buffer')\n  copyProps(buffer, exports)\n  exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n  if (typeof arg === 'number') {\n    throw new TypeError('Argument must not be a number')\n  }\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  var buf = Buffer(size)\n  if (fill !== undefined) {\n    if (typeof encoding === 'string') {\n      buf.fill(fill, encoding)\n    } else {\n      buf.fill(fill)\n    }\n  } else {\n    buf.fill(0)\n  }\n  return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return buffer.SlowBuffer(size)\n}\n{\n  \"name\": \"safe-buffer\",\n  \"description\": \"Safer Node.js Buffer API\",\n  \"version\": \"5.2.1\",\n  \"author\": {\n    \"name\": \"Feross Aboukhadijeh\",\n    \"email\": \"feross@feross.org\",\n    \"url\": \"https://feross.org\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/feross/safe-buffer/issues\"\n  },\n  \"devDependencies\": {\n    \"standard\": \"*\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"homepage\": \"https://github.com/feross/safe-buffer\",\n  \"keywords\": [\n    \"buffer\",\n    \"buffer allocate\",\n    \"node security\",\n    \"safe\",\n    \"safe-buffer\",\n    \"security\",\n    \"uninitialized\"\n  ],\n  \"license\": \"MIT\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/feross/safe-buffer.git\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && tape test/*.js\"\n  },\n  \"funding\": [\n    {\n      \"type\": \"github\",\n      \"url\": \"https://github.com/sponsors/feross\"\n    },\n    {\n      \"type\": \"patreon\",\n      \"url\": \"https://www.patreon.com/feross\"\n    },\n    {\n      \"type\": \"consulting\",\n      \"url\": \"https://feross.org/support\"\n    }\n  ]\n}\nmodule.exports = safetyCatch\n\nfunction isActuallyUncaught (err) {\n  if (!err) return false\n  return err instanceof TypeError ||\n    err instanceof SyntaxError ||\n    err instanceof ReferenceError ||\n    err instanceof EvalError ||\n    err instanceof RangeError ||\n    err instanceof URIError ||\n    err.code === 'ERR_ASSERTION'\n}\n\nfunction throwErrorNT (err) {\n  queueMicrotask(() => { throw err })\n}\n\nfunction safetyCatch (err) {\n  if (isActuallyUncaught(err)) {\n    throwErrorNT(err)\n    throw err\n  }\n}\n{\n  \"name\": \"safety-catch\",\n  \"version\": \"1.0.2\",\n  \"description\": \"Small module that makes sure your catch, caught an actual error and not a programming mistake or assertion\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/safety-catch.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/safety-catch/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/safety-catch\"\n}\nlet tmpResolve = null\n\nmodule.exports = class ScopeLock {\n  constructor ({ debounce = false } = {}) {\n    this.debounce = debounce\n    this.waiting = []\n    this.locked = false\n    this.skip = 0\n    this.destroyed = false\n  }\n\n  flush () {\n    if (this.locked === false && this.waiting.length === 0) return Promise.resolve(this.destroyed === false)\n\n    const promise = new Promise(setTmpResolve)\n    const resolve = tmpResolve\n\n    tmpResolve = null\n    this.waiting.push({ lock: false, resolve })\n\n    return promise\n  }\n\n  destroy () {\n    this.destroyed = true\n  }\n\n  lock () {\n    const promise = new Promise(setTmpResolve)\n    const resolve = tmpResolve\n\n    tmpResolve = null\n\n    if (this.locked === true) {\n      this.waiting.push({ lock: true, resolve })\n      return promise\n    }\n\n    if (this.destroyed === true) {\n      resolve(false)\n      return promise\n    }\n\n    this.locked = true\n    resolve(true)\n\n    return promise\n  }\n\n  unlock () {\n    if (this.destroyed === true) {\n      for (let i = 0; i < this.waiting.length; i++) {\n        this.waiting[i].resolve(false)\n      }\n      this.waiting = []\n      this.skip = 0\n      this.locked = false\n      return\n    }\n\n    if (this.skip !== 0) {\n      for (let i = 0; i < this.skip; i++) {\n        const { lock, resolve } = this.waiting[i]\n        resolve(lock === false)\n      }\n\n      this.waiting = this.waiting.slice(this.skip)\n      this.skip = 0\n    }\n\n    while (this.waiting.length > 0 && this.waiting[0].lock === false) {\n      this.waiting.shift().resolve(true)\n    }\n\n    if (this.waiting.length === 0) {\n      this.locked = false\n      return\n    }\n\n    const { resolve } = this.waiting.shift()\n    if (this.debounce === true) this.skip = this.waiting.length\n\n    resolve(true)\n  }\n}\n\nfunction setTmpResolve (resolve) {\n  tmpResolve = resolve\n}\n{\n  \"name\": \"scope-lock\",\n  \"version\": \"1.2.4\",\n  \"description\": \"Some concurrency semantics around entering scopes\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"devDependencies\": {\n    \"brittle\": \"^3.7.0\",\n    \"standard\": \"^17.1.2\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/scope-lock.git\"\n  },\n  \"author\": \"Holepunch Inc.\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/scope-lock/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/scope-lock\"\n}\n'use strict'\nmodule.exports = require('bindings')('secp256k1')\n'use strict'\nmodule.exports = require('./lib')(require('./lib/elliptic'))\n'use strict'\ntry {\n  module.exports = require('./bindings')\n} catch (err) {\n  if (process.env.DEBUG) {\n    console.error('Secp256k1 bindings are not compiled. Pure JS implementation will be used.')\n  }\n\n  module.exports = require('./elliptic')\n}\n'use strict'\nvar toString = Object.prototype.toString\n\n// TypeError\nexports.isArray = function (value, message) {\n  if (!Array.isArray(value)) throw TypeError(message)\n}\n\nexports.isBoolean = function (value, message) {\n  if (toString.call(value) !== '[object Boolean]') throw TypeError(message)\n}\n\nexports.isBuffer = function (value, message) {\n  if (!Buffer.isBuffer(value)) throw TypeError(message)\n}\n\nexports.isFunction = function (value, message) {\n  if (toString.call(value) !== '[object Function]') throw TypeError(message)\n}\n\nexports.isNumber = function (value, message) {\n  if (toString.call(value) !== '[object Number]') throw TypeError(message)\n}\n\nexports.isObject = function (value, message) {\n  if (toString.call(value) !== '[object Object]') throw TypeError(message)\n}\n\n// RangeError\nexports.isBufferLength = function (buffer, length, message) {\n  if (buffer.length !== length) throw RangeError(message)\n}\n\nexports.isBufferLength2 = function (buffer, length1, length2, message) {\n  if (buffer.length !== length1 && buffer.length !== length2) throw RangeError(message)\n}\n\nexports.isLengthGTZero = function (value, message) {\n  if (value.length === 0) throw RangeError(message)\n}\n\nexports.isNumberInInterval = function (number, x, y, message) {\n  if (number <= x || number >= y) throw RangeError(message)\n}\n'use strict'\nvar Buffer = require('safe-buffer').Buffer\nvar bip66 = require('bip66')\n\nvar EC_PRIVKEY_EXPORT_DER_COMPRESSED = Buffer.from([\n  // begin\n  0x30, 0x81, 0xd3, 0x02, 0x01, 0x01, 0x04, 0x20,\n  // private key\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  // middle\n  0xa0, 0x81, 0x85, 0x30, 0x81, 0x82, 0x02, 0x01, 0x01, 0x30, 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48,\n  0xcE, 0x3d, 0x01, 0x01, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xfE, 0xff, 0xff, 0xfc, 0x2f, 0x30, 0x06, 0x04, 0x01, 0x00, 0x04, 0x01, 0x07, 0x04,\n  0x21, 0x02, 0x79, 0xbE, 0x66, 0x7E, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xcE, 0x87,\n  0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xcE, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8,\n  0x17, 0x98, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xfE, 0xba, 0xaE, 0xdc, 0xE6, 0xaf, 0x48, 0xa0, 0x3b, 0xbf, 0xd2, 0x5E,\n  0x8c, 0xd0, 0x36, 0x41, 0x41, 0x02, 0x01, 0x01, 0xa1, 0x24, 0x03, 0x22, 0x00,\n  // public key\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00\n])\n\nvar EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED = Buffer.from([\n  // begin\n  0x30, 0x82, 0x01, 0x13, 0x02, 0x01, 0x01, 0x04, 0x20,\n  // private key\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  // middle\n  0xa0, 0x81, 0xa5, 0x30, 0x81, 0xa2, 0x02, 0x01, 0x01, 0x30, 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48,\n  0xcE, 0x3d, 0x01, 0x01, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xfE, 0xff, 0xff, 0xfc, 0x2f, 0x30, 0x06, 0x04, 0x01, 0x00, 0x04, 0x01, 0x07, 0x04,\n  0x41, 0x04, 0x79, 0xbE, 0x66, 0x7E, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xcE, 0x87,\n  0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xcE, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8,\n  0x17, 0x98, 0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65, 0x5d, 0xa4, 0xfb, 0xfc, 0x0E, 0x11,\n  0x08, 0xa8, 0xfd, 0x17, 0xb4, 0x48, 0xa6, 0x85, 0x54, 0x19, 0x9c, 0x47, 0xd0, 0x8f, 0xfb, 0x10,\n  0xd4, 0xb8, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xfE, 0xba, 0xaE, 0xdc, 0xE6, 0xaf, 0x48, 0xa0, 0x3b, 0xbf, 0xd2, 0x5E,\n  0x8c, 0xd0, 0x36, 0x41, 0x41, 0x02, 0x01, 0x01, 0xa1, 0x44, 0x03, 0x42, 0x00,\n  // public key\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00\n])\n\nexports.privateKeyExport = function (privateKey, publicKey, compressed) {\n  var result = Buffer.from(compressed ? EC_PRIVKEY_EXPORT_DER_COMPRESSED : EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED)\n  privateKey.copy(result, compressed ? 8 : 9)\n  publicKey.copy(result, compressed ? 181 : 214)\n  return result\n}\n\nexports.privateKeyImport = function (privateKey) {\n  var length = privateKey.length\n\n  // sequence header\n  var index = 0\n  if (length < index + 1 || privateKey[index] !== 0x30) return\n  index += 1\n\n  // sequence length constructor\n  if (length < index + 1 || !(privateKey[index] & 0x80)) return\n\n  var lenb = privateKey[index] & 0x7f\n  index += 1\n  if (lenb < 1 || lenb > 2) return\n  if (length < index + lenb) return\n\n  // sequence length\n  var len = privateKey[index + lenb - 1] | (lenb > 1 ? privateKey[index + lenb - 2] << 8 : 0)\n  index += lenb\n  if (length < index + len) return\n\n  // sequence element 0: version number (=1)\n  if (length < index + 3 ||\n      privateKey[index] !== 0x02 ||\n      privateKey[index + 1] !== 0x01 ||\n      privateKey[index + 2] !== 0x01) {\n    return\n  }\n  index += 3\n\n  // sequence element 1: octet string, up to 32 bytes\n  if (length < index + 2 ||\n      privateKey[index] !== 0x04 ||\n      privateKey[index + 1] > 0x20 ||\n      length < index + 2 + privateKey[index + 1]) {\n    return\n  }\n\n  return privateKey.slice(index + 2, index + 2 + privateKey[index + 1])\n}\n\nexports.signatureExport = function (sigObj) {\n  var r = Buffer.concat([Buffer.from([0]), sigObj.r])\n  for (var lenR = 33, posR = 0; lenR > 1 && r[posR] === 0x00 && !(r[posR + 1] & 0x80); --lenR, ++posR);\n\n  var s = Buffer.concat([Buffer.from([0]), sigObj.s])\n  for (var lenS = 33, posS = 0; lenS > 1 && s[posS] === 0x00 && !(s[posS + 1] & 0x80); --lenS, ++posS);\n\n  return bip66.encode(r.slice(posR), s.slice(posS))\n}\n\nexports.signatureImport = function (sig) {\n  var r = Buffer.alloc(32, 0)\n  var s = Buffer.alloc(32, 0)\n\n  try {\n    var sigObj = bip66.decode(sig)\n    if (sigObj.r.length === 33 && sigObj.r[0] === 0x00) sigObj.r = sigObj.r.slice(1)\n    if (sigObj.r.length > 32) throw new Error('R length is too long')\n    if (sigObj.s.length === 33 && sigObj.s[0] === 0x00) sigObj.s = sigObj.s.slice(1)\n    if (sigObj.s.length > 32) throw new Error('S length is too long')\n  } catch (err) {\n    return\n  }\n\n  sigObj.r.copy(r, 32 - sigObj.r.length)\n  sigObj.s.copy(s, 32 - sigObj.s.length)\n\n  return { r: r, s: s }\n}\n\nexports.signatureImportLax = function (sig) {\n  var r = Buffer.alloc(32, 0)\n  var s = Buffer.alloc(32, 0)\n\n  var length = sig.length\n  var index = 0\n\n  // sequence tag byte\n  if (sig[index++] !== 0x30) return\n\n  // sequence length byte\n  var lenbyte = sig[index++]\n  if (lenbyte & 0x80) {\n    index += lenbyte - 0x80\n    if (index > length) return\n  }\n\n  // sequence tag byte for r\n  if (sig[index++] !== 0x02) return\n\n  // length for r\n  var rlen = sig[index++]\n  if (rlen & 0x80) {\n    lenbyte = rlen - 0x80\n    if (index + lenbyte > length) return\n    for (; lenbyte > 0 && sig[index] === 0x00; index += 1, lenbyte -= 1);\n    for (rlen = 0; lenbyte > 0; index += 1, lenbyte -= 1) rlen = (rlen << 8) + sig[index]\n  }\n  if (rlen > length - index) return\n  var rindex = index\n  index += rlen\n\n  // sequence tag byte for s\n  if (sig[index++] !== 0x02) return\n\n  // length for s\n  var slen = sig[index++]\n  if (slen & 0x80) {\n    lenbyte = slen - 0x80\n    if (index + lenbyte > length) return\n    for (; lenbyte > 0 && sig[index] === 0x00; index += 1, lenbyte -= 1);\n    for (slen = 0; lenbyte > 0; index += 1, lenbyte -= 1) slen = (slen << 8) + sig[index]\n  }\n  if (slen > length - index) return\n  var sindex = index\n  index += slen\n\n  // ignore leading zeros in r\n  for (; rlen > 0 && sig[rindex] === 0x00; rlen -= 1, rindex += 1);\n  // copy r value\n  if (rlen > 32) return\n  var rvalue = sig.slice(rindex, rindex + rlen)\n  rvalue.copy(r, 32 - rvalue.length)\n\n  // ignore leading zeros in s\n  for (; slen > 0 && sig[sindex] === 0x00; slen -= 1, sindex += 1);\n  // copy s value\n  if (slen > 32) return\n  var svalue = sig.slice(sindex, sindex + slen)\n  svalue.copy(s, 32 - svalue.length)\n\n  return { r: r, s: s }\n}\n'use strict'\nvar Buffer = require('safe-buffer').Buffer\nvar createHash = require('create-hash')\nvar BN = require('bn.js')\nvar EC = require('elliptic').ec\n\nvar messages = require('../messages.json')\n\nvar ec = new EC('secp256k1')\nvar ecparams = ec.curve\n\nfunction loadCompressedPublicKey (first, xBuffer) {\n  var x = new BN(xBuffer)\n\n  // overflow\n  if (x.cmp(ecparams.p) >= 0) return null\n  x = x.toRed(ecparams.red)\n\n  // compute corresponding Y\n  var y = x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt()\n  if ((first === 0x03) !== y.isOdd()) y = y.redNeg()\n\n  // x*x*x + b = y*y\n  const x3 = x.redSqr().redIMul(x)\n  if (!y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()) return null\n\n  return ec.keyPair({ pub: { x: x, y: y } })\n}\n\nfunction loadUncompressedPublicKey (first, xBuffer, yBuffer) {\n  var x = new BN(xBuffer)\n  var y = new BN(yBuffer)\n\n  // overflow\n  if (x.cmp(ecparams.p) >= 0 || y.cmp(ecparams.p) >= 0) return null\n\n  x = x.toRed(ecparams.red)\n  y = y.toRed(ecparams.red)\n\n  // is odd flag\n  if ((first === 0x06 || first === 0x07) && y.isOdd() !== (first === 0x07)) return null\n\n  // x*x*x + b = y*y\n  var x3 = x.redSqr().redIMul(x)\n  if (!y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()) return null\n\n  return ec.keyPair({ pub: { x: x, y: y } })\n}\n\nfunction loadPublicKey (publicKey) {\n  var first = publicKey[0]\n  switch (first) {\n    case 0x02:\n    case 0x03:\n      if (publicKey.length !== 33) return null\n      return loadCompressedPublicKey(first, publicKey.slice(1, 33))\n    case 0x04:\n    case 0x06:\n    case 0x07:\n      if (publicKey.length !== 65) return null\n      return loadUncompressedPublicKey(first, publicKey.slice(1, 33), publicKey.slice(33, 65))\n    default:\n      return null\n  }\n}\n\nexports.privateKeyVerify = function (privateKey) {\n  var bn = new BN(privateKey)\n  return bn.cmp(ecparams.n) < 0 && !bn.isZero()\n}\n\nexports.privateKeyExport = function (privateKey, compressed) {\n  var d = new BN(privateKey)\n  if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL)\n\n  return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed, true))\n}\n\nexports.privateKeyNegate = function (privateKey) {\n  var bn = new BN(privateKey)\n  return bn.isZero() ? Buffer.alloc(32) : ecparams.n.sub(bn).umod(ecparams.n).toArrayLike(Buffer, 'be', 32)\n}\n\nexports.privateKeyModInverse = function (privateKey) {\n  var bn = new BN(privateKey)\n  if (bn.cmp(ecparams.n) >= 0 || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_RANGE_INVALID)\n\n  return bn.invm(ecparams.n).toArrayLike(Buffer, 'be', 32)\n}\n\nexports.privateKeyTweakAdd = function (privateKey, tweak) {\n  var bn = new BN(tweak)\n  if (bn.cmp(ecparams.n) >= 0) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)\n\n  bn.iadd(new BN(privateKey))\n  if (bn.cmp(ecparams.n) >= 0) bn.isub(ecparams.n)\n  if (bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)\n\n  return bn.toArrayLike(Buffer, 'be', 32)\n}\n\nexports.privateKeyTweakMul = function (privateKey, tweak) {\n  var bn = new BN(tweak)\n  if (bn.cmp(ecparams.n) >= 0 || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL)\n\n  bn.imul(new BN(privateKey))\n  if (bn.cmp(ecparams.n)) bn = bn.umod(ecparams.n)\n\n  return bn.toArrayLike(Buffer, 'be', 32)\n}\n\nexports.publicKeyCreate = function (privateKey, compressed) {\n  var d = new BN(privateKey)\n  if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL)\n\n  return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed, true))\n}\n\nexports.publicKeyConvert = function (publicKey, compressed) {\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  return Buffer.from(pair.getPublic(compressed, true))\n}\n\nexports.publicKeyVerify = function (publicKey) {\n  return loadPublicKey(publicKey) !== null\n}\n\nexports.publicKeyTweakAdd = function (publicKey, tweak, compressed) {\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  tweak = new BN(tweak)\n  if (tweak.cmp(ecparams.n) >= 0) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL)\n\n  var point = ecparams.g.mul(tweak).add(pair.pub)\n  if (point.isInfinity()) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL)\n\n  return Buffer.from(point.encode(true, compressed))\n}\n\nexports.publicKeyTweakMul = function (publicKey, tweak, compressed) {\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  tweak = new BN(tweak)\n  if (tweak.cmp(ecparams.n) >= 0 || tweak.isZero()) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL)\n\n  return Buffer.from(pair.pub.mul(tweak).encode(true, compressed))\n}\n\nexports.publicKeyCombine = function (publicKeys, compressed) {\n  var pairs = new Array(publicKeys.length)\n  for (var i = 0; i < publicKeys.length; ++i) {\n    pairs[i] = loadPublicKey(publicKeys[i])\n    if (pairs[i] === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n  }\n\n  var point = pairs[0].pub\n  for (var j = 1; j < pairs.length; ++j) point = point.add(pairs[j].pub)\n  if (point.isInfinity()) throw new Error(messages.EC_PUBLIC_KEY_COMBINE_FAIL)\n\n  return Buffer.from(point.encode(true, compressed))\n}\n\nexports.signatureNormalize = function (signature) {\n  var r = new BN(signature.slice(0, 32))\n  var s = new BN(signature.slice(32, 64))\n  if (r.cmp(ecparams.n) >= 0 || s.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  var result = Buffer.from(signature)\n  if (s.cmp(ec.nh) === 1) ecparams.n.sub(s).toArrayLike(Buffer, 'be', 32).copy(result, 32)\n\n  return result\n}\n\nexports.signatureExport = function (signature) {\n  var r = signature.slice(0, 32)\n  var s = signature.slice(32, 64)\n  if (new BN(r).cmp(ecparams.n) >= 0 || new BN(s).cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  return { r: r, s: s }\n}\n\nexports.signatureImport = function (sigObj) {\n  var r = new BN(sigObj.r)\n  if (r.cmp(ecparams.n) >= 0) r = new BN(0)\n\n  var s = new BN(sigObj.s)\n  if (s.cmp(ecparams.n) >= 0) s = new BN(0)\n\n  return Buffer.concat([\n    r.toArrayLike(Buffer, 'be', 32),\n    s.toArrayLike(Buffer, 'be', 32)\n  ])\n}\n\nexports.sign = function (message, privateKey, noncefn, data) {\n  if (typeof noncefn === 'function') {\n    var getNonce = noncefn\n    noncefn = function (counter) {\n      var nonce = getNonce(message, privateKey, null, data, counter)\n      if (!Buffer.isBuffer(nonce) || nonce.length !== 32) throw new Error(messages.ECDSA_SIGN_FAIL)\n\n      return new BN(nonce)\n    }\n  }\n\n  var d = new BN(privateKey)\n  if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.ECDSA_SIGN_FAIL)\n\n  var result = ec.sign(message, privateKey, { canonical: true, k: noncefn, pers: data })\n  return {\n    signature: Buffer.concat([\n      result.r.toArrayLike(Buffer, 'be', 32),\n      result.s.toArrayLike(Buffer, 'be', 32)\n    ]),\n    recovery: result.recoveryParam\n  }\n}\n\nexports.verify = function (message, signature, publicKey) {\n  var sigObj = { r: signature.slice(0, 32), s: signature.slice(32, 64) }\n\n  var sigr = new BN(sigObj.r)\n  var sigs = new BN(sigObj.s)\n  if (sigr.cmp(ecparams.n) >= 0 || sigs.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n  if (sigs.cmp(ec.nh) === 1 || sigr.isZero() || sigs.isZero()) return false\n\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  return ec.verify(message, sigObj, { x: pair.pub.x, y: pair.pub.y })\n}\n\nexports.recover = function (message, signature, recovery, compressed) {\n  var sigObj = { r: signature.slice(0, 32), s: signature.slice(32, 64) }\n\n  var sigr = new BN(sigObj.r)\n  var sigs = new BN(sigObj.s)\n  if (sigr.cmp(ecparams.n) >= 0 || sigs.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  try {\n    if (sigr.isZero() || sigs.isZero()) throw new Error()\n\n    var point = ec.recoverPubKey(message, sigObj, recovery)\n    return Buffer.from(point.encode(true, compressed))\n  } catch (err) {\n    throw new Error(messages.ECDSA_RECOVER_FAIL)\n  }\n}\n\nexports.ecdh = function (publicKey, privateKey) {\n  var shared = exports.ecdhUnsafe(publicKey, privateKey, true)\n  return createHash('sha256').update(shared).digest()\n}\n\nexports.ecdhUnsafe = function (publicKey, privateKey, compressed) {\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  var scalar = new BN(privateKey)\n  if (scalar.cmp(ecparams.n) >= 0 || scalar.isZero()) throw new Error(messages.ECDH_FAIL)\n\n  return Buffer.from(pair.pub.mul(scalar).encode(true, compressed))\n}\n'use strict'\nvar assert = require('./assert')\nvar der = require('./der')\nvar messages = require('./messages.json')\n\nfunction initCompressedValue (value, defaultValue) {\n  if (value === undefined) return defaultValue\n\n  assert.isBoolean(value, messages.COMPRESSED_TYPE_INVALID)\n  return value\n}\n\nmodule.exports = function (secp256k1) {\n  return {\n    privateKeyVerify: function (privateKey) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      return privateKey.length === 32 && secp256k1.privateKeyVerify(privateKey)\n    },\n\n    privateKeyExport: function (privateKey, compressed) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n      var publicKey = secp256k1.privateKeyExport(privateKey, compressed)\n\n      return der.privateKeyExport(privateKey, publicKey, compressed)\n    },\n\n    privateKeyImport: function (privateKey) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n\n      privateKey = der.privateKeyImport(privateKey)\n      if (privateKey && privateKey.length === 32 && secp256k1.privateKeyVerify(privateKey)) return privateKey\n\n      throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)\n    },\n\n    privateKeyNegate: function (privateKey) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      return secp256k1.privateKeyNegate(privateKey)\n    },\n\n    privateKeyModInverse: function (privateKey) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      return secp256k1.privateKeyModInverse(privateKey)\n    },\n\n    privateKeyTweakAdd: function (privateKey, tweak) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n      assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n      return secp256k1.privateKeyTweakAdd(privateKey, tweak)\n    },\n\n    privateKeyTweakMul: function (privateKey, tweak) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n      assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n      return secp256k1.privateKeyTweakMul(privateKey, tweak)\n    },\n\n    publicKeyCreate: function (privateKey, compressed) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyCreate(privateKey, compressed)\n    },\n\n    publicKeyConvert: function (publicKey, compressed) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyConvert(publicKey, compressed)\n    },\n\n    publicKeyVerify: function (publicKey) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      return secp256k1.publicKeyVerify(publicKey)\n    },\n\n    publicKeyTweakAdd: function (publicKey, tweak, compressed) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n      assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyTweakAdd(publicKey, tweak, compressed)\n    },\n\n    publicKeyTweakMul: function (publicKey, tweak, compressed) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n      assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyTweakMul(publicKey, tweak, compressed)\n    },\n\n    publicKeyCombine: function (publicKeys, compressed) {\n      assert.isArray(publicKeys, messages.EC_PUBLIC_KEYS_TYPE_INVALID)\n      assert.isLengthGTZero(publicKeys, messages.EC_PUBLIC_KEYS_LENGTH_INVALID)\n      for (var i = 0; i < publicKeys.length; ++i) {\n        assert.isBuffer(publicKeys[i], messages.EC_PUBLIC_KEY_TYPE_INVALID)\n        assert.isBufferLength2(publicKeys[i], 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n      }\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyCombine(publicKeys, compressed)\n    },\n\n    signatureNormalize: function (signature) {\n      assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      return secp256k1.signatureNormalize(signature)\n    },\n\n    signatureExport: function (signature) {\n      assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      var sigObj = secp256k1.signatureExport(signature)\n      return der.signatureExport(sigObj)\n    },\n\n    signatureImport: function (sig) {\n      assert.isBuffer(sig, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isLengthGTZero(sig, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      var sigObj = der.signatureImport(sig)\n      if (sigObj) return secp256k1.signatureImport(sigObj)\n\n      throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL)\n    },\n\n    signatureImportLax: function (sig) {\n      assert.isBuffer(sig, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isLengthGTZero(sig, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      var sigObj = der.signatureImportLax(sig)\n      if (sigObj) return secp256k1.signatureImport(sigObj)\n\n      throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL)\n    },\n\n    sign: function (message, privateKey, options) {\n      assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n      assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      var data = null\n      var noncefn = null\n      if (options !== undefined) {\n        assert.isObject(options, messages.OPTIONS_TYPE_INVALID)\n\n        if (options.data !== undefined) {\n          assert.isBuffer(options.data, messages.OPTIONS_DATA_TYPE_INVALID)\n          assert.isBufferLength(options.data, 32, messages.OPTIONS_DATA_LENGTH_INVALID)\n          data = options.data\n        }\n\n        if (options.noncefn !== undefined) {\n          assert.isFunction(options.noncefn, messages.OPTIONS_NONCEFN_TYPE_INVALID)\n          noncefn = options.noncefn\n        }\n      }\n\n      return secp256k1.sign(message, privateKey, noncefn, data)\n    },\n\n    verify: function (message, signature, publicKey) {\n      assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n      assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n      assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      return secp256k1.verify(message, signature, publicKey)\n    },\n\n    recover: function (message, signature, recovery, compressed) {\n      assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n      assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n      assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      assert.isNumber(recovery, messages.RECOVERY_ID_TYPE_INVALID)\n      assert.isNumberInInterval(recovery, -1, 4, messages.RECOVERY_ID_VALUE_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.recover(message, signature, recovery, compressed)\n    },\n\n    ecdh: function (publicKey, privateKey) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      return secp256k1.ecdh(publicKey, privateKey)\n    },\n\n    ecdhUnsafe: function (publicKey, privateKey, compressed) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.ecdhUnsafe(publicKey, privateKey, compressed)\n    }\n  }\n}\n{\n  \"COMPRESSED_TYPE_INVALID\": \"compressed should be a boolean\",\n  \"EC_PRIVATE_KEY_TYPE_INVALID\": \"private key should be a Buffer\",\n  \"EC_PRIVATE_KEY_LENGTH_INVALID\": \"private key length is invalid\",\n  \"EC_PRIVATE_KEY_RANGE_INVALID\": \"private key range is invalid\",\n  \"EC_PRIVATE_KEY_TWEAK_ADD_FAIL\": \"tweak out of range or resulting private key is invalid\",\n  \"EC_PRIVATE_KEY_TWEAK_MUL_FAIL\": \"tweak out of range\",\n  \"EC_PRIVATE_KEY_EXPORT_DER_FAIL\": \"couldn't export to DER format\",\n  \"EC_PRIVATE_KEY_IMPORT_DER_FAIL\": \"couldn't import from DER format\",\n  \"EC_PUBLIC_KEYS_TYPE_INVALID\": \"public keys should be an Array\",\n  \"EC_PUBLIC_KEYS_LENGTH_INVALID\": \"public keys Array should have at least 1 element\",\n  \"EC_PUBLIC_KEY_TYPE_INVALID\": \"public key should be a Buffer\",\n  \"EC_PUBLIC_KEY_LENGTH_INVALID\": \"public key length is invalid\",\n  \"EC_PUBLIC_KEY_PARSE_FAIL\": \"the public key could not be parsed or is invalid\",\n  \"EC_PUBLIC_KEY_CREATE_FAIL\": \"private was invalid, try again\",\n  \"EC_PUBLIC_KEY_TWEAK_ADD_FAIL\": \"tweak out of range or resulting public key is invalid\",\n  \"EC_PUBLIC_KEY_TWEAK_MUL_FAIL\": \"tweak out of range\",\n  \"EC_PUBLIC_KEY_COMBINE_FAIL\": \"the sum of the public keys is not valid\",\n  \"ECDH_FAIL\": \"scalar was invalid (zero or overflow)\",\n  \"ECDSA_SIGNATURE_TYPE_INVALID\": \"signature should be a Buffer\",\n  \"ECDSA_SIGNATURE_LENGTH_INVALID\": \"signature length is invalid\",\n  \"ECDSA_SIGNATURE_PARSE_FAIL\": \"couldn't parse signature\",\n  \"ECDSA_SIGNATURE_PARSE_DER_FAIL\": \"couldn't parse DER signature\",\n  \"ECDSA_SIGNATURE_SERIALIZE_DER_FAIL\": \"couldn't serialize signature to DER format\",\n  \"ECDSA_SIGN_FAIL\": \"nonce generation function failed or private key is invalid\",\n  \"ECDSA_RECOVER_FAIL\": \"couldn't recover public key from signature\",\n  \"MSG32_TYPE_INVALID\": \"message should be a Buffer\",\n  \"MSG32_LENGTH_INVALID\": \"message length is invalid\",\n  \"OPTIONS_TYPE_INVALID\": \"options should be an Object\",\n  \"OPTIONS_DATA_TYPE_INVALID\": \"options.data should be a Buffer\",\n  \"OPTIONS_DATA_LENGTH_INVALID\": \"options.data length is invalid\",\n  \"OPTIONS_NONCEFN_TYPE_INVALID\": \"options.noncefn should be a Function\",\n  \"RECOVERY_ID_TYPE_INVALID\": \"recovery should be a Number\",\n  \"RECOVERY_ID_VALUE_INVALID\": \"recovery should have value between -1 and 4\",\n  \"TWEAK_TYPE_INVALID\": \"tweak should be a Buffer\",\n  \"TWEAK_LENGTH_INVALID\": \"tweak length is invalid\"\n}\n{\n  \"name\": \"secp256k1\",\n  \"version\": \"3.8.1\",\n  \"description\": \"This module provides native bindings to ecdsa secp256k1 functions\",\n  \"keywords\": [\n    \"ec\",\n    \"ecdh\",\n    \"ecdsa\",\n    \"secp256k1\"\n  ],\n  \"bugs\": {\n    \"url\": \"https://github.com/cryptocoinjs/secp256k1-node/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Martin Becze <mjbecze@gmail.com>\",\n  \"contributors\": [\n    \"Aaron Davis (https://github.com/kumavis)\",\n    \"Ian Matyssik (https://github.com/phpb-com)\",\n    \"Kagami Hiiragi <kagami@genshiken.org> (http://kagami.genshiken.org/)\",\n    \"ethers (https://github.com/ethers)\",\n    \"Kirill Fomichev <fanatid@ya.ru> (https://github.com/fanatid)\"\n  ],\n  \"files\": [\n    \"lib\",\n    \"src\",\n    \"API.md\",\n    \"binding.gyp\",\n    \"bindings.js\",\n    \"elliptic.js\",\n    \"index.js\",\n    \"js.js\",\n    \"utils/has_lib.sh\"\n  ],\n  \"main\": \"./index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/cryptocoinjs/secp256k1-node.git\"\n  },\n  \"scripts\": {\n    \"coverage\": \"RANDOM_TESTS_REPEAT=1 nyc tape test/index.js\",\n    \"coverage-lcov\": \"npm run coverage && nyc report -r lcov\",\n    \"install\": \"npm run rebuild || echo \\\"Secp256k1 bindings compilation fail. Pure JS implementation will be used.\\\"\",\n    \"lint\": \"standard\",\n    \"rebuild\": \"node-gyp rebuild\",\n    \"test\": \"npm run lint && npm run unit\",\n    \"test:browser\": \"karma start karma.conf.js\",\n    \"unit\": \"tape test/index.js\"\n  },\n  \"dependencies\": {\n    \"bindings\": \"^1.5.0\",\n    \"bip66\": \"^1.1.5\",\n    \"bn.js\": \"^4.11.8\",\n    \"create-hash\": \"^1.2.0\",\n    \"drbg.js\": \"^1.0.1\",\n    \"elliptic\": \"^6.5.7\",\n    \"nan\": \"^2.14.0\",\n    \"safe-buffer\": \"^5.1.2\"\n  },\n  \"devDependencies\": {\n    \"bignum\": \"https://github.com/fanatid/node-bignum#e688fd40dff43b03480bcdb5e4c099ee9ac27102\",\n    \"browserify\": \"^16.2.3\",\n    \"karma\": \"^1.3.0\",\n    \"karma-browserify\": \"^5.0.4\",\n    \"karma-chrome-launcher\": \"^2.2.0\",\n    \"karma-detect-browsers\": \"^2.3.3\",\n    \"karma-env-preprocessor\": \"^0.1.1\",\n    \"karma-firefox-launcher\": \"^1.0.0\",\n    \"karma-tap\": \"^3.1.1\",\n    \"node-gyp\": \"^4.0.0\",\n    \"nyc\": \"^14.1.0\",\n    \"standard\": \"^12.0.1\",\n    \"tape\": \"^4.10.1\",\n    \"xorshift.js\": \"^1.0.3\"\n  },\n  \"engines\": {\n    \"node\": \">=4.0.0\"\n  },\n  \"gypfile\": true,\n  \"browser\": {\n    \"./index.js\": \"./elliptic.js\"\n  }\n}\nmodule.exports = class Signal {\n  constructor () {\n    this._resolve = null\n    this._reject = null\n    this._promise = null\n    this._bind = bind.bind(this)\n    this._onerror = clear.bind(this)\n    this._onsuccess = clear.bind(this, null)\n    this._timers = new Set()\n  }\n\n  wait (max) {\n    if (!this._promise) {\n      this._promise = new Promise(this._bind)\n      this._promise.then(this._onsuccess).catch(this._onerror)\n    }\n    if (max) return this._sleep(max)\n    return this._promise\n  }\n\n  _sleep (max) {\n    const s = new Promise((resolve, reject) => {\n      const done = () => {\n        this._timers.delete(state)\n        resolve(true)\n      }\n      const id = setTimeout(done, max)\n      const state = { id, resolve, reject }\n      this._timers.add(state)\n    })\n\n    return s\n  }\n\n  notify (err) {\n    if (!this._promise) return\n    const resolve = this._resolve\n    const reject = this._reject\n    this._promise = null\n    if (err) reject(err)\n    else resolve(true)\n  }\n}\n\nfunction clear (err) {\n  for (const { id, resolve, reject } of this._timers) {\n    clearTimeout(id)\n    if (err) reject(err)\n    else resolve(true)\n  }\n  this._timers.clear()\n}\n\nfunction bind (resolve, reject) {\n  this._resolve = resolve\n  this._reject = reject\n}\n{\n  \"name\": \"signal-promise\",\n  \"version\": \"1.0.3\",\n  \"description\": \"Simple wait/notify promise with optional max wait time\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {},\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/signal-promise.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/signal-promise/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/signal-promise\"\n}\nvar varint = require('varint')\nexports.encode = function encode (v, b, o) {\n  v = v >= 0 ? v*2 : v*-2 - 1\n  var r = varint.encode(v, b, o)\n  encode.bytes = varint.encode.bytes\n  return r\n}\nexports.decode = function decode (b, o) {\n  var v = varint.decode(b, o)\n  decode.bytes = varint.decode.bytes\n  return v & 1 ? (v+1) / -2 : v / 2\n}\n\nexports.encodingLength = function (v) {\n  return varint.encodingLength(v >= 0 ? v*2 : v*-2 - 1)\n}\n{\n  \"name\": \"signed-varint\",\n  \"description\": \"efficiently store signed integers in varint\",\n  \"version\": \"2.0.1\",\n  \"homepage\": \"https://github.com/dominictarr/signed-varint\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/dominictarr/signed-varint.git\"\n  },\n  \"dependencies\": {\n    \"varint\": \"~5.0.0\"\n  },\n  \"devDependencies\": {\n    \"tape\": \"~2.12.3\"\n  },\n  \"scripts\": {\n    \"test\": \"node test.js\"\n  },\n  \"author\": \"Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)\",\n  \"license\": \"MIT\"\n}\nrequire.addon = require('require-addon')\n\nmodule.exports = require.addon('.', __filename)\nconst binding = require('./binding')\nconst b4a = require('b4a')\n\nfunction predicate(u8, u16, u32) {\n  return function predicate(buf) {\n    if (buf.byteLength % 16 !== 0) {\n      throw new Error('Buffer length must be a multiple of 16')\n    }\n\n    const n = buf.BYTES_PER_ELEMENT\n\n    if (n === 1) return u8(buf)\n    if (n === 2) return u16(buf)\n    return u32(buf)\n  }\n}\n\nfunction unary(u8, u16, u32) {\n  return function unary(buf, result = b4a.allocUnsafe(buf.byteLength)) {\n    if (buf.byteLength % 16 !== 0) {\n      throw new Error('Buffer length must be a multiple of 16')\n    }\n\n    if (buf.byteLength !== result.byteLength) {\n      throw new Error('Length of result buffer is insufficient')\n    }\n\n    const n = buf.BYTES_PER_ELEMENT\n\n    if (n === 1) u8(buf, result)\n    else if (n === 2) u16(buf, result)\n    else u32(buf, result)\n\n    return result\n  }\n}\n\nfunction binary(u8, u16, u32) {\n  return function binary(a, b, result = b4a.allocUnsafe(a.byteLength)) {\n    if (a.byteLength % 16 !== 0) {\n      throw new Error('Buffer length must be a multiple of 16')\n    }\n\n    if (a.byteLength !== b.byteLength || a.byteLength !== result.byteLength) {\n      throw new Error('Buffers must be the same length')\n    }\n\n    const n = a.BYTES_PER_ELEMENT\n\n    if (n === 1) u8(a, b, result)\n    else if (n === 2) u16(a, b, result)\n    else u32(a, b, result)\n\n    return result\n  }\n}\n\nfunction reduce(u8, u16, u32) {\n  return function reduce(buf) {\n    if (buf.byteLength % 16 !== 0) {\n      throw new Error('Buffer length must be a multiple of 16')\n    }\n\n    const n = buf.BYTES_PER_ELEMENT\n\n    if (n === 1) return u8(buf)\n    if (n === 2) return u16(buf)\n    return u32(buf)\n  }\n}\n\nexports.allo = predicate(\n  binding.simdle_native_allo_v128_u8,\n  binding.simdle_native_allo_v128_u16,\n  binding.simdle_native_allo_v128_u32\n)\n\nexports.allz = predicate(\n  binding.simdle_native_allz_v128_u8,\n  binding.simdle_native_allz_v128_u16,\n  binding.simdle_native_allz_v128_u32\n)\n\nexports.and = binary(\n  binding.simdle_native_and_v128_u8,\n  binding.simdle_native_and_v128_u16,\n  binding.simdle_native_and_v128_u32\n)\n\nexports.clear = binary(\n  binding.simdle_native_clear_v128_u8,\n  binding.simdle_native_clear_v128_u16,\n  binding.simdle_native_clear_v128_u32\n)\n\nexports.clo = unary(\n  binding.simdle_native_clo_v128_u8,\n  binding.simdle_native_clo_v128_u16,\n  binding.simdle_native_clo_v128_u32\n)\n\nexports.clz = unary(\n  binding.simdle_native_clz_v128_u8,\n  binding.simdle_native_clz_v128_u16,\n  binding.simdle_native_clz_v128_u32\n)\n\nexports.cnt = unary(\n  binding.simdle_native_cnt_v128_u8,\n  binding.simdle_native_cnt_v128_u16,\n  binding.simdle_native_cnt_v128_u32\n)\n\nexports.cto = unary(\n  binding.simdle_native_cto_v128_u8,\n  binding.simdle_native_cto_v128_u16,\n  binding.simdle_native_cto_v128_u32\n)\n\nexports.ctz = unary(\n  binding.simdle_native_ctz_v128_u8,\n  binding.simdle_native_ctz_v128_u16,\n  binding.simdle_native_ctz_v128_u32\n)\n\nexports.not = unary(\n  binding.simdle_native_not_v128_u8,\n  binding.simdle_native_not_v128_u16,\n  binding.simdle_native_not_v128_u32\n)\n\nexports.or = binary(\n  binding.simdle_native_or_v128_u8,\n  binding.simdle_native_or_v128_u16,\n  binding.simdle_native_or_v128_u32\n)\n\nexports.sum = reduce(\n  binding.simdle_native_sum_v128_u8,\n  binding.simdle_native_sum_v128_u16,\n  binding.simdle_native_sum_v128_u32\n)\n\nexports.xor = binary(\n  binding.simdle_native_xor_v128_u8,\n  binding.simdle_native_xor_v128_u16,\n  binding.simdle_native_xor_v128_u32\n)\n{\n  \"name\": \"simdle-native\",\n  \"version\": \"1.3.9\",\n  \"description\": \"libsimdle JavaScript bindings for Node.js\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"binding.cc\",\n    \"binding.js\",\n    \"CMakeLists.txt\",\n    \"prebuilds\"\n  ],\n  \"addon\": true,\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"lint\": \"prettier --check .\",\n    \"test\": \"npm run lint && npm run test:bare && npm run test:node\",\n    \"test:bare\": \"bare test.mjs\",\n    \"test:node\": \"node test.mjs\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/simdle-native.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/simdle-native/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/simdle-native#readme\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.0\",\n    \"require-addon\": \"^1.1.0\"\n  },\n  \"devDependencies\": {\n    \"bare-compat-napi\": \"^1.3.2\",\n    \"brittle\": \"^3.1.0\",\n    \"cmake-bare\": \"^1.1.7\",\n    \"cmake-fetch\": \"^1.1.0\",\n    \"cmake-napi\": \"^1.0.2\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^1.0.0\"\n  }\n}\nconst b4a = require('b4a')\nconst scalar = require('./scalar')\n\nfunction view (buf, n) {\n  if (n === buf.BYTES_PER_ELEMENT) return buf\n\n  let TypedArray\n\n  if (n === 1) TypedArray = Uint8Array\n  else if (n === 2) TypedArray = Uint16Array\n  else TypedArray = Uint32Array\n\n  return new TypedArray(buf.buffer, buf.byteOffset, buf.byteLength / n)\n}\n\nfunction unary (u8, u16 = u8, u32 = u16) {\n  return function unary (buf, result = b4a.allocUnsafe(buf.byteLength)) {\n    if (buf.byteLength % 16 !== 0) {\n      throw new Error('Buffer length must be a multiple of 16')\n    }\n\n    if (buf.byteLength !== result.byteLength) {\n      throw new Error('Length of result buffer is insufficient')\n    }\n\n    const n = buf.BYTES_PER_ELEMENT\n\n    if (n === 1) u8(buf, view(result, n))\n    else if (n === 2) u16(buf, view(result, n))\n    else u32(buf, view(result, n))\n\n    return result\n  }\n}\n\nfunction binary (u8, u16 = u8, u32 = u16) {\n  return function binary (a, b, result = b4a.allocUnsafe(a.byteLength)) {\n    if (a.byteLength % 16 !== 0) {\n      throw new Error('Buffer length must be a multiple of 16')\n    }\n\n    if (a.byteLength !== b.byteLength || a.byteLength !== result.byteLength) {\n      throw new Error('Buffers must be the same length')\n    }\n\n    const n = a.BYTES_PER_ELEMENT\n\n    if (n === 1) u8(a, b, view(result, n))\n    else if (n === 2) u16(a, b, view(result, n))\n    else u32(a, b, view(result, n))\n\n    return result\n  }\n}\n\nfunction reduce (u8, u16 = u8, u32 = u16) {\n  return function reduce (buf) {\n    if (buf.byteLength % 16 !== 0) {\n      throw new Error('Buffer length must be a multiple of 16')\n    }\n\n    const n = buf.BYTES_PER_ELEMENT\n\n    if (n === 1) return u8(buf)\n    if (n === 2) return u16(buf)\n    return u32(buf)\n  }\n}\n\nexports.allo = function allo (buf) {\n  if (buf.byteLength % 16 !== 0) {\n    throw new Error('Buffer length must be a multiple of 16')\n  }\n\n  const m = 2 ** (buf.BYTES_PER_ELEMENT * 8) - 1\n\n  for (let i = 0, n = buf.length; i < n; i++) {\n    if (buf[i] !== m) return false\n  }\n\n  return true\n}\n\nexports.allz = function allz (buf) {\n  if (buf.byteLength % 16 !== 0) {\n    throw new Error('Buffer length must be a multiple of 16')\n  }\n\n  for (let i = 0, n = buf.length; i < n; i++) {\n    if (buf[i] !== 0) return false\n  }\n\n  return true\n}\n\nexports.and = binary(\n  (a, b, result) => {\n    for (let i = 0, n = result.length; i < n; i++) {\n      result[i] = a[i] & b[i]\n    }\n  }\n)\n\nexports.clear = binary(\n  (a, b, result) => {\n    for (let i = 0, n = result.length; i < n; i++) {\n      result[i] = a[i] & ~b[i]\n    }\n  }\n)\n\nexports.clo = unary(\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = 24 - scalar.clo(buf[i])\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = 16 - scalar.clo(buf[i])\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = scalar.clo(buf[i])\n    }\n  }\n)\n\nexports.clz = unary(\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = 24 - scalar.clz(buf[i])\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = 16 - scalar.clz(buf[i])\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = scalar.clz(buf[i])\n    }\n  }\n)\n\nexports.cnt = unary(\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = scalar.cnt(buf[i]) & 0xff\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = scalar.cnt(buf[i]) & 0xffff\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = scalar.cnt(buf[i])\n    }\n  }\n)\n\nexports.cto = unary(\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = Math.min(scalar.cto(buf[i]), 8)\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = Math.min(scalar.cto(buf[i]), 16)\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = scalar.cto(buf[i])\n    }\n  }\n)\n\nexports.ctz = unary(\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = Math.min(scalar.ctz(buf[i]), 8)\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = Math.min(scalar.ctz(buf[i]), 16)\n    }\n  },\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = scalar.ctz(buf[i])\n    }\n  }\n)\n\nexports.not = unary(\n  (buf, result) => {\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result[i] = ~buf[i]\n    }\n  }\n)\n\nexports.or = binary(\n  (a, b, result) => {\n    for (let i = 0, n = result.length; i < n; i++) {\n      result[i] = a[i] | b[i]\n    }\n  }\n)\n\nexports.sum = reduce(\n  (buf) => {\n    let result = 0n\n\n    for (let i = 0, n = buf.length; i < n; i++) {\n      result += BigInt(buf[i])\n    }\n\n    return result\n  }\n)\n\nexports.xor = binary(\n  (a, b, result) => {\n    for (let i = 0, n = result.length; i < n; i++) {\n      result[i] = a[i] ^ b[i]\n    }\n  }\n)\ntry {\n  module.exports = require('simdle-native')\n} catch {\n  module.exports = require('./fallback')\n}\n{\n  \"name\": \"simdle-universal\",\n  \"version\": \"1.1.2\",\n  \"description\": \"Universal wrapper for libsimdle with a JavaScript fallback\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"fallback.js\",\n    \"index.js\",\n    \"scalar.js\"\n  ],\n  \"browser\": {\n    \"./index.js\": \"./fallback.js\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.mjs\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/simdle-universal.git\"\n  },\n  \"author\": \"Kasper Isager Dalsgarð <kasper@funktionel.co>\",\n  \"license\": \"ISC\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/simdle-universal/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/simdle-universal#readme\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.0\"\n  },\n  \"optionalDependencies\": {\n    \"simdle-native\": \"^1.1.1\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.0\",\n    \"standard\": \"^17.0.0\"\n  }\n}\nconst clz = exports.clz = function clz (n) {\n  return Math.clz32(n)\n}\n\nexports.clo = function clo (n) {\n  return clz(~n)\n}\n\nconst ctz = exports.ctz = function ctz (n) {\n  return 32 - (n === 0 ? 0 : (clz(n & -n) + 1))\n}\n\nexports.cto = function cto (n) {\n  return ctz(~n)\n}\n\nexports.cnt = function cnt (n) {\n  n = n - ((n >>> 1) & 0x55555555)\n  n = (n & 0x33333333) + ((n >>> 2) & 0x33333333)\n  n = (n + (n >>> 4)) & 0x0f0f0f0f\n  n = (n * 0x01010101) >>> 24\n  return n\n}\nconst sodium = require('sodium-universal')\n\nmodule.exports = {\n  init: sodium.crypto_hash_sha256_init,\n  update: sodium.crypto_hash_sha256_update,\n  final: sodium.crypto_hash_sha256_final,\n  BYTES: sodium.crypto_hash_sha256_BYTES,\n  STATEBYTES: sodium.crypto_hash_sha256_STATEBYTES\n}\nconst sodium = require('sodium-universal')\n\nmodule.exports = {\n  init: sodium.crypto_hash_sha512_init,\n  update: sodium.crypto_hash_sha512_update,\n  final: sodium.crypto_hash_sha512_final,\n  BYTES: sodium.crypto_hash_sha512_BYTES,\n  STATEBYTES: sodium.crypto_hash_sha512_STATEBYTES\n}\nconst b4a = require('b4a')\n\nconst sha256 = require('./hash/sha256')\nconst sha512 = require('./hash/sha512')\n\nclass HMAC {\n  constructor (hash, key) {\n    this.hash = hash\n    this.length = hash.BYTES\n\n    this._blocksize = 2 * hash.BYTES\n\n    this._initialised = false\n\n    this.state = b4a.alloc(hash.STATEBYTES)\n    this.pad = b4a.alloc(this._blocksize)\n\n    if (key) this.init(key)\n  }\n\n  init (key) {\n    if (this._initialised) {\n      throw new Error('Already initialised, call final first')\n    }\n\n    if (key.length > this._blocksize) {\n      this.hash.init(this.state)\n      this.hash.update(this.state, key)\n      this.hash.final(this.state, this.pad.subarray(0, this.length))\n    } else {\n      this.pad.set(key)\n    }\n\n    bufferByteXor(this.pad, 0x36)\n\n    this.hash.init(this.state)\n    this.hash.update(this.state, this.pad)\n\n    bufferByteXor(this.pad, 0x5c ^ 0x36)\n\n    this._initialised = true\n\n    return this\n  }\n\n  update (data) {\n    if (!this._initialised) {\n      throw new Error('First initialise with a key')\n    }\n\n    this.hash.update(this.state, data)\n    return this\n  }\n\n  final (output = b4a.alloc(this.length)) {\n    if (!this._initialised) {\n      throw new Error('First initialise with a key')\n    }\n\n    const out = output.byteLength === this.length\n      ? output\n      : output.subarray(0, this.hash.BYTES)\n\n    this.hash.final(this.state, out)\n\n    this.hash.init(this.state)\n    this.hash.update(this.state, this.pad)\n    this.hash.update(this.state, out)\n    this.hash.final(this.state, out)\n\n    this.pad.fill(0)\n    this.state.fill(0)\n\n    this._initialised = false\n\n    return out\n  }\n\n  static sha256 (data, key, output) {\n    const hmac = new HMAC(sha256, key)\n    return hmac.update(data).final(output)\n  }\n\n  static sha512 (data, key, output) {\n    const hmac = new HMAC(sha512, key)\n    return hmac.update(data).final(output)\n  }\n}\n\nmodule.exports = {\n  HMAC,\n  sha256,\n  sha512\n}\n\nfunction bufferByteXor (output, byte) {\n  for (let i = 0; i < output.byteLength; i++) {\n    output[i] ^= byte\n  }\n\n  return output\n}\n{\n  \"name\": \"sodium-hmac\",\n  \"version\": \"2.1.0\",\n  \"description\": \"HMAC utility\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"standard && brittle test/*.js\"\n  },\n  \"author\": \"\",\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.6\",\n    \"sodium-universal\": \"^5.0.1\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.4.0\",\n    \"standard\": \"^17.1.0\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/sodium-hmac.git\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"hash/*\"\n  ],\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/sodium-hmac/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/sodium-hmac#readme\"\n}\nrequire.addon = require('require-addon')\nmodule.exports = require.addon('.', __filename)\nconst binding = require('./binding')\nconst { isNode } = require('which-runtime')\n\nconst OPTIONAL = Buffer.from(new ArrayBuffer(0))\n\nmodule.exports = exports = { ...binding }\n\n// memory\n\nexports.sodium_memzero = function (buf) {\n  binding.sodium_memzero(buf)\n}\n\nexports.sodium_mlock = function (buf) {\n  const res = binding.sodium_mlock(buf)\n  if (res !== 0) throw new Error('memory lock failed')\n}\n\nexports.sodium_munlock = function (buf) {\n  const res = binding.sodium_munlock(buf)\n  if (res !== 0) throw new Error('memory unlock failed')\n}\n\nexports.sodium_malloc = function (size) {\n  if (size < 0) throw new Error('invalid size')\n  const buf = Buffer.from(binding.sodium_malloc(size))\n  buf.secure = true\n\n  return buf\n}\n\nexports.sodium_free = function (buf) {\n  if (!buf?.secure) return\n\n  binding.sodium_free(buf.buffer)\n}\n\nexports.sodium_mprotect_noaccess = function (buf) {\n  const res = binding.sodium_mprotect_noaccess(buf.buffer)\n\n  if (res !== 0) throw new Error('failed to lock buffer')\n}\n\nexports.sodium_mprotect_readonly = function (buf) {\n  const res = binding.sodium_mprotect_readonly(buf.buffer)\n\n  if (res !== 0) throw new Error('failed to unlock buffer')\n}\n\nexports.sodium_mprotect_readwrite = function (buf) {\n  const res = binding.sodium_mprotect_readwrite(buf.buffer)\n\n  if (res !== 0) throw new Error('failed to unlock buffer')\n}\n\n// crypto_randombytes\n\nexports.randombytes_buf = function (buffer) {\n  binding.randombytes_buf(buffer.buffer, buffer.byteOffset, buffer.byteLength)\n}\n\nexports.randombytes_buf_deterministic = function (buffer, seed) {\n  binding.randombytes_buf_deterministic(\n    buffer.buffer,\n    buffer.byteOffset,\n    buffer.byteLength,\n\n    seed.buffer,\n    seed.byteOffset,\n    seed.byteLength\n  )\n}\n\n// sodium_helpers\n\nexports.sodium_memcmp = function (a, b) {\n  if (a?.byteLength !== b?.byteLength)\n    throw new Error('buffers must be of same length\"')\n  return binding.sodium_memcmp(a, b)\n}\n\nexports.sodium_add = function (a, b) {\n  if (a?.byteLength !== b?.byteLength)\n    throw new Error('buffers must be of same length\"')\n  binding.sodium_add(a, b)\n}\n\nexports.sodium_sub = function (a, b) {\n  if (a?.byteLength !== b?.byteLength)\n    throw new Error('buffers must be of same length\"')\n  binding.sodium_sub(a, b)\n}\n\nexports.sodium_compare = function (a, b) {\n  if (a?.byteLength !== b?.byteLength)\n    throw new Error('buffers must be of same length\"')\n  return binding.sodium_compare(a, b)\n}\n\nexports.sodium_is_zero = function (buffer, length) {\n  if (!buffer) throw new Error('invalid buffer')\n  length ??= buffer.byteLength\n  if (length > buffer.byteLength || length < 0)\n    throw new Error('invalid length')\n\n  return binding.sodium_is_zero(buffer, length)\n}\n\nexports.sodium_pad = function (buffer, unpaddedBuflen, blockSize) {\n  if (unpaddedBuflen > buffer.byteLength)\n    throw new Error('unpadded length cannot exceed buffer length')\n  if (blockSize > buffer.byteLength)\n    throw new Error('block size cannot exceed buffer length')\n  if (blockSize < 1) throw new Error('block sizemust be at least 1 byte')\n  if (\n    buffer?.byteLength <\n    unpaddedBuflen + (blockSize - (unpaddedBuflen % blockSize))\n  )\n    throw new Error('buf not long enough')\n\n  return binding.sodium_pad(buffer, unpaddedBuflen, blockSize)\n}\n\nexports.sodium_unpad = function (buffer, paddedBuflen, blockSize) {\n  if (paddedBuflen > buffer.byteLength)\n    throw new Error('unpadded length cannot exceed buffer length')\n  if (blockSize > buffer.byteLength)\n    throw new Error('block size cannot exceed buffer length')\n  if (blockSize < 1) throw new Error('block size must be at least 1 byte')\n\n  return binding.sodium_unpad(buffer, paddedBuflen, blockSize)\n}\n\n// crypto_sign\n\nexports.crypto_sign_keypair = function (pk, sk) {\n  if (pk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('pk')\n\n  const res = binding.crypto_sign_keypair(pk, sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_sign_seed_keypair = function (pk, sk, seed) {\n  if (pk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('pk')\n\n  const res = binding.crypto_sign_seed_keypair(pk, sk, seed)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_sign = function (sm, m, sk) {\n  if (sm?.byteLength !== binding.crypto_sign_BYTES + m.byteLength)\n    throw new Error('sm must be \"m.byteLength + crypto_sign_BYTES\" bytes')\n  if (sk?.byteLength !== binding.crypto_sign_SECRETKEYBYTES)\n    throw new Error('sk')\n\n  const res = binding.crypto_sign(sm, m, sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_sign_open = function (m, sm, pk) {\n  if (sm?.byteLength < binding.crypto_sign_BYTES) throw new Error('sm')\n  if (m?.byteLength !== sm.byteLength - binding.crypto_sign_BYTES)\n    throw new Error('m must be \"sm.byteLength - crypto_sign_BYTES\" bytes')\n  if (pk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('pk')\n\n  const res = binding.crypto_sign_open(m, sm, pk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_sign_open = function (m, sm, pk) {\n  if (sm?.byteLength < binding.crypto_sign_BYTES) throw new Error('sm')\n  if (m?.byteLength !== sm.byteLength - binding.crypto_sign_BYTES)\n    throw new Error('m must be \"sm.byteLength - crypto_sign_BYTES\" bytes')\n  if (pk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('pk')\n\n  return binding.crypto_sign_open(m, sm, pk)\n}\n\nexports.crypto_sign_detached = function (sig, m, sk) {\n  if (sig?.byteLength !== binding.crypto_sign_BYTES) throw new Error('sig')\n  if (sk?.byteLength !== binding.crypto_sign_SECRETKEYBYTES)\n    throw new Error('sk')\n\n  const res = binding.crypto_sign_detached(sig, m, sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_sign_verify_detached = function (sig, m, pk) {\n  return binding.crypto_sign_verify_detached(\n    sig.buffer,\n    sig.byteOffset,\n    sig.byteLength,\n\n    m.buffer,\n    m.byteOffset,\n    m.byteLength,\n\n    pk.buffer,\n    pk.byteOffset,\n    pk.byteLength\n  )\n}\n\nexports.crypto_sign_ed25519_sk_to_pk = function (pk, sk) {\n  if (pk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('pk')\n  if (sk?.byteLength !== binding.crypto_sign_SECRETKEYBYTES)\n    throw new Error('sk')\n\n  const res = binding.crypto_sign_ed25519_sk_to_pk(pk, sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_sign_ed25519_pk_to_curve25519 = function (x25519pk, ed25519pk) {\n  if (x25519pk?.byteLength !== binding.crypto_box_PUBLICKEYBYTES)\n    throw new Error('x25519_pk')\n  if (ed25519pk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('ed25519_pk')\n\n  const res = binding.crypto_sign_ed25519_pk_to_curve25519(x25519pk, ed25519pk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_sign_ed25519_sk_to_curve25519 = function (x25519sk, ed25519sk) {\n  if (x25519sk?.byteLength !== binding.crypto_box_SECRETKEYBYTES)\n    throw new Error('x25519_sk')\n\n  const edLen = ed25519sk.byteLength\n\n  if (\n    edLen !== binding.crypto_sign_SECRETKEYBYTES &&\n    edLen !== binding.crypto_box_SECRETKEYBYTES\n  ) {\n    throw new Error(\n      \"ed25519_sk should either be 'crypto_sign_SECRETKEYBYTES' bytes or 'crypto_sign_SECRETKEYBYTES - crypto_sign_PUBLICKEYBYTES' bytes\"\n    )\n  }\n\n  const res = binding.crypto_sign_ed25519_sk_to_curve25519(x25519sk, ed25519sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\n// crypto_box\n\nexports.crypto_box_keypair = function (pk, sk) {\n  if (pk?.byteLength !== binding.crypto_box_PUBLICKEYBYTES)\n    throw new Error('pk')\n  if (sk?.byteLength !== binding.crypto_box_SECRETKEYBYTES)\n    throw new Error('sk')\n\n  const res = binding.crypto_box_keypair(pk, sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_box_seed_keypair = function (pk, sk, seed) {\n  if (pk?.byteLength !== binding.crypto_box_PUBLICKEYBYTES)\n    throw new Error('pk')\n  if (sk?.byteLength !== binding.crypto_box_SECRETKEYBYTES)\n    throw new Error('sk')\n\n  const res = binding.crypto_box_seed_keypair(pk, sk, seed)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_box_easy = function (c, m, n, pk, sk) {\n  const res = binding.crypto_box_easy(c, m, n, pk, sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_box_detached = function (c, mac, m, n, pk, sk) {\n  const res = binding.crypto_box_detached(c, mac, m, n, pk, sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_box_seal = function (c, m, pk) {\n  const res = binding.crypto_box_seal(c, m, pk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_box_seal_open = function (m, c, pk, sk) {\n  return binding.crypto_box_seal_open(\n    m.buffer,\n    m.byteOffset,\n    m.byteLength,\n\n    c.buffer,\n    c.byteOffset,\n    c.byteLength,\n\n    pk.buffer,\n    pk.byteOffset,\n    pk.byteLength,\n\n    sk.buffer,\n    sk.byteOffset,\n    sk.byteLength\n  )\n}\n\n// crypto_secretbox\n\nexports.crypto_secretbox_easy = function (c, m, n, k) {\n  if (c?.byteLength !== m.byteLength + binding.crypto_secretbox_MACBYTES)\n    throw new Error(\n      'c must be \"m.byteLength + crypto_secretbox_MACBYTES\" bytes'\n    )\n  if (n?.byteLength !== binding.crypto_secretbox_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_secretbox_KEYBYTES) throw new Error('k')\n\n  const res = binding.crypto_secretbox_easy(c, m, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_secretbox_open_easy = function (m, c, n, k) {\n  if (m?.byteLength !== c.byteLength - binding.crypto_secretbox_MACBYTES)\n    throw new Error('m must be \"c - crypto_secretbox_MACBYTES\" bytes')\n  if (c?.byteLength < binding.crypto_secretbox_MACBYTES) throw new Error('c')\n  if (n?.byteLength !== binding.crypto_secretbox_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_secretbox_KEYBYTES) throw new Error('k')\n\n  return binding.crypto_secretbox_open_easy(m, c, n, k)\n}\n\nexports.crypto_secretbox_detached = function (c, mac, m, n, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('c must \"m.byteLength\" bytes')\n  if (mac?.byteLength !== binding.crypto_secretbox_MACBYTES)\n    throw new Error('mac')\n  if (n?.byteLength !== binding.crypto_secretbox_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_secretbox_KEYBYTES) throw new Error('k')\n\n  const res = binding.crypto_secretbox_detached(c, mac, m, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_secretbox_open_detached = function (m, c, mac, n, k) {\n  if (m?.byteLength !== c.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (mac?.byteLength !== binding.crypto_secretbox_MACBYTES)\n    throw new Error('mac')\n  if (n?.byteLength !== binding.crypto_secretbox_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_secretbox_KEYBYTES) throw new Error('k')\n\n  return binding.crypto_secretbox_open_detached(m, c, mac, n, k)\n}\n\n// crypto_generichash\n\nexports.crypto_generichash = function (output, input, key = OPTIONAL) {\n  const res = binding.crypto_generichash(\n    output.buffer,\n    output.byteOffset,\n    output.byteLength,\n\n    input.buffer,\n    input.byteOffset,\n    input.byteLength,\n\n    key.buffer,\n    key.byteOffset,\n    key.byteLength\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_generichash_batch = function (output, batch, key) {\n  if (isNode || batch.length < 4) {\n    const res = binding.crypto_generichash_batch(\n      output,\n      batch,\n      !!key,\n      key || OPTIONAL\n    )\n    if (res !== 0) throw new Error('status: ' + res)\n  } else {\n    const state = Buffer.alloc(binding.crypto_generichash_STATEBYTES)\n\n    exports.crypto_generichash_init(state, key, output.byteLength)\n\n    for (const buf of batch) {\n      exports.crypto_generichash_update(state, buf)\n    }\n\n    exports.crypto_generichash_final(state, output)\n  }\n}\n\nexports.crypto_generichash_keygen = function (key) {\n  const res = binding.crypto_generichash_keygen(\n    key.buffer,\n    key.byteOffset,\n    key.byteLength\n  )\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_generichash_init = function (state, key, outputLength) {\n  key ||= OPTIONAL\n\n  const res = binding.crypto_generichash_init(\n    state.buffer,\n    state.byteOffset,\n    state.byteLength,\n\n    key.buffer,\n    key.byteOffset,\n    key.byteLength,\n\n    outputLength\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_generichash_update = function (state, input) {\n  const res = binding.crypto_generichash_update(\n    state.buffer,\n    state.byteOffset,\n    state.byteLength,\n\n    input.buffer,\n    input.byteOffset,\n    input.byteLength\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_generichash_final = function (state, output) {\n  const res = binding.crypto_generichash_final(\n    state.buffer,\n    state.byteOffset,\n    state.byteLength,\n\n    output.buffer,\n    output.byteOffset,\n    output.byteLength\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\n// secretstream\n\nexports.crypto_secretstream_xchacha20poly1305_keygen = function (k) {\n  binding.crypto_secretstream_xchacha20poly1305_keygen(\n    k.buffer,\n    k.byteOffset,\n    k.byteLength\n  )\n}\n\nexports.crypto_secretstream_xchacha20poly1305_init_push = function (\n  state,\n  header,\n  k\n) {\n  const res = binding.crypto_secretstream_xchacha20poly1305_init_push(\n    state.buffer,\n    state.byteOffset,\n    state.byteLength,\n\n    header.buffer,\n    header.byteOffset,\n    header.byteLength,\n\n    k.buffer,\n    k.byteOffset,\n    k.byteLength\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_secretstream_xchacha20poly1305_init_pull = function (\n  state,\n  header,\n  k\n) {\n  const res = binding.crypto_secretstream_xchacha20poly1305_init_pull(\n    state.buffer,\n    state.byteOffset,\n    state.byteLength,\n\n    header.buffer,\n    header.byteOffset,\n    header.byteLength,\n\n    k.buffer,\n    k.byteOffset,\n    k.byteLength\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_secretstream_xchacha20poly1305_push = function (\n  state,\n  c,\n  m,\n  ad,\n  tag\n) {\n  ad ||= OPTIONAL\n\n  const res = binding.crypto_secretstream_xchacha20poly1305_push(\n    state.buffer,\n    state.byteOffset,\n    state.byteLength,\n\n    c.buffer,\n    c.byteOffset,\n    c.byteLength,\n\n    m.buffer,\n    m.byteOffset,\n    m.byteLength,\n\n    ad.buffer,\n    ad.byteOffset,\n    ad.byteLength,\n\n    tag\n  )\n\n  if (res < 0) throw new Error('push failed')\n\n  return res\n}\n\nexports.crypto_secretstream_xchacha20poly1305_pull = function (\n  state,\n  m,\n  tag,\n  c,\n  ad\n) {\n  ad ||= OPTIONAL\n\n  if (c?.byteLength < binding.crypto_secretstream_xchacha20poly1305_ABYTES)\n    throw new Error('invalid cipher length')\n  if (\n    m?.byteLength !==\n    c.byteLength - binding.crypto_secretstream_xchacha20poly1305_ABYTES\n  )\n    throw new Error('invalid message length')\n\n  const res = binding.crypto_secretstream_xchacha20poly1305_pull(\n    state.buffer,\n    state.byteOffset,\n    state.byteLength,\n\n    m.buffer,\n    m.byteOffset,\n    m.byteLength,\n\n    tag.buffer,\n    tag.byteOffset,\n    tag.byteLength,\n\n    c.buffer,\n    c.byteOffset,\n    c.byteLength,\n\n    ad.buffer,\n    ad.byteOffset,\n    ad.byteLength\n  )\n\n  if (res < 0) throw new Error('pull failed')\n\n  return res\n}\n\nexports.crypto_secretstream_xchacha20poly1305_rekey = function (state) {\n  binding.crypto_secretstream_xchacha20poly1305_rekey(\n    state.buffer,\n    state.byteOffset,\n    state.byteLength\n  )\n}\n\n// crypto_stream\n\nexports.crypto_stream = function (c, n, k) {\n  if (n?.byteLength !== binding.crypto_stream_NONCEBYTES) throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_KEYBYTES) throw new Error('k')\n\n  const res = binding.crypto_stream(c, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_xor = function (c, m, n, k) {\n  const res = binding.crypto_stream_xor(\n    c.buffer,\n    c.byteOffset,\n    c.byteLength,\n\n    m.buffer,\n    m.byteOffset,\n    m.byteLength,\n\n    n.buffer,\n    n.byteOffset,\n    n.byteLength,\n\n    k.buffer,\n    k.byteOffset,\n    k.byteLength\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_chacha20 = function (c, n, k) {\n  if (n?.byteLength !== binding.crypto_stream_chacha20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_chacha20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_chacha20(c, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_chacha20_xor = function (c, m, n, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (n?.byteLength !== binding.crypto_stream_chacha20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_chacha20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_chacha20_xor(c, m, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_chacha20_xor_ic = function (c, m, n, ic, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (n?.byteLength !== binding.crypto_stream_chacha20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_chacha20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_chacha20_xor_ic(c, m, n, ic, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_chacha20_ietf = function (c, n, k) {\n  if (n?.byteLength !== binding.crypto_stream_chacha20_ietf_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_chacha20_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_chacha20_ietf(c, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_chacha20_ietf_xor = function (c, m, n, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (n?.byteLength !== binding.crypto_stream_chacha20_ietf_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_chacha20_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_chacha20_ietf_xor(c, m, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_chacha20_ietf_xor_ic = function (c, m, n, ic, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (n?.byteLength !== binding.crypto_stream_chacha20_ietf_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_chacha20_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_chacha20_ietf_xor_ic(c, m, n, ic, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_xchacha20 = function (c, n, k) {\n  if (n?.byteLength !== binding.crypto_stream_xchacha20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_xchacha20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_xchacha20(c, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_xchacha20_xor = function (c, m, n, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (n?.byteLength !== binding.crypto_stream_xchacha20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_xchacha20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_xchacha20_xor(c, m, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_xchacha20_xor_ic = function (c, m, n, ic, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (n?.byteLength !== binding.crypto_stream_xchacha20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_xchacha20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_xchacha20_xor_ic(c, m, n, ic, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_salsa20 = function (c, n, k) {\n  if (n?.byteLength !== binding.crypto_stream_salsa20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_salsa20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_salsa20(c, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_salsa20_xor = function (c, m, n, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (n?.byteLength !== binding.crypto_stream_salsa20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_salsa20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_salsa20_xor(c, m, n, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_stream_salsa20_xor_ic = function (c, m, n, ic, k) {\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (n?.byteLength !== binding.crypto_stream_salsa20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_salsa20_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_stream_salsa20_xor_ic(c, m, n, ic, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\n// crypto_auth\n\nexports.crypto_auth = function (out, input, k) {\n  if (out?.byteLength !== binding.crypto_auth_BYTES) throw new Error('out')\n  if (k?.byteLength !== binding.crypto_auth_KEYBYTES) throw new Error('k')\n\n  const res = binding.crypto_auth(out, input, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_auth_verify = function (h, input, k) {\n  if (h?.byteLength !== binding.crypto_auth_BYTES) throw new Error('h')\n  if (k?.byteLength !== binding.crypto_auth_KEYBYTES) throw new Error('k')\n\n  return binding.crypto_auth_verify(h, input, k)\n}\n\n// crypto_onetimeauth\n\nexports.crypto_onetimeauth = function (out, input, k) {\n  if (out?.byteLength !== binding.crypto_onetimeauth_BYTES)\n    throw new Error('out')\n  if (k?.byteLength !== binding.crypto_onetimeauth_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_onetimeauth(out, input, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_onetimeauth_init = function (state, k) {\n  if (state?.byteLength !== binding.crypto_onetimeauth_STATEBYTES)\n    throw new Error(\"state must be 'crypto_onetimeauth_STATEBYTES' bytes\")\n  if (k?.byteLength !== binding.crypto_onetimeauth_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_onetimeauth_init(state, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_onetimeauth_update = function (state, input) {\n  if (state?.byteLength !== binding.crypto_onetimeauth_STATEBYTES)\n    throw new Error(\"state must be 'crypto_onetimeauth_STATEBYTES' bytes\")\n\n  const res = binding.crypto_onetimeauth_update(state, input)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_onetimeauth_final = function (state, out) {\n  if (state?.byteLength !== binding.crypto_onetimeauth_STATEBYTES)\n    throw new Error(\"state must be 'crypto_onetimeauth_STATEBYTES' bytes\")\n  if (out?.byteLength !== binding.crypto_onetimeauth_BYTES)\n    throw new Error('out')\n\n  const res = binding.crypto_onetimeauth_final(state, out)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_onetimeauth_verify = function (h, input, k) {\n  if (h?.byteLength !== binding.crypto_onetimeauth_BYTES) throw new Error('h')\n  if (k?.byteLength !== binding.crypto_onetimeauth_KEYBYTES)\n    throw new Error('k')\n\n  return binding.crypto_onetimeauth_verify(h, input, k)\n}\n\n// crypto_pwhash\n\nexports.crypto_pwhash = function (out, passwd, salt, opslimit, memlimit, alg) {\n  if (out?.byteLength < binding.crypto_pwhash_BYTES_MIN) throw new Error('out')\n  if (out?.byteLength > binding.crypto_pwhash_BYTES_MAX) throw new Error('out')\n  if (salt?.byteLength !== binding.crypto_pwhash_SALTBYTES)\n    throw new Error('salt')\n  if (opslimit < binding.crypto_pwhash_OPSLIMIT_MIN) throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_OPSLIMIT_MAX) throw new Error('opslimit')\n  if (memlimit < binding.crypto_pwhash_MEMLIMIT_MIN) throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_MEMLIMIT_MAX) throw new Error('memlimit')\n  if (alg < 1 || alg > 2)\n    throw new Error('alg must be either Argon2i 1.3 or Argon2id 1.3')\n\n  const res = binding.crypto_pwhash(out, passwd, salt, opslimit, memlimit, alg)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_pwhash_async = function (\n  out,\n  passwd,\n  salt,\n  opslimit,\n  memlimit,\n  alg,\n  callback = undefined\n) {\n  if (out?.byteLength < binding.crypto_pwhash_BYTES_MIN) throw new Error('out')\n  if (out?.byteLength > binding.crypto_pwhash_BYTES_MAX) throw new Error('out')\n  if (salt?.byteLength !== binding.crypto_pwhash_SALTBYTES)\n    throw new Error('salt')\n  if (opslimit < binding.crypto_pwhash_OPSLIMIT_MIN) throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_OPSLIMIT_MAX) throw new Error('opslimit')\n  if (memlimit < binding.crypto_pwhash_MEMLIMIT_MIN) throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_MEMLIMIT_MAX) throw new Error('memlimit')\n  if (alg < 1 || alg > 2)\n    throw new Error('alg must be either Argon2i 1.3 or Argon2id 1.3')\n\n  const [done, promise] = checkStatus(callback)\n\n  binding.crypto_pwhash_async(\n    out.buffer,\n    out.byteOffset,\n    out.byteLength,\n\n    passwd.buffer,\n    passwd.byteOffset,\n    passwd.byteLength,\n\n    salt.buffer,\n    salt.byteOffset,\n    salt.byteLength,\n\n    opslimit,\n    memlimit,\n    alg,\n\n    done\n  )\n\n  return promise\n}\n\nexports.crypto_pwhash_str = function (out, passwd, opslimit, memlimit) {\n  if (out?.byteLength !== binding.crypto_pwhash_STRBYTES) throw new Error('out')\n  if (typeof opslimit !== 'number') throw new Error('opslimit')\n  if (opslimit < binding.crypto_pwhash_OPSLIMIT_MIN) throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_OPSLIMIT_MAX) throw new Error('opslimit')\n  if (typeof memlimit !== 'number') throw new Error('memlimit')\n  if (memlimit < binding.crypto_pwhash_MEMLIMIT_MIN) throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_MEMLIMIT_MAX) throw new Error('memlimit')\n\n  const res = binding.crypto_pwhash_str(out, passwd, opslimit, memlimit)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_pwhash_str_async = function (\n  out,\n  passwd,\n  opslimit,\n  memlimit,\n  callback = undefined\n) {\n  if (out?.byteLength !== binding.crypto_pwhash_STRBYTES) throw new Error('out')\n  if (!passwd?.byteLength) throw new Error('passwd')\n  if (typeof opslimit !== 'number') throw new Error('opslimit')\n  if (opslimit < binding.crypto_pwhash_OPSLIMIT_MIN) throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_OPSLIMIT_MAX) throw new Error('opslimit')\n  if (typeof memlimit !== 'number') throw new Error('memlimit')\n  if (memlimit < binding.crypto_pwhash_MEMLIMIT_MIN) throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_MEMLIMIT_MAX) throw new Error('memlimit')\n\n  const [done, promise] = checkStatus(callback)\n\n  binding.crypto_pwhash_str_async(\n    out.buffer,\n    out.byteOffset,\n    out.byteLength,\n\n    passwd.buffer,\n    passwd.byteOffset,\n    passwd.byteLength,\n\n    opslimit,\n    memlimit,\n\n    done\n  )\n\n  return promise\n}\n\nexports.crypto_pwhash_str_verify = function (str, passwd) {\n  if (str?.byteLength !== binding.crypto_pwhash_STRBYTES) throw new Error('str')\n\n  return binding.crypto_pwhash_str_verify(str, passwd)\n}\n\nexports.crypto_pwhash_str_verify_async = function (\n  str,\n  passwd,\n  callback = undefined\n) {\n  if (str?.byteLength !== binding.crypto_pwhash_STRBYTES) throw new Error('str')\n  if (!passwd?.byteLength) throw new Error('passwd')\n\n  const [done, promise] = checkStatus(callback, true)\n\n  binding.crypto_pwhash_str_verify_async(\n    str.buffer,\n    str.byteOffset,\n    str.byteLength,\n\n    passwd.buffer,\n    passwd.byteOffset,\n    passwd.byteLength,\n\n    done\n  )\n\n  return promise\n}\n\nexports.crypto_pwhash_str_needs_rehash = function (str, opslimit, memlimit) {\n  if (str?.byteLength !== binding.crypto_pwhash_STRBYTES) throw new Error('str')\n  if (opslimit < binding.crypto_pwhash_OPSLIMIT_MIN) throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_OPSLIMIT_MAX) throw new Error('opslimit')\n  if (memlimit < binding.crypto_pwhash_MEMLIMIT_MIN) throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_MEMLIMIT_MAX) throw new Error('memlimit')\n\n  return binding.crypto_pwhash_str_needs_rehash(str, opslimit, memlimit)\n}\n\nexports.crypto_pwhash_scryptsalsa208sha256 = function (\n  out,\n  passwd,\n  salt,\n  opslimit,\n  memlimit\n) {\n  if (out?.byteLength < binding.crypto_pwhash_scryptsalsa208sha256_BYTES_MIN)\n    throw new Error('out')\n  if (out?.byteLength > binding.crypto_pwhash_scryptsalsa208sha256_BYTES_MAX)\n    throw new Error('out')\n  if (salt?.byteLength !== binding.crypto_pwhash_scryptsalsa208sha256_SALTBYTES)\n    throw new Error('salt')\n  if (opslimit < binding.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN)\n    throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX)\n    throw new Error('opslimit')\n  if (memlimit < binding.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN)\n    throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX)\n    throw new Error('memlimit')\n\n  const res = binding.crypto_pwhash_scryptsalsa208sha256(\n    out,\n    passwd,\n    salt,\n    opslimit,\n    memlimit\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_pwhash_scryptsalsa208sha256_async = function (\n  out,\n  passwd,\n  salt,\n  opslimit,\n  memlimit,\n  callback = undefined\n) {\n  if (out?.byteLength < binding.crypto_pwhash_scryptsalsa208sha256_BYTES_MIN)\n    throw new Error('out')\n  if (out?.byteLength > binding.crypto_pwhash_scryptsalsa208sha256_BYTES_MAX)\n    throw new Error('out')\n  if (!passwd?.byteLength) throw new Error('passwd')\n  if (salt?.byteLength !== binding.crypto_pwhash_scryptsalsa208sha256_SALTBYTES)\n    throw new Error('salt')\n  if (opslimit < binding.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN)\n    throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX)\n    throw new Error('opslimit')\n  if (memlimit < binding.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN)\n    throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX)\n    throw new Error('memlimit')\n\n  const [done, promise] = checkStatus(callback)\n\n  binding.crypto_pwhash_scryptsalsa208sha256_async(\n    out.buffer,\n    out.byteOffset,\n    out.byteLength,\n\n    passwd.buffer,\n    passwd.byteOffset,\n    passwd.byteLength,\n\n    salt.buffer,\n    salt.byteOffset,\n    salt.byteLength,\n\n    opslimit,\n    memlimit,\n\n    done\n  )\n\n  return promise\n}\n\nexports.crypto_pwhash_scryptsalsa208sha256_str_async = function (\n  out,\n  passwd,\n  opslimit,\n  memlimit,\n  callback = undefined\n) {\n  if (out?.byteLength !== binding.crypto_pwhash_scryptsalsa208sha256_STRBYTES)\n    throw new Error('out')\n  if (!passwd?.byteLength) throw new Error('passwd')\n  if (opslimit < binding.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN)\n    throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX)\n    throw new Error('opslimit')\n  if (memlimit < binding.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN)\n    throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX)\n    throw new Error('memlimit')\n\n  const [done, promise] = checkStatus(callback)\n\n  binding.crypto_pwhash_scryptsalsa208sha256_str_async(\n    out.buffer,\n    out.byteOffset,\n    out.byteLength,\n\n    passwd.buffer,\n    passwd.byteOffset,\n    passwd.byteLength,\n\n    opslimit,\n    memlimit,\n\n    done\n  )\n\n  return promise\n}\n\nexports.crypto_pwhash_scryptsalsa208sha256_str = function (\n  out,\n  passwd,\n  opslimit,\n  memlimit\n) {\n  if (out?.byteLength !== binding.crypto_pwhash_scryptsalsa208sha256_STRBYTES)\n    throw new Error('out')\n  if (!passwd?.byteLength) throw new Error('passwd')\n  if (opslimit < binding.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN)\n    throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX)\n    throw new Error('opslimit')\n  if (memlimit < binding.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN)\n    throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX)\n    throw new Error('memlimit')\n\n  const res = binding.crypto_pwhash_scryptsalsa208sha256_str(\n    out,\n    passwd,\n    opslimit,\n    memlimit\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_pwhash_scryptsalsa208sha256_str_verify_async = function (\n  str,\n  passwd,\n  callback = undefined\n) {\n  if (str?.byteLength !== binding.crypto_pwhash_scryptsalsa208sha256_STRBYTES)\n    throw new Error('str')\n  if (!passwd?.byteLength) throw new Error('passwd')\n\n  const [done, promise] = checkStatus(callback, true)\n\n  binding.crypto_pwhash_scryptsalsa208sha256_str_verify_async(\n    str.buffer,\n    str.byteOffset,\n    str.byteLength,\n\n    passwd.buffer,\n    passwd.byteOffset,\n    passwd.byteLength,\n\n    done\n  )\n\n  return promise\n}\n\nexports.crypto_pwhash_scryptsalsa208sha256_str_verify = function (str, passwd) {\n  if (str?.byteLength !== binding.crypto_pwhash_scryptsalsa208sha256_STRBYTES)\n    throw new Error('str')\n  if (!passwd?.byteLength) throw new Error('passwd')\n\n  return binding.crypto_pwhash_scryptsalsa208sha256_str_verify(str, passwd)\n}\n\nexports.crypto_pwhash_scryptsalsa208sha256_str_needs_rehash = function (\n  str,\n  opslimit,\n  memlimit\n) {\n  if (str?.byteLength !== binding.crypto_pwhash_scryptsalsa208sha256_STRBYTES)\n    throw new Error('str')\n  if (opslimit < binding.crypto_pwhash_OPSLIMIT_MIN) throw new Error('opslimit')\n  if (opslimit > binding.crypto_pwhash_OPSLIMIT_MAX) throw new Error('opslimit')\n  if (memlimit < binding.crypto_pwhash_MEMLIMIT_MIN) throw new Error('memlimit')\n  if (memlimit > binding.crypto_pwhash_MEMLIMIT_MAX) throw new Error('memlimit')\n\n  return binding.crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(\n    str,\n    opslimit,\n    memlimit\n  )\n}\n\n// crypto_kx\n\nexports.crypto_kx_keypair = function (pk, sk) {\n  if (pk?.byteLength !== binding.crypto_kx_PUBLICKEYBYTES) throw new Error('pk')\n  if (sk?.byteLength !== binding.crypto_kx_SECRETKEYBYTES) throw new Error('sk')\n\n  const res = binding.crypto_kx_keypair(pk, sk)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_kx_seed_keypair = function (pk, sk, seed) {\n  if (pk?.byteLength !== binding.crypto_kx_PUBLICKEYBYTES) throw new Error('pk')\n  if (sk?.byteLength !== binding.crypto_kx_SECRETKEYBYTES) throw new Error('sk')\n  if (seed?.byteLength !== binding.crypto_kx_SEEDBYTES) throw new Error('seed')\n\n  const res = binding.crypto_kx_seed_keypair(pk, sk, seed)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_kx_client_session_keys = function (\n  rx,\n  tx,\n  clientPk,\n  clientSk,\n  serverPk\n) {\n  // match `std::optional` by coercing null to undefined\n  rx ??= undefined\n  tx ??= undefined\n\n  if (!rx && !tx) throw new Error('at least one session key must be specified')\n\n  if (rx) {\n    if (rx?.byteLength !== binding.crypto_kx_SESSIONKEYBYTES)\n      throw new Error(\n        'receiving key buffer must be \"crypto_kx_SESSIONKEYBYTES\" bytes or null'\n      )\n  } else {\n    if (tx?.byteLength !== binding.crypto_kx_SESSIONKEYBYTES)\n      throw new Error(\n        'transmitting key buffer must be \"crypto_kx_SESSIONKEYBYTES\" bytes or null'\n      )\n  }\n\n  if (clientPk?.byteLength !== binding.crypto_kx_PUBLICKEYBYTES)\n    throw new Error('client_pk')\n  if (clientSk?.byteLength !== binding.crypto_kx_SECRETKEYBYTES)\n    throw new Error('client_sk')\n  if (serverPk?.byteLength !== binding.crypto_kx_PUBLICKEYBYTES)\n    throw new Error('server_pk')\n\n  const res = binding.crypto_kx_client_session_keys(\n    rx,\n    tx,\n    clientPk,\n    clientSk,\n    serverPk\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_kx_server_session_keys = function (\n  rx,\n  tx,\n  serverPk,\n  serverSk,\n  clientPk\n) {\n  rx ??= undefined\n  tx ??= undefined\n\n  if (!rx && !tx) throw new Error('at least one session key must be specified')\n\n  if (rx) {\n    if (rx?.byteLength !== binding.crypto_kx_SESSIONKEYBYTES)\n      throw new Error(\n        'receiving key buffer must be \"crypto_kx_SESSIONKEYBYTES\" bytes or null'\n      )\n  } else {\n    if (tx?.byteLength !== binding.crypto_kx_SESSIONKEYBYTES)\n      throw new Error(\n        'transmitting key buffer must be \"crypto_kx_SESSIONKEYBYTES\" bytes or null'\n      )\n  }\n\n  if (serverPk?.byteLength !== binding.crypto_kx_PUBLICKEYBYTES)\n    throw new Error('server_pk')\n  if (serverSk?.byteLength !== binding.crypto_kx_SECRETKEYBYTES)\n    throw new Error('server_sk')\n  if (clientPk?.byteLength !== binding.crypto_kx_PUBLICKEYBYTES)\n    throw new Error('client_pk')\n\n  const res = binding.crypto_kx_server_session_keys(\n    rx,\n    tx,\n    serverPk,\n    serverSk,\n    clientPk\n  )\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\n// crypto_scalarmult\n\nexports.crypto_scalarmult_base = function (q, n) {\n  if (q?.byteLength !== binding.crypto_scalarmult_BYTES) throw new Error('q')\n  if (n?.byteLength !== binding.crypto_scalarmult_SCALARBYTES)\n    throw new Error('n')\n\n  const res = binding.crypto_scalarmult_base(q, n)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_scalarmult = function (q, n, p) {\n  if (q?.byteLength !== binding.crypto_scalarmult_BYTES) throw new Error('q')\n  if (n?.byteLength !== binding.crypto_scalarmult_SCALARBYTES)\n    throw new Error('n')\n  if (p?.byteLength !== binding.crypto_scalarmult_BYTES) throw new Error('p')\n\n  const res = binding.crypto_scalarmult(q, n, p)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_scalarmult_ed25519_base = function (q, n) {\n  if (q?.byteLength !== binding.crypto_scalarmult_ed25519_BYTES)\n    throw new Error('q')\n  if (n?.byteLength !== binding.crypto_scalarmult_ed25519_SCALARBYTES)\n    throw new Error('n')\n\n  const res = binding.crypto_scalarmult_ed25519_base(q, n)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_scalarmult_ed25519 = function (q, n, p) {\n  if (q?.byteLength !== binding.crypto_scalarmult_ed25519_BYTES)\n    throw new Error('q')\n  if (n?.byteLength !== binding.crypto_scalarmult_ed25519_SCALARBYTES)\n    throw new Error('n')\n  if (p?.byteLength !== binding.crypto_scalarmult_ed25519_BYTES)\n    throw new Error('p')\n\n  const res = binding.crypto_scalarmult_ed25519(q, n, p)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_core_ed25519_is_valid_point = function (p) {\n  if (p?.byteLength !== binding.crypto_core_ed25519_BYTES) throw new Error('p')\n\n  return binding.crypto_core_ed25519_is_valid_point(p)\n}\n\nexports.crypto_core_ed25519_from_uniform = function (p, r) {\n  if (p?.byteLength !== binding.crypto_core_ed25519_BYTES) throw new Error('p')\n  if (r?.byteLength !== binding.crypto_core_ed25519_UNIFORMBYTES)\n    throw new Error('r')\n\n  const res = binding.crypto_core_ed25519_from_uniform(p, r)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_scalarmult_ed25519_base_noclamp = function (q, n) {\n  if (q?.byteLength !== binding.crypto_scalarmult_ed25519_BYTES)\n    throw new Error('q')\n  if (n?.byteLength !== binding.crypto_scalarmult_ed25519_SCALARBYTES)\n    throw new Error('n')\n\n  const res = binding.crypto_scalarmult_ed25519_base_noclamp(q, n)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_scalarmult_ed25519_noclamp = function (q, n, p) {\n  if (q?.byteLength !== binding.crypto_scalarmult_ed25519_BYTES)\n    throw new Error('q')\n  if (n?.byteLength !== binding.crypto_scalarmult_ed25519_SCALARBYTES)\n    throw new Error('n')\n  if (p?.byteLength !== binding.crypto_scalarmult_ed25519_BYTES)\n    throw new Error('p')\n\n  const res = binding.crypto_scalarmult_ed25519_noclamp(q, n, p)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\n// crypto_core\n\nexports.crypto_core_ed25519_add = function (r, p, q) {\n  if (r?.byteLength !== binding.crypto_core_ed25519_BYTES) throw new Error('r')\n  if (p?.byteLength !== binding.crypto_core_ed25519_BYTES) throw new Error('p')\n  if (q?.byteLength !== binding.crypto_core_ed25519_BYTES) throw new Error('q')\n\n  const res = binding.crypto_core_ed25519_add(r, p, q)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_core_ed25519_sub = function (r, p, q) {\n  if (r?.byteLength !== binding.crypto_core_ed25519_BYTES) throw new Error('r')\n  if (p?.byteLength !== binding.crypto_core_ed25519_BYTES) throw new Error('p')\n  if (q?.byteLength !== binding.crypto_core_ed25519_BYTES) throw new Error('q')\n\n  const res = binding.crypto_core_ed25519_sub(r, p, q)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_core_ed25519_scalar_random = function (r) {\n  if (r?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('r')\n\n  binding.crypto_core_ed25519_scalar_random(r)\n}\n\nexports.crypto_core_ed25519_scalar_reduce = function (r, s) {\n  if (r?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('r')\n  if (s?.byteLength !== binding.crypto_core_ed25519_NONREDUCEDSCALARBYTES)\n    throw new Error('s')\n\n  binding.crypto_core_ed25519_scalar_reduce(r, s)\n}\n\nexports.crypto_core_ed25519_scalar_invert = function (recip, s) {\n  if (recip?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('recip')\n  if (s?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('s')\n\n  binding.crypto_core_ed25519_scalar_invert(recip, s)\n}\n\nexports.crypto_core_ed25519_scalar_negate = function (neg, s) {\n  if (neg?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('neg')\n  if (s?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('s')\n\n  binding.crypto_core_ed25519_scalar_negate(neg, s)\n}\n\nexports.crypto_core_ed25519_scalar_complement = function (comp, s) {\n  if (comp?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('comp')\n  if (s?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('s')\n\n  binding.crypto_core_ed25519_scalar_complement(comp, s)\n}\n\nexports.crypto_core_ed25519_scalar_add = function (z, x, y) {\n  if (z?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('z')\n  if (x?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('x')\n  if (y?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('y')\n\n  binding.crypto_core_ed25519_scalar_add(z, x, y)\n}\n\nexports.crypto_core_ed25519_scalar_sub = function (z, x, y) {\n  if (z?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('z')\n  if (x?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('x')\n  if (y?.byteLength !== binding.crypto_core_ed25519_SCALARBYTES)\n    throw new Error('y')\n\n  binding.crypto_core_ed25519_scalar_sub(z, x, y)\n}\n\n// crypto_shorthash\n\nexports.crypto_shorthash = function (out, input, k) {\n  if (out?.byteLength !== binding.crypto_shorthash_BYTES) throw new Error('out')\n  if (k?.byteLength !== binding.crypto_shorthash_KEYBYTES) throw new Error('k')\n\n  const res = binding.crypto_shorthash(out, input, k)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\n// crypto_kdf\n\nexports.crypto_kdf_keygen = function (key) {\n  if (key?.byteLength !== binding.crypto_kdf_KEYBYTES) throw new Error('key')\n\n  binding.crypto_kdf_keygen(key)\n}\n\nexports.crypto_kdf_derive_from_key = function (subkey, subkeyId, ctx, key) {\n  if (subkey?.byteLength < binding.crypto_kdf_BYTES_MIN)\n    throw new Error('subkey')\n  if (subkey?.byteLength > binding.crypto_kdf_BYTES_MAX)\n    throw new Error('subkey')\n  if (ctx?.byteLength !== binding.crypto_kdf_CONTEXTBYTES)\n    throw new Error('ctx')\n  if (key?.byteLength !== binding.crypto_kdf_KEYBYTES) throw new Error('key')\n\n  const res = binding.crypto_kdf_derive_from_key(subkey, subkeyId, ctx, key)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\n// crypto_hash\n\nexports.crypto_hash = function (out, input) {\n  if (out?.byteLength !== binding.crypto_hash_BYTES) throw new Error('out')\n\n  const res = binding.crypto_hash(out, input)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_hash_sha256 = function (out, input) {\n  if (out?.byteLength !== binding.crypto_hash_sha256_BYTES)\n    throw new Error('out')\n\n  const res = binding.crypto_hash_sha256(out, input)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_hash_sha256_init = function (state) {\n  if (state?.byteLength !== binding.crypto_hash_sha256_STATEBYTES) {\n    throw new Error(\"state must be 'crypto_hash_sha256_STATEBYTES' bytes\")\n  }\n\n  const res = binding.crypto_hash_sha256_init(state)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_hash_sha256_update = function (state, input) {\n  if (state?.byteLength !== binding.crypto_hash_sha256_STATEBYTES) {\n    throw new Error(\"state must be 'crypto_hash_sha256_STATEBYTES' bytes\")\n  }\n\n  const res = binding.crypto_hash_sha256_update(state, input)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_hash_sha256_final = function (state, out) {\n  if (state?.byteLength !== binding.crypto_hash_sha256_STATEBYTES) {\n    throw new Error(\"state must be 'crypto_hash_sha256_STATEBYTES' bytes\")\n  }\n  if (out?.byteLength !== binding.crypto_hash_sha256_BYTES)\n    throw new Error('state')\n\n  const res = binding.crypto_hash_sha256_final(state, out)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_hash_sha512 = function (out, input) {\n  if (out?.byteLength !== binding.crypto_hash_sha512_BYTES)\n    throw new Error('out')\n\n  const res = binding.crypto_hash_sha512(out, input)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_hash_sha512_init = function (state) {\n  if (state?.byteLength !== binding.crypto_hash_sha512_STATEBYTES) {\n    throw new Error(\"state must be 'crypto_hash_sha512_STATEBYTES' bytes\")\n  }\n\n  const res = binding.crypto_hash_sha512_init(state)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_hash_sha512_update = function (state, input) {\n  if (state?.byteLength !== binding.crypto_hash_sha512_STATEBYTES) {\n    throw new Error(\"state must be 'crypto_hash_sha512_STATEBYTES' bytes\")\n  }\n\n  const res = binding.crypto_hash_sha512_update(state, input)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\nexports.crypto_hash_sha512_final = function (state, out) {\n  if (state?.byteLength !== binding.crypto_hash_sha512_STATEBYTES) {\n    throw new Error(\"state must be 'crypto_hash_sha512_STATEBYTES' bytes\")\n  }\n  if (out?.byteLength !== binding.crypto_hash_sha512_BYTES)\n    throw new Error('out')\n\n  const res = binding.crypto_hash_sha512_final(state, out)\n\n  if (res !== 0) throw new Error('status: ' + res)\n}\n\n// crypto_aead\n\nexports.crypto_aead_xchacha20poly1305_ietf_keygen = function (k) {\n  if (k?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  binding.crypto_aead_xchacha20poly1305_ietf_keygen(k)\n}\n\nexports.crypto_aead_xchacha20poly1305_ietf_encrypt = function (\n  c,\n  m,\n  ad,\n  nsec = null,\n  npub,\n  k\n) {\n  ad ??= undefined\n  if (nsec !== null) throw new Error('nsec must always be set to null')\n  if (\n    c?.byteLength !==\n    m.byteLength + binding.crypto_aead_xchacha20poly1305_ietf_ABYTES\n  )\n    throw new Error(\n      'c must \"m.byteLength + crypto_aead_xchacha20poly1305_ietf_ABYTES\" bytes'\n    )\n  if (c?.byteLength > 0xffffffff)\n    throw new Error('c.byteLength must be a 32bit integer')\n  if (npub?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES)\n    throw new Error('npub')\n  if (k?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_aead_xchacha20poly1305_ietf_encrypt(\n    c,\n    m,\n    ad,\n    npub,\n    k\n  )\n  if (res < 0) throw new Error('could not encrypt data')\n\n  return res\n}\n\nexports.crypto_aead_xchacha20poly1305_ietf_decrypt = function (\n  m,\n  nsec = null,\n  c,\n  ad,\n  npub,\n  k\n) {\n  ad ??= undefined\n  if (nsec !== null) throw new Error('nsec must always be set to null')\n  if (\n    m?.byteLength !==\n    c.byteLength - binding.crypto_aead_xchacha20poly1305_ietf_ABYTES\n  )\n    throw new Error(\n      'm must \"c.byteLength - crypto_aead_xchacha20poly1305_ietf_ABYTES\" bytes'\n    )\n  if (m?.byteLength > 0xffffffff)\n    throw new Error('m.byteLength must be a 32bit integer')\n  if (npub?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES)\n    throw new Error('npub')\n  if (k?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_aead_xchacha20poly1305_ietf_decrypt(\n    m,\n    c,\n    ad,\n    npub,\n    k\n  )\n  if (res < 0) throw new Error('could not verify data')\n\n  return res\n}\n\nexports.crypto_aead_xchacha20poly1305_ietf_encrypt_detached = function (\n  c,\n  mac,\n  m,\n  ad,\n  nsec = null,\n  npub,\n  k\n) {\n  ad ??= undefined\n  if (nsec !== null) throw new Error('nsec must always be set to null')\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('c must be \"m.byteLength\" bytes')\n  if (mac?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_ABYTES)\n    throw new Error('mac')\n  if (npub?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES)\n    throw new Error('npub')\n  if (k?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_aead_xchacha20poly1305_ietf_encrypt_detached(\n    c,\n    mac,\n    m,\n    ad,\n    npub,\n    k\n  )\n  if (res < 0) throw new Error('could not encrypt data')\n\n  return res\n}\n\nexports.crypto_aead_xchacha20poly1305_ietf_decrypt_detached = function (\n  m,\n  nsec = null,\n  c,\n  mac,\n  ad,\n  npub,\n  k\n) {\n  ad ??= undefined\n  if (nsec !== null) throw new Error('nsec must always be set to null')\n  if (m?.byteLength !== c.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (mac?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_ABYTES)\n    throw new Error('mac')\n  if (npub?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES)\n    throw new Error('npub')\n  if (k?.byteLength !== binding.crypto_aead_xchacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_aead_xchacha20poly1305_ietf_decrypt_detached(\n    m,\n    c,\n    mac,\n    ad,\n    npub,\n    k\n  )\n  if (res !== 0) throw new Error('could not verify data')\n}\n\nexports.crypto_aead_chacha20poly1305_ietf_keygen = function (k) {\n  if (k?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  binding.crypto_aead_chacha20poly1305_ietf_keygen(k)\n}\n\nexports.crypto_aead_chacha20poly1305_ietf_encrypt = function (\n  c,\n  m,\n  ad,\n  nsec = null,\n  npub,\n  k\n) {\n  ad ??= undefined\n  if (nsec !== null) throw new Error('nsec must always be set to null')\n  if (\n    c?.byteLength !==\n    m.byteLength + binding.crypto_aead_chacha20poly1305_ietf_ABYTES\n  )\n    throw new Error(\n      'c must \"m.byteLength + crypto_aead_chacha20poly1305_ietf_ABYTES\" bytes'\n    )\n  if (c?.byteLength > 0xffffffff)\n    throw new Error('c.byteLength must be a 32bit integer')\n  if (npub?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_NPUBBYTES)\n    throw new Error('npub')\n  if (k?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_aead_chacha20poly1305_ietf_encrypt(\n    c,\n    m,\n    ad,\n    npub,\n    k\n  )\n  if (res < 0) throw new Error('could not encrypt data')\n\n  return res\n}\n\nexports.crypto_aead_chacha20poly1305_ietf_decrypt = function (\n  m,\n  nsec = null,\n  c,\n  ad,\n  npub,\n  k\n) {\n  ad ??= undefined\n  if (nsec !== null) throw new Error('nsec must always be set to null')\n  if (\n    m?.byteLength !==\n    c.byteLength - binding.crypto_aead_chacha20poly1305_ietf_ABYTES\n  )\n    throw new Error(\n      'm must \"c.byteLength - crypto_aead_chacha20poly1305_ietf_ABYTES\" bytes'\n    )\n  if (m?.byteLength > 0xffffffff)\n    throw new Error('m.byteLength must be a 32bit integer')\n  if (npub?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_NPUBBYTES)\n    throw new Error('npub')\n  if (k?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_aead_chacha20poly1305_ietf_decrypt(\n    m,\n    c,\n    ad,\n    npub,\n    k\n  )\n  if (res < 0) throw new Error('could not verify data')\n\n  return res\n}\n\nexports.crypto_aead_chacha20poly1305_ietf_encrypt_detached = function (\n  c,\n  mac,\n  m,\n  ad,\n  nsec = null,\n  npub,\n  k\n) {\n  ad ??= undefined\n  if (nsec !== null) throw new Error('nsec must always be set to null')\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('c must be \"m.byteLength\" bytes')\n  if (mac?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_ABYTES)\n    throw new Error('mac')\n  if (npub?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_NPUBBYTES)\n    throw new Error('npub')\n  if (k?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_aead_chacha20poly1305_ietf_encrypt_detached(\n    c,\n    mac,\n    m,\n    ad,\n    npub,\n    k\n  )\n  if (res < 0) throw new Error('could not encrypt data')\n\n  return res\n}\n\nexports.crypto_aead_chacha20poly1305_ietf_decrypt_detached = function (\n  m,\n  nsec = null,\n  c,\n  mac,\n  ad,\n  npub,\n  k\n) {\n  ad ??= undefined\n  if (nsec !== null) throw new Error('nsec must always be set to null')\n  if (m?.byteLength !== c.byteLength)\n    throw new Error('m must be \"c.byteLength\" bytes')\n  if (mac?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_ABYTES)\n    throw new Error('mac')\n  if (npub?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_NPUBBYTES)\n    throw new Error('npub')\n  if (k?.byteLength !== binding.crypto_aead_chacha20poly1305_ietf_KEYBYTES)\n    throw new Error('k')\n\n  const res = binding.crypto_aead_chacha20poly1305_ietf_decrypt_detached(\n    m,\n    c,\n    mac,\n    ad,\n    npub,\n    k\n  )\n  if (res !== 0) throw new Error('could not verify data')\n}\n\n// crypto_stream\n\nexports.crypto_stream_xor_wrap_init = function (state, n, k) {\n  if (state?.byteLength !== binding.sn_crypto_stream_xor_STATEBYTES) {\n    throw new Error(\"state must be 'sn_crypto_stream_xor_STATEBYTES' bytes\")\n  }\n  if (n?.byteLength !== binding.crypto_stream_NONCEBYTES) throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_KEYBYTES) throw new Error('k')\n\n  binding.crypto_stream_xor_wrap_init(state, n, k)\n}\n\nexports.crypto_stream_xor_wrap_update = function (state, c, m) {\n  if (state?.byteLength !== binding.sn_crypto_stream_xor_STATEBYTES) {\n    throw new Error(\"state must be 'sn_crypto_stream_xor_STATEBYTES' bytes\")\n  }\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('c must be \"m.byteLength\" bytes')\n\n  binding.crypto_stream_xor_wrap_update(state, c, m)\n}\n\nexports.crypto_stream_xor_wrap_final = function (state) {\n  if (state?.byteLength !== binding.sn_crypto_stream_xor_STATEBYTES) {\n    throw new Error(\"state must be 'sn_crypto_stream_xor_STATEBYTES' bytes\")\n  }\n\n  binding.crypto_stream_xor_wrap_final(state)\n}\n\nexports.crypto_stream_chacha20_xor_wrap_init = function (state, n, k) {\n  if (state?.byteLength !== binding.crypto_stream_chacha20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_chacha20_xor_STATEBYTES' bytes\"\n    )\n  }\n  if (n?.byteLength !== binding.crypto_stream_chacha20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_chacha20_KEYBYTES)\n    throw new Error('k')\n\n  binding.crypto_stream_chacha20_xor_wrap_init(state, n, k)\n}\n\nexports.crypto_stream_chacha20_xor_wrap_update = function (state, c, m) {\n  if (state?.byteLength !== binding.crypto_stream_chacha20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_chacha20_xor_STATEBYTES' bytes\"\n    )\n  }\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('c must be \"m.byteLength\" bytes')\n\n  binding.crypto_stream_chacha20_xor_wrap_update(state, c, m)\n}\n\nexports.crypto_stream_chacha20_xor_wrap_final = function (state) {\n  if (state?.byteLength !== binding.crypto_stream_chacha20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_chacha20_xor_STATEBYTES' bytes\"\n    )\n  }\n\n  binding.crypto_stream_chacha20_xor_wrap_final(state)\n}\n\nexports.crypto_stream_chacha20_ietf_xor_wrap_init = function (state, n, k) {\n  if (\n    state?.byteLength !== binding.crypto_stream_chacha20_ietf_xor_STATEBYTES\n  ) {\n    throw new Error(\n      \"state must be 'crypto_stream_chacha20_ietf_xor_STATEBYTES' bytes\"\n    )\n  }\n  if (n?.byteLength !== binding.crypto_stream_chacha20_ietf_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_chacha20_ietf_KEYBYTES)\n    throw new Error('k')\n\n  binding.crypto_stream_chacha20_ietf_xor_wrap_init(state, n, k)\n}\n\nexports.crypto_stream_chacha20_ietf_xor_wrap_update = function (state, c, m) {\n  if (\n    state?.byteLength !== binding.crypto_stream_chacha20_ietf_xor_STATEBYTES\n  ) {\n    throw new Error(\n      \"state must be 'crypto_stream_chacha20_ietf_xor_STATEBYTES' bytes\"\n    )\n  }\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('c must be \"m.byteLength\" bytes')\n\n  binding.crypto_stream_chacha20_ietf_xor_wrap_update(state, c, m)\n}\n\nexports.crypto_stream_chacha20_ietf_xor_wrap_final = function (state) {\n  if (\n    state?.byteLength !== binding.crypto_stream_chacha20_ietf_xor_STATEBYTES\n  ) {\n    throw new Error(\n      \"state must be 'crypto_stream_chacha20_ietf_xor_STATEBYTES' bytes\"\n    )\n  }\n\n  binding.crypto_stream_chacha20_ietf_xor_wrap_final(state)\n}\n\nexports.crypto_stream_xchacha20_xor_wrap_init = function (state, n, k) {\n  if (state?.byteLength !== binding.crypto_stream_xchacha20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_xchacha20_xor_STATEBYTES' bytes\"\n    )\n  }\n  if (n?.byteLength !== binding.crypto_stream_xchacha20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_xchacha20_KEYBYTES)\n    throw new Error('k')\n\n  binding.crypto_stream_xchacha20_xor_wrap_init(state, n, k)\n}\n\nexports.crypto_stream_xchacha20_xor_wrap_update = function (state, c, m) {\n  if (state?.byteLength !== binding.crypto_stream_xchacha20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_xchacha20_xor_STATEBYTES' bytes\"\n    )\n  }\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('c must be \"m.byteLength\" bytes')\n\n  binding.crypto_stream_xchacha20_xor_wrap_update(state, c, m)\n}\n\nexports.crypto_stream_xchacha20_xor_wrap_final = function (state) {\n  if (state?.byteLength !== binding.crypto_stream_xchacha20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_xchacha20_xor_STATEBYTES' bytes\"\n    )\n  }\n\n  binding.crypto_stream_xchacha20_xor_wrap_final(state)\n}\n\nexports.crypto_stream_salsa20_xor_wrap_init = function (state, n, k) {\n  if (state?.byteLength !== binding.crypto_stream_salsa20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_salsa20_xor_STATEBYTES' bytes\"\n    )\n  }\n  if (n?.byteLength !== binding.crypto_stream_salsa20_NONCEBYTES)\n    throw new Error('n')\n  if (k?.byteLength !== binding.crypto_stream_salsa20_KEYBYTES)\n    throw new Error('k')\n\n  binding.crypto_stream_salsa20_xor_wrap_init(state, n, k)\n}\n\nexports.crypto_stream_salsa20_xor_wrap_update = function (state, c, m) {\n  if (state?.byteLength !== binding.crypto_stream_salsa20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_salsa20_xor_STATEBYTES' bytes\"\n    )\n  }\n  if (c?.byteLength !== m.byteLength)\n    throw new Error('c must be \"m.byteLength\" bytes')\n\n  binding.crypto_stream_salsa20_xor_wrap_update(state, c, m)\n}\n\nexports.crypto_stream_salsa20_xor_wrap_final = function (state) {\n  if (state?.byteLength !== binding.crypto_stream_salsa20_xor_STATEBYTES) {\n    throw new Error(\n      \"state must be 'crypto_stream_salsa20_xor_STATEBYTES' bytes\"\n    )\n  }\n\n  binding.crypto_stream_salsa20_xor_wrap_final(state)\n}\n\n// experimental\n\nexports.extension_tweak_ed25519_base = function (n, p, ns) {\n  if (n?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('n')\n  if (p?.byteLength !== binding.extension_tweak_ed25519_BYTES)\n    throw new Error('p')\n\n  binding.extension_tweak_ed25519_base(n, p, ns)\n}\n\nexports.extension_tweak_ed25519_sign_detached = function (sig, m, scalar, pk) {\n  if (sig?.byteLength !== binding.crypto_sign_BYTES) throw new Error('sig')\n  if (scalar?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar')\n  if (pk && pk.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('pk')\n\n  const res = binding.extension_tweak_ed25519_sign_detached(sig, m, scalar, pk)\n  if (res !== 0) throw new Error('failed to compute signature')\n}\n\nexports.extension_tweak_ed25519_sk_to_scalar = function (n, sk) {\n  if (n?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('n')\n  if (sk?.byteLength !== binding.crypto_sign_SECRETKEYBYTES)\n    throw new Error('sk')\n\n  binding.extension_tweak_ed25519_sk_to_scalar(n, sk)\n}\n\nexports.extension_tweak_ed25519_scalar = function (scalarOut, scalar, ns) {\n  if (scalarOut?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar_out')\n  if (scalar?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar')\n\n  binding.extension_tweak_ed25519_scalar(scalarOut, scalar, ns)\n}\n\nexports.extension_tweak_ed25519_pk = function (tpk, pk, ns) {\n  if (tpk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('tpk')\n  if (pk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('pk')\n\n  const res = binding.extension_tweak_ed25519_pk(tpk, pk, ns)\n  if (res !== 0) throw new Error('failed to tweak public key')\n}\n\nexports.extension_tweak_ed25519_keypair = function (\n  pk,\n  scalarOut,\n  scalarIn,\n  ns\n) {\n  if (pk?.byteLength !== binding.extension_tweak_ed25519_BYTES)\n    throw new Error('pk')\n  if (scalarOut?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar_out')\n  if (scalarIn?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar_in')\n\n  binding.extension_tweak_ed25519_keypair(pk, scalarOut, scalarIn, ns)\n}\n\nexports.extension_tweak_ed25519_scalar_add = function (scalarOut, scalar, n) {\n  if (scalarOut?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar_out')\n  if (scalar?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar')\n  if (n?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('n')\n\n  binding.extension_tweak_ed25519_scalar_add(scalarOut, scalar, n)\n}\n\nexports.extension_tweak_ed25519_pk_add = function (tpk, pk, p) {\n  if (tpk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('tpk')\n  if (pk?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES)\n    throw new Error('pk')\n  if (p?.byteLength !== binding.crypto_sign_PUBLICKEYBYTES) throw new Error('p')\n\n  const res = binding.extension_tweak_ed25519_pk_add(tpk, pk, p)\n  if (res !== 0) throw new Error('failed to add tweak to public key')\n}\n\nexports.extension_tweak_ed25519_keypair_add = function (\n  pk,\n  scalarOut,\n  scalarIn,\n  tweak\n) {\n  if (pk?.byteLength !== binding.extension_tweak_ed25519_BYTES)\n    throw new Error('pk')\n  if (scalarOut?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar_out')\n  if (scalarIn?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('scalar_in')\n  if (tweak?.byteLength !== binding.extension_tweak_ed25519_SCALARBYTES)\n    throw new Error('tweak')\n\n  const res = binding.extension_tweak_ed25519_keypair_add(\n    pk,\n    scalarOut,\n    scalarIn,\n    tweak\n  )\n  if (res !== 0) throw new Error('failed to add tweak to keypair')\n}\n\nexports.extension_pbkdf2_sha512_async = function (\n  out,\n  passwd,\n  salt,\n  iter,\n  outlen,\n  callback = undefined\n) {\n  if (iter < binding.extension_pbkdf2_sha512_ITERATIONS_MIN)\n    throw new Error('iterations')\n  if (outlen > binding.extension_pbkdf2_sha512_BYTES_MAX)\n    throw new Error('outlen')\n  if (out?.byteLength < outlen) throw new Error('out')\n  if (!out?.byteLength) throw new Error('out')\n  if (!passwd?.byteLength) throw new Error('passwd')\n  if (!salt?.byteLength) throw new Error('salt')\n\n  const [done, promise] = checkStatus(callback)\n\n  binding.extension_pbkdf2_sha512_async(\n    out.buffer,\n    out.byteOffset,\n    out.byteLength,\n\n    passwd.buffer,\n    passwd.byteOffset,\n    passwd.byteLength,\n\n    salt.buffer,\n    salt.byteOffset,\n    salt.byteLength,\n\n    iter,\n    outlen,\n\n    done\n  )\n\n  return promise\n}\n\nexports.extension_pbkdf2_sha512 = function (out, passwd, salt, iter, outlen) {\n  if (iter < binding.extension_pbkdf2_sha512_ITERATIONS_MIN)\n    throw new Error('iterations')\n  if (outlen > binding.extension_pbkdf2_sha512_BYTES_MAX)\n    throw new Error('outlen')\n  if (out?.byteLength < outlen) throw new Error('out')\n\n  const res = binding.extension_pbkdf2_sha512(out, passwd, salt, iter, outlen)\n\n  if (res !== 0) throw new Error('failed to add tweak to public key')\n}\n\nfunction checkStatus(callback, booleanResult = false) {\n  let done, promise\n\n  if (typeof callback === 'function') {\n    done = function (status) {\n      if (booleanResult) callback(null, status === 0)\n      else if (status === 0) callback(null)\n      else callback(new Error('status: ' + status))\n    }\n  } else {\n    promise = new Promise(function (resolve, reject) {\n      done = function (status) {\n        if (booleanResult) resolve(status === 0)\n        else if (status === 0) resolve()\n        else reject(new Error('status: ' + status))\n      }\n    })\n  }\n\n  return [done, promise]\n}\n{\n  \"name\": \"sodium-native\",\n  \"version\": \"5.0.10\",\n  \"description\": \"Low level bindings for libsodium\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"binding.cc\",\n    \"binding.js\",\n    \"extensions\",\n    \"prebuilds\",\n    \"CMakeLists.txt\"\n  ],\n  \"addon\": true,\n  \"dependencies\": {\n    \"require-addon\": \"^1.1.0\",\n    \"which-runtime\": \"^1.2.1\"\n  },\n  \"devDependencies\": {\n    \"bare-compat-napi\": \"^1.3.5\",\n    \"brittle\": \"^3.16.2\",\n    \"cmake-bare\": \"^1.6.1\",\n    \"cmake-fetch\": \"^1.4.3\",\n    \"cmake-napi\": \"^1.2.1\",\n    \"prettier\": \"^3.6.2\",\n    \"prettier-config-holepunch\": \"^1.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"prettier . --check && npm run test:node && npm run test:bare\",\n    \"test:node\": \"node test/all.js\",\n    \"test:bare\": \"bare test/all.js\"\n  },\n  \"standard\": {\n    \"ignore\": [\n      \"/test/fixtures/*.js\"\n    ]\n  },\n  \"engines\": {\n    \"bare\": \">=1.16.0\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/sodium-native.git\"\n  },\n  \"contributors\": [\n    \"Emil Bay <github@tixz.dk> (http://bayes.dk)\",\n    \"Mathias Buus <mathiasbuus@gmail.com> (https://mafinto.sh)\",\n    \"Christophe Diederichs <chm-diederichs@hyperdivision.dk>\"\n  ],\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/sodium-native/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/sodium-native\"\n}\nconst sodium = require('sodium-universal')\nconst b4a = require('b4a')\n\nconst ABYTES = sodium.crypto_secretstream_xchacha20poly1305_ABYTES\nconst TAG_MESSAGE = sodium.crypto_secretstream_xchacha20poly1305_TAG_MESSAGE\nconst TAG_FINAL = sodium.crypto_secretstream_xchacha20poly1305_TAG_FINAL\nconst STATEBYTES = sodium.crypto_secretstream_xchacha20poly1305_STATEBYTES\nconst HEADERBYTES = sodium.crypto_secretstream_xchacha20poly1305_HEADERBYTES\nconst KEYBYTES = sodium.crypto_secretstream_xchacha20poly1305_KEYBYTES\nconst TAG_FINAL_BYTE = b4a.isBuffer(TAG_FINAL) ? TAG_FINAL[0] : TAG_FINAL\n\nconst EMPTY = b4a.alloc(0)\nconst TAG = b4a.alloc(1)\n\nclass Push {\n  constructor (key, state = b4a.allocUnsafeSlow(STATEBYTES), header = b4a.allocUnsafeSlow(HEADERBYTES)) {\n    if (!TAG_FINAL) throw new Error('JavaScript sodium version needs to support crypto_secretstream_xchacha20poly')\n\n    this.key = key\n    this.state = state\n    this.header = header\n\n    sodium.crypto_secretstream_xchacha20poly1305_init_push(this.state, this.header, this.key)\n  }\n\n  next (message, cipher = b4a.allocUnsafe(message.byteLength + ABYTES)) {\n    sodium.crypto_secretstream_xchacha20poly1305_push(this.state, cipher, message, null, TAG_MESSAGE)\n    return cipher\n  }\n\n  final (message = EMPTY, cipher = b4a.allocUnsafe(ABYTES)) {\n    sodium.crypto_secretstream_xchacha20poly1305_push(this.state, cipher, message, null, TAG_FINAL)\n    return cipher\n  }\n}\n\nclass Pull {\n  constructor (key, state = b4a.allocUnsafeSlow(STATEBYTES)) {\n    if (!TAG_FINAL) throw new Error('JavaScript sodium version needs to support crypto_secretstream_xchacha20poly')\n\n    this.key = key\n    this.state = state\n    this.final = false\n  }\n\n  init (header) {\n    sodium.crypto_secretstream_xchacha20poly1305_init_pull(this.state, header, this.key)\n  }\n\n  next (cipher, message = b4a.allocUnsafe(cipher.byteLength - ABYTES)) {\n    sodium.crypto_secretstream_xchacha20poly1305_pull(this.state, message, TAG, cipher, null)\n    this.final = TAG[0] === TAG_FINAL_BYTE\n    return message\n  }\n}\n\nfunction keygen (buf = b4a.alloc(KEYBYTES)) {\n  sodium.crypto_secretstream_xchacha20poly1305_keygen(buf)\n  return buf\n}\n\nmodule.exports = {\n  keygen,\n  KEYBYTES,\n  ABYTES,\n  STATEBYTES,\n  HEADERBYTES,\n  Push,\n  Pull\n}\n{\n  \"name\": \"sodium-secretstream\",\n  \"version\": \"1.2.0\",\n  \"description\": \"Wraps libsodiums secretstream in a higher level abstraction\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"b4a\": \"^1.1.1\",\n    \"sodium-universal\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"standard\": \"^17.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/sodium-secretstream.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/sodium-secretstream/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/sodium-secretstream\"\n}\nmodule.exports = require('sodium-native')\n{\n  \"name\": \"sodium-universal\",\n  \"version\": \"5.0.1\",\n  \"description\": \"Universal wrapper for sodium-javascript and sodium-native working in Node.js and the Browser\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"sodium-native\": \"^5.0.1\"\n  },\n  \"peerDependencies\": {\n    \"sodium-javascript\": \"~0.8.0\"\n  },\n  \"peerDependenciesMeta\": {\n    \"sodium-javascript\": {\n      \"optional\": true\n    }\n  },\n  \"scripts\": {\n    \"prepublish\": \"./build-scripts/generate.js\"\n  },\n  \"browser\": {\n    \"sodium-native\": \"sodium-javascript\"\n  },\n  \"browserify\": {\n    \"transform\": [\n      \"./build-scripts/transform.js\"\n    ]\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/sodium-universal.git\"\n  },\n  \"keywords\": [\n    \"libsodium\",\n    \"sodium\",\n    \"sodium-native\",\n    \"sodium-javascript\",\n    \"browserify\"\n  ],\n  \"contributors\": [\n    \"Emil Bay <github@tixz.dk> (http://bayes.dk)\",\n    \"Mathias Buus <mathiasbuus@gmail.com> (https://mafinto.sh)\",\n    \"Christophe Diederichs <chm-diederichs@hyperdivision.dk>\"\n  ],\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/sodium-universal/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/sodium-universal#readme\"\n}\nconst { EventEmitter } = require('events-universal')\nconst STREAM_DESTROYED = new Error('Stream was destroyed')\nconst PREMATURE_CLOSE = new Error('Premature close')\n\nconst FIFO = require('fast-fifo')\nconst TextDecoder = require('text-decoder')\n\n// if we do a future major, expect queue microtask to be there always, for now a bit defensive\nconst qmt = typeof queueMicrotask === 'undefined' ? fn => global.process.nextTick(fn) : queueMicrotask\n\n/* eslint-disable no-multi-spaces */\n\n// 29 bits used total (4 from shared, 14 from read, and 11 from write)\nconst MAX = ((1 << 29) - 1)\n\n// Shared state\nconst OPENING       = 0b0001\nconst PREDESTROYING = 0b0010\nconst DESTROYING    = 0b0100\nconst DESTROYED     = 0b1000\n\nconst NOT_OPENING = MAX ^ OPENING\nconst NOT_PREDESTROYING = MAX ^ PREDESTROYING\n\n// Read state (4 bit offset from shared state)\nconst READ_ACTIVE           = 0b00000000000001 << 4\nconst READ_UPDATING         = 0b00000000000010 << 4\nconst READ_PRIMARY          = 0b00000000000100 << 4\nconst READ_QUEUED           = 0b00000000001000 << 4\nconst READ_RESUMED          = 0b00000000010000 << 4\nconst READ_PIPE_DRAINED     = 0b00000000100000 << 4\nconst READ_ENDING           = 0b00000001000000 << 4\nconst READ_EMIT_DATA        = 0b00000010000000 << 4\nconst READ_EMIT_READABLE    = 0b00000100000000 << 4\nconst READ_EMITTED_READABLE = 0b00001000000000 << 4\nconst READ_DONE             = 0b00010000000000 << 4\nconst READ_NEXT_TICK        = 0b00100000000000 << 4\nconst READ_NEEDS_PUSH       = 0b01000000000000 << 4\nconst READ_READ_AHEAD       = 0b10000000000000 << 4\n\n// Combined read state\nconst READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED\nconst READ_ACTIVE_AND_NEEDS_PUSH = READ_ACTIVE | READ_NEEDS_PUSH\nconst READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE\nconst READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED\nconst READ_RESUMED_READ_AHEAD = READ_RESUMED | READ_READ_AHEAD\n\nconst READ_NOT_ACTIVE             = MAX ^ READ_ACTIVE\nconst READ_NON_PRIMARY            = MAX ^ READ_PRIMARY\nconst READ_NON_PRIMARY_AND_PUSHED = MAX ^ (READ_PRIMARY | READ_NEEDS_PUSH)\nconst READ_PUSHED                 = MAX ^ READ_NEEDS_PUSH\nconst READ_PAUSED                 = MAX ^ READ_RESUMED\nconst READ_NOT_QUEUED             = MAX ^ (READ_QUEUED | READ_EMITTED_READABLE)\nconst READ_NOT_ENDING             = MAX ^ READ_ENDING\nconst READ_PIPE_NOT_DRAINED       = MAX ^ READ_FLOWING\nconst READ_NOT_NEXT_TICK          = MAX ^ READ_NEXT_TICK\nconst READ_NOT_UPDATING           = MAX ^ READ_UPDATING\nconst READ_NO_READ_AHEAD          = MAX ^ READ_READ_AHEAD\nconst READ_PAUSED_NO_READ_AHEAD   = MAX ^ READ_RESUMED_READ_AHEAD\n\n// Write state (18 bit offset, 4 bit offset from shared state and 14 from read state)\nconst WRITE_ACTIVE     = 0b00000000001 << 18\nconst WRITE_UPDATING   = 0b00000000010 << 18\nconst WRITE_PRIMARY    = 0b00000000100 << 18\nconst WRITE_QUEUED     = 0b00000001000 << 18\nconst WRITE_UNDRAINED  = 0b00000010000 << 18\nconst WRITE_DONE       = 0b00000100000 << 18\nconst WRITE_EMIT_DRAIN = 0b00001000000 << 18\nconst WRITE_NEXT_TICK  = 0b00010000000 << 18\nconst WRITE_WRITING    = 0b00100000000 << 18\nconst WRITE_FINISHING  = 0b01000000000 << 18\nconst WRITE_CORKED     = 0b10000000000 << 18\n\nconst WRITE_NOT_ACTIVE    = MAX ^ (WRITE_ACTIVE | WRITE_WRITING)\nconst WRITE_NON_PRIMARY   = MAX ^ WRITE_PRIMARY\nconst WRITE_NOT_FINISHING = MAX ^ (WRITE_ACTIVE | WRITE_FINISHING)\nconst WRITE_DRAINED       = MAX ^ WRITE_UNDRAINED\nconst WRITE_NOT_QUEUED    = MAX ^ WRITE_QUEUED\nconst WRITE_NOT_NEXT_TICK = MAX ^ WRITE_NEXT_TICK\nconst WRITE_NOT_UPDATING  = MAX ^ WRITE_UPDATING\nconst WRITE_NOT_CORKED    = MAX ^ WRITE_CORKED\n\n// Combined shared state\nconst ACTIVE = READ_ACTIVE | WRITE_ACTIVE\nconst NOT_ACTIVE = MAX ^ ACTIVE\nconst DONE = READ_DONE | WRITE_DONE\nconst DESTROY_STATUS = DESTROYING | DESTROYED | PREDESTROYING\nconst OPEN_STATUS = DESTROY_STATUS | OPENING\nconst AUTO_DESTROY = DESTROY_STATUS | DONE\nconst NON_PRIMARY = WRITE_NON_PRIMARY & READ_NON_PRIMARY\nconst ACTIVE_OR_TICKING = WRITE_NEXT_TICK | READ_NEXT_TICK\nconst TICKING = ACTIVE_OR_TICKING & NOT_ACTIVE\nconst IS_OPENING = OPEN_STATUS | TICKING\n\n// Combined shared state and read state\nconst READ_PRIMARY_STATUS = OPEN_STATUS | READ_ENDING | READ_DONE\nconst READ_STATUS = OPEN_STATUS | READ_DONE | READ_QUEUED\nconst READ_ENDING_STATUS = OPEN_STATUS | READ_ENDING | READ_QUEUED\nconst READ_READABLE_STATUS = OPEN_STATUS | READ_EMIT_READABLE | READ_QUEUED | READ_EMITTED_READABLE\nconst SHOULD_NOT_READ = OPEN_STATUS | READ_ACTIVE | READ_ENDING | READ_DONE | READ_NEEDS_PUSH | READ_READ_AHEAD\nconst READ_BACKPRESSURE_STATUS = DESTROY_STATUS | READ_ENDING | READ_DONE\nconst READ_UPDATE_SYNC_STATUS = READ_UPDATING | OPEN_STATUS | READ_NEXT_TICK | READ_PRIMARY\nconst READ_NEXT_TICK_OR_OPENING = READ_NEXT_TICK | OPENING\n\n// Combined write state\nconst WRITE_PRIMARY_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_DONE\nconst WRITE_QUEUED_AND_UNDRAINED = WRITE_QUEUED | WRITE_UNDRAINED\nconst WRITE_QUEUED_AND_ACTIVE = WRITE_QUEUED | WRITE_ACTIVE\nconst WRITE_DRAIN_STATUS = WRITE_QUEUED | WRITE_UNDRAINED | OPEN_STATUS | WRITE_ACTIVE\nconst WRITE_STATUS = OPEN_STATUS | WRITE_ACTIVE | WRITE_QUEUED | WRITE_CORKED\nconst WRITE_PRIMARY_AND_ACTIVE = WRITE_PRIMARY | WRITE_ACTIVE\nconst WRITE_ACTIVE_AND_WRITING = WRITE_ACTIVE | WRITE_WRITING\nconst WRITE_FINISHING_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_QUEUED_AND_ACTIVE | WRITE_DONE\nconst WRITE_BACKPRESSURE_STATUS = WRITE_UNDRAINED | DESTROY_STATUS | WRITE_FINISHING | WRITE_DONE\nconst WRITE_UPDATE_SYNC_STATUS = WRITE_UPDATING | OPEN_STATUS | WRITE_NEXT_TICK | WRITE_PRIMARY\nconst WRITE_DROP_DATA = WRITE_FINISHING | WRITE_DONE | DESTROY_STATUS\n\nconst asyncIterator = Symbol.asyncIterator || Symbol('asyncIterator')\n\nclass WritableState {\n  constructor (stream, { highWaterMark = 16384, map = null, mapWritable, byteLength, byteLengthWritable } = {}) {\n    this.stream = stream\n    this.queue = new FIFO()\n    this.highWaterMark = highWaterMark\n    this.buffered = 0\n    this.error = null\n    this.pipeline = null\n    this.drains = null // if we add more seldomly used helpers we might them into a subobject so its a single ptr\n    this.byteLength = byteLengthWritable || byteLength || defaultByteLength\n    this.map = mapWritable || map\n    this.afterWrite = afterWrite.bind(this)\n    this.afterUpdateNextTick = updateWriteNT.bind(this)\n  }\n\n  get ended () {\n    return (this.stream._duplexState & WRITE_DONE) !== 0\n  }\n\n  push (data) {\n    if ((this.stream._duplexState & WRITE_DROP_DATA) !== 0) return false\n    if (this.map !== null) data = this.map(data)\n\n    this.buffered += this.byteLength(data)\n    this.queue.push(data)\n\n    if (this.buffered < this.highWaterMark) {\n      this.stream._duplexState |= WRITE_QUEUED\n      return true\n    }\n\n    this.stream._duplexState |= WRITE_QUEUED_AND_UNDRAINED\n    return false\n  }\n\n  shift () {\n    const data = this.queue.shift()\n\n    this.buffered -= this.byteLength(data)\n    if (this.buffered === 0) this.stream._duplexState &= WRITE_NOT_QUEUED\n\n    return data\n  }\n\n  end (data) {\n    if (typeof data === 'function') this.stream.once('finish', data)\n    else if (data !== undefined && data !== null) this.push(data)\n    this.stream._duplexState = (this.stream._duplexState | WRITE_FINISHING) & WRITE_NON_PRIMARY\n  }\n\n  autoBatch (data, cb) {\n    const buffer = []\n    const stream = this.stream\n\n    buffer.push(data)\n    while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) {\n      buffer.push(stream._writableState.shift())\n    }\n\n    if ((stream._duplexState & OPEN_STATUS) !== 0) return cb(null)\n    stream._writev(buffer, cb)\n  }\n\n  update () {\n    const stream = this.stream\n\n    stream._duplexState |= WRITE_UPDATING\n\n    do {\n      while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) {\n        const data = this.shift()\n        stream._duplexState |= WRITE_ACTIVE_AND_WRITING\n        stream._write(data, this.afterWrite)\n      }\n\n      if ((stream._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary()\n    } while (this.continueUpdate() === true)\n\n    stream._duplexState &= WRITE_NOT_UPDATING\n  }\n\n  updateNonPrimary () {\n    const stream = this.stream\n\n    if ((stream._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) {\n      stream._duplexState = stream._duplexState | WRITE_ACTIVE\n      stream._final(afterFinal.bind(this))\n      return\n    }\n\n    if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {\n      if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {\n        stream._duplexState |= ACTIVE\n        stream._destroy(afterDestroy.bind(this))\n      }\n      return\n    }\n\n    if ((stream._duplexState & IS_OPENING) === OPENING) {\n      stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING\n      stream._open(afterOpen.bind(this))\n    }\n  }\n\n  continueUpdate () {\n    if ((this.stream._duplexState & WRITE_NEXT_TICK) === 0) return false\n    this.stream._duplexState &= WRITE_NOT_NEXT_TICK\n    return true\n  }\n\n  updateCallback () {\n    if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) this.update()\n    else this.updateNextTick()\n  }\n\n  updateNextTick () {\n    if ((this.stream._duplexState & WRITE_NEXT_TICK) !== 0) return\n    this.stream._duplexState |= WRITE_NEXT_TICK\n    if ((this.stream._duplexState & WRITE_UPDATING) === 0) qmt(this.afterUpdateNextTick)\n  }\n}\n\nclass ReadableState {\n  constructor (stream, { highWaterMark = 16384, map = null, mapReadable, byteLength, byteLengthReadable } = {}) {\n    this.stream = stream\n    this.queue = new FIFO()\n    this.highWaterMark = highWaterMark === 0 ? 1 : highWaterMark\n    this.buffered = 0\n    this.readAhead = highWaterMark > 0\n    this.error = null\n    this.pipeline = null\n    this.byteLength = byteLengthReadable || byteLength || defaultByteLength\n    this.map = mapReadable || map\n    this.pipeTo = null\n    this.afterRead = afterRead.bind(this)\n    this.afterUpdateNextTick = updateReadNT.bind(this)\n  }\n\n  get ended () {\n    return (this.stream._duplexState & READ_DONE) !== 0\n  }\n\n  pipe (pipeTo, cb) {\n    if (this.pipeTo !== null) throw new Error('Can only pipe to one destination')\n    if (typeof cb !== 'function') cb = null\n\n    this.stream._duplexState |= READ_PIPE_DRAINED\n    this.pipeTo = pipeTo\n    this.pipeline = new Pipeline(this.stream, pipeTo, cb)\n\n    if (cb) this.stream.on('error', noop) // We already error handle this so supress crashes\n\n    if (isStreamx(pipeTo)) {\n      pipeTo._writableState.pipeline = this.pipeline\n      if (cb) pipeTo.on('error', noop) // We already error handle this so supress crashes\n      pipeTo.on('finish', this.pipeline.finished.bind(this.pipeline)) // TODO: just call finished from pipeTo itself\n    } else {\n      const onerror = this.pipeline.done.bind(this.pipeline, pipeTo)\n      const onclose = this.pipeline.done.bind(this.pipeline, pipeTo, null) // onclose has a weird bool arg\n      pipeTo.on('error', onerror)\n      pipeTo.on('close', onclose)\n      pipeTo.on('finish', this.pipeline.finished.bind(this.pipeline))\n    }\n\n    pipeTo.on('drain', afterDrain.bind(this))\n    this.stream.emit('piping', pipeTo)\n    pipeTo.emit('pipe', this.stream)\n  }\n\n  push (data) {\n    const stream = this.stream\n\n    if (data === null) {\n      this.highWaterMark = 0\n      stream._duplexState = (stream._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED\n      return false\n    }\n\n    if (this.map !== null) {\n      data = this.map(data)\n      if (data === null) {\n        stream._duplexState &= READ_PUSHED\n        return this.buffered < this.highWaterMark\n      }\n    }\n\n    this.buffered += this.byteLength(data)\n    this.queue.push(data)\n\n    stream._duplexState = (stream._duplexState | READ_QUEUED) & READ_PUSHED\n\n    return this.buffered < this.highWaterMark\n  }\n\n  shift () {\n    const data = this.queue.shift()\n\n    this.buffered -= this.byteLength(data)\n    if (this.buffered === 0) this.stream._duplexState &= READ_NOT_QUEUED\n    return data\n  }\n\n  unshift (data) {\n    const pending = [this.map !== null ? this.map(data) : data]\n    while (this.buffered > 0) pending.push(this.shift())\n\n    for (let i = 0; i < pending.length - 1; i++) {\n      const data = pending[i]\n      this.buffered += this.byteLength(data)\n      this.queue.push(data)\n    }\n\n    this.push(pending[pending.length - 1])\n  }\n\n  read () {\n    const stream = this.stream\n\n    if ((stream._duplexState & READ_STATUS) === READ_QUEUED) {\n      const data = this.shift()\n      if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED\n      if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit('data', data)\n      return data\n    }\n\n    if (this.readAhead === false) {\n      stream._duplexState |= READ_READ_AHEAD\n      this.updateNextTick()\n    }\n\n    return null\n  }\n\n  drain () {\n    const stream = this.stream\n\n    while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) {\n      const data = this.shift()\n      if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED\n      if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit('data', data)\n    }\n  }\n\n  update () {\n    const stream = this.stream\n\n    stream._duplexState |= READ_UPDATING\n\n    do {\n      this.drain()\n\n      while (this.buffered < this.highWaterMark && (stream._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) {\n        stream._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH\n        stream._read(this.afterRead)\n        this.drain()\n      }\n\n      if ((stream._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) {\n        stream._duplexState |= READ_EMITTED_READABLE\n        stream.emit('readable')\n      }\n\n      if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary()\n    } while (this.continueUpdate() === true)\n\n    stream._duplexState &= READ_NOT_UPDATING\n  }\n\n  updateNonPrimary () {\n    const stream = this.stream\n\n    if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) {\n      stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING\n      stream.emit('end')\n      if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING\n      if (this.pipeTo !== null) this.pipeTo.end()\n    }\n\n    if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {\n      if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {\n        stream._duplexState |= ACTIVE\n        stream._destroy(afterDestroy.bind(this))\n      }\n      return\n    }\n\n    if ((stream._duplexState & IS_OPENING) === OPENING) {\n      stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING\n      stream._open(afterOpen.bind(this))\n    }\n  }\n\n  continueUpdate () {\n    if ((this.stream._duplexState & READ_NEXT_TICK) === 0) return false\n    this.stream._duplexState &= READ_NOT_NEXT_TICK\n    return true\n  }\n\n  updateCallback () {\n    if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) this.update()\n    else this.updateNextTick()\n  }\n\n  updateNextTickIfOpen () {\n    if ((this.stream._duplexState & READ_NEXT_TICK_OR_OPENING) !== 0) return\n    this.stream._duplexState |= READ_NEXT_TICK\n    if ((this.stream._duplexState & READ_UPDATING) === 0) qmt(this.afterUpdateNextTick)\n  }\n\n  updateNextTick () {\n    if ((this.stream._duplexState & READ_NEXT_TICK) !== 0) return\n    this.stream._duplexState |= READ_NEXT_TICK\n    if ((this.stream._duplexState & READ_UPDATING) === 0) qmt(this.afterUpdateNextTick)\n  }\n}\n\nclass TransformState {\n  constructor (stream) {\n    this.data = null\n    this.afterTransform = afterTransform.bind(stream)\n    this.afterFinal = null\n  }\n}\n\nclass Pipeline {\n  constructor (src, dst, cb) {\n    this.from = src\n    this.to = dst\n    this.afterPipe = cb\n    this.error = null\n    this.pipeToFinished = false\n  }\n\n  finished () {\n    this.pipeToFinished = true\n  }\n\n  done (stream, err) {\n    if (err) this.error = err\n\n    if (stream === this.to) {\n      this.to = null\n\n      if (this.from !== null) {\n        if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) {\n          this.from.destroy(this.error || new Error('Writable stream closed prematurely'))\n        }\n        return\n      }\n    }\n\n    if (stream === this.from) {\n      this.from = null\n\n      if (this.to !== null) {\n        if ((stream._duplexState & READ_DONE) === 0) {\n          this.to.destroy(this.error || new Error('Readable stream closed before ending'))\n        }\n        return\n      }\n    }\n\n    if (this.afterPipe !== null) this.afterPipe(this.error)\n    this.to = this.from = this.afterPipe = null\n  }\n}\n\nfunction afterDrain () {\n  this.stream._duplexState |= READ_PIPE_DRAINED\n  this.updateCallback()\n}\n\nfunction afterFinal (err) {\n  const stream = this.stream\n  if (err) stream.destroy(err)\n  if ((stream._duplexState & DESTROY_STATUS) === 0) {\n    stream._duplexState |= WRITE_DONE\n    stream.emit('finish')\n  }\n  if ((stream._duplexState & AUTO_DESTROY) === DONE) {\n    stream._duplexState |= DESTROYING\n  }\n\n  stream._duplexState &= WRITE_NOT_FINISHING\n\n  // no need to wait the extra tick here, so we short circuit that\n  if ((stream._duplexState & WRITE_UPDATING) === 0) this.update()\n  else this.updateNextTick()\n}\n\nfunction afterDestroy (err) {\n  const stream = this.stream\n\n  if (!err && this.error !== STREAM_DESTROYED) err = this.error\n  if (err) stream.emit('error', err)\n  stream._duplexState |= DESTROYED\n  stream.emit('close')\n\n  const rs = stream._readableState\n  const ws = stream._writableState\n\n  if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream, err)\n\n  if (ws !== null) {\n    while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false)\n    if (ws.pipeline !== null) ws.pipeline.done(stream, err)\n  }\n}\n\nfunction afterWrite (err) {\n  const stream = this.stream\n\n  if (err) stream.destroy(err)\n  stream._duplexState &= WRITE_NOT_ACTIVE\n\n  if (this.drains !== null) tickDrains(this.drains)\n\n  if ((stream._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) {\n    stream._duplexState &= WRITE_DRAINED\n    if ((stream._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) {\n      stream.emit('drain')\n    }\n  }\n\n  this.updateCallback()\n}\n\nfunction afterRead (err) {\n  if (err) this.stream.destroy(err)\n  this.stream._duplexState &= READ_NOT_ACTIVE\n  if (this.readAhead === false && (this.stream._duplexState & READ_RESUMED) === 0) this.stream._duplexState &= READ_NO_READ_AHEAD\n  this.updateCallback()\n}\n\nfunction updateReadNT () {\n  if ((this.stream._duplexState & READ_UPDATING) === 0) {\n    this.stream._duplexState &= READ_NOT_NEXT_TICK\n    this.update()\n  }\n}\n\nfunction updateWriteNT () {\n  if ((this.stream._duplexState & WRITE_UPDATING) === 0) {\n    this.stream._duplexState &= WRITE_NOT_NEXT_TICK\n    this.update()\n  }\n}\n\nfunction tickDrains (drains) {\n  for (let i = 0; i < drains.length; i++) {\n    // drains.writes are monotonic, so if one is 0 its always the first one\n    if (--drains[i].writes === 0) {\n      drains.shift().resolve(true)\n      i--\n    }\n  }\n}\n\nfunction afterOpen (err) {\n  const stream = this.stream\n\n  if (err) stream.destroy(err)\n\n  if ((stream._duplexState & DESTROYING) === 0) {\n    if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) stream._duplexState |= READ_PRIMARY\n    if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) stream._duplexState |= WRITE_PRIMARY\n    stream.emit('open')\n  }\n\n  stream._duplexState &= NOT_ACTIVE\n\n  if (stream._writableState !== null) {\n    stream._writableState.updateCallback()\n  }\n\n  if (stream._readableState !== null) {\n    stream._readableState.updateCallback()\n  }\n}\n\nfunction afterTransform (err, data) {\n  if (data !== undefined && data !== null) this.push(data)\n  this._writableState.afterWrite(err)\n}\n\nfunction newListener (name) {\n  if (this._readableState !== null) {\n    if (name === 'data') {\n      this._duplexState |= (READ_EMIT_DATA | READ_RESUMED_READ_AHEAD)\n      this._readableState.updateNextTick()\n    }\n    if (name === 'readable') {\n      this._duplexState |= READ_EMIT_READABLE\n      this._readableState.updateNextTick()\n    }\n  }\n\n  if (this._writableState !== null) {\n    if (name === 'drain') {\n      this._duplexState |= WRITE_EMIT_DRAIN\n      this._writableState.updateNextTick()\n    }\n  }\n}\n\nclass Stream extends EventEmitter {\n  constructor (opts) {\n    super()\n\n    this._duplexState = 0\n    this._readableState = null\n    this._writableState = null\n\n    if (opts) {\n      if (opts.open) this._open = opts.open\n      if (opts.destroy) this._destroy = opts.destroy\n      if (opts.predestroy) this._predestroy = opts.predestroy\n      if (opts.signal) {\n        opts.signal.addEventListener('abort', abort.bind(this))\n      }\n    }\n\n    this.on('newListener', newListener)\n  }\n\n  _open (cb) {\n    cb(null)\n  }\n\n  _destroy (cb) {\n    cb(null)\n  }\n\n  _predestroy () {\n    // does nothing\n  }\n\n  get readable () {\n    return this._readableState !== null ? true : undefined\n  }\n\n  get writable () {\n    return this._writableState !== null ? true : undefined\n  }\n\n  get destroyed () {\n    return (this._duplexState & DESTROYED) !== 0\n  }\n\n  get destroying () {\n    return (this._duplexState & DESTROY_STATUS) !== 0\n  }\n\n  destroy (err) {\n    if ((this._duplexState & DESTROY_STATUS) === 0) {\n      if (!err) err = STREAM_DESTROYED\n      this._duplexState = (this._duplexState | DESTROYING) & NON_PRIMARY\n\n      if (this._readableState !== null) {\n        this._readableState.highWaterMark = 0\n        this._readableState.error = err\n      }\n      if (this._writableState !== null) {\n        this._writableState.highWaterMark = 0\n        this._writableState.error = err\n      }\n\n      this._duplexState |= PREDESTROYING\n      this._predestroy()\n      this._duplexState &= NOT_PREDESTROYING\n\n      if (this._readableState !== null) this._readableState.updateNextTick()\n      if (this._writableState !== null) this._writableState.updateNextTick()\n    }\n  }\n}\n\nclass Readable extends Stream {\n  constructor (opts) {\n    super(opts)\n\n    this._duplexState |= OPENING | WRITE_DONE | READ_READ_AHEAD\n    this._readableState = new ReadableState(this, opts)\n\n    if (opts) {\n      if (this._readableState.readAhead === false) this._duplexState &= READ_NO_READ_AHEAD\n      if (opts.read) this._read = opts.read\n      if (opts.eagerOpen) this._readableState.updateNextTick()\n      if (opts.encoding) this.setEncoding(opts.encoding)\n    }\n  }\n\n  setEncoding (encoding) {\n    const dec = new TextDecoder(encoding)\n    const map = this._readableState.map || echo\n    this._readableState.map = mapOrSkip\n    return this\n\n    function mapOrSkip (data) {\n      const next = dec.push(data)\n      return next === '' && (data.byteLength !== 0 || dec.remaining > 0) ? null : map(next)\n    }\n  }\n\n  _read (cb) {\n    cb(null)\n  }\n\n  pipe (dest, cb) {\n    this._readableState.updateNextTick()\n    this._readableState.pipe(dest, cb)\n    return dest\n  }\n\n  read () {\n    this._readableState.updateNextTick()\n    return this._readableState.read()\n  }\n\n  push (data) {\n    this._readableState.updateNextTickIfOpen()\n    return this._readableState.push(data)\n  }\n\n  unshift (data) {\n    this._readableState.updateNextTickIfOpen()\n    return this._readableState.unshift(data)\n  }\n\n  resume () {\n    this._duplexState |= READ_RESUMED_READ_AHEAD\n    this._readableState.updateNextTick()\n    return this\n  }\n\n  pause () {\n    this._duplexState &= (this._readableState.readAhead === false ? READ_PAUSED_NO_READ_AHEAD : READ_PAUSED)\n    return this\n  }\n\n  static _fromAsyncIterator (ite, opts) {\n    let destroy\n\n    const rs = new Readable({\n      ...opts,\n      read (cb) {\n        ite.next().then(push).then(cb.bind(null, null)).catch(cb)\n      },\n      predestroy () {\n        destroy = ite.return()\n      },\n      destroy (cb) {\n        if (!destroy) return cb(null)\n        destroy.then(cb.bind(null, null)).catch(cb)\n      }\n    })\n\n    return rs\n\n    function push (data) {\n      if (data.done) rs.push(null)\n      else rs.push(data.value)\n    }\n  }\n\n  static from (data, opts) {\n    if (isReadStreamx(data)) return data\n    if (data[asyncIterator]) return this._fromAsyncIterator(data[asyncIterator](), opts)\n    if (!Array.isArray(data)) data = data === undefined ? [] : [data]\n\n    let i = 0\n    return new Readable({\n      ...opts,\n      read (cb) {\n        this.push(i === data.length ? null : data[i++])\n        cb(null)\n      }\n    })\n  }\n\n  static isBackpressured (rs) {\n    return (rs._duplexState & READ_BACKPRESSURE_STATUS) !== 0 || rs._readableState.buffered >= rs._readableState.highWaterMark\n  }\n\n  static isPaused (rs) {\n    return (rs._duplexState & READ_RESUMED) === 0\n  }\n\n  [asyncIterator] () {\n    const stream = this\n\n    let error = null\n    let promiseResolve = null\n    let promiseReject = null\n\n    this.on('error', (err) => { error = err })\n    this.on('readable', onreadable)\n    this.on('close', onclose)\n\n    return {\n      [asyncIterator] () {\n        return this\n      },\n      next () {\n        return new Promise(function (resolve, reject) {\n          promiseResolve = resolve\n          promiseReject = reject\n          const data = stream.read()\n          if (data !== null) ondata(data)\n          else if ((stream._duplexState & DESTROYED) !== 0) ondata(null)\n        })\n      },\n      return () {\n        return destroy(null)\n      },\n      throw (err) {\n        return destroy(err)\n      }\n    }\n\n    function onreadable () {\n      if (promiseResolve !== null) ondata(stream.read())\n    }\n\n    function onclose () {\n      if (promiseResolve !== null) ondata(null)\n    }\n\n    function ondata (data) {\n      if (promiseReject === null) return\n      if (error) promiseReject(error)\n      else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED)\n      else promiseResolve({ value: data, done: data === null })\n      promiseReject = promiseResolve = null\n    }\n\n    function destroy (err) {\n      stream.destroy(err)\n      return new Promise((resolve, reject) => {\n        if (stream._duplexState & DESTROYED) return resolve({ value: undefined, done: true })\n        stream.once('close', function () {\n          if (err) reject(err)\n          else resolve({ value: undefined, done: true })\n        })\n      })\n    }\n  }\n}\n\nclass Writable extends Stream {\n  constructor (opts) {\n    super(opts)\n\n    this._duplexState |= OPENING | READ_DONE\n    this._writableState = new WritableState(this, opts)\n\n    if (opts) {\n      if (opts.writev) this._writev = opts.writev\n      if (opts.write) this._write = opts.write\n      if (opts.final) this._final = opts.final\n      if (opts.eagerOpen) this._writableState.updateNextTick()\n    }\n  }\n\n  cork () {\n    this._duplexState |= WRITE_CORKED\n  }\n\n  uncork () {\n    this._duplexState &= WRITE_NOT_CORKED\n    this._writableState.updateNextTick()\n  }\n\n  _writev (batch, cb) {\n    cb(null)\n  }\n\n  _write (data, cb) {\n    this._writableState.autoBatch(data, cb)\n  }\n\n  _final (cb) {\n    cb(null)\n  }\n\n  static isBackpressured (ws) {\n    return (ws._duplexState & WRITE_BACKPRESSURE_STATUS) !== 0\n  }\n\n  static drained (ws) {\n    if (ws.destroyed) return Promise.resolve(false)\n    const state = ws._writableState\n    const pending = (isWritev(ws) ? Math.min(1, state.queue.length) : state.queue.length)\n    const writes = pending + ((ws._duplexState & WRITE_WRITING) ? 1 : 0)\n    if (writes === 0) return Promise.resolve(true)\n    if (state.drains === null) state.drains = []\n    return new Promise((resolve) => {\n      state.drains.push({ writes, resolve })\n    })\n  }\n\n  write (data) {\n    this._writableState.updateNextTick()\n    return this._writableState.push(data)\n  }\n\n  end (data) {\n    this._writableState.updateNextTick()\n    this._writableState.end(data)\n    return this\n  }\n}\n\nclass Duplex extends Readable { // and Writable\n  constructor (opts) {\n    super(opts)\n\n    this._duplexState = OPENING | (this._duplexState & READ_READ_AHEAD)\n    this._writableState = new WritableState(this, opts)\n\n    if (opts) {\n      if (opts.writev) this._writev = opts.writev\n      if (opts.write) this._write = opts.write\n      if (opts.final) this._final = opts.final\n    }\n  }\n\n  cork () {\n    this._duplexState |= WRITE_CORKED\n  }\n\n  uncork () {\n    this._duplexState &= WRITE_NOT_CORKED\n    this._writableState.updateNextTick()\n  }\n\n  _writev (batch, cb) {\n    cb(null)\n  }\n\n  _write (data, cb) {\n    this._writableState.autoBatch(data, cb)\n  }\n\n  _final (cb) {\n    cb(null)\n  }\n\n  write (data) {\n    this._writableState.updateNextTick()\n    return this._writableState.push(data)\n  }\n\n  end (data) {\n    this._writableState.updateNextTick()\n    this._writableState.end(data)\n    return this\n  }\n}\n\nclass Transform extends Duplex {\n  constructor (opts) {\n    super(opts)\n    this._transformState = new TransformState(this)\n\n    if (opts) {\n      if (opts.transform) this._transform = opts.transform\n      if (opts.flush) this._flush = opts.flush\n    }\n  }\n\n  _write (data, cb) {\n    if (this._readableState.buffered >= this._readableState.highWaterMark) {\n      this._transformState.data = data\n    } else {\n      this._transform(data, this._transformState.afterTransform)\n    }\n  }\n\n  _read (cb) {\n    if (this._transformState.data !== null) {\n      const data = this._transformState.data\n      this._transformState.data = null\n      cb(null)\n      this._transform(data, this._transformState.afterTransform)\n    } else {\n      cb(null)\n    }\n  }\n\n  destroy (err) {\n    super.destroy(err)\n    if (this._transformState.data !== null) {\n      this._transformState.data = null\n      this._transformState.afterTransform()\n    }\n  }\n\n  _transform (data, cb) {\n    cb(null, data)\n  }\n\n  _flush (cb) {\n    cb(null)\n  }\n\n  _final (cb) {\n    this._transformState.afterFinal = cb\n    this._flush(transformAfterFlush.bind(this))\n  }\n}\n\nclass PassThrough extends Transform {}\n\nfunction transformAfterFlush (err, data) {\n  const cb = this._transformState.afterFinal\n  if (err) return cb(err)\n  if (data !== null && data !== undefined) this.push(data)\n  this.push(null)\n  cb(null)\n}\n\nfunction pipelinePromise (...streams) {\n  return new Promise((resolve, reject) => {\n    return pipeline(...streams, (err) => {\n      if (err) return reject(err)\n      resolve()\n    })\n  })\n}\n\nfunction pipeline (stream, ...streams) {\n  const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...streams]\n  const done = (all.length && typeof all[all.length - 1] === 'function') ? all.pop() : null\n\n  if (all.length < 2) throw new Error('Pipeline requires at least 2 streams')\n\n  let src = all[0]\n  let dest = null\n  let error = null\n\n  for (let i = 1; i < all.length; i++) {\n    dest = all[i]\n\n    if (isStreamx(src)) {\n      src.pipe(dest, onerror)\n    } else {\n      errorHandle(src, true, i > 1, onerror)\n      src.pipe(dest)\n    }\n\n    src = dest\n  }\n\n  if (done) {\n    let fin = false\n\n    const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy)\n\n    dest.on('error', (err) => {\n      if (error === null) error = err\n    })\n\n    dest.on('finish', () => {\n      fin = true\n      if (!autoDestroy) done(error)\n    })\n\n    if (autoDestroy) {\n      dest.on('close', () => done(error || (fin ? null : PREMATURE_CLOSE)))\n    }\n  }\n\n  return dest\n\n  function errorHandle (s, rd, wr, onerror) {\n    s.on('error', onerror)\n    s.on('close', onclose)\n\n    function onclose () {\n      if (rd && s._readableState && !s._readableState.ended) return onerror(PREMATURE_CLOSE)\n      if (wr && s._writableState && !s._writableState.ended) return onerror(PREMATURE_CLOSE)\n    }\n  }\n\n  function onerror (err) {\n    if (!err || error) return\n    error = err\n\n    for (const s of all) {\n      s.destroy(err)\n    }\n  }\n}\n\nfunction echo (s) {\n  return s\n}\n\nfunction isStream (stream) {\n  return !!stream._readableState || !!stream._writableState\n}\n\nfunction isStreamx (stream) {\n  return typeof stream._duplexState === 'number' && isStream(stream)\n}\n\nfunction isEnded (stream) {\n  return !!stream._readableState && stream._readableState.ended\n}\n\nfunction isFinished (stream) {\n  return !!stream._writableState && stream._writableState.ended\n}\n\nfunction getStreamError (stream, opts = {}) {\n  const err = (stream._readableState && stream._readableState.error) || (stream._writableState && stream._writableState.error)\n\n  // avoid implicit errors by default\n  return (!opts.all && err === STREAM_DESTROYED) ? null : err\n}\n\nfunction isReadStreamx (stream) {\n  return isStreamx(stream) && stream.readable\n}\n\nfunction isDisturbed (stream) {\n  return (stream._duplexState & OPENING) !== OPENING || (stream._duplexState & ACTIVE_OR_TICKING) !== 0\n}\n\nfunction isTypedArray (data) {\n  return typeof data === 'object' && data !== null && typeof data.byteLength === 'number'\n}\n\nfunction defaultByteLength (data) {\n  return isTypedArray(data) ? data.byteLength : 1024\n}\n\nfunction noop () {}\n\nfunction abort () {\n  this.destroy(new Error('Stream aborted.'))\n}\n\nfunction isWritev (s) {\n  return s._writev !== Writable.prototype._writev && s._writev !== Duplex.prototype._writev\n}\n\nmodule.exports = {\n  pipeline,\n  pipelinePromise,\n  isStream,\n  isStreamx,\n  isEnded,\n  isFinished,\n  isDisturbed,\n  getStreamError,\n  Stream,\n  Writable,\n  Readable,\n  Duplex,\n  Transform,\n  // Export PassThrough for compatibility with Node.js core's stream module\n  PassThrough\n}\n{\n  \"name\": \"streamx\",\n  \"version\": \"2.23.0\",\n  \"description\": \"An iteration of the Node.js core streams with a series of improvements\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"events-universal\": \"^1.0.0\",\n    \"fast-fifo\": \"^1.3.2\",\n    \"text-decoder\": \"^1.1.0\"\n  },\n  \"devDependencies\": {\n    \"b4a\": \"^1.6.6\",\n    \"brittle\": \"^3.1.1\",\n    \"end-of-stream\": \"^1.4.4\",\n    \"standard\": \"^17.0.0\"\n  },\n  \"files\": [\n    \"index.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"standard && node test/all.js\",\n    \"test:bare\": \"standard && bare test/all.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/streamx.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/streamx/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/streamx\"\n}\nconst codecs = require('codecs')\nconst b = require('b4a')\n\nconst SEP = b.alloc(1)\nconst SEP_BUMPED = b.from([0x1])\nconst EMPTY = b.alloc(0)\n\nmodule.exports = class SubEncoder {\n  constructor (prefix, encoding, parent = null) {\n    this.userEncoding = codecs(encoding)\n    this.prefix = prefix != null ? createPrefix(prefix, parent) : null\n    this.lt = this.prefix && b.concat([this.prefix.subarray(0, this.prefix.byteLength - 1), SEP_BUMPED])\n  }\n\n  _encodeRangeUser (r) {\n    if (this.userEncoding.encodeRange) return this.userEncoding.encodeRange(r)\n\n    const res = {}\n    if (r.gt != null) res.gt = this.userEncoding.encode(r.gt)\n    if (r.gte != null) res.gte = this.userEncoding.encode(r.gte)\n    if (r.lte != null) res.lte = this.userEncoding.encode(r.lte)\n    if (r.lt != null) res.lt = this.userEncoding.encode(r.lt)\n\n    return res\n  }\n\n  _addPrefix (key) {\n    return this.prefix ? b.concat([this.prefix, key]) : key\n  }\n\n  encode (key) {\n    return this._addPrefix(this.userEncoding.encode(key))\n  }\n\n  encodeRange (range) {\n    const r = this._encodeRangeUser(range)\n\n    if (r.gt) r.gt = this._addPrefix(r.gt)\n    else if (r.gte) r.gte = this._addPrefix(r.gte)\n    else if (this.prefix) r.gte = this.prefix\n\n    if (r.lt) r.lt = this._addPrefix(r.lt)\n    else if (r.lte) r.lte = this._addPrefix(r.lte)\n    else if (this.prefix) r.lt = this.lt\n\n    return r\n  }\n\n  decode (key) {\n    return this.userEncoding.decode(this.prefix ? key.subarray(this.prefix.byteLength) : key)\n  }\n\n  sub (prefix, encoding) {\n    return new SubEncoder(prefix || EMPTY, compat(encoding), this.prefix)\n  }\n}\n\nfunction createPrefix (prefix, parent) {\n  prefix = typeof prefix === 'string' ? b.from(prefix) : prefix\n\n  if (prefix && parent) return b.concat([parent, prefix, SEP])\n  if (prefix) return b.concat([prefix, SEP])\n  if (parent) return b.concat([parent, SEP])\n  return SEP\n}\n\nfunction compat (enc) {\n  if (enc && enc.keyEncoding) return enc.keyEncoding\n  return enc\n}\n{\n  \"name\": \"sub-encoder\",\n  \"version\": \"2.1.3\",\n  \"description\": \"Generate sub encodings for key/value stores\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"standard && brittle test/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/sub-encoder.git\"\n  },\n  \"keywords\": [\n    \"kv-store\",\n    \"encoding\",\n    \"hyperbee\"\n  ],\n  \"author\": \"Andrew Osheroff <andrewosh@gmail.com>\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/sub-encoder/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/sub-encoder#readme\",\n  \"devDependencies\": {\n    \"brittle\": \"^3.1.1\",\n    \"compact-encoding\": \"^2.12.0\",\n    \"hyperbee\": \"^2.11.0\",\n    \"hypercore\": \"^10.3.2\",\n    \"index-encoder\": \"^3.0.0\",\n    \"random-access-memory\": \"^6.0.0\",\n    \"standard\": \"^17.0.0\"\n  },\n  \"dependencies\": {\n    \"b4a\": \"^1.6.0\",\n    \"codecs\": \"^3.1.0\"\n  }\n}\nconst PassThroughDecoder = require('./lib/pass-through-decoder')\nconst UTF8Decoder = require('./lib/utf8-decoder')\n\nmodule.exports = class TextDecoder {\n  constructor (encoding = 'utf8') {\n    this.encoding = normalizeEncoding(encoding)\n\n    switch (this.encoding) {\n      case 'utf8':\n        this.decoder = new UTF8Decoder()\n        break\n      case 'utf16le':\n      case 'base64':\n        throw new Error('Unsupported encoding: ' + this.encoding)\n      default:\n        this.decoder = new PassThroughDecoder(this.encoding)\n    }\n  }\n\n  get remaining () {\n    return this.decoder.remaining\n  }\n\n  push (data) {\n    if (typeof data === 'string') return data\n    return this.decoder.decode(data)\n  }\n\n  // For Node.js compatibility\n  write (data) {\n    return this.push(data)\n  }\n\n  end (data) {\n    let result = ''\n    if (data) result = this.push(data)\n    result += this.decoder.flush()\n    return result\n  }\n}\n\nfunction normalizeEncoding (encoding) {\n  encoding = encoding.toLowerCase()\n\n  switch (encoding) {\n    case 'utf8':\n    case 'utf-8':\n      return 'utf8'\n    case 'ucs2':\n    case 'ucs-2':\n    case 'utf16le':\n    case 'utf-16le':\n      return 'utf16le'\n    case 'latin1':\n    case 'binary':\n      return 'latin1'\n    case 'base64':\n    case 'ascii':\n    case 'hex':\n      return encoding\n    default:\n      throw new Error('Unknown encoding: ' + encoding)\n  }\n};\nconst b4a = require('b4a')\n\nmodule.exports = class PassThroughDecoder {\n  constructor (encoding) {\n    this.encoding = encoding\n  }\n\n  get remaining () {\n    return 0\n  }\n\n  decode (tail) {\n    return b4a.toString(tail, this.encoding)\n  }\n\n  flush () {\n    return ''\n  }\n}\nconst b4a = require('b4a')\n\n/**\n * https://encoding.spec.whatwg.org/#utf-8-decoder\n */\nmodule.exports = class UTF8Decoder {\n  constructor () {\n    this.codePoint = 0\n    this.bytesSeen = 0\n    this.bytesNeeded = 0\n    this.lowerBoundary = 0x80\n    this.upperBoundary = 0xbf\n  }\n\n  get remaining () {\n    return this.bytesSeen\n  }\n\n  decode (data) {\n    // If we have a fast path, just sniff if the last part is a boundary\n    if (this.bytesNeeded === 0) {\n      let isBoundary = true\n\n      for (let i = Math.max(0, data.byteLength - 4), n = data.byteLength; i < n && isBoundary; i++) {\n        isBoundary = data[i] <= 0x7f\n      }\n\n      if (isBoundary) return b4a.toString(data, 'utf8')\n    }\n\n    let result = ''\n\n    for (let i = 0, n = data.byteLength; i < n; i++) {\n      const byte = data[i]\n\n      if (this.bytesNeeded === 0) {\n        if (byte <= 0x7f) {\n          result += String.fromCharCode(byte)\n        } else {\n          this.bytesSeen = 1\n\n          if (byte >= 0xc2 && byte <= 0xdf) {\n            this.bytesNeeded = 2\n            this.codePoint = byte & 0x1f\n          } else if (byte >= 0xe0 && byte <= 0xef) {\n            if (byte === 0xe0) this.lowerBoundary = 0xa0\n            else if (byte === 0xed) this.upperBoundary = 0x9f\n            this.bytesNeeded = 3\n            this.codePoint = byte & 0xf\n          } else if (byte >= 0xf0 && byte <= 0xf4) {\n            if (byte === 0xf0) this.lowerBoundary = 0x90\n            if (byte === 0xf4) this.upperBoundary = 0x8f\n            this.bytesNeeded = 4\n            this.codePoint = byte & 0x7\n          } else {\n            result += '\\ufffd'\n          }\n        }\n\n        continue\n      }\n\n      if (byte < this.lowerBoundary || byte > this.upperBoundary) {\n        this.codePoint = 0\n        this.bytesNeeded = 0\n        this.bytesSeen = 0\n        this.lowerBoundary = 0x80\n        this.upperBoundary = 0xbf\n\n        result += '\\ufffd'\n\n        continue\n      }\n\n      this.lowerBoundary = 0x80\n      this.upperBoundary = 0xbf\n\n      this.codePoint = (this.codePoint << 6) | (byte & 0x3f)\n      this.bytesSeen++\n\n      if (this.bytesSeen !== this.bytesNeeded) continue\n\n      result += String.fromCodePoint(this.codePoint)\n\n      this.codePoint = 0\n      this.bytesNeeded = 0\n      this.bytesSeen = 0\n    }\n\n    return result\n  }\n\n  flush () {\n    const result = this.bytesNeeded > 0 ? '\\ufffd' : ''\n\n    this.codePoint = 0\n    this.bytesNeeded = 0\n    this.bytesSeen = 0\n    this.lowerBoundary = 0x80\n    this.upperBoundary = 0xbf\n\n    return result\n  }\n}\n{\n  \"name\": \"text-decoder\",\n  \"version\": \"1.2.3\",\n  \"description\": \"Streaming text decoder that preserves multibyte Unicode characters\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\",\n    \"lib\"\n  ],\n  \"browser\": {\n    \"./lib/pass-through-decoder.js\": \"./lib/browser-decoder.js\",\n    \"./lib/utf8-decoder.js\": \"./lib/browser-decoder.js\"\n  },\n  \"react-native\": {\n    \"./lib/pass-through-decoder.js\": \"./lib/pass-through-decoder.js\",\n    \"./lib/utf8-decoder.js\": \"./lib/utf8-decoder.js\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/holepunchto/text-decoder.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/text-decoder/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/text-decoder#readme\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.4\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.3.2\",\n    \"standard\": \"^17.0.0\"\n  }\n}\nmodule.exports = class TimerBrowser {\n  constructor (ms, fn, ctx = null, interval = false) {\n    this.ms = ms\n    this.ontimeout = fn\n    this.context = ctx || null\n    this.interval = interval\n    this.done = false\n\n    this._timer = interval\n      ? setInterval(callInterval, ms, this)\n      : setTimeout(callTimeout, ms, this)\n  }\n\n  unref () {}\n\n  ref () {}\n\n  refresh () {\n    if (this.done) return\n\n    if (this.interval) {\n      clearInterval(this._timer)\n      this._timer = setInterval(callInterval, this.ms, this)\n    } else {\n      clearTimeout(this._timer)\n      this._timer = setTimeout(callTimeout, this.ms, this)\n    }\n  }\n\n  destroy () {\n    this.done = true\n    this.ontimeout = null\n\n    if (this.interval) clearInterval(this._timer)\n    else clearTimeout(this._timer)\n  }\n\n  static once (ms, fn, ctx) {\n    return new this(ms, fn, ctx, false)\n  }\n\n  static on (ms, fn, ctx) {\n    return new this(ms, fn, ctx, true)\n  }\n}\n\nfunction callTimeout (self) {\n  self.done = true\n  self.ontimeout.call(self.context)\n}\n\nfunction callInterval (self) {\n  self.ontimeout.call(self.context)\n}\nmodule.exports = isNode()\n  ? require('./node')\n  : require('./browser')\n\nfunction isNode () {\n  const to = setTimeout(function () {}, 1000)\n  clearTimeout(to)\n  return !!to.refresh\n}\nmodule.exports = class Timer {\n  constructor (ms, fn, ctx = null, interval = false) {\n    this.ms = ms\n    this.ontimeout = fn\n    this.context = ctx\n    this.interval = interval\n    this.done = false\n\n    this._timer = interval\n      ? setInterval(callInterval, ms, this)\n      : setTimeout(callTimeout, ms, this)\n  }\n\n  unref () {\n    this._timer.unref()\n  }\n\n  ref () {\n    this._timer.ref()\n  }\n\n  refresh () {\n    if (this.done !== true) this._timer.refresh()\n  }\n\n  destroy () {\n    this.done = true\n    this.ontimeout = null\n    if (this.interval) clearInterval(this._timer)\n    else clearTimeout(this._timer)\n  }\n\n  static once (ms, fn, ctx) {\n    return new this(ms, fn, ctx, false)\n  }\n\n  static on (ms, fn, ctx) {\n    return new this(ms, fn, ctx, true)\n  }\n}\n\nfunction callTimeout (self) {\n  self.done = true\n  self.ontimeout.call(self.context)\n}\n\nfunction callInterval (self) {\n  self.ontimeout.call(self.context)\n}\n{\n  \"name\": \"timeout-refresh\",\n  \"version\": \"2.0.1\",\n  \"description\": \"Efficiently refresh a timer\",\n  \"main\": \"index.js\",\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"standard\": \"^16.0.4\",\n    \"tape\": \"^5.5.2\"\n  },\n  \"browser\": \"./browser.js\",\n  \"scripts\": {\n    \"test\": \"standard && tape test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/timeout-refresh.git\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/timeout-refresh/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/timeout-refresh\"\n}\nconst b4a = require('b4a')\n\nmodule.exports = class BufferMap {\n  constructor (other) {\n    this.m = other ? new Map([...other.m]) : new Map()\n  }\n\n  get size () {\n    return this.m.size\n  }\n\n  get (key) {\n    if (b4a.isBuffer(key)) key = b4a.toString(key, 'hex')\n    return this.m.get(key)\n  }\n\n  set (key, value) {\n    if (b4a.isBuffer(key)) key = b4a.toString(key, 'hex')\n    return this.m.set(key, value)\n  }\n\n  delete (key) {\n    if (b4a.isBuffer(key)) key = b4a.toString(key, 'hex')\n    return this.m.delete(key)\n  }\n\n  has (key) {\n    if (b4a.isBuffer(key)) key = b4a.toString(key, 'hex')\n    return this.m.has(key)\n  }\n\n  * [Symbol.iterator] () {\n    for (const [key, value] of this.m) {\n      yield [b4a.from(key, 'hex'), value]\n    }\n  }\n\n  * keys () {\n    for (const key of this.m.keys()) {\n      yield b4a.from(key, 'hex')\n    }\n  }\n\n  values () {\n    return this.m.values()\n  }\n\n  clear () {\n    return this.m.clear()\n  }\n}\n{\n  \"name\": \"tiny-buffer-map\",\n  \"version\": \"1.1.1\",\n  \"description\": \"A very simple map for Buffers\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/andrewosh/tiny-buffer-map.git\"\n  },\n  \"keywords\": [\n    \"buffer\",\n    \"map\"\n  ],\n  \"author\": \"Andrew Osheroff <andrewosh@gmail.com>\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/andrewosh/tiny-buffer-map/issues\"\n  },\n  \"homepage\": \"https://github.com/andrewosh/tiny-buffer-map#readme\",\n  \"dependencies\": {\n    \"b4a\": \"^1.6.0\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.0.4\"\n  }\n}\nvar native = require('./native')\n\nfunction getTypeName (fn) {\n  return fn.name || fn.toString().match(/function (.*?)\\s*\\(/)[1]\n}\n\nfunction getValueTypeName (value) {\n  return native.Nil(value) ? '' : getTypeName(value.constructor)\n}\n\nfunction getValue (value) {\n  if (native.Function(value)) return ''\n  if (native.String(value)) return JSON.stringify(value)\n  if (value && native.Object(value)) return ''\n  return value\n}\n\nfunction captureStackTrace (e, t) {\n  if (Error.captureStackTrace) {\n    Error.captureStackTrace(e, t)\n  }\n}\n\nfunction tfJSON (type) {\n  if (native.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type)\n  if (native.Array(type)) return 'Array'\n  if (type && native.Object(type)) return 'Object'\n\n  return type !== undefined ? type : ''\n}\n\nfunction tfErrorString (type, value, valueTypeName) {\n  var valueJson = getValue(value)\n\n  return 'Expected ' + tfJSON(type) + ', got' +\n    (valueTypeName !== '' ? ' ' + valueTypeName : '') +\n    (valueJson !== '' ? ' ' + valueJson : '')\n}\n\nfunction TfTypeError (type, value, valueTypeName) {\n  valueTypeName = valueTypeName || getValueTypeName(value)\n  this.message = tfErrorString(type, value, valueTypeName)\n\n  captureStackTrace(this, TfTypeError)\n  this.__type = type\n  this.__value = value\n  this.__valueTypeName = valueTypeName\n}\n\nTfTypeError.prototype = Object.create(Error.prototype)\nTfTypeError.prototype.constructor = TfTypeError\n\nfunction tfPropertyErrorString (type, label, name, value, valueTypeName) {\n  var description = '\" of type '\n  if (label === 'key') description = '\" with key type '\n\n  return tfErrorString('property \"' + tfJSON(name) + description + tfJSON(type), value, valueTypeName)\n}\n\nfunction TfPropertyTypeError (type, property, label, value, valueTypeName) {\n  if (type) {\n    valueTypeName = valueTypeName || getValueTypeName(value)\n    this.message = tfPropertyErrorString(type, label, property, value, valueTypeName)\n  } else {\n    this.message = 'Unexpected property \"' + property + '\"'\n  }\n\n  captureStackTrace(this, TfTypeError)\n  this.__label = label\n  this.__property = property\n  this.__type = type\n  this.__value = value\n  this.__valueTypeName = valueTypeName\n}\n\nTfPropertyTypeError.prototype = Object.create(Error.prototype)\nTfPropertyTypeError.prototype.constructor = TfTypeError\n\nfunction tfCustomError (expected, actual) {\n  return new TfTypeError(expected, {}, actual)\n}\n\nfunction tfSubError (e, property, label) {\n  // sub child?\n  if (e instanceof TfPropertyTypeError) {\n    property = property + '.' + e.__property\n\n    e = new TfPropertyTypeError(\n      e.__type, property, e.__label, e.__value, e.__valueTypeName\n    )\n\n  // child?\n  } else if (e instanceof TfTypeError) {\n    e = new TfPropertyTypeError(\n      e.__type, property, label, e.__value, e.__valueTypeName\n    )\n  }\n\n  captureStackTrace(e)\n  return e\n}\n\nmodule.exports = {\n  TfTypeError: TfTypeError,\n  TfPropertyTypeError: TfPropertyTypeError,\n  tfCustomError: tfCustomError,\n  tfSubError: tfSubError,\n  tfJSON: tfJSON,\n  getValueTypeName: getValueTypeName\n}\nvar NATIVE = require('./native')\nvar ERRORS = require('./errors')\n\nfunction _Buffer (value) {\n  return Buffer.isBuffer(value)\n}\n\nfunction Hex (value) {\n  return typeof value === 'string' && /^([0-9a-f]{2})+$/i.test(value)\n}\n\nfunction _LengthN (type, length) {\n  var name = type.toJSON()\n\n  function Length (value) {\n    if (!type(value)) return false\n    if (value.length === length) return true\n\n    throw ERRORS.tfCustomError(name + '(Length: ' + length + ')', name + '(Length: ' + value.length + ')')\n  }\n  Length.toJSON = function () { return name }\n\n  return Length\n}\n\nvar _ArrayN = _LengthN.bind(null, NATIVE.Array)\nvar _BufferN = _LengthN.bind(null, _Buffer)\nvar _HexN = _LengthN.bind(null, Hex)\nvar _StringN = _LengthN.bind(null, NATIVE.String)\n\nfunction Range (a, b, f) {\n  f = f || NATIVE.Number\n  function _range (value, strict) {\n    return f(value, strict) && (value > a) && (value < b)\n  }\n  _range.toJSON = function () {\n    return `${f.toJSON()} between [${a}, ${b}]`\n  }\n  return _range\n}\n\nvar INT53_MAX = Math.pow(2, 53) - 1\n\nfunction Finite (value) {\n  return typeof value === 'number' && isFinite(value)\n}\nfunction Int8 (value) { return ((value << 24) >> 24) === value }\nfunction Int16 (value) { return ((value << 16) >> 16) === value }\nfunction Int32 (value) { return (value | 0) === value }\nfunction Int53 (value) {\n  return typeof value === 'number' &&\n    value >= -INT53_MAX &&\n    value <= INT53_MAX &&\n    Math.floor(value) === value\n}\nfunction UInt8 (value) { return (value & 0xff) === value }\nfunction UInt16 (value) { return (value & 0xffff) === value }\nfunction UInt32 (value) { return (value >>> 0) === value }\nfunction UInt53 (value) {\n  return typeof value === 'number' &&\n    value >= 0 &&\n    value <= INT53_MAX &&\n    Math.floor(value) === value\n}\n\nvar types = {\n  ArrayN: _ArrayN,\n  Buffer: _Buffer,\n  BufferN: _BufferN,\n  Finite: Finite,\n  Hex: Hex,\n  HexN: _HexN,\n  Int8: Int8,\n  Int16: Int16,\n  Int32: Int32,\n  Int53: Int53,\n  Range: Range,\n  StringN: _StringN,\n  UInt8: UInt8,\n  UInt16: UInt16,\n  UInt32: UInt32,\n  UInt53: UInt53\n}\n\nfor (var typeName in types) {\n  types[typeName].toJSON = function (t) {\n    return t\n  }.bind(null, typeName)\n}\n\nmodule.exports = types\nvar ERRORS = require('./errors')\nvar NATIVE = require('./native')\n\n// short-hand\nvar tfJSON = ERRORS.tfJSON\nvar TfTypeError = ERRORS.TfTypeError\nvar TfPropertyTypeError = ERRORS.TfPropertyTypeError\nvar tfSubError = ERRORS.tfSubError\nvar getValueTypeName = ERRORS.getValueTypeName\n\nvar TYPES = {\n  arrayOf: function arrayOf (type, options) {\n    type = compile(type)\n    options = options || {}\n\n    function _arrayOf (array, strict) {\n      if (!NATIVE.Array(array)) return false\n      if (NATIVE.Nil(array)) return false\n      if (options.minLength !== undefined && array.length < options.minLength) return false\n      if (options.maxLength !== undefined && array.length > options.maxLength) return false\n      if (options.length !== undefined && array.length !== options.length) return false\n\n      return array.every(function (value, i) {\n        try {\n          return typeforce(type, value, strict)\n        } catch (e) {\n          throw tfSubError(e, i)\n        }\n      })\n    }\n    _arrayOf.toJSON = function () {\n      var str = '[' + tfJSON(type) + ']'\n      if (options.length !== undefined) {\n        str += '{' + options.length + '}'\n      } else if (options.minLength !== undefined || options.maxLength !== undefined) {\n        str += '{' +\n          (options.minLength === undefined ? 0 : options.minLength) + ',' +\n          (options.maxLength === undefined ? Infinity : options.maxLength) + '}'\n      }\n      return str\n    }\n\n    return _arrayOf\n  },\n\n  maybe: function maybe (type) {\n    type = compile(type)\n\n    function _maybe (value, strict) {\n      return NATIVE.Nil(value) || type(value, strict, maybe)\n    }\n    _maybe.toJSON = function () { return '?' + tfJSON(type) }\n\n    return _maybe\n  },\n\n  map: function map (propertyType, propertyKeyType) {\n    propertyType = compile(propertyType)\n    if (propertyKeyType) propertyKeyType = compile(propertyKeyType)\n\n    function _map (value, strict) {\n      if (!NATIVE.Object(value)) return false\n      if (NATIVE.Nil(value)) return false\n\n      for (var propertyName in value) {\n        try {\n          if (propertyKeyType) {\n            typeforce(propertyKeyType, propertyName, strict)\n          }\n        } catch (e) {\n          throw tfSubError(e, propertyName, 'key')\n        }\n\n        try {\n          var propertyValue = value[propertyName]\n          typeforce(propertyType, propertyValue, strict)\n        } catch (e) {\n          throw tfSubError(e, propertyName)\n        }\n      }\n\n      return true\n    }\n\n    if (propertyKeyType) {\n      _map.toJSON = function () {\n        return '{' + tfJSON(propertyKeyType) + ': ' + tfJSON(propertyType) + '}'\n      }\n    } else {\n      _map.toJSON = function () { return '{' + tfJSON(propertyType) + '}' }\n    }\n\n    return _map\n  },\n\n  object: function object (uncompiled) {\n    var type = {}\n\n    for (var typePropertyName in uncompiled) {\n      type[typePropertyName] = compile(uncompiled[typePropertyName])\n    }\n\n    function _object (value, strict) {\n      if (!NATIVE.Object(value)) return false\n      if (NATIVE.Nil(value)) return false\n\n      var propertyName\n\n      try {\n        for (propertyName in type) {\n          var propertyType = type[propertyName]\n          var propertyValue = value[propertyName]\n\n          typeforce(propertyType, propertyValue, strict)\n        }\n      } catch (e) {\n        throw tfSubError(e, propertyName)\n      }\n\n      if (strict) {\n        for (propertyName in value) {\n          if (type[propertyName]) continue\n\n          throw new TfPropertyTypeError(undefined, propertyName)\n        }\n      }\n\n      return true\n    }\n    _object.toJSON = function () { return tfJSON(type) }\n\n    return _object\n  },\n\n  anyOf: function anyOf () {\n    var types = [].slice.call(arguments).map(compile)\n\n    function _anyOf (value, strict) {\n      return types.some(function (type) {\n        try {\n          return typeforce(type, value, strict)\n        } catch (e) {\n          return false\n        }\n      })\n    }\n    _anyOf.toJSON = function () { return types.map(tfJSON).join('|') }\n\n    return _anyOf\n  },\n\n  allOf: function allOf () {\n    var types = [].slice.call(arguments).map(compile)\n\n    function _allOf (value, strict) {\n      return types.every(function (type) {\n        try {\n          return typeforce(type, value, strict)\n        } catch (e) {\n          return false\n        }\n      })\n    }\n    _allOf.toJSON = function () { return types.map(tfJSON).join(' & ') }\n\n    return _allOf\n  },\n\n  quacksLike: function quacksLike (type) {\n    function _quacksLike (value) {\n      return type === getValueTypeName(value)\n    }\n    _quacksLike.toJSON = function () { return type }\n\n    return _quacksLike\n  },\n\n  tuple: function tuple () {\n    var types = [].slice.call(arguments).map(compile)\n\n    function _tuple (values, strict) {\n      if (NATIVE.Nil(values)) return false\n      if (NATIVE.Nil(values.length)) return false\n      if (strict && (values.length !== types.length)) return false\n\n      return types.every(function (type, i) {\n        try {\n          return typeforce(type, values[i], strict)\n        } catch (e) {\n          throw tfSubError(e, i)\n        }\n      })\n    }\n    _tuple.toJSON = function () { return '(' + types.map(tfJSON).join(', ') + ')' }\n\n    return _tuple\n  },\n\n  value: function value (expected) {\n    function _value (actual) {\n      return actual === expected\n    }\n    _value.toJSON = function () { return expected }\n\n    return _value\n  }\n}\n\n// TODO: deprecate\nTYPES.oneOf = TYPES.anyOf\n\nfunction compile (type) {\n  if (NATIVE.String(type)) {\n    if (type[0] === '?') return TYPES.maybe(type.slice(1))\n\n    return NATIVE[type] || TYPES.quacksLike(type)\n  } else if (type && NATIVE.Object(type)) {\n    if (NATIVE.Array(type)) {\n      if (type.length !== 1) throw new TypeError('Expected compile() parameter of type Array of length 1')\n      return TYPES.arrayOf(type[0])\n    }\n\n    return TYPES.object(type)\n  } else if (NATIVE.Function(type)) {\n    return type\n  }\n\n  return TYPES.value(type)\n}\n\nfunction typeforce (type, value, strict, surrogate) {\n  if (NATIVE.Function(type)) {\n    if (type(value, strict)) return true\n\n    throw new TfTypeError(surrogate || type, value)\n  }\n\n  // JIT\n  return typeforce(compile(type), value, strict)\n}\n\n// assign types to typeforce function\nfor (var typeName in NATIVE) {\n  typeforce[typeName] = NATIVE[typeName]\n}\n\nfor (typeName in TYPES) {\n  typeforce[typeName] = TYPES[typeName]\n}\n\nvar EXTRA = require('./extra')\nfor (typeName in EXTRA) {\n  typeforce[typeName] = EXTRA[typeName]\n}\n\ntypeforce.compile = compile\ntypeforce.TfTypeError = TfTypeError\ntypeforce.TfPropertyTypeError = TfPropertyTypeError\n\nmodule.exports = typeforce\nvar types = {\n  Array: function (value) { return value !== null && value !== undefined && value.constructor === Array },\n  Boolean: function (value) { return typeof value === 'boolean' },\n  Function: function (value) { return typeof value === 'function' },\n  Nil: function (value) { return value === undefined || value === null },\n  Number: function (value) { return typeof value === 'number' },\n  Object: function (value) { return typeof value === 'object' },\n  String: function (value) { return typeof value === 'string' },\n  '': function () { return true }\n}\n\n// TODO: deprecate\ntypes.Null = types.Nil\n\nfor (var typeName in types) {\n  types[typeName].toJSON = function (t) {\n    return t\n  }.bind(null, typeName)\n}\n\nmodule.exports = types\n{\n  \"name\": \"typeforce\",\n  \"version\": \"1.18.0\",\n  \"description\": \"Another biased type checking solution for Javascript\",\n  \"keywords\": [\n    \"typeforce\",\n    \"types\",\n    \"typechecking\",\n    \"type\",\n    \"exceptions\",\n    \"force\"\n  ],\n  \"homepage\": \"https://github.com/dcousens/typeforce\",\n  \"bugs\": {\n    \"url\": \"https://github.com/dcousens/typeforce/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Daniel Cousens\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"async.js\",\n    \"errors.js\",\n    \"extra.js\",\n    \"index.js\",\n    \"native.js\",\n    \"nothrow.js\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcousens/typeforce.git\"\n  },\n  \"scripts\": {\n    \"coverage\": \"nyc --check-coverage --branches 100 --functions 100 node test/*.js\",\n    \"test\": \"npm run standard && npm run unit\",\n    \"standard\": \"standard\",\n    \"unit\": \"node test/*.js\"\n  },\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"nyc\": \"^13.1.0\",\n    \"standard\": \"*\",\n    \"tape\": \"^4.6.1\"\n  }\n}\nconst b4a = require('b4a')\n\nunslab.all = all\nunslab.is = is\n\nmodule.exports = unslab\n\nfunction unslab (buf) {\n  if (buf === null || buf.buffer.byteLength === buf.byteLength) return buf\n  const copy = b4a.allocUnsafeSlow(buf.byteLength)\n  copy.set(buf, 0)\n  return copy\n}\n\nfunction is (buf) {\n  return buf.buffer.byteLength !== buf.byteLength\n}\n\nfunction all (list) {\n  let size = 0\n  for (let i = 0; i < list.length; i++) {\n    const buf = list[i]\n    size += buf === null || buf.buffer.byteLength === buf.byteLength ? 0 : buf.byteLength\n  }\n\n  const copy = b4a.allocUnsafeSlow(size)\n  const result = new Array(list.length)\n\n  let offset = 0\n  for (let i = 0; i < list.length; i++) {\n    let buf = list[i]\n\n    if (buf !== null && buf.buffer.byteLength !== buf.byteLength) {\n      copy.set(buf, offset)\n      buf = copy.subarray(offset, offset += buf.byteLength)\n    }\n\n    result[i] = buf\n  }\n\n  return result\n}\n{\n  \"name\": \"unslab\",\n  \"version\": \"1.3.0\",\n  \"description\": \"Unslab some slab'ed buffers\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {\n    \"b4a\": \"^1.6.6\"\n  },\n  \"devDependencies\": {\n    \"brittle\": \"^3.5.2\",\n    \"standard\": \"^17.1.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/unslab.git\"\n  },\n  \"author\": \"Holepunch\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/unslab/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/unslab\"\n}\n'use strict';\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction isValidUTF8(buf) {\n  const len = buf.length;\n  let i = 0;\n\n  while (i < len) {\n    if ((buf[i] & 0x80) === 0x00) {  // 0xxxxxxx\n      i++;\n    } else if ((buf[i] & 0xe0) === 0xc0) {  // 110xxxxx 10xxxxxx\n      if (\n        i + 1 === len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i] & 0xfe) === 0xc0  // overlong\n      ) {\n        return false;\n      }\n\n      i += 2;\n    } else if ((buf[i] & 0xf0) === 0xe0) {  // 1110xxxx 10xxxxxx 10xxxxxx\n      if (\n        i + 2 >= len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i + 2] & 0xc0) !== 0x80 ||\n        buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80 ||  // overlong\n        buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0  // surrogate (U+D800 - U+DFFF)\n      ) {\n        return false;\n      }\n\n      i += 3;\n    } else if ((buf[i] & 0xf8) === 0xf0) {  // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n      if (\n        i + 3 >= len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i + 2] & 0xc0) !== 0x80 ||\n        (buf[i + 3] & 0xc0) !== 0x80 ||\n        buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80 ||  // overlong\n        buf[i] === 0xf4 && buf[i + 1] > 0x8f || buf[i] > 0xf4  // > U+10FFFF\n      ) {\n        return false;\n      }\n\n      i += 4;\n    } else {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nmodule.exports = isValidUTF8;\n'use strict';\n\ntry {\n  module.exports = require('node-gyp-build')(__dirname);\n} catch (e) {\n  module.exports = require('./fallback');\n}\n{\n  \"name\": \"utf-8-validate\",\n  \"version\": \"6.0.6\",\n  \"description\": \"Check if a buffer contains valid UTF-8\",\n  \"main\": \"index.js\",\n  \"engines\": {\n    \"node\": \">=6.14.2\"\n  },\n  \"scripts\": {\n    \"install\": \"node-gyp-build\",\n    \"prebuild\": \"prebuildify --napi --strip --target=8.11.2\",\n    \"prebuild-linux-musl-x64\": \"prebuildify-cross --image alpine --napi --strip --target=8.11.2\",\n    \"test\": \"mocha\"\n  },\n  \"files\": [\n    \"prebuilds/\",\n    \"src/\",\n    \"deps/is_utf8/LICENSE-MIT\",\n    \"deps/is_utf8/include/is_utf8.h\",\n    \"deps/is_utf8/src/is_utf8.cpp\",\n    \"binding.gyp\",\n    \"fallback.js\",\n    \"index.js\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/websockets/utf-8-validate.git\"\n  },\n  \"keywords\": [\n    \"utf-8-validate\"\n  ],\n  \"author\": \"Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/websockets/utf-8-validate/issues\"\n  },\n  \"homepage\": \"https://github.com/websockets/utf-8-validate\",\n  \"dependencies\": {\n    \"node-gyp-build\": \"^4.3.0\"\n  },\n  \"devDependencies\": {\n    \"mocha\": \"^11.0.1\",\n    \"node-gyp\": \"^12.1.0\",\n    \"prebuildify\": \"^6.0.0\",\n    \"prebuildify-cross\": \"^5.0.0\"\n  }\n}\nmodule.exports = read\n\nvar MSB = 0x80\n  , REST = 0x7F\n\nfunction read(buf, offset) {\n  var res    = 0\n    , offset = offset || 0\n    , shift  = 0\n    , counter = offset\n    , b\n    , l = buf.length\n\n  do {\n    if (counter >= l) {\n      read.bytes = 0\n      throw new RangeError('Could not decode varint')\n    }\n    b = buf[counter++]\n    res += shift < 28\n      ? (b & REST) << shift\n      : (b & REST) * Math.pow(2, shift)\n    shift += 7\n  } while (b >= MSB)\n\n  read.bytes = counter - offset\n\n  return res\n}\nmodule.exports = encode\n\nvar MSB = 0x80\n  , REST = 0x7F\n  , MSBALL = ~REST\n  , INT = Math.pow(2, 31)\n\nfunction encode(num, out, offset) {\n  out = out || []\n  offset = offset || 0\n  var oldOffset = offset\n\n  while(num >= INT) {\n    out[offset++] = (num & 0xFF) | MSB\n    num /= 128\n  }\n  while(num & MSBALL) {\n    out[offset++] = (num & 0xFF) | MSB\n    num >>>= 7\n  }\n  out[offset] = num | 0\n  \n  encode.bytes = offset - oldOffset + 1\n  \n  return out\n}\nmodule.exports = {\n    encode: require('./encode.js')\n  , decode: require('./decode.js')\n  , encodingLength: require('./length.js')\n}\n\nvar N1 = Math.pow(2,  7)\nvar N2 = Math.pow(2, 14)\nvar N3 = Math.pow(2, 21)\nvar N4 = Math.pow(2, 28)\nvar N5 = Math.pow(2, 35)\nvar N6 = Math.pow(2, 42)\nvar N7 = Math.pow(2, 49)\nvar N8 = Math.pow(2, 56)\nvar N9 = Math.pow(2, 63)\n\nmodule.exports = function (value) {\n  return (\n    value < N1 ? 1\n  : value < N2 ? 2\n  : value < N3 ? 3\n  : value < N4 ? 4\n  : value < N5 ? 5\n  : value < N6 ? 6\n  : value < N7 ? 7\n  : value < N8 ? 8\n  : value < N9 ? 9\n  :              10\n  )\n}\n{\n  \"name\": \"varint\",\n  \"version\": \"5.0.0\",\n  \"description\": \"protobuf-style varint bytes - use msb to create integer values of varying sizes\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"node test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/chrisdickinson/varint.git\"\n  },\n  \"keywords\": [\n    \"varint\",\n    \"protobuf\",\n    \"encode\",\n    \"decode\"\n  ],\n  \"author\": \"Chris Dickinson <chris@neversaw.us>\",\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"tape\": \"~2.12.3\"\n  }\n}\n'use strict'\nvar Buffer = require('safe-buffer').Buffer\n\n// Number.MAX_SAFE_INTEGER\nvar MAX_SAFE_INTEGER = 9007199254740991\n\nfunction checkUInt53 (n) {\n  if (n < 0 || n > MAX_SAFE_INTEGER || n % 1 !== 0) throw new RangeError('value out of range')\n}\n\nfunction encode (number, buffer, offset) {\n  checkUInt53(number)\n\n  if (!buffer) buffer = Buffer.allocUnsafe(encodingLength(number))\n  if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance')\n  if (!offset) offset = 0\n\n  // 8 bit\n  if (number < 0xfd) {\n    buffer.writeUInt8(number, offset)\n    encode.bytes = 1\n\n  // 16 bit\n  } else if (number <= 0xffff) {\n    buffer.writeUInt8(0xfd, offset)\n    buffer.writeUInt16LE(number, offset + 1)\n    encode.bytes = 3\n\n  // 32 bit\n  } else if (number <= 0xffffffff) {\n    buffer.writeUInt8(0xfe, offset)\n    buffer.writeUInt32LE(number, offset + 1)\n    encode.bytes = 5\n\n  // 64 bit\n  } else {\n    buffer.writeUInt8(0xff, offset)\n    buffer.writeUInt32LE(number >>> 0, offset + 1)\n    buffer.writeUInt32LE((number / 0x100000000) | 0, offset + 5)\n    encode.bytes = 9\n  }\n\n  return buffer\n}\n\nfunction decode (buffer, offset) {\n  if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance')\n  if (!offset) offset = 0\n\n  var first = buffer.readUInt8(offset)\n\n  // 8 bit\n  if (first < 0xfd) {\n    decode.bytes = 1\n    return first\n\n  // 16 bit\n  } else if (first === 0xfd) {\n    decode.bytes = 3\n    return buffer.readUInt16LE(offset + 1)\n\n  // 32 bit\n  } else if (first === 0xfe) {\n    decode.bytes = 5\n    return buffer.readUInt32LE(offset + 1)\n\n  // 64 bit\n  } else {\n    decode.bytes = 9\n    var lo = buffer.readUInt32LE(offset + 1)\n    var hi = buffer.readUInt32LE(offset + 5)\n    var number = hi * 0x0100000000 + lo\n    checkUInt53(number)\n\n    return number\n  }\n}\n\nfunction encodingLength (number) {\n  checkUInt53(number)\n\n  return (\n    number < 0xfd ? 1\n      : number <= 0xffff ? 3\n        : number <= 0xffffffff ? 5\n          : 9\n  )\n}\n\nmodule.exports = { encode: encode, decode: decode, encodingLength: encodingLength }\n{\n  \"name\": \"varuint-bitcoin\",\n  \"version\": \"1.1.2\",\n  \"description\": \"encode/decode number as bitcoin variable length integer\",\n  \"homepage\": \"https://github.com/bitcoinjs/varuint-bitcoin\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/varuint-bitcoin/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Kirill Fomichev <fanatid@ya.ru> (http://github.com/fanatid)\",\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\"\n  ],\n  \"main\": \"./index.js\",\n  \"types\": \"./index.d.ts\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/varuint-bitcoin.git\"\n  },\n  \"scripts\": {\n    \"coverage\": \"nyc --check-coverage --branches 100 --functions 100 tape test/*.js\",\n    \"lint\": \"standard\",\n    \"test\": \"npm run lint && npm run unit\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"dependencies\": {\n    \"safe-buffer\": \"^5.1.1\"\n  },\n  \"devDependencies\": {\n    \"nyc\": \"^14.1.1\",\n    \"standard\": \"*\",\n    \"tape\": \"^4.5.1\"\n  }\n}\nconst { runtime, platform, arch } = typeof Bare !== 'undefined'\n  ? { runtime: 'bare', platform: global.Bare.platform, arch: global.Bare.arch }\n  : typeof process !== 'undefined'\n    ? { runtime: 'node', platform: global.process.platform, arch: global.process.arch }\n    : typeof Window !== 'undefined'\n      ? { runtime: 'browser', platform: 'unknown', arch: 'unknown' }\n      : { runtime: 'unknown', platform: 'unknown', arch: 'unknown' }\n\nexports.runtime = runtime\nexports.platform = platform\nexports.arch = arch\nexports.isBare = runtime === 'bare'\nexports.isBareKit = exports.isBare && typeof BareKit !== 'undefined'\nexports.isPear = typeof Pear !== 'undefined'\nexports.isNode = runtime === 'node'\nexports.isBrowser = runtime === 'browser'\nexports.isWindows = platform === 'win32'\nexports.isLinux = platform === 'linux'\nexports.isMac = platform === 'darwin'\nexports.isIOS = platform === 'ios' || platform === 'ios-simulator'\nexports.isAndroid = platform === 'android'\nexports.isElectron = typeof process !== 'undefined' && !!global.process.versions?.electron\nexports.isElectronRenderer = exports.isElectron && global.process.type === 'renderer'\nexports.isElectronWorker = exports.isElectron && global.process.type === 'worker'\n{\n  \"name\": \"which-runtime\",\n  \"version\": \"1.3.2\",\n  \"description\": \"Detect if you are in Bare or Node and which os etc\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"dependencies\": {},\n  \"devDependencies\": {\n    \"standard\": \"^17.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"standard\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/holepunchto/which-runtime.git\"\n  },\n  \"author\": \"Holepunch Inc.\",\n  \"license\": \"Apache-2.0\",\n  \"bugs\": {\n    \"url\": \"https://github.com/holepunchto/which-runtime/issues\"\n  },\n  \"homepage\": \"https://github.com/holepunchto/which-runtime\"\n}\nvar bs58check = require('bs58check')\n\nfunction decodeRaw (buffer, version) {\n  // check version only if defined\n  if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version')\n\n  // uncompressed\n  if (buffer.length === 33) {\n    return {\n      version: buffer[0],\n      privateKey: buffer.slice(1, 33),\n      compressed: false\n    }\n  }\n\n  // invalid length\n  if (buffer.length !== 34) throw new Error('Invalid WIF length')\n\n  // invalid compression flag\n  if (buffer[33] !== 0x01) throw new Error('Invalid compression flag')\n\n  return {\n    version: buffer[0],\n    privateKey: buffer.slice(1, 33),\n    compressed: true\n  }\n}\n\nfunction encodeRaw (version, privateKey, compressed) {\n  var result = new Buffer(compressed ? 34 : 33)\n\n  result.writeUInt8(version, 0)\n  privateKey.copy(result, 1)\n\n  if (compressed) {\n    result[33] = 0x01\n  }\n\n  return result\n}\n\nfunction decode (string, version) {\n  return decodeRaw(bs58check.decode(string), version)\n}\n\nfunction encode (version, privateKey, compressed) {\n  if (typeof version === 'number') return bs58check.encode(encodeRaw(version, privateKey, compressed))\n\n  return bs58check.encode(\n    encodeRaw(\n      version.version,\n      version.privateKey,\n      version.compressed\n    )\n  )\n}\n\nmodule.exports = {\n  decode: decode,\n  decodeRaw: decodeRaw,\n  encode: encode,\n  encodeRaw: encodeRaw\n}\n{\n  \"name\": \"base-x\",\n  \"version\": \"3.0.11\",\n  \"description\": \"Fast base encoding / decoding of any given alphabet\",\n  \"keywords\": [\n    \"base-x\",\n    \"base58\",\n    \"base62\",\n    \"base64\",\n    \"crypto\",\n    \"crytography\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\"\n  ],\n  \"homepage\": \"https://github.com/cryptocoinjs/base-x\",\n  \"bugs\": {\n    \"url\": \"https://github.com/cryptocoinjs/base-x/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Daniel Cousens\",\n  \"files\": [\n    \"src\"\n  ],\n  \"main\": \"src/index.js\",\n  \"types\": \"src/index.d.ts\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/cryptocoinjs/base-x.git\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc -p ./tsconfig.json ; standard --fix\",\n    \"gitdiff\": \"npm run build && git diff --exit-code\",\n    \"prepublish\": \"npm run gitdiff\",\n    \"standard\": \"standard\",\n    \"test\": \"npm run unit && npm run standard\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"devDependencies\": {\n    \"@types/node\": \"12.0.10\",\n    \"standard\": \"^10.0.3\",\n    \"tape\": \"^4.5.1\",\n    \"typescript\": \"3.5.2\"\n  },\n  \"dependencies\": {\n    \"safe-buffer\": \"^5.0.1\"\n  }\n}\n'use strict'\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\n// @ts-ignore\nvar _Buffer = require('safe-buffer').Buffer\nfunction base (ALPHABET) {\n  if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n  var BASE_MAP = new Uint8Array(256)\n  for (var j = 0; j < BASE_MAP.length; j++) {\n    BASE_MAP[j] = 255\n  }\n  for (var i = 0; i < ALPHABET.length; i++) {\n    var x = ALPHABET.charAt(i)\n    var xc = x.charCodeAt(0)\n    if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n    BASE_MAP[xc] = i\n  }\n  var BASE = ALPHABET.length\n  var LEADER = ALPHABET.charAt(0)\n  var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n  var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n  function encode (source) {\n    if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer.from(source) }\n    if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') }\n    if (source.length === 0) { return '' }\n        // Skip & count leading zeroes.\n    var zeroes = 0\n    var length = 0\n    var pbegin = 0\n    var pend = source.length\n    while (pbegin !== pend && source[pbegin] === 0) {\n      pbegin++\n      zeroes++\n    }\n        // Allocate enough space in big-endian base58 representation.\n    var size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n    var b58 = new Uint8Array(size)\n        // Process the bytes.\n    while (pbegin !== pend) {\n      var carry = source[pbegin]\n            // Apply \"b58 = b58 * 256 + ch\".\n      var i = 0\n      for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n        carry += (256 * b58[it1]) >>> 0\n        b58[it1] = (carry % BASE) >>> 0\n        carry = (carry / BASE) >>> 0\n      }\n      if (carry !== 0) { throw new Error('Non-zero carry') }\n      length = i\n      pbegin++\n    }\n        // Skip leading zeroes in base58 result.\n    var it2 = size - length\n    while (it2 !== size && b58[it2] === 0) {\n      it2++\n    }\n        // Translate the result into a string.\n    var str = LEADER.repeat(zeroes)\n    for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }\n    return str\n  }\n  function decodeUnsafe (source) {\n    if (typeof source !== 'string') { throw new TypeError('Expected String') }\n    if (source.length === 0) { return _Buffer.alloc(0) }\n    var psz = 0\n        // Skip and count leading '1's.\n    var zeroes = 0\n    var length = 0\n    while (source[psz] === LEADER) {\n      zeroes++\n      psz++\n    }\n        // Allocate enough space in big-endian base256 representation.\n    var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n    var b256 = new Uint8Array(size)\n        // Process the characters.\n    while (psz < source.length) {\n            // Find code of next character\n      var charCode = source.charCodeAt(psz)\n            // Base map can not be indexed using char code\n      if (charCode > 255) { return }\n            // Decode character\n      var carry = BASE_MAP[charCode]\n            // Invalid character\n      if (carry === 255) { return }\n      var i = 0\n      for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n        carry += (BASE * b256[it3]) >>> 0\n        b256[it3] = (carry % 256) >>> 0\n        carry = (carry / 256) >>> 0\n      }\n      if (carry !== 0) { throw new Error('Non-zero carry') }\n      length = i\n      psz++\n    }\n        // Skip leading zeroes in b256.\n    var it4 = size - length\n    while (it4 !== size && b256[it4] === 0) {\n      it4++\n    }\n    var vch = _Buffer.allocUnsafe(zeroes + (size - it4))\n    vch.fill(0x00, 0, zeroes)\n    var j = zeroes\n    while (it4 !== size) {\n      vch[j++] = b256[it4++]\n    }\n    return vch\n  }\n  function decode (string) {\n    var buffer = decodeUnsafe(string)\n    if (buffer) { return buffer }\n    throw new Error('Non-base' + BASE + ' character')\n  }\n  return {\n    encode: encode,\n    decodeUnsafe: decodeUnsafe,\n    decode: decode\n  }\n}\nmodule.exports = base\nvar basex = require('base-x')\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n{\n  \"name\": \"bs58\",\n  \"version\": \"4.0.1\",\n  \"description\": \"Base 58 encoding / decoding\",\n  \"keywords\": [\n    \"base58\",\n    \"bitcoin\",\n    \"crypto\",\n    \"crytography\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\",\n    \"litecoin\"\n  ],\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"standard\": \"*\",\n    \"tape\": \"^4.6.3\"\n  },\n  \"repository\": {\n    \"url\": \"https://github.com/cryptocoinjs/bs58\",\n    \"type\": \"git\"\n  },\n  \"files\": [\n    \"./index.js\"\n  ],\n  \"main\": \"./index.js\",\n  \"scripts\": {\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run unit\",\n    \"unit\": \"tape test/index.js\"\n  },\n  \"dependencies\": {\n    \"base-x\": \"^3.0.2\"\n  }\n}\n'use strict'\n\nvar base58 = require('bs58')\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function (checksumFn) {\n  // Encode a buffer as a base58-check encoded string\n  function encode (payload) {\n    var checksum = checksumFn(payload)\n\n    return base58.encode(Buffer.concat([\n      payload,\n      checksum\n    ], payload.length + 4))\n  }\n\n  function decodeRaw (buffer) {\n    var payload = buffer.slice(0, -4)\n    var checksum = buffer.slice(-4)\n    var newChecksum = checksumFn(payload)\n\n    if (checksum[0] ^ newChecksum[0] |\n        checksum[1] ^ newChecksum[1] |\n        checksum[2] ^ newChecksum[2] |\n        checksum[3] ^ newChecksum[3]) return\n\n    return payload\n  }\n\n  // Decode a base58-check encoded string to a buffer, no result if checksum is wrong\n  function decodeUnsafe (string) {\n    var buffer = base58.decodeUnsafe(string)\n    if (!buffer) return\n\n    return decodeRaw(buffer)\n  }\n\n  function decode (string) {\n    var buffer = base58.decode(string)\n    var payload = decodeRaw(buffer, checksumFn)\n    if (!payload) throw new Error('Invalid checksum')\n    return payload\n  }\n\n  return {\n    encode: encode,\n    decode: decode,\n    decodeUnsafe: decodeUnsafe\n  }\n}\n'use strict'\n\nvar createHash = require('create-hash')\nvar bs58checkBase = require('./base')\n\n// SHA256(SHA256(buffer))\nfunction sha256x2 (buffer) {\n  var tmp = createHash('sha256').update(buffer).digest()\n  return createHash('sha256').update(tmp).digest()\n}\n\nmodule.exports = bs58checkBase(sha256x2)\n{\n  \"name\": \"bs58check\",\n  \"version\": \"2.1.2\",\n  \"description\": \"A straightforward implementation of base58-check encoding\",\n  \"keywords\": [\n    \"base\",\n    \"base58\",\n    \"base58check\",\n    \"bitcoin\",\n    \"bs58\",\n    \"check\",\n    \"checksum\",\n    \"decode\",\n    \"decoding\",\n    \"encode\",\n    \"encoding\",\n    \"litecoin\"\n  ],\n  \"homepage\": \"https://github.com/bitcoinjs/bs58check\",\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/bs58check/issues\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Daniel Cousens\",\n  \"files\": [\n    \"index.js\",\n    \"base.js\"\n  ],\n  \"main\": \"index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/bs58check.git\"\n  },\n  \"scripts\": {\n    \"coverage-report\": \"nyc report --reporter=lcov\",\n    \"coverage\": \"nyc --check-coverage --branches 90 --functions 90 npm run unit\",\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run coverage\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"dependencies\": {\n    \"bs58\": \"^4.0.0\",\n    \"create-hash\": \"^1.1.0\",\n    \"safe-buffer\": \"^5.1.2\"\n  },\n  \"devDependencies\": {\n    \"blake-hash\": \"^1.0.0\",\n    \"nyc\": \"^11.3.0\",\n    \"standard\": \"^10.0.3\",\n    \"tape\": \"^4.6.2\"\n  }\n}\n{\n  \"name\": \"wif\",\n  \"version\": \"2.0.6\",\n  \"description\": \"Bitcoin Wallet Import Format (WIF) decoding/encoding module\",\n  \"author\": \"Daniel Cousens\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/bitcoinjs/wif.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/bitcoinjs/wif/issues\"\n  },\n  \"homepage\": \"https://github.com/bitcoinjs/wif\",\n  \"keywords\": [\n    \"bitcoin\",\n    \"base58\",\n    \"base58check\",\n    \"decode\",\n    \"decoding\",\n    \"encoding\",\n    \"encode\",\n    \"key\",\n    \"private\",\n    \"wif\"\n  ],\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"coverage-report\": \"nyc report --reporter=lcov\",\n    \"coverage\": \"nyc --check-coverage --branches 90 --functions 90 npm run unit\",\n    \"standard\": \"standard\",\n    \"test\": \"npm run standard && npm run coverage\",\n    \"unit\": \"tape test/*.js\"\n  },\n  \"dependencies\": {\n    \"bs58check\": \"<3.0.0\"\n  },\n  \"devDependencies\": {\n    \"nyc\": \"^6.4.0\",\n    \"standard\": \"*\",\n    \"tape\": \"^4.6.2\"\n  }\n}\n'use strict';\n\nconst { EMPTY_BUFFER } = require('./constants');\n\nconst FastBuffer = Buffer[Symbol.species];\n\n/**\n * Merges an array of buffers into a new buffer.\n *\n * @param {Buffer[]} list The array of buffers to concat\n * @param {Number} totalLength The total length of buffers in the list\n * @return {Buffer} The resulting buffer\n * @public\n */\nfunction concat(list, totalLength) {\n  if (list.length === 0) return EMPTY_BUFFER;\n  if (list.length === 1) return list[0];\n\n  const target = Buffer.allocUnsafe(totalLength);\n  let offset = 0;\n\n  for (let i = 0; i < list.length; i++) {\n    const buf = list[i];\n    target.set(buf, offset);\n    offset += buf.length;\n  }\n\n  if (offset < totalLength) {\n    return new FastBuffer(target.buffer, target.byteOffset, offset);\n  }\n\n  return target;\n}\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nfunction _mask(source, mask, output, offset, length) {\n  for (let i = 0; i < length; i++) {\n    output[offset + i] = source[i] ^ mask[i & 3];\n  }\n}\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nfunction _unmask(buffer, mask) {\n  for (let i = 0; i < buffer.length; i++) {\n    buffer[i] ^= mask[i & 3];\n  }\n}\n\n/**\n * Converts a buffer to an `ArrayBuffer`.\n *\n * @param {Buffer} buf The buffer to convert\n * @return {ArrayBuffer} Converted buffer\n * @public\n */\nfunction toArrayBuffer(buf) {\n  if (buf.length === buf.buffer.byteLength) {\n    return buf.buffer;\n  }\n\n  return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length);\n}\n\n/**\n * Converts `data` to a `Buffer`.\n *\n * @param {*} data The data to convert\n * @return {Buffer} The buffer\n * @throws {TypeError}\n * @public\n */\nfunction toBuffer(data) {\n  toBuffer.readOnly = true;\n\n  if (Buffer.isBuffer(data)) return data;\n\n  let buf;\n\n  if (data instanceof ArrayBuffer) {\n    buf = new FastBuffer(data);\n  } else if (ArrayBuffer.isView(data)) {\n    buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength);\n  } else {\n    buf = Buffer.from(data);\n    toBuffer.readOnly = false;\n  }\n\n  return buf;\n}\n\nmodule.exports = {\n  concat,\n  mask: _mask,\n  toArrayBuffer,\n  toBuffer,\n  unmask: _unmask\n};\n\n/* istanbul ignore else  */\nif (!process.env.WS_NO_BUFFER_UTIL) {\n  try {\n    const bufferUtil = require('bufferutil');\n\n    module.exports.mask = function (source, mask, output, offset, length) {\n      if (length < 48) _mask(source, mask, output, offset, length);\n      else bufferUtil.mask(source, mask, output, offset, length);\n    };\n\n    module.exports.unmask = function (buffer, mask) {\n      if (buffer.length < 32) _unmask(buffer, mask);\n      else bufferUtil.unmask(buffer, mask);\n    };\n  } catch (e) {\n    // Continue regardless of the error.\n  }\n}\n'use strict';\n\nmodule.exports = {\n  BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],\n  EMPTY_BUFFER: Buffer.alloc(0),\n  GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',\n  kForOnEventAttribute: Symbol('kIsForOnEventAttribute'),\n  kListener: Symbol('kListener'),\n  kStatusCode: Symbol('status-code'),\n  kWebSocket: Symbol('websocket'),\n  NOOP: () => {}\n};\n'use strict';\n\nconst { kForOnEventAttribute, kListener } = require('./constants');\n\nconst kCode = Symbol('kCode');\nconst kData = Symbol('kData');\nconst kError = Symbol('kError');\nconst kMessage = Symbol('kMessage');\nconst kReason = Symbol('kReason');\nconst kTarget = Symbol('kTarget');\nconst kType = Symbol('kType');\nconst kWasClean = Symbol('kWasClean');\n\n/**\n * Class representing an event.\n */\nclass Event {\n  /**\n   * Create a new `Event`.\n   *\n   * @param {String} type The name of the event\n   * @throws {TypeError} If the `type` argument is not specified\n   */\n  constructor(type) {\n    this[kTarget] = null;\n    this[kType] = type;\n  }\n\n  /**\n   * @type {*}\n   */\n  get target() {\n    return this[kTarget];\n  }\n\n  /**\n   * @type {String}\n   */\n  get type() {\n    return this[kType];\n  }\n}\n\nObject.defineProperty(Event.prototype, 'target', { enumerable: true });\nObject.defineProperty(Event.prototype, 'type', { enumerable: true });\n\n/**\n * Class representing a close event.\n *\n * @extends Event\n */\nclass CloseEvent extends Event {\n  /**\n   * Create a new `CloseEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {Number} [options.code=0] The status code explaining why the\n   *     connection was closed\n   * @param {String} [options.reason=''] A human-readable string explaining why\n   *     the connection was closed\n   * @param {Boolean} [options.wasClean=false] Indicates whether or not the\n   *     connection was cleanly closed\n   */\n  constructor(type, options = {}) {\n    super(type);\n\n    this[kCode] = options.code === undefined ? 0 : options.code;\n    this[kReason] = options.reason === undefined ? '' : options.reason;\n    this[kWasClean] = options.wasClean === undefined ? false : options.wasClean;\n  }\n\n  /**\n   * @type {Number}\n   */\n  get code() {\n    return this[kCode];\n  }\n\n  /**\n   * @type {String}\n   */\n  get reason() {\n    return this[kReason];\n  }\n\n  /**\n   * @type {Boolean}\n   */\n  get wasClean() {\n    return this[kWasClean];\n  }\n}\n\nObject.defineProperty(CloseEvent.prototype, 'code', { enumerable: true });\nObject.defineProperty(CloseEvent.prototype, 'reason', { enumerable: true });\nObject.defineProperty(CloseEvent.prototype, 'wasClean', { enumerable: true });\n\n/**\n * Class representing an error event.\n *\n * @extends Event\n */\nclass ErrorEvent extends Event {\n  /**\n   * Create a new `ErrorEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {*} [options.error=null] The error that generated this event\n   * @param {String} [options.message=''] The error message\n   */\n  constructor(type, options = {}) {\n    super(type);\n\n    this[kError] = options.error === undefined ? null : options.error;\n    this[kMessage] = options.message === undefined ? '' : options.message;\n  }\n\n  /**\n   * @type {*}\n   */\n  get error() {\n    return this[kError];\n  }\n\n  /**\n   * @type {String}\n   */\n  get message() {\n    return this[kMessage];\n  }\n}\n\nObject.defineProperty(ErrorEvent.prototype, 'error', { enumerable: true });\nObject.defineProperty(ErrorEvent.prototype, 'message', { enumerable: true });\n\n/**\n * Class representing a message event.\n *\n * @extends Event\n */\nclass MessageEvent extends Event {\n  /**\n   * Create a new `MessageEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {*} [options.data=null] The message content\n   */\n  constructor(type, options = {}) {\n    super(type);\n\n    this[kData] = options.data === undefined ? null : options.data;\n  }\n\n  /**\n   * @type {*}\n   */\n  get data() {\n    return this[kData];\n  }\n}\n\nObject.defineProperty(MessageEvent.prototype, 'data', { enumerable: true });\n\n/**\n * This provides methods for emulating the `EventTarget` interface. It's not\n * meant to be used directly.\n *\n * @mixin\n */\nconst EventTarget = {\n  /**\n   * Register an event listener.\n   *\n   * @param {String} type A string representing the event type to listen for\n   * @param {(Function|Object)} handler The listener to add\n   * @param {Object} [options] An options object specifies characteristics about\n   *     the event listener\n   * @param {Boolean} [options.once=false] A `Boolean` indicating that the\n   *     listener should be invoked at most once after being added. If `true`,\n   *     the listener would be automatically removed when invoked.\n   * @public\n   */\n  addEventListener(type, handler, options = {}) {\n    for (const listener of this.listeners(type)) {\n      if (\n        !options[kForOnEventAttribute] &&\n        listener[kListener] === handler &&\n        !listener[kForOnEventAttribute]\n      ) {\n        return;\n      }\n    }\n\n    let wrapper;\n\n    if (type === 'message') {\n      wrapper = function onMessage(data, isBinary) {\n        const event = new MessageEvent('message', {\n          data: isBinary ? data : data.toString()\n        });\n\n        event[kTarget] = this;\n        callListener(handler, this, event);\n      };\n    } else if (type === 'close') {\n      wrapper = function onClose(code, message) {\n        const event = new CloseEvent('close', {\n          code,\n          reason: message.toString(),\n          wasClean: this._closeFrameReceived && this._closeFrameSent\n        });\n\n        event[kTarget] = this;\n        callListener(handler, this, event);\n      };\n    } else if (type === 'error') {\n      wrapper = function onError(error) {\n        const event = new ErrorEvent('error', {\n          error,\n          message: error.message\n        });\n\n        event[kTarget] = this;\n        callListener(handler, this, event);\n      };\n    } else if (type === 'open') {\n      wrapper = function onOpen() {\n        const event = new Event('open');\n\n        event[kTarget] = this;\n        callListener(handler, this, event);\n      };\n    } else {\n      return;\n    }\n\n    wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];\n    wrapper[kListener] = handler;\n\n    if (options.once) {\n      this.once(type, wrapper);\n    } else {\n      this.on(type, wrapper);\n    }\n  },\n\n  /**\n   * Remove an event listener.\n   *\n   * @param {String} type A string representing the event type to remove\n   * @param {(Function|Object)} handler The listener to remove\n   * @public\n   */\n  removeEventListener(type, handler) {\n    for (const listener of this.listeners(type)) {\n      if (listener[kListener] === handler && !listener[kForOnEventAttribute]) {\n        this.removeListener(type, listener);\n        break;\n      }\n    }\n  }\n};\n\nmodule.exports = {\n  CloseEvent,\n  ErrorEvent,\n  Event,\n  EventTarget,\n  MessageEvent\n};\n\n/**\n * Call an event listener\n *\n * @param {(Function|Object)} listener The listener to call\n * @param {*} thisArg The value to use as `this`` when calling the listener\n * @param {Event} event The event to pass to the listener\n * @private\n */\nfunction callListener(listener, thisArg, event) {\n  if (typeof listener === 'object' && listener.handleEvent) {\n    listener.handleEvent.call(listener, event);\n  } else {\n    listener.call(thisArg, event);\n  }\n}\n'use strict';\n\nconst { tokenChars } = require('./validation');\n\n/**\n * Adds an offer to the map of extension offers or a parameter to the map of\n * parameters.\n *\n * @param {Object} dest The map of extension offers or parameters\n * @param {String} name The extension or parameter name\n * @param {(Object|Boolean|String)} elem The extension parameters or the\n *     parameter value\n * @private\n */\nfunction push(dest, name, elem) {\n  if (dest[name] === undefined) dest[name] = [elem];\n  else dest[name].push(elem);\n}\n\n/**\n * Parses the `Sec-WebSocket-Extensions` header into an object.\n *\n * @param {String} header The field value of the header\n * @return {Object} The parsed object\n * @public\n */\nfunction parse(header) {\n  const offers = Object.create(null);\n  let params = Object.create(null);\n  let mustUnescape = false;\n  let isEscaping = false;\n  let inQuotes = false;\n  let extensionName;\n  let paramName;\n  let start = -1;\n  let code = -1;\n  let end = -1;\n  let i = 0;\n\n  for (; i < header.length; i++) {\n    code = header.charCodeAt(i);\n\n    if (extensionName === undefined) {\n      if (end === -1 && tokenChars[code] === 1) {\n        if (start === -1) start = i;\n      } else if (\n        i !== 0 &&\n        (code === 0x20 /* ' ' */ || code === 0x09) /* '\\t' */\n      ) {\n        if (end === -1 && start !== -1) end = i;\n      } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {\n        if (start === -1) {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n\n        if (end === -1) end = i;\n        const name = header.slice(start, end);\n        if (code === 0x2c) {\n          push(offers, name, params);\n          params = Object.create(null);\n        } else {\n          extensionName = name;\n        }\n\n        start = end = -1;\n      } else {\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      }\n    } else if (paramName === undefined) {\n      if (end === -1 && tokenChars[code] === 1) {\n        if (start === -1) start = i;\n      } else if (code === 0x20 || code === 0x09) {\n        if (end === -1 && start !== -1) end = i;\n      } else if (code === 0x3b || code === 0x2c) {\n        if (start === -1) {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n\n        if (end === -1) end = i;\n        push(params, header.slice(start, end), true);\n        if (code === 0x2c) {\n          push(offers, extensionName, params);\n          params = Object.create(null);\n          extensionName = undefined;\n        }\n\n        start = end = -1;\n      } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {\n        paramName = header.slice(start, i);\n        start = end = -1;\n      } else {\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      }\n    } else {\n      //\n      // The value of a quoted-string after unescaping must conform to the\n      // token ABNF, so only token characters are valid.\n      // Ref: https://tools.ietf.org/html/rfc6455#section-9.1\n      //\n      if (isEscaping) {\n        if (tokenChars[code] !== 1) {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n        if (start === -1) start = i;\n        else if (!mustUnescape) mustUnescape = true;\n        isEscaping = false;\n      } else if (inQuotes) {\n        if (tokenChars[code] === 1) {\n          if (start === -1) start = i;\n        } else if (code === 0x22 /* '\"' */ && start !== -1) {\n          inQuotes = false;\n          end = i;\n        } else if (code === 0x5c /* '\\' */) {\n          isEscaping = true;\n        } else {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n      } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {\n        inQuotes = true;\n      } else if (end === -1 && tokenChars[code] === 1) {\n        if (start === -1) start = i;\n      } else if (start !== -1 && (code === 0x20 || code === 0x09)) {\n        if (end === -1) end = i;\n      } else if (code === 0x3b || code === 0x2c) {\n        if (start === -1) {\n          throw new SyntaxError(`Unexpected character at index ${i}`);\n        }\n\n        if (end === -1) end = i;\n        let value = header.slice(start, end);\n        if (mustUnescape) {\n          value = value.replace(/\\\\/g, '');\n          mustUnescape = false;\n        }\n        push(params, paramName, value);\n        if (code === 0x2c) {\n          push(offers, extensionName, params);\n          params = Object.create(null);\n          extensionName = undefined;\n        }\n\n        paramName = undefined;\n        start = end = -1;\n      } else {\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      }\n    }\n  }\n\n  if (start === -1 || inQuotes || code === 0x20 || code === 0x09) {\n    throw new SyntaxError('Unexpected end of input');\n  }\n\n  if (end === -1) end = i;\n  const token = header.slice(start, end);\n  if (extensionName === undefined) {\n    push(offers, token, params);\n  } else {\n    if (paramName === undefined) {\n      push(params, token, true);\n    } else if (mustUnescape) {\n      push(params, paramName, token.replace(/\\\\/g, ''));\n    } else {\n      push(params, paramName, token);\n    }\n    push(offers, extensionName, params);\n  }\n\n  return offers;\n}\n\n/**\n * Builds the `Sec-WebSocket-Extensions` header field value.\n *\n * @param {Object} extensions The map of extensions and parameters to format\n * @return {String} A string representing the given object\n * @public\n */\nfunction format(extensions) {\n  return Object.keys(extensions)\n    .map((extension) => {\n      let configurations = extensions[extension];\n      if (!Array.isArray(configurations)) configurations = [configurations];\n      return configurations\n        .map((params) => {\n          return [extension]\n            .concat(\n              Object.keys(params).map((k) => {\n                let values = params[k];\n                if (!Array.isArray(values)) values = [values];\n                return values\n                  .map((v) => (v === true ? k : `${k}=${v}`))\n                  .join('; ');\n              })\n            )\n            .join('; ');\n        })\n        .join(', ');\n    })\n    .join(', ');\n}\n\nmodule.exports = { format, parse };\n'use strict';\n\nconst kDone = Symbol('kDone');\nconst kRun = Symbol('kRun');\n\n/**\n * A very simple job queue with adjustable concurrency. Adapted from\n * https://github.com/STRML/async-limiter\n */\nclass Limiter {\n  /**\n   * Creates a new `Limiter`.\n   *\n   * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed\n   *     to run concurrently\n   */\n  constructor(concurrency) {\n    this[kDone] = () => {\n      this.pending--;\n      this[kRun]();\n    };\n    this.concurrency = concurrency || Infinity;\n    this.jobs = [];\n    this.pending = 0;\n  }\n\n  /**\n   * Adds a job to the queue.\n   *\n   * @param {Function} job The job to run\n   * @public\n   */\n  add(job) {\n    this.jobs.push(job);\n    this[kRun]();\n  }\n\n  /**\n   * Removes a job from the queue and runs it if possible.\n   *\n   * @private\n   */\n  [kRun]() {\n    if (this.pending === this.concurrency) return;\n\n    if (this.jobs.length) {\n      const job = this.jobs.shift();\n\n      this.pending++;\n      job(this[kDone]);\n    }\n  }\n}\n\nmodule.exports = Limiter;\n'use strict';\n\nconst zlib = require('zlib');\n\nconst bufferUtil = require('./buffer-util');\nconst Limiter = require('./limiter');\nconst { kStatusCode } = require('./constants');\n\nconst FastBuffer = Buffer[Symbol.species];\nconst TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);\nconst kPerMessageDeflate = Symbol('permessage-deflate');\nconst kTotalLength = Symbol('total-length');\nconst kCallback = Symbol('callback');\nconst kBuffers = Symbol('buffers');\nconst kError = Symbol('error');\n\n//\n// We limit zlib concurrency, which prevents severe memory fragmentation\n// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913\n// and https://github.com/websockets/ws/issues/1202\n//\n// Intentionally global; it's the global thread pool that's an issue.\n//\nlet zlibLimiter;\n\n/**\n * permessage-deflate implementation.\n */\nclass PerMessageDeflate {\n  /**\n   * Creates a PerMessageDeflate instance.\n   *\n   * @param {Object} [options] Configuration options\n   * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support\n   *     for, or request, a custom client window size\n   * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/\n   *     acknowledge disabling of client context takeover\n   * @param {Number} [options.concurrencyLimit=10] The number of concurrent\n   *     calls to zlib\n   * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the\n   *     use of a custom server window size\n   * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept\n   *     disabling of server context takeover\n   * @param {Number} [options.threshold=1024] Size (in bytes) below which\n   *     messages should not be compressed if context takeover is disabled\n   * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on\n   *     deflate\n   * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on\n   *     inflate\n   * @param {Boolean} [isServer=false] Create the instance in either server or\n   *     client mode\n   * @param {Number} [maxPayload=0] The maximum allowed message length\n   */\n  constructor(options, isServer, maxPayload) {\n    this._maxPayload = maxPayload | 0;\n    this._options = options || {};\n    this._threshold =\n      this._options.threshold !== undefined ? this._options.threshold : 1024;\n    this._isServer = !!isServer;\n    this._deflate = null;\n    this._inflate = null;\n\n    this.params = null;\n\n    if (!zlibLimiter) {\n      const concurrency =\n        this._options.concurrencyLimit !== undefined\n          ? this._options.concurrencyLimit\n          : 10;\n      zlibLimiter = new Limiter(concurrency);\n    }\n  }\n\n  /**\n   * @type {String}\n   */\n  static get extensionName() {\n    return 'permessage-deflate';\n  }\n\n  /**\n   * Create an extension negotiation offer.\n   *\n   * @return {Object} Extension parameters\n   * @public\n   */\n  offer() {\n    const params = {};\n\n    if (this._options.serverNoContextTakeover) {\n      params.server_no_context_takeover = true;\n    }\n    if (this._options.clientNoContextTakeover) {\n      params.client_no_context_takeover = true;\n    }\n    if (this._options.serverMaxWindowBits) {\n      params.server_max_window_bits = this._options.serverMaxWindowBits;\n    }\n    if (this._options.clientMaxWindowBits) {\n      params.client_max_window_bits = this._options.clientMaxWindowBits;\n    } else if (this._options.clientMaxWindowBits == null) {\n      params.client_max_window_bits = true;\n    }\n\n    return params;\n  }\n\n  /**\n   * Accept an extension negotiation offer/response.\n   *\n   * @param {Array} configurations The extension negotiation offers/reponse\n   * @return {Object} Accepted configuration\n   * @public\n   */\n  accept(configurations) {\n    configurations = this.normalizeParams(configurations);\n\n    this.params = this._isServer\n      ? this.acceptAsServer(configurations)\n      : this.acceptAsClient(configurations);\n\n    return this.params;\n  }\n\n  /**\n   * Releases all resources used by the extension.\n   *\n   * @public\n   */\n  cleanup() {\n    if (this._inflate) {\n      this._inflate.close();\n      this._inflate = null;\n    }\n\n    if (this._deflate) {\n      const callback = this._deflate[kCallback];\n\n      this._deflate.close();\n      this._deflate = null;\n\n      if (callback) {\n        callback(\n          new Error(\n            'The deflate stream was closed while data was being processed'\n          )\n        );\n      }\n    }\n  }\n\n  /**\n   *  Accept an extension negotiation offer.\n   *\n   * @param {Array} offers The extension negotiation offers\n   * @return {Object} Accepted configuration\n   * @private\n   */\n  acceptAsServer(offers) {\n    const opts = this._options;\n    const accepted = offers.find((params) => {\n      if (\n        (opts.serverNoContextTakeover === false &&\n          params.server_no_context_takeover) ||\n        (params.server_max_window_bits &&\n          (opts.serverMaxWindowBits === false ||\n            (typeof opts.serverMaxWindowBits === 'number' &&\n              opts.serverMaxWindowBits > params.server_max_window_bits))) ||\n        (typeof opts.clientMaxWindowBits === 'number' &&\n          !params.client_max_window_bits)\n      ) {\n        return false;\n      }\n\n      return true;\n    });\n\n    if (!accepted) {\n      throw new Error('None of the extension offers can be accepted');\n    }\n\n    if (opts.serverNoContextTakeover) {\n      accepted.server_no_context_takeover = true;\n    }\n    if (opts.clientNoContextTakeover) {\n      accepted.client_no_context_takeover = true;\n    }\n    if (typeof opts.serverMaxWindowBits === 'number') {\n      accepted.server_max_window_bits = opts.serverMaxWindowBits;\n    }\n    if (typeof opts.clientMaxWindowBits === 'number') {\n      accepted.client_max_window_bits = opts.clientMaxWindowBits;\n    } else if (\n      accepted.client_max_window_bits === true ||\n      opts.clientMaxWindowBits === false\n    ) {\n      delete accepted.client_max_window_bits;\n    }\n\n    return accepted;\n  }\n\n  /**\n   * Accept the extension negotiation response.\n   *\n   * @param {Array} response The extension negotiation response\n   * @return {Object} Accepted configuration\n   * @private\n   */\n  acceptAsClient(response) {\n    const params = response[0];\n\n    if (\n      this._options.clientNoContextTakeover === false &&\n      params.client_no_context_takeover\n    ) {\n      throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n    }\n\n    if (!params.client_max_window_bits) {\n      if (typeof this._options.clientMaxWindowBits === 'number') {\n        params.client_max_window_bits = this._options.clientMaxWindowBits;\n      }\n    } else if (\n      this._options.clientMaxWindowBits === false ||\n      (typeof this._options.clientMaxWindowBits === 'number' &&\n        params.client_max_window_bits > this._options.clientMaxWindowBits)\n    ) {\n      throw new Error(\n        'Unexpected or invalid parameter \"client_max_window_bits\"'\n      );\n    }\n\n    return params;\n  }\n\n  /**\n   * Normalize parameters.\n   *\n   * @param {Array} configurations The extension negotiation offers/reponse\n   * @return {Array} The offers/response with normalized parameters\n   * @private\n   */\n  normalizeParams(configurations) {\n    configurations.forEach((params) => {\n      Object.keys(params).forEach((key) => {\n        let value = params[key];\n\n        if (value.length > 1) {\n          throw new Error(`Parameter \"${key}\" must have only a single value`);\n        }\n\n        value = value[0];\n\n        if (key === 'client_max_window_bits') {\n          if (value !== true) {\n            const num = +value;\n            if (!Number.isInteger(num) || num < 8 || num > 15) {\n              throw new TypeError(\n                `Invalid value for parameter \"${key}\": ${value}`\n              );\n            }\n            value = num;\n          } else if (!this._isServer) {\n            throw new TypeError(\n              `Invalid value for parameter \"${key}\": ${value}`\n            );\n          }\n        } else if (key === 'server_max_window_bits') {\n          const num = +value;\n          if (!Number.isInteger(num) || num < 8 || num > 15) {\n            throw new TypeError(\n              `Invalid value for parameter \"${key}\": ${value}`\n            );\n          }\n          value = num;\n        } else if (\n          key === 'client_no_context_takeover' ||\n          key === 'server_no_context_takeover'\n        ) {\n          if (value !== true) {\n            throw new TypeError(\n              `Invalid value for parameter \"${key}\": ${value}`\n            );\n          }\n        } else {\n          throw new Error(`Unknown parameter \"${key}\"`);\n        }\n\n        params[key] = value;\n      });\n    });\n\n    return configurations;\n  }\n\n  /**\n   * Decompress data. Concurrency limited.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @public\n   */\n  decompress(data, fin, callback) {\n    zlibLimiter.add((done) => {\n      this._decompress(data, fin, (err, result) => {\n        done();\n        callback(err, result);\n      });\n    });\n  }\n\n  /**\n   * Compress data. Concurrency limited.\n   *\n   * @param {(Buffer|String)} data Data to compress\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @public\n   */\n  compress(data, fin, callback) {\n    zlibLimiter.add((done) => {\n      this._compress(data, fin, (err, result) => {\n        done();\n        callback(err, result);\n      });\n    });\n  }\n\n  /**\n   * Decompress data.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @private\n   */\n  _decompress(data, fin, callback) {\n    const endpoint = this._isServer ? 'client' : 'server';\n\n    if (!this._inflate) {\n      const key = `${endpoint}_max_window_bits`;\n      const windowBits =\n        typeof this.params[key] !== 'number'\n          ? zlib.Z_DEFAULT_WINDOWBITS\n          : this.params[key];\n\n      this._inflate = zlib.createInflateRaw({\n        ...this._options.zlibInflateOptions,\n        windowBits\n      });\n      this._inflate[kPerMessageDeflate] = this;\n      this._inflate[kTotalLength] = 0;\n      this._inflate[kBuffers] = [];\n      this._inflate.on('error', inflateOnError);\n      this._inflate.on('data', inflateOnData);\n    }\n\n    this._inflate[kCallback] = callback;\n\n    this._inflate.write(data);\n    if (fin) this._inflate.write(TRAILER);\n\n    this._inflate.flush(() => {\n      const err = this._inflate[kError];\n\n      if (err) {\n        this._inflate.close();\n        this._inflate = null;\n        callback(err);\n        return;\n      }\n\n      const data = bufferUtil.concat(\n        this._inflate[kBuffers],\n        this._inflate[kTotalLength]\n      );\n\n      if (this._inflate._readableState.endEmitted) {\n        this._inflate.close();\n        this._inflate = null;\n      } else {\n        this._inflate[kTotalLength] = 0;\n        this._inflate[kBuffers] = [];\n\n        if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n          this._inflate.reset();\n        }\n      }\n\n      callback(null, data);\n    });\n  }\n\n  /**\n   * Compress data.\n   *\n   * @param {(Buffer|String)} data Data to compress\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @private\n   */\n  _compress(data, fin, callback) {\n    const endpoint = this._isServer ? 'server' : 'client';\n\n    if (!this._deflate) {\n      const key = `${endpoint}_max_window_bits`;\n      const windowBits =\n        typeof this.params[key] !== 'number'\n          ? zlib.Z_DEFAULT_WINDOWBITS\n          : this.params[key];\n\n      this._deflate = zlib.createDeflateRaw({\n        ...this._options.zlibDeflateOptions,\n        windowBits\n      });\n\n      this._deflate[kTotalLength] = 0;\n      this._deflate[kBuffers] = [];\n\n      this._deflate.on('data', deflateOnData);\n    }\n\n    this._deflate[kCallback] = callback;\n\n    this._deflate.write(data);\n    this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {\n      if (!this._deflate) {\n        //\n        // The deflate stream was closed while data was being processed.\n        //\n        return;\n      }\n\n      let data = bufferUtil.concat(\n        this._deflate[kBuffers],\n        this._deflate[kTotalLength]\n      );\n\n      if (fin) {\n        data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);\n      }\n\n      //\n      // Ensure that the callback will not be called again in\n      // `PerMessageDeflate#cleanup()`.\n      //\n      this._deflate[kCallback] = null;\n\n      this._deflate[kTotalLength] = 0;\n      this._deflate[kBuffers] = [];\n\n      if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n        this._deflate.reset();\n      }\n\n      callback(null, data);\n    });\n  }\n}\n\nmodule.exports = PerMessageDeflate;\n\n/**\n * The listener of the `zlib.DeflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction deflateOnData(chunk) {\n  this[kBuffers].push(chunk);\n  this[kTotalLength] += chunk.length;\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction inflateOnData(chunk) {\n  this[kTotalLength] += chunk.length;\n\n  if (\n    this[kPerMessageDeflate]._maxPayload < 1 ||\n    this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload\n  ) {\n    this[kBuffers].push(chunk);\n    return;\n  }\n\n  this[kError] = new RangeError('Max payload size exceeded');\n  this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';\n  this[kError][kStatusCode] = 1009;\n  this.removeListener('data', inflateOnData);\n  this.reset();\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'error'` event.\n *\n * @param {Error} err The emitted error\n * @private\n */\nfunction inflateOnError(err) {\n  //\n  // There is no need to call `Zlib#close()` as the handle is automatically\n  // closed when an error is emitted.\n  //\n  this[kPerMessageDeflate]._inflate = null;\n  err[kStatusCode] = 1007;\n  this[kCallback](err);\n}\n'use strict';\n\nconst { Writable } = require('stream');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst {\n  BINARY_TYPES,\n  EMPTY_BUFFER,\n  kStatusCode,\n  kWebSocket\n} = require('./constants');\nconst { concat, toArrayBuffer, unmask } = require('./buffer-util');\nconst { isValidStatusCode, isValidUTF8 } = require('./validation');\n\nconst FastBuffer = Buffer[Symbol.species];\n\nconst GET_INFO = 0;\nconst GET_PAYLOAD_LENGTH_16 = 1;\nconst GET_PAYLOAD_LENGTH_64 = 2;\nconst GET_MASK = 3;\nconst GET_DATA = 4;\nconst INFLATING = 5;\nconst DEFER_EVENT = 6;\n\n/**\n * HyBi Receiver implementation.\n *\n * @extends Writable\n */\nclass Receiver extends Writable {\n  /**\n   * Creates a Receiver instance.\n   *\n   * @param {Object} [options] Options object\n   * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether\n   *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted\n   *     multiple times in the same tick\n   * @param {String} [options.binaryType=nodebuffer] The type for binary data\n   * @param {Object} [options.extensions] An object containing the negotiated\n   *     extensions\n   * @param {Boolean} [options.isServer=false] Specifies whether to operate in\n   *     client or server mode\n   * @param {Number} [options.maxPayload=0] The maximum allowed message length\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   */\n  constructor(options = {}) {\n    super();\n\n    this._allowSynchronousEvents =\n      options.allowSynchronousEvents !== undefined\n        ? options.allowSynchronousEvents\n        : true;\n    this._binaryType = options.binaryType || BINARY_TYPES[0];\n    this._extensions = options.extensions || {};\n    this._isServer = !!options.isServer;\n    this._maxPayload = options.maxPayload | 0;\n    this._skipUTF8Validation = !!options.skipUTF8Validation;\n    this[kWebSocket] = undefined;\n\n    this._bufferedBytes = 0;\n    this._buffers = [];\n\n    this._compressed = false;\n    this._payloadLength = 0;\n    this._mask = undefined;\n    this._fragmented = 0;\n    this._masked = false;\n    this._fin = false;\n    this._opcode = 0;\n\n    this._totalPayloadLength = 0;\n    this._messageLength = 0;\n    this._fragments = [];\n\n    this._errored = false;\n    this._loop = false;\n    this._state = GET_INFO;\n  }\n\n  /**\n   * Implements `Writable.prototype._write()`.\n   *\n   * @param {Buffer} chunk The chunk of data to write\n   * @param {String} encoding The character encoding of `chunk`\n   * @param {Function} cb Callback\n   * @private\n   */\n  _write(chunk, encoding, cb) {\n    if (this._opcode === 0x08 && this._state == GET_INFO) return cb();\n\n    this._bufferedBytes += chunk.length;\n    this._buffers.push(chunk);\n    this.startLoop(cb);\n  }\n\n  /**\n   * Consumes `n` bytes from the buffered data.\n   *\n   * @param {Number} n The number of bytes to consume\n   * @return {Buffer} The consumed bytes\n   * @private\n   */\n  consume(n) {\n    this._bufferedBytes -= n;\n\n    if (n === this._buffers[0].length) return this._buffers.shift();\n\n    if (n < this._buffers[0].length) {\n      const buf = this._buffers[0];\n      this._buffers[0] = new FastBuffer(\n        buf.buffer,\n        buf.byteOffset + n,\n        buf.length - n\n      );\n\n      return new FastBuffer(buf.buffer, buf.byteOffset, n);\n    }\n\n    const dst = Buffer.allocUnsafe(n);\n\n    do {\n      const buf = this._buffers[0];\n      const offset = dst.length - n;\n\n      if (n >= buf.length) {\n        dst.set(this._buffers.shift(), offset);\n      } else {\n        dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);\n        this._buffers[0] = new FastBuffer(\n          buf.buffer,\n          buf.byteOffset + n,\n          buf.length - n\n        );\n      }\n\n      n -= buf.length;\n    } while (n > 0);\n\n    return dst;\n  }\n\n  /**\n   * Starts the parsing loop.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  startLoop(cb) {\n    this._loop = true;\n\n    do {\n      switch (this._state) {\n        case GET_INFO:\n          this.getInfo(cb);\n          break;\n        case GET_PAYLOAD_LENGTH_16:\n          this.getPayloadLength16(cb);\n          break;\n        case GET_PAYLOAD_LENGTH_64:\n          this.getPayloadLength64(cb);\n          break;\n        case GET_MASK:\n          this.getMask();\n          break;\n        case GET_DATA:\n          this.getData(cb);\n          break;\n        case INFLATING:\n        case DEFER_EVENT:\n          this._loop = false;\n          return;\n      }\n    } while (this._loop);\n\n    if (!this._errored) cb();\n  }\n\n  /**\n   * Reads the first two bytes of a frame.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  getInfo(cb) {\n    if (this._bufferedBytes < 2) {\n      this._loop = false;\n      return;\n    }\n\n    const buf = this.consume(2);\n\n    if ((buf[0] & 0x30) !== 0x00) {\n      const error = this.createError(\n        RangeError,\n        'RSV2 and RSV3 must be clear',\n        true,\n        1002,\n        'WS_ERR_UNEXPECTED_RSV_2_3'\n      );\n\n      cb(error);\n      return;\n    }\n\n    const compressed = (buf[0] & 0x40) === 0x40;\n\n    if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n      const error = this.createError(\n        RangeError,\n        'RSV1 must be clear',\n        true,\n        1002,\n        'WS_ERR_UNEXPECTED_RSV_1'\n      );\n\n      cb(error);\n      return;\n    }\n\n    this._fin = (buf[0] & 0x80) === 0x80;\n    this._opcode = buf[0] & 0x0f;\n    this._payloadLength = buf[1] & 0x7f;\n\n    if (this._opcode === 0x00) {\n      if (compressed) {\n        const error = this.createError(\n          RangeError,\n          'RSV1 must be clear',\n          true,\n          1002,\n          'WS_ERR_UNEXPECTED_RSV_1'\n        );\n\n        cb(error);\n        return;\n      }\n\n      if (!this._fragmented) {\n        const error = this.createError(\n          RangeError,\n          'invalid opcode 0',\n          true,\n          1002,\n          'WS_ERR_INVALID_OPCODE'\n        );\n\n        cb(error);\n        return;\n      }\n\n      this._opcode = this._fragmented;\n    } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n      if (this._fragmented) {\n        const error = this.createError(\n          RangeError,\n          `invalid opcode ${this._opcode}`,\n          true,\n          1002,\n          'WS_ERR_INVALID_OPCODE'\n        );\n\n        cb(error);\n        return;\n      }\n\n      this._compressed = compressed;\n    } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n      if (!this._fin) {\n        const error = this.createError(\n          RangeError,\n          'FIN must be set',\n          true,\n          1002,\n          'WS_ERR_EXPECTED_FIN'\n        );\n\n        cb(error);\n        return;\n      }\n\n      if (compressed) {\n        const error = this.createError(\n          RangeError,\n          'RSV1 must be clear',\n          true,\n          1002,\n          'WS_ERR_UNEXPECTED_RSV_1'\n        );\n\n        cb(error);\n        return;\n      }\n\n      if (\n        this._payloadLength > 0x7d ||\n        (this._opcode === 0x08 && this._payloadLength === 1)\n      ) {\n        const error = this.createError(\n          RangeError,\n          `invalid payload length ${this._payloadLength}`,\n          true,\n          1002,\n          'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'\n        );\n\n        cb(error);\n        return;\n      }\n    } else {\n      const error = this.createError(\n        RangeError,\n        `invalid opcode ${this._opcode}`,\n        true,\n        1002,\n        'WS_ERR_INVALID_OPCODE'\n      );\n\n      cb(error);\n      return;\n    }\n\n    if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n    this._masked = (buf[1] & 0x80) === 0x80;\n\n    if (this._isServer) {\n      if (!this._masked) {\n        const error = this.createError(\n          RangeError,\n          'MASK must be set',\n          true,\n          1002,\n          'WS_ERR_EXPECTED_MASK'\n        );\n\n        cb(error);\n        return;\n      }\n    } else if (this._masked) {\n      const error = this.createError(\n        RangeError,\n        'MASK must be clear',\n        true,\n        1002,\n        'WS_ERR_UNEXPECTED_MASK'\n      );\n\n      cb(error);\n      return;\n    }\n\n    if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n    else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n    else this.haveLength(cb);\n  }\n\n  /**\n   * Gets extended payload length (7+16).\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  getPayloadLength16(cb) {\n    if (this._bufferedBytes < 2) {\n      this._loop = false;\n      return;\n    }\n\n    this._payloadLength = this.consume(2).readUInt16BE(0);\n    this.haveLength(cb);\n  }\n\n  /**\n   * Gets extended payload length (7+64).\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  getPayloadLength64(cb) {\n    if (this._bufferedBytes < 8) {\n      this._loop = false;\n      return;\n    }\n\n    const buf = this.consume(8);\n    const num = buf.readUInt32BE(0);\n\n    //\n    // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n    // if payload length is greater than this number.\n    //\n    if (num > Math.pow(2, 53 - 32) - 1) {\n      const error = this.createError(\n        RangeError,\n        'Unsupported WebSocket frame: payload length > 2^53 - 1',\n        false,\n        1009,\n        'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'\n      );\n\n      cb(error);\n      return;\n    }\n\n    this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);\n    this.haveLength(cb);\n  }\n\n  /**\n   * Payload length has been read.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  haveLength(cb) {\n    if (this._payloadLength && this._opcode < 0x08) {\n      this._totalPayloadLength += this._payloadLength;\n      if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {\n        const error = this.createError(\n          RangeError,\n          'Max payload size exceeded',\n          false,\n          1009,\n          'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n        );\n\n        cb(error);\n        return;\n      }\n    }\n\n    if (this._masked) this._state = GET_MASK;\n    else this._state = GET_DATA;\n  }\n\n  /**\n   * Reads mask bytes.\n   *\n   * @private\n   */\n  getMask() {\n    if (this._bufferedBytes < 4) {\n      this._loop = false;\n      return;\n    }\n\n    this._mask = this.consume(4);\n    this._state = GET_DATA;\n  }\n\n  /**\n   * Reads data bytes.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  getData(cb) {\n    let data = EMPTY_BUFFER;\n\n    if (this._payloadLength) {\n      if (this._bufferedBytes < this._payloadLength) {\n        this._loop = false;\n        return;\n      }\n\n      data = this.consume(this._payloadLength);\n\n      if (\n        this._masked &&\n        (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0\n      ) {\n        unmask(data, this._mask);\n      }\n    }\n\n    if (this._opcode > 0x07) {\n      this.controlMessage(data, cb);\n      return;\n    }\n\n    if (this._compressed) {\n      this._state = INFLATING;\n      this.decompress(data, cb);\n      return;\n    }\n\n    if (data.length) {\n      //\n      // This message is not compressed so its length is the sum of the payload\n      // length of all fragments.\n      //\n      this._messageLength = this._totalPayloadLength;\n      this._fragments.push(data);\n    }\n\n    this.dataMessage(cb);\n  }\n\n  /**\n   * Decompresses data.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Function} cb Callback\n   * @private\n   */\n  decompress(data, cb) {\n    const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n    perMessageDeflate.decompress(data, this._fin, (err, buf) => {\n      if (err) return cb(err);\n\n      if (buf.length) {\n        this._messageLength += buf.length;\n        if (this._messageLength > this._maxPayload && this._maxPayload > 0) {\n          const error = this.createError(\n            RangeError,\n            'Max payload size exceeded',\n            false,\n            1009,\n            'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n          );\n\n          cb(error);\n          return;\n        }\n\n        this._fragments.push(buf);\n      }\n\n      this.dataMessage(cb);\n      if (this._state === GET_INFO) this.startLoop(cb);\n    });\n  }\n\n  /**\n   * Handles a data message.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  dataMessage(cb) {\n    if (!this._fin) {\n      this._state = GET_INFO;\n      return;\n    }\n\n    const messageLength = this._messageLength;\n    const fragments = this._fragments;\n\n    this._totalPayloadLength = 0;\n    this._messageLength = 0;\n    this._fragmented = 0;\n    this._fragments = [];\n\n    if (this._opcode === 2) {\n      let data;\n\n      if (this._binaryType === 'nodebuffer') {\n        data = concat(fragments, messageLength);\n      } else if (this._binaryType === 'arraybuffer') {\n        data = toArrayBuffer(concat(fragments, messageLength));\n      } else {\n        data = fragments;\n      }\n\n      if (this._allowSynchronousEvents) {\n        this.emit('message', data, true);\n        this._state = GET_INFO;\n      } else {\n        this._state = DEFER_EVENT;\n        setImmediate(() => {\n          this.emit('message', data, true);\n          this._state = GET_INFO;\n          this.startLoop(cb);\n        });\n      }\n    } else {\n      const buf = concat(fragments, messageLength);\n\n      if (!this._skipUTF8Validation && !isValidUTF8(buf)) {\n        const error = this.createError(\n          Error,\n          'invalid UTF-8 sequence',\n          true,\n          1007,\n          'WS_ERR_INVALID_UTF8'\n        );\n\n        cb(error);\n        return;\n      }\n\n      if (this._state === INFLATING || this._allowSynchronousEvents) {\n        this.emit('message', buf, false);\n        this._state = GET_INFO;\n      } else {\n        this._state = DEFER_EVENT;\n        setImmediate(() => {\n          this.emit('message', buf, false);\n          this._state = GET_INFO;\n          this.startLoop(cb);\n        });\n      }\n    }\n  }\n\n  /**\n   * Handles a control message.\n   *\n   * @param {Buffer} data Data to handle\n   * @return {(Error|RangeError|undefined)} A possible error\n   * @private\n   */\n  controlMessage(data, cb) {\n    if (this._opcode === 0x08) {\n      if (data.length === 0) {\n        this._loop = false;\n        this.emit('conclude', 1005, EMPTY_BUFFER);\n        this.end();\n      } else {\n        const code = data.readUInt16BE(0);\n\n        if (!isValidStatusCode(code)) {\n          const error = this.createError(\n            RangeError,\n            `invalid status code ${code}`,\n            true,\n            1002,\n            'WS_ERR_INVALID_CLOSE_CODE'\n          );\n\n          cb(error);\n          return;\n        }\n\n        const buf = new FastBuffer(\n          data.buffer,\n          data.byteOffset + 2,\n          data.length - 2\n        );\n\n        if (!this._skipUTF8Validation && !isValidUTF8(buf)) {\n          const error = this.createError(\n            Error,\n            'invalid UTF-8 sequence',\n            true,\n            1007,\n            'WS_ERR_INVALID_UTF8'\n          );\n\n          cb(error);\n          return;\n        }\n\n        this._loop = false;\n        this.emit('conclude', code, buf);\n        this.end();\n      }\n\n      this._state = GET_INFO;\n      return;\n    }\n\n    if (this._allowSynchronousEvents) {\n      this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);\n      this._state = GET_INFO;\n    } else {\n      this._state = DEFER_EVENT;\n      setImmediate(() => {\n        this.emit(this._opcode === 0x09 ? 'ping' : 'pong', data);\n        this._state = GET_INFO;\n        this.startLoop(cb);\n      });\n    }\n  }\n\n  /**\n   * Builds an error object.\n   *\n   * @param {function(new:Error|RangeError)} ErrorCtor The error constructor\n   * @param {String} message The error message\n   * @param {Boolean} prefix Specifies whether or not to add a default prefix to\n   *     `message`\n   * @param {Number} statusCode The status code\n   * @param {String} errorCode The exposed error code\n   * @return {(Error|RangeError)} The error\n   * @private\n   */\n  createError(ErrorCtor, message, prefix, statusCode, errorCode) {\n    this._loop = false;\n    this._errored = true;\n\n    const err = new ErrorCtor(\n      prefix ? `Invalid WebSocket frame: ${message}` : message\n    );\n\n    Error.captureStackTrace(err, this.createError);\n    err.code = errorCode;\n    err[kStatusCode] = statusCode;\n    return err;\n  }\n}\n\nmodule.exports = Receiver;\n/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Duplex\" }] */\n\n'use strict';\n\nconst { Duplex } = require('stream');\nconst { randomFillSync } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst { EMPTY_BUFFER } = require('./constants');\nconst { isValidStatusCode } = require('./validation');\nconst { mask: applyMask, toBuffer } = require('./buffer-util');\n\nconst kByteLength = Symbol('kByteLength');\nconst maskBuffer = Buffer.alloc(4);\nconst RANDOM_POOL_SIZE = 8 * 1024;\nlet randomPool;\nlet randomPoolPointer = RANDOM_POOL_SIZE;\n\n/**\n * HyBi Sender implementation.\n */\nclass Sender {\n  /**\n   * Creates a Sender instance.\n   *\n   * @param {Duplex} socket The connection socket\n   * @param {Object} [extensions] An object containing the negotiated extensions\n   * @param {Function} [generateMask] The function used to generate the masking\n   *     key\n   */\n  constructor(socket, extensions, generateMask) {\n    this._extensions = extensions || {};\n\n    if (generateMask) {\n      this._generateMask = generateMask;\n      this._maskBuffer = Buffer.alloc(4);\n    }\n\n    this._socket = socket;\n\n    this._firstFragment = true;\n    this._compress = false;\n\n    this._bufferedBytes = 0;\n    this._deflating = false;\n    this._queue = [];\n  }\n\n  /**\n   * Frames a piece of data according to the HyBi WebSocket protocol.\n   *\n   * @param {(Buffer|String)} data The data to frame\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @return {(Buffer|String)[]} The framed data\n   * @public\n   */\n  static frame(data, options) {\n    let mask;\n    let merge = false;\n    let offset = 2;\n    let skipMasking = false;\n\n    if (options.mask) {\n      mask = options.maskBuffer || maskBuffer;\n\n      if (options.generateMask) {\n        options.generateMask(mask);\n      } else {\n        if (randomPoolPointer === RANDOM_POOL_SIZE) {\n          /* istanbul ignore else  */\n          if (randomPool === undefined) {\n            //\n            // This is lazily initialized because server-sent frames must not\n            // be masked so it may never be used.\n            //\n            randomPool = Buffer.alloc(RANDOM_POOL_SIZE);\n          }\n\n          randomFillSync(randomPool, 0, RANDOM_POOL_SIZE);\n          randomPoolPointer = 0;\n        }\n\n        mask[0] = randomPool[randomPoolPointer++];\n        mask[1] = randomPool[randomPoolPointer++];\n        mask[2] = randomPool[randomPoolPointer++];\n        mask[3] = randomPool[randomPoolPointer++];\n      }\n\n      skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0;\n      offset = 6;\n    }\n\n    let dataLength;\n\n    if (typeof data === 'string') {\n      if (\n        (!options.mask || skipMasking) &&\n        options[kByteLength] !== undefined\n      ) {\n        dataLength = options[kByteLength];\n      } else {\n        data = Buffer.from(data);\n        dataLength = data.length;\n      }\n    } else {\n      dataLength = data.length;\n      merge = options.mask && options.readOnly && !skipMasking;\n    }\n\n    let payloadLength = dataLength;\n\n    if (dataLength >= 65536) {\n      offset += 8;\n      payloadLength = 127;\n    } else if (dataLength > 125) {\n      offset += 2;\n      payloadLength = 126;\n    }\n\n    const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);\n\n    target[0] = options.fin ? options.opcode | 0x80 : options.opcode;\n    if (options.rsv1) target[0] |= 0x40;\n\n    target[1] = payloadLength;\n\n    if (payloadLength === 126) {\n      target.writeUInt16BE(dataLength, 2);\n    } else if (payloadLength === 127) {\n      target[2] = target[3] = 0;\n      target.writeUIntBE(dataLength, 4, 6);\n    }\n\n    if (!options.mask) return [target, data];\n\n    target[1] |= 0x80;\n    target[offset - 4] = mask[0];\n    target[offset - 3] = mask[1];\n    target[offset - 2] = mask[2];\n    target[offset - 1] = mask[3];\n\n    if (skipMasking) return [target, data];\n\n    if (merge) {\n      applyMask(data, mask, target, offset, dataLength);\n      return [target];\n    }\n\n    applyMask(data, mask, data, 0, dataLength);\n    return [target, data];\n  }\n\n  /**\n   * Sends a close message to the other peer.\n   *\n   * @param {Number} [code] The status code component of the body\n   * @param {(String|Buffer)} [data] The message component of the body\n   * @param {Boolean} [mask=false] Specifies whether or not to mask the message\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  close(code, data, mask, cb) {\n    let buf;\n\n    if (code === undefined) {\n      buf = EMPTY_BUFFER;\n    } else if (typeof code !== 'number' || !isValidStatusCode(code)) {\n      throw new TypeError('First argument must be a valid error code number');\n    } else if (data === undefined || !data.length) {\n      buf = Buffer.allocUnsafe(2);\n      buf.writeUInt16BE(code, 0);\n    } else {\n      const length = Buffer.byteLength(data);\n\n      if (length > 123) {\n        throw new RangeError('The message must not be greater than 123 bytes');\n      }\n\n      buf = Buffer.allocUnsafe(2 + length);\n      buf.writeUInt16BE(code, 0);\n\n      if (typeof data === 'string') {\n        buf.write(data, 2);\n      } else {\n        buf.set(data, 2);\n      }\n    }\n\n    const options = {\n      [kByteLength]: buf.length,\n      fin: true,\n      generateMask: this._generateMask,\n      mask,\n      maskBuffer: this._maskBuffer,\n      opcode: 0x08,\n      readOnly: false,\n      rsv1: false\n    };\n\n    if (this._deflating) {\n      this.enqueue([this.dispatch, buf, false, options, cb]);\n    } else {\n      this.sendFrame(Sender.frame(buf, options), cb);\n    }\n  }\n\n  /**\n   * Sends a ping message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  ping(data, mask, cb) {\n    let byteLength;\n    let readOnly;\n\n    if (typeof data === 'string') {\n      byteLength = Buffer.byteLength(data);\n      readOnly = false;\n    } else {\n      data = toBuffer(data);\n      byteLength = data.length;\n      readOnly = toBuffer.readOnly;\n    }\n\n    if (byteLength > 125) {\n      throw new RangeError('The data size must not be greater than 125 bytes');\n    }\n\n    const options = {\n      [kByteLength]: byteLength,\n      fin: true,\n      generateMask: this._generateMask,\n      mask,\n      maskBuffer: this._maskBuffer,\n      opcode: 0x09,\n      readOnly,\n      rsv1: false\n    };\n\n    if (this._deflating) {\n      this.enqueue([this.dispatch, data, false, options, cb]);\n    } else {\n      this.sendFrame(Sender.frame(data, options), cb);\n    }\n  }\n\n  /**\n   * Sends a pong message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  pong(data, mask, cb) {\n    let byteLength;\n    let readOnly;\n\n    if (typeof data === 'string') {\n      byteLength = Buffer.byteLength(data);\n      readOnly = false;\n    } else {\n      data = toBuffer(data);\n      byteLength = data.length;\n      readOnly = toBuffer.readOnly;\n    }\n\n    if (byteLength > 125) {\n      throw new RangeError('The data size must not be greater than 125 bytes');\n    }\n\n    const options = {\n      [kByteLength]: byteLength,\n      fin: true,\n      generateMask: this._generateMask,\n      mask,\n      maskBuffer: this._maskBuffer,\n      opcode: 0x0a,\n      readOnly,\n      rsv1: false\n    };\n\n    if (this._deflating) {\n      this.enqueue([this.dispatch, data, false, options, cb]);\n    } else {\n      this.sendFrame(Sender.frame(data, options), cb);\n    }\n  }\n\n  /**\n   * Sends a data message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Object} options Options object\n   * @param {Boolean} [options.binary=false] Specifies whether `data` is binary\n   *     or text\n   * @param {Boolean} [options.compress=false] Specifies whether or not to\n   *     compress `data`\n   * @param {Boolean} [options.fin=false] Specifies whether the fragment is the\n   *     last one\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  send(data, options, cb) {\n    const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n    let opcode = options.binary ? 2 : 1;\n    let rsv1 = options.compress;\n\n    let byteLength;\n    let readOnly;\n\n    if (typeof data === 'string') {\n      byteLength = Buffer.byteLength(data);\n      readOnly = false;\n    } else {\n      data = toBuffer(data);\n      byteLength = data.length;\n      readOnly = toBuffer.readOnly;\n    }\n\n    if (this._firstFragment) {\n      this._firstFragment = false;\n      if (\n        rsv1 &&\n        perMessageDeflate &&\n        perMessageDeflate.params[\n          perMessageDeflate._isServer\n            ? 'server_no_context_takeover'\n            : 'client_no_context_takeover'\n        ]\n      ) {\n        rsv1 = byteLength >= perMessageDeflate._threshold;\n      }\n      this._compress = rsv1;\n    } else {\n      rsv1 = false;\n      opcode = 0;\n    }\n\n    if (options.fin) this._firstFragment = true;\n\n    if (perMessageDeflate) {\n      const opts = {\n        [kByteLength]: byteLength,\n        fin: options.fin,\n        generateMask: this._generateMask,\n        mask: options.mask,\n        maskBuffer: this._maskBuffer,\n        opcode,\n        readOnly,\n        rsv1\n      };\n\n      if (this._deflating) {\n        this.enqueue([this.dispatch, data, this._compress, opts, cb]);\n      } else {\n        this.dispatch(data, this._compress, opts, cb);\n      }\n    } else {\n      this.sendFrame(\n        Sender.frame(data, {\n          [kByteLength]: byteLength,\n          fin: options.fin,\n          generateMask: this._generateMask,\n          mask: options.mask,\n          maskBuffer: this._maskBuffer,\n          opcode,\n          readOnly,\n          rsv1: false\n        }),\n        cb\n      );\n    }\n  }\n\n  /**\n   * Dispatches a message.\n   *\n   * @param {(Buffer|String)} data The message to send\n   * @param {Boolean} [compress=false] Specifies whether or not to compress\n   *     `data`\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  dispatch(data, compress, options, cb) {\n    if (!compress) {\n      this.sendFrame(Sender.frame(data, options), cb);\n      return;\n    }\n\n    const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n    this._bufferedBytes += options[kByteLength];\n    this._deflating = true;\n    perMessageDeflate.compress(data, options.fin, (_, buf) => {\n      if (this._socket.destroyed) {\n        const err = new Error(\n          'The socket was closed while data was being compressed'\n        );\n\n        if (typeof cb === 'function') cb(err);\n\n        for (let i = 0; i < this._queue.length; i++) {\n          const params = this._queue[i];\n          const callback = params[params.length - 1];\n\n          if (typeof callback === 'function') callback(err);\n        }\n\n        return;\n      }\n\n      this._bufferedBytes -= options[kByteLength];\n      this._deflating = false;\n      options.readOnly = false;\n      this.sendFrame(Sender.frame(buf, options), cb);\n      this.dequeue();\n    });\n  }\n\n  /**\n   * Executes queued send operations.\n   *\n   * @private\n   */\n  dequeue() {\n    while (!this._deflating && this._queue.length) {\n      const params = this._queue.shift();\n\n      this._bufferedBytes -= params[3][kByteLength];\n      Reflect.apply(params[0], this, params.slice(1));\n    }\n  }\n\n  /**\n   * Enqueues a send operation.\n   *\n   * @param {Array} params Send operation parameters.\n   * @private\n   */\n  enqueue(params) {\n    this._bufferedBytes += params[3][kByteLength];\n    this._queue.push(params);\n  }\n\n  /**\n   * Sends a frame.\n   *\n   * @param {Buffer[]} list The frame to send\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  sendFrame(list, cb) {\n    if (list.length === 2) {\n      this._socket.cork();\n      this._socket.write(list[0]);\n      this._socket.write(list[1], cb);\n      this._socket.uncork();\n    } else {\n      this._socket.write(list[0], cb);\n    }\n  }\n}\n\nmodule.exports = Sender;\n'use strict';\n\nconst { Duplex } = require('stream');\n\n/**\n * Emits the `'close'` event on a stream.\n *\n * @param {Duplex} stream The stream.\n * @private\n */\nfunction emitClose(stream) {\n  stream.emit('close');\n}\n\n/**\n * The listener of the `'end'` event.\n *\n * @private\n */\nfunction duplexOnEnd() {\n  if (!this.destroyed && this._writableState.finished) {\n    this.destroy();\n  }\n}\n\n/**\n * The listener of the `'error'` event.\n *\n * @param {Error} err The error\n * @private\n */\nfunction duplexOnError(err) {\n  this.removeListener('error', duplexOnError);\n  this.destroy();\n  if (this.listenerCount('error') === 0) {\n    // Do not suppress the throwing behavior.\n    this.emit('error', err);\n  }\n}\n\n/**\n * Wraps a `WebSocket` in a duplex stream.\n *\n * @param {WebSocket} ws The `WebSocket` to wrap\n * @param {Object} [options] The options for the `Duplex` constructor\n * @return {Duplex} The duplex stream\n * @public\n */\nfunction createWebSocketStream(ws, options) {\n  let terminateOnDestroy = true;\n\n  const duplex = new Duplex({\n    ...options,\n    autoDestroy: false,\n    emitClose: false,\n    objectMode: false,\n    writableObjectMode: false\n  });\n\n  ws.on('message', function message(msg, isBinary) {\n    const data =\n      !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;\n\n    if (!duplex.push(data)) ws.pause();\n  });\n\n  ws.once('error', function error(err) {\n    if (duplex.destroyed) return;\n\n    // Prevent `ws.terminate()` from being called by `duplex._destroy()`.\n    //\n    // - If the `'error'` event is emitted before the `'open'` event, then\n    //   `ws.terminate()` is a noop as no socket is assigned.\n    // - Otherwise, the error is re-emitted by the listener of the `'error'`\n    //   event of the `Receiver` object. The listener already closes the\n    //   connection by calling `ws.close()`. This allows a close frame to be\n    //   sent to the other peer. If `ws.terminate()` is called right after this,\n    //   then the close frame might not be sent.\n    terminateOnDestroy = false;\n    duplex.destroy(err);\n  });\n\n  ws.once('close', function close() {\n    if (duplex.destroyed) return;\n\n    duplex.push(null);\n  });\n\n  duplex._destroy = function (err, callback) {\n    if (ws.readyState === ws.CLOSED) {\n      callback(err);\n      process.nextTick(emitClose, duplex);\n      return;\n    }\n\n    let called = false;\n\n    ws.once('error', function error(err) {\n      called = true;\n      callback(err);\n    });\n\n    ws.once('close', function close() {\n      if (!called) callback(err);\n      process.nextTick(emitClose, duplex);\n    });\n\n    if (terminateOnDestroy) ws.terminate();\n  };\n\n  duplex._final = function (callback) {\n    if (ws.readyState === ws.CONNECTING) {\n      ws.once('open', function open() {\n        duplex._final(callback);\n      });\n      return;\n    }\n\n    // If the value of the `_socket` property is `null` it means that `ws` is a\n    // client websocket and the handshake failed. In fact, when this happens, a\n    // socket is never assigned to the websocket. Wait for the `'error'` event\n    // that will be emitted by the websocket.\n    if (ws._socket === null) return;\n\n    if (ws._socket._writableState.finished) {\n      callback();\n      if (duplex._readableState.endEmitted) duplex.destroy();\n    } else {\n      ws._socket.once('finish', function finish() {\n        // `duplex` is not destroyed here because the `'end'` event will be\n        // emitted on `duplex` after this `'finish'` event. The EOF signaling\n        // `null` chunk is, in fact, pushed when the websocket emits `'close'`.\n        callback();\n      });\n      ws.close();\n    }\n  };\n\n  duplex._read = function () {\n    if (ws.isPaused) ws.resume();\n  };\n\n  duplex._write = function (chunk, encoding, callback) {\n    if (ws.readyState === ws.CONNECTING) {\n      ws.once('open', function open() {\n        duplex._write(chunk, encoding, callback);\n      });\n      return;\n    }\n\n    ws.send(chunk, callback);\n  };\n\n  duplex.on('end', duplexOnEnd);\n  duplex.on('error', duplexOnError);\n  return duplex;\n}\n\nmodule.exports = createWebSocketStream;\n'use strict';\n\nconst { tokenChars } = require('./validation');\n\n/**\n * Parses the `Sec-WebSocket-Protocol` header into a set of subprotocol names.\n *\n * @param {String} header The field value of the header\n * @return {Set} The subprotocol names\n * @public\n */\nfunction parse(header) {\n  const protocols = new Set();\n  let start = -1;\n  let end = -1;\n  let i = 0;\n\n  for (i; i < header.length; i++) {\n    const code = header.charCodeAt(i);\n\n    if (end === -1 && tokenChars[code] === 1) {\n      if (start === -1) start = i;\n    } else if (\n      i !== 0 &&\n      (code === 0x20 /* ' ' */ || code === 0x09) /* '\\t' */\n    ) {\n      if (end === -1 && start !== -1) end = i;\n    } else if (code === 0x2c /* ',' */) {\n      if (start === -1) {\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      }\n\n      if (end === -1) end = i;\n\n      const protocol = header.slice(start, end);\n\n      if (protocols.has(protocol)) {\n        throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n      }\n\n      protocols.add(protocol);\n      start = end = -1;\n    } else {\n      throw new SyntaxError(`Unexpected character at index ${i}`);\n    }\n  }\n\n  if (start === -1 || end !== -1) {\n    throw new SyntaxError('Unexpected end of input');\n  }\n\n  const protocol = header.slice(start, i);\n\n  if (protocols.has(protocol)) {\n    throw new SyntaxError(`The \"${protocol}\" subprotocol is duplicated`);\n  }\n\n  protocols.add(protocol);\n  return protocols;\n}\n\nmodule.exports = { parse };\n'use strict';\n\nconst { isUtf8 } = require('buffer');\n\n//\n// Allowed token characters:\n//\n// '!', '#', '$', '%', '&', ''', '*', '+', '-',\n// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'\n//\n// tokenChars[32] === 0 // ' '\n// tokenChars[33] === 1 // '!'\n// tokenChars[34] === 0 // '\"'\n// ...\n//\n// prettier-ignore\nconst tokenChars = [\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31\n  0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63\n  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127\n];\n\n/**\n * Checks if a status code is allowed in a close frame.\n *\n * @param {Number} code The status code\n * @return {Boolean} `true` if the status code is valid, else `false`\n * @public\n */\nfunction isValidStatusCode(code) {\n  return (\n    (code >= 1000 &&\n      code <= 1014 &&\n      code !== 1004 &&\n      code !== 1005 &&\n      code !== 1006) ||\n    (code >= 3000 && code <= 4999)\n  );\n}\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction _isValidUTF8(buf) {\n  const len = buf.length;\n  let i = 0;\n\n  while (i < len) {\n    if ((buf[i] & 0x80) === 0) {\n      // 0xxxxxxx\n      i++;\n    } else if ((buf[i] & 0xe0) === 0xc0) {\n      // 110xxxxx 10xxxxxx\n      if (\n        i + 1 === len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i] & 0xfe) === 0xc0 // Overlong\n      ) {\n        return false;\n      }\n\n      i += 2;\n    } else if ((buf[i] & 0xf0) === 0xe0) {\n      // 1110xxxx 10xxxxxx 10xxxxxx\n      if (\n        i + 2 >= len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i + 2] & 0xc0) !== 0x80 ||\n        (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong\n        (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)\n      ) {\n        return false;\n      }\n\n      i += 3;\n    } else if ((buf[i] & 0xf8) === 0xf0) {\n      // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n      if (\n        i + 3 >= len ||\n        (buf[i + 1] & 0xc0) !== 0x80 ||\n        (buf[i + 2] & 0xc0) !== 0x80 ||\n        (buf[i + 3] & 0xc0) !== 0x80 ||\n        (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong\n        (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||\n        buf[i] > 0xf4 // > U+10FFFF\n      ) {\n        return false;\n      }\n\n      i += 4;\n    } else {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nmodule.exports = {\n  isValidStatusCode,\n  isValidUTF8: _isValidUTF8,\n  tokenChars\n};\n\nif (isUtf8) {\n  module.exports.isValidUTF8 = function (buf) {\n    return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);\n  };\n} /* istanbul ignore else  */ else if (!process.env.WS_NO_UTF_8_VALIDATE) {\n  try {\n    const isValidUTF8 = require('utf-8-validate');\n\n    module.exports.isValidUTF8 = function (buf) {\n      return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);\n    };\n  } catch (e) {\n    // Continue regardless of the error.\n  }\n}\n/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Duplex$\", \"caughtErrors\": \"none\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst http = require('http');\nconst { Duplex } = require('stream');\nconst { createHash } = require('crypto');\n\nconst extension = require('./extension');\nconst PerMessageDeflate = require('./permessage-deflate');\nconst subprotocol = require('./subprotocol');\nconst WebSocket = require('./websocket');\nconst { GUID, kWebSocket } = require('./constants');\n\nconst keyRegex = /^[+/0-9A-Za-z]{22}==$/;\n\nconst RUNNING = 0;\nconst CLOSING = 1;\nconst CLOSED = 2;\n\n/**\n * Class representing a WebSocket server.\n *\n * @extends EventEmitter\n */\nclass WebSocketServer extends EventEmitter {\n  /**\n   * Create a `WebSocketServer` instance.\n   *\n   * @param {Object} options Configuration options\n   * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether\n   *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted\n   *     multiple times in the same tick\n   * @param {Boolean} [options.autoPong=true] Specifies whether or not to\n   *     automatically send a pong in response to a ping\n   * @param {Number} [options.backlog=511] The maximum length of the queue of\n   *     pending connections\n   * @param {Boolean} [options.clientTracking=true] Specifies whether or not to\n   *     track clients\n   * @param {Function} [options.handleProtocols] A hook to handle protocols\n   * @param {String} [options.host] The hostname where to bind the server\n   * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n   *     size\n   * @param {Boolean} [options.noServer=false] Enable no server mode\n   * @param {String} [options.path] Accept only connections matching this path\n   * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable\n   *     permessage-deflate\n   * @param {Number} [options.port] The port where to bind the server\n   * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S\n   *     server to use\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   * @param {Function} [options.verifyClient] A hook to reject connections\n   * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`\n   *     class to use. It must be the `WebSocket` class or class that extends it\n   * @param {Function} [callback] A listener for the `listening` event\n   */\n  constructor(options, callback) {\n    super();\n\n    options = {\n      allowSynchronousEvents: true,\n      autoPong: true,\n      maxPayload: 100 * 1024 * 1024,\n      skipUTF8Validation: false,\n      perMessageDeflate: false,\n      handleProtocols: null,\n      clientTracking: true,\n      verifyClient: null,\n      noServer: false,\n      backlog: null, // use default (511 as implemented in net.js)\n      server: null,\n      host: null,\n      path: null,\n      port: null,\n      WebSocket,\n      ...options\n    };\n\n    if (\n      (options.port == null && !options.server && !options.noServer) ||\n      (options.port != null && (options.server || options.noServer)) ||\n      (options.server && options.noServer)\n    ) {\n      throw new TypeError(\n        'One and only one of the \"port\", \"server\", or \"noServer\" options ' +\n          'must be specified'\n      );\n    }\n\n    if (options.port != null) {\n      this._server = http.createServer((req, res) => {\n        const body = http.STATUS_CODES[426];\n\n        res.writeHead(426, {\n          'Content-Length': body.length,\n          'Content-Type': 'text/plain'\n        });\n        res.end(body);\n      });\n      this._server.listen(\n        options.port,\n        options.host,\n        options.backlog,\n        callback\n      );\n    } else if (options.server) {\n      this._server = options.server;\n    }\n\n    if (this._server) {\n      const emitConnection = this.emit.bind(this, 'connection');\n\n      this._removeListeners = addListeners(this._server, {\n        listening: this.emit.bind(this, 'listening'),\n        error: this.emit.bind(this, 'error'),\n        upgrade: (req, socket, head) => {\n          this.handleUpgrade(req, socket, head, emitConnection);\n        }\n      });\n    }\n\n    if (options.perMessageDeflate === true) options.perMessageDeflate = {};\n    if (options.clientTracking) {\n      this.clients = new Set();\n      this._shouldEmitClose = false;\n    }\n\n    this.options = options;\n    this._state = RUNNING;\n  }\n\n  /**\n   * Returns the bound address, the address family name, and port of the server\n   * as reported by the operating system if listening on an IP socket.\n   * If the server is listening on a pipe or UNIX domain socket, the name is\n   * returned as a string.\n   *\n   * @return {(Object|String|null)} The address of the server\n   * @public\n   */\n  address() {\n    if (this.options.noServer) {\n      throw new Error('The server is operating in \"noServer\" mode');\n    }\n\n    if (!this._server) return null;\n    return this._server.address();\n  }\n\n  /**\n   * Stop the server from accepting new connections and emit the `'close'` event\n   * when all existing connections are closed.\n   *\n   * @param {Function} [cb] A one-time listener for the `'close'` event\n   * @public\n   */\n  close(cb) {\n    if (this._state === CLOSED) {\n      if (cb) {\n        this.once('close', () => {\n          cb(new Error('The server is not running'));\n        });\n      }\n\n      process.nextTick(emitClose, this);\n      return;\n    }\n\n    if (cb) this.once('close', cb);\n\n    if (this._state === CLOSING) return;\n    this._state = CLOSING;\n\n    if (this.options.noServer || this.options.server) {\n      if (this._server) {\n        this._removeListeners();\n        this._removeListeners = this._server = null;\n      }\n\n      if (this.clients) {\n        if (!this.clients.size) {\n          process.nextTick(emitClose, this);\n        } else {\n          this._shouldEmitClose = true;\n        }\n      } else {\n        process.nextTick(emitClose, this);\n      }\n    } else {\n      const server = this._server;\n\n      this._removeListeners();\n      this._removeListeners = this._server = null;\n\n      //\n      // The HTTP/S server was created internally. Close it, and rely on its\n      // `'close'` event.\n      //\n      server.close(() => {\n        emitClose(this);\n      });\n    }\n  }\n\n  /**\n   * See if a given request should be handled by this server instance.\n   *\n   * @param {http.IncomingMessage} req Request object to inspect\n   * @return {Boolean} `true` if the request is valid, else `false`\n   * @public\n   */\n  shouldHandle(req) {\n    if (this.options.path) {\n      const index = req.url.indexOf('?');\n      const pathname = index !== -1 ? req.url.slice(0, index) : req.url;\n\n      if (pathname !== this.options.path) return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Handle a HTTP Upgrade request.\n   *\n   * @param {http.IncomingMessage} req The request object\n   * @param {Duplex} socket The network socket between the server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Function} cb Callback\n   * @public\n   */\n  handleUpgrade(req, socket, head, cb) {\n    socket.on('error', socketOnError);\n\n    const key = req.headers['sec-websocket-key'];\n    const upgrade = req.headers.upgrade;\n    const version = +req.headers['sec-websocket-version'];\n\n    if (req.method !== 'GET') {\n      const message = 'Invalid HTTP method';\n      abortHandshakeOrEmitwsClientError(this, req, socket, 405, message);\n      return;\n    }\n\n    if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') {\n      const message = 'Invalid Upgrade header';\n      abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n      return;\n    }\n\n    if (key === undefined || !keyRegex.test(key)) {\n      const message = 'Missing or invalid Sec-WebSocket-Key header';\n      abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n      return;\n    }\n\n    if (version !== 8 && version !== 13) {\n      const message = 'Missing or invalid Sec-WebSocket-Version header';\n      abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n      return;\n    }\n\n    if (!this.shouldHandle(req)) {\n      abortHandshake(socket, 400);\n      return;\n    }\n\n    const secWebSocketProtocol = req.headers['sec-websocket-protocol'];\n    let protocols = new Set();\n\n    if (secWebSocketProtocol !== undefined) {\n      try {\n        protocols = subprotocol.parse(secWebSocketProtocol);\n      } catch (err) {\n        const message = 'Invalid Sec-WebSocket-Protocol header';\n        abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n        return;\n      }\n    }\n\n    const secWebSocketExtensions = req.headers['sec-websocket-extensions'];\n    const extensions = {};\n\n    if (\n      this.options.perMessageDeflate &&\n      secWebSocketExtensions !== undefined\n    ) {\n      const perMessageDeflate = new PerMessageDeflate(\n        this.options.perMessageDeflate,\n        true,\n        this.options.maxPayload\n      );\n\n      try {\n        const offers = extension.parse(secWebSocketExtensions);\n\n        if (offers[PerMessageDeflate.extensionName]) {\n          perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);\n          extensions[PerMessageDeflate.extensionName] = perMessageDeflate;\n        }\n      } catch (err) {\n        const message =\n          'Invalid or unacceptable Sec-WebSocket-Extensions header';\n        abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);\n        return;\n      }\n    }\n\n    //\n    // Optionally call external client verification handler.\n    //\n    if (this.options.verifyClient) {\n      const info = {\n        origin:\n          req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],\n        secure: !!(req.socket.authorized || req.socket.encrypted),\n        req\n      };\n\n      if (this.options.verifyClient.length === 2) {\n        this.options.verifyClient(info, (verified, code, message, headers) => {\n          if (!verified) {\n            return abortHandshake(socket, code || 401, message, headers);\n          }\n\n          this.completeUpgrade(\n            extensions,\n            key,\n            protocols,\n            req,\n            socket,\n            head,\n            cb\n          );\n        });\n        return;\n      }\n\n      if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);\n    }\n\n    this.completeUpgrade(extensions, key, protocols, req, socket, head, cb);\n  }\n\n  /**\n   * Upgrade the connection to WebSocket.\n   *\n   * @param {Object} extensions The accepted extensions\n   * @param {String} key The value of the `Sec-WebSocket-Key` header\n   * @param {Set} protocols The subprotocols\n   * @param {http.IncomingMessage} req The request object\n   * @param {Duplex} socket The network socket between the server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Function} cb Callback\n   * @throws {Error} If called more than once with the same socket\n   * @private\n   */\n  completeUpgrade(extensions, key, protocols, req, socket, head, cb) {\n    //\n    // Destroy the socket if the client has already sent a FIN packet.\n    //\n    if (!socket.readable || !socket.writable) return socket.destroy();\n\n    if (socket[kWebSocket]) {\n      throw new Error(\n        'server.handleUpgrade() was called more than once with the same ' +\n          'socket, possibly due to a misconfiguration'\n      );\n    }\n\n    if (this._state > RUNNING) return abortHandshake(socket, 503);\n\n    const digest = createHash('sha1')\n      .update(key + GUID)\n      .digest('base64');\n\n    const headers = [\n      'HTTP/1.1 101 Switching Protocols',\n      'Upgrade: websocket',\n      'Connection: Upgrade',\n      `Sec-WebSocket-Accept: ${digest}`\n    ];\n\n    const ws = new this.options.WebSocket(null, undefined, this.options);\n\n    if (protocols.size) {\n      //\n      // Optionally call external protocol selection handler.\n      //\n      const protocol = this.options.handleProtocols\n        ? this.options.handleProtocols(protocols, req)\n        : protocols.values().next().value;\n\n      if (protocol) {\n        headers.push(`Sec-WebSocket-Protocol: ${protocol}`);\n        ws._protocol = protocol;\n      }\n    }\n\n    if (extensions[PerMessageDeflate.extensionName]) {\n      const params = extensions[PerMessageDeflate.extensionName].params;\n      const value = extension.format({\n        [PerMessageDeflate.extensionName]: [params]\n      });\n      headers.push(`Sec-WebSocket-Extensions: ${value}`);\n      ws._extensions = extensions;\n    }\n\n    //\n    // Allow external modification/inspection of handshake headers.\n    //\n    this.emit('headers', headers, req);\n\n    socket.write(headers.concat('\\r\\n').join('\\r\\n'));\n    socket.removeListener('error', socketOnError);\n\n    ws.setSocket(socket, head, {\n      allowSynchronousEvents: this.options.allowSynchronousEvents,\n      maxPayload: this.options.maxPayload,\n      skipUTF8Validation: this.options.skipUTF8Validation\n    });\n\n    if (this.clients) {\n      this.clients.add(ws);\n      ws.on('close', () => {\n        this.clients.delete(ws);\n\n        if (this._shouldEmitClose && !this.clients.size) {\n          process.nextTick(emitClose, this);\n        }\n      });\n    }\n\n    cb(ws, req);\n  }\n}\n\nmodule.exports = WebSocketServer;\n\n/**\n * Add event listeners on an `EventEmitter` using a map of <event, listener>\n * pairs.\n *\n * @param {EventEmitter} server The event emitter\n * @param {Object.<String, Function>} map The listeners to add\n * @return {Function} A function that will remove the added listeners when\n *     called\n * @private\n */\nfunction addListeners(server, map) {\n  for (const event of Object.keys(map)) server.on(event, map[event]);\n\n  return function removeListeners() {\n    for (const event of Object.keys(map)) {\n      server.removeListener(event, map[event]);\n    }\n  };\n}\n\n/**\n * Emit a `'close'` event on an `EventEmitter`.\n *\n * @param {EventEmitter} server The event emitter\n * @private\n */\nfunction emitClose(server) {\n  server._state = CLOSED;\n  server.emit('close');\n}\n\n/**\n * Handle socket errors.\n *\n * @private\n */\nfunction socketOnError() {\n  this.destroy();\n}\n\n/**\n * Close the connection when preconditions are not fulfilled.\n *\n * @param {Duplex} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} [message] The HTTP response body\n * @param {Object} [headers] Additional HTTP response headers\n * @private\n */\nfunction abortHandshake(socket, code, message, headers) {\n  //\n  // The socket is writable unless the user destroyed or ended it before calling\n  // `server.handleUpgrade()` or in the `verifyClient` function, which is a user\n  // error. Handling this does not make much sense as the worst that can happen\n  // is that some of the data written by the user might be discarded due to the\n  // call to `socket.end()` below, which triggers an `'error'` event that in\n  // turn causes the socket to be destroyed.\n  //\n  message = message || http.STATUS_CODES[code];\n  headers = {\n    Connection: 'close',\n    'Content-Type': 'text/html',\n    'Content-Length': Buffer.byteLength(message),\n    ...headers\n  };\n\n  socket.once('finish', socket.destroy);\n\n  socket.end(\n    `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\\r\\n` +\n      Object.keys(headers)\n        .map((h) => `${h}: ${headers[h]}`)\n        .join('\\r\\n') +\n      '\\r\\n\\r\\n' +\n      message\n  );\n}\n\n/**\n * Emit a `'wsClientError'` event on a `WebSocketServer` if there is at least\n * one listener for it, otherwise call `abortHandshake()`.\n *\n * @param {WebSocketServer} server The WebSocket server\n * @param {http.IncomingMessage} req The request object\n * @param {Duplex} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} message The HTTP response body\n * @private\n */\nfunction abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {\n  if (server.listenerCount('wsClientError')) {\n    const err = new Error(message);\n    Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);\n\n    server.emit('wsClientError', err, socket, req);\n  } else {\n    abortHandshake(socket, code, message);\n  }\n}\n/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Duplex|Readable$\", \"caughtErrors\": \"none\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst https = require('https');\nconst http = require('http');\nconst net = require('net');\nconst tls = require('tls');\nconst { randomBytes, createHash } = require('crypto');\nconst { Duplex, Readable } = require('stream');\nconst { URL } = require('url');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst Receiver = require('./receiver');\nconst Sender = require('./sender');\nconst {\n  BINARY_TYPES,\n  EMPTY_BUFFER,\n  GUID,\n  kForOnEventAttribute,\n  kListener,\n  kStatusCode,\n  kWebSocket,\n  NOOP\n} = require('./constants');\nconst {\n  EventTarget: { addEventListener, removeEventListener }\n} = require('./event-target');\nconst { format, parse } = require('./extension');\nconst { toBuffer } = require('./buffer-util');\n\nconst closeTimeout = 30 * 1000;\nconst kAborted = Symbol('kAborted');\nconst protocolVersions = [8, 13];\nconst readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];\nconst subprotocolRegex = /^[!#$%&'*+\\-.0-9A-Z^_`|a-z~]+$/;\n\n/**\n * Class representing a WebSocket.\n *\n * @extends EventEmitter\n */\nclass WebSocket extends EventEmitter {\n  /**\n   * Create a new `WebSocket`.\n   *\n   * @param {(String|URL)} address The URL to which to connect\n   * @param {(String|String[])} [protocols] The subprotocols\n   * @param {Object} [options] Connection options\n   */\n  constructor(address, protocols, options) {\n    super();\n\n    this._binaryType = BINARY_TYPES[0];\n    this._closeCode = 1006;\n    this._closeFrameReceived = false;\n    this._closeFrameSent = false;\n    this._closeMessage = EMPTY_BUFFER;\n    this._closeTimer = null;\n    this._extensions = {};\n    this._paused = false;\n    this._protocol = '';\n    this._readyState = WebSocket.CONNECTING;\n    this._receiver = null;\n    this._sender = null;\n    this._socket = null;\n\n    if (address !== null) {\n      this._bufferedAmount = 0;\n      this._isServer = false;\n      this._redirects = 0;\n\n      if (protocols === undefined) {\n        protocols = [];\n      } else if (!Array.isArray(protocols)) {\n        if (typeof protocols === 'object' && protocols !== null) {\n          options = protocols;\n          protocols = [];\n        } else {\n          protocols = [protocols];\n        }\n      }\n\n      initAsClient(this, address, protocols, options);\n    } else {\n      this._autoPong = options.autoPong;\n      this._isServer = true;\n    }\n  }\n\n  /**\n   * This deviates from the WHATWG interface since ws doesn't support the\n   * required default \"blob\" type (instead we define a custom \"nodebuffer\"\n   * type).\n   *\n   * @type {String}\n   */\n  get binaryType() {\n    return this._binaryType;\n  }\n\n  set binaryType(type) {\n    if (!BINARY_TYPES.includes(type)) return;\n\n    this._binaryType = type;\n\n    //\n    // Allow to change `binaryType` on the fly.\n    //\n    if (this._receiver) this._receiver._binaryType = type;\n  }\n\n  /**\n   * @type {Number}\n   */\n  get bufferedAmount() {\n    if (!this._socket) return this._bufferedAmount;\n\n    return this._socket._writableState.length + this._sender._bufferedBytes;\n  }\n\n  /**\n   * @type {String}\n   */\n  get extensions() {\n    return Object.keys(this._extensions).join();\n  }\n\n  /**\n   * @type {Boolean}\n   */\n  get isPaused() {\n    return this._paused;\n  }\n\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onclose() {\n    return null;\n  }\n\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onerror() {\n    return null;\n  }\n\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onopen() {\n    return null;\n  }\n\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onmessage() {\n    return null;\n  }\n\n  /**\n   * @type {String}\n   */\n  get protocol() {\n    return this._protocol;\n  }\n\n  /**\n   * @type {Number}\n   */\n  get readyState() {\n    return this._readyState;\n  }\n\n  /**\n   * @type {String}\n   */\n  get url() {\n    return this._url;\n  }\n\n  /**\n   * Set up the socket and the internal resources.\n   *\n   * @param {Duplex} socket The network socket between the server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Object} options Options object\n   * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether\n   *     any of the `'message'`, `'ping'`, and `'pong'` events can be emitted\n   *     multiple times in the same tick\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Number} [options.maxPayload=0] The maximum allowed message size\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   * @private\n   */\n  setSocket(socket, head, options) {\n    const receiver = new Receiver({\n      allowSynchronousEvents: options.allowSynchronousEvents,\n      binaryType: this.binaryType,\n      extensions: this._extensions,\n      isServer: this._isServer,\n      maxPayload: options.maxPayload,\n      skipUTF8Validation: options.skipUTF8Validation\n    });\n\n    this._sender = new Sender(socket, this._extensions, options.generateMask);\n    this._receiver = receiver;\n    this._socket = socket;\n\n    receiver[kWebSocket] = this;\n    socket[kWebSocket] = this;\n\n    receiver.on('conclude', receiverOnConclude);\n    receiver.on('drain', receiverOnDrain);\n    receiver.on('error', receiverOnError);\n    receiver.on('message', receiverOnMessage);\n    receiver.on('ping', receiverOnPing);\n    receiver.on('pong', receiverOnPong);\n\n    //\n    // These methods may not be available if `socket` is just a `Duplex`.\n    //\n    if (socket.setTimeout) socket.setTimeout(0);\n    if (socket.setNoDelay) socket.setNoDelay();\n\n    if (head.length > 0) socket.unshift(head);\n\n    socket.on('close', socketOnClose);\n    socket.on('data', socketOnData);\n    socket.on('end', socketOnEnd);\n    socket.on('error', socketOnError);\n\n    this._readyState = WebSocket.OPEN;\n    this.emit('open');\n  }\n\n  /**\n   * Emit the `'close'` event.\n   *\n   * @private\n   */\n  emitClose() {\n    if (!this._socket) {\n      this._readyState = WebSocket.CLOSED;\n      this.emit('close', this._closeCode, this._closeMessage);\n      return;\n    }\n\n    if (this._extensions[PerMessageDeflate.extensionName]) {\n      this._extensions[PerMessageDeflate.extensionName].cleanup();\n    }\n\n    this._receiver.removeAllListeners();\n    this._readyState = WebSocket.CLOSED;\n    this.emit('close', this._closeCode, this._closeMessage);\n  }\n\n  /**\n   * Start a closing handshake.\n   *\n   *          +----------+   +-----------+   +----------+\n   *     - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n   *    |     +----------+   +-----------+   +----------+     |\n   *          +----------+   +-----------+         |\n   * CLOSING  |ws.close()|<--|close frame|<--+-----+       CLOSING\n   *          +----------+   +-----------+   |\n   *    |           |                        |   +---+        |\n   *                +------------------------+-->|fin| - - - -\n   *    |         +---+                      |   +---+\n   *     - - - - -|fin|<---------------------+\n   *              +---+\n   *\n   * @param {Number} [code] Status code explaining why the connection is closing\n   * @param {(String|Buffer)} [data] The reason why the connection is\n   *     closing\n   * @public\n   */\n  close(code, data) {\n    if (this.readyState === WebSocket.CLOSED) return;\n    if (this.readyState === WebSocket.CONNECTING) {\n      const msg = 'WebSocket was closed before the connection was established';\n      abortHandshake(this, this._req, msg);\n      return;\n    }\n\n    if (this.readyState === WebSocket.CLOSING) {\n      if (\n        this._closeFrameSent &&\n        (this._closeFrameReceived || this._receiver._writableState.errorEmitted)\n      ) {\n        this._socket.end();\n      }\n\n      return;\n    }\n\n    this._readyState = WebSocket.CLOSING;\n    this._sender.close(code, data, !this._isServer, (err) => {\n      //\n      // This error is handled by the `'error'` listener on the socket. We only\n      // want to know if the close frame has been sent here.\n      //\n      if (err) return;\n\n      this._closeFrameSent = true;\n\n      if (\n        this._closeFrameReceived ||\n        this._receiver._writableState.errorEmitted\n      ) {\n        this._socket.end();\n      }\n    });\n\n    //\n    // Specify a timeout for the closing handshake to complete.\n    //\n    this._closeTimer = setTimeout(\n      this._socket.destroy.bind(this._socket),\n      closeTimeout\n    );\n  }\n\n  /**\n   * Pause the socket.\n   *\n   * @public\n   */\n  pause() {\n    if (\n      this.readyState === WebSocket.CONNECTING ||\n      this.readyState === WebSocket.CLOSED\n    ) {\n      return;\n    }\n\n    this._paused = true;\n    this._socket.pause();\n  }\n\n  /**\n   * Send a ping.\n   *\n   * @param {*} [data] The data to send\n   * @param {Boolean} [mask] Indicates whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when the ping is sent\n   * @public\n   */\n  ping(data, mask, cb) {\n    if (this.readyState === WebSocket.CONNECTING) {\n      throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n    }\n\n    if (typeof data === 'function') {\n      cb = data;\n      data = mask = undefined;\n    } else if (typeof mask === 'function') {\n      cb = mask;\n      mask = undefined;\n    }\n\n    if (typeof data === 'number') data = data.toString();\n\n    if (this.readyState !== WebSocket.OPEN) {\n      sendAfterClose(this, data, cb);\n      return;\n    }\n\n    if (mask === undefined) mask = !this._isServer;\n    this._sender.ping(data || EMPTY_BUFFER, mask, cb);\n  }\n\n  /**\n   * Send a pong.\n   *\n   * @param {*} [data] The data to send\n   * @param {Boolean} [mask] Indicates whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when the pong is sent\n   * @public\n   */\n  pong(data, mask, cb) {\n    if (this.readyState === WebSocket.CONNECTING) {\n      throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n    }\n\n    if (typeof data === 'function') {\n      cb = data;\n      data = mask = undefined;\n    } else if (typeof mask === 'function') {\n      cb = mask;\n      mask = undefined;\n    }\n\n    if (typeof data === 'number') data = data.toString();\n\n    if (this.readyState !== WebSocket.OPEN) {\n      sendAfterClose(this, data, cb);\n      return;\n    }\n\n    if (mask === undefined) mask = !this._isServer;\n    this._sender.pong(data || EMPTY_BUFFER, mask, cb);\n  }\n\n  /**\n   * Resume the socket.\n   *\n   * @public\n   */\n  resume() {\n    if (\n      this.readyState === WebSocket.CONNECTING ||\n      this.readyState === WebSocket.CLOSED\n    ) {\n      return;\n    }\n\n    this._paused = false;\n    if (!this._receiver._writableState.needDrain) this._socket.resume();\n  }\n\n  /**\n   * Send a data message.\n   *\n   * @param {*} data The message to send\n   * @param {Object} [options] Options object\n   * @param {Boolean} [options.binary] Specifies whether `data` is binary or\n   *     text\n   * @param {Boolean} [options.compress] Specifies whether or not to compress\n   *     `data`\n   * @param {Boolean} [options.fin=true] Specifies whether the fragment is the\n   *     last one\n   * @param {Boolean} [options.mask] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when data is written out\n   * @public\n   */\n  send(data, options, cb) {\n    if (this.readyState === WebSocket.CONNECTING) {\n      throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n    }\n\n    if (typeof options === 'function') {\n      cb = options;\n      options = {};\n    }\n\n    if (typeof data === 'number') data = data.toString();\n\n    if (this.readyState !== WebSocket.OPEN) {\n      sendAfterClose(this, data, cb);\n      return;\n    }\n\n    const opts = {\n      binary: typeof data !== 'string',\n      mask: !this._isServer,\n      compress: true,\n      fin: true,\n      ...options\n    };\n\n    if (!this._extensions[PerMessageDeflate.extensionName]) {\n      opts.compress = false;\n    }\n\n    this._sender.send(data || EMPTY_BUFFER, opts, cb);\n  }\n\n  /**\n   * Forcibly close the connection.\n   *\n   * @public\n   */\n  terminate() {\n    if (this.readyState === WebSocket.CLOSED) return;\n    if (this.readyState === WebSocket.CONNECTING) {\n      const msg = 'WebSocket was closed before the connection was established';\n      abortHandshake(this, this._req, msg);\n      return;\n    }\n\n    if (this._socket) {\n      this._readyState = WebSocket.CLOSING;\n      this._socket.destroy();\n    }\n  }\n}\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CONNECTING', {\n  enumerable: true,\n  value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CONNECTING', {\n  enumerable: true,\n  value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'OPEN', {\n  enumerable: true,\n  value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'OPEN', {\n  enumerable: true,\n  value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSING', {\n  enumerable: true,\n  value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSING', {\n  enumerable: true,\n  value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSED', {\n  enumerable: true,\n  value: readyStates.indexOf('CLOSED')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSED', {\n  enumerable: true,\n  value: readyStates.indexOf('CLOSED')\n});\n\n[\n  'binaryType',\n  'bufferedAmount',\n  'extensions',\n  'isPaused',\n  'protocol',\n  'readyState',\n  'url'\n].forEach((property) => {\n  Object.defineProperty(WebSocket.prototype, property, { enumerable: true });\n});\n\n//\n// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.\n// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface\n//\n['open', 'error', 'close', 'message'].forEach((method) => {\n  Object.defineProperty(WebSocket.prototype, `on${method}`, {\n    enumerable: true,\n    get() {\n      for (const listener of this.listeners(method)) {\n        if (listener[kForOnEventAttribute]) return listener[kListener];\n      }\n\n      return null;\n    },\n    set(handler) {\n      for (const listener of this.listeners(method)) {\n        if (listener[kForOnEventAttribute]) {\n          this.removeListener(method, listener);\n          break;\n        }\n      }\n\n      if (typeof handler !== 'function') return;\n\n      this.addEventListener(method, handler, {\n        [kForOnEventAttribute]: true\n      });\n    }\n  });\n});\n\nWebSocket.prototype.addEventListener = addEventListener;\nWebSocket.prototype.removeEventListener = removeEventListener;\n\nmodule.exports = WebSocket;\n\n/**\n * Initialize a WebSocket client.\n *\n * @param {WebSocket} websocket The client to initialize\n * @param {(String|URL)} address The URL to which to connect\n * @param {Array} protocols The subprotocols\n * @param {Object} [options] Connection options\n * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether any\n *     of the `'message'`, `'ping'`, and `'pong'` events can be emitted multiple\n *     times in the same tick\n * @param {Boolean} [options.autoPong=true] Specifies whether or not to\n *     automatically send a pong in response to a ping\n * @param {Function} [options.finishRequest] A function which can be used to\n *     customize the headers of each http request before it is sent\n * @param {Boolean} [options.followRedirects=false] Whether or not to follow\n *     redirects\n * @param {Function} [options.generateMask] The function used to generate the\n *     masking key\n * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the\n *     handshake request\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n *     size\n * @param {Number} [options.maxRedirects=10] The maximum number of redirects\n *     allowed\n * @param {String} [options.origin] Value of the `Origin` or\n *     `Sec-WebSocket-Origin` header\n * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable\n *     permessage-deflate\n * @param {Number} [options.protocolVersion=13] Value of the\n *     `Sec-WebSocket-Version` header\n * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n *     not to skip UTF-8 validation for text and close messages\n * @private\n */\nfunction initAsClient(websocket, address, protocols, options) {\n  const opts = {\n    allowSynchronousEvents: true,\n    autoPong: true,\n    protocolVersion: protocolVersions[1],\n    maxPayload: 100 * 1024 * 1024,\n    skipUTF8Validation: false,\n    perMessageDeflate: true,\n    followRedirects: false,\n    maxRedirects: 10,\n    ...options,\n    socketPath: undefined,\n    hostname: undefined,\n    protocol: undefined,\n    timeout: undefined,\n    method: 'GET',\n    host: undefined,\n    path: undefined,\n    port: undefined\n  };\n\n  websocket._autoPong = opts.autoPong;\n\n  if (!protocolVersions.includes(opts.protocolVersion)) {\n    throw new RangeError(\n      `Unsupported protocol version: ${opts.protocolVersion} ` +\n        `(supported versions: ${protocolVersions.join(', ')})`\n    );\n  }\n\n  let parsedUrl;\n\n  if (address instanceof URL) {\n    parsedUrl = address;\n  } else {\n    try {\n      parsedUrl = new URL(address);\n    } catch (e) {\n      throw new SyntaxError(`Invalid URL: ${address}`);\n    }\n  }\n\n  if (parsedUrl.protocol === 'http:') {\n    parsedUrl.protocol = 'ws:';\n  } else if (parsedUrl.protocol === 'https:') {\n    parsedUrl.protocol = 'wss:';\n  }\n\n  websocket._url = parsedUrl.href;\n\n  const isSecure = parsedUrl.protocol === 'wss:';\n  const isIpcUrl = parsedUrl.protocol === 'ws+unix:';\n  let invalidUrlMessage;\n\n  if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) {\n    invalidUrlMessage =\n      'The URL\\'s protocol must be one of \"ws:\", \"wss:\", ' +\n      '\"http:\", \"https\", or \"ws+unix:\"';\n  } else if (isIpcUrl && !parsedUrl.pathname) {\n    invalidUrlMessage = \"The URL's pathname is empty\";\n  } else if (parsedUrl.hash) {\n    invalidUrlMessage = 'The URL contains a fragment identifier';\n  }\n\n  if (invalidUrlMessage) {\n    const err = new SyntaxError(invalidUrlMessage);\n\n    if (websocket._redirects === 0) {\n      throw err;\n    } else {\n      emitErrorAndClose(websocket, err);\n      return;\n    }\n  }\n\n  const defaultPort = isSecure ? 443 : 80;\n  const key = randomBytes(16).toString('base64');\n  const request = isSecure ? https.request : http.request;\n  const protocolSet = new Set();\n  let perMessageDeflate;\n\n  opts.createConnection =\n    opts.createConnection || (isSecure ? tlsConnect : netConnect);\n  opts.defaultPort = opts.defaultPort || defaultPort;\n  opts.port = parsedUrl.port || defaultPort;\n  opts.host = parsedUrl.hostname.startsWith('[')\n    ? parsedUrl.hostname.slice(1, -1)\n    : parsedUrl.hostname;\n  opts.headers = {\n    ...opts.headers,\n    'Sec-WebSocket-Version': opts.protocolVersion,\n    'Sec-WebSocket-Key': key,\n    Connection: 'Upgrade',\n    Upgrade: 'websocket'\n  };\n  opts.path = parsedUrl.pathname + parsedUrl.search;\n  opts.timeout = opts.handshakeTimeout;\n\n  if (opts.perMessageDeflate) {\n    perMessageDeflate = new PerMessageDeflate(\n      opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},\n      false,\n      opts.maxPayload\n    );\n    opts.headers['Sec-WebSocket-Extensions'] = format({\n      [PerMessageDeflate.extensionName]: perMessageDeflate.offer()\n    });\n  }\n  if (protocols.length) {\n    for (const protocol of protocols) {\n      if (\n        typeof protocol !== 'string' ||\n        !subprotocolRegex.test(protocol) ||\n        protocolSet.has(protocol)\n      ) {\n        throw new SyntaxError(\n          'An invalid or duplicated subprotocol was specified'\n        );\n      }\n\n      protocolSet.add(protocol);\n    }\n\n    opts.headers['Sec-WebSocket-Protocol'] = protocols.join(',');\n  }\n  if (opts.origin) {\n    if (opts.protocolVersion < 13) {\n      opts.headers['Sec-WebSocket-Origin'] = opts.origin;\n    } else {\n      opts.headers.Origin = opts.origin;\n    }\n  }\n  if (parsedUrl.username || parsedUrl.password) {\n    opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;\n  }\n\n  if (isIpcUrl) {\n    const parts = opts.path.split(':');\n\n    opts.socketPath = parts[0];\n    opts.path = parts[1];\n  }\n\n  let req;\n\n  if (opts.followRedirects) {\n    if (websocket._redirects === 0) {\n      websocket._originalIpc = isIpcUrl;\n      websocket._originalSecure = isSecure;\n      websocket._originalHostOrSocketPath = isIpcUrl\n        ? opts.socketPath\n        : parsedUrl.host;\n\n      const headers = options && options.headers;\n\n      //\n      // Shallow copy the user provided options so that headers can be changed\n      // without mutating the original object.\n      //\n      options = { ...options, headers: {} };\n\n      if (headers) {\n        for (const [key, value] of Object.entries(headers)) {\n          options.headers[key.toLowerCase()] = value;\n        }\n      }\n    } else if (websocket.listenerCount('redirect') === 0) {\n      const isSameHost = isIpcUrl\n        ? websocket._originalIpc\n          ? opts.socketPath === websocket._originalHostOrSocketPath\n          : false\n        : websocket._originalIpc\n          ? false\n          : parsedUrl.host === websocket._originalHostOrSocketPath;\n\n      if (!isSameHost || (websocket._originalSecure && !isSecure)) {\n        //\n        // Match curl 7.77.0 behavior and drop the following headers. These\n        // headers are also dropped when following a redirect to a subdomain.\n        //\n        delete opts.headers.authorization;\n        delete opts.headers.cookie;\n\n        if (!isSameHost) delete opts.headers.host;\n\n        opts.auth = undefined;\n      }\n    }\n\n    //\n    // Match curl 7.77.0 behavior and make the first `Authorization` header win.\n    // If the `Authorization` header is set, then there is nothing to do as it\n    // will take precedence.\n    //\n    if (opts.auth && !options.headers.authorization) {\n      options.headers.authorization =\n        'Basic ' + Buffer.from(opts.auth).toString('base64');\n    }\n\n    req = websocket._req = request(opts);\n\n    if (websocket._redirects) {\n      //\n      // Unlike what is done for the `'upgrade'` event, no early exit is\n      // triggered here if the user calls `websocket.close()` or\n      // `websocket.terminate()` from a listener of the `'redirect'` event. This\n      // is because the user can also call `request.destroy()` with an error\n      // before calling `websocket.close()` or `websocket.terminate()` and this\n      // would result in an error being emitted on the `request` object with no\n      // `'error'` event listeners attached.\n      //\n      websocket.emit('redirect', websocket.url, req);\n    }\n  } else {\n    req = websocket._req = request(opts);\n  }\n\n  if (opts.timeout) {\n    req.on('timeout', () => {\n      abortHandshake(websocket, req, 'Opening handshake has timed out');\n    });\n  }\n\n  req.on('error', (err) => {\n    if (req === null || req[kAborted]) return;\n\n    req = websocket._req = null;\n    emitErrorAndClose(websocket, err);\n  });\n\n  req.on('response', (res) => {\n    const location = res.headers.location;\n    const statusCode = res.statusCode;\n\n    if (\n      location &&\n      opts.followRedirects &&\n      statusCode >= 300 &&\n      statusCode < 400\n    ) {\n      if (++websocket._redirects > opts.maxRedirects) {\n        abortHandshake(websocket, req, 'Maximum redirects exceeded');\n        return;\n      }\n\n      req.abort();\n\n      let addr;\n\n      try {\n        addr = new URL(location, address);\n      } catch (e) {\n        const err = new SyntaxError(`Invalid URL: ${location}`);\n        emitErrorAndClose(websocket, err);\n        return;\n      }\n\n      initAsClient(websocket, addr, protocols, options);\n    } else if (!websocket.emit('unexpected-response', req, res)) {\n      abortHandshake(\n        websocket,\n        req,\n        `Unexpected server response: ${res.statusCode}`\n      );\n    }\n  });\n\n  req.on('upgrade', (res, socket, head) => {\n    websocket.emit('upgrade', res);\n\n    //\n    // The user may have closed the connection from a listener of the\n    // `'upgrade'` event.\n    //\n    if (websocket.readyState !== WebSocket.CONNECTING) return;\n\n    req = websocket._req = null;\n\n    const upgrade = res.headers.upgrade;\n\n    if (upgrade === undefined || upgrade.toLowerCase() !== 'websocket') {\n      abortHandshake(websocket, socket, 'Invalid Upgrade header');\n      return;\n    }\n\n    const digest = createHash('sha1')\n      .update(key + GUID)\n      .digest('base64');\n\n    if (res.headers['sec-websocket-accept'] !== digest) {\n      abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');\n      return;\n    }\n\n    const serverProt = res.headers['sec-websocket-protocol'];\n    let protError;\n\n    if (serverProt !== undefined) {\n      if (!protocolSet.size) {\n        protError = 'Server sent a subprotocol but none was requested';\n      } else if (!protocolSet.has(serverProt)) {\n        protError = 'Server sent an invalid subprotocol';\n      }\n    } else if (protocolSet.size) {\n      protError = 'Server sent no subprotocol';\n    }\n\n    if (protError) {\n      abortHandshake(websocket, socket, protError);\n      return;\n    }\n\n    if (serverProt) websocket._protocol = serverProt;\n\n    const secWebSocketExtensions = res.headers['sec-websocket-extensions'];\n\n    if (secWebSocketExtensions !== undefined) {\n      if (!perMessageDeflate) {\n        const message =\n          'Server sent a Sec-WebSocket-Extensions header but no extension ' +\n          'was requested';\n        abortHandshake(websocket, socket, message);\n        return;\n      }\n\n      let extensions;\n\n      try {\n        extensions = parse(secWebSocketExtensions);\n      } catch (err) {\n        const message = 'Invalid Sec-WebSocket-Extensions header';\n        abortHandshake(websocket, socket, message);\n        return;\n      }\n\n      const extensionNames = Object.keys(extensions);\n\n      if (\n        extensionNames.length !== 1 ||\n        extensionNames[0] !== PerMessageDeflate.extensionName\n      ) {\n        const message = 'Server indicated an extension that was not requested';\n        abortHandshake(websocket, socket, message);\n        return;\n      }\n\n      try {\n        perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);\n      } catch (err) {\n        const message = 'Invalid Sec-WebSocket-Extensions header';\n        abortHandshake(websocket, socket, message);\n        return;\n      }\n\n      websocket._extensions[PerMessageDeflate.extensionName] =\n        perMessageDeflate;\n    }\n\n    websocket.setSocket(socket, head, {\n      allowSynchronousEvents: opts.allowSynchronousEvents,\n      generateMask: opts.generateMask,\n      maxPayload: opts.maxPayload,\n      skipUTF8Validation: opts.skipUTF8Validation\n    });\n  });\n\n  if (opts.finishRequest) {\n    opts.finishRequest(req, websocket);\n  } else {\n    req.end();\n  }\n}\n\n/**\n * Emit the `'error'` and `'close'` events.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {Error} The error to emit\n * @private\n */\nfunction emitErrorAndClose(websocket, err) {\n  websocket._readyState = WebSocket.CLOSING;\n  websocket.emit('error', err);\n  websocket.emitClose();\n}\n\n/**\n * Create a `net.Socket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {net.Socket} The newly created socket used to start the connection\n * @private\n */\nfunction netConnect(options) {\n  options.path = options.socketPath;\n  return net.connect(options);\n}\n\n/**\n * Create a `tls.TLSSocket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {tls.TLSSocket} The newly created socket used to start the connection\n * @private\n */\nfunction tlsConnect(options) {\n  options.path = undefined;\n\n  if (!options.servername && options.servername !== '') {\n    options.servername = net.isIP(options.host) ? '' : options.host;\n  }\n\n  return tls.connect(options);\n}\n\n/**\n * Abort the handshake and emit an error.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to\n *     abort or the socket to destroy\n * @param {String} message The error message\n * @private\n */\nfunction abortHandshake(websocket, stream, message) {\n  websocket._readyState = WebSocket.CLOSING;\n\n  const err = new Error(message);\n  Error.captureStackTrace(err, abortHandshake);\n\n  if (stream.setHeader) {\n    stream[kAborted] = true;\n    stream.abort();\n\n    if (stream.socket && !stream.socket.destroyed) {\n      //\n      // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if\n      // called after the request completed. See\n      // https://github.com/websockets/ws/issues/1869.\n      //\n      stream.socket.destroy();\n    }\n\n    process.nextTick(emitErrorAndClose, websocket, err);\n  } else {\n    stream.destroy(err);\n    stream.once('error', websocket.emit.bind(websocket, 'error'));\n    stream.once('close', websocket.emitClose.bind(websocket));\n  }\n}\n\n/**\n * Handle cases where the `ping()`, `pong()`, or `send()` methods are called\n * when the `readyState` attribute is `CLOSING` or `CLOSED`.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {*} [data] The data to send\n * @param {Function} [cb] Callback\n * @private\n */\nfunction sendAfterClose(websocket, data, cb) {\n  if (data) {\n    const length = toBuffer(data).length;\n\n    //\n    // The `_bufferedAmount` property is used only when the peer is a client and\n    // the opening handshake fails. Under these circumstances, in fact, the\n    // `setSocket()` method is not called, so the `_socket` and `_sender`\n    // properties are set to `null`.\n    //\n    if (websocket._socket) websocket._sender._bufferedBytes += length;\n    else websocket._bufferedAmount += length;\n  }\n\n  if (cb) {\n    const err = new Error(\n      `WebSocket is not open: readyState ${websocket.readyState} ` +\n        `(${readyStates[websocket.readyState]})`\n    );\n    process.nextTick(cb, err);\n  }\n}\n\n/**\n * The listener of the `Receiver` `'conclude'` event.\n *\n * @param {Number} code The status code\n * @param {Buffer} reason The reason for closing\n * @private\n */\nfunction receiverOnConclude(code, reason) {\n  const websocket = this[kWebSocket];\n\n  websocket._closeFrameReceived = true;\n  websocket._closeMessage = reason;\n  websocket._closeCode = code;\n\n  if (websocket._socket[kWebSocket] === undefined) return;\n\n  websocket._socket.removeListener('data', socketOnData);\n  process.nextTick(resume, websocket._socket);\n\n  if (code === 1005) websocket.close();\n  else websocket.close(code, reason);\n}\n\n/**\n * The listener of the `Receiver` `'drain'` event.\n *\n * @private\n */\nfunction receiverOnDrain() {\n  const websocket = this[kWebSocket];\n\n  if (!websocket.isPaused) websocket._socket.resume();\n}\n\n/**\n * The listener of the `Receiver` `'error'` event.\n *\n * @param {(RangeError|Error)} err The emitted error\n * @private\n */\nfunction receiverOnError(err) {\n  const websocket = this[kWebSocket];\n\n  if (websocket._socket[kWebSocket] !== undefined) {\n    websocket._socket.removeListener('data', socketOnData);\n\n    //\n    // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See\n    // https://github.com/websockets/ws/issues/1940.\n    //\n    process.nextTick(resume, websocket._socket);\n\n    websocket.close(err[kStatusCode]);\n  }\n\n  websocket.emit('error', err);\n}\n\n/**\n * The listener of the `Receiver` `'finish'` event.\n *\n * @private\n */\nfunction receiverOnFinish() {\n  this[kWebSocket].emitClose();\n}\n\n/**\n * The listener of the `Receiver` `'message'` event.\n *\n * @param {Buffer|ArrayBuffer|Buffer[])} data The message\n * @param {Boolean} isBinary Specifies whether the message is binary or not\n * @private\n */\nfunction receiverOnMessage(data, isBinary) {\n  this[kWebSocket].emit('message', data, isBinary);\n}\n\n/**\n * The listener of the `Receiver` `'ping'` event.\n *\n * @param {Buffer} data The data included in the ping frame\n * @private\n */\nfunction receiverOnPing(data) {\n  const websocket = this[kWebSocket];\n\n  if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);\n  websocket.emit('ping', data);\n}\n\n/**\n * The listener of the `Receiver` `'pong'` event.\n *\n * @param {Buffer} data The data included in the pong frame\n * @private\n */\nfunction receiverOnPong(data) {\n  this[kWebSocket].emit('pong', data);\n}\n\n/**\n * Resume a readable stream\n *\n * @param {Readable} stream The readable stream\n * @private\n */\nfunction resume(stream) {\n  stream.resume();\n}\n\n/**\n * The listener of the socket `'close'` event.\n *\n * @private\n */\nfunction socketOnClose() {\n  const websocket = this[kWebSocket];\n\n  this.removeListener('close', socketOnClose);\n  this.removeListener('data', socketOnData);\n  this.removeListener('end', socketOnEnd);\n\n  websocket._readyState = WebSocket.CLOSING;\n\n  let chunk;\n\n  //\n  // The close frame might not have been received or the `'end'` event emitted,\n  // for example, if the socket was destroyed due to an error. Ensure that the\n  // `receiver` stream is closed after writing any remaining buffered data to\n  // it. If the readable side of the socket is in flowing mode then there is no\n  // buffered data as everything has been already written and `readable.read()`\n  // will return `null`. If instead, the socket is paused, any possible buffered\n  // data will be read as a single chunk.\n  //\n  if (\n    !this._readableState.endEmitted &&\n    !websocket._closeFrameReceived &&\n    !websocket._receiver._writableState.errorEmitted &&\n    (chunk = websocket._socket.read()) !== null\n  ) {\n    websocket._receiver.write(chunk);\n  }\n\n  websocket._receiver.end();\n\n  this[kWebSocket] = undefined;\n\n  clearTimeout(websocket._closeTimer);\n\n  if (\n    websocket._receiver._writableState.finished ||\n    websocket._receiver._writableState.errorEmitted\n  ) {\n    websocket.emitClose();\n  } else {\n    websocket._receiver.on('error', receiverOnFinish);\n    websocket._receiver.on('finish', receiverOnFinish);\n  }\n}\n\n/**\n * The listener of the socket `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction socketOnData(chunk) {\n  if (!this[kWebSocket]._receiver.write(chunk)) {\n    this.pause();\n  }\n}\n\n/**\n * The listener of the socket `'end'` event.\n *\n * @private\n */\nfunction socketOnEnd() {\n  const websocket = this[kWebSocket];\n\n  websocket._readyState = WebSocket.CLOSING;\n  websocket._receiver.end();\n  this.end();\n}\n\n/**\n * The listener of the socket `'error'` event.\n *\n * @private\n */\nfunction socketOnError() {\n  const websocket = this[kWebSocket];\n\n  this.removeListener('error', socketOnError);\n  this.on('error', NOOP);\n\n  if (websocket) {\n    websocket._readyState = WebSocket.CLOSING;\n    this.destroy();\n  }\n}\n{\n  \"name\": \"ws\",\n  \"version\": \"8.17.1\",\n  \"description\": \"Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js\",\n  \"keywords\": [\n    \"HyBi\",\n    \"Push\",\n    \"RFC-6455\",\n    \"WebSocket\",\n    \"WebSockets\",\n    \"real-time\"\n  ],\n  \"homepage\": \"https://github.com/websockets/ws\",\n  \"bugs\": \"https://github.com/websockets/ws/issues\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/websockets/ws.git\"\n  },\n  \"author\": \"Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)\",\n  \"license\": \"MIT\",\n  \"main\": \"index.js\",\n  \"exports\": {\n    \".\": {\n      \"browser\": \"./browser.js\",\n      \"import\": \"./wrapper.mjs\",\n      \"require\": \"./index.js\"\n    },\n    \"./package.json\": \"./package.json\"\n  },\n  \"browser\": \"browser.js\",\n  \"engines\": {\n    \"node\": \">=10.0.0\"\n  },\n  \"files\": [\n    \"browser.js\",\n    \"index.js\",\n    \"lib/*.js\",\n    \"wrapper.mjs\"\n  ],\n  \"scripts\": {\n    \"test\": \"nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js\",\n    \"integration\": \"mocha --throw-deprecation test/*.integration.js\",\n    \"lint\": \"eslint . && prettier --check --ignore-path .gitignore \\\"**/*.{json,md,yaml,yml}\\\"\"\n  },\n  \"peerDependencies\": {\n    \"bufferutil\": \"^4.0.1\",\n    \"utf-8-validate\": \">=5.0.2\"\n  },\n  \"peerDependenciesMeta\": {\n    \"bufferutil\": {\n      \"optional\": true\n    },\n    \"utf-8-validate\": {\n      \"optional\": true\n    }\n  },\n  \"devDependencies\": {\n    \"benchmark\": \"^2.1.4\",\n    \"bufferutil\": \"^4.0.1\",\n    \"eslint\": \"^9.0.0\",\n    \"eslint-config-prettier\": \"^9.0.0\",\n    \"eslint-plugin-prettier\": \"^5.0.0\",\n    \"globals\": \"^15.0.0\",\n    \"mocha\": \"^8.4.0\",\n    \"nyc\": \"^15.0.0\",\n    \"prettier\": \"^3.0.0\",\n    \"utf-8-validate\": \"^6.0.0\"\n  }\n}\nimport createWebSocketStream from './lib/stream.js';\nimport Receiver from './lib/receiver.js';\nimport Sender from './lib/sender.js';\nimport WebSocket from './lib/websocket.js';\nimport WebSocketServer from './lib/websocket-server.js';\n\nexport { createWebSocketStream, Receiver, Sender, WebSocket, WebSocketServer };\nexport default WebSocket;\n/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\n\t\t// Clean up tail reference when queue becomes empty\n\t\tif (!this.#head) {\n\t\t\tthis.#tail = undefined;\n\t\t}\n\n\t\treturn current.value;\n\t}\n\n\tpeek() {\n\t\tif (!this.#head) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.#head.value;\n\n\t\t// TODO: Node.js 18.\n\t\t// return this.#head?.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n\n\t* drain() {\n\t\twhile (this.#head) {\n\t\t\tyield this.dequeue();\n\t\t}\n\t}\n}\n{\n\t\"name\": \"yocto-queue\",\n\t\"version\": \"1.2.2\",\n\t\"description\": \"Tiny queue data structure\",\n\t\"license\": \"MIT\",\n\t\"repository\": \"sindresorhus/yocto-queue\",\n\t\"funding\": \"https://github.com/sponsors/sindresorhus\",\n\t\"author\": {\n\t\t\"name\": \"Sindre Sorhus\",\n\t\t\"email\": \"sindresorhus@gmail.com\",\n\t\t\"url\": \"https://sindresorhus.com\"\n\t},\n\t\"type\": \"module\",\n\t\"exports\": \"./index.js\",\n\t\"types\": \"./index.d.ts\",\n\t\"sideEffects\": false,\n\t\"engines\": {\n\t\t\"node\": \">=12.20\"\n\t},\n\t\"scripts\": {\n\t\t\"//test\": \"xo && ava && tsd\",\n\t\t\"test\": \"ava && tsd\"\n\t},\n\t\"files\": [\n\t\t\"index.js\",\n\t\t\"index.d.ts\"\n\t],\n\t\"keywords\": [\n\t\t\"queue\",\n\t\t\"data\",\n\t\t\"structure\",\n\t\t\"algorithm\",\n\t\t\"queues\",\n\t\t\"queuing\",\n\t\t\"list\",\n\t\t\"array\",\n\t\t\"linkedlist\",\n\t\t\"fifo\",\n\t\t\"enqueue\",\n\t\t\"dequeue\",\n\t\t\"data-structure\"\n\t],\n\t\"devDependencies\": {\n\t\t\"ava\": \"^3.15.0\",\n\t\t\"tsd\": \"^0.17.0\",\n\t\t\"xo\": \"^0.44.0\"\n\t}\n}\nconst b4a = require('b4a')\n\nconst ALPHABET = 'ybndrfg8ejkmcpqxot1uwisza345h769'\nconst MIN = 0x31 // 1\nconst MAX = 0x7a // z\nconst REVERSE = new Int8Array(1 + MAX - MIN)\n\nREVERSE.fill(-1)\n\nfor (let i = 0; i < ALPHABET.length; i++) {\n  const v = ALPHABET.charCodeAt(i) - MIN\n  REVERSE[v] = i\n}\n\nexports.encode = encode\nexports.decode = decode\nexports.ALPHABET = ALPHABET\n\nfunction decode (s, out) {\n  let pb = 0\n  let ps = 0\n\n  const r = s.length & 7\n  const q = (s.length - r) / 8\n\n  if (!out) out = b4a.allocUnsafe(Math.ceil(s.length * 5 / 8))\n\n  // 0 5 2 7 4 1 6 3 (+5 mod 8)\n  for (let i = 0; i < q; i++) {\n    const a = quintet(s, ps++)\n    const b = quintet(s, ps++)\n    const c = quintet(s, ps++)\n    const d = quintet(s, ps++)\n    const e = quintet(s, ps++)\n    const f = quintet(s, ps++)\n    const g = quintet(s, ps++)\n    const h = quintet(s, ps++)\n\n    out[pb++] = (a << 3) | (b >>> 2)\n    out[pb++] = ((b & 0b11) << 6) | (c << 1) | (d >>> 4)\n    out[pb++] = ((d & 0b1111) << 4) | (e >>> 1)\n    out[pb++] = ((e & 0b1) << 7) | (f << 2) | (g >>> 3)\n    out[pb++] = ((g & 0b111) << 5) | h\n  }\n\n  if (r === 0) return out.subarray(0, pb)\n\n  const a = quintet(s, ps++)\n  const b = quintet(s, ps++)\n\n  out[pb++] = (a << 3) | (b >>> 2)\n\n  if (r <= 2) return out.subarray(0, pb)\n\n  const c = quintet(s, ps++)\n  const d = quintet(s, ps++)\n\n  out[pb++] = ((b & 0b11) << 6) | (c << 1) | (d >>> 4)\n\n  if (r <= 4) return out.subarray(0, pb)\n\n  const e = quintet(s, ps++)\n\n  out[pb++] = ((d & 0b1111) << 4) | (e >>> 1)\n\n  if (r <= 5) return out.subarray(0, pb)\n\n  const f = quintet(s, ps++)\n  const g = quintet(s, ps++)\n\n  out[pb++] = ((e & 0b1) << 7) | (f << 2) | (g >>> 3)\n\n  if (r <= 7) return out.subarray(0, pb)\n\n  const h = quintet(s, ps++)\n\n  out[pb++] = ((g & 0b111) << 5) | h\n\n  return out.subarray(0, pb)\n}\n\nfunction encode (buf) {\n  if (typeof buf === 'string') buf = b4a.from(buf)\n\n  const max = buf.byteLength * 8\n\n  let s = ''\n\n  for (let p = 0; p < max; p += 5) {\n    const i = p >>> 3\n    const j = p & 7\n\n    if (j <= 3) {\n      s += ALPHABET[(buf[i] >>> (3 - j)) & 0b11111]\n      continue\n    }\n\n    const of = j - 3\n    const h = (buf[i] << of) & 0b11111\n    const l = (i >= buf.byteLength ? 0 : buf[i + 1]) >>> (8 - of)\n\n    s += ALPHABET[h | l]\n  }\n\n  return s\n}\n\nfunction quintet (s, i) {\n  if (i > s.length) {\n    return 0\n  }\n\n  const v = s.charCodeAt(i)\n\n  if (v < MIN || v > MAX) {\n    throw Error('Invalid character in base32 input: \"' + s[i] + '\" at position ' + i)\n  }\n\n  const bits = REVERSE[v - MIN]\n\n  if (bits === -1) {\n    throw Error('Invalid character in base32 input: \"' + s[i] + '\" at position ' + i)\n  }\n\n  return bits\n}\n{\n  \"name\": \"z32\",\n  \"version\": \"1.1.0\",\n  \"description\": \"Encode & decode z-base32\",\n  \"main\": \"index.js\",\n  \"dependencies\": {\n    \"b4a\": \"^1.5.3\"\n  },\n  \"devDependencies\": {\n    \"base-x\": \"^4.0.0\",\n    \"base32\": \"0.0.7\",\n    \"brittle\": \"^3.1.3\",\n    \"nanobench\": \"^3.0.0\",\n    \"rfc4648\": \"^1.5.2\",\n    \"standard\": \"^17.0.0\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/mafintosh/z32.git\"\n  },\n  \"scripts\": {\n    \"test\": \"standard && brittle test.js\",\n    \"bench\": \"node benchmark.js\"\n  },\n  \"author\": \"Mathias Buus (@mafintosh)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/mafintosh/z32/issues\"\n  },\n  \"homepage\": \"https://github.com/mafintosh/z32\"\n}\n{\n  \"name\": \"hyper-wallet\",\n  \"version\": \"0.1.0\",\n  \"description\": \"Self-custodial P2P cryptocurrency wallet built on Holepunchto and Tether WDK\",\n  \"type\": \"module\",\n  \"main\": \"cli.js\",\n  \"bin\": {\n    \"hyper-wallet\": \"./cli.js\"\n  },\n  \"pear\": {\n    \"name\": \"hyper-wallet\",\n    \"type\": \"terminal\"\n  },\n  \"imports\": {\n    \"@tetherto/wdk\": \"./shims/wdk-bare.js\",\n    \"@tetherto/wdk-wallet\": \"./shims/wdk-wallet.js\",\n    \"@tetherto/wdk-wallet-btc\": \"./shims/wdk-wallet-btc.js\",\n    \"@tetherto/wdk-wallet-evm\": \"./shims/wdk-wallet-evm.js\",\n    \"#node:crypto\": {\n      \"bare\": \"bare-crypto\",\n      \"default\": \"crypto\"\n    },\n    \"#crypto\": {\n      \"bare\": \"bare-crypto\",\n      \"default\": \"crypto\"\n    },\n    \"#node:buffer\": {\n      \"bare\": \"bare-buffer\",\n      \"default\": \"buffer\"\n    },\n    \"#buffer\": {\n      \"bare\": \"bare-buffer\",\n      \"default\": \"buffer\"\n    },\n    \"#node:stream\": {\n      \"bare\": \"bare-stream\",\n      \"default\": \"stream\"\n    },\n    \"#stream\": {\n      \"bare\": \"bare-stream\",\n      \"default\": \"stream\"\n    },\n    \"#node:util\": {\n      \"bare\": \"bare-utils\",\n      \"default\": \"util\"\n    },\n    \"#util\": {\n      \"bare\": \"bare-utils\",\n      \"default\": \"util\"\n    },\n    \"#node:events\": {\n      \"bare\": \"bare-events\",\n      \"default\": \"events\"\n    },\n    \"#events\": {\n      \"bare\": \"bare-events\",\n      \"default\": \"events\"\n    },\n    \"#node:path\": {\n      \"bare\": \"bare-path\",\n      \"default\": \"path\"\n    },\n    \"#path\": {\n      \"bare\": \"bare-path\",\n      \"default\": \"path\"\n    },\n    \"#node:os\": {\n      \"bare\": \"bare-os\",\n      \"default\": \"os\"\n    },\n    \"#os\": {\n      \"bare\": \"bare-os\",\n      \"default\": \"os\"\n    },\n    \"#node:process\": {\n      \"bare\": \"bare-process\",\n      \"default\": \"process\"\n    },\n    \"#process\": {\n      \"bare\": \"bare-process\",\n      \"default\": \"process\"\n    }\n  },\n  \"scripts\": {\n    \"test\": \"brittle test/**/*.test.js\",\n    \"format\": \"prettier --write .\",\n    \"bundle\": \"bare-pack --linked --imports ./pack.imports.json --out bundle/hyper-wallet.bundle.js cli.js\",\n    \"bundle:linux\": \"bare-pack --target linux-x64 --linked --imports ./pack.imports.json --out bundle/hyper-wallet.linux-x64.bundle.js cli.js\",\n    \"bundle:macos\": \"bare-pack --target darwin-arm64 --linked --imports ./pack.imports.json --out bundle/hyper-wallet.darwin-arm64.bundle.js cli.js\",\n    \"bundle:all\": \"npm run bundle:linux && npm run bundle:macos\",\n    \"pear:stage\": \"pear stage hyper-wallet .\",\n    \"pear:seed\": \"pear seed hyper-wallet .\",\n    \"check:pear\": \"node check-pear-version.js\",\n    \"pretest\": \"node check-pear-version.js\"\n  },\n  \"keywords\": [\n    \"wallet\",\n    \"cryptocurrency\",\n    \"p2p\",\n    \"holepunch\",\n    \"lightning\",\n    \"usdt\",\n    \"wdk\"\n  ],\n  \"author\": \"\",\n  \"license\": \"Apache-2.0\",\n  \"dependencies\": {\n    \"@tetherto/wdk\": \"^1.0.0-beta.5\",\n    \"@tetherto/wdk-wallet-btc\": \"^1.0.0-beta.4\",\n    \"@tetherto/wdk-wallet-evm\": \"^1.0.0-beta.4\",\n    \"autobase\": \"^7.25.0\",\n    \"b4a\": \"^1.6.0\",\n    \"bare-crypto\": \"^1.13.0\",\n    \"bare-node-runtime\": \"^1.1.4\",\n    \"bare-os\": \"^3.6.2\",\n    \"bare-path\": \"^3.0.0\",\n    \"bip39\": \"^3.0.0\",\n    \"bufferutil\": \"^4.1.0\",\n    \"corestore\": \"^7.0.0\",\n    \"hyperbee\": \"^2.26.0\",\n    \"hyperswarm\": \"^4.16.0\",\n    \"keet-identity-key\": \"^3.1.0\",\n    \"ledger-bitcoin\": \"^0.2.3\",\n    \"qrcode\": \"^1.5.0\",\n    \"utf-8-validate\": \"^6.0.6\"\n  },\n  \"optionalDependencies\": {\n    \"blind-pairing\": \"^2.0.0\",\n    \"paparam\": \"^1.10.0\"\n  },\n  \"devDependencies\": {\n    \"bare-pack\": \"^2.0.0\",\n    \"brittle\": \"^3.0.0\",\n    \"prettier\": \"^3.0.0\",\n    \"prettier-config-holepunch\": \"^1.0.0\"\n  }\n}\n// protocols/index.js - Protocol Registry\n//\n// Object mapping pattern (like Pear's runners)\n// Protocols are registered and enabled via config\n\nimport wdk from './wdk.js'\n\n// All available protocols\nconst protocols = {\n  wdk\n  // stellar: require('./stellar'),  // Future protocol\n  // nano: require('./nano'),        // Future protocol\n}\n\n/**\n * Get enabled protocols from config\n * @param {Object} config - Configuration object\n * @returns {Object} - Enabled protocol instances\n */\nexport function getEnabledProtocols(config) {\n  const enabled = config.protocols || ['wdk'] // Default to WDK\n\n  return Object.keys(protocols)\n    .filter(name => enabled.includes(name))\n    .reduce((acc, name) => {\n      acc[name] = protocols[name]\n      return acc\n    }, {})\n}\n\nexport { protocols }\n// protocols/wdk.js - Tether WDK Protocol Integration\n//\n// Implements the standard protocol interface for Tether WDK\n// Supports: Bitcoin, Ethereum, and EVM-compatible chains\n//\n// WDK Documentation: https://docs.wallet.tether.io\n\n// TEMPORARY: Use shims until Pear runtime upgrades to Bare v1.26.0+\n// See PEAR_BARE_SHIM_README.md for details\nimport WDK from '../shims/wdk-bare.js'\nimport WalletManagerEvm from '../shims/wdk-wallet-evm.js'\nimport WalletManagerBtc from '../shims/wdk-wallet-btc.js'\n\nexport default {\n  name: 'wdk',\n\n  // Protocol metadata\n  info: {\n    displayName: 'Tether WDK',\n    description: 'Multi-chain wallet with Bitcoin and Ethereum support',\n    chains: ['bitcoin', 'ethereum'],\n    stablecoin: true,\n    privacy: 'public',\n    speed: 'varies', // Depends on chain\n    fees: 'low' // Varies by chain\n  },\n\n  // Internal state\n  context: null,\n  wdk: null,\n  accounts: {},\n\n  /**\n   * Initialize WDK protocol\n   * @param {Object} context - Wallet context { identity, corestore, db, config }\n   * @returns {Object} - This protocol instance\n   */\n  async init(context) {\n    this.context = context\n\n    // Get mnemonic from identity\n    // keet-identity-key stores the mnemonic, we can access it\n    const mnemonic = context.identity.mnemonic\n\n    // Initialize WDK manager\n    this.wdk = new WDK(mnemonic)\n\n    // Register enabled blockchains\n    const chains = context.config.wdk.chains || ['ethereum', 'bitcoin']\n    const networks = context.config.wdk.networks\n\n    for (const chain of chains) {\n      if (chain === 'ethereum' && networks.ethereum) {\n        this.wdk.registerWallet('ethereum', WalletManagerEvm, {\n          provider: networks.ethereum.provider\n        })\n      } else if (chain === 'bitcoin' && networks.bitcoin) {\n        this.wdk.registerWallet('bitcoin', WalletManagerBtc, {\n          network: networks.bitcoin.network,\n          host: networks.bitcoin.host,\n          port: networks.bitcoin.port\n        })\n      }\n    }\n\n    // Get accounts (index 0 for each chain)\n    for (const chain of chains) {\n      try {\n        this.accounts[chain] = await this.wdk.getAccount(chain, 0)\n      } catch (err) {\n        console.error(`   ⚠️  Failed to get ${chain} account: ${err.message}`)\n      }\n    }\n\n    // Store wallet addresses in Hyperbee for multi-device sync\n    await this.storeWalletInfo()\n\n    console.log('   Chains:', chains.join(', '))\n\n    return this\n  },\n\n  /**\n   * Store wallet information in Hyperbee for multi-device sync\n   */\n  async storeWalletInfo() {\n    for (const [chain, account] of Object.entries(this.accounts)) {\n      try {\n        const address = await account.getAddress()\n        await this.context.db.put(`wallets/${chain}`, {\n          chain,\n          address,\n          createdAt: Date.now()\n        })\n      } catch (err) {\n        console.error(`   ⚠️  Failed to store ${chain} wallet info: ${err.message}`)\n      }\n    }\n  },\n\n  /**\n   * Get balances across all enabled chains\n   * @returns {Array<Object>} - Array of { chain, currency, amount }\n   */\n  async getBalance() {\n    const balances = []\n\n    for (const [chain, account] of Object.entries(this.accounts)) {\n      try {\n        const balance = await account.getBalance()\n        const address = await account.getAddress()\n\n        balances.push({\n          chain,\n          address,\n          currency: this.getCurrency(chain),\n          amount: balance.toString(), // bigint to string\n          wei: balance // Keep raw bigint for calculations\n        })\n      } catch (err) {\n        balances.push({\n          chain,\n          currency: this.getCurrency(chain),\n          error: err.message\n        })\n      }\n    }\n\n    return balances\n  },\n\n  /**\n   * Send payment\n   * @param {Object} params - { to, amount, chain, memo }\n   * @returns {Object} - Transaction details\n   */\n  async send({ to, amount, chain, memo }) {\n    // Select chain if not specified\n    if (!chain) {\n      chain = this.selectChain(to)\n    }\n\n    const account = this.accounts[chain]\n    if (!account) {\n      throw new Error(`Chain \"${chain}\" not enabled`)\n    }\n\n    // Send transaction\n    const result = await account.sendTransaction({\n      to,\n      value: BigInt(amount)\n    })\n\n    // Store transaction in Hyperbee\n    await this.context.db.put(`tx/${chain}/${result.hash}`, {\n      timestamp: Date.now(),\n      chain,\n      type: 'send',\n      to,\n      amount: amount.toString(),\n      hash: result.hash,\n      fee: result.fee.toString(),\n      memo\n    })\n\n    // Append to Autobase for multi-device sync\n    await this.context.txHistory.append(JSON.stringify({\n      timestamp: Date.now(),\n      chain,\n      type: 'send',\n      to,\n      amount: amount.toString(),\n      hash: result.hash\n    }))\n\n    return result\n  },\n\n  /**\n   * Create address for receiving payment\n   * @param {Object} params - { chain, amount, memo }\n   * @returns {Object} - Address details\n   */\n  async receive({ chain, amount, memo }) {\n    // Default to ethereum if not specified\n    if (!chain) {\n      chain = 'ethereum'\n    }\n\n    const account = this.accounts[chain]\n    if (!account) {\n      throw new Error(`Chain \"${chain}\" not enabled`)\n    }\n\n    // Get address\n    const address = await account.getAddress()\n\n    return {\n      address,\n      chain,\n      currency: this.getCurrency(chain),\n      amount,\n      memo\n    }\n  },\n\n  /**\n   * Get transaction history\n   * @param {Object} params - { limit, chain }\n   * @returns {Array} - Transaction history\n   */\n  async history({ limit = 50, chain = null }) {\n    const txs = []\n    const prefix = chain ? `tx/${chain}/` : 'tx/'\n\n    for await (const { key, value } of this.context.db.createReadStream()) {\n      if (key.startsWith(prefix)) {\n        txs.push(value)\n      }\n\n      if (txs.length >= limit) break\n    }\n\n    // Sort by timestamp (most recent first)\n    return txs.sort((a, b) => b.timestamp - a.timestamp)\n  },\n\n  /**\n   * Select appropriate chain based on address format\n   * @param {String} to - Recipient address\n   * @returns {String} - Chain name\n   */\n  selectChain(to) {\n    // Auto-detect from address format\n    if (to.startsWith('0x')) return 'ethereum'\n    if (to.startsWith('bc1') || to.startsWith('tb1')) return 'bitcoin' // Native SegWit\n    if (to.startsWith('1') || to.startsWith('3')) return 'bitcoin' // Legacy (though WDK only supports SegWit)\n\n    // Default to ethereum\n    return 'ethereum'\n  },\n\n  /**\n   * Get currency symbol for chain\n   * @param {String} chain - Chain name\n   * @returns {String} - Currency symbol\n   */\n  getCurrency(chain) {\n    const currencyMap = {\n      bitcoin: 'BTC',\n      ethereum: 'ETH'\n    }\n\n    return currencyMap[chain] || chain.toUpperCase()\n  },\n\n  /**\n   * Format balance for display\n   * @param {bigint} balance - Balance in wei or satoshis\n   * @param {String} chain - Chain name\n   * @returns {String} - Formatted balance\n   */\n  formatBalance(balance, chain) {\n    if (chain === 'bitcoin') {\n      // Bitcoin: satoshis to BTC (1 BTC = 100,000,000 satoshis)\n      return (Number(balance) / 1e8).toFixed(8)\n    } else if (chain === 'ethereum') {\n      // Ethereum: wei to ETH (1 ETH = 10^18 wei)\n      return (Number(balance) / 1e18).toFixed(18)\n    }\n    return balance.toString()\n  }\n}\n// ⚠️  TEMPORARY SHIM - DELETE WHEN PEAR RUNTIME UPGRADES TO BARE v1.26.0+\n//\n// Created: 2026-01-23\n// Reason: Pear runtime has Bare v1.24.3, but WDK requires v1.26.0+\n//\n// The official @tetherto/wdk/bare.js uses `with { imports: ... }` syntax which\n// requires Bare v1.26.0+, but Pear runtime currently has Bare v1.24.3.\n//\n// This shim:\n// 1. Imports bare-node-runtime/global to set up Node.js-compatible globals\n// 2. Re-exports from @tetherto/wdk/index.js directly (bypassing bare.js wrapper)\n// 3. Relies on package.json imports field for module resolution\n//\n// REMOVAL TRIGGER:\n// Run `node check-pear-version.js` - it will fail when upgrade is detected\n// See MIGRATION_PEAR_UPGRADE.md for removal instructions\n\nimport 'bare-node-runtime/global'\n\n// Import from the main index.js file directly, bypassing bare.js wrapper\n// The exports field in WDK package.json maps bare -> ./bare.js, default -> ./index.js\n// We need to reach into node_modules directly to avoid the exports field\nexport { default } from '../node_modules/@tetherto/wdk/index.js'\nexport * from '../node_modules/@tetherto/wdk/index.js'\n// ⚠️  TEMPORARY SHIM - DELETE WHEN PEAR RUNTIME UPGRADES TO BARE v1.26.0+\n//\n// Created: 2026-01-23\n// Reason: @tetherto/wdk-wallet-btc/bare.js uses `with { imports: ... }` syntax\n//\n// See PEAR_BARE_SHIM_README.md for details\n\nimport 'bare-node-runtime/global'\n\nexport { default } from '../node_modules/@tetherto/wdk-wallet-btc/index.js'\nexport * from '../node_modules/@tetherto/wdk-wallet-btc/index.js'\n// ⚠️  TEMPORARY SHIM - DELETE WHEN PEAR RUNTIME UPGRADES TO BARE v1.26.0+\n//\n// Created: 2026-01-23\n// Reason: @tetherto/wdk-wallet-evm/bare.js uses `with { imports: ... }` syntax\n//\n// See PEAR_BARE_SHIM_README.md for details\n\nimport 'bare-node-runtime/global'\n\nexport { default } from '../node_modules/@tetherto/wdk-wallet-evm/index.js'\nexport * from '../node_modules/@tetherto/wdk-wallet-evm/index.js'\n"