@wormhole-foundation/wormhole-connect 3.0.2-beta.0-development → 3.0.2-beta.1-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/{basic-ChNCp6rI.js → basic-PUjrTVXb.js} +1 -1
- package/dist/assets/{evm-DSirgd5b.js → evm-CO5UWnAY.js} +2 -2
- package/dist/assets/{index-L-lC4rqb.js → index-1lzfHdT2.js} +1 -1
- package/dist/assets/{index-CHfaLf5J.js → index-DBVZDYF7.js} +1 -1
- package/dist/assets/index-DKlPX3ZI.js +1 -0
- package/dist/assets/{index-BtCrMDAu.js → index-Ddk7n7Ti.js} +1 -1
- package/dist/assets/{index-HhyysXFu.js → index-DyUmO4PR.js} +1 -1
- package/dist/assets/{index-BiwA3Bbq.js → index-MMzKxP1N.js} +1 -1
- package/dist/assets/{secp256k1-Cd7rIav0.js → secp256k1-0LtSM2L1.js} +1 -1
- package/dist/assets/{secp256k1-BQBOR8e3.js → secp256k1-DwTU3j1N.js} +1 -1
- package/dist/assets/{solana-DcwLWeKT.js → solana-DlGdMBSL.js} +4 -4
- package/dist/assets/{w3m-modal-DdptuLHe.js → w3m-modal-DD9Jgepz.js} +1 -1
- package/dist/main.js +72 -70
- package/dist/src/AppRouter.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/config/tokens.d.ts +1 -1
- package/dist/src/config/tokens.d.ts.map +1 -1
- package/dist/src/exports/index.d.ts +2 -2
- package/dist/src/exports/index.d.ts.map +1 -1
- package/dist/src/hooks/useFetchQuotes.d.ts.map +1 -1
- package/dist/src/icons/Chains/PLUME.d.ts.map +1 -1
- package/dist/src/icons/PoweredBy.d.ts.map +1 -1
- package/dist/src/icons/Routing.d.ts +5 -0
- package/dist/src/icons/Routing.d.ts.map +1 -0
- package/dist/src/icons/Tokens/PLUME.d.ts.map +1 -1
- package/dist/src/store/transferInput.d.ts +1 -1
- package/dist/src/store/transferInput.d.ts.map +1 -1
- package/dist/src/utils/coingecko.d.ts.map +1 -1
- package/dist/src/utils/formatNumber.d.ts +23 -0
- package/dist/src/utils/formatNumber.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +3 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/routes.d.ts +12 -0
- package/dist/src/utils/routes.d.ts.map +1 -0
- package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/Eta.d.ts +6 -0
- package/dist/src/views/v3/Bridge/Routes/Eta.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RouteBadge.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts +7 -6
- package/dist/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/RoutesLink.d.ts +7 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesLink.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesList.d.ts +2 -1
- package/dist/src/views/v3/Bridge/Routes/RoutesList.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/RoutesLoader.d.ts +4 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesLoader.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/Routes/RoutesModal.d.ts +6 -5
- package/dist/src/views/v3/Bridge/Routes/RoutesModal.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts +1 -0
- package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
- package/dist/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/account-Br8E7RB6.js +1 -0
- package/lib/{account-BTK2b2Fv.mjs → account-CVa_3S2g.mjs} +1 -1
- package/lib/{address-8wLqn60W.mjs → address-BApwdEpr.mjs} +96 -96
- package/lib/address-BwQqFkyh.js +1 -0
- package/lib/address-C2pxq9b2.js +1 -0
- package/lib/{address-n0gAFMrZ.mjs → address-f6joE_ig.mjs} +12 -12
- package/lib/aptos-CMRGggVs.js +2 -0
- package/lib/{aptos-CK-j196x.js → aptos-CTKQNmlP.js} +1 -1
- package/lib/{aptos-B-DJQlwt.mjs → aptos-CfFbx7uf.mjs} +9 -9
- package/lib/{aptos-Bwcz9wZX.mjs → aptos-fozuppXh.mjs} +3 -3
- package/lib/{basic-DHWVLmCq.mjs → basic-BA2aRJJn.mjs} +2 -2
- package/lib/{basic-B5ZFelC_.js → basic-DUWaF2I0.js} +1 -1
- package/lib/{basic-E2M-9h1u.js → basic-DeiUayOA.js} +1 -1
- package/lib/{basic-Pour9Ggp.mjs → basic-DoC8u7J8.mjs} +2 -2
- package/lib/{blake2b-C5HyObld.mjs → blake2b-BGxWUAjG.mjs} +23 -23
- package/lib/blake2b-Fj1aPKgL.js +1 -0
- package/lib/{browser-ponyfill-jK8MKVVg.mjs → browser-ponyfill-D5AN8ZPp.mjs} +1 -1
- package/lib/browser-ponyfill-Dn6gsMYK.js +2 -0
- package/lib/{chain-Bm6u6eUF.mjs → chain-DAw2I5H8.mjs} +1 -1
- package/lib/chain-DnPXlO8g.js +1 -0
- package/lib/chunk-KJH4KKG6-BjF7YUcU.js +470 -0
- package/lib/{chunk-KJH4KKG6-DJsu-Y-X.mjs → chunk-KJH4KKG6-DmVjhXO7.mjs} +144 -144
- package/lib/{constants-Cf2YMjNo.js → constants-BtNs_2F4.js} +1 -1
- package/lib/{constants-B7AbX6qr.mjs → constants-Dcc2nVaW.mjs} +3 -3
- package/lib/contract-BEHYQLvJ.js +1 -0
- package/lib/{contract-llnN6ki0.mjs → contract-BkMAZomO.mjs} +123 -123
- package/lib/{core-CF5c7Vev.mjs → core-BHV42Qa0.mjs} +25 -26
- package/lib/core-CV23yxnG.js +889 -0
- package/lib/create-CHcGblj6.js +1 -0
- package/lib/{create-Dm87_0zG.mjs → create-CKLtL7hr.mjs} +1 -1
- package/lib/{evm-BYIGg8e4.mjs → evm-Bf7qbM19.mjs} +42 -42
- package/lib/{evm-B2hUWkt7.js → evm-ClWkquRx.js} +2 -2
- package/lib/{evm-fvvpk-li.mjs → evm-DhMoy8cH.mjs} +6 -6
- package/lib/{evm-DFNbMHoa.js → evm-tXmzU9Xp.js} +2 -2
- package/lib/executor.js +1 -1
- package/lib/executor.mjs +145 -138
- package/lib/hosted.js +1 -1
- package/lib/hosted.mjs +1 -1
- package/lib/{index-Cwo5AKUC.mjs → index-1rCCpdwd.mjs} +5 -5
- package/lib/{index-DBCa3k0j.mjs → index-3HvzWPL7.mjs} +9 -9
- package/lib/{index-MOwE6ses.mjs → index-B7ztYPhr.mjs} +21 -22
- package/lib/index-BM-0SeYB.js +1 -0
- package/lib/{index-DiQ8Ytrt.mjs → index-BTnpftLz.mjs} +1 -1
- package/lib/{index-BiCMaXJS.js → index-BWQMi6Rj.js} +1 -1
- package/lib/index-BbgKw2pu.js +1 -0
- package/lib/index-BblcpkoK.js +1 -0
- package/lib/index-Bfblsmud.js +1 -0
- package/lib/{index-C_0yAOSX.mjs → index-BfkFXEnG.mjs} +25082 -24072
- package/lib/{index-fi1sh8vr.mjs → index-BijBPDRn.mjs} +2 -2
- package/lib/index-BoquY9R2.js +337 -0
- package/lib/index-C2NtsO9Q.js +1 -0
- package/lib/{index-CNuk-XLX.mjs → index-C4JmrizV.mjs} +4 -4
- package/lib/index-C8TtXpOf.js +1 -0
- package/lib/index-CB8kOyIP.js +1 -0
- package/lib/index-CInVjUCW.js +1 -0
- package/lib/{index-BF11RebI.mjs → index-CLTklDbp.mjs} +1 -1
- package/lib/index-CQvgeH_r.js +1 -0
- package/lib/{index-DzYjoSJp.mjs → index-CUnOYRFQ.mjs} +23 -24
- package/lib/{index-DGh9LzN1.mjs → index-CWe_BTdo.mjs} +31 -31
- package/lib/{index-2Bz1Np4K.mjs → index-CZ91lJ9M.mjs} +5 -5
- package/lib/{index-Dgy1FO7C.js → index-CgyVnj6U.js} +1 -1
- package/lib/{index-BzJcFdt_.mjs → index-Clr2JjoJ.mjs} +44 -44
- package/lib/index-CnnCCv6Q.js +1 -0
- package/lib/{index-CJnRWlFf.mjs → index-CwxGLNEk.mjs} +48 -49
- package/lib/index-D7BLfz05.js +1 -0
- package/lib/index-DM7C-wvQ.js +3 -0
- package/lib/{index-DhIh3xiW.mjs → index-DNy_sNGr.mjs} +8 -8
- package/lib/{index-BZaRg0yd.mjs → index-DVcaDWmz.mjs} +1 -1
- package/lib/{index-CsAigASU.mjs → index-DWOP9OBp.mjs} +17 -17
- package/lib/{index-CTLz8Fz0.mjs → index-Dda5qc2t.mjs} +13 -14
- package/lib/{index-CLBXF_zH.mjs → index-DeaiBvpG.mjs} +16 -16
- package/lib/index-HOuGP-7b.js +1 -0
- package/lib/{index-Dt2uNp-N.mjs → index-KZve3tYJ.mjs} +4 -4
- package/lib/{index-CJDBidKv.mjs → index-SIyXqCAN.mjs} +41 -41
- package/lib/index-WhVYPMUr.js +1 -0
- package/lib/index-hmjT4xa7.js +1 -0
- package/lib/index-ledagFNU.js +1 -0
- package/lib/index-pbRVlgcN.js +1 -0
- package/lib/{index-BpQXUhR4.mjs → index-qK7AyMAk.mjs} +23 -27
- package/lib/index-ttZu99PZ.js +1 -0
- package/lib/{index.es-BqRBGIq6.mjs → index.es-BXRQf6Oi.mjs} +25 -26
- package/lib/index.es-BjGaOok5.js +11 -0
- package/lib/index.es-D6S74vhi.js +27 -0
- package/lib/{index.es-DgCZuUzB.mjs → index.es-cOw8juwf.mjs} +741 -737
- package/lib/index.js +1 -1
- package/lib/index.mjs +17 -16
- package/lib/mayan.js +3 -3
- package/lib/mayan.mjs +918 -891
- package/lib/mint-CL36R6ED.js +1 -0
- package/lib/{mint-Dc-VsiAn.mjs → mint-DunEG1jV.mjs} +32 -33
- package/lib/ntt.js +1 -1
- package/lib/ntt.mjs +2332 -2373
- package/lib/platform-7vCWzCny.js +1 -0
- package/lib/platform-BKhoO9So.js +1 -0
- package/lib/{platform-B95L0Vxv.mjs → platform-BN6LFtXE.mjs} +16 -16
- package/lib/{platform-DnP_1wGA.mjs → platform-BYLu9SzP.mjs} +4 -4
- package/lib/platform-Bbe26nx7.js +1 -0
- package/lib/{platform-DiG7WY9Z.mjs → platform-DCgWqmh1.mjs} +4 -4
- package/lib/{provider-jsonrpc-CRABh2gN.mjs → provider-jsonrpc-Bmgnrmpy.mjs} +155 -155
- package/lib/provider-jsonrpc-CbtP2Ffg.js +1 -0
- package/lib/{secp256k1-zHHDNAlH.mjs → secp256k1-BDQEvyHq.mjs} +1 -1
- package/lib/{secp256k1-obBDPYM-.mjs → secp256k1-C77Oh9AA.mjs} +1 -1
- package/lib/{secp256k1-2hq3Jk4g.mjs → secp256k1-CCn2vlXj.mjs} +1 -1
- package/lib/{secp256k1-B94G4gyy.js → secp256k1-CHAR40au.js} +1 -1
- package/lib/{secp256k1-DCcAh19h.js → secp256k1-D-DmPYcJ.js} +1 -1
- package/lib/{secp256k1-CjndBUS7.js → secp256k1-DYWDlveU.js} +1 -1
- package/lib/{signer-N_ccpPOz.mjs → signer-BIcn81N5.mjs} +18 -18
- package/lib/signer-H7atraks.js +1 -0
- package/lib/{solana-_Ha4YgiP.mjs → solana-B0QSg7B3.mjs} +30 -30
- package/lib/solana-Cs5VyB20.js +900 -0
- package/lib/solana-uvHG8JV5.js +1 -0
- package/lib/solana-zyfOlbhb.mjs +18 -0
- package/lib/{solanaEmbed.esm-DK5RIquB.mjs → solanaEmbed.esm-BqdznDuW.mjs} +623 -622
- package/lib/solanaEmbed.esm-D8vtESE6.js +10 -0
- package/lib/src/AppRouter.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/config/tokens.d.ts +1 -1
- package/lib/src/config/tokens.d.ts.map +1 -1
- package/lib/src/exports/index.d.ts +2 -2
- package/lib/src/exports/index.d.ts.map +1 -1
- package/lib/src/hooks/useFetchQuotes.d.ts.map +1 -1
- package/lib/src/icons/Chains/PLUME.d.ts.map +1 -1
- package/lib/src/icons/PoweredBy.d.ts.map +1 -1
- package/lib/src/icons/Routing.d.ts +5 -0
- package/lib/src/icons/Routing.d.ts.map +1 -0
- package/lib/src/icons/Tokens/PLUME.d.ts.map +1 -1
- package/lib/src/store/transferInput.d.ts +1 -1
- package/lib/src/store/transferInput.d.ts.map +1 -1
- package/lib/src/utils/coingecko.d.ts.map +1 -1
- package/lib/src/utils/formatNumber.d.ts +23 -0
- package/lib/src/utils/formatNumber.d.ts.map +1 -0
- package/lib/src/utils/index.d.ts +3 -1
- package/lib/src/utils/index.d.ts.map +1 -1
- package/lib/src/utils/routes.d.ts +12 -0
- package/lib/src/utils/routes.d.ts.map +1 -0
- package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/TokenItem.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/Eta.d.ts +6 -0
- package/lib/src/views/v3/Bridge/Routes/Eta.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RouteBadge.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts +7 -6
- package/lib/src/views/v3/Bridge/Routes/RoutesBottomSheet.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/RoutesLink.d.ts +7 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesLink.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesList.d.ts +2 -1
- package/lib/src/views/v3/Bridge/Routes/RoutesList.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/RoutesLoader.d.ts +4 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesLoader.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/Routes/RoutesModal.d.ts +6 -5
- package/lib/src/views/v3/Bridge/Routes/RoutesModal.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts +1 -0
- package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
- package/lib/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/{sui-CQcQ6w_P.mjs → sui-B38DyOqM.mjs} +44 -44
- package/lib/{sui-BplKFZQu.mjs → sui-BpfnZR4f.mjs} +3 -3
- package/lib/sui-CT9MWY38.js +1 -0
- package/lib/{sui-_hvmCvD8.js → sui-DXQAMRQJ.js} +1 -1
- package/lib/{tokens-DNv0ZNvU.js → tokens-CmINcwKk.js} +31 -31
- package/lib/{tokens-Dl4YwW18.mjs → tokens-YxAPPVy3.mjs} +1726 -1724
- package/lib/transfer-BQ72fByU.js +1 -0
- package/lib/transfer-bTW0j9yh.mjs +58 -0
- package/lib/units-Ckije3Qv.js +1 -0
- package/lib/{units-DPWUSE6J.mjs → units-CtyvuzxQ.mjs} +13 -13
- package/lib/unsignedTransaction-C6Qp42VS.js +1 -0
- package/lib/{unsignedTransaction-DwcUilyN.mjs → unsignedTransaction-CXB-QCUC.mjs} +18 -18
- package/lib/{w3m-modal-BJILsxDp.mjs → w3m-modal-B7LUHLWC.mjs} +2 -2
- package/lib/{w3m-modal-D4CpFxO2.mjs → w3m-modal-BOTzBqbc.mjs} +2 -2
- package/lib/{w3m-modal-CrfHWSrF.js → w3m-modal-BTb03-7B.js} +1 -1
- package/lib/{w3m-modal-CBG2MSPp.js → w3m-modal-xmdf4r6V.js} +1 -1
- package/lib/web3-COTIsLs8.js +22 -0
- package/lib/{address-B-XN4tFw.mjs → web3-DYVeiqSa.mjs} +6599 -6576
- package/package.json +32 -32
- package/dist/assets/index-BWPgrXHs.js +0 -1
- package/lib/account-cRt2xMoW.js +0 -1
- package/lib/address-BGujeWtN.js +0 -22
- package/lib/address-C7DIAk4M.js +0 -1
- package/lib/address-KNhRm6oe.js +0 -1
- package/lib/aptos-f5TqmvqV.js +0 -2
- package/lib/blake2b-B-MRXUPb.js +0 -1
- package/lib/browser-ponyfill-CE6vRkjp.js +0 -2
- package/lib/chain-Hsn22HAP.js +0 -1
- package/lib/chunk-KJH4KKG6-CoyI75Ig.js +0 -470
- package/lib/contract-D2fTrJgn.js +0 -1
- package/lib/core-v0G9f7LX.js +0 -889
- package/lib/create-DoZZ7ciL.js +0 -1
- package/lib/index-B8-KKWD-.js +0 -1
- package/lib/index-BHbvgOMD.js +0 -1
- package/lib/index-BHfUgvSV.js +0 -1
- package/lib/index-BTKC7Hou.js +0 -1
- package/lib/index-BWXglAWd.js +0 -1
- package/lib/index-Bpp8C4u8.js +0 -1
- package/lib/index-CF2fHBHJ.js +0 -3
- package/lib/index-CTPz98nv.js +0 -1
- package/lib/index-ClMoiji-.js +0 -1
- package/lib/index-ClsVcH6F.js +0 -1
- package/lib/index-CqOI6LVu.js +0 -1
- package/lib/index-DCz_4mcz.js +0 -1
- package/lib/index-DKksdvND.js +0 -335
- package/lib/index-DRv3ZpVL.js +0 -1
- package/lib/index-DYqo8IhM.js +0 -1
- package/lib/index-DZubce9o.js +0 -1
- package/lib/index-DprM_IpB.js +0 -1
- package/lib/index-DshEQYMA.js +0 -1
- package/lib/index-JrM783SN.js +0 -1
- package/lib/index.es-C6YhioMN.js +0 -27
- package/lib/index.es-D3Xxxr8I.js +0 -11
- package/lib/mint-DlXC3sGi.js +0 -1
- package/lib/platform-B1XoDKoN.js +0 -1
- package/lib/platform-COuZC5Zc.js +0 -1
- package/lib/platform-NG3efAb2.js +0 -1
- package/lib/provider-jsonrpc-pXNHQF7n.js +0 -1
- package/lib/signer-CCa6npZ3.js +0 -1
- package/lib/solana-BJ3aReZw.mjs +0 -18
- package/lib/solana-BwyVgP30.js +0 -1
- package/lib/solana-CanFuMgA.js +0 -900
- package/lib/solanaEmbed.esm-C--1F7Lx.js +0 -10
- package/lib/sui-Bs83Gy5Z.js +0 -1
- package/lib/units-BvcKDiAx.js +0 -1
- package/lib/unsignedTransaction-dN_5EJf5.js +0 -1
- package/lib/web3-Bu_6UejS.mjs +0 -67
- package/lib/web3-Doz_0RHD.js +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";const P=require("./web3-COTIsLs8.js"),mo=require("./index-BoquY9R2.js"),ar=require("./browser-ponyfill-Dn6gsMYK.js");var _e=mo.requireEvents();const vo=P.getDefaultExportFromCjs(_e);var je={};/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */var Ot=function(e,t){return Ot=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])},Ot(e,t)};function Eo(e,t){Ot(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Ft=function(){return Ft=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ft.apply(this,arguments)};function _o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function So(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(i=(o<3?a(i):o>3?a(t,r,i):a(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function Oo(e,t){return function(r,n){t(r,n,e)}}function Fo(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Co(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{s(n.next(u))}catch(f){a(f)}}function c(u){try{s(n.throw(u))}catch(f){a(f)}}function s(u){u.done?i(u.value):o(u.value).then(l,c)}s((n=n.apply(e,t||[])).next())})}function Ao(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(s){return function(u){return c([s,u])}}function c(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(u){s=[6,u],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function xo(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function Bo(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function Ct(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ln(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Io(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ln(arguments[t]));return e}function To(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)n[o]=i[a];return n}function Te(e){return this instanceof Te?(this.v=e,this):new Te(e)}function Ro(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(h){n[h]&&(o[h]=function(b){return new Promise(function(d,g){i.push([h,b,d,g])>1||l(h,b)})})}function l(h,b){try{c(n[h](b))}catch(d){f(i[0][3],d)}}function c(h){h.value instanceof Te?Promise.resolve(h.value.v).then(s,u):f(i[0][2],h)}function s(h){l("next",h)}function u(h){l("throw",h)}function f(h,b){h(b),i.shift(),i.length&&l(i[0][0],i[0][1])}}function No(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(a){return(r=!r)?{value:Te(e[o](a)),done:o==="return"}:i?i(a):a}:i}}function Po(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ct=="function"?Ct(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(l,c){a=e[i](a),o(l,c,a.done,a.value)})}}function o(i,a,l,c){Promise.resolve(c).then(function(s){i({value:s,done:l})},a)}}function jo(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Lo(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Uo(e){return e&&e.__esModule?e:{default:e}}function Mo(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function $o(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}const zo=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Ft},__asyncDelegator:No,__asyncGenerator:Ro,__asyncValues:Po,__await:Te,__awaiter:Co,__classPrivateFieldGet:Mo,__classPrivateFieldSet:$o,__createBinding:xo,__decorate:So,__exportStar:Bo,__extends:Eo,__generator:Ao,__importDefault:Uo,__importStar:Lo,__makeTemplateObject:jo,__metadata:Fo,__param:Oo,__read:ln,__rest:_o,__spread:Io,__spreadArrays:To,__values:Ct},Symbol.toStringTag,{value:"Module"})),tt=P.getAugmentedNamespace(zo);var ct={},Ae={},ur;function Wo(){if(ur)return Ae;ur=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.delay=void 0;function e(t){return new Promise(r=>{setTimeout(()=>{r(!0)},t)})}return Ae.delay=e,Ae}var fe={},lt={},he={},cr;function ko(){return cr||(cr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.ONE_THOUSAND=he.ONE_HUNDRED=void 0,he.ONE_HUNDRED=100,he.ONE_THOUSAND=1e3),he}var ft={},lr;function Ho(){return lr||(lr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365}(ft)),ft}var fr;function fn(){return fr||(fr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=tt;t.__exportStar(ko(),e),t.__exportStar(Ho(),e)}(lt)),lt}var hr;function Vo(){if(hr)return fe;hr=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.fromMiliseconds=fe.toMiliseconds=void 0;const e=fn();function t(n){return n*e.ONE_THOUSAND}fe.toMiliseconds=t;function r(n){return Math.floor(n/e.ONE_THOUSAND)}return fe.fromMiliseconds=r,fe}var dr;function qo(){return dr||(dr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=tt;t.__exportStar(Wo(),e),t.__exportStar(Vo(),e)}(ct)),ct}var De={},br;function Ko(){if(br)return De;br=1,Object.defineProperty(De,"__esModule",{value:!0}),De.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const o=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:o})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return De.Watch=e,De.default=e,De}var ht={},xe={},pr;function Go(){if(pr)return xe;pr=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.IWatch=void 0;class e{}return xe.IWatch=e,xe}var gr;function Yo(){return gr||(gr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),tt.__exportStar(Go(),e)}(ht)),ht}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=tt;t.__exportStar(qo(),e),t.__exportStar(Ko(),e),t.__exportStar(Yo(),e),t.__exportStar(fn(),e)})(je);class hn{}let Jo=class extends hn{constructor(t){super()}};const wr=je.FIVE_SECONDS,dn={pulse:"heartbeat_pulse"};let Xo=class bn extends Jo{constructor(t){super(t),this.events=new _e.EventEmitter,this.interval=wr,this.interval=(t==null?void 0:t.interval)||wr}static async init(t){const r=new bn(t);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),je.toMiliseconds(this.interval))}pulse(){this.events.emit(dn.pulse)}};const Zo=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Qo=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,ei=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function ti(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){ri(e);return}return t}function ri(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function We(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);const r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!ei.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Zo.test(e)||Qo.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,ti)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function ni(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function z(e,...t){try{return ni(e(...t))}catch(r){return Promise.reject(r)}}function oi(e){const t=typeof e;return e===null||t!=="object"&&t!=="function"}function ii(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function Ge(e){if(oi(e))return String(e);if(ii(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Ge(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const At="base64:";function si(e){return typeof e=="string"?e:At+ci(e)}function ai(e){return typeof e!="string"||!e.startsWith(At)?e:ui(e.slice(At.length))}function ui(e){return globalThis.Buffer?P.dist.Buffer.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function ci(e){return globalThis.Buffer?P.dist.Buffer.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function G(e){var t;return e&&((t=e.split("?")[0])==null?void 0:t.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function li(...e){return G(e.join(":"))}function ke(e){return e=G(e),e?e+":":""}function fi(e,t){if(t===void 0)return!0;let r=0,n=e.indexOf(":");for(;n>-1;)r++,n=e.indexOf(":",n+1);return r<=t}function hi(e,t){return t?e.startsWith(t)&&e[e.length-1]!=="$":e[e.length-1]!=="$"}const di="memory",bi=()=>{const e=new Map;return{name:di,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}};function pi(e={}){const t={mounts:{"":e.driver||bi()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=s=>{for(const u of t.mountpoints)if(s.startsWith(u))return{base:u,relativeKey:s.slice(u.length),driver:t.mounts[u]};return{base:"",relativeKey:s,driver:t.mounts[""]}},n=(s,u)=>t.mountpoints.filter(f=>f.startsWith(s)||u&&s.startsWith(f)).map(f=>({relativeBase:s.length>f.length?s.slice(f.length):void 0,mountpoint:f,driver:t.mounts[f]})),o=(s,u)=>{if(t.watching){u=G(u);for(const f of t.watchListeners)f(s,u)}},i=async()=>{if(!t.watching){t.watching=!0;for(const s in t.mounts)t.unwatch[s]=await Dr(t.mounts[s],o,s)}},a=async()=>{if(t.watching){for(const s in t.unwatch)await t.unwatch[s]();t.unwatch={},t.watching=!1}},l=(s,u,f)=>{const h=new Map,b=d=>{let g=h.get(d.base);return g||(g={driver:d.driver,base:d.base,items:[]},h.set(d.base,g)),g};for(const d of s){const g=typeof d=="string",D=G(g?d:d.key),y=g?void 0:d.value,S=g||!d.options?u:{...u,...d.options},p=r(D);b(p).items.push({key:D,value:y,relativeKey:p.relativeKey,options:S})}return Promise.all([...h.values()].map(d=>f(d))).then(d=>d.flat())},c={hasItem(s,u={}){s=G(s);const{relativeKey:f,driver:h}=r(s);return z(h.hasItem,f,u)},getItem(s,u={}){s=G(s);const{relativeKey:f,driver:h}=r(s);return z(h.getItem,f,u).then(b=>We(b))},getItems(s,u={}){return l(s,u,f=>f.driver.getItems?z(f.driver.getItems,f.items.map(h=>({key:h.relativeKey,options:h.options})),u).then(h=>h.map(b=>({key:li(f.base,b.key),value:We(b.value)}))):Promise.all(f.items.map(h=>z(f.driver.getItem,h.relativeKey,h.options).then(b=>({key:h.key,value:We(b)})))))},getItemRaw(s,u={}){s=G(s);const{relativeKey:f,driver:h}=r(s);return h.getItemRaw?z(h.getItemRaw,f,u):z(h.getItem,f,u).then(b=>ai(b))},async setItem(s,u,f={}){if(u===void 0)return c.removeItem(s);s=G(s);const{relativeKey:h,driver:b}=r(s);b.setItem&&(await z(b.setItem,h,Ge(u),f),b.watch||o("update",s))},async setItems(s,u){await l(s,u,async f=>{if(f.driver.setItems)return z(f.driver.setItems,f.items.map(h=>({key:h.relativeKey,value:Ge(h.value),options:h.options})),u);f.driver.setItem&&await Promise.all(f.items.map(h=>z(f.driver.setItem,h.relativeKey,Ge(h.value),h.options)))})},async setItemRaw(s,u,f={}){if(u===void 0)return c.removeItem(s,f);s=G(s);const{relativeKey:h,driver:b}=r(s);if(b.setItemRaw)await z(b.setItemRaw,h,u,f);else if(b.setItem)await z(b.setItem,h,si(u),f);else return;b.watch||o("update",s)},async removeItem(s,u={}){typeof u=="boolean"&&(u={removeMeta:u}),s=G(s);const{relativeKey:f,driver:h}=r(s);h.removeItem&&(await z(h.removeItem,f,u),(u.removeMeta||u.removeMata)&&await z(h.removeItem,f+"$",u),h.watch||o("remove",s))},async getMeta(s,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),s=G(s);const{relativeKey:f,driver:h}=r(s),b=Object.create(null);if(h.getMeta&&Object.assign(b,await z(h.getMeta,f,u)),!u.nativeOnly){const d=await z(h.getItem,f+"$",u).then(g=>We(g));d&&typeof d=="object"&&(typeof d.atime=="string"&&(d.atime=new Date(d.atime)),typeof d.mtime=="string"&&(d.mtime=new Date(d.mtime)),Object.assign(b,d))}return b},setMeta(s,u,f={}){return this.setItem(s+"$",u,f)},removeMeta(s,u={}){return this.removeItem(s+"$",u)},async getKeys(s,u={}){var D;s=ke(s);const f=n(s,!0);let h=[];const b=[];let d=!0;for(const y of f){(D=y.driver.flags)!=null&&D.maxDepth||(d=!1);const S=await z(y.driver.getKeys,y.relativeBase,u);for(const p of S){const m=y.mountpoint+G(p);h.some(F=>m.startsWith(F))||b.push(m)}h=[y.mountpoint,...h.filter(p=>!p.startsWith(y.mountpoint))]}const g=u.maxDepth!==void 0&&!d;return b.filter(y=>(!g||fi(y,u.maxDepth))&&hi(y,s))},async clear(s,u={}){s=ke(s),await Promise.all(n(s,!1).map(async f=>{if(f.driver.clear)return z(f.driver.clear,f.relativeBase,u);if(f.driver.removeItem){const h=await f.driver.getKeys(f.relativeBase||"",u);return Promise.all(h.map(b=>f.driver.removeItem(b,u)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(s=>yr(s)))},async watch(s){return await i(),t.watchListeners.push(s),async()=>{t.watchListeners=t.watchListeners.filter(u=>u!==s),t.watchListeners.length===0&&await a()}},async unwatch(){t.watchListeners=[],await a()},mount(s,u){if(s=ke(s),s&&t.mounts[s])throw new Error(`already mounted at ${s}`);return s&&(t.mountpoints.push(s),t.mountpoints.sort((f,h)=>h.length-f.length)),t.mounts[s]=u,t.watching&&Promise.resolve(Dr(u,o,s)).then(f=>{t.unwatch[s]=f}).catch(console.error),c},async unmount(s,u=!0){var f,h;s=ke(s),!(!s||!t.mounts[s])&&(t.watching&&s in t.unwatch&&((h=(f=t.unwatch)[s])==null||h.call(f),delete t.unwatch[s]),u&&await yr(t.mounts[s]),t.mountpoints=t.mountpoints.filter(b=>b!==s),delete t.mounts[s])},getMount(s=""){s=G(s)+":";const u=r(s);return{driver:u.driver,base:u.base}},getMounts(s="",u={}){return s=G(s),n(s,u.parents).map(h=>({driver:h.driver,base:h.mountpoint}))},keys:(s,u={})=>c.getKeys(s,u),get:(s,u={})=>c.getItem(s,u),set:(s,u,f={})=>c.setItem(s,u,f),has:(s,u={})=>c.hasItem(s,u),del:(s,u={})=>c.removeItem(s,u),remove:(s,u={})=>c.removeItem(s,u)};return c}function Dr(e,t,r){return e.watch?e.watch((n,o)=>t(n,r+o)):()=>{}}async function yr(e){typeof e.dispose=="function"&&await z(e.dispose)}function be(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function pn(e,t){let r;const n=()=>{if(r)return r;const o=indexedDB.open(e);return o.onupgradeneeded=()=>o.result.createObjectStore(t),r=be(o),r.then(i=>{i.onclose=()=>r=void 0},()=>{}),r};return(o,i)=>n().then(a=>i(a.transaction(t,o).objectStore(t)))}let dt;function Le(){return dt||(dt=pn("keyval-store","keyval")),dt}function mr(e,t=Le()){return t("readonly",r=>be(r.get(e)))}function gi(e,t,r=Le()){return r("readwrite",n=>(n.put(t,e),be(n.transaction)))}function wi(e,t=Le()){return t("readwrite",r=>(r.delete(e),be(r.transaction)))}function Di(e=Le()){return e("readwrite",t=>(t.clear(),be(t.transaction)))}function yi(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},be(e.transaction)}function mi(e=Le()){return e("readonly",t=>{if(t.getAllKeys)return be(t.getAllKeys());const r=[];return yi(t,n=>r.push(n.key)).then(()=>r)})}const vi=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),Ei=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function Se(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return Ei(e)}catch{return e}}function ie(e){return typeof e=="string"?e:vi(e)||""}const _i="idb-keyval";var Si=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=o=>t+o;let n;return e.dbName&&e.storeName&&(n=pn(e.dbName,e.storeName)),{name:_i,options:e,async hasItem(o){return!(typeof await mr(r(o),n)>"u")},async getItem(o){return await mr(r(o),n)??null},setItem(o,i){return gi(r(o),i,n)},removeItem(o){return wi(r(o),n)},getKeys(){return mi(n)},clear(){return Di(n)}}};const Oi="WALLET_CONNECT_V2_INDEXED_DB",Fi="keyvaluestorage";let Ci=class{constructor(){this.indexedDb=pi({driver:Si({dbName:Oi,storeName:Fi})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const r=await this.indexedDb.getItem(t);if(r!==null)return r}async setItem(t,r){await this.indexedDb.setItem(t,ie(r))}async removeItem(t){await this.indexedDb.removeItem(t)}};var bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof P.dist.global<"u"?P.dist.global:typeof self<"u"?self:{},Ye={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},e.prototype.setItem=function(r,n){this[r]=String(n)},e.prototype.removeItem=function(r){delete this[r]},e.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},e.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof bt<"u"&&bt.localStorage?Ye.exports=bt.localStorage:typeof window<"u"&&window.localStorage?Ye.exports=window.localStorage:Ye.exports=new t})();function Ai(e){var t;return[e[0],Se((t=e[1])!=null?t:"")]}let xi=class{constructor(){this.localStorage=Ye.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Ai)}async getItem(t){const r=this.localStorage.getItem(t);if(r!==null)return Se(r)}async setItem(t,r){this.localStorage.setItem(t,ie(r))}async removeItem(t){this.localStorage.removeItem(t)}};const Bi="wc_storage_version",vr=1,Ii=async(e,t,r)=>{const n=Bi,o=await t.getItem(n);if(o&&o>=vr){r(t);return}const i=await e.getKeys();if(!i.length){r(t);return}const a=[];for(;i.length;){const l=i.shift();if(!l)continue;const c=l.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const s=await e.getItem(l);await t.setItem(l,s),a.push(l)}}await t.setItem(n,vr),r(t),Ti(e,a)},Ti=async(e,t)=>{t.length&&t.forEach(async r=>{await e.removeItem(r)})};let Ri=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const t=new xi;this.storage=t;try{const r=new Ci;Ii(t,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,r){return await this.initialize(),this.storage.setItem(t,r)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),t())},20)})}};function Ni(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Pi=ji;function ji(e,t,r){var n=r&&r.stringify||Ni,o=1;if(typeof e=="object"&&e!==null){var i=t.length+o;if(i===1)return e;var a=new Array(i);a[0]=n(e);for(var l=1;l<i;l++)a[l]=n(t[l]);return a.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var s="",u=1-o,f=-1,h=e&&e.length||0,b=0;b<h;){if(e.charCodeAt(b)===37&&b+1<h){switch(f=f>-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(u>=c||t[u]==null)break;f<b&&(s+=e.slice(f,b)),s+=Number(t[u]),f=b+2,b++;break;case 105:if(u>=c||t[u]==null)break;f<b&&(s+=e.slice(f,b)),s+=Math.floor(Number(t[u])),f=b+2,b++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;f<b&&(s+=e.slice(f,b));var d=typeof t[u];if(d==="string"){s+="'"+t[u]+"'",f=b+2,b++;break}if(d==="function"){s+=t[u].name||"<anonymous>",f=b+2,b++;break}s+=n(t[u]),f=b+2,b++;break;case 115:if(u>=c)break;f<b&&(s+=e.slice(f,b)),s+=String(t[u]),f=b+2,b++;break;case 37:f<b&&(s+=e.slice(f,b)),s+="%",f=b+2,b++,u--;break}++u}++b}return f===-1?e:(f<h&&(s+=e.slice(f)),s)}const Er=Pi;var Ee=Z;const Re=qi().console||{},Li={mapHttpRequest:He,mapHttpResponse:He,wrapRequestSerializer:pt,wrapResponseSerializer:pt,wrapErrorSerializer:pt,req:He,res:He,err:Wi};function Ui(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function Z(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const r=e.browser.write||Re;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},o=Ui(e.browser.serialize,n);let i=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(i=!1);const a=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),e.enabled===!1&&(e.level="silent");const l=e.level||"info",c=Object.create(r);c.log||(c.log=Ne),Object.defineProperty(c,"levelVal",{get:u}),Object.defineProperty(c,"level",{get:f,set:h});const s={transmit:t,serialize:o,asObject:e.browser.asObject,levels:a,timestamp:ki(e)};c.levels=Z.levels,c.level=l,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=Ne,c.serializers=n,c._serialize=o,c._stdErrSerialize=i,c.child=b,t&&(c._logEvent=xt());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function f(){return this._level}function h(d){if(d!=="silent"&&!this.levels.values[d])throw Error("unknown level "+d);this._level=d,ye(s,c,"error","log"),ye(s,c,"fatal","error"),ye(s,c,"warn","error"),ye(s,c,"info","log"),ye(s,c,"debug","log"),ye(s,c,"trace","log")}function b(d,g){if(!d)throw new Error("missing bindings for child Pino");g=g||{},o&&d.serializers&&(g.serializers=d.serializers);const D=g.serializers;if(o&&D){var y=Object.assign({},n,D),S=e.browser.serialize===!0?Object.keys(y):o;delete d.serializers,rt([d],S,y,this._stdErrSerialize)}function p(m){this._childLevel=(m._childLevel|0)+1,this.error=me(m,d,"error"),this.fatal=me(m,d,"fatal"),this.warn=me(m,d,"warn"),this.info=me(m,d,"info"),this.debug=me(m,d,"debug"),this.trace=me(m,d,"trace"),y&&(this.serializers=y,this._serialize=S),t&&(this._logEvent=xt([].concat(m._logEvent.bindings,d)))}return p.prototype=this,new p(this)}return c}Z.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};Z.stdSerializers=Li;Z.stdTimeFunctions=Object.assign({},{nullTime:gn,epochTime:wn,unixTime:Hi,isoTime:Vi});function ye(e,t,r,n){const o=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?Ne:o[r]?o[r]:Re[r]||Re[n]||Ne,Mi(e,t,r)}function Mi(e,t,r){!e.transmit&&t[r]===Ne||(t[r]=function(n){return function(){const i=e.timestamp(),a=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Re?Re:this;for(var c=0;c<a.length;c++)a[c]=arguments[c];if(e.serialize&&!e.asObject&&rt(a,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?n.call(l,$i(this,r,a,i)):n.apply(l,a),e.transmit){const s=e.transmit.level||t.level,u=Z.levels.values[s],f=Z.levels.values[r];if(f<u)return;zi(this,{ts:i,methodLevel:r,methodValue:f,transmitValue:Z.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},a)}}}(t[r]))}function $i(e,t,r,n){e._serialize&&rt(r,e._serialize,e.serializers,e._stdErrSerialize);const o=r.slice();let i=o[0];const a={};n&&(a.time=n),a.level=Z.levels.values[t];let l=(e._childLevel|0)+1;if(l<1&&(l=1),i!==null&&typeof i=="object"){for(;l--&&typeof o[0]=="object";)Object.assign(a,o.shift());i=o.length?Er(o.shift(),o):void 0}else typeof i=="string"&&(i=Er(o.shift(),o));return i!==void 0&&(a.msg=i),a}function rt(e,t,r,n){for(const o in e)if(n&&e[o]instanceof Error)e[o]=Z.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o]))for(const i in e[o])t&&t.indexOf(i)>-1&&i in r&&(e[o][i]=r[i](e[o][i]))}function me(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var o=1;o<n.length;o++)n[o]=arguments[o-1];return e[r].apply(this,n)}}function zi(e,t,r){const n=t.send,o=t.ts,i=t.methodLevel,a=t.methodValue,l=t.val,c=e._logEvent.bindings;rt(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=r.filter(function(s){return c.indexOf(s)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=a,n(i,e._logEvent,l),e._logEvent=xt(c)}function xt(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Wi(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)t[r]===void 0&&(t[r]=e[r]);return t}function ki(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?gn:wn}function He(){return{}}function pt(e){return e}function Ne(){}function gn(){return!1}function wn(){return Date.now()}function Hi(){return Math.round(Date.now()/1e3)}function Vi(){return new Date(Date.now()).toISOString()}function qi(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const Ut=P.getDefaultExportFromCjs(Ee),Ki={level:"info"},Ue="custom_context",Mt=1e3*1024;let Gi=class{constructor(t){this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},_r=class{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const r=new Gi(t);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let r=this.head;for(;r!==null;)t.push(r.value),r=r.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const r=t.value;return t=t.next,{done:!1,value:r}}}}},Dn=class{constructor(t,r=Mt){this.level=t??"error",this.levelValue=Ee.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new _r(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,r){r===Ee.levels.values.error?console.error(t):r===Ee.levels.values.warn?console.warn(t):r===Ee.levels.values.debug?console.debug(t):r===Ee.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(ie({timestamp:new Date().toISOString(),log:t}));const r=typeof t=="string"?JSON.parse(t).level:t.level;r>=this.levelValue&&this.forwardToConsole(t,r)}getLogs(){return this.logs}clearLogs(){this.logs=new _r(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const r=this.getLogArray();return r.push(ie({extraMetadata:t})),new Blob(r,{type:"application/json"})}};class Yi{constructor(t,r=Mt){this.baseChunkLogger=new Dn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const r=URL.createObjectURL(this.logsToBlob(t)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}class Ji{constructor(t,r=Mt){this.baseChunkLogger=new Dn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var Xi=Object.defineProperty,Zi=Object.defineProperties,Qi=Object.getOwnPropertyDescriptors,Sr=Object.getOwnPropertySymbols,es=Object.prototype.hasOwnProperty,ts=Object.prototype.propertyIsEnumerable,Or=(e,t,r)=>t in e?Xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xe=(e,t)=>{for(var r in t||(t={}))es.call(t,r)&&Or(e,r,t[r]);if(Sr)for(var r of Sr(t))ts.call(t,r)&&Or(e,r,t[r]);return e},Ze=(e,t)=>Zi(e,Qi(t));function rs(e){return Ze(Xe({},e),{level:(e==null?void 0:e.level)||Ki.level})}function ns(e,t=Ue){return e[t]||""}function os(e,t,r=Ue){return e[r]=t,e}function yn(e,t=Ue){let r="";return typeof e.bindings>"u"?r=ns(e,t):r=e.bindings().context||"",r}function is(e,t,r=Ue){const n=yn(e,r);return n.trim()?`${n}/${t}`:t}function ss(e,t,r=Ue){const n=is(e,t,r),o=e.child({context:n});return os(o,n,r)}function as(e){var t,r;const n=new Yi((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Ut(Ze(Xe({},e.opts),{level:"trace",browser:Ze(Xe({},(r=e.opts)==null?void 0:r.browser),{write:o=>n.write(o)})})),chunkLoggerController:n}}function us(e){var t;const r=new Ji((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Ut(Ze(Xe({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}function cs(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?as(e):us(e)}function ls(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function mn(e,...t){if(!ls(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Fr(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function fs(e,t){mn(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const ve=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gt=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function hs(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function vn(e){return typeof e=="string"&&(e=hs(e)),mn(e),e}class ds{clone(){return this._cloneInto()}}function bs(e){const t=n=>e().update(vn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function En(e=32){if(ve&&typeof ve.getRandomValues=="function")return ve.getRandomValues(new Uint8Array(e));if(ve&&typeof ve.randomBytes=="function")return ve.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function ps(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),l=Number(r&i),c=n?4:0,s=n?0:4;e.setUint32(t+c,a,n),e.setUint32(t+s,l,n)}class gs extends ds{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=gt(this.buffer)}update(t){Fr(this);const{view:r,buffer:n,blockLen:o}=this;t=vn(t);const i=t.length;for(let a=0;a<i;){const l=Math.min(o-this.pos,i-a);if(l===o){const c=gt(t);for(;o<=i-a;a+=o)this.process(c,a);continue}n.set(t.subarray(a,a+l),this.pos),this.pos+=l,a+=l,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Fr(this),fs(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:o,isLE:i}=this;let{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let f=a;f<o;f++)r[f]=0;ps(n,o-8,BigInt(this.length*8),i),this.process(n,0);const l=gt(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const s=c/4,u=this.get();if(s>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<s;f++)l.setUint32(4*f,u[f],i)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:o,finished:i,destroyed:a,pos:l}=this;return t.length=o,t.pos=l,t.finished=i,t.destroyed=a,o%r&&t.buffer.set(n),t}}const Ve=BigInt(2**32-1),Bt=BigInt(32);function _n(e,t=!1){return t?{h:Number(e&Ve),l:Number(e>>Bt&Ve)}:{h:Number(e>>Bt&Ve)|0,l:Number(e&Ve)|0}}function ws(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:i,l:a}=_n(e[o],t);[r[o],n[o]]=[i,a]}return[r,n]}const Ds=(e,t)=>BigInt(e>>>0)<<Bt|BigInt(t>>>0),ys=(e,t,r)=>e>>>r,ms=(e,t,r)=>e<<32-r|t>>>r,vs=(e,t,r)=>e>>>r|t<<32-r,Es=(e,t,r)=>e<<32-r|t>>>r,_s=(e,t,r)=>e<<64-r|t>>>r-32,Ss=(e,t,r)=>e>>>r-32|t<<64-r,Os=(e,t)=>t,Fs=(e,t)=>e,Cs=(e,t,r)=>e<<r|t>>>32-r,As=(e,t,r)=>t<<r|e>>>32-r,xs=(e,t,r)=>t<<r-32|e>>>64-r,Bs=(e,t,r)=>e<<r-32|t>>>64-r;function Is(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}const Ts=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Rs=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Ns=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Ps=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,js=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),Ls=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,O={fromBig:_n,split:ws,toBig:Ds,shrSH:ys,shrSL:ms,rotrSH:vs,rotrSL:Es,rotrBH:_s,rotrBL:Ss,rotr32H:Os,rotr32L:Fs,rotlSH:Cs,rotlSL:As,rotlBH:xs,rotlBL:Bs,add:Is,add3L:Ts,add3H:Rs,add4L:Ns,add4H:Ps,add5H:Ls,add5L:js},[Us,Ms]=O.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ae=new Uint32Array(80),ue=new Uint32Array(80);class $s extends gs{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:o,Ch:i,Cl:a,Dh:l,Dl:c,Eh:s,El:u,Fh:f,Fl:h,Gh:b,Gl:d,Hh:g,Hl:D}=this;return[t,r,n,o,i,a,l,c,s,u,f,h,b,d,g,D]}set(t,r,n,o,i,a,l,c,s,u,f,h,b,d,g,D){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=a|0,this.Dh=l|0,this.Dl=c|0,this.Eh=s|0,this.El=u|0,this.Fh=f|0,this.Fl=h|0,this.Gh=b|0,this.Gl=d|0,this.Hh=g|0,this.Hl=D|0}process(t,r){for(let p=0;p<16;p++,r+=4)ae[p]=t.getUint32(r),ue[p]=t.getUint32(r+=4);for(let p=16;p<80;p++){const m=ae[p-15]|0,F=ue[p-15]|0,T=O.rotrSH(m,F,1)^O.rotrSH(m,F,8)^O.shrSH(m,F,7),B=O.rotrSL(m,F,1)^O.rotrSL(m,F,8)^O.shrSL(m,F,7),C=ae[p-2]|0,j=ue[p-2]|0,ge=O.rotrSH(C,j,19)^O.rotrBH(C,j,61)^O.shrSH(C,j,6),ce=O.rotrSL(C,j,19)^O.rotrBL(C,j,61)^O.shrSL(C,j,6),we=O.add4L(B,ce,ue[p-7],ue[p-16]),Ce=O.add4H(we,T,ge,ae[p-7],ae[p-16]);ae[p]=Ce|0,ue[p]=we|0}let{Ah:n,Al:o,Bh:i,Bl:a,Ch:l,Cl:c,Dh:s,Dl:u,Eh:f,El:h,Fh:b,Fl:d,Gh:g,Gl:D,Hh:y,Hl:S}=this;for(let p=0;p<80;p++){const m=O.rotrSH(f,h,14)^O.rotrSH(f,h,18)^O.rotrBH(f,h,41),F=O.rotrSL(f,h,14)^O.rotrSL(f,h,18)^O.rotrBL(f,h,41),T=f&b^~f&g,B=h&d^~h&D,C=O.add5L(S,F,B,Ms[p],ue[p]),j=O.add5H(C,y,m,T,Us[p],ae[p]),ge=C|0,ce=O.rotrSH(n,o,28)^O.rotrBH(n,o,34)^O.rotrBH(n,o,39),we=O.rotrSL(n,o,28)^O.rotrBL(n,o,34)^O.rotrBL(n,o,39),Ce=n&i^n&l^i&l,at=o&a^o&c^a&c;y=g|0,S=D|0,g=b|0,D=d|0,b=f|0,d=h|0,{h:f,l:h}=O.add(s|0,u|0,j|0,ge|0),s=l|0,u=c|0,l=i|0,c=a|0,i=n|0,a=o|0;const E=O.add3L(ge,we,at);n=O.add3H(E,j,ce,Ce),o=E|0}({h:n,l:o}=O.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:a}=O.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:l,l:c}=O.add(this.Ch|0,this.Cl|0,l|0,c|0),{h:s,l:u}=O.add(this.Dh|0,this.Dl|0,s|0,u|0),{h:f,l:h}=O.add(this.Eh|0,this.El|0,f|0,h|0),{h:b,l:d}=O.add(this.Fh|0,this.Fl|0,b|0,d|0),{h:g,l:D}=O.add(this.Gh|0,this.Gl|0,g|0,D|0),{h:y,l:S}=O.add(this.Hh|0,this.Hl|0,y|0,S|0),this.set(n,o,i,a,l,c,s,u,f,h,b,d,g,D,y,S)}roundClean(){ae.fill(0),ue.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const zs=bs(()=>new $s);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $t=BigInt(0),Sn=BigInt(1),Ws=BigInt(2);function zt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Wt(e){if(!zt(e))throw new Error("Uint8Array expected")}function wt(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const ks=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function kt(e){Wt(e);let t="";for(let r=0;r<e.length;r++)t+=ks[e[r]];return t}function On(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?$t:BigInt("0x"+e)}const te={_0:48,_9:57,A:65,F:70,a:97,f:102};function Cr(e){if(e>=te._0&&e<=te._9)return e-te._0;if(e>=te.A&&e<=te.F)return e-(te.A-10);if(e>=te.a&&e<=te.f)return e-(te.a-10)}function Fn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const a=Cr(e.charCodeAt(i)),l=Cr(e.charCodeAt(i+1));if(a===void 0||l===void 0){const c=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=a*16+l}return n}function Hs(e){return On(kt(e))}function Je(e){return Wt(e),On(kt(Uint8Array.from(e).reverse()))}function Cn(e,t){return Fn(e.toString(16).padStart(t*2,"0"))}function It(e,t){return Cn(e,t).reverse()}function re(e,t,r){let n;if(typeof t=="string")try{n=Fn(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(zt(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function Ar(...e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];Wt(o),t+=o.length}const r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){const i=e[n];r.set(i,o),o+=i.length}return r}const Dt=e=>typeof e=="bigint"&&$t<=e;function Vs(e,t,r){return Dt(e)&&Dt(t)&&Dt(r)&&t<=e&&e<r}function Be(e,t,r,n){if(!Vs(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function qs(e){let t;for(t=0;e>$t;e>>=Sn,t+=1);return t}const Ks=e=>(Ws<<BigInt(e-1))-Sn,Gs={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||zt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ht(e,t,r={}){const n=(o,i,a)=>{const l=Gs[i];if(typeof l!="function")throw new Error("invalid validator function");const c=e[o];if(!(a&&c===void 0)&&!l(c,e))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+c)};for(const[o,i]of Object.entries(t))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return e}function xr(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0)return o;const i=e(r,...n);return t.set(r,i),i}}const W=BigInt(0),M=BigInt(1),de=BigInt(2),Ys=BigInt(3),Tt=BigInt(4),Br=BigInt(5),Ir=BigInt(8);function $(e,t){const r=e%t;return r>=W?r:t+r}function Js(e,t,r){if(t<W)throw new Error("invalid exponent, negatives unsupported");if(r<=W)throw new Error("invalid modulus");if(r===M)return W;let n=M;for(;t>W;)t&M&&(n=n*e%r),e=e*e%r,t>>=M;return n}function X(e,t,r){let n=e;for(;t-- >W;)n*=n,n%=r;return n}function Tr(e,t){if(e===W)throw new Error("invert: expected non-zero number");if(t<=W)throw new Error("invert: expected positive modulus, got "+t);let r=$(e,t),n=t,o=W,i=M;for(;r!==W;){const a=n/r,l=n%r,c=o-i*a;n=r,r=l,o=i,i=c}if(n!==M)throw new Error("invert: does not exist");return $(o,t)}function Xs(e){const t=(e-M)/de;let r,n,o;for(r=e-M,n=0;r%de===W;r/=de,n++);for(o=de;o<e&&Js(o,t,e)!==e-M;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const a=(e+M)/Tt;return function(l,c){const s=l.pow(c,a);if(!l.eql(l.sqr(s),c))throw new Error("Cannot find square root");return s}}const i=(r+M)/de;return function(a,l){if(a.pow(l,t)===a.neg(a.ONE))throw new Error("Cannot find square root");let c=n,s=a.pow(a.mul(a.ONE,o),r),u=a.pow(l,i),f=a.pow(l,r);for(;!a.eql(f,a.ONE);){if(a.eql(f,a.ZERO))return a.ZERO;let h=1;for(let d=a.sqr(f);h<c&&!a.eql(d,a.ONE);h++)d=a.sqr(d);const b=a.pow(s,M<<BigInt(c-h-1));s=a.sqr(b),u=a.mul(u,b),f=a.mul(f,s),c=h}return u}}function Zs(e){if(e%Tt===Ys){const t=(e+M)/Tt;return function(r,n){const o=r.pow(n,t);if(!r.eql(r.sqr(o),n))throw new Error("Cannot find square root");return o}}if(e%Ir===Br){const t=(e-Br)/Ir;return function(r,n){const o=r.mul(n,de),i=r.pow(o,t),a=r.mul(n,i),l=r.mul(r.mul(a,de),i),c=r.mul(a,r.sub(l,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return Xs(e)}const Qs=(e,t)=>($(e,t)&M)===M,ea=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ta(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=ea.reduce((n,o)=>(n[o]="function",n),t);return Ht(e,r)}function ra(e,t,r){if(r<W)throw new Error("invalid exponent, negatives unsupported");if(r===W)return e.ONE;if(r===M)return t;let n=e.ONE,o=t;for(;r>W;)r&M&&(n=e.mul(n,o)),o=e.sqr(o),r>>=M;return n}function na(e,t){const r=new Array(t.length),n=t.reduce((i,a,l)=>e.is0(a)?i:(r[l]=i,e.mul(i,a)),e.ONE),o=e.inv(n);return t.reduceRight((i,a,l)=>e.is0(a)?i:(r[l]=e.mul(i,r[l]),e.mul(i,a)),o),r}function An(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function xn(e,t,r=!1,n={}){if(e<=W)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:i}=An(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const l=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:Ks(o),ZERO:W,ONE:M,create:c=>$(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return W<=c&&c<e},is0:c=>c===W,isOdd:c=>(c&M)===M,neg:c=>$(-c,e),eql:(c,s)=>c===s,sqr:c=>$(c*c,e),add:(c,s)=>$(c+s,e),sub:(c,s)=>$(c-s,e),mul:(c,s)=>$(c*s,e),pow:(c,s)=>ra(l,c,s),div:(c,s)=>$(c*Tr(s,e),e),sqrN:c=>c*c,addN:(c,s)=>c+s,subN:(c,s)=>c-s,mulN:(c,s)=>c*s,inv:c=>Tr(c,e),sqrt:n.sqrt||(c=>(a||(a=Zs(e)),a(l,c))),invertBatch:c=>na(l,c),cmov:(c,s,u)=>u?s:c,toBytes:c=>r?It(c,i):Cn(c,i),fromBytes:c=>{if(c.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+c.length);return r?Je(c):Hs(c)}});return Object.freeze(l)}const Rr=BigInt(0),qe=BigInt(1);function yt(e,t){const r=t.negate();return e?r:t}function Bn(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function mt(e,t){Bn(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function oa(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function ia(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const vt=new WeakMap,In=new WeakMap;function Et(e){return In.get(e)||1}function sa(e,t){return{constTimeNegate:yt,hasPrecomputes(r){return Et(r)!==1},unsafeLadder(r,n,o=e.ZERO){let i=r;for(;n>Rr;)n&qe&&(o=o.add(i)),i=i.double(),n>>=qe;return o},precomputeWindow(r,n){const{windows:o,windowSize:i}=mt(n,t),a=[];let l=r,c=l;for(let s=0;s<o;s++){c=l,a.push(c);for(let u=1;u<i;u++)c=c.add(l),a.push(c);l=c.double()}return a},wNAF(r,n,o){const{windows:i,windowSize:a}=mt(r,t);let l=e.ZERO,c=e.BASE;const s=BigInt(2**r-1),u=2**r,f=BigInt(r);for(let h=0;h<i;h++){const b=h*a;let d=Number(o&s);o>>=f,d>a&&(d-=u,o+=qe);const g=b,D=b+Math.abs(d)-1,y=h%2!==0,S=d<0;d===0?c=c.add(yt(y,n[g])):l=l.add(yt(S,n[D]))}return{p:l,f:c}},wNAFUnsafe(r,n,o,i=e.ZERO){const{windows:a,windowSize:l}=mt(r,t),c=BigInt(2**r-1),s=2**r,u=BigInt(r);for(let f=0;f<a;f++){const h=f*l;if(o===Rr)break;let b=Number(o&c);if(o>>=u,b>l&&(b-=s,o+=qe),b===0)continue;let d=n[h+Math.abs(b)-1];b<0&&(d=d.negate()),i=i.add(d)}return i},getPrecomputes(r,n,o){let i=vt.get(n);return i||(i=this.precomputeWindow(n,r),r!==1&&vt.set(n,o(i))),i},wNAFCached(r,n,o){const i=Et(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){const a=Et(r);return a===1?this.unsafeLadder(r,n,i):this.wNAFUnsafe(a,this.getPrecomputes(a,r,o),n,i)},setWindowSize(r,n){Bn(n,t),In.set(r,n),vt.delete(r)}}}function aa(e,t,r,n){if(oa(r,e),ia(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,i=qs(BigInt(r.length)),a=i>12?i-3:i>4?i-2:i?2:1,l=(1<<a)-1,c=new Array(l+1).fill(o),s=Math.floor((t.BITS-1)/a)*a;let u=o;for(let f=s;f>=0;f-=a){c.fill(o);for(let b=0;b<n.length;b++){const d=n[b],g=Number(d>>BigInt(f)&BigInt(l));c[g]=c[g].add(r[b])}let h=o;for(let b=c.length-1,d=o;b>0;b--)d=d.add(c[b]),h=h.add(d);if(u=u.add(h),f!==0)for(let b=0;b<a;b++)u=u.double()}return u}function ua(e){return ta(e.Fp),Ht(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...An(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const J=BigInt(0),K=BigInt(1),Ke=BigInt(2),ca=BigInt(8),la={zip215:!0};function fa(e){const t=ua(e);return Ht(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function ha(e){const t=fa(e),{Fp:r,n,prehash:o,hash:i,randomBytes:a,nByteLength:l,h:c}=t,s=Ke<<BigInt(l*8)-K,u=r.create,f=xn(t.n,t.nBitLength),h=t.uvRatio||((E,w)=>{try{return{isValid:!0,value:r.sqrt(E*r.inv(w))}}catch{return{isValid:!1,value:J}}}),b=t.adjustScalarBytes||(E=>E),d=t.domain||((E,w,v)=>{if(wt("phflag",v),w.length||v)throw new Error("Contexts/pre-hash are not supported");return E});function g(E,w){Be("coordinate "+E,w,J,s)}function D(E){if(!(E instanceof p))throw new Error("ExtendedPoint expected")}const y=xr((E,w)=>{const{ex:v,ey:_,ez:A}=E,x=E.is0();w==null&&(w=x?ca:r.inv(A));const I=u(v*w),L=u(_*w),R=u(A*w);if(x)return{x:J,y:K};if(R!==K)throw new Error("invZ was invalid");return{x:I,y:L}}),S=xr(E=>{const{a:w,d:v}=t;if(E.is0())throw new Error("bad point: ZERO");const{ex:_,ey:A,ez:x,et:I}=E,L=u(_*_),R=u(A*A),U=u(x*x),k=u(U*U),q=u(L*w),Q=u(U*u(q+R)),ee=u(k+u(v*u(L*R)));if(Q!==ee)throw new Error("bad point: equation left != right (1)");const Y=u(_*A),se=u(x*I);if(Y!==se)throw new Error("bad point: equation left != right (2)");return!0});class p{constructor(w,v,_,A){this.ex=w,this.ey=v,this.ez=_,this.et=A,g("x",w),g("y",v),g("z",_),g("t",A),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof p)throw new Error("extended point not allowed");const{x:v,y:_}=w||{};return g("x",v),g("y",_),new p(v,_,K,u(v*_))}static normalizeZ(w){const v=r.invertBatch(w.map(_=>_.ez));return w.map((_,A)=>_.toAffine(v[A])).map(p.fromAffine)}static msm(w,v){return aa(p,f,w,v)}_setWindowSize(w){T.setWindowSize(this,w)}assertValidity(){S(this)}equals(w){D(w);const{ex:v,ey:_,ez:A}=this,{ex:x,ey:I,ez:L}=w,R=u(v*L),U=u(x*A),k=u(_*L),q=u(I*A);return R===U&&k===q}is0(){return this.equals(p.ZERO)}negate(){return new p(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:w}=t,{ex:v,ey:_,ez:A}=this,x=u(v*v),I=u(_*_),L=u(Ke*u(A*A)),R=u(w*x),U=v+_,k=u(u(U*U)-x-I),q=R+I,Q=q-L,ee=R-I,Y=u(k*Q),se=u(q*ee),le=u(k*ee),ze=u(Q*q);return new p(Y,se,ze,le)}add(w){D(w);const{a:v,d:_}=t,{ex:A,ey:x,ez:I,et:L}=this,{ex:R,ey:U,ez:k,et:q}=w;if(v===BigInt(-1)){const er=u((x-A)*(U+R)),tr=u((x+A)*(U-R)),ut=u(tr-er);if(ut===J)return this.double();const rr=u(I*Ke*q),nr=u(L*Ke*k),or=nr+rr,ir=tr+er,sr=nr-rr,go=u(or*ut),wo=u(ir*sr),Do=u(or*sr),yo=u(ut*ir);return new p(go,wo,yo,Do)}const Q=u(A*R),ee=u(x*U),Y=u(L*_*q),se=u(I*k),le=u((A+x)*(R+U)-Q-ee),ze=se-Y,Zt=se+Y,Qt=u(ee-v*Q),fo=u(le*ze),ho=u(Zt*Qt),bo=u(le*Qt),po=u(ze*Zt);return new p(fo,ho,po,bo)}subtract(w){return this.add(w.negate())}wNAF(w){return T.wNAFCached(this,w,p.normalizeZ)}multiply(w){const v=w;Be("scalar",v,K,n);const{p:_,f:A}=this.wNAF(v);return p.normalizeZ([_,A])[0]}multiplyUnsafe(w,v=p.ZERO){const _=w;return Be("scalar",_,J,n),_===J?F:this.is0()||_===K?this:T.wNAFCachedUnsafe(this,_,p.normalizeZ,v)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return T.unsafeLadder(this,n).is0()}toAffine(w){return y(this,w)}clearCofactor(){const{h:w}=t;return w===K?this:this.multiplyUnsafe(w)}static fromHex(w,v=!1){const{d:_,a:A}=t,x=r.BYTES;w=re("pointHex",w,x),wt("zip215",v);const I=w.slice(),L=w[x-1];I[x-1]=L&-129;const R=Je(I),U=v?s:r.ORDER;Be("pointHex.y",R,J,U);const k=u(R*R),q=u(k-K),Q=u(_*k-A);let{isValid:ee,value:Y}=h(q,Q);if(!ee)throw new Error("Point.fromHex: invalid y coordinate");const se=(Y&K)===K,le=(L&128)!==0;if(!v&&Y===J&&le)throw new Error("Point.fromHex: x=0 and x_0=1");return le!==se&&(Y=u(-Y)),p.fromAffine({x:Y,y:R})}static fromPrivateKey(w){return j(w).point}toRawBytes(){const{x:w,y:v}=this.toAffine(),_=It(v,r.BYTES);return _[_.length-1]|=w&K?128:0,_}toHex(){return kt(this.toRawBytes())}}p.BASE=new p(t.Gx,t.Gy,K,u(t.Gx*t.Gy)),p.ZERO=new p(J,K,K,J);const{BASE:m,ZERO:F}=p,T=sa(p,l*8);function B(E){return $(E,n)}function C(E){return B(Je(E))}function j(E){const w=r.BYTES;E=re("private key",E,w);const v=re("hashed private key",i(E),2*w),_=b(v.slice(0,w)),A=v.slice(w,2*w),x=C(_),I=m.multiply(x),L=I.toRawBytes();return{head:_,prefix:A,scalar:x,point:I,pointBytes:L}}function ge(E){return j(E).pointBytes}function ce(E=new Uint8Array,...w){const v=Ar(...w);return C(i(d(v,re("context",E),!!o)))}function we(E,w,v={}){E=re("message",E),o&&(E=o(E));const{prefix:_,scalar:A,pointBytes:x}=j(w),I=ce(v.context,_,E),L=m.multiply(I).toRawBytes(),R=ce(v.context,L,x,E),U=B(I+R*A);Be("signature.s",U,J,n);const k=Ar(L,It(U,r.BYTES));return re("result",k,r.BYTES*2)}const Ce=la;function at(E,w,v,_=Ce){const{context:A,zip215:x}=_,I=r.BYTES;E=re("signature",E,2*I),w=re("message",w),v=re("publicKey",v,I),x!==void 0&&wt("zip215",x),o&&(w=o(w));const L=Je(E.slice(I,2*I));let R,U,k;try{R=p.fromHex(v,x),U=p.fromHex(E.slice(0,I),x),k=m.multiplyUnsafe(L)}catch{return!1}if(!x&&R.isSmallOrder())return!1;const q=ce(A,U.toRawBytes(),R.toRawBytes(),w);return U.add(R.multiplyUnsafe(q)).subtract(k).clearCofactor().equals(p.ZERO)}return m._setWindowSize(8),{CURVE:t,getPublicKey:ge,sign:we,verify:at,ExtendedPoint:p,utils:{getExtendedPublicKey:j,randomPrivateKey:()=>a(r.BYTES),precompute(E=8,w=p.BASE){return w._setWindowSize(E),w.multiply(BigInt(3)),w}}}}BigInt(0),BigInt(1);const Vt=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Nr=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const da=BigInt(1),Pr=BigInt(2);BigInt(3);const ba=BigInt(5),pa=BigInt(8);function ga(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=Vt,a=e*e%i*e%i,l=X(a,Pr,i)*a%i,c=X(l,da,i)*e%i,s=X(c,ba,i)*c%i,u=X(s,t,i)*s%i,f=X(u,r,i)*u%i,h=X(f,n,i)*f%i,b=X(h,o,i)*h%i,d=X(b,o,i)*h%i,g=X(d,t,i)*s%i;return{pow_p_5_8:X(g,Pr,i)*e%i,b2:a}}function wa(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function Da(e,t){const r=Vt,n=$(t*t*t,r),o=$(n*n*t,r),i=ga(e*o).pow_p_5_8;let a=$(e*n*i,r);const l=$(t*a*a,r),c=a,s=$(a*Nr,r),u=l===e,f=l===$(-e,r),h=l===$(-e*Nr,r);return u&&(a=c),(f||h)&&(a=s),Qs(a,r)&&(a=$(-a,r)),{isValid:u||f,value:a}}const ya=xn(Vt,void 0,!0),ma={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:ya,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:pa,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:zs,randomBytes:En,adjustScalarBytes:wa,uvRatio:Da},Tn=ha(ma),va="EdDSA",Ea="JWT",Qe=".",nt="base64url",Rn="utf8",Nn="utf8",_a=":",Sa="did",Oa="key",jr="base58btc",Fa="z",Ca="K36",Aa=32;function qt(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Pn(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?qt(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function jn(e,t){t||(t=e.reduce((o,i)=>o+i.length,0));const r=Pn(t);let n=0;for(const o of e)r.set(o,n),n+=o.length;return qt(r)}function xa(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),a=i.charCodeAt(0);if(r[a]!==255)throw new TypeError(i+" is ambiguous");r[a]=o}var l=e.length,c=e.charAt(0),s=Math.log(l)/Math.log(256),u=Math.log(256)/Math.log(l);function f(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var g=0,D=0,y=0,S=d.length;y!==S&&d[y]===0;)y++,g++;for(var p=(S-y)*u+1>>>0,m=new Uint8Array(p);y!==S;){for(var F=d[y],T=0,B=p-1;(F!==0||T<D)&&B!==-1;B--,T++)F+=256*m[B]>>>0,m[B]=F%l>>>0,F=F/l>>>0;if(F!==0)throw new Error("Non-zero carry");D=T,y++}for(var C=p-D;C!==p&&m[C]===0;)C++;for(var j=c.repeat(g);C<p;++C)j+=e.charAt(m[C]);return j}function h(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var g=0;if(d[g]!==" "){for(var D=0,y=0;d[g]===c;)D++,g++;for(var S=(d.length-g)*s+1>>>0,p=new Uint8Array(S);d[g];){var m=r[d.charCodeAt(g)];if(m===255)return;for(var F=0,T=S-1;(m!==0||F<y)&&T!==-1;T--,F++)m+=l*p[T]>>>0,p[T]=m%256>>>0,m=m/256>>>0;if(m!==0)throw new Error("Non-zero carry");y=F,g++}if(d[g]!==" "){for(var B=S-y;B!==S&&p[B]===0;)B++;for(var C=new Uint8Array(D+(S-B)),j=D;B!==S;)C[j++]=p[B++];return C}}}function b(d){var g=h(d);if(g)return g;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:h,decode:b}}var Ba=xa,Ia=Ba;const Ln=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ta=e=>new TextEncoder().encode(e),Ra=e=>new TextDecoder().decode(e);class Na{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Pa{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Un(this,t)}}class ja{constructor(t){this.decoders=t}or(t){return Un(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Un=(e,t)=>new ja({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class La{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new Na(t,r,n),this.decoder=new Pa(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const ot=({name:e,prefix:t,encode:r,decode:n})=>new La(e,t,r,n),Me=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=Ia(r,t);return ot({prefix:e,name:t,encode:n,decode:i=>Ln(o(i))})},Ua=(e,t,r,n)=>{const o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const a=new Uint8Array(i*r/8|0);let l=0,c=0,s=0;for(let u=0;u<i;++u){const f=o[e[u]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,l+=r,l>=8&&(l-=8,a[s++]=255&c>>l)}if(l>=r||255&c<<8-l)throw new SyntaxError("Unexpected end of data");return a},Ma=(e,t,r)=>{const n=t[t.length-1]==="=",o=(1<<r)-1;let i="",a=0,l=0;for(let c=0;c<e.length;++c)for(l=l<<8|e[c],a+=8;a>r;)a-=r,i+=t[o&l>>a];if(a&&(i+=t[o&l<<r-a]),n)for(;i.length*r&7;)i+="=";return i},H=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>ot({prefix:t,name:e,encode(o){return Ma(o,n,r)},decode(o){return Ua(o,n,r,e)}}),$a=ot({prefix:"\0",name:"identity",encode:e=>Ra(e),decode:e=>Ta(e)});var za=Object.freeze({__proto__:null,identity:$a});const Wa=H({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ka=Object.freeze({__proto__:null,base2:Wa});const Ha=H({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Va=Object.freeze({__proto__:null,base8:Ha});const qa=Me({prefix:"9",name:"base10",alphabet:"0123456789"});var Ka=Object.freeze({__proto__:null,base10:qa});const Ga=H({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ya=H({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Ja=Object.freeze({__proto__:null,base16:Ga,base16upper:Ya});const Xa=H({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Za=H({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Qa=H({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),eu=H({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),tu=H({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ru=H({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nu=H({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ou=H({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),iu=H({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var su=Object.freeze({__proto__:null,base32:Xa,base32upper:Za,base32pad:Qa,base32padupper:eu,base32hex:tu,base32hexupper:ru,base32hexpad:nu,base32hexpadupper:ou,base32z:iu});const au=Me({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),uu=Me({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var cu=Object.freeze({__proto__:null,base36:au,base36upper:uu});const lu=Me({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fu=Me({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var hu=Object.freeze({__proto__:null,base58btc:lu,base58flickr:fu});const du=H({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bu=H({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),pu=H({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),gu=H({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var wu=Object.freeze({__proto__:null,base64:du,base64pad:bu,base64url:pu,base64urlpad:gu});const Mn=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Du=Mn.reduce((e,t,r)=>(e[r]=t,e),[]),yu=Mn.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function mu(e){return e.reduce((t,r)=>(t+=Du[r],t),"")}function vu(e){const t=[];for(const r of e){const n=yu[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const Eu=ot({prefix:"🚀",name:"base256emoji",encode:mu,decode:vu});var _u=Object.freeze({__proto__:null,base256emoji:Eu}),Su=$n,Lr=128,Ou=-128,Fu=Math.pow(2,31);function $n(e,t,r){t=t||[],r=r||0;for(var n=r;e>=Fu;)t[r++]=e&255|Lr,e/=128;for(;e&Ou;)t[r++]=e&255|Lr,e>>>=7;return t[r]=e|0,$n.bytes=r-n+1,t}var Cu=Rt,Au=128,Ur=127;function Rt(e,n){var r=0,n=n||0,o=0,i=n,a,l=e.length;do{if(i>=l)throw Rt.bytes=0,new RangeError("Could not decode varint");a=e[i++],r+=o<28?(a&Ur)<<o:(a&Ur)*Math.pow(2,o),o+=7}while(a>=Au);return Rt.bytes=i-n,r}var xu=Math.pow(2,7),Bu=Math.pow(2,14),Iu=Math.pow(2,21),Tu=Math.pow(2,28),Ru=Math.pow(2,35),Nu=Math.pow(2,42),Pu=Math.pow(2,49),ju=Math.pow(2,56),Lu=Math.pow(2,63),Uu=function(e){return e<xu?1:e<Bu?2:e<Iu?3:e<Tu?4:e<Ru?5:e<Nu?6:e<Pu?7:e<ju?8:e<Lu?9:10},Mu={encode:Su,decode:Cu,encodingLength:Uu},zn=Mu;const Mr=(e,t,r=0)=>(zn.encode(e,t,r),t),$r=e=>zn.encodingLength(e),Nt=(e,t)=>{const r=t.byteLength,n=$r(e),o=n+$r(r),i=new Uint8Array(o+r);return Mr(e,i,0),Mr(r,i,n),i.set(t,o),new $u(e,r,t,i)};class $u{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}}const Wn=({name:e,code:t,encode:r})=>new zu(e,t,r);class zu{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?Nt(this.code,r):r.then(n=>Nt(this.code,n))}else throw Error("Unknown type, must be binary type")}}const kn=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Wu=Wn({name:"sha2-256",code:18,encode:kn("SHA-256")}),ku=Wn({name:"sha2-512",code:19,encode:kn("SHA-512")});var Hu=Object.freeze({__proto__:null,sha256:Wu,sha512:ku});const Hn=0,Vu="identity",Vn=Ln,qu=e=>Nt(Hn,Vn(e)),Ku={code:Hn,name:Vu,encode:Vn,digest:qu};var Gu=Object.freeze({__proto__:null,identity:Ku});new TextEncoder,new TextDecoder;const zr={...za,...ka,...Va,...Ka,...Ja,...su,...cu,...hu,...wu,..._u};({...Hu,...Gu});function qn(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Wr=qn("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),_t=qn("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Pn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Kn={utf8:Wr,"utf-8":Wr,hex:zr.base16,latin1:_t,ascii:_t,binary:_t,...zr};function it(e,t="utf8"){const r=Kn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function Oe(e,t="utf8"){const r=Kn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?qt(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function kr(e){return Se(it(Oe(e,nt),Rn))}function et(e){return it(Oe(ie(e),Rn),nt)}function Gn(e){const t=Oe(Ca,jr),r=Fa+it(jn([t,e]),jr);return[Sa,Oa,r].join(_a)}function Yu(e){return it(e,nt)}function Ju(e){return Oe(e,nt)}function Xu(e){return Oe([et(e.header),et(e.payload)].join(Qe),Nn)}function Zu(e){return[et(e.header),et(e.payload),Yu(e.signature)].join(Qe)}function Qu(e){const t=e.split(Qe),r=kr(t[0]),n=kr(t[1]),o=Ju(t[2]),i=Oe(t.slice(0,2).join(Qe),Nn);return{header:r,payload:n,signature:o,data:i}}function ec(e=En(Aa)){const t=Tn.getPublicKey(e);return{secretKey:jn([e,t]),publicKey:t}}async function tc(e,t,r,n,o=je.fromMiliseconds(Date.now())){const i={alg:va,typ:Ea},a=Gn(n.publicKey),l=o+r,c={iss:a,sub:e,aud:t,iat:o,exp:l},s=Xu({header:i,payload:c}),u=Tn.sign(s,n.secretKey.slice(0,32));return Zu({header:i,payload:c,signature:u})}var Hr=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},rc=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),nc=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=P.dist.process.platform}return e}(),oc=function(){function e(t,r,n,o){this.name=t,this.version=r,this.os=n,this.bot=o,this.type="bot-device"}return e}(),ic=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),sc=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),ac=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,uc=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Vr=3,cc=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",ac]],qr=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function lc(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new sc:typeof navigator<"u"?hc(navigator.userAgent):bc()}function fc(e){return e!==""&&cc.reduce(function(t,r){var n=r[0],o=r[1];if(t)return t;var i=o.exec(e);return!!i&&[n,i]},!1)}function hc(e){var t=fc(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new ic;var o=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);o?o.length<Vr&&(o=Hr(Hr([],o,!0),pc(Vr-o.length),!0)):o=[];var i=o.join("."),a=dc(e),l=uc.exec(e);return l&&l[1]?new oc(r,i,a,l[1]):new rc(r,i,a)}function dc(e){for(var t=0,r=qr.length;t<r;t++){var n=qr[t],o=n[0],i=n[1],a=i.exec(e);if(a)return o}return null}function bc(){var e=typeof P.dist.process<"u"&&P.dist.process.version;return e?new nc(P.dist.process.version.slice(1)):null}function pc(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var N={};Object.defineProperty(N,"__esModule",{value:!0});N.getLocalStorage=N.getLocalStorageOrThrow=N.getCrypto=N.getCryptoOrThrow=exports.getLocation_1=N.getLocation=N.getLocationOrThrow=exports.getNavigator_1=N.getNavigator=N.getNavigatorOrThrow=exports.getDocument_1=N.getDocument=N.getDocumentOrThrow=N.getFromWindowOrThrow=N.getFromWindow=void 0;function pe(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}N.getFromWindow=pe;function Fe(e){const t=pe(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}N.getFromWindowOrThrow=Fe;function gc(){return Fe("document")}N.getDocumentOrThrow=gc;function wc(){return pe("document")}exports.getDocument_1=N.getDocument=wc;function Dc(){return Fe("navigator")}N.getNavigatorOrThrow=Dc;function yc(){return pe("navigator")}exports.getNavigator_1=N.getNavigator=yc;function mc(){return Fe("location")}N.getLocationOrThrow=mc;function vc(){return pe("location")}exports.getLocation_1=N.getLocation=vc;function Ec(){return Fe("crypto")}N.getCryptoOrThrow=Ec;function _c(){return pe("crypto")}N.getCrypto=_c;function Sc(){return Fe("localStorage")}N.getLocalStorageOrThrow=Sc;function Oc(){return pe("localStorage")}N.getLocalStorage=Oc;var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});exports.getWindowMetadata_1=Kt.getWindowMetadata=void 0;const Kr=N;function Fc(){let e,t;try{e=Kr.getDocumentOrThrow(),t=Kr.getLocationOrThrow()}catch{return null}function r(){const f=e.getElementsByTagName("link"),h=[];for(let b=0;b<f.length;b++){const d=f[b],g=d.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const D=d.getAttribute("href");if(D)if(D.toLowerCase().indexOf("https:")===-1&&D.toLowerCase().indexOf("http:")===-1&&D.indexOf("//")!==0){let y=t.protocol+"//"+t.host;if(D.indexOf("/")===0)y+=D;else{const S=t.pathname.split("/");S.pop();const p=S.join("/");y+=p+"/"+D}h.push(y)}else if(D.indexOf("//")===0){const y=t.protocol+D;h.push(y)}else h.push(D)}}return h}function n(...f){const h=e.getElementsByTagName("meta");for(let b=0;b<h.length;b++){const d=h[b],g=["itemprop","property","name"].map(D=>d.getAttribute(D)).filter(D=>D?f.includes(D):!1);if(g.length&&g){const D=d.getAttribute("content");if(D)return D}}return""}function o(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=e.title),f}function i(){return n("description","og:description","twitter:description","keywords")}const a=o(),l=i(),c=t.origin,s=r();return{description:l,url:c,icons:s,name:a}}exports.getWindowMetadata_1=Kt.getWindowMetadata=Fc;function Yn(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Cc(e,t){t||(t=e.reduce((o,i)=>o+i.length,0));const r=Yn(t);let n=0;for(const o of e)r.set(o,n),n+=o.length;return r}function Ac(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),a=i.charCodeAt(0);if(r[a]!==255)throw new TypeError(i+" is ambiguous");r[a]=o}var l=e.length,c=e.charAt(0),s=Math.log(l)/Math.log(256),u=Math.log(256)/Math.log(l);function f(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var g=0,D=0,y=0,S=d.length;y!==S&&d[y]===0;)y++,g++;for(var p=(S-y)*u+1>>>0,m=new Uint8Array(p);y!==S;){for(var F=d[y],T=0,B=p-1;(F!==0||T<D)&&B!==-1;B--,T++)F+=256*m[B]>>>0,m[B]=F%l>>>0,F=F/l>>>0;if(F!==0)throw new Error("Non-zero carry");D=T,y++}for(var C=p-D;C!==p&&m[C]===0;)C++;for(var j=c.repeat(g);C<p;++C)j+=e.charAt(m[C]);return j}function h(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var g=0;if(d[g]!==" "){for(var D=0,y=0;d[g]===c;)D++,g++;for(var S=(d.length-g)*s+1>>>0,p=new Uint8Array(S);d[g];){var m=r[d.charCodeAt(g)];if(m===255)return;for(var F=0,T=S-1;(m!==0||F<y)&&T!==-1;T--,F++)m+=l*p[T]>>>0,p[T]=m%256>>>0,m=m/256>>>0;if(m!==0)throw new Error("Non-zero carry");y=F,g++}if(d[g]!==" "){for(var B=S-y;B!==S&&p[B]===0;)B++;for(var C=new Uint8Array(D+(S-B)),j=D;B!==S;)C[j++]=p[B++];return C}}}function b(d){var g=h(d);if(g)return g;throw new Error(`Non-${t} character`)}return{encode:f,decodeUnsafe:h,decode:b}}var xc=Ac,Bc=xc;const Ic=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Tc=e=>new TextEncoder().encode(e),Rc=e=>new TextDecoder().decode(e);class Nc{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Pc{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Jn(this,t)}}class jc{constructor(t){this.decoders=t}or(t){return Jn(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Jn=(e,t)=>new jc({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Lc{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new Nc(t,r,n),this.decoder=new Pc(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const st=({name:e,prefix:t,encode:r,decode:n})=>new Lc(e,t,r,n),$e=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=Bc(r,t);return st({prefix:e,name:t,encode:n,decode:i=>Ic(o(i))})},Uc=(e,t,r,n)=>{const o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const a=new Uint8Array(i*r/8|0);let l=0,c=0,s=0;for(let u=0;u<i;++u){const f=o[e[u]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,l+=r,l>=8&&(l-=8,a[s++]=255&c>>l)}if(l>=r||255&c<<8-l)throw new SyntaxError("Unexpected end of data");return a},Mc=(e,t,r)=>{const n=t[t.length-1]==="=",o=(1<<r)-1;let i="",a=0,l=0;for(let c=0;c<e.length;++c)for(l=l<<8|e[c],a+=8;a>r;)a-=r,i+=t[o&l>>a];if(a&&(i+=t[o&l<<r-a]),n)for(;i.length*r&7;)i+="=";return i},V=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>st({prefix:t,name:e,encode(o){return Mc(o,n,r)},decode(o){return Uc(o,n,r,e)}}),$c=st({prefix:"\0",name:"identity",encode:e=>Rc(e),decode:e=>Tc(e)}),zc=Object.freeze(Object.defineProperty({__proto__:null,identity:$c},Symbol.toStringTag,{value:"Module"})),Wc=V({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),kc=Object.freeze(Object.defineProperty({__proto__:null,base2:Wc},Symbol.toStringTag,{value:"Module"})),Hc=V({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Vc=Object.freeze(Object.defineProperty({__proto__:null,base8:Hc},Symbol.toStringTag,{value:"Module"})),qc=$e({prefix:"9",name:"base10",alphabet:"0123456789"}),Kc=Object.freeze(Object.defineProperty({__proto__:null,base10:qc},Symbol.toStringTag,{value:"Module"})),Gc=V({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Yc=V({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Jc=Object.freeze(Object.defineProperty({__proto__:null,base16:Gc,base16upper:Yc},Symbol.toStringTag,{value:"Module"})),Xc=V({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Zc=V({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Qc=V({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),el=V({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),tl=V({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rl=V({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),nl=V({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ol=V({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),il=V({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),sl=Object.freeze(Object.defineProperty({__proto__:null,base32:Xc,base32hex:tl,base32hexpad:nl,base32hexpadupper:ol,base32hexupper:rl,base32pad:Qc,base32padupper:el,base32upper:Zc,base32z:il},Symbol.toStringTag,{value:"Module"})),al=$e({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ul=$e({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),cl=Object.freeze(Object.defineProperty({__proto__:null,base36:al,base36upper:ul},Symbol.toStringTag,{value:"Module"})),ll=$e({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fl=$e({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),hl=Object.freeze(Object.defineProperty({__proto__:null,base58btc:ll,base58flickr:fl},Symbol.toStringTag,{value:"Module"})),dl=V({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bl=V({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),pl=V({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),gl=V({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),wl=Object.freeze(Object.defineProperty({__proto__:null,base64:dl,base64pad:bl,base64url:pl,base64urlpad:gl},Symbol.toStringTag,{value:"Module"})),Xn=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Dl=Xn.reduce((e,t,r)=>(e[r]=t,e),[]),yl=Xn.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function ml(e){return e.reduce((t,r)=>(t+=Dl[r],t),"")}function vl(e){const t=[];for(const r of e){const n=yl[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const El=st({prefix:"🚀",name:"base256emoji",encode:ml,decode:vl}),_l=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:El},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Gr={...zc,...kc,...Vc,...Kc,...Jc,...sl,...cl,...hl,...wl,..._l};function Zn(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Yr=Zn("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),St=Zn("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Yn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Qn={utf8:Yr,"utf-8":Yr,hex:Gr.base16,latin1:St,ascii:St,binary:St,...Gr};function Sl(e,t="utf8"){const r=Qn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function Ol(e,t="utf8"){const r=Qn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}const Fl={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},Cl="PARSE_ERROR",Al="INVALID_REQUEST",xl="METHOD_NOT_FOUND",Bl="INVALID_PARAMS",eo="INTERNAL_ERROR",Gt="SERVER_ERROR",Il=[-32700,-32600,-32601,-32602,-32603],Ie={[Cl]:{code:-32700,message:"Parse error"},[Al]:{code:-32600,message:"Invalid Request"},[xl]:{code:-32601,message:"Method not found"},[Bl]:{code:-32602,message:"Invalid params"},[eo]:{code:-32603,message:"Internal error"},[Gt]:{code:-32e3,message:"Server error"}},to=Gt;function Tl(e){return Il.includes(e)}function Jr(e){return Object.keys(Ie).includes(e)?Ie[e]:Ie[to]}function Rl(e){const t=Object.values(Ie).find(r=>r.code===e);return t||Ie[to]}function ro(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var no={};/*! *****************************************************************************
|
|
15
|
+
Copyright (c) Microsoft Corporation.
|
|
16
|
+
|
|
17
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
18
|
+
purpose with or without fee is hereby granted.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
21
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
22
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
23
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
24
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
25
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
26
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
27
|
+
***************************************************************************** */var Pt=function(e,t){return Pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])},Pt(e,t)};function Nl(e,t){Pt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var jt=function(){return jt=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},jt.apply(this,arguments)};function Pl(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function jl(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(i=(o<3?a(i):o>3?a(t,r,i):a(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function Ll(e,t){return function(r,n){t(r,n,e)}}function Ul(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Ml(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(u){try{s(n.next(u))}catch(f){a(f)}}function c(u){try{s(n.throw(u))}catch(f){a(f)}}function s(u){u.done?i(u.value):o(u.value).then(l,c)}s((n=n.apply(e,t||[])).next())})}function $l(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(s){return function(u){return c([s,u])}}function c(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=s[0]&2?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1],i=s;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(s);break}i[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(u){s=[6,u],o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function zl(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function Wl(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function Lt(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function oo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function kl(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(oo(arguments[t]));return e}function Hl(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)n[o]=i[a];return n}function Pe(e){return this instanceof Pe?(this.v=e,this):new Pe(e)}function Vl(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(h){n[h]&&(o[h]=function(b){return new Promise(function(d,g){i.push([h,b,d,g])>1||l(h,b)})})}function l(h,b){try{c(n[h](b))}catch(d){f(i[0][3],d)}}function c(h){h.value instanceof Pe?Promise.resolve(h.value.v).then(s,u):f(i[0][2],h)}function s(h){l("next",h)}function u(h){l("throw",h)}function f(h,b){h(b),i.shift(),i.length&&l(i[0][0],i[0][1])}}function ql(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(a){return(r=!r)?{value:Pe(e[o](a)),done:o==="return"}:i?i(a):a}:i}}function Kl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Lt=="function"?Lt(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(l,c){a=e[i](a),o(l,c,a.done,a.value)})}}function o(i,a,l,c){Promise.resolve(c).then(function(s){i({value:s,done:l})},a)}}function Gl(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Yl(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Jl(e){return e&&e.__esModule?e:{default:e}}function Xl(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function Zl(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}const Ql=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return jt},__asyncDelegator:ql,__asyncGenerator:Vl,__asyncValues:Kl,__await:Pe,__awaiter:Ml,__classPrivateFieldGet:Xl,__classPrivateFieldSet:Zl,__createBinding:zl,__decorate:jl,__exportStar:Wl,__extends:Nl,__generator:$l,__importDefault:Jl,__importStar:Yl,__makeTemplateObject:Gl,__metadata:Ul,__param:Ll,__read:oo,__rest:Pl,__spread:kl,__spreadArrays:Hl,__values:Lt},Symbol.toStringTag,{value:"Module"})),ef=P.getAugmentedNamespace(Ql);var ne={},Xr;function tf(){if(Xr)return ne;Xr=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.isBrowserCryptoAvailable=ne.getSubtleCrypto=ne.getBrowerCrypto=void 0;function e(){return(P.commonjsGlobal===null||P.commonjsGlobal===void 0?void 0:P.commonjsGlobal.crypto)||(P.commonjsGlobal===null||P.commonjsGlobal===void 0?void 0:P.commonjsGlobal.msCrypto)||{}}ne.getBrowerCrypto=e;function t(){const n=e();return n.subtle||n.webkitSubtle}ne.getSubtleCrypto=t;function r(){return!!e()&&!!t()}return ne.isBrowserCryptoAvailable=r,ne}var oe={},Zr;function rf(){if(Zr)return oe;Zr=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.isBrowser=oe.isNode=oe.isReactNative=void 0;function e(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}oe.isReactNative=e;function t(){return typeof P.dist.process<"u"&&typeof P.dist.process.versions<"u"&&typeof P.dist.process.versions.node<"u"}oe.isNode=t;function r(){return!e()&&!t()}return oe.isBrowser=r,oe}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ef;t.__exportStar(tf(),e),t.__exportStar(rf(),e)})(no);function Yt(e=3){const t=Date.now()*Math.pow(10,e),r=Math.floor(Math.random()*Math.pow(10,e));return t+r}function io(e=6){return BigInt(Yt(e))}function so(e,t,r){return{id:r||Yt(),jsonrpc:"2.0",method:e,params:t}}function nf(e,t){return{id:e,jsonrpc:"2.0",result:t}}function Jt(e,t,r){return{id:e,jsonrpc:"2.0",error:of(t)}}function of(e,t){return typeof e>"u"?Jr(eo):(typeof e=="string"&&(e=Object.assign(Object.assign({},Jr(Gt)),{message:e})),Tl(e.code)&&(e=Rl(e.code)),e)}class sf{}class af extends sf{constructor(){super()}}class uf extends af{constructor(t){super()}}const cf="^https?:",lf="^wss?:";function ff(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function ao(e,t){const r=ff(e);return typeof r>"u"?!1:new RegExp(t).test(r)}function Qr(e){return ao(e,cf)}function en(e){return ao(e,lf)}function hf(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function uo(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function df(e){return uo(e)&&"method"in e}function co(e){return uo(e)&&(lo(e)||Xt(e))}function lo(e){return"result"in e}function Xt(e){return"error"in e}class bf extends uf{constructor(t){super(t),this.events=new _e.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async request(t,r){return this.requestStrict(so(t.method,t.params||[],t.id||io().toString()),r)}async requestStrict(t,r){return new Promise(async(n,o)=>{if(!this.connection.connected)try{await this.open()}catch(i){o(i)}this.events.on(`${t.id}`,i=>{Xt(i)?o(i.error):n(i.result)});try{await this.connection.send(t,r)}catch(i){o(i)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),co(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const pf=()=>typeof WebSocket<"u"?WebSocket:typeof P.dist.global<"u"&&typeof P.dist.global.WebSocket<"u"?P.dist.global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),gf=()=>typeof WebSocket<"u"||typeof P.dist.global<"u"&&typeof P.dist.global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",tn=e=>e.split("?")[0],rn=10,wf=pf();let Df=class{constructor(t){if(this.url=t,this.events=new _e.EventEmitter,this.registering=!1,!en(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ie(t))}catch(r){this.onError(t.id,r)}}register(t=this.url){if(!en(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",i=>{this.resetMaxListeners(),o(i)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=t,this.registering=!0,new Promise((r,n)=>{const o=no.isReactNative()?void 0:{rejectUnauthorized:!hf(t)},i=new wf(t,[],o);gf()?i.onerror=a=>{const l=a;n(this.emitError(l.error))}:i.on("error",a=>{n(this.emitError(a))}),i.onopen=()=>{this.onOpen(i),r(i)}})}onOpen(t){t.onmessage=r=>this.onPayload(r),t.onclose=r=>this.onClose(r),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const r=typeof t.data=="string"?Se(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const n=this.parseError(r),o=n.message||n.toString(),i=Jt(t,o);this.events.emit("payload",i)}parseError(t,r=this.url){return ro(t,tn(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>rn&&this.events.setMaxListeners(rn)}emitError(t){const r=this.parseError(new Error((t==null?void 0:t.message)||`WebSocket connection failed for host: ${tn(this.url)}`));return this.events.emit("register_error",r),r}};var yf=Object.defineProperty,mf=Object.defineProperties,vf=Object.getOwnPropertyDescriptors,nn=Object.getOwnPropertySymbols,Ef=Object.prototype.hasOwnProperty,_f=Object.prototype.propertyIsEnumerable,on=(e,t,r)=>t in e?yf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sn=(e,t)=>{for(var r in t||(t={}))Ef.call(t,r)&&on(e,r,t[r]);if(nn)for(var r of nn(t))_f.call(t,r)&&on(e,r,t[r]);return e},an=(e,t)=>mf(e,vf(t));const Sf={Accept:"application/json","Content-Type":"application/json"},Of="POST",un={headers:Sf,method:Of},cn=10;class Ff{constructor(t,r=!1){if(this.url=t,this.disableProviderPing=r,this.events=new _e.EventEmitter,this.isAvailable=!1,this.registering=!1,!Qr(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);this.url=t,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(t){this.isAvailable||await this.register();try{const r=ie(t),n=await(await ar.o(this.url,an(sn({},un),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(t.id,r)}}async register(t=this.url){if(!Qr(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",i=>{this.resetMaxListeners(),o(i)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));n()})})}this.url=t,this.registering=!0;try{if(!this.disableProviderPing){const r=ie({id:1,jsonrpc:"2.0",method:"test",params:[]});await ar.o(t,an(sn({},un),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(t){if(typeof t.data>"u")return;const r=typeof t.data=="string"?Se(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const n=this.parseError(r),o=n.message||n.toString(),i=Jt(t,o);this.events.emit("payload",i)}parseError(t,r=this.url){return ro(t,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>cn&&this.events.setMaxListeners(cn)}}exports.A=cs;exports.C=Fl;exports.E=ss;exports.IEvents=hn;exports.Nt=vo;exports.Ot=Ut;exports.Po=ec;exports.Qe=Gn;exports.Qo=tc;exports.cjs=je;exports.concat=Cc;exports.detect=lc;exports.eventsExports=_e;exports.f=Df;exports.f$1=Ff;exports.formatJsonRpcError=Jt;exports.formatJsonRpcRequest=so;exports.formatJsonRpcResult=nf;exports.fromString=Sl;exports.getBigIntRpcId=io;exports.h=Ri;exports.i=Xo;exports.isJsonRpcError=Xt;exports.isJsonRpcRequest=df;exports.isJsonRpcResponse=co;exports.isJsonRpcResult=lo;exports.k=rs;exports.o=bf;exports.payloadId=Yt;exports.r=dn;exports.safeJsonParse=Se;exports.safeJsonStringify=ie;exports.sn=Qu;exports.toString=Ol;exports.y=yn;
|