@stakekit/widget 0.0.280 → 0.0.282
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/dist/{website/assets/build-Dn2S6Ko5.js → bundle/build-BjTGUKBb.js} +1 -1
- package/dist/bundle/{build-DXRLzwHe.js → build-DaXa2hFa.js} +1 -1
- package/dist/bundle/{cardano-connector-ebl32zUD.js → cardano-connector-Bxl4EuKG.js} +1 -1
- package/dist/bundle/dist-C6DxN7oQ.js +1 -0
- package/dist/bundle/index.bundle.js +3 -3
- package/dist/bundle/{ledger-connector-BN25ujqn.js → ledger-connector-BYlWQcC2.js} +1 -1
- package/dist/bundle/{ledger-live-connector-meta-DPFZoSjd.js → ledger-live-connector-meta-BSOi7ps6.js} +2 -2
- package/dist/bundle/{misc-C7prhhSc.js → misc-B58_8Z_Y.js} +1 -1
- package/dist/bundle/name-service-WTCg35Ui.js +1 -0
- package/dist/bundle/networks-DcV8Uo1h.js +1 -0
- package/dist/bundle/{solana-connector-G7AHadyF.js → solana-connector-C4fvrXDL.js} +1 -1
- package/dist/bundle/{substrate-connector-C1B1qvJ7.js → substrate-connector-DjL2B0YP.js} +1 -1
- package/dist/bundle/{ton-connector-GT3crFFI.js → ton-connector-CFA850-u.js} +1 -1
- package/dist/bundle/{tron-connector-gqA-Dier.js → tron-connector-Bi9vQYaJ.js} +1 -1
- package/dist/bundle/tx-DTVo9zYr.js +1 -0
- package/dist/bundle/{utils-D25hFEIj.js → utils-UHcv2aK_.js} +1 -1
- package/dist/bundle/{wallet-manager-l_QoGIj_.js → wallet-manager-st5o-xIp.js} +3 -3
- package/dist/package/{build-BdpEvliU.js → build-19T6Y-f2.js} +1 -1
- package/dist/package/{build-vbzY6oYn.js → build-BrztUmTv.js} +2 -2
- package/dist/package/{cardano-connector-BZZm7XoD.js → cardano-connector-CKtTdyDA.js} +2 -2
- package/dist/package/dist-CDUoHqPz.js +3 -0
- package/dist/package/index.package.js +83 -23
- package/dist/package/{ledger-connector-C4iWqKKK.js → ledger-connector-Cs_sRWr9.js} +2 -2
- package/dist/package/{ledger-live-connector-meta-DaQZkCPN.js → ledger-live-connector-meta-BhqB5kyr.js} +24 -3
- package/dist/package/{misc-D2AZp5-W.js → misc-sZYZi3H7.js} +1 -1
- package/dist/package/name-service-CKkyMnnB.js +3 -0
- package/dist/package/{networks-CdsbwZ0i.js → networks-3BCZBoc0.js} +2 -1
- package/dist/package/{solana-connector-YHtJzNsy.js → solana-connector-BBT9LAWs.js} +2 -2
- package/dist/package/{substrate-connector-BfDsxLU7.js → substrate-connector-DfK3K0B4.js} +1 -1
- package/dist/package/{ton-connector-CJQSQVZ4.js → ton-connector-CRoAd0ZH.js} +2 -2
- package/dist/package/{tron-connector-CMwQ3mXk.js → tron-connector-DQfLwaZm.js} +2 -2
- package/dist/package/tx-DgblqE_C.js +3 -0
- package/dist/package/{utils-pXuPoWum.js → utils-CHNRVjvx.js} +1 -1
- package/dist/package/{wallet-manager-kCjbi0Rb.js → wallet-manager-DvGKqMe3.js} +17 -17
- package/dist/types/common/get-enabled-networks.d.ts +1 -1
- package/dist/types/domain/types/chains/evm.d.ts +4 -3
- package/dist/types/domain/types/chains/networks.d.ts +2 -0
- package/dist/types/domain/types/yields.d.ts +2 -2
- package/dist/types/generated/api/legacy.d.ts +244 -74
- package/dist/types/generated/api/yield.d.ts +120 -30
- package/dist/types/hooks/api/use-activity-actions.d.ts +1 -1
- package/dist/types/hooks/use-init-query-params.d.ts +2 -2
- package/dist/types/hooks/use-reward-token-details/index.d.ts +1 -1
- package/dist/types/pages/details/earn-page/state/use-get-token-balances-map.d.ts +1 -1
- package/dist/types/pages/details/earn-page/state/use-token-balances-map.d.ts +1 -1
- package/dist/types/pages/details/positions-page/hooks/use-position-list-item.d.ts +2 -2
- package/dist/types/pages/review/hooks/use-pending-review.hook.d.ts +1 -1
- package/dist/types/pages/review/hooks/use-stake-review.hook.d.ts +1 -1
- package/dist/types/pages/review/hooks/use-unstake-review.hook.d.ts +1 -1
- package/dist/website/assets/{AccountController-BXsRFth1.js → AccountController-CZ3AskK0.js} +1 -1
- package/dist/website/assets/{ConnectorUtil-DaRsDYoB.js → ConnectorUtil-DhfSckTl.js} +1 -1
- package/dist/website/assets/{ConnectorUtil-DdfNBWZU.js → ConnectorUtil-Dr-Sj5Xi.js} +1 -1
- package/dist/website/assets/{ConstantsUtil-fZnrIu9U.js → ConstantsUtil-KBrAwQeh.js} +1 -1
- package/dist/website/assets/{ConstantsUtil-BRcDxkmi.js → ConstantsUtil-cWzo_bL6.js} +1 -1
- package/dist/website/assets/{EnsController-mVupdCk3.js → EnsController-DCvEdmLX.js} +1 -1
- package/dist/website/assets/{ErrorUtil-DvzHlG5i.js → ErrorUtil-CqiPmwUQ.js} +1 -1
- package/dist/website/assets/{HelpersUtil-CDNW2Itr.js → HelpersUtil-5BtTobdy.js} +1 -1
- package/dist/website/assets/{OnRampController-zR3Eg9Lb.js → OnRampController-Bja8dlwC.js} +1 -1
- package/dist/website/assets/{ProviderUtil-CSca7Bc2.js → ProviderUtil-B7GUQMp6.js} +1 -1
- package/dist/website/assets/{SIWXUtil-6dcrtQP6.js → SIWXUtil-WhCFYYeb.js} +1 -1
- package/dist/website/assets/{SIWXUtil-CikouSg3.js → SIWXUtil-cetRK2TM.js} +1 -1
- package/dist/website/assets/{SwapController-CA8FjUeg.js → SwapController-CM-1PbEv.js} +1 -1
- package/dist/website/assets/{W3mFrameHelpers-Ck9yu4pb.js → W3mFrameHelpers-B8kV5Q0n.js} +1 -1
- package/dist/website/assets/{W3mFrameProvider-DfcFoA3B.js → W3mFrameProvider-ohY0LTwE.js} +1 -1
- package/dist/website/assets/{add-8n0zSoWt.js → add-DM2nvQT-.js} +1 -1
- package/dist/website/assets/{all-wallets-CZgEQ_8C.js → all-wallets-CbBymuk3.js} +1 -1
- package/dist/website/assets/{app-store-DvXsDq9r.js → app-store-DDxmj9Lx.js} +1 -1
- package/dist/website/assets/{apple-GZlzW650.js → apple-Dn7auf4q.js} +1 -1
- package/dist/website/assets/{arrow-bottom-tnog9Vhw.js → arrow-bottom-Bb9Or_Vr.js} +1 -1
- package/dist/website/assets/{arrow-bottom-circle-j8xr3qhF.js → arrow-bottom-circle-Dtsu395i.js} +1 -1
- package/dist/website/assets/{arrow-left-BR73rwFp.js → arrow-left-urUveqA6.js} +1 -1
- package/dist/website/assets/{arrow-right-BuoaNM6r.js → arrow-right-Cy0Ygemc.js} +1 -1
- package/dist/website/assets/{arrow-top-3HeVqrTn.js → arrow-top-CMkFVUPL.js} +1 -1
- package/dist/website/assets/{bank-BMOvHygc.js → bank-BfpbjcJU.js} +1 -1
- package/dist/website/assets/{basic-myS4JgJ0.js → basic-BOLR86Me.js} +1 -1
- package/dist/website/assets/{basic-CFWydhJA.js → basic-CelNIwvX.js} +1 -1
- package/dist/website/assets/{browser-BXu6SRdK.js → browser-DjOYXDTm.js} +1 -1
- package/dist/website/assets/{browser-9eOj1g61.js → browser-MeMHJ-8U.js} +1 -1
- package/dist/website/assets/{build-DbM8T8c9.js → build-CWk0QocV.js} +1 -1
- package/dist/{bundle/build-Z489QYQJ.js → website/assets/build-CpWkW2tw.js} +1 -1
- package/dist/website/assets/{card-CvTZC_8L.js → card-BGKYxgPZ.js} +1 -1
- package/dist/website/assets/{cardano-connector-C_muiVsd.js → cardano-connector-BYu3bSHH.js} +1 -1
- package/dist/website/assets/{ccip-CcZo2Fpk.js → ccip-DQel3KVV.js} +1 -1
- package/dist/website/assets/{ccip-tbBiP3Dz.js → ccip-DfRE0PKO.js} +1 -1
- package/dist/website/assets/{checkmark-C13udN5Q.js → checkmark-B54WvXLf.js} +1 -1
- package/dist/website/assets/{checkmark-bold-wLzOfJZ0.js → checkmark-bold-CCJMCK3Y.js} +1 -1
- package/dist/website/assets/{chevron-bottom-C4Kw4oUb.js → chevron-bottom-hwdmvWLF.js} +1 -1
- package/dist/website/assets/{chevron-left-Dm0ksS2E.js → chevron-left-CN6NEo1b.js} +1 -1
- package/dist/website/assets/{chevron-right-zYUb5bDP.js → chevron-right-CWf6ew-m.js} +1 -1
- package/dist/website/assets/{chevron-top-D7uyjciW.js → chevron-top-BfSjLB5_.js} +1 -1
- package/dist/website/assets/{chrome-store-cdiN0IyG.js → chrome-store-ClZGfzcx.js} +1 -1
- package/dist/website/assets/{clock-DK84tN8N.js → clock-DSZaUPCM.js} +1 -1
- package/dist/website/assets/{close-D6qsR_P7.js → close-o8u0_8yN.js} +1 -1
- package/dist/website/assets/{coinPlaceholder-sLFUGuQp.js → coinPlaceholder-XznZsK4p.js} +1 -1
- package/dist/website/assets/{compass-Dt478IJg.js → compass-YEYH0wOn.js} +1 -1
- package/dist/website/assets/{copy-sUG2jNjJ.js → copy-pInvOcim.js} +1 -1
- package/dist/website/assets/{core-DGhf5Owi.js → core-CfyKWiQv.js} +2 -2
- package/dist/website/assets/cursor-BkSthN9t.js +3 -0
- package/dist/website/assets/{cursor-transparent-BhKJkrPt.js → cursor-transparent-D3AJK0My.js} +1 -1
- package/dist/website/assets/{data-capture-BMbc2_PH.js → data-capture-DU463HBK.js} +1 -1
- package/dist/website/assets/{decode-XNepIc6v.js → decode-DmPUixTK.js} +3 -3
- package/dist/website/assets/{desktop-C8MpypxK.js → desktop-D9coRt6t.js} +1 -1
- package/dist/website/assets/{disconnect-DtDN7daS.js → disconnect-BP3wbEyx.js} +1 -1
- package/dist/website/assets/{discord-QWpY_3BZ.js → discord-Bue5RU-6.js} +1 -1
- package/dist/website/assets/dist-C582ZtDs.js +1 -0
- package/dist/website/assets/{dist-BV2fmIQl.js → dist-DZQMP5L_.js} +2 -2
- package/dist/website/assets/{email-Bdyjfw-1.js → email-BYn06MIp.js} +1 -1
- package/dist/website/assets/{embedded-wallet-CoS-5Uth.js → embedded-wallet-DHUvMYek.js} +1 -1
- package/dist/website/assets/en_US-IFPOGBSL-BK5IEFRX.js +1 -0
- package/dist/website/assets/{esm-ERsoOQ9y.js → esm-ONCreVwv.js} +1 -1
- package/dist/website/assets/{etherscan-CH4C08Og.js → etherscan-DQBoFKLv.js} +1 -1
- package/dist/website/assets/{exclamation-triangle-BSxl84FF.js → exclamation-triangle-kDYUulbA.js} +1 -1
- package/dist/website/assets/{exports-JNRgcf-r.js → exports-BvOrlL9b.js} +1 -1
- package/dist/website/assets/{exports-Cl6RAY1Q.js → exports-CzRzpkCO.js} +1 -1
- package/dist/website/assets/{exports-B9Pw3cj2.js → exports-DFrhs9-4.js} +1 -1
- package/dist/website/assets/{extension-CP45VJnn.js → extension-7ZdOFRsz.js} +1 -1
- package/dist/website/assets/{external-link-CtDMyV_K.js → external-link-tgLj5Ewp.js} +1 -1
- package/dist/website/assets/{facebook-Crz6X9gg.js → facebook-l5ej5aLA.js} +1 -1
- package/dist/website/assets/{farcaster-Df4-Pp3Z.js → farcaster-B4by4dn_.js} +1 -1
- package/dist/website/assets/{features-DDNuqQ4C.js → features-DQXem-4z.js} +1 -1
- package/dist/website/assets/{filters-DDCtxBrn.js → filters-DcZXEY3g.js} +1 -1
- package/dist/website/assets/{github-DbYOVtqT.js → github-BDsHglT5.js} +1 -1
- package/dist/website/assets/{google-1BSMH8E-.js → google-Jkx1oZdL.js} +1 -1
- package/dist/website/assets/{help-circle-DrNe6qj7.js → help-circle-CFwJ8FAj.js} +1 -1
- package/dist/website/assets/{id-C-sagMdh.js → id-XqBLPO2G.js} +1 -1
- package/dist/website/assets/{image-DtElFp4Y.js → image-lo_miGZb.js} +1 -1
- package/dist/website/assets/{index-Df3qcnRy.js → index--r1G5ij4.js} +8 -8
- package/dist/website/assets/{index.es-CxlQAn5S.js → index.es-B5D3HtzA.js} +1 -1
- package/dist/website/assets/{index.es-DwDX0D6n.js → index.es-CoCSILjf.js} +2 -2
- package/dist/website/assets/{info-circle-B_M3A6w3.js → info-circle-DmYANINU.js} +1 -1
- package/dist/website/assets/{info-z8hrOu6P.js → info-eVFjXpEa.js} +1 -1
- package/dist/website/assets/{ledger-connector-B2SyUFPi.js → ledger-connector-BD7bNK8U.js} +1 -1
- package/dist/website/assets/{lightbulb-Co2k7Lz3.js → lightbulb-CNNrGCtj.js} +1 -1
- package/dist/website/assets/{localBatchGatewayRequest-BX1SDCRT.js → localBatchGatewayRequest-gb19_uU1.js} +3 -3
- package/dist/website/assets/{mail-B0V2obJI.js → mail-CtNG1vZT.js} +1 -1
- package/dist/website/assets/{mobile-BNu_yxHf.js → mobile-AWJ5nLmy.js} +1 -1
- package/dist/website/assets/{more-C5mME45o.js → more-DfEQIkwx.js} +1 -1
- package/dist/website/assets/name-service-tewBv0Xj.js +1 -0
- package/dist/website/assets/{network-placeholder-B140DISA.js → network-placeholder-NmjG-bQA.js} +1 -1
- package/dist/website/assets/{nftPlaceholder-BA-KEOI4.js → nftPlaceholder-5eI3PZnu.js} +1 -1
- package/dist/website/assets/{off-DYT0HW2y.js → off-B-dZyTnf.js} +1 -1
- package/dist/website/assets/{onramp-B86Uxabn.js → onramp-BqLRcbU9.js} +1 -1
- package/dist/website/assets/{p256-mV6uWy_F.js → p256-CAvUfeCP.js} +1 -1
- package/dist/website/assets/{pay-with-exchange-Ci1fJF9C.js → pay-with-exchange-BB04DYim.js} +1 -1
- package/dist/website/assets/{play-store-DJvTk1V0.js → play-store-BUU7RrlP.js} +1 -1
- package/dist/website/assets/{plus-BXC5vq-0.js → plus-Bs4s1rv1.js} +1 -1
- package/dist/website/assets/{qr-code-DW-VBpT0.js → qr-code-bQtPB-Gz.js} +1 -1
- package/dist/website/assets/{receive-kh6a9nq_.js → receive-Czcadidc.js} +1 -1
- package/dist/website/assets/{recycle-horizontal-n9mD83wS.js → recycle-horizontal-Cx8_xLt7.js} +1 -1
- package/dist/website/assets/{refresh-DQKyv14D.js → refresh-DZ2CzY4A.js} +1 -1
- package/dist/website/assets/{registry-BVCSWVxM.js → registry-CCoDEOty.js} +1 -1
- package/dist/website/assets/{reown-logo-_oyKlw_B.js → reown-logo-Bc69tk_B.js} +1 -1
- package/dist/website/assets/{safe-connector-tu0CEuPs.js → safe-connector-ChHN6PFH.js} +1 -1
- package/dist/website/assets/{search-DZBY0SV8.js → search-BMdCijEz.js} +1 -1
- package/dist/website/assets/{send-DVhV-fml.js → send-Cml8YGtH.js} +1 -1
- package/dist/website/assets/{send-CZrkBquG.js → send-welRl4pB.js} +1 -1
- package/dist/website/assets/{socials-Ce3JBjG9.js → socials-lvk_JwAC.js} +1 -1
- package/dist/website/assets/{solana-connector-Bfis347u.js → solana-connector-C-tqKpo-.js} +1 -1
- package/dist/website/assets/{substrate-connector-D5z4oo_G.js → substrate-connector-C0UxydKR.js} +2 -2
- package/dist/website/assets/{swapHorizontal-C61iNGv-.js → swapHorizontal-XLOsaD8E.js} +1 -1
- package/dist/website/assets/{swapHorizontalBold-7_y3kYSs.js → swapHorizontalBold-rltpBI6G.js} +1 -1
- package/dist/website/assets/{swapHorizontalMedium-2z9azSx2.js → swapHorizontalMedium-B66Ecuau.js} +1 -1
- package/dist/website/assets/{swapHorizontalRoundedBold-DPiVhN-O.js → swapHorizontalRoundedBold-D-nAnu47.js} +1 -1
- package/dist/website/assets/{swapVertical-Fc8jF_6a.js → swapVertical-DXYw64Gv.js} +1 -1
- package/dist/website/assets/{swaps-D7h2vN4O.js → swaps-DcF_cAL3.js} +1 -1
- package/dist/website/assets/{telegram-s8DNJhqL.js → telegram-D6f1t_w1.js} +1 -1
- package/dist/website/assets/{three-dots-DUPBzsjQ.js → three-dots-Ct4Bt9fa.js} +1 -1
- package/dist/website/assets/{ton-connector-b37k02lA.js → ton-connector-DX6PEEu6.js} +1 -1
- package/dist/website/assets/{transactions-BRUgq8XT.js → transactions-NlQoRKDN.js} +1 -1
- package/dist/website/assets/{tron-connector-ox8kl_zv.js → tron-connector-DnNZm1ad.js} +3 -3
- package/dist/website/assets/{twitch-Caz90Rn_.js → twitch-D6l2ucO_.js} +1 -1
- package/dist/website/assets/{twitterIcon-BxKf8Jh_.js → twitterIcon-B_BwiCHt.js} +1 -1
- package/dist/website/assets/tx-M8zFD10L.js +1 -0
- package/dist/website/assets/{utils-CGAMSRtW.js → utils-yNiv3ygK.js} +1 -1
- package/dist/website/assets/{verify-wZntm1qK.js → verify-Dqnc4oTE.js} +1 -1
- package/dist/website/assets/{verify-filled-Dn15pE3Y.js → verify-filled-CMUc8_Tu.js} +1 -1
- package/dist/website/assets/{w3m-activity-list-CSy1D7Px.js → w3m-activity-list-OGYrJa_i.js} +1 -1
- package/dist/website/assets/{w3m-email-otp-widget-ZZK1MWCg.js → w3m-email-otp-widget-CQKNfGsf.js} +1 -1
- package/dist/website/assets/{w3m-legal-footer-CyRmKgcT.js → w3m-legal-footer-QkjY632O.js} +1 -1
- package/dist/website/assets/{w3m-modal-C74Z-Wde.js → w3m-modal-K5qblTEQ.js} +1 -1
- package/dist/website/assets/{w3m-modal-BmJeZR8F.js → w3m-modal-VMveiR8F.js} +1 -1
- package/dist/website/assets/{w3m-modal-ClrTQhCp.js → w3m-modal-XAHgBJGP.js} +1 -1
- package/dist/website/assets/{w3m-router-D2i1-9eU.js → w3m-router-o5zv6Iwe.js} +1 -1
- package/dist/website/assets/{w3m-tooltip-B65dDAf0.js → w3m-tooltip-Cf2MoT2S.js} +1 -1
- package/dist/website/assets/{w3m-tooltip-trigger-Dkf1to8X.js → w3m-tooltip-trigger-DANArbtb.js} +1 -1
- package/dist/website/assets/{wallet-CiIFi6Ow.js → wallet-CwzDEuji.js} +1 -1
- package/dist/website/assets/{wallet-manager-BahrWHsh.js → wallet-manager-DlDW8sTG.js} +4 -4
- package/dist/website/assets/{wallet-placeholder-CS75xGdX.js → wallet-placeholder-lvbGOM19.js} +1 -1
- package/dist/website/assets/{walletconnect-C8bigzxh.js → walletconnect-1RONYn1c.js} +1 -1
- package/dist/website/assets/{warning-circle-CU03RvAv.js → warning-circle-rLUGv8BB.js} +1 -1
- package/dist/website/assets/{wui-button-El6Iki-c.js → wui-button-RbojCS_V.js} +1 -1
- package/dist/website/assets/{wui-chip-button-r2MeEzUd.js → wui-chip-button-DJqoVDqs.js} +1 -1
- package/dist/website/assets/{wui-email-input-KVuJsbZ7.js → wui-email-input-BDTuv7qX.js} +1 -1
- package/dist/website/assets/wui-icon-CX2U1cQN.js +1 -0
- package/dist/website/assets/{wui-icon-CWzpC6lY.js → wui-icon-DGvilNiQ.js} +1 -1
- package/dist/website/assets/wui-icon-box-DVQU4OBo.js +1 -0
- package/dist/website/assets/{wui-icon-box-DUCAMlgp.js → wui-icon-box-DcWR69zt.js} +1 -1
- package/dist/website/assets/{wui-icon-link-NP-6zNqd.js → wui-icon-link-DHSEK3F6.js} +1 -1
- package/dist/website/assets/{wui-image-DDLPZ8QL.js → wui-image-C7Cs2dFG.js} +1 -1
- package/dist/website/assets/wui-image-Z7-7hOwu.js +1 -0
- package/dist/website/assets/wui-input-text-D3nDS5vo.js +1 -0
- package/dist/website/assets/{wui-input-text-DGKNu3Vs.js → wui-input-text-DNXtkc3b.js} +1 -1
- package/dist/website/assets/{wui-link-Dx14km_P.js → wui-link-B3ACN9m1.js} +1 -1
- package/dist/website/assets/{wui-list-item-D48C89uG.js → wui-list-item-IkfIdqB_.js} +1 -1
- package/dist/website/assets/{wui-list-social-CS4muZ7_.js → wui-list-social-1TJN_kN9.js} +1 -1
- package/dist/website/assets/{wui-list-token-SM4Gg8uh.js → wui-list-token-BEOVjAxO.js} +1 -1
- package/dist/website/assets/wui-loading-spinner-DYStep66.js +1 -0
- package/dist/website/assets/{wui-loading-spinner-E_XVq0Ku.js → wui-loading-spinner-Dit3fDIZ.js} +1 -1
- package/dist/website/assets/{wui-loading-thumbnail-DZDea1B9.js → wui-loading-thumbnail-CgsJwZcw.js} +1 -1
- package/dist/website/assets/{wui-qr-code-CKi_M-xO.js → wui-qr-code-aMc5Qnn_.js} +1 -1
- package/dist/website/assets/{wui-separator-Cif5cLAA.js → wui-separator-tSBrE8qX.js} +1 -1
- package/dist/website/assets/wui-shimmer-BJS_0nwN.js +1 -0
- package/dist/website/assets/{wui-shimmer-C1HyYtrS.js → wui-shimmer-Bdko9qLE.js} +1 -1
- package/dist/website/assets/{wui-tag-BmR8aESq.js → wui-tag-2uJXk-g0.js} +1 -1
- package/dist/website/assets/{wui-text-CkYfVs2Q.js → wui-text-CwFmUhFG.js} +1 -1
- package/dist/website/assets/{wui-text-BTGzDPZb.js → wui-text-DkRtRoYA.js} +1 -1
- package/dist/website/assets/{wui-text-D7fAhGZ-.js → wui-text-NSwyfOcr.js} +3 -3
- package/dist/website/assets/{wui-token-button-BZHb2bII.js → wui-token-button-Fd4nqF_T.js} +1 -1
- package/dist/website/assets/{wui-visual-Dmg8Q6ZO.js → wui-visual-Dqd3OHrH.js} +1 -1
- package/dist/website/assets/{wui-wallet-image-D2jDLEip.js → wui-wallet-image-BbrxI49C.js} +1 -1
- package/dist/website/assets/{x-g7NuP_zt.js → x-B927Ooe7.js} +1 -1
- package/dist/website/index.html +1 -1
- package/package.json +1 -1
- package/dist/bundle/dist-Dg6gWrxW.js +0 -1
- package/dist/bundle/name-service-C5U_6bCa.js +0 -1
- package/dist/bundle/networks-DkZQuO0f.js +0 -1
- package/dist/bundle/tx-J4VM1ks9.js +0 -1
- package/dist/package/dist-Ird-eHMD.js +0 -3
- package/dist/package/name-service-DZL_wu3E.js +0 -3
- package/dist/package/tx-BMW2v_GY.js +0 -3
- package/dist/website/assets/cursor-DTyK8ya2.js +0 -3
- package/dist/website/assets/dist-DvvuyouA.js +0 -1
- package/dist/website/assets/en_US-IFPOGBSL-CpUUm4oA.js +0 -1
- package/dist/website/assets/name-service-_X3z8z-1.js +0 -1
- package/dist/website/assets/tx-D_pX3LCM.js +0 -1
- package/dist/website/assets/wui-icon-BSkhJpAH.js +0 -1
- package/dist/website/assets/wui-icon-box-aq-ZFyFc.js +0 -1
- package/dist/website/assets/wui-image-DTA4cjmw.js +0 -1
- package/dist/website/assets/wui-input-text-CZWEFoh2.js +0 -1
- package/dist/website/assets/wui-loading-spinner-CKB70hw4.js +0 -1
- package/dist/website/assets/wui-shimmer-CSJ2ENlN.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as e}from"./chunk-CJJwijRH.js";import{n as t,t as n}from"./dist-CeXM7Kux.js";import{n as r,t as i}from"./dist-BalQtXKe.js";import{r as a,t as o}from"./dist-BQMAk709.js";import{t as s}from"./events-H7eok89L.js";import{n as c,t as l}from"./index.es-CVduIgnn.js";import{a as u,c as d,i as f,l as p,o as m,r as h,s as g,t as _,u as v}from"./index.es-CD1QZ58d.js";import{_ as y,a as b,d as x,f as S,g as C,h as w,i as T,l as E,n as D,o as O,p as k,r as A,s as j,u as M,v as N}from"./browser-ponyfill-Um6_QYhg.js";import{n as P,t as F}from"./esm-DovyE5S1.js";import{a as I,i as L,n as R,r as ee,t as te}from"./index.es-6CkPQHjl.js";import{t as ne}from"./esm-DZjVTWAH.js";import{n as re,r as ie,t as ae}from"./decode-XNepIc6v.js";import{n as oe,r as se,t as ce}from"./src-BNPFDZz3.js";import{t as le}from"./blakejs-C2IeO1K2.js";n(),r(),a();var ue=e(s()),de=Object.defineProperty,fe=(e,t,n)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pe=(e,t,n)=>fe(e,typeof t==`symbol`?t:t+``,n),me=class extends N{constructor(e){super(),this.opts=e,pe(this,`protocol`,`wc`),pe(this,`version`,2)}},he=Object.defineProperty,ge=(e,t,n)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_e=(e,t,n)=>ge(e,typeof t==`symbol`?t:t+``,n),ve=class extends N{constructor(e,t){super(),this.core=e,this.logger=t,_e(this,`records`,new Map)}},ye=class{constructor(e,t){this.logger=e,this.core=t}},be=class extends N{constructor(e,t){super(),this.relayer=e,this.logger=t}},xe=class extends N{constructor(e){super()}},Se=class{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}},Ce=class extends N{constructor(e,t){super(),this.relayer=e,this.logger=t}},we=class extends N{constructor(e,t){super(),this.core=e,this.logger=t}},Te=class{constructor(e,t,n){this.core=e,this.logger=t,this.store=n}},Ee=class{constructor(e,t){this.projectId=e,this.logger=t}},De=class{constructor(e,t,n){this.core=e,this.logger=t,this.telemetryEnabled=n}},Oe=Object.defineProperty,ke=(e,t,n)=>t in e?Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ae=(e,t,n)=>ke(e,typeof t==`symbol`?t:t+``,n),je=class{constructor(e){this.opts=e,Ae(this,`protocol`,`wc`),Ae(this,`version`,2)}},Me=class{constructor(e){this.client=e}},z=v(),Ne=f(),Pe=h(),Fe=le(),Ie=`:`;function Le(e){let[t,n]=e.split(Ie);return{namespace:t,reference:n}}function Re(e,t){return e.includes(`:`)?[e]:t.chains||[]}var ze=Object.defineProperty,Be=Object.defineProperties,Ve=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Ge=(e,t,n)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ke=(e,t)=>{for(var n in t||={})Ue.call(t,n)&&Ge(e,n,t[n]);if(He)for(var n of He(t))We.call(t,n)&&Ge(e,n,t[n]);return e},qe=(e,t)=>Be(e,Ve(t)),Je=(e,t,n)=>Ge(e,typeof t==`symbol`?t:t+``,n),Ye={reactNative:`react-native`,node:`node`,browser:`browser`,unknown:`unknown`};function Xe(){return typeof t<`u`&&typeof t.versions<`u`&&typeof t.versions.node<`u`}function Ze(){return!(0,Ne.getDocument)()&&!!(0,Ne.getNavigator)()&&navigator.product===`ReactNative`}function Qe(){return Ze()&&typeof i<`u`&&typeof i?.Platform<`u`&&i?.Platform.OS===`android`}function $e(){return Ze()&&typeof i<`u`&&typeof i?.Platform<`u`&&i?.Platform.OS===`ios`}function et(){return!Xe()&&!!(0,Ne.getNavigator)()&&!!(0,Ne.getDocument)()}function tt(){return Ze()?Ye.reactNative:Xe()?Ye.node:et()?Ye.browser:Ye.unknown}function nt(){try{return Ze()&&typeof i<`u`&&typeof i?.Application<`u`?i.Application?.applicationId:void 0}catch{return}}function rt(e,t){let n=new URLSearchParams(e);for(let e of Object.keys(t).sort())if(t.hasOwnProperty(e)){let r=t[e];r!==void 0&&n.set(e,r)}return n.toString()}function it(e){var t,n;let r=at();try{return e!=null&&e.url&&r.url&&new URL(e.url).host!==new URL(r.url).host&&(e.url=r.url),(t=e?.icons)!=null&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>e!==``)),qe(Ke(Ke({},r),e),{url:e?.url||r.url,name:e?.name||r.name,description:e?.description||r.description,icons:(n=e?.icons)!=null&&n.length&&e.icons.length>0?e.icons:r.icons})}catch{return e||r}}function at(){return(0,Pe.getWindowMetadata)()||{name:``,description:``,url:``,icons:[``]}}function ot(){if(tt()===Ye.reactNative&&typeof i<`u`&&typeof i?.Platform<`u`){let{OS:e,Version:t}=i.Platform;return[e,t].join(`-`)}let e=u();if(e===null)return`unknown`;let t=e.os?e.os.replace(` `,``).toLowerCase():`unknown`;return e.type===`browser`?[t,e.name,e.version].join(`-`):[t,e.version].join(`-`)}function st(){let e=tt();return e===Ye.browser?[e,(0,Ne.getLocation)()?.host||`unknown`].join(`:`):e}function ct(e,t,n){let r=ot(),i=st();return[[e,t].join(`-`),[`js`,n].join(`-`),r,i].join(`/`)}function lt({protocol:e,version:t,relayUrl:n,sdkVersion:r,auth:i,projectId:a,useOnCloseEvent:o,bundleId:s,packageName:c}){let l=n.split(`?`),u={auth:i,ua:ct(e,t,r),projectId:a,useOnCloseEvent:o||void 0,packageName:c||void 0,bundleId:s||void 0},d=rt(l[1]||``,u);return l[0]+`?`+d}function ut(e,t){return e.filter(e=>t.includes(e)).length===e.length}function dt(e){return Object.fromEntries(e.entries())}function ft(e){return new Map(Object.entries(e))}function pt(e=z.FIVE_MINUTES,t){let n=(0,z.toMiliseconds)(e||z.FIVE_MINUTES),r,i,a,o;return{resolve:e=>{a&&r&&(clearTimeout(a),r(e),o=Promise.resolve(e))},reject:e=>{a&&i&&(clearTimeout(a),i(e))},done:()=>new Promise((e,s)=>{if(o)return e(o);a=setTimeout(()=>{let e=Error(t);o=Promise.reject(e),s(e)},n),r=e,i=s})}}function mt(e,t,n){return new Promise(async(r,i)=>{let a=setTimeout(()=>i(Error(n)),t);try{r(await e)}catch(e){i(e)}clearTimeout(a)})}function ht(e,t){if(typeof t==`string`&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()===`topic`){if(typeof t!=`string`)throw Error(`Value must be "string" for expirer target type: topic`);return`topic:${t}`}else if(e.toLowerCase()===`id`){if(typeof t!=`number`)throw Error(`Value must be "number" for expirer target type: id`);return`id:${t}`}throw Error(`Unknown expirer target type: ${e}`)}function gt(e){return ht(`topic`,e)}function _t(e){return ht(`id`,e)}function vt(e){let[t,n]=e.split(`:`),r={id:void 0,topic:void 0};if(t===`topic`&&typeof n==`string`)r.topic=n;else if(t===`id`&&Number.isInteger(Number(n)))r.id=Number(n);else throw Error(`Invalid target, expected id:number or topic:string, got ${t}:${n}`);return r}function yt(e,t){return(0,z.fromMiliseconds)((t||Date.now())+(0,z.toMiliseconds)(e))}function bt(e){return Date.now()>=(0,z.toMiliseconds)(e)}function B(e,t){return`${e}${t?`:${t}`:``}`}function xt(e=[],t=[]){return[...new Set([...e,...t])]}async function St({id:e,topic:t,wcDeepLink:n}){var r;try{if(!n)return;let a=(typeof n==`string`?JSON.parse(n):n)?.href;if(typeof a!=`string`)return;let o=Ct(a,e,t),s=tt();if(s===Ye.browser){if(!((r=(0,Ne.getDocument)())!=null&&r.hasFocus()))return;wt(o)}else s===Ye.reactNative&&typeof i?.Linking<`u`&&await i.Linking.openURL(o)}catch{}}function Ct(e,t,n){let r=`requestId=${t}&sessionTopic=${n}`;e.endsWith(`/`)&&(e=e.slice(0,-1));let i=`${e}`;if(e.startsWith(`https://t.me`)){let t=e.includes(`?`)?`&startapp=`:`?startapp=`;i=`${i}${t}${jt(r,!0)}`}else i=`${i}/wc?${r}`;return i}function wt(e){let t=`_self`;At()?t=`_top`:(kt()||e.startsWith(`https://`)||e.startsWith(`http://`))&&(t=`_blank`),window.open(e,t,`noreferrer noopener`)}async function Tt(e,t){let n=``;try{if(et()&&(n=localStorage.getItem(t),n))return n;n=await e.getItem(t)}catch{}return n}function Et(e,t){if(!e.includes(t))return null;let n=e.split(/([&,?,=])/);return n[n.indexOf(t)+2]}function Dt(){return typeof crypto<`u`&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/gu,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function Ot(){return typeof t<`u`&&{}.IS_VITEST===`true`}function kt(){return typeof window<`u`&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function At(){try{return window.self!==window.top}catch{return!1}}function jt(e,t=!1){let n=o.from(e).toString(`base64`);return t?n.replace(/[=]/g,``):n}function Mt(e){return o.from(e,`base64`).toString(`utf-8`)}function Nt(e){return new Promise(t=>setTimeout(t,e))}var Pt=class{constructor({limit:e}){Je(this,`limit`),Je(this,`set`),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){let e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}},Ft=BigInt(2**32-1),It=BigInt(32);function Lt(e,t=!1){return t?{h:Number(e&Ft),l:Number(e>>It&Ft)}:{h:Number(e>>It&Ft)|0,l:Number(e&Ft)|0}}function Rt(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=Lt(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var zt=(e,t,n)=>e>>>n,Bt=(e,t,n)=>e<<32-n|t>>>n,Vt=(e,t,n)=>e>>>n|t<<32-n,Ht=(e,t,n)=>e<<32-n|t>>>n,Ut=(e,t,n)=>e<<64-n|t>>>n-32,Wt=(e,t,n)=>e>>>n-32|t<<64-n,Gt=(e,t)=>t,Kt=(e,t)=>e,qt=(e,t,n)=>e<<n|t>>>32-n,Jt=(e,t,n)=>t<<n|e>>>32-n,Yt=(e,t,n)=>t<<n-32|e>>>64-n,Xt=(e,t,n)=>e<<n-32|t>>>64-n;function Zt(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Qt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),$t=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,en=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),tn=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,nn=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),rn=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,an=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0;function on(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function sn(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function cn(e,...t){if(!on(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function ln(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);sn(e.outputLen),sn(e.blockLen)}function un(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function dn(e,t){cn(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function fn(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function pn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function mn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function hn(e,t){return e<<32-t|e>>>t}var gn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function _n(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}var vn=gn?e=>e:e=>_n(e);function yn(e){for(let t=0;t<e.length;t++)e[t]=_n(e[t]);return e}var bn=gn?e=>e:yn,xn=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Sn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Cn(e){if(cn(e),xn)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Sn[e[n]];return t}var wn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Tn(e){if(e>=wn._0&&e<=wn._9)return e-wn._0;if(e>=wn.A&&e<=wn.F)return e-(wn.A-10);if(e>=wn.a&&e<=wn.f)return e-(wn.a-10)}function En(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(xn)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=Tn(e.charCodeAt(i)),a=Tn(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function Dn(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function On(e){return typeof e==`string`&&(e=Dn(e)),cn(e),e}function kn(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];cn(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}var An=class{};function jn(e){let t=t=>e().update(On(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Mn(e){let t=(t,n)=>e(n).update(On(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function Nn(e=32){if(an&&typeof an.getRandomValues==`function`)return an.getRandomValues(new Uint8Array(e));if(an&&typeof an.randomBytes==`function`)return Uint8Array.from(an.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}var Pn=BigInt(0),Fn=BigInt(1),In=BigInt(2),Ln=BigInt(7),Rn=BigInt(256),zn=BigInt(113),Bn=[],Vn=[],Hn=[];for(let e=0,t=Fn,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Bn.push(2*(5*r+n)),Vn.push((e+1)*(e+2)/2%64);let i=Pn;for(let e=0;e<7;e++)t=(t<<Fn^(t>>Ln)*zn)%Rn,t&In&&(i^=Fn<<(Fn<<BigInt(e))-Fn);Hn.push(i)}var Un=Rt(Hn,!0),Wn=Un[0],Gn=Un[1],Kn=(e,t,n)=>n>32?Yt(e,t,n):qt(e,t,n),qn=(e,t,n)=>n>32?Xt(e,t,n):Jt(e,t,n);function Jn(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,a=n[i],o=n[i+1],s=Kn(a,o,1)^n[r],c=qn(a,o,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=Vn[n],a=Kn(t,i,r),o=qn(t,i,r),s=Bn[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=Wn[r],e[1]^=Gn[r]}pn(n)}var Yn=class e extends An{constructor(e,t,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,sn(n),!(0<e&&e<200))throw Error(`only keccak-f1600 function is supported`);this.state=new Uint8Array(200),this.state32=fn(this.state)}clone(){return this._cloneInto()}keccak(){bn(this.state32),Jn(this.state32,this.rounds),bn(this.state32),this.posOut=0,this.pos=0}update(e){un(this),e=On(e),cn(e);let{blockLen:t,state:n}=this,r=e.length;for(let i=0;i<r;){let a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){un(this,!1),cn(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not possible for this instance`);return this.writeInto(e)}xof(e){return sn(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(dn(e,this),this.finished)throw Error(`digest() was already called`);return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,pn(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}},Xn=((e,t,n)=>jn(()=>new Yn(t,e,n)))(1,136,256/8);function Zn(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function Qn(e,t,n){return e&t^~e&n}function $n(e,t,n){return e&t^e&n^t&n}var er=class extends An{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=mn(this.buffer)}update(e){un(this),e=On(e),cn(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=mn(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){un(this),dn(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,pn(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Zn(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=mn(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},tr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),nr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),rr=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ir=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ar=new Uint32Array(64),or=class extends er{constructor(e=32){super(64,e,8,!1),this.A=tr[0]|0,this.B=tr[1]|0,this.C=tr[2]|0,this.D=tr[3]|0,this.E=tr[4]|0,this.F=tr[5]|0,this.G=tr[6]|0,this.H=tr[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)ar[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=ar[e-15],n=ar[e-2],r=hn(t,7)^hn(t,18)^t>>>3;ar[e]=(hn(n,17)^hn(n,19)^n>>>10)+ar[e-7]+r+ar[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=hn(o,6)^hn(o,11)^hn(o,25),u=l+t+Qn(o,s,c)+ir[e]+ar[e]|0,d=(hn(n,2)^hn(n,13)^hn(n,22))+$n(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){pn(ar)}destroy(){this.set(0,0,0,0,0,0,0,0),pn(this.buffer)}},sr=Rt(`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`.split(`.`).map(e=>BigInt(e))),cr=sr[0],lr=sr[1],ur=new Uint32Array(80),dr=new Uint32Array(80),fr=class extends er{constructor(e=64){super(128,e,16,!1),this.Ah=rr[0]|0,this.Al=rr[1]|0,this.Bh=rr[2]|0,this.Bl=rr[3]|0,this.Ch=rr[4]|0,this.Cl=rr[5]|0,this.Dh=rr[6]|0,this.Dl=rr[7]|0,this.Eh=rr[8]|0,this.El=rr[9]|0,this.Fh=rr[10]|0,this.Fl=rr[11]|0,this.Gh=rr[12]|0,this.Gl=rr[13]|0,this.Hh=rr[14]|0,this.Hl=rr[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)ur[n]=e.getUint32(t),dr[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=ur[e-15]|0,n=dr[e-15]|0,r=Vt(t,n,1)^Vt(t,n,8)^zt(t,n,7),i=Ht(t,n,1)^Ht(t,n,8)^Bt(t,n,7),a=ur[e-2]|0,o=dr[e-2]|0,s=Vt(a,o,19)^Ut(a,o,61)^zt(a,o,6),c=en(i,Ht(a,o,19)^Wt(a,o,61)^Bt(a,o,6),dr[e-7],dr[e-16]);ur[e]=tn(c,r,s,ur[e-7],ur[e-16])|0,dr[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=Vt(u,d,14)^Vt(u,d,18)^Ut(u,d,41),v=Ht(u,d,14)^Ht(u,d,18)^Wt(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=nn(_,v,b,lr[e],dr[e]),S=rn(x,g,t,y,cr[e],ur[e]),C=x|0,w=Vt(n,r,28)^Ut(n,r,34)^Ut(n,r,39),T=Ht(n,r,28)^Wt(n,r,34)^Wt(n,r,39),E=n&i^n&o^i&o,D=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Zt(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let O=Qt(C,T,D);n=$t(O,S,w,E),r=O|0}({h:n,l:r}=Zt(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Zt(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Zt(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Zt(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Zt(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Zt(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Zt(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Zt(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){pn(ur,dr)}destroy(){pn(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},pr=class extends fr{constructor(){super(48),this.Ah=nr[0]|0,this.Al=nr[1]|0,this.Bh=nr[2]|0,this.Bl=nr[3]|0,this.Ch=nr[4]|0,this.Cl=nr[5]|0,this.Dh=nr[6]|0,this.Dl=nr[7]|0,this.Eh=nr[8]|0,this.El=nr[9]|0,this.Fh=nr[10]|0,this.Fl=nr[11]|0,this.Gh=nr[12]|0,this.Gl=nr[13]|0,this.Hh=nr[14]|0,this.Hl=nr[15]|0}},mr=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),hr=class extends fr{constructor(){super(32),this.Ah=mr[0]|0,this.Al=mr[1]|0,this.Bh=mr[2]|0,this.Bl=mr[3]|0,this.Ch=mr[4]|0,this.Cl=mr[5]|0,this.Dh=mr[6]|0,this.Dl=mr[7]|0,this.Eh=mr[8]|0,this.El=mr[9]|0,this.Fh=mr[10]|0,this.Fl=mr[11]|0,this.Gh=mr[12]|0,this.Gl=mr[13]|0,this.Hh=mr[14]|0,this.Hl=mr[15]|0}},gr=jn(()=>new or),_r=jn(()=>new fr),vr=jn(()=>new pr),yr=jn(()=>new hr),br=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),xr=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),V=new Uint32Array(32);function Sr(e,t,n,r,i,a){let o=i[a],s=i[a+1],c=V[2*e],l=V[2*e+1],u=V[2*t],d=V[2*t+1],f=V[2*n],p=V[2*n+1],m=V[2*r],h=V[2*r+1],g=Qt(c,u,o);l=$t(g,l,d,s),c=g|0,{Dh:h,Dl:m}={Dh:h^l,Dl:m^c},{Dh:h,Dl:m}={Dh:Gt(h,m),Dl:Kt(h)},{h:p,l:f}=Zt(p,f,h,m),{Bh:d,Bl:u}={Bh:d^p,Bl:u^f},{Bh:d,Bl:u}={Bh:Vt(d,u,24),Bl:Ht(d,u,24)},V[2*e]=c,V[2*e+1]=l,V[2*t]=u,V[2*t+1]=d,V[2*n]=f,V[2*n+1]=p,V[2*r]=m,V[2*r+1]=h}function Cr(e,t,n,r,i,a){let o=i[a],s=i[a+1],c=V[2*e],l=V[2*e+1],u=V[2*t],d=V[2*t+1],f=V[2*n],p=V[2*n+1],m=V[2*r],h=V[2*r+1],g=Qt(c,u,o);l=$t(g,l,d,s),c=g|0,{Dh:h,Dl:m}={Dh:h^l,Dl:m^c},{Dh:h,Dl:m}={Dh:Vt(h,m,16),Dl:Ht(h,m,16)},{h:p,l:f}=Zt(p,f,h,m),{Bh:d,Bl:u}={Bh:d^p,Bl:u^f},{Bh:d,Bl:u}={Bh:Ut(d,u,63),Bl:Wt(d,u,63)},V[2*e]=c,V[2*e+1]=l,V[2*t]=u,V[2*t+1]=d,V[2*n]=f,V[2*n+1]=p,V[2*r]=m,V[2*r+1]=h}function wr(e,t={},n,r,i){if(sn(n),e<0||e>n)throw Error(`outputLen bigger than keyLen`);let{key:a,salt:o,personalization:s}=t;if(a!==void 0&&(a.length<1||a.length>n))throw Error(`key length must be undefined or 1..`+n);if(o!==void 0&&o.length!==r)throw Error(`salt must be undefined or `+r);if(s!==void 0&&s.length!==i)throw Error(`personalization must be undefined or `+i)}var Tr=class extends An{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,sn(e),sn(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=fn(this.buffer)}update(e){un(this),e=On(e),cn(e);let{blockLen:t,buffer:n,buffer32:r}=this,i=e.length,a=e.byteOffset,o=e.buffer;for(let s=0;s<i;){this.pos===t&&(bn(r),this.compress(r,0,!1),bn(r),this.pos=0);let c=Math.min(t-this.pos,i-s),l=a+s;if(c===t&&!(l%4)&&s+c<i){let e=new Uint32Array(o,l,Math.floor((i-s)/4));bn(e);for(let n=0;s+t<i;n+=r.length,s+=t)this.length+=t,this.compress(e,n,!1);bn(e);continue}n.set(e.subarray(s,s+c),this.pos),this.pos+=c,this.length+=c,s+=c}return this}digestInto(e){un(this),dn(e,this);let{pos:t,buffer32:n}=this;this.finished=!0,pn(this.buffer.subarray(t)),bn(n),this.compress(n,0,!0),bn(n);let r=fn(e);this.get().forEach((e,t)=>r[t]=vn(e))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){let{buffer:t,length:n,finished:r,destroyed:i,outputLen:a,pos:o}=this;return e||=new this.constructor({dkLen:a}),e.set(...this.get()),e.buffer.set(t),e.destroyed=i,e.finished=r,e.length=n,e.pos=o,e.outputLen=a,e}clone(){return this._cloneInto()}},Er=class extends Tr{constructor(e={}){let t=e.dkLen===void 0?64:e.dkLen;super(128,t),this.v0l=xr[0]|0,this.v0h=xr[1]|0,this.v1l=xr[2]|0,this.v1h=xr[3]|0,this.v2l=xr[4]|0,this.v2h=xr[5]|0,this.v3l=xr[6]|0,this.v3h=xr[7]|0,this.v4l=xr[8]|0,this.v4h=xr[9]|0,this.v5l=xr[10]|0,this.v5h=xr[11]|0,this.v6l=xr[12]|0,this.v6h=xr[13]|0,this.v7l=xr[14]|0,this.v7h=xr[15]|0,wr(t,e,64,16,16);let{key:n,personalization:r,salt:i}=e,a=0;if(n!==void 0&&(n=On(n),a=n.length),this.v0l^=this.outputLen|a<<8|16842752,i!==void 0){i=On(i);let e=fn(i);this.v4l^=vn(e[0]),this.v4h^=vn(e[1]),this.v5l^=vn(e[2]),this.v5h^=vn(e[3])}if(r!==void 0){r=On(r);let e=fn(r);this.v6l^=vn(e[0]),this.v6h^=vn(e[1]),this.v7l^=vn(e[2]),this.v7h^=vn(e[3])}if(n!==void 0){let e=new Uint8Array(this.blockLen);e.set(n),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:i,v2h:a,v3l:o,v3h:s,v4l:c,v4h:l,v5l:u,v5h:d,v6l:f,v6h:p,v7l:m,v7h:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.v0l=e|0,this.v0h=t|0,this.v1l=n|0,this.v1h=r|0,this.v2l=i|0,this.v2h=a|0,this.v3l=o|0,this.v3h=s|0,this.v4l=c|0,this.v4h=l|0,this.v5l=u|0,this.v5h=d|0,this.v6l=f|0,this.v6h=p|0,this.v7l=m|0,this.v7h=h|0}compress(e,t,n){this.get().forEach((e,t)=>V[t]=e),V.set(xr,16);let{h:r,l:i}=Lt(BigInt(this.length));V[24]=xr[8]^i,V[25]=xr[9]^r,n&&(V[28]=~V[28],V[29]=~V[29]);let a=0,o=br;for(let n=0;n<12;n++)Sr(0,4,8,12,e,t+2*o[a++]),Cr(0,4,8,12,e,t+2*o[a++]),Sr(1,5,9,13,e,t+2*o[a++]),Cr(1,5,9,13,e,t+2*o[a++]),Sr(2,6,10,14,e,t+2*o[a++]),Cr(2,6,10,14,e,t+2*o[a++]),Sr(3,7,11,15,e,t+2*o[a++]),Cr(3,7,11,15,e,t+2*o[a++]),Sr(0,5,10,15,e,t+2*o[a++]),Cr(0,5,10,15,e,t+2*o[a++]),Sr(1,6,11,12,e,t+2*o[a++]),Cr(1,6,11,12,e,t+2*o[a++]),Sr(2,7,8,13,e,t+2*o[a++]),Cr(2,7,8,13,e,t+2*o[a++]),Sr(3,4,9,14,e,t+2*o[a++]),Cr(3,4,9,14,e,t+2*o[a++]);this.v0l^=V[0]^V[16],this.v0h^=V[1]^V[17],this.v1l^=V[2]^V[18],this.v1h^=V[3]^V[19],this.v2l^=V[4]^V[20],this.v2h^=V[5]^V[21],this.v3l^=V[6]^V[22],this.v3h^=V[7]^V[23],this.v4l^=V[8]^V[24],this.v4h^=V[9]^V[25],this.v5l^=V[10]^V[26],this.v5h^=V[11]^V[27],this.v6l^=V[12]^V[28],this.v6h^=V[13]^V[29],this.v7l^=V[14]^V[30],this.v7h^=V[15]^V[31],pn(V)}destroy(){this.destroyed=!0,pn(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Dr=Mn(e=>new Er(e)),Or=`https://rpc.walletconnect.org/v1`;function kr(e){let t=`Ethereum Signed Message:
|
|
1
|
+
import{s as e}from"./chunk-CJJwijRH.js";import{n as t,t as n}from"./dist-CeXM7Kux.js";import{n as r,t as i}from"./dist-BalQtXKe.js";import{r as a,t as o}from"./dist-BQMAk709.js";import{t as s}from"./events-H7eok89L.js";import{n as c,t as l}from"./index.es-CVduIgnn.js";import{a as u,c as d,i as f,l as p,o as m,r as h,s as g,t as _,u as v}from"./index.es-CD1QZ58d.js";import{_ as y,a as b,d as x,f as S,g as C,h as w,i as T,l as E,n as D,o as O,p as k,r as A,s as j,u as M,v as N}from"./browser-ponyfill-Um6_QYhg.js";import{n as P,t as F}from"./esm-DovyE5S1.js";import{a as I,i as L,n as R,r as ee,t as te}from"./index.es-6CkPQHjl.js";import{t as ne}from"./esm-DZjVTWAH.js";import{n as re,r as ie,t as ae}from"./decode-DmPUixTK.js";import{n as oe,r as se,t as ce}from"./src-BNPFDZz3.js";import{t as le}from"./blakejs-C2IeO1K2.js";n(),r(),a();var ue=e(s()),de=Object.defineProperty,fe=(e,t,n)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pe=(e,t,n)=>fe(e,typeof t==`symbol`?t:t+``,n),me=class extends N{constructor(e){super(),this.opts=e,pe(this,`protocol`,`wc`),pe(this,`version`,2)}},he=Object.defineProperty,ge=(e,t,n)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_e=(e,t,n)=>ge(e,typeof t==`symbol`?t:t+``,n),ve=class extends N{constructor(e,t){super(),this.core=e,this.logger=t,_e(this,`records`,new Map)}},ye=class{constructor(e,t){this.logger=e,this.core=t}},be=class extends N{constructor(e,t){super(),this.relayer=e,this.logger=t}},xe=class extends N{constructor(e){super()}},Se=class{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}},Ce=class extends N{constructor(e,t){super(),this.relayer=e,this.logger=t}},we=class extends N{constructor(e,t){super(),this.core=e,this.logger=t}},Te=class{constructor(e,t,n){this.core=e,this.logger=t,this.store=n}},Ee=class{constructor(e,t){this.projectId=e,this.logger=t}},De=class{constructor(e,t,n){this.core=e,this.logger=t,this.telemetryEnabled=n}},Oe=Object.defineProperty,ke=(e,t,n)=>t in e?Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ae=(e,t,n)=>ke(e,typeof t==`symbol`?t:t+``,n),je=class{constructor(e){this.opts=e,Ae(this,`protocol`,`wc`),Ae(this,`version`,2)}},Me=class{constructor(e){this.client=e}},z=v(),Ne=f(),Pe=h(),Fe=le(),Ie=`:`;function Le(e){let[t,n]=e.split(Ie);return{namespace:t,reference:n}}function Re(e,t){return e.includes(`:`)?[e]:t.chains||[]}var ze=Object.defineProperty,Be=Object.defineProperties,Ve=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Ge=(e,t,n)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ke=(e,t)=>{for(var n in t||={})Ue.call(t,n)&&Ge(e,n,t[n]);if(He)for(var n of He(t))We.call(t,n)&&Ge(e,n,t[n]);return e},qe=(e,t)=>Be(e,Ve(t)),Je=(e,t,n)=>Ge(e,typeof t==`symbol`?t:t+``,n),Ye={reactNative:`react-native`,node:`node`,browser:`browser`,unknown:`unknown`};function Xe(){return typeof t<`u`&&typeof t.versions<`u`&&typeof t.versions.node<`u`}function Ze(){return!(0,Ne.getDocument)()&&!!(0,Ne.getNavigator)()&&navigator.product===`ReactNative`}function Qe(){return Ze()&&typeof i<`u`&&typeof i?.Platform<`u`&&i?.Platform.OS===`android`}function $e(){return Ze()&&typeof i<`u`&&typeof i?.Platform<`u`&&i?.Platform.OS===`ios`}function et(){return!Xe()&&!!(0,Ne.getNavigator)()&&!!(0,Ne.getDocument)()}function tt(){return Ze()?Ye.reactNative:Xe()?Ye.node:et()?Ye.browser:Ye.unknown}function nt(){try{return Ze()&&typeof i<`u`&&typeof i?.Application<`u`?i.Application?.applicationId:void 0}catch{return}}function rt(e,t){let n=new URLSearchParams(e);for(let e of Object.keys(t).sort())if(t.hasOwnProperty(e)){let r=t[e];r!==void 0&&n.set(e,r)}return n.toString()}function it(e){var t,n;let r=at();try{return e!=null&&e.url&&r.url&&new URL(e.url).host!==new URL(r.url).host&&(e.url=r.url),(t=e?.icons)!=null&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>e!==``)),qe(Ke(Ke({},r),e),{url:e?.url||r.url,name:e?.name||r.name,description:e?.description||r.description,icons:(n=e?.icons)!=null&&n.length&&e.icons.length>0?e.icons:r.icons})}catch{return e||r}}function at(){return(0,Pe.getWindowMetadata)()||{name:``,description:``,url:``,icons:[``]}}function ot(){if(tt()===Ye.reactNative&&typeof i<`u`&&typeof i?.Platform<`u`){let{OS:e,Version:t}=i.Platform;return[e,t].join(`-`)}let e=u();if(e===null)return`unknown`;let t=e.os?e.os.replace(` `,``).toLowerCase():`unknown`;return e.type===`browser`?[t,e.name,e.version].join(`-`):[t,e.version].join(`-`)}function st(){let e=tt();return e===Ye.browser?[e,(0,Ne.getLocation)()?.host||`unknown`].join(`:`):e}function ct(e,t,n){let r=ot(),i=st();return[[e,t].join(`-`),[`js`,n].join(`-`),r,i].join(`/`)}function lt({protocol:e,version:t,relayUrl:n,sdkVersion:r,auth:i,projectId:a,useOnCloseEvent:o,bundleId:s,packageName:c}){let l=n.split(`?`),u={auth:i,ua:ct(e,t,r),projectId:a,useOnCloseEvent:o||void 0,packageName:c||void 0,bundleId:s||void 0},d=rt(l[1]||``,u);return l[0]+`?`+d}function ut(e,t){return e.filter(e=>t.includes(e)).length===e.length}function dt(e){return Object.fromEntries(e.entries())}function ft(e){return new Map(Object.entries(e))}function pt(e=z.FIVE_MINUTES,t){let n=(0,z.toMiliseconds)(e||z.FIVE_MINUTES),r,i,a,o;return{resolve:e=>{a&&r&&(clearTimeout(a),r(e),o=Promise.resolve(e))},reject:e=>{a&&i&&(clearTimeout(a),i(e))},done:()=>new Promise((e,s)=>{if(o)return e(o);a=setTimeout(()=>{let e=Error(t);o=Promise.reject(e),s(e)},n),r=e,i=s})}}function mt(e,t,n){return new Promise(async(r,i)=>{let a=setTimeout(()=>i(Error(n)),t);try{r(await e)}catch(e){i(e)}clearTimeout(a)})}function ht(e,t){if(typeof t==`string`&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()===`topic`){if(typeof t!=`string`)throw Error(`Value must be "string" for expirer target type: topic`);return`topic:${t}`}else if(e.toLowerCase()===`id`){if(typeof t!=`number`)throw Error(`Value must be "number" for expirer target type: id`);return`id:${t}`}throw Error(`Unknown expirer target type: ${e}`)}function gt(e){return ht(`topic`,e)}function _t(e){return ht(`id`,e)}function vt(e){let[t,n]=e.split(`:`),r={id:void 0,topic:void 0};if(t===`topic`&&typeof n==`string`)r.topic=n;else if(t===`id`&&Number.isInteger(Number(n)))r.id=Number(n);else throw Error(`Invalid target, expected id:number or topic:string, got ${t}:${n}`);return r}function yt(e,t){return(0,z.fromMiliseconds)((t||Date.now())+(0,z.toMiliseconds)(e))}function bt(e){return Date.now()>=(0,z.toMiliseconds)(e)}function B(e,t){return`${e}${t?`:${t}`:``}`}function xt(e=[],t=[]){return[...new Set([...e,...t])]}async function St({id:e,topic:t,wcDeepLink:n}){var r;try{if(!n)return;let a=(typeof n==`string`?JSON.parse(n):n)?.href;if(typeof a!=`string`)return;let o=Ct(a,e,t),s=tt();if(s===Ye.browser){if(!((r=(0,Ne.getDocument)())!=null&&r.hasFocus()))return;wt(o)}else s===Ye.reactNative&&typeof i?.Linking<`u`&&await i.Linking.openURL(o)}catch{}}function Ct(e,t,n){let r=`requestId=${t}&sessionTopic=${n}`;e.endsWith(`/`)&&(e=e.slice(0,-1));let i=`${e}`;if(e.startsWith(`https://t.me`)){let t=e.includes(`?`)?`&startapp=`:`?startapp=`;i=`${i}${t}${jt(r,!0)}`}else i=`${i}/wc?${r}`;return i}function wt(e){let t=`_self`;At()?t=`_top`:(kt()||e.startsWith(`https://`)||e.startsWith(`http://`))&&(t=`_blank`),window.open(e,t,`noreferrer noopener`)}async function Tt(e,t){let n=``;try{if(et()&&(n=localStorage.getItem(t),n))return n;n=await e.getItem(t)}catch{}return n}function Et(e,t){if(!e.includes(t))return null;let n=e.split(/([&,?,=])/);return n[n.indexOf(t)+2]}function Dt(){return typeof crypto<`u`&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/gu,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function Ot(){return typeof t<`u`&&{}.IS_VITEST===`true`}function kt(){return typeof window<`u`&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function At(){try{return window.self!==window.top}catch{return!1}}function jt(e,t=!1){let n=o.from(e).toString(`base64`);return t?n.replace(/[=]/g,``):n}function Mt(e){return o.from(e,`base64`).toString(`utf-8`)}function Nt(e){return new Promise(t=>setTimeout(t,e))}var Pt=class{constructor({limit:e}){Je(this,`limit`),Je(this,`set`),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){let e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}},Ft=BigInt(2**32-1),It=BigInt(32);function Lt(e,t=!1){return t?{h:Number(e&Ft),l:Number(e>>It&Ft)}:{h:Number(e>>It&Ft)|0,l:Number(e&Ft)|0}}function Rt(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=Lt(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}var zt=(e,t,n)=>e>>>n,Bt=(e,t,n)=>e<<32-n|t>>>n,Vt=(e,t,n)=>e>>>n|t<<32-n,Ht=(e,t,n)=>e<<32-n|t>>>n,Ut=(e,t,n)=>e<<64-n|t>>>n-32,Wt=(e,t,n)=>e>>>n-32|t<<64-n,Gt=(e,t)=>t,Kt=(e,t)=>e,qt=(e,t,n)=>e<<n|t>>>32-n,Jt=(e,t,n)=>t<<n|e>>>32-n,Yt=(e,t,n)=>t<<n-32|e>>>64-n,Xt=(e,t,n)=>e<<n-32|t>>>64-n;function Zt(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Qt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),$t=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,en=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),tn=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,nn=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),rn=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,an=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0;function on(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function sn(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function cn(e,...t){if(!on(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function ln(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);sn(e.outputLen),sn(e.blockLen)}function un(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function dn(e,t){cn(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function fn(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function pn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function mn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function hn(e,t){return e<<32-t|e>>>t}var gn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function _n(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}var vn=gn?e=>e:e=>_n(e);function yn(e){for(let t=0;t<e.length;t++)e[t]=_n(e[t]);return e}var bn=gn?e=>e:yn,xn=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Sn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Cn(e){if(cn(e),xn)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Sn[e[n]];return t}var wn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Tn(e){if(e>=wn._0&&e<=wn._9)return e-wn._0;if(e>=wn.A&&e<=wn.F)return e-(wn.A-10);if(e>=wn.a&&e<=wn.f)return e-(wn.a-10)}function En(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(xn)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=Tn(e.charCodeAt(i)),a=Tn(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function Dn(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function On(e){return typeof e==`string`&&(e=Dn(e)),cn(e),e}function kn(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];cn(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}var An=class{};function jn(e){let t=t=>e().update(On(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Mn(e){let t=(t,n)=>e(n).update(On(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function Nn(e=32){if(an&&typeof an.getRandomValues==`function`)return an.getRandomValues(new Uint8Array(e));if(an&&typeof an.randomBytes==`function`)return Uint8Array.from(an.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}var Pn=BigInt(0),Fn=BigInt(1),In=BigInt(2),Ln=BigInt(7),Rn=BigInt(256),zn=BigInt(113),Bn=[],Vn=[],Hn=[];for(let e=0,t=Fn,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Bn.push(2*(5*r+n)),Vn.push((e+1)*(e+2)/2%64);let i=Pn;for(let e=0;e<7;e++)t=(t<<Fn^(t>>Ln)*zn)%Rn,t&In&&(i^=Fn<<(Fn<<BigInt(e))-Fn);Hn.push(i)}var Un=Rt(Hn,!0),Wn=Un[0],Gn=Un[1],Kn=(e,t,n)=>n>32?Yt(e,t,n):qt(e,t,n),qn=(e,t,n)=>n>32?Xt(e,t,n):Jt(e,t,n);function Jn(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,a=n[i],o=n[i+1],s=Kn(a,o,1)^n[r],c=qn(a,o,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=Vn[n],a=Kn(t,i,r),o=qn(t,i,r),s=Bn[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=Wn[r],e[1]^=Gn[r]}pn(n)}var Yn=class e extends An{constructor(e,t,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,sn(n),!(0<e&&e<200))throw Error(`only keccak-f1600 function is supported`);this.state=new Uint8Array(200),this.state32=fn(this.state)}clone(){return this._cloneInto()}keccak(){bn(this.state32),Jn(this.state32,this.rounds),bn(this.state32),this.posOut=0,this.pos=0}update(e){un(this),e=On(e),cn(e);let{blockLen:t,state:n}=this,r=e.length;for(let i=0;i<r;){let a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,t&128&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){un(this,!1),cn(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw Error(`XOF is not possible for this instance`);return this.writeInto(e)}xof(e){return sn(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(dn(e,this),this.finished)throw Error(`digest() was already called`);return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,pn(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return t||=new e(n,r,i,o,a),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}},Xn=((e,t,n)=>jn(()=>new Yn(t,e,n)))(1,136,256/8);function Zn(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function Qn(e,t,n){return e&t^~e&n}function $n(e,t,n){return e&t^e&n^t&n}var er=class extends An{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=mn(this.buffer)}update(e){un(this),e=On(e),cn(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=mn(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){un(this),dn(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,pn(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Zn(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=mn(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}},tr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),nr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),rr=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ir=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ar=new Uint32Array(64),or=class extends er{constructor(e=32){super(64,e,8,!1),this.A=tr[0]|0,this.B=tr[1]|0,this.C=tr[2]|0,this.D=tr[3]|0,this.E=tr[4]|0,this.F=tr[5]|0,this.G=tr[6]|0,this.H=tr[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)ar[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=ar[e-15],n=ar[e-2],r=hn(t,7)^hn(t,18)^t>>>3;ar[e]=(hn(n,17)^hn(n,19)^n>>>10)+ar[e-7]+r+ar[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=hn(o,6)^hn(o,11)^hn(o,25),u=l+t+Qn(o,s,c)+ir[e]+ar[e]|0,d=(hn(n,2)^hn(n,13)^hn(n,22))+$n(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){pn(ar)}destroy(){this.set(0,0,0,0,0,0,0,0),pn(this.buffer)}},sr=Rt(`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`.split(`.`).map(e=>BigInt(e))),cr=sr[0],lr=sr[1],ur=new Uint32Array(80),dr=new Uint32Array(80),fr=class extends er{constructor(e=64){super(128,e,16,!1),this.Ah=rr[0]|0,this.Al=rr[1]|0,this.Bh=rr[2]|0,this.Bl=rr[3]|0,this.Ch=rr[4]|0,this.Cl=rr[5]|0,this.Dh=rr[6]|0,this.Dl=rr[7]|0,this.Eh=rr[8]|0,this.El=rr[9]|0,this.Fh=rr[10]|0,this.Fl=rr[11]|0,this.Gh=rr[12]|0,this.Gl=rr[13]|0,this.Hh=rr[14]|0,this.Hl=rr[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)ur[n]=e.getUint32(t),dr[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=ur[e-15]|0,n=dr[e-15]|0,r=Vt(t,n,1)^Vt(t,n,8)^zt(t,n,7),i=Ht(t,n,1)^Ht(t,n,8)^Bt(t,n,7),a=ur[e-2]|0,o=dr[e-2]|0,s=Vt(a,o,19)^Ut(a,o,61)^zt(a,o,6),c=en(i,Ht(a,o,19)^Wt(a,o,61)^Bt(a,o,6),dr[e-7],dr[e-16]);ur[e]=tn(c,r,s,ur[e-7],ur[e-16])|0,dr[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=Vt(u,d,14)^Vt(u,d,18)^Ut(u,d,41),v=Ht(u,d,14)^Ht(u,d,18)^Wt(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=nn(_,v,b,lr[e],dr[e]),S=rn(x,g,t,y,cr[e],ur[e]),C=x|0,w=Vt(n,r,28)^Ut(n,r,34)^Ut(n,r,39),T=Ht(n,r,28)^Wt(n,r,34)^Wt(n,r,39),E=n&i^n&o^i&o,D=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Zt(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let O=Qt(C,T,D);n=$t(O,S,w,E),r=O|0}({h:n,l:r}=Zt(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Zt(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Zt(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Zt(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Zt(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Zt(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Zt(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Zt(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){pn(ur,dr)}destroy(){pn(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},pr=class extends fr{constructor(){super(48),this.Ah=nr[0]|0,this.Al=nr[1]|0,this.Bh=nr[2]|0,this.Bl=nr[3]|0,this.Ch=nr[4]|0,this.Cl=nr[5]|0,this.Dh=nr[6]|0,this.Dl=nr[7]|0,this.Eh=nr[8]|0,this.El=nr[9]|0,this.Fh=nr[10]|0,this.Fl=nr[11]|0,this.Gh=nr[12]|0,this.Gl=nr[13]|0,this.Hh=nr[14]|0,this.Hl=nr[15]|0}},mr=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),hr=class extends fr{constructor(){super(32),this.Ah=mr[0]|0,this.Al=mr[1]|0,this.Bh=mr[2]|0,this.Bl=mr[3]|0,this.Ch=mr[4]|0,this.Cl=mr[5]|0,this.Dh=mr[6]|0,this.Dl=mr[7]|0,this.Eh=mr[8]|0,this.El=mr[9]|0,this.Fh=mr[10]|0,this.Fl=mr[11]|0,this.Gh=mr[12]|0,this.Gl=mr[13]|0,this.Hh=mr[14]|0,this.Hl=mr[15]|0}},gr=jn(()=>new or),_r=jn(()=>new fr),vr=jn(()=>new pr),yr=jn(()=>new hr),br=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),xr=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),V=new Uint32Array(32);function Sr(e,t,n,r,i,a){let o=i[a],s=i[a+1],c=V[2*e],l=V[2*e+1],u=V[2*t],d=V[2*t+1],f=V[2*n],p=V[2*n+1],m=V[2*r],h=V[2*r+1],g=Qt(c,u,o);l=$t(g,l,d,s),c=g|0,{Dh:h,Dl:m}={Dh:h^l,Dl:m^c},{Dh:h,Dl:m}={Dh:Gt(h,m),Dl:Kt(h)},{h:p,l:f}=Zt(p,f,h,m),{Bh:d,Bl:u}={Bh:d^p,Bl:u^f},{Bh:d,Bl:u}={Bh:Vt(d,u,24),Bl:Ht(d,u,24)},V[2*e]=c,V[2*e+1]=l,V[2*t]=u,V[2*t+1]=d,V[2*n]=f,V[2*n+1]=p,V[2*r]=m,V[2*r+1]=h}function Cr(e,t,n,r,i,a){let o=i[a],s=i[a+1],c=V[2*e],l=V[2*e+1],u=V[2*t],d=V[2*t+1],f=V[2*n],p=V[2*n+1],m=V[2*r],h=V[2*r+1],g=Qt(c,u,o);l=$t(g,l,d,s),c=g|0,{Dh:h,Dl:m}={Dh:h^l,Dl:m^c},{Dh:h,Dl:m}={Dh:Vt(h,m,16),Dl:Ht(h,m,16)},{h:p,l:f}=Zt(p,f,h,m),{Bh:d,Bl:u}={Bh:d^p,Bl:u^f},{Bh:d,Bl:u}={Bh:Ut(d,u,63),Bl:Wt(d,u,63)},V[2*e]=c,V[2*e+1]=l,V[2*t]=u,V[2*t+1]=d,V[2*n]=f,V[2*n+1]=p,V[2*r]=m,V[2*r+1]=h}function wr(e,t={},n,r,i){if(sn(n),e<0||e>n)throw Error(`outputLen bigger than keyLen`);let{key:a,salt:o,personalization:s}=t;if(a!==void 0&&(a.length<1||a.length>n))throw Error(`key length must be undefined or 1..`+n);if(o!==void 0&&o.length!==r)throw Error(`salt must be undefined or `+r);if(s!==void 0&&s.length!==i)throw Error(`personalization must be undefined or `+i)}var Tr=class extends An{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,sn(e),sn(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=fn(this.buffer)}update(e){un(this),e=On(e),cn(e);let{blockLen:t,buffer:n,buffer32:r}=this,i=e.length,a=e.byteOffset,o=e.buffer;for(let s=0;s<i;){this.pos===t&&(bn(r),this.compress(r,0,!1),bn(r),this.pos=0);let c=Math.min(t-this.pos,i-s),l=a+s;if(c===t&&!(l%4)&&s+c<i){let e=new Uint32Array(o,l,Math.floor((i-s)/4));bn(e);for(let n=0;s+t<i;n+=r.length,s+=t)this.length+=t,this.compress(e,n,!1);bn(e);continue}n.set(e.subarray(s,s+c),this.pos),this.pos+=c,this.length+=c,s+=c}return this}digestInto(e){un(this),dn(e,this);let{pos:t,buffer32:n}=this;this.finished=!0,pn(this.buffer.subarray(t)),bn(n),this.compress(n,0,!0),bn(n);let r=fn(e);this.get().forEach((e,t)=>r[t]=vn(e))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){let{buffer:t,length:n,finished:r,destroyed:i,outputLen:a,pos:o}=this;return e||=new this.constructor({dkLen:a}),e.set(...this.get()),e.buffer.set(t),e.destroyed=i,e.finished=r,e.length=n,e.pos=o,e.outputLen=a,e}clone(){return this._cloneInto()}},Er=class extends Tr{constructor(e={}){let t=e.dkLen===void 0?64:e.dkLen;super(128,t),this.v0l=xr[0]|0,this.v0h=xr[1]|0,this.v1l=xr[2]|0,this.v1h=xr[3]|0,this.v2l=xr[4]|0,this.v2h=xr[5]|0,this.v3l=xr[6]|0,this.v3h=xr[7]|0,this.v4l=xr[8]|0,this.v4h=xr[9]|0,this.v5l=xr[10]|0,this.v5h=xr[11]|0,this.v6l=xr[12]|0,this.v6h=xr[13]|0,this.v7l=xr[14]|0,this.v7h=xr[15]|0,wr(t,e,64,16,16);let{key:n,personalization:r,salt:i}=e,a=0;if(n!==void 0&&(n=On(n),a=n.length),this.v0l^=this.outputLen|a<<8|16842752,i!==void 0){i=On(i);let e=fn(i);this.v4l^=vn(e[0]),this.v4h^=vn(e[1]),this.v5l^=vn(e[2]),this.v5h^=vn(e[3])}if(r!==void 0){r=On(r);let e=fn(r);this.v6l^=vn(e[0]),this.v6h^=vn(e[1]),this.v7l^=vn(e[2]),this.v7h^=vn(e[3])}if(n!==void 0){let e=new Uint8Array(this.blockLen);e.set(n),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:i,v2h:a,v3l:o,v3h:s,v4l:c,v4h:l,v5l:u,v5h:d,v6l:f,v6h:p,v7l:m,v7h:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.v0l=e|0,this.v0h=t|0,this.v1l=n|0,this.v1h=r|0,this.v2l=i|0,this.v2h=a|0,this.v3l=o|0,this.v3h=s|0,this.v4l=c|0,this.v4h=l|0,this.v5l=u|0,this.v5h=d|0,this.v6l=f|0,this.v6h=p|0,this.v7l=m|0,this.v7h=h|0}compress(e,t,n){this.get().forEach((e,t)=>V[t]=e),V.set(xr,16);let{h:r,l:i}=Lt(BigInt(this.length));V[24]=xr[8]^i,V[25]=xr[9]^r,n&&(V[28]=~V[28],V[29]=~V[29]);let a=0,o=br;for(let n=0;n<12;n++)Sr(0,4,8,12,e,t+2*o[a++]),Cr(0,4,8,12,e,t+2*o[a++]),Sr(1,5,9,13,e,t+2*o[a++]),Cr(1,5,9,13,e,t+2*o[a++]),Sr(2,6,10,14,e,t+2*o[a++]),Cr(2,6,10,14,e,t+2*o[a++]),Sr(3,7,11,15,e,t+2*o[a++]),Cr(3,7,11,15,e,t+2*o[a++]),Sr(0,5,10,15,e,t+2*o[a++]),Cr(0,5,10,15,e,t+2*o[a++]),Sr(1,6,11,12,e,t+2*o[a++]),Cr(1,6,11,12,e,t+2*o[a++]),Sr(2,7,8,13,e,t+2*o[a++]),Cr(2,7,8,13,e,t+2*o[a++]),Sr(3,4,9,14,e,t+2*o[a++]),Cr(3,4,9,14,e,t+2*o[a++]);this.v0l^=V[0]^V[16],this.v0h^=V[1]^V[17],this.v1l^=V[2]^V[18],this.v1h^=V[3]^V[19],this.v2l^=V[4]^V[20],this.v2h^=V[5]^V[21],this.v3l^=V[6]^V[22],this.v3h^=V[7]^V[23],this.v4l^=V[8]^V[24],this.v4h^=V[9]^V[25],this.v5l^=V[10]^V[26],this.v5h^=V[11]^V[27],this.v6l^=V[12]^V[28],this.v6h^=V[13]^V[29],this.v7l^=V[14]^V[30],this.v7h^=V[15]^V[31],pn(V)}destroy(){this.destroyed=!0,pn(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Dr=Mn(e=>new Er(e)),Or=`https://rpc.walletconnect.org/v1`;function kr(e){let t=`Ethereum Signed Message:
|
|
2
2
|
${e.length}`,n=new TextEncoder().encode(t+e);return`0x`+o.from(Xn(n)).toString(`hex`)}async function Ar(e,t,n,r,i,a){switch(n.t){case`eip191`:return await jr(e,t,n.s);case`eip1271`:return await Mr(e,t,n.s,r,i,a);default:throw Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${n.t}`)}}async function jr(e,t,n){return(await ie({hash:kr(t),signature:n})).toLowerCase()===e.toLowerCase()}async function Mr(e,t,n,r,i,a){let o=Le(r);if(!o.namespace||!o.reference)throw Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${r}`);try{let o=n.substring(2),s=(o.length/2).toString(16).padStart(64,`0`),c=`0x1626ba7e`+(t.startsWith(`0x`)?t:kr(t)).substring(2)+`0000000000000000000000000000000000000000000000000000000000000040`+s+o,{result:l}=await(await fetch(`${a||Or}/?chainId=${r}&projectId=${i}`,{headers:{"Content-Type":`application/json`},method:`POST`,body:JSON.stringify({id:Nr(),jsonrpc:`2.0`,method:`eth_call`,params:[{to:e,data:c},`latest`]})})).json();return l?l.slice(0,10).toLowerCase()===`0x1626ba7e`:!1}catch{return!1}}function Nr(){return Date.now()+Math.floor(Math.random()*1e3)}function Pr(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);let r=n[0];if(r===0)throw Error(`No signatures found`);let i=1+r*64;if(n.length<i)throw Error(`Transaction data too short for claimed signature count`);if(n.length<100)throw Error(`Transaction too short`);let a=o.from(e,`base64`).slice(1,65);return c.encode(a)}function Fr(e){let t=new Uint8Array(o.from(e,`base64`)),n=Array.from(`TransactionData::`).map(e=>e.charCodeAt(0)),r=new Uint8Array(n.length+t.length);r.set(n),r.set(t,n.length);let i=Dr(r,{dkLen:32});return c.encode(i)}function Ir(e){let t=new Uint8Array(gr(Lr(e)));return c.encode(t)}function Lr(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e==`object`&&e&&e.data)return new Uint8Array(Object.values(e.data));if(typeof e==`object`&&e)return new Uint8Array(Object.values(e));throw Error(`getNearUint8ArrayFromBytes: Unexpected result type from bytes array`)}function Rr(e){let t=ae(o.from(e,`base64`)).txn;if(!t)throw Error(`Invalid signed transaction: missing 'txn' field`);let n=re(t),r=o.from(`TX`),i=yr(o.concat([r,o.from(n)]));return ne.encode(i).replace(/=+$/,``)}function zr(e){let t=[],n=BigInt(e);for(;n>=BigInt(128);)t.push(Number(n&BigInt(127)|BigInt(128))),n>>=BigInt(7);return t.push(Number(n)),o.from(t)}function Br(e){let t=o.from(e.signed.bodyBytes,`base64`),n=o.from(e.signed.authInfoBytes,`base64`),r=o.from(e.signature.signature,`base64`),i=[];i.push(o.from([10])),i.push(zr(t.length)),i.push(t),i.push(o.from([18])),i.push(zr(n.length)),i.push(n),i.push(o.from([26])),i.push(zr(r.length)),i.push(r);let a=gr(o.concat(i));return o.from(a).toString(`hex`).toUpperCase()}var Vr=Object.defineProperty,Hr=Object.defineProperties,Ur=Object.getOwnPropertyDescriptors,Wr=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable,qr=(e,t,n)=>t in e?Vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jr=(e,t)=>{for(var n in t||={})Gr.call(t,n)&&qr(e,n,t[n]);if(Wr)for(var n of Wr(t))Kr.call(t,n)&&qr(e,n,t[n]);return e},Yr=(e,t)=>Hr(e,Ur(t)),Xr=`did:pkh:`,Zr=e=>e?.split(`:`),Qr=e=>{let t=e&&Zr(e);if(t)return e.includes(Xr)?t[3]:t[1]},$r=e=>{let t=e&&Zr(e);if(t)return t[2]+`:`+t[3]},ei=e=>{let t=e&&Zr(e);if(t)return t.pop()};async function ti(e){let{cacao:t,projectId:n}=e,{s:r,p:i}=t,a=ni(i,i.iss);return await Ar(ei(i.iss),a,r,$r(i.iss),n)}var ni=(e,t)=>{let n=`${e.domain} wants you to sign in with your Ethereum account:`,r=ei(t);if(!e.aud&&!e.uri)throw Error("Either `aud` or `uri` is required to construct the message");let i=e.statement||void 0,a=`URI: ${e.aud||e.uri}`,o=`Version: ${e.version}`,s=`Chain ID: ${Qr(t)}`,c=`Nonce: ${e.nonce}`,l=`Issued At: ${e.iat}`,u=e.exp?`Expiration Time: ${e.exp}`:void 0,d=e.nbf?`Not Before: ${e.nbf}`:void 0,f=e.requestId?`Request ID: ${e.requestId}`:void 0,p=e.resources?`Resources:${e.resources.map(e=>`
|
|
3
3
|
- ${e}`).join(``)}`:void 0,m=_i(e.resources);if(m){let e=li(m);i=mi(i,e)}return[n,r,``,i,``,a,o,s,c,l,u,d,f,p].filter(e=>e!=null).join(`
|
|
4
4
|
`)};function ri(e){return o.from(JSON.stringify(e)).toString(`base64`)}function ii(e){return JSON.parse(o.from(e,`base64`).toString(`utf-8`))}function ai(e){if(!e)throw Error(`No recap provided, value is undefined`);if(!e.att)throw Error("No `att` property found");let t=Object.keys(e.att);if(!(t!=null&&t.length))throw Error("No resources found in `att` property");t.forEach(t=>{let n=e.att[t];if(Array.isArray(n)||typeof n!=`object`)throw Error(`Resource must be an object: ${t}`);if(!Object.keys(n).length)throw Error(`Resource object is empty: ${t}`);Object.keys(n).forEach(e=>{let t=n[e];if(!Array.isArray(t))throw Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach(t=>{if(typeof t!=`object`)throw Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)})})})}function oi(e,t,n,r={}){return n?.sort((e,t)=>e.localeCompare(t)),{att:{[e]:si(t,n,r)}}}function si(e,t,n={}){t=t?.sort((e,t)=>e.localeCompare(t));let r=t.map(t=>({[`${e}/${t}`]:[n]}));return Object.assign({},...r)}function ci(e){return ai(e),`urn:recap:${ri(e).replace(/=/g,``)}`}function li(e){let t=ii(e.replace(`urn:recap:`,``));return ai(t),t}function ui(e,t,n){return ci(oi(e,t,n))}function di(e){return e&&e.includes(`urn:recap:`)}function fi(e,t){return ci(pi(li(e),li(t)))}function pi(e,t){ai(e),ai(t);let n=Object.keys(e.att).concat(Object.keys(t.att)).sort((e,t)=>e.localeCompare(t)),r={att:{}};return n.forEach(n=>{Object.keys(e.att?.[n]||{}).concat(Object.keys(t.att?.[n]||{})).sort((e,t)=>e.localeCompare(t)).forEach(i=>{r.att[n]=Yr(Jr({},r.att[n]),{[i]:e.att[n]?.[i]||t.att[n]?.[i]})})}),r}function mi(e=``,t){ai(t);let n=`I further authorize the stated URI to perform the following actions on my behalf: `;if(e.includes(n))return e;let r=[],i=0;Object.keys(t.att).forEach(e=>{let n=Object.keys(t.att[e]).map(e=>({ability:e.split(`/`)[0],action:e.split(`/`)[1]}));n.sort((e,t)=>e.action.localeCompare(t.action));let a={};n.forEach(e=>{a[e.ability]||(a[e.ability]=[]),a[e.ability].push(e.action)});let o=Object.keys(a).map(t=>(i++,`(${i}) '${t}': '${a[t].join(`', '`)}' for '${e}'.`));r.push(o.join(`, `).replace(`.,`,`.`))});let a=`${n}${r.join(` `)}`;return`${e?e+` `:``}${a}`}function hi(e){let t=li(e);ai(t);let n=t.att?.eip155;return n?Object.keys(n).map(e=>e.split(`/`)[1]):[]}function gi(e){let t=li(e);ai(t);let n=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;(t=e?.[0])!=null&&t.chains&&n.push(e[0].chains)})}),[...new Set(n.flat())]}function _i(e){if(!e)return;let t=e?.[e.length-1];return di(t)?t:void 0}function vi(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function yi(e){if(typeof e!=`boolean`)throw Error(`boolean expected, not ${e}`)}function bi(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function xi(e,...t){if(!vi(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function Si(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Ci(e,t){xi(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function wi(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ti(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ei(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var Di=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Oi(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function ki(e){if(typeof e==`string`)e=Oi(e);else if(vi(e))e=Li(e);else throw Error(`Uint8Array expected, got `+typeof e);return e}function Ai(e,t){if(typeof t!=`object`||!t)throw Error(`options must be defined`);return Object.assign(e,t)}function ji(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}var Mi=(e,t)=>{function n(n,...r){if(xi(n),!Di)throw Error(`Non little-endian hardware is not yet supported`);if(e.nonceLength!==void 0){let t=r[0];if(!t)throw Error(`nonce / iv required`);e.varSizeNonce?xi(t):xi(t,e.nonceLength)}let i=e.tagLength;i&&r[1]!==void 0&&xi(r[1]);let a=t(n,...r),o=(e,t)=>{if(t!==void 0){if(e!==2)throw Error(`cipher output not supported`);xi(t)}},s=!1;return{encrypt(e,t){if(s)throw Error(`cannot encrypt() twice with same key + nonce`);return s=!0,xi(e),o(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(xi(e),i&&e.length<i)throw Error(`invalid ciphertext length: smaller than tagLength=`+i);return o(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(n,e),n};function Ni(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw Error(`invalid output length, expected `+e+`, got: `+t.length);if(n&&!Ii(t))throw Error(`invalid output, must be aligned`);return t}function Pi(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function Fi(e,t,n){yi(n);let r=new Uint8Array(16),i=Ei(r);return Pi(i,0,BigInt(t),n),Pi(i,8,BigInt(e),n),r}function Ii(e){return e.byteOffset%4==0}function Li(e){return Uint8Array.from(e)}var Ri=e=>Uint8Array.from(e.split(``).map(e=>e.charCodeAt(0))),zi=Ri(`expand 16-byte k`),Bi=Ri(`expand 32-byte k`),Vi=wi(zi),Hi=wi(Bi);function H(e,t){return e<<t|e>>>32-t}function Ui(e){return e.byteOffset%4==0}var Wi=64,Gi=16,Ki=2**32-1,qi=new Uint32Array;function Ji(e,t,n,r,i,a,o,s){let c=i.length,l=new Uint8Array(Wi),u=wi(l),d=Ui(i)&&Ui(a),f=d?wi(i):qi,p=d?wi(a):qi;for(let m=0;m<c;o++){if(e(t,n,r,u,o,s),o>=Ki)throw Error(`arx: counter overflow`);let h=Math.min(Wi,c-m);if(d&&h===Wi){let e=m/4;if(m%4!=0)throw Error(`arx: invalid block position`);for(let t=0,n;t<Gi;t++)n=e+t,p[n]=f[n]^u[t];m+=Wi;continue}for(let e=0,t;e<h;e++)t=m+e,a[t]=i[t]^l[e];m+=h}}function Yi(e,t){let{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:a,rounds:o}=Ai({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!=`function`)throw Error(`core must be a function`);return bi(i),bi(o),yi(a),yi(n),(t,s,c,l,u=0)=>{xi(t),xi(s),xi(c);let d=c.length;if(l===void 0&&(l=new Uint8Array(d)),xi(l),bi(u),u<0||u>=Ki)throw Error(`arx: counter overflow`);if(l.length<d)throw Error(`arx: output (${l.length}) is shorter than data (${d})`);let f=[],p=t.length,m,h;if(p===32)f.push(m=Li(t)),h=Hi;else if(p===16&&n)m=new Uint8Array(32),m.set(t),m.set(t,16),h=Vi,f.push(m);else throw Error(`arx: invalid 32-byte key, got length=${p}`);Ui(s)||f.push(s=Li(s));let g=wi(m);if(r){if(s.length!==24)throw Error(`arx: extended nonce must be 24 bytes`);r(h,g,wi(s.subarray(0,16)),g),s=s.subarray(16)}let _=16-i;if(_!==s.length)throw Error(`arx: nonce must be ${_} or 16 bytes`);if(_!==12){let e=new Uint8Array(12);e.set(s,a?0:12-s.length),s=e,f.push(s)}let v=wi(s);return Ji(e,h,g,v,c,l,u,o),Ti(...f),l}}var Xi=(e,t)=>e[t++]&255|(e[t++]&255)<<8,Zi=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=ki(e),xi(e,32);let t=Xi(e,0),n=Xi(e,2),r=Xi(e,4),i=Xi(e,6),a=Xi(e,8),o=Xi(e,10),s=Xi(e,12),c=Xi(e,14);this.r[0]=t&8191,this.r[1]=(t>>>13|n<<3)&8191,this.r[2]=(n>>>10|r<<6)&7939,this.r[3]=(r>>>7|i<<9)&8191,this.r[4]=(i>>>4|a<<12)&255,this.r[5]=a>>>1&8190,this.r[6]=(a>>>14|o<<2)&8191,this.r[7]=(o>>>11|s<<5)&8065,this.r[8]=(s>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=Xi(e,16+2*t)}process(e,t,n=!1){let r=n?0:2048,{h:i,r:a}=this,o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],d=a[5],f=a[6],p=a[7],m=a[8],h=a[9],g=Xi(e,t+0),_=Xi(e,t+2),v=Xi(e,t+4),y=Xi(e,t+6),b=Xi(e,t+8),x=Xi(e,t+10),S=Xi(e,t+12),C=Xi(e,t+14),w=i[0]+(g&8191),T=i[1]+((g>>>13|_<<3)&8191),E=i[2]+((_>>>10|v<<6)&8191),D=i[3]+((v>>>7|y<<9)&8191),O=i[4]+((y>>>4|b<<12)&8191),k=i[5]+(b>>>1&8191),A=i[6]+((b>>>14|x<<2)&8191),j=i[7]+((x>>>11|S<<5)&8191),M=i[8]+((S>>>8|C<<8)&8191),N=i[9]+(C>>>5|r),P=0,F=P+w*o+5*h*T+5*m*E+5*p*D+5*f*O;P=F>>>13,F&=8191,F+=5*d*k+5*u*A+5*l*j+5*c*M+5*s*N,P+=F>>>13,F&=8191;let I=P+w*s+T*o+5*h*E+5*m*D+5*p*O;P=I>>>13,I&=8191,I+=5*f*k+5*d*A+5*u*j+5*l*M+5*c*N,P+=I>>>13,I&=8191;let L=P+w*c+T*s+E*o+5*h*D+5*m*O;P=L>>>13,L&=8191,L+=5*p*k+5*f*A+5*d*j+5*u*M+5*l*N,P+=L>>>13,L&=8191;let R=P+w*l+T*c+E*s+D*o+5*h*O;P=R>>>13,R&=8191,R+=5*m*k+5*p*A+5*f*j+5*d*M+5*u*N,P+=R>>>13,R&=8191;let ee=P+w*u+T*l+E*c+D*s+O*o;P=ee>>>13,ee&=8191,ee+=5*h*k+5*m*A+5*p*j+5*f*M+5*d*N,P+=ee>>>13,ee&=8191;let te=P+w*d+T*u+E*l+D*c+O*s;P=te>>>13,te&=8191,te+=k*o+5*h*A+5*m*j+5*p*M+5*f*N,P+=te>>>13,te&=8191;let ne=P+w*f+T*d+E*u+D*l+O*c;P=ne>>>13,ne&=8191,ne+=k*s+A*o+5*h*j+5*m*M+5*p*N,P+=ne>>>13,ne&=8191;let re=P+w*p+T*f+E*d+D*u+O*l;P=re>>>13,re&=8191,re+=k*c+A*s+j*o+5*h*M+5*m*N,P+=re>>>13,re&=8191;let ie=P+w*m+T*p+E*f+D*d+O*u;P=ie>>>13,ie&=8191,ie+=k*l+A*c+j*s+M*o+5*h*N,P+=ie>>>13,ie&=8191;let ae=P+w*h+T*m+E*p+D*f+O*d;P=ae>>>13,ae&=8191,ae+=k*u+A*l+j*c+M*s+N*o,P+=ae>>>13,ae&=8191,P=(P<<2)+P|0,P=P+F|0,F=P&8191,P>>>=13,I+=P,i[0]=F,i[1]=I,i[2]=L,i[3]=R,i[4]=ee,i[5]=te,i[6]=ne,i[7]=re,i[8]=ie,i[9]=ae}finalize(){let{h:e,pad:t}=this,n=new Uint16Array(10),r=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=r,r=e[t]>>>13,e[t]&=8191;e[0]+=r*5,r=e[0]>>>13,e[0]&=8191,e[1]+=r,r=e[1]>>>13,e[1]&=8191,e[2]+=r,n[0]=e[0]+5,r=n[0]>>>13,n[0]&=8191;for(let t=1;t<10;t++)n[t]=e[t]+r,r=n[t]>>>13,n[t]&=8191;n[9]-=8192;let i=(r^1)-1;for(let e=0;e<10;e++)n[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|n[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let a=e[0]+t[0];e[0]=a&65535;for(let n=1;n<8;n++)a=(e[n]+t[n]|0)+(a>>>16)|0,e[n]=a&65535;Ti(n)}update(e){Si(this),e=ki(e),xi(e);let{buffer:t,blockLen:n}=this,r=e.length;for(let i=0;i<r;){let a=Math.min(n-this.pos,r-i);if(a===n){for(;n<=r-i;i+=n)this.process(e,i);continue}t.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){Ti(this.h,this.r,this.buffer,this.pad)}digestInto(e){Si(this),Ci(e,this),this.finished=!0;let{buffer:t,h:n}=this,{pos:r}=this;if(r){for(t[r++]=1;r<16;r++)t[r]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=n[t]>>>0,e[i++]=n[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}};function Qi(e){let t=(t,n)=>e(n).update(ki(t)).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}var $i=Qi(e=>new Zi(e));function ea(e,t,n,r,i,a=20){let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=t[2],p=t[3],m=t[4],h=t[5],g=t[6],_=t[7],v=i,y=n[0],b=n[1],x=n[2],S=o,C=s,w=c,T=l,E=u,D=d,O=f,k=p,A=m,j=h,M=g,N=_,P=v,F=y,I=b,L=x;for(let e=0;e<a;e+=2)S=S+E|0,P=H(P^S,16),A=A+P|0,E=H(E^A,12),S=S+E|0,P=H(P^S,8),A=A+P|0,E=H(E^A,7),C=C+D|0,F=H(F^C,16),j=j+F|0,D=H(D^j,12),C=C+D|0,F=H(F^C,8),j=j+F|0,D=H(D^j,7),w=w+O|0,I=H(I^w,16),M=M+I|0,O=H(O^M,12),w=w+O|0,I=H(I^w,8),M=M+I|0,O=H(O^M,7),T=T+k|0,L=H(L^T,16),N=N+L|0,k=H(k^N,12),T=T+k|0,L=H(L^T,8),N=N+L|0,k=H(k^N,7),S=S+D|0,L=H(L^S,16),M=M+L|0,D=H(D^M,12),S=S+D|0,L=H(L^S,8),M=M+L|0,D=H(D^M,7),C=C+O|0,P=H(P^C,16),N=N+P|0,O=H(O^N,12),C=C+O|0,P=H(P^C,8),N=N+P|0,O=H(O^N,7),w=w+k|0,F=H(F^w,16),A=A+F|0,k=H(k^A,12),w=w+k|0,F=H(F^w,8),A=A+F|0,k=H(k^A,7),T=T+E|0,I=H(I^T,16),j=j+I|0,E=H(E^j,12),T=T+E|0,I=H(I^T,8),j=j+I|0,E=H(E^j,7);let R=0;r[R++]=o+S|0,r[R++]=s+C|0,r[R++]=c+w|0,r[R++]=l+T|0,r[R++]=u+E|0,r[R++]=d+D|0,r[R++]=f+O|0,r[R++]=p+k|0,r[R++]=m+A|0,r[R++]=h+j|0,r[R++]=g+M|0,r[R++]=_+N|0,r[R++]=v+P|0,r[R++]=y+F|0,r[R++]=b+I|0,r[R++]=x+L|0}var ta=Yi(ea,{counterRight:!1,counterLength:4,allowShortKeys:!1}),na=new Uint8Array(16),ra=(e,t)=>{e.update(t);let n=t.length%16;n&&e.update(na.subarray(n))},ia=new Uint8Array(32);function aa(e,t,n,r,i){let a=e(t,n,ia),o=$i.create(a);i&&ra(o,i),ra(o,r);let s=Fi(r.length,i?i.length:0,!0);o.update(s);let c=o.digest();return Ti(a,s),c}var oa=Mi({blockSize:64,nonceLength:12,tagLength:16},(e=>(t,n,r)=>({encrypt(i,a){let o=i.length;a=Ni(o+16,a,!1),a.set(i);let s=a.subarray(0,-16);e(t,n,s,s,1);let c=aa(e,t,n,s,r);return a.set(c,o),Ti(c),a},decrypt(i,a){a=Ni(i.length-16,a,!1);let o=i.subarray(0,-16),s=i.subarray(-16),c=aa(e,t,n,o,r);if(!ji(s,c))throw Error(`invalid tag`);return a.set(i.subarray(0,-16)),e(t,n,a,a,1),Ti(c),a}}))(ta)),sa=class extends An{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ln(e);let n=On(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),pn(i)}update(e){return un(this),this.iHash.update(e),this}digestInto(e){un(this),cn(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},ca=(e,t,n)=>new sa(e,t).update(n).digest();ca.create=(e,t)=>new sa(e,t);function la(e,t,n){return ln(e),n===void 0&&(n=new Uint8Array(e.outputLen)),ca(e,On(n),On(t))}var ua=Uint8Array.from([0]),da=Uint8Array.of();function fa(e,t,n,r=32){ln(e),sn(r);let i=e.outputLen;if(r>255*i)throw Error(`Length should be <= 255*HashLen`);let a=Math.ceil(r/i);n===void 0&&(n=da);let o=new Uint8Array(a*i),s=ca.create(e,t),c=s._cloneInto(),l=new Uint8Array(s.outputLen);for(let e=0;e<a;e++)ua[0]=e+1,c.update(e===0?da:l).update(n).update(ua).digestInto(l),o.set(l,i*e),s._cloneInto(c);return s.destroy(),c.destroy(),pn(l,ua),o.slice(0,r)}var pa=(e,t,n,r,i)=>fa(e,la(e,t,n),r,i),ma=gr,ha=BigInt(0),ga=BigInt(1);function _a(e,t){if(typeof t!=`boolean`)throw Error(e+` boolean expected, got `+t)}function va(e){let t=e.toString(16);return t.length&1?`0`+t:t}function ya(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?ha:BigInt(`0x`+e)}function ba(e){return ya(Cn(e))}function xa(e){return cn(e),ya(Cn(Uint8Array.from(e).reverse()))}function Sa(e,t){return En(e.toString(16).padStart(t*2,`0`))}function Ca(e,t){return Sa(e,t).reverse()}function wa(e,t,n){let r;if(typeof t==`string`)try{r=En(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(on(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}var Ta=e=>typeof e==`bigint`&&ha<=e;function Ea(e,t,n){return Ta(e)&&Ta(t)&&Ta(n)&&t<=e&&e<n}function Da(e,t,n,r){if(!Ea(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function Oa(e){let t;for(t=0;e>ha;e>>=ga,t+=1);return t}var ka=e=>(ga<<BigInt(e))-ga;function Aa(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=e=>new Uint8Array(e),i=e=>Uint8Array.of(e),a=r(e),o=r(e),s=0,c=()=>{a.fill(1),o.fill(0),s=0},l=(...e)=>n(o,a,...e),u=(e=r(0))=>{o=l(i(0),e),a=l(),e.length!==0&&(o=l(i(1),e),a=l())},d=()=>{if(s++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){a=l();let t=a.slice();n.push(t),e+=a.length}return kn(...n)};return(e,t)=>{c(),u(e);let n;for(;!(n=t(d()));)u();return c(),n}}function ja(e,t,n={}){if(!e||typeof e!=`object`)throw Error(`expected valid options object`);function r(t,n,r){let i=e[t];if(r&&i===void 0)return;let a=typeof i;if(a!==n||i===null)throw Error(`param "${t}" is invalid: expected ${n}, got ${a}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}function Ma(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}var Na=BigInt(0),Pa=BigInt(1),Fa=BigInt(2),Ia=BigInt(3),La=BigInt(4),Ra=BigInt(5),za=BigInt(8);function Ba(e,t){let n=e%t;return n>=Na?n:t+n}function Va(e,t,n){let r=e;for(;t-- >Na;)r*=r,r%=n;return r}function Ha(e,t){if(e===Na)throw Error(`invert: expected non-zero number`);if(t<=Na)throw Error(`invert: expected positive modulus, got `+t);let n=Ba(e,t),r=t,i=Na,a=Pa;for(;n!==Na;){let e=r/n,t=r%n,o=i-a*e;r=n,n=t,i=a,a=o}if(r!==Pa)throw Error(`invert: does not exist`);return Ba(i,t)}function Ua(e,t){let n=(e.ORDER+Pa)/La,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw Error(`Cannot find square root`);return r}function Wa(e,t){let n=(e.ORDER-Ra)/za,r=e.mul(t,Fa),i=e.pow(r,n),a=e.mul(t,i),o=e.mul(e.mul(a,Fa),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),t))throw Error(`Cannot find square root`);return s}function Ga(e){if(e<BigInt(3))throw Error(`sqrt is not defined for small field`);let t=e-Pa,n=0;for(;t%Fa===Na;)t/=Fa,n++;let r=Fa,i=$a(e);for(;Za(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return Ua;let a=i.pow(r,t),o=(t+Pa)/Fa;return function(e,r){if(e.is0(r))return r;if(Za(e,r)!==1)throw Error(`Cannot find square root`);let i=n,s=e.mul(e.ONE,a),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw Error(`Cannot find square root`);let r=Pa<<BigInt(i-t-1),a=e.pow(s,r);i=t,s=e.sqr(a),c=e.mul(c,s),l=e.mul(l,a)}return l}}function Ka(e){return e%La===Ia?Ua:e%za===Ra?Wa:Ga(e)}var qa=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function Ja(e){return ja(e,qa.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`number`,BITS:`number`})),e}function Ya(e,t,n){if(n<Na)throw Error(`invalid exponent, negatives unsupported`);if(n===Na)return e.ONE;if(n===Pa)return t;let r=e.ONE,i=t;for(;n>Na;)n&Pa&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Pa;return r}function Xa(e,t,n=!1){let r=Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),a=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),a),r}function Za(e,t){let n=(e.ORDER-Pa)/Fa,r=e.pow(t,n),i=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!a&&!o)throw Error(`invalid Legendre symbol result`);return i?1:a?0:-1}function Qa(e,t){t!==void 0&&sn(t);let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function $a(e,t,n=!1,r={}){if(e<=Na)throw Error(`invalid field: expected ORDER > 0, got `+e);let i,a;if(typeof t==`object`&&t){if(r.sqrt||n)throw Error(`cannot specify opts in two arguments`);let e=t;e.BITS&&(i=e.BITS),e.sqrt&&(a=e.sqrt),typeof e.isLE==`boolean`&&(n=e.isLE)}else typeof t==`number`&&(i=t),r.sqrt&&(a=r.sqrt);let{nBitLength:o,nByteLength:s}=Qa(e,i);if(s>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);let c,l=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:ka(o),ZERO:Na,ONE:Pa,create:t=>Ba(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`invalid field element: expected bigint, got `+typeof t);return Na<=t&&t<e},is0:e=>e===Na,isValidNot0:e=>!l.is0(e)&&l.isValid(e),isOdd:e=>(e&Pa)===Pa,neg:t=>Ba(-t,e),eql:(e,t)=>e===t,sqr:t=>Ba(t*t,e),add:(t,n)=>Ba(t+n,e),sub:(t,n)=>Ba(t-n,e),mul:(t,n)=>Ba(t*n,e),pow:(e,t)=>Ya(l,e,t),div:(t,n)=>Ba(t*Ha(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Ha(t,e),sqrt:a||(t=>(c||=Ka(e),c(l,t))),toBytes:e=>n?Ca(e,s):Sa(e,s),fromBytes:e=>{if(e.length!==s)throw Error(`Field.fromBytes: expected `+s+` bytes, got `+e.length);return n?xa(e):ba(e)},invertBatch:e=>Xa(l,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(l)}function eo(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function to(e){let t=eo(e);return t+Math.ceil(t/2)}function no(e,t,n=!1){let r=e.length,i=eo(t),a=to(t);if(r<16||r<a||r>1024)throw Error(`expected `+a+`-1024 bytes of input, got `+r);let o=Ba(n?xa(e):ba(e),t-Pa)+Pa;return n?Ca(o,i):Sa(o,i)}var ro=BigInt(0),io=BigInt(1);function ao(e,t){let n=t.negate();return e?n:t}function oo(e,t,n){let r=t===`pz`?e=>e.pz:e=>e.ez,i=Xa(e.Fp,n.map(r));return n.map((e,t)=>e.toAffine(i[t])).map(e.fromAffine)}function so(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`invalid window size, expected [1..`+t+`], got W=`+e)}function co(e,t){so(e,t);let n=Math.ceil(t/e)+1,r=2**(e-1),i=2**e;return{windows:n,windowSize:r,mask:ka(e),maxNumber:i,shiftBy:BigInt(e)}}function lo(e,t,n){let{windowSize:r,mask:i,maxNumber:a,shiftBy:o}=n,s=Number(e&i),c=e>>o;s>r&&(s-=a,c+=io);let l=t*r,u=l+Math.abs(s)-1,d=s===0,f=s<0,p=t%2!=0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:p,offsetF:l}}function uo(e,t){if(!Array.isArray(e))throw Error(`array expected`);e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function fo(e,t){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,n)=>{if(!t.isValid(e))throw Error(`invalid scalar at index `+n)})}var po=new WeakMap,mo=new WeakMap;function ho(e){return mo.get(e)||1}function go(e){if(e!==ro)throw Error(`invalid wNAF`)}function _o(e,t){return{constTimeNegate:ao,hasPrecomputes(e){return ho(e)!==1},unsafeLadder(t,n,r=e.ZERO){let i=t;for(;n>ro;)n&io&&(r=r.add(i)),i=i.double(),n>>=io;return r},precomputeWindow(e,n){let{windows:r,windowSize:i}=co(n,t),a=[],o=e,s=o;for(let e=0;e<r;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(n,r,i){let a=e.ZERO,o=e.BASE,s=co(n,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:n,isZero:c,isNeg:l,isNegF:u,offsetF:d}=lo(i,e,s);i=t,c?o=o.add(ao(u,r[d])):a=a.add(ao(l,r[n]))}return go(i),{p:a,f:o}},wNAFUnsafe(n,r,i,a=e.ZERO){let o=co(n,t);for(let e=0;e<o.windows&&i!==ro;e++){let{nextN:t,offset:n,isZero:s,isNeg:c}=lo(i,e,o);if(i=t,!s){let e=r[n];a=a.add(c?e.negate():e)}}return go(i),a},getPrecomputes(e,t,n){let r=po.get(t);return r||(r=this.precomputeWindow(t,e),e!==1&&(typeof n==`function`&&(r=n(r)),po.set(t,r))),r},wNAFCached(e,t,n){let r=ho(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){let i=ho(e);return i===1?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){so(n,t),mo.set(e,n),po.delete(e)}}}function vo(e,t,n,r){let i=t,a=e.ZERO,o=e.ZERO;for(;n>ro||r>ro;)n&io&&(a=a.add(i)),r&io&&(o=o.add(i)),i=i.double(),n>>=io,r>>=io;return{p1:a,p2:o}}function yo(e,t,n,r){uo(n,e),fo(r,t);let i=n.length,a=r.length;if(i!==a)throw Error(`arrays of points and scalars must have equal length`);let o=e.ZERO,s=Oa(BigInt(i)),c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);let l=ka(c),u=Array(Number(l)+1).fill(o),d=Math.floor((t.BITS-1)/c)*c,f=o;for(let e=d;e>=0;e-=c){u.fill(o);for(let t=0;t<a;t++){let i=r[t],a=Number(i>>BigInt(e)&l);u[a]=u[a].add(n[t])}let t=o;for(let e=u.length-1,n=o;e>0;e--)n=n.add(u[e]),t=t.add(n);if(f=f.add(t),e!==0)for(let e=0;e<c;e++)f=f.double()}return f}function bo(e,t){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return Ja(t),t}else return $a(e)}function xo(e,t,n={}){if(!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(typeof n==`bigint`&&n>ro))throw Error(`CURVE.${e} must be positive bigint`)}let r=bo(t.p,n.Fp),i=bo(t.n,n.Fn),a=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of a)if(!r.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{Fp:r,Fn:i}}var So=BigInt(0),Co=BigInt(1),wo=BigInt(2);function To(e){return ja(e,{adjustScalarBytes:`function`,powPminus2:`function`}),Object.freeze({...e})}function Eo(e){let{P:t,type:n,adjustScalarBytes:r,powPminus2:i,randomBytes:a}=To(e),o=n===`x25519`;if(!o&&n!==`x448`)throw Error(`invalid type`);let s=a||Nn,c=o?255:448,l=o?32:56,u=BigInt(o?9:5),d=BigInt(o?121665:39081),f=o?wo**BigInt(254):wo**BigInt(447),p=f+(o?BigInt(8)*wo**BigInt(251)-Co:BigInt(4)*wo**BigInt(445)-Co)+Co,m=e=>Ba(e,t),h=g(u);function g(e){return Ca(m(e),l)}function _(e){let t=wa(`u coordinate`,e,l);return o&&(t[31]&=127),m(xa(t))}function v(e){return xa(r(wa(`scalar`,e,l)))}function y(e,t){let n=S(_(t),v(e));if(n===So)throw Error(`invalid private or public key received`);return g(n)}function b(e){return y(e,h)}function x(e,t,n){let r=m(e*(t-n));return t=m(t-r),n=m(n+r),{x_2:t,x_3:n}}function S(e,n){Da(`u`,e,So,t),Da(`scalar`,n,f,p);let r=n,a=e,o=Co,s=So,l=e,u=Co,h=So;for(let e=BigInt(c-1);e>=So;e--){let t=r>>e&Co;h^=t,{x_2:o,x_3:l}=x(h,o,l),{x_2:s,x_3:u}=x(h,s,u),h=t;let n=o+s,i=m(n*n),c=o-s,f=m(c*c),p=i-f,g=l+u,_=m((l-u)*n),v=m(g*c),y=_+v,b=_-v;l=m(y*y),u=m(a*m(b*b)),o=m(i*f),s=m(p*(i+m(d*p)))}({x_2:o,x_3:l}=x(h,o,l)),{x_2:s,x_3:u}=x(h,s,u);let g=i(s);return m(o*g)}return{scalarMult:y,scalarMultBase:b,getSharedSecret:(e,t)=>y(e,t),getPublicKey:e=>b(e),utils:{randomPrivateKey:()=>s(l)},GuBytes:h.slice()}}var Do=BigInt(1),Oo=BigInt(2),ko=BigInt(3),Ao=BigInt(5),jo={p:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed`),n:BigInt(`0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed`),h:BigInt(8),a:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec`),d:BigInt(`0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3`),Gx:BigInt(`0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a`),Gy:BigInt(`0x6666666666666666666666666666666666666666666666666666666666666658`)};function Mo(e){let t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=jo.p,o=e*e%a*e%a,s=Va(Va(o,Oo,a)*o%a,Do,a)*e%a,c=Va(s,Ao,a)*s%a,l=Va(c,t,a)*c%a,u=Va(l,n,a)*l%a,d=Va(u,r,a)*u%a;return{pow_p_5_8:Va(Va(Va(Va(d,i,a)*d%a,i,a)*d%a,t,a)*c%a,Oo,a)*e%a,b2:o}}function No(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}var Po=(()=>{let e=jo.p;return Eo({P:e,type:`x25519`,powPminus2:t=>{let{pow_p_5_8:n,b2:r}=Mo(t);return Ba(Va(n,ko,e)*r,e)},adjustScalarBytes:No})})();function Fo(e){e.lowS!==void 0&&_a(`lowS`,e.lowS),e.prehash!==void 0&&_a(`prehash`,e.prehash)}var Io={Err:class extends Error{constructor(e=``){super(e)}},_tlv:{encode:(e,t)=>{let{Err:n}=Io;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length&1)throw new n(`tlv.encode: unpadded data`);let r=t.length/2,i=va(r);if(i.length/2&128)throw new n(`tlv.encode: long form length too big`);let a=r>127?va(i.length/2|128):``;return va(e)+a+i+t},decode(e,t){let{Err:n}=Io,r=0;if(e<0||e>256)throw new n(`tlv.encode: wrong tag`);if(t.length<2||t[r++]!==e)throw new n(`tlv.decode: wrong tlv`);let i=t[r++],a=!!(i&128),o=0;if(!a)o=i;else{let e=i&127;if(!e)throw new n(`tlv.decode(long): indefinite length not supported`);if(e>4)throw new n(`tlv.decode(long): byte length is too big`);let a=t.subarray(r,r+e);if(a.length!==e)throw new n(`tlv.decode: length bytes not complete`);if(a[0]===0)throw new n(`tlv.decode(long): zero leftmost byte`);for(let e of a)o=o<<8|e;if(r+=e,o<128)throw new n(`tlv.decode(long): not minimal encoding`)}let s=t.subarray(r,r+o);if(s.length!==o)throw new n(`tlv.decode: wrong value length`);return{v:s,l:t.subarray(r+o)}}},_int:{encode(e){let{Err:t}=Io;if(e<Lo)throw new t(`integer: negative integers are not allowed`);let n=va(e);if(Number.parseInt(n[0],16)&8&&(n=`00`+n),n.length&1)throw new t(`unexpected DER parsing assertion: unpadded hex`);return n},decode(e){let{Err:t}=Io;if(e[0]&128)throw new t(`invalid signature integer: negative`);if(e[0]===0&&!(e[1]&128))throw new t(`invalid signature integer: unnecessary leading zero`);return ba(e)}},toSig(e){let{Err:t,_int:n,_tlv:r}=Io,i=wa(`signature`,e),{v:a,l:o}=r.decode(48,i);if(o.length)throw new t(`invalid signature: left bytes after parsing`);let{v:s,l:c}=r.decode(2,a),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t(`invalid signature: left bytes after parsing`);return{r:n.decode(s),s:n.decode(l)}},hexFromSig(e){let{_tlv:t,_int:n}=Io,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}},Lo=BigInt(0),Ro=BigInt(1),zo=BigInt(2),Bo=BigInt(3),Vo=BigInt(4);function Ho(e,t,n){function r(r){let i=e.sqr(r),a=e.mul(i,r);return e.add(e.add(a,e.mul(r,t)),n)}return r}function Uo(e,t,n){let{BYTES:r}=e;function i(i){let a;if(typeof i==`bigint`)a=i;else{let n=wa(`private key`,i);if(t){if(!t.includes(n.length*2))throw Error(`invalid private key`);let e=new Uint8Array(r);e.set(n,e.length-n.length),n=e}try{a=e.fromBytes(n)}catch{throw Error(`invalid private key: expected ui8a of size ${r}, got ${typeof i}`)}}if(n&&(a=e.create(a)),!e.isValidNot0(a))throw Error(`invalid private key: out of range [1..N-1]`);return a}return i}function Wo(e,t={}){let{Fp:n,Fn:r}=xo(`weierstrass`,e,t),{h:i,n:a}=e;ja(t,{},{allowInfinityPoint:`boolean`,clearCofactor:`function`,isTorsionFree:`function`,fromBytes:`function`,toBytes:`function`,endo:`object`,wrapPrivateKey:`boolean`});let{endo:o}=t;if(o&&(!n.is0(e.a)||typeof o.beta!=`bigint`||typeof o.splitScalar!=`function`))throw Error(`invalid endo: expected "beta": bigint and "splitScalar": function`);function s(){if(!n.isOdd)throw Error(`compression is not supported: Field does not have .isOdd()`)}function c(e,t,r){let{x:i,y:a}=t.toAffine(),o=n.toBytes(i);return _a(`isCompressed`,r),r?(s(),kn(Go(!n.isOdd(a)),o)):kn(Uint8Array.of(4),o,n.toBytes(a))}function l(e){cn(e);let t=n.BYTES,r=t+1,i=2*t+1,a=e.length,o=e[0],c=e.subarray(1);if(a===r&&(o===2||o===3)){let e=n.fromBytes(c);if(!n.isValid(e))throw Error(`bad point: is not on curve, wrong x`);let t=f(e),r;try{r=n.sqrt(t)}catch(e){let t=e instanceof Error?`: `+e.message:``;throw Error(`bad point: is not on curve, sqrt error`+t)}s();let i=n.isOdd(r);return(o&1)==1!==i&&(r=n.neg(r)),{x:e,y:r}}else if(a===i&&o===4){let e=n.fromBytes(c.subarray(t*0,t*1)),r=n.fromBytes(c.subarray(t*1,t*2));if(!p(e,r))throw Error(`bad point: is not on curve`);return{x:e,y:r}}else throw Error(`bad point: got length ${a}, expected compressed=${r} or uncompressed=${i}`)}let u=t.toBytes||c,d=t.fromBytes||l,f=Ho(n,e.a,e.b);function p(e,t){let r=n.sqr(t),i=f(e);return n.eql(r,i)}if(!p(e.Gx,e.Gy))throw Error(`bad curve params: generator point`);let m=n.mul(n.pow(e.a,Bo),Vo),h=n.mul(n.sqr(e.b),BigInt(27));if(n.is0(n.add(m,h)))throw Error(`bad curve params: a or b`);function g(e,t,r=!1){if(!n.isValid(t)||r&&n.is0(t))throw Error(`bad point coordinate ${e}`);return t}function _(e){if(!(e instanceof x))throw Error(`ProjectivePoint expected`)}let v=Ma((e,t)=>{let{px:r,py:i,pz:a}=e;if(n.eql(a,n.ONE))return{x:r,y:i};let o=e.is0();t??=o?n.ONE:n.inv(a);let s=n.mul(r,t),c=n.mul(i,t),l=n.mul(a,t);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(l,n.ONE))throw Error(`invZ was invalid`);return{x:s,y:c}}),y=Ma(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.py))return;throw Error(`bad point: ZERO`)}let{x:r,y:i}=e.toAffine();if(!n.isValid(r)||!n.isValid(i))throw Error(`bad point: x or y not field elements`);if(!p(r,i))throw Error(`bad point: equation left != right`);if(!e.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`);return!0});function b(e,t,r,i,a){return r=new x(n.mul(r.px,e),r.py,r.pz),t=ao(i,t),r=ao(a,r),t.add(r)}class x{constructor(e,t,n){this.px=g(`x`,e),this.py=g(`y`,t,!0),this.pz=g(`z`,n),Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error(`invalid affine point`);if(e instanceof x)throw Error(`projective point not allowed`);return n.is0(t)&&n.is0(r)?x.ZERO:new x(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){return oo(x,`pz`,e)}static fromBytes(e){return cn(e),x.fromHex(e)}static fromHex(e){let t=x.fromAffine(d(wa(`pointHex`,e)));return t.assertValidity(),t}static fromPrivateKey(e){let n=Uo(r,t.allowedPrivateKeyLengths,t.wrapPrivateKey);return x.BASE.multiply(n(e))}static msm(e,t){return yo(x,r,e,t)}precompute(e=8,t=!0){return C.setWindowSize(this,e),t||this.multiply(Bo),this}_setWindowSize(e){this.precompute(e)}assertValidity(){y(this)}hasEvenY(){let{y:e}=this.toAffine();if(!n.isOdd)throw Error(`Field doesn't support isOdd`);return!n.isOdd(e)}equals(e){_(e);let{px:t,py:r,pz:i}=this,{px:a,py:o,pz:s}=e,c=n.eql(n.mul(t,s),n.mul(a,i)),l=n.eql(n.mul(r,s),n.mul(o,i));return c&&l}negate(){return new x(this.px,n.neg(this.py),this.pz)}double(){let{a:t,b:r}=e,i=n.mul(r,Bo),{px:a,py:o,pz:s}=this,c=n.ZERO,l=n.ZERO,u=n.ZERO,d=n.mul(a,a),f=n.mul(o,o),p=n.mul(s,s),m=n.mul(a,o);return m=n.add(m,m),u=n.mul(a,s),u=n.add(u,u),c=n.mul(t,u),l=n.mul(i,p),l=n.add(c,l),c=n.sub(f,l),l=n.add(f,l),l=n.mul(c,l),c=n.mul(m,c),u=n.mul(i,u),p=n.mul(t,p),m=n.sub(d,p),m=n.mul(t,m),m=n.add(m,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,p),d=n.mul(d,m),l=n.add(l,d),p=n.mul(o,s),p=n.add(p,p),d=n.mul(p,m),c=n.sub(c,d),u=n.mul(p,f),u=n.add(u,u),u=n.add(u,u),new x(c,l,u)}add(t){_(t);let{px:r,py:i,pz:a}=this,{px:o,py:s,pz:c}=t,l=n.ZERO,u=n.ZERO,d=n.ZERO,f=e.a,p=n.mul(e.b,Bo),m=n.mul(r,o),h=n.mul(i,s),g=n.mul(a,c),v=n.add(r,i),y=n.add(o,s);v=n.mul(v,y),y=n.add(m,h),v=n.sub(v,y),y=n.add(r,a);let b=n.add(o,c);return y=n.mul(y,b),b=n.add(m,g),y=n.sub(y,b),b=n.add(i,a),l=n.add(s,c),b=n.mul(b,l),l=n.add(h,g),b=n.sub(b,l),d=n.mul(f,y),l=n.mul(p,g),d=n.add(l,d),l=n.sub(h,d),d=n.add(h,d),u=n.mul(l,d),h=n.add(m,m),h=n.add(h,m),g=n.mul(f,g),y=n.mul(p,y),h=n.add(h,g),g=n.sub(m,g),g=n.mul(f,g),y=n.add(y,g),m=n.mul(h,y),u=n.add(u,m),m=n.mul(b,y),l=n.mul(v,l),l=n.sub(l,m),m=n.mul(v,h),d=n.mul(b,d),d=n.add(d,m),new x(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}multiply(e){let{endo:n}=t;if(!r.isValidNot0(e))throw Error(`invalid scalar: out of range`);let i,a,o=e=>C.wNAFCached(this,e,x.normalizeZ);if(n){let{k1neg:t,k1:r,k2neg:s,k2:c}=n.splitScalar(e),{p:l,f:u}=o(r),{p:d,f}=o(c);a=u.add(f),i=b(n.beta,l,d,t,s)}else{let{p:t,f:n}=o(e);i=t,a=n}return x.normalizeZ([i,a])[0]}multiplyUnsafe(e){let{endo:n}=t,i=this;if(!r.isValid(e))throw Error(`invalid scalar: out of range`);if(e===Lo||i.is0())return x.ZERO;if(e===Ro)return i;if(C.hasPrecomputes(this))return this.multiply(e);if(n){let{k1neg:t,k1:r,k2neg:a,k2:o}=n.splitScalar(e),{p1:s,p2:c}=vo(x,i,r,o);return b(n.beta,s,c,t,a)}else return C.wNAFCachedUnsafe(i,e)}multiplyAndAddUnsafe(e,t,n){let r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return v(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return i===Ro?!0:e?e(x,this):C.wNAFCachedUnsafe(this,a).is0()}clearCofactor(){let{clearCofactor:e}=t;return i===Ro?this:e?e(x,this):this.multiplyUnsafe(i)}toBytes(e=!0){return _a(`isCompressed`,e),this.assertValidity(),u(x,this,e)}toRawBytes(e=!0){return this.toBytes(e)}toHex(e=!0){return Cn(this.toBytes(e))}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}}x.BASE=new x(e.Gx,e.Gy,n.ONE),x.ZERO=new x(n.ZERO,n.ONE,n.ZERO),x.Fp=n,x.Fn=r;let S=r.BITS,C=_o(x,t.endo?Math.ceil(S/2):S);return x}function Go(e){return Uint8Array.of(e?2:3)}function Ko(e,t,n={}){ja(t,{hash:`function`},{hmac:`function`,lowS:`boolean`,randomBytes:`function`,bits2int:`function`,bits2int_modN:`function`});let r=t.randomBytes||Nn,i=t.hmac||((e,...n)=>ca(t.hash,e,kn(...n))),{Fp:a,Fn:o}=e,{ORDER:s,BITS:c}=o;function l(e){return e>s>>Ro}function u(e){return l(e)?o.neg(e):e}function d(e,t){if(!o.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..CURVE.n`)}class f{constructor(e,t,n){d(`r`,e),d(`s`,t),this.r=e,this.s=t,n!=null&&(this.recovery=n),Object.freeze(this)}static fromCompact(e){let t=o.BYTES,n=wa(`compactSignature`,e,t*2);return new f(o.fromBytes(n.subarray(0,t)),o.fromBytes(n.subarray(t,t*2)))}static fromDER(e){let{r:t,s:n}=Io.toSig(wa(`DER`,e));return new f(t,n)}assertValidity(){}addRecoveryBit(e){return new f(this.r,this.s,e)}recoverPublicKey(t){let n=a.ORDER,{r,s:i,recovery:c}=this;if(c==null||![0,1,2,3].includes(c))throw Error(`recovery id invalid`);if(s*zo<n&&c>1)throw Error(`recovery id is ambiguous for h>1 curve`);let l=c===2||c===3?r+s:r;if(!a.isValid(l))throw Error(`recovery id 2 or 3 invalid`);let u=a.toBytes(l),d=e.fromHex(kn(Go((c&1)==0),u)),f=o.inv(l),p=y(wa(`msgHash`,t)),m=o.create(-p*f),h=o.create(i*f),g=e.BASE.multiplyUnsafe(m).add(d.multiplyUnsafe(h));if(g.is0())throw Error(`point at infinify`);return g.assertValidity(),g}hasHighS(){return l(this.s)}normalizeS(){return this.hasHighS()?new f(this.r,o.neg(this.s),this.recovery):this}toBytes(e){if(e===`compact`)return kn(o.toBytes(this.r),o.toBytes(this.s));if(e===`der`)return En(Io.hexFromSig(this));throw Error(`invalid format`)}toDERRawBytes(){return this.toBytes(`der`)}toDERHex(){return Cn(this.toBytes(`der`))}toCompactRawBytes(){return this.toBytes(`compact`)}toCompactHex(){return Cn(this.toBytes(`compact`))}}let p=Uo(o,n.allowedPrivateKeyLengths,n.wrapPrivateKey),m={isValidPrivateKey(e){try{return p(e),!0}catch{return!1}},normPrivateKeyToScalar:p,randomPrivateKey:()=>{let e=s;return no(r(to(e)),e)},precompute(t=8,n=e.BASE){return n.precompute(t,!1)}};function h(t,n=!0){return e.fromPrivateKey(t).toBytes(n)}function g(t){if(typeof t==`bigint`)return!1;if(t instanceof e)return!0;let r=wa(`key`,t).length,i=a.BYTES,s=i+1,c=2*i+1;if(!(n.allowedPrivateKeyLengths||o.BYTES===s))return r===s||r===c}function _(t,n,r=!0){if(g(t)===!0)throw Error(`first arg must be private key`);if(g(n)===!1)throw Error(`second arg must be public key`);return e.fromHex(n).multiply(p(t)).toBytes(r)}let v=t.bits2int||function(e){if(e.length>8192)throw Error(`input is too large`);let t=ba(e),n=e.length*8-c;return n>0?t>>BigInt(n):t},y=t.bits2int_modN||function(e){return o.create(v(e))},b=ka(c);function x(e){return Da(`num < 2^`+c,e,Lo,b),o.toBytes(e)}function S(n,i,s=C){if([`recovered`,`canonical`].some(e=>e in s))throw Error(`sign() legacy options not supported`);let{hash:c}=t,{lowS:d,prehash:m,extraEntropy:h}=s;d??=!0,n=wa(`msgHash`,n),Fo(s),m&&(n=wa(`prehashed msgHash`,c(n)));let g=y(n),_=p(i),b=[x(_),x(g)];if(h!=null&&h!==!1){let e=h===!0?r(a.BYTES):h;b.push(wa(`extraEntropy`,e))}let S=kn(...b),w=g;function T(t){let n=v(t);if(!o.isValidNot0(n))return;let r=o.inv(n),i=e.BASE.multiply(n).toAffine(),a=o.create(i.x);if(a===Lo)return;let s=o.create(r*o.create(w+a*_));if(s===Lo)return;let c=(i.x===a?0:2)|Number(i.y&Ro),p=s;return d&&l(s)&&(p=u(s),c^=1),new f(a,p,c)}return{seed:S,k2sig:T}}let C={lowS:t.lowS,prehash:!1},w={lowS:t.lowS,prehash:!1};function T(e,n,r=C){let{seed:a,k2sig:s}=S(e,n,r);return Aa(t.hash.outputLen,o.BYTES,i)(a,s)}e.BASE.precompute(8);function E(n,r,i,a=w){let s=n;r=wa(`msgHash`,r),i=wa(`publicKey`,i),Fo(a);let{lowS:c,prehash:l,format:u}=a;if(`strict`in a)throw Error(`options.strict was renamed to lowS`);if(u!==void 0&&![`compact`,`der`,`js`].includes(u))throw Error(`format must be "compact", "der" or "js"`);let d=typeof s==`string`||on(s),p=!d&&!u&&typeof s==`object`&&!!s&&typeof s.r==`bigint`&&typeof s.s==`bigint`;if(!d&&!p)throw Error(`invalid signature, expected Uint8Array, hex string or Signature instance`);let m,h;try{if(p)if(u===void 0||u===`js`)m=new f(s.r,s.s);else throw Error(`invalid format`);if(d){try{u!==`compact`&&(m=f.fromDER(s))}catch(e){if(!(e instanceof Io.Err))throw e}!m&&u!==`der`&&(m=f.fromCompact(s))}h=e.fromHex(i)}catch{return!1}if(!m||c&&m.hasHighS())return!1;l&&(r=t.hash(r));let{r:g,s:_}=m,v=y(r),b=o.inv(_),x=o.create(v*b),S=o.create(g*b),C=e.BASE.multiplyUnsafe(x).add(h.multiplyUnsafe(S));return C.is0()?!1:o.create(C.x)===g}return Object.freeze({getPublicKey:h,getSharedSecret:_,sign:T,verify:E,utils:m,Point:e,Signature:f})}function qo(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy};return{CURVE:t,curveOpts:{Fp:e.Fp,Fn:$a(t.n,e.nBitLength),allowedPrivateKeyLengths:e.allowedPrivateKeyLengths,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,wrapPrivateKey:e.wrapPrivateKey,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function Jo(e){let{CURVE:t,curveOpts:n}=qo(e);return{CURVE:t,curveOpts:n,ecdsaOpts:{hash:e.hash,hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN}}}function Yo(e,t){return Object.assign({},t,{ProjectivePoint:t.Point,CURVE:e})}function Xo(e){let{CURVE:t,curveOpts:n,ecdsaOpts:r}=Jo(e);return Yo(e,Ko(Wo(t,n),r,n))}function Zo(e,t){let n=t=>Xo({...e,hash:t});return{...n(t),create:n}}var Qo={p:BigInt(`0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff`),n:BigInt(`0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551`),h:BigInt(1),a:BigInt(`0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc`),b:BigInt(`0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b`),Gx:BigInt(`0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296`),Gy:BigInt(`0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5`)},$o={p:BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff`),n:BigInt(`0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973`),h:BigInt(1),a:BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc`),b:BigInt(`0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef`),Gx:BigInt(`0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7`),Gy:BigInt(`0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f`)},es={p:BigInt(`0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),n:BigInt(`0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409`),h:BigInt(1),a:BigInt(`0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc`),b:BigInt(`0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00`),Gx:BigInt(`0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66`),Gy:BigInt(`0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650`)},ts=$a(Qo.p),ns=$a($o.p),rs=$a(es.p),is=Zo({...Qo,Fp:ts,lowS:!1},gr);Zo({...$o,Fp:ns,lowS:!1},vr),Zo({...es,Fp:rs,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},_r);var as=is,os=`base10`,ss=`base16`,cs=`base64pad`,ls=`base64url`,us=`utf8`,ds=0,fs=1,ps=12,ms=32;function hs(){let e=Po.utils.randomPrivateKey(),t=Po.getPublicKey(e);return{privateKey:ce(e,ss),publicKey:ce(t,ss)}}function gs(){return ce(Nn(ms),ss)}function _s(e,t){return ce(pa(ma,Po.getSharedSecret(oe(e,ss),oe(t,ss)),void 0,void 0,ms),ss)}function vs(e){return ce(ma(oe(e,ss)),ss)}function ys(e){return ce(ma(oe(e,us)),ss)}function bs(e){return oe(`${e}`,os)}function xs(e){return Number(ce(e,os))}function Ss(e){return e.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Cs(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4;return t+`=`.repeat(n)}function ws(e){let t=bs(typeof e.type<`u`?e.type:0);if(xs(t)===1&&typeof e.senderPublicKey>`u`)throw Error(`Missing sender public key for type 1 envelope`);let n=typeof e.senderPublicKey<`u`?oe(e.senderPublicKey,ss):void 0,r=typeof e.iv<`u`?oe(e.iv,ss):Nn(ps),i=Os({type:t,sealed:oa(oe(e.symKey,ss),r).encrypt(oe(e.message,us)),iv:r,senderPublicKey:n});return e.encoding===`base64url`?Ss(i):i}function Ts(e){let t=oe(e.symKey,ss),{sealed:n,iv:r}=ks({encoded:e.encoded,encoding:e.encoding}),i=oa(t,r).decrypt(n);if(i===null)throw Error(`Failed to decrypt`);return ce(i,us)}function Es(e,t){let n=bs(2),r=Nn(ps),i=Os({type:n,sealed:oe(e,us),iv:r});return t===`base64url`?Ss(i):i}function Ds(e,t){let{sealed:n}=ks({encoded:e,encoding:t});return ce(n,us)}function Os(e){if(xs(e.type)===2)return ce(se([e.type,e.sealed]),cs);if(xs(e.type)===1){if(typeof e.senderPublicKey>`u`)throw Error(`Missing sender public key for type 1 envelope`);return ce(se([e.type,e.senderPublicKey,e.iv,e.sealed]),cs)}return ce(se([e.type,e.iv,e.sealed]),cs)}function ks(e){let t=oe((e.encoding||`base64pad`)===`base64url`?Cs(e.encoded):e.encoded,cs),n=t.slice(ds,fs),r=fs;if(xs(n)===1){let e=t.slice(r,33),i=t.slice(33,45);return{type:n,sealed:t.slice(45),iv:i,senderPublicKey:e}}if(xs(n)===2)return{type:n,sealed:t.slice(r),iv:Nn(ps)};let i=t.slice(r,13);return{type:n,sealed:t.slice(13),iv:i}}function As(e,t){let n=ks({encoded:e,encoding:t?.encoding});return js({type:xs(n.type),senderPublicKey:typeof n.senderPublicKey<`u`?ce(n.senderPublicKey,ss):void 0,receiverPublicKey:t?.receiverPublicKey})}function js(e){let t=e?.type||0;if(t===1){if(typeof e?.senderPublicKey>`u`)throw Error(`missing sender public key`);if(typeof e?.receiverPublicKey>`u`)throw Error(`missing receiver public key`)}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function Ms(e){return e.type===1&&typeof e.senderPublicKey==`string`&&typeof e.receiverPublicKey==`string`}function Ns(e){return e.type===2}function Ps(e){let t=o.from(e.x,`base64`),n=o.from(e.y,`base64`);return se([new Uint8Array([4]),t,n])}function Fs(e,t){let[n,r,i]=e.split(`.`),a=o.from(Cs(i),`base64`);if(a.length!==64)throw Error(`Invalid signature length`);let s=a.slice(0,32),c=a.slice(32,64),l=ma(`${n}.${r}`),u=Ps(t);if(!as.verify(se([s,c]),l,u))throw Error(`Invalid signature`);return p(e).payload}function Is(e){return e?.relay||{protocol:`irn`}}function Ls(e){let t=_[e];if(typeof t>`u`)throw Error(`Relay Protocol not supported: ${e}`);return t}function Rs(e,t=`-`){let n={},r=`relay`+t;return Object.keys(e).forEach(t=>{if(t.startsWith(r)){let i=t.replace(r,``);n[i]=e[t]}}),n}function zs(e){if(!e.includes(`wc:`)){let t=Mt(e);t!=null&&t.includes(`wc:`)&&(e=t)}e=e.includes(`wc://`)?e.replace(`wc://`,``):e,e=e.includes(`wc:`)?e.replace(`wc:`,``):e;let t=e.indexOf(`:`),n=e.indexOf(`?`)===-1?void 0:e.indexOf(`?`),r=e.substring(0,t),i=e.substring(t+1,n).split(`@`),a=typeof n<`u`?e.substring(n):``,o=new URLSearchParams(a),s={};o.forEach((e,t)=>{s[t]=e});let c=typeof s.methods==`string`?s.methods.split(`,`):void 0;return{protocol:r,topic:Bs(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:Rs(s),methods:c,expiryTimestamp:s.expiryTimestamp?parseInt(s.expiryTimestamp,10):void 0}}function Bs(e){return e.startsWith(`//`)?e.substring(2):e}function Vs(e,t=`-`){let n={};return Object.keys(e).forEach(r=>{let i=r,a=`relay`+t+i;e[i]&&(n[a]=e[i])}),n}function Hs(e){let t=new URLSearchParams,n=Vs(e.relay);Object.keys(n).sort().forEach(e=>{t.set(e,n[e])}),t.set(`symKey`,e.symKey),e.expiryTimestamp&&t.set(`expiryTimestamp`,e.expiryTimestamp.toString()),e.methods&&t.set(`methods`,e.methods.join(`,`));let r=t.toString();return`${e.protocol}:${e.topic}@${e.version}?${r}`}function Us(e,t,n){return`${e}?wc_ev=${n}&topic=${t}`}var Ws=Object.defineProperty,Gs=Object.defineProperties,Ks=Object.getOwnPropertyDescriptors,qs=Object.getOwnPropertySymbols,Js=Object.prototype.hasOwnProperty,Ys=Object.prototype.propertyIsEnumerable,Xs=(e,t,n)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zs=(e,t)=>{for(var n in t||={})Js.call(t,n)&&Xs(e,n,t[n]);if(qs)for(var n of qs(t))Ys.call(t,n)&&Xs(e,n,t[n]);return e},Qs=(e,t)=>Gs(e,Ks(t));function $s(e){let t=[];return e.forEach(e=>{let[n,r]=e.split(`:`);t.push(`${n}:${r}`)}),t}function ec(e){let t=[];return Object.values(e).forEach(e=>{t.push(...$s(e.accounts))}),t}function tc(e,t){let n=[];return Object.values(e).forEach(e=>{$s(e.accounts).includes(t)&&n.push(...e.methods)}),n}function nc(e,t){let n=[];return Object.values(e).forEach(e=>{$s(e.accounts).includes(t)&&n.push(...e.events)}),n}function rc(e){return e.includes(`:`)}function ic(e){return rc(e)?e.split(`:`)[0]:e}function ac(e){let t={};if(!fc(e))return t;for(let[n,r]of Object.entries(e)){let e=rc(n)?[n]:r.chains,i=r.methods||[],a=r.events||[],o=ic(n);t[o]=Qs(Zs({},t[o]),{chains:xt(e,t[o]?.chains),methods:xt(i,t[o]?.methods),events:xt(a,t[o]?.events)})}return t}function oc(e){let t={};return e?.forEach(e=>{var n;let[r,i]=e.split(`:`);t[r]||(t[r]={accounts:[],chains:[],events:[],methods:[]}),t[r].accounts.push(e),(n=t[r].chains)==null||n.push(`${r}:${i}`)}),t}function sc(e,t){t=t.map(e=>e.replace(`did:pkh:`,``));let n=oc(t);for(let[t,r]of Object.entries(n))r.methods?r.methods=xt(r.methods,e):r.methods=e,r.events=[`chainChanged`,`accountsChanged`];return n}function cc(e,t){let n=ac(e),r=ac(t),i={},a=Object.keys(n).concat(Object.keys(r));for(let e of a)i[e]={chains:xt(n[e]?.chains,r[e]?.chains),methods:xt(n[e]?.methods,r[e]?.methods),events:xt(n[e]?.events,r[e]?.events)};return i}var lc={INVALID_METHOD:{message:`Invalid method.`,code:1001},INVALID_EVENT:{message:`Invalid event.`,code:1002},INVALID_UPDATE_REQUEST:{message:`Invalid update request.`,code:1003},INVALID_EXTEND_REQUEST:{message:`Invalid extend request.`,code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:`Invalid session settle request.`,code:1005},UNAUTHORIZED_METHOD:{message:`Unauthorized method.`,code:3001},UNAUTHORIZED_EVENT:{message:`Unauthorized event.`,code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:`Unauthorized update request.`,code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:`Unauthorized extend request.`,code:3004},USER_REJECTED:{message:`User rejected.`,code:5e3},USER_REJECTED_CHAINS:{message:`User rejected chains.`,code:5001},USER_REJECTED_METHODS:{message:`User rejected methods.`,code:5002},USER_REJECTED_EVENTS:{message:`User rejected events.`,code:5003},UNSUPPORTED_CHAINS:{message:`Unsupported chains.`,code:5100},UNSUPPORTED_METHODS:{message:`Unsupported methods.`,code:5101},UNSUPPORTED_EVENTS:{message:`Unsupported events.`,code:5102},UNSUPPORTED_ACCOUNTS:{message:`Unsupported accounts.`,code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:`Unsupported namespace key.`,code:5104},USER_DISCONNECTED:{message:`User disconnected.`,code:6e3},SESSION_SETTLEMENT_FAILED:{message:`Session settlement failed.`,code:7e3},WC_METHOD_UNSUPPORTED:{message:`Unsupported wc_ method.`,code:10001}},uc={NOT_INITIALIZED:{message:`Not initialized.`,code:1},NO_MATCHING_KEY:{message:`No matching key.`,code:2},RESTORE_WILL_OVERRIDE:{message:`Restore will override.`,code:3},RESUBSCRIBED:{message:`Resubscribed.`,code:4},MISSING_OR_INVALID:{message:`Missing or invalid.`,code:5},EXPIRED:{message:`Expired.`,code:6},UNKNOWN_TYPE:{message:`Unknown type.`,code:7},MISMATCHED_TOPIC:{message:`Mismatched topic.`,code:8},NON_CONFORMING_NAMESPACES:{message:`Non conforming namespaces.`,code:9}};function U(e,t){let{message:n,code:r}=uc[e];return{message:t?`${n} ${t}`:n,code:r}}function W(e,t){let{message:n,code:r}=lc[e];return{message:t?`${n} ${t}`:n,code:r}}function dc(e,t){return Array.isArray(e)?typeof t<`u`&&e.length?e.every(t):!0:!1}function fc(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function pc(e){return typeof e>`u`}function mc(e,t){return t&&pc(e)?!0:typeof e==`string`&&!!e.trim().length}function hc(e,t){return t&&pc(e)?!0:typeof e==`number`&&!isNaN(e)}function gc(e,t){let{requiredNamespaces:n}=t,r=Object.keys(e.namespaces),i=Object.keys(n),a=!0;return ut(i,r)?(r.forEach(t=>{let{accounts:r,methods:i,events:o}=e.namespaces[t],s=$s(r),c=n[t];(!ut(Re(t,c),s)||!ut(c.methods,i)||!ut(c.events,o))&&(a=!1)}),a):!1}function _c(e){return mc(e,!1)&&e.includes(`:`)?e.split(`:`).length===2:!1}function vc(e){if(mc(e,!1)&&e.includes(`:`)){let t=e.split(`:`);if(t.length===3){let e=t[0]+`:`+t[1];return!!t[2]&&_c(e)}}return!1}function yc(e){function t(e){try{return typeof new URL(e)<`u`}catch{return!1}}try{if(mc(e,!1))return t(e)?!0:t(Mt(e))}catch{}return!1}function bc(e){return e?.proposer?.publicKey}function xc(e){return e?.topic}function Sc(e,t){let n=null;return mc(e?.publicKey,!1)||(n=U(`MISSING_OR_INVALID`,`${t} controller public key should be a string`)),n}function Cc(e){let t=!0;return dc(e)?e.length&&(t=e.every(e=>mc(e,!1))):t=!1,t}function wc(e,t,n){let r=null;return dc(t)&&t.length?t.forEach(e=>{r||_c(e)||(r=W(`UNSUPPORTED_CHAINS`,`${n}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):_c(e)||(r=W(`UNSUPPORTED_CHAINS`,`${n}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),r}function Tc(e,t,n){let r=null;return Object.entries(e).forEach(([e,i])=>{if(r)return;let a=wc(e,Re(e,i),`${t} ${n}`);a&&(r=a)}),r}function Ec(e,t){let n=null;return dc(e)?e.forEach(e=>{n||vc(e)||(n=W(`UNSUPPORTED_ACCOUNTS`,`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):n=W(`UNSUPPORTED_ACCOUNTS`,`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),n}function Dc(e,t){let n=null;return Object.values(e).forEach(e=>{if(n)return;let r=Ec(e?.accounts,`${t} namespace`);r&&(n=r)}),n}function Oc(e,t){let n=null;return Cc(e?.methods)?Cc(e?.events)||(n=W(`UNSUPPORTED_EVENTS`,`${t}, events should be an array of strings or empty array for no events`)):n=W(`UNSUPPORTED_METHODS`,`${t}, methods should be an array of strings or empty array for no methods`),n}function kc(e,t){let n=null;return Object.values(e).forEach(e=>{if(n)return;let r=Oc(e,`${t}, namespace`);r&&(n=r)}),n}function Ac(e,t,n){let r=null;if(e&&fc(e)){let i=kc(e,t);i&&(r=i);let a=Tc(e,t,n);a&&(r=a)}else r=U(`MISSING_OR_INVALID`,`${t}, ${n} should be an object with data`);return r}function jc(e,t){let n=null;if(e&&fc(e)){let r=kc(e,t);r&&(n=r);let i=Dc(e,t);i&&(n=i)}else n=U(`MISSING_OR_INVALID`,`${t}, namespaces should be an object with data`);return n}function Mc(e){return mc(e.protocol,!0)}function Nc(e,t){let n=!1;return t&&!e?n=!0:e&&dc(e)&&e.length&&e.forEach(e=>{n=Mc(e)}),n}function Pc(e){return typeof e==`number`}function Fc(e){return typeof e<`u`&&!0}function Ic(e){return!(!e||typeof e!=`object`||!e.code||!hc(e.code,!1)||!e.message||!mc(e.message,!1))}function Lc(e){return!(pc(e)||!mc(e.method,!1))}function Rc(e){return!(pc(e)||pc(e.result)&&pc(e.error)||!hc(e.id,!1)||!mc(e.jsonrpc,!1))}function zc(e){return!(pc(e)||!mc(e.name,!1))}function Bc(e,t){return!(!_c(t)||!ec(e).includes(t))}function Vc(e,t,n){return mc(n,!1)?tc(e,t).includes(n):!1}function Hc(e,t,n){return mc(n,!1)?nc(e,t).includes(n):!1}function Uc(e,t,n){let r=null,i=Wc(e),a=Kc(t),o=Object.keys(i),s=Object.keys(a),c=Gc(Object.keys(e)),l=Gc(Object.keys(t)),u=c.filter(e=>!l.includes(e));return u.length&&(r=U(`NON_CONFORMING_NAMESPACES`,`${n} namespaces keys don't satisfy requiredNamespaces.
|